<script>
    function toggleVisibility() {
        const licenseField = document.getElementById('licenseKey');
        if (licenseField.type === 'password') {
            licenseField.type = 'text';
        } else {
            licenseField.type = 'password';
        }
    }

    function copyAndRefresh(license) {
        navigator.clipboard.writeText(license).then(function() {
            alert('License key copied to clipboard!');
            window.location.reload();
        }, function(err) {
            alert('Failed to copy license key: ' + err);
        });
    }
</script>