125 lines
9.0 KiB
PHP
Executable File
125 lines
9.0 KiB
PHP
Executable File
<?php # [BlazeFolded]:{flux::text}:{/Users/mag/Sites/WMS/Concepts/WMS_Core/vendor/livewire/flux/src/../stubs/resources/views/flux/text.blade.php}:{1776985208} ?>
|
|
<?php # [BlazeFolded]:{flux::button}:{/Users/mag/Sites/WMS/Concepts/WMS_Core/vendor/livewire/flux/src/../stubs/resources/views/flux/button/index.blade.php}:{1776985208} ?>
|
|
<?php # [BlazeFolded]:{flux::text}:{/Users/mag/Sites/WMS/Concepts/WMS_Core/vendor/livewire/flux/src/../stubs/resources/views/flux/text.blade.php}:{1776985208} ?>
|
|
<?php # [BlazeFolded]:{flux::button}:{/Users/mag/Sites/WMS/Concepts/WMS_Core/vendor/livewire/flux/src/../stubs/resources/views/flux/button/index.blade.php}:{1776985208} ?>
|
|
<?php # [BlazeFolded]:{flux::button}:{/Users/mag/Sites/WMS/Concepts/WMS_Core/vendor/livewire/flux/src/../stubs/resources/views/flux/button/index.blade.php}:{1776985208} ?>
|
|
<?php
|
|
$__assetKey = '2986292017-0';
|
|
|
|
ob_start();
|
|
?>
|
|
<?php echo app('Illuminate\Foundation\Vite')('resources/js/passkeys.js'); ?>
|
|
<?php
|
|
$__output = ob_get_clean();
|
|
|
|
// If the asset has already been loaded anywhere during this request, skip it...
|
|
if (in_array($__assetKey, \Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys)) {
|
|
// Skip it...
|
|
} else {
|
|
\Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$alreadyRunAssetKeys[] = $__assetKey;
|
|
|
|
// Check if we're in a Livewire component or not and store the asset accordingly...
|
|
if (isset($this)) {
|
|
\Livewire\store($this)->push('assets', $__output, $__assetKey);
|
|
} else {
|
|
\Livewire\Features\SupportScriptsAndAssets\SupportScriptsAndAssets::$nonLivewireAssets[$__assetKey] = $__output;
|
|
}
|
|
}
|
|
?>
|
|
|
|
<div
|
|
x-data="{
|
|
supported: false,
|
|
showForm: false,
|
|
name: '',
|
|
loading: false,
|
|
error: null,
|
|
updateSupport() {
|
|
this.supported = Boolean(window.Passkeys?.isSupported());
|
|
},
|
|
init() {
|
|
this.updateSupport();
|
|
|
|
window.addEventListener('passkeys:ready', () => this.updateSupport(), { once: true });
|
|
},
|
|
async register() {
|
|
if (!this.name.trim()) return;
|
|
|
|
this.loading = true;
|
|
this.error = null;
|
|
|
|
try {
|
|
await window.Passkeys.register({ name: this.name });
|
|
this.name = '';
|
|
this.showForm = false;
|
|
await $wire.loadPasskeys();
|
|
} catch (e) {
|
|
if (e.constructor?.name !== 'UserCancelledError') {
|
|
this.error = e.message;
|
|
}
|
|
} finally {
|
|
this.loading = false;
|
|
}
|
|
},
|
|
cancel() {
|
|
this.showForm = false;
|
|
this.name = '';
|
|
this.error = null;
|
|
},
|
|
}"
|
|
>
|
|
<template x-if="!supported">
|
|
<?php ob_start(); ?><p class="[:where(&)]:font-normal [:where(&)]:text-sm [:where(&)]:text-zinc-500 [:where(&)]:dark:text-white/70" data-flux-text ><?php ob_start(); ?><?php echo e(__('Passkeys are not supported in this browser.')); ?><?php echo trim(ob_get_clean()); ?></p><?php echo ltrim(ob_get_clean()); ?>
|
|
</template>
|
|
|
|
<template x-if="supported && !showForm">
|
|
<div>
|
|
<?php ob_start(); ?><button type="button" class="relative items-center font-medium justify-center gap-2 whitespace-nowrap disabled:opacity-75 dark:disabled:opacity-75 disabled:cursor-default disabled:pointer-events-none justify-center h-10 text-sm rounded-lg ps-3 pe-4 inline-flex bg-[var(--color-accent)] hover:bg-[color-mix(in_oklab,_var(--color-accent),_transparent_10%)] text-[var(--color-accent-foreground)] border border-black/10 dark:border-0 shadow-[inset_0px_1px_--theme(--color-white/.2)] [[data-flux-button-group]_&]:border-e-0 [:is([data-flux-button-group]>&:last-child,_[data-flux-button-group]_:last-child>&)]:border-e-[1px] dark:[:is([data-flux-button-group]>&:last-child,_[data-flux-button-group]_:last-child>&)]:border-e-0 dark:[:is([data-flux-button-group]>&:last-child,_[data-flux-button-group]_:last-child>&)]:border-s-[1px] [:is([data-flux-button-group]>&:not(:first-child),_[data-flux-button-group]_:not(:first-child)>&)]:border-s-[color-mix(in_srgb,var(--color-accent-foreground),transparent_85%)]" data-flux-button="data-flux-button" data-flux-group-target="data-flux-group-target" x-on:click="showForm = true">
|
|
<svg class="shrink-0 [:where(&)]:size-4" data-flux-icon xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" data-slot="icon">
|
|
<path d="M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z"/>
|
|
</svg>
|
|
|
|
|
|
|
|
|
|
<span><?php ob_start(); ?>
|
|
<?php echo e(__('Add passkey')); ?>
|
|
|
|
<?php echo trim(ob_get_clean()); ?></span>
|
|
</button>
|
|
<?php echo ltrim(ob_get_clean()); ?>
|
|
</div>
|
|
</template>
|
|
|
|
<template x-if="supported && showForm">
|
|
<div class="space-y-4 rounded-lg border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800/50 p-4">
|
|
<?php $__blaze->ensureRequired('/Users/mag/Sites/WMS/Concepts/WMS_Core/vendor/livewire/flux/src/../stubs/resources/views/flux/input/index.blade.php', $__blaze->compiledPath.'/e9fe329cbd986d5723d2692e449cddae.php'); ?>
|
|
<?php $__blaze->pushData(['label' => e(__('Passkey name')),'xModel' => 'name','placeholder' => e(__('e.g., MacBook Pro, iPhone')),'xOn:keydown.enter.prevent' => 'register()','xRef' => 'passkeyNameInput','xInit' => '$nextTick(() => $refs.passkeyNameInput?.focus())']); ?>
|
|
<?php _e9fe329cbd986d5723d2692e449cddae($__blaze, ['label' => e(__('Passkey name')),'xModel' => 'name','placeholder' => e(__('e.g., MacBook Pro, iPhone')),'xOn:keydown.enter.prevent' => 'register()','xRef' => 'passkeyNameInput','xInit' => '$nextTick(() => $refs.passkeyNameInput?.focus())'], [], [], ['xModel' => 'x-model', 'xOn:keydown.enter.prevent' => 'x-on:keydown.enter.prevent', 'xRef' => 'x-ref', 'xInit' => 'x-init'], $__this ?? (isset($this) ? $this : null)); ?>
|
|
<?php $__blaze->popData(); ?>
|
|
<?php ob_start(); ?><p class="[:where(&)]:font-normal [:where(&)]:text-sm [:where(&)]:text-zinc-500 [:where(&)]:dark:text-white/70 !mt-1" data-flux-text ><?php ob_start(); ?><?php echo e(__('Give this passkey a name to help you identify it later.')); ?><?php echo trim(ob_get_clean()); ?></p><?php echo ltrim(ob_get_clean()); ?>
|
|
|
|
<p x-show="error" x-text="error" x-cloak class="text-sm text-red-600 dark:text-red-400"></p>
|
|
|
|
<div class="flex gap-2">
|
|
<?php ob_start(); ?><button type="button" class="relative items-center font-medium justify-center gap-2 whitespace-nowrap disabled:opacity-75 dark:disabled:opacity-75 disabled:cursor-default disabled:pointer-events-none justify-center h-10 text-sm rounded-lg ps-4 pe-4 inline-flex bg-[var(--color-accent)] hover:bg-[color-mix(in_oklab,_var(--color-accent),_transparent_10%)] text-[var(--color-accent-foreground)] border border-black/10 dark:border-0 shadow-[inset_0px_1px_--theme(--color-white/.2)] [[data-flux-button-group]_&]:border-e-0 [:is([data-flux-button-group]>&:last-child,_[data-flux-button-group]_:last-child>&)]:border-e-[1px] dark:[:is([data-flux-button-group]>&:last-child,_[data-flux-button-group]_:last-child>&)]:border-e-0 dark:[:is([data-flux-button-group]>&:last-child,_[data-flux-button-group]_:last-child>&)]:border-s-[1px] [:is([data-flux-button-group]>&:not(:first-child),_[data-flux-button-group]_:not(:first-child)>&)]:border-s-[color-mix(in_srgb,var(--color-accent-foreground),transparent_85%)]" data-flux-button="data-flux-button" data-flux-group-target="data-flux-group-target" x-on:click="register()" x-bind:disabled="loading || !name.trim()">
|
|
<?php ob_start(); ?>
|
|
<span x-show="!loading"><?php echo e(__('Register passkey')); ?></span>
|
|
<span x-show="loading" x-cloak><?php echo e(__('Registering...')); ?></span>
|
|
<?php echo trim(ob_get_clean()); ?>
|
|
|
|
</button>
|
|
<?php echo ltrim(ob_get_clean()); ?>
|
|
<?php ob_start(); ?><button type="button" class="relative items-center font-medium justify-center gap-2 whitespace-nowrap disabled:opacity-75 dark:disabled:opacity-75 disabled:cursor-default disabled:pointer-events-none justify-center h-10 text-sm rounded-lg ps-4 pe-4 inline-flex bg-transparent hover:bg-zinc-800/5 dark:hover:bg-white/15 text-zinc-800 dark:text-white" data-flux-button="data-flux-button" x-on:click="cancel()">
|
|
<?php ob_start(); ?>
|
|
<?php echo e(__('Cancel')); ?>
|
|
|
|
<?php echo trim(ob_get_clean()); ?>
|
|
|
|
</button>
|
|
<?php echo ltrim(ob_get_clean()); ?>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</div>
|
|
<?php /**PATH /Users/mag/Sites/WMS/Concepts/WMS_Core/resources/views/components/passkey-registration.blade.php ENDPATH**/ ?>
|