From 7965b34c85ed9210382bdf562f8afcf9a124ccc9 Mon Sep 17 00:00:00 2001 From: debesocial Date: Thu, 21 May 2026 22:15:53 +0700 Subject: [PATCH] security: expand and complete permissions matrix with granular, enterprise-ready permissions --- .../Controllers/ActivityLogController.php | 4 +- .../Controllers/NotificationController.php | 4 +- app/Http/Controllers/RoleController.php | 4 +- .../Controllers/SystemSettingController.php | 6 +- app/Http/Controllers/UserController.php | 6 +- app/Policies/UserPolicy.php | 4 +- .../seeders/RolesAndPermissionsSeeder.php | 44 ++++- ...-Hp.js => AuthenticatedLayout-C8h2HS7D.js} | 2 +- .../{Can-DkptxH2j.js => Can-bASqMhyx.js} | 2 +- ...enge-BcvFwzFZ.js => Challenge-fTLTkT9A.js} | 2 +- ...BNbpA9Y.js => ConfirmPassword-aqHWSvyY.js} | 2 +- ...oard-BWFrXJia.js => Dashboard-CpVakWgQ.js} | 2 +- ...DSLo5Ybm.js => DeleteUserForm-Bh5dZDoZ.js} | 2 +- .../{Edit-CqP9KoA8.js => Edit-DhcQ-LdT.js} | 2 +- .../{Error-CmUynFQU.js => Error-BoVeZyza.js} | 2 +- ...BGsGiFYN.js => ForgotPassword-C_3dBdrE.js} | 2 +- ...ut-CgPUg7Kz.js => GuestLayout-DfP8Xy7D.js} | 2 +- .../{Index-DQODC9UE.js => Index-B7Zsmvlf.js} | 2 +- .../{Index-DcNFR6n1.js => Index-Bi9DKRMK.js} | 2 +- .../{Index-Cx7Ouq_R.js => Index-BzmzPZNr.js} | 2 +- .../{Index-BYUmRpDS.js => Index-DUo87EQf.js} | 2 +- .../{Index-DFR_vfBx.js => Index-DaQeOcsk.js} | 2 +- .../{Index-nOX76BwE.js => Index-ezavejt9.js} | 2 +- .../{Index-db0jqw8f.js => Index-v8jEWebY.js} | 2 +- .../{Login-qxXrNDeD.js => Login-DtnGAKBx.js} | 2 +- ...{Portal-C0c8udmH.js => Portal-B40Voc8b.js} | 2 +- ...-2i3vnLMz.js => PrimaryButton-C1Df3FyG.js} | 2 +- ...ister-B7hpuNim.js => Register-DYiZg_h7.js} | 2 +- ...-Cp8_si20.js => ResetPassword-CIvssuDm.js} | 2 +- .../{Setup-D7-GiQxF.js => Setup-BG3giU65.js} | 2 +- .../{Show-BhGooyPq.js => Show-BOefHxwU.js} | 2 +- ...nput-BnQizTbW.js => TextInput-BGMhFr2s.js} | 2 +- ...uw4Q.js => UpdatePasswordForm-Co29OuF0.js} | 2 +- ... UpdateProfileInformationForm-4t1_h1jU.js} | 2 +- ...il-BkreAOfA.js => VerifyEmail-DvY7W-s2.js} | 2 +- ...elcome-B4dAuF6T.js => Welcome-Cd22q1re.js} | 2 +- .../{Xxx-j7qS3EYb.js => Xxx-nngAMS4M.js} | 2 +- .../{app-BK5KCPMc.js => app-C2kGDHB9.js} | 4 +- ...ond-plugin-file-validate-type-DOUFAaeW.js} | 2 +- ...{lodash-BXsCgLz3.js => lodash-BdNO5KR4.js} | 2 +- .../{swal-D8hRpOIh.js => swal-DeDNECCu.js} | 2 +- public/build/manifest.json | 166 +++++++++--------- resources/js/Layouts/components/Sidebar.tsx | 10 +- routes/web.php | 6 +- 44 files changed, 179 insertions(+), 145 deletions(-) rename public/build/assets/{AuthenticatedLayout-BjuyW-Hp.js => AuthenticatedLayout-C8h2HS7D.js} (72%) rename public/build/assets/{Can-DkptxH2j.js => Can-bASqMhyx.js} (77%) rename public/build/assets/{Challenge-BcvFwzFZ.js => Challenge-fTLTkT9A.js} (96%) rename public/build/assets/{ConfirmPassword-DBNbpA9Y.js => ConfirmPassword-aqHWSvyY.js} (94%) rename public/build/assets/{Dashboard-BWFrXJia.js => Dashboard-CpVakWgQ.js} (99%) rename public/build/assets/{DeleteUserForm-DSLo5Ybm.js => DeleteUserForm-Bh5dZDoZ.js} (99%) rename public/build/assets/{Edit-CqP9KoA8.js => Edit-DhcQ-LdT.js} (97%) rename public/build/assets/{Error-CmUynFQU.js => Error-BoVeZyza.js} (97%) rename public/build/assets/{ForgotPassword-BGsGiFYN.js => ForgotPassword-C_3dBdrE.js} (94%) rename public/build/assets/{GuestLayout-CgPUg7Kz.js => GuestLayout-DfP8Xy7D.js} (98%) rename public/build/assets/{Index-DQODC9UE.js => Index-B7Zsmvlf.js} (97%) rename public/build/assets/{Index-DcNFR6n1.js => Index-Bi9DKRMK.js} (97%) rename public/build/assets/{Index-Cx7Ouq_R.js => Index-BzmzPZNr.js} (98%) rename public/build/assets/{Index-BYUmRpDS.js => Index-DUo87EQf.js} (99%) rename public/build/assets/{Index-DFR_vfBx.js => Index-DaQeOcsk.js} (96%) rename public/build/assets/{Index-nOX76BwE.js => Index-ezavejt9.js} (98%) rename public/build/assets/{Index-db0jqw8f.js => Index-v8jEWebY.js} (98%) rename public/build/assets/{Login-qxXrNDeD.js => Login-DtnGAKBx.js} (98%) rename public/build/assets/{Portal-C0c8udmH.js => Portal-B40Voc8b.js} (54%) rename public/build/assets/{PrimaryButton-2i3vnLMz.js => PrimaryButton-C1Df3FyG.js} (87%) rename public/build/assets/{Register-B7hpuNim.js => Register-DYiZg_h7.js} (98%) rename public/build/assets/{ResetPassword-Cp8_si20.js => ResetPassword-CIvssuDm.js} (95%) rename public/build/assets/{Setup-D7-GiQxF.js => Setup-BG3giU65.js} (97%) rename public/build/assets/{Show-BhGooyPq.js => Show-BOefHxwU.js} (98%) rename public/build/assets/{TextInput-BnQizTbW.js => TextInput-BGMhFr2s.js} (99%) rename public/build/assets/{UpdatePasswordForm-CoUiuw4Q.js => UpdatePasswordForm-Co29OuF0.js} (91%) rename public/build/assets/{UpdateProfileInformationForm-DPfGMj-q.js => UpdateProfileInformationForm-4t1_h1jU.js} (91%) rename public/build/assets/{VerifyEmail-BkreAOfA.js => VerifyEmail-DvY7W-s2.js} (94%) rename public/build/assets/{Welcome-B4dAuF6T.js => Welcome-Cd22q1re.js} (99%) rename public/build/assets/{Xxx-j7qS3EYb.js => Xxx-nngAMS4M.js} (87%) rename public/build/assets/{app-BK5KCPMc.js => app-C2kGDHB9.js} (99%) rename public/build/assets/{filepond-plugin-file-validate-type-tybTRj_0.js => filepond-plugin-file-validate-type-DOUFAaeW.js} (99%) rename public/build/assets/{lodash-BXsCgLz3.js => lodash-BdNO5KR4.js} (99%) rename public/build/assets/{swal-D8hRpOIh.js => swal-DeDNECCu.js} (99%) diff --git a/app/Http/Controllers/ActivityLogController.php b/app/Http/Controllers/ActivityLogController.php index 97cd0f9..c1f60a3 100644 --- a/app/Http/Controllers/ActivityLogController.php +++ b/app/Http/Controllers/ActivityLogController.php @@ -10,7 +10,7 @@ class ActivityLogController extends Controller { public function index(Request $request) { - $this->authorize('user.view'); + abort_if(!auth()->user()->can('activity-logs.view'), 403, 'Unauthorized. Activity logs view permission required.'); $search = $request->input('search'); $logName = $request->input('log_name'); @@ -58,7 +58,7 @@ class ActivityLogController extends Controller public function bulkDelete(Request $request) { - $this->authorize('user.delete'); + abort_if(!auth()->user()->can('activity-logs.delete'), 403, 'Unauthorized. Activity logs delete permission required.'); $ids = (array) $request->input('ids', []); diff --git a/app/Http/Controllers/NotificationController.php b/app/Http/Controllers/NotificationController.php index db1c3d2..a491b76 100644 --- a/app/Http/Controllers/NotificationController.php +++ b/app/Http/Controllers/NotificationController.php @@ -12,7 +12,7 @@ class NotificationController extends Controller { public function index(Request $request) { - abort_if(!auth()->user()->can('role.manage'), 403, 'Unauthorized. Role management permission required.'); + abort_if(!auth()->user()->can('notifications.view'), 403, 'Unauthorized. Notification view permission required.'); $logs = NotificationLog::with(['targetUser', 'sender']) ->latest() @@ -39,7 +39,7 @@ class NotificationController extends Controller public function store(Request $request) { - abort_if(!auth()->user()->can('role.manage'), 403, 'Unauthorized. Role management permission required.'); + abort_if(!auth()->user()->can('notifications.send'), 403, 'Unauthorized. Notification send permission required.'); $validated = $request->validate([ 'title' => 'required|string|max:255', diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php index 95522ac..d030d5e 100644 --- a/app/Http/Controllers/RoleController.php +++ b/app/Http/Controllers/RoleController.php @@ -68,7 +68,7 @@ class RoleController extends Controller */ public function store(Request $request) { - abort_if(!auth()->user()->can('role.manage'), 403, 'Unauthorized. Role management permission required.'); + abort_if(!auth()->user()->can('role.create'), 403, 'Unauthorized. Role creation permission required.'); $validated = $request->validate([ 'name' => 'required|string|max:50|unique:roles,name', @@ -87,7 +87,7 @@ class RoleController extends Controller */ public function destroy(Role $role) { - abort_if(!auth()->user()->can('role.manage'), 403, 'Unauthorized. Role management permission required.'); + abort_if(!auth()->user()->can('role.delete'), 403, 'Unauthorized. Role deletion permission required.'); if ($role->name === 'super-admin') { return back()->withErrors(['error' => 'Cannot delete the super-admin role.']); diff --git a/app/Http/Controllers/SystemSettingController.php b/app/Http/Controllers/SystemSettingController.php index 4ad07ed..fe58d94 100644 --- a/app/Http/Controllers/SystemSettingController.php +++ b/app/Http/Controllers/SystemSettingController.php @@ -15,7 +15,7 @@ class SystemSettingController extends Controller */ public function index() { - abort_if(!auth()->user()->hasRole('super-admin') && !auth()->user()->can('settings.manage'), 403, 'Unauthorized. Settings management permission required.'); + abort_if(!auth()->user()->hasRole('super-admin') && !auth()->user()->can('settings.view'), 403, 'Unauthorized. Settings view permission required.'); $settings = Setting::all()->pluck('value', 'key'); @@ -73,7 +73,7 @@ class SystemSettingController extends Controller */ public function update(Request $request) { - abort_if(!auth()->user()->hasRole('super-admin') && !auth()->user()->can('settings.manage'), 403, 'Unauthorized. Settings management permission required.'); + abort_if(!auth()->user()->hasRole('super-admin') && !auth()->user()->can('settings.edit'), 403, 'Unauthorized. Settings edit permission required.'); $validated = $request->validate([ 'settings' => 'required|array', @@ -140,7 +140,7 @@ class SystemSettingController extends Controller */ public function testEmail(Request $request) { - abort_if(!auth()->user()->hasRole('super-admin') && !auth()->user()->can('settings.manage'), 403, 'Unauthorized. Settings management permission required.'); + abort_if(!auth()->user()->hasRole('super-admin') && !auth()->user()->can('settings.test-email'), 403, 'Unauthorized. SMTP testing permission required.'); $request->validate([ 'recipient' => 'required|email', diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 5e42ba0..cf150fe 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -181,7 +181,7 @@ class UserController extends Controller public function bulkArchive(Request $request) { - $this->authorize('user.delete'); + abort_if(!auth()->user()->can('user.delete'), 403, 'Unauthorized. User delete permission required.'); $ids = array_filter( (array) $request->input('ids', []), @@ -195,7 +195,7 @@ class UserController extends Controller public function bulkRestore(Request $request) { - $this->authorize('user.delete'); + abort_if(!auth()->user()->can('user.restore'), 403, 'Unauthorized. User restore permission required.'); $ids = (array) $request->input('ids', []); @@ -206,7 +206,7 @@ class UserController extends Controller public function bulkForceDelete(Request $request) { - $this->authorize('user.delete'); + abort_if(!auth()->user()->can('user.force-delete'), 403, 'Unauthorized. User permanent deletion permission required.'); $ids = array_filter( (array) $request->input('ids', []), diff --git a/app/Policies/UserPolicy.php b/app/Policies/UserPolicy.php index 11bbf48..09af2a9 100644 --- a/app/Policies/UserPolicy.php +++ b/app/Policies/UserPolicy.php @@ -33,11 +33,11 @@ class UserPolicy public function restore(User $authUser, User $user): bool { - return $authUser->hasPermissionTo('user.delete'); + return $authUser->hasPermissionTo('user.restore'); } public function forceDelete(User $authUser, User $user): bool { - return $authUser->hasPermissionTo('user.delete') && $authUser->id !== $user->id; + return $authUser->hasPermissionTo('user.force-delete') && $authUser->id !== $user->id; } } diff --git a/database/seeders/RolesAndPermissionsSeeder.php b/database/seeders/RolesAndPermissionsSeeder.php index 3477994..087d6ff 100644 --- a/database/seeders/RolesAndPermissionsSeeder.php +++ b/database/seeders/RolesAndPermissionsSeeder.php @@ -14,13 +14,37 @@ class RolesAndPermissionsSeeder extends Seeder app()[PermissionRegistrar::class]->forgetCachedPermissions(); $permissions = [ + // User Management 'user.view', 'user.create', 'user.edit', 'user.delete', + 'user.restore', + 'user.force-delete', + 'user.export', + 'user.import', + + // Role Management 'role.view', + 'role.create', + 'role.delete', 'role.manage', - 'settings.manage', + + // Notification broadcast + 'notifications.view', + 'notifications.send', + + // Activity Logs + 'activity-logs.view', + 'activity-logs.delete', + + // System Settings + 'settings.view', + 'settings.edit', + 'settings.test-email', + + // Internal Documentation + 'documentation.view', ]; foreach ($permissions as $permission) { @@ -28,22 +52,32 @@ class RolesAndPermissionsSeeder extends Seeder Permission::firstOrCreate(['name' => $permission, 'guard_name' => 'api']); } - // user — read-only access + // user — read-only basic access $user = Role::firstOrCreate(['name' => 'user', 'guard_name' => 'web']); - $user->syncPermissions(['user.view']); + $user->syncPermissions([ + 'user.view', + ]); - // admin — full user & role management, no system settings + // admin — full operational, governance, and reporting access, no raw system configuration $admin = Role::firstOrCreate(['name' => 'admin', 'guard_name' => 'web']); $admin->syncPermissions([ 'user.view', 'user.create', 'user.edit', 'user.delete', + 'user.restore', + 'user.export', + 'user.import', 'role.view', + 'role.create', + 'role.delete', 'role.manage', + 'notifications.view', + 'notifications.send', + 'activity-logs.view', ]); - // super-admin — everything (Gate::before bypasses checks anyway) + // super-admin — absolute root access $superAdmin = Role::firstOrCreate(['name' => 'super-admin', 'guard_name' => 'web']); $superAdmin->syncPermissions(Permission::where('guard_name', 'web')->get()); } diff --git a/public/build/assets/AuthenticatedLayout-BjuyW-Hp.js b/public/build/assets/AuthenticatedLayout-C8h2HS7D.js similarity index 72% rename from public/build/assets/AuthenticatedLayout-BjuyW-Hp.js rename to public/build/assets/AuthenticatedLayout-C8h2HS7D.js index e46a13f..8e44ff8 100644 --- a/public/build/assets/AuthenticatedLayout-BjuyW-Hp.js +++ b/public/build/assets/AuthenticatedLayout-C8h2HS7D.js @@ -1,4 +1,4 @@ -import{c as e,d as t,i as n,o as r,r as i,t as a}from"./app-BK5KCPMc.js";var o=t(e(),1),s=a();function c({theme:e}){let{auth:t}=r().props,{user:n,permissions:a}=t,o=window.location.pathname,c=e=>e?a.includes(e):!0,l=`${n.first_name?.charAt(0)||``}${n.last_name?.charAt(0)||``}`.toUpperCase(),u=[{label:`Governance`,items:[{href:`/dashboard`,label:`Dashboard`,ability:null,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6`})})},{href:`/notifications`,label:`Notifications`,ability:`role.manage`,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9`})})}]},{label:`Management`,items:[{href:`/users`,label:`Users`,ability:`user.view`,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z`})})},{href:`/roles`,label:`Roles`,ability:`role.view`,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})})},{href:`/activity-logs`,label:`Activity Logs`,ability:`user.view`,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})})}]},{label:`Account`,items:[{href:`/settings`,label:`Settings`,ability:null,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})})}]},{label:`Systems`,adminOnly:!0,items:[{href:`/system-settings`,label:`System Settings`,ability:null,icon:(0,s.jsxs)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:[(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z`}),(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`})]})},{href:`/documentation`,label:`Dokumentasi`,ability:null,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253`})})}]}],d=a.includes(`settings.manage`);return(0,s.jsx)(`aside`,{className:`w-[260px] h-screen p-4 shrink-0 relative z-20 flex flex-col anim-left`,children:(0,s.jsxs)(`div`,{className:`bg-[#3D4E4B] flex-1 rounded-[2rem] flex flex-col relative`,children:[(0,s.jsxs)(`div`,{className:`p-8 flex flex-col items-center text-center`,children:[(0,s.jsxs)(`div`,{className:`relative mb-4`,children:[(0,s.jsx)(`div`,{className:`w-16 h-16 rounded-full border border-[#D4A017] p-1 flex items-center justify-center`,children:(0,s.jsx)(`div`,{className:`w-full h-full rounded-full bg-[#2D3A38] overflow-hidden flex items-center justify-center font-bold text-white/40 text-lg`,children:n.avatar_url?(0,s.jsx)(`img`,{src:n.avatar_url,className:`w-full h-full object-cover`}):l})}),(0,s.jsx)(`div`,{className:`absolute bottom-0 right-0 w-4 h-4 bg-[#21A59F] border-2 border-[#3D4E4B] rounded-full`})]}),(0,s.jsxs)(`h3`,{className:`text-white text-sm font-bold tracking-tight`,children:[n.first_name,` `,n.last_name]}),(0,s.jsx)(`p`,{className:`text-[#E3EBE8]/40 text-sm font-medium mt-0.5`,children:n.email})]}),(0,s.jsx)(`nav`,{className:`flex-1 px-3 space-y-6 overflow-y-auto custom-scrollbar pb-10`,children:u.map(e=>{if(e.adminOnly&&!d)return null;let t=e.items.filter(e=>c(e.ability));return t.length===0?null:(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,s.jsx)(`div`,{className:`px-5 text-xs font-semibold text-[#E3EBE8]/30 tracking-widest uppercase mb-2`,children:e.label}),t.map(e=>{let t=o===e.href||o.startsWith(e.href+`/`);return(0,s.jsxs)(i,{href:e.href,className:`flex items-center gap-4 py-3 transition-[color,background-color,box-shadow,opacity] duration-200 relative group +import{c as e,d as t,i as n,o as r,r as i,t as a}from"./app-C2kGDHB9.js";var o=t(e(),1),s=a();function c({theme:e}){let{auth:t}=r().props,{user:n,permissions:a}=t,o=window.location.pathname,c=e=>e?a.includes(e):!0,l=`${n.first_name?.charAt(0)||``}${n.last_name?.charAt(0)||``}`.toUpperCase(),u=[{label:`Governance`,items:[{href:`/dashboard`,label:`Dashboard`,ability:null,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6`})})},{href:`/notifications`,label:`Notifications`,ability:`notifications.view`,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9`})})}]},{label:`Management`,items:[{href:`/users`,label:`Users`,ability:`user.view`,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z`})})},{href:`/roles`,label:`Roles`,ability:`role.view`,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})})},{href:`/activity-logs`,label:`Activity Logs`,ability:`activity-logs.view`,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})})}]},{label:`Account`,items:[{href:`/settings`,label:`Settings`,ability:null,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})})}]},{label:`Systems`,adminOnly:!0,items:[{href:`/system-settings`,label:`System Settings`,ability:`settings.view`,icon:(0,s.jsxs)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:[(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z`}),(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`})]})},{href:`/documentation`,label:`Dokumentasi`,ability:`documentation.view`,icon:(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253`})})}]}],d=a.includes(`settings.view`);return(0,s.jsx)(`aside`,{className:`w-[260px] h-screen p-4 shrink-0 relative z-20 flex flex-col anim-left`,children:(0,s.jsxs)(`div`,{className:`bg-[#3D4E4B] flex-1 rounded-[2rem] flex flex-col relative`,children:[(0,s.jsxs)(`div`,{className:`p-8 flex flex-col items-center text-center`,children:[(0,s.jsxs)(`div`,{className:`relative mb-4`,children:[(0,s.jsx)(`div`,{className:`w-16 h-16 rounded-full border border-[#D4A017] p-1 flex items-center justify-center`,children:(0,s.jsx)(`div`,{className:`w-full h-full rounded-full bg-[#2D3A38] overflow-hidden flex items-center justify-center font-bold text-white/40 text-lg`,children:n.avatar_url?(0,s.jsx)(`img`,{src:n.avatar_url,className:`w-full h-full object-cover`}):l})}),(0,s.jsx)(`div`,{className:`absolute bottom-0 right-0 w-4 h-4 bg-[#21A59F] border-2 border-[#3D4E4B] rounded-full`})]}),(0,s.jsxs)(`h3`,{className:`text-white text-sm font-bold tracking-tight`,children:[n.first_name,` `,n.last_name]}),(0,s.jsx)(`p`,{className:`text-[#E3EBE8]/40 text-sm font-medium mt-0.5`,children:n.email})]}),(0,s.jsx)(`nav`,{className:`flex-1 px-3 space-y-6 overflow-y-auto custom-scrollbar pb-10`,children:u.map(e=>{if(e.adminOnly&&!d)return null;let t=e.items.filter(e=>c(e.ability));return t.length===0?null:(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,s.jsx)(`div`,{className:`px-5 text-xs font-semibold text-[#E3EBE8]/30 tracking-widest uppercase mb-2`,children:e.label}),t.map(e=>{let t=o===e.href||o.startsWith(e.href+`/`);return(0,s.jsxs)(i,{href:e.href,className:`flex items-center gap-4 py-3 transition-[color,background-color,box-shadow,opacity] duration-200 relative group ${t?`text-[#3D4E4B] bg-[#E3EBE8] dark:bg-[#1A2120] dark:text-white -mr-3 pr-6 pl-5 rounded-l-[15px] w-[calc(100%+0.75rem)] shadow-sm`:`text-[#E3EBE8]/60 hover:text-white hover:bg-white/5 px-5 rounded-[15px]`}`,children:[(0,s.jsx)(`span`,{className:`shrink-0 z-10 transition-colors duration-300 ${t?`text-[#D4A017]`:`group-hover:text-[#D4A017]`}`,children:e.icon}),(0,s.jsx)(`span`,{className:`text-sm font-semibold tracking-tight z-10`,children:e.label})]},e.href)})]},e.label)})}),(0,s.jsx)(`div`,{className:`p-6 pb-8`,children:(0,s.jsxs)(`div`,{className:`px-4 py-3 rounded-2xl bg-white/5 border border-white/5 flex items-center justify-between group hover:bg-white/10 transition-colors cursor-default`,children:[(0,s.jsx)(`span`,{className:`text-sm font-semibold tracking-tight text-[#D4A017]`,children:`biiproject kit`}),(0,s.jsx)(`span`,{className:`text-sm font-bold text-white`,children:`v2`})]})})]})})}function l({theme:e,onThemeToggle:t,onMenuToggle:a,sidebarOpen:c}){let{auth:l,system_settings:u,unread_notifications:d}=r().props,{user:f,roles:p}=l,[m,h]=(0,o.useState)(!1),g=(0,o.useRef)(null),[_,v]=(0,o.useState)(``),[y,b]=(0,o.useState)([]),[x,S]=(0,o.useState)(!1),C=(0,o.useRef)(null),w=window.location.pathname;(0,o.useEffect)(()=>{function e(e){g.current&&!g.current.contains(e.target)&&h(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,o.useEffect)(()=>{if(_.length<2){b([]);return}let e=setTimeout(async()=>{S(!0);try{b(await(await fetch(`/api/search?query=${encodeURIComponent(_)}`)).json())}catch(e){console.error(`Search error:`,e)}finally{S(!1)}},300);return()=>clearTimeout(e)},[_]),(0,o.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key===`k`&&(e.preventDefault(),C.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let T=()=>{n.post(`/logout`)},E=`${f?.first_name?.charAt(0)||``}${f?.last_name?.charAt(0)||``}`.toUpperCase(),D=w.split(`/`).filter(Boolean),O=e=>e.replace(/-/g,` `).replace(/\b\w/g,e=>e.toUpperCase()),k=D.length>0?O(D[0]):`Dashboard`,A=D.length>1?D.map((e,t)=>({label:O(e),href:`/`+D.slice(0,t+1).join(`/`)})):null;return(0,s.jsxs)(`header`,{className:`h-16 flex items-center justify-between px-6 shrink-0 relative z-30 transition-colors duration-300 bg-transparent`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,s.jsx)(`button`,{onClick:a,className:`lg:hidden p-2 rounded-xl bg-white dark:bg-white/5 border border-gray-100 dark:border-white/5 text-gray-500 dark:text-gray-400 hover:text-[#3D4E4B] dark:hover:text-white transition-all`,"aria-label":`Toggle menu`,children:c?(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 18L18 6M6 6l12 12`})}):(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4 6h16M4 12h16M4 18h16`})})}),(0,s.jsxs)(`div`,{className:`hidden lg:block`,children:[(0,s.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B] dark:text-white tracking-tight leading-none`,children:k}),(0,s.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-semibold text-gray-400 tracking-tight mt-1`,children:[(0,s.jsx)(i,{href:`/dashboard`,className:`hover:text-[#3D4E4B] dark:hover:text-white transition-colors`,children:u?.app_name||`biiproject kit`}),A?A.map((e,t)=>(0,s.jsxs)(o.Fragment,{children:[(0,s.jsx)(`svg`,{className:`w-1 h-1 shrink-0`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,s.jsx)(`circle`,{cx:`12`,cy:`12`,r:`12`})}),t===A.length-1?(0,s.jsx)(`span`,{className:`text-[#D4A017] font-bold`,children:e.label}):(0,s.jsx)(i,{href:e.href,className:`hover:text-[#3D4E4B] dark:hover:text-white transition-colors`,children:e.label})]},e.href)):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`svg`,{className:`w-1 h-1 shrink-0`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,s.jsx)(`circle`,{cx:`12`,cy:`12`,r:`12`})}),(0,s.jsx)(`span`,{className:`text-[#D4A017] font-bold`,children:k})]})]})]}),(0,s.jsxs)(`div`,{className:`relative group ml-4`,children:[(0,s.jsxs)(`div`,{className:`relative w-[300px]`,children:[(0,s.jsx)(`svg`,{className:`absolute left-3.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400 pointer-events-none group-focus-within:text-[#D4A017] transition-colors`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:3,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})}),(0,s.jsx)(`input`,{ref:C,type:`text`,placeholder:`Search anything... (Ctrl+K)`,value:_,onChange:e=>v(e.target.value),className:`w-full h-10 pl-10 pr-4 rounded-xl border border-gray-100 dark:border-white/5 bg-white dark:bg-white/5 text-xs font-bold text-[#3D4E4B] dark:text-white placeholder-gray-400 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all`}),x&&(0,s.jsx)(`div`,{className:`absolute right-3.5 top-1/2 -translate-y-1/2`,children:(0,s.jsx)(`div`,{className:`w-3.5 h-3.5 border-2 border-[#D4A017] border-t-transparent rounded-full animate-spin`})})]}),y.length>0&&(0,s.jsx)(`div`,{className:`absolute left-0 right-0 mt-3 bg-white dark:bg-[#232D2B] rounded-2xl shadow-2xl border border-gray-100 dark:border-white/5 overflow-hidden anim-up z-50`,children:(0,s.jsx)(`div`,{className:`p-2 max-h-[400px] overflow-y-auto custom-scrollbar`,children:y.map((e,t)=>(0,s.jsxs)(i,{href:e.url,onClick:()=>v(``),className:`flex items-center gap-3 p-3 rounded-xl hover:bg-gray-50 dark:hover:bg-white/5 transition-all group`,children:[(0,s.jsxs)(`div`,{className:`w-9 h-9 rounded-lg bg-gray-100 dark:bg-white/5 flex items-center justify-center text-gray-400 group-hover:text-[#D4A017] transition-colors shrink-0`,children:[e.icon===`user`&&(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),e.icon===`shield`&&(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})}),e.icon===`clock`&&(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`div`,{className:`text-xs font-bold text-[#3D4E4B] dark:text-white tracking-tight`,children:e.title}),(0,s.jsxs)(`div`,{className:`text-[10px] text-gray-400 font-bold uppercase tracking-widest mt-0.5`,children:[e.type,` • `,e.subtitle]})]})]},t))})})]})]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,s.jsx)(`button`,{onClick:t,className:`p-2.5 rounded-xl bg-white dark:bg-white/5 text-gray-400 hover:text-[#D4A017] transition-all border border-gray-100 dark:border-white/5`,title:`Switch to ${e===`dark`?`Light`:`Dark`} Mode`,children:e===`dark`?(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{d:`M12 3v1m0 16v1m9-9h-1M4 12H3m15.364-6.364l-.707.707M6.343 17.657l-.707.707m12.728 0l-.707-.707M6.343 6.343l-.707.707M12 5a7 7 0 100 14 7 7 0 000-14z`})}):(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{d:`M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z`})})}),(0,s.jsxs)(i,{href:`/notifications`,className:`relative p-2.5 rounded-xl bg-white dark:bg-white/5 text-gray-400 hover:text-[#3D4E4B] dark:hover:text-white transition-all border border-gray-100 dark:border-white/5 flex items-center justify-center`,children:[(0,s.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9`})}),d>0&&(0,s.jsx)(`span`,{className:`absolute top-1.5 right-1.5 min-w-[1rem] h-4 px-0.5 bg-red-500 rounded-full flex items-center justify-center text-[9px] font-black text-white leading-none`,children:d>99?`99+`:d})]}),(0,s.jsxs)(`div`,{className:`relative`,ref:g,children:[(0,s.jsxs)(`button`,{onClick:()=>h(!m),className:`flex items-center gap-3 p-1.5 rounded-xl bg-white dark:bg-white/5 border border-gray-100 dark:border-white/5 hover:bg-gray-50 dark:hover:bg-white/10 transition-all group`,children:[(0,s.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-[#3D4E4B] flex items-center justify-center font-bold text-white text-sm`,children:f?.avatar_url?(0,s.jsx)(`img`,{src:f.avatar_url,className:`w-full h-full object-cover rounded-lg`}):E}),(0,s.jsxs)(`div`,{className:`hidden sm:block text-left pr-2`,children:[(0,s.jsx)(`div`,{className:`text-xs font-bold text-[#3D4E4B] dark:text-white leading-none`,children:f?.first_name}),(0,s.jsx)(`div`,{className:`text-[10px] text-[#D4A017] font-black uppercase tracking-widest mt-1`,children:p?.[0]?.replace(`-`,` `)||`User`})]})]}),m&&(0,s.jsxs)(`div`,{className:`absolute right-0 mt-3 w-56 bg-white dark:bg-[#232D2B] rounded-2xl shadow-2xl border border-gray-50 dark:border-white/5 py-2 z-50 anim-up`,children:[(0,s.jsxs)(`div`,{className:`px-5 py-3 border-b border-gray-50 dark:border-white/5 mb-1`,children:[(0,s.jsxs)(`div`,{className:`text-xs font-black text-[#3D4E4B] dark:text-white tracking-tight`,children:[f?.first_name,` `,f?.last_name]}),(0,s.jsx)(`div`,{className:`text-[10px] text-gray-400 font-bold truncate mt-1 uppercase tracking-widest`,children:f?.email})]}),(0,s.jsxs)(i,{href:`/profile`,className:`flex items-center gap-2.5 px-5 py-3 text-xs font-bold text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 transition-all`,children:[(0,s.jsx)(`svg`,{className:`w-4 h-4 opacity-50`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),`Account Settings`]}),(0,s.jsxs)(`button`,{onClick:T,className:`w-full flex items-center gap-2.5 px-5 py-3 text-xs font-bold text-red-600 hover:bg-red-50 dark:hover:bg-red-500/10 transition-all text-left border-t border-gray-50 dark:border-white/5 mt-1`,children:[(0,s.jsx)(`svg`,{className:`w-4 h-4 opacity-50`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,s.jsx)(`path`,{d:`M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1`})}),`Sign Out Session`]})]})]})]})]})}function u({children:e}){let{system_settings:t}=r().props,n=t?.primary_color,[i,a]=o.useState(()=>typeof window<`u`&&localStorage.getItem(`theme`)||`light`),[u,d]=o.useState(!1);o.useEffect(()=>{i===`dark`?document.documentElement.classList.add(`dark`):document.documentElement.classList.remove(`dark`),localStorage.setItem(`theme`,i)},[i]);let f=r().url;return o.useEffect(()=>{d(!1)},[f]),(0,s.jsxs)(`div`,{className:`flex h-screen overflow-hidden transition-colors duration-300 bg-[#E3EBE8] dark:bg-[#1A2120]`,style:n?{"--color-primary-500":n,"--color-accent-gold":n}:{},children:[(0,s.jsx)(`div`,{onClick:()=>d(!1),className:`fixed inset-0 z-10 bg-black/40 backdrop-blur-sm lg:hidden transition-opacity duration-300 ${u?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`}`}),(0,s.jsx)(`div`,{className:`hidden lg:block shrink-0`,children:(0,s.jsx)(c,{theme:i})}),(0,s.jsx)(`div`,{className:`fixed inset-y-0 left-0 z-20 lg:hidden transition-transform duration-300 ease-in-out ${u?`translate-x-0`:`-translate-x-full`}`,children:(0,s.jsx)(c,{theme:i})}),(0,s.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0 h-full relative`,children:[(0,s.jsx)(l,{theme:i,onThemeToggle:()=>a(e=>e===`dark`?`light`:`dark`),onMenuToggle:()=>d(e=>!e),sidebarOpen:u}),(0,s.jsx)(`main`,{className:`flex-1 overflow-y-auto px-6 pt-6 pb-6 custom-scrollbar`,children:(0,s.jsx)(`div`,{className:`max-w-[1600px] mx-auto anim-page`,children:e},f)})]})]})}export{u as t}; \ No newline at end of file diff --git a/public/build/assets/Can-DkptxH2j.js b/public/build/assets/Can-bASqMhyx.js similarity index 77% rename from public/build/assets/Can-DkptxH2j.js rename to public/build/assets/Can-bASqMhyx.js index 0dd73fc..bf29f32 100644 --- a/public/build/assets/Can-DkptxH2j.js +++ b/public/build/assets/Can-bASqMhyx.js @@ -1 +1 @@ -import{c as e,o as t,t as n}from"./app-BK5KCPMc.js";e();var r=n();function i({ability:e,children:n,fallback:i=null}){let{permissions:a}=t().props.auth;return(Array.isArray(e)?e:[e]).some(e=>a.includes(e))?(0,r.jsx)(r.Fragment,{children:n}):(0,r.jsx)(r.Fragment,{children:i})}export{i as t}; \ No newline at end of file +import{c as e,o as t,t as n}from"./app-C2kGDHB9.js";e();var r=n();function i({ability:e,children:n,fallback:i=null}){let{permissions:a}=t().props.auth;return(Array.isArray(e)?e:[e]).some(e=>a.includes(e))?(0,r.jsx)(r.Fragment,{children:n}):(0,r.jsx)(r.Fragment,{children:i})}export{i as t}; \ No newline at end of file diff --git a/public/build/assets/Challenge-BcvFwzFZ.js b/public/build/assets/Challenge-fTLTkT9A.js similarity index 96% rename from public/build/assets/Challenge-BcvFwzFZ.js rename to public/build/assets/Challenge-fTLTkT9A.js index 9d5f65b..6f535c2 100644 --- a/public/build/assets/Challenge-BcvFwzFZ.js +++ b/public/build/assets/Challenge-fTLTkT9A.js @@ -1,2 +1,2 @@ -import{a as e,c as t,d as n,i as r,n as i,t as a}from"./app-BK5KCPMc.js";import{t as o}from"./swal-D8hRpOIh.js";var s=n(t(),1),c=a();function l({type:t=`totp`}){let[n,a]=(0,s.useState)(!1),{data:l,setData:u,post:d,processing:f,errors:p}=e({code:``}),[m,h]=(0,s.useState)(!1),g=e=>{e.preventDefault(),d(route(`two-factor.verify`),{preserveScroll:!0})},_=()=>{m||(h(!0),r.post(route(`two-factor.resend`),{},{preserveScroll:!0,onSuccess:()=>{h(!1),o.success(`Sent!`,`A new verification code has been sent to your email.`)},onError:e=>{h(!1),o.error(`Error`,e.code||`Failed to resend verification code.`)}}))},v=t===`email`;return(0,c.jsxs)(`div`,{className:`min-h-screen bg-[#E3EBE8] flex items-center justify-center p-4`,children:[(0,c.jsx)(i,{title:`Two-Factor Authentication`}),(0,c.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,c.jsxs)(`div`,{className:`text-center mb-8`,children:[(0,c.jsx)(`div`,{className:`inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-[#3D4E4B] mb-4 shadow-lg shadow-[#3D4E4B]/10`,children:v&&!n?(0,c.jsx)(`svg`,{className:`w-7 h-7 text-[#D4A017]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,c.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z`})}):(0,c.jsx)(`svg`,{className:`w-7 h-7 text-[#D4A017]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,c.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z`})})}),(0,c.jsx)(`h1`,{className:`text-xl font-black text-[#3D4E4B] tracking-tight`,children:`Two-Factor Authentication`}),(0,c.jsx)(`p`,{className:`text-sm text-gray-500 font-medium mt-2 leading-relaxed px-2`,children:n?`Enter a recovery code to continue.`:v?`Please enter the 6-digit verification code sent to your registered email address.`:`Please enter the 6-digit authentication code from your authenticator app.`})]}),(0,c.jsxs)(`div`,{className:`bg-white rounded-2xl shadow-sm border border-gray-100 p-8`,children:[(0,c.jsxs)(`form`,{onSubmit:g,className:`space-y-5`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`label`,{className:`block text-xs font-bold text-gray-400 uppercase tracking-widest mb-2.5`,children:n?`Recovery Code`:v?`Email Verification Code`:`Authenticator Code`}),(0,c.jsx)(`input`,{type:`text`,inputMode:n?`text`:`numeric`,maxLength:n?21:6,value:l.code,onChange:e=>u(`code`,e.target.value),autoFocus:!0,className:`w-full h-12 border rounded-xl px-4 text-center font-mono font-bold text-lg tracking-[0.4em] outline-none transition-all +import{a as e,c as t,d as n,i as r,n as i,t as a}from"./app-C2kGDHB9.js";import{t as o}from"./swal-DeDNECCu.js";var s=n(t(),1),c=a();function l({type:t=`totp`}){let[n,a]=(0,s.useState)(!1),{data:l,setData:u,post:d,processing:f,errors:p}=e({code:``}),[m,h]=(0,s.useState)(!1),g=e=>{e.preventDefault(),d(route(`two-factor.verify`),{preserveScroll:!0})},_=()=>{m||(h(!0),r.post(route(`two-factor.resend`),{},{preserveScroll:!0,onSuccess:()=>{h(!1),o.success(`Sent!`,`A new verification code has been sent to your email.`)},onError:e=>{h(!1),o.error(`Error`,e.code||`Failed to resend verification code.`)}}))},v=t===`email`;return(0,c.jsxs)(`div`,{className:`min-h-screen bg-[#E3EBE8] flex items-center justify-center p-4`,children:[(0,c.jsx)(i,{title:`Two-Factor Authentication`}),(0,c.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,c.jsxs)(`div`,{className:`text-center mb-8`,children:[(0,c.jsx)(`div`,{className:`inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-[#3D4E4B] mb-4 shadow-lg shadow-[#3D4E4B]/10`,children:v&&!n?(0,c.jsx)(`svg`,{className:`w-7 h-7 text-[#D4A017]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,c.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z`})}):(0,c.jsx)(`svg`,{className:`w-7 h-7 text-[#D4A017]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,c.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z`})})}),(0,c.jsx)(`h1`,{className:`text-xl font-black text-[#3D4E4B] tracking-tight`,children:`Two-Factor Authentication`}),(0,c.jsx)(`p`,{className:`text-sm text-gray-500 font-medium mt-2 leading-relaxed px-2`,children:n?`Enter a recovery code to continue.`:v?`Please enter the 6-digit verification code sent to your registered email address.`:`Please enter the 6-digit authentication code from your authenticator app.`})]}),(0,c.jsxs)(`div`,{className:`bg-white rounded-2xl shadow-sm border border-gray-100 p-8`,children:[(0,c.jsxs)(`form`,{onSubmit:g,className:`space-y-5`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`label`,{className:`block text-xs font-bold text-gray-400 uppercase tracking-widest mb-2.5`,children:n?`Recovery Code`:v?`Email Verification Code`:`Authenticator Code`}),(0,c.jsx)(`input`,{type:`text`,inputMode:n?`text`:`numeric`,maxLength:n?21:6,value:l.code,onChange:e=>u(`code`,e.target.value),autoFocus:!0,className:`w-full h-12 border rounded-xl px-4 text-center font-mono font-bold text-lg tracking-[0.4em] outline-none transition-all ${p.code?`border-red-300 bg-red-50 focus:ring-red-100`:`border-gray-200 focus:border-[#3D4E4B] focus:ring-2 focus:ring-[#3D4E4B]/10`}`,placeholder:n?`xxxxxxxxxx-xxxxxxxxxx`:`000000`}),p.code&&(0,c.jsx)(`p`,{className:`text-xs text-red-500 font-semibold mt-1.5 text-center`,children:p.code})]}),(0,c.jsx)(`button`,{type:`submit`,disabled:f||l.code.length<(n?5:6),className:`w-full h-11 bg-[#3D4E4B] text-white text-sm font-bold rounded-xl hover:bg-[#2D3A38] transition-all disabled:opacity-60 shadow-md shadow-[#3D4E4B]/15`,children:f?`Verifying...`:`Continue`})]}),v&&!n&&(0,c.jsx)(`div`,{className:`mt-5 text-center`,children:(0,c.jsx)(`button`,{onClick:_,disabled:m,className:`text-xs font-bold text-[#D4A017] hover:underline disabled:opacity-50`,children:m?`Resending code...`:`Didn't receive a code? Resend`})}),!v&&(0,c.jsx)(`div`,{className:`mt-6 text-center border-t border-gray-50 pt-4`,children:(0,c.jsx)(`button`,{onClick:()=>{a(!n),u(`code`,``)},className:`text-xs font-bold text-[#3D4E4B] hover:underline`,children:n?`Use authenticator code instead`:`Use a recovery code`})})]}),(0,c.jsx)(`div`,{className:`mt-6 text-center`,children:(0,c.jsx)(`a`,{href:`/login`,className:`text-xs font-semibold text-gray-400 hover:text-[#3D4E4B] transition-colors`,children:`← Back to login`})})]})]})}export{l as default}; \ No newline at end of file diff --git a/public/build/assets/ConfirmPassword-DBNbpA9Y.js b/public/build/assets/ConfirmPassword-aqHWSvyY.js similarity index 94% rename from public/build/assets/ConfirmPassword-DBNbpA9Y.js rename to public/build/assets/ConfirmPassword-aqHWSvyY.js index 15cc32a..0bb5488 100644 --- a/public/build/assets/ConfirmPassword-DBNbpA9Y.js +++ b/public/build/assets/ConfirmPassword-aqHWSvyY.js @@ -1 +1 @@ -import{a as e,c as t,n,t as r}from"./app-BK5KCPMc.js";import{t as i}from"./GuestLayout-CgPUg7Kz.js";t();var a=r();function o(){let{data:t,setData:r,post:o,processing:s,errors:c,reset:l}=e({password:``});return(0,a.jsxs)(i,{children:[(0,a.jsx)(n,{title:`Confirm password`}),(0,a.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,a.jsx)(`div`,{className:`w-12 h-12 bg-[#3D4E4B]/5 rounded-2xl flex items-center justify-center mb-6`,children:(0,a.jsx)(`svg`,{className:`w-5 h-5 text-[#3D4E4B]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`})})}),(0,a.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Confirm your password`}),(0,a.jsx)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium leading-relaxed`,children:`For your security, please confirm your password to continue.`})]}),(0,a.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),o(route(`password.confirm`),{onFinish:()=>l(`password`)})},className:`anim-up`,style:{animationDelay:`0.1s`},children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`label`,{htmlFor:`password`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Password`}),(0,a.jsx)(`input`,{id:`password`,type:`password`,autoComplete:`current-password`,autoFocus:!0,value:t.password,onChange:e=>r(`password`,e.target.value),placeholder:`••••••••`,className:`auth-input${c.password?` !border-red-300 !bg-red-50/50`:``}`}),c.password&&(0,a.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:c.password})]}),(0,a.jsx)(`button`,{type:`submit`,disabled:s,className:`mt-6 w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,a.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,a.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Confirming…`]}):`Confirm password`})]})]})}export{o as default}; \ No newline at end of file +import{a as e,c as t,n,t as r}from"./app-C2kGDHB9.js";import{t as i}from"./GuestLayout-DfP8Xy7D.js";t();var a=r();function o(){let{data:t,setData:r,post:o,processing:s,errors:c,reset:l}=e({password:``});return(0,a.jsxs)(i,{children:[(0,a.jsx)(n,{title:`Confirm password`}),(0,a.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,a.jsx)(`div`,{className:`w-12 h-12 bg-[#3D4E4B]/5 rounded-2xl flex items-center justify-center mb-6`,children:(0,a.jsx)(`svg`,{className:`w-5 h-5 text-[#3D4E4B]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`})})}),(0,a.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Confirm your password`}),(0,a.jsx)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium leading-relaxed`,children:`For your security, please confirm your password to continue.`})]}),(0,a.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),o(route(`password.confirm`),{onFinish:()=>l(`password`)})},className:`anim-up`,style:{animationDelay:`0.1s`},children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`label`,{htmlFor:`password`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Password`}),(0,a.jsx)(`input`,{id:`password`,type:`password`,autoComplete:`current-password`,autoFocus:!0,value:t.password,onChange:e=>r(`password`,e.target.value),placeholder:`••••••••`,className:`auth-input${c.password?` !border-red-300 !bg-red-50/50`:``}`}),c.password&&(0,a.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:c.password})]}),(0,a.jsx)(`button`,{type:`submit`,disabled:s,className:`mt-6 w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,a.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,a.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Confirming…`]}):`Confirm password`})]})]})}export{o as default}; \ No newline at end of file diff --git a/public/build/assets/Dashboard-BWFrXJia.js b/public/build/assets/Dashboard-CpVakWgQ.js similarity index 99% rename from public/build/assets/Dashboard-BWFrXJia.js rename to public/build/assets/Dashboard-CpVakWgQ.js index 167be7a..769898a 100644 --- a/public/build/assets/Dashboard-BWFrXJia.js +++ b/public/build/assets/Dashboard-CpVakWgQ.js @@ -1,3 +1,3 @@ -import{c as e,d as t,n,r,t as i}from"./app-BK5KCPMc.js";import{t as a}from"./AuthenticatedLayout-BjuyW-Hp.js";var o=t(e(),1);function s(e){return e+.5|0}var c=(e,t,n)=>Math.max(Math.min(e,n),t);function l(e){return c(s(e*2.55),0,255)}function u(e){return c(s(e*255),0,255)}function d(e){return c(s(e/2.55)/100,0,1)}function f(e){return c(s(e*100),0,100)}var p={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},m=[...`0123456789ABCDEF`],h=e=>m[e&15],g=e=>m[(e&240)>>4]+m[e&15],_=e=>(e&240)>>4==(e&15),v=e=>_(e.r)&&_(e.g)&&_(e.b)&&_(e.a);function y(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&p[e[1]]*17,g:255&p[e[2]]*17,b:255&p[e[3]]*17,a:t===5?p[e[4]]*17:255}:(t===7||t===9)&&(n={r:p[e[1]]<<4|p[e[2]],g:p[e[3]]<<4|p[e[4]],b:p[e[5]]<<4|p[e[6]],a:t===9?p[e[7]]<<4|p[e[8]]:255})),n}var b=(e,t)=>e<255?t(e):``;function x(e){var t=v(e)?h:g;return e?`#`+t(e.r)+t(e.g)+t(e.b)+b(e.a,t):void 0}var S=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function C(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function w(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function T(e,t,n){let r=C(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function E(e,t,n,r,i){return e===i?(t-n)/r+(t.5?l/(2-i-a):l/(i+a),s=E(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function ee(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(u)}function O(e,t,n){return ee(C,e,t,n)}function te(e,t,n){return ee(T,e,t,n)}function ne(e,t,n){return ee(w,e,t,n)}function re(e){return(e%360+360)%360}function ie(e){let t=S.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?l(+t[5]):u(+t[5]));let i=re(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?te(i,a,o):t[1]===`hsv`?ne(i,a,o):O(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function ae(e,t){var n=D(e);n[0]=re(n[0]+t),n=O(n),e.r=n[0],e.g=n[1],e.b=n[2]}function oe(e){if(!e)return;let t=D(e),n=t[0],r=f(t[1]),i=f(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${d(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var se={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`},ce={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function le(){let e={},t=Object.keys(ce),n=Object.keys(se),r,i,a,o,s;for(r=0;r>16&255,a>>8&255,a&255]}return e}var ue;function de(e){ue||(ue=le(),ue.transparent=[0,0,0,0]);let t=ue[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var fe=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function pe(e){let t=fe.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?l(e):c(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?l(r):c(r,0,255)),i=255&(t[4]?l(i):c(i,0,255)),a=255&(t[6]?l(a):c(a,0,255)),{r,g:i,b:a,a:n}}}function me(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${d(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var he=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,ge=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function _e(e,t,n){let r=ge(d(e.r)),i=ge(d(e.g)),a=ge(d(e.b));return{r:u(he(r+n*(ge(d(t.r))-r))),g:u(he(i+n*(ge(d(t.g))-i))),b:u(he(a+n*(ge(d(t.b))-a))),a:e.a+n*(t.a-e.a)}}function ve(e,t,n){if(e){let r=D(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=O(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function ye(e,t){return e&&Object.assign(t||{},e)}function be(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=u(e[3]))):(t=ye(e,{r:0,g:0,b:0,a:1}),t.a=u(t.a)),t}function xe(e){return e.charAt(0)===`r`?pe(e):ie(e)}var Se=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=be(t):n===`string`&&(r=y(t)||de(t)||xe(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=ye(this._rgb);return e&&(e.a=d(e.a)),e}set rgb(e){this._rgb=be(e)}rgbString(){return this._valid?me(this._rgb):void 0}hexString(){return this._valid?x(this._rgb):void 0}hslString(){return this._valid?oe(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=_e(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=u(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=s(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return ve(this._rgb,2,e),this}darken(e){return ve(this._rgb,2,-e),this}saturate(e){return ve(this._rgb,1,e),this}desaturate(e){return ve(this._rgb,1,-e),this}rotate(e){return ae(this._rgb,e),this}};function Ce(){}var we=(()=>{let e=0;return()=>e++})();function k(e){return e==null}function A(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function j(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function M(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function N(e,t){return M(e)?e:t}function P(e,t){return e===void 0?t:e}var Te=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,Ee=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function F(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function I(e,t,n,r){let i,a,o;if(A(e))if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;ie,x:e=>e.x,y:e=>e.y};function Fe(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function Ie(e){let t=Fe(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Le(e,t){return(Pe[t]||(Pe[t]=Ie(t)))(e)}function Re(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ze=e=>e!==void 0,Be=e=>typeof e==`function`,Ve=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function He(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var L=Math.PI,R=2*L,Ue=R+L,We=1/0,Ge=L/180,z=L/2,Ke=L/4,qe=L*2/3,Je=Math.log10,B=Math.sign;function Ye(e,t,n){return Math.abs(e-t)e-t).pop(),t}function Qe(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function $e(e){return!Qe(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function et(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function tt(e,t,n){let r,i,a;for(r=0,i=e.length;rc&&l=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ut(e,t,n){n||=(n=>e[n]1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var dt=(e,t,n,r)=>ut(e,n,r?r=>{let i=e[r][t];return ie[r][t]ut(e,n,r=>e[r][t]>=n);function pt(e,t,n){let r=0,i=e.length;for(;rr&&e[i-1]>n;)i--;return r>0||i{let n=`_onData`+Re(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function gt(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(mt.forEach(t=>{delete e[t]}),delete e._chartjs)}function _t(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var vt=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function yt(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,vt.call(window,()=>{r=!1,e.apply(t,n)}))}}function bt(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var xt=e=>e===`start`?`left`:e===`end`?`right`:`center`,W=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,St=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function Ct(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(dt(c,u,d).lo,n?r:dt(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!k(e[s.axis]));i-=Math.max(0,e)}i=U(i,0,r-1)}if(m){let e=Math.max(dt(c,o.axis,f,!0).hi+1,n?0:dt(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!k(e[s.axis]));e+=Math.max(0,t)}a=U(e,i,r)-i}else a=r-i}return{start:i,count:a}}function wt(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var Tt=e=>e===0||e===1,Et=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*R/n)),Dt=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*R/n)+1,Ot={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*z)+1,easeOutSine:e=>Math.sin(e*z),easeInOutSine:e=>-.5*(Math.cos(L*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>Tt(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Tt(e)?e:Et(e,.075,.3),easeOutElastic:e=>Tt(e)?e:Dt(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return Tt(e)?e:e<.5?.5*Et(e*2,t,n):.5+.5*Dt(e*2-1,t,n)},easeInBack(e){let t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){let t=1.70158;return--e*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Ot.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?Ot.easeInBounce(e*2)*.5:Ot.easeOutBounce(e*2-1)*.5+.5};function kt(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function At(e){return kt(e)?e:new Se(e)}function jt(e){return kt(e)?e:new Se(e).saturate(.5).darken(.1).hexString()}var Mt=[`x`,`y`,`borderWidth`,`radius`,`tension`],Nt=[`color`,`borderColor`,`backgroundColor`];function Pt(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:Nt},numbers:{type:`number`,properties:Mt}}),e.describe(`animations`,{_fallback:`animation`}),e.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:e=>e|0}}}})}function Ft(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var It=new Map;function Lt(e,t){t||={};let n=e+JSON.stringify(t),r=It.get(n);return r||(r=new Intl.NumberFormat(e,t),It.set(n,r)),r}function Rt(e,t,n){return Lt(t,n).format(e)}var zt={values(e){return A(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Bt(e,n)}let o=Je(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Rt(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Je(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?zt.numeric.call(this,e,t,n):``}};function Bt(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Vt={formatters:zt};function Ht(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Vt.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var Ut=Object.create(null),Wt=Object.create(null);function Gt(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;te.chart.platform.getDevicePixelRatio(),this.elements={},this.events=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],this.font={family:`'Helvetica Neue', 'Helvetica', 'Arial', sans-serif`,size:12,style:`normal`,lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>jt(t.backgroundColor),this.hoverBorderColor=(e,t)=>jt(t.borderColor),this.hoverColor=(e,t)=>jt(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return Kt(this,e,t)}get(e){return Gt(this,e)}describe(e,t){return Kt(Wt,e,t)}override(e,t){return Kt(Ut,e,t)}route(e,t,n,r){let i=Gt(this,e),a=Gt(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return j(e)?Object.assign({},t,e):P(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Pt,Ft,Ht]);function qt(e){return!e||k(e.size)||k(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Jt(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Yt(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;cn.length){for(c=0;c0&&e.stroke()}}function en(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,on(e,a),c=0;c+e||0;function hn(e,t){let n={},r=j(t),i=r?Object.keys(t):t,a=j(e)?r?n=>P(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=mn(a(e));return n}function gn(e){return hn(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function _n(e){return hn(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function K(e){let t=gn(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function q(e,t){e||={},t||=G.font;let n=P(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=P(e.style,t.style);r&&!(``+r).match(fn)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:P(e.family,t.family),lineHeight:pn(P(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:P(e.weight,t.weight),string:``};return i.string=qt(i),i}function vn(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;an&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function bn(e,t){return Object.assign(Object.create(e),t)}function xn(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=Ln(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>xn([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return En(n,r,()=>In(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Rn(e).includes(t)},ownKeys(e){return Rn(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function Sn(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Cn(e,r),setContext:t=>Sn(e,t,n,r),override:i=>Sn(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return En(e,t,()=>Dn(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function Cn(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Be(n)?n:()=>n,isIndexable:Be(r)?r:()=>r}}var wn=(e,t)=>e?e+Re(t):t,Tn=(e,t)=>j(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function En(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function Dn(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Be(s)&&o.isScriptable(t)&&(s=On(t,s,e,n)),A(s)&&s.length&&(s=kn(t,s,e,o.isIndexable)),Tn(t,s)&&(s=Sn(s,i,a&&a[t],o)),s}function On(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),Tn(e,c)&&(c=Nn(i._scopes,i,e,c)),c}function kn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(j(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Nn(r,i,e,c);t.push(Sn(n,a,o&&o[e],s))}}return t}function An(e,t,n){return Be(e)?e(t,n):e}var jn=(e,t)=>e===!0?t:typeof e==`string`?Le(t,e):void 0;function Mn(e,t,n,r,i){for(let a of t){let t=jn(n,a);if(t){e.add(t);let a=An(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Nn(e,t,n,r){let i=t._rootScopes,a=An(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Pn(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Pn(s,o,a,c,r),c===null)?!1:xn(Array.from(s),[``],i,a,()=>Fn(t,n,r))}function Pn(e,t,n,r,i){for(;n;)n=Mn(e,t,n,r,i);return n}function Fn(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return A(i)&&j(n)?n:i||{}}function In(e,t,n,r){let i;for(let a of t)if(i=Ln(wn(a,e),n),i!==void 0)return Tn(e,i)?Nn(n,r,e,i):i}function Ln(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Rn(e){let t=e._keys;return t||=e._keys=zn(e._scopes),t}function zn(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}var Bn=2**-52||1e-14,Vn=(e,t)=>te===`x`?`y`:`x`;function Un(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=at(a,i),c=at(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Wn(e,t,n){let r=e.length,i,a,o,s,c,l=Vn(e,0);for(let u=0;u!e.skip)),t.cubicInterpolationMode===`monotone`)Kn(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;ae.ownerDocument.defaultView.getComputedStyle(e,null);function er(e,t){return $n(e).getPropertyValue(t)}var tr=[`top`,`right`,`bottom`,`left`];function nr(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=tr[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var rr=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function ir(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(rr(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function ar(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=$n(n),a=i.boxSizing===`border-box`,o=nr(i,`padding`),s=nr(i,`border`,`width`),{x:c,y:l,box:u}=ir(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function or(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&Zn(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=$n(a),s=nr(o,`border`,`width`),c=nr(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Qn(o.maxWidth,a,`clientWidth`),i=Qn(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||We,maxHeight:i||We}}var sr=e=>Math.round(e*10)/10;function cr(e,t,n,r){let i=$n(e),a=nr(i,`margin`),o=Qn(i.maxWidth,e,`clientWidth`)||We,s=Qn(i.maxHeight,e,`clientHeight`)||We,c=or(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=nr(i,`border`,`width`),t=nr(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=sr(Math.min(l,o,c.maxWidth)),u=sr(Math.min(u,s,c.maxHeight)),l&&!u&&(u=sr(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=sr(Math.floor(u*r))),{width:l,height:u}}function lr(e,t,n){let r=t||1,i=sr(e.height*r),a=sr(e.width*r);e.height=sr(e.height),e.width=sr(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var ur=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Xn()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function dr(e,t){let n=er(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function fr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function pr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function mr(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=fr(e,i,n),s=fr(i,a,n),c=fr(a,t,n);return fr(fr(o,s,n),fr(s,c,n),n)}var hr=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},gr=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function _r(e,t,n){return e?hr(t,n):gr()}function vr(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function yr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function br(e){return e===`angle`?{between:st,compare:ot,normalize:H}:{between:lt,compare:(e,t)=>e-t,normalize:e=>e}}function xr({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function Sr(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=br(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;fc(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(xr({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(xr({start:g,end:d,loop:f,count:o,style:p})),m}function wr(e,t){let n=[],r=e.segments;for(let i=0;ii&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function Er(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function Dr(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=Tr(n,i,a,r);return r===!0?Or(e,[{start:o,end:s,loop:a}],n,t):Or(e,Er(n,o,sr({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,vt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},Ir=`transparent`,Lr={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=At(e||Ir),i=r.valid&&At(t||Ir);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Rr=class{constructor(e,t,n,r){let i=t[n];r=vn([e.to,r,i,e.from]);let a=vn([e.from,i,r]);this._active=!0,this._fn=e.fn||Lr[e.type||typeof a],this._easing=Ot[e.easing]||Ot.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=vn([e.to,t,r,e.from]),this._from=vn([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e{let i=e[r];if(!j(i))return;let a={};for(let e of t)a[e]=i[e];(A(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Vr(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&Br(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,l,o);continue}else u.cancel();if(!d||!d.duration){e[c]=l;continue}i[c]=u=new Rr(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Fr.add(this._chart,n),!0}};function Br(e,t){let n=[],r=Object.keys(t);for(let t=0;t0||!n&&t<0)return i.index}return null}function $r(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Yr(a,o,r),d=t.length,f;for(let e=0;en[e].axis===t).shift()}function ti(e,t){return bn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function ni(e,t,n){return bn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function ri(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var ii=e=>e===`reset`||e===`none`,ai=(e,t)=>t?e:Object.assign({},e),oi=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Gr(n,!0),values:null},si=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Jr(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled(`filler`)&&console.warn(`Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options`)}updateIndex(e){this.index!==e&&ri(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=P(n.xAxisID,ei(e,`x`)),a=t.yAxisID=P(n.yAxisID,ei(e,`y`)),o=t.rAxisID=P(n.rAxisID,ei(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&>(this._data,this),e._stacked&&ri(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(j(t)){let e=this._cachedMeta;this._data=qr(t,e)}else if(n!==t){if(n){gt(n,this);let e=this._cachedMeta;ri(e),e._parsed=[]}t&&Object.isExtensible(t)&&ht(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Jr(t.vScale,t),t.stack!==n.stack&&(r=!0,ri(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&($r(this,t._parsed),t._stacked=Jr(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length?!0:n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=A(r[e])?this.parseArrayData(n,r,e,t):j(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]t||u=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r=0&&ethis.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(ai(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new zr(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||ii(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){ii(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!ii(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;oe-t))}return e._cache.$bar}function li(e){let t=e.iScale,n=ci(t,e.type),r=t._length,i,a,o,s,c=()=>{o===32767||o===-32768||(ze(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i0?i[e-1]:null,s=eMath.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function pi(e,t,n,r){return A(e)?fi(e,t,n,r):t[n.axis]=n.parse(e,r),t}function mi(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l=n?1:-1):B(e)}function _i(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.basee.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(k(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[P(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;ist(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>st(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(z,u,f),_=m(L,l,d),v=m(L+z,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var Ti=class extends si{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(j(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Le(n[t],e)}let a,o;for(a=e,o=e+t;a0&&!isNaN(e)?Math.abs(e)/t*R:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Rt(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r0&&this.getParsed(t-1);for(let n=0;n=_){v.skip=!0;continue}let b=this.getParsed(n),x=k(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}};function Di(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var Oi={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Di()}parse(){return Di()}format(){return Di()}add(){return Di()}diff(){return Di()}startOf(){return Di()}endOf(){return Di()}}};function ki(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ft:dt;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!k(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!k(e[t.axis]));r.hi+=Math.max(0,o)}return r}else if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function Ai(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Li={evaluateInteractionItems:Ai,modes:{index(e,t,n,r){let i=ar(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Mi(e,i,a,r,o):Fi(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=ar(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Mi(e,i,a,r,o):Fi(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;ee.pos===t)}function Bi(e,t){return e.filter(e=>Ri.indexOf(e.pos)===-1&&e.box.axis===t)}function Vi(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function Hi(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;ne.box.fullSize),!0),r=Vi(zi(t,`left`),!0),i=Vi(zi(t,`right`)),a=Vi(zi(t,`top`),!0),o=Vi(zi(t,`bottom`)),s=Bi(t,`x`),c=Bi(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:zi(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function Ki(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function qi(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Ji(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!j(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&qi(o,a.getPadding());let s=Math.max(0,t.outerWidth-Ki(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-Ki(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function Yi(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function Xi(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function Zi(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);qi(f,K(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Wi(c.concat(l),d);Zi(s.fullSize,p,d,m),Zi(c,p,d,m),Zi(l,p,d,m)&&Zi(c,p,d,m),Yi(p),$i(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,$i(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},I(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},ea=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},ta=class extends ea{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},na=`$chartjs`,ra={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},ia=e=>e===null||e===``;function aa(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[na]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,ia(i)){let t=dr(e,`width`);t!==void 0&&(e.width=t)}if(ia(r))if(e.style.height===``)e.height=e.width/(t||2);else{let t=dr(e,`height`);t!==void 0&&(e.height=t)}return e}var oa=ur?{passive:!0}:!1;function sa(e,t,n){e&&e.addEventListener(t,n,oa)}function ca(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,oa)}function la(e,t){let n=ra[e.type]||e.type,{x:r,y:i}=ar(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function ua(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function da(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ua(n.addedNodes,r),t&&=!ua(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function fa(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ua(n.removedNodes,r),t&&=!ua(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var pa=new Map,ma=0;function ha(){let e=window.devicePixelRatio;e!==ma&&(ma=e,pa.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function ga(e,t){pa.size||window.addEventListener(`resize`,ha),pa.set(e,t)}function _a(e){pa.delete(e),pa.size||window.removeEventListener(`resize`,ha)}function va(e,t,n){let r=e.canvas,i=r&&Zn(r);if(!i)return;let a=yt((e,t)=>{let r=i.clientWidth;n(e,t),r{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0&&r===0||a(n,r)});return o.observe(i),ga(e,a),o}function ya(e,t,n){n&&n.disconnect(),t===`resize`&&_a(e)}function ba(e,t,n){let r=e.canvas,i=yt(t=>{e.ctx!==null&&n(la(t,e))},e);return sa(r,t,i),i}var xa=class extends ea{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(aa(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[na])return!1;let n=t[na].initial;[`height`,`width`].forEach(e=>{let r=n[e];k(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[na],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:da,detach:fa,resize:va}[t]||ba)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:ya,detach:ya,resize:ya}[t]||ca)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return cr(e,t,n,r)}isAttached(e){let t=e&&Zn(e);return!!(t&&t.isConnected)}};function Sa(e){return!Xn()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?ta:xa}var Ca=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return $e(this.x)&&$e(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function wa(e,t){let n=e.options.ticks,r=Ta(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?Da(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Oa(t,l,a,o/i),l;let u=Ea(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(ka(t,l,u,k(r)?0:s-r,s),e=0,n=o-1;ei)return t}return Math.max(i,1)}function Da(e){let t=[],n,r;for(n=0,r=e.length;ne===`left`?`right`:e===`right`?`left`:e,Ma=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Na=(e,t)=>Math.min(t||e,e);function Pa(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;ao+s)))return c}function Ia(e,t){I(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;in?n:t,n=r&&t>n?t:n,{min:N(t,N(n,t)),max:N(n,N(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){F(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=yn(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=U(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-La(e.grid)-t.padding-Ra(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=nt(Math.min(Math.asin(U((l.highest.height+6)/o,-1,1)),Math.asin(U(s/c,-1,1))-Math.asin(U(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){F(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){F(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Ra(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=La(i)+a):(e.height=this.maxHeight,e.width=La(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=V(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){F(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ct(this._alignToPixels?Xt(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&eo*r?o/n:s/r:s*r0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+ +!!s,u=La(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Xt(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(j(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(j(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=P(r.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/ee));for(_=0;_0&&(a-=r/2);break}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-V(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);G.route(a,i,c,s)})}function qa(e){return`id`in e&&`defaults`in e}var Y=new class{constructor(){this.controllers=new Wa(si,`datasets`,!0),this.elements=new Wa(Ca,`elements`),this.plugins=new Wa(Object,`plugins`),this.scales=new Wa(Ua,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):I(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Re(e);F(n[`before`+r],[],n),t[e](n),F(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;te.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function Ya(e){let t={},n=[],r=Object.keys(Y.plugins.items);for(let e=0;e1&&no(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ao(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function oo(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return ao(e,`x`,n[0])||ao(e,`y`,n[0])}return{}}function so(e,t){let n=Ut[e.type]||{scales:{}},r=t.scales||{},i=$a(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!j(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=io(t,o,oo(t,e),G.scales[o.type]),c=to(s,i),l=n.scales||{};a[t]=Me(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||$a(i,t),s=(Ut[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=eo(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),Me(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];Me(t,[G.scales[t.type],G.scale])}),a}function co(e){let t=e.options||={};t.plugins=P(t.plugins,{}),t.scales=so(e,t)}function lo(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function uo(e){return e||={},e.data=lo(e.data),co(e),e}var fo=new Map,po=new Set;function mo(e,t){let n=fo.get(e);return n||(n=t(),fo.set(e,n),po.add(n)),n}var ho=(e,t,n)=>{let r=Le(t,n);r!==void 0&&e.add(r)},go=class{constructor(e){this._config=uo(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=lo(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),co(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return mo(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return mo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return mo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return mo(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>ho(s,e,t))),t.forEach(e=>ho(s,r,e)),t.forEach(e=>ho(s,Ut[i]||{},e)),t.forEach(e=>ho(s,G,e)),t.forEach(e=>ho(s,Wt,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),po.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Ut[t]||{},G.datasets[t]||{},{type:t},G,Wt]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=_o(this._resolverCache,e,r),s=a;if(yo(a,t)){i.$shared=!1,n=Be(n)?n():n;let t=this.createResolver(e,n,o);s=Sn(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=_o(this._resolverCache,e,n);return j(t)?Sn(i,t,void 0,r):i}};function _o(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:xn(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var vo=e=>j(e)&&Object.getOwnPropertyNames(e).some(t=>Be(e[t]));function yo(e,t){let{isScriptable:n,isIndexable:r}=Cn(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Be(o)||vo(o))||a&&A(o))return!0}return!1}var bo=`4.5.1`,xo=[`top`,`bottom`,`left`,`right`,`chartArea`];function So(e,t){return e===`top`||e===`bottom`||xo.indexOf(e)===-1&&t===`x`}function Co(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function wo(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),F(n&&n.onComplete,[e],t)}function To(e){let t=e.chart,n=t.options.animation;F(n&&n.onProgress,[e],t)}function Eo(e){return Xn()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Do={},Oo=e=>{let t=Eo(e);return Object.values(Do).filter(e=>e.canvas===t).pop()};function ko(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function Ao(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var jo=class{static defaults=G;static instances=Do;static overrides=Ut;static registry=Y;static version=bo;static getChart=Oo;static register(...e){Y.add(...e),Mo()}static unregister(...e){Y.remove(...e),Mo()}constructor(e,t){let n=this.config=new go(t),r=Eo(e),i=Oo(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(Sa(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=we(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ja,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=bt(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],Do[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}Fr.listen(this,`complete`,wo),Fr.listen(this,`progress`,To),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return k(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Y}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():lr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Zt(this.canvas,this.ctx),this}stop(){return Fr.stop(this),this}resize(e,t){Fr.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,lr(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),F(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){I(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=io(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),I(i,t=>{let i=t.options,a=i.id,o=io(a,i),s=P(i.type,t.dtype);(i.position===void 0||So(i.position,o)!==So(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(Y.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),I(r,(e,t)=>{e||delete n[t]}),I(n,e=>{J.configure(this,e,e.options),J.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;et.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(Co(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){I(this.scales,e=>{J.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!Ve(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)ko(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;ee.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;J.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],I(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Pr(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&tn(t,r),e.controller.draw(),r&&nn(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return en(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Li.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=bn(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);ze(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Fr.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};I(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){I(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},I(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});De(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=He(e),c=Ao(e,this._lastEvent,n,s);n&&(this._lastEvent=null,F(i.onHover,[e,o,this],this),s&&F(i.onClick,[e,o,this],this));let l=!De(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Mo(){return I(jo.instances,e=>e._plugins.invalidate())}function No(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,H(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,H(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*H(r-n));if(u===`round`)e.arc(i,a,t,n-L/2,r+L/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+L/2)+i,c=-o*Math.sin(n+L/2)+a,l=o*Math.cos(r+L/2)+i,u=o*Math.sin(r+L/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function Po(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+z,r-z),e.closePath(),e.clip()}function Fo(e){return hn(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function Io(e,t,n,r){let i=Fo(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return U(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:U(i.innerStart,0,o),innerEnd:U(i.innerEnd,0,o)}}function Lo(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Ro(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/L)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=Io(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,ee=g+b/E,O=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=Lo(C,T,o,s);e.arc(t.x,t.y,y,T,_+z)}let n=Lo(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=Lo(D,O,o,s);e.arc(t.x,t.y,x,_+z,O+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=Lo(E,ee,o,s);e.arc(t.x,t.y,b,ee+Math.PI,g-z)}let i=Lo(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=Lo(S,w,o,s);e.arc(t.x,t.y,v,g-z,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function zo(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Ro(e,t,n,r,c,i);for(let t=0;t=L&&p===0&&u!==`miter`&&No(e,t,h),a||(Ro(e,t,n,r,h,i),e.stroke())}var Vo=class extends Ca{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=it(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=P(l,o-a),f=st(r,a,o)&&a!==o,p=d>=R||f,m=lt(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>R?Math.floor(n/R):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(L,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,zo(e,this,s,i,a),Bo(e,this,s,i,a),e.restore()}};function Ho(e,t,n=t){e.lineCap=P(n.borderCapStyle,t.borderCapStyle),e.setLineDash(P(n.borderDash,t.borderDash)),e.lineDashOffset=P(n.borderDashOffset,t.borderDashOffset),e.lineJoin=P(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=P(n.borderWidth,t.borderWidth),e.strokeStyle=P(n.borderColor,t.borderColor)}function Uo(e,t,n){e.lineTo(n.x,n.y)}function Wo(e){return e.stepped?rn:e.tension||e.cubicInterpolationMode===`monotone`?an:Uo}function Go(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=is&&a>s;return{count:r,start:c,loop:t.loop,ilen:l(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(ng&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function Jo(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?qo:Ko}function Yo(e){return e.stepped?pr:e.tension||e.cubicInterpolationMode===`monotone`?mr:fr}function Xo(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Ho(e,t.options),e.stroke(i)}function Zo(e,t,n,r){let{segments:i,options:a}=t,o=Jo(t);for(let s of i)Ho(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var Qo=typeof Path2D==`function`;function $o(e,t,n,r){Qo&&!t.options.segment?Xo(e,t,n,r):Zo(e,t,n,r)}var es=class extends Ca{static id=`line`;static defaults={borderCapStyle:`butt`,borderDash:[],borderDashOffset:0,borderJoinStyle:`miter`,borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:`default`,fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`&&e!==`fill`};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Yn(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=Dr(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=wr(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=Yo(n),c,l;for(c=0,l=a.length;c{t=gs(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function gs(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function _s(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function vs(e,t){let n=[],r=!1;return A(e)?(r=!0,n=e):n=hs(e,t),n.length?new es({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function ys(e){return e&&e.fill!==!1}function bs(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!M(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function xs(e,t,n){let r=Ts(e);if(j(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return M(i)&&Math.floor(i)===i?Ss(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function Ss(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function Cs(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:j(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function ws(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:j(e)?e.value:t.getBaseValue(),r}function Ts(e){let t=e.options,n=t.fill,r=P(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function Es(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=Ds(t,n);s.push(vs({x:null,y:t.bottom},r));for(let e=0;e=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&Is(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;ys(n)&&Is(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;!ys(r)||n.drawTime!==`beforeDatasetDraw`||Is(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},Ws=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Gs=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Ks=class extends Ca{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=F(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=q(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=Ws(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=qs(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=_r(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=W(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=W(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=W(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=W(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;tn(e,this),this._draw(),nn(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=G.color,s=_r(e.rtl,this.left,this.width),c=q(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=Ws(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=P(n.lineWidth,1);if(r.fillStyle=P(n.fillStyle,o),r.lineCap=P(n.lineCap,`butt`),r.lineDashOffset=P(n.lineDashOffset,0),r.lineJoin=P(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=P(n.strokeStyle,o),r.setLineDash(P(n.lineDash,[])),a.usePointStyle)$t(r,{radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},s.xPlus(e,p/2),t+d,a.pointStyleWidth&&p);else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=_n(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?un(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){ln(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:W(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:W(i,this.top+y+l,this.bottom-t[0].height),line:0},vr(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;if(s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=W(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=W(i,this.top+y+l,this.bottom-t[f.line].height)),g(s.x(S),C,o),S=St(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=Xs(o,e)+l}else f.y+=b}),yr(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=q(t.font),r=K(t.padding);if(!t.display)return;let i=_r(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=W(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+W(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=W(o,u,u+d);a.textAlign=i.textAlign(xt(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,ln(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=q(e.font),n=K(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(lt(e,this.left,this.right)&<(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;ne.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function Ys(e,t,n){let r=e;return typeof t.text!=`string`&&(r=Xs(t,n)),r}function Xs(e,t){return t*(e.text?e.text.length:0)}function Zs(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var Qs={id:`legend`,_element:Ks,start(e,t,n){let r=e.legend=new Ks({ctx:e.ctx,options:n,chart:e});J.configure(e,r,n),J.addBox(e,r)},stop(e){J.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;J.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=K(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},$s=class extends Ca{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let r=A(n.text)?n.text.length:1;this._padding=K(n.padding);let i=r*q(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){let e=this.options.position;return e===`top`||e===`bottom`}_drawArgs(e){let{top:t,left:n,bottom:r,right:i,options:a}=this,o=a.align,s=0,c,l,u;return this.isHorizontal()?(l=W(o,n,i),u=t+e,c=i-n):(a.position===`left`?(l=n+e,u=W(o,r,t),s=L*-.5):(l=i-e,u=W(o,t,r),s=L*.5),c=r-t),{titleX:l,titleY:u,maxWidth:c,rotation:s}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let n=q(t.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:o,rotation:s}=this._drawArgs(r);ln(e,t.text,0,0,n,{color:t.color,maxWidth:o,rotation:s,textAlign:xt(t.align),textBaseline:`middle`,translation:[i,a]})}};function ec(e,t){let n=new $s({ctx:e.ctx,options:t,chart:e});J.configure(e,n,t),J.addBox(e,n),e.titleBlock=n}var tc={id:`title`,_element:$s,start(e,t,n){ec(e,n)},stop(e){let t=e.titleBlock;J.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let r=e.titleBlock;J.configure(e,r,n),r.options=n},defaults:{align:`center`,display:!1,font:{weight:`bold`},fullSize:!0,padding:10,position:`top`,text:``,weight:2e3},defaultRoutes:{color:`color`},descriptors:{_scriptable:!0,_indexable:!1}},nc={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;te+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;aMath.max(Math.min(e,n),t);function l(e){return c(s(e*2.55),0,255)}function u(e){return c(s(e*255),0,255)}function d(e){return c(s(e/2.55)/100,0,1)}function f(e){return c(s(e*100),0,100)}var p={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},m=[...`0123456789ABCDEF`],h=e=>m[e&15],g=e=>m[(e&240)>>4]+m[e&15],_=e=>(e&240)>>4==(e&15),v=e=>_(e.r)&&_(e.g)&&_(e.b)&&_(e.a);function y(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&p[e[1]]*17,g:255&p[e[2]]*17,b:255&p[e[3]]*17,a:t===5?p[e[4]]*17:255}:(t===7||t===9)&&(n={r:p[e[1]]<<4|p[e[2]],g:p[e[3]]<<4|p[e[4]],b:p[e[5]]<<4|p[e[6]],a:t===9?p[e[7]]<<4|p[e[8]]:255})),n}var b=(e,t)=>e<255?t(e):``;function x(e){var t=v(e)?h:g;return e?`#`+t(e.r)+t(e.g)+t(e.b)+b(e.a,t):void 0}var S=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function C(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function w(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function T(e,t,n){let r=C(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function E(e,t,n,r,i){return e===i?(t-n)/r+(t.5?l/(2-i-a):l/(i+a),s=E(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function ee(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(u)}function O(e,t,n){return ee(C,e,t,n)}function te(e,t,n){return ee(T,e,t,n)}function ne(e,t,n){return ee(w,e,t,n)}function re(e){return(e%360+360)%360}function ie(e){let t=S.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?l(+t[5]):u(+t[5]));let i=re(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?te(i,a,o):t[1]===`hsv`?ne(i,a,o):O(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function ae(e,t){var n=D(e);n[0]=re(n[0]+t),n=O(n),e.r=n[0],e.g=n[1],e.b=n[2]}function oe(e){if(!e)return;let t=D(e),n=t[0],r=f(t[1]),i=f(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${d(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var se={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`},ce={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function le(){let e={},t=Object.keys(ce),n=Object.keys(se),r,i,a,o,s;for(r=0;r>16&255,a>>8&255,a&255]}return e}var ue;function de(e){ue||(ue=le(),ue.transparent=[0,0,0,0]);let t=ue[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var fe=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function pe(e){let t=fe.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?l(e):c(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?l(r):c(r,0,255)),i=255&(t[4]?l(i):c(i,0,255)),a=255&(t[6]?l(a):c(a,0,255)),{r,g:i,b:a,a:n}}}function me(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${d(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var he=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,ge=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function _e(e,t,n){let r=ge(d(e.r)),i=ge(d(e.g)),a=ge(d(e.b));return{r:u(he(r+n*(ge(d(t.r))-r))),g:u(he(i+n*(ge(d(t.g))-i))),b:u(he(a+n*(ge(d(t.b))-a))),a:e.a+n*(t.a-e.a)}}function ve(e,t,n){if(e){let r=D(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=O(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function ye(e,t){return e&&Object.assign(t||{},e)}function be(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=u(e[3]))):(t=ye(e,{r:0,g:0,b:0,a:1}),t.a=u(t.a)),t}function xe(e){return e.charAt(0)===`r`?pe(e):ie(e)}var Se=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=be(t):n===`string`&&(r=y(t)||de(t)||xe(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=ye(this._rgb);return e&&(e.a=d(e.a)),e}set rgb(e){this._rgb=be(e)}rgbString(){return this._valid?me(this._rgb):void 0}hexString(){return this._valid?x(this._rgb):void 0}hslString(){return this._valid?oe(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=_e(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=u(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=s(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return ve(this._rgb,2,e),this}darken(e){return ve(this._rgb,2,-e),this}saturate(e){return ve(this._rgb,1,e),this}desaturate(e){return ve(this._rgb,1,-e),this}rotate(e){return ae(this._rgb,e),this}};function Ce(){}var we=(()=>{let e=0;return()=>e++})();function k(e){return e==null}function A(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function j(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function M(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function N(e,t){return M(e)?e:t}function P(e,t){return e===void 0?t:e}var Te=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,Ee=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function F(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function I(e,t,n,r){let i,a,o;if(A(e))if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;ie,x:e=>e.x,y:e=>e.y};function Fe(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function Ie(e){let t=Fe(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Le(e,t){return(Pe[t]||(Pe[t]=Ie(t)))(e)}function Re(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ze=e=>e!==void 0,Be=e=>typeof e==`function`,Ve=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function He(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var L=Math.PI,R=2*L,Ue=R+L,We=1/0,Ge=L/180,z=L/2,Ke=L/4,qe=L*2/3,Je=Math.log10,B=Math.sign;function Ye(e,t,n){return Math.abs(e-t)e-t).pop(),t}function Qe(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function $e(e){return!Qe(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function et(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function tt(e,t,n){let r,i,a;for(r=0,i=e.length;rc&&l=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ut(e,t,n){n||=(n=>e[n]1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var dt=(e,t,n,r)=>ut(e,n,r?r=>{let i=e[r][t];return ie[r][t]ut(e,n,r=>e[r][t]>=n);function pt(e,t,n){let r=0,i=e.length;for(;rr&&e[i-1]>n;)i--;return r>0||i{let n=`_onData`+Re(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function gt(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(mt.forEach(t=>{delete e[t]}),delete e._chartjs)}function _t(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var vt=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function yt(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,vt.call(window,()=>{r=!1,e.apply(t,n)}))}}function bt(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var xt=e=>e===`start`?`left`:e===`end`?`right`:`center`,W=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,St=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function Ct(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(dt(c,u,d).lo,n?r:dt(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!k(e[s.axis]));i-=Math.max(0,e)}i=U(i,0,r-1)}if(m){let e=Math.max(dt(c,o.axis,f,!0).hi+1,n?0:dt(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!k(e[s.axis]));e+=Math.max(0,t)}a=U(e,i,r)-i}else a=r-i}return{start:i,count:a}}function wt(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var Tt=e=>e===0||e===1,Et=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*R/n)),Dt=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*R/n)+1,Ot={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*z)+1,easeOutSine:e=>Math.sin(e*z),easeInOutSine:e=>-.5*(Math.cos(L*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>Tt(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Tt(e)?e:Et(e,.075,.3),easeOutElastic:e=>Tt(e)?e:Dt(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return Tt(e)?e:e<.5?.5*Et(e*2,t,n):.5+.5*Dt(e*2-1,t,n)},easeInBack(e){let t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){let t=1.70158;return--e*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Ot.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?Ot.easeInBounce(e*2)*.5:Ot.easeOutBounce(e*2-1)*.5+.5};function kt(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function At(e){return kt(e)?e:new Se(e)}function jt(e){return kt(e)?e:new Se(e).saturate(.5).darken(.1).hexString()}var Mt=[`x`,`y`,`borderWidth`,`radius`,`tension`],Nt=[`color`,`borderColor`,`backgroundColor`];function Pt(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:Nt},numbers:{type:`number`,properties:Mt}}),e.describe(`animations`,{_fallback:`animation`}),e.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:e=>e|0}}}})}function Ft(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var It=new Map;function Lt(e,t){t||={};let n=e+JSON.stringify(t),r=It.get(n);return r||(r=new Intl.NumberFormat(e,t),It.set(n,r)),r}function Rt(e,t,n){return Lt(t,n).format(e)}var zt={values(e){return A(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Bt(e,n)}let o=Je(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Rt(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Je(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?zt.numeric.call(this,e,t,n):``}};function Bt(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Vt={formatters:zt};function Ht(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Vt.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var Ut=Object.create(null),Wt=Object.create(null);function Gt(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;te.chart.platform.getDevicePixelRatio(),this.elements={},this.events=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],this.font={family:`'Helvetica Neue', 'Helvetica', 'Arial', sans-serif`,size:12,style:`normal`,lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>jt(t.backgroundColor),this.hoverBorderColor=(e,t)=>jt(t.borderColor),this.hoverColor=(e,t)=>jt(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return Kt(this,e,t)}get(e){return Gt(this,e)}describe(e,t){return Kt(Wt,e,t)}override(e,t){return Kt(Ut,e,t)}route(e,t,n,r){let i=Gt(this,e),a=Gt(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return j(e)?Object.assign({},t,e):P(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Pt,Ft,Ht]);function qt(e){return!e||k(e.size)||k(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Jt(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Yt(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;cn.length){for(c=0;c0&&e.stroke()}}function en(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,on(e,a),c=0;c+e||0;function hn(e,t){let n={},r=j(t),i=r?Object.keys(t):t,a=j(e)?r?n=>P(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=mn(a(e));return n}function gn(e){return hn(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function _n(e){return hn(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function K(e){let t=gn(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function q(e,t){e||={},t||=G.font;let n=P(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=P(e.style,t.style);r&&!(``+r).match(fn)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:P(e.family,t.family),lineHeight:pn(P(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:P(e.weight,t.weight),string:``};return i.string=qt(i),i}function vn(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;an&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function bn(e,t){return Object.assign(Object.create(e),t)}function xn(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=Ln(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>xn([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return En(n,r,()=>In(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Rn(e).includes(t)},ownKeys(e){return Rn(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function Sn(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Cn(e,r),setContext:t=>Sn(e,t,n,r),override:i=>Sn(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return En(e,t,()=>Dn(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function Cn(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Be(n)?n:()=>n,isIndexable:Be(r)?r:()=>r}}var wn=(e,t)=>e?e+Re(t):t,Tn=(e,t)=>j(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function En(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function Dn(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Be(s)&&o.isScriptable(t)&&(s=On(t,s,e,n)),A(s)&&s.length&&(s=kn(t,s,e,o.isIndexable)),Tn(t,s)&&(s=Sn(s,i,a&&a[t],o)),s}function On(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),Tn(e,c)&&(c=Nn(i._scopes,i,e,c)),c}function kn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(j(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Nn(r,i,e,c);t.push(Sn(n,a,o&&o[e],s))}}return t}function An(e,t,n){return Be(e)?e(t,n):e}var jn=(e,t)=>e===!0?t:typeof e==`string`?Le(t,e):void 0;function Mn(e,t,n,r,i){for(let a of t){let t=jn(n,a);if(t){e.add(t);let a=An(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Nn(e,t,n,r){let i=t._rootScopes,a=An(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Pn(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Pn(s,o,a,c,r),c===null)?!1:xn(Array.from(s),[``],i,a,()=>Fn(t,n,r))}function Pn(e,t,n,r,i){for(;n;)n=Mn(e,t,n,r,i);return n}function Fn(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return A(i)&&j(n)?n:i||{}}function In(e,t,n,r){let i;for(let a of t)if(i=Ln(wn(a,e),n),i!==void 0)return Tn(e,i)?Nn(n,r,e,i):i}function Ln(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Rn(e){let t=e._keys;return t||=e._keys=zn(e._scopes),t}function zn(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}var Bn=2**-52||1e-14,Vn=(e,t)=>te===`x`?`y`:`x`;function Un(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=at(a,i),c=at(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function Wn(e,t,n){let r=e.length,i,a,o,s,c,l=Vn(e,0);for(let u=0;u!e.skip)),t.cubicInterpolationMode===`monotone`)Kn(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;ae.ownerDocument.defaultView.getComputedStyle(e,null);function er(e,t){return $n(e).getPropertyValue(t)}var tr=[`top`,`right`,`bottom`,`left`];function nr(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=tr[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var rr=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function ir(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(rr(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function ar(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=$n(n),a=i.boxSizing===`border-box`,o=nr(i,`padding`),s=nr(i,`border`,`width`),{x:c,y:l,box:u}=ir(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function or(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&Zn(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=$n(a),s=nr(o,`border`,`width`),c=nr(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Qn(o.maxWidth,a,`clientWidth`),i=Qn(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||We,maxHeight:i||We}}var sr=e=>Math.round(e*10)/10;function cr(e,t,n,r){let i=$n(e),a=nr(i,`margin`),o=Qn(i.maxWidth,e,`clientWidth`)||We,s=Qn(i.maxHeight,e,`clientHeight`)||We,c=or(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=nr(i,`border`,`width`),t=nr(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=sr(Math.min(l,o,c.maxWidth)),u=sr(Math.min(u,s,c.maxHeight)),l&&!u&&(u=sr(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=sr(Math.floor(u*r))),{width:l,height:u}}function lr(e,t,n){let r=t||1,i=sr(e.height*r),a=sr(e.width*r);e.height=sr(e.height),e.width=sr(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var ur=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Xn()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function dr(e,t){let n=er(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function fr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function pr(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function mr(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=fr(e,i,n),s=fr(i,a,n),c=fr(a,t,n);return fr(fr(o,s,n),fr(s,c,n),n)}var hr=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},gr=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function _r(e,t,n){return e?hr(t,n):gr()}function vr(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function yr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function br(e){return e===`angle`?{between:st,compare:ot,normalize:H}:{between:lt,compare:(e,t)=>e-t,normalize:e=>e}}function xr({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function Sr(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=br(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;fc(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(xr({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(xr({start:g,end:d,loop:f,count:o,style:p})),m}function wr(e,t){let n=[],r=e.segments;for(let i=0;ii&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function Er(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function Dr(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=Tr(n,i,a,r);return r===!0?Or(e,[{start:o,end:s,loop:a}],n,t):Or(e,Er(n,o,sr({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,vt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},Ir=`transparent`,Lr={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=At(e||Ir),i=r.valid&&At(t||Ir);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Rr=class{constructor(e,t,n,r){let i=t[n];r=vn([e.to,r,i,e.from]);let a=vn([e.from,i,r]);this._active=!0,this._fn=e.fn||Lr[e.type||typeof a],this._easing=Ot[e.easing]||Ot.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=vn([e.to,t,r,e.from]),this._from=vn([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e{let i=e[r];if(!j(i))return;let a={};for(let e of t)a[e]=i[e];(A(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Vr(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&Br(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,l,o);continue}else u.cancel();if(!d||!d.duration){e[c]=l;continue}i[c]=u=new Rr(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Fr.add(this._chart,n),!0}};function Br(e,t){let n=[],r=Object.keys(t);for(let t=0;t0||!n&&t<0)return i.index}return null}function $r(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Yr(a,o,r),d=t.length,f;for(let e=0;en[e].axis===t).shift()}function ti(e,t){return bn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function ni(e,t,n){return bn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function ri(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var ii=e=>e===`reset`||e===`none`,ai=(e,t)=>t?e:Object.assign({},e),oi=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Gr(n,!0),values:null},si=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Jr(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled(`filler`)&&console.warn(`Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options`)}updateIndex(e){this.index!==e&&ri(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=P(n.xAxisID,ei(e,`x`)),a=t.yAxisID=P(n.yAxisID,ei(e,`y`)),o=t.rAxisID=P(n.rAxisID,ei(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&>(this._data,this),e._stacked&&ri(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(j(t)){let e=this._cachedMeta;this._data=qr(t,e)}else if(n!==t){if(n){gt(n,this);let e=this._cachedMeta;ri(e),e._parsed=[]}t&&Object.isExtensible(t)&&ht(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Jr(t.vScale,t),t.stack!==n.stack&&(r=!0,ri(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&($r(this,t._parsed),t._stacked=Jr(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length?!0:n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=A(r[e])?this.parseArrayData(n,r,e,t):j(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]t||u=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r=0&&ethis.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(ai(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new zr(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||ii(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){ii(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!ii(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;oe-t))}return e._cache.$bar}function li(e){let t=e.iScale,n=ci(t,e.type),r=t._length,i,a,o,s,c=()=>{o===32767||o===-32768||(ze(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i0?i[e-1]:null,s=eMath.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function pi(e,t,n,r){return A(e)?fi(e,t,n,r):t[n.axis]=n.parse(e,r),t}function mi(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l=n?1:-1):B(e)}function _i(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.basee.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(k(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[P(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;ist(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>st(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(z,u,f),_=m(L,l,d),v=m(L+z,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var Ti=class extends si{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(j(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Le(n[t],e)}let a,o;for(a=e,o=e+t;a0&&!isNaN(e)?Math.abs(e)/t*R:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Rt(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r0&&this.getParsed(t-1);for(let n=0;n=_){v.skip=!0;continue}let b=this.getParsed(n),x=k(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}};function Di(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var Oi={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Di()}parse(){return Di()}format(){return Di()}add(){return Di()}diff(){return Di()}startOf(){return Di()}endOf(){return Di()}}};function ki(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ft:dt;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!k(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!k(e[t.axis]));r.hi+=Math.max(0,o)}return r}else if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function Ai(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Li={evaluateInteractionItems:Ai,modes:{index(e,t,n,r){let i=ar(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Mi(e,i,a,r,o):Fi(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=ar(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Mi(e,i,a,r,o):Fi(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;ee.pos===t)}function Bi(e,t){return e.filter(e=>Ri.indexOf(e.pos)===-1&&e.box.axis===t)}function Vi(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function Hi(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;ne.box.fullSize),!0),r=Vi(zi(t,`left`),!0),i=Vi(zi(t,`right`)),a=Vi(zi(t,`top`),!0),o=Vi(zi(t,`bottom`)),s=Bi(t,`x`),c=Bi(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:zi(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function Ki(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function qi(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Ji(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!j(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&qi(o,a.getPadding());let s=Math.max(0,t.outerWidth-Ki(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-Ki(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function Yi(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function Xi(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function Zi(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);qi(f,K(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Wi(c.concat(l),d);Zi(s.fullSize,p,d,m),Zi(c,p,d,m),Zi(l,p,d,m)&&Zi(c,p,d,m),Yi(p),$i(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,$i(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},I(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},ea=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},ta=class extends ea{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},na=`$chartjs`,ra={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},ia=e=>e===null||e===``;function aa(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[na]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,ia(i)){let t=dr(e,`width`);t!==void 0&&(e.width=t)}if(ia(r))if(e.style.height===``)e.height=e.width/(t||2);else{let t=dr(e,`height`);t!==void 0&&(e.height=t)}return e}var oa=ur?{passive:!0}:!1;function sa(e,t,n){e&&e.addEventListener(t,n,oa)}function ca(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,oa)}function la(e,t){let n=ra[e.type]||e.type,{x:r,y:i}=ar(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function ua(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function da(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ua(n.addedNodes,r),t&&=!ua(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function fa(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ua(n.removedNodes,r),t&&=!ua(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var pa=new Map,ma=0;function ha(){let e=window.devicePixelRatio;e!==ma&&(ma=e,pa.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function ga(e,t){pa.size||window.addEventListener(`resize`,ha),pa.set(e,t)}function _a(e){pa.delete(e),pa.size||window.removeEventListener(`resize`,ha)}function va(e,t,n){let r=e.canvas,i=r&&Zn(r);if(!i)return;let a=yt((e,t)=>{let r=i.clientWidth;n(e,t),r{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0&&r===0||a(n,r)});return o.observe(i),ga(e,a),o}function ya(e,t,n){n&&n.disconnect(),t===`resize`&&_a(e)}function ba(e,t,n){let r=e.canvas,i=yt(t=>{e.ctx!==null&&n(la(t,e))},e);return sa(r,t,i),i}var xa=class extends ea{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(aa(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[na])return!1;let n=t[na].initial;[`height`,`width`].forEach(e=>{let r=n[e];k(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[na],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:da,detach:fa,resize:va}[t]||ba)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:ya,detach:ya,resize:ya}[t]||ca)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return cr(e,t,n,r)}isAttached(e){let t=e&&Zn(e);return!!(t&&t.isConnected)}};function Sa(e){return!Xn()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?ta:xa}var Ca=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return $e(this.x)&&$e(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function wa(e,t){let n=e.options.ticks,r=Ta(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?Da(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Oa(t,l,a,o/i),l;let u=Ea(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(ka(t,l,u,k(r)?0:s-r,s),e=0,n=o-1;ei)return t}return Math.max(i,1)}function Da(e){let t=[],n,r;for(n=0,r=e.length;ne===`left`?`right`:e===`right`?`left`:e,Ma=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Na=(e,t)=>Math.min(t||e,e);function Pa(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;ao+s)))return c}function Ia(e,t){I(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;in?n:t,n=r&&t>n?t:n,{min:N(t,N(n,t)),max:N(n,N(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){F(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=yn(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=U(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-La(e.grid)-t.padding-Ra(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=nt(Math.min(Math.asin(U((l.highest.height+6)/o,-1,1)),Math.asin(U(s/c,-1,1))-Math.asin(U(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){F(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){F(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=Ra(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=La(i)+a):(e.height=this.maxHeight,e.width=La(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=V(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){F(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ct(this._alignToPixels?Xt(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&eo*r?o/n:s/r:s*r0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+ +!!s,u=La(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Xt(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(j(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(j(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=P(r.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/ee));for(_=0;_0&&(a-=r/2);break}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-V(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);G.route(a,i,c,s)})}function qa(e){return`id`in e&&`defaults`in e}var Y=new class{constructor(){this.controllers=new Wa(si,`datasets`,!0),this.elements=new Wa(Ca,`elements`),this.plugins=new Wa(Object,`plugins`),this.scales=new Wa(Ua,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):I(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Re(e);F(n[`before`+r],[],n),t[e](n),F(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;te.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function Ya(e){let t={},n=[],r=Object.keys(Y.plugins.items);for(let e=0;e1&&no(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ao(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function oo(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return ao(e,`x`,n[0])||ao(e,`y`,n[0])}return{}}function so(e,t){let n=Ut[e.type]||{scales:{}},r=t.scales||{},i=$a(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!j(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=io(t,o,oo(t,e),G.scales[o.type]),c=to(s,i),l=n.scales||{};a[t]=Me(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||$a(i,t),s=(Ut[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=eo(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),Me(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];Me(t,[G.scales[t.type],G.scale])}),a}function co(e){let t=e.options||={};t.plugins=P(t.plugins,{}),t.scales=so(e,t)}function lo(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function uo(e){return e||={},e.data=lo(e.data),co(e),e}var fo=new Map,po=new Set;function mo(e,t){let n=fo.get(e);return n||(n=t(),fo.set(e,n),po.add(n)),n}var ho=(e,t,n)=>{let r=Le(t,n);r!==void 0&&e.add(r)},go=class{constructor(e){this._config=uo(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=lo(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),co(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return mo(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return mo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return mo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return mo(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>ho(s,e,t))),t.forEach(e=>ho(s,r,e)),t.forEach(e=>ho(s,Ut[i]||{},e)),t.forEach(e=>ho(s,G,e)),t.forEach(e=>ho(s,Wt,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),po.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Ut[t]||{},G.datasets[t]||{},{type:t},G,Wt]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=_o(this._resolverCache,e,r),s=a;if(yo(a,t)){i.$shared=!1,n=Be(n)?n():n;let t=this.createResolver(e,n,o);s=Sn(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=_o(this._resolverCache,e,n);return j(t)?Sn(i,t,void 0,r):i}};function _o(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:xn(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var vo=e=>j(e)&&Object.getOwnPropertyNames(e).some(t=>Be(e[t]));function yo(e,t){let{isScriptable:n,isIndexable:r}=Cn(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Be(o)||vo(o))||a&&A(o))return!0}return!1}var bo=`4.5.1`,xo=[`top`,`bottom`,`left`,`right`,`chartArea`];function So(e,t){return e===`top`||e===`bottom`||xo.indexOf(e)===-1&&t===`x`}function Co(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function wo(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),F(n&&n.onComplete,[e],t)}function To(e){let t=e.chart,n=t.options.animation;F(n&&n.onProgress,[e],t)}function Eo(e){return Xn()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Do={},Oo=e=>{let t=Eo(e);return Object.values(Do).filter(e=>e.canvas===t).pop()};function ko(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function Ao(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var jo=class{static defaults=G;static instances=Do;static overrides=Ut;static registry=Y;static version=bo;static getChart=Oo;static register(...e){Y.add(...e),Mo()}static unregister(...e){Y.remove(...e),Mo()}constructor(e,t){let n=this.config=new go(t),r=Eo(e),i=Oo(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(Sa(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=we(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ja,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=bt(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],Do[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}Fr.listen(this,`complete`,wo),Fr.listen(this,`progress`,To),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return k(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Y}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():lr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Zt(this.canvas,this.ctx),this}stop(){return Fr.stop(this),this}resize(e,t){Fr.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,lr(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),F(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){I(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=io(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),I(i,t=>{let i=t.options,a=i.id,o=io(a,i),s=P(i.type,t.dtype);(i.position===void 0||So(i.position,o)!==So(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(Y.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),I(r,(e,t)=>{e||delete n[t]}),I(n,e=>{J.configure(this,e,e.options),J.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;et.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(Co(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){I(this.scales,e=>{J.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!Ve(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)ko(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;ee.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;J.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],I(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Pr(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&tn(t,r),e.controller.draw(),r&&nn(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return en(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Li.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=bn(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);ze(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Fr.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};I(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){I(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},I(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});De(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=He(e),c=Ao(e,this._lastEvent,n,s);n&&(this._lastEvent=null,F(i.onHover,[e,o,this],this),s&&F(i.onClick,[e,o,this],this));let l=!De(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Mo(){return I(jo.instances,e=>e._plugins.invalidate())}function No(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,H(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,H(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*H(r-n));if(u===`round`)e.arc(i,a,t,n-L/2,r+L/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+L/2)+i,c=-o*Math.sin(n+L/2)+a,l=o*Math.cos(r+L/2)+i,u=o*Math.sin(r+L/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function Po(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+z,r-z),e.closePath(),e.clip()}function Fo(e){return hn(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function Io(e,t,n,r){let i=Fo(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return U(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:U(i.innerStart,0,o),innerEnd:U(i.innerEnd,0,o)}}function Lo(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Ro(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/L)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=Io(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,ee=g+b/E,O=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=Lo(C,T,o,s);e.arc(t.x,t.y,y,T,_+z)}let n=Lo(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=Lo(D,O,o,s);e.arc(t.x,t.y,x,_+z,O+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=Lo(E,ee,o,s);e.arc(t.x,t.y,b,ee+Math.PI,g-z)}let i=Lo(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=Lo(S,w,o,s);e.arc(t.x,t.y,v,g-z,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function zo(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Ro(e,t,n,r,c,i);for(let t=0;t=L&&p===0&&u!==`miter`&&No(e,t,h),a||(Ro(e,t,n,r,h,i),e.stroke())}var Vo=class extends Ca{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=it(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=P(l,o-a),f=st(r,a,o)&&a!==o,p=d>=R||f,m=lt(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>R?Math.floor(n/R):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(L,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,zo(e,this,s,i,a),Bo(e,this,s,i,a),e.restore()}};function Ho(e,t,n=t){e.lineCap=P(n.borderCapStyle,t.borderCapStyle),e.setLineDash(P(n.borderDash,t.borderDash)),e.lineDashOffset=P(n.borderDashOffset,t.borderDashOffset),e.lineJoin=P(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=P(n.borderWidth,t.borderWidth),e.strokeStyle=P(n.borderColor,t.borderColor)}function Uo(e,t,n){e.lineTo(n.x,n.y)}function Wo(e){return e.stepped?rn:e.tension||e.cubicInterpolationMode===`monotone`?an:Uo}function Go(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=is&&a>s;return{count:r,start:c,loop:t.loop,ilen:l(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(ng&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function Jo(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?qo:Ko}function Yo(e){return e.stepped?pr:e.tension||e.cubicInterpolationMode===`monotone`?mr:fr}function Xo(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Ho(e,t.options),e.stroke(i)}function Zo(e,t,n,r){let{segments:i,options:a}=t,o=Jo(t);for(let s of i)Ho(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var Qo=typeof Path2D==`function`;function $o(e,t,n,r){Qo&&!t.options.segment?Xo(e,t,n,r):Zo(e,t,n,r)}var es=class extends Ca{static id=`line`;static defaults={borderCapStyle:`butt`,borderDash:[],borderDashOffset:0,borderJoinStyle:`miter`,borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:`default`,fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`&&e!==`fill`};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Yn(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=Dr(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=wr(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=Yo(n),c,l;for(c=0,l=a.length;c{t=gs(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function gs(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function _s(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function vs(e,t){let n=[],r=!1;return A(e)?(r=!0,n=e):n=hs(e,t),n.length?new es({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function ys(e){return e&&e.fill!==!1}function bs(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!M(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function xs(e,t,n){let r=Ts(e);if(j(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return M(i)&&Math.floor(i)===i?Ss(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function Ss(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function Cs(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:j(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function ws(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:j(e)?e.value:t.getBaseValue(),r}function Ts(e){let t=e.options,n=t.fill,r=P(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function Es(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=Ds(t,n);s.push(vs({x:null,y:t.bottom},r));for(let e=0;e=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&Is(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;ys(n)&&Is(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;!ys(r)||n.drawTime!==`beforeDatasetDraw`||Is(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},Ws=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Gs=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Ks=class extends Ca{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=F(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=q(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=Ws(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=qs(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=_r(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=W(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=W(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=W(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=W(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;tn(e,this),this._draw(),nn(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=G.color,s=_r(e.rtl,this.left,this.width),c=q(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=Ws(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=P(n.lineWidth,1);if(r.fillStyle=P(n.fillStyle,o),r.lineCap=P(n.lineCap,`butt`),r.lineDashOffset=P(n.lineDashOffset,0),r.lineJoin=P(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=P(n.strokeStyle,o),r.setLineDash(P(n.lineDash,[])),a.usePointStyle)$t(r,{radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},s.xPlus(e,p/2),t+d,a.pointStyleWidth&&p);else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=_n(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?un(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){ln(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:W(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:W(i,this.top+y+l,this.bottom-t[0].height),line:0},vr(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;if(s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=W(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=W(i,this.top+y+l,this.bottom-t[f.line].height)),g(s.x(S),C,o),S=St(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=Xs(o,e)+l}else f.y+=b}),yr(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=q(t.font),r=K(t.padding);if(!t.display)return;let i=_r(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=W(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+W(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=W(o,u,u+d);a.textAlign=i.textAlign(xt(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,ln(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=q(e.font),n=K(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(lt(e,this.left,this.right)&<(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;ne.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function Ys(e,t,n){let r=e;return typeof t.text!=`string`&&(r=Xs(t,n)),r}function Xs(e,t){return t*(e.text?e.text.length:0)}function Zs(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var Qs={id:`legend`,_element:Ks,start(e,t,n){let r=e.legend=new Ks({ctx:e.ctx,options:n,chart:e});J.configure(e,r,n),J.addBox(e,r)},stop(e){J.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;J.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=K(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},$s=class extends Ca{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let r=A(n.text)?n.text.length:1;this._padding=K(n.padding);let i=r*q(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){let e=this.options.position;return e===`top`||e===`bottom`}_drawArgs(e){let{top:t,left:n,bottom:r,right:i,options:a}=this,o=a.align,s=0,c,l,u;return this.isHorizontal()?(l=W(o,n,i),u=t+e,c=i-n):(a.position===`left`?(l=n+e,u=W(o,r,t),s=L*-.5):(l=i-e,u=W(o,t,r),s=L*.5),c=r-t),{titleX:l,titleY:u,maxWidth:c,rotation:s}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let n=q(t.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:o,rotation:s}=this._drawArgs(r);ln(e,t.text,0,0,n,{color:t.color,maxWidth:o,rotation:s,textAlign:xt(t.align),textBaseline:`middle`,translation:[i,a]})}};function ec(e,t){let n=new $s({ctx:e.ctx,options:t,chart:e});J.configure(e,n,t),J.addBox(e,n),e.titleBlock=n}var tc={id:`title`,_element:$s,start(e,t,n){ec(e,n)},stop(e){let t=e.titleBlock;J.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let r=e.titleBlock;J.configure(e,r,n),r.options=n},defaults:{align:`center`,display:!1,font:{weight:`bold`},fullSize:!0,padding:10,position:`top`,text:``,weight:2e3},defaultRoutes:{color:`color`},descriptors:{_scriptable:!0,_indexable:!1}},nc={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;te+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a-1?e.split(` `):e}function ic(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function ac(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=q(t.bodyFont),l=q(t.titleFont),u=q(t.footerFont),d=a.length,f=i.length,p=r.length,m=K(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,I(e.title,y),n.font=c.string,I(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,I(r,e=>{I(e.before,y),I(e.lines,y),I(e.after,y)}),v=0,n.font=u.string,I(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function oc(e,t){let{y:n,height:r}=t;return ne.height-r/2?`bottom`:`center`}function sc(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function cc(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),sc(l,e,t,n)&&(l=`center`),l}function lc(e,t,n){let r=n.yAlign||t.yAlign||oc(e,n);return{xAlign:n.xAlign||t.xAlign||cc(e,t,n,r),yAlign:r}}function uc(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function dc(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:t===`bottom`?r-=i+n:r-=i/2,r}function fc(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=_n(o),m=uc(t,s),h=dc(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:U(m,0,r.width-t.width),y:U(h,0,r.height-t.height)}}function pc(e,t,n){let r=K(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function mc(e){return X([],rc(e))}function hc(e,t,n){return bn(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function gc(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var _c={beforeTitle:Ce,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex{let t={before:[],lines:[],after:[]},i=gc(n,e);X(t.before,rc(Z(i,`beforeLabel`,this,e))),X(t.lines,Z(i,`label`,this,e)),X(t.after,rc(Z(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return mc(Z(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=Z(n,`beforeFooter`,this,e),i=Z(n,`footer`,this,e),a=Z(n,`afterFooter`,this,e),o=[];return o=X(o,rc(r)),o=X(o,rc(i)),o=X(o,rc(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;se.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),I(o,t=>{let n=gc(e.callbacks,t);r.push(Z(n,`labelColor`,this,t)),i.push(Z(n,`labelPointStyle`,this,t)),a.push(Z(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=nc[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=ac(this,n),o=Object.assign({},e,t),s=lc(this.chart,n,o),c=fc(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=_n(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=_r(n.rtl,this.x,this.width);for(e.x=pc(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=q(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;se!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,un(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),un(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=q(n.bodyFont),d=u.lineHeight,f=0,p=_r(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=pc(this,h,n),t.fillStyle=n.bodyColor,I(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=nc[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=ac(this,e),o=Object.assign({},n,this._size),s=lc(t,e,o),c=fc(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=K(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),vr(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),yr(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!De(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!De(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=nc[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},yc={id:`tooltip`,_element:vc,positioners:nc,afterInit(e,t,n){n&&(e.tooltip=new vc({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:`average`,backgroundColor:`rgba(0,0,0,0.8)`,titleColor:`#fff`,titleFont:{weight:`bold`},titleSpacing:2,titleMarginBottom:6,titleAlign:`left`,bodyColor:`#fff`,bodySpacing:2,bodyFont:{},bodyAlign:`left`,footerColor:`#fff`,footerSpacing:2,footerMarginTop:6,footerFont:{weight:`bold`},footerAlign:`left`,padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:`#fff`,displayColors:!0,boxPadding:0,borderColor:`rgba(0,0,0,0)`,borderWidth:0,animation:{duration:400,easing:`easeOutQuart`},animations:{numbers:{type:`number`,properties:[`x`,`y`,`width`,`height`,`caretX`,`caretY`]},opacity:{easing:`linear`,duration:200}},callbacks:_c},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},bc=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function xc(e,t,n,r){let i=e.indexOf(t);return i===-1?bc(e,t,n,r):i===e.lastIndexOf(t)?i:n}var Sc=(e,t)=>e===null?null:U(Math.round(e),0,t);function Cc(e){let t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function Tc(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!k(a),_=!k(o),v=!k(c),y=(h-m)/(u+1),b=Xe((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=Xe(w*b/p/f)*f),k(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&et((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Ye(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(rt(b),rt(S));x=10**(k(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),So)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Ye(n[n.length-1].value,o,Ec(o,y,e))?n[n.length-1].value=o:n.push({value:o}):(!_||C===o)&&n.push({value:C}),n}function Ec(e,t,{horizontal:n,minRotation:r}){let i=V(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var Dc=class extends Ua{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return k(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=B(r),t=B(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=Tc({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&tt(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return Rt(e,this.chart.options.locale,this.options.ticks.format)}},Oc=class extends Dc{static id=`linear`;static defaults={ticks:{callback:Vt.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=M(e)?e:0,this.max=M(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=V(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},kc=e=>Math.floor(Je(e)),Ac=(e,t)=>10**(kc(e)+t);function jc(e){return e/10**kc(e)==1}function Mc(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function Nc(e,t){let n=kc(t-e);for(;Mc(e,t,n)>10;)n++;for(;Mc(e,t,n)<10;)n--;return Math.min(n,kc(e))}function Pc(e,{min:t,max:n}){t=N(e.min,t);let r=[],i=kc(t),a=Nc(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=N(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=N(e.max,f);return r.push({value:p,major:jc(p),significand:d}),r}(class extends Ua{static id=`logarithmic`;static defaults={ticks:{callback:Vt.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=Dc.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return M(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=M(e)?Math.max(0,e):null,this.max=M(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!M(this._userMin)&&(this.min=e===Ac(this.min,0)?Ac(this.min,-1):Ac(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(Ac(n,-1)),a(Ac(r,1)))),n<=0&&i(Ac(r,-1)),r<=0&&a(Ac(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=Pc({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&tt(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:Rt(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Je(e),this._valueRange=Je(this.max)-Je(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Je(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}});function Fc(e){let t=e.ticks;if(t.display&&e.display){let e=K(t.backdropPadding);return P(t.font&&t.font.size,G.font.size)+e.height}return 0}function Ic(e,t,n){return n=A(n)?n:[n],{w:Yt(e,t.string,n),h:n.length*t.lineHeight}}function Lc(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function Rc(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?L/a:0;for(let c=0;ct.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.startt.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function Bc(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(nt(H(c.angle+z))),u=Gc(c.y,s.h,l),d=Uc(l),f=Wc(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function Vc(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(en({x:n,y:r},t)||en({x:n,y:a},t)||en({x:i,y:r},t)||en({x:i,y:a},t))}function Hc(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:Fc(a)/2,additionalAngle:o?L/i:0},l;for(let a=0;a270||n<90)&&(e-=t),e}function Kc(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!k(s)){let n=_n(t.borderRadius),c=K(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),un(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function qc(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));Kc(n,a,t);let o=q(a.font),{x:s,y:c,textAlign:l}=t;ln(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function Jc(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,R);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a{let n=F(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?Rc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=R/(this._pointLabels.length||1),n=this.options.startAngle||0;return H(e*t+V(n))}getDistanceFromCenterForValue(e){if(k(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(k(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);Yc(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;!a||!i||(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=q(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=K(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}ln(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}});var Zc={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Q=Object.keys(Zc);function Qc(e,t){return e-t}function $c(e,t){if(k(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),M(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&($e(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function el(e,t,n,r){let i=Q.length;for(let a=Q.indexOf(e);a=Q.indexOf(n);a--){let n=Q[a];if(Zc[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return Q[n?Q.indexOf(n):0]}function nl(e){for(let t=Q.indexOf(e)+1,n=Q.length;t=t?n[r]:n[i];e[a]=!0}}function il(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function al(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=U(t,0,a),n=U(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||el(i.minUnit,t,n,this._getLabelCapacity(t)),o=P(r.ticks.stepSize,1),s=a===`week`?i.isoWeekday:!1,c=$e(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return F(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=dt(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=dt(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}(class extends ol{static id=`timeseries`;static defaults=ol.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=sl(t,this.min),this._tableRange=sl(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;ae-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(sl(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return sl(this._table,n*this._tableRange+this._minPos,!0)}});var $=i(),cl=`label`;function ll(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function ul(e,t){let n=e.options;n&&t&&Object.assign(n,t)}function dl(e,t){e.labels=t}function fl(e,t,n=cl){let r=[];e.datasets=t.map(t=>{let i=e.datasets.find(e=>e[n]===t[n]);return!i||!t.data||r.includes(i)?{...t}:(r.push(i),Object.assign(i,t),i)})}function pl(e,t=cl){let n={labels:[],datasets:[]};return dl(n,e.labels),fl(n,e.datasets,t),n}function ml(e,t){let{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:a,type:s,data:c,options:l,plugins:u=[],fallbackContent:d,updateMode:f,...p}=e,m=(0,o.useRef)(null),h=(0,o.useRef)(null),g=()=>{m.current&&(h.current=new jo(m.current,{type:s,data:pl(c,a),options:l&&{...l},plugins:u}),ll(t,h.current))},_=()=>{ll(t,null),h.current&&=(h.current.destroy(),null)};return(0,o.useEffect)(()=>{!i&&h.current&&l&&ul(h.current,l)},[i,l]),(0,o.useEffect)(()=>{!i&&h.current&&dl(h.current.config.data,c.labels)},[i,c.labels]),(0,o.useEffect)(()=>{!i&&h.current&&c.datasets&&fl(h.current.config.data,c.datasets,a)},[i,c.datasets]),(0,o.useEffect)(()=>{h.current&&(i?(_(),setTimeout(g)):h.current.update(f))},[i,l,c.labels,c.datasets,f]),(0,o.useEffect)(()=>{h.current&&(_(),setTimeout(g))},[s]),(0,o.useEffect)(()=>(g(),()=>_()),[]),(0,$.jsx)(`canvas`,{ref:m,role:`img`,height:n,width:r,...p,children:d})}var hl=(0,o.forwardRef)(ml);function gl(e,t){return jo.register(t),(0,o.forwardRef)((t,n)=>(0,$.jsx)(hl,{...t,ref:n,type:e}))}var _l=gl(`line`,Ei),vl=gl(`bar`,Ci),yl=gl(`doughnut`,Ti);jo.register(wc,Oc,ns,es,fs,Vo,tc,yc,Qs,Us);function bl({label:e,value:t,sub:n,icon:r,variant:i=`white`,delay:a=`0s`}){return(0,$.jsxs)(`div`,{className:`relative rounded-2xl p-6 anim-up shadow-sm hover:-translate-y-0.5 transition-transform duration-200 ${{white:`bg-white text-[#3D4E4B] border border-gray-100`,dark:`bg-[#3D4E4B] text-white border border-[#3D4E4B]`,gold:`bg-[#D4A017] text-white border border-[#D4A017]`,teal:`bg-[#21A59F] text-white border border-[#21A59F]`}[i]}`,style:{animationDelay:a},children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between mb-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-sm font-semibold opacity-60`,children:e}),(0,$.jsx)(`p`,{className:`text-3xl font-bold tracking-tighter mt-1`,children:typeof t==`number`?t.toLocaleString():t})]}),(0,$.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-black/5 border border-white/10 flex items-center justify-center shrink-0`,children:r})]}),(0,$.jsx)(`p`,{className:`text-sm font-semibold opacity-60`,children:n})]})}function xl({stats:e}){let{totalUsers:t,activeUsers:i,totalRoles:o,recentUsers:s,charts:c}=e,l=t-i,u={labels:c.userGrowth.map(e=>e.label),datasets:[{label:`New Registrations`,data:c.userGrowth.map(e=>e.value),borderColor:`#D4A017`,backgroundColor:`rgba(212, 160, 23, 0.1)`,fill:!0,tension:.4,pointRadius:4,pointBackgroundColor:`#D4A017`}]},d={labels:c.activityStats.map(e=>e.label),datasets:[{label:`System Activity`,data:c.activityStats.map(e=>e.value),backgroundColor:`#3D4E4B`,borderRadius:8}]},f={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:`#3D4E4B`,titleFont:{size:12,weight:`bold`},padding:12,cornerRadius:12}},scales:{x:{grid:{display:!1},ticks:{font:{size:10,weight:`bold`},color:`#9ca3af`}},y:{border:{display:!1},ticks:{font:{size:10,weight:`bold`},color:`#9ca3af`},grid:{color:`#f3f4f6`}}}};return(0,$.jsxs)(a,{children:[(0,$.jsx)(n,{title:`Dashboard`}),(0,$.jsxs)(`div`,{className:`space-y-6`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,$.jsx)(bl,{label:`Total Users`,value:t,sub:`All registered accounts`,variant:`gold`,delay:`0s`,icon:(0,$.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,$.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z`})})}),(0,$.jsx)(bl,{label:`Active Users`,value:i,sub:`${t>0?Math.round(i/t*100):0}% of total`,variant:`dark`,delay:`0.08s`,icon:(0,$.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,$.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`})})}),(0,$.jsx)(bl,{label:`Inactive Users`,value:l,sub:`Suspended or deactivated`,variant:`teal`,delay:`0.16s`,icon:(0,$.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,$.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636`})})}),(0,$.jsx)(bl,{label:`Roles`,value:o,sub:`Defined permission sets`,variant:`white`,delay:`0.24s`,icon:(0,$.jsx)(`svg`,{className:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,$.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})})})]}),(0,$.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-6`,children:[(0,$.jsxs)(`div`,{className:`lg:col-span-8 bg-white rounded-2xl border border-gray-100 shadow-sm p-8 anim-up`,style:{animationDelay:`0.32s`},children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between mb-8`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-base font-black text-[#3D4E4B] tracking-tight leading-none`,children:`User Growth`}),(0,$.jsx)(`p`,{className:`text-xs font-bold text-gray-400 mt-2 tracking-tight`,children:`Registration metrics over the last 6 months`})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-[#D4A017]`}),(0,$.jsx)(`span`,{className:`text-[10px] font-black uppercase tracking-widest text-[#D4A017]`,children:`Accounts`})]})]}),(0,$.jsx)(`div`,{className:`h-[300px]`,children:(0,$.jsx)(_l,{data:u,options:f})})]}),(0,$.jsxs)(`div`,{className:`lg:col-span-4 bg-[#3D4E4B] rounded-2xl p-8 text-white anim-up shadow-lg shadow-[#3D4E4B]/20`,style:{animationDelay:`0.4s`},children:[(0,$.jsx)(`h3`,{className:`text-base font-black tracking-tight leading-none mb-2`,children:`Account Integrity`}),(0,$.jsx)(`p`,{className:`text-xs font-bold text-white/40 tracking-tight mb-8 uppercase tracking-widest`,children:`Global Status Registry`}),(0,$.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,$.jsx)(`div`,{className:`w-48 h-48 mb-8`,children:(0,$.jsx)(yl,{data:{labels:[`Active`,`Inactive`],datasets:[{data:[i,l],backgroundColor:[`#D4A017`,`rgba(255,255,255,0.1)`],borderWidth:0,cutout:`75%`}]},options:{plugins:{legend:{display:!1}},maintainAspectRatio:!1}})}),(0,$.jsxs)(`div`,{className:`w-full space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between p-4 rounded-xl bg-white/5 border border-white/5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-[#D4A017]`}),(0,$.jsx)(`span`,{className:`text-xs font-bold opacity-60`,children:`Verified Active`})]}),(0,$.jsx)(`span`,{className:`text-sm font-black`,children:i})]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between p-4 rounded-xl bg-white/5 border border-white/5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-white/20`}),(0,$.jsx)(`span`,{className:`text-xs font-bold opacity-60`,children:`Restricted/Inactive`})]}),(0,$.jsx)(`span`,{className:`text-sm font-black`,children:l})]})]})]})]})]}),(0,$.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-6`,children:[(0,$.jsxs)(`div`,{className:`lg:col-span-4 bg-white rounded-2xl border border-gray-100 shadow-sm p-8 anim-up`,style:{animationDelay:`0.48s`},children:[(0,$.jsx)(`h3`,{className:`text-base font-black text-[#3D4E4B] tracking-tight leading-none mb-8`,children:`System Pulse`}),(0,$.jsx)(`div`,{className:`h-[250px]`,children:(0,$.jsx)(vl,{data:d,options:f})})]}),(0,$.jsxs)(`div`,{className:`lg:col-span-8 bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden anim-up`,style:{animationDelay:`0.56s`},children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-8 py-6 border-b border-gray-50`,children:[(0,$.jsx)(`div`,{children:(0,$.jsx)(`h3`,{className:`text-sm font-black text-[#3D4E4B] tracking-tight uppercase tracking-widest`,children:`Recent Registry`})}),(0,$.jsx)(r,{href:`/users`,className:`text-[10px] font-black uppercase tracking-widest text-[#D4A017] hover:text-[#B88B14] transition-colors`,children:`View Full Archive →`})]}),(0,$.jsx)(`div`,{className:`divide-y divide-gray-50`,children:s.map(e=>{let t=`${e.first_name?.charAt(0)??``}${e.last_name?.charAt(0)??``}`.toUpperCase();return(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-8 py-5 hover:bg-gray-50/30 transition-colors group`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,$.jsx)(`div`,{className:`w-10 h-10 rounded-2xl bg-[#3D4E4B] text-white text-[10px] font-black flex items-center justify-center border-2 border-white shadow-lg shadow-[#3D4E4B]/10 overflow-hidden`,children:e.avatar_url?(0,$.jsx)(`img`,{src:e.avatar_url,className:`w-full h-full object-cover`,alt:``}):t}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`p`,{className:`text-sm font-black text-[#3D4E4B] tracking-tight`,children:[e.first_name,` `,e.last_name]}),(0,$.jsx)(`p`,{className:`text-[10px] font-bold text-gray-300 uppercase tracking-widest mt-1`,children:e.email})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,$.jsx)(`span`,{className:`px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest border ${e.status===`active`?`text-emerald-600 border-emerald-100 bg-emerald-50/50`:`text-gray-400 border-gray-100 bg-gray-50/50`}`,children:e.status}),(0,$.jsx)(r,{href:route(`users.show`,e.id),className:`w-8 h-8 rounded-xl bg-gray-50 flex items-center justify-center text-gray-400 hover:bg-[#3D4E4B] hover:text-white transition-all`,children:(0,$.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,$.jsx)(`path`,{d:`M9 5l7 7-7 7`})})})]})]},e.id)})})]})]})]})]})}export{xl as default}; \ No newline at end of file diff --git a/public/build/assets/DeleteUserForm-DSLo5Ybm.js b/public/build/assets/DeleteUserForm-Bh5dZDoZ.js similarity index 99% rename from public/build/assets/DeleteUserForm-DSLo5Ybm.js rename to public/build/assets/DeleteUserForm-Bh5dZDoZ.js index 9c8d157..afd7862 100644 --- a/public/build/assets/DeleteUserForm-DSLo5Ybm.js +++ b/public/build/assets/DeleteUserForm-Bh5dZDoZ.js @@ -1 +1 @@ -import{a as e,c as t,d as n,s as r,t as i,u as a}from"./app-BK5KCPMc.js";import{C as o,S as s,_ as c,a as l,b as u,c as d,d as f,f as p,g as m,h,i as g,l as ee,m as _,n as v,o as y,p as b,r as x,s as te,t as S,u as C,v as w,x as T,y as E}from"./TextInput-BnQizTbW.js";var D=i();function O({className:e=``,disabled:t,children:n,...r}){return(0,D.jsx)(`button`,{...r,className:`inline-flex items-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-xs font-semibold uppercase tracking-widest text-white transition duration-150 ease-in-out hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 active:bg-red-700 ${t&&`opacity-25`} `+e,disabled:t,children:n})}function k(e){return T.isServer?null:e==null?document:e?.ownerDocument??document}function A(e){return T.isServer?null:e==null?document:(e?.getRootNode)?.call(e)??document}function ne(e){return A(e)?.activeElement??null}function re(e){return ne(e)===e}var j=n(t(),1);function M(e){return(0,j.useMemo)(()=>e,Object.values(e))}var N=(0,j.createContext)(void 0);function ie(){return(0,j.useContext)(N)}var P=`span`,F=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(F||{});function ae(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)==2?!0:r[`aria-hidden`]??void 0,hidden:(n&4)==4?!0:void 0,style:{position:`fixed`,top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,...(n&4)==4&&(n&2)!=2&&{display:`none`}}};return p()({ourProps:i,theirProps:r,slot:{},defaultTag:P,name:`Hidden`})}var oe=b(ae);function se(e){return typeof e!=`object`||!e?!1:`nodeType`in e}function I(e){return se(e)&&`tagName`in e}function L(e){return I(e)&&`accessKey`in e}function R(e){return I(e)&&`tabIndex`in e}function z(e){return I(e)&&`style`in e}function ce(e){return L(e)&&e.nodeName===`IFRAME`}function le(e){return L(e)&&e.nodeName===`INPUT`}var ue=(0,j.createContext)(null);ue.displayName=`DescriptionContext`;function de(){let e=(0,j.useContext)(ue);if(e===null){let e=Error(`You used a component, but it is not inside a relevant parent.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,de),e}return e}function fe(){let[e,t]=(0,j.useState)([]);return[e.length>0?e.join(` `):void 0,(0,j.useMemo)(()=>function(e){let n=h(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}))),r=(0,j.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return j.createElement(ue.Provider,{value:r},e.children)},[t])]}var pe=`p`;function me(e,t){let n=(0,j.useId)(),r=ie(),{id:i=`headlessui-description-${n}`,...a}=e,o=de(),s=C(t);c(()=>o.register(i),[i,o.register]);let l=M({...o.slot,disabled:r||!1}),u={ref:s,...o.props,id:i};return p()({ourProps:u,theirProps:a,slot:l,defaultTag:pe,name:o.name||`Description`})}var he=b(me),ge=Object.assign(he,{}),_e=(e=>(e.Space=` `,e.Enter=`Enter`,e.Escape=`Escape`,e.Backspace=`Backspace`,e.Delete=`Delete`,e.ArrowLeft=`ArrowLeft`,e.ArrowUp=`ArrowUp`,e.ArrowRight=`ArrowRight`,e.ArrowDown=`ArrowDown`,e.Home=`Home`,e.End=`End`,e.PageUp=`PageUp`,e.PageDown=`PageDown`,e.Tab=`Tab`,e))(_e||{}),ve=(0,j.createContext)(()=>{});function ye({value:e,children:t}){return j.createElement(ve.Provider,{value:e},t)}var be=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}},xe=Object.defineProperty,Se=(e,t,n)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ce=(e,t,n)=>(Se(e,typeof t==`symbol`?t:t+``,n),n),we=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},B=(e,t,n)=>(we(e,t,`read from private field`),n?n.call(e):t.get(e)),Te=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Ee=(e,t,n,r)=>(we(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),V,H,U,De=class{constructor(e){Te(this,V,{}),Te(this,H,new be(()=>new Set)),Te(this,U,new Set),Ce(this,`disposables`,E()),Ee(this,V,e),T.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return B(this,V)}subscribe(e,t){if(T.isServer)return()=>{};let n={selector:e,callback:t,current:e(B(this,V))};return B(this,U).add(n),this.disposables.add(()=>{B(this,U).delete(n)})}on(e,t){return T.isServer?()=>{}:(B(this,H).get(e).add(t),this.disposables.add(()=>{B(this,H).get(e).delete(t)}))}send(e){let t=this.reduce(B(this,V),e);if(t!==B(this,V)){Ee(this,V,t);for(let e of B(this,U)){let t=e.selector(B(this,V));Oe(e.current,t)||(e.current=t,e.callback(t))}for(let t of B(this,H).get(e.type))t(B(this,V),e)}}};V=new WeakMap,H=new WeakMap,U=new WeakMap;function Oe(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length?ke(e[Symbol.iterator](),t[Symbol.iterator]()):!1:e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size?ke(e.entries(),t.entries()):!1:Ae(e)&&Ae(t)?ke(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function ke(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function Ae(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var je=Object.defineProperty,Me=(e,t,n)=>t in e?je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ne=(e,t,n)=>(Me(e,typeof t==`symbol`?t:t+``,n),n),Pe=(e=>(e[e.Push=0]=`Push`,e[e.Pop=1]=`Pop`,e))(Pe||{}),Fe={0(e,t){let n=t.id,r=e.stack,i=e.stack.indexOf(n);if(i!==-1){let t=e.stack.slice();return t.splice(i,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let i=e.stack.slice();return i.splice(r,1),{...e,stack:i}}},Ie=class e extends De{constructor(){super(...arguments),Ne(this,`actions`,{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),Ne(this,`selectors`,{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new e({stack:[]})}reduce(e,t){return _(t.type,Fe,e,t)}},Le=new be(()=>Ie.new()),Re=a((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ze=a(((e,t)=>{t.exports=Re()}))();function Be(e,t,n=Oe){return(0,ze.useSyncExternalStoreWithSelector)(h(t=>e.subscribe(Ve,t)),h(()=>e.state),h(()=>e.state),h(t),n)}function Ve(e){return e}function W(e,t){let n=(0,j.useId)(),r=Le.get(t),[i,a]=Be(r,(0,j.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return c(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?a?i:!0:!1}var He=new Map,G=new Map;function Ue(e){let t=G.get(e)??0;return G.set(e,t+1),t===0?(He.set(e,{"aria-hidden":e.getAttribute(`aria-hidden`),inert:e.inert}),e.setAttribute(`aria-hidden`,`true`),e.inert=!0,()=>We(e)):()=>We(e)}function We(e){let t=G.get(e)??1;if(t===1?G.delete(e):G.set(e,t-1),t!==1)return;let n=He.get(e);n&&(n[`aria-hidden`]===null?e.removeAttribute(`aria-hidden`):e.setAttribute(`aria-hidden`,n[`aria-hidden`]),e.inert=n.inert,He.delete(e))}function Ge(e,{allowed:t,disallowed:n}={}){let r=W(e,`inert-others`);c(()=>{if(!r)return;let e=E();for(let t of n?.()??[])t&&e.add(Ue(t));let i=t?.()??[];for(let t of i){if(!t)continue;let n=k(t);if(!n)continue;let r=t.parentElement;for(;r&&r!==n.body;){for(let t of r.children)i.some(e=>t.contains(e))||e.add(Ue(t));r=r.parentElement}}return e.dispose},[r,t,n])}function Ke(e,t,n){let r=m(e=>{let t=e.getBoundingClientRect();t.x===0&&t.y===0&&t.width===0&&t.height===0&&n()});(0,j.useEffect)(()=>{if(!e)return;let n=t===null?null:L(t)?t:t.current;if(!n)return;let i=E();if(typeof ResizeObserver<`u`){let e=new ResizeObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}if(typeof IntersectionObserver<`u`){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}return()=>i.dispose()},[t,r,e])}var K=[`[contentEditable=true]`,`[tabindex]`,`a[href]`,`area[href]`,`button:not([disabled])`,`iframe`,`input:not([disabled])`,`select:not([disabled])`,`details>summary`,`textarea:not([disabled])`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),qe=[`[data-autofocus]`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),q=(e=>(e[e.First=1]=`First`,e[e.Previous=2]=`Previous`,e[e.Next=4]=`Next`,e[e.Last=8]=`Last`,e[e.WrapAround=16]=`WrapAround`,e[e.NoScroll=32]=`NoScroll`,e[e.AutoFocus=64]=`AutoFocus`,e))(q||{}),Je=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(Je||{}),Ye=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(Ye||{});function Xe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(K)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}function Ze(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(qe)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}var Qe=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(Qe||{});function $e(e,t=0){return e===k(e)?.body?!1:_(t,{0(){return e.matches(K)},1(){let t=e;for(;t!==null;){if(t.matches(K))return!0;t=t.parentElement}return!1}})}var et=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(et||{});typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible=``)},!0),document.addEventListener(`click`,e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible=``)},!0));function J(e){e?.focus({preventScroll:!0})}var tt=[`textarea`,`input`].join(`,`);function nt(e){return(e?.matches)?.call(e,tt)??!1}function rt(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Y(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?A(e[0]):document:A(e),o=Array.isArray(e)?n?rt(e):e:t&64?Ze(e):Xe(e);i.length>0&&o.length>1&&(o=o.filter(e=>!i.some(t=>t!=null&&`current`in t?t?.current===e:t===e))),r??=a?.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),l=t&32?{preventScroll:!0}:{},u=0,d=o.length,f;do{if(u>=d||u+d<=0)return 0;let e=c+u;if(t&16)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}f=o[e],f?.focus(l),u+=s}while(f!==ne(f));return t&6&&nt(f)&&f.select(),2}function it(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function at(){return/Android/gi.test(window.navigator.userAgent)}function ot(){return it()||at()}function st(e,t,n,r){let i=m(n);(0,j.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r)},[e,t,r])}function ct(e,t,n,r){let i=m(n);(0,j.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r)},[e,t,r])}var lt=30;function ut(e,t,n){let r=m(n),i=(0,j.useCallback)(function(e,n){if(e.defaultPrevented)return;let i=n(e);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let a=function e(t){return typeof t==`function`?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of a)if(t!==null&&(t.contains(i)||e.composed&&e.composedPath().includes(t)))return;return!$e(i,Qe.Loose)&&i.tabIndex!==-1&&e.preventDefault(),r.current(e,i)},[r,t]),a=(0,j.useRef)(null);st(e,`pointerdown`,e=>{ot()||(a.current=e.composedPath?.call(e)?.[0]||e.target)},!0),st(e,`pointerup`,e=>{if(ot()||!a.current)return;let t=a.current;return a.current=null,i(e,()=>t)},!0);let o=(0,j.useRef)({x:0,y:0});st(e,`touchstart`,e=>{o.current.x=e.touches[0].clientX,o.current.y=e.touches[0].clientY},!0),st(e,`touchend`,e=>{let t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};if(!(Math.abs(t.x-o.current.x)>=lt||Math.abs(t.y-o.current.y)>=lt))return i(e,()=>R(e.target)?e.target:null)},!0),ct(e,`blur`,e=>i(e,()=>ce(window.document.activeElement)?window.document.activeElement:null),!0)}function dt(...e){return(0,j.useMemo)(()=>k(...e),[...e])}function ft(e,t,n,r){let i=m(n);(0,j.useEffect)(()=>{e??=window;function n(e){i.current(e)}return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}function pt(e){return(0,j.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}function mt(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(e){return r.add(e),()=>r.delete(e)},dispatch(e,...i){let a=t[e].call(n,...i);a&&(n=a,r.forEach(e=>e()))}}}function ht(){let e;return{before({doc:t}){let n=t.documentElement,r=t.defaultView??window;e=Math.max(0,r.innerWidth-n.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-i);n.style(r,`paddingRight`,`${a}px`)}}}function gt(){return it()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!==`auto`){let n=E();n.style(e.documentElement,`scrollBehavior`,`auto`),t.add(()=>t.microTask(()=>n.dispose()))}let n=window.scrollY??window.pageYOffset,i=null;t.addEventListener(e,`click`,t=>{if(R(t.target))try{let n=t.target.closest(`a`);if(!n)return;let{hash:a}=new URL(n.href),o=e.querySelector(a);R(o)&&!r(o)&&(i=o)}catch{}},!0),t.group(n=>{t.addEventListener(e,`touchstart`,e=>{if(n.dispose(),R(e.target)&&z(e.target))if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,`overscrollBehavior`,`contain`)}else n.style(e.target,`touchAction`,`none`)})}),t.addEventListener(e,`touchmove`,e=>{if(R(e.target)){if(le(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&t.dataset.headlessuiPortal!==``&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;t.dataset.headlessuiPortal===``&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{n!==(window.scrollY??window.pageYOffset)&&window.scrollTo(0,n),i&&i.isConnected&&(i.scrollIntoView({block:`nearest`}),i=null)})})}}:{}}function _t(){return{before({doc:e,d:t}){t.style(e.documentElement,`overflow`,`hidden`)}}}function vt(e){let t={};for(let n of e)Object.assign(t,n(t));return t}var X=mt(()=>new Map,{PUSH(e,t){let n=this.get(e)??{doc:e,count:0,d:E(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=vt(n.meta),this.set(e,n),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=vt(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[gt(),ht(),_t()];n.forEach(({before:e})=>e?.(t)),n.forEach(({after:e})=>e?.(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});X.subscribe(()=>{let e=X.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e=t.get(n.doc)===`hidden`,r=n.count!==0;(r&&!e||!r&&e)&&X.dispatch(n.count>0?`SCROLL_PREVENT`:`SCROLL_ALLOW`,n),n.count===0&&X.dispatch(`TEARDOWN`,n)}});function yt(e,t,n=()=>({containers:[]})){let r=pt(X),i=t?r.get(t):void 0,a=i?i.count>0:!1;return c(()=>{if(!(!t||!e))return X.dispatch(`PUSH`,t,n),()=>X.dispatch(`POP`,t,n)},[e,t]),a}function bt(e,t,n=()=>[document.body]){yt(W(e,`scroll-lock`),t,e=>({containers:[...e.containers??[],n]}))}function xt(e,t){let n=(0,j.useRef)([]),r=h(e);(0,j.useEffect)(()=>{let e=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let i=r(t,e);return n.current=t,i}},[r,...t])}function St(e){function t(){document.readyState!==`loading`&&(e(),document.removeEventListener(`DOMContentLoaded`,t))}typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`DOMContentLoaded`,t),t())}var Z=[];St(()=>{function e(e){if(!R(e.target)||e.target===document.body||Z[0]===e.target)return;let t=e.target;t=t.closest(K),Z.unshift(t??e.target),Z=Z.filter(e=>e!=null&&e.isConnected),Z.splice(10)}window.addEventListener(`click`,e,{capture:!0}),window.addEventListener(`mousedown`,e,{capture:!0}),window.addEventListener(`focus`,e,{capture:!0}),document.body.addEventListener(`click`,e,{capture:!0}),document.body.addEventListener(`mousedown`,e,{capture:!0}),document.body.addEventListener(`focus`,e,{capture:!0})});function Ct(e){let t=h(e),n=(0,j.useRef)(!1);(0,j.useEffect)(()=>(n.current=!1,()=>{n.current=!0,u(()=>{n.current&&t()})}),[t])}var wt=(0,j.createContext)(!1);function Tt(){return(0,j.useContext)(wt)}function Et(e){return j.createElement(wt.Provider,{value:e.force},e.children)}var Dt=n(r(),1);function Ot(e){let t=Tt(),n=(0,j.useContext)(Nt),[r,i]=(0,j.useState)(()=>{if(!t&&n!==null)return n.current??null;if(T.isServer)return null;let r=e?.getElementById(`headlessui-portal-root`);if(r)return r;if(e===null)return null;let i=e.createElement(`div`);return i.setAttribute(`id`,`headlessui-portal-root`),e.body.appendChild(i)});return(0,j.useEffect)(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),(0,j.useEffect)(()=>{t||n!==null&&i(n.current)},[n,i,t]),r}var kt=j.Fragment,At=b(function(e,t){let{ownerDocument:n=null,...r}=e,i=(0,j.useRef)(null),a=C(ee(e=>{i.current=e}),t),o=dt(i.current),s=Ot(n??o),c=(0,j.useContext)(Ft),u=w(),d=l(),f=p();return Ct(()=>{var e;s&&s.childNodes.length<=0&&((e=s.parentElement)==null||e.removeChild(s))}),!s||!d?null:(0,Dt.createPortal)(j.createElement(`div`,{"data-headlessui-portal":``,ref:e=>{u.dispose(),c&&e&&u.add(c.register(e))}},f({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:kt,name:`Portal`})),s)});function jt(e,t){let n=C(t),{enabled:r=!0,ownerDocument:i,...a}=e,o=p();return r?j.createElement(At,{...a,ownerDocument:i,ref:n}):o({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:kt,name:`Portal`})}var Mt=j.Fragment,Nt=(0,j.createContext)(null);function Pt(e,t){let{target:n,...r}=e,i={ref:C(t)},a=p();return j.createElement(Nt.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:Mt,name:`Popover.Group`}))}var Ft=(0,j.createContext)(null);function It(){let e=(0,j.useContext)(Ft),t=(0,j.useRef)([]),n=h(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=h(n=>{let r=t.current.indexOf(n);r!==-1&&t.current.splice(r,1),e&&e.unregister(n)}),i=(0,j.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,j.useMemo)(()=>function({children:e}){return j.createElement(Ft.Provider,{value:i},e)},[i])]}var Lt=b(jt),Rt=b(Pt),zt=Object.assign(Lt,{Group:Rt});function Bt(e,t=typeof document<`u`?document.defaultView:null,n){let r=W(e,`escape`);ft(t,`keydown`,e=>{r&&(e.defaultPrevented||e.key===_e.Escape&&n(e))})}function Vt(){let[e]=(0,j.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`):null),[t,n]=(0,j.useState)(e?.matches??!1);return c(()=>{if(!e)return;function t(e){n(e.matches)}return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[e]),t}function Ht({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=h(()=>{let r=k(n),i=[];for(let t of e)t!==null&&(I(t)?i.push(t):`current`in t&&I(t.current)&&i.push(t.current));if(t!=null&&t.current)for(let e of t.current)i.push(e);for(let e of r?.querySelectorAll(`html > *, body > *`)??[])e!==document.body&&e!==document.head&&I(e)&&e.id!==`headlessui-portal-root`&&(n&&(e.contains(n)||e.contains(n?.getRootNode()?.host))||i.some(t=>e.contains(t))||i.push(e));return i});return{resolveContainers:r,contains:h(e=>r().some(t=>t.contains(e)))}}var Ut=(0,j.createContext)(null);function Wt({children:e,node:t}){let[n,r]=(0,j.useState)(null),i=Gt(t??n);return j.createElement(Ut.Provider,{value:i},e,i===null&&j.createElement(oe,{features:F.Hidden,ref:e=>{if(e){for(let t of k(e)?.querySelectorAll(`html > *, body > *`)??[])if(t!==document.body&&t!==document.head&&I(t)&&t!=null&&t.contains(e)){r(t);break}}}}))}function Gt(e=null){return(0,j.useContext)(Ut)??e}var Q=(e=>(e[e.Forwards=0]=`Forwards`,e[e.Backwards=1]=`Backwards`,e))(Q||{});function Kt(){let e=(0,j.useRef)(0);return ct(!0,`keydown`,t=>{t.key===`Tab`&&(e.current=+!!t.shiftKey)},!0),e}function qt(e){if(!e)return new Set;if(typeof e==`function`)return new Set(e());let t=new Set;for(let n of e.current)I(n.current)&&t.add(n.current);return t}var Jt=`div`,$=(e=>(e[e.None=0]=`None`,e[e.InitialFocus=1]=`InitialFocus`,e[e.TabLock=2]=`TabLock`,e[e.FocusLock=4]=`FocusLock`,e[e.RestoreFocus=8]=`RestoreFocus`,e[e.AutoFocus=16]=`AutoFocus`,e))($||{});function Yt(e,t){let n=(0,j.useRef)(null),r=C(n,t),{initialFocus:i,initialFocusFallback:a,containers:o,features:s=15,...c}=e;l()||(s=0);let u=dt(n.current);$t(s,{ownerDocument:u});let d=en(s,{ownerDocument:u,container:n,initialFocus:i,initialFocusFallback:a});tn(s,{ownerDocument:u,container:n,containers:o,previousActiveElement:d});let f=Kt(),m=h(e=>{if(!L(n.current))return;let t=n.current;(e=>e())(()=>{_(f.current,{[Q.Forwards]:()=>{Y(t,q.First,{skipElements:[e.relatedTarget,a]})},[Q.Backwards]:()=>{Y(t,q.Last,{skipElements:[e.relatedTarget,a]})}})})}),g=W(!!(s&2),`focus-trap#tab-lock`),ee=w(),v=(0,j.useRef)(!1),y={ref:r,onKeyDown(e){e.key==`Tab`&&(v.current=!0,ee.requestAnimationFrame(()=>{v.current=!1}))},onBlur(e){if(!(s&4))return;let t=qt(o);L(n.current)&&t.add(n.current);let r=e.relatedTarget;R(r)&&r.dataset.headlessuiFocusGuard!==`true`&&(nn(t,r)||(v.current?Y(n.current,_(f.current,{[Q.Forwards]:()=>q.Next,[Q.Backwards]:()=>q.Previous})|q.WrapAround,{relativeTo:e.target}):R(e.target)&&J(e.target)))}},b=p();return j.createElement(j.Fragment,null,g&&j.createElement(oe,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:m,features:F.Focusable}),b({ourProps:y,theirProps:c,defaultTag:Jt,name:`FocusTrap`}),g&&j.createElement(oe,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:m,features:F.Focusable}))}var Xt=b(Yt),Zt=Object.assign(Xt,{features:$});function Qt(e=!0){let t=(0,j.useRef)(Z.slice());return xt(([e],[n])=>{n===!0&&e===!1&&u(()=>{t.current.splice(0)}),n===!1&&e===!0&&(t.current=Z.slice())},[e,Z,t]),h(()=>t.current.find(e=>e!=null&&e.isConnected)??null)}function $t(e,{ownerDocument:t}){let n=!!(e&8),r=Qt(n);xt(()=>{n||re(t?.body)&&J(r())},[n]),Ct(()=>{n&&J(r())})}function en(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:i}){let a=(0,j.useRef)(null),o=W(!!(e&1),`focus-trap#initial-focus`),s=g();return xt(()=>{if(e===0)return;if(!o){i!=null&&i.current&&J(i.current);return}let c=n.current;c&&u(()=>{if(!s.current)return;let n=t?.activeElement;if(r!=null&&r.current){if(r?.current===n){a.current=n;return}}else if(c.contains(n)){a.current=n;return}if(r!=null&&r.current)J(r.current);else{if(e&16){if(Y(c,q.First|q.AutoFocus)!==Je.Error)return}else if(Y(c,q.First)!==Je.Error)return;if(i!=null&&i.current&&(J(i.current),t?.activeElement===i.current))return;console.warn(`There are no focusable elements inside the `)}a.current=t?.activeElement})},[i,o,e]),a}function tn(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let a=g(),o=!!(e&4);ft(t?.defaultView,`focus`,e=>{if(!o||!a.current)return;let t=qt(r);L(n.current)&&t.add(n.current);let s=i.current;if(!s)return;let c=e.target;L(c)?nn(t,c)?(i.current=c,J(c)):(e.preventDefault(),e.stopPropagation(),J(s)):J(i.current)},!0)}function nn(e,t){for(let n of e)if(n.contains(t))return!0;return!1}var rn=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))(rn||{}),an=(e=>(e[e.SetTitleId=0]=`SetTitleId`,e))(an||{}),on={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},sn=(0,j.createContext)(null);sn.displayName=`DialogContext`;function cn(e){let t=(0,j.useContext)(sn);if(t===null){let t=Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,cn),t}return t}function ln(e,t){return _(t.type,on,e,t)}var un=b(function(e,t){let n=(0,j.useId)(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:a,initialFocus:o,role:s=`dialog`,autoFocus:u=!0,__demoMode:f=!1,unmount:m=!1,...g}=e,ee=(0,j.useRef)(!1);s=function(){return s===`dialog`||s===`alertdialog`?s:(ee.current||(ee.current=!0,console.warn(`Invalid role [${s}] passed to . Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),`dialog`)}();let _=d();i===void 0&&_!==null&&(i=(_&y.Open)===y.Open);let v=(0,j.useRef)(null),b=C(v,t),x=dt(v.current),S=+!i,[w,T]=(0,j.useReducer)(ln,{titleId:null,descriptionId:null,panelRef:(0,j.createRef)()}),E=h(()=>a(!1)),D=h(e=>T({type:0,id:e})),O=l()?S===0:!1,[k,A]=It(),ne={get current(){return w.panelRef.current??v.current}},re=Gt(),{resolveContainers:N}=Ht({mainTreeNode:re,portals:k,defaultContainers:[ne]}),ie=_===null?!1:(_&y.Closing)===y.Closing;Ge(f||ie?!1:O,{allowed:h(()=>[v.current?.closest(`[data-headlessui-portal]`)??null]),disallowed:h(()=>[re?.closest(`body > *:not(#headlessui-portal-root)`)??null])});let P=Le.get(null);c(()=>{if(O)return P.actions.push(r),()=>P.actions.pop(r)},[P,r,O]);let F=Be(P,(0,j.useCallback)(e=>P.selectors.isTop(e,r),[P,r]));ut(F,N,e=>{e.preventDefault(),E()}),Bt(F,x?.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&`blur`in document.activeElement&&typeof document.activeElement.blur==`function`&&document.activeElement.blur(),E()}),bt(f||ie?!1:O,x,N),Ke(O,v,E);let[ae,oe]=fe(),se=(0,j.useMemo)(()=>[{dialogState:S,close:E,setTitleId:D,unmount:m},w],[S,E,D,m,w]),I=M({open:S===0}),L={ref:b,id:r,role:s,tabIndex:-1,"aria-modal":f?void 0:S===0?!0:void 0,"aria-labelledby":w.titleId,"aria-describedby":ae,unmount:m},R=!Vt(),z=$.None;O&&!f&&(z|=$.RestoreFocus,z|=$.TabLock,u&&(z|=$.AutoFocus),R&&(z|=$.InitialFocus));let ce=p();return j.createElement(te,null,j.createElement(Et,{force:!0},j.createElement(zt,null,j.createElement(sn.Provider,{value:se},j.createElement(Rt,{target:v},j.createElement(Et,{force:!1},j.createElement(oe,{slot:I},j.createElement(A,null,j.createElement(Zt,{initialFocus:o,initialFocusFallback:v,containers:N,features:z},j.createElement(ye,{value:E},ce({ourProps:L,theirProps:g,slot:I,defaultTag:dn,features:fn,visible:S===0,name:`Dialog`})))))))))))}),dn=`div`,fn=f.RenderStrategy|f.Static;function pn(e,t){let{transition:n=!1,open:r,...i}=e,a=d(),o=e.hasOwnProperty(`open`)||a!==null,s=e.hasOwnProperty(`onClose`);if(!o&&!s)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!=`boolean`)throw Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!=`function`)throw Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!i.static?j.createElement(Wt,null,j.createElement(v,{show:r,transition:n,unmount:i.unmount},j.createElement(un,{ref:t,...i}))):j.createElement(Wt,null,j.createElement(un,{ref:t,open:r,...i}))}var mn=`div`;function hn(e,t){let n=(0,j.useId)(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...a}=e,[{dialogState:o,unmount:s},c]=cn(`Dialog.Panel`),l=C(t,c.panelRef),u=M({open:o===0}),d={ref:l,id:r,onClick:h(e=>{e.stopPropagation()})},f=i?x:j.Fragment,m=i?{unmount:s}:{},g=p();return j.createElement(f,{...m},g({ourProps:d,theirProps:a,slot:u,defaultTag:mn,name:`Dialog.Panel`}))}var gn=`div`;function _n(e,t){let{transition:n=!1,...r}=e,[{dialogState:i,unmount:a}]=cn(`Dialog.Backdrop`),o=M({open:i===0}),s={ref:t,"aria-hidden":!0},c=n?x:j.Fragment,l=n?{unmount:a}:{},u=p();return j.createElement(c,{...l},u({ourProps:s,theirProps:r,slot:o,defaultTag:gn,name:`Dialog.Backdrop`}))}var vn=`h2`;function yn(e,t){let n=(0,j.useId)(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:a,setTitleId:o}]=cn(`Dialog.Title`),s=C(t);(0,j.useEffect)(()=>(o(r),()=>o(null)),[r,o]);let c=M({open:a===0}),l={ref:s,id:r};return p()({ourProps:l,theirProps:i,slot:c,defaultTag:vn,name:`Dialog.Title`})}var bn=b(pn),xn=b(hn);b(_n);var Sn=b(yn),Cn=Object.assign(bn,{Panel:xn,Title:Sn,Description:ge});function wn({children:e,show:t=!1,maxWidth:n=`2xl`,closeable:r=!0,onClose:i=()=>{}}){let a=()=>{r&&i()},o={sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`}[n];return(0,D.jsx)(v,{show:t,leave:`duration-200`,children:(0,D.jsxs)(Cn,{as:`div`,id:`modal`,className:`fixed inset-0 z-50 flex transform items-center overflow-y-auto px-4 py-6 transition-all sm:px-0`,onClose:a,children:[(0,D.jsx)(x,{enter:`ease-out duration-300`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-200`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,D.jsx)(`div`,{className:`absolute inset-0 bg-gray-500/75`})}),(0,D.jsx)(x,{enter:`ease-out duration-300`,enterFrom:`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,enterTo:`opacity-100 translate-y-0 sm:scale-100`,leave:`ease-in duration-200`,leaveFrom:`opacity-100 translate-y-0 sm:scale-100`,leaveTo:`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,children:(0,D.jsx)(xn,{className:`mb-6 transform overflow-hidden rounded-lg bg-white shadow-xl transition-all sm:mx-auto sm:w-full ${o}`,children:e})})]})})}function Tn({type:e=`button`,className:t=``,disabled:n,children:r,...i}){return(0,D.jsx)(`button`,{...i,type:e,className:`inline-flex items-center rounded-xl border border-gray-200 bg-white px-4 py-2 text-sm font-bold tracking-tight text-[#3D4E4B] transition-all hover:bg-gray-50 hover:border-gray-300 focus:outline-none focus:ring-2 focus:ring-[#D4A017] focus:ring-offset-2 disabled:opacity-25 ${n&&`opacity-25`} `+t,disabled:n,children:r})}function En({className:t=``}){let[n,r]=(0,j.useState)(!1),i=(0,j.useRef)(),{data:a,setData:c,delete:l,processing:u,reset:d,errors:f,clearErrors:p}=e({password:``}),m=()=>{r(!0)},h=e=>{e.preventDefault(),l(route(`profile.destroy`),{preserveScroll:!0,onSuccess:()=>g(),onError:()=>i.current.focus(),onFinish:()=>d()})},g=()=>{r(!1),p(),d()};return(0,D.jsxs)(`section`,{className:`space-y-6 ${t}`,children:[(0,D.jsxs)(`header`,{children:[(0,D.jsx)(`h2`,{className:`text-lg font-medium text-gray-900`,children:`Delete Account`}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:`Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.`})]}),(0,D.jsx)(O,{onClick:m,children:`Delete Account`}),(0,D.jsx)(wn,{show:n,onClose:g,children:(0,D.jsxs)(`form`,{onSubmit:h,className:`p-6`,children:[(0,D.jsx)(`h2`,{className:`text-lg font-medium text-gray-900`,children:`Are you sure you want to delete your account?`}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:`Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.`}),(0,D.jsxs)(`div`,{className:`mt-6`,children:[(0,D.jsx)(s,{htmlFor:`password`,value:`Password`,className:`sr-only`}),(0,D.jsx)(S,{id:`password`,type:`password`,name:`password`,ref:i,value:a.password,onChange:e=>c(`password`,e.target.value),className:`mt-1 block w-3/4`,isFocused:!0,placeholder:`Password`}),(0,D.jsx)(o,{message:f.password,className:`mt-2`})]}),(0,D.jsxs)(`div`,{className:`mt-6 flex justify-end`,children:[(0,D.jsx)(Tn,{onClick:g,children:`Cancel`}),(0,D.jsx)(O,{className:`ms-3`,disabled:u,children:`Delete Account`})]})]})})]})}export{En as default}; \ No newline at end of file +import{a as e,c as t,d as n,s as r,t as i,u as a}from"./app-C2kGDHB9.js";import{C as o,S as s,_ as c,a as l,b as u,c as d,d as f,f as p,g as m,h,i as g,l as ee,m as _,n as v,o as y,p as b,r as x,s as te,t as S,u as C,v as w,x as T,y as E}from"./TextInput-BGMhFr2s.js";var D=i();function O({className:e=``,disabled:t,children:n,...r}){return(0,D.jsx)(`button`,{...r,className:`inline-flex items-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-xs font-semibold uppercase tracking-widest text-white transition duration-150 ease-in-out hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 active:bg-red-700 ${t&&`opacity-25`} `+e,disabled:t,children:n})}function k(e){return T.isServer?null:e==null?document:e?.ownerDocument??document}function A(e){return T.isServer?null:e==null?document:(e?.getRootNode)?.call(e)??document}function ne(e){return A(e)?.activeElement??null}function re(e){return ne(e)===e}var j=n(t(),1);function M(e){return(0,j.useMemo)(()=>e,Object.values(e))}var N=(0,j.createContext)(void 0);function ie(){return(0,j.useContext)(N)}var P=`span`,F=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(F||{});function ae(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)==2?!0:r[`aria-hidden`]??void 0,hidden:(n&4)==4?!0:void 0,style:{position:`fixed`,top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,...(n&4)==4&&(n&2)!=2&&{display:`none`}}};return p()({ourProps:i,theirProps:r,slot:{},defaultTag:P,name:`Hidden`})}var oe=b(ae);function se(e){return typeof e!=`object`||!e?!1:`nodeType`in e}function I(e){return se(e)&&`tagName`in e}function L(e){return I(e)&&`accessKey`in e}function R(e){return I(e)&&`tabIndex`in e}function z(e){return I(e)&&`style`in e}function ce(e){return L(e)&&e.nodeName===`IFRAME`}function le(e){return L(e)&&e.nodeName===`INPUT`}var ue=(0,j.createContext)(null);ue.displayName=`DescriptionContext`;function de(){let e=(0,j.useContext)(ue);if(e===null){let e=Error(`You used a component, but it is not inside a relevant parent.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,de),e}return e}function fe(){let[e,t]=(0,j.useState)([]);return[e.length>0?e.join(` `):void 0,(0,j.useMemo)(()=>function(e){let n=h(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}))),r=(0,j.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return j.createElement(ue.Provider,{value:r},e.children)},[t])]}var pe=`p`;function me(e,t){let n=(0,j.useId)(),r=ie(),{id:i=`headlessui-description-${n}`,...a}=e,o=de(),s=C(t);c(()=>o.register(i),[i,o.register]);let l=M({...o.slot,disabled:r||!1}),u={ref:s,...o.props,id:i};return p()({ourProps:u,theirProps:a,slot:l,defaultTag:pe,name:o.name||`Description`})}var he=b(me),ge=Object.assign(he,{}),_e=(e=>(e.Space=` `,e.Enter=`Enter`,e.Escape=`Escape`,e.Backspace=`Backspace`,e.Delete=`Delete`,e.ArrowLeft=`ArrowLeft`,e.ArrowUp=`ArrowUp`,e.ArrowRight=`ArrowRight`,e.ArrowDown=`ArrowDown`,e.Home=`Home`,e.End=`End`,e.PageUp=`PageUp`,e.PageDown=`PageDown`,e.Tab=`Tab`,e))(_e||{}),ve=(0,j.createContext)(()=>{});function ye({value:e,children:t}){return j.createElement(ve.Provider,{value:e},t)}var be=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}},xe=Object.defineProperty,Se=(e,t,n)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ce=(e,t,n)=>(Se(e,typeof t==`symbol`?t:t+``,n),n),we=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},B=(e,t,n)=>(we(e,t,`read from private field`),n?n.call(e):t.get(e)),Te=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Ee=(e,t,n,r)=>(we(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),V,H,U,De=class{constructor(e){Te(this,V,{}),Te(this,H,new be(()=>new Set)),Te(this,U,new Set),Ce(this,`disposables`,E()),Ee(this,V,e),T.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return B(this,V)}subscribe(e,t){if(T.isServer)return()=>{};let n={selector:e,callback:t,current:e(B(this,V))};return B(this,U).add(n),this.disposables.add(()=>{B(this,U).delete(n)})}on(e,t){return T.isServer?()=>{}:(B(this,H).get(e).add(t),this.disposables.add(()=>{B(this,H).get(e).delete(t)}))}send(e){let t=this.reduce(B(this,V),e);if(t!==B(this,V)){Ee(this,V,t);for(let e of B(this,U)){let t=e.selector(B(this,V));Oe(e.current,t)||(e.current=t,e.callback(t))}for(let t of B(this,H).get(e.type))t(B(this,V),e)}}};V=new WeakMap,H=new WeakMap,U=new WeakMap;function Oe(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length?ke(e[Symbol.iterator](),t[Symbol.iterator]()):!1:e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size?ke(e.entries(),t.entries()):!1:Ae(e)&&Ae(t)?ke(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function ke(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function Ae(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var je=Object.defineProperty,Me=(e,t,n)=>t in e?je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ne=(e,t,n)=>(Me(e,typeof t==`symbol`?t:t+``,n),n),Pe=(e=>(e[e.Push=0]=`Push`,e[e.Pop=1]=`Pop`,e))(Pe||{}),Fe={0(e,t){let n=t.id,r=e.stack,i=e.stack.indexOf(n);if(i!==-1){let t=e.stack.slice();return t.splice(i,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let i=e.stack.slice();return i.splice(r,1),{...e,stack:i}}},Ie=class e extends De{constructor(){super(...arguments),Ne(this,`actions`,{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),Ne(this,`selectors`,{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new e({stack:[]})}reduce(e,t){return _(t.type,Fe,e,t)}},Le=new be(()=>Ie.new()),Re=a((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ze=a(((e,t)=>{t.exports=Re()}))();function Be(e,t,n=Oe){return(0,ze.useSyncExternalStoreWithSelector)(h(t=>e.subscribe(Ve,t)),h(()=>e.state),h(()=>e.state),h(t),n)}function Ve(e){return e}function W(e,t){let n=(0,j.useId)(),r=Le.get(t),[i,a]=Be(r,(0,j.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return c(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?a?i:!0:!1}var He=new Map,G=new Map;function Ue(e){let t=G.get(e)??0;return G.set(e,t+1),t===0?(He.set(e,{"aria-hidden":e.getAttribute(`aria-hidden`),inert:e.inert}),e.setAttribute(`aria-hidden`,`true`),e.inert=!0,()=>We(e)):()=>We(e)}function We(e){let t=G.get(e)??1;if(t===1?G.delete(e):G.set(e,t-1),t!==1)return;let n=He.get(e);n&&(n[`aria-hidden`]===null?e.removeAttribute(`aria-hidden`):e.setAttribute(`aria-hidden`,n[`aria-hidden`]),e.inert=n.inert,He.delete(e))}function Ge(e,{allowed:t,disallowed:n}={}){let r=W(e,`inert-others`);c(()=>{if(!r)return;let e=E();for(let t of n?.()??[])t&&e.add(Ue(t));let i=t?.()??[];for(let t of i){if(!t)continue;let n=k(t);if(!n)continue;let r=t.parentElement;for(;r&&r!==n.body;){for(let t of r.children)i.some(e=>t.contains(e))||e.add(Ue(t));r=r.parentElement}}return e.dispose},[r,t,n])}function Ke(e,t,n){let r=m(e=>{let t=e.getBoundingClientRect();t.x===0&&t.y===0&&t.width===0&&t.height===0&&n()});(0,j.useEffect)(()=>{if(!e)return;let n=t===null?null:L(t)?t:t.current;if(!n)return;let i=E();if(typeof ResizeObserver<`u`){let e=new ResizeObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}if(typeof IntersectionObserver<`u`){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}return()=>i.dispose()},[t,r,e])}var K=[`[contentEditable=true]`,`[tabindex]`,`a[href]`,`area[href]`,`button:not([disabled])`,`iframe`,`input:not([disabled])`,`select:not([disabled])`,`details>summary`,`textarea:not([disabled])`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),qe=[`[data-autofocus]`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),q=(e=>(e[e.First=1]=`First`,e[e.Previous=2]=`Previous`,e[e.Next=4]=`Next`,e[e.Last=8]=`Last`,e[e.WrapAround=16]=`WrapAround`,e[e.NoScroll=32]=`NoScroll`,e[e.AutoFocus=64]=`AutoFocus`,e))(q||{}),Je=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(Je||{}),Ye=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(Ye||{});function Xe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(K)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}function Ze(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(qe)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}var Qe=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(Qe||{});function $e(e,t=0){return e===k(e)?.body?!1:_(t,{0(){return e.matches(K)},1(){let t=e;for(;t!==null;){if(t.matches(K))return!0;t=t.parentElement}return!1}})}var et=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(et||{});typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible=``)},!0),document.addEventListener(`click`,e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible=``)},!0));function J(e){e?.focus({preventScroll:!0})}var tt=[`textarea`,`input`].join(`,`);function nt(e){return(e?.matches)?.call(e,tt)??!1}function rt(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Y(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?A(e[0]):document:A(e),o=Array.isArray(e)?n?rt(e):e:t&64?Ze(e):Xe(e);i.length>0&&o.length>1&&(o=o.filter(e=>!i.some(t=>t!=null&&`current`in t?t?.current===e:t===e))),r??=a?.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),l=t&32?{preventScroll:!0}:{},u=0,d=o.length,f;do{if(u>=d||u+d<=0)return 0;let e=c+u;if(t&16)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}f=o[e],f?.focus(l),u+=s}while(f!==ne(f));return t&6&&nt(f)&&f.select(),2}function it(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function at(){return/Android/gi.test(window.navigator.userAgent)}function ot(){return it()||at()}function st(e,t,n,r){let i=m(n);(0,j.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r)},[e,t,r])}function ct(e,t,n,r){let i=m(n);(0,j.useEffect)(()=>{if(!e)return;function n(e){i.current(e)}return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r)},[e,t,r])}var lt=30;function ut(e,t,n){let r=m(n),i=(0,j.useCallback)(function(e,n){if(e.defaultPrevented)return;let i=n(e);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let a=function e(t){return typeof t==`function`?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of a)if(t!==null&&(t.contains(i)||e.composed&&e.composedPath().includes(t)))return;return!$e(i,Qe.Loose)&&i.tabIndex!==-1&&e.preventDefault(),r.current(e,i)},[r,t]),a=(0,j.useRef)(null);st(e,`pointerdown`,e=>{ot()||(a.current=e.composedPath?.call(e)?.[0]||e.target)},!0),st(e,`pointerup`,e=>{if(ot()||!a.current)return;let t=a.current;return a.current=null,i(e,()=>t)},!0);let o=(0,j.useRef)({x:0,y:0});st(e,`touchstart`,e=>{o.current.x=e.touches[0].clientX,o.current.y=e.touches[0].clientY},!0),st(e,`touchend`,e=>{let t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};if(!(Math.abs(t.x-o.current.x)>=lt||Math.abs(t.y-o.current.y)>=lt))return i(e,()=>R(e.target)?e.target:null)},!0),ct(e,`blur`,e=>i(e,()=>ce(window.document.activeElement)?window.document.activeElement:null),!0)}function dt(...e){return(0,j.useMemo)(()=>k(...e),[...e])}function ft(e,t,n,r){let i=m(n);(0,j.useEffect)(()=>{e??=window;function n(e){i.current(e)}return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}function pt(e){return(0,j.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}function mt(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(e){return r.add(e),()=>r.delete(e)},dispatch(e,...i){let a=t[e].call(n,...i);a&&(n=a,r.forEach(e=>e()))}}}function ht(){let e;return{before({doc:t}){let n=t.documentElement,r=t.defaultView??window;e=Math.max(0,r.innerWidth-n.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-i);n.style(r,`paddingRight`,`${a}px`)}}}function gt(){return it()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!==`auto`){let n=E();n.style(e.documentElement,`scrollBehavior`,`auto`),t.add(()=>t.microTask(()=>n.dispose()))}let n=window.scrollY??window.pageYOffset,i=null;t.addEventListener(e,`click`,t=>{if(R(t.target))try{let n=t.target.closest(`a`);if(!n)return;let{hash:a}=new URL(n.href),o=e.querySelector(a);R(o)&&!r(o)&&(i=o)}catch{}},!0),t.group(n=>{t.addEventListener(e,`touchstart`,e=>{if(n.dispose(),R(e.target)&&z(e.target))if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,`overscrollBehavior`,`contain`)}else n.style(e.target,`touchAction`,`none`)})}),t.addEventListener(e,`touchmove`,e=>{if(R(e.target)){if(le(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&t.dataset.headlessuiPortal!==``&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;t.dataset.headlessuiPortal===``&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{n!==(window.scrollY??window.pageYOffset)&&window.scrollTo(0,n),i&&i.isConnected&&(i.scrollIntoView({block:`nearest`}),i=null)})})}}:{}}function _t(){return{before({doc:e,d:t}){t.style(e.documentElement,`overflow`,`hidden`)}}}function vt(e){let t={};for(let n of e)Object.assign(t,n(t));return t}var X=mt(()=>new Map,{PUSH(e,t){let n=this.get(e)??{doc:e,count:0,d:E(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=vt(n.meta),this.set(e,n),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=vt(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[gt(),ht(),_t()];n.forEach(({before:e})=>e?.(t)),n.forEach(({after:e})=>e?.(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});X.subscribe(()=>{let e=X.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e=t.get(n.doc)===`hidden`,r=n.count!==0;(r&&!e||!r&&e)&&X.dispatch(n.count>0?`SCROLL_PREVENT`:`SCROLL_ALLOW`,n),n.count===0&&X.dispatch(`TEARDOWN`,n)}});function yt(e,t,n=()=>({containers:[]})){let r=pt(X),i=t?r.get(t):void 0,a=i?i.count>0:!1;return c(()=>{if(!(!t||!e))return X.dispatch(`PUSH`,t,n),()=>X.dispatch(`POP`,t,n)},[e,t]),a}function bt(e,t,n=()=>[document.body]){yt(W(e,`scroll-lock`),t,e=>({containers:[...e.containers??[],n]}))}function xt(e,t){let n=(0,j.useRef)([]),r=h(e);(0,j.useEffect)(()=>{let e=[...n.current];for(let[i,a]of t.entries())if(n.current[i]!==a){let i=r(t,e);return n.current=t,i}},[r,...t])}function St(e){function t(){document.readyState!==`loading`&&(e(),document.removeEventListener(`DOMContentLoaded`,t))}typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`DOMContentLoaded`,t),t())}var Z=[];St(()=>{function e(e){if(!R(e.target)||e.target===document.body||Z[0]===e.target)return;let t=e.target;t=t.closest(K),Z.unshift(t??e.target),Z=Z.filter(e=>e!=null&&e.isConnected),Z.splice(10)}window.addEventListener(`click`,e,{capture:!0}),window.addEventListener(`mousedown`,e,{capture:!0}),window.addEventListener(`focus`,e,{capture:!0}),document.body.addEventListener(`click`,e,{capture:!0}),document.body.addEventListener(`mousedown`,e,{capture:!0}),document.body.addEventListener(`focus`,e,{capture:!0})});function Ct(e){let t=h(e),n=(0,j.useRef)(!1);(0,j.useEffect)(()=>(n.current=!1,()=>{n.current=!0,u(()=>{n.current&&t()})}),[t])}var wt=(0,j.createContext)(!1);function Tt(){return(0,j.useContext)(wt)}function Et(e){return j.createElement(wt.Provider,{value:e.force},e.children)}var Dt=n(r(),1);function Ot(e){let t=Tt(),n=(0,j.useContext)(Nt),[r,i]=(0,j.useState)(()=>{if(!t&&n!==null)return n.current??null;if(T.isServer)return null;let r=e?.getElementById(`headlessui-portal-root`);if(r)return r;if(e===null)return null;let i=e.createElement(`div`);return i.setAttribute(`id`,`headlessui-portal-root`),e.body.appendChild(i)});return(0,j.useEffect)(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),(0,j.useEffect)(()=>{t||n!==null&&i(n.current)},[n,i,t]),r}var kt=j.Fragment,At=b(function(e,t){let{ownerDocument:n=null,...r}=e,i=(0,j.useRef)(null),a=C(ee(e=>{i.current=e}),t),o=dt(i.current),s=Ot(n??o),c=(0,j.useContext)(Ft),u=w(),d=l(),f=p();return Ct(()=>{var e;s&&s.childNodes.length<=0&&((e=s.parentElement)==null||e.removeChild(s))}),!s||!d?null:(0,Dt.createPortal)(j.createElement(`div`,{"data-headlessui-portal":``,ref:e=>{u.dispose(),c&&e&&u.add(c.register(e))}},f({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:kt,name:`Portal`})),s)});function jt(e,t){let n=C(t),{enabled:r=!0,ownerDocument:i,...a}=e,o=p();return r?j.createElement(At,{...a,ownerDocument:i,ref:n}):o({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:kt,name:`Portal`})}var Mt=j.Fragment,Nt=(0,j.createContext)(null);function Pt(e,t){let{target:n,...r}=e,i={ref:C(t)},a=p();return j.createElement(Nt.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:Mt,name:`Popover.Group`}))}var Ft=(0,j.createContext)(null);function It(){let e=(0,j.useContext)(Ft),t=(0,j.useRef)([]),n=h(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=h(n=>{let r=t.current.indexOf(n);r!==-1&&t.current.splice(r,1),e&&e.unregister(n)}),i=(0,j.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,j.useMemo)(()=>function({children:e}){return j.createElement(Ft.Provider,{value:i},e)},[i])]}var Lt=b(jt),Rt=b(Pt),zt=Object.assign(Lt,{Group:Rt});function Bt(e,t=typeof document<`u`?document.defaultView:null,n){let r=W(e,`escape`);ft(t,`keydown`,e=>{r&&(e.defaultPrevented||e.key===_e.Escape&&n(e))})}function Vt(){let[e]=(0,j.useState)(()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`):null),[t,n]=(0,j.useState)(e?.matches??!1);return c(()=>{if(!e)return;function t(e){n(e.matches)}return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[e]),t}function Ht({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=h(()=>{let r=k(n),i=[];for(let t of e)t!==null&&(I(t)?i.push(t):`current`in t&&I(t.current)&&i.push(t.current));if(t!=null&&t.current)for(let e of t.current)i.push(e);for(let e of r?.querySelectorAll(`html > *, body > *`)??[])e!==document.body&&e!==document.head&&I(e)&&e.id!==`headlessui-portal-root`&&(n&&(e.contains(n)||e.contains(n?.getRootNode()?.host))||i.some(t=>e.contains(t))||i.push(e));return i});return{resolveContainers:r,contains:h(e=>r().some(t=>t.contains(e)))}}var Ut=(0,j.createContext)(null);function Wt({children:e,node:t}){let[n,r]=(0,j.useState)(null),i=Gt(t??n);return j.createElement(Ut.Provider,{value:i},e,i===null&&j.createElement(oe,{features:F.Hidden,ref:e=>{if(e){for(let t of k(e)?.querySelectorAll(`html > *, body > *`)??[])if(t!==document.body&&t!==document.head&&I(t)&&t!=null&&t.contains(e)){r(t);break}}}}))}function Gt(e=null){return(0,j.useContext)(Ut)??e}var Q=(e=>(e[e.Forwards=0]=`Forwards`,e[e.Backwards=1]=`Backwards`,e))(Q||{});function Kt(){let e=(0,j.useRef)(0);return ct(!0,`keydown`,t=>{t.key===`Tab`&&(e.current=+!!t.shiftKey)},!0),e}function qt(e){if(!e)return new Set;if(typeof e==`function`)return new Set(e());let t=new Set;for(let n of e.current)I(n.current)&&t.add(n.current);return t}var Jt=`div`,$=(e=>(e[e.None=0]=`None`,e[e.InitialFocus=1]=`InitialFocus`,e[e.TabLock=2]=`TabLock`,e[e.FocusLock=4]=`FocusLock`,e[e.RestoreFocus=8]=`RestoreFocus`,e[e.AutoFocus=16]=`AutoFocus`,e))($||{});function Yt(e,t){let n=(0,j.useRef)(null),r=C(n,t),{initialFocus:i,initialFocusFallback:a,containers:o,features:s=15,...c}=e;l()||(s=0);let u=dt(n.current);$t(s,{ownerDocument:u});let d=en(s,{ownerDocument:u,container:n,initialFocus:i,initialFocusFallback:a});tn(s,{ownerDocument:u,container:n,containers:o,previousActiveElement:d});let f=Kt(),m=h(e=>{if(!L(n.current))return;let t=n.current;(e=>e())(()=>{_(f.current,{[Q.Forwards]:()=>{Y(t,q.First,{skipElements:[e.relatedTarget,a]})},[Q.Backwards]:()=>{Y(t,q.Last,{skipElements:[e.relatedTarget,a]})}})})}),g=W(!!(s&2),`focus-trap#tab-lock`),ee=w(),v=(0,j.useRef)(!1),y={ref:r,onKeyDown(e){e.key==`Tab`&&(v.current=!0,ee.requestAnimationFrame(()=>{v.current=!1}))},onBlur(e){if(!(s&4))return;let t=qt(o);L(n.current)&&t.add(n.current);let r=e.relatedTarget;R(r)&&r.dataset.headlessuiFocusGuard!==`true`&&(nn(t,r)||(v.current?Y(n.current,_(f.current,{[Q.Forwards]:()=>q.Next,[Q.Backwards]:()=>q.Previous})|q.WrapAround,{relativeTo:e.target}):R(e.target)&&J(e.target)))}},b=p();return j.createElement(j.Fragment,null,g&&j.createElement(oe,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:m,features:F.Focusable}),b({ourProps:y,theirProps:c,defaultTag:Jt,name:`FocusTrap`}),g&&j.createElement(oe,{as:`button`,type:`button`,"data-headlessui-focus-guard":!0,onFocus:m,features:F.Focusable}))}var Xt=b(Yt),Zt=Object.assign(Xt,{features:$});function Qt(e=!0){let t=(0,j.useRef)(Z.slice());return xt(([e],[n])=>{n===!0&&e===!1&&u(()=>{t.current.splice(0)}),n===!1&&e===!0&&(t.current=Z.slice())},[e,Z,t]),h(()=>t.current.find(e=>e!=null&&e.isConnected)??null)}function $t(e,{ownerDocument:t}){let n=!!(e&8),r=Qt(n);xt(()=>{n||re(t?.body)&&J(r())},[n]),Ct(()=>{n&&J(r())})}function en(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:i}){let a=(0,j.useRef)(null),o=W(!!(e&1),`focus-trap#initial-focus`),s=g();return xt(()=>{if(e===0)return;if(!o){i!=null&&i.current&&J(i.current);return}let c=n.current;c&&u(()=>{if(!s.current)return;let n=t?.activeElement;if(r!=null&&r.current){if(r?.current===n){a.current=n;return}}else if(c.contains(n)){a.current=n;return}if(r!=null&&r.current)J(r.current);else{if(e&16){if(Y(c,q.First|q.AutoFocus)!==Je.Error)return}else if(Y(c,q.First)!==Je.Error)return;if(i!=null&&i.current&&(J(i.current),t?.activeElement===i.current))return;console.warn(`There are no focusable elements inside the `)}a.current=t?.activeElement})},[i,o,e]),a}function tn(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let a=g(),o=!!(e&4);ft(t?.defaultView,`focus`,e=>{if(!o||!a.current)return;let t=qt(r);L(n.current)&&t.add(n.current);let s=i.current;if(!s)return;let c=e.target;L(c)?nn(t,c)?(i.current=c,J(c)):(e.preventDefault(),e.stopPropagation(),J(s)):J(i.current)},!0)}function nn(e,t){for(let n of e)if(n.contains(t))return!0;return!1}var rn=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))(rn||{}),an=(e=>(e[e.SetTitleId=0]=`SetTitleId`,e))(an||{}),on={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},sn=(0,j.createContext)(null);sn.displayName=`DialogContext`;function cn(e){let t=(0,j.useContext)(sn);if(t===null){let t=Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,cn),t}return t}function ln(e,t){return _(t.type,on,e,t)}var un=b(function(e,t){let n=(0,j.useId)(),{id:r=`headlessui-dialog-${n}`,open:i,onClose:a,initialFocus:o,role:s=`dialog`,autoFocus:u=!0,__demoMode:f=!1,unmount:m=!1,...g}=e,ee=(0,j.useRef)(!1);s=function(){return s===`dialog`||s===`alertdialog`?s:(ee.current||(ee.current=!0,console.warn(`Invalid role [${s}] passed to . Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),`dialog`)}();let _=d();i===void 0&&_!==null&&(i=(_&y.Open)===y.Open);let v=(0,j.useRef)(null),b=C(v,t),x=dt(v.current),S=+!i,[w,T]=(0,j.useReducer)(ln,{titleId:null,descriptionId:null,panelRef:(0,j.createRef)()}),E=h(()=>a(!1)),D=h(e=>T({type:0,id:e})),O=l()?S===0:!1,[k,A]=It(),ne={get current(){return w.panelRef.current??v.current}},re=Gt(),{resolveContainers:N}=Ht({mainTreeNode:re,portals:k,defaultContainers:[ne]}),ie=_===null?!1:(_&y.Closing)===y.Closing;Ge(f||ie?!1:O,{allowed:h(()=>[v.current?.closest(`[data-headlessui-portal]`)??null]),disallowed:h(()=>[re?.closest(`body > *:not(#headlessui-portal-root)`)??null])});let P=Le.get(null);c(()=>{if(O)return P.actions.push(r),()=>P.actions.pop(r)},[P,r,O]);let F=Be(P,(0,j.useCallback)(e=>P.selectors.isTop(e,r),[P,r]));ut(F,N,e=>{e.preventDefault(),E()}),Bt(F,x?.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&`blur`in document.activeElement&&typeof document.activeElement.blur==`function`&&document.activeElement.blur(),E()}),bt(f||ie?!1:O,x,N),Ke(O,v,E);let[ae,oe]=fe(),se=(0,j.useMemo)(()=>[{dialogState:S,close:E,setTitleId:D,unmount:m},w],[S,E,D,m,w]),I=M({open:S===0}),L={ref:b,id:r,role:s,tabIndex:-1,"aria-modal":f?void 0:S===0?!0:void 0,"aria-labelledby":w.titleId,"aria-describedby":ae,unmount:m},R=!Vt(),z=$.None;O&&!f&&(z|=$.RestoreFocus,z|=$.TabLock,u&&(z|=$.AutoFocus),R&&(z|=$.InitialFocus));let ce=p();return j.createElement(te,null,j.createElement(Et,{force:!0},j.createElement(zt,null,j.createElement(sn.Provider,{value:se},j.createElement(Rt,{target:v},j.createElement(Et,{force:!1},j.createElement(oe,{slot:I},j.createElement(A,null,j.createElement(Zt,{initialFocus:o,initialFocusFallback:v,containers:N,features:z},j.createElement(ye,{value:E},ce({ourProps:L,theirProps:g,slot:I,defaultTag:dn,features:fn,visible:S===0,name:`Dialog`})))))))))))}),dn=`div`,fn=f.RenderStrategy|f.Static;function pn(e,t){let{transition:n=!1,open:r,...i}=e,a=d(),o=e.hasOwnProperty(`open`)||a!==null,s=e.hasOwnProperty(`onClose`);if(!o&&!s)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!o)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof e.open!=`boolean`)throw Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!=`function`)throw Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(r!==void 0||n)&&!i.static?j.createElement(Wt,null,j.createElement(v,{show:r,transition:n,unmount:i.unmount},j.createElement(un,{ref:t,...i}))):j.createElement(Wt,null,j.createElement(un,{ref:t,open:r,...i}))}var mn=`div`;function hn(e,t){let n=(0,j.useId)(),{id:r=`headlessui-dialog-panel-${n}`,transition:i=!1,...a}=e,[{dialogState:o,unmount:s},c]=cn(`Dialog.Panel`),l=C(t,c.panelRef),u=M({open:o===0}),d={ref:l,id:r,onClick:h(e=>{e.stopPropagation()})},f=i?x:j.Fragment,m=i?{unmount:s}:{},g=p();return j.createElement(f,{...m},g({ourProps:d,theirProps:a,slot:u,defaultTag:mn,name:`Dialog.Panel`}))}var gn=`div`;function _n(e,t){let{transition:n=!1,...r}=e,[{dialogState:i,unmount:a}]=cn(`Dialog.Backdrop`),o=M({open:i===0}),s={ref:t,"aria-hidden":!0},c=n?x:j.Fragment,l=n?{unmount:a}:{},u=p();return j.createElement(c,{...l},u({ourProps:s,theirProps:r,slot:o,defaultTag:gn,name:`Dialog.Backdrop`}))}var vn=`h2`;function yn(e,t){let n=(0,j.useId)(),{id:r=`headlessui-dialog-title-${n}`,...i}=e,[{dialogState:a,setTitleId:o}]=cn(`Dialog.Title`),s=C(t);(0,j.useEffect)(()=>(o(r),()=>o(null)),[r,o]);let c=M({open:a===0}),l={ref:s,id:r};return p()({ourProps:l,theirProps:i,slot:c,defaultTag:vn,name:`Dialog.Title`})}var bn=b(pn),xn=b(hn);b(_n);var Sn=b(yn),Cn=Object.assign(bn,{Panel:xn,Title:Sn,Description:ge});function wn({children:e,show:t=!1,maxWidth:n=`2xl`,closeable:r=!0,onClose:i=()=>{}}){let a=()=>{r&&i()},o={sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`}[n];return(0,D.jsx)(v,{show:t,leave:`duration-200`,children:(0,D.jsxs)(Cn,{as:`div`,id:`modal`,className:`fixed inset-0 z-50 flex transform items-center overflow-y-auto px-4 py-6 transition-all sm:px-0`,onClose:a,children:[(0,D.jsx)(x,{enter:`ease-out duration-300`,enterFrom:`opacity-0`,enterTo:`opacity-100`,leave:`ease-in duration-200`,leaveFrom:`opacity-100`,leaveTo:`opacity-0`,children:(0,D.jsx)(`div`,{className:`absolute inset-0 bg-gray-500/75`})}),(0,D.jsx)(x,{enter:`ease-out duration-300`,enterFrom:`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,enterTo:`opacity-100 translate-y-0 sm:scale-100`,leave:`ease-in duration-200`,leaveFrom:`opacity-100 translate-y-0 sm:scale-100`,leaveTo:`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,children:(0,D.jsx)(xn,{className:`mb-6 transform overflow-hidden rounded-lg bg-white shadow-xl transition-all sm:mx-auto sm:w-full ${o}`,children:e})})]})})}function Tn({type:e=`button`,className:t=``,disabled:n,children:r,...i}){return(0,D.jsx)(`button`,{...i,type:e,className:`inline-flex items-center rounded-xl border border-gray-200 bg-white px-4 py-2 text-sm font-bold tracking-tight text-[#3D4E4B] transition-all hover:bg-gray-50 hover:border-gray-300 focus:outline-none focus:ring-2 focus:ring-[#D4A017] focus:ring-offset-2 disabled:opacity-25 ${n&&`opacity-25`} `+t,disabled:n,children:r})}function En({className:t=``}){let[n,r]=(0,j.useState)(!1),i=(0,j.useRef)(),{data:a,setData:c,delete:l,processing:u,reset:d,errors:f,clearErrors:p}=e({password:``}),m=()=>{r(!0)},h=e=>{e.preventDefault(),l(route(`profile.destroy`),{preserveScroll:!0,onSuccess:()=>g(),onError:()=>i.current.focus(),onFinish:()=>d()})},g=()=>{r(!1),p(),d()};return(0,D.jsxs)(`section`,{className:`space-y-6 ${t}`,children:[(0,D.jsxs)(`header`,{children:[(0,D.jsx)(`h2`,{className:`text-lg font-medium text-gray-900`,children:`Delete Account`}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:`Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.`})]}),(0,D.jsx)(O,{onClick:m,children:`Delete Account`}),(0,D.jsx)(wn,{show:n,onClose:g,children:(0,D.jsxs)(`form`,{onSubmit:h,className:`p-6`,children:[(0,D.jsx)(`h2`,{className:`text-lg font-medium text-gray-900`,children:`Are you sure you want to delete your account?`}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:`Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.`}),(0,D.jsxs)(`div`,{className:`mt-6`,children:[(0,D.jsx)(s,{htmlFor:`password`,value:`Password`,className:`sr-only`}),(0,D.jsx)(S,{id:`password`,type:`password`,name:`password`,ref:i,value:a.password,onChange:e=>c(`password`,e.target.value),className:`mt-1 block w-3/4`,isFocused:!0,placeholder:`Password`}),(0,D.jsx)(o,{message:f.password,className:`mt-2`})]}),(0,D.jsxs)(`div`,{className:`mt-6 flex justify-end`,children:[(0,D.jsx)(Tn,{onClick:g,children:`Cancel`}),(0,D.jsx)(O,{className:`ms-3`,disabled:u,children:`Delete Account`})]})]})})]})}export{En as default}; \ No newline at end of file diff --git a/public/build/assets/Edit-CqP9KoA8.js b/public/build/assets/Edit-DhcQ-LdT.js similarity index 97% rename from public/build/assets/Edit-CqP9KoA8.js rename to public/build/assets/Edit-DhcQ-LdT.js index 5ceb08f..3439a9d 100644 --- a/public/build/assets/Edit-CqP9KoA8.js +++ b/public/build/assets/Edit-DhcQ-LdT.js @@ -1,2 +1,2 @@ -import{a as e,c as t,d as n,i as r,n as i,o as a,t as o}from"./app-BK5KCPMc.js";import{t as s}from"./AuthenticatedLayout-BjuyW-Hp.js";import{t as c}from"./swal-D8hRpOIh.js";import{n as l,r as u,t as d}from"./filepond-plugin-file-validate-type-tybTRj_0.js";var f=n(t(),1),p=u(),m=n(l(),1),h=n(d(),1),g=o();(0,p.registerPlugin)(m.default,h.default);function _({title:e,description:t,children:n,delay:r=`0s`}){return(0,g.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden h-full flex flex-col anim-up`,style:{animationDelay:r},children:[(0,g.jsxs)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:e}),(0,g.jsx)(`p`,{className:`text-xs text-gray-400 font-semibold tracking-tight mt-1`,children:t})]}),(0,g.jsx)(`div`,{className:`p-6 flex-1`,children:n})]})}function v({label:e,id:t,type:n=`text`,value:r,onChange:i,error:a,placeholder:o,required:s=!1,...c}){return(0,g.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,g.jsxs)(`label`,{htmlFor:t,className:`block text-xs font-bold text-gray-400 tracking-tight ml-1`,children:[e,` `,s&&(0,g.jsx)(`span`,{className:`text-red-500`,children:`*`})]}),(0,g.jsx)(`input`,{id:t,type:n,value:r,onChange:i,placeholder:o,className:`w-full px-4 py-2.5 rounded-xl border text-sm font-bold transition-all outline-none +import{a as e,c as t,d as n,i as r,n as i,o as a,t as o}from"./app-C2kGDHB9.js";import{t as s}from"./AuthenticatedLayout-C8h2HS7D.js";import{t as c}from"./swal-DeDNECCu.js";import{n as l,r as u,t as d}from"./filepond-plugin-file-validate-type-DOUFAaeW.js";var f=n(t(),1),p=u(),m=n(l(),1),h=n(d(),1),g=o();(0,p.registerPlugin)(m.default,h.default);function _({title:e,description:t,children:n,delay:r=`0s`}){return(0,g.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden h-full flex flex-col anim-up`,style:{animationDelay:r},children:[(0,g.jsxs)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:e}),(0,g.jsx)(`p`,{className:`text-xs text-gray-400 font-semibold tracking-tight mt-1`,children:t})]}),(0,g.jsx)(`div`,{className:`p-6 flex-1`,children:n})]})}function v({label:e,id:t,type:n=`text`,value:r,onChange:i,error:a,placeholder:o,required:s=!1,...c}){return(0,g.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,g.jsxs)(`label`,{htmlFor:t,className:`block text-xs font-bold text-gray-400 tracking-tight ml-1`,children:[e,` `,s&&(0,g.jsx)(`span`,{className:`text-red-500`,children:`*`})]}),(0,g.jsx)(`input`,{id:t,type:n,value:r,onChange:i,placeholder:o,className:`w-full px-4 py-2.5 rounded-xl border text-sm font-bold transition-all outline-none ${a?`border-red-300 bg-red-50`:`border-gray-100 bg-gray-50/30 focus:border-[#D4A017] focus:bg-white`}`,...c}),a&&(0,g.jsx)(`p`,{className:`text-sm text-red-500 font-bold ml-1`,children:a})]})}function y({mustVerifyEmail:t,status:n}){let{auth:o}=a().props,{user:l}=o,[u,d]=(0,f.useState)([]),m=e({first_name:l.first_name||``,last_name:l.last_name||``,email:l.email||``,phone:l.phone||``,bio:l.bio||``,avatar_file:null,_method:`PATCH`}),h=e({current_password:``,password:``,password_confirmation:``}),y=e=>{e.preventDefault(),m.post(route(`profile.update`),{preserveScroll:!0,onSuccess:()=>c.success(`Success`,`Profile identity synchronized.`)})},b=e=>{e.preventDefault(),h.put(route(`password.update`),{preserveScroll:!0,onSuccess:()=>{h.reset(),c.success(`Success`,`Security token updated.`)}})},x=`${l.first_name?.charAt(0)||``}${l.last_name?.charAt(0)||``}`.toUpperCase();return(0,g.jsxs)(s,{children:[(0,g.jsx)(i,{title:`Account Settings`}),(0,g.jsxs)(`div`,{className:`mb-6 anim-down`,children:[(0,g.jsx)(`h1`,{className:`text-lg font-bold text-[#3D4E4B] dark:text-white tracking-tight leading-none`,children:`Account Settings`}),(0,g.jsx)(`p`,{className:`text-xs font-semibold text-gray-400 tracking-tight mt-2`,children:`Personal Identity & Security Governance`})]}),(0,g.jsxs)(`div`,{className:`w-full grid grid-cols-1 lg:grid-cols-2 gap-6 pb-20`,children:[(0,g.jsx)(`div`,{className:`space-y-6`,children:(0,g.jsx)(_,{title:`Identity Configuration`,description:`Manage your personal credentials`,delay:`0s`,children:(0,g.jsxs)(`form`,{onSubmit:y,className:`space-y-6`,children:[(0,g.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center gap-6 mb-4`,children:[(0,g.jsx)(`div`,{className:`w-24 h-24 rounded-2xl flex items-center justify-center text-white text-3xl font-bold shrink-0 border border-gray-100 dark:border-white/5 ${l.avatar_url?`bg-white dark:bg-white/5`:`bg-[#3D4E4B]`}`,children:l.avatar_url?(0,g.jsx)(`img`,{src:l.avatar_url,className:`w-full h-full object-cover rounded-2xl`}):x}),(0,g.jsxs)(`div`,{className:`flex-1 w-full`,children:[(0,g.jsx)(`label`,{className:`text-[10px] font-black text-gray-400 uppercase tracking-widest mb-2 block`,children:`Identity Portrait`}),(0,g.jsx)(p.FilePond,{files:u,onupdatefiles:e=>{d(e),m.setData(`avatar_file`,e[0]?.file||null)},allowMultiple:!1,maxFiles:1,labelIdle:`Portrait update`})]})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,g.jsx)(v,{label:`First Designation`,id:`first_name`,value:m.data.first_name,onChange:e=>m.setData(`first_name`,e.target.value),error:m.errors.first_name,required:!0,placeholder:`e.g. Alex`}),(0,g.jsx)(v,{label:`Last Designation`,id:`last_name`,value:m.data.last_name,onChange:e=>m.setData(`last_name`,e.target.value),error:m.errors.last_name,required:!0,placeholder:`e.g. Johnson`})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,g.jsx)(v,{label:`Communication Channel (Email)`,id:`email`,type:`email`,value:m.data.email,onChange:e=>m.setData(`email`,e.target.value),error:m.errors.email,required:!0,placeholder:`alex@company.com`}),(0,g.jsx)(v,{label:`Contact Number (Phone)`,id:`phone`,type:`tel`,value:m.data.phone,onChange:e=>m.setData(`phone`,e.target.value),error:m.errors.phone,placeholder:`+62...`})]}),(0,g.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,g.jsx)(`label`,{className:`block text-[10px] font-black text-gray-400 uppercase tracking-widest ml-1`,children:`Professional Bio`}),(0,g.jsx)(`textarea`,{value:m.data.bio,onChange:e=>m.setData(`bio`,e.target.value),rows:4,className:`input-field py-3 resize-none`,placeholder:`Tell us about yourself...`})]}),(0,g.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,g.jsx)(`button`,{type:`submit`,disabled:m.processing,className:`px-8 py-3 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20`,children:m.processing?`Synchronizing...`:`Update Identity`})})]})})}),(0,g.jsxs)(`div`,{className:`space-y-6 flex flex-col`,children:[(0,g.jsx)(_,{title:`Security Protocols`,description:`Authentication & Token Lifecycle`,delay:`0.1s`,children:(0,g.jsxs)(`form`,{onSubmit:b,className:`space-y-4`,children:[(0,g.jsx)(v,{label:`Current Security Token`,id:`current_password`,type:`password`,value:h.data.current_password,onChange:e=>h.setData(`current_password`,e.target.value),error:h.errors.current_password,required:!0,placeholder:`••••••••`}),(0,g.jsx)(v,{label:`New Security Token`,id:`password`,type:`password`,value:h.data.password,onChange:e=>h.setData(`password`,e.target.value),error:h.errors.password,required:!0,placeholder:`••••••••`}),(0,g.jsx)(v,{label:`Verify Token`,id:`password_confirmation`,type:`password`,value:h.data.password_confirmation,onChange:e=>h.setData(`password_confirmation`,e.target.value),error:h.errors.password_confirmation,required:!0,placeholder:`••••••••`}),(0,g.jsx)(`div`,{className:`pt-4`,children:(0,g.jsx)(`button`,{type:`submit`,disabled:h.processing,className:`w-full py-3 bg-[#D4A017] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#B88B14] transition-all`,children:h.processing?`...`:`Rotate Security Tokens`})})]})}),(0,g.jsxs)(`div`,{className:`bg-white rounded-2xl border border-red-100 p-6 shadow-sm anim-up`,style:{animationDelay:`0.2s`},children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,g.jsx)(`h3`,{className:`text-sm font-bold text-red-800 tracking-tight`,children:`Termination Zone`}),(0,g.jsx)(`span`,{className:`px-2 py-0.5 bg-red-50 text-red-600 text-sm font-bold rounded-md border border-red-100`,children:`Critical`})]}),(0,g.jsx)(`p`,{className:`text-xs text-red-600 font-semibold leading-relaxed mb-4`,children:`Once account liquidation is initiated, the process is irreversible. All associated data assets will be purged.`}),(0,g.jsx)(`button`,{onClick:()=>{c.confirmDelete(`Your Entire Account`).then(e=>{e.isConfirmed&&r.delete(route(`profile.destroy`))})},className:`w-full py-3 border border-red-100 text-red-600 text-xs font-bold tracking-tight rounded-xl hover:bg-red-50 transition-colors`,children:`Initiate Liquidation`})]})]})]})]})}export{y as default}; \ No newline at end of file diff --git a/public/build/assets/Error-CmUynFQU.js b/public/build/assets/Error-BoVeZyza.js similarity index 97% rename from public/build/assets/Error-CmUynFQU.js rename to public/build/assets/Error-BoVeZyza.js index 3f72ac7..364a732 100644 --- a/public/build/assets/Error-CmUynFQU.js +++ b/public/build/assets/Error-BoVeZyza.js @@ -1 +1 @@ -import{c as e,n as t,r as n,t as r}from"./app-BK5KCPMc.js";e();var i=r(),a={403:{title:`Access Denied`,description:`You don't have permission to access this resource.`},404:{title:`Page Not Found`,description:`The page you're looking for doesn't exist or has been moved.`},419:{title:`Session Expired`,description:`Your session has expired. Please refresh and try again.`},500:{title:`Server Error`,description:`Something went wrong on our end. Please try again later.`},503:{title:`Under Maintenance`,description:`The system is temporarily unavailable. Please check back soon.`}};function o({status:e}){let{title:r,description:o}=a[e]??{title:`Unexpected Error`,description:`An unexpected error occurred.`};return(0,i.jsxs)(`div`,{className:`min-h-screen bg-[#E3EBE8] flex items-center justify-center p-6`,children:[(0,i.jsx)(t,{title:`${e} — ${r}`}),(0,i.jsxs)(`div`,{className:`w-full max-w-md`,children:[(0,i.jsxs)(`div`,{className:`bg-white rounded-3xl border border-gray-100 shadow-sm overflow-hidden`,children:[(0,i.jsxs)(`div`,{className:`bg-[#3D4E4B] px-8 py-10 text-center`,children:[(0,i.jsx)(`div`,{className:`text-7xl font-black text-white/10 tracking-tighter leading-none select-none`,children:e}),(0,i.jsx)(`div`,{className:`mt-2 text-xl font-bold text-white tracking-tight`,children:r})]}),(0,i.jsxs)(`div`,{className:`px-8 py-8 text-center space-y-6`,children:[(0,i.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 leading-relaxed`,children:o}),(0,i.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3 justify-center`,children:[e===419?(0,i.jsxs)(`button`,{onClick:()=>window.location.reload(),className:`h-10 px-6 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all flex items-center justify-center gap-2`,children:[(0,i.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`})}),`Refresh Page`]}):(0,i.jsxs)(n,{href:`/dashboard`,className:`h-10 px-6 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all flex items-center justify-center gap-2`,children:[(0,i.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6`})}),`Back to Dashboard`]}),(0,i.jsx)(`button`,{onClick:()=>window.history.back(),className:`h-10 px-6 bg-white border border-gray-100 text-gray-500 text-sm font-bold tracking-tight rounded-xl hover:bg-gray-50 transition-all`,children:`Go Back`})]})]})]}),(0,i.jsxs)(`p`,{className:`text-center text-xs font-bold text-gray-400 uppercase tracking-widest mt-6`,children:[`Error `,e]})]})]})}export{o as default}; \ No newline at end of file +import{c as e,n as t,r as n,t as r}from"./app-C2kGDHB9.js";e();var i=r(),a={403:{title:`Access Denied`,description:`You don't have permission to access this resource.`},404:{title:`Page Not Found`,description:`The page you're looking for doesn't exist or has been moved.`},419:{title:`Session Expired`,description:`Your session has expired. Please refresh and try again.`},500:{title:`Server Error`,description:`Something went wrong on our end. Please try again later.`},503:{title:`Under Maintenance`,description:`The system is temporarily unavailable. Please check back soon.`}};function o({status:e}){let{title:r,description:o}=a[e]??{title:`Unexpected Error`,description:`An unexpected error occurred.`};return(0,i.jsxs)(`div`,{className:`min-h-screen bg-[#E3EBE8] flex items-center justify-center p-6`,children:[(0,i.jsx)(t,{title:`${e} — ${r}`}),(0,i.jsxs)(`div`,{className:`w-full max-w-md`,children:[(0,i.jsxs)(`div`,{className:`bg-white rounded-3xl border border-gray-100 shadow-sm overflow-hidden`,children:[(0,i.jsxs)(`div`,{className:`bg-[#3D4E4B] px-8 py-10 text-center`,children:[(0,i.jsx)(`div`,{className:`text-7xl font-black text-white/10 tracking-tighter leading-none select-none`,children:e}),(0,i.jsx)(`div`,{className:`mt-2 text-xl font-bold text-white tracking-tight`,children:r})]}),(0,i.jsxs)(`div`,{className:`px-8 py-8 text-center space-y-6`,children:[(0,i.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 leading-relaxed`,children:o}),(0,i.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3 justify-center`,children:[e===419?(0,i.jsxs)(`button`,{onClick:()=>window.location.reload(),className:`h-10 px-6 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all flex items-center justify-center gap-2`,children:[(0,i.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`})}),`Refresh Page`]}):(0,i.jsxs)(n,{href:`/dashboard`,className:`h-10 px-6 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all flex items-center justify-center gap-2`,children:[(0,i.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6`})}),`Back to Dashboard`]}),(0,i.jsx)(`button`,{onClick:()=>window.history.back(),className:`h-10 px-6 bg-white border border-gray-100 text-gray-500 text-sm font-bold tracking-tight rounded-xl hover:bg-gray-50 transition-all`,children:`Go Back`})]})]})]}),(0,i.jsxs)(`p`,{className:`text-center text-xs font-bold text-gray-400 uppercase tracking-widest mt-6`,children:[`Error `,e]})]})]})}export{o as default}; \ No newline at end of file diff --git a/public/build/assets/ForgotPassword-BGsGiFYN.js b/public/build/assets/ForgotPassword-C_3dBdrE.js similarity index 94% rename from public/build/assets/ForgotPassword-BGsGiFYN.js rename to public/build/assets/ForgotPassword-C_3dBdrE.js index 29730b6..d6976b5 100644 --- a/public/build/assets/ForgotPassword-BGsGiFYN.js +++ b/public/build/assets/ForgotPassword-C_3dBdrE.js @@ -1 +1 @@ -import{a as e,c as t,n,r,t as i}from"./app-BK5KCPMc.js";import{t as a}from"./GuestLayout-CgPUg7Kz.js";t();var o=i();function s({status:t}){let{data:i,setData:s,post:c,processing:l,errors:u}=e({email:``});return(0,o.jsxs)(a,{children:[(0,o.jsx)(n,{title:`Forgot password`}),(0,o.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,o.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Forgot password?`}),(0,o.jsx)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium`,children:`Enter your email and we'll send a reset link.`})]}),t&&(0,o.jsx)(`div`,{className:`mb-6 px-4 py-3 rounded-xl bg-emerald-50 border border-emerald-100 text-sm font-semibold text-emerald-700 anim-fade`,children:t}),(0,o.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),c(route(`password.email`))},className:`anim-up`,style:{animationDelay:`0.1s`},children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`label`,{htmlFor:`email`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Email address`}),(0,o.jsx)(`input`,{id:`email`,type:`email`,autoComplete:`email`,autoFocus:!0,value:i.email,onChange:e=>s(`email`,e.target.value),placeholder:`you@company.com`,className:`auth-input${u.email?` !border-red-300 !bg-red-50/50`:``}`}),u.email&&(0,o.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:u.email})]}),(0,o.jsx)(`button`,{type:`submit`,disabled:l,className:`mt-6 w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:l?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,o.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,o.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Sending…`]}):`Send reset link`})]}),(0,o.jsx)(`p`,{className:`mt-7 text-center text-sm text-gray-400 font-medium anim-fade`,style:{animationDelay:`0.18s`},children:(0,o.jsx)(r,{href:route(`login`),className:`text-[#3D4E4B] font-semibold hover:text-[#D4A017] transition-colors duration-200`,children:`← Back to sign in`})})]})}export{s as default}; \ No newline at end of file +import{a as e,c as t,n,r,t as i}from"./app-C2kGDHB9.js";import{t as a}from"./GuestLayout-DfP8Xy7D.js";t();var o=i();function s({status:t}){let{data:i,setData:s,post:c,processing:l,errors:u}=e({email:``});return(0,o.jsxs)(a,{children:[(0,o.jsx)(n,{title:`Forgot password`}),(0,o.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,o.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Forgot password?`}),(0,o.jsx)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium`,children:`Enter your email and we'll send a reset link.`})]}),t&&(0,o.jsx)(`div`,{className:`mb-6 px-4 py-3 rounded-xl bg-emerald-50 border border-emerald-100 text-sm font-semibold text-emerald-700 anim-fade`,children:t}),(0,o.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),c(route(`password.email`))},className:`anim-up`,style:{animationDelay:`0.1s`},children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`label`,{htmlFor:`email`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Email address`}),(0,o.jsx)(`input`,{id:`email`,type:`email`,autoComplete:`email`,autoFocus:!0,value:i.email,onChange:e=>s(`email`,e.target.value),placeholder:`you@company.com`,className:`auth-input${u.email?` !border-red-300 !bg-red-50/50`:``}`}),u.email&&(0,o.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:u.email})]}),(0,o.jsx)(`button`,{type:`submit`,disabled:l,className:`mt-6 w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:l?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,o.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,o.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Sending…`]}):`Send reset link`})]}),(0,o.jsx)(`p`,{className:`mt-7 text-center text-sm text-gray-400 font-medium anim-fade`,style:{animationDelay:`0.18s`},children:(0,o.jsx)(r,{href:route(`login`),className:`text-[#3D4E4B] font-semibold hover:text-[#D4A017] transition-colors duration-200`,children:`← Back to sign in`})})]})}export{s as default}; \ No newline at end of file diff --git a/public/build/assets/GuestLayout-CgPUg7Kz.js b/public/build/assets/GuestLayout-DfP8Xy7D.js similarity index 98% rename from public/build/assets/GuestLayout-CgPUg7Kz.js rename to public/build/assets/GuestLayout-DfP8Xy7D.js index 0b9cf92..f3edc7e 100644 --- a/public/build/assets/GuestLayout-CgPUg7Kz.js +++ b/public/build/assets/GuestLayout-DfP8Xy7D.js @@ -1 +1 @@ -import{c as e,o as t,r as n,t as r}from"./app-BK5KCPMc.js";e();var i=r();function a({children:e}){let{system_settings:r}=t().props,a=r?.app_name||`biiproject kit v2`,o=r?.app_logo,s=r?.app_logo_text||`BK`;return(0,i.jsxs)(`div`,{className:`min-h-screen flex font-sans`,children:[(0,i.jsxs)(`div`,{className:`hidden lg:flex lg:w-[44%] bg-[#3D4E4B] flex-col justify-between p-14 relative overflow-hidden shrink-0`,children:[(0,i.jsxs)(`svg`,{className:`absolute inset-0 w-full h-full pointer-events-none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,i.jsx)(`defs`,{children:(0,i.jsx)(`pattern`,{id:`dots`,x:`0`,y:`0`,width:`28`,height:`28`,patternUnits:`userSpaceOnUse`,children:(0,i.jsx)(`circle`,{cx:`1.5`,cy:`1.5`,r:`1.5`,fill:`white`,fillOpacity:`0.07`})})}),(0,i.jsx)(`rect`,{width:`100%`,height:`100%`,fill:`url(#dots)`})]}),(0,i.jsx)(`div`,{className:`absolute -bottom-40 -right-40 w-[480px] h-[480px] rounded-full border border-white/[0.06] pointer-events-none`}),(0,i.jsx)(`div`,{className:`absolute -bottom-64 -right-64 w-[700px] h-[700px] rounded-full border border-white/[0.04] pointer-events-none`}),(0,i.jsx)(`div`,{className:`absolute top-[-60px] left-[-60px] w-[300px] h-[300px] rounded-full border border-white/[0.04] pointer-events-none`}),(0,i.jsx)(`div`,{className:`relative z-10 anim-fade`,children:(0,i.jsxs)(n,{href:`/`,className:`inline-flex items-center gap-3 group`,children:[(0,i.jsx)(`div`,{className:`w-10 h-10 rounded-[0.75rem] flex items-center justify-center overflow-hidden text-sm font-bold text-white shrink-0 ${o?`bg-white/10`:`bg-[#D4A017]`}`,children:o?(0,i.jsx)(`img`,{src:o,alt:a,className:`w-full h-full object-contain`}):s}),(0,i.jsx)(`span`,{className:`text-white font-bold text-base tracking-tight`,children:a})]})}),(0,i.jsxs)(`div`,{className:`relative z-10 anim-up`,style:{animationDelay:`0.1s`},children:[(0,i.jsx)(`p`,{className:`text-[#D4A017] text-xs font-bold uppercase tracking-[0.18em] mb-5`,children:`Enterprise Platform`}),(0,i.jsxs)(`h2`,{className:`text-white text-[2rem] font-bold leading-[1.2] tracking-tight`,children:[`Manage your`,(0,i.jsx)(`br`,{}),`organization`,(0,i.jsx)(`br`,{}),`with precision.`]}),(0,i.jsx)(`p`,{className:`mt-5 text-[#E3EBE8]/45 text-sm leading-relaxed max-w-xs`,children:`Access control, user management, and system configuration — unified in one secure interface.`}),(0,i.jsx)(`div`,{className:`mt-9 flex flex-col gap-3`,children:[`Role-based access control`,`Real-time audit logs`,`Multi-level permissions`].map(e=>(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-[#D4A017] shrink-0`}),(0,i.jsx)(`span`,{className:`text-[#E3EBE8]/55 text-sm font-medium`,children:e})]},e))})]}),(0,i.jsx)(`div`,{className:`relative z-10 anim-fade`,style:{animationDelay:`0.2s`},children:(0,i.jsxs)(`p`,{className:`text-[#E3EBE8]/25 text-xs`,children:[`© `,new Date().getFullYear(),` `,a,`. All rights reserved.`]})})]}),(0,i.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center bg-white px-8 py-12 min-h-screen`,children:[(0,i.jsxs)(`div`,{className:`lg:hidden mb-10 flex items-center gap-3 anim-down`,children:[(0,i.jsx)(`div`,{className:`w-9 h-9 rounded-[0.6rem] flex items-center justify-center text-sm font-bold overflow-hidden ${o?``:`bg-[#3D4E4B] text-white`}`,children:o?(0,i.jsx)(`img`,{src:o,alt:a,className:`w-full h-full object-contain`}):s}),(0,i.jsx)(`span`,{className:`text-[#3D4E4B] font-bold text-base tracking-tight`,children:a})]}),(0,i.jsx)(`div`,{className:`w-full max-w-[360px]`,children:e}),(0,i.jsx)(`div`,{className:`mt-10 anim-fade`,style:{animationDelay:`0.35s`},children:(0,i.jsxs)(n,{href:`/`,className:`inline-flex items-center gap-1.5 text-xs font-semibold text-gray-300 hover:text-[#3D4E4B] transition-colors duration-200 tracking-tight`,children:[(0,i.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10 19l-7-7m0 0l7-7m-7 7h18`})}),`Back to home`]})})]})]})}export{a as t}; \ No newline at end of file +import{c as e,o as t,r as n,t as r}from"./app-C2kGDHB9.js";e();var i=r();function a({children:e}){let{system_settings:r}=t().props,a=r?.app_name||`biiproject kit v2`,o=r?.app_logo,s=r?.app_logo_text||`BK`;return(0,i.jsxs)(`div`,{className:`min-h-screen flex font-sans`,children:[(0,i.jsxs)(`div`,{className:`hidden lg:flex lg:w-[44%] bg-[#3D4E4B] flex-col justify-between p-14 relative overflow-hidden shrink-0`,children:[(0,i.jsxs)(`svg`,{className:`absolute inset-0 w-full h-full pointer-events-none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,i.jsx)(`defs`,{children:(0,i.jsx)(`pattern`,{id:`dots`,x:`0`,y:`0`,width:`28`,height:`28`,patternUnits:`userSpaceOnUse`,children:(0,i.jsx)(`circle`,{cx:`1.5`,cy:`1.5`,r:`1.5`,fill:`white`,fillOpacity:`0.07`})})}),(0,i.jsx)(`rect`,{width:`100%`,height:`100%`,fill:`url(#dots)`})]}),(0,i.jsx)(`div`,{className:`absolute -bottom-40 -right-40 w-[480px] h-[480px] rounded-full border border-white/[0.06] pointer-events-none`}),(0,i.jsx)(`div`,{className:`absolute -bottom-64 -right-64 w-[700px] h-[700px] rounded-full border border-white/[0.04] pointer-events-none`}),(0,i.jsx)(`div`,{className:`absolute top-[-60px] left-[-60px] w-[300px] h-[300px] rounded-full border border-white/[0.04] pointer-events-none`}),(0,i.jsx)(`div`,{className:`relative z-10 anim-fade`,children:(0,i.jsxs)(n,{href:`/`,className:`inline-flex items-center gap-3 group`,children:[(0,i.jsx)(`div`,{className:`w-10 h-10 rounded-[0.75rem] flex items-center justify-center overflow-hidden text-sm font-bold text-white shrink-0 ${o?`bg-white/10`:`bg-[#D4A017]`}`,children:o?(0,i.jsx)(`img`,{src:o,alt:a,className:`w-full h-full object-contain`}):s}),(0,i.jsx)(`span`,{className:`text-white font-bold text-base tracking-tight`,children:a})]})}),(0,i.jsxs)(`div`,{className:`relative z-10 anim-up`,style:{animationDelay:`0.1s`},children:[(0,i.jsx)(`p`,{className:`text-[#D4A017] text-xs font-bold uppercase tracking-[0.18em] mb-5`,children:`Enterprise Platform`}),(0,i.jsxs)(`h2`,{className:`text-white text-[2rem] font-bold leading-[1.2] tracking-tight`,children:[`Manage your`,(0,i.jsx)(`br`,{}),`organization`,(0,i.jsx)(`br`,{}),`with precision.`]}),(0,i.jsx)(`p`,{className:`mt-5 text-[#E3EBE8]/45 text-sm leading-relaxed max-w-xs`,children:`Access control, user management, and system configuration — unified in one secure interface.`}),(0,i.jsx)(`div`,{className:`mt-9 flex flex-col gap-3`,children:[`Role-based access control`,`Real-time audit logs`,`Multi-level permissions`].map(e=>(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-[#D4A017] shrink-0`}),(0,i.jsx)(`span`,{className:`text-[#E3EBE8]/55 text-sm font-medium`,children:e})]},e))})]}),(0,i.jsx)(`div`,{className:`relative z-10 anim-fade`,style:{animationDelay:`0.2s`},children:(0,i.jsxs)(`p`,{className:`text-[#E3EBE8]/25 text-xs`,children:[`© `,new Date().getFullYear(),` `,a,`. All rights reserved.`]})})]}),(0,i.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center bg-white px-8 py-12 min-h-screen`,children:[(0,i.jsxs)(`div`,{className:`lg:hidden mb-10 flex items-center gap-3 anim-down`,children:[(0,i.jsx)(`div`,{className:`w-9 h-9 rounded-[0.6rem] flex items-center justify-center text-sm font-bold overflow-hidden ${o?``:`bg-[#3D4E4B] text-white`}`,children:o?(0,i.jsx)(`img`,{src:o,alt:a,className:`w-full h-full object-contain`}):s}),(0,i.jsx)(`span`,{className:`text-[#3D4E4B] font-bold text-base tracking-tight`,children:a})]}),(0,i.jsx)(`div`,{className:`w-full max-w-[360px]`,children:e}),(0,i.jsx)(`div`,{className:`mt-10 anim-fade`,style:{animationDelay:`0.35s`},children:(0,i.jsxs)(n,{href:`/`,className:`inline-flex items-center gap-1.5 text-xs font-semibold text-gray-300 hover:text-[#3D4E4B] transition-colors duration-200 tracking-tight`,children:[(0,i.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,i.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10 19l-7-7m0 0l7-7m-7 7h18`})}),`Back to home`]})})]})]})}export{a as t}; \ No newline at end of file diff --git a/public/build/assets/Index-DQODC9UE.js b/public/build/assets/Index-B7Zsmvlf.js similarity index 97% rename from public/build/assets/Index-DQODC9UE.js rename to public/build/assets/Index-B7Zsmvlf.js index 884af4a..5a6ff28 100644 --- a/public/build/assets/Index-DQODC9UE.js +++ b/public/build/assets/Index-B7Zsmvlf.js @@ -1 +1 @@ -import{c as e,d as t,i as n,n as r,t as i}from"./app-BK5KCPMc.js";import{t as a}from"./AuthenticatedLayout-BjuyW-Hp.js";import{n as o,t as s}from"./lodash-BXsCgLz3.js";import{t as c}from"./Portal-C0c8udmH.js";var l=t(e(),1),u=t(s(),1),d=i();function f({activity:e,onClose:t}){let[n,r]=(0,l.useState)(!1),i=JSON.stringify(e.properties,null,4);return(0,d.jsx)(c,{children:(0,d.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-[#3D4E4B]/60 backdrop-blur-md anim-fade`,children:(0,d.jsxs)(`div`,{className:`bg-white w-full max-w-2xl rounded-2xl shadow-2xl overflow-hidden anim-zoom border border-gray-100 flex flex-col max-h-[90vh]`,children:[(0,d.jsxs)(`div`,{className:`p-8 border-b border-gray-50 shrink-0`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,d.jsx)(`h2`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight`,children:`Activity Details`}),(0,d.jsx)(`button`,{onClick:t,className:`p-2 hover:bg-gray-50 rounded-xl transition-colors`,children:(0,d.jsx)(`svg`,{className:`w-5 h-5 text-gray-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{d:`M6 18L18 6M6 6l12 12`})})})]}),(0,d.jsx)(`p`,{className:`text-sm text-gray-400 font-medium`,children:e.description})]}),(0,d.jsxs)(`div`,{className:`p-8 overflow-y-auto custom-scrollbar space-y-8`,children:[(0,d.jsxs)(`div`,{className:`grid grid-cols-2 gap-8`,children:[(0,d.jsxs)(`div`,{className:`space-y-1`,children:[(0,d.jsx)(`label`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:`Performed By`}),(0,d.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B]`,children:e.causer?`${e.causer.first_name} ${e.causer.last_name}`:`System`})]}),(0,d.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,d.jsx)(`label`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:`Date & Time`}),(0,d.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B]`,children:new Date(e.created_at).toLocaleString()})]}),(0,d.jsxs)(`div`,{className:`space-y-1`,children:[(0,d.jsx)(`label`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:`Log Name`}),(0,d.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B]`,children:e.log_name})]}),(0,d.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,d.jsx)(`label`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:`Subject`}),(0,d.jsxs)(`p`,{className:`text-sm font-bold text-[#3D4E4B]`,children:[e.subject_type.split(`\\`).pop(),` #`,e.subject_id]})]})]}),(0,d.jsxs)(`div`,{className:`space-y-4`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,d.jsx)(`label`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:`Data Changes / Properties`}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(i),r(!0),setTimeout(()=>r(!1),2e3)},className:`text-[10px] font-bold px-2 py-0.5 rounded-lg border transition-all uppercase tracking-tight flex items-center gap-1 ${n?`bg-green-500/10 text-green-500 border-green-500/20`:`bg-[#D4A017]/5 text-[#D4A017] border-[#D4A017]/10 hover:bg-[#D4A017]/10`}`,children:n?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:3,children:(0,d.jsx)(`path`,{d:`M5 13l4 4L19 7`})}),`Copied`]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{d:`M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2`})}),`Copy JSON`]})}),(0,d.jsx)(`span`,{className:`text-[10px] font-bold text-gray-400 bg-gray-50 px-2 py-0.5 rounded-lg border border-gray-100 uppercase tracking-tight`,children:`JSON Format`})]})]}),(0,d.jsx)(`div`,{className:`bg-[#1E1E1E] p-6 overflow-hidden shadow-inner border border-white/5 relative group`,children:(0,d.jsx)(`pre`,{className:`text-[11px] font-mono text-gray-300 whitespace-pre-wrap break-all leading-relaxed custom-scrollbar max-h-[400px] overflow-y-auto`,children:i})})]})]}),(0,d.jsx)(`div`,{className:`p-8 border-t border-gray-50 bg-gray-50/30 shrink-0 flex justify-end`,children:(0,d.jsx)(`button`,{onClick:t,className:`h-11 px-8 bg-white border border-gray-200 rounded-xl text-sm font-bold text-[#3D4E4B] hover:bg-gray-50 transition-all shadow-sm`,children:`Close`})})]})})})}function p({activities:e,filters:t,availableLogNames:i,availableEvents:s}){let[p,m]=(0,l.useState)(!1),[h,g]=(0,l.useState)(null),[_,v]=(0,l.useState)([]),[y,b]=(0,l.useState)({search:t.search||``,log_name:t.log_name||``,event:t.event||``,per_page:t.per_page||15}),x=(0,l.useCallback)(u.default.debounce(e=>{m(!0),n.get(route(`activity-logs.index`),e,{preserveState:!0,preserveScroll:!0,replace:!0,only:[`activities`,`filters`],onFinish:()=>m(!1)})},400),[]),S=(e,t)=>{let n={...y,[e]:t};b(n);let r={...n,page:1};v([]),x(r)};return(0,d.jsxs)(a,{children:[(0,d.jsx)(r,{title:`Activity Logs`}),(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`Activity Logs`}),(0,d.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Audit trail of system events and user actions`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsxs)(`div`,{className:`relative w-[240px]`,children:[(0,d.jsx)(`svg`,{className:`absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})}),(0,d.jsx)(`input`,{type:`text`,placeholder:`Search logs…`,value:y.search,onChange:e=>S(`search`,e.target.value),className:`w-full h-11 pl-10 pr-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 placeholder-gray-400 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm`})]}),(0,d.jsxs)(`select`,{value:y.log_name,onChange:e=>S(`log_name`,e.target.value),className:`h-11 px-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm cursor-pointer min-w-[140px]`,children:[(0,d.jsx)(`option`,{value:``,children:`All Logs`}),i.map(e=>(0,d.jsx)(`option`,{value:e,children:e},e))]}),(0,d.jsxs)(`select`,{value:y.event,onChange:e=>S(`event`,e.target.value),className:`h-11 px-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm cursor-pointer min-w-[140px]`,children:[(0,d.jsx)(`option`,{value:``,children:`All Events`}),s.map(e=>(0,d.jsx)(`option`,{value:e,children:e},e))]})]})]}),(0,d.jsx)(`div`,{className:`anim-up`,children:(0,d.jsx)(o,{data:e.data,columns:[{header:`Activity`,accessorKey:`description`,cell:e=>(0,d.jsxs)(`div`,{className:`flex flex-col`,children:[(0,d.jsx)(`span`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:e.description}),(0,d.jsx)(`span`,{className:`text-[10px] text-gray-400 font-bold uppercase tracking-widest mt-0.5`,children:e.log_name})]})},{header:`Causer`,accessorKey:`causer`,cell:e=>(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-gray-100 flex items-center justify-center text-[10px] font-bold text-gray-500`,children:e.causer?`${e.causer.first_name[0]}${e.causer.last_name[0]}`:`SYS`}),(0,d.jsxs)(`div`,{className:`flex flex-col`,children:[(0,d.jsx)(`span`,{className:`text-xs font-bold text-[#3D4E4B]`,children:e.causer?`${e.causer.first_name} ${e.causer.last_name}`:`System`}),(0,d.jsx)(`span`,{className:`text-[10px] text-gray-400 font-semibold`,children:e.causer?.email||`automated@system`})]})]})},{header:`Properties`,accessorKey:`properties`,cell:e=>(0,d.jsx)(`div`,{className:`max-w-[300px] truncate`,children:(0,d.jsx)(`code`,{className:`text-[10px] bg-gray-50 px-1.5 py-0.5 rounded text-gray-500 font-semibold`,children:JSON.stringify(e.properties)})})},{header:`Date & Time`,accessorKey:`created_at`,cell:e=>(0,d.jsx)(`span`,{className:`text-xs font-semibold text-gray-400 tracking-tight`,children:new Date(e.created_at).toLocaleString(`en-US`,{day:`2-digit`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})})},{header:`Action`,accessorKey:`actions`,cell:e=>(0,d.jsx)(`div`,{className:`flex justify-end pr-4`,children:(0,d.jsx)(`button`,{onClick:()=>g(e),className:`p-2 rounded-xl text-gray-400 hover:text-[#D4A017] hover:bg-[#D4A017]/5 transition-all opacity-0 group-hover:opacity-100 translate-x-2 group-hover:translate-x-0`,title:`View Details`,children:(0,d.jsxs)(`svg`,{className:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:[(0,d.jsx)(`path`,{d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`}),(0,d.jsx)(`path`,{d:`M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z`})]})})})}],meta:e.meta,links:e.links,filters:y,isLoading:p,selectedIds:_,onSelectionChange:v})}),h&&(0,d.jsx)(f,{activity:h,onClose:()=>g(null)}),(0,d.jsx)(c,{children:(0,d.jsx)(`div`,{className:`fixed bottom-8 left-1/2 -translate-x-1/2 z-40 transition-all duration-500 ${_.length>0?`translate-y-0 opacity-100`:`translate-y-20 opacity-0 pointer-events-none`}`,children:(0,d.jsxs)(`div`,{className:`bg-[#3D4E4B] rounded-2xl shadow-2xl px-6 py-4 flex items-center gap-6 border border-white/10 backdrop-blur-xl`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-3 pr-6 border-r border-white/10`,children:[(0,d.jsx)(`span`,{className:`w-8 h-8 rounded-lg bg-white/10 flex items-center justify-center text-white text-xs font-bold`,children:_.length}),(0,d.jsx)(`span`,{className:`text-white text-sm font-bold tracking-tight`,children:`Logs selected`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsxs)(`button`,{onClick:()=>{let e=_.length;swal.confirm(`Purge Logs?`,`Are you sure you want to permanently delete ${e} activity logs?`,`Purge`).then(t=>{t.isConfirmed&&n.post(route(`activity-logs.bulk-delete`),{ids:_},{preserveScroll:!0,onSuccess:()=>{v([]),swal.success(`Purged`,`${e} logs deleted successfully.`)}})})},className:`h-10 px-5 rounded-xl bg-red-500 text-white text-xs font-bold hover:bg-red-600 transition-all flex items-center gap-2`,children:[(0,d.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})}),`Bulk Purge`]}),(0,d.jsx)(`button`,{onClick:()=>v([]),className:`h-10 px-4 text-white/40 text-xs font-bold hover:text-white transition-colors`,children:`Cancel`})]})]})})})]})}export{p as default}; \ No newline at end of file +import{c as e,d as t,i as n,n as r,t as i}from"./app-C2kGDHB9.js";import{t as a}from"./AuthenticatedLayout-C8h2HS7D.js";import{n as o,t as s}from"./lodash-BdNO5KR4.js";import{t as c}from"./Portal-B40Voc8b.js";var l=t(e(),1),u=t(s(),1),d=i();function f({activity:e,onClose:t}){let[n,r]=(0,l.useState)(!1),i=JSON.stringify(e.properties,null,4);return(0,d.jsx)(c,{children:(0,d.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-[#3D4E4B]/60 backdrop-blur-md anim-fade`,children:(0,d.jsxs)(`div`,{className:`bg-white w-full max-w-2xl rounded-2xl shadow-2xl overflow-hidden anim-zoom border border-gray-100 flex flex-col max-h-[90vh]`,children:[(0,d.jsxs)(`div`,{className:`p-8 border-b border-gray-50 shrink-0`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,d.jsx)(`h2`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight`,children:`Activity Details`}),(0,d.jsx)(`button`,{onClick:t,className:`p-2 hover:bg-gray-50 rounded-xl transition-colors`,children:(0,d.jsx)(`svg`,{className:`w-5 h-5 text-gray-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{d:`M6 18L18 6M6 6l12 12`})})})]}),(0,d.jsx)(`p`,{className:`text-sm text-gray-400 font-medium`,children:e.description})]}),(0,d.jsxs)(`div`,{className:`p-8 overflow-y-auto custom-scrollbar space-y-8`,children:[(0,d.jsxs)(`div`,{className:`grid grid-cols-2 gap-8`,children:[(0,d.jsxs)(`div`,{className:`space-y-1`,children:[(0,d.jsx)(`label`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:`Performed By`}),(0,d.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B]`,children:e.causer?`${e.causer.first_name} ${e.causer.last_name}`:`System`})]}),(0,d.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,d.jsx)(`label`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:`Date & Time`}),(0,d.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B]`,children:new Date(e.created_at).toLocaleString()})]}),(0,d.jsxs)(`div`,{className:`space-y-1`,children:[(0,d.jsx)(`label`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:`Log Name`}),(0,d.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B]`,children:e.log_name})]}),(0,d.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,d.jsx)(`label`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:`Subject`}),(0,d.jsxs)(`p`,{className:`text-sm font-bold text-[#3D4E4B]`,children:[e.subject_type.split(`\\`).pop(),` #`,e.subject_id]})]})]}),(0,d.jsxs)(`div`,{className:`space-y-4`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,d.jsx)(`label`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:`Data Changes / Properties`}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(i),r(!0),setTimeout(()=>r(!1),2e3)},className:`text-[10px] font-bold px-2 py-0.5 rounded-lg border transition-all uppercase tracking-tight flex items-center gap-1 ${n?`bg-green-500/10 text-green-500 border-green-500/20`:`bg-[#D4A017]/5 text-[#D4A017] border-[#D4A017]/10 hover:bg-[#D4A017]/10`}`,children:n?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:3,children:(0,d.jsx)(`path`,{d:`M5 13l4 4L19 7`})}),`Copied`]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{d:`M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2`})}),`Copy JSON`]})}),(0,d.jsx)(`span`,{className:`text-[10px] font-bold text-gray-400 bg-gray-50 px-2 py-0.5 rounded-lg border border-gray-100 uppercase tracking-tight`,children:`JSON Format`})]})]}),(0,d.jsx)(`div`,{className:`bg-[#1E1E1E] p-6 overflow-hidden shadow-inner border border-white/5 relative group`,children:(0,d.jsx)(`pre`,{className:`text-[11px] font-mono text-gray-300 whitespace-pre-wrap break-all leading-relaxed custom-scrollbar max-h-[400px] overflow-y-auto`,children:i})})]})]}),(0,d.jsx)(`div`,{className:`p-8 border-t border-gray-50 bg-gray-50/30 shrink-0 flex justify-end`,children:(0,d.jsx)(`button`,{onClick:t,className:`h-11 px-8 bg-white border border-gray-200 rounded-xl text-sm font-bold text-[#3D4E4B] hover:bg-gray-50 transition-all shadow-sm`,children:`Close`})})]})})})}function p({activities:e,filters:t,availableLogNames:i,availableEvents:s}){let[p,m]=(0,l.useState)(!1),[h,g]=(0,l.useState)(null),[_,v]=(0,l.useState)([]),[y,b]=(0,l.useState)({search:t.search||``,log_name:t.log_name||``,event:t.event||``,per_page:t.per_page||15}),x=(0,l.useCallback)(u.default.debounce(e=>{m(!0),n.get(route(`activity-logs.index`),e,{preserveState:!0,preserveScroll:!0,replace:!0,only:[`activities`,`filters`],onFinish:()=>m(!1)})},400),[]),S=(e,t)=>{let n={...y,[e]:t};b(n);let r={...n,page:1};v([]),x(r)};return(0,d.jsxs)(a,{children:[(0,d.jsx)(r,{title:`Activity Logs`}),(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`Activity Logs`}),(0,d.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Audit trail of system events and user actions`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsxs)(`div`,{className:`relative w-[240px]`,children:[(0,d.jsx)(`svg`,{className:`absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})}),(0,d.jsx)(`input`,{type:`text`,placeholder:`Search logs…`,value:y.search,onChange:e=>S(`search`,e.target.value),className:`w-full h-11 pl-10 pr-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 placeholder-gray-400 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm`})]}),(0,d.jsxs)(`select`,{value:y.log_name,onChange:e=>S(`log_name`,e.target.value),className:`h-11 px-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm cursor-pointer min-w-[140px]`,children:[(0,d.jsx)(`option`,{value:``,children:`All Logs`}),i.map(e=>(0,d.jsx)(`option`,{value:e,children:e},e))]}),(0,d.jsxs)(`select`,{value:y.event,onChange:e=>S(`event`,e.target.value),className:`h-11 px-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm cursor-pointer min-w-[140px]`,children:[(0,d.jsx)(`option`,{value:``,children:`All Events`}),s.map(e=>(0,d.jsx)(`option`,{value:e,children:e},e))]})]})]}),(0,d.jsx)(`div`,{className:`anim-up`,children:(0,d.jsx)(o,{data:e.data,columns:[{header:`Activity`,accessorKey:`description`,cell:e=>(0,d.jsxs)(`div`,{className:`flex flex-col`,children:[(0,d.jsx)(`span`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:e.description}),(0,d.jsx)(`span`,{className:`text-[10px] text-gray-400 font-bold uppercase tracking-widest mt-0.5`,children:e.log_name})]})},{header:`Causer`,accessorKey:`causer`,cell:e=>(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-gray-100 flex items-center justify-center text-[10px] font-bold text-gray-500`,children:e.causer?`${e.causer.first_name[0]}${e.causer.last_name[0]}`:`SYS`}),(0,d.jsxs)(`div`,{className:`flex flex-col`,children:[(0,d.jsx)(`span`,{className:`text-xs font-bold text-[#3D4E4B]`,children:e.causer?`${e.causer.first_name} ${e.causer.last_name}`:`System`}),(0,d.jsx)(`span`,{className:`text-[10px] text-gray-400 font-semibold`,children:e.causer?.email||`automated@system`})]})]})},{header:`Properties`,accessorKey:`properties`,cell:e=>(0,d.jsx)(`div`,{className:`max-w-[300px] truncate`,children:(0,d.jsx)(`code`,{className:`text-[10px] bg-gray-50 px-1.5 py-0.5 rounded text-gray-500 font-semibold`,children:JSON.stringify(e.properties)})})},{header:`Date & Time`,accessorKey:`created_at`,cell:e=>(0,d.jsx)(`span`,{className:`text-xs font-semibold text-gray-400 tracking-tight`,children:new Date(e.created_at).toLocaleString(`en-US`,{day:`2-digit`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})})},{header:`Action`,accessorKey:`actions`,cell:e=>(0,d.jsx)(`div`,{className:`flex justify-end pr-4`,children:(0,d.jsx)(`button`,{onClick:()=>g(e),className:`p-2 rounded-xl text-gray-400 hover:text-[#D4A017] hover:bg-[#D4A017]/5 transition-all opacity-0 group-hover:opacity-100 translate-x-2 group-hover:translate-x-0`,title:`View Details`,children:(0,d.jsxs)(`svg`,{className:`w-5 h-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:[(0,d.jsx)(`path`,{d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`}),(0,d.jsx)(`path`,{d:`M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z`})]})})})}],meta:e.meta,links:e.links,filters:y,isLoading:p,selectedIds:_,onSelectionChange:v})}),h&&(0,d.jsx)(f,{activity:h,onClose:()=>g(null)}),(0,d.jsx)(c,{children:(0,d.jsx)(`div`,{className:`fixed bottom-8 left-1/2 -translate-x-1/2 z-40 transition-all duration-500 ${_.length>0?`translate-y-0 opacity-100`:`translate-y-20 opacity-0 pointer-events-none`}`,children:(0,d.jsxs)(`div`,{className:`bg-[#3D4E4B] rounded-2xl shadow-2xl px-6 py-4 flex items-center gap-6 border border-white/10 backdrop-blur-xl`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-3 pr-6 border-r border-white/10`,children:[(0,d.jsx)(`span`,{className:`w-8 h-8 rounded-lg bg-white/10 flex items-center justify-center text-white text-xs font-bold`,children:_.length}),(0,d.jsx)(`span`,{className:`text-white text-sm font-bold tracking-tight`,children:`Logs selected`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsxs)(`button`,{onClick:()=>{let e=_.length;swal.confirm(`Purge Logs?`,`Are you sure you want to permanently delete ${e} activity logs?`,`Purge`).then(t=>{t.isConfirmed&&n.post(route(`activity-logs.bulk-delete`),{ids:_},{preserveScroll:!0,onSuccess:()=>{v([]),swal.success(`Purged`,`${e} logs deleted successfully.`)}})})},className:`h-10 px-5 rounded-xl bg-red-500 text-white text-xs font-bold hover:bg-red-600 transition-all flex items-center gap-2`,children:[(0,d.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})}),`Bulk Purge`]}),(0,d.jsx)(`button`,{onClick:()=>v([]),className:`h-10 px-4 text-white/40 text-xs font-bold hover:text-white transition-colors`,children:`Cancel`})]})]})})})]})}export{p as default}; \ No newline at end of file diff --git a/public/build/assets/Index-DcNFR6n1.js b/public/build/assets/Index-Bi9DKRMK.js similarity index 97% rename from public/build/assets/Index-DcNFR6n1.js rename to public/build/assets/Index-Bi9DKRMK.js index 36860f0..f6a8594 100644 --- a/public/build/assets/Index-DcNFR6n1.js +++ b/public/build/assets/Index-Bi9DKRMK.js @@ -1,3 +1,3 @@ -import{a as e,c as t,i as n,n as r,t as i}from"./app-BK5KCPMc.js";import{t as a}from"./AuthenticatedLayout-BjuyW-Hp.js";import{t as o}from"./swal-D8hRpOIh.js";t();var s=i();function c({logs:t,users:i}){let{data:c,setData:l,post:u,processing:d,reset:f,errors:p}=e({title:``,body:``,image_url:``,deep_link:``,target_type:`all`,target_user_id:``});return(0,s.jsxs)(a,{children:[(0,s.jsx)(r,{title:`Push Notifications`}),(0,s.jsx)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`Notification Center`}),(0,s.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Broadcast messages and alerts to Android devices`})]})}),(0,s.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-8`,children:[(0,s.jsx)(`div`,{className:`lg:col-span-5`,children:(0,s.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden anim-up`,children:[(0,s.jsxs)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:[(0,s.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Compose Broadcast`}),(0,s.jsx)(`p`,{className:`text-[10px] text-gray-400 font-bold uppercase tracking-widest mt-1`,children:`New FCM Message`})]}),(0,s.jsx)(`div`,{className:`p-8`,children:(0,s.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),u(route(`notifications.store`),{onSuccess:()=>{f(),o.success(`Dispatched`,`Notification has been sent to devices.`)}})},className:`space-y-6`,children:[(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,s.jsx)(`label`,{className:`text-xs font-bold text-gray-500 ml-1`,children:`Message Title`}),(0,s.jsx)(`input`,{value:c.title,onChange:e=>l(`title`,e.target.value),placeholder:`e.g. Flash Sale Alert!`,className:`input-field ${p.title?`is-error`:``}`}),p.title&&(0,s.jsx)(`p`,{className:`text-[10px] text-red-500 font-bold ml-1`,children:p.title})]}),(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,s.jsx)(`label`,{className:`text-xs font-bold text-gray-500 ml-1`,children:`Message Body`}),(0,s.jsx)(`textarea`,{value:c.body,onChange:e=>l(`body`,e.target.value),rows:3,placeholder:`Write your notification message here...`,className:`input-field py-3 resize-none ${p.body?`is-error`:``}`}),p.body&&(0,s.jsx)(`p`,{className:`text-[10px] text-red-500 font-bold ml-1`,children:p.body})]}),(0,s.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,s.jsxs)(`div`,{className:`space-y-1.5 text-xs font-bold text-gray-500 ml-1`,children:[(0,s.jsx)(`label`,{children:`Target Audience`}),(0,s.jsxs)(`select`,{value:c.target_type,onChange:e=>l(`target_type`,e.target.value),className:`input-field mt-1.5 h-10`,children:[(0,s.jsx)(`option`,{value:`all`,children:`All Users`}),(0,s.jsx)(`option`,{value:`individual`,children:`Specific User`})]})]}),c.target_type===`individual`&&(0,s.jsxs)(`div`,{className:`space-y-1.5 text-xs font-bold text-gray-500 ml-1`,children:[(0,s.jsx)(`label`,{children:`Select User`}),(0,s.jsxs)(`select`,{value:c.target_user_id,onChange:e=>l(`target_user_id`,e.target.value),className:`input-field mt-1.5 h-10`,children:[(0,s.jsx)(`option`,{value:``,children:`Choose User...`}),i.map(e=>(0,s.jsxs)(`option`,{value:e.id,children:[e.first_name,` `,e.last_name]},e.id))]})]})]}),(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,s.jsx)(`label`,{className:`text-xs font-bold text-gray-500 ml-1`,children:`Deep Link (Optional)`}),(0,s.jsx)(`input`,{value:c.deep_link,onChange:e=>l(`deep_link`,e.target.value),placeholder:`app://screen/profile`,className:`input-field`})]}),(0,s.jsx)(`div`,{className:`pt-4 border-t border-gray-50`,children:(0,s.jsx)(`button`,{type:`submit`,disabled:d,className:`w-full h-11 bg-[#3D4E4B] text-white text-xs font-black uppercase tracking-widest rounded-xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20 disabled:opacity-60`,children:d?`Sending...`:`Send Notification`})})]})})]})}),(0,s.jsx)(`div`,{className:`lg:col-span-7`,children:(0,s.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden anim-up`,style:{animationDelay:`0.1s`},children:[(0,s.jsx)(`div`,{className:`px-6 py-4 border-b border-gray-50`,children:(0,s.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Recent Broadcasts`})}),(0,s.jsx)(`div`,{className:`overflow-x-auto`,children:(0,s.jsxs)(`table`,{className:`w-full text-left border-collapse`,children:[(0,s.jsx)(`thead`,{className:`bg-gray-50/50`,children:(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`th`,{className:`px-6 py-3 text-[10px] font-black text-gray-400 uppercase tracking-widest`,children:`Message`}),(0,s.jsx)(`th`,{className:`px-6 py-3 text-[10px] font-black text-gray-400 uppercase tracking-widest`,children:`Target`}),(0,s.jsx)(`th`,{className:`px-6 py-3 text-[10px] font-black text-gray-400 uppercase tracking-widest`,children:`Status`}),(0,s.jsx)(`th`,{className:`px-6 py-3 text-[10px] font-black text-gray-400 uppercase tracking-widest`,children:`Sent At`})]})}),(0,s.jsxs)(`tbody`,{className:`divide-y divide-gray-50`,children:[t.data.map(e=>(0,s.jsxs)(`tr`,{className:`hover:bg-gray-50/30 transition-colors group`,children:[(0,s.jsxs)(`td`,{className:`px-6 py-4`,children:[(0,s.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:e.title}),(0,s.jsx)(`div`,{className:`text-[10px] text-gray-400 font-medium truncate max-w-[200px] mt-0.5`,children:e.body})]}),(0,s.jsx)(`td`,{className:`px-6 py-4`,children:(0,s.jsx)(`span`,{className:`text-[10px] font-black uppercase tracking-widest ${e.target_type===`all`?`text-[#D4A017]`:`text-blue-600`}`,children:e.target_type===`all`?`All Devices`:e.target_user?.first_name||`Individual`})}),(0,s.jsx)(`td`,{className:`px-6 py-4`,children:(0,s.jsx)(`span`,{className:`px-2 py-0.5 rounded-md text-[9px] font-black uppercase tracking-widest border ${e.status===`sent`?`bg-emerald-50 text-emerald-600 border-emerald-100`:`bg-red-50 text-red-500 border-red-100`}`,children:e.status})}),(0,s.jsx)(`td`,{className:`px-6 py-4 text-[10px] font-bold text-gray-400`,children:new Date(e.created_at).toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`,year:`numeric`})})]},e.id)),t.data.length===0&&(0,s.jsx)(`tr`,{children:(0,s.jsx)(`td`,{colSpan:4,className:`px-6 py-16 text-center`,children:(0,s.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,s.jsx)(`div`,{className:`w-12 h-12 rounded-2xl bg-gray-50 border border-gray-100 flex items-center justify-center`,children:(0,s.jsx)(`svg`,{className:`w-5 h-5 text-gray-300`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9`})})}),(0,s.jsx)(`p`,{className:`text-xs font-bold text-gray-300`,children:`No broadcasts sent yet`})]})})})]})]})}),t.meta&&t.meta.last_page>1&&(0,s.jsxs)(`div`,{className:`px-6 py-4 border-t border-gray-50 flex items-center justify-between`,children:[(0,s.jsxs)(`p`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:[t.meta.total,` total — page `,t.meta.current_page,` of `,t.meta.last_page]}),(0,s.jsx)(`div`,{className:`flex items-center gap-1`,children:t.links.map((e,t)=>(0,s.jsx)(`button`,{disabled:!e.url||e.active,onClick:()=>e.url&&n.get(e.url,{},{preserveScroll:!0}),className:`h-8 min-w-[2rem] px-2 rounded-lg text-xs font-bold transition-all border +import{a as e,c as t,i as n,n as r,t as i}from"./app-C2kGDHB9.js";import{t as a}from"./AuthenticatedLayout-C8h2HS7D.js";import{t as o}from"./swal-DeDNECCu.js";t();var s=i();function c({logs:t,users:i}){let{data:c,setData:l,post:u,processing:d,reset:f,errors:p}=e({title:``,body:``,image_url:``,deep_link:``,target_type:`all`,target_user_id:``});return(0,s.jsxs)(a,{children:[(0,s.jsx)(r,{title:`Push Notifications`}),(0,s.jsx)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`Notification Center`}),(0,s.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Broadcast messages and alerts to Android devices`})]})}),(0,s.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-8`,children:[(0,s.jsx)(`div`,{className:`lg:col-span-5`,children:(0,s.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden anim-up`,children:[(0,s.jsxs)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:[(0,s.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Compose Broadcast`}),(0,s.jsx)(`p`,{className:`text-[10px] text-gray-400 font-bold uppercase tracking-widest mt-1`,children:`New FCM Message`})]}),(0,s.jsx)(`div`,{className:`p-8`,children:(0,s.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),u(route(`notifications.store`),{onSuccess:()=>{f(),o.success(`Dispatched`,`Notification has been sent to devices.`)}})},className:`space-y-6`,children:[(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,s.jsx)(`label`,{className:`text-xs font-bold text-gray-500 ml-1`,children:`Message Title`}),(0,s.jsx)(`input`,{value:c.title,onChange:e=>l(`title`,e.target.value),placeholder:`e.g. Flash Sale Alert!`,className:`input-field ${p.title?`is-error`:``}`}),p.title&&(0,s.jsx)(`p`,{className:`text-[10px] text-red-500 font-bold ml-1`,children:p.title})]}),(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,s.jsx)(`label`,{className:`text-xs font-bold text-gray-500 ml-1`,children:`Message Body`}),(0,s.jsx)(`textarea`,{value:c.body,onChange:e=>l(`body`,e.target.value),rows:3,placeholder:`Write your notification message here...`,className:`input-field py-3 resize-none ${p.body?`is-error`:``}`}),p.body&&(0,s.jsx)(`p`,{className:`text-[10px] text-red-500 font-bold ml-1`,children:p.body})]}),(0,s.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,s.jsxs)(`div`,{className:`space-y-1.5 text-xs font-bold text-gray-500 ml-1`,children:[(0,s.jsx)(`label`,{children:`Target Audience`}),(0,s.jsxs)(`select`,{value:c.target_type,onChange:e=>l(`target_type`,e.target.value),className:`input-field mt-1.5 h-10`,children:[(0,s.jsx)(`option`,{value:`all`,children:`All Users`}),(0,s.jsx)(`option`,{value:`individual`,children:`Specific User`})]})]}),c.target_type===`individual`&&(0,s.jsxs)(`div`,{className:`space-y-1.5 text-xs font-bold text-gray-500 ml-1`,children:[(0,s.jsx)(`label`,{children:`Select User`}),(0,s.jsxs)(`select`,{value:c.target_user_id,onChange:e=>l(`target_user_id`,e.target.value),className:`input-field mt-1.5 h-10`,children:[(0,s.jsx)(`option`,{value:``,children:`Choose User...`}),i.map(e=>(0,s.jsxs)(`option`,{value:e.id,children:[e.first_name,` `,e.last_name]},e.id))]})]})]}),(0,s.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,s.jsx)(`label`,{className:`text-xs font-bold text-gray-500 ml-1`,children:`Deep Link (Optional)`}),(0,s.jsx)(`input`,{value:c.deep_link,onChange:e=>l(`deep_link`,e.target.value),placeholder:`app://screen/profile`,className:`input-field`})]}),(0,s.jsx)(`div`,{className:`pt-4 border-t border-gray-50`,children:(0,s.jsx)(`button`,{type:`submit`,disabled:d,className:`w-full h-11 bg-[#3D4E4B] text-white text-xs font-black uppercase tracking-widest rounded-xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20 disabled:opacity-60`,children:d?`Sending...`:`Send Notification`})})]})})]})}),(0,s.jsx)(`div`,{className:`lg:col-span-7`,children:(0,s.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden anim-up`,style:{animationDelay:`0.1s`},children:[(0,s.jsx)(`div`,{className:`px-6 py-4 border-b border-gray-50`,children:(0,s.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Recent Broadcasts`})}),(0,s.jsx)(`div`,{className:`overflow-x-auto`,children:(0,s.jsxs)(`table`,{className:`w-full text-left border-collapse`,children:[(0,s.jsx)(`thead`,{className:`bg-gray-50/50`,children:(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`th`,{className:`px-6 py-3 text-[10px] font-black text-gray-400 uppercase tracking-widest`,children:`Message`}),(0,s.jsx)(`th`,{className:`px-6 py-3 text-[10px] font-black text-gray-400 uppercase tracking-widest`,children:`Target`}),(0,s.jsx)(`th`,{className:`px-6 py-3 text-[10px] font-black text-gray-400 uppercase tracking-widest`,children:`Status`}),(0,s.jsx)(`th`,{className:`px-6 py-3 text-[10px] font-black text-gray-400 uppercase tracking-widest`,children:`Sent At`})]})}),(0,s.jsxs)(`tbody`,{className:`divide-y divide-gray-50`,children:[t.data.map(e=>(0,s.jsxs)(`tr`,{className:`hover:bg-gray-50/30 transition-colors group`,children:[(0,s.jsxs)(`td`,{className:`px-6 py-4`,children:[(0,s.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:e.title}),(0,s.jsx)(`div`,{className:`text-[10px] text-gray-400 font-medium truncate max-w-[200px] mt-0.5`,children:e.body})]}),(0,s.jsx)(`td`,{className:`px-6 py-4`,children:(0,s.jsx)(`span`,{className:`text-[10px] font-black uppercase tracking-widest ${e.target_type===`all`?`text-[#D4A017]`:`text-blue-600`}`,children:e.target_type===`all`?`All Devices`:e.target_user?.first_name||`Individual`})}),(0,s.jsx)(`td`,{className:`px-6 py-4`,children:(0,s.jsx)(`span`,{className:`px-2 py-0.5 rounded-md text-[9px] font-black uppercase tracking-widest border ${e.status===`sent`?`bg-emerald-50 text-emerald-600 border-emerald-100`:`bg-red-50 text-red-500 border-red-100`}`,children:e.status})}),(0,s.jsx)(`td`,{className:`px-6 py-4 text-[10px] font-bold text-gray-400`,children:new Date(e.created_at).toLocaleDateString(`en-GB`,{day:`2-digit`,month:`short`,year:`numeric`})})]},e.id)),t.data.length===0&&(0,s.jsx)(`tr`,{children:(0,s.jsx)(`td`,{colSpan:4,className:`px-6 py-16 text-center`,children:(0,s.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,s.jsx)(`div`,{className:`w-12 h-12 rounded-2xl bg-gray-50 border border-gray-100 flex items-center justify-center`,children:(0,s.jsx)(`svg`,{className:`w-5 h-5 text-gray-300`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9`})})}),(0,s.jsx)(`p`,{className:`text-xs font-bold text-gray-300`,children:`No broadcasts sent yet`})]})})})]})]})}),t.meta&&t.meta.last_page>1&&(0,s.jsxs)(`div`,{className:`px-6 py-4 border-t border-gray-50 flex items-center justify-between`,children:[(0,s.jsxs)(`p`,{className:`text-[10px] font-bold text-gray-400 uppercase tracking-widest`,children:[t.meta.total,` total — page `,t.meta.current_page,` of `,t.meta.last_page]}),(0,s.jsx)(`div`,{className:`flex items-center gap-1`,children:t.links.map((e,t)=>(0,s.jsx)(`button`,{disabled:!e.url||e.active,onClick:()=>e.url&&n.get(e.url,{},{preserveScroll:!0}),className:`h-8 min-w-[2rem] px-2 rounded-lg text-xs font-bold transition-all border ${e.active?`bg-[#3D4E4B] text-white border-[#3D4E4B]`:`bg-white text-gray-400 border-gray-100 hover:border-gray-200 hover:text-[#3D4E4B]`} ${e.url?`cursor-pointer`:`opacity-30 cursor-not-allowed`}`,dangerouslySetInnerHTML:{__html:e.label}},t))})]})]})})]})]})}export{c as default}; \ No newline at end of file diff --git a/public/build/assets/Index-Cx7Ouq_R.js b/public/build/assets/Index-BzmzPZNr.js similarity index 98% rename from public/build/assets/Index-Cx7Ouq_R.js rename to public/build/assets/Index-BzmzPZNr.js index 98fdf57..58b402f 100644 --- a/public/build/assets/Index-Cx7Ouq_R.js +++ b/public/build/assets/Index-BzmzPZNr.js @@ -1 +1 @@ -import{a as e,c as t,d as n,l as r,n as i,o as a,t as o}from"./app-BK5KCPMc.js";import{t as s}from"./AuthenticatedLayout-BjuyW-Hp.js";import{t as c}from"./swal-D8hRpOIh.js";import{n as l,r as u,t as d}from"./filepond-plugin-file-validate-type-tybTRj_0.js";var f=n(t(),1),p=u(),m=n(l(),1),h=n(d(),1),g=o();(0,p.registerPlugin)(m.default,h.default);function _({title:e,description:t,children:n,delay:r=`0s`}){return(0,g.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden h-full flex flex-col anim-up`,style:{animationDelay:r},children:[(0,g.jsxs)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:e}),(0,g.jsx)(`p`,{className:`text-xs text-gray-400 font-semibold tracking-tight mt-1`,children:t})]}),(0,g.jsx)(`div`,{className:`p-8 flex-1`,children:n})]})}function v({label:e,description:t,checked:n,onChange:r}){return(0,g.jsxs)(`div`,{className:`flex items-center justify-between py-3 border-b border-gray-50 last:border-0 hover:bg-gray-50/30 px-2 -mx-2 rounded-xl transition-colors group`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight group-hover:text-[#D4A017] transition-colors`,children:e}),(0,g.jsx)(`div`,{className:`text-xs text-gray-400 font-medium`,children:t})]}),(0,g.jsxs)(`label`,{className:`relative inline-flex items-center cursor-pointer`,children:[(0,g.jsx)(`input`,{type:`checkbox`,className:`sr-only peer`,checked:n,onChange:e=>r(e.target.checked)}),(0,g.jsx)(`div`,{className:`w-10 h-5 bg-gray-300 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-400 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-[#D4A017] peer-checked:after:border-[#D4A017] border border-gray-200`})]})]})}function y({label:e,value:t,onChange:n,type:r=`text`,placeholder:i=``,error:a=``,required:o=!1,maxLength:s,id:c}){return(0,g.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,g.jsxs)(`label`,{htmlFor:c,className:`block text-xs font-semibold text-gray-500 tracking-tight ml-1`,children:[e,` `,o&&(0,g.jsx)(`span`,{className:`text-red-500`,children:`*`})]}),(0,g.jsx)(`input`,{id:c,type:r,value:t,onChange:e=>n(e.target.value),placeholder:i,maxLength:s,className:`input-field${a?` is-error`:``}`}),a&&(0,g.jsx)(`p`,{className:`text-xs text-red-500 font-semibold ml-1 mt-1`,children:a})]})}var b=[`general`,`security`,`email`,`mobile`];function x(){let e=window.location.hash.replace(`#`,``);return b.includes(e)?e:`general`}function S({settings:t}){let[n,o]=(0,f.useState)(x);(0,f.useEffect)(()=>{let e=()=>o(x());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let l=e=>{window.location.hash=e,o(e)},{auth:u}=a().props,[d,m]=(0,f.useState)(u?.user?.email||``),[h,b]=(0,f.useState)(!1),S=async()=>{if(d){b(!0);try{let e=await r.post(route(`system.settings.test-email`),{recipient:d,mail_host:C.settings.mail_host,mail_port:C.settings.mail_port,mail_username:C.settings.mail_username,mail_password:C.settings.mail_password,mail_encryption:C.settings.mail_encryption,mail_from_address:C.settings.mail_from_address,mail_from_name:C.settings.mail_from_name});e.data.success?c.success(`Success`,e.data.message||`Test email sent successfully!`):c.error(`SMTP Error`,e.data.message||`Failed to send test email.`)}catch(e){c.error(`Error`,e.response?.data?.message||e.message||`An error occurred.`)}finally{b(!1)}}},{data:C,setData:w,post:T,processing:E,errors:D}=e({settings:{app_name:t.app_name||``,app_logo_text:t.app_logo_text||`B`,app_description:t.app_description||``,allow_registration:t.allow_registration===`1`||t.allow_registration===!0,require_email_verification:t.require_email_verification===`1`||t.require_email_verification===!0,password_minimum_length:parseInt(t.password_minimum_length)||8,password_require_symbols:t.password_require_symbols===`1`||t.password_require_symbols===!0,password_require_numbers:t.password_require_numbers===`1`||t.password_require_numbers===!0,password_require_mixed_case:t.password_require_mixed_case===`1`||t.password_require_mixed_case===!0,two_factor_totp_enabled:t.two_factor_totp_enabled===`1`||t.two_factor_totp_enabled===!0,two_factor_email_enabled:t.two_factor_email_enabled===`1`||t.two_factor_email_enabled===!0,oauth_google_enabled:t.oauth_google_enabled===`1`||t.oauth_google_enabled===!0,oauth_google_client_id:t.oauth_google_client_id||``,oauth_google_client_secret:t.oauth_google_client_secret||``,oauth_github_enabled:t.oauth_github_enabled===`1`||t.oauth_github_enabled===!0,oauth_github_client_id:t.oauth_github_client_id||``,oauth_github_client_secret:t.oauth_github_client_secret||``,mail_host:t.mail_host||``,mail_port:t.mail_port||``,mail_username:t.mail_username||``,mail_password:t.mail_password||``,mail_encryption:t.mail_encryption||`tls`,mail_from_address:t.mail_from_address||``,mail_from_name:t.mail_from_name||``,primary_color:t.primary_color||`#D4A017`,android_latest_version:t.android_latest_version||`1.0.0`,android_min_version:t.android_min_version||`1.0.0`,android_maintenance_mode:t.android_maintenance_mode===`1`||t.android_maintenance_mode===!0,android_playstore_url:t.android_playstore_url||``},logo_file:null,_method:`PATCH`}),[O,k]=(0,f.useState)([]),A=(e,t)=>{w(`settings`,{...C.settings,[e]:t})};return(0,g.jsxs)(s,{children:[(0,g.jsx)(i,{title:`System Settings`}),(0,g.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`System Configuration`}),(0,g.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Manage global application behavior and external protocols`})]}),(0,g.jsx)(`button`,{onClick:e=>{e.preventDefault(),T(route(`system.settings.update`),{preserveScroll:!0,onSuccess:()=>c.success(`Saved`,`System settings updated successfully.`)})},disabled:E,className:`h-10 px-8 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20 disabled:opacity-60 disabled:cursor-not-allowed`,children:E?`Saving...`:`Save Configuration`})]}),(0,g.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-gray-100 w-full mb-8 anim-down`,style:{animationDelay:`0.05s`},children:[(0,g.jsxs)(`button`,{type:`button`,onClick:()=>l(`general`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${n===`general`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`General & Branding`,n===`general`&&(0,g.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>l(`security`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${n===`security`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Security & OAuth`,n===`security`&&(0,g.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>l(`email`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${n===`email`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Email Protocol`,n===`email`&&(0,g.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>l(`mobile`),className:`relative pb-3 px-1 text-sm font-bold tracking-tight transition-colors ${n===`mobile`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Mobile App Control`,n===`mobile`&&(0,g.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]})]}),(0,g.jsxs)(`div`,{className:`space-y-8 pb-20`,children:[n===`general`&&(0,g.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-8 anim-fade`,children:[(0,g.jsx)(_,{title:`Application Branding`,description:`Logo and visual identity`,delay:`0.1s`,children:(0,g.jsxs)(`div`,{className:`space-y-8`,children:[(0,g.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center gap-8`,children:[(0,g.jsx)(`div`,{className:`w-24 h-24 rounded-2xl flex items-center justify-center text-white text-3xl font-bold shrink-0 border border-gray-100 shadow-sm ${t.app_logo?`bg-white`:`bg-[#3D4E4B]`}`,children:t.app_logo?(0,g.jsx)(`img`,{src:t.app_logo,className:`w-full h-full object-contain`}):C.settings.app_logo_text||`B`}),(0,g.jsx)(`div`,{className:`flex-1 w-full`,children:(0,g.jsx)(p.FilePond,{files:O,onupdatefiles:e=>{k(e),w(`logo_file`,e[0]?.file||null)},allowMultiple:!1,maxFiles:1,labelIdle:`Drop Logo here`})})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-6`,children:[(0,g.jsx)(y,{label:`App Name`,value:C.settings.app_name,onChange:e=>A(`app_name`,e),required:!0,placeholder:`e.g. Biiskit Platform`}),(0,g.jsx)(y,{label:`Logo Text`,value:C.settings.app_logo_text,onChange:e=>A(`app_logo_text`,e),maxLength:3,required:!0,placeholder:`e.g. B`})]})]})}),(0,g.jsx)(_,{title:`Public Policy`,description:`Manage open registration and access`,delay:`0.15s`,children:(0,g.jsxs)(`div`,{className:`space-y-2`,children:[(0,g.jsx)(v,{label:`Public Registration`,description:`Allow new users to create accounts`,checked:C.settings.allow_registration,onChange:e=>A(`allow_registration`,e)}),(0,g.jsx)(v,{label:`Email Verification`,description:`Require email validation for new accounts`,checked:C.settings.require_email_verification,onChange:e=>A(`require_email_verification`,e)})]})})]}),n===`security`&&(0,g.jsxs)(`div`,{className:`space-y-8 anim-fade`,children:[(0,g.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-8`,children:[(0,g.jsx)(_,{title:`Password Standards`,description:`Complexity requirements for user access`,delay:`0.1s`,children:(0,g.jsxs)(`div`,{className:`space-y-2`,children:[(0,g.jsx)(v,{label:`Require Symbols`,description:`Include special characters (!@#$)`,checked:C.settings.password_require_symbols,onChange:e=>A(`password_require_symbols`,e)}),(0,g.jsx)(v,{label:`Require Numbers`,description:`Include numerical digits (0-9)`,checked:C.settings.password_require_numbers,onChange:e=>A(`password_require_numbers`,e)}),(0,g.jsx)(v,{label:`Require Mixed Case`,description:`Force Uppercase and Lowercase letters`,checked:C.settings.password_require_mixed_case,onChange:e=>A(`password_require_mixed_case`,e)}),(0,g.jsxs)(`div`,{className:`flex items-center justify-between py-4 mt-2 border-t border-gray-50`,children:[(0,g.jsx)(`span`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Minimum Length`}),(0,g.jsx)(`input`,{type:`number`,value:C.settings.password_minimum_length,onChange:e=>A(`password_minimum_length`,parseInt(e.target.value)),className:`w-16 h-10 input-field text-center px-2 text-[#D4A017] font-bold`})]})]})}),(0,g.jsx)(_,{title:`Two-Factor Authentication (2FA)`,description:`Configure globally available 2FA options for users`,delay:`0.12s`,children:(0,g.jsxs)(`div`,{className:`space-y-2`,children:[(0,g.jsx)(v,{label:`Google Authenticator (TOTP)`,description:`Allow users to use Authenticator Apps (Google, Authy, etc.)`,checked:C.settings.two_factor_totp_enabled,onChange:e=>A(`two_factor_totp_enabled`,e)}),(0,g.jsx)(v,{label:`Email 2FA`,description:`Allow users to receive 6-digit OTP codes via email (requires SMTP configuration)`,checked:C.settings.two_factor_email_enabled,onChange:e=>A(`two_factor_email_enabled`,e)})]})})]}),(0,g.jsx)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-8`,children:(0,g.jsx)(_,{title:`OAuth Providers`,description:`Third-party authentication protocols`,delay:`0.15s`,children:(0,g.jsx)(`div`,{className:`space-y-6`,children:[`google`,`github`].map(e=>(0,g.jsxs)(`div`,{className:`p-6 rounded-2xl bg-gray-50/50 border border-gray-100`,children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,g.jsxs)(`div`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight capitalize flex items-center gap-2`,children:[(0,g.jsx)(`span`,{className:`w-2 h-2 rounded-full ${C.settings[`oauth_${e}_enabled`]?`bg-green-500`:`bg-gray-300`}`}),e,` Login`]}),(0,g.jsxs)(`label`,{className:`relative inline-flex items-center cursor-pointer scale-90`,children:[(0,g.jsx)(`input`,{type:`checkbox`,className:`sr-only peer`,checked:C.settings[`oauth_${e}_enabled`],onChange:t=>A(`oauth_${e}_enabled`,t.target.checked)}),(0,g.jsx)(`div`,{className:`w-10 h-5 bg-gray-300 rounded-full peer peer-checked:bg-[#D4A017] after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-400 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:after:translate-x-full border border-gray-200`})]})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,g.jsx)(y,{label:`Client ID`,value:C.settings[`oauth_${e}_client_id`],onChange:t=>A(`oauth_${e}_client_id`,t),placeholder:`Enter ${e} Client ID`}),(0,g.jsx)(y,{label:`Client Secret`,type:`password`,value:C.settings[`oauth_${e}_client_secret`],onChange:t=>A(`oauth_${e}_client_secret`,t),placeholder:`••••••••`})]})]},e))})})})]}),n===`email`&&(0,g.jsxs)(`div`,{className:`max-w-5xl space-y-8 anim-fade`,children:[(0,g.jsx)(_,{title:`Mail Transmission`,description:`SMTP server configuration for system notifications`,delay:`0.1s`,children:(0,g.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-8`,children:[(0,g.jsxs)(`div`,{className:`md:col-span-2 space-y-6`,children:[(0,g.jsxs)(`div`,{className:`grid grid-cols-3 gap-6`,children:[(0,g.jsx)(`div`,{className:`col-span-2`,children:(0,g.jsx)(y,{label:`Mail Host`,value:C.settings.mail_host,onChange:e=>A(`mail_host`,e),placeholder:`e.g. smtp.mailtrap.io`,required:!0})}),(0,g.jsx)(y,{label:`Port`,value:C.settings.mail_port,onChange:e=>A(`mail_port`,e),placeholder:`e.g. 587`,required:!0})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-6`,children:[(0,g.jsx)(y,{label:`Username`,value:C.settings.mail_username,onChange:e=>A(`mail_username`,e),placeholder:`e.g. user_key_123`}),(0,g.jsx)(y,{label:`Password`,type:`password`,value:C.settings.mail_password,onChange:e=>A(`mail_password`,e),placeholder:`••••••••`})]})]}),(0,g.jsxs)(`div`,{className:`space-y-6 pt-6 md:pt-0 border-t md:border-t-0 md:border-l border-gray-100 md:pl-8`,children:[(0,g.jsx)(y,{label:`Sender Address`,value:C.settings.mail_from_address,onChange:e=>A(`mail_from_address`,e),placeholder:`e.g. no-reply@app.com`,required:!0}),(0,g.jsx)(y,{label:`Sender Name`,value:C.settings.mail_from_name,onChange:e=>A(`mail_from_name`,e),placeholder:`e.g. System Admin`,required:!0})]})]})}),(0,g.jsx)(_,{title:`SMTP Connection Test`,description:`Verify your SMTP transmission parameters by sending a test email`,delay:`0.15s`,children:(0,g.jsxs)(`div`,{className:`max-w-xl space-y-6`,children:[(0,g.jsxs)(`div`,{className:`p-4 rounded-xl bg-gray-50/50 border border-gray-100 flex items-start gap-3`,children:[(0,g.jsx)(`svg`,{className:`w-5 h-5 text-[#D4A017] mt-0.5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,g.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})}),(0,g.jsx)(`p`,{className:`text-xs text-[#3D4E4B] font-semibold leading-relaxed`,children:`This test will use the SMTP values entered in the form above. You don't need to save the configuration first to test it.`})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-6 items-end`,children:[(0,g.jsx)(`div`,{className:`sm:col-span-2`,children:(0,g.jsx)(y,{label:`Recipient Email Address`,value:d,onChange:m,placeholder:`e.g. you@example.com`,required:!0})}),(0,g.jsx)(`button`,{type:`button`,onClick:S,disabled:h||!d,className:`h-10 px-6 bg-[#3D4E4B] text-white text-xs font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all shadow-md shadow-[#3D4E4B]/10 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2`,children:h?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`svg`,{className:`animate-spin h-4 w-4 text-white`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,g.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,g.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]}),(0,g.jsx)(`span`,{children:`Transmitting...`})]}):`Send Test Email`})]})]})})]}),n===`mobile`&&(0,g.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-8 anim-fade`,children:[(0,g.jsx)(_,{title:`Version Management`,description:`Control Android application lifecycle`,delay:`0.1s`,children:(0,g.jsxs)(`div`,{className:`space-y-8`,children:[(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-6`,children:[(0,g.jsx)(y,{label:`Latest Version`,value:C.settings.android_latest_version,onChange:e=>A(`android_latest_version`,e),placeholder:`e.g. 1.2.0`}),(0,g.jsx)(y,{label:`Min Required Version`,value:C.settings.android_min_version,onChange:e=>A(`android_min_version`,e),placeholder:`e.g. 1.0.5`})]}),(0,g.jsx)(y,{label:`Play Store URL`,value:C.settings.android_playstore_url,onChange:e=>A(`android_playstore_url`,e),placeholder:`https://play.google.com/store/apps/details?id=...`})]})}),(0,g.jsx)(_,{title:`Mobile Availability`,description:`Control API accessibility for devices`,delay:`0.15s`,children:(0,g.jsxs)(`div`,{className:`space-y-4`,children:[(0,g.jsx)(v,{label:`Maintenance Mode`,description:`Block Android API access for maintenance`,checked:C.settings.android_maintenance_mode,onChange:e=>A(`android_maintenance_mode`,e)}),(0,g.jsxs)(`div`,{className:`p-4 rounded-xl bg-amber-50 border border-amber-100 mt-4`,children:[(0,g.jsx)(`p`,{className:`text-[10px] font-bold text-amber-800 leading-relaxed uppercase tracking-widest mb-1`,children:`Warning`}),(0,g.jsx)(`p`,{className:`text-[11px] text-amber-700 font-medium`,children:`Enabling maintenance mode will return a 503 error to all mobile devices connecting to the API.`})]})]})})]})]})]})}export{S as default}; \ No newline at end of file +import{a as e,c as t,d as n,l as r,n as i,o as a,t as o}from"./app-C2kGDHB9.js";import{t as s}from"./AuthenticatedLayout-C8h2HS7D.js";import{t as c}from"./swal-DeDNECCu.js";import{n as l,r as u,t as d}from"./filepond-plugin-file-validate-type-DOUFAaeW.js";var f=n(t(),1),p=u(),m=n(l(),1),h=n(d(),1),g=o();(0,p.registerPlugin)(m.default,h.default);function _({title:e,description:t,children:n,delay:r=`0s`}){return(0,g.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden h-full flex flex-col anim-up`,style:{animationDelay:r},children:[(0,g.jsxs)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:e}),(0,g.jsx)(`p`,{className:`text-xs text-gray-400 font-semibold tracking-tight mt-1`,children:t})]}),(0,g.jsx)(`div`,{className:`p-8 flex-1`,children:n})]})}function v({label:e,description:t,checked:n,onChange:r}){return(0,g.jsxs)(`div`,{className:`flex items-center justify-between py-3 border-b border-gray-50 last:border-0 hover:bg-gray-50/30 px-2 -mx-2 rounded-xl transition-colors group`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight group-hover:text-[#D4A017] transition-colors`,children:e}),(0,g.jsx)(`div`,{className:`text-xs text-gray-400 font-medium`,children:t})]}),(0,g.jsxs)(`label`,{className:`relative inline-flex items-center cursor-pointer`,children:[(0,g.jsx)(`input`,{type:`checkbox`,className:`sr-only peer`,checked:n,onChange:e=>r(e.target.checked)}),(0,g.jsx)(`div`,{className:`w-10 h-5 bg-gray-300 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-400 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-[#D4A017] peer-checked:after:border-[#D4A017] border border-gray-200`})]})]})}function y({label:e,value:t,onChange:n,type:r=`text`,placeholder:i=``,error:a=``,required:o=!1,maxLength:s,id:c}){return(0,g.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,g.jsxs)(`label`,{htmlFor:c,className:`block text-xs font-semibold text-gray-500 tracking-tight ml-1`,children:[e,` `,o&&(0,g.jsx)(`span`,{className:`text-red-500`,children:`*`})]}),(0,g.jsx)(`input`,{id:c,type:r,value:t,onChange:e=>n(e.target.value),placeholder:i,maxLength:s,className:`input-field${a?` is-error`:``}`}),a&&(0,g.jsx)(`p`,{className:`text-xs text-red-500 font-semibold ml-1 mt-1`,children:a})]})}var b=[`general`,`security`,`email`,`mobile`];function x(){let e=window.location.hash.replace(`#`,``);return b.includes(e)?e:`general`}function S({settings:t}){let[n,o]=(0,f.useState)(x);(0,f.useEffect)(()=>{let e=()=>o(x());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let l=e=>{window.location.hash=e,o(e)},{auth:u}=a().props,[d,m]=(0,f.useState)(u?.user?.email||``),[h,b]=(0,f.useState)(!1),S=async()=>{if(d){b(!0);try{let e=await r.post(route(`system.settings.test-email`),{recipient:d,mail_host:C.settings.mail_host,mail_port:C.settings.mail_port,mail_username:C.settings.mail_username,mail_password:C.settings.mail_password,mail_encryption:C.settings.mail_encryption,mail_from_address:C.settings.mail_from_address,mail_from_name:C.settings.mail_from_name});e.data.success?c.success(`Success`,e.data.message||`Test email sent successfully!`):c.error(`SMTP Error`,e.data.message||`Failed to send test email.`)}catch(e){c.error(`Error`,e.response?.data?.message||e.message||`An error occurred.`)}finally{b(!1)}}},{data:C,setData:w,post:T,processing:E,errors:D}=e({settings:{app_name:t.app_name||``,app_logo_text:t.app_logo_text||`B`,app_description:t.app_description||``,allow_registration:t.allow_registration===`1`||t.allow_registration===!0,require_email_verification:t.require_email_verification===`1`||t.require_email_verification===!0,password_minimum_length:parseInt(t.password_minimum_length)||8,password_require_symbols:t.password_require_symbols===`1`||t.password_require_symbols===!0,password_require_numbers:t.password_require_numbers===`1`||t.password_require_numbers===!0,password_require_mixed_case:t.password_require_mixed_case===`1`||t.password_require_mixed_case===!0,two_factor_totp_enabled:t.two_factor_totp_enabled===`1`||t.two_factor_totp_enabled===!0,two_factor_email_enabled:t.two_factor_email_enabled===`1`||t.two_factor_email_enabled===!0,oauth_google_enabled:t.oauth_google_enabled===`1`||t.oauth_google_enabled===!0,oauth_google_client_id:t.oauth_google_client_id||``,oauth_google_client_secret:t.oauth_google_client_secret||``,oauth_github_enabled:t.oauth_github_enabled===`1`||t.oauth_github_enabled===!0,oauth_github_client_id:t.oauth_github_client_id||``,oauth_github_client_secret:t.oauth_github_client_secret||``,mail_host:t.mail_host||``,mail_port:t.mail_port||``,mail_username:t.mail_username||``,mail_password:t.mail_password||``,mail_encryption:t.mail_encryption||`tls`,mail_from_address:t.mail_from_address||``,mail_from_name:t.mail_from_name||``,primary_color:t.primary_color||`#D4A017`,android_latest_version:t.android_latest_version||`1.0.0`,android_min_version:t.android_min_version||`1.0.0`,android_maintenance_mode:t.android_maintenance_mode===`1`||t.android_maintenance_mode===!0,android_playstore_url:t.android_playstore_url||``},logo_file:null,_method:`PATCH`}),[O,k]=(0,f.useState)([]),A=(e,t)=>{w(`settings`,{...C.settings,[e]:t})};return(0,g.jsxs)(s,{children:[(0,g.jsx)(i,{title:`System Settings`}),(0,g.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`System Configuration`}),(0,g.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Manage global application behavior and external protocols`})]}),(0,g.jsx)(`button`,{onClick:e=>{e.preventDefault(),T(route(`system.settings.update`),{preserveScroll:!0,onSuccess:()=>c.success(`Saved`,`System settings updated successfully.`)})},disabled:E,className:`h-10 px-8 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20 disabled:opacity-60 disabled:cursor-not-allowed`,children:E?`Saving...`:`Save Configuration`})]}),(0,g.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-gray-100 w-full mb-8 anim-down`,style:{animationDelay:`0.05s`},children:[(0,g.jsxs)(`button`,{type:`button`,onClick:()=>l(`general`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${n===`general`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`General & Branding`,n===`general`&&(0,g.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>l(`security`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${n===`security`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Security & OAuth`,n===`security`&&(0,g.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>l(`email`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${n===`email`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Email Protocol`,n===`email`&&(0,g.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>l(`mobile`),className:`relative pb-3 px-1 text-sm font-bold tracking-tight transition-colors ${n===`mobile`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Mobile App Control`,n===`mobile`&&(0,g.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]})]}),(0,g.jsxs)(`div`,{className:`space-y-8 pb-20`,children:[n===`general`&&(0,g.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-8 anim-fade`,children:[(0,g.jsx)(_,{title:`Application Branding`,description:`Logo and visual identity`,delay:`0.1s`,children:(0,g.jsxs)(`div`,{className:`space-y-8`,children:[(0,g.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center gap-8`,children:[(0,g.jsx)(`div`,{className:`w-24 h-24 rounded-2xl flex items-center justify-center text-white text-3xl font-bold shrink-0 border border-gray-100 shadow-sm ${t.app_logo?`bg-white`:`bg-[#3D4E4B]`}`,children:t.app_logo?(0,g.jsx)(`img`,{src:t.app_logo,className:`w-full h-full object-contain`}):C.settings.app_logo_text||`B`}),(0,g.jsx)(`div`,{className:`flex-1 w-full`,children:(0,g.jsx)(p.FilePond,{files:O,onupdatefiles:e=>{k(e),w(`logo_file`,e[0]?.file||null)},allowMultiple:!1,maxFiles:1,labelIdle:`Drop Logo here`})})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-6`,children:[(0,g.jsx)(y,{label:`App Name`,value:C.settings.app_name,onChange:e=>A(`app_name`,e),required:!0,placeholder:`e.g. Biiskit Platform`}),(0,g.jsx)(y,{label:`Logo Text`,value:C.settings.app_logo_text,onChange:e=>A(`app_logo_text`,e),maxLength:3,required:!0,placeholder:`e.g. B`})]})]})}),(0,g.jsx)(_,{title:`Public Policy`,description:`Manage open registration and access`,delay:`0.15s`,children:(0,g.jsxs)(`div`,{className:`space-y-2`,children:[(0,g.jsx)(v,{label:`Public Registration`,description:`Allow new users to create accounts`,checked:C.settings.allow_registration,onChange:e=>A(`allow_registration`,e)}),(0,g.jsx)(v,{label:`Email Verification`,description:`Require email validation for new accounts`,checked:C.settings.require_email_verification,onChange:e=>A(`require_email_verification`,e)})]})})]}),n===`security`&&(0,g.jsxs)(`div`,{className:`space-y-8 anim-fade`,children:[(0,g.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-8`,children:[(0,g.jsx)(_,{title:`Password Standards`,description:`Complexity requirements for user access`,delay:`0.1s`,children:(0,g.jsxs)(`div`,{className:`space-y-2`,children:[(0,g.jsx)(v,{label:`Require Symbols`,description:`Include special characters (!@#$)`,checked:C.settings.password_require_symbols,onChange:e=>A(`password_require_symbols`,e)}),(0,g.jsx)(v,{label:`Require Numbers`,description:`Include numerical digits (0-9)`,checked:C.settings.password_require_numbers,onChange:e=>A(`password_require_numbers`,e)}),(0,g.jsx)(v,{label:`Require Mixed Case`,description:`Force Uppercase and Lowercase letters`,checked:C.settings.password_require_mixed_case,onChange:e=>A(`password_require_mixed_case`,e)}),(0,g.jsxs)(`div`,{className:`flex items-center justify-between py-4 mt-2 border-t border-gray-50`,children:[(0,g.jsx)(`span`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Minimum Length`}),(0,g.jsx)(`input`,{type:`number`,value:C.settings.password_minimum_length,onChange:e=>A(`password_minimum_length`,parseInt(e.target.value)),className:`w-16 h-10 input-field text-center px-2 text-[#D4A017] font-bold`})]})]})}),(0,g.jsx)(_,{title:`Two-Factor Authentication (2FA)`,description:`Configure globally available 2FA options for users`,delay:`0.12s`,children:(0,g.jsxs)(`div`,{className:`space-y-2`,children:[(0,g.jsx)(v,{label:`Google Authenticator (TOTP)`,description:`Allow users to use Authenticator Apps (Google, Authy, etc.)`,checked:C.settings.two_factor_totp_enabled,onChange:e=>A(`two_factor_totp_enabled`,e)}),(0,g.jsx)(v,{label:`Email 2FA`,description:`Allow users to receive 6-digit OTP codes via email (requires SMTP configuration)`,checked:C.settings.two_factor_email_enabled,onChange:e=>A(`two_factor_email_enabled`,e)})]})})]}),(0,g.jsx)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-8`,children:(0,g.jsx)(_,{title:`OAuth Providers`,description:`Third-party authentication protocols`,delay:`0.15s`,children:(0,g.jsx)(`div`,{className:`space-y-6`,children:[`google`,`github`].map(e=>(0,g.jsxs)(`div`,{className:`p-6 rounded-2xl bg-gray-50/50 border border-gray-100`,children:[(0,g.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,g.jsxs)(`div`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight capitalize flex items-center gap-2`,children:[(0,g.jsx)(`span`,{className:`w-2 h-2 rounded-full ${C.settings[`oauth_${e}_enabled`]?`bg-green-500`:`bg-gray-300`}`}),e,` Login`]}),(0,g.jsxs)(`label`,{className:`relative inline-flex items-center cursor-pointer scale-90`,children:[(0,g.jsx)(`input`,{type:`checkbox`,className:`sr-only peer`,checked:C.settings[`oauth_${e}_enabled`],onChange:t=>A(`oauth_${e}_enabled`,t.target.checked)}),(0,g.jsx)(`div`,{className:`w-10 h-5 bg-gray-300 rounded-full peer peer-checked:bg-[#D4A017] after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-400 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:after:translate-x-full border border-gray-200`})]})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,g.jsx)(y,{label:`Client ID`,value:C.settings[`oauth_${e}_client_id`],onChange:t=>A(`oauth_${e}_client_id`,t),placeholder:`Enter ${e} Client ID`}),(0,g.jsx)(y,{label:`Client Secret`,type:`password`,value:C.settings[`oauth_${e}_client_secret`],onChange:t=>A(`oauth_${e}_client_secret`,t),placeholder:`••••••••`})]})]},e))})})})]}),n===`email`&&(0,g.jsxs)(`div`,{className:`max-w-5xl space-y-8 anim-fade`,children:[(0,g.jsx)(_,{title:`Mail Transmission`,description:`SMTP server configuration for system notifications`,delay:`0.1s`,children:(0,g.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-8`,children:[(0,g.jsxs)(`div`,{className:`md:col-span-2 space-y-6`,children:[(0,g.jsxs)(`div`,{className:`grid grid-cols-3 gap-6`,children:[(0,g.jsx)(`div`,{className:`col-span-2`,children:(0,g.jsx)(y,{label:`Mail Host`,value:C.settings.mail_host,onChange:e=>A(`mail_host`,e),placeholder:`e.g. smtp.mailtrap.io`,required:!0})}),(0,g.jsx)(y,{label:`Port`,value:C.settings.mail_port,onChange:e=>A(`mail_port`,e),placeholder:`e.g. 587`,required:!0})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-6`,children:[(0,g.jsx)(y,{label:`Username`,value:C.settings.mail_username,onChange:e=>A(`mail_username`,e),placeholder:`e.g. user_key_123`}),(0,g.jsx)(y,{label:`Password`,type:`password`,value:C.settings.mail_password,onChange:e=>A(`mail_password`,e),placeholder:`••••••••`})]})]}),(0,g.jsxs)(`div`,{className:`space-y-6 pt-6 md:pt-0 border-t md:border-t-0 md:border-l border-gray-100 md:pl-8`,children:[(0,g.jsx)(y,{label:`Sender Address`,value:C.settings.mail_from_address,onChange:e=>A(`mail_from_address`,e),placeholder:`e.g. no-reply@app.com`,required:!0}),(0,g.jsx)(y,{label:`Sender Name`,value:C.settings.mail_from_name,onChange:e=>A(`mail_from_name`,e),placeholder:`e.g. System Admin`,required:!0})]})]})}),(0,g.jsx)(_,{title:`SMTP Connection Test`,description:`Verify your SMTP transmission parameters by sending a test email`,delay:`0.15s`,children:(0,g.jsxs)(`div`,{className:`max-w-xl space-y-6`,children:[(0,g.jsxs)(`div`,{className:`p-4 rounded-xl bg-gray-50/50 border border-gray-100 flex items-start gap-3`,children:[(0,g.jsx)(`svg`,{className:`w-5 h-5 text-[#D4A017] mt-0.5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,g.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})}),(0,g.jsx)(`p`,{className:`text-xs text-[#3D4E4B] font-semibold leading-relaxed`,children:`This test will use the SMTP values entered in the form above. You don't need to save the configuration first to test it.`})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-6 items-end`,children:[(0,g.jsx)(`div`,{className:`sm:col-span-2`,children:(0,g.jsx)(y,{label:`Recipient Email Address`,value:d,onChange:m,placeholder:`e.g. you@example.com`,required:!0})}),(0,g.jsx)(`button`,{type:`button`,onClick:S,disabled:h||!d,className:`h-10 px-6 bg-[#3D4E4B] text-white text-xs font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all shadow-md shadow-[#3D4E4B]/10 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2`,children:h?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`svg`,{className:`animate-spin h-4 w-4 text-white`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,g.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,g.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]}),(0,g.jsx)(`span`,{children:`Transmitting...`})]}):`Send Test Email`})]})]})})]}),n===`mobile`&&(0,g.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-8 anim-fade`,children:[(0,g.jsx)(_,{title:`Version Management`,description:`Control Android application lifecycle`,delay:`0.1s`,children:(0,g.jsxs)(`div`,{className:`space-y-8`,children:[(0,g.jsxs)(`div`,{className:`grid grid-cols-2 gap-6`,children:[(0,g.jsx)(y,{label:`Latest Version`,value:C.settings.android_latest_version,onChange:e=>A(`android_latest_version`,e),placeholder:`e.g. 1.2.0`}),(0,g.jsx)(y,{label:`Min Required Version`,value:C.settings.android_min_version,onChange:e=>A(`android_min_version`,e),placeholder:`e.g. 1.0.5`})]}),(0,g.jsx)(y,{label:`Play Store URL`,value:C.settings.android_playstore_url,onChange:e=>A(`android_playstore_url`,e),placeholder:`https://play.google.com/store/apps/details?id=...`})]})}),(0,g.jsx)(_,{title:`Mobile Availability`,description:`Control API accessibility for devices`,delay:`0.15s`,children:(0,g.jsxs)(`div`,{className:`space-y-4`,children:[(0,g.jsx)(v,{label:`Maintenance Mode`,description:`Block Android API access for maintenance`,checked:C.settings.android_maintenance_mode,onChange:e=>A(`android_maintenance_mode`,e)}),(0,g.jsxs)(`div`,{className:`p-4 rounded-xl bg-amber-50 border border-amber-100 mt-4`,children:[(0,g.jsx)(`p`,{className:`text-[10px] font-bold text-amber-800 leading-relaxed uppercase tracking-widest mb-1`,children:`Warning`}),(0,g.jsx)(`p`,{className:`text-[11px] text-amber-700 font-medium`,children:`Enabling maintenance mode will return a 503 error to all mobile devices connecting to the API.`})]})]})})]})]})]})}export{S as default}; \ No newline at end of file diff --git a/public/build/assets/Index-BYUmRpDS.js b/public/build/assets/Index-DUo87EQf.js similarity index 99% rename from public/build/assets/Index-BYUmRpDS.js rename to public/build/assets/Index-DUo87EQf.js index 67e1583..6ce5b4c 100644 --- a/public/build/assets/Index-BYUmRpDS.js +++ b/public/build/assets/Index-DUo87EQf.js @@ -1,4 +1,4 @@ -import{c as e,d as t,n,t as r}from"./app-BK5KCPMc.js";import{t as i}from"./AuthenticatedLayout-BjuyW-Hp.js";var a=t(e(),1),o=r(),s=[{id:`intro`,label:`Pendahuluan`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})})},{id:`quickstart`,label:`Quick Start`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 10V3L4 14h7v7l9-11h-7z`})})},{id:`stack`,label:`Tech Stack`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10`})})},{id:`auth`,label:`Autentikasi`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`})})},{id:`roles`,label:`Roles & Permission`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})})},{id:`features`,label:`Fitur Lengkap`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4 6h16M4 10h16M4 14h16M4 18h7`})})},{id:`api`,label:`REST API`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z`})})},{id:`2fa`,label:`Two-Factor Auth`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z`})})},{id:`settings`,label:`System Settings`,icon:(0,o.jsxs)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:[(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z`}),(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`})]})},{id:`structure`,label:`Struktur Folder`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z`})})}];function c({children:e,color:t=`gray`}){return(0,o.jsx)(`span`,{className:`inline-flex items-center px-2.5 py-0.5 rounded-lg text-[10px] font-bold uppercase tracking-widest ${{green:`bg-emerald-50 text-emerald-700 border border-emerald-200`,blue:`bg-blue-50 text-blue-700 border border-blue-200`,amber:`bg-amber-50 text-amber-700 border border-amber-200`,red:`bg-red-50 text-red-700 border border-red-200`,gray:`bg-gray-50 text-gray-600 border border-gray-200`,purple:`bg-purple-50 text-purple-700 border border-purple-200`}[t]}`,children:e})}function l({children:e,lang:t=`bash`}){let[n,r]=(0,a.useState)(!1);return(0,o.jsxs)(`div`,{className:`relative group mt-3`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between bg-[#1E2A28] rounded-t-xl px-4 py-2 border-b border-white/5`,children:[(0,o.jsx)(`span`,{className:`text-[10px] text-gray-400 font-mono font-bold uppercase tracking-widest`,children:t}),(0,o.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},className:`text-[10px] text-gray-400 font-bold hover:text-white transition-colors`,children:n?`✓ Copied`:`Copy`})]}),(0,o.jsx)(`pre`,{className:`bg-[#152320] text-emerald-300 text-xs font-mono p-4 rounded-b-xl overflow-x-auto leading-relaxed`,children:(0,o.jsx)(`code`,{children:e})})]})}function u({id:e,title:t,badge:n,badgeColor:r}){return(0,o.jsxs)(`div`,{id:e,className:`flex items-center gap-3 mb-6 pt-2 scroll-mt-6`,children:[(0,o.jsx)(`h2`,{className:`text-base font-black text-[#3D4E4B] dark:text-white tracking-tight`,children:t}),n&&(0,o.jsx)(c,{color:r,children:n}),(0,o.jsx)(`div`,{className:`flex-1 h-px bg-gray-100 dark:bg-white/10`})]})}function d({method:e,path:t,desc:n,auth:r=!0}){return(0,o.jsxs)(`div`,{className:`flex items-center gap-3 py-3 border-b border-gray-50 last:border-0`,children:[(0,o.jsx)(`span`,{className:`shrink-0 px-2.5 py-1 rounded-lg text-[10px] font-black tracking-widest uppercase ${{GET:`bg-blue-100 text-blue-700`,POST:`bg-emerald-100 text-emerald-700`,PATCH:`bg-amber-100 text-amber-700`,DELETE:`bg-red-100 text-red-700`,PUT:`bg-purple-100 text-purple-700`}[e]??`bg-gray-100 text-gray-600`}`,children:e}),(0,o.jsx)(`code`,{className:`flex-1 text-xs font-mono text-[#3D4E4B] font-bold`,children:t}),(0,o.jsx)(`span`,{className:`text-xs text-gray-400 font-medium hidden md:block`,children:n}),r&&(0,o.jsx)(`span`,{className:`shrink-0 text-[10px] text-amber-600 font-bold`,children:`🔒 Auth`})]})}function f(){let[e,t]=(0,a.useState)(`intro`),r=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=s.map(e=>e.id),n=new IntersectionObserver(e=>{let n=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top);n.length>0&&t(n[0].target.id)},{rootMargin:`-20% 0px -70% 0px`,threshold:0});return e.forEach(e=>{let t=document.getElementById(e);t&&n.observe(t)}),()=>n.disconnect()},[]);let f=e=>{document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`})};return(0,o.jsxs)(i,{children:[(0,o.jsx)(n,{title:`Dokumentasi biiproject kit v2`}),(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] dark:text-white tracking-tight leading-none`,children:`Dokumentasi`}),(0,o.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Panduan lengkap biiproject kit v2`})]}),(0,o.jsx)(c,{color:`green`,children:`v2.0`})]}),(0,o.jsxs)(`div`,{className:`flex gap-8 anim-up`,children:[(0,o.jsx)(`aside`,{className:`hidden lg:block w-52 shrink-0`,children:(0,o.jsx)(`div`,{className:`sticky top-6 bg-white dark:bg-[#1A2120] rounded-2xl border border-gray-100 dark:border-white/10 shadow-sm p-3 space-y-0.5`,children:s.map(t=>(0,o.jsxs)(`button`,{onClick:()=>f(t.id),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-xs font-bold text-left transition-all ${e===t.id?`bg-[#3D4E4B] text-white`:`text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 hover:text-[#3D4E4B] dark:hover:text-white`}`,children:[(0,o.jsx)(`span`,{className:`shrink-0 ${e===t.id?`text-[#D4A017]`:``}`,children:t.icon}),t.label]},t.id))})}),(0,o.jsxs)(`div`,{ref:r,className:`flex-1 min-w-0 space-y-12 pb-20`,children:[(0,o.jsxs)(`section`,{children:[(0,o.jsx)(u,{id:`intro`,title:`Pendahuluan`,badge:`Starter Kit`,badgeColor:`blue`}),(0,o.jsxs)(`div`,{className:`bg-white dark:bg-[#1A2120] rounded-2xl border border-gray-100 dark:border-white/10 shadow-sm p-8 space-y-4`,children:[(0,o.jsxs)(`p`,{className:`text-sm text-gray-600 dark:text-gray-300 font-medium leading-relaxed`,children:[(0,o.jsx)(`strong`,{className:`text-[#3D4E4B] dark:text-white`,children:`biiproject kit v2`}),` adalah starter kit enterprise berbasis `,(0,o.jsx)(`strong`,{children:`Laravel 13 + React (Inertia.js)`}),` yang dirancang untuk mempercepat pembangunan aplikasi web dengan fitur manajemen pengguna, hak akses berbasis peran, monitoring aktivitas, notifikasi, dan konfigurasi sistem yang lengkap.`]}),(0,o.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 pt-2`,children:[{label:`Users & Roles`,icon:`👥`},{label:`Activity Logs`,icon:`📋`},{label:`System Settings`,icon:`⚙️`},{label:`Two-Factor Auth`,icon:`🔒`},{label:`REST API v1`,icon:`🔌`},{label:`Dark Mode`,icon:`🌙`},{label:`Notifikasi`,icon:`🔔`},{label:`Mobile Ready`,icon:`📱`}].map(e=>(0,o.jsxs)(`div`,{className:`p-4 bg-gray-50 dark:bg-white/5 rounded-xl text-center`,children:[(0,o.jsx)(`div`,{className:`text-2xl mb-1`,children:e.icon}),(0,o.jsx)(`div`,{className:`text-[11px] font-bold text-[#3D4E4B] dark:text-white`,children:e.label})]},e.label))})]})]}),(0,o.jsxs)(`section`,{children:[(0,o.jsx)(u,{id:`quickstart`,title:`Quick Start`,badge:`Setup`,badgeColor:`green`}),(0,o.jsxs)(`div`,{className:`bg-white dark:bg-[#1A2120] rounded-2xl border border-gray-100 dark:border-white/10 shadow-sm p-8 space-y-6`,children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`h3`,{className:`text-xs font-black text-[#3D4E4B] dark:text-white uppercase tracking-widest mb-2`,children:`1. Clone & Install`}),(0,o.jsx)(l,{lang:`bash`,children:`git clone https://github.com/your-org/biiskit.git +import{c as e,d as t,n,t as r}from"./app-C2kGDHB9.js";import{t as i}from"./AuthenticatedLayout-C8h2HS7D.js";var a=t(e(),1),o=r(),s=[{id:`intro`,label:`Pendahuluan`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})})},{id:`quickstart`,label:`Quick Start`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 10V3L4 14h7v7l9-11h-7z`})})},{id:`stack`,label:`Tech Stack`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10`})})},{id:`auth`,label:`Autentikasi`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`})})},{id:`roles`,label:`Roles & Permission`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})})},{id:`features`,label:`Fitur Lengkap`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4 6h16M4 10h16M4 14h16M4 18h7`})})},{id:`api`,label:`REST API`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z`})})},{id:`2fa`,label:`Two-Factor Auth`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z`})})},{id:`settings`,label:`System Settings`,icon:(0,o.jsxs)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:[(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z`}),(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`})]})},{id:`structure`,label:`Struktur Folder`,icon:(0,o.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z`})})}];function c({children:e,color:t=`gray`}){return(0,o.jsx)(`span`,{className:`inline-flex items-center px-2.5 py-0.5 rounded-lg text-[10px] font-bold uppercase tracking-widest ${{green:`bg-emerald-50 text-emerald-700 border border-emerald-200`,blue:`bg-blue-50 text-blue-700 border border-blue-200`,amber:`bg-amber-50 text-amber-700 border border-amber-200`,red:`bg-red-50 text-red-700 border border-red-200`,gray:`bg-gray-50 text-gray-600 border border-gray-200`,purple:`bg-purple-50 text-purple-700 border border-purple-200`}[t]}`,children:e})}function l({children:e,lang:t=`bash`}){let[n,r]=(0,a.useState)(!1);return(0,o.jsxs)(`div`,{className:`relative group mt-3`,children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between bg-[#1E2A28] rounded-t-xl px-4 py-2 border-b border-white/5`,children:[(0,o.jsx)(`span`,{className:`text-[10px] text-gray-400 font-mono font-bold uppercase tracking-widest`,children:t}),(0,o.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},className:`text-[10px] text-gray-400 font-bold hover:text-white transition-colors`,children:n?`✓ Copied`:`Copy`})]}),(0,o.jsx)(`pre`,{className:`bg-[#152320] text-emerald-300 text-xs font-mono p-4 rounded-b-xl overflow-x-auto leading-relaxed`,children:(0,o.jsx)(`code`,{children:e})})]})}function u({id:e,title:t,badge:n,badgeColor:r}){return(0,o.jsxs)(`div`,{id:e,className:`flex items-center gap-3 mb-6 pt-2 scroll-mt-6`,children:[(0,o.jsx)(`h2`,{className:`text-base font-black text-[#3D4E4B] dark:text-white tracking-tight`,children:t}),n&&(0,o.jsx)(c,{color:r,children:n}),(0,o.jsx)(`div`,{className:`flex-1 h-px bg-gray-100 dark:bg-white/10`})]})}function d({method:e,path:t,desc:n,auth:r=!0}){return(0,o.jsxs)(`div`,{className:`flex items-center gap-3 py-3 border-b border-gray-50 last:border-0`,children:[(0,o.jsx)(`span`,{className:`shrink-0 px-2.5 py-1 rounded-lg text-[10px] font-black tracking-widest uppercase ${{GET:`bg-blue-100 text-blue-700`,POST:`bg-emerald-100 text-emerald-700`,PATCH:`bg-amber-100 text-amber-700`,DELETE:`bg-red-100 text-red-700`,PUT:`bg-purple-100 text-purple-700`}[e]??`bg-gray-100 text-gray-600`}`,children:e}),(0,o.jsx)(`code`,{className:`flex-1 text-xs font-mono text-[#3D4E4B] font-bold`,children:t}),(0,o.jsx)(`span`,{className:`text-xs text-gray-400 font-medium hidden md:block`,children:n}),r&&(0,o.jsx)(`span`,{className:`shrink-0 text-[10px] text-amber-600 font-bold`,children:`🔒 Auth`})]})}function f(){let[e,t]=(0,a.useState)(`intro`),r=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=s.map(e=>e.id),n=new IntersectionObserver(e=>{let n=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top);n.length>0&&t(n[0].target.id)},{rootMargin:`-20% 0px -70% 0px`,threshold:0});return e.forEach(e=>{let t=document.getElementById(e);t&&n.observe(t)}),()=>n.disconnect()},[]);let f=e=>{document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`})};return(0,o.jsxs)(i,{children:[(0,o.jsx)(n,{title:`Dokumentasi biiproject kit v2`}),(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] dark:text-white tracking-tight leading-none`,children:`Dokumentasi`}),(0,o.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Panduan lengkap biiproject kit v2`})]}),(0,o.jsx)(c,{color:`green`,children:`v2.0`})]}),(0,o.jsxs)(`div`,{className:`flex gap-8 anim-up`,children:[(0,o.jsx)(`aside`,{className:`hidden lg:block w-52 shrink-0`,children:(0,o.jsx)(`div`,{className:`sticky top-6 bg-white dark:bg-[#1A2120] rounded-2xl border border-gray-100 dark:border-white/10 shadow-sm p-3 space-y-0.5`,children:s.map(t=>(0,o.jsxs)(`button`,{onClick:()=>f(t.id),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-xs font-bold text-left transition-all ${e===t.id?`bg-[#3D4E4B] text-white`:`text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 hover:text-[#3D4E4B] dark:hover:text-white`}`,children:[(0,o.jsx)(`span`,{className:`shrink-0 ${e===t.id?`text-[#D4A017]`:``}`,children:t.icon}),t.label]},t.id))})}),(0,o.jsxs)(`div`,{ref:r,className:`flex-1 min-w-0 space-y-12 pb-20`,children:[(0,o.jsxs)(`section`,{children:[(0,o.jsx)(u,{id:`intro`,title:`Pendahuluan`,badge:`Starter Kit`,badgeColor:`blue`}),(0,o.jsxs)(`div`,{className:`bg-white dark:bg-[#1A2120] rounded-2xl border border-gray-100 dark:border-white/10 shadow-sm p-8 space-y-4`,children:[(0,o.jsxs)(`p`,{className:`text-sm text-gray-600 dark:text-gray-300 font-medium leading-relaxed`,children:[(0,o.jsx)(`strong`,{className:`text-[#3D4E4B] dark:text-white`,children:`biiproject kit v2`}),` adalah starter kit enterprise berbasis `,(0,o.jsx)(`strong`,{children:`Laravel 13 + React (Inertia.js)`}),` yang dirancang untuk mempercepat pembangunan aplikasi web dengan fitur manajemen pengguna, hak akses berbasis peran, monitoring aktivitas, notifikasi, dan konfigurasi sistem yang lengkap.`]}),(0,o.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 pt-2`,children:[{label:`Users & Roles`,icon:`👥`},{label:`Activity Logs`,icon:`📋`},{label:`System Settings`,icon:`⚙️`},{label:`Two-Factor Auth`,icon:`🔒`},{label:`REST API v1`,icon:`🔌`},{label:`Dark Mode`,icon:`🌙`},{label:`Notifikasi`,icon:`🔔`},{label:`Mobile Ready`,icon:`📱`}].map(e=>(0,o.jsxs)(`div`,{className:`p-4 bg-gray-50 dark:bg-white/5 rounded-xl text-center`,children:[(0,o.jsx)(`div`,{className:`text-2xl mb-1`,children:e.icon}),(0,o.jsx)(`div`,{className:`text-[11px] font-bold text-[#3D4E4B] dark:text-white`,children:e.label})]},e.label))})]})]}),(0,o.jsxs)(`section`,{children:[(0,o.jsx)(u,{id:`quickstart`,title:`Quick Start`,badge:`Setup`,badgeColor:`green`}),(0,o.jsxs)(`div`,{className:`bg-white dark:bg-[#1A2120] rounded-2xl border border-gray-100 dark:border-white/10 shadow-sm p-8 space-y-6`,children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`h3`,{className:`text-xs font-black text-[#3D4E4B] dark:text-white uppercase tracking-widest mb-2`,children:`1. Clone & Install`}),(0,o.jsx)(l,{lang:`bash`,children:`git clone https://github.com/your-org/biiskit.git cd biiskit composer install npm install`})]}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`h3`,{className:`text-xs font-black text-[#3D4E4B] dark:text-white uppercase tracking-widest mb-2`,children:`2. Konfigurasi Environment`}),(0,o.jsx)(l,{lang:`bash`,children:`cp .env.example .env diff --git a/public/build/assets/Index-DFR_vfBx.js b/public/build/assets/Index-DaQeOcsk.js similarity index 96% rename from public/build/assets/Index-DFR_vfBx.js rename to public/build/assets/Index-DaQeOcsk.js index 48d7603..2f79bb5 100644 --- a/public/build/assets/Index-DFR_vfBx.js +++ b/public/build/assets/Index-DaQeOcsk.js @@ -1 +1 @@ -import{c as e,d as t,i as n,n as r,t as i}from"./app-BK5KCPMc.js";import{t as a}from"./AuthenticatedLayout-BjuyW-Hp.js";import{t as o}from"./Portal-C0c8udmH.js";import{t as s}from"./swal-D8hRpOIh.js";import{t as c}from"./Can-DkptxH2j.js";var l=t(e(),1),u=i();function d({roles:e,permissions:t}){let i=[...new Set(t.map(e=>e.group))],[d,f]=(0,l.useState)(()=>{let t={};return e.forEach(e=>{t[e.id]=[...e.permissions]}),t}),[p,m]=(0,l.useState)({}),[h,g]=(0,l.useState)({}),[_,v]=(0,l.useState)(!1),[y,b]=(0,l.useState)(``),x=(e,t)=>{f(n=>{let r=n[e]||[],i=r.includes(t)?r.filter(e=>e!==t):[...r,t];return{...n,[e]:i}}),m(t=>({...t,[e]:!0}))},S=async e=>{g(t=>({...t,[e.id]:!0})),n.patch(`/roles/${e.id}/permissions`,{permissions:d[e.id]||[]},{preserveScroll:!0,onSuccess:()=>{m(t=>({...t,[e.id]:!1})),g(t=>({...t,[e.id]:!1})),s.success(`Saved`,`Permissions updated for "${e.name}"`)},onError:()=>{g(t=>({...t,[e.id]:!1})),s.error(`Error`,`Failed to update permissions.`)}})},C=e=>{e.preventDefault(),y.trim()&&n.post(`/roles`,{name:y.trim()},{onSuccess:()=>{v(!1),b(``),s.success(`Created`,`New role created successfully.`)},onError:()=>s.error(`Error`,`Failed to create role.`)})},w=async e=>{(await s.confirmDelete(e.name)).isConfirmed&&n.delete(`/roles/${e.id}`,{onSuccess:()=>s.success(`Deleted`,`Role "${e.name}" has been deleted.`),onError:()=>s.error(`Error`,`Failed to delete role.`)})};return(0,u.jsxs)(a,{children:[(0,u.jsx)(r,{title:`Roles & Permissions`}),(0,u.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`Access Control`}),(0,u.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Configure hierarchical roles and granular permissions`})]}),(0,u.jsx)(c,{ability:`role.manage`,children:(0,u.jsx)(`button`,{onClick:()=>v(!0),className:`h-10 px-6 rounded-xl bg-[#D4A017] text-white text-sm font-bold tracking-tight hover:bg-[#B88B14] transition-all shadow-lg shadow-[#D4A017]/20`,children:`New Role`})})]}),(0,u.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mb-8`,children:e.map((e,n)=>{let r=(d[e.id]||[]).length,i=e.name===`super-admin`;return(0,u.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 p-6 shadow-sm anim-up`,style:{animationDelay:`${n*.05}s`},children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,u.jsx)(`span`,{className:`px-3 py-1 text-[10px] font-black uppercase tracking-widest rounded-lg border ${i?`bg-[#3D4E4B] text-white border-[#3D4E4B]`:`bg-white text-gray-500 border-gray-100`}`,children:e.name}),!i&&(0,u.jsx)(c,{ability:`role.manage`,children:(0,u.jsx)(`button`,{onClick:()=>w(e),className:`w-8 h-8 rounded-lg flex items-center justify-center text-gray-300 hover:text-red-500 hover:bg-red-50 transition-all`,children:(0,u.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,u.jsx)(`path`,{d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})})})})]}),(0,u.jsxs)(`div`,{className:`text-3xl font-black text-[#3D4E4B] tracking-tighter`,children:[r,(0,u.jsxs)(`span`,{className:`text-sm text-gray-200 font-bold ml-1 tracking-normal`,children:[`/ `,t.length,` perms`]})]}),(0,u.jsxs)(`div`,{className:`text-[10px] font-black text-gray-300 uppercase tracking-widest mt-2`,children:[e.users_count,` Total Active Users`]}),(0,u.jsx)(`div`,{className:`mt-6 h-1.5 bg-gray-50 rounded-full overflow-hidden`,children:(0,u.jsx)(`div`,{className:`h-full bg-[#D4A017] transition-all duration-700`,style:{width:`${r/t.length*100}%`}})}),p[e.id]&&(0,u.jsx)(`button`,{onClick:()=>S(e),disabled:h[e.id],className:`mt-6 w-full h-10 bg-[#3D4E4B] text-white text-xs font-black uppercase tracking-widest rounded-xl anim-fade shadow-lg shadow-[#3D4E4B]/20 disabled:opacity-60`,children:h[e.id]?`Saving…`:`Apply Changes`})]},e.id)})}),(0,u.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden mb-20 anim-up`,style:{animationDelay:`0.2s`},children:[(0,u.jsx)(`div`,{className:`px-8 py-6 border-b border-gray-50 bg-gray-50/20`,children:(0,u.jsx)(`h3`,{className:`text-sm font-black text-[#3D4E4B] uppercase tracking-widest`,children:`Permissions Matrix`})}),(0,u.jsx)(`div`,{className:`overflow-x-auto custom-scrollbar`,children:(0,u.jsxs)(`table`,{className:`w-full text-left border-collapse`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{className:`bg-white`,children:[(0,u.jsx)(`th`,{className:`px-8 py-5 text-[10px] font-black text-gray-400 uppercase tracking-widest w-72 sticky left-0 bg-white z-10 border-b border-gray-50`,children:`Functional Permission`}),e.map(e=>(0,u.jsx)(`th`,{className:`px-8 py-5 text-center text-[10px] font-black text-[#3D4E4B] uppercase tracking-widest border-b border-gray-50 bg-gray-50/30`,children:e.name},e.id))]})}),(0,u.jsx)(`tbody`,{className:`divide-y divide-gray-50`,children:i.map(n=>(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)(`tr`,{className:`bg-gray-50/10`,children:(0,u.jsx)(`td`,{colSpan:e.length+1,className:`px-8 py-3`,children:(0,u.jsxs)(`span`,{className:`text-[10px] font-black text-[#D4A017] uppercase tracking-[0.2em]`,children:[n,` Module`]})})}),t.filter(e=>e.group===n).map(t=>(0,u.jsxs)(`tr`,{className:`hover:bg-gray-50/30 transition-colors`,children:[(0,u.jsxs)(`td`,{className:`px-8 py-4 sticky left-0 bg-white group border-r border-gray-50/50`,children:[(0,u.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight capitalize`,children:t.name.replace(`.`,` `)}),(0,u.jsx)(`div`,{className:`text-[9px] text-gray-300 font-bold uppercase tracking-widest mt-1`,children:t.name})]}),e.map(e=>{let n=(d[e.id]||[]).includes(t.name),r=e.name===`super-admin`;return(0,u.jsx)(`td`,{className:`px-8 py-4 text-center`,children:(0,u.jsx)(`button`,{onClick:()=>!r&&x(e.id,t.name),disabled:r,className:`w-8 h-8 rounded-xl transition-all flex items-center justify-center mx-auto border-2 ${r?`bg-gray-50 text-[#3D4E4B] border-gray-100 opacity-40`:n?`bg-[#3D4E4B] text-white shadow-lg shadow-[#3D4E4B]/20 border-[#3D4E4B]`:`bg-white text-gray-100 hover:text-[#D4A017] border-gray-100 hover:border-[#D4A017]`}`,children:n?(0,u.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:4,children:(0,u.jsx)(`path`,{d:`M5 13l4 4L19 7`})}):(0,u.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-current`})})},`${e.id}-${t.id}`)})]},t.id))]},n))})]})})]}),_&&(0,u.jsx)(o,{children:(0,u.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-[#3D4E4B]/60 backdrop-blur-md anim-fade`,children:(0,u.jsxs)(`div`,{className:`relative bg-white rounded-3xl shadow-2xl w-full max-w-sm overflow-hidden anim-zoom border border-gray-100`,children:[(0,u.jsx)(`div`,{className:`px-8 py-6 border-b border-gray-50`,children:(0,u.jsx)(`h3`,{className:`text-base font-black text-[#3D4E4B] tracking-tight`,children:`Provision New Role`})}),(0,u.jsxs)(`form`,{onSubmit:C,className:`p-8 space-y-8`,children:[(0,u.jsxs)(`div`,{className:`space-y-2`,children:[(0,u.jsx)(`label`,{className:`text-xs font-black text-gray-400 uppercase tracking-widest ml-1`,children:`Internal Role Name`}),(0,u.jsx)(`input`,{type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`e.g. auditor`,className:`input-field`,required:!0,autoFocus:!0})]}),(0,u.jsxs)(`div`,{className:`flex gap-4`,children:[(0,u.jsx)(`button`,{type:`button`,onClick:()=>v(!1),className:`flex-1 h-11 bg-white text-gray-400 text-xs font-black uppercase tracking-widest border border-gray-100 rounded-2xl hover:bg-gray-50 transition-all`,children:`Cancel`}),(0,u.jsx)(`button`,{type:`submit`,className:`flex-1 h-11 bg-[#3D4E4B] text-white text-xs font-black uppercase tracking-widest rounded-2xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20`,children:`Provision`})]})]})]})})})]})}export{d as default}; \ No newline at end of file +import{c as e,d as t,i as n,n as r,t as i}from"./app-C2kGDHB9.js";import{t as a}from"./AuthenticatedLayout-C8h2HS7D.js";import{t as o}from"./Portal-B40Voc8b.js";import{t as s}from"./swal-DeDNECCu.js";import{t as c}from"./Can-bASqMhyx.js";var l=t(e(),1),u=i();function d({roles:e,permissions:t}){let i=[...new Set(t.map(e=>e.group))],[d,f]=(0,l.useState)(()=>{let t={};return e.forEach(e=>{t[e.id]=[...e.permissions]}),t}),[p,m]=(0,l.useState)({}),[h,g]=(0,l.useState)({}),[_,v]=(0,l.useState)(!1),[y,b]=(0,l.useState)(``),x=(e,t)=>{f(n=>{let r=n[e]||[],i=r.includes(t)?r.filter(e=>e!==t):[...r,t];return{...n,[e]:i}}),m(t=>({...t,[e]:!0}))},S=async e=>{g(t=>({...t,[e.id]:!0})),n.patch(`/roles/${e.id}/permissions`,{permissions:d[e.id]||[]},{preserveScroll:!0,onSuccess:()=>{m(t=>({...t,[e.id]:!1})),g(t=>({...t,[e.id]:!1})),s.success(`Saved`,`Permissions updated for "${e.name}"`)},onError:()=>{g(t=>({...t,[e.id]:!1})),s.error(`Error`,`Failed to update permissions.`)}})},C=e=>{e.preventDefault(),y.trim()&&n.post(`/roles`,{name:y.trim()},{onSuccess:()=>{v(!1),b(``),s.success(`Created`,`New role created successfully.`)},onError:()=>s.error(`Error`,`Failed to create role.`)})},w=async e=>{(await s.confirmDelete(e.name)).isConfirmed&&n.delete(`/roles/${e.id}`,{onSuccess:()=>s.success(`Deleted`,`Role "${e.name}" has been deleted.`),onError:()=>s.error(`Error`,`Failed to delete role.`)})};return(0,u.jsxs)(a,{children:[(0,u.jsx)(r,{title:`Roles & Permissions`}),(0,u.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`Access Control`}),(0,u.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Configure hierarchical roles and granular permissions`})]}),(0,u.jsx)(c,{ability:`role.manage`,children:(0,u.jsx)(`button`,{onClick:()=>v(!0),className:`h-10 px-6 rounded-xl bg-[#D4A017] text-white text-sm font-bold tracking-tight hover:bg-[#B88B14] transition-all shadow-lg shadow-[#D4A017]/20`,children:`New Role`})})]}),(0,u.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mb-8`,children:e.map((e,n)=>{let r=(d[e.id]||[]).length,i=e.name===`super-admin`;return(0,u.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 p-6 shadow-sm anim-up`,style:{animationDelay:`${n*.05}s`},children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,u.jsx)(`span`,{className:`px-3 py-1 text-[10px] font-black uppercase tracking-widest rounded-lg border ${i?`bg-[#3D4E4B] text-white border-[#3D4E4B]`:`bg-white text-gray-500 border-gray-100`}`,children:e.name}),!i&&(0,u.jsx)(c,{ability:`role.manage`,children:(0,u.jsx)(`button`,{onClick:()=>w(e),className:`w-8 h-8 rounded-lg flex items-center justify-center text-gray-300 hover:text-red-500 hover:bg-red-50 transition-all`,children:(0,u.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,u.jsx)(`path`,{d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})})})})]}),(0,u.jsxs)(`div`,{className:`text-3xl font-black text-[#3D4E4B] tracking-tighter`,children:[r,(0,u.jsxs)(`span`,{className:`text-sm text-gray-200 font-bold ml-1 tracking-normal`,children:[`/ `,t.length,` perms`]})]}),(0,u.jsxs)(`div`,{className:`text-[10px] font-black text-gray-300 uppercase tracking-widest mt-2`,children:[e.users_count,` Total Active Users`]}),(0,u.jsx)(`div`,{className:`mt-6 h-1.5 bg-gray-50 rounded-full overflow-hidden`,children:(0,u.jsx)(`div`,{className:`h-full bg-[#D4A017] transition-all duration-700`,style:{width:`${r/t.length*100}%`}})}),p[e.id]&&(0,u.jsx)(`button`,{onClick:()=>S(e),disabled:h[e.id],className:`mt-6 w-full h-10 bg-[#3D4E4B] text-white text-xs font-black uppercase tracking-widest rounded-xl anim-fade shadow-lg shadow-[#3D4E4B]/20 disabled:opacity-60`,children:h[e.id]?`Saving…`:`Apply Changes`})]},e.id)})}),(0,u.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden mb-20 anim-up`,style:{animationDelay:`0.2s`},children:[(0,u.jsx)(`div`,{className:`px-8 py-6 border-b border-gray-50 bg-gray-50/20`,children:(0,u.jsx)(`h3`,{className:`text-sm font-black text-[#3D4E4B] uppercase tracking-widest`,children:`Permissions Matrix`})}),(0,u.jsx)(`div`,{className:`overflow-x-auto custom-scrollbar`,children:(0,u.jsxs)(`table`,{className:`w-full text-left border-collapse`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{className:`bg-white`,children:[(0,u.jsx)(`th`,{className:`px-8 py-5 text-[10px] font-black text-gray-400 uppercase tracking-widest w-72 sticky left-0 bg-white z-10 border-b border-gray-50`,children:`Functional Permission`}),e.map(e=>(0,u.jsx)(`th`,{className:`px-8 py-5 text-center text-[10px] font-black text-[#3D4E4B] uppercase tracking-widest border-b border-gray-50 bg-gray-50/30`,children:e.name},e.id))]})}),(0,u.jsx)(`tbody`,{className:`divide-y divide-gray-50`,children:i.map(n=>(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)(`tr`,{className:`bg-gray-50/10`,children:(0,u.jsx)(`td`,{colSpan:e.length+1,className:`px-8 py-3`,children:(0,u.jsxs)(`span`,{className:`text-[10px] font-black text-[#D4A017] uppercase tracking-[0.2em]`,children:[n,` Module`]})})}),t.filter(e=>e.group===n).map(t=>(0,u.jsxs)(`tr`,{className:`hover:bg-gray-50/30 transition-colors`,children:[(0,u.jsxs)(`td`,{className:`px-8 py-4 sticky left-0 bg-white group border-r border-gray-50/50`,children:[(0,u.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight capitalize`,children:t.name.replace(`.`,` `)}),(0,u.jsx)(`div`,{className:`text-[9px] text-gray-300 font-bold uppercase tracking-widest mt-1`,children:t.name})]}),e.map(e=>{let n=(d[e.id]||[]).includes(t.name),r=e.name===`super-admin`;return(0,u.jsx)(`td`,{className:`px-8 py-4 text-center`,children:(0,u.jsx)(`button`,{onClick:()=>!r&&x(e.id,t.name),disabled:r,className:`w-8 h-8 rounded-xl transition-all flex items-center justify-center mx-auto border-2 ${r?`bg-gray-50 text-[#3D4E4B] border-gray-100 opacity-40`:n?`bg-[#3D4E4B] text-white shadow-lg shadow-[#3D4E4B]/20 border-[#3D4E4B]`:`bg-white text-gray-100 hover:text-[#D4A017] border-gray-100 hover:border-[#D4A017]`}`,children:n?(0,u.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:4,children:(0,u.jsx)(`path`,{d:`M5 13l4 4L19 7`})}):(0,u.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-current`})})},`${e.id}-${t.id}`)})]},t.id))]},n))})]})})]}),_&&(0,u.jsx)(o,{children:(0,u.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-[#3D4E4B]/60 backdrop-blur-md anim-fade`,children:(0,u.jsxs)(`div`,{className:`relative bg-white rounded-3xl shadow-2xl w-full max-w-sm overflow-hidden anim-zoom border border-gray-100`,children:[(0,u.jsx)(`div`,{className:`px-8 py-6 border-b border-gray-50`,children:(0,u.jsx)(`h3`,{className:`text-base font-black text-[#3D4E4B] tracking-tight`,children:`Provision New Role`})}),(0,u.jsxs)(`form`,{onSubmit:C,className:`p-8 space-y-8`,children:[(0,u.jsxs)(`div`,{className:`space-y-2`,children:[(0,u.jsx)(`label`,{className:`text-xs font-black text-gray-400 uppercase tracking-widest ml-1`,children:`Internal Role Name`}),(0,u.jsx)(`input`,{type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`e.g. auditor`,className:`input-field`,required:!0,autoFocus:!0})]}),(0,u.jsxs)(`div`,{className:`flex gap-4`,children:[(0,u.jsx)(`button`,{type:`button`,onClick:()=>v(!1),className:`flex-1 h-11 bg-white text-gray-400 text-xs font-black uppercase tracking-widest border border-gray-100 rounded-2xl hover:bg-gray-50 transition-all`,children:`Cancel`}),(0,u.jsx)(`button`,{type:`submit`,className:`flex-1 h-11 bg-[#3D4E4B] text-white text-xs font-black uppercase tracking-widest rounded-2xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20`,children:`Provision`})]})]})]})})})]})}export{d as default}; \ No newline at end of file diff --git a/public/build/assets/Index-nOX76BwE.js b/public/build/assets/Index-ezavejt9.js similarity index 98% rename from public/build/assets/Index-nOX76BwE.js rename to public/build/assets/Index-ezavejt9.js index e1fec07..6f3cb8e 100644 --- a/public/build/assets/Index-nOX76BwE.js +++ b/public/build/assets/Index-ezavejt9.js @@ -1 +1 @@ -import{c as e,d as t,i as n,n as r,o as i,t as a}from"./app-BK5KCPMc.js";import{t as o}from"./AuthenticatedLayout-BjuyW-Hp.js";import{n as s,t as c}from"./lodash-BXsCgLz3.js";import{t as l}from"./Portal-C0c8udmH.js";import{t as u}from"./swal-D8hRpOIh.js";import{t as d}from"./Can-DkptxH2j.js";var f=t(e(),1),p=t(c(),1),m=a();function h({user:e,availableRoles:t,onClose:r}){let i=e?.id?(e.roles||[]).map(e=>e.name||e):[],[a,o]=(0,f.useState)({first_name:e?.first_name||``,last_name:e?.last_name||``,email:e?.email||``,password:``,status:e?.status||`active`,roles:i}),[s,c]=(0,f.useState)({}),[d,p]=(0,f.useState)(!1),h=()=>{let t={};return a.first_name.trim()||(t.first_name=`Required`),a.last_name.trim()||(t.last_name=`Required`),a.email.trim()?/\S+@\S+\.\S+/.test(a.email)||(t.email=`Invalid`):t.email=`Required`,!e?.id&&!a.password&&(t.password=`Required`),c(t),Object.keys(t).length===0},g=e=>{o(t=>({...t,roles:t.roles.includes(e)?t.roles.filter(t=>t!==e):[...t.roles,e]}))};return(0,m.jsx)(l,{children:(0,m.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-[#3D4E4B]/60 backdrop-blur-md anim-fade`,children:(0,m.jsx)(`div`,{className:`bg-white w-full max-w-lg rounded-2xl shadow-2xl overflow-hidden anim-zoom border border-gray-100`,children:(0,m.jsxs)(`div`,{className:`p-8`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h2`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight`,children:e?.id?`Edit user`:`New user`}),(0,m.jsx)(`p`,{className:`text-sm text-gray-400 font-medium mt-1`,children:`Fill in the user details below.`})]}),(0,m.jsx)(`button`,{onClick:r,className:`p-2 hover:bg-gray-50 rounded-xl transition-colors`,children:(0,m.jsx)(`svg`,{className:`w-5 h-5 text-gray-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{d:`M6 18L18 6M6 6l12 12`})})})]}),(0,m.jsxs)(`form`,{onSubmit:t=>{if(t.preventDefault(),!h())return;p(!0);let i={...a};e?.id?n.patch(`/users/${e.id}`,i,{preserveScroll:!0,onSuccess:()=>{r(),u.success(`Updated`,`User updated successfully.`)},onError:e=>{c(e),p(!1)}}):n.post(`/users`,i,{preserveScroll:!0,onSuccess:()=>{r(),u.success(`Created`,`New user created successfully.`)},onError:e=>{c(e),p(!1)}})},className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{className:`text-xs font-semibold text-gray-500 tracking-tight px-1`,children:`First Name`}),(0,m.jsx)(`input`,{type:`text`,value:a.first_name,onChange:e=>o({...a,first_name:e.target.value}),className:`input-field${s.first_name?` is-error`:``}`,placeholder:`John`,required:!0}),s.first_name&&(0,m.jsx)(`p`,{className:`text-[10px] text-red-500 font-bold ml-1`,children:s.first_name})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{className:`text-xs font-semibold text-gray-500 tracking-tight px-1`,children:`Last Name`}),(0,m.jsx)(`input`,{type:`text`,value:a.last_name,onChange:e=>o({...a,last_name:e.target.value}),className:`input-field${s.last_name?` is-error`:``}`,placeholder:`Doe`,required:!0}),s.last_name&&(0,m.jsx)(`p`,{className:`text-[10px] text-red-500 font-bold ml-1`,children:s.last_name})]})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{className:`text-xs font-semibold text-gray-500 tracking-tight px-1`,children:`Email Address`}),(0,m.jsx)(`input`,{type:`email`,value:a.email,onChange:e=>o({...a,email:e.target.value}),className:`input-field${s.email?` is-error`:``}`,placeholder:`john.doe@example.com`,required:!0}),s.email&&(0,m.jsx)(`p`,{className:`text-[10px] text-red-500 font-bold ml-1`,children:s.email})]}),!e?.id&&(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{className:`text-xs font-semibold text-gray-500 tracking-tight px-1`,children:`Initial Password`}),(0,m.jsx)(`input`,{type:`password`,value:a.password,onChange:e=>o({...a,password:e.target.value}),className:`input-field`,placeholder:`••••••••`,required:!0})]}),(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsx)(`label`,{className:`text-xs font-semibold text-gray-500 tracking-tight px-1`,children:`Assigned Roles`}),(0,m.jsx)(`div`,{className:`flex flex-wrap gap-2 p-1`,children:t.map(e=>(0,m.jsx)(`button`,{type:`button`,onClick:()=>g(e),className:`px-4 py-2 rounded-xl text-xs font-bold tracking-tight transition-all border ${a.roles.includes(e)?`bg-[#3D4E4B] text-white border-[#3D4E4B] shadow-md shadow-[#3D4E4B]/20`:`bg-white text-gray-400 border-gray-100 hover:border-gray-200`}`,children:e},e))})]}),(0,m.jsxs)(`div`,{className:`pt-4 flex gap-3`,children:[(0,m.jsx)(`button`,{type:`button`,onClick:r,className:`flex-1 h-9 bg-white border border-gray-200 rounded-xl text-sm font-bold text-gray-400 hover:bg-gray-50 transition-all`,children:`Cancel`}),(0,m.jsx)(`button`,{type:`submit`,disabled:d,className:`flex-1 h-9 bg-[#3D4E4B] text-white rounded-xl text-sm font-bold hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20 flex items-center justify-center gap-2 disabled:opacity-60`,children:d?(0,m.jsx)(`div`,{className:`w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin`}):e?.id?`Save changes`:`Create user`})]})]})]})})})})}function g({users:e,availableRoles:t,filters:a}){let{permissions:c}=i().props.auth,[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(null),[b,x]=(0,f.useState)(!1),[S,C]=(0,f.useState)([]),[w,T]=(0,f.useState)({search:a.search||``,status:a.status||``,role:a.role||``,trashed:a.trashed||``,per_page:a.per_page||15,sort_field:a.sort_field||`created_at`,sort_direction:a.sort_direction||`desc`});f.useEffect(()=>{T({search:a.search||``,status:a.status||``,role:a.role||``,sort_field:a.sort_field||`created_at`,sort_direction:a.sort_direction||`desc`,per_page:a.per_page||15,trashed:a.trashed||``})},[a]);let E=(0,f.useCallback)(p.default.debounce(e=>{x(!0),n.get(`/users`,e,{preserveState:!0,preserveScroll:!0,replace:!0,only:[`users`,`filters`],onFinish:()=>x(!1)})},400),[]),D=(e,t)=>{let n={...w,[e]:t};T(n);let r={...n,page:1};C([]),E(r)},O=e=>{let t={archive:{url:route(`users.bulk-archive`),text:`Archive`},restore:{url:route(`users.bulk-restore`),text:`Restore`},delete:{url:route(`users.bulk-force-delete`),text:`Delete`}}[e];u.confirm(`${t.text} Selected?`,`Are you sure you want to ${e} ${S.length} users?`,t.text).then(r=>{r.isConfirmed&&n.post(t.url,{ids:S},{preserveScroll:!0,onSuccess:()=>{C([]),u.success(`Success`,`${S.length} users ${e}d successfully.`)}})})},k=[{header:`User`,accessorKey:`first_name`,sortable:!0,cell:e=>(0,m.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,m.jsx)(`div`,{className:`w-10 h-10 rounded-xl flex items-center justify-center text-white text-sm font-bold overflow-hidden shrink-0 ${e.deleted_at?`bg-gray-400`:`bg-[#3D4E4B]`}`,children:e.avatar_url?(0,m.jsx)(`img`,{src:e.avatar_url,className:`w-full h-full object-cover`}):`${e.first_name?.charAt(0)}${e.last_name?.charAt(0)}`}),(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:`text-sm font-bold tracking-tight ${e.deleted_at?`text-gray-400 line-through`:`text-[#3D4E4B]`}`,children:[e.first_name,` `,e.last_name]}),(0,m.jsx)(`div`,{className:`text-xs text-gray-400 font-semibold mt-0.5`,children:e.email})]})]})},{header:`Roles`,accessorKey:`roles`,cell:e=>(0,m.jsx)(`div`,{className:`flex gap-1.5`,children:e.roles?.length?e.roles.map(t=>(0,m.jsx)(`span`,{className:`px-2 py-0.5 text-sm font-bold tracking-tight bg-white border border-gray-100 rounded-md ${e.deleted_at?`text-gray-300`:`text-gray-500`}`,children:t.name||t},t.name||t)):(0,m.jsx)(`span`,{className:`text-sm font-semibold text-gray-300 italic tracking-tight`,children:`Unassigned`})})},{header:`Status`,accessorKey:`status`,sortable:!0,cell:e=>(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold tracking-tight border border-gray-100 ${e.deleted_at?`text-gray-300 bg-gray-50/50`:e.status===`active`?`text-green-600 bg-white border-green-100`:`text-gray-400 bg-white`}`,children:[(0,m.jsx)(`span`,{className:`w-1 h-1 rounded-full ${e.deleted_at?`bg-gray-300`:e.status===`active`?`bg-green-500`:`bg-gray-300`}`}),e.deleted_at?`Archived`:e.status]})},{header:w.trashed===`only`?`Archived at`:`Joined`,accessorKey:w.trashed===`only`?`deleted_at`:`created_at`,sortable:!0,cell:e=>(0,m.jsx)(`span`,{className:`text-sm font-semibold text-gray-400 tracking-tight`,children:new Date(e[e.deleted_at?`deleted_at`:`created_at`]).toLocaleDateString(`en-US`,{day:`2-digit`,month:`short`,year:`numeric`})})}],A=w.trashed===`only`;return(0,m.jsxs)(o,{children:[(0,m.jsx)(r,{title:`Users`}),(0,m.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`User Management`}),(0,m.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Maintain and configure the global user registry`})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,m.jsxs)(`div`,{className:`relative w-[240px]`,children:[(0,m.jsx)(`svg`,{className:`absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})}),(0,m.jsx)(`input`,{type:`text`,placeholder:`Search users…`,value:w.search,onChange:e=>D(`search`,e.target.value),className:`w-full h-11 pl-10 pr-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 placeholder-gray-400 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm`})]}),!A&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`select`,{value:w.status,onChange:e=>D(`status`,e.target.value),className:`h-11 px-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm cursor-pointer min-w-[140px]`,children:[(0,m.jsx)(`option`,{value:``,children:`All Status`}),(0,m.jsx)(`option`,{value:`active`,children:`Active`}),(0,m.jsx)(`option`,{value:`inactive`,children:`Inactive`})]}),(0,m.jsxs)(`select`,{value:w.role,onChange:e=>D(`role`,e.target.value),className:`h-11 px-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm cursor-pointer min-w-[140px]`,children:[(0,m.jsx)(`option`,{value:``,children:`All Roles`}),t.map(e=>(0,m.jsx)(`option`,{value:e,children:e},e))]})]}),!A&&(0,m.jsx)(`div`,{className:`flex items-center gap-2 border-l border-gray-100 pl-3`,children:(0,m.jsxs)(`a`,{href:route(`users.export`),className:`flex items-center gap-2 h-11 px-4 rounded-2xl bg-white border border-gray-100 text-[#3D4E4B] text-sm font-bold hover:bg-gray-50 transition-all shadow-sm`,children:[(0,m.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4`})}),`Export`]})}),!A&&(0,m.jsx)(d,{ability:`user.create`,children:(0,m.jsx)(`button`,{onClick:()=>{y(null),_(!0)},className:`flex items-center gap-2 h-11 px-6 rounded-2xl bg-[#D4A017] text-white text-sm font-bold hover:bg-[#B88B14] transition-all shadow-lg shadow-[#D4A017]/20 hover:-translate-y-0.5 active:translate-y-0 ml-1`,children:`New user`})})]})]}),(0,m.jsx)(`div`,{className:`flex items-center justify-between mb-5 anim-down`,style:{animationDelay:`0.05s`},children:(0,m.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-gray-100 w-full`,children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>D(`trashed`,``),className:`relative pb-3 px-1 mr-4 text-sm font-bold tracking-tight transition-colors ${A?`text-gray-400 hover:text-[#3D4E4B]`:`text-[#3D4E4B]`}`,children:[`Active users`,!A&&(0,m.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,m.jsxs)(`button`,{type:`button`,onClick:()=>D(`trashed`,`only`),className:`relative pb-3 px-1 text-sm font-bold tracking-tight transition-colors ${A?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Archived`,A&&(0,m.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-red-400 rounded-t-full`})]}),A&&(0,m.jsxs)(`span`,{className:`ml-auto mb-2 flex items-center gap-1.5 text-xs font-semibold text-amber-600 bg-amber-50 border border-amber-100 px-2.5 py-1 rounded-lg`,children:[(0,m.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z`})}),`Archived users cannot log in`]})]})}),(0,m.jsx)(`div`,{className:`anim-up relative`,style:{animationDelay:`0.08s`},children:(0,m.jsx)(s,{data:e.data,columns:k,meta:e.meta,links:e.links,filters:w,onSort:(e,t)=>{D(`sort_field`,e),D(`sort_direction`,t)},isLoading:b,selectedIds:S,onSelectionChange:C,canEdit:!A&&c.includes(`user.edit`),emptyAction:!A&&c.includes(`user.create`)?(0,m.jsx)(`button`,{onClick:()=>{y(null),_(!0)},className:`h-9 px-5 rounded-xl bg-[#D4A017] text-white text-xs font-bold hover:bg-[#B88B14] transition-all shadow-md shadow-[#D4A017]/20`,children:`Add first user`}):void 0,onEdit:e=>{y(e),_(!0)},onDelete:A?void 0:e=>{u.confirm(`Archive user?`,`Move ${e.first_name} ${e.last_name} to the archived list?`,`Archive`).then(t=>{t.isConfirmed&&n.delete(`/users/${e.id}`,{preserveScroll:!0,onSuccess:()=>u.success(`Archived`,`User archived successfully.`)})})},onRestore:A?e=>{u.confirm(`Restore user?`,`Restore ${e.first_name} ${e.last_name} to active status?`,`Restore`).then(t=>{t.isConfirmed&&n.post(`/users/${e.id}/restore`,{},{preserveScroll:!0,onSuccess:()=>u.success(`Restored`,`User restored successfully.`)})})}:void 0,onPermanentDelete:A?e=>{u.confirmDelete(`${e.first_name} ${e.last_name}`).then(t=>{t.isConfirmed&&n.delete(`/users/${e.id}/force-delete`,{preserveScroll:!0,onSuccess:()=>u.success(`Deleted`,`User permanently deleted.`)})})}:void 0})}),g&&(0,m.jsx)(h,{user:v,availableRoles:t,onClose:()=>{_(!1),y(null)}}),(0,m.jsx)(l,{children:(0,m.jsx)(`div`,{className:`fixed bottom-8 left-1/2 -translate-x-1/2 z-40 transition-all duration-500 ${S.length>0?`translate-y-0 opacity-100`:`translate-y-20 opacity-0 pointer-events-none`}`,children:(0,m.jsxs)(`div`,{className:`bg-[#3D4E4B] rounded-2xl shadow-2xl px-6 py-4 flex items-center gap-6 border border-white/10 backdrop-blur-xl`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-3 pr-6 border-r border-white/10`,children:[(0,m.jsx)(`span`,{className:`w-8 h-8 rounded-lg bg-white/10 flex items-center justify-center text-white text-xs font-bold`,children:S.length}),(0,m.jsx)(`span`,{className:`text-white text-sm font-bold tracking-tight`,children:`Items selected`})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[A?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`button`,{onClick:()=>O(`restore`),className:`h-10 px-5 rounded-xl bg-green-500 text-white text-xs font-bold hover:bg-green-600 transition-all flex items-center gap-2`,children:[(0,m.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{d:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`})}),`Bulk Restore`]}),(0,m.jsxs)(`button`,{onClick:()=>O(`delete`),className:`h-10 px-5 rounded-xl bg-red-500 text-white text-xs font-bold hover:bg-red-600 transition-all flex items-center gap-2`,children:[(0,m.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})}),`Bulk Delete`]})]}):(0,m.jsxs)(`button`,{onClick:()=>O(`archive`),className:`h-10 px-5 rounded-xl bg-white/10 text-white text-xs font-bold hover:bg-white/20 transition-all flex items-center gap-2`,children:[(0,m.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})}),`Bulk Archive`]}),(0,m.jsx)(`button`,{onClick:()=>C([]),className:`h-10 px-4 text-white/40 text-xs font-bold hover:text-white transition-colors`,children:`Cancel`})]})]})})})]})}export{g as default}; \ No newline at end of file +import{c as e,d as t,i as n,n as r,o as i,t as a}from"./app-C2kGDHB9.js";import{t as o}from"./AuthenticatedLayout-C8h2HS7D.js";import{n as s,t as c}from"./lodash-BdNO5KR4.js";import{t as l}from"./Portal-B40Voc8b.js";import{t as u}from"./swal-DeDNECCu.js";import{t as d}from"./Can-bASqMhyx.js";var f=t(e(),1),p=t(c(),1),m=a();function h({user:e,availableRoles:t,onClose:r}){let i=e?.id?(e.roles||[]).map(e=>e.name||e):[],[a,o]=(0,f.useState)({first_name:e?.first_name||``,last_name:e?.last_name||``,email:e?.email||``,password:``,status:e?.status||`active`,roles:i}),[s,c]=(0,f.useState)({}),[d,p]=(0,f.useState)(!1),h=()=>{let t={};return a.first_name.trim()||(t.first_name=`Required`),a.last_name.trim()||(t.last_name=`Required`),a.email.trim()?/\S+@\S+\.\S+/.test(a.email)||(t.email=`Invalid`):t.email=`Required`,!e?.id&&!a.password&&(t.password=`Required`),c(t),Object.keys(t).length===0},g=e=>{o(t=>({...t,roles:t.roles.includes(e)?t.roles.filter(t=>t!==e):[...t.roles,e]}))};return(0,m.jsx)(l,{children:(0,m.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-[#3D4E4B]/60 backdrop-blur-md anim-fade`,children:(0,m.jsx)(`div`,{className:`bg-white w-full max-w-lg rounded-2xl shadow-2xl overflow-hidden anim-zoom border border-gray-100`,children:(0,m.jsxs)(`div`,{className:`p-8`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h2`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight`,children:e?.id?`Edit user`:`New user`}),(0,m.jsx)(`p`,{className:`text-sm text-gray-400 font-medium mt-1`,children:`Fill in the user details below.`})]}),(0,m.jsx)(`button`,{onClick:r,className:`p-2 hover:bg-gray-50 rounded-xl transition-colors`,children:(0,m.jsx)(`svg`,{className:`w-5 h-5 text-gray-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{d:`M6 18L18 6M6 6l12 12`})})})]}),(0,m.jsxs)(`form`,{onSubmit:t=>{if(t.preventDefault(),!h())return;p(!0);let i={...a};e?.id?n.patch(`/users/${e.id}`,i,{preserveScroll:!0,onSuccess:()=>{r(),u.success(`Updated`,`User updated successfully.`)},onError:e=>{c(e),p(!1)}}):n.post(`/users`,i,{preserveScroll:!0,onSuccess:()=>{r(),u.success(`Created`,`New user created successfully.`)},onError:e=>{c(e),p(!1)}})},className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{className:`text-xs font-semibold text-gray-500 tracking-tight px-1`,children:`First Name`}),(0,m.jsx)(`input`,{type:`text`,value:a.first_name,onChange:e=>o({...a,first_name:e.target.value}),className:`input-field${s.first_name?` is-error`:``}`,placeholder:`John`,required:!0}),s.first_name&&(0,m.jsx)(`p`,{className:`text-[10px] text-red-500 font-bold ml-1`,children:s.first_name})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{className:`text-xs font-semibold text-gray-500 tracking-tight px-1`,children:`Last Name`}),(0,m.jsx)(`input`,{type:`text`,value:a.last_name,onChange:e=>o({...a,last_name:e.target.value}),className:`input-field${s.last_name?` is-error`:``}`,placeholder:`Doe`,required:!0}),s.last_name&&(0,m.jsx)(`p`,{className:`text-[10px] text-red-500 font-bold ml-1`,children:s.last_name})]})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{className:`text-xs font-semibold text-gray-500 tracking-tight px-1`,children:`Email Address`}),(0,m.jsx)(`input`,{type:`email`,value:a.email,onChange:e=>o({...a,email:e.target.value}),className:`input-field${s.email?` is-error`:``}`,placeholder:`john.doe@example.com`,required:!0}),s.email&&(0,m.jsx)(`p`,{className:`text-[10px] text-red-500 font-bold ml-1`,children:s.email})]}),!e?.id&&(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{className:`text-xs font-semibold text-gray-500 tracking-tight px-1`,children:`Initial Password`}),(0,m.jsx)(`input`,{type:`password`,value:a.password,onChange:e=>o({...a,password:e.target.value}),className:`input-field`,placeholder:`••••••••`,required:!0})]}),(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsx)(`label`,{className:`text-xs font-semibold text-gray-500 tracking-tight px-1`,children:`Assigned Roles`}),(0,m.jsx)(`div`,{className:`flex flex-wrap gap-2 p-1`,children:t.map(e=>(0,m.jsx)(`button`,{type:`button`,onClick:()=>g(e),className:`px-4 py-2 rounded-xl text-xs font-bold tracking-tight transition-all border ${a.roles.includes(e)?`bg-[#3D4E4B] text-white border-[#3D4E4B] shadow-md shadow-[#3D4E4B]/20`:`bg-white text-gray-400 border-gray-100 hover:border-gray-200`}`,children:e},e))})]}),(0,m.jsxs)(`div`,{className:`pt-4 flex gap-3`,children:[(0,m.jsx)(`button`,{type:`button`,onClick:r,className:`flex-1 h-9 bg-white border border-gray-200 rounded-xl text-sm font-bold text-gray-400 hover:bg-gray-50 transition-all`,children:`Cancel`}),(0,m.jsx)(`button`,{type:`submit`,disabled:d,className:`flex-1 h-9 bg-[#3D4E4B] text-white rounded-xl text-sm font-bold hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20 flex items-center justify-center gap-2 disabled:opacity-60`,children:d?(0,m.jsx)(`div`,{className:`w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin`}):e?.id?`Save changes`:`Create user`})]})]})]})})})})}function g({users:e,availableRoles:t,filters:a}){let{permissions:c}=i().props.auth,[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(null),[b,x]=(0,f.useState)(!1),[S,C]=(0,f.useState)([]),[w,T]=(0,f.useState)({search:a.search||``,status:a.status||``,role:a.role||``,trashed:a.trashed||``,per_page:a.per_page||15,sort_field:a.sort_field||`created_at`,sort_direction:a.sort_direction||`desc`});f.useEffect(()=>{T({search:a.search||``,status:a.status||``,role:a.role||``,sort_field:a.sort_field||`created_at`,sort_direction:a.sort_direction||`desc`,per_page:a.per_page||15,trashed:a.trashed||``})},[a]);let E=(0,f.useCallback)(p.default.debounce(e=>{x(!0),n.get(`/users`,e,{preserveState:!0,preserveScroll:!0,replace:!0,only:[`users`,`filters`],onFinish:()=>x(!1)})},400),[]),D=(e,t)=>{let n={...w,[e]:t};T(n);let r={...n,page:1};C([]),E(r)},O=e=>{let t={archive:{url:route(`users.bulk-archive`),text:`Archive`},restore:{url:route(`users.bulk-restore`),text:`Restore`},delete:{url:route(`users.bulk-force-delete`),text:`Delete`}}[e];u.confirm(`${t.text} Selected?`,`Are you sure you want to ${e} ${S.length} users?`,t.text).then(r=>{r.isConfirmed&&n.post(t.url,{ids:S},{preserveScroll:!0,onSuccess:()=>{C([]),u.success(`Success`,`${S.length} users ${e}d successfully.`)}})})},k=[{header:`User`,accessorKey:`first_name`,sortable:!0,cell:e=>(0,m.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,m.jsx)(`div`,{className:`w-10 h-10 rounded-xl flex items-center justify-center text-white text-sm font-bold overflow-hidden shrink-0 ${e.deleted_at?`bg-gray-400`:`bg-[#3D4E4B]`}`,children:e.avatar_url?(0,m.jsx)(`img`,{src:e.avatar_url,className:`w-full h-full object-cover`}):`${e.first_name?.charAt(0)}${e.last_name?.charAt(0)}`}),(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:`text-sm font-bold tracking-tight ${e.deleted_at?`text-gray-400 line-through`:`text-[#3D4E4B]`}`,children:[e.first_name,` `,e.last_name]}),(0,m.jsx)(`div`,{className:`text-xs text-gray-400 font-semibold mt-0.5`,children:e.email})]})]})},{header:`Roles`,accessorKey:`roles`,cell:e=>(0,m.jsx)(`div`,{className:`flex gap-1.5`,children:e.roles?.length?e.roles.map(t=>(0,m.jsx)(`span`,{className:`px-2 py-0.5 text-sm font-bold tracking-tight bg-white border border-gray-100 rounded-md ${e.deleted_at?`text-gray-300`:`text-gray-500`}`,children:t.name||t},t.name||t)):(0,m.jsx)(`span`,{className:`text-sm font-semibold text-gray-300 italic tracking-tight`,children:`Unassigned`})})},{header:`Status`,accessorKey:`status`,sortable:!0,cell:e=>(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold tracking-tight border border-gray-100 ${e.deleted_at?`text-gray-300 bg-gray-50/50`:e.status===`active`?`text-green-600 bg-white border-green-100`:`text-gray-400 bg-white`}`,children:[(0,m.jsx)(`span`,{className:`w-1 h-1 rounded-full ${e.deleted_at?`bg-gray-300`:e.status===`active`?`bg-green-500`:`bg-gray-300`}`}),e.deleted_at?`Archived`:e.status]})},{header:w.trashed===`only`?`Archived at`:`Joined`,accessorKey:w.trashed===`only`?`deleted_at`:`created_at`,sortable:!0,cell:e=>(0,m.jsx)(`span`,{className:`text-sm font-semibold text-gray-400 tracking-tight`,children:new Date(e[e.deleted_at?`deleted_at`:`created_at`]).toLocaleDateString(`en-US`,{day:`2-digit`,month:`short`,year:`numeric`})})}],A=w.trashed===`only`;return(0,m.jsxs)(o,{children:[(0,m.jsx)(r,{title:`Users`}),(0,m.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`User Management`}),(0,m.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Maintain and configure the global user registry`})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,m.jsxs)(`div`,{className:`relative w-[240px]`,children:[(0,m.jsx)(`svg`,{className:`absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})}),(0,m.jsx)(`input`,{type:`text`,placeholder:`Search users…`,value:w.search,onChange:e=>D(`search`,e.target.value),className:`w-full h-11 pl-10 pr-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 placeholder-gray-400 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm`})]}),!A&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`select`,{value:w.status,onChange:e=>D(`status`,e.target.value),className:`h-11 px-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm cursor-pointer min-w-[140px]`,children:[(0,m.jsx)(`option`,{value:``,children:`All Status`}),(0,m.jsx)(`option`,{value:`active`,children:`Active`}),(0,m.jsx)(`option`,{value:`inactive`,children:`Inactive`})]}),(0,m.jsxs)(`select`,{value:w.role,onChange:e=>D(`role`,e.target.value),className:`h-11 px-4 rounded-2xl border border-gray-100 bg-white text-sm font-semibold text-gray-700 focus:outline-none focus:border-[#D4A017] focus:ring-4 focus:ring-[#D4A017]/5 transition-all shadow-sm cursor-pointer min-w-[140px]`,children:[(0,m.jsx)(`option`,{value:``,children:`All Roles`}),t.map(e=>(0,m.jsx)(`option`,{value:e,children:e},e))]})]}),!A&&(0,m.jsx)(`div`,{className:`flex items-center gap-2 border-l border-gray-100 pl-3`,children:(0,m.jsxs)(`a`,{href:route(`users.export`),className:`flex items-center gap-2 h-11 px-4 rounded-2xl bg-white border border-gray-100 text-[#3D4E4B] text-sm font-bold hover:bg-gray-50 transition-all shadow-sm`,children:[(0,m.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4`})}),`Export`]})}),!A&&(0,m.jsx)(d,{ability:`user.create`,children:(0,m.jsx)(`button`,{onClick:()=>{y(null),_(!0)},className:`flex items-center gap-2 h-11 px-6 rounded-2xl bg-[#D4A017] text-white text-sm font-bold hover:bg-[#B88B14] transition-all shadow-lg shadow-[#D4A017]/20 hover:-translate-y-0.5 active:translate-y-0 ml-1`,children:`New user`})})]})]}),(0,m.jsx)(`div`,{className:`flex items-center justify-between mb-5 anim-down`,style:{animationDelay:`0.05s`},children:(0,m.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-gray-100 w-full`,children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>D(`trashed`,``),className:`relative pb-3 px-1 mr-4 text-sm font-bold tracking-tight transition-colors ${A?`text-gray-400 hover:text-[#3D4E4B]`:`text-[#3D4E4B]`}`,children:[`Active users`,!A&&(0,m.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,m.jsxs)(`button`,{type:`button`,onClick:()=>D(`trashed`,`only`),className:`relative pb-3 px-1 text-sm font-bold tracking-tight transition-colors ${A?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Archived`,A&&(0,m.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-red-400 rounded-t-full`})]}),A&&(0,m.jsxs)(`span`,{className:`ml-auto mb-2 flex items-center gap-1.5 text-xs font-semibold text-amber-600 bg-amber-50 border border-amber-100 px-2.5 py-1 rounded-lg`,children:[(0,m.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z`})}),`Archived users cannot log in`]})]})}),(0,m.jsx)(`div`,{className:`anim-up relative`,style:{animationDelay:`0.08s`},children:(0,m.jsx)(s,{data:e.data,columns:k,meta:e.meta,links:e.links,filters:w,onSort:(e,t)=>{D(`sort_field`,e),D(`sort_direction`,t)},isLoading:b,selectedIds:S,onSelectionChange:C,canEdit:!A&&c.includes(`user.edit`),emptyAction:!A&&c.includes(`user.create`)?(0,m.jsx)(`button`,{onClick:()=>{y(null),_(!0)},className:`h-9 px-5 rounded-xl bg-[#D4A017] text-white text-xs font-bold hover:bg-[#B88B14] transition-all shadow-md shadow-[#D4A017]/20`,children:`Add first user`}):void 0,onEdit:e=>{y(e),_(!0)},onDelete:A?void 0:e=>{u.confirm(`Archive user?`,`Move ${e.first_name} ${e.last_name} to the archived list?`,`Archive`).then(t=>{t.isConfirmed&&n.delete(`/users/${e.id}`,{preserveScroll:!0,onSuccess:()=>u.success(`Archived`,`User archived successfully.`)})})},onRestore:A?e=>{u.confirm(`Restore user?`,`Restore ${e.first_name} ${e.last_name} to active status?`,`Restore`).then(t=>{t.isConfirmed&&n.post(`/users/${e.id}/restore`,{},{preserveScroll:!0,onSuccess:()=>u.success(`Restored`,`User restored successfully.`)})})}:void 0,onPermanentDelete:A?e=>{u.confirmDelete(`${e.first_name} ${e.last_name}`).then(t=>{t.isConfirmed&&n.delete(`/users/${e.id}/force-delete`,{preserveScroll:!0,onSuccess:()=>u.success(`Deleted`,`User permanently deleted.`)})})}:void 0})}),g&&(0,m.jsx)(h,{user:v,availableRoles:t,onClose:()=>{_(!1),y(null)}}),(0,m.jsx)(l,{children:(0,m.jsx)(`div`,{className:`fixed bottom-8 left-1/2 -translate-x-1/2 z-40 transition-all duration-500 ${S.length>0?`translate-y-0 opacity-100`:`translate-y-20 opacity-0 pointer-events-none`}`,children:(0,m.jsxs)(`div`,{className:`bg-[#3D4E4B] rounded-2xl shadow-2xl px-6 py-4 flex items-center gap-6 border border-white/10 backdrop-blur-xl`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-3 pr-6 border-r border-white/10`,children:[(0,m.jsx)(`span`,{className:`w-8 h-8 rounded-lg bg-white/10 flex items-center justify-center text-white text-xs font-bold`,children:S.length}),(0,m.jsx)(`span`,{className:`text-white text-sm font-bold tracking-tight`,children:`Items selected`})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[A?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`button`,{onClick:()=>O(`restore`),className:`h-10 px-5 rounded-xl bg-green-500 text-white text-xs font-bold hover:bg-green-600 transition-all flex items-center gap-2`,children:[(0,m.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{d:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`})}),`Bulk Restore`]}),(0,m.jsxs)(`button`,{onClick:()=>O(`delete`),className:`h-10 px-5 rounded-xl bg-red-500 text-white text-xs font-bold hover:bg-red-600 transition-all flex items-center gap-2`,children:[(0,m.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})}),`Bulk Delete`]})]}):(0,m.jsxs)(`button`,{onClick:()=>O(`archive`),className:`h-10 px-5 rounded-xl bg-white/10 text-white text-xs font-bold hover:bg-white/20 transition-all flex items-center gap-2`,children:[(0,m.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,m.jsx)(`path`,{d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})}),`Bulk Archive`]}),(0,m.jsx)(`button`,{onClick:()=>C([]),className:`h-10 px-4 text-white/40 text-xs font-bold hover:text-white transition-colors`,children:`Cancel`})]})]})})})]})}export{g as default}; \ No newline at end of file diff --git a/public/build/assets/Index-db0jqw8f.js b/public/build/assets/Index-v8jEWebY.js similarity index 98% rename from public/build/assets/Index-db0jqw8f.js rename to public/build/assets/Index-v8jEWebY.js index a782948..a87c188 100644 --- a/public/build/assets/Index-db0jqw8f.js +++ b/public/build/assets/Index-v8jEWebY.js @@ -1 +1 @@ -import{a as e,c as t,d as n,i as r,n as i,o as a,t as o}from"./app-BK5KCPMc.js";import{t as s}from"./AuthenticatedLayout-BjuyW-Hp.js";import{n as c,t as l}from"./swal-D8hRpOIh.js";import{n as u,r as d,t as f}from"./filepond-plugin-file-validate-type-tybTRj_0.js";var p=n(t(),1),m=n(c(),1),h=d(),g=n(u(),1),_=n(f(),1),v=o();(0,h.registerPlugin)(g.default,_.default);function y({title:e,description:t,children:n,delay:r=`0s`,variant:i=`default`}){let a=i===`danger`;return(0,v.jsxs)(`div`,{className:`bg-white rounded-2xl border ${a?`border-red-200 shadow-none`:`border-gray-100 shadow-sm`} overflow-hidden h-full flex flex-col anim-up`,style:{animationDelay:r},children:[(0,v.jsxs)(`div`,{className:`px-6 py-4 border-b ${a?`border-red-100 bg-red-50`:`border-gray-50 bg-gray-50/30`}`,children:[(0,v.jsx)(`h2`,{className:`text-sm font-bold tracking-tight ${a?`text-red-600`:`text-[#3D4E4B]`}`,children:e}),(0,v.jsx)(`p`,{className:`text-xs font-semibold tracking-tight mt-1 ${a?`text-red-400`:`text-gray-400`}`,children:t})]}),(0,v.jsx)(`div`,{className:`p-8 flex-1`,children:n})]})}function b({label:e,id:t,type:n=`text`,value:r,onChange:i,error:a,placeholder:o,required:s=!1}){return(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsxs)(`label`,{htmlFor:t,className:`block text-xs font-semibold text-gray-500 tracking-tight ml-1`,children:[e,` `,s&&(0,v.jsx)(`span`,{className:`text-red-500`,children:`*`})]}),(0,v.jsx)(`input`,{id:t,type:n,value:r,onChange:i,placeholder:o,className:`input-field${a?` is-error`:``}`}),a&&(0,v.jsx)(`p`,{className:`text-xs text-red-500 font-semibold ml-1 mt-1`,children:a})]})}var x=[`profile`,`security`,`2fa`,`danger`];function S(){let e=window.location.hash.replace(`#`,``);return x.includes(e)?e:`profile`}function C({twoFactor:t,twoFactorSettings:n}){let{user:o}=a().props.auth,[c,u]=(0,p.useState)(()=>{let e=S();return e===`2fa`&&!(n.totp_allowed||n.email_allowed)?`profile`:e});(0,p.useEffect)(()=>{let e=()=>{let e=S();e===`2fa`&&!(n.totp_allowed||n.email_allowed)?u(`profile`):u(e)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[n]);let d=e=>{window.location.hash=e,u(e)},{data:f,setData:g,post:_,processing:x,errors:C}=e({first_name:o.first_name||``,last_name:o.last_name||``,email:o.email||``,phone:o.phone||``,bio:o.bio||``,avatar_file:null,_method:`PATCH`}),[w,T]=(0,p.useState)([]),E=e=>{e.preventDefault(),_(route(`profile.update`),{preserveScroll:!0,onSuccess:()=>l.success(`Saved`,`Profile updated successfully.`)})},{data:D,setData:O,put:k,processing:A,errors:j,reset:M}=e({current_password:``,password:``,password_confirmation:``}),N=e=>{e.preventDefault(),k(route(`password.update`),{preserveScroll:!0,onSuccess:()=>{M(),l.success(`Saved`,`Password updated successfully.`)}})},P=async()=>{if((await l.confirm(`Delete account?`,`This action is irreversible.`,`Delete Permanently`)).isConfirmed){let{value:e}=await m.default.fire({title:`Confirm Password`,input:`password`,inputPlaceholder:`Enter your current password`,showCancelButton:!0,confirmButtonText:`Delete`,confirmButtonColor:`#dc2626`});e&&r.delete(route(`profile.destroy`),{data:{password:e},preserveScroll:!0,onSuccess:()=>l.success(`Deleted`,`Account removed.`),onError:e=>l.error(`Error`,e.password||`Incorrect password.`)})}},F=`${o.first_name?.charAt(0)||``}${o.last_name?.charAt(0)||``}`.toUpperCase(),[I,L]=(0,p.useState)(!1),[R,z]=(0,p.useState)(!1),B=e({code:``}),V=()=>{navigator.clipboard.writeText(t.secret||``),L(!0),setTimeout(()=>L(!1),2e3)},H=async e=>{e.preventDefault(),!(t.email_enabled&&!(await l.confirm(`Deactivate Email 2FA?`,`Enabling Google Authenticator will automatically deactivate Email Two-Factor Authentication. Do you want to proceed?`,`Proceed`)).isConfirmed)&&B.post(route(`two-factor.enable`),{preserveScroll:!0,onSuccess:()=>{B.reset(),l.success(`Enabled`,`2FA is now active on your account.`)}})},U=async()=>{let{value:e}=await m.default.fire({title:`Disable 2FA`,text:`Enter your password to confirm.`,input:`password`,inputPlaceholder:`Your current password`,showCancelButton:!0,confirmButtonText:`Disable`,confirmButtonColor:`#dc2626`});e&&r.post(route(`two-factor.disable`),{password:e},{preserveScroll:!0,onSuccess:()=>l.success(`Disabled`,`2FA has been disabled.`)})},W=async()=>{(await l.confirm(`Regenerate Codes?`,`Old recovery codes will be invalidated.`,`Regenerate`)).isConfirmed&&r.post(route(`two-factor.recovery-codes`),{},{preserveScroll:!0,onSuccess:()=>{z(!0),l.success(`Regenerated`,`New recovery codes generated.`)}})},G=async e=>{if(e&&!t.smtp_configured){m.default.fire({icon:`warning`,title:`SMTP Mail Server Not Set Up`,text:`Two-Factor Authentication via Email cannot be enabled because the system SMTP configurations are not set up yet. Please configure the SMTP settings under System Settings (or contact your Administrator) first.`,confirmButtonColor:`#3D4E4B`});return}if(e&&t.enabled&&!(await l.confirm(`Switch to Email 2FA?`,`Enabling Email 2FA will automatically deactivate your Google Authenticator setup. Do you want to proceed?`,`Proceed`)).isConfirmed)return;let{value:n}=await m.default.fire({title:e?`Enable Email 2FA`:`Disable Email 2FA`,text:`Enter your password to confirm.`,input:`password`,inputPlaceholder:`Your current password`,showCancelButton:!0,confirmButtonText:`Confirm`,confirmButtonColor:`#3D4E4B`});n&&r.post(route(`two-factor.email.toggle`),{password:n,enabled:e},{preserveScroll:!0,onSuccess:()=>l.success(`Success`,`Email Two-Factor Authentication has been ${e?`enabled`:`disabled`} successfully.`),onError:e=>l.error(`Error`,e.password||`Incorrect password.`)})};return(0,v.jsxs)(s,{children:[(0,v.jsx)(i,{title:`Account Settings`}),(0,v.jsx)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`Account Settings`}),(0,v.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Manage your personal credentials and security preferences`})]})}),(0,v.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-gray-100 w-full mb-8 anim-down`,style:{animationDelay:`0.05s`},children:[(0,v.jsxs)(`button`,{type:`button`,onClick:()=>d(`profile`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${c===`profile`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Profile Information`,c===`profile`&&(0,v.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,v.jsxs)(`button`,{type:`button`,onClick:()=>d(`security`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${c===`security`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Security & Password`,c===`security`&&(0,v.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(n.totp_allowed||n.email_allowed)&&(0,v.jsxs)(`button`,{type:`button`,onClick:()=>d(`2fa`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${c===`2fa`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Two-Factor Auth`,c===`2fa`&&(0,v.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,v.jsxs)(`button`,{type:`button`,onClick:()=>d(`danger`),className:`relative pb-3 px-1 text-sm font-bold tracking-tight transition-colors ${c===`danger`?`text-red-600`:`text-gray-400 hover:text-red-600`}`,children:[`Danger Zone`,c===`danger`&&(0,v.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-red-500 rounded-t-full`})]})]}),(0,v.jsxs)(`div`,{className:`space-y-8 pb-20`,children:[c===`profile`&&(0,v.jsx)(`div`,{className:`space-y-8 anim-fade`,children:(0,v.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-8`,children:[(0,v.jsx)(`div`,{className:`lg:col-span-2`,children:(0,v.jsx)(y,{title:`Identity`,description:`Manage your public name and contact email`,delay:`0.1s`,children:(0,v.jsxs)(`form`,{onSubmit:E,className:`space-y-8`,children:[(0,v.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-6`,children:[(0,v.jsx)(b,{label:`First Name`,id:`first_name`,value:f.first_name,onChange:e=>g(`first_name`,e.target.value),error:C.first_name,required:!0,placeholder:`e.g. John`}),(0,v.jsx)(b,{label:`Last Name`,id:`last_name`,value:f.last_name,onChange:e=>g(`last_name`,e.target.value),error:C.last_name,required:!0,placeholder:`e.g. Doe`})]}),(0,v.jsx)(b,{label:`Email Address`,id:`email`,type:`email`,value:f.email,onChange:e=>g(`email`,e.target.value),error:C.email,required:!0,placeholder:`e.g. john.doe@example.com`}),(0,v.jsx)(b,{label:`Phone Number`,id:`phone`,value:f.phone,onChange:e=>g(`phone`,e.target.value),error:C.phone,placeholder:`e.g. +62 812 3456 7890`}),(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(`label`,{htmlFor:`bio`,className:`block text-xs font-semibold text-gray-500 tracking-tight ml-1`,children:`Bio`}),(0,v.jsx)(`textarea`,{id:`bio`,value:f.bio,onChange:e=>g(`bio`,e.target.value),rows:3,placeholder:`A short description about yourself...`,className:`input-field py-3 resize-none${C.bio?` is-error`:``}`}),C.bio&&(0,v.jsx)(`p`,{className:`text-xs text-red-500 font-semibold ml-1 mt-1`,children:C.bio})]}),(0,v.jsx)(`div`,{className:`flex justify-end pt-4 border-t border-gray-50`,children:(0,v.jsx)(`button`,{type:`submit`,disabled:x,className:`h-10 px-8 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20 disabled:opacity-60`,children:x?`Saving...`:`Save Profile`})})]})})}),(0,v.jsx)(`div`,{className:`lg:col-span-1`,children:(0,v.jsx)(y,{title:`Profile Photo`,description:`Update your avatar`,delay:`0.15s`,children:(0,v.jsxs)(`div`,{className:`flex flex-col items-center gap-6`,children:[(0,v.jsx)(`div`,{className:`w-24 h-24 rounded-2xl bg-[#3D4E4B] flex items-center justify-center text-white text-2xl font-bold shadow-lg shadow-[#3D4E4B]/10 overflow-hidden border-2 border-white`,children:o.avatar_url?(0,v.jsx)(`img`,{src:o.avatar_url,className:`w-full h-full object-cover`}):F}),(0,v.jsx)(`div`,{className:`w-full`,children:(0,v.jsx)(h.FilePond,{files:w,onupdatefiles:e=>{T(e),g(`avatar_file`,e[0]?.file||null)},allowMultiple:!1,maxFiles:1,labelIdle:`Drop Photo here`})})]})})})]})}),c===`security`&&(0,v.jsx)(`div`,{className:`max-w-4xl anim-fade`,children:(0,v.jsx)(y,{title:`Password`,description:`Update your secure access key`,delay:`0.1s`,children:(0,v.jsxs)(`form`,{onSubmit:N,className:`space-y-8`,children:[(0,v.jsx)(`div`,{className:`max-w-md`,children:(0,v.jsx)(b,{label:`Current Password`,id:`current_password`,type:`password`,value:D.current_password,onChange:e=>O(`current_password`,e.target.value),error:j.current_password,required:!0,placeholder:`••••••••`})}),(0,v.jsx)(`div`,{className:`h-px bg-gray-50 -mx-8`}),(0,v.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-8`,children:[(0,v.jsx)(b,{label:`New Password`,id:`password`,type:`password`,value:D.password,onChange:e=>O(`password`,e.target.value),error:j.password,required:!0,placeholder:`Enter new password`}),(0,v.jsx)(b,{label:`Confirm New Password`,id:`password_confirmation`,type:`password`,value:D.password_confirmation,onChange:e=>O(`password_confirmation`,e.target.value),error:j.password_confirmation,required:!0,placeholder:`Repeat new password`})]}),(0,v.jsx)(`div`,{className:`flex justify-end pt-4 border-t border-gray-50`,children:(0,v.jsx)(`button`,{type:`submit`,disabled:A,className:`h-10 px-8 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20 disabled:opacity-60`,children:A?`Updating...`:`Update Password`})})]})})}),c===`2fa`&&(0,v.jsxs)(`div`,{className:`max-w-4xl space-y-8 anim-fade`,children:[(0,v.jsxs)(`div`,{className:`p-5 bg-amber-50 border border-amber-200 rounded-2xl flex items-start gap-3`,children:[(0,v.jsx)(`svg`,{className:`w-5 h-5 text-amber-500 mt-0.5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,v.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z`})}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`p`,{className:`text-xs font-bold text-amber-800 mb-1`,children:`Two-Factor Authentication (2FA)`}),(0,v.jsx)(`p`,{className:`text-[11px] text-amber-700 font-medium leading-relaxed`,children:`2FA menambah lapisan keamanan ekstra dengan meminta kode OTP dari aplikasi authenticator setiap kali login.`})]})]}),n.totp_allowed&&(t.enabled?(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsxs)(`div`,{className:`bg-white rounded-2xl border border-emerald-100 shadow-sm p-6 flex items-center gap-4`,children:[(0,v.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-emerald-50 flex items-center justify-center shrink-0`,children:(0,v.jsx)(`svg`,{className:`w-6 h-6 text-emerald-600`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,v.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})})}),(0,v.jsxs)(`div`,{className:`flex-1`,children:[(0,v.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Two-Factor Authentication Aktif`}),(0,v.jsx)(`div`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:`Akun Anda dilindungi dengan TOTP authentication.`})]}),(0,v.jsx)(`button`,{onClick:U,type:`button`,className:`h-9 px-5 text-xs font-bold text-red-500 border border-red-200 rounded-xl hover:bg-red-50 transition-all`,children:`Disable 2FA`})]}),(0,v.jsx)(y,{title:`Recovery Codes`,description:`Simpan kode ini dengan aman — gunakan jika kehilangan akses ke authenticator`,children:(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`button`,{onClick:()=>z(!R),type:`button`,className:`h-8 px-4 text-xs font-bold text-[#3D4E4B] border border-gray-200 rounded-lg hover:bg-gray-50 transition-all`,children:R?`Hide`:`Show Codes`}),(0,v.jsx)(`button`,{onClick:W,type:`button`,className:`h-8 px-4 text-xs font-bold text-[#D4A017] border border-amber-200 rounded-lg hover:bg-amber-50 transition-all`,children:`Regenerate`})]}),R&&t.recovery_codes.length>0&&(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:t.recovery_codes.map((e,t)=>(0,v.jsx)(`code`,{className:`px-4 py-2.5 bg-gray-50 border border-gray-100 rounded-xl text-xs font-mono text-[#3D4E4B] tracking-wider text-center`,children:e},t))}),(0,v.jsx)(`p`,{className:`text-[11px] text-amber-600 font-semibold mt-3`,children:`⚠ Setiap kode hanya bisa digunakan sekali.`})]})]})})]}):(0,v.jsx)(y,{title:`Setup Authenticator App`,description:`Scan QR code dengan Google Authenticator, Authy, atau TOTP app lainnya`,children:(0,v.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-10 items-center md:items-start`,children:[(0,v.jsx)(`div`,{className:`shrink-0`,children:(0,v.jsx)(`div`,{className:`p-4 bg-white border-2 border-gray-100 rounded-2xl inline-block shadow-sm`,children:t.qr_code&&(0,v.jsx)(`img`,{src:t.qr_code,alt:`2FA QR Code`,className:`w-44 h-44`})})}),(0,v.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[(0,v.jsx)(`div`,{className:`space-y-3`,children:[`Install aplikasi authenticator (Google Authenticator, Authy, 1Password)`,`Scan QR code atau masukkan manual key di bawah`,`Masukkan kode 6 digit dari aplikasi untuk mengaktifkan`].map((e,t)=>(0,v.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,v.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-[#3D4E4B] text-white text-[10px] font-black flex items-center justify-center shrink-0 mt-0.5`,children:t+1}),(0,v.jsx)(`p`,{className:`text-xs font-medium text-gray-500 leading-relaxed pt-0.5`,children:e})]},t))}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:`block text-xs font-semibold text-gray-400 mb-1.5`,children:`Manual Key`}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`code`,{className:`flex-1 text-xs font-mono bg-gray-50 border border-gray-100 rounded-xl px-4 py-3 text-[#3D4E4B] tracking-wider`,children:t.secret}),(0,v.jsx)(`button`,{onClick:V,type:`button`,className:`shrink-0 h-11 px-4 border border-gray-200 rounded-xl text-xs font-bold text-gray-500 hover:bg-gray-50 transition-all`,children:I?`✓ Copied`:`Copy`})]})]}),(0,v.jsxs)(`form`,{onSubmit:H,className:`space-y-3`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:`block text-xs font-semibold text-gray-400 mb-1.5`,children:`Verification Code *`}),(0,v.jsx)(`input`,{type:`text`,inputMode:`numeric`,maxLength:6,value:B.data.code,onChange:e=>B.setData(`code`,e.target.value),className:`input-field w-full text-center tracking-[0.5em] font-bold text-lg`,placeholder:`000000`}),B.errors.code&&(0,v.jsx)(`p`,{className:`text-xs text-red-500 font-semibold mt-1`,children:B.errors.code})]}),(0,v.jsx)(`button`,{type:`submit`,disabled:B.processing||B.data.code.length<6,className:`w-full h-11 bg-[#3D4E4B] text-white text-xs font-bold rounded-xl hover:bg-[#2D3A38] transition-all disabled:opacity-60`,children:B.processing?`Verifying...`:`Enable Two-Factor Authentication`})]})]})]})})),n.email_allowed&&(0,v.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm p-6 flex items-center gap-4`,children:[(0,v.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-blue-50 flex items-center justify-center shrink-0`,children:(0,v.jsx)(`svg`,{className:`w-6 h-6 text-[#D4A017]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,v.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z`})})}),(0,v.jsxs)(`div`,{className:`flex-1`,children:[(0,v.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Two-Factor Authentication via Email`}),(0,v.jsx)(`div`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:t.email_enabled?`Email 2FA is active. Every login attempt will require an OTP code sent to your email.`:`Receive a 6-digit OTP code in your email to secure your login sessions.`}),!t.smtp_configured&&(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-2 text-[11px] font-bold text-amber-600 bg-amber-50 px-2.5 py-1 rounded-lg w-fit border border-amber-200`,children:[(0,v.jsx)(`span`,{className:`text-sm`,children:`⚠`}),(0,v.jsx)(`span`,{children:`SMTP Mail Server is not configured. Setup required.`})]})]}),t.email_enabled?(0,v.jsx)(`button`,{onClick:()=>G(!1),type:`button`,className:`h-9 px-5 text-xs font-bold text-red-500 border border-red-200 rounded-xl hover:bg-red-50 transition-all`,children:`Disable Email 2FA`}):(0,v.jsx)(`button`,{onClick:()=>G(!0),type:`button`,className:`h-9 px-5 text-xs font-bold text-[#3D4E4B] border border-gray-200 rounded-xl hover:bg-gray-50 transition-all`,children:`Enable Email 2FA`})]})]}),c===`danger`&&(0,v.jsx)(`div`,{className:`max-w-4xl anim-fade`,children:(0,v.jsx)(y,{title:`Account Lifecycle`,description:`Critical and irreversible account actions`,delay:`0.1s`,children:(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-10 p-6 rounded-2xl bg-red-50 border border-red-100`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,v.jsx)(`div`,{className:`w-14 h-14 rounded-2xl bg-white border border-red-100 flex items-center justify-center text-red-600 shrink-0`,children:(0,v.jsx)(`svg`,{className:`w-7 h-7`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,v.jsx)(`path`,{d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})})}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`p`,{className:`text-base font-bold text-red-900 leading-none`,children:`Delete Account Permanently`}),(0,v.jsx)(`p`,{className:`text-xs text-red-700/60 font-semibold mt-2 leading-relaxed`,children:`Proceeding will scrub your identity, logs, and settings from our database. This action is irreversible.`})]})]}),(0,v.jsx)(`button`,{onClick:P,className:`h-11 px-8 bg-red-600 text-white text-xs font-bold uppercase tracking-widest rounded-xl hover:bg-red-700 transition-all shrink-0`,children:`Delete Account`})]})})})]})]})}export{C as default}; \ No newline at end of file +import{a as e,c as t,d as n,i as r,n as i,o as a,t as o}from"./app-C2kGDHB9.js";import{t as s}from"./AuthenticatedLayout-C8h2HS7D.js";import{n as c,t as l}from"./swal-DeDNECCu.js";import{n as u,r as d,t as f}from"./filepond-plugin-file-validate-type-DOUFAaeW.js";var p=n(t(),1),m=n(c(),1),h=d(),g=n(u(),1),_=n(f(),1),v=o();(0,h.registerPlugin)(g.default,_.default);function y({title:e,description:t,children:n,delay:r=`0s`,variant:i=`default`}){let a=i===`danger`;return(0,v.jsxs)(`div`,{className:`bg-white rounded-2xl border ${a?`border-red-200 shadow-none`:`border-gray-100 shadow-sm`} overflow-hidden h-full flex flex-col anim-up`,style:{animationDelay:r},children:[(0,v.jsxs)(`div`,{className:`px-6 py-4 border-b ${a?`border-red-100 bg-red-50`:`border-gray-50 bg-gray-50/30`}`,children:[(0,v.jsx)(`h2`,{className:`text-sm font-bold tracking-tight ${a?`text-red-600`:`text-[#3D4E4B]`}`,children:e}),(0,v.jsx)(`p`,{className:`text-xs font-semibold tracking-tight mt-1 ${a?`text-red-400`:`text-gray-400`}`,children:t})]}),(0,v.jsx)(`div`,{className:`p-8 flex-1`,children:n})]})}function b({label:e,id:t,type:n=`text`,value:r,onChange:i,error:a,placeholder:o,required:s=!1}){return(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsxs)(`label`,{htmlFor:t,className:`block text-xs font-semibold text-gray-500 tracking-tight ml-1`,children:[e,` `,s&&(0,v.jsx)(`span`,{className:`text-red-500`,children:`*`})]}),(0,v.jsx)(`input`,{id:t,type:n,value:r,onChange:i,placeholder:o,className:`input-field${a?` is-error`:``}`}),a&&(0,v.jsx)(`p`,{className:`text-xs text-red-500 font-semibold ml-1 mt-1`,children:a})]})}var x=[`profile`,`security`,`2fa`,`danger`];function S(){let e=window.location.hash.replace(`#`,``);return x.includes(e)?e:`profile`}function C({twoFactor:t,twoFactorSettings:n}){let{user:o}=a().props.auth,[c,u]=(0,p.useState)(()=>{let e=S();return e===`2fa`&&!(n.totp_allowed||n.email_allowed)?`profile`:e});(0,p.useEffect)(()=>{let e=()=>{let e=S();e===`2fa`&&!(n.totp_allowed||n.email_allowed)?u(`profile`):u(e)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[n]);let d=e=>{window.location.hash=e,u(e)},{data:f,setData:g,post:_,processing:x,errors:C}=e({first_name:o.first_name||``,last_name:o.last_name||``,email:o.email||``,phone:o.phone||``,bio:o.bio||``,avatar_file:null,_method:`PATCH`}),[w,T]=(0,p.useState)([]),E=e=>{e.preventDefault(),_(route(`profile.update`),{preserveScroll:!0,onSuccess:()=>l.success(`Saved`,`Profile updated successfully.`)})},{data:D,setData:O,put:k,processing:A,errors:j,reset:M}=e({current_password:``,password:``,password_confirmation:``}),N=e=>{e.preventDefault(),k(route(`password.update`),{preserveScroll:!0,onSuccess:()=>{M(),l.success(`Saved`,`Password updated successfully.`)}})},P=async()=>{if((await l.confirm(`Delete account?`,`This action is irreversible.`,`Delete Permanently`)).isConfirmed){let{value:e}=await m.default.fire({title:`Confirm Password`,input:`password`,inputPlaceholder:`Enter your current password`,showCancelButton:!0,confirmButtonText:`Delete`,confirmButtonColor:`#dc2626`});e&&r.delete(route(`profile.destroy`),{data:{password:e},preserveScroll:!0,onSuccess:()=>l.success(`Deleted`,`Account removed.`),onError:e=>l.error(`Error`,e.password||`Incorrect password.`)})}},F=`${o.first_name?.charAt(0)||``}${o.last_name?.charAt(0)||``}`.toUpperCase(),[I,L]=(0,p.useState)(!1),[R,z]=(0,p.useState)(!1),B=e({code:``}),V=()=>{navigator.clipboard.writeText(t.secret||``),L(!0),setTimeout(()=>L(!1),2e3)},H=async e=>{e.preventDefault(),!(t.email_enabled&&!(await l.confirm(`Deactivate Email 2FA?`,`Enabling Google Authenticator will automatically deactivate Email Two-Factor Authentication. Do you want to proceed?`,`Proceed`)).isConfirmed)&&B.post(route(`two-factor.enable`),{preserveScroll:!0,onSuccess:()=>{B.reset(),l.success(`Enabled`,`2FA is now active on your account.`)}})},U=async()=>{let{value:e}=await m.default.fire({title:`Disable 2FA`,text:`Enter your password to confirm.`,input:`password`,inputPlaceholder:`Your current password`,showCancelButton:!0,confirmButtonText:`Disable`,confirmButtonColor:`#dc2626`});e&&r.post(route(`two-factor.disable`),{password:e},{preserveScroll:!0,onSuccess:()=>l.success(`Disabled`,`2FA has been disabled.`)})},W=async()=>{(await l.confirm(`Regenerate Codes?`,`Old recovery codes will be invalidated.`,`Regenerate`)).isConfirmed&&r.post(route(`two-factor.recovery-codes`),{},{preserveScroll:!0,onSuccess:()=>{z(!0),l.success(`Regenerated`,`New recovery codes generated.`)}})},G=async e=>{if(e&&!t.smtp_configured){m.default.fire({icon:`warning`,title:`SMTP Mail Server Not Set Up`,text:`Two-Factor Authentication via Email cannot be enabled because the system SMTP configurations are not set up yet. Please configure the SMTP settings under System Settings (or contact your Administrator) first.`,confirmButtonColor:`#3D4E4B`});return}if(e&&t.enabled&&!(await l.confirm(`Switch to Email 2FA?`,`Enabling Email 2FA will automatically deactivate your Google Authenticator setup. Do you want to proceed?`,`Proceed`)).isConfirmed)return;let{value:n}=await m.default.fire({title:e?`Enable Email 2FA`:`Disable Email 2FA`,text:`Enter your password to confirm.`,input:`password`,inputPlaceholder:`Your current password`,showCancelButton:!0,confirmButtonText:`Confirm`,confirmButtonColor:`#3D4E4B`});n&&r.post(route(`two-factor.email.toggle`),{password:n,enabled:e},{preserveScroll:!0,onSuccess:()=>l.success(`Success`,`Email Two-Factor Authentication has been ${e?`enabled`:`disabled`} successfully.`),onError:e=>l.error(`Error`,e.password||`Incorrect password.`)})};return(0,v.jsxs)(s,{children:[(0,v.jsx)(i,{title:`Account Settings`}),(0,v.jsx)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] tracking-tight leading-none`,children:`Account Settings`}),(0,v.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Manage your personal credentials and security preferences`})]})}),(0,v.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-gray-100 w-full mb-8 anim-down`,style:{animationDelay:`0.05s`},children:[(0,v.jsxs)(`button`,{type:`button`,onClick:()=>d(`profile`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${c===`profile`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Profile Information`,c===`profile`&&(0,v.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,v.jsxs)(`button`,{type:`button`,onClick:()=>d(`security`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${c===`security`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Security & Password`,c===`security`&&(0,v.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(n.totp_allowed||n.email_allowed)&&(0,v.jsxs)(`button`,{type:`button`,onClick:()=>d(`2fa`),className:`relative pb-3 px-1 mr-8 text-sm font-bold tracking-tight transition-colors ${c===`2fa`?`text-[#3D4E4B]`:`text-gray-400 hover:text-[#3D4E4B]`}`,children:[`Two-Factor Auth`,c===`2fa`&&(0,v.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-[#D4A017] rounded-t-full`})]}),(0,v.jsxs)(`button`,{type:`button`,onClick:()=>d(`danger`),className:`relative pb-3 px-1 text-sm font-bold tracking-tight transition-colors ${c===`danger`?`text-red-600`:`text-gray-400 hover:text-red-600`}`,children:[`Danger Zone`,c===`danger`&&(0,v.jsx)(`span`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-red-500 rounded-t-full`})]})]}),(0,v.jsxs)(`div`,{className:`space-y-8 pb-20`,children:[c===`profile`&&(0,v.jsx)(`div`,{className:`space-y-8 anim-fade`,children:(0,v.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-8`,children:[(0,v.jsx)(`div`,{className:`lg:col-span-2`,children:(0,v.jsx)(y,{title:`Identity`,description:`Manage your public name and contact email`,delay:`0.1s`,children:(0,v.jsxs)(`form`,{onSubmit:E,className:`space-y-8`,children:[(0,v.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-6`,children:[(0,v.jsx)(b,{label:`First Name`,id:`first_name`,value:f.first_name,onChange:e=>g(`first_name`,e.target.value),error:C.first_name,required:!0,placeholder:`e.g. John`}),(0,v.jsx)(b,{label:`Last Name`,id:`last_name`,value:f.last_name,onChange:e=>g(`last_name`,e.target.value),error:C.last_name,required:!0,placeholder:`e.g. Doe`})]}),(0,v.jsx)(b,{label:`Email Address`,id:`email`,type:`email`,value:f.email,onChange:e=>g(`email`,e.target.value),error:C.email,required:!0,placeholder:`e.g. john.doe@example.com`}),(0,v.jsx)(b,{label:`Phone Number`,id:`phone`,value:f.phone,onChange:e=>g(`phone`,e.target.value),error:C.phone,placeholder:`e.g. +62 812 3456 7890`}),(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(`label`,{htmlFor:`bio`,className:`block text-xs font-semibold text-gray-500 tracking-tight ml-1`,children:`Bio`}),(0,v.jsx)(`textarea`,{id:`bio`,value:f.bio,onChange:e=>g(`bio`,e.target.value),rows:3,placeholder:`A short description about yourself...`,className:`input-field py-3 resize-none${C.bio?` is-error`:``}`}),C.bio&&(0,v.jsx)(`p`,{className:`text-xs text-red-500 font-semibold ml-1 mt-1`,children:C.bio})]}),(0,v.jsx)(`div`,{className:`flex justify-end pt-4 border-t border-gray-50`,children:(0,v.jsx)(`button`,{type:`submit`,disabled:x,className:`h-10 px-8 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20 disabled:opacity-60`,children:x?`Saving...`:`Save Profile`})})]})})}),(0,v.jsx)(`div`,{className:`lg:col-span-1`,children:(0,v.jsx)(y,{title:`Profile Photo`,description:`Update your avatar`,delay:`0.15s`,children:(0,v.jsxs)(`div`,{className:`flex flex-col items-center gap-6`,children:[(0,v.jsx)(`div`,{className:`w-24 h-24 rounded-2xl bg-[#3D4E4B] flex items-center justify-center text-white text-2xl font-bold shadow-lg shadow-[#3D4E4B]/10 overflow-hidden border-2 border-white`,children:o.avatar_url?(0,v.jsx)(`img`,{src:o.avatar_url,className:`w-full h-full object-cover`}):F}),(0,v.jsx)(`div`,{className:`w-full`,children:(0,v.jsx)(h.FilePond,{files:w,onupdatefiles:e=>{T(e),g(`avatar_file`,e[0]?.file||null)},allowMultiple:!1,maxFiles:1,labelIdle:`Drop Photo here`})})]})})})]})}),c===`security`&&(0,v.jsx)(`div`,{className:`max-w-4xl anim-fade`,children:(0,v.jsx)(y,{title:`Password`,description:`Update your secure access key`,delay:`0.1s`,children:(0,v.jsxs)(`form`,{onSubmit:N,className:`space-y-8`,children:[(0,v.jsx)(`div`,{className:`max-w-md`,children:(0,v.jsx)(b,{label:`Current Password`,id:`current_password`,type:`password`,value:D.current_password,onChange:e=>O(`current_password`,e.target.value),error:j.current_password,required:!0,placeholder:`••••••••`})}),(0,v.jsx)(`div`,{className:`h-px bg-gray-50 -mx-8`}),(0,v.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-8`,children:[(0,v.jsx)(b,{label:`New Password`,id:`password`,type:`password`,value:D.password,onChange:e=>O(`password`,e.target.value),error:j.password,required:!0,placeholder:`Enter new password`}),(0,v.jsx)(b,{label:`Confirm New Password`,id:`password_confirmation`,type:`password`,value:D.password_confirmation,onChange:e=>O(`password_confirmation`,e.target.value),error:j.password_confirmation,required:!0,placeholder:`Repeat new password`})]}),(0,v.jsx)(`div`,{className:`flex justify-end pt-4 border-t border-gray-50`,children:(0,v.jsx)(`button`,{type:`submit`,disabled:A,className:`h-10 px-8 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all shadow-lg shadow-[#3D4E4B]/20 disabled:opacity-60`,children:A?`Updating...`:`Update Password`})})]})})}),c===`2fa`&&(0,v.jsxs)(`div`,{className:`max-w-4xl space-y-8 anim-fade`,children:[(0,v.jsxs)(`div`,{className:`p-5 bg-amber-50 border border-amber-200 rounded-2xl flex items-start gap-3`,children:[(0,v.jsx)(`svg`,{className:`w-5 h-5 text-amber-500 mt-0.5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,v.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z`})}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`p`,{className:`text-xs font-bold text-amber-800 mb-1`,children:`Two-Factor Authentication (2FA)`}),(0,v.jsx)(`p`,{className:`text-[11px] text-amber-700 font-medium leading-relaxed`,children:`2FA menambah lapisan keamanan ekstra dengan meminta kode OTP dari aplikasi authenticator setiap kali login.`})]})]}),n.totp_allowed&&(t.enabled?(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsxs)(`div`,{className:`bg-white rounded-2xl border border-emerald-100 shadow-sm p-6 flex items-center gap-4`,children:[(0,v.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-emerald-50 flex items-center justify-center shrink-0`,children:(0,v.jsx)(`svg`,{className:`w-6 h-6 text-emerald-600`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,v.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})})}),(0,v.jsxs)(`div`,{className:`flex-1`,children:[(0,v.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Two-Factor Authentication Aktif`}),(0,v.jsx)(`div`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:`Akun Anda dilindungi dengan TOTP authentication.`})]}),(0,v.jsx)(`button`,{onClick:U,type:`button`,className:`h-9 px-5 text-xs font-bold text-red-500 border border-red-200 rounded-xl hover:bg-red-50 transition-all`,children:`Disable 2FA`})]}),(0,v.jsx)(y,{title:`Recovery Codes`,description:`Simpan kode ini dengan aman — gunakan jika kehilangan akses ke authenticator`,children:(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`button`,{onClick:()=>z(!R),type:`button`,className:`h-8 px-4 text-xs font-bold text-[#3D4E4B] border border-gray-200 rounded-lg hover:bg-gray-50 transition-all`,children:R?`Hide`:`Show Codes`}),(0,v.jsx)(`button`,{onClick:W,type:`button`,className:`h-8 px-4 text-xs font-bold text-[#D4A017] border border-amber-200 rounded-lg hover:bg-amber-50 transition-all`,children:`Regenerate`})]}),R&&t.recovery_codes.length>0&&(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:t.recovery_codes.map((e,t)=>(0,v.jsx)(`code`,{className:`px-4 py-2.5 bg-gray-50 border border-gray-100 rounded-xl text-xs font-mono text-[#3D4E4B] tracking-wider text-center`,children:e},t))}),(0,v.jsx)(`p`,{className:`text-[11px] text-amber-600 font-semibold mt-3`,children:`⚠ Setiap kode hanya bisa digunakan sekali.`})]})]})})]}):(0,v.jsx)(y,{title:`Setup Authenticator App`,description:`Scan QR code dengan Google Authenticator, Authy, atau TOTP app lainnya`,children:(0,v.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-10 items-center md:items-start`,children:[(0,v.jsx)(`div`,{className:`shrink-0`,children:(0,v.jsx)(`div`,{className:`p-4 bg-white border-2 border-gray-100 rounded-2xl inline-block shadow-sm`,children:t.qr_code&&(0,v.jsx)(`img`,{src:t.qr_code,alt:`2FA QR Code`,className:`w-44 h-44`})})}),(0,v.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[(0,v.jsx)(`div`,{className:`space-y-3`,children:[`Install aplikasi authenticator (Google Authenticator, Authy, 1Password)`,`Scan QR code atau masukkan manual key di bawah`,`Masukkan kode 6 digit dari aplikasi untuk mengaktifkan`].map((e,t)=>(0,v.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,v.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-[#3D4E4B] text-white text-[10px] font-black flex items-center justify-center shrink-0 mt-0.5`,children:t+1}),(0,v.jsx)(`p`,{className:`text-xs font-medium text-gray-500 leading-relaxed pt-0.5`,children:e})]},t))}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:`block text-xs font-semibold text-gray-400 mb-1.5`,children:`Manual Key`}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`code`,{className:`flex-1 text-xs font-mono bg-gray-50 border border-gray-100 rounded-xl px-4 py-3 text-[#3D4E4B] tracking-wider`,children:t.secret}),(0,v.jsx)(`button`,{onClick:V,type:`button`,className:`shrink-0 h-11 px-4 border border-gray-200 rounded-xl text-xs font-bold text-gray-500 hover:bg-gray-50 transition-all`,children:I?`✓ Copied`:`Copy`})]})]}),(0,v.jsxs)(`form`,{onSubmit:H,className:`space-y-3`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:`block text-xs font-semibold text-gray-400 mb-1.5`,children:`Verification Code *`}),(0,v.jsx)(`input`,{type:`text`,inputMode:`numeric`,maxLength:6,value:B.data.code,onChange:e=>B.setData(`code`,e.target.value),className:`input-field w-full text-center tracking-[0.5em] font-bold text-lg`,placeholder:`000000`}),B.errors.code&&(0,v.jsx)(`p`,{className:`text-xs text-red-500 font-semibold mt-1`,children:B.errors.code})]}),(0,v.jsx)(`button`,{type:`submit`,disabled:B.processing||B.data.code.length<6,className:`w-full h-11 bg-[#3D4E4B] text-white text-xs font-bold rounded-xl hover:bg-[#2D3A38] transition-all disabled:opacity-60`,children:B.processing?`Verifying...`:`Enable Two-Factor Authentication`})]})]})]})})),n.email_allowed&&(0,v.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm p-6 flex items-center gap-4`,children:[(0,v.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-blue-50 flex items-center justify-center shrink-0`,children:(0,v.jsx)(`svg`,{className:`w-6 h-6 text-[#D4A017]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,v.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z`})})}),(0,v.jsxs)(`div`,{className:`flex-1`,children:[(0,v.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Two-Factor Authentication via Email`}),(0,v.jsx)(`div`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:t.email_enabled?`Email 2FA is active. Every login attempt will require an OTP code sent to your email.`:`Receive a 6-digit OTP code in your email to secure your login sessions.`}),!t.smtp_configured&&(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-2 text-[11px] font-bold text-amber-600 bg-amber-50 px-2.5 py-1 rounded-lg w-fit border border-amber-200`,children:[(0,v.jsx)(`span`,{className:`text-sm`,children:`⚠`}),(0,v.jsx)(`span`,{children:`SMTP Mail Server is not configured. Setup required.`})]})]}),t.email_enabled?(0,v.jsx)(`button`,{onClick:()=>G(!1),type:`button`,className:`h-9 px-5 text-xs font-bold text-red-500 border border-red-200 rounded-xl hover:bg-red-50 transition-all`,children:`Disable Email 2FA`}):(0,v.jsx)(`button`,{onClick:()=>G(!0),type:`button`,className:`h-9 px-5 text-xs font-bold text-[#3D4E4B] border border-gray-200 rounded-xl hover:bg-gray-50 transition-all`,children:`Enable Email 2FA`})]})]}),c===`danger`&&(0,v.jsx)(`div`,{className:`max-w-4xl anim-fade`,children:(0,v.jsx)(y,{title:`Account Lifecycle`,description:`Critical and irreversible account actions`,delay:`0.1s`,children:(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-10 p-6 rounded-2xl bg-red-50 border border-red-100`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,v.jsx)(`div`,{className:`w-14 h-14 rounded-2xl bg-white border border-red-100 flex items-center justify-center text-red-600 shrink-0`,children:(0,v.jsx)(`svg`,{className:`w-7 h-7`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,v.jsx)(`path`,{d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})})}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`p`,{className:`text-base font-bold text-red-900 leading-none`,children:`Delete Account Permanently`}),(0,v.jsx)(`p`,{className:`text-xs text-red-700/60 font-semibold mt-2 leading-relaxed`,children:`Proceeding will scrub your identity, logs, and settings from our database. This action is irreversible.`})]})]}),(0,v.jsx)(`button`,{onClick:P,className:`h-11 px-8 bg-red-600 text-white text-xs font-bold uppercase tracking-widest rounded-xl hover:bg-red-700 transition-all shrink-0`,children:`Delete Account`})]})})})]})]})}export{C as default}; \ No newline at end of file diff --git a/public/build/assets/Login-qxXrNDeD.js b/public/build/assets/Login-DtnGAKBx.js similarity index 98% rename from public/build/assets/Login-qxXrNDeD.js rename to public/build/assets/Login-DtnGAKBx.js index a4e2dc0..8859142 100644 --- a/public/build/assets/Login-qxXrNDeD.js +++ b/public/build/assets/Login-DtnGAKBx.js @@ -1 +1 @@ -import{a as e,c as t,n,o as r,r as i,t as a}from"./app-BK5KCPMc.js";import{t as o}from"./GuestLayout-CgPUg7Kz.js";t();var s=a();function c({status:t,canResetPassword:a}){let{system_settings:c}=r().props,l=c?.oauth_google_enabled===`1`||c?.oauth_google_enabled===!0,u=c?.oauth_github_enabled===`1`||c?.oauth_github_enabled===!0,{data:d,setData:f,post:p,processing:m,errors:h,reset:g}=e({email:``,password:``,remember:!1});return(0,s.jsxs)(o,{children:[(0,s.jsx)(n,{title:`Sign in`}),(0,s.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,s.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Sign in`}),(0,s.jsx)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium`,children:`Enter your credentials to access the dashboard.`})]}),t&&(0,s.jsx)(`div`,{className:`mb-6 px-4 py-3 rounded-xl bg-emerald-50 border border-emerald-100 text-sm font-semibold text-emerald-700 anim-fade`,children:t}),(l||u)&&(0,s.jsxs)(`div`,{className:`mb-6 anim-up`,style:{animationDelay:`0.08s`},children:[(0,s.jsxs)(`div`,{className:`grid gap-3 ${l&&u?`grid-cols-2`:`grid-cols-1`}`,children:[l&&(0,s.jsxs)(`a`,{href:`/auth/google/redirect`,className:`flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 hover:border-gray-300 transition-colors duration-200 text-sm font-semibold text-gray-700`,children:[(0,s.jsxs)(`svg`,{className:`w-4 h-4 shrink-0`,viewBox:`0 0 24 24`,children:[(0,s.jsx)(`path`,{fill:`#EA4335`,d:`M12 5c1.61 0 3.09.59 4.23 1.57l3.12-3.12C17.35 1.67 14.85 1 12 1 7.73 1 4.14 3.48 2.46 7.1l3.71 2.87C7.04 7.09 9.34 5 12 5z`}),(0,s.jsx)(`path`,{fill:`#4285F4`,d:`M23.49 12.27c0-.79-.07-1.54-.19-2.27H12v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58l3.7 2.87c2.16-2 3.72-4.94 3.72-8.69z`}),(0,s.jsx)(`path`,{fill:`#FBBC05`,d:`M6.17 14.77l-3.71 2.87C4.14 21.27 7.73 23 12 23c2.97 0 5.48-1 7.37-2.69l-3.7-2.87c-1.03.69-2.35 1.11-3.67 1.11-2.66 0-4.96-2.09-5.83-4.78z`}),(0,s.jsx)(`path`,{fill:`#34A853`,d:`M12 19.45c1.32 0 2.64-.42 3.67-1.11l3.7 2.87C17.48 22 14.97 23 12 23 7.73 23 4.14 21.27 2.47 17.64l3.71-2.87c.86 2.69 3.16 4.68 5.82 4.68z`})]}),`Google`]}),u&&(0,s.jsxs)(`a`,{href:`/auth/github/redirect`,className:`flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 hover:border-gray-300 transition-colors duration-200 text-sm font-semibold text-gray-700`,children:[(0,s.jsx)(`svg`,{className:`w-4 h-4 shrink-0`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,s.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})}),`GitHub`]})]}),(0,s.jsxs)(`div`,{className:`relative my-6`,children:[(0,s.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,s.jsx)(`div`,{className:`w-full border-t border-gray-100`})}),(0,s.jsx)(`div`,{className:`relative flex justify-center`,children:(0,s.jsx)(`span`,{className:`px-3 bg-white text-xs font-semibold text-gray-300 uppercase tracking-widest`,children:`or`})})]})]}),(0,s.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),p(route(`login`),{onFinish:()=>g(`password`)})},className:`anim-up`,style:{animationDelay:`0.14s`},children:[(0,s.jsxs)(`div`,{className:`space-y-4`,children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`email`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Email address`}),(0,s.jsx)(`input`,{id:`email`,type:`email`,autoComplete:`email`,autoFocus:!0,value:d.email,onChange:e=>f(`email`,e.target.value),placeholder:`you@company.com`,className:`auth-input${h.email?` !border-red-300 !bg-red-50/50`:``}`}),h.email&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:h.email})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,s.jsx)(`label`,{htmlFor:`password`,className:`text-sm font-semibold text-gray-600`,children:`Password`}),a&&(0,s.jsx)(i,{href:route(`password.request`),className:`text-xs font-semibold text-[#D4A017] hover:text-[#B88B14] transition-colors duration-200`,children:`Forgot password?`})]}),(0,s.jsx)(`input`,{id:`password`,type:`password`,autoComplete:`current-password`,value:d.password,onChange:e=>f(`password`,e.target.value),placeholder:`••••••••`,className:`auth-input${h.password?` !border-red-300 !bg-red-50/50`:``}`}),h.password&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:h.password})]})]}),(0,s.jsxs)(`label`,{className:`mt-4 flex items-center gap-2.5 cursor-pointer select-none group w-fit`,children:[(0,s.jsx)(`input`,{type:`checkbox`,checked:d.remember,onChange:e=>f(`remember`,e.target.checked),className:`sr-only`}),(0,s.jsx)(`div`,{className:`w-4 h-4 rounded-[5px] border flex items-center justify-center transition-colors duration-200 shrink-0 ${d.remember?`bg-[#3D4E4B] border-[#3D4E4B]`:`bg-white border-gray-300`}`,children:d.remember&&(0,s.jsx)(`svg`,{className:`w-2.5 h-2.5 text-white`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:3.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 13l4 4L19 7`})})}),(0,s.jsx)(`span`,{className:`text-sm font-medium text-gray-500 group-hover:text-gray-700 transition-colors duration-200`,children:`Keep me signed in`})]}),(0,s.jsx)(`button`,{type:`submit`,disabled:m,className:`mt-6 w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,s.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,s.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Signing in…`]}):`Sign in`})]}),(0,s.jsxs)(`p`,{className:`mt-7 text-center text-sm text-gray-400 font-medium anim-fade`,style:{animationDelay:`0.22s`},children:[`Don't have an account?`,` `,(0,s.jsx)(i,{href:route(`register`),className:`text-[#3D4E4B] font-semibold hover:text-[#D4A017] transition-colors duration-200`,children:`Create one`})]})]})}export{c as default}; \ No newline at end of file +import{a as e,c as t,n,o as r,r as i,t as a}from"./app-C2kGDHB9.js";import{t as o}from"./GuestLayout-DfP8Xy7D.js";t();var s=a();function c({status:t,canResetPassword:a}){let{system_settings:c}=r().props,l=c?.oauth_google_enabled===`1`||c?.oauth_google_enabled===!0,u=c?.oauth_github_enabled===`1`||c?.oauth_github_enabled===!0,{data:d,setData:f,post:p,processing:m,errors:h,reset:g}=e({email:``,password:``,remember:!1});return(0,s.jsxs)(o,{children:[(0,s.jsx)(n,{title:`Sign in`}),(0,s.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,s.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Sign in`}),(0,s.jsx)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium`,children:`Enter your credentials to access the dashboard.`})]}),t&&(0,s.jsx)(`div`,{className:`mb-6 px-4 py-3 rounded-xl bg-emerald-50 border border-emerald-100 text-sm font-semibold text-emerald-700 anim-fade`,children:t}),(l||u)&&(0,s.jsxs)(`div`,{className:`mb-6 anim-up`,style:{animationDelay:`0.08s`},children:[(0,s.jsxs)(`div`,{className:`grid gap-3 ${l&&u?`grid-cols-2`:`grid-cols-1`}`,children:[l&&(0,s.jsxs)(`a`,{href:`/auth/google/redirect`,className:`flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 hover:border-gray-300 transition-colors duration-200 text-sm font-semibold text-gray-700`,children:[(0,s.jsxs)(`svg`,{className:`w-4 h-4 shrink-0`,viewBox:`0 0 24 24`,children:[(0,s.jsx)(`path`,{fill:`#EA4335`,d:`M12 5c1.61 0 3.09.59 4.23 1.57l3.12-3.12C17.35 1.67 14.85 1 12 1 7.73 1 4.14 3.48 2.46 7.1l3.71 2.87C7.04 7.09 9.34 5 12 5z`}),(0,s.jsx)(`path`,{fill:`#4285F4`,d:`M23.49 12.27c0-.79-.07-1.54-.19-2.27H12v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58l3.7 2.87c2.16-2 3.72-4.94 3.72-8.69z`}),(0,s.jsx)(`path`,{fill:`#FBBC05`,d:`M6.17 14.77l-3.71 2.87C4.14 21.27 7.73 23 12 23c2.97 0 5.48-1 7.37-2.69l-3.7-2.87c-1.03.69-2.35 1.11-3.67 1.11-2.66 0-4.96-2.09-5.83-4.78z`}),(0,s.jsx)(`path`,{fill:`#34A853`,d:`M12 19.45c1.32 0 2.64-.42 3.67-1.11l3.7 2.87C17.48 22 14.97 23 12 23 7.73 23 4.14 21.27 2.47 17.64l3.71-2.87c.86 2.69 3.16 4.68 5.82 4.68z`})]}),`Google`]}),u&&(0,s.jsxs)(`a`,{href:`/auth/github/redirect`,className:`flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 hover:border-gray-300 transition-colors duration-200 text-sm font-semibold text-gray-700`,children:[(0,s.jsx)(`svg`,{className:`w-4 h-4 shrink-0`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,s.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})}),`GitHub`]})]}),(0,s.jsxs)(`div`,{className:`relative my-6`,children:[(0,s.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,s.jsx)(`div`,{className:`w-full border-t border-gray-100`})}),(0,s.jsx)(`div`,{className:`relative flex justify-center`,children:(0,s.jsx)(`span`,{className:`px-3 bg-white text-xs font-semibold text-gray-300 uppercase tracking-widest`,children:`or`})})]})]}),(0,s.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),p(route(`login`),{onFinish:()=>g(`password`)})},className:`anim-up`,style:{animationDelay:`0.14s`},children:[(0,s.jsxs)(`div`,{className:`space-y-4`,children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`email`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Email address`}),(0,s.jsx)(`input`,{id:`email`,type:`email`,autoComplete:`email`,autoFocus:!0,value:d.email,onChange:e=>f(`email`,e.target.value),placeholder:`you@company.com`,className:`auth-input${h.email?` !border-red-300 !bg-red-50/50`:``}`}),h.email&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:h.email})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5`,children:[(0,s.jsx)(`label`,{htmlFor:`password`,className:`text-sm font-semibold text-gray-600`,children:`Password`}),a&&(0,s.jsx)(i,{href:route(`password.request`),className:`text-xs font-semibold text-[#D4A017] hover:text-[#B88B14] transition-colors duration-200`,children:`Forgot password?`})]}),(0,s.jsx)(`input`,{id:`password`,type:`password`,autoComplete:`current-password`,value:d.password,onChange:e=>f(`password`,e.target.value),placeholder:`••••••••`,className:`auth-input${h.password?` !border-red-300 !bg-red-50/50`:``}`}),h.password&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:h.password})]})]}),(0,s.jsxs)(`label`,{className:`mt-4 flex items-center gap-2.5 cursor-pointer select-none group w-fit`,children:[(0,s.jsx)(`input`,{type:`checkbox`,checked:d.remember,onChange:e=>f(`remember`,e.target.checked),className:`sr-only`}),(0,s.jsx)(`div`,{className:`w-4 h-4 rounded-[5px] border flex items-center justify-center transition-colors duration-200 shrink-0 ${d.remember?`bg-[#3D4E4B] border-[#3D4E4B]`:`bg-white border-gray-300`}`,children:d.remember&&(0,s.jsx)(`svg`,{className:`w-2.5 h-2.5 text-white`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:3.5,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 13l4 4L19 7`})})}),(0,s.jsx)(`span`,{className:`text-sm font-medium text-gray-500 group-hover:text-gray-700 transition-colors duration-200`,children:`Keep me signed in`})]}),(0,s.jsx)(`button`,{type:`submit`,disabled:m,className:`mt-6 w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,s.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,s.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Signing in…`]}):`Sign in`})]}),(0,s.jsxs)(`p`,{className:`mt-7 text-center text-sm text-gray-400 font-medium anim-fade`,style:{animationDelay:`0.22s`},children:[`Don't have an account?`,` `,(0,s.jsx)(i,{href:route(`register`),className:`text-[#3D4E4B] font-semibold hover:text-[#D4A017] transition-colors duration-200`,children:`Create one`})]})]})}export{c as default}; \ No newline at end of file diff --git a/public/build/assets/Portal-C0c8udmH.js b/public/build/assets/Portal-B40Voc8b.js similarity index 54% rename from public/build/assets/Portal-C0c8udmH.js rename to public/build/assets/Portal-B40Voc8b.js index e5ddeb9..481e5e1 100644 --- a/public/build/assets/Portal-C0c8udmH.js +++ b/public/build/assets/Portal-B40Voc8b.js @@ -1 +1 @@ -import{d as e,s as t}from"./app-BK5KCPMc.js";var n=e(t(),1);function r({children:e}){return(0,n.createPortal)(e,document.body)}export{r as t}; \ No newline at end of file +import{d as e,s as t}from"./app-C2kGDHB9.js";var n=e(t(),1);function r({children:e}){return(0,n.createPortal)(e,document.body)}export{r as t}; \ No newline at end of file diff --git a/public/build/assets/PrimaryButton-2i3vnLMz.js b/public/build/assets/PrimaryButton-C1Df3FyG.js similarity index 87% rename from public/build/assets/PrimaryButton-2i3vnLMz.js rename to public/build/assets/PrimaryButton-C1Df3FyG.js index bc1307e..c932d04 100644 --- a/public/build/assets/PrimaryButton-2i3vnLMz.js +++ b/public/build/assets/PrimaryButton-C1Df3FyG.js @@ -1 +1 @@ -import{t as e}from"./app-BK5KCPMc.js";var t=e();function n({className:e=``,disabled:n,children:r,...i}){return(0,t.jsx)(`button`,{...i,className:`inline-flex items-center rounded-md border border-transparent bg-gray-800 px-4 py-2 text-xs font-bold tracking-tight text-white transition duration-150 ease-in-out hover:bg-gray-700 focus:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 active:bg-gray-900 ${n&&`opacity-25`} `+e,disabled:n,children:r})}export{n as t}; \ No newline at end of file +import{t as e}from"./app-C2kGDHB9.js";var t=e();function n({className:e=``,disabled:n,children:r,...i}){return(0,t.jsx)(`button`,{...i,className:`inline-flex items-center rounded-md border border-transparent bg-gray-800 px-4 py-2 text-xs font-bold tracking-tight text-white transition duration-150 ease-in-out hover:bg-gray-700 focus:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 active:bg-gray-900 ${n&&`opacity-25`} `+e,disabled:n,children:r})}export{n as t}; \ No newline at end of file diff --git a/public/build/assets/Register-B7hpuNim.js b/public/build/assets/Register-DYiZg_h7.js similarity index 98% rename from public/build/assets/Register-B7hpuNim.js rename to public/build/assets/Register-DYiZg_h7.js index 5da7010..aa4d77f 100644 --- a/public/build/assets/Register-B7hpuNim.js +++ b/public/build/assets/Register-DYiZg_h7.js @@ -1 +1 @@ -import{a as e,c as t,n,o as r,r as i,t as a}from"./app-BK5KCPMc.js";import{t as o}from"./GuestLayout-CgPUg7Kz.js";t();var s=a();function c(){let{system_settings:t}=r().props,a=t?.allow_registration===`1`||t?.allow_registration===!0,c=t?.oauth_google_enabled===`1`||t?.oauth_google_enabled===!0,l=t?.oauth_github_enabled===`1`||t?.oauth_github_enabled===!0,{data:u,setData:d,post:f,processing:p,errors:m,reset:h}=e({first_name:``,last_name:``,email:``,password:``,password_confirmation:``});return a?(0,s.jsxs)(o,{children:[(0,s.jsx)(n,{title:`Create account`}),(0,s.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,s.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Create account`}),(0,s.jsx)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium`,children:`Fill in your details to get started.`})]}),(c||l)&&(0,s.jsxs)(`div`,{className:`mb-6 anim-up`,style:{animationDelay:`0.08s`},children:[(0,s.jsxs)(`div`,{className:`grid gap-3 ${c&&l?`grid-cols-2`:`grid-cols-1`}`,children:[c&&(0,s.jsxs)(`a`,{href:`/auth/google/redirect`,className:`flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 hover:border-gray-300 transition-colors duration-200 text-sm font-semibold text-gray-700`,children:[(0,s.jsxs)(`svg`,{className:`w-4 h-4 shrink-0`,viewBox:`0 0 24 24`,children:[(0,s.jsx)(`path`,{fill:`#EA4335`,d:`M12 5c1.61 0 3.09.59 4.23 1.57l3.12-3.12C17.35 1.67 14.85 1 12 1 7.73 1 4.14 3.48 2.46 7.1l3.71 2.87C7.04 7.09 9.34 5 12 5z`}),(0,s.jsx)(`path`,{fill:`#4285F4`,d:`M23.49 12.27c0-.79-.07-1.54-.19-2.27H12v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58l3.7 2.87c2.16-2 3.72-4.94 3.72-8.69z`}),(0,s.jsx)(`path`,{fill:`#FBBC05`,d:`M6.17 14.77l-3.71 2.87C4.14 21.27 7.73 23 12 23c2.97 0 5.48-1 7.37-2.69l-3.7-2.87c-1.03.69-2.35 1.11-3.67 1.11-2.66 0-4.96-2.09-5.83-4.78z`}),(0,s.jsx)(`path`,{fill:`#34A853`,d:`M12 19.45c1.32 0 2.64-.42 3.67-1.11l3.7 2.87C17.48 22 14.97 23 12 23 7.73 23 4.14 21.27 2.47 17.64l3.71-2.87c.86 2.69 3.16 4.68 5.82 4.68z`})]}),`Google`]}),l&&(0,s.jsxs)(`a`,{href:`/auth/github/redirect`,className:`flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 hover:border-gray-300 transition-colors duration-200 text-sm font-semibold text-gray-700`,children:[(0,s.jsx)(`svg`,{className:`w-4 h-4 shrink-0`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,s.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})}),`GitHub`]})]}),(0,s.jsxs)(`div`,{className:`relative my-6`,children:[(0,s.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,s.jsx)(`div`,{className:`w-full border-t border-gray-100`})}),(0,s.jsx)(`div`,{className:`relative flex justify-center`,children:(0,s.jsx)(`span`,{className:`px-3 bg-white text-xs font-semibold text-gray-300 uppercase tracking-widest`,children:`or`})})]})]}),(0,s.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f(route(`register`),{onFinish:()=>h(`password`,`password_confirmation`)})},className:`anim-up`,style:{animationDelay:`0.14s`},children:[(0,s.jsxs)(`div`,{className:`space-y-4`,children:[(0,s.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`first_name`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`First name`}),(0,s.jsx)(`input`,{id:`first_name`,type:`text`,autoComplete:`given-name`,autoFocus:!0,value:u.first_name,onChange:e=>d(`first_name`,e.target.value),placeholder:`Alex`,className:`auth-input${m.first_name?` !border-red-300 !bg-red-50/50`:``}`}),m.first_name&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:m.first_name})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`last_name`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Last name`}),(0,s.jsx)(`input`,{id:`last_name`,type:`text`,autoComplete:`family-name`,value:u.last_name,onChange:e=>d(`last_name`,e.target.value),placeholder:`Johnson`,className:`auth-input${m.last_name?` !border-red-300 !bg-red-50/50`:``}`}),m.last_name&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:m.last_name})]})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`email`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Email address`}),(0,s.jsx)(`input`,{id:`email`,type:`email`,autoComplete:`email`,value:u.email,onChange:e=>d(`email`,e.target.value),placeholder:`you@company.com`,className:`auth-input${m.email?` !border-red-300 !bg-red-50/50`:``}`}),m.email&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:m.email})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`password`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Password`}),(0,s.jsx)(`input`,{id:`password`,type:`password`,autoComplete:`new-password`,value:u.password,onChange:e=>d(`password`,e.target.value),placeholder:`Min. 8 characters`,className:`auth-input${m.password?` !border-red-300 !bg-red-50/50`:``}`}),m.password&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:m.password})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`password_confirmation`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Confirm password`}),(0,s.jsx)(`input`,{id:`password_confirmation`,type:`password`,autoComplete:`new-password`,value:u.password_confirmation,onChange:e=>d(`password_confirmation`,e.target.value),placeholder:`••••••••`,className:`auth-input${m.password_confirmation?` !border-red-300 !bg-red-50/50`:``}`}),m.password_confirmation&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:m.password_confirmation})]})]}),(0,s.jsx)(`button`,{type:`submit`,disabled:p,className:`mt-6 w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,s.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,s.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Creating account…`]}):`Create account`})]}),(0,s.jsxs)(`p`,{className:`mt-7 text-center text-sm text-gray-400 font-medium anim-fade`,style:{animationDelay:`0.22s`},children:[`Already have an account?`,` `,(0,s.jsx)(i,{href:route(`login`),className:`text-[#3D4E4B] font-semibold hover:text-[#D4A017] transition-colors duration-200`,children:`Sign in`})]})]}):(0,s.jsxs)(o,{children:[(0,s.jsx)(n,{title:`Registration Closed`}),(0,s.jsxs)(`div`,{className:`anim-fade`,children:[(0,s.jsx)(`div`,{className:`w-12 h-12 bg-amber-50 border border-amber-100 rounded-2xl flex items-center justify-center mb-6`,children:(0,s.jsx)(`svg`,{className:`w-5 h-5 text-amber-600`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`})})}),(0,s.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Registration closed`}),(0,s.jsx)(`p`,{className:`mt-2 text-sm text-gray-400 font-medium`,children:`New account registration is currently disabled by the administrator.`}),(0,s.jsx)(`div`,{className:`mt-8 pt-6 border-t border-gray-100`,children:(0,s.jsx)(i,{href:route(`login`),className:`text-sm font-semibold text-[#3D4E4B] hover:text-[#D4A017] transition-colors duration-200`,children:`← Back to sign in`})})]})]})}export{c as default}; \ No newline at end of file +import{a as e,c as t,n,o as r,r as i,t as a}from"./app-C2kGDHB9.js";import{t as o}from"./GuestLayout-DfP8Xy7D.js";t();var s=a();function c(){let{system_settings:t}=r().props,a=t?.allow_registration===`1`||t?.allow_registration===!0,c=t?.oauth_google_enabled===`1`||t?.oauth_google_enabled===!0,l=t?.oauth_github_enabled===`1`||t?.oauth_github_enabled===!0,{data:u,setData:d,post:f,processing:p,errors:m,reset:h}=e({first_name:``,last_name:``,email:``,password:``,password_confirmation:``});return a?(0,s.jsxs)(o,{children:[(0,s.jsx)(n,{title:`Create account`}),(0,s.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,s.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Create account`}),(0,s.jsx)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium`,children:`Fill in your details to get started.`})]}),(c||l)&&(0,s.jsxs)(`div`,{className:`mb-6 anim-up`,style:{animationDelay:`0.08s`},children:[(0,s.jsxs)(`div`,{className:`grid gap-3 ${c&&l?`grid-cols-2`:`grid-cols-1`}`,children:[c&&(0,s.jsxs)(`a`,{href:`/auth/google/redirect`,className:`flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 hover:border-gray-300 transition-colors duration-200 text-sm font-semibold text-gray-700`,children:[(0,s.jsxs)(`svg`,{className:`w-4 h-4 shrink-0`,viewBox:`0 0 24 24`,children:[(0,s.jsx)(`path`,{fill:`#EA4335`,d:`M12 5c1.61 0 3.09.59 4.23 1.57l3.12-3.12C17.35 1.67 14.85 1 12 1 7.73 1 4.14 3.48 2.46 7.1l3.71 2.87C7.04 7.09 9.34 5 12 5z`}),(0,s.jsx)(`path`,{fill:`#4285F4`,d:`M23.49 12.27c0-.79-.07-1.54-.19-2.27H12v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58l3.7 2.87c2.16-2 3.72-4.94 3.72-8.69z`}),(0,s.jsx)(`path`,{fill:`#FBBC05`,d:`M6.17 14.77l-3.71 2.87C4.14 21.27 7.73 23 12 23c2.97 0 5.48-1 7.37-2.69l-3.7-2.87c-1.03.69-2.35 1.11-3.67 1.11-2.66 0-4.96-2.09-5.83-4.78z`}),(0,s.jsx)(`path`,{fill:`#34A853`,d:`M12 19.45c1.32 0 2.64-.42 3.67-1.11l3.7 2.87C17.48 22 14.97 23 12 23 7.73 23 4.14 21.27 2.47 17.64l3.71-2.87c.86 2.69 3.16 4.68 5.82 4.68z`})]}),`Google`]}),l&&(0,s.jsxs)(`a`,{href:`/auth/github/redirect`,className:`flex items-center justify-center gap-2.5 px-4 py-2.5 rounded-xl border border-gray-200 bg-white hover:bg-gray-50 hover:border-gray-300 transition-colors duration-200 text-sm font-semibold text-gray-700`,children:[(0,s.jsx)(`svg`,{className:`w-4 h-4 shrink-0`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,s.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})}),`GitHub`]})]}),(0,s.jsxs)(`div`,{className:`relative my-6`,children:[(0,s.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,s.jsx)(`div`,{className:`w-full border-t border-gray-100`})}),(0,s.jsx)(`div`,{className:`relative flex justify-center`,children:(0,s.jsx)(`span`,{className:`px-3 bg-white text-xs font-semibold text-gray-300 uppercase tracking-widest`,children:`or`})})]})]}),(0,s.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f(route(`register`),{onFinish:()=>h(`password`,`password_confirmation`)})},className:`anim-up`,style:{animationDelay:`0.14s`},children:[(0,s.jsxs)(`div`,{className:`space-y-4`,children:[(0,s.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`first_name`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`First name`}),(0,s.jsx)(`input`,{id:`first_name`,type:`text`,autoComplete:`given-name`,autoFocus:!0,value:u.first_name,onChange:e=>d(`first_name`,e.target.value),placeholder:`Alex`,className:`auth-input${m.first_name?` !border-red-300 !bg-red-50/50`:``}`}),m.first_name&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:m.first_name})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`last_name`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Last name`}),(0,s.jsx)(`input`,{id:`last_name`,type:`text`,autoComplete:`family-name`,value:u.last_name,onChange:e=>d(`last_name`,e.target.value),placeholder:`Johnson`,className:`auth-input${m.last_name?` !border-red-300 !bg-red-50/50`:``}`}),m.last_name&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:m.last_name})]})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`email`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Email address`}),(0,s.jsx)(`input`,{id:`email`,type:`email`,autoComplete:`email`,value:u.email,onChange:e=>d(`email`,e.target.value),placeholder:`you@company.com`,className:`auth-input${m.email?` !border-red-300 !bg-red-50/50`:``}`}),m.email&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:m.email})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`password`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Password`}),(0,s.jsx)(`input`,{id:`password`,type:`password`,autoComplete:`new-password`,value:u.password,onChange:e=>d(`password`,e.target.value),placeholder:`Min. 8 characters`,className:`auth-input${m.password?` !border-red-300 !bg-red-50/50`:``}`}),m.password&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:m.password})]}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`label`,{htmlFor:`password_confirmation`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Confirm password`}),(0,s.jsx)(`input`,{id:`password_confirmation`,type:`password`,autoComplete:`new-password`,value:u.password_confirmation,onChange:e=>d(`password_confirmation`,e.target.value),placeholder:`••••••••`,className:`auth-input${m.password_confirmation?` !border-red-300 !bg-red-50/50`:``}`}),m.password_confirmation&&(0,s.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:m.password_confirmation})]})]}),(0,s.jsx)(`button`,{type:`submit`,disabled:p,className:`mt-6 w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,s.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,s.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Creating account…`]}):`Create account`})]}),(0,s.jsxs)(`p`,{className:`mt-7 text-center text-sm text-gray-400 font-medium anim-fade`,style:{animationDelay:`0.22s`},children:[`Already have an account?`,` `,(0,s.jsx)(i,{href:route(`login`),className:`text-[#3D4E4B] font-semibold hover:text-[#D4A017] transition-colors duration-200`,children:`Sign in`})]})]}):(0,s.jsxs)(o,{children:[(0,s.jsx)(n,{title:`Registration Closed`}),(0,s.jsxs)(`div`,{className:`anim-fade`,children:[(0,s.jsx)(`div`,{className:`w-12 h-12 bg-amber-50 border border-amber-100 rounded-2xl flex items-center justify-center mb-6`,children:(0,s.jsx)(`svg`,{className:`w-5 h-5 text-amber-600`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,s.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`})})}),(0,s.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Registration closed`}),(0,s.jsx)(`p`,{className:`mt-2 text-sm text-gray-400 font-medium`,children:`New account registration is currently disabled by the administrator.`}),(0,s.jsx)(`div`,{className:`mt-8 pt-6 border-t border-gray-100`,children:(0,s.jsx)(i,{href:route(`login`),className:`text-sm font-semibold text-[#3D4E4B] hover:text-[#D4A017] transition-colors duration-200`,children:`← Back to sign in`})})]})]})}export{c as default}; \ No newline at end of file diff --git a/public/build/assets/ResetPassword-Cp8_si20.js b/public/build/assets/ResetPassword-CIvssuDm.js similarity index 95% rename from public/build/assets/ResetPassword-Cp8_si20.js rename to public/build/assets/ResetPassword-CIvssuDm.js index 37a36b2..26f4a28 100644 --- a/public/build/assets/ResetPassword-Cp8_si20.js +++ b/public/build/assets/ResetPassword-CIvssuDm.js @@ -1 +1 @@ -import{a as e,c as t,n,t as r}from"./app-BK5KCPMc.js";import{t as i}from"./GuestLayout-CgPUg7Kz.js";t();var a=r();function o({token:t,email:r}){let{data:o,setData:s,post:c,processing:l,errors:u,reset:d}=e({token:t,email:r,password:``,password_confirmation:``});return(0,a.jsxs)(i,{children:[(0,a.jsx)(n,{title:`Reset password`}),(0,a.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,a.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Set new password`}),(0,a.jsxs)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium`,children:[`Choose a strong password for `,(0,a.jsx)(`span`,{className:`text-[#3D4E4B] font-semibold`,children:r}),`.`]})]}),(0,a.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),c(route(`password.store`),{onFinish:()=>d(`password`,`password_confirmation`)})},className:`space-y-4 anim-up`,style:{animationDelay:`0.1s`},children:[(0,a.jsx)(`input`,{type:`hidden`,value:o.email}),(0,a.jsx)(`input`,{type:`hidden`,value:o.token}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`label`,{htmlFor:`password`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`New password`}),(0,a.jsx)(`input`,{id:`password`,type:`password`,autoComplete:`new-password`,autoFocus:!0,value:o.password,onChange:e=>s(`password`,e.target.value),placeholder:`Min. 8 characters`,className:`auth-input${u.password?` !border-red-300 !bg-red-50/50`:``}`}),u.password&&(0,a.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:u.password})]}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`label`,{htmlFor:`password_confirmation`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Confirm new password`}),(0,a.jsx)(`input`,{id:`password_confirmation`,type:`password`,autoComplete:`new-password`,value:o.password_confirmation,onChange:e=>s(`password_confirmation`,e.target.value),placeholder:`••••••••`,className:`auth-input${u.password_confirmation?` !border-red-300 !bg-red-50/50`:``}`}),u.password_confirmation&&(0,a.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:u.password_confirmation})]}),(0,a.jsx)(`button`,{type:`submit`,disabled:l,className:`mt-2 w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,a.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,a.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Saving…`]}):`Reset password`})]})]})}export{o as default}; \ No newline at end of file +import{a as e,c as t,n,t as r}from"./app-C2kGDHB9.js";import{t as i}from"./GuestLayout-DfP8Xy7D.js";t();var a=r();function o({token:t,email:r}){let{data:o,setData:s,post:c,processing:l,errors:u,reset:d}=e({token:t,email:r,password:``,password_confirmation:``});return(0,a.jsxs)(i,{children:[(0,a.jsx)(n,{title:`Reset password`}),(0,a.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,a.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Set new password`}),(0,a.jsxs)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium`,children:[`Choose a strong password for `,(0,a.jsx)(`span`,{className:`text-[#3D4E4B] font-semibold`,children:r}),`.`]})]}),(0,a.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),c(route(`password.store`),{onFinish:()=>d(`password`,`password_confirmation`)})},className:`space-y-4 anim-up`,style:{animationDelay:`0.1s`},children:[(0,a.jsx)(`input`,{type:`hidden`,value:o.email}),(0,a.jsx)(`input`,{type:`hidden`,value:o.token}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`label`,{htmlFor:`password`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`New password`}),(0,a.jsx)(`input`,{id:`password`,type:`password`,autoComplete:`new-password`,autoFocus:!0,value:o.password,onChange:e=>s(`password`,e.target.value),placeholder:`Min. 8 characters`,className:`auth-input${u.password?` !border-red-300 !bg-red-50/50`:``}`}),u.password&&(0,a.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:u.password})]}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`label`,{htmlFor:`password_confirmation`,className:`block text-sm font-semibold text-gray-600 mb-1.5`,children:`Confirm new password`}),(0,a.jsx)(`input`,{id:`password_confirmation`,type:`password`,autoComplete:`new-password`,value:o.password_confirmation,onChange:e=>s(`password_confirmation`,e.target.value),placeholder:`••••••••`,className:`auth-input${u.password_confirmation?` !border-red-300 !bg-red-50/50`:``}`}),u.password_confirmation&&(0,a.jsx)(`p`,{className:`mt-1.5 text-xs font-semibold text-red-500`,children:u.password_confirmation})]}),(0,a.jsx)(`button`,{type:`submit`,disabled:l,className:`mt-2 w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,a.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,a.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Saving…`]}):`Reset password`})]})]})}export{o as default}; \ No newline at end of file diff --git a/public/build/assets/Setup-D7-GiQxF.js b/public/build/assets/Setup-BG3giU65.js similarity index 97% rename from public/build/assets/Setup-D7-GiQxF.js rename to public/build/assets/Setup-BG3giU65.js index 83a977e..e002494 100644 --- a/public/build/assets/Setup-D7-GiQxF.js +++ b/public/build/assets/Setup-BG3giU65.js @@ -1 +1 @@ -import{a as e,c as t,d as n,i as r,n as i,t as a}from"./app-BK5KCPMc.js";import{t as o}from"./AuthenticatedLayout-BjuyW-Hp.js";import{n as s,t as c}from"./swal-D8hRpOIh.js";var l=n(t(),1),u=n(s(),1),d=a();function f({enabled:t,qr_code:n,secret:a,recovery_codes:s}){let[f,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)(!1),{data:g,setData:_,post:v,processing:y,errors:b,reset:x}=e({code:``});return e({password:``}),(0,d.jsxs)(o,{children:[(0,d.jsx)(i,{title:`Two-Factor Authentication`}),(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] dark:text-white tracking-tight leading-none`,children:`Two-Factor Authentication`}),(0,d.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Protect your account with an additional verification step`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold ${t?`bg-emerald-50 text-emerald-700 border border-emerald-200`:`bg-amber-50 text-amber-700 border border-amber-200`}`,children:[(0,d.jsx)(`span`,{className:`w-2 h-2 rounded-full ${t?`bg-emerald-500`:`bg-amber-400`}`}),t?`2FA Active`:`2FA Not Enabled`]})]}),(0,d.jsxs)(`div`,{className:`max-w-3xl space-y-6`,children:[(0,d.jsxs)(`div`,{className:`p-5 bg-amber-50 border border-amber-200 rounded-2xl flex items-start gap-3 anim-down`,children:[(0,d.jsx)(`svg`,{className:`w-5 h-5 text-amber-500 mt-0.5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z`})}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-xs font-bold text-amber-800 mb-1`,children:`What is Two-Factor Authentication?`}),(0,d.jsx)(`p`,{className:`text-[11px] text-amber-700 font-medium leading-relaxed`,children:`2FA adds an extra layer of security by requiring a one-time code from your authenticator app in addition to your password when signing in.`})]})]}),t?(0,d.jsxs)(`div`,{className:`space-y-4`,children:[(0,d.jsxs)(`div`,{className:`bg-white rounded-2xl border border-emerald-100 shadow-sm p-6 flex items-center gap-4 anim-up`,children:[(0,d.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-emerald-50 flex items-center justify-center shrink-0`,children:(0,d.jsx)(`svg`,{className:`w-6 h-6 text-emerald-600`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})})}),(0,d.jsxs)(`div`,{className:`flex-1`,children:[(0,d.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Two-Factor Authentication is Active`}),(0,d.jsx)(`div`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:`Your account is secured with TOTP authentication.`})]}),(0,d.jsx)(`button`,{onClick:async()=>{let{value:e}=await u.default.fire({title:`Disable 2FA`,text:`Enter your password to confirm disabling Two-Factor Authentication.`,input:`password`,inputPlaceholder:`Your current password`,showCancelButton:!0,confirmButtonText:`Disable`,confirmButtonColor:`#dc2626`});e&&r.post(route(`two-factor.disable`),{password:e},{preserveScroll:!0,onSuccess:()=>c.success(`Disabled`,`2FA has been disabled.`)})},className:`h-9 px-5 text-xs font-bold text-red-500 border border-red-200 rounded-xl hover:bg-red-50 transition-all`,children:`Disable 2FA`})]}),(0,d.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden anim-up`,style:{animationDelay:`0.05s`},children:[(0,d.jsxs)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30 flex items-center justify-between`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Recovery Codes`}),(0,d.jsx)(`p`,{className:`text-xs text-gray-400 font-semibold mt-1`,children:`Store these codes safely — use them if you lose access to your authenticator`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(`button`,{onClick:()=>h(!m),className:`h-8 px-4 text-xs font-bold text-[#3D4E4B] border border-gray-200 rounded-lg hover:bg-gray-50 transition-all`,children:m?`Hide`:`Show`}),(0,d.jsx)(`button`,{onClick:async()=>{(await c.confirm(`Regenerate Codes?`,`Old recovery codes will be invalidated immediately.`,`Regenerate`)).isConfirmed&&r.post(route(`two-factor.recovery-codes`),{},{preserveScroll:!0,onSuccess:()=>{h(!0),c.success(`Regenerated`,`New recovery codes have been generated.`)}})},className:`h-8 px-4 text-xs font-bold text-[#D4A017] border border-amber-200 rounded-lg hover:bg-amber-50 transition-all`,children:`Regenerate`})]})]}),m&&s.length>0&&(0,d.jsxs)(`div`,{className:`p-6`,children:[(0,d.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:s.map((e,t)=>(0,d.jsx)(`code`,{className:`px-4 py-2.5 bg-gray-50 border border-gray-100 rounded-xl text-xs font-mono text-[#3D4E4B] tracking-wider text-center`,children:e},t))}),(0,d.jsx)(`p`,{className:`text-[11px] text-amber-600 font-semibold mt-4`,children:`⚠ Each code can only be used once. Regenerate if compromised.`})]})]})]}):(0,d.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden anim-up`,children:[(0,d.jsxs)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:[(0,d.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Setup Authenticator App`}),(0,d.jsx)(`p`,{className:`text-xs text-gray-400 font-semibold mt-1`,children:`Scan the QR code with Google Authenticator, Authy, or any TOTP app`})]}),(0,d.jsx)(`div`,{className:`p-8`,children:(0,d.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-10 items-center md:items-start`,children:[(0,d.jsx)(`div`,{className:`shrink-0`,children:(0,d.jsx)(`div`,{className:`p-4 bg-white border-2 border-gray-100 rounded-2xl inline-block shadow-sm`,children:(0,d.jsx)(`img`,{src:n,alt:`2FA QR Code`,className:`w-48 h-48`})})}),(0,d.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[(0,d.jsx)(`div`,{className:`space-y-4`,children:[`Install an authenticator app (Google Authenticator, Authy, 1Password)`,`Scan the QR code or enter the manual key below`,`Enter the 6-digit code from your app to verify and activate`].map((e,t)=>(0,d.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,d.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-[#3D4E4B] text-white text-[10px] font-black flex items-center justify-center shrink-0 mt-0.5`,children:t+1}),(0,d.jsx)(`p`,{className:`text-xs font-medium text-gray-500 leading-relaxed pt-0.5`,children:e})]},t))}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`block text-xs font-semibold text-gray-400 mb-1.5`,children:`Manual Key`}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(`code`,{className:`flex-1 text-xs font-mono bg-gray-50 border border-gray-100 rounded-xl px-4 py-3 text-[#3D4E4B] tracking-wider`,children:a}),(0,d.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(a),p(!0),setTimeout(()=>p(!1),2e3)},className:`shrink-0 h-11 px-4 border border-gray-200 rounded-xl text-xs font-bold text-gray-500 hover:bg-gray-50 transition-all`,children:f?`✓ Copied`:`Copy`})]})]}),(0,d.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),v(route(`two-factor.enable`),{preserveScroll:!0,onSuccess:()=>{x(),c.success(`Enabled`,`2FA is now active on your account.`)}})},className:`space-y-3`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`block text-xs font-semibold text-gray-400 mb-1.5`,children:`Verification Code *`}),(0,d.jsx)(`input`,{type:`text`,inputMode:`numeric`,maxLength:6,value:g.code,onChange:e=>_(`code`,e.target.value),className:`input-field w-full text-center tracking-[0.5em] font-bold text-lg`,placeholder:`000000`}),b.code&&(0,d.jsx)(`p`,{className:`text-xs text-red-500 font-semibold mt-1`,children:b.code})]}),(0,d.jsx)(`button`,{type:`submit`,disabled:y||g.code.length<6,className:`w-full h-11 bg-[#3D4E4B] text-white text-xs font-bold rounded-xl hover:bg-[#2D3A38] transition-all disabled:opacity-60`,children:y?`Verifying...`:`Enable Two-Factor Authentication`})]})]})]})})]})]})]})}export{f as default}; \ No newline at end of file +import{a as e,c as t,d as n,i as r,n as i,t as a}from"./app-C2kGDHB9.js";import{t as o}from"./AuthenticatedLayout-C8h2HS7D.js";import{n as s,t as c}from"./swal-DeDNECCu.js";var l=n(t(),1),u=n(s(),1),d=a();function f({enabled:t,qr_code:n,secret:a,recovery_codes:s}){let[f,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)(!1),{data:g,setData:_,post:v,processing:y,errors:b,reset:x}=e({code:``});return e({password:``}),(0,d.jsxs)(o,{children:[(0,d.jsx)(i,{title:`Two-Factor Authentication`}),(0,d.jsxs)(`div`,{className:`flex items-center justify-between mb-8 anim-down`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h1`,{className:`text-xl font-bold text-[#3D4E4B] dark:text-white tracking-tight leading-none`,children:`Two-Factor Authentication`}),(0,d.jsx)(`p`,{className:`text-sm font-semibold text-gray-400 tracking-tight mt-2`,children:`Protect your account with an additional verification step`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold ${t?`bg-emerald-50 text-emerald-700 border border-emerald-200`:`bg-amber-50 text-amber-700 border border-amber-200`}`,children:[(0,d.jsx)(`span`,{className:`w-2 h-2 rounded-full ${t?`bg-emerald-500`:`bg-amber-400`}`}),t?`2FA Active`:`2FA Not Enabled`]})]}),(0,d.jsxs)(`div`,{className:`max-w-3xl space-y-6`,children:[(0,d.jsxs)(`div`,{className:`p-5 bg-amber-50 border border-amber-200 rounded-2xl flex items-start gap-3 anim-down`,children:[(0,d.jsx)(`svg`,{className:`w-5 h-5 text-amber-500 mt-0.5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z`})}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-xs font-bold text-amber-800 mb-1`,children:`What is Two-Factor Authentication?`}),(0,d.jsx)(`p`,{className:`text-[11px] text-amber-700 font-medium leading-relaxed`,children:`2FA adds an extra layer of security by requiring a one-time code from your authenticator app in addition to your password when signing in.`})]})]}),t?(0,d.jsxs)(`div`,{className:`space-y-4`,children:[(0,d.jsxs)(`div`,{className:`bg-white rounded-2xl border border-emerald-100 shadow-sm p-6 flex items-center gap-4 anim-up`,children:[(0,d.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-emerald-50 flex items-center justify-center shrink-0`,children:(0,d.jsx)(`svg`,{className:`w-6 h-6 text-emerald-600`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2.5,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})})}),(0,d.jsxs)(`div`,{className:`flex-1`,children:[(0,d.jsx)(`div`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Two-Factor Authentication is Active`}),(0,d.jsx)(`div`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:`Your account is secured with TOTP authentication.`})]}),(0,d.jsx)(`button`,{onClick:async()=>{let{value:e}=await u.default.fire({title:`Disable 2FA`,text:`Enter your password to confirm disabling Two-Factor Authentication.`,input:`password`,inputPlaceholder:`Your current password`,showCancelButton:!0,confirmButtonText:`Disable`,confirmButtonColor:`#dc2626`});e&&r.post(route(`two-factor.disable`),{password:e},{preserveScroll:!0,onSuccess:()=>c.success(`Disabled`,`2FA has been disabled.`)})},className:`h-9 px-5 text-xs font-bold text-red-500 border border-red-200 rounded-xl hover:bg-red-50 transition-all`,children:`Disable 2FA`})]}),(0,d.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden anim-up`,style:{animationDelay:`0.05s`},children:[(0,d.jsxs)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30 flex items-center justify-between`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Recovery Codes`}),(0,d.jsx)(`p`,{className:`text-xs text-gray-400 font-semibold mt-1`,children:`Store these codes safely — use them if you lose access to your authenticator`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(`button`,{onClick:()=>h(!m),className:`h-8 px-4 text-xs font-bold text-[#3D4E4B] border border-gray-200 rounded-lg hover:bg-gray-50 transition-all`,children:m?`Hide`:`Show`}),(0,d.jsx)(`button`,{onClick:async()=>{(await c.confirm(`Regenerate Codes?`,`Old recovery codes will be invalidated immediately.`,`Regenerate`)).isConfirmed&&r.post(route(`two-factor.recovery-codes`),{},{preserveScroll:!0,onSuccess:()=>{h(!0),c.success(`Regenerated`,`New recovery codes have been generated.`)}})},className:`h-8 px-4 text-xs font-bold text-[#D4A017] border border-amber-200 rounded-lg hover:bg-amber-50 transition-all`,children:`Regenerate`})]})]}),m&&s.length>0&&(0,d.jsxs)(`div`,{className:`p-6`,children:[(0,d.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:s.map((e,t)=>(0,d.jsx)(`code`,{className:`px-4 py-2.5 bg-gray-50 border border-gray-100 rounded-xl text-xs font-mono text-[#3D4E4B] tracking-wider text-center`,children:e},t))}),(0,d.jsx)(`p`,{className:`text-[11px] text-amber-600 font-semibold mt-4`,children:`⚠ Each code can only be used once. Regenerate if compromised.`})]})]})]}):(0,d.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden anim-up`,children:[(0,d.jsxs)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:[(0,d.jsx)(`h2`,{className:`text-sm font-bold text-[#3D4E4B]`,children:`Setup Authenticator App`}),(0,d.jsx)(`p`,{className:`text-xs text-gray-400 font-semibold mt-1`,children:`Scan the QR code with Google Authenticator, Authy, or any TOTP app`})]}),(0,d.jsx)(`div`,{className:`p-8`,children:(0,d.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-10 items-center md:items-start`,children:[(0,d.jsx)(`div`,{className:`shrink-0`,children:(0,d.jsx)(`div`,{className:`p-4 bg-white border-2 border-gray-100 rounded-2xl inline-block shadow-sm`,children:(0,d.jsx)(`img`,{src:n,alt:`2FA QR Code`,className:`w-48 h-48`})})}),(0,d.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[(0,d.jsx)(`div`,{className:`space-y-4`,children:[`Install an authenticator app (Google Authenticator, Authy, 1Password)`,`Scan the QR code or enter the manual key below`,`Enter the 6-digit code from your app to verify and activate`].map((e,t)=>(0,d.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,d.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-[#3D4E4B] text-white text-[10px] font-black flex items-center justify-center shrink-0 mt-0.5`,children:t+1}),(0,d.jsx)(`p`,{className:`text-xs font-medium text-gray-500 leading-relaxed pt-0.5`,children:e})]},t))}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`block text-xs font-semibold text-gray-400 mb-1.5`,children:`Manual Key`}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(`code`,{className:`flex-1 text-xs font-mono bg-gray-50 border border-gray-100 rounded-xl px-4 py-3 text-[#3D4E4B] tracking-wider`,children:a}),(0,d.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(a),p(!0),setTimeout(()=>p(!1),2e3)},className:`shrink-0 h-11 px-4 border border-gray-200 rounded-xl text-xs font-bold text-gray-500 hover:bg-gray-50 transition-all`,children:f?`✓ Copied`:`Copy`})]})]}),(0,d.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),v(route(`two-factor.enable`),{preserveScroll:!0,onSuccess:()=>{x(),c.success(`Enabled`,`2FA is now active on your account.`)}})},className:`space-y-3`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`label`,{className:`block text-xs font-semibold text-gray-400 mb-1.5`,children:`Verification Code *`}),(0,d.jsx)(`input`,{type:`text`,inputMode:`numeric`,maxLength:6,value:g.code,onChange:e=>_(`code`,e.target.value),className:`input-field w-full text-center tracking-[0.5em] font-bold text-lg`,placeholder:`000000`}),b.code&&(0,d.jsx)(`p`,{className:`text-xs text-red-500 font-semibold mt-1`,children:b.code})]}),(0,d.jsx)(`button`,{type:`submit`,disabled:y||g.code.length<6,className:`w-full h-11 bg-[#3D4E4B] text-white text-xs font-bold rounded-xl hover:bg-[#2D3A38] transition-all disabled:opacity-60`,children:y?`Verifying...`:`Enable Two-Factor Authentication`})]})]})]})})]})]})]})}export{f as default}; \ No newline at end of file diff --git a/public/build/assets/Show-BhGooyPq.js b/public/build/assets/Show-BOefHxwU.js similarity index 98% rename from public/build/assets/Show-BhGooyPq.js rename to public/build/assets/Show-BOefHxwU.js index 5f1bb80..6842c41 100644 --- a/public/build/assets/Show-BhGooyPq.js +++ b/public/build/assets/Show-BOefHxwU.js @@ -1 +1 @@ -import{c as e,n as t,r as n,t as r}from"./app-BK5KCPMc.js";import{t as i}from"./AuthenticatedLayout-BjuyW-Hp.js";e();var a=r();function o({label:e,children:t}){return(0,a.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-0 py-3.5 border-b border-gray-50 last:border-0`,children:[(0,a.jsx)(`dt`,{className:`text-xs font-semibold text-gray-500 sm:w-44 shrink-0 mt-0.5`,children:e}),(0,a.jsx)(`dd`,{className:`text-sm font-semibold text-[#3D4E4B] tracking-tight`,children:t})]})}function s({viewUser:e}){let r=`${e.first_name?.charAt(0)||``}${e.last_name?.charAt(0)||``}`.toUpperCase();return(0,a.jsxs)(i,{children:[(0,a.jsx)(t,{title:`${e.first_name} ${e.last_name} — Users`}),(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-sm mb-6 anim-fade`,children:[(0,a.jsx)(n,{href:`/users`,className:`text-gray-400 hover:text-[#3D4E4B] transition-colors font-semibold`,children:`Users`}),(0,a.jsx)(`svg`,{className:`w-3.5 h-3.5 text-gray-300`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 5l7 7-7 7`})}),(0,a.jsxs)(`span`,{className:`text-[#3D4E4B] font-bold`,children:[e.first_name,` `,e.last_name]})]}),(0,a.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6`,children:[(0,a.jsxs)(`div`,{className:`lg:col-span-1 space-y-4 anim-up`,children:[(0,a.jsx)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm p-6`,children:(0,a.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,a.jsx)(`div`,{className:`w-20 h-20 rounded-2xl bg-[#3D4E4B] flex items-center justify-center text-white text-2xl font-bold overflow-hidden mb-4`,children:e.avatar_url?(0,a.jsx)(`img`,{src:e.avatar_url,className:`w-full h-full object-cover`,alt:``}):r}),(0,a.jsxs)(`h2`,{className:`text-base font-bold text-[#3D4E4B] tracking-tight`,children:[e.first_name,` `,e.last_name]}),(0,a.jsx)(`p`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:e.email}),(0,a.jsx)(`div`,{className:`flex flex-wrap justify-center gap-1.5 mt-3`,children:e.roles?.map(e=>(0,a.jsx)(`span`,{className:`px-2.5 py-1 text-xs font-bold bg-white text-gray-500 border border-gray-100 rounded-md`,children:e.name||e},e.name||e))}),(0,a.jsx)(`div`,{className:`mt-4`,children:(0,a.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold border ${e.status===`active`?`text-green-600 bg-white border-green-100`:`text-gray-400 bg-white border-gray-100`}`,children:[(0,a.jsx)(`span`,{className:`w-1 h-1 rounded-full ${e.status===`active`?`bg-green-500`:`bg-gray-300`}`}),e.status===`active`?`Active`:`Inactive`]})})]})}),(0,a.jsx)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm p-4 space-y-1`,children:(0,a.jsxs)(n,{href:`/users`,className:`flex items-center gap-3 px-3 py-2.5 rounded-xl text-sm font-semibold text-gray-500 hover:bg-gray-50 hover:text-[#3D4E4B] transition-colors w-full`,children:[(0,a.jsx)(`svg`,{className:`w-4 h-4 text-gray-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10 19l-7-7m0 0l7-7m-7 7h18`})}),`Back to Users`]})})]}),(0,a.jsxs)(`div`,{className:`lg:col-span-2 space-y-4 anim-up`,style:{animationDelay:`0.08s`},children:[(0,a.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden`,children:[(0,a.jsx)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:(0,a.jsx)(`h3`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Personal Information`})}),(0,a.jsx)(`div`,{className:`px-6`,children:(0,a.jsxs)(`dl`,{children:[(0,a.jsx)(o,{label:`First name`,children:e.first_name}),(0,a.jsx)(o,{label:`Last name`,children:e.last_name}),(0,a.jsx)(o,{label:`Email`,children:e.email}),(0,a.jsx)(o,{label:`User ID`,children:(0,a.jsxs)(`span`,{className:`font-mono text-gray-400 text-xs`,children:[`#`,e.id]})})]})})]}),(0,a.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden`,children:[(0,a.jsx)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:(0,a.jsx)(`h3`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Roles & Permissions`})}),(0,a.jsxs)(`div`,{className:`p-6 space-y-5`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-xs font-semibold text-gray-400 tracking-tight mb-2`,children:`Assigned Roles`}),(0,a.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.roles?.length?e.roles.map(e=>(0,a.jsx)(`span`,{className:`px-3 py-1.5 text-xs font-bold bg-[#3D4E4B] text-white rounded-lg`,children:e.name||e},e.name||e)):(0,a.jsx)(`span`,{className:`text-sm text-gray-400 font-semibold`,children:`No roles assigned`})})]}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-xs font-semibold text-gray-400 tracking-tight mb-2`,children:`Granted Permissions`}),(0,a.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 gap-1.5`,children:e.permissions?.length?e.permissions.map(e=>(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-gray-600 font-semibold bg-gray-50 border border-gray-100 px-2.5 py-1.5 rounded-lg`,children:[(0,a.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-[#21A59F] shrink-0`}),e.name||e]},e.name||e)):(0,a.jsx)(`span`,{className:`text-sm text-gray-400 font-semibold col-span-full`,children:`Inherited from roles`})})]})]})]}),(0,a.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden`,children:[(0,a.jsx)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:(0,a.jsx)(`h3`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Activity Timeline`})}),(0,a.jsxs)(`div`,{className:`p-6 space-y-4`,children:[(0,a.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,a.jsx)(`div`,{className:`w-8 h-8 rounded-xl bg-[#E3EBE8] flex items-center justify-center shrink-0`,children:(0,a.jsx)(`svg`,{className:`w-4 h-4 text-[#3D4E4B]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 4v16m8-8H4`})})}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Account Created`}),(0,a.jsx)(`p`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:new Date(e.created_at).toLocaleDateString(`en-US`,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`})})]})]}),(0,a.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,a.jsx)(`div`,{className:`w-8 h-8 rounded-xl bg-[#E3EBE8] flex items-center justify-center shrink-0`,children:(0,a.jsx)(`svg`,{className:`w-4 h-4 text-[#3D4E4B]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`})})}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Last Updated`}),(0,a.jsx)(`p`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:new Date(e.updated_at).toLocaleDateString(`en-US`,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`})})]})]})]})]})]})]})]})}export{s as default}; \ No newline at end of file +import{c as e,n as t,r as n,t as r}from"./app-C2kGDHB9.js";import{t as i}from"./AuthenticatedLayout-C8h2HS7D.js";e();var a=r();function o({label:e,children:t}){return(0,a.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-0 py-3.5 border-b border-gray-50 last:border-0`,children:[(0,a.jsx)(`dt`,{className:`text-xs font-semibold text-gray-500 sm:w-44 shrink-0 mt-0.5`,children:e}),(0,a.jsx)(`dd`,{className:`text-sm font-semibold text-[#3D4E4B] tracking-tight`,children:t})]})}function s({viewUser:e}){let r=`${e.first_name?.charAt(0)||``}${e.last_name?.charAt(0)||``}`.toUpperCase();return(0,a.jsxs)(i,{children:[(0,a.jsx)(t,{title:`${e.first_name} ${e.last_name} — Users`}),(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-sm mb-6 anim-fade`,children:[(0,a.jsx)(n,{href:`/users`,className:`text-gray-400 hover:text-[#3D4E4B] transition-colors font-semibold`,children:`Users`}),(0,a.jsx)(`svg`,{className:`w-3.5 h-3.5 text-gray-300`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 5l7 7-7 7`})}),(0,a.jsxs)(`span`,{className:`text-[#3D4E4B] font-bold`,children:[e.first_name,` `,e.last_name]})]}),(0,a.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6`,children:[(0,a.jsxs)(`div`,{className:`lg:col-span-1 space-y-4 anim-up`,children:[(0,a.jsx)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm p-6`,children:(0,a.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,a.jsx)(`div`,{className:`w-20 h-20 rounded-2xl bg-[#3D4E4B] flex items-center justify-center text-white text-2xl font-bold overflow-hidden mb-4`,children:e.avatar_url?(0,a.jsx)(`img`,{src:e.avatar_url,className:`w-full h-full object-cover`,alt:``}):r}),(0,a.jsxs)(`h2`,{className:`text-base font-bold text-[#3D4E4B] tracking-tight`,children:[e.first_name,` `,e.last_name]}),(0,a.jsx)(`p`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:e.email}),(0,a.jsx)(`div`,{className:`flex flex-wrap justify-center gap-1.5 mt-3`,children:e.roles?.map(e=>(0,a.jsx)(`span`,{className:`px-2.5 py-1 text-xs font-bold bg-white text-gray-500 border border-gray-100 rounded-md`,children:e.name||e},e.name||e))}),(0,a.jsx)(`div`,{className:`mt-4`,children:(0,a.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold border ${e.status===`active`?`text-green-600 bg-white border-green-100`:`text-gray-400 bg-white border-gray-100`}`,children:[(0,a.jsx)(`span`,{className:`w-1 h-1 rounded-full ${e.status===`active`?`bg-green-500`:`bg-gray-300`}`}),e.status===`active`?`Active`:`Inactive`]})})]})}),(0,a.jsx)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm p-4 space-y-1`,children:(0,a.jsxs)(n,{href:`/users`,className:`flex items-center gap-3 px-3 py-2.5 rounded-xl text-sm font-semibold text-gray-500 hover:bg-gray-50 hover:text-[#3D4E4B] transition-colors w-full`,children:[(0,a.jsx)(`svg`,{className:`w-4 h-4 text-gray-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10 19l-7-7m0 0l7-7m-7 7h18`})}),`Back to Users`]})})]}),(0,a.jsxs)(`div`,{className:`lg:col-span-2 space-y-4 anim-up`,style:{animationDelay:`0.08s`},children:[(0,a.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden`,children:[(0,a.jsx)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:(0,a.jsx)(`h3`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Personal Information`})}),(0,a.jsx)(`div`,{className:`px-6`,children:(0,a.jsxs)(`dl`,{children:[(0,a.jsx)(o,{label:`First name`,children:e.first_name}),(0,a.jsx)(o,{label:`Last name`,children:e.last_name}),(0,a.jsx)(o,{label:`Email`,children:e.email}),(0,a.jsx)(o,{label:`User ID`,children:(0,a.jsxs)(`span`,{className:`font-mono text-gray-400 text-xs`,children:[`#`,e.id]})})]})})]}),(0,a.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden`,children:[(0,a.jsx)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:(0,a.jsx)(`h3`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Roles & Permissions`})}),(0,a.jsxs)(`div`,{className:`p-6 space-y-5`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-xs font-semibold text-gray-400 tracking-tight mb-2`,children:`Assigned Roles`}),(0,a.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.roles?.length?e.roles.map(e=>(0,a.jsx)(`span`,{className:`px-3 py-1.5 text-xs font-bold bg-[#3D4E4B] text-white rounded-lg`,children:e.name||e},e.name||e)):(0,a.jsx)(`span`,{className:`text-sm text-gray-400 font-semibold`,children:`No roles assigned`})})]}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-xs font-semibold text-gray-400 tracking-tight mb-2`,children:`Granted Permissions`}),(0,a.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 gap-1.5`,children:e.permissions?.length?e.permissions.map(e=>(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-gray-600 font-semibold bg-gray-50 border border-gray-100 px-2.5 py-1.5 rounded-lg`,children:[(0,a.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-[#21A59F] shrink-0`}),e.name||e]},e.name||e)):(0,a.jsx)(`span`,{className:`text-sm text-gray-400 font-semibold col-span-full`,children:`Inherited from roles`})})]})]})]}),(0,a.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden`,children:[(0,a.jsx)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:(0,a.jsx)(`h3`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Activity Timeline`})}),(0,a.jsxs)(`div`,{className:`p-6 space-y-4`,children:[(0,a.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,a.jsx)(`div`,{className:`w-8 h-8 rounded-xl bg-[#E3EBE8] flex items-center justify-center shrink-0`,children:(0,a.jsx)(`svg`,{className:`w-4 h-4 text-[#3D4E4B]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 4v16m8-8H4`})})}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Account Created`}),(0,a.jsx)(`p`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:new Date(e.created_at).toLocaleDateString(`en-US`,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`})})]})]}),(0,a.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,a.jsx)(`div`,{className:`w-8 h-8 rounded-xl bg-[#E3EBE8] flex items-center justify-center shrink-0`,children:(0,a.jsx)(`svg`,{className:`w-4 h-4 text-[#3D4E4B]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`})})}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Last Updated`}),(0,a.jsx)(`p`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:new Date(e.updated_at).toLocaleDateString(`en-US`,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`})})]})]})]})]})]})]})]})}export{s as default}; \ No newline at end of file diff --git a/public/build/assets/TextInput-BnQizTbW.js b/public/build/assets/TextInput-BGMhFr2s.js similarity index 99% rename from public/build/assets/TextInput-BnQizTbW.js rename to public/build/assets/TextInput-BGMhFr2s.js index 0a35801..20253e2 100644 --- a/public/build/assets/TextInput-BnQizTbW.js +++ b/public/build/assets/TextInput-BGMhFr2s.js @@ -1,4 +1,4 @@ -import{c as e,d as t,t as n}from"./app-BK5KCPMc.js";var r=n();function i({message:e,className:t=``,...n}){return e?(0,r.jsx)(`p`,{...n,className:`text-sm text-red-600 `+t,children:e}):null}function a({value:e,className:t=``,children:n,...i}){return(0,r.jsx)(`label`,{...i,className:`block text-sm font-medium text-gray-700 `+t,children:e||n})}var o=t(e(),1),s=Object.defineProperty,c=(e,t,n)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l=(e,t,n)=>(c(e,typeof t==`symbol`?t:t+``,n),n),u=new class{constructor(){l(this,`current`,this.detect()),l(this,`handoffState`,`pending`),l(this,`currentId`,0)}set(e){this.current!==e&&(this.handoffState=`pending`,this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current===`server`}get isClient(){return this.current===`client`}detect(){return typeof window>`u`||typeof document>`u`?`server`:`client`}handoff(){this.handoffState===`pending`&&(this.handoffState=`complete`)}get isHandoffComplete(){return this.handoffState===`complete`}};function d(e){typeof queueMicrotask==`function`?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function f(){let e=[],t={addEventListener(e,n,r,i){return e.addEventListener(n,r,i),t.add(()=>e.removeEventListener(n,r,i))},requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...e){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...e))},setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return d(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=f();return e(t),this.add(()=>t.dispose())},add(t){return e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}},dispose(){for(let t of e.splice(0))t()}};return t}function p(){let[e]=(0,o.useState)(f);return(0,o.useEffect)(()=>()=>e.dispose(),[e]),e}var m=(e,t)=>{u.isServer?(0,o.useEffect)(e,t):(0,o.useLayoutEffect)(e,t)};function h(e){let t=(0,o.useRef)(e);return m(()=>{t.current=e},[e]),t}var g=function(e){let t=h(e);return o.useCallback((...e)=>t.current(...e),[t])};function _(...e){return Array.from(new Set(e.flatMap(e=>typeof e==`string`?e.split(` `):[]))).filter(Boolean).join(` `)}function v(e,t,...n){if(e in t){let r=t[e];return typeof r==`function`?r(...n):r}let r=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(`, `)}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,v),r}var y=(e=>(e[e.None=0]=`None`,e[e.RenderStrategy=1]=`RenderStrategy`,e[e.Static=2]=`Static`,e))(y||{}),b=(e=>(e[e.Unmount=0]=`Unmount`,e[e.Hidden=1]=`Hidden`,e))(b||{});function x(){let e=ee();return(0,o.useCallback)(t=>S({mergeRefs:e,...t}),[e])}function S({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o,mergeRefs:s}){s??=w;let c=T(t,e);if(a)return C(c,n,r,o,s);let l=i??0;if(l&2){let{static:e=!1,...t}=c;if(e)return C(t,n,r,o,s)}if(l&1){let{unmount:e=!0,...t}=c;return v(+!e,{0(){return null},1(){return C({...t,hidden:!0,style:{display:`none`}},n,r,o,s)}})}return C(c,n,r,o,s)}function C(e,t={},n,r,i){let{as:a=n,children:s,refName:c=`ref`,...l}=O(e,[`unmount`,`static`]),u=e.ref===void 0?{}:{[c]:e.ref},d=typeof s==`function`?s(t):s;d=A(d),`className`in l&&l.className&&typeof l.className==`function`&&(l.className=l.className(t)),l[`aria-labelledby`]&&l[`aria-labelledby`]===l.id&&(l[`aria-labelledby`]=void 0);let f={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))typeof i==`boolean`&&(e=!0),i===!0&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){f[`data-headlessui-state`]=n.join(` `);for(let e of n)f[`data-${e}`]=``}}if(j(a)&&(Object.keys(D(l)).length>0||Object.keys(D(f)).length>0))if(!(0,o.isValidElement)(d)||Array.isArray(d)&&d.length>1||M(d)){if(Object.keys(D(l)).length>0)throw Error([`Passing props on "Fragment"!`,``,`The current component <${r} /> is rendering a "Fragment".`,`However we need to passthrough the following props:`,Object.keys(D(l)).concat(Object.keys(D(f))).map(e=>` - ${e}`).join(` +import{c as e,d as t,t as n}from"./app-C2kGDHB9.js";var r=n();function i({message:e,className:t=``,...n}){return e?(0,r.jsx)(`p`,{...n,className:`text-sm text-red-600 `+t,children:e}):null}function a({value:e,className:t=``,children:n,...i}){return(0,r.jsx)(`label`,{...i,className:`block text-sm font-medium text-gray-700 `+t,children:e||n})}var o=t(e(),1),s=Object.defineProperty,c=(e,t,n)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l=(e,t,n)=>(c(e,typeof t==`symbol`?t:t+``,n),n),u=new class{constructor(){l(this,`current`,this.detect()),l(this,`handoffState`,`pending`),l(this,`currentId`,0)}set(e){this.current!==e&&(this.handoffState=`pending`,this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current===`server`}get isClient(){return this.current===`client`}detect(){return typeof window>`u`||typeof document>`u`?`server`:`client`}handoff(){this.handoffState===`pending`&&(this.handoffState=`complete`)}get isHandoffComplete(){return this.handoffState===`complete`}};function d(e){typeof queueMicrotask==`function`?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function f(){let e=[],t={addEventListener(e,n,r,i){return e.addEventListener(n,r,i),t.add(()=>e.removeEventListener(n,r,i))},requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...e){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...e))},setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return d(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=f();return e(t),this.add(()=>t.dispose())},add(t){return e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}},dispose(){for(let t of e.splice(0))t()}};return t}function p(){let[e]=(0,o.useState)(f);return(0,o.useEffect)(()=>()=>e.dispose(),[e]),e}var m=(e,t)=>{u.isServer?(0,o.useEffect)(e,t):(0,o.useLayoutEffect)(e,t)};function h(e){let t=(0,o.useRef)(e);return m(()=>{t.current=e},[e]),t}var g=function(e){let t=h(e);return o.useCallback((...e)=>t.current(...e),[t])};function _(...e){return Array.from(new Set(e.flatMap(e=>typeof e==`string`?e.split(` `):[]))).filter(Boolean).join(` `)}function v(e,t,...n){if(e in t){let r=t[e];return typeof r==`function`?r(...n):r}let r=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(`, `)}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,v),r}var y=(e=>(e[e.None=0]=`None`,e[e.RenderStrategy=1]=`RenderStrategy`,e[e.Static=2]=`Static`,e))(y||{}),b=(e=>(e[e.Unmount=0]=`Unmount`,e[e.Hidden=1]=`Hidden`,e))(b||{});function x(){let e=ee();return(0,o.useCallback)(t=>S({mergeRefs:e,...t}),[e])}function S({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o,mergeRefs:s}){s??=w;let c=T(t,e);if(a)return C(c,n,r,o,s);let l=i??0;if(l&2){let{static:e=!1,...t}=c;if(e)return C(t,n,r,o,s)}if(l&1){let{unmount:e=!0,...t}=c;return v(+!e,{0(){return null},1(){return C({...t,hidden:!0,style:{display:`none`}},n,r,o,s)}})}return C(c,n,r,o,s)}function C(e,t={},n,r,i){let{as:a=n,children:s,refName:c=`ref`,...l}=O(e,[`unmount`,`static`]),u=e.ref===void 0?{}:{[c]:e.ref},d=typeof s==`function`?s(t):s;d=A(d),`className`in l&&l.className&&typeof l.className==`function`&&(l.className=l.className(t)),l[`aria-labelledby`]&&l[`aria-labelledby`]===l.id&&(l[`aria-labelledby`]=void 0);let f={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))typeof i==`boolean`&&(e=!0),i===!0&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){f[`data-headlessui-state`]=n.join(` `);for(let e of n)f[`data-${e}`]=``}}if(j(a)&&(Object.keys(D(l)).length>0||Object.keys(D(f)).length>0))if(!(0,o.isValidElement)(d)||Array.isArray(d)&&d.length>1||M(d)){if(Object.keys(D(l)).length>0)throw Error([`Passing props on "Fragment"!`,``,`The current component <${r} /> is rendering a "Fragment".`,`However we need to passthrough the following props:`,Object.keys(D(l)).concat(Object.keys(D(f))).map(e=>` - ${e}`).join(` `),``,`You can apply a few solutions:`,['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',`Render a single element as the child so that we can forward the props onto that element.`].map(e=>` - ${e}`).join(` `)].join(` `))}else{let e=d.props?.className,t=typeof e==`function`?(...t)=>_(e(...t),l.className):_(e,l.className),n=t?{className:t}:{},r=T(d.props,D(O(l,[`ref`])));for(let e in f)e in r&&delete f[e];return(0,o.cloneElement)(d,Object.assign({},r,f,u,{ref:i(k(d),u.ref)},n))}return(0,o.createElement)(a,Object.assign({},O(l,[`ref`]),!j(a)&&u,!j(a)&&f),d)}function ee(){let e=(0,o.useRef)([]),t=(0,o.useCallback)(t=>{for(let n of e.current)n!=null&&(typeof n==`function`?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>e==null))return e.current=n,t}}function w(...e){return e.every(e=>e==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n==`function`?n(t):n.current=t)}}function T(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t[`aria-disabled`])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>(e?.preventDefault)?.call(e)]);for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||t?.nativeEvent instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function E(e){return Object.assign((0,o.forwardRef)(e),{displayName:e.displayName??e.name})}function D(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}function O(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function k(e){return`18.3.1`.split(`.`)[0]>=`19`?e.props.ref:e.ref}function A(e){if(e!=null&&e.$$typeof===Symbol.for(`react.lazy`)){let t=e._payload;if(t!=null&&t.status===`fulfilled`)return A(t.value)}return e}function j(e){return e===o.Fragment||e===Symbol.for(`react.fragment`)}function M(e){return j(e.type)}var N=Symbol();function P(e,t=!0){return Object.assign(e,{[N]:t})}function F(...e){let t=(0,o.useRef)(e);(0,o.useEffect)(()=>{t.current=e},[e]);let n=g(e=>{for(let n of t.current)n!=null&&(typeof n==`function`?n(e):n.current=e)});return e.every(e=>e==null||e?.[N])?void 0:n}function I(e=0){let[t,n]=(0,o.useState)(e);return{flags:t,setFlag:(0,o.useCallback)(e=>n(e),[]),addFlag:(0,o.useCallback)(e=>n(t=>t|e),[]),hasFlag:(0,o.useCallback)(e=>(t&e)===e,[t]),removeFlag:(0,o.useCallback)(e=>n(t=>t&~e),[]),toggleFlag:(0,o.useCallback)(e=>n(t=>t^e),[])}}typeof process<`u`&&typeof globalThis<`u`&&typeof Element<`u`&&(process==null?void 0:{})?.NODE_ENV===`test`&&(Element==null?void 0:Element.prototype)?.getAnimations===void 0&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.",``,`Example usage:`,"```js",`import { mockAnimationsApi } from 'jsdom-testing-mocks'`,`mockAnimationsApi()`,"```"].join(` diff --git a/public/build/assets/UpdatePasswordForm-CoUiuw4Q.js b/public/build/assets/UpdatePasswordForm-Co29OuF0.js similarity index 91% rename from public/build/assets/UpdatePasswordForm-CoUiuw4Q.js rename to public/build/assets/UpdatePasswordForm-Co29OuF0.js index ea702ce..b45e21d 100644 --- a/public/build/assets/UpdatePasswordForm-CoUiuw4Q.js +++ b/public/build/assets/UpdatePasswordForm-Co29OuF0.js @@ -1 +1 @@ -import{a as e,c as t,d as n,t as r}from"./app-BK5KCPMc.js";import{C as i,S as a,n as o,t as s}from"./TextInput-BnQizTbW.js";import{t as c}from"./PrimaryButton-2i3vnLMz.js";var l=n(t(),1),u=r();function d({className:t=``}){let n=(0,l.useRef)(),r=(0,l.useRef)(),{data:d,setData:f,errors:p,put:m,reset:h,processing:g,recentlySuccessful:_}=e({current_password:``,password:``,password_confirmation:``});return(0,u.jsxs)(`section`,{className:t,children:[(0,u.jsxs)(`header`,{children:[(0,u.jsx)(`h2`,{className:`text-lg font-medium text-gray-900`,children:`Update Password`}),(0,u.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:`Ensure your account is using a long, random password to stay secure.`})]}),(0,u.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),m(route(`password.update`),{preserveScroll:!0,onSuccess:()=>h(),onError:e=>{e.password&&(h(`password`,`password_confirmation`),n.current.focus()),e.current_password&&(h(`current_password`),r.current.focus())}})},className:`mt-6 space-y-6`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(a,{htmlFor:`current_password`,value:`Current Password`}),(0,u.jsx)(s,{id:`current_password`,ref:r,value:d.current_password,onChange:e=>f(`current_password`,e.target.value),type:`password`,className:`mt-1 block w-full`,autoComplete:`current-password`}),(0,u.jsx)(i,{message:p.current_password,className:`mt-2`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(a,{htmlFor:`password`,value:`New Password`}),(0,u.jsx)(s,{id:`password`,ref:n,value:d.password,onChange:e=>f(`password`,e.target.value),type:`password`,className:`mt-1 block w-full`,autoComplete:`new-password`}),(0,u.jsx)(i,{message:p.password,className:`mt-2`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(a,{htmlFor:`password_confirmation`,value:`Confirm Password`}),(0,u.jsx)(s,{id:`password_confirmation`,value:d.password_confirmation,onChange:e=>f(`password_confirmation`,e.target.value),type:`password`,className:`mt-1 block w-full`,autoComplete:`new-password`}),(0,u.jsx)(i,{message:p.password_confirmation,className:`mt-2`})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,u.jsx)(c,{disabled:g,children:`Save`}),(0,u.jsx)(o,{show:_,enter:`transition ease-in-out`,enterFrom:`opacity-0`,leave:`transition ease-in-out`,leaveTo:`opacity-0`,children:(0,u.jsx)(`p`,{className:`text-sm text-gray-600`,children:`Saved.`})})]})]})]})}export{d as default}; \ No newline at end of file +import{a as e,c as t,d as n,t as r}from"./app-C2kGDHB9.js";import{C as i,S as a,n as o,t as s}from"./TextInput-BGMhFr2s.js";import{t as c}from"./PrimaryButton-C1Df3FyG.js";var l=n(t(),1),u=r();function d({className:t=``}){let n=(0,l.useRef)(),r=(0,l.useRef)(),{data:d,setData:f,errors:p,put:m,reset:h,processing:g,recentlySuccessful:_}=e({current_password:``,password:``,password_confirmation:``});return(0,u.jsxs)(`section`,{className:t,children:[(0,u.jsxs)(`header`,{children:[(0,u.jsx)(`h2`,{className:`text-lg font-medium text-gray-900`,children:`Update Password`}),(0,u.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:`Ensure your account is using a long, random password to stay secure.`})]}),(0,u.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),m(route(`password.update`),{preserveScroll:!0,onSuccess:()=>h(),onError:e=>{e.password&&(h(`password`,`password_confirmation`),n.current.focus()),e.current_password&&(h(`current_password`),r.current.focus())}})},className:`mt-6 space-y-6`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(a,{htmlFor:`current_password`,value:`Current Password`}),(0,u.jsx)(s,{id:`current_password`,ref:r,value:d.current_password,onChange:e=>f(`current_password`,e.target.value),type:`password`,className:`mt-1 block w-full`,autoComplete:`current-password`}),(0,u.jsx)(i,{message:p.current_password,className:`mt-2`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(a,{htmlFor:`password`,value:`New Password`}),(0,u.jsx)(s,{id:`password`,ref:n,value:d.password,onChange:e=>f(`password`,e.target.value),type:`password`,className:`mt-1 block w-full`,autoComplete:`new-password`}),(0,u.jsx)(i,{message:p.password,className:`mt-2`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(a,{htmlFor:`password_confirmation`,value:`Confirm Password`}),(0,u.jsx)(s,{id:`password_confirmation`,value:d.password_confirmation,onChange:e=>f(`password_confirmation`,e.target.value),type:`password`,className:`mt-1 block w-full`,autoComplete:`new-password`}),(0,u.jsx)(i,{message:p.password_confirmation,className:`mt-2`})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,u.jsx)(c,{disabled:g,children:`Save`}),(0,u.jsx)(o,{show:_,enter:`transition ease-in-out`,enterFrom:`opacity-0`,leave:`transition ease-in-out`,leaveTo:`opacity-0`,children:(0,u.jsx)(`p`,{className:`text-sm text-gray-600`,children:`Saved.`})})]})]})]})}export{d as default}; \ No newline at end of file diff --git a/public/build/assets/UpdateProfileInformationForm-DPfGMj-q.js b/public/build/assets/UpdateProfileInformationForm-4t1_h1jU.js similarity index 91% rename from public/build/assets/UpdateProfileInformationForm-DPfGMj-q.js rename to public/build/assets/UpdateProfileInformationForm-4t1_h1jU.js index 9d43b63..abad831 100644 --- a/public/build/assets/UpdateProfileInformationForm-DPfGMj-q.js +++ b/public/build/assets/UpdateProfileInformationForm-4t1_h1jU.js @@ -1 +1 @@ -import{a as e,o as t,r as n,t as r}from"./app-BK5KCPMc.js";import{C as i,S as a,n as o,t as s}from"./TextInput-BnQizTbW.js";import{t as c}from"./PrimaryButton-2i3vnLMz.js";var l=r();function u({mustVerifyEmail:r,status:u,className:d=``}){let f=t().props.auth.user,{data:p,setData:m,patch:h,errors:g,processing:_,recentlySuccessful:v}=e({name:f.name,email:f.email});return(0,l.jsxs)(`section`,{className:d,children:[(0,l.jsxs)(`header`,{children:[(0,l.jsx)(`h2`,{className:`text-lg font-medium text-gray-900`,children:`Profile Information`}),(0,l.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:`Update your account's profile information and email address.`})]}),(0,l.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),h(route(`profile.update`))},className:`mt-6 space-y-6`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(a,{htmlFor:`name`,value:`Name`}),(0,l.jsx)(s,{id:`name`,className:`mt-1 block w-full`,value:p.name,onChange:e=>m(`name`,e.target.value),required:!0,isFocused:!0,autoComplete:`name`}),(0,l.jsx)(i,{className:`mt-2`,message:g.name})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(a,{htmlFor:`email`,value:`Email`}),(0,l.jsx)(s,{id:`email`,type:`email`,className:`mt-1 block w-full`,value:p.email,onChange:e=>m(`email`,e.target.value),required:!0,autoComplete:`username`}),(0,l.jsx)(i,{className:`mt-2`,message:g.email})]}),r&&f.email_verified_at===null&&(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`p`,{className:`mt-2 text-sm text-gray-800`,children:[`Your email address is unverified.`,(0,l.jsx)(n,{href:route(`verification.send`),method:`post`,as:`button`,className:`rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`,children:`Click here to re-send the verification email.`})]}),u===`verification-link-sent`&&(0,l.jsx)(`div`,{className:`mt-2 text-sm font-medium text-green-600`,children:`A new verification link has been sent to your email address.`})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,l.jsx)(c,{disabled:_,children:`Save`}),(0,l.jsx)(o,{show:v,enter:`transition ease-in-out`,enterFrom:`opacity-0`,leave:`transition ease-in-out`,leaveTo:`opacity-0`,children:(0,l.jsx)(`p`,{className:`text-sm text-gray-600`,children:`Saved.`})})]})]})]})}export{u as default}; \ No newline at end of file +import{a as e,o as t,r as n,t as r}from"./app-C2kGDHB9.js";import{C as i,S as a,n as o,t as s}from"./TextInput-BGMhFr2s.js";import{t as c}from"./PrimaryButton-C1Df3FyG.js";var l=r();function u({mustVerifyEmail:r,status:u,className:d=``}){let f=t().props.auth.user,{data:p,setData:m,patch:h,errors:g,processing:_,recentlySuccessful:v}=e({name:f.name,email:f.email});return(0,l.jsxs)(`section`,{className:d,children:[(0,l.jsxs)(`header`,{children:[(0,l.jsx)(`h2`,{className:`text-lg font-medium text-gray-900`,children:`Profile Information`}),(0,l.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:`Update your account's profile information and email address.`})]}),(0,l.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),h(route(`profile.update`))},className:`mt-6 space-y-6`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(a,{htmlFor:`name`,value:`Name`}),(0,l.jsx)(s,{id:`name`,className:`mt-1 block w-full`,value:p.name,onChange:e=>m(`name`,e.target.value),required:!0,isFocused:!0,autoComplete:`name`}),(0,l.jsx)(i,{className:`mt-2`,message:g.name})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(a,{htmlFor:`email`,value:`Email`}),(0,l.jsx)(s,{id:`email`,type:`email`,className:`mt-1 block w-full`,value:p.email,onChange:e=>m(`email`,e.target.value),required:!0,autoComplete:`username`}),(0,l.jsx)(i,{className:`mt-2`,message:g.email})]}),r&&f.email_verified_at===null&&(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`p`,{className:`mt-2 text-sm text-gray-800`,children:[`Your email address is unverified.`,(0,l.jsx)(n,{href:route(`verification.send`),method:`post`,as:`button`,className:`rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`,children:`Click here to re-send the verification email.`})]}),u===`verification-link-sent`&&(0,l.jsx)(`div`,{className:`mt-2 text-sm font-medium text-green-600`,children:`A new verification link has been sent to your email address.`})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,l.jsx)(c,{disabled:_,children:`Save`}),(0,l.jsx)(o,{show:v,enter:`transition ease-in-out`,enterFrom:`opacity-0`,leave:`transition ease-in-out`,leaveTo:`opacity-0`,children:(0,l.jsx)(`p`,{className:`text-sm text-gray-600`,children:`Saved.`})})]})]})]})}export{u as default}; \ No newline at end of file diff --git a/public/build/assets/VerifyEmail-BkreAOfA.js b/public/build/assets/VerifyEmail-DvY7W-s2.js similarity index 94% rename from public/build/assets/VerifyEmail-BkreAOfA.js rename to public/build/assets/VerifyEmail-DvY7W-s2.js index a9935d3..f7010b0 100644 --- a/public/build/assets/VerifyEmail-BkreAOfA.js +++ b/public/build/assets/VerifyEmail-DvY7W-s2.js @@ -1 +1 @@ -import{a as e,c as t,n,r,t as i}from"./app-BK5KCPMc.js";import{t as a}from"./GuestLayout-CgPUg7Kz.js";t();var o=i();function s({status:t}){let{post:i,processing:s}=e({});return(0,o.jsxs)(a,{children:[(0,o.jsx)(n,{title:`Verify email`}),(0,o.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,o.jsx)(`div`,{className:`w-12 h-12 bg-[#3D4E4B]/5 rounded-2xl flex items-center justify-center mb-6`,children:(0,o.jsx)(`svg`,{className:`w-5 h-5 text-[#3D4E4B]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z`})})}),(0,o.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Check your email`}),(0,o.jsx)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium leading-relaxed`,children:`We sent a verification link to your email address. Click the link to activate your account.`})]}),t===`verification-link-sent`&&(0,o.jsx)(`div`,{className:`mb-6 px-4 py-3 rounded-xl bg-emerald-50 border border-emerald-100 text-sm font-semibold text-emerald-700 anim-fade`,children:`A new verification link has been sent to your email.`}),(0,o.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),i(route(`verification.send`))},className:`anim-up`,style:{animationDelay:`0.1s`},children:(0,o.jsx)(`button`,{type:`submit`,disabled:s,className:`w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:s?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,o.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,o.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Sending…`]}):`Resend verification email`})}),(0,o.jsx)(`div`,{className:`mt-5 text-center anim-fade`,style:{animationDelay:`0.18s`},children:(0,o.jsx)(r,{href:route(`logout`),method:`post`,as:`button`,className:`text-sm font-semibold text-gray-400 hover:text-[#3D4E4B] transition-colors duration-200`,children:`Sign out`})})]})}export{s as default}; \ No newline at end of file +import{a as e,c as t,n,r,t as i}from"./app-C2kGDHB9.js";import{t as a}from"./GuestLayout-DfP8Xy7D.js";t();var o=i();function s({status:t}){let{post:i,processing:s}=e({});return(0,o.jsxs)(a,{children:[(0,o.jsx)(n,{title:`Verify email`}),(0,o.jsxs)(`div`,{className:`mb-8 anim-down`,children:[(0,o.jsx)(`div`,{className:`w-12 h-12 bg-[#3D4E4B]/5 rounded-2xl flex items-center justify-center mb-6`,children:(0,o.jsx)(`svg`,{className:`w-5 h-5 text-[#3D4E4B]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,o.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z`})})}),(0,o.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A2421] tracking-tight`,children:`Check your email`}),(0,o.jsx)(`p`,{className:`mt-1.5 text-sm text-gray-400 font-medium leading-relaxed`,children:`We sent a verification link to your email address. Click the link to activate your account.`})]}),t===`verification-link-sent`&&(0,o.jsx)(`div`,{className:`mb-6 px-4 py-3 rounded-xl bg-emerald-50 border border-emerald-100 text-sm font-semibold text-emerald-700 anim-fade`,children:`A new verification link has been sent to your email.`}),(0,o.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),i(route(`verification.send`))},className:`anim-up`,style:{animationDelay:`0.1s`},children:(0,o.jsx)(`button`,{type:`submit`,disabled:s,className:`w-full h-11 rounded-xl bg-[#3D4E4B] hover:bg-[#2D3A38] text-white text-sm font-bold tracking-tight transition-colors duration-200 flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed`,children:s?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`svg`,{className:`w-4 h-4 animate-spin text-white/60`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,o.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,o.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Sending…`]}):`Resend verification email`})}),(0,o.jsx)(`div`,{className:`mt-5 text-center anim-fade`,style:{animationDelay:`0.18s`},children:(0,o.jsx)(r,{href:route(`logout`),method:`post`,as:`button`,className:`text-sm font-semibold text-gray-400 hover:text-[#3D4E4B] transition-colors duration-200`,children:`Sign out`})})]})}export{s as default}; \ No newline at end of file diff --git a/public/build/assets/Welcome-B4dAuF6T.js b/public/build/assets/Welcome-Cd22q1re.js similarity index 99% rename from public/build/assets/Welcome-B4dAuF6T.js rename to public/build/assets/Welcome-Cd22q1re.js index fcc16e2..146f0db 100644 --- a/public/build/assets/Welcome-B4dAuF6T.js +++ b/public/build/assets/Welcome-Cd22q1re.js @@ -1 +1 @@ -import{c as e,n as t,o as n,r,t as i}from"./app-BK5KCPMc.js";e();var a=i();function o({auth:e}){let{system_settings:i}=n().props,o=i?.app_name||`biiproject kit v2`,s=i?.app_logo,c=i?.app_logo_text||`BK`;return(0,a.jsxs)(`div`,{className:`min-h-screen bg-[#E3EBE8] text-[#3D4E4B] selection:bg-[#D4A017] selection:text-white font-sans`,children:[(0,a.jsx)(t,{title:`${o} — Premium Enterprise Identity`}),(0,a.jsx)(`nav`,{className:`fixed w-full z-50 px-6 py-6 anim-down`,children:(0,a.jsxs)(`div`,{className:`max-w-7xl mx-auto flex items-center justify-between bg-white/80 backdrop-blur-md rounded-[2rem] px-8 py-4 border border-white/20 shadow-sm`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(`div`,{className:`w-10 h-10 rounded-xl flex items-center justify-center text-xl font-bold overflow-hidden border border-gray-100 ${s?`bg-white`:`bg-[#3D4E4B] text-[#D4A017]`}`,children:s?(0,a.jsx)(`img`,{src:s,className:`w-full h-full object-contain`}):c}),(0,a.jsx)(`span`,{className:`text-sm font-bold tracking-tight`,children:o})]}),(0,a.jsxs)(`div`,{className:`flex items-center gap-8`,children:[(0,a.jsx)(`div`,{className:`hidden md:flex items-center gap-6`,children:[`Solutions`,`Ecosystem`,`Xxx`,`Governance`,`Intelligence`].map(e=>(0,a.jsx)(r,{href:e===`Xxx`?route(`xxx`):`#`,className:`text-sm font-bold tracking-tight hover:text-[#D4A017] transition-colors`,children:e},e))}),(0,a.jsx)(`div`,{className:`h-6 w-[1px] bg-gray-100 mx-2`}),e.user?(0,a.jsx)(r,{href:route(`dashboard`),className:`px-6 py-2.5 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all`,children:`Command Center`}):(0,a.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,a.jsx)(r,{href:route(`login`),className:`text-sm font-bold tracking-tight hover:text-[#D4A017] transition-colors`,children:`Access`}),(0,a.jsx)(r,{href:route(`register`),className:`px-6 py-2.5 bg-[#D4A017] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#B88B14] transition-all`,children:`Initialize Identity`})]})]})]})}),(0,a.jsx)(`section`,{className:`relative pt-40 pb-20 px-6 overflow-hidden`,children:(0,a.jsxs)(`div`,{className:`max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-2 gap-20 items-center`,children:[(0,a.jsxs)(`div`,{className:`relative z-10 anim-left`,children:[(0,a.jsxs)(`div`,{className:`inline-flex items-center gap-2 px-4 py-2 bg-white rounded-full border border-gray-100 mb-8`,children:[(0,a.jsx)(`span`,{className:`flex h-2 w-2 rounded-full bg-[#D4A017]`}),(0,a.jsx)(`span`,{className:`text-xs font-bold tracking-tight text-[#D4A017]`,children:`Enterprise V4.0 Live`})]}),(0,a.jsxs)(`h1`,{className:`text-6xl lg:text-8xl font-bold text-[#3D4E4B] tracking-tighter leading-[0.9] mb-8`,children:[`Precision `,(0,a.jsx)(`br`,{}),(0,a.jsx)(`span`,{className:`text-transparent`,style:{WebkitTextStroke:`1px #3D4E4B`},children:`Identity`}),` `,(0,a.jsx)(`br`,{}),`Architecture.`]}),(0,a.jsx)(`p`,{className:`text-lg text-gray-500 font-medium max-w-md leading-relaxed mb-10`,children:`The ultimate governance framework for airline-grade digital ecosystems. Secure, modular, and uncompromisingly professional.`}),(0,a.jsxs)(`div`,{className:`flex flex-wrap items-center gap-8`,children:[(0,a.jsxs)(r,{href:e.user?route(`dashboard`):route(`register`),className:`px-10 py-5 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-2xl hover:bg-[#2D3A38] transition-all shadow-2xl shadow-[#3D4E4B]/20 hover:shadow-[#D4A017]/10 flex items-center gap-3 group border border-[#3D4E4B]`,children:[e.user?`Access Command`:`Initialize Session`,(0,a.jsx)(`svg`,{className:`w-4 h-4 transition-transform group-hover:translate-x-1`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:3,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 7l5 5m0 0l-5 5m5-5H6`})})]}),(0,a.jsxs)(`div`,{className:`flex items-center`,children:[(0,a.jsx)(`div`,{className:`flex -space-x-3`,children:[1,2,3].map(e=>(0,a.jsx)(`div`,{className:`w-10 h-10 rounded-full border-4 border-[#E3EBE8] bg-[#3D4E4B] flex items-center justify-center text-sm font-bold text-white ring-1 ring-white/10`,children:String.fromCharCode(64+e)},e))}),(0,a.jsxs)(`div`,{className:`pl-6 flex flex-col justify-center`,children:[(0,a.jsx)(`span`,{className:`text-sm font-bold tracking-tight text-[#3D4E4B]`,children:`2,400+ Entities`}),(0,a.jsx)(`span`,{className:`text-sm font-semibold tracking-tight text-gray-400 mt-0.5`,children:`Authenticated Weekly`})]})]})]})]}),(0,a.jsx)(`div`,{className:`relative anim-right`,children:(0,a.jsxs)(`div`,{className:`aspect-square bg-white rounded-[3rem] border border-gray-100 shadow-2xl relative overflow-hidden p-8 group`,children:[(0,a.jsx)(`div`,{className:`absolute inset-0 bg-[#3D4E4B] opacity-0 group-hover:opacity-[0.02] transition-opacity`}),(0,a.jsxs)(`div`,{className:`w-full h-full border-2 border-dashed border-gray-100 rounded-[2rem] flex flex-col items-center justify-center relative`,children:[(0,a.jsx)(`div`,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-40 h-40 bg-[#D4A017]/10 rounded-full blur-[80px]`}),(0,a.jsx)(`div`,{className:`text-[120px] font-bold text-[#3D4E4B] opacity-5 select-none tracking-tight`,children:`SYSTEM`}),(0,a.jsxs)(`div`,{className:`absolute inset-x-8 bottom-8 h-32 bg-gray-50 rounded-2xl border border-gray-100 p-6 flex items-end justify-between`,children:[(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsx)(`div`,{className:`w-24 h-2 bg-gray-200 rounded-full`}),(0,a.jsx)(`div`,{className:`w-16 h-2 bg-gray-200 rounded-full opacity-50`})]}),(0,a.jsx)(`div`,{className:`w-12 h-12 bg-[#3D4E4B] rounded-xl`})]})]})]})})]})}),(0,a.jsx)(`section`,{className:`py-20 px-6 bg-white border-y border-gray-100`,children:(0,a.jsxs)(`div`,{className:`max-w-7xl mx-auto`,children:[(0,a.jsxs)(`div`,{className:`text-center mb-20 anim-up`,children:[(0,a.jsx)(`h2`,{className:`text-sm font-bold tracking-tight text-[#D4A017] mb-4`,children:`Core Ecosystem`}),(0,a.jsx)(`h3`,{className:`text-4xl font-bold text-[#3D4E4B] tracking-tight`,children:`Governance Intelligence.`})]}),(0,a.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-8`,children:[{t:`Secure Matrix`,d:`Advanced role-based access control with granular permission governance.`,c:`#3D4E4B`},{t:`Live Telemetry`,d:`Real-time activity monitoring and audit logging for complete transparency.`,c:`#D4A017`},{t:`Global Identity`,d:`Multi-provider authentication and identity verification systems.`,c:`#21A59F`}].map((e,t)=>(0,a.jsxs)(`div`,{className:`p-10 rounded-[2.5rem] bg-[#E3EBE8]/30 border border-gray-100 hover:bg-white hover:shadow-xl hover:-translate-y-2 transition-all duration-500 group anim-up`,style:{animationDelay:`${t*.1}s`},children:[(0,a.jsx)(`div`,{className:`w-12 h-12 rounded-2xl flex items-center justify-center text-white mb-8 group-hover:scale-110 transition-transform`,style:{backgroundColor:e.c},children:(0,a.jsx)(`svg`,{className:`w-6 h-6`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:3,children:(0,a.jsx)(`path`,{d:`M13 10V3L4 14h7v7l9-11h-7z`})})}),(0,a.jsx)(`h4`,{className:`text-sm font-bold tracking-tight text-[#3D4E4B] mb-4`,children:e.t}),(0,a.jsx)(`p`,{className:`text-sm font-medium text-gray-400 leading-relaxed tracking-tight`,children:e.d})]},t))})]})}),(0,a.jsx)(`footer`,{className:`py-12 px-6 border-t border-gray-100`,children:(0,a.jsxs)(`div`,{className:`max-w-7xl mx-auto flex flex-col md:flex-row items-center justify-between gap-8`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3 anim-left`,children:[(0,a.jsx)(`div`,{className:`w-8 h-8 rounded-lg flex items-center justify-center text-sm font-bold border border-gray-100 ${s?`bg-white`:`bg-[#3D4E4B] text-[#D4A017]`}`,children:s?(0,a.jsx)(`img`,{src:s,className:`w-full h-full object-contain`}):c}),(0,a.jsxs)(`span`,{className:`text-sm font-bold tracking-tight`,children:[o,` © 2024`]})]}),(0,a.jsxs)(`div`,{className:`flex items-center gap-8 text-xs font-bold tracking-tight text-gray-400 anim-right`,children:[(0,a.jsx)(`a`,{href:`#`,className:`hover:text-[#3D4E4B]`,children:`Term of Service`}),(0,a.jsx)(`a`,{href:`#`,className:`hover:text-[#3D4E4B]`,children:`Privacy Protocol`}),(0,a.jsx)(`a`,{href:`#`,className:`hover:text-[#3D4E4B]`,children:`Compliance`})]})]})})]})}export{o as default}; \ No newline at end of file +import{c as e,n as t,o as n,r,t as i}from"./app-C2kGDHB9.js";e();var a=i();function o({auth:e}){let{system_settings:i}=n().props,o=i?.app_name||`biiproject kit v2`,s=i?.app_logo,c=i?.app_logo_text||`BK`;return(0,a.jsxs)(`div`,{className:`min-h-screen bg-[#E3EBE8] text-[#3D4E4B] selection:bg-[#D4A017] selection:text-white font-sans`,children:[(0,a.jsx)(t,{title:`${o} — Premium Enterprise Identity`}),(0,a.jsx)(`nav`,{className:`fixed w-full z-50 px-6 py-6 anim-down`,children:(0,a.jsxs)(`div`,{className:`max-w-7xl mx-auto flex items-center justify-between bg-white/80 backdrop-blur-md rounded-[2rem] px-8 py-4 border border-white/20 shadow-sm`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,a.jsx)(`div`,{className:`w-10 h-10 rounded-xl flex items-center justify-center text-xl font-bold overflow-hidden border border-gray-100 ${s?`bg-white`:`bg-[#3D4E4B] text-[#D4A017]`}`,children:s?(0,a.jsx)(`img`,{src:s,className:`w-full h-full object-contain`}):c}),(0,a.jsx)(`span`,{className:`text-sm font-bold tracking-tight`,children:o})]}),(0,a.jsxs)(`div`,{className:`flex items-center gap-8`,children:[(0,a.jsx)(`div`,{className:`hidden md:flex items-center gap-6`,children:[`Solutions`,`Ecosystem`,`Xxx`,`Governance`,`Intelligence`].map(e=>(0,a.jsx)(r,{href:e===`Xxx`?route(`xxx`):`#`,className:`text-sm font-bold tracking-tight hover:text-[#D4A017] transition-colors`,children:e},e))}),(0,a.jsx)(`div`,{className:`h-6 w-[1px] bg-gray-100 mx-2`}),e.user?(0,a.jsx)(r,{href:route(`dashboard`),className:`px-6 py-2.5 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#2D3A38] transition-all`,children:`Command Center`}):(0,a.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,a.jsx)(r,{href:route(`login`),className:`text-sm font-bold tracking-tight hover:text-[#D4A017] transition-colors`,children:`Access`}),(0,a.jsx)(r,{href:route(`register`),className:`px-6 py-2.5 bg-[#D4A017] text-white text-sm font-bold tracking-tight rounded-xl hover:bg-[#B88B14] transition-all`,children:`Initialize Identity`})]})]})]})}),(0,a.jsx)(`section`,{className:`relative pt-40 pb-20 px-6 overflow-hidden`,children:(0,a.jsxs)(`div`,{className:`max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-2 gap-20 items-center`,children:[(0,a.jsxs)(`div`,{className:`relative z-10 anim-left`,children:[(0,a.jsxs)(`div`,{className:`inline-flex items-center gap-2 px-4 py-2 bg-white rounded-full border border-gray-100 mb-8`,children:[(0,a.jsx)(`span`,{className:`flex h-2 w-2 rounded-full bg-[#D4A017]`}),(0,a.jsx)(`span`,{className:`text-xs font-bold tracking-tight text-[#D4A017]`,children:`Enterprise V4.0 Live`})]}),(0,a.jsxs)(`h1`,{className:`text-6xl lg:text-8xl font-bold text-[#3D4E4B] tracking-tighter leading-[0.9] mb-8`,children:[`Precision `,(0,a.jsx)(`br`,{}),(0,a.jsx)(`span`,{className:`text-transparent`,style:{WebkitTextStroke:`1px #3D4E4B`},children:`Identity`}),` `,(0,a.jsx)(`br`,{}),`Architecture.`]}),(0,a.jsx)(`p`,{className:`text-lg text-gray-500 font-medium max-w-md leading-relaxed mb-10`,children:`The ultimate governance framework for airline-grade digital ecosystems. Secure, modular, and uncompromisingly professional.`}),(0,a.jsxs)(`div`,{className:`flex flex-wrap items-center gap-8`,children:[(0,a.jsxs)(r,{href:e.user?route(`dashboard`):route(`register`),className:`px-10 py-5 bg-[#3D4E4B] text-white text-sm font-bold tracking-tight rounded-2xl hover:bg-[#2D3A38] transition-all shadow-2xl shadow-[#3D4E4B]/20 hover:shadow-[#D4A017]/10 flex items-center gap-3 group border border-[#3D4E4B]`,children:[e.user?`Access Command`:`Initialize Session`,(0,a.jsx)(`svg`,{className:`w-4 h-4 transition-transform group-hover:translate-x-1`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:3,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 7l5 5m0 0l-5 5m5-5H6`})})]}),(0,a.jsxs)(`div`,{className:`flex items-center`,children:[(0,a.jsx)(`div`,{className:`flex -space-x-3`,children:[1,2,3].map(e=>(0,a.jsx)(`div`,{className:`w-10 h-10 rounded-full border-4 border-[#E3EBE8] bg-[#3D4E4B] flex items-center justify-center text-sm font-bold text-white ring-1 ring-white/10`,children:String.fromCharCode(64+e)},e))}),(0,a.jsxs)(`div`,{className:`pl-6 flex flex-col justify-center`,children:[(0,a.jsx)(`span`,{className:`text-sm font-bold tracking-tight text-[#3D4E4B]`,children:`2,400+ Entities`}),(0,a.jsx)(`span`,{className:`text-sm font-semibold tracking-tight text-gray-400 mt-0.5`,children:`Authenticated Weekly`})]})]})]})]}),(0,a.jsx)(`div`,{className:`relative anim-right`,children:(0,a.jsxs)(`div`,{className:`aspect-square bg-white rounded-[3rem] border border-gray-100 shadow-2xl relative overflow-hidden p-8 group`,children:[(0,a.jsx)(`div`,{className:`absolute inset-0 bg-[#3D4E4B] opacity-0 group-hover:opacity-[0.02] transition-opacity`}),(0,a.jsxs)(`div`,{className:`w-full h-full border-2 border-dashed border-gray-100 rounded-[2rem] flex flex-col items-center justify-center relative`,children:[(0,a.jsx)(`div`,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-40 h-40 bg-[#D4A017]/10 rounded-full blur-[80px]`}),(0,a.jsx)(`div`,{className:`text-[120px] font-bold text-[#3D4E4B] opacity-5 select-none tracking-tight`,children:`SYSTEM`}),(0,a.jsxs)(`div`,{className:`absolute inset-x-8 bottom-8 h-32 bg-gray-50 rounded-2xl border border-gray-100 p-6 flex items-end justify-between`,children:[(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsx)(`div`,{className:`w-24 h-2 bg-gray-200 rounded-full`}),(0,a.jsx)(`div`,{className:`w-16 h-2 bg-gray-200 rounded-full opacity-50`})]}),(0,a.jsx)(`div`,{className:`w-12 h-12 bg-[#3D4E4B] rounded-xl`})]})]})]})})]})}),(0,a.jsx)(`section`,{className:`py-20 px-6 bg-white border-y border-gray-100`,children:(0,a.jsxs)(`div`,{className:`max-w-7xl mx-auto`,children:[(0,a.jsxs)(`div`,{className:`text-center mb-20 anim-up`,children:[(0,a.jsx)(`h2`,{className:`text-sm font-bold tracking-tight text-[#D4A017] mb-4`,children:`Core Ecosystem`}),(0,a.jsx)(`h3`,{className:`text-4xl font-bold text-[#3D4E4B] tracking-tight`,children:`Governance Intelligence.`})]}),(0,a.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-8`,children:[{t:`Secure Matrix`,d:`Advanced role-based access control with granular permission governance.`,c:`#3D4E4B`},{t:`Live Telemetry`,d:`Real-time activity monitoring and audit logging for complete transparency.`,c:`#D4A017`},{t:`Global Identity`,d:`Multi-provider authentication and identity verification systems.`,c:`#21A59F`}].map((e,t)=>(0,a.jsxs)(`div`,{className:`p-10 rounded-[2.5rem] bg-[#E3EBE8]/30 border border-gray-100 hover:bg-white hover:shadow-xl hover:-translate-y-2 transition-all duration-500 group anim-up`,style:{animationDelay:`${t*.1}s`},children:[(0,a.jsx)(`div`,{className:`w-12 h-12 rounded-2xl flex items-center justify-center text-white mb-8 group-hover:scale-110 transition-transform`,style:{backgroundColor:e.c},children:(0,a.jsx)(`svg`,{className:`w-6 h-6`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:3,children:(0,a.jsx)(`path`,{d:`M13 10V3L4 14h7v7l9-11h-7z`})})}),(0,a.jsx)(`h4`,{className:`text-sm font-bold tracking-tight text-[#3D4E4B] mb-4`,children:e.t}),(0,a.jsx)(`p`,{className:`text-sm font-medium text-gray-400 leading-relaxed tracking-tight`,children:e.d})]},t))})]})}),(0,a.jsx)(`footer`,{className:`py-12 px-6 border-t border-gray-100`,children:(0,a.jsxs)(`div`,{className:`max-w-7xl mx-auto flex flex-col md:flex-row items-center justify-between gap-8`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-3 anim-left`,children:[(0,a.jsx)(`div`,{className:`w-8 h-8 rounded-lg flex items-center justify-center text-sm font-bold border border-gray-100 ${s?`bg-white`:`bg-[#3D4E4B] text-[#D4A017]`}`,children:s?(0,a.jsx)(`img`,{src:s,className:`w-full h-full object-contain`}):c}),(0,a.jsxs)(`span`,{className:`text-sm font-bold tracking-tight`,children:[o,` © 2024`]})]}),(0,a.jsxs)(`div`,{className:`flex items-center gap-8 text-xs font-bold tracking-tight text-gray-400 anim-right`,children:[(0,a.jsx)(`a`,{href:`#`,className:`hover:text-[#3D4E4B]`,children:`Term of Service`}),(0,a.jsx)(`a`,{href:`#`,className:`hover:text-[#3D4E4B]`,children:`Privacy Protocol`}),(0,a.jsx)(`a`,{href:`#`,className:`hover:text-[#3D4E4B]`,children:`Compliance`})]})]})})]})}export{o as default}; \ No newline at end of file diff --git a/public/build/assets/Xxx-j7qS3EYb.js b/public/build/assets/Xxx-nngAMS4M.js similarity index 87% rename from public/build/assets/Xxx-j7qS3EYb.js rename to public/build/assets/Xxx-nngAMS4M.js index 8c66de5..c5e5b54 100644 --- a/public/build/assets/Xxx-j7qS3EYb.js +++ b/public/build/assets/Xxx-nngAMS4M.js @@ -1 +1 @@ -import{c as e,n as t,t as n}from"./app-BK5KCPMc.js";e();var r=n();function i({auth:e}){return(0,r.jsxs)(`div`,{className:`min-h-screen bg-[#E3EBE8] text-[#3D4E4B] font-sans`,children:[(0,r.jsx)(t,{title:`Xxx`}),(0,r.jsxs)(`div`,{className:`max-w-7xl mx-auto px-6 py-12`,children:[(0,r.jsx)(`h1`,{className:`text-3xl font-bold mb-8`,children:`Xxx Page`}),(0,r.jsx)(`div`,{className:`bg-white rounded-lg shadow-sm p-6`,children:(0,r.jsx)(`p`,{children:`This is the new xxx page content.`})})]})]})}export{i as default}; \ No newline at end of file +import{c as e,n as t,t as n}from"./app-C2kGDHB9.js";e();var r=n();function i({auth:e}){return(0,r.jsxs)(`div`,{className:`min-h-screen bg-[#E3EBE8] text-[#3D4E4B] font-sans`,children:[(0,r.jsx)(t,{title:`Xxx`}),(0,r.jsxs)(`div`,{className:`max-w-7xl mx-auto px-6 py-12`,children:[(0,r.jsx)(`h1`,{className:`text-3xl font-bold mb-8`,children:`Xxx Page`}),(0,r.jsx)(`div`,{className:`bg-white rounded-lg shadow-sm p-6`,children:(0,r.jsx)(`p`,{children:`This is the new xxx page content.`})})]})]})}export{i as default}; \ No newline at end of file diff --git a/public/build/assets/app-BK5KCPMc.js b/public/build/assets/app-C2kGDHB9.js similarity index 99% rename from public/build/assets/app-BK5KCPMc.js rename to public/build/assets/app-C2kGDHB9.js index 1c5c201..4ecd530 100644 --- a/public/build/assets/app-BK5KCPMc.js +++ b/public/build/assets/app-C2kGDHB9.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Index-DQODC9UE.js","assets/lodash-BXsCgLz3.js","assets/Portal-C0c8udmH.js","assets/AuthenticatedLayout-BjuyW-Hp.js","assets/ConfirmPassword-DBNbpA9Y.js","assets/GuestLayout-CgPUg7Kz.js","assets/ForgotPassword-BGsGiFYN.js","assets/Login-qxXrNDeD.js","assets/Register-B7hpuNim.js","assets/ResetPassword-Cp8_si20.js","assets/VerifyEmail-BkreAOfA.js","assets/Dashboard-BWFrXJia.js","assets/Index-BYUmRpDS.js","assets/Index-DcNFR6n1.js","assets/swal-D8hRpOIh.js","assets/swal-DtpL8WXZ.css","assets/Edit-CqP9KoA8.js","assets/filepond-plugin-file-validate-type-tybTRj_0.js","assets/filepond-plugin-file-validate-type-CEtEkCs1.css","assets/DeleteUserForm-DSLo5Ybm.js","assets/TextInput-BnQizTbW.js","assets/UpdatePasswordForm-CoUiuw4Q.js","assets/PrimaryButton-2i3vnLMz.js","assets/UpdateProfileInformationForm-DPfGMj-q.js","assets/Index-DFR_vfBx.js","assets/Can-DkptxH2j.js","assets/Index-db0jqw8f.js","assets/Index-Cx7Ouq_R.js","assets/Challenge-BcvFwzFZ.js","assets/Setup-D7-GiQxF.js","assets/Index-nOX76BwE.js","assets/Show-BhGooyPq.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Index-B7Zsmvlf.js","assets/lodash-BdNO5KR4.js","assets/Portal-B40Voc8b.js","assets/AuthenticatedLayout-C8h2HS7D.js","assets/ConfirmPassword-aqHWSvyY.js","assets/GuestLayout-DfP8Xy7D.js","assets/ForgotPassword-C_3dBdrE.js","assets/Login-DtnGAKBx.js","assets/Register-DYiZg_h7.js","assets/ResetPassword-CIvssuDm.js","assets/VerifyEmail-DvY7W-s2.js","assets/Dashboard-CpVakWgQ.js","assets/Index-DUo87EQf.js","assets/Index-Bi9DKRMK.js","assets/swal-DeDNECCu.js","assets/swal-DtpL8WXZ.css","assets/Edit-DhcQ-LdT.js","assets/filepond-plugin-file-validate-type-DOUFAaeW.js","assets/filepond-plugin-file-validate-type-CEtEkCs1.css","assets/DeleteUserForm-Bh5dZDoZ.js","assets/TextInput-BGMhFr2s.js","assets/UpdatePasswordForm-Co29OuF0.js","assets/PrimaryButton-C1Df3FyG.js","assets/UpdateProfileInformationForm-4t1_h1jU.js","assets/Index-DaQeOcsk.js","assets/Can-bASqMhyx.js","assets/Index-v8jEWebY.js","assets/Index-BzmzPZNr.js","assets/Challenge-fTLTkT9A.js","assets/Setup-BG3giU65.js","assets/Index-ezavejt9.js","assets/Show-BOefHxwU.js"])))=>i.map(i=>d[i]); var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));function u(e,t){return function(){return e.apply(t,arguments)}}var{toString:d}=Object.prototype,{getPrototypeOf:f}=Object,{iterator:p,toStringTag:m}=Symbol,h=(e=>t=>{let n=d.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),g=e=>(e=e.toLowerCase(),t=>h(t)===e),_=e=>t=>typeof t===e,{isArray:v}=Array,y=_(`undefined`);function b(e){return e!==null&&!y(e)&&e.constructor!==null&&!y(e.constructor)&&w(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var x=g(`ArrayBuffer`);function S(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&x(e.buffer),t}var C=_(`string`),w=_(`function`),T=_(`number`),E=e=>typeof e==`object`&&!!e,D=e=>e===!0||e===!1,O=e=>{if(h(e)!==`object`)return!1;let t=f(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(m in e)&&!(p in e)},k=e=>{if(!E(e)||b(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},A=g(`Date`),j=g(`File`),M=e=>!!(e&&e.uri!==void 0),N=e=>e&&e.getParts!==void 0,P=g(`Blob`),F=g(`FileList`),I=e=>E(e)&&w(e.pipe);function L(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var ee=L(),te=ee.FormData===void 0?void 0:ee.FormData,ne=e=>{if(!e)return!1;if(te&&e instanceof te)return!0;let t=f(e);if(!t||t===Object.prototype||!w(e.append))return!1;let n=h(e);return n===`formdata`||n===`object`&&w(e.toString)&&e.toString()===`[object FormData]`},R=g(`URLSearchParams`),[re,ie,ae,z]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(g),oe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function se(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),v(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}var le=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,ue=e=>!y(e)&&e!==le;function de(...e){let{caseless:t,skipUndefined:n}=ue(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&ce(r,i)||i,o=Ce(r,a)?r[a]:void 0;O(o)&&O(e)?r[a]=de(o,e):O(e)?r[a]=de({},e):v(e)?r[a]=e.slice():(!n||!y(e))&&(r[a]=e)};for(let t=0,n=e.length;t(se(t,(t,r)=>{n&&w(t)?Object.defineProperty(e,r,{__proto__:null,value:u(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),pe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),me=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,`constructor`,{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,`super`,{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},he=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&f(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ge=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},_e=e=>{if(!e)return null;if(v(e))return e;let t=e.length;if(!T(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},ve=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&f(Uint8Array)),ye=(e,t)=>{let n=(e&&e[p]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},be=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},xe=g(`HTMLFormElement`),Se=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),Ce=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),we=g(`RegExp`),Te=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};se(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},Ee=e=>{Te(e,(t,n)=>{if(w(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(w(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},De=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return v(e)?r(e):r(String(e).split(t)),n},Oe=()=>{},ke=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Ae(e){return!!(e&&w(e.append)&&e[m]===`FormData`&&e[p])}var je=e=>{let t=Array(10),n=(e,r)=>{if(E(e)){if(t.indexOf(e)>=0)return;if(b(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=v(e)?[]:{};return se(e,(e,t)=>{let a=n(e,r+1);!y(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},Me=g(`AsyncFunction`),Ne=e=>e&&(E(e)||w(e))&&w(e.then)&&w(e.catch),Pe=((e,t)=>e?setImmediate:t?((e,t)=>(le.addEventListener(`message`,({source:n,data:r})=>{n===le&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),le.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,w(le.postMessage)),B={isArray:v,isArrayBuffer:x,isBuffer:b,isFormData:ne,isArrayBufferView:S,isString:C,isNumber:T,isBoolean:D,isObject:E,isPlainObject:O,isEmptyObject:k,isReadableStream:re,isRequest:ie,isResponse:ae,isHeaders:z,isUndefined:y,isDate:A,isFile:j,isReactNativeBlob:M,isReactNative:N,isBlob:P,isRegExp:we,isFunction:w,isStream:I,isURLSearchParams:R,isTypedArray:ve,isFileList:F,forEach:se,merge:de,extend:fe,trim:oe,stripBOM:pe,inherits:me,toFlatObject:he,kindOf:h,kindOfTest:g,endsWith:ge,toArray:_e,forEachEntry:ye,matchAll:be,isHTMLForm:xe,hasOwnProperty:Ce,hasOwnProp:Ce,reduceDescriptors:Te,freezeMethods:Ee,toObjectSet:De,toCamelCase:Se,noop:Oe,toFiniteNumber:ke,findKey:ce,global:le,isContextDefined:ue,isSpecCompliantForm:Ae,toJSONObject:je,isAsyncFn:Me,isThenable:Ne,setImmediate:Pe,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(le):typeof process<`u`&&process.nextTick||Pe,isIterable:e=>e!=null&&w(e[p])},Fe=B.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),Ie=e=>{let t={},n,r,i;return e&&e.split(` `).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&Fe[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},Le=Symbol(`internals`),Re=/[^\x09\x20-\x7E\x80-\xFF]/g;function ze(e){let t=0,n=e.length;for(;tt;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function Be(e){return e&&String(e).trim().toLowerCase()}function Ve(e){return ze(e.replace(Re,``))}function He(e){return e===!1||e==null?e:B.isArray(e)?e.map(He):Ve(String(e))}function Ue(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var We=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ge(e,t,n,r,i){if(B.isFunction(r))return r.call(this,t,n);if(i&&(t=n),B.isString(t)){if(B.isString(r))return t.indexOf(r)!==-1;if(B.isRegExp(r))return r.test(t)}}function Ke(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function qe(e,t){let n=B.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var Je=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=Be(t);if(!i)throw Error(`header name must be a non-empty string`);let a=B.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=He(e))}let a=(e,t)=>B.forEach(e,(e,n)=>i(e,n,t));if(B.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(B.isString(e)&&(e=e.trim())&&!We(e))a(Ie(e),t);else if(B.isObject(e)&&B.isIterable(e)){let n={},r,i;for(let t of e){if(!B.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?B.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=Be(e),e){let n=B.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return Ue(e);if(B.isFunction(t))return t.call(this,e,n);if(B.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=Be(e),e){let n=B.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Ge(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=Be(e),e){let i=B.findKey(n,e);i&&(!t||Ge(n,n[i],i,t))&&(delete n[i],r=!0)}}return B.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||Ge(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return B.forEach(this,(r,i)=>{let a=B.findKey(n,i);if(a){t[a]=He(r),delete t[i];return}let o=e?Ke(i):String(i).trim();o!==i&&delete t[i],t[o]=He(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return B.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&B.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(` `)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[Le]=this[Le]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=Be(e);t[r]||(qe(n,e),t[r]=!0)}return B.isArray(e)?e.forEach(r):r(e),this}};Je.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),B.reduceDescriptors(Je.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),B.freezeMethods(Je);var Ye=`[REDACTED ****]`;function Xe(e){if(B.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(B.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function Ze(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||B.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof Je&&(e=e.toJSON()),r.push(e);let t;if(B.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);B.isUndefined(r)||(t[n]=r)});else{if(!B.isPlainObject(e)&&Xe(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?Ye:i(a);B.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}var V=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,`message`,{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&B.hasOwnProp(e,`redact`)?e.redact:void 0,n=B.isArray(t)&&t.length>0?Ze(e,t):B.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};V.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,V.ERR_BAD_OPTION=`ERR_BAD_OPTION`,V.ECONNABORTED=`ECONNABORTED`,V.ETIMEDOUT=`ETIMEDOUT`,V.ECONNREFUSED=`ECONNREFUSED`,V.ERR_NETWORK=`ERR_NETWORK`,V.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,V.ERR_DEPRECATED=`ERR_DEPRECATED`,V.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,V.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,V.ERR_CANCELED=`ERR_CANCELED`,V.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,V.ERR_INVALID_URL=`ERR_INVALID_URL`,V.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function Qe(e){return B.isPlainObject(e)||B.isArray(e)}function $e(e){return B.endsWith(e,`[]`)?e.slice(0,-2):e}function et(e,t,n){return e?e.concat(t).map(function(e,t){return e=$e(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function tt(e){return B.isArray(e)&&!e.some(Qe)}var nt=B.toFlatObject(B,{},null,function(e){return/^is[A-Z]/.test(e)});function rt(e,t,n){if(!B.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!B.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||d,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&B.isSpecCompliantForm(t);if(!B.isFunction(i))throw TypeError(`visitor must be a function`);function u(e){if(e===null)return``;if(B.isDate(e))return e.toISOString();if(B.isBoolean(e))return e.toString();if(!l&&B.isBlob(e))throw new V(`Blob is not supported. Use a Buffer instead.`);return B.isArrayBuffer(e)||B.isTypedArray(e)?l&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function d(e,n,i){let s=e;if(B.isReactNative(t)&&B.isReactNativeBlob(e))return t.append(et(i,n,a),u(e)),!1;if(e&&!i&&typeof e==`object`){if(B.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(B.isArray(e)&&tt(e)||(B.isFileList(e)||B.endsWith(n,`[]`))&&(s=B.toArray(e)))return n=$e(n),s.forEach(function(e,r){!(B.isUndefined(e)||e===null)&&t.append(o===!0?et([n],r,a):o===null?n:n+`[]`,u(e))}),!1}return Qe(e)?!0:(t.append(et(i,n,a),u(e)),!1)}let f=[],p=Object.assign(nt,{defaultVisitor:d,convertValue:u,isVisitable:Qe});function m(e,n,r=0){if(!B.isUndefined(e)){if(r>c)throw new V(`Object is too deeply nested (`+r+` levels). Max depth: `+c,V.ERR_FORM_DATA_DEPTH_EXCEEDED);if(f.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));f.push(e),B.forEach(e,function(e,a){(!(B.isUndefined(e)||e===null)&&i.call(t,e,B.isString(a)?a.trim():a,n,p))===!0&&m(e,n?n.concat(a):[a],r+1)}),f.pop()}}if(!B.isObject(e))throw TypeError(`data must be an object`);return m(e),t}function it(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function at(e,t){this._pairs=[],e&&rt(e,this,t)}var ot=at.prototype;ot.append=function(e,t){this._pairs.push([e,t])},ot.toString=function(e){let t=e?function(t){return e.call(this,t,it)}:it;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function st(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function ct(e,t,n){if(!t)return e;let r=n&&n.encode||st,i=B.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):B.isURLSearchParams(t)?t.toString():new at(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var lt=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){B.forEach(this.handlers,function(t){t!==null&&e(t)})}},ut={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},dt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:at,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},ft=s({hasBrowserEnv:()=>pt,hasStandardBrowserEnv:()=>ht,hasStandardBrowserWebWorkerEnv:()=>gt,navigator:()=>mt,origin:()=>_t}),pt=typeof window<`u`&&typeof document<`u`,mt=typeof navigator==`object`&&navigator||void 0,ht=pt&&(!mt||[`ReactNative`,`NativeScript`,`NS`].indexOf(mt.product)<0),gt=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,_t=pt&&window.location.href||`http://localhost`,vt={...ft,...dt};function yt(e,t){return rt(e,new vt.classes.URLSearchParams,{visitor:function(e,t,n,r){return vt.isNode&&B.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function bt(e){return B.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function xt(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r=e.length;return a=!a&&B.isArray(r)?r.length:a,s?(B.hasOwnProp(r,a)?r[a]=B.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!r[a]||!B.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&B.isArray(r[a])&&(r[a]=xt(r[a])),!o)}if(B.isFormData(e)&&B.isFunction(e.entries)){let n={};return B.forEachEntry(e,(e,r)=>{t(bt(e),r,n,0)}),n}return null}var Ct=(e,t)=>e!=null&&B.hasOwnProp(e,t)?e[t]:void 0;function wt(e,t,n){if(B.isString(e))try{return(t||JSON.parse)(e),B.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var Tt={transitional:ut,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=B.isObject(e);if(i&&B.isHTMLForm(e)&&(e=new FormData(e)),B.isFormData(e))return r?JSON.stringify(St(e)):e;if(B.isArrayBuffer(e)||B.isBuffer(e)||B.isStream(e)||B.isFile(e)||B.isBlob(e)||B.isReadableStream(e))return e;if(B.isArrayBufferView(e))return e.buffer;if(B.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=Ct(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return yt(e,t).toString();if((a=B.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=Ct(this,`env`),r=n&&n.FormData;return rt(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),wt(e)):e}],transformResponse:[function(e){let t=Ct(this,`transitional`)||Tt.transitional,n=t&&t.forcedJSONParsing,r=Ct(this,`responseType`),i=r===`json`;if(B.isResponse(e)||B.isReadableStream(e))return e;if(e&&B.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Ct(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?V.from(e,V.ERR_BAD_RESPONSE,this,null,Ct(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:vt.classes.FormData,Blob:vt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};B.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`],e=>{Tt.headers[e]={}});function Et(e,t){let n=this||Tt,r=t||n,i=Je.from(r.headers),a=r.data;return B.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Dt(e){return!!(e&&e.__CANCEL__)}var Ot=class extends V{constructor(e,t,n){super(e??`canceled`,V.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function kt(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new V(`Request failed with status code `+n.status,n.status>=400&&n.status<500?V.ERR_BAD_REQUEST:V.ERR_BAD_RESPONSE,n.config,n.request,n))}function At(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function jt(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var Nt=(e,t,n=3)=>{let r=0,i=jt(50,250);return Mt(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Pt=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ft=e=>(...t)=>B.asap(()=>e(...t)),It=vt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,vt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(vt.origin),vt.navigator&&/(msie|trident)/i.test(vt.navigator.userAgent)):()=>!0,Lt=vt.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];B.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),B.isString(r)&&s.push(`path=${r}`),B.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),B.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;ne instanceof Je?{...e}:e;function Vt(e,t){t||={};let n=Object.create(null);Object.defineProperty(n,`hasOwnProperty`,{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return B.isPlainObject(e)&&B.isPlainObject(t)?B.merge.call({caseless:r},e,t):B.isPlainObject(t)?B.merge({},t):B.isArray(t)?t.slice():t}function i(e,t,n,i){if(!B.isUndefined(t))return r(e,t,n,i);if(!B.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!B.isUndefined(t))return r(void 0,t)}function o(e,t){if(!B.isUndefined(t))return r(void 0,t);if(!B.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(B.hasOwnProp(t,a))return r(n,i);if(B.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(Bt(e),Bt(t),n,!0)};return B.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=B.hasOwnProp(c,r)?c[r]:i,o=a(B.hasOwnProp(e,r)?e[r]:void 0,B.hasOwnProp(t,r)?t[r]:void 0,r);B.isUndefined(o)&&a!==s||(n[r]=o)}),n}var Ht=[`content-type`,`content-length`];function Ut(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t).forEach(([t,n])=>{Ht.includes(t.toLowerCase())&&e.set(t,n)})}var Wt=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Gt=e=>{let t=Vt({},e),n=e=>B.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=Je.from(s),t.url=ct(zt(l,d,u),e.params,e.paramsSerializer),c&&s.set(`Authorization`,`Basic `+btoa((c.username||``)+`:`+(c.password?Wt(c.password):``))),B.isFormData(r)&&(vt.hasStandardBrowserEnv||vt.hasStandardBrowserWebWorkerEnv?s.setContentType(void 0):B.isFunction(r.getHeaders)&&Ut(s,r.getHeaders(),n(`formDataHeaderPolicy`))),vt.hasStandardBrowserEnv&&(B.isFunction(i)&&(i=i(t)),i===!0||i==null&&It(t.url))){let e=a&&o&&Lt.read(o);e&&s.set(a,e)}return t},Kt=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=Gt(e),i=r.data,a=Je.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=Je.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());kt(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith(`file:`))||setTimeout(g)},h.onabort=function(){h&&=(n(new V(`Request aborted`,V.ECONNABORTED,e,h)),m(),null)},h.onerror=function(t){let r=new V(t&&t.message?t.message:`Network Error`,V.ERR_NETWORK,e,h);r.event=t||null,n(r),m(),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||ut;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new V(t,i.clarifyTimeoutError?V.ETIMEDOUT:V.ECONNABORTED,e,h)),m(),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&B.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),B.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=Nt(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=Nt(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new Ot(null,e,h):t),h.abort(),m(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=At(r.url);if(_&&!vt.protocols.includes(_)){n(new V(`Unsupported protocol `+_+`:`,V.ERR_BAD_REQUEST,e));return}h.send(i||null)})},qt=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof V?t:new Ot(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new V(`timeout of ${t}ms exceeded`,V.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>B.asap(o),s}},Jt=function*(e,t){let n=e.byteLength;if(!t||n{let i=Yt(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})};function Qt(e){if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let t=e.indexOf(`,`);if(t<0)return 0;let n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length,t=r.length;for(let n=0;n=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102)&&(e-=2,n+=2)}let n=0,i=t-1,a=e=>e>=2&&r.charCodeAt(e-2)===37&&r.charCodeAt(e-1)===51&&(r.charCodeAt(e)===68||r.charCodeAt(e)===100);i>=0&&(r.charCodeAt(i)===61?(n++,i--):a(i)&&(n++,i-=3)),n===1&&i>=0&&(r.charCodeAt(i)===61||a(i))&&n++;let o=Math.floor(e/4)*3-(n||0);return o>0?o:0}if(typeof Buffer<`u`&&typeof Buffer.byteLength==`function`)return Buffer.byteLength(r,`utf8`);let i=0;for(let e=0,t=r.length;e=55296&&n<=56319&&e+1=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}var $t=`1.16.0`,en=64*1024,{isFunction:tn}=B,nn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},rn=e=>{let t=B.global??globalThis,{ReadableStream:n,TextEncoder:r}=t;e=B.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?tn(i):typeof fetch==`function`,c=tn(a),l=tn(o);if(!s)return!1;let u=s&&tn(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&nn(()=>{let e=!1,t=new a(vt.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&nn(()=>B.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new V(`Response type '${e}' is not supported`,V.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(B.isBlob(e))return e.size;if(B.isSpecCompliantForm(e))return(await new a(vt.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(B.isArrayBufferView(e)||B.isArrayBuffer(e))return e.byteLength;if(B.isURLSearchParams(e)&&(e+=``),B.isString(e))return(await d(e)).byteLength},g=async(e,t)=>B.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:u,timeout:d,onDownloadProgress:h,onUploadProgress:_,responseType:v,headers:y,withCredentials:b=`same-origin`,fetchOptions:x,maxContentLength:S,maxBodyLength:C}=Gt(e),w=B.isNumber(S)&&S>-1,T=B.isNumber(C)&&C>-1,E=i||fetch;v=v?(v+``).toLowerCase():`text`;let D=qt([l,u&&u.toAbortSignal()],d),O=null,k=D&&D.unsubscribe&&(()=>{D.unsubscribe()}),A;try{if(w&&typeof t==`string`&&t.startsWith(`data:`)&&Qt(t)>S)throw new V(`maxContentLength size of `+S+` exceeded`,V.ERR_BAD_RESPONSE,e,O);if(T&&n!==`get`&&n!==`head`){let t=await g(y,s);if(typeof t==`number`&&isFinite(t)&&t>C)throw new V(`Request body larger than maxBodyLength limit`,V.ERR_BAD_REQUEST,e,O)}if(_&&f&&n!==`get`&&n!==`head`&&(A=await g(y,s))!==0){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(B.isFormData(s)&&(n=e.headers.get(`content-type`))&&y.setContentType(n),e.body){let[t,n]=Pt(A,Nt(Ft(_)));s=Zt(e.body,en,t,n)}}B.isString(b)||(b=b?`include`:`omit`);let i=c&&`credentials`in a.prototype;if(B.isFormData(s)){let e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete(`content-type`)}y.set(`User-Agent`,`axios/`+$t,!1);let l={...x,signal:D,method:n.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:`half`,credentials:i?b:void 0};O=c&&new a(t,l);let u=await(c?E(O,x):E(t,l));if(w){let t=B.toFiniteNumber(u.headers.get(`content-length`));if(t!=null&&t>S)throw new V(`maxContentLength size of `+S+` exceeded`,V.ERR_BAD_RESPONSE,e,O)}let d=p&&(v===`stream`||v===`response`);if(p&&u.body&&(h||w||d&&k)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=u[e]});let n=B.toFiniteNumber(u.headers.get(`content-length`)),[r,i]=h&&Pt(n,Nt(Ft(h),!0))||[],a=0;u=new o(Zt(u.body,en,t=>{if(w&&(a=t,a>S))throw new V(`maxContentLength size of `+S+` exceeded`,V.ERR_BAD_RESPONSE,e,O);r&&r(t)},()=>{i&&i(),k&&k()}),t)}v||=`text`;let j=await m[B.findKey(m,v)||`text`](u,e);if(w&&!p&&!d){let t;if(j!=null&&(typeof j.byteLength==`number`?t=j.byteLength:typeof j.size==`number`?t=j.size:typeof j==`string`&&(t=typeof r==`function`?new r().encode(j).byteLength:j.length)),typeof t==`number`&&t>S)throw new V(`maxContentLength size of `+S+` exceeded`,V.ERR_BAD_RESPONSE,e,O)}return!d&&k&&k(),await new Promise((t,n)=>{kt(t,n,{data:j,headers:Je.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:O})})}catch(t){if(k&&k(),D&&D.aborted&&D.reason instanceof V){let n=D.reason;throw n.config=e,O&&(n.request=O),t!==n&&(n.cause=t),n}throw t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new V(`Network Error`,V.ERR_NETWORK,e,O,t&&t.response),{cause:t.cause||t}):V.from(t,t&&t.code,e,O,t&&t.response)}}},an=new Map,on=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=an;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:rn(t)),l=c;return c};on();var sn={http:null,xhr:Kt,fetch:{get:on}};B.forEach(sn,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{__proto__:null,value:t})}catch{}Object.defineProperty(e,`adapterName`,{__proto__:null,value:t})}});var cn=e=>`- ${e}`,ln=e=>B.isFunction(e)||e===null||e===!1;function un(e,t){e=B.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new V(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since : @@ -92,4 +92,4 @@ Error generating stack: `+e.message+` `+e.stack}return{value:e,source:t,stack:i,digest:null}}function Ts(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Es(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ds=typeof WeakMap==`function`?WeakMap:Map;function Os(e,t,n){n=$a(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){rl||(rl=!0,il=r),Es(e,t)},n}function ks(e,t,n){n=$a(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Es(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Es(e,t),typeof r!=`function`&&(al===null?al=new Set([this]):al.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function As(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ds;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Bl.bind(null,e,t,n),t.then(e,e))}function js(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Ms(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=$a(-1,1),t.tag=2,eo(n,t,1))),n.lanes|=1),e)}var Ns=x.ReactCurrentOwner,Ps=!1;function Fs(e,t,n,r){t.child=e===null?Ia(t,null,n,r):Fa(t,e.child,n,r)}function Is(e,t,n,r,i){n=n.render;var a=t.ref;return Wa(t,i),r=jo(e,t,n,r,a,i),n=Mo(),e!==null&&!Ps?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,nc(e,t,i)):(ya&&n&&ha(t),t.flags|=1,Fs(e,t,r,i),t.child)}function Ls(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Jl(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Rs(e,t,a,r,i)):(e=Zl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Er:n,n(o,r)&&e.ref===t.ref)return nc(e,t,i)}return t.flags|=1,e=Xl(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Er(a,r)&&e.ref===t.ref)if(Ps=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Ps=!0);else return t.lanes=e.lanes,nc(e,t,i)}return Vs(e,t,n,r,i)}function zs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},K(Kc,Gc),Gc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,K(Kc,Gc),Gc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,K(Kc,Gc),Gc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),K(Kc,Gc),Gc|=r;return Fs(e,t,i,n),t.child}function Bs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Vs(e,t,n,r,i){var a=qi(n)?Gi:Ui.current;return a=Ki(t,a),Wa(t,i),n=jo(e,t,n,r,a,i),r=Mo(),e!==null&&!Ps?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,nc(e,t,i)):(ya&&r&&ha(t),t.flags|=1,Fs(e,t,n,i),t.child)}function Hs(e,t,n,r,i){if(qi(n)){var a=!0;Zi(t)}else a=!1;if(Wa(t,i),t.stateNode===null)tc(e,t),xs(t,n,r),Cs(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Ga(l):(l=qi(n)?Gi:Ui.current,l=Ki(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Ss(t,o,r,l),Xa=!1;var f=t.memoizedState;o.state=f,ro(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Wi.current||Xa?(typeof u==`function`&&(vs(t,n,u,r),c=t.memoizedState),(s=Xa||bs(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Qa(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:_s(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Ga(c):(c=qi(n)?Gi:Ui.current,c=Ki(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Ss(t,o,r,c),Xa=!1,f=t.memoizedState,o.state=f,ro(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Wi.current||Xa?(typeof p==`function`&&(vs(t,n,p,r),m=t.memoizedState),(l=Xa||bs(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Us(e,t,n,r,a,i)}function Us(e,t,n,r,i,a){Bs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&Qi(t,n,!1),nc(e,t,a);r=t.stateNode,Ns.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Fa(t,e.child,null,a),t.child=Fa(t,null,s,a)):Fs(e,t,s,a),t.memoizedState=r.state,i&&Qi(t,n,!0),t.child}function Ws(e){var t=e.stateNode;t.pendingContext?Yi(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Yi(e,t.context,!1),uo(e,t.containerInfo)}function Gs(e,t,n,r,i){return Oa(),ka(i),t.flags|=256,Fs(e,t,n,r),t.child}var Ks={dehydrated:null,treeContext:null,retryLane:0};function qs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Js(e,t,n){var r=t.pendingProps,i=ho.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),K(ho,i&1),e===null)return wa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=$l(o,r,0,null),e=Ql(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=qs(n),t.memoizedState=Ks,e):Ys(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Zs(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Xl(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=Ql(a,o,n,null),a.flags|=2):a=Xl(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?qs(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Ks,r}return a=e.child,e=a.sibling,r=Xl(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ys(e,t){return t=$l({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function Xs(e,t,n,r){return r!==null&&ka(r),Fa(t,e.child,null,n),e=Ys(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zs(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Ts(Error(r(422))),Xs(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=$l({mode:`visible`,children:i.children},a,0,null),o=Ql(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Fa(t,e.child,null,s),t.child.memoizedState=qs(s),t.memoizedState=Ks,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return Xs(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Ts(o,i,void 0),Xs(e,t,s,i)}if(c=(s&e.childLanes)!==0,Ps||c){if(i=Hc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,Ya(e,a),hl(i,e,a,-1))}return kl(),i=Ts(Error(r(421))),Xs(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Hl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,va=Ei(a.nextSibling),_a=t,ya=!0,ba=null,e!==null&&(ca[la++]=da,ca[la++]=fa,ca[la++]=ua,da=e.id,fa=e.overflow,ua=t),t=Ys(t,i.children),t.flags|=4096,t)}function Qs(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ua(e.return,t,n)}function $s(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Fs(e,t,r.children,n),r=ho.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qs(e,n,t);else if(e.tag===19)Qs(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(K(ho,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&go(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$s(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&go(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$s(t,!0,n,null,a);break;case`together`:$s(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function tc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function nc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yc|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=Xl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Xl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function rc(e,t,n){switch(t.tag){case 3:Ws(t),Oa();break;case 5:po(t);break;case 1:qi(t.type)&&Zi(t);break;case 4:uo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;K(La,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(K(ho,ho.current&1),e=nc(e,t,n),e===null?null:e.sibling):Js(e,t,n):(K(ho,ho.current&1),t.flags|=128,null);K(ho,ho.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),K(ho,ho.current),r)break;return null;case 22:case 23:return t.lanes=0,zs(e,t,n)}return nc(e,t,n)}var ic=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ac=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,lo(oo.current);var o=null;switch(n){case`input`:i=de(e,i),r=de(e,r),o=[];break;case`select`:i=L({},i,{value:void 0}),r=L({},r,{value:void 0}),o=[];break;case`textarea`:i=ye(e,i),r=ye(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=gi)}Ne(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&W(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},oc=function(e,t,n,r){n!==r&&(t.flags|=4)};function sc(e,t){if(!ya)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function cc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function lc(e,t,n){var i=t.pendingProps;switch(ga(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cc(t),null;case 1:return qi(t.type)&&Ji(),cc(t),null;case 3:return i=t.stateNode,fo(),G(Wi),G(Ui),vo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ea(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ba!==null&&(yl(ba),ba=null))),cc(t),null;case 5:mo(t);var o=lo(co.current);if(n=t.type,e!==null&&t.stateNode!=null)ac(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return cc(t),null}if(e=lo(oo.current),Ea(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[ki]=t,i[Ai]=s,e=(t.mode&1)!=0,n){case`dialog`:W(`cancel`,i),W(`close`,i);break;case`iframe`:case`object`:case`embed`:W(`load`,i);break;case`video`:case`audio`:for(o=0;o<$r.length;o++)W($r[o],i);break;case`source`:W(`error`,i);break;case`img`:case`image`:case`link`:W(`error`,i),W(`load`,i);break;case`details`:W(`toggle`,i);break;case`input`:fe(i,s),W(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},W(`invalid`,i);break;case`textarea`:be(i,s),W(`invalid`,i)}for(var c in Ne(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&hi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&hi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&W(`scroll`,i)}switch(n){case`input`:ce(i),he(i,s,!0);break;case`textarea`:ce(i),Se(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=gi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=Ce(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`