@zango-core/appbuilder 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConfigurePage-DRzSb06z.js +29 -0
- package/dist/ConfigurePage-DRzSb06z.js.map +1 -0
- package/dist/LoginPageWithRoleSelection-xTr_eIWh.js +662 -0
- package/dist/LoginPageWithRoleSelection-xTr_eIWh.js.map +1 -0
- package/dist/PageTypeRegistry-5269IpiS.js +53 -0
- package/dist/PageTypeRegistry-5269IpiS.js.map +1 -0
- package/dist/index.framework-B8SMzgN1.js +28005 -0
- package/dist/index.framework-B8SMzgN1.js.map +1 -0
- package/dist/types/App.d.ts +14 -0
- package/dist/types/__tests__/mocks/data/appInitData.d.ts +197 -0
- package/dist/types/__tests__/mocks/data/authConfigData.d.ts +356 -0
- package/dist/types/__tests__/mocks/externalPackages.d.ts +42 -0
- package/dist/types/__tests__/mocks/handlers/appInit.handlers.d.ts +3 -0
- package/dist/types/__tests__/mocks/handlers/auth.handlers.d.ts +1 -0
- package/dist/types/__tests__/mocks/handlers/index.d.ts +5 -0
- package/dist/types/__tests__/mocks/handlers/profile.handlers.d.ts +15 -0
- package/dist/types/__tests__/mocks/handlers/session.handlers.d.ts +2 -0
- package/dist/types/__tests__/setup/setupDOMMatchers.d.ts +0 -0
- package/dist/types/__tests__/setup/setupMSW.d.ts +1 -0
- package/dist/types/__tests__/setup/setupTests.d.ts +34 -0
- package/dist/types/__tests__/utils/mockRouterUtils.d.ts +62 -0
- package/dist/types/__tests__/utils/renderWithProviders.d.ts +22 -0
- package/dist/types/__tests__/utils/waitForHelpers.d.ts +36 -0
- package/dist/types/auth/components/AuthMobileShell.d.ts +8 -0
- package/dist/types/auth/components/AuthProvider.d.ts +30 -0
- package/dist/types/auth/components/DynamicLoginForm.d.ts +9 -0
- package/dist/types/auth/components/ForgotPasswordForm.d.ts +11 -0
- package/dist/types/auth/components/LoginForm.d.ts +7 -0
- package/dist/types/auth/components/LoginRouter.d.ts +197 -0
- package/dist/types/auth/components/OAuthCallback.d.ts +19 -0
- package/dist/types/auth/components/OTPForm.d.ts +11 -0
- package/dist/types/auth/components/OTPInput.d.ts +8 -0
- package/dist/types/auth/components/PasswordResetRequired.d.ts +23 -0
- package/dist/types/auth/components/ProviderButton.d.ts +17 -0
- package/dist/types/auth/components/ResetPasswordForm.d.ts +12 -0
- package/dist/types/auth/components/RoleSelection.d.ts +25 -0
- package/dist/types/auth/components/SecondFactorAuth.d.ts +21 -0
- package/dist/types/auth/components/composable/OTPLoginForm.d.ts +17 -0
- package/dist/types/auth/components/composable/PasswordLoginForm.d.ts +17 -0
- package/dist/types/auth/components/composable/SSOButtons.d.ts +61 -0
- package/dist/types/auth/components/composable/index.d.ts +42 -0
- package/dist/types/auth/contexts/LoginContext.d.ts +6 -0
- package/dist/types/auth/hocs/withMultiStepAuth.d.ts +35 -0
- package/dist/types/auth/index.d.ts +23 -0
- package/dist/types/auth/pages/CompleteAuthFlow.d.ts +24 -0
- package/dist/types/auth/pages/LoginPage.d.ts +8 -0
- package/dist/types/auth/pages/LoginPageWithRoleSelection.d.ts +13 -0
- package/dist/types/auth/pages/OAuthCallbackPage.d.ts +17 -0
- package/dist/types/auth/pages/SAMLCallbackPage.d.ts +16 -0
- package/dist/types/auth/services/authService.d.ts +87 -0
- package/dist/types/auth/services/internal/apiClients.d.ts +9 -0
- package/dist/types/auth/services/internal/authState.d.ts +12 -0
- package/dist/types/auth/services/internal/errorHelper.d.ts +1 -0
- package/dist/types/auth/services/internal/oauthSamlService.d.ts +46 -0
- package/dist/types/auth/services/internal/passwordValidator.d.ts +17 -0
- package/dist/types/auth/services/network/api.d.ts +1629 -0
- package/dist/types/auth/services/network/base.d.ts +31 -0
- package/dist/types/auth/services/network/configuration.d.ts +74 -0
- package/dist/types/auth/services/network/index.d.ts +13 -0
- package/dist/types/auth/stores/index.d.ts +1 -0
- package/dist/types/auth/stores/useAuthStore.d.ts +6 -0
- package/dist/types/auth/types/index.d.ts +57 -0
- package/dist/types/auth/utils/authFlowHandler.d.ts +72 -0
- package/dist/types/auth/utils/authUtils.d.ts +21 -0
- package/dist/types/auth/utils/validators.d.ts +18 -0
- package/dist/types/components/ErrorBoundary.d.ts +23 -0
- package/dist/types/components/ErrorFallback.d.ts +8 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/ui/avatar.d.ts +11 -0
- package/dist/types/components/ui/button.d.ts +10 -0
- package/dist/types/components/ui/collapsible.d.ts +5 -0
- package/dist/types/components/ui/dialog.d.ts +13 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +10 -0
- package/dist/types/components/ui/empty.d.ts +8 -0
- package/dist/types/components/ui/index.d.ts +12 -0
- package/dist/types/components/ui/input.d.ts +3 -0
- package/dist/types/components/ui/separator.d.ts +4 -0
- package/dist/types/components/ui/sheet.d.ts +14 -0
- package/dist/types/components/ui/sidebar.d.ts +69 -0
- package/dist/types/components/ui/skeleton.d.ts +2 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/framework/ZangoApp.d.ts +19 -0
- package/dist/types/framework/components/CachedLogo.d.ts +9 -0
- package/dist/types/framework/components/CustomPageFallback.d.ts +13 -0
- package/dist/types/framework/components/CustomPageLoader.d.ts +10 -0
- package/dist/types/framework/components/DocumentHead.d.ts +5 -0
- package/dist/types/framework/components/RouteErrorBoundary.d.ts +16 -0
- package/dist/types/framework/components/SessionSecurityDialog.d.ts +10 -0
- package/dist/types/framework/components/SessionSecurityProvider.d.ts +8 -0
- package/dist/types/framework/components/SmartLink.d.ts +13 -0
- package/dist/types/framework/components/layout/AppSidebar.d.ts +36 -0
- package/dist/types/framework/components/layout/Breadcrumbs.d.ts +2 -0
- package/dist/types/framework/components/layout/CommandPalette.d.ts +2 -0
- package/dist/types/framework/components/layout/Layout.d.ts +2 -0
- package/dist/types/framework/components/layout/Navbar.d.ts +9 -0
- package/dist/types/framework/components/layout/NavbarIcon.d.ts +12 -0
- package/dist/types/framework/components/layout/Topbar.d.ts +50 -0
- package/dist/types/framework/components/layout/UserProfileDrawer.d.ts +7 -0
- package/dist/types/framework/components/layout/profile/PasswordCard.d.ts +18 -0
- package/dist/types/framework/components/layout/profile/PersonalInfoCard.d.ts +12 -0
- package/dist/types/framework/components/layout/profile/ProfileRail.d.ts +23 -0
- package/dist/types/framework/components/layout/profile/SessionsCard.d.ts +8 -0
- package/dist/types/framework/components/layout/profile/TokensCard.d.ts +11 -0
- package/dist/types/framework/components/layout/profile/TwoFactorCard.d.ts +7 -0
- package/dist/types/framework/config/defaultLayoutConfig.d.ts +34 -0
- package/dist/types/framework/constants/routes.d.ts +5 -0
- package/dist/types/framework/contexts/AppContext.d.ts +57 -0
- package/dist/types/framework/contexts/AuthConfigContext.d.ts +22 -0
- package/dist/types/framework/hooks/useProfileData.d.ts +73 -0
- package/dist/types/framework/hooks/useRoutes.d.ts +10 -0
- package/dist/types/framework/hooks/useSessionSecurity.d.ts +17 -0
- package/dist/types/framework/hooks/useSmartNavigation.d.ts +15 -0
- package/dist/types/framework/index.d.ts +35 -0
- package/dist/types/framework/pages/ConfigurePage.d.ts +2 -0
- package/dist/types/framework/pages/CrudPage.d.ts +6 -0
- package/dist/types/framework/pages/LoginPage.d.ts +5 -0
- package/dist/types/framework/pages/LogoutPage.d.ts +2 -0
- package/dist/types/framework/pages/NotFoundPage.d.ts +6 -0
- package/dist/types/framework/pages/TrainingPage.d.ts +6 -0
- package/dist/types/framework/routing/PageTypeRegistry.d.ts +43 -0
- package/dist/types/framework/routing/PageTypeRouter.d.ts +12 -0
- package/dist/types/framework/routing/dynamicPageRegistry.d.ts +41 -0
- package/dist/types/framework/routing/getRenderComponent.d.ts +6 -0
- package/dist/types/framework/types/layout.types.d.ts +107 -0
- package/dist/types/framework/utils/apiConfig.d.ts +41 -0
- package/dist/types/framework/utils/apiInterceptor.d.ts +12 -0
- package/dist/types/framework/utils/apiUrlUtils.d.ts +9 -0
- package/dist/types/framework/utils/authThemeUtils.d.ts +64 -0
- package/dist/types/framework/utils/colorUtils.d.ts +53 -0
- package/dist/types/framework/utils/cookieUtils.d.ts +20 -0
- package/dist/types/framework/utils/csrf.d.ts +27 -0
- package/dist/types/framework/utils/logoCache.d.ts +21 -0
- package/dist/types/framework/utils/logoutUtils.d.ts +15 -0
- package/dist/types/framework/utils/redirectUtils.d.ts +48 -0
- package/dist/types/framework/utils/safeRedirect.d.ts +21 -0
- package/dist/types/framework/utils/storageKeys.d.ts +44 -0
- package/dist/types/framework/utils/storageSanitizer.d.ts +20 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/queries/index.d.ts +4 -0
- package/dist/types/hooks/queries/useAppInitQuery.d.ts +1 -0
- package/dist/types/hooks/queries/useAuthConfigQuery.d.ts +1 -0
- package/dist/types/hooks/queries/useProfileQuery.d.ts +8 -0
- package/dist/types/hooks/useBreakpoint.d.ts +2 -0
- package/dist/types/hooks/useMobile.d.ts +1 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/index.framework.d.ts +39 -0
- package/dist/types/index.zango.d.ts +12 -0
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/schemas/appInit.schema.d.ts +61 -0
- package/dist/types/schemas/index.d.ts +10 -0
- package/dist/types/schemas/profile.schema.d.ts +18 -0
- package/dist/types/schemas/route.schema.d.ts +9 -0
- package/dist/types/schemas/session.schema.d.ts +8 -0
- package/dist/types/schemas/theme.schema.d.ts +27 -0
- package/dist/types/services/api/index.d.ts +2 -0
- package/dist/types/services/api.d.ts +109 -0
- package/dist/types/services/index.d.ts +7 -0
- package/dist/types/services/legacyAdapter.d.ts +10 -0
- package/dist/types/services/logger.d.ts +32 -0
- package/dist/types/services/normalizeResponse.d.ts +29 -0
- package/dist/types/types/auth.d.ts +103 -0
- package/dist/types/types/common.d.ts +343 -0
- package/dist/types/types/index.d.ts +278 -0
- package/dist/zango-appbuilder.js +99 -0
- package/dist/zango-appbuilder.js.map +1 -0
- package/dist/zango-appbuilder.umd.cjs +247 -0
- package/dist/zango-appbuilder.umd.cjs.map +1 -0
- package/package.json +140 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(`@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";@layer components;@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-600:oklch(57.7% .245 27.325);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-700:oklch(55.4% .135 66.442);--color-green-500:oklch(72.3% .219 149.579);--color-blue-500:oklch(62.3% .214 259.815);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-6xl:3.75rem;--text-6xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-tight:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--shadow-sm:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--shadow-md:0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:#fff}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.-top-2{top:calc(var(--spacing) * -2)}.top-0{top:0}.top-1\\.5{top:calc(var(--spacing) * 1.5)}.top-1\\/2{top:50%}.top-3\\.5{top:calc(var(--spacing) * 3.5)}.top-4{top:calc(var(--spacing) * 4)}.top-\\[50\\%\\]{top:50%}.-right-2{right:calc(var(--spacing) * -2)}.right-0{right:0}.right-1{right:var(--spacing)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:0}.left-0{left:0}.left-1\\/2,.left-\\[50\\%\\]{left:50%}.isolate{isolation:isolate}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[1\\]{z-index:1}.z-\\[10001\\]{z-index:10001}.z-\\[10002\\]{z-index:10002}.order-1{order:1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3\\.5{margin-inline:calc(var(--spacing) * 3.5)}.mx-6{margin-inline:calc(var(--spacing) * 6)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-3{margin-block:calc(var(--spacing) * 3)}.my-4{margin-block:calc(var(--spacing) * 4)}.my-8{margin-block:calc(var(--spacing) * 8)}.-mt-4{margin-top:calc(var(--spacing) * -4)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-auto{margin-top:auto}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-3{margin-right:calc(var(--spacing) * 3)}.\\!mb-0{margin-bottom:0!important}.\\!mb-2{margin-bottom:calc(var(--spacing) * 2)!important}.\\!mb-3{margin-bottom:calc(var(--spacing) * 3)!important}.\\!mb-6{margin-bottom:calc(var(--spacing) * 6)!important}.mb-0{margin-bottom:0}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-7{margin-bottom:calc(var(--spacing) * 7)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.mb-\\[18px\\]{margin-bottom:18px}.mb-\\[22px\\]{margin-bottom:22px}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.\\!line-clamp-2{-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;display:-webkit-box!important;overflow:hidden!important}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-square{aspect-ratio:1}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.\\!h-\\[clamp\\(40px\\,11vw\\,56px\\)\\]{height:clamp(40px,11vw,56px)!important}.h-3\\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-32{height:calc(var(--spacing) * 32)}.h-\\[42px\\]{height:42px}.h-\\[50px\\]{height:50px}.h-\\[320px\\]{height:320px}.h-auto{height:auto}.h-dvh{height:100dvh}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-16{max-height:calc(var(--spacing) * 16)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\\[300px\\]{max-height:300px}.min-h-0{min-height:0}.min-h-\\[8rem\\]{min-height:8rem}.min-h-\\[50vh\\]{min-height:50vh}.min-h-\\[60vh\\]{min-height:60vh}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[400px\\]{min-height:400px}.min-h-dvh{min-height:100dvh}.min-h-loading-min-h{min-height:300px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.\\!w-\\[clamp\\(40px\\,11vw\\,56px\\)\\]{width:clamp(40px,11vw,56px)!important}.w-\\(--sidebar-width\\){width:var(--sidebar-width)}.w-3\\.5{width:calc(var(--spacing) * 3.5)}.w-3\\/4{width:75%}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-8{width:calc(var(--spacing) * 8)}.w-12{width:calc(var(--spacing) * 12)}.w-\\[50px\\]{width:50px}.w-\\[90\\%\\]{width:90%}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-screen\\!{width:100vw!important}.max-w-\\(--skeleton-width\\){max-width:var(--skeleton-width)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-16{max-width:calc(var(--spacing) * 16)}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[420px\\]{max-width:420px}.max-w-\\[500px\\]{max-width:500px}.max-w-lg{max-width:var(--container-lg)}.max-w-logo-max-w{max-width:150px}.max-w-md{max-width:var(--container-md)}.max-w-none\\!{max-width:none!important}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[180px\\]{min-width:180px}.flex-1{flex:1}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.origin-\\(--radix-tooltip-content-transform-origin\\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-px{--tw-translate-x:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\[-50\\%\\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\[calc\\(-50\\%_-_2px\\)\\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-\\[18px\\]{gap:18px}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.rounded-\\[14px\\]{border-radius:14px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-\\[3px\\]{border-style:var(--tw-border-style);border-width:3px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-border{border-color:var(--color-gray-200,#e5e7eb)}.border-destructive\\/20{border-color:var(--color-error-500,#f04438)}@supports (color:color-mix(in lab,red,red)){.border-destructive\\/20{border-color:color-mix(in oklab,var(--color-error-500,#f04438) 20%,transparent)}}.border-destructive\\/30{border-color:var(--color-error-500,#f04438)}@supports (color:color-mix(in lab,red,red)){.border-destructive\\/30{border-color:color-mix(in oklab,var(--color-error-500,#f04438) 30%,transparent)}}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-900{border-color:var(--color-gray-900)}.border-input{border-color:var(--color-gray-200,#e5e7eb)}.border-sidebar-border{border-color:var(--sidebar-border)}.border-yellow-300{border-color:var(--color-yellow-300)}.bg-\\[var\\(--color-background\\,\\#ffffff\\)\\]{background-color:var(--color-background,#fff)}.bg-accent{background-color:var(--color-brand-50,#eae8ff)}.bg-background{background-color:#fff}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-black\\/75{background-color:#000000bf}@supports (color:color-mix(in lab,red,red)){.bg-black\\/75{background-color:color-mix(in oklab,var(--color-black) 75%,transparent)}}.bg-border{background-color:var(--color-gray-200,#e5e7eb)}.bg-destructive,.bg-destructive\\/5{background-color:var(--color-error-500,#f04438)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\\/5{background-color:color-mix(in oklab,var(--color-error-500,#f04438) 5%,transparent)}}.bg-destructive\\/10{background-color:var(--color-error-500,#f04438)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\\/10{background-color:color-mix(in oklab,var(--color-error-500,#f04438) 10%,transparent)}}.bg-foreground{background-color:var(--color-gray-900,#111827)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-muted{background-color:var(--color-gray-100,#f3f4f6)}.bg-muted\\/50{background-color:#f3f4f680}@supports (color:color-mix(in lab,red,red)){.bg-muted\\/50{background-color:color-mix(in oklab,var(--color-gray-100,#f3f4f6) 50%,transparent)}}.bg-primary{background-color:var(--color-brand-500,#5048ed)}.bg-secondary{background-color:var(--color-gray-100,#f3f4f6)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-50{background-color:var(--color-yellow-50)}.fill-foreground{fill:var(--color-gray-900,#111827)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.\\[padding\\:calc\\(env\\(safe-area-inset-top\\)\\+56px\\)_28px_max\\(env\\(safe-area-inset-bottom\\)\\,24px\\)\\]{padding:calc(env(safe-area-inset-top) + 56px) 28px max(env(safe-area-inset-bottom),24px)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-10{padding:calc(var(--spacing) * 10)}.p-12{padding:calc(var(--spacing) * 12)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.\\[padding-top\\:env\\(safe-area-inset-top\\)\\]{padding-top:env(safe-area-inset-top)}.pt-4{padding-top:calc(var(--spacing) * 4)}.\\[padding-bottom\\:env\\(safe-area-inset-bottom\\)\\]{padding-bottom:env(safe-area-inset-bottom)}.pb-1{padding-bottom:var(--spacing)}.pb-3\\.5{padding-bottom:calc(var(--spacing) * 3.5)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.\\!text-center{text-align:center!important}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.\\!text-2xl{font-size:var(--text-2xl)!important;line-height:var(--tw-leading,var(--text-2xl--line-height))!important}.\\!text-sm{font-size:var(--text-sm)!important;line-height:var(--tw-leading,var(--text-sm--line-height))!important}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-7xl{font-size:var(--text-7xl);line-height:var(--tw-leading,var(--text-7xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[13px\\]{font-size:13px}.text-\\[32px\\]{font-size:32px}.text-\\[40px\\]{font-size:40px}.text-\\[clamp\\(16px\\,4vw\\,20px\\)\\]{font-size:clamp(16px,4vw,20px)}.\\!leading-relaxed{--tw-leading:var(--leading-relaxed)!important;line-height:var(--leading-relaxed)!important}.\\!leading-tight{--tw-leading:var(--leading-tight)!important;line-height:var(--leading-tight)!important}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\\!font-semibold{--tw-font-weight:var(--font-weight-semibold)!important;font-weight:var(--font-weight-semibold)!important}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-balance{text-wrap:balance}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.\\!text-gray-800{color:var(--color-gray-800)!important}.\\!text-gray-900{color:var(--color-gray-900)!important}.text-background{color:#fff}.text-blue-500{color:var(--color-blue-500)}.text-destructive,.text-destructive\\/70{color:var(--color-error-500,#f04438)}@supports (color:color-mix(in lab,red,red)){.text-destructive\\/70{color:color-mix(in oklab,var(--color-error-500,#f04438) 70%,transparent)}}.text-foreground{color:var(--color-gray-900,#111827)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-500{color:var(--color-green-500)}.text-muted-foreground{color:var(--color-gray-500,#6b7280)}.text-muted-foreground\\/30{color:#6a72824d}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\\/30{color:color-mix(in oklab,var(--color-gray-500,#6b7280) 30%,transparent)}}.text-muted-foreground\\/40{color:#6a728266}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\\/40{color:color-mix(in oklab,var(--color-gray-500,#6b7280) 40%,transparent)}}.text-muted-foreground\\/60{color:#6a728299}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\\/60{color:color-mix(in oklab,var(--color-gray-500,#6b7280) 60%,transparent)}}.text-primary{color:var(--color-brand-500,#5048ed)}.text-primary-foreground{color:#fff}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--color-gray-900,#111827)}.text-sidebar-foreground,.text-sidebar-foreground\\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\\/70{color:color-mix(in oklab,var(--sidebar-foreground) 70%,transparent)}}.text-white{color:var(--color-white)}.text-white\\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\\/70{color:color-mix(in oklab,var(--color-white) 70%,transparent)}}.text-yellow-700{color:var(--color-yellow-700)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_0_1px_hsl\\(var\\(--sidebar-border\\)\\)\\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-border)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.ring-offset-background{--tw-ring-offset-color:#fff}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[left\\,right\\,width\\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[margin\\,opacity\\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\,height\\,padding\\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.fade-in{--tw-enter-opacity:0}.running{animation-play-state:running}.slide-in-from-top-1{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.group-focus-within\\/menu-item\\:opacity-100:is(:where(.group\\/menu-item):focus-within *){opacity:1}@media(hover:hover){.group-hover\\/menu-item\\:opacity-100:is(:where(.group\\/menu-item):hover *){opacity:1}}.group-has-data-\\[sidebar\\=menu-action\\]\\/menu-item\\:pr-8:is(:where(.group\\/menu-item):has([data-sidebar=menu-action]) *){padding-right:calc(var(--spacing) * 8)}.group-data-\\[collapsible\\=icon\\]\\:-mt-8:is(:where(.group)[data-collapsible=icon] *){margin-top:calc(var(--spacing) * -8)}.group-data-\\[collapsible\\=icon\\]\\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\\[collapsible\\=icon\\]\\:size-8\\!:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--spacing) * 8)!important;height:calc(var(--spacing) * 8)!important}.group-data-\\[collapsible\\=icon\\]\\:w-\\(--sidebar-width-icon\\):is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\\[collapsible\\=icon\\]\\:w-\\[calc\\(var\\(--sidebar-width-icon\\)\\+\\(--spacing\\(4\\)\\)\\)\\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing) * 4)))}.group-data-\\[collapsible\\=icon\\]\\:w-\\[calc\\(var\\(--sidebar-width-icon\\)\\+\\(--spacing\\(4\\)\\)\\+2px\\)\\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + (calc(var(--spacing) * 4)) + 2px)}.group-data-\\[collapsible\\=icon\\]\\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.group-data-\\[collapsible\\=icon\\]\\:p-0\\!:is(:where(.group)[data-collapsible=icon] *){padding:0!important}.group-data-\\[collapsible\\=icon\\]\\:p-2\\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing) * 2)!important}.group-data-\\[collapsible\\=icon\\]\\:opacity-0:is(:where(.group)[data-collapsible=icon] *){opacity:0}.group-data-\\[collapsible\\=offcanvas\\]\\:right-\\[calc\\(var\\(--sidebar-width\\)\\*-1\\)\\]:is(:where(.group)[data-collapsible=offcanvas] *){right:calc(var(--sidebar-width) * -1)}.group-data-\\[collapsible\\=offcanvas\\]\\:left-\\[calc\\(var\\(--sidebar-width\\)\\*-1\\)\\]:is(:where(.group)[data-collapsible=offcanvas] *){left:calc(var(--sidebar-width) * -1)}.group-data-\\[collapsible\\=offcanvas\\]\\:w-0:is(:where(.group)[data-collapsible=offcanvas] *){width:0}.group-data-\\[collapsible\\=offcanvas\\]\\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-data-\\[side\\=left\\]\\:-right-4:is(:where(.group)[data-side=left] *){right:calc(var(--spacing) * -4)}.group-data-\\[side\\=left\\]\\:border-r:is(:where(.group)[data-side=left] *){border-right-style:var(--tw-border-style);border-right-width:1px}.group-data-\\[side\\=right\\]\\:left-0:is(:where(.group)[data-side=right] *){left:0}.group-data-\\[side\\=right\\]\\:rotate-180:is(:where(.group)[data-side=right] *){rotate:180deg}.group-data-\\[side\\=right\\]\\:border-l:is(:where(.group)[data-side=right] *){border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-\\[variant\\=floating\\]\\:rounded-lg:is(:where(.group)[data-variant=floating] *){border-radius:var(--radius-lg)}.group-data-\\[variant\\=floating\\]\\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\\[variant\\=floating\\]\\:border-sidebar-border:is(:where(.group)[data-variant=floating] *){border-color:var(--sidebar-border)}.group-data-\\[variant\\=floating\\]\\:shadow-sm:is(:where(.group)[data-variant=floating] *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.peer-hover\\/menu-button\\:text-sidebar-accent-foreground:is(:where(.peer\\/menu-button):hover~*){color:var(--sidebar-accent-foreground)}}.peer-data-\\[active\\=true\\]\\/menu-button\\:text-sidebar-accent-foreground:is(:where(.peer\\/menu-button)[data-active=true]~*){color:var(--sidebar-accent-foreground)}.peer-data-\\[size\\=default\\]\\/menu-button\\:top-1\\.5:is(:where(.peer\\/menu-button)[data-size=default]~*){top:calc(var(--spacing) * 1.5)}.peer-data-\\[size\\=lg\\]\\/menu-button\\:top-2\\.5:is(:where(.peer\\/menu-button)[data-size=lg]~*){top:calc(var(--spacing) * 2.5)}.peer-data-\\[size\\=sm\\]\\/menu-button\\:top-1:is(:where(.peer\\/menu-button)[data-size=sm]~*){top:var(--spacing)}.selection\\:bg-primary ::selection{background-color:var(--color-brand-500,#5048ed)}.selection\\:bg-primary::selection{background-color:var(--color-brand-500,#5048ed)}.selection\\:text-primary-foreground ::selection{color:#fff}.selection\\:text-primary-foreground::selection{color:#fff}.file\\:inline-flex::file-selector-button{display:inline-flex}.file\\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\\:bg-transparent::file-selector-button{background-color:#0000}.file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\\:text-foreground::file-selector-button{color:var(--color-gray-900,#111827)}.placeholder\\:text-muted-foreground::placeholder{color:var(--color-gray-500,#6b7280)}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing) * -2)}.after\\:inset-y-0:after{content:var(--tw-content);inset-block:0}.after\\:left-1\\/2:after{content:var(--tw-content);left:50%}.after\\:w-\\[2px\\]:after{content:var(--tw-content);width:2px}.group-data-\\[collapsible\\=offcanvas\\]\\:after\\:left-full:is(:where(.group)[data-collapsible=offcanvas] *):after{content:var(--tw-content);left:100%}.last\\:mb-0:last-child{margin-bottom:0}@media(hover:hover){.hover\\:-translate-y-1:hover{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}.hover\\:bg-accent:hover{background-color:var(--color-brand-50,#eae8ff)}.hover\\:bg-destructive\\/90:hover{background-color:var(--color-error-500,#f04438)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--color-error-500,#f04438) 90%,transparent)}}.hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\\:bg-primary\\/90:hover{background-color:var(--color-brand-500,#5048ed)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--color-brand-500,#5048ed) 90%,transparent)}}.hover\\:bg-secondary\\/80:hover{background-color:#f3f4f6cc}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--color-gray-100,#f3f4f6) 80%,transparent)}}.hover\\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\\:text-accent-foreground:hover{color:var(--color-brand-500,#5048ed)}.hover\\:text-foreground:hover{color:var(--color-gray-900,#111827)}.hover\\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-\\[0_0_0_1px_hsl\\(var\\(--sidebar-accent\\)\\)\\]:hover{--tw-shadow:0 0 0 1px var(--tw-shadow-color,hsl(var(--sidebar-accent)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\\:group-data-\\[collapsible\\=offcanvas\\]\\:bg-sidebar:hover:is(:where(.group)[data-collapsible=offcanvas] *){background-color:var(--sidebar)}.hover\\:after\\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\\:bg-accent:focus{background-color:var(--color-brand-50,#eae8ff)}.focus\\:text-accent-foreground:focus{color:var(--color-brand-500,#5048ed)}.focus\\:shadow-\\[0_0_0_2px_rgba\\(106\\,138\\,18\\,0\\.2\\)\\]:focus{--tw-shadow:0 0 0 2px var(--tw-shadow-color,#6a8a1233);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-ring:focus{--tw-ring-color:var(--color-brand-500,#5048ed)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-ring:focus-visible{border-color:var(--color-brand-500,#5048ed)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--color-error-500,#f04438)}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-error-500,#f04438) 20%, transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--color-brand-500,#5048ed)}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-brand-500,#5048ed) 50%, transparent)}}.active\\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-gray-100:disabled{background-color:var(--color-gray-100)}.disabled\\:opacity-50:disabled{opacity:.5}:where([data-side=left]) .in-data-\\[side\\=left\\]\\:cursor-w-resize{cursor:w-resize}:where([data-side=right]) .in-data-\\[side\\=right\\]\\:cursor-e-resize{cursor:e-resize}.has-data-\\[variant\\=inset\\]\\:bg-sidebar:has([data-variant=inset]){background-color:var(--sidebar)}.has-\\[\\>svg\\]\\:px-1\\.5:has(>svg){padding-inline:calc(var(--spacing) * 1.5)}.has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-disabled\\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--color-error-500,#f04438)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--color-error-500,#f04438)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-error-500,#f04438) 20%, transparent)}}.data-\\[active\\=true\\]\\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\\[active\\=true\\]\\:font-medium[data-active=true]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\\[active\\=true\\]\\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[orientation\\=horizontal\\]\\:h-px[data-orientation=horizontal]{height:1px}.data-\\[orientation\\=horizontal\\]\\:w-full[data-orientation=horizontal]{width:100%}.data-\\[orientation\\=vertical\\]\\:h-full[data-orientation=vertical]{height:100%}.data-\\[orientation\\=vertical\\]\\:w-px[data-orientation=vertical]{width:1px}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\\[state\\=closed\\]\\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=closed\\]\\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.data-\\[state\\=closed\\]\\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x:-100%}.data-\\[state\\=closed\\]\\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x:100%}.data-\\[state\\=closed\\]\\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:var(--color-brand-50,#eae8ff)}.data-\\[state\\=open\\]\\:bg-secondary[data-state=open]{background-color:var(--color-gray-100,#f3f4f6)}.data-\\[state\\=open\\]\\:opacity-100[data-state=open]{opacity:1}.data-\\[state\\=open\\]\\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[state\\=open\\]\\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.data-\\[state\\=open\\]\\:slide-in-from-left[data-state=open]{--tw-enter-translate-x:-100%}.data-\\[state\\=open\\]\\:slide-in-from-right[data-state=open]{--tw-enter-translate-x:100%}.data-\\[state\\=open\\]\\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}@media(hover:hover){.data-\\[state\\=open\\]\\:hover\\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}.data-\\[state\\=open\\]\\:hover\\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}@media not all and (min-width:64rem){.max-lg\\:inset-0{inset:0}.max-lg\\:top-0{top:0}.max-lg\\:left-0{left:0}.max-lg\\:h-dvh{height:100dvh}.max-lg\\:max-h-dvh{max-height:100dvh}.max-lg\\:w-screen{width:100vw}.max-lg\\:max-w-full{max-width:100%}.max-lg\\:max-w-screen{max-width:100vw}.max-lg\\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.max-lg\\:translate-y-0{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.max-lg\\:rounded-none{border-radius:0}.max-lg\\:p-6{padding:calc(var(--spacing) * 6)}.max-lg\\:shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@media not all and (min-width:40rem){.max-sm\\:mb-6{margin-bottom:calc(var(--spacing) * 6)}.max-sm\\:min-h-\\[44px\\]{min-height:44px}.max-sm\\:w-full{width:100%}.max-sm\\:flex-col{flex-direction:column}.max-sm\\:p-7{padding:calc(var(--spacing) * 7)}.max-sm\\:px-5{padding-inline:calc(var(--spacing) * 5)}.max-sm\\:text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.max-sm\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.max-sm\\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}}@media(min-width:40rem){.sm\\:flex{display:flex}.sm\\:hidden{display:none}.sm\\:max-w-none\\!{max-width:none!important}.sm\\:max-w-sm{max-width:var(--container-sm)}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:p-12{padding:calc(var(--spacing) * 12)}}@media(min-width:48rem){.md\\:block{display:block}.md\\:flex{display:flex}.md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\\:opacity-0{opacity:0}.md\\:peer-data-\\[variant\\=inset\\]\\:m-2:is(:where(.peer)[data-variant=inset]~*){margin:calc(var(--spacing) * 2)}.md\\:peer-data-\\[variant\\=inset\\]\\:ml-0:is(:where(.peer)[data-variant=inset]~*){margin-left:0}.md\\:peer-data-\\[variant\\=inset\\]\\:rounded-xl:is(:where(.peer)[data-variant=inset]~*){border-radius:var(--radius-xl)}.md\\:peer-data-\\[variant\\=inset\\]\\:shadow-sm:is(:where(.peer)[data-variant=inset]~*){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.md\\:peer-data-\\[variant\\=inset\\]\\:peer-data-\\[state\\=collapsed\\]\\:ml-2:is(:where(.peer)[data-variant=inset]~*):is(:where(.peer)[data-state=collapsed]~*){margin-left:calc(var(--spacing) * 2)}.md\\:after\\:hidden:after{content:var(--tw-content);display:none}}@media(min-width:64rem){.lg\\:h-10{height:calc(var(--spacing) * 10)}.lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.dark\\:border-input:is(.dark *){border-color:var(--color-gray-200,#e5e7eb)}.dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--color-error-500,#f04438)}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab,var(--color-error-500,#f04438) 60%,transparent)}}.dark\\:bg-input\\/30:is(.dark *){background-color:#e5e7eb4d}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--color-gray-200,#e5e7eb) 30%,transparent)}}@media(hover:hover){.dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--color-brand-50,#eae8ff)}@supports (color:color-mix(in lab,red,red)){.dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-brand-50,#eae8ff) 50%,transparent)}}.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:#e5e7eb80}@supports (color:color-mix(in lab,red,red)){.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-gray-200,#e5e7eb) 50%,transparent)}}}.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--color-error-500,#f04438)}@supports (color:color-mix(in lab,red,red)){.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-error-500,#f04438) 40%, transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--color-error-500,#f04438)}@supports (color:color-mix(in lab,red,red)){.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--color-error-500,#f04438) 40%, transparent)}}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:size-4 svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\[\\&\\>button\\:last-child\\]\\:p-2>button:last-child{padding:calc(var(--spacing) * 2)}.\\[\\&\\>button\\:last-child\\]\\:opacity-100>button:last-child{opacity:1}.\\[\\&\\>button\\:last-child_svg\\]\\:size-7>button:last-child svg{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.\\[\\&\\>span\\:last-child\\]\\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\\[\\&\\>svg\\]\\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\[\\&\\>svg\\]\\:shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:text-sidebar-accent-foreground>svg{color:var(--sidebar-accent-foreground)}[data-side=left][data-collapsible=offcanvas] .\\[\\[data-side\\=left\\]\\[data-collapsible\\=offcanvas\\]_\\&\\]\\:-right-2{right:calc(var(--spacing) * -2)}[data-side=left][data-state=collapsed] .\\[\\[data-side\\=left\\]\\[data-state\\=collapsed\\]_\\&\\]\\:cursor-e-resize{cursor:e-resize}[data-side=right][data-collapsible=offcanvas] .\\[\\[data-side\\=right\\]\\[data-collapsible\\=offcanvas\\]_\\&\\]\\:-left-2{left:calc(var(--spacing) * -2)}[data-side=right][data-state=collapsed] .\\[\\[data-side\\=right\\]\\[data-state\\=collapsed\\]_\\&\\]\\:cursor-w-resize{cursor:w-resize}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}[data-slot=button]{background-color:revert-layer}html,body{overflow-x:hidden}@media(max-width:1023px){input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea{font-size:16px}}*{box-sizing:border-box;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}a{text-decoration:none}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}#root{height:100dvh}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}:root{--radius:.5rem;--sidebar:#fff;--sidebar-foreground:#414651;--sidebar-primary:var(--color-brand-500,#5048ed);--sidebar-primary-foreground:#fff;--sidebar-accent:var(--color-brand-50,#eae8ff);--sidebar-accent-foreground:var(--color-brand-500,#5048ed);--sidebar-border:#d5d7da;--sidebar-ring:var(--color-brand-500,#5048ed)}.dark{--sidebar:#18181b;--sidebar-foreground:#f4f4f5;--sidebar-primary:#1d4ed8;--sidebar-primary-foreground:#fff;--sidebar-accent:#27272a;--sidebar-accent-foreground:#f4f4f5;--sidebar-border:#27272a;--sidebar-ring:#3b82f6}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}.auth-mobile-shell__content h1{font-weight:600!important;font-size:30px!important;line-height:1.15!important;letter-spacing:-.02em!important;margin-bottom:8px!important}.auth-mobile-shell__content h1 em,.auth-mobile-shell__content h1 .accent{font-style:normal;color:var(--color-brand-500, #5048ED);font-weight:600}.auth-mobile-shell__content p{color:#6e6e89}.auth-mobile-shell .form input:not([type=checkbox]):not([type=radio]),.auth-mobile-shell .form-item input:not([type=checkbox]):not([type=radio]){height:48px!important;border-radius:12px!important;font-size:16px!important}.auth-mobile-shell .form button[type=submit],.auth-mobile-shell .auth-mobile-cta-anchor button,.auth-mobile-shell .form-item:has(button[type=submit]) button[type=submit],.auth-mobile-shell__content button.w-full{height:48px!important;border-radius:12px!important;font-size:15px!important;font-weight:600!important}.auth-mobile-shell .form button[type=submit]:disabled,.auth-mobile-shell .auth-mobile-cta-anchor button:disabled{background:var(--color-gray-200, #E9EAEB)!important;color:var(--color-gray-500, #717680)!important;border-color:var(--color-gray-200, #E9EAEB)!important;cursor:not-allowed;opacity:1!important}.auth-mobile-shell .form>.form-item:last-child:has(button[type=submit]),.auth-mobile-shell .auth-mobile-cta-anchor{position:fixed;left:0;right:0;bottom:0;margin:0!important;padding:16px 28px max(env(safe-area-inset-bottom),16px);background:#fff;border-top:1px solid #ECECF1;box-shadow:0 -8px 24px -12px #14123c14;z-index:5}.auth-mobile-shell .form>.form-item:last-child:has(button[type=submit])>*,.auth-mobile-shell .auth-mobile-cta-anchor>*{max-width:420px;margin:0 auto;width:100%}.auth-mobile-shell[data-has-cta=true] .auth-mobile-shell__content{padding-bottom:calc(96px + max(env(safe-area-inset-bottom),0px))}.auth-mobile-shell:has(.role-select-mobile){height:100dvh;min-height:100dvh;padding-bottom:0}.auth-mobile-shell:has(.role-select-mobile) .auth-mobile-shell__content{display:flex;flex-direction:column;min-height:0}.auth-mobile-shell:has(.role-select-mobile) .auth-mobile-shell__content>*{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;width:100%}.auth-mobile-shell__content .role-select-mobile h1{margin:0 0 8px!important;font-weight:600!important;font-size:30px!important;line-height:1.15!important;letter-spacing:-.02em!important;color:#1a1a2e}.role-select-mobile h1 em.accent{font-style:normal;color:var(--color-brand-500, #5048ED);font-weight:600}.role-select-mobile p{color:#6e6e89}.role-select-mobile__list{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:10px;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:4px 4px 96px;margin:0 -4px;scrollbar-width:none;-ms-overflow-style:none}.role-select-mobile__list::-webkit-scrollbar{width:0;height:0;display:none}.role-select-mobile__row{display:flex;align-items:center;gap:14px;width:100%;padding:14px;background:#fff;border:1.5px solid #ECECF1;border-radius:14px;cursor:pointer;transition:border-color .18s ease,background-color .18s ease,transform .12s ease;text-align:left;font-family:inherit;appearance:none;-webkit-appearance:none}.role-select-mobile__row:focus-visible{outline:2px solid var(--color-brand-500, #5048ED);outline-offset:2px}.role-select-mobile__row:not(.role-select-mobile__row--selected):hover{border-color:#5048ed59}.role-select-mobile__row:active{transform:scale(.99)}.role-select-mobile__row--selected{border-color:var(--color-brand-500, #5048ED);background:#fff}.role-select-mobile__row-icon{flex:0 0 auto;width:40px;height:40px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:#5048ed14;color:var(--color-brand-500, #5048ED);transition:background-color .18s ease,color .18s ease}.role-select-mobile__row--selected .role-select-mobile__row-icon{background:var(--color-brand-500, #5048ED);color:#fff}.role-select-mobile__row-body{flex:1 1 auto;display:flex;flex-direction:column;gap:4px;min-width:0}.role-select-mobile__row-name{font-size:15px;font-weight:600;color:#1a1a2e;letter-spacing:-.01em;line-height:1.3;word-break:break-word}.role-select-mobile__row-recommended{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-brand-500, #5048ED)}.role-select-mobile__row-check{flex:0 0 auto;width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--color-brand-500, #5048ED);color:#fff}.role-select-mobile__cta{position:fixed;left:0;right:0;bottom:0;padding:16px 28px max(env(safe-area-inset-bottom),16px);background:#fff;border-top:1px solid #ECECF1;box-shadow:0 -8px 24px -12px #14123c14;z-index:5}.role-select-mobile__cta-inner{max-width:420px;margin:0 auto}.role-select-mobile__cta-button{width:100%;height:48px;border:none;border-radius:12px;background:var(--color-brand-500, #5048ED);color:#fff;font-size:15px;font-weight:600;letter-spacing:-.005em;cursor:pointer;transition:background-color .18s ease,transform .12s ease;display:flex;align-items:center;justify-content:center;gap:8px;font-family:inherit}.role-select-mobile__cta-button:disabled{background:var(--color-gray-200, #E9EAEB);color:var(--color-gray-500, #717680);cursor:not-allowed}.role-select-mobile__cta-button:not(:disabled):active{transform:translateY(1px)}.role-select-mobile__cta-hint{text-align:center;margin:8px 0 0;font-size:12px;color:#6e6e89}[data-slot=sidebar] [data-sidebar=sidebar],[data-slot=sidebar]:not([data-state]){border-right:1px solid var(--sidebar-border, #D5D7DA)}[data-slot=sidebar]:not([data-collapsible=icon]) .frame-logo-container{height:64px;display:flex;align-items:center;gap:8px;padding:20px}[data-slot=sidebar][data-collapsible=icon] .frame-logo-container{display:flex;align-items:center;justify-content:center;padding:8px 0;height:auto}.frame-logo-container a{display:flex;align-items:center;text-decoration:none}.frame-logo-container img{height:28px;width:auto}[data-slot=sidebar-header]{padding:0;gap:0}[data-sidebar=content]{padding:0}[data-slot=sidebar]:not([data-collapsible=icon]) [data-slot=sidebar-group]{padding:8px 12px}[data-slot=sidebar][data-collapsible=icon] [data-sidebar=menu]{align-items:center}[data-sidebar=menu]{gap:4px}[data-slot=sidebar]:not([data-collapsible=icon]) [data-sidebar=menu-button]{padding:12px!important;border-radius:6px;gap:8px;font-size:14px;font-weight:500;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;height:auto!important;color:var(--sidebar-foreground)}[data-sidebar=menu-button][data-active=true]{font-weight:600;color:var(--sidebar-primary, var(--color-brand-500, #5048ED))!important;background-color:var(--sidebar-accent, var(--color-brand-50, #EAE8FF))!important}.group\\/collapsible:hover>[data-slot=sidebar-menu-item]>[data-sidebar=menu-button]:not([data-active=true]){background-color:var(--sidebar-accent, var(--color-brand-50, #EAE8FF));color:var(--sidebar-accent-foreground, var(--color-brand-500, #5048ED))}.navbar-icon{width:16px;height:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.navbar-icon svg{width:16px;height:16px}.navbar-icon img{width:16px;height:16px;object-fit:contain}.navbar-icon-emoji{font-size:16px;line-height:1;width:16px;text-align:center}[data-sidebar=menu-button] .navbar-icon svg [fill]:not([fill=none]):not([fill=currentColor]){fill:currentColor}[data-sidebar=menu-button] .navbar-icon svg [stroke]:not([stroke=none]):not([stroke=currentColor]){stroke:currentColor}[data-slot=sidebar]:not([data-collapsible=icon]) [data-sidebar=menu-sub]{border-left:none;margin:0;padding:4px 0;gap:0;translate:0}[data-slot=sidebar]:not([data-collapsible=icon]) [data-sidebar=menu-sub-button]{padding:10px 12px!important;font-size:12px;height:auto!important;border-radius:6px;translate:0;color:var(--color-gray-700, #414651);font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-weight:400;gap:8px}[data-slot=sidebar]:not([data-collapsible=icon]) [data-sidebar=menu-sub-button]:hover{color:var(--sidebar-primary, var(--color-brand-500, #5048ED))!important}[data-slot=sidebar]:not([data-collapsible=icon]) [data-sidebar=menu-sub-button][data-active=true]{font-weight:600;color:var(--sidebar-primary, var(--color-brand-500, #5048ED))!important;background-color:transparent!important}[data-slot=sidebar]:not([data-collapsible=icon]) [data-sidebar=menu-sub-button][data-active=true]:hover{background-color:var(--sidebar-accent, var(--color-brand-50, #EAE8FF))!important}.submenu-arrow-slot{width:16px;height:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0}@media(min-width:768px){[data-slot=sidebar][data-state]{display:block!important}[data-slot=sidebar][data-state]>[data-slot=sidebar-container]{display:flex!important}}[data-sidebar=content]::-webkit-scrollbar{width:4px}[data-sidebar=content]::-webkit-scrollbar-track{background:transparent}[data-sidebar=content]::-webkit-scrollbar-thumb{background:var(--color-gray-300, #dde2e5);border-radius:2px}[data-sidebar=content]::-webkit-scrollbar-thumb:hover{background:var(--color-gray-400, #d5d7da)}.sidebar-theme-dark [data-sidebar=content]::-webkit-scrollbar-thumb{background:#fff3}.sidebar-theme-dark [data-sidebar=content]::-webkit-scrollbar-thumb:hover{background:#ffffff4d}.sidebar-theme-dark:not([data-collapsible=icon]) [data-sidebar=menu-sub-button]{color:#ffffffb3}.sidebar-theme-dark:not([data-collapsible=icon]) [data-sidebar=menu-sub-button]:hover{color:#fff!important}.sidebar-theme-dark:not([data-collapsible=icon]) [data-sidebar=menu-sub-button][data-active=true]{color:#fff!important}.sidebar-theme-dark .submenu-arrow-slot svg path{fill:#fff}[data-slot=sidebar][data-collapsible=icon] [data-slot=sidebar-header],[data-slot=sidebar][data-collapsible=icon] [data-slot=sidebar-footer]{overflow:hidden}.sidebar-dropdown-dark{background-color:var(--color-brand-600, #4038c7);border-color:var(--color-brand-500, #5048ED);color:#ffffffe6}.sidebar-dropdown-dark [data-slot=dropdown-menu-label]{color:#fff9}.sidebar-dropdown-dark [data-slot=dropdown-menu-separator]{background-color:#ffffff26}.sidebar-dropdown-dark [data-slot=dropdown-menu-item]{color:#ffffffd9}.sidebar-dropdown-dark [data-slot=dropdown-menu-item]:hover,.sidebar-dropdown-dark [data-slot=dropdown-menu-item]:focus{background-color:#ffffff1a;color:#fff}[data-slot=sidebar][data-mobile=true] [data-slot=sidebar-footer]{padding-bottom:calc(.5rem + env(safe-area-inset-bottom))}[data-slot=sidebar-inset]{overflow:hidden}.sidebar-section-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--color-gray-300, #D1D5DB);padding:8px 12px 4px}.sidebar-section-unlabeled{padding-top:0}.sidebar-section+.sidebar-section{margin-top:0}.dropdown{position:relative}.profile-dropdown-menu-button{display:flex;gap:20px;align-items:center;cursor:pointer;padding:8px 12px;border-radius:8px;transition:background-color .2s ease}.profile-dropdown-menu-button:hover{background-color:var(--color-gray-100, #f5f5f5)}.profile-info-wrapper{display:flex;align-items:center;gap:8px}.profile-avatar{width:24px;height:24px;border-radius:50%;overflow:hidden}.profile-name{font-size:14px;font-weight:500;color:var(--color-Gray-900, #252b37)}.dropdown-arrow{transition:transform .2s cubic-bezier(.16,1,.3,1)}.dropdown-arrow.open{transform:rotate(180deg)}.profile-dropdown-menu{border-radius:8px;border:1px solid var(--color-gray-200, #E9EAEB);background:var(--color-background, #FFFFFF);box-shadow:0 12px 12px -4px #0a0d1214,0 -4px 6px -2px #0a0d120f,0 -2px 2px -2px #0a0d120d;min-width:158px;position:absolute;right:0;top:calc(100% + 10px);z-index:1000;list-style:none;margin:0;padding:0;opacity:0;visibility:hidden;transform:translateY(-8px) scale(.96);transform-origin:top right;transition:opacity .25s cubic-bezier(.16,1,.3,1),transform .25s cubic-bezier(.16,1,.3,1),visibility 0s .25s;overflow:hidden}.profile-dropdown-menu *{cursor:pointer!important}.profile-dropdown-menu.show{opacity:1;visibility:visible;transform:translateY(0) scale(1);transition:opacity .25s cubic-bezier(.16,1,.3,1),transform .25s cubic-bezier(.16,1,.3,1),visibility 0s 0s}.profile-dropdown-menu li{margin:0}.dropdown-item{display:flex;align-items:center;padding:8px 12px;color:#717680;text-decoration:none;font-size:14px;transition:all .2s ease;cursor:pointer!important;background:none;border:none;width:100%;text-align:left;gap:8px}.dropdown-item:hover{background-color:#f5f5f5;color:#252b37}.profile-dropdown-menu li:first-child .dropdown-item:hover{border-top-left-radius:8px;border-top-right-radius:8px}.profile-dropdown-menu li:last-child .dropdown-item:hover{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.dropdown-item.profile-info{padding:8px 12px;cursor:pointer}.dropdown-item.profile-info:hover{background-color:transparent;cursor:pointer}.dropdown-item.profile-info.clickable:hover{background-color:var(--color-Gray-100, #f5f5f5);cursor:pointer;border-radius:4px}.user-info-content{display:flex;align-items:center;gap:8px;cursor:pointer}.profile-role{font-weight:500;color:var(--color-Gray-900, #252b37)}.role-arrow{display:flex;align-items:center;justify-content:center;transition:transform .2s cubic-bezier(.16,1,.3,1)}.role-arrow.expanded{transform:rotate(180deg)}.profile-roles{max-height:200px;overflow-y:auto;margin:0 -16px;padding:0 16px}.profile-each-role{display:flex;align-items:center;padding:8px 12px;gap:8px;cursor:pointer;transition:all .2s ease}.profile-each-role:hover{background-color:var(--color-Gray-100, #f5f5f5)}.profile-dropdown-menu .profile-each-role:hover{border-radius:4px}.profile-each-role .label{font-size:14px;color:var(--color-Gray-700, #717680)}.profile-dropdown-divider{border:none}.profile-menu-option{display:flex;align-items:center;gap:8px;cursor:pointer}.profile-menu-name,.profile-name{font-size:12px;font-weight:500;cursor:pointer}.topbar-theme-dark.header-container{background:var(--color-brand-500, #5048ED);border-bottom:none}.topbar-theme-dark .profile-name{color:#fff}.topbar-theme-dark .profile-avatar{border:1px solid rgba(255,255,255,.3)}.topbar-theme-dark .profile-dropdown-menu-button:hover{background-color:var(--color-brand-800, rgba(255, 255, 255, .1))}.topbar-theme-dark .dropdown-arrow path{fill:#fff}.topbar-theme-dark .profile-dropdown-menu{background:var(--color-brand-500, #5048ED);border-color:var(--color-brand-800, rgba(255, 255, 255, .15))}.topbar-theme-dark .dropdown-item{color:#ffffffb3}.topbar-theme-dark .dropdown-item:hover{background-color:var(--color-brand-800, rgba(255, 255, 255, .1));color:#fff}.topbar-theme-dark .dropdown-item svg path{stroke:#ffffffb3}.topbar-theme-dark .dropdown-item:hover svg path{stroke:#fff}.topbar-theme-dark .profile-each-role{color:#ffffffb3}.topbar-theme-dark .profile-each-role:hover{background-color:var(--color-brand-800, rgba(255, 255, 255, .1));color:#fff}.topbar-theme-dark .profile-each-role .label{color:#ffffffb3}.topbar-theme-dark .profile-each-role:hover .label{color:#fff}.topbar-theme-dark .profile-dropdown-divider{border-color:var(--color-brand-800, rgba(255, 255, 255, .15))}.topbar-theme-dark .profile-role,.topbar-theme-dark .breadcrumbs a{color:#ffffffb3}.topbar-theme-dark .breadcrumbs a:hover,.topbar-theme-dark .breadcrumbs .breadcrumb-current{color:#fff}.topbar-theme-dark .breadcrumbs .breadcrumb-separator{color:#ffffff80}.topbar-mobile.header-container{padding:env(safe-area-inset-top) 12px 0;height:calc(56px + env(safe-area-inset-top));background:var(--color-brand-500, #5048ED);border-bottom-color:transparent;color:#fff}.topbar-mobile.header-container .topbar-mobile-trigger,.topbar-mobile.header-container .topbar-mobile-trigger svg{color:#fff}.topbar-mobile.header-container .topbar-mobile-logo-text{color:#fff}.topbar-mobile-content{width:100%;display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:8px}.topbar-mobile-trigger{width:44px;height:44px;display:flex;align-items:center;justify-content:center}.topbar-mobile-trigger svg{width:24px;height:24px}.topbar-mobile-logo{display:flex;align-items:center;justify-content:center;min-width:0}.topbar-mobile-logo img{max-height:32px;max-width:140px;object-fit:contain;background:#fff;border-radius:8px;padding:3px}.topbar-mobile-logo-text{font-size:15px;font-weight:600;color:var(--color-Gray-900, #252b37);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar-mobile-avatar-button{width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:transparent;border:0;padding:0;cursor:pointer}.topbar-mobile-avatar-button .profile-avatar{width:32px;height:32px}.topbar-mobile.topbar-theme-dark .topbar-mobile-logo-text{color:#fff}.layout-content:has(.content-spinner-container.active)>:not(.content-spinner-container){opacity:0;transition:opacity .2s ease-in}.layout-content>:not(.content-spinner-container){opacity:1;transition:opacity .3s ease-in}.content-spinner-container{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:#fff;border-radius:18px;z-index:99;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s ease-out}.content-spinner-container.active{opacity:1;visibility:visible;pointer-events:all;transition:none}.spinner{width:64px;height:64px;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.layout-compact .layout-content{max-width:1280px;margin-left:auto;margin-right:auto}.complete-hidden-scroll-style::-webkit-scrollbar{display:none}.complete-hidden-scroll-style{-ms-overflow-style:none;scrollbar-width:none}@media(max-width:1023px){html,body{overflow-x:hidden}}.user-profile-drawer{position:fixed;top:0;right:0;transform:translate(100%);width:100%;height:100vh;height:100dvh;background-color:var(--zango-gray-50, #F9FAFB);transition:transform .3s ease-in-out;will-change:transform;contain:paint;z-index:1300;overflow:hidden;display:flex;flex-direction:column}.user-profile-drawer *{box-sizing:border-box}.user-profile-drawer.open{transform:translate(0)}.profile-avatar-circle{width:80px;height:80px;background:var(--zango-gray-100, #F3F4F6);border-radius:50%;display:inline-flex;align-items:center;justify-content:center;border:4px solid #FFFFFF;box-shadow:0 0 14px #00000038;position:relative}.profile-avatar-circle svg{width:40px;height:40px}.profile-avatar-img{width:100%;height:100%;border-radius:50%;object-fit:cover}.profile-avatar-edit{position:absolute;bottom:-4px;right:-4px;background:var(--color-brand-500, #5048ED);color:#fff;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;border:2px solid white;box-shadow:0 2px 4px #0000001a}.profile-avatar-edit:hover{background:var(--color-brand-600, #433BD9);transform:scale(1.1)}.profile-avatar-edit svg{width:14px;height:14px}.profile-initials{font-size:32px;font-weight:600;color:var(--zango-gray-700, #4B5563)}.profile-user-name{font-size:20px;font-weight:600;color:var(--zango-gray-900, #111827);margin:0 0 2px}.profile-user-role{font-size:14px;color:var(--zango-gray-600, #6B7280);margin:0}.profile-user-role-badge{display:inline-flex;align-items:center;gap:6px;background:color-mix(in srgb,var(--color-brand-500, #5048ED) 10%,#FFFFFF);color:var(--color-brand-500, #5048ED);padding:6px 14px;border-radius:20px;font-size:13px;font-weight:500;border:1px solid rgba(80,72,237,.2);margin-top:6px;transition:all .2s ease}.profile-user-role-badge:hover{background:linear-gradient(135deg,#5048ed26,#7c3aed26,#ec489926);border-color:#5048ed4d;transform:translateY(-1px);box-shadow:0 2px 8px #5048ed33}.profile-user-role-badge svg{width:14px;height:14px;stroke:var(--color-brand-500, #5048ED);flex-shrink:0}.profile-user-role-badge span{letter-spacing:.3px;text-transform:capitalize}.account-section{display:flex;flex-direction:column;gap:24px}.profile-photo-edit:hover{background:var(--color-brand-600, #433BD9)}.profile-field-section{border-bottom:1px solid var(--zango-gray-300, #E5E7EB);padding-bottom:16px}.profile-field-section:last-child{border-bottom:none}.profile-field-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.profile-field-label{font-size:14px;font-weight:500;color:var(--zango-gray-600, #6B7280)}.profile-field-value{font-size:16px;color:var(--zango-gray-900, #111827);margin:0;display:flex;align-items:center;gap:8px}.profile-field-value.readonly{color:var(--zango-gray-600, #6B7280)}.profile-field-value .empty-value{color:#9ca3af;font-style:italic}.profile-field-value .field-icon{flex-shrink:0}.profile-field-edit-btn{background:none;border:none;color:var(--color-brand-500, #5048ED);font-size:14px;font-weight:500;cursor:pointer;padding:4px 8px;border-radius:4px;transition:all .2s ease}.profile-field-edit-btn:hover{background:#5048ed1a}.profile-inline-form{width:100%}.profile-inline-actions{display:flex;gap:8px;margin-top:12px;justify-content:flex-end}.profile-save-btn{padding:8px 16px;font-size:14px;font-weight:500;color:#fff;background:var(--color-brand-500, #5048ED);border:none;border-radius:6px;cursor:pointer;transition:all .2s ease}.profile-save-btn:hover{background:var(--color-brand-600, #433BD9)}.profile-save-btn:disabled{opacity:.6;cursor:not-allowed}.profile-rail-roles-collapsible{display:contents}.roles-list{display:flex;flex-direction:column;gap:8px;margin-top:8px}.role-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:#f9fafb;border-radius:8px;border:1px solid #E5E7EB;transition:all .2s ease}.role-item:hover{background:var(--zango-gray-100, #F3F4F6);border-color:#d1d5db}.role-item.active{background:#5048ed0d;border-color:var(--color-brand-500, #5048ED)}.role-info{display:flex;align-items:center;gap:10px}.role-info svg{width:16px;height:16px;stroke:#6b7280;flex-shrink:0}.role-item.active .role-info svg{stroke:var(--color-brand-500, #5048ED)}.role-name{font-size:14px;color:#374151;font-weight:500}.role-badge{font-size:12px;font-weight:500;color:var(--color-brand-500, #5048ED);background:#5048ed1a;padding:4px 12px;border-radius:12px}.role-switch-btn{font-size:12px;font-weight:500;color:var(--zango-gray-600, #6B7280);background:#fff;padding:4px 12px;border-radius:6px;border:1px solid #E5E7EB;cursor:pointer;transition:all .2s ease}.role-switch-btn:hover{color:var(--color-brand-500, #5048ED);border-color:var(--color-brand-500, #5048ED);background:#5048ed0d}.security-section{display:flex;flex-direction:column;gap:24px}.security-block{border:1px solid #E5E7EB;border-radius:8px;padding:20px}.security-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:16px}.security-title{font-size:16px;font-weight:600;color:var(--zango-gray-900, #111827);margin:0 0 4px}.security-subtitle{font-size:14px;color:var(--zango-gray-600, #6B7280);margin:0}.toggle-btn{padding:8px 16px;font-size:14px;font-weight:500;border:1px solid #E5E7EB;border-radius:6px;background:#fff;color:#374151;cursor:pointer;transition:all .2s ease}.toggle-btn:hover{background:#f9fafb}.toggle-btn.enabled{background:var(--color-brand-500, #5048ED);color:#fff;border-color:var(--color-brand-500, #5048ED)}.toggle-btn.enabled:hover{background:var(--color-brand-600, #433BD9)}.password-form{margin-top:16px}.sessions-list{display:flex;flex-direction:column;gap:12px;margin-top:16px}.session-item{display:flex;justify-content:space-between;align-items:center;padding:16px;background:#f9fafb;border-radius:8px;border:1px solid #E5E7EB}.session-info{display:flex;align-items:center;gap:16px;flex:1}.session-device{display:flex;align-items:center;gap:12px}.session-device svg{color:var(--zango-gray-600, #6B7280)}.session-device-header{display:flex;align-items:center;gap:8px;margin-bottom:2px}.session-device-name{font-size:14px;font-weight:500;color:var(--zango-gray-900, #111827);margin:0}.session-status-tag{font-size:11px;font-weight:500;padding:2px 8px;border-radius:12px;text-transform:uppercase;letter-spacing:.5px}.session-status-tag.current{background:#22c55e1a;color:#16a34a;border:1px solid rgba(34,197,94,.2)}.session-status-tag.inactive{background:transparent;padding:0;border:none}.logout-tag-btn{font-size:11px;font-weight:500;padding:2px 8px;border-radius:12px;text-transform:uppercase;letter-spacing:.5px;background:#ef44441a;color:#dc2626;border:1px solid rgba(239,68,68,.2);cursor:pointer;transition:all .2s ease}.logout-tag-btn:hover{background:#ef444426;border-color:#ef44444d}.logout-tag-btn-ghost{background:#9ca3af1a;color:#6b7280;border:1px solid rgba(156,163,175,.2)}.logout-tag-btn-ghost:hover{background:#9ca3af26;border-color:#9ca3af4d;color:#4b5563}.session-details{font-size:12px;color:var(--zango-gray-600, #6B7280);margin:0}.session-time{text-align:right}.session-time-info{display:flex;flex-direction:column;gap:4px;align-items:flex-end}.session-start-time{font-size:12px;color:var(--zango-gray-500, #9CA3AF);margin:0;font-weight:500}.session-last-active{font-size:12px;color:var(--zango-gray-600, #6B7280);margin:0}.session-logout-btn{padding:6px 12px;font-size:12px;font-weight:500;border:1px solid #E5E7EB;border-radius:4px;background:#fff;color:#dc2626;cursor:pointer;transition:all .2s ease}.session-logout-btn:hover{background:#fef2f2;border-color:#dc2626}.session-current{font-size:12px;color:var(--zango-gray-600, #6B7280);font-style:italic}.no-sessions{text-align:center;color:var(--zango-gray-600, #6B7280);font-size:14px;padding:20px}.logout-all-btn{width:100%;padding:12px 20px;font-size:14px;font-weight:500;color:#dc2626;background:#fff;border:1px solid #DC2626;border-radius:8px;cursor:pointer;transition:all .2s ease;margin-top:16px}.logout-all-btn:hover{background:#fef2f2}.tokens-list{margin-top:16px}.token-item{display:flex;align-items:center;justify-content:space-between;padding:16px;background:#f9fafb;border-radius:8px;margin-bottom:12px;transition:all .2s ease}.token-item:hover{background:var(--zango-gray-100, #F3F4F6)}.token-info{display:flex;align-items:center;justify-content:space-between;width:100%;gap:16px}.token-details{display:flex;align-items:center;gap:12px}.token-details svg{color:var(--zango-gray-600, #6B7280)}.token-name{font-size:14px;font-weight:500;color:var(--zango-gray-900, #111827);margin:0 0 4px}.token-created{font-size:12px;color:var(--zango-gray-600, #6B7280);margin:0}.token-revoke-btn{padding:6px 16px;font-size:13px;font-weight:500;color:#dc2626;background:#fff;border:1px solid #FEE2E2;border-radius:6px;cursor:pointer;transition:all .2s ease}.token-revoke-btn:hover{background:#fef2f2;border-color:#fecaca}.no-tokens{text-align:center;padding:32px 16px;color:var(--zango-gray-600, #6B7280)}.no-tokens p{margin:0 0 8px;font-size:14px}.no-tokens-hint{font-size:12px;color:#9ca3af}.profile-form-group{margin-bottom:16px;width:100%;box-sizing:border-box}.profile-form-label{display:block;font-size:14px;font-weight:500;color:#374151;margin-bottom:6px}.profile-form-input{width:100%;padding:10px 14px;font-size:14px;border:1px solid #E5E7EB;border-radius:8px;background:#fff;transition:all .2s ease;box-sizing:border-box}.profile-form-input:focus{outline:none;border-color:var(--color-brand-500, #5048ED);background:#fff;box-shadow:0 0 0 3px #5048ed1a}.profile-form-input::placeholder{color:#9ca3af}.profile-form-error{color:#ef4444;font-size:12px;margin-top:4px}.profile-form-actions{display:flex;gap:12px;margin-top:20px;justify-content:flex-end}.profile-cancel-btn{padding:10px 20px;font-size:14px;font-weight:500;color:var(--zango-gray-600, #6B7280);background:#fff;border:1px solid #E5E7EB;border-radius:8px;cursor:pointer;transition:all .2s ease}.profile-cancel-btn:hover{background:#f9fafb;color:var(--zango-gray-700, #4B5563)}.profile-submit-btn{padding:10px 20px;font-size:14px;font-weight:600;color:#fff;background:var(--color-brand-500, #5048ED);border:none;border-radius:8px;cursor:pointer;transition:all .2s ease}.profile-submit-btn:hover{background:var(--color-brand-600, #433BD9)}.profile-submit-btn:disabled{opacity:.6;cursor:not-allowed}.profile-alert{padding:12px 16px;border-radius:8px;margin-bottom:20px;font-size:14px;display:flex;align-items:center;gap:8px}.profile-alert.error{background:#fee2e2;color:#dc2626;border:1px solid #FECACA}.profile-alert.success{background:#5048ed1a;color:var(--color-brand-500, #5048ED);border:1px solid rgba(80,72,237,.2)}.password-requirements{background:#f9fafb;border:1px solid #E5E7EB;border-radius:8px;padding:16px;margin:16px 0;width:100%;box-sizing:border-box}.password-requirement{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--zango-gray-600, #6B7280);margin-bottom:8px;transition:color .2s ease}.password-requirement:last-child{margin-bottom:0}.password-requirement svg{flex-shrink:0}.password-requirement svg path{fill:#9ca3af;transition:fill .2s ease}.password-requirement.met{color:var(--color-brand-500, #5048ED)}.password-requirement.met svg path{fill:var(--color-brand-500, #5048ED)}.welcome-banner{background:color-mix(in srgb,var(--color-brand-500, #5048ED) 6%,#FFFFFF);border:1px solid rgba(80,72,237,.2);border-radius:12px;padding:24px;text-align:center;margin-bottom:24px}.welcome-banner svg{margin-bottom:16px}.welcome-banner h3{font-size:18px;font-weight:600;color:var(--zango-gray-900, #111827);margin:0 0 8px}.welcome-banner p{font-size:14px;color:var(--zango-gray-600, #6B7280);max-width:400px;margin:0 auto}.empty-value{color:#9ca3af;font-style:italic;font-weight:400}.field-icon{width:16px;height:16px;flex-shrink:0}.profile-field-section{transition:background .2s ease;padding:0 0 16px}.profile-field-section:hover{background:#00000003}.logout-section{margin-top:20px;padding-top:20px;border-top:1px solid #E5E7EB}.logout-button{width:100%;display:flex;align-items:center;justify-content:center;gap:8px;padding:12px 20px;font-size:14px;font-weight:500;color:#dc2626;background:#fff;border:1px solid #DC2626;border-radius:8px;cursor:pointer;transition:all .2s ease}.logout-button:hover{background:#fef2f2;color:#b91c1c;border-color:#b91c1c}.logout-button svg{width:16px;height:16px;stroke:currentColor}@media(max-width:768px){.profile-main-content{padding:16px}.profile-content-wrapper{padding:16px;max-width:100%}.profile-tabs{margin:0 -16px 20px;padding:0 16px}.profile-tab{flex:1;text-align:center}.session-info{flex-direction:column;align-items:flex-start;gap:8px}.session-item{flex-direction:column;align-items:flex-start;gap:12px}}.password-history-list{margin-top:16px}.password-history-item{display:flex;align-items:center;gap:12px;padding:12px 16px;background:var(--zango-gray-50, #F9FAFB);border-radius:8px;margin-bottom:12px;transition:all .2s ease}.password-history-item:last-child{margin-bottom:0}.password-history-item:hover{background:var(--zango-gray-100, #F3F4F6)}.history-icon{width:40px;height:40px;background:var(--zango-brand-100, rgba(80, 72, 237, .1));border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.history-icon svg{color:var(--zango-brand-600, #5048ED)}.history-details{flex:1}.history-text{font-size:14px;font-weight:500;color:var(--zango-gray-900, #111827);margin:0 0 2px}.history-time{font-size:12px;color:var(--zango-gray-600, #6B7280);margin:0}.no-password-history{text-align:center;padding:24px 16px;color:var(--zango-gray-600, #6B7280)}.no-password-history p{margin:0;font-size:14px}.password-disabled-badge{display:inline-block;margin-left:8px;padding:2px 8px;font-size:11px;font-weight:600;color:var(--zango-error-600, #DC2626);background:var(--zango-error-100, #FEE2E2);border-radius:12px;text-transform:uppercase;letter-spacing:.5px}.password-expired{color:var(--zango-error-600, #DC2626);font-weight:600}.token-type{font-size:12px;color:var(--color-brand-500, #5048ED);margin:2px 0 4px;font-weight:500}.token-expiry{font-size:12px;color:var(--zango-gray-600, #6B7280);margin:4px 0 0}.profile-topstrip{height:64px;background:linear-gradient(90deg,var(--color-brand-600, #443DC9) 0%,var(--color-brand-500, #5048ED) 100%);display:flex;align-items:center;justify-content:space-between;padding:0 24px;color:#fff;flex-shrink:0}.profile-topstrip-breadcrumb{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:500;color:#fffffff2}.profile-topstrip-breadcrumb .sep{color:#ffffff8c;font-weight:400}.profile-topstrip .profile-close-btn{position:static;width:36px;height:36px;padding:0;border:1px solid rgba(255,255,255,.28);border-radius:999px;background:#ffffff1f;color:#fff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s ease,border-color .15s ease}.profile-topstrip .profile-close-btn:hover{background:#ffffff3d;border-color:#ffffff80}.profile-body{display:flex;flex:1;min-height:0;overflow:hidden;background:var(--zango-gray-50, #F9FAFB)}.profile-body-loading{align-items:center;justify-content:center;overflow:auto}.profile-rail{width:320px;flex-shrink:0;background:#fff;border-right:1px solid var(--zango-gray-200, #E5E7EB);padding:28px 24px;display:flex;flex-direction:column;overflow-y:auto}.profile-rail-header{display:flex;flex-direction:column;align-items:center;gap:10px;padding-bottom:20px}.profile-rail-name{font-size:18px;font-weight:600;color:var(--zango-gray-900, #111827);margin:4px 0 0}.profile-rail-email{font-size:13px;color:var(--zango-gray-500, #6B7280);margin:0}.profile-rail-divider{height:1px;background:var(--zango-gray-100, #F3F4F6);margin:16px 0}.profile-rail-section{display:flex;flex-direction:column;gap:6px}.profile-rail-section-label{font-size:11px;font-weight:600;color:var(--zango-gray-400, #9CA3AF);text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}.profile-rail-spacer{flex:1 1 auto;min-height:16px}.profile-right-col{flex:1;min-width:0;overflow-y:auto;padding:28px 40px;display:flex;flex-direction:column;gap:20px}.profile-card{background:#fff;border:1px solid var(--zango-gray-200, #E5E7EB);border-radius:8px;padding:22px}.profile-card-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.profile-card-title-group{display:flex;align-items:center;gap:8px;min-width:0}.profile-card-title{font-size:15px;font-weight:600;color:var(--zango-gray-900, #111827);margin:0}.profile-card-subtitle{font-size:12px;color:var(--zango-gray-500, #6B7280);margin:2px 0 0}.profile-kv-row{display:flex;align-items:center;padding:10px 0;border-top:1px solid var(--zango-gray-100, #F3F4F6);gap:16px}.profile-kv-row:first-child{border-top:0;padding-top:4px}.profile-kv-label{width:180px;flex-shrink:0;font-size:12px;font-weight:500;color:var(--zango-gray-500, #6B7280);text-transform:uppercase;letter-spacing:.4px}.profile-kv-value{flex:1;font-size:14px;color:var(--zango-gray-900, #111827);display:flex;align-items:center;gap:8px;min-width:0;word-break:break-word}.profile-kv-value .empty-value{color:var(--zango-gray-400, #9CA3AF);font-style:italic}.profile-card .profile-field-section{padding:0;border:0;margin:0}.profile-card .profile-inline-form{padding:8px 0 0;margin:0;border:0}.profile-card .profile-field-edit-btn{padding:4px 10px;font-size:12px;font-weight:500}.profile-card .profile-inline-actions{margin-bottom:14px}.profile-card .welcome-banner{padding:20px;margin:0 0 14px;text-align:center;border-radius:8px;background:color-mix(in srgb,var(--color-brand-500, #5048ED) 6%,#FFFFFF);border:1px solid color-mix(in srgb,var(--color-brand-500, #5048ED) 14%,#FFFFFF)}.profile-card .welcome-banner h3{font-size:15px;margin:8px 0 4px}.profile-card .welcome-banner p{font-size:13px;color:var(--zango-gray-500, #6B7280);margin:0}.profile-card .security-header{margin:0 0 8px;padding:0;border:0;display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.profile-card .security-header>div:first-child{flex:1;min-width:0}.profile-card .security-title{font-size:15px;font-weight:600;margin:0;display:flex;align-items:center;gap:8px}.profile-card .security-subtitle{font-size:12px;color:var(--zango-gray-500, #6B7280);margin:2px 0 0}.profile-card .password-form{margin-top:14px;padding:14px;background:var(--zango-gray-50, #F9FAFB);border-radius:6px}.profile-card .password-requirements{margin:10px 0;padding:10px 12px;background:#fff;border:1px solid var(--zango-gray-200, #E5E7EB);border-radius:6px}.profile-card .toggle-btn{padding:6px 14px;font-size:13px}.profile-card .sessions-list{display:flex;flex-direction:column;gap:0;margin:0}.profile-card .session-item{padding:12px 0;border-top:1px solid var(--zango-gray-100, #F3F4F6);display:flex;align-items:center;gap:16px;background:transparent;border-left:0;border-right:0;border-bottom:0}.profile-card .session-item:first-child{border-top:0;padding-top:4px}.profile-card .session-info{flex:1;min-width:0}.profile-card .session-device{display:flex;align-items:center;gap:12px}.profile-card .session-device-name{font-size:14px;font-weight:600;color:var(--zango-gray-900, #111827);margin:0}.profile-card .session-details{font-size:12px;color:var(--zango-gray-500, #6B7280);margin:2px 0 0}.profile-card .session-time{text-align:right;flex-shrink:0}.profile-card .session-start-time,.profile-card .session-last-active{font-size:12px;color:var(--zango-gray-500, #6B7280);margin:0}.profile-card .logout-all-btn{width:auto;margin:0;padding:4px 10px;font-size:12px;font-weight:500;background:transparent;color:var(--color-brand-500, #5048ED);border:0;border-radius:6px;flex-shrink:0;cursor:pointer}.profile-card .session-device-header .logout-tag-btn,.profile-card .session-device-header .logout-tag-btn-ghost{padding:4px 12px;font-size:12px;font-weight:500;text-transform:none;letter-spacing:0;border-radius:6px;background:#fff;color:#dc2626;border:1px solid #FECACA;cursor:pointer;line-height:1.4}.profile-card .session-device-header .logout-tag-btn:hover,.profile-card .session-device-header .logout-tag-btn-ghost:hover{background:#fef2f2;border-color:#dc2626;color:#dc2626}.profile-card .logout-all-btn:hover{background:transparent;text-decoration:underline}.profile-card .tokens-list{display:flex;flex-direction:column;margin:0;padding:0}.profile-card .token-item{padding:12px 0;border-top:1px solid var(--zango-gray-100, #F3F4F6);background:transparent;border-left:0;border-right:0;border-bottom:0}.profile-card .token-item:first-child{border-top:0;padding-top:4px}.profile-card .token-info{display:flex;align-items:center;gap:12px}.profile-card .token-details{display:flex;gap:12px;align-items:flex-start}.profile-card .token-name{font-size:14px;font-weight:600;color:var(--zango-gray-900, #111827);margin:0}.profile-card .token-type,.profile-card .token-created,.profile-card .token-expiry{font-size:12px;color:var(--zango-gray-500, #6B7280);margin:2px 0 0}.profile-card .no-tokens{padding:20px 0;text-align:center;color:var(--zango-gray-500, #6B7280)}.profile-card .no-tokens p{margin:0;font-size:13px}.profile-card .no-tokens-hint{margin-top:4px!important;font-size:12px;color:var(--zango-gray-400, #9CA3AF)}.profile-rail-header .profile-avatar-circle{width:96px;height:96px;margin:0}.profile-rail-header .profile-avatar-edit{width:28px;height:28px;background:var(--color-brand-500, #5048ED)}.profile-rail-header .profile-user-role-badge{background:color-mix(in srgb,var(--color-brand-500, #5048ED) 10%,#FFFFFF);color:var(--color-brand-500, #5048ED);border:1px solid color-mix(in srgb,var(--color-brand-500, #5048ED) 24%,#FFFFFF);padding:4px 12px;font-size:12px;border-radius:999px;display:inline-flex;align-items:center;gap:6px}.profile-rail .roles-list{display:flex;flex-direction:column;gap:4px}.profile-rail .role-item{padding:10px 12px;border-radius:8px;border:1px solid transparent;background:transparent;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px}.profile-rail .role-item:hover{background:var(--zango-gray-50, #F9FAFB)}.profile-rail .role-item.active{background:color-mix(in srgb,var(--color-brand-500, #5048ED) 8%,#FFFFFF);border-color:color-mix(in srgb,var(--color-brand-500, #5048ED) 28%,#FFFFFF);color:var(--color-brand-500, #5048ED)}.profile-rail .role-info{display:flex;align-items:center;gap:8px;min-width:0}.profile-rail .role-name{font-weight:500}.profile-rail .role-item.active .role-badge{background:var(--color-brand-500, #5048ED);color:#fff;font-size:10px;padding:2px 8px;border-radius:999px;text-transform:uppercase;letter-spacing:.5px}.profile-rail .role-switch-btn{padding:3px 10px;font-size:11px;border:1px solid var(--zango-gray-300, #D1D5DB);background:#fff;border-radius:6px;cursor:pointer}.profile-rail .role-switch-btn:hover:not(:disabled){background:var(--zango-gray-50, #F9FAFB)}.profile-rail .logout-button{width:100%;padding:10px 12px;border:1px solid #DC2626;color:#dc2626;background:#fff;border-radius:8px;display:flex;align-items:center;justify-content:center;gap:8px;font-weight:500;font-size:13px;cursor:pointer;margin-top:0}.profile-rail .logout-button:hover{background:#fef2f2}.profile-rail-mobile-actions{display:contents}@media(max-width:1023px){.user-profile-drawer.user-profile-drawer-mobile{width:100vw!important;max-width:100vw!important;height:100dvh!important;top:0!important;bottom:0!important;left:auto;border-radius:0!important;box-shadow:none!important;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}.user-profile-drawer.user-profile-drawer-mobile.open{transform:translate(0)!important}.user-profile-drawer-mobile .profile-body{flex-direction:column;overflow:auto}.user-profile-drawer-mobile .profile-rail{width:100%;border-right:0;border-bottom:1px solid var(--zango-gray-200, #E5E7EB);padding:20px 16px 24px}.user-profile-drawer-mobile .profile-right-col{flex:0 0 auto;overflow:visible;padding:20px 16px 24px}.user-profile-drawer-mobile .profile-rail{flex:0 0 auto}.user-profile-drawer-mobile .profile-rail-section-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:10px 12px;background:#fff;border:1px solid var(--zango-gray-200, #E5E7EB);border-radius:10px;cursor:pointer;color:var(--zango-gray-700, #374151);box-shadow:0 1px 2px #1018280a}.user-profile-drawer-mobile .profile-rail-section-toggle .profile-rail-section-label{margin:0;font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--zango-gray-600, #6B7280)}.user-profile-drawer-mobile .profile-rail-section-chevron{color:var(--zango-gray-500, #9CA3AF);transition:transform .2s ease;flex-shrink:0}.user-profile-drawer-mobile .profile-rail-section-chevron.open{transform:rotate(180deg)}.user-profile-drawer-mobile .profile-rail-roles-collapsible{display:grid;grid-template-rows:0fr;transition:grid-template-rows .28s cubic-bezier(.4,0,.2,1),margin-top .28s cubic-bezier(.4,0,.2,1);margin-top:0}.user-profile-drawer-mobile .profile-rail-section.expanded .profile-rail-roles-collapsible{grid-template-rows:1fr;margin-top:10px}.user-profile-drawer-mobile .profile-rail-roles-collapsible .roles-list{display:flex;flex-direction:column;gap:8px;overflow:hidden;min-height:0;opacity:0;transition:opacity .2s ease;padding-bottom:0}.user-profile-drawer-mobile .profile-rail-section.expanded .profile-rail-roles-collapsible .roles-list{opacity:1;transition-delay:80ms}.user-profile-drawer-mobile .role-item{width:100%;min-height:56px;padding:12px 14px;border-radius:10px;background:#fff;border:1px solid var(--zango-gray-200, #E5E7EB);box-shadow:0 1px 2px #1018280a}.user-profile-drawer-mobile .role-item.active{background:#5048ed0f;border-color:var(--color-brand-500, #5048ED);box-shadow:inset 3px 0 0 var(--color-brand-500, #5048ED),0 1px 2px #5048ed14}.user-profile-drawer-mobile .role-info{gap:12px}.user-profile-drawer-mobile .role-info svg{width:18px;height:18px}.user-profile-drawer-mobile .role-name{font-size:15px}.user-profile-drawer-mobile .role-badge{font-size:11px;padding:4px 10px;text-transform:uppercase;letter-spacing:.04em}.user-profile-drawer-mobile .role-switch-btn{min-height:32px;padding:6px 14px;font-size:13px;border-radius:8px}.user-profile-drawer-mobile .profile-rail-mobile-actions{display:none}.user-profile-drawer-mobile .profile-mobile-footer-actions{position:sticky;bottom:0;background:#fff;padding:12px 16px max(env(safe-area-inset-bottom),16px);border-top:1px solid var(--zango-gray-200, #E5E7EB);z-index:2}.user-profile-drawer-mobile .profile-mobile-footer-actions .logout-button{width:100%;min-height:44px;justify-content:center}.user-profile-drawer-mobile .profile-form-input{min-height:44px;font-size:16px}.user-profile-drawer-mobile .profile-form-actions{flex-direction:column-reverse;gap:8px}.user-profile-drawer-mobile .profile-form-actions>button{width:100%;min-height:44px}.user-profile-drawer-mobile .profile-inline-actions{flex-direction:column-reverse;gap:8px;margin-top:16px;margin-bottom:12px}.user-profile-drawer-mobile .profile-card{padding:16px}.user-profile-drawer-mobile .profile-card-header{flex-direction:row;align-items:center;justify-content:space-between;gap:8px}.user-profile-drawer-mobile .token-item{flex-direction:column;align-items:flex-start;gap:8px}.user-profile-drawer-mobile .profile-card .sessions-list{display:flex;flex-direction:column;gap:10px;padding-top:4px;margin:0}.user-profile-drawer-mobile .profile-card .session-item{display:flex;flex-direction:column;align-items:stretch;gap:0;padding:14px;background:#fff;border:1px solid var(--zango-gray-200, #E5E7EB);border-radius:12px;box-shadow:0 1px 3px #1018280a;position:relative;overflow:hidden}.user-profile-drawer-mobile .profile-card .session-item:first-child{border-top:1px solid var(--zango-gray-200, #E5E7EB);padding-top:14px}.user-profile-drawer-mobile .profile-card .session-item:has(.session-status-tag.current){border-color:color-mix(in srgb,var(--color-brand-500, #5048ED) 24%,#FFFFFF);box-shadow:0 1px 3px #5048ed14}.user-profile-drawer-mobile .profile-card .session-item:has(.session-status-tag.current):before{content:"";position:absolute;top:0;left:0;bottom:0;width:3px;background:var(--color-brand-500, #5048ED)}.user-profile-drawer-mobile .profile-card .session-info{width:100%;flex:1;display:flex;flex-direction:column;gap:0;min-width:0}.user-profile-drawer-mobile .profile-card .session-device{display:flex;align-items:flex-start;gap:12px;width:100%}.user-profile-drawer-mobile .profile-card .session-device>svg{width:22px;height:22px;padding:9px;box-sizing:content-box;background:color-mix(in srgb,var(--color-brand-500, #5048ED) 10%,#FFFFFF);border:1px solid color-mix(in srgb,var(--color-brand-500, #5048ED) 18%,#FFFFFF);border-radius:10px;color:var(--color-brand-500, #5048ED);flex-shrink:0;display:block}.user-profile-drawer-mobile .profile-card .session-device>div{flex:1;min-width:0;padding-top:2px;display:flex;flex-direction:column;gap:3px}.user-profile-drawer-mobile .profile-card .session-device-header{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0}.user-profile-drawer-mobile .profile-card .session-device-name{font-size:15px;font-weight:600;color:var(--zango-gray-900, #111827);line-height:1.3;margin:0;letter-spacing:-.01em}.user-profile-drawer-mobile .profile-card .session-details{font-size:13px;color:var(--zango-gray-500, #6B7280);margin:0;line-height:1.4;font-variant-numeric:tabular-nums}.user-profile-drawer-mobile .profile-card .session-status-tag.current{font-size:10px;font-weight:700;padding:3px 9px;letter-spacing:.06em;border-radius:999px;background:#22c55e1f;color:#15803d;border:1px solid rgba(34,197,94,.3);text-transform:uppercase}.user-profile-drawer-mobile .profile-card .session-device-header .logout-tag-btn,.user-profile-drawer-mobile .profile-card .session-device-header .logout-tag-btn-ghost{font-size:11px;font-weight:500;padding:4px 10px;border-radius:6px}.user-profile-drawer-mobile .profile-card .session-time{width:calc(100% - 52px);margin-left:52px;margin-top:10px;padding-top:10px;border-top:1px dashed color-mix(in srgb,var(--zango-gray-300, #D1D5DB) 80%,transparent);text-align:left;flex-shrink:1}.user-profile-drawer-mobile .profile-card .session-time-info{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px 12px;width:100%}.user-profile-drawer-mobile .profile-card .session-last-active{font-size:12px;color:var(--zango-gray-700, #374151);margin:0;font-weight:500;display:inline-flex;align-items:center;gap:6px;order:1}.user-profile-drawer-mobile .profile-card .session-last-active:before{content:"";width:6px;height:6px;border-radius:50%;background:#22c55e;flex-shrink:0;animation:session-active-pulse 2.4s ease-in-out infinite}.user-profile-drawer-mobile .profile-card .session-start-time{font-size:12px;color:var(--zango-gray-500, #6B7280);margin:0;font-weight:400;order:2}.user-profile-drawer-mobile .profile-card .security-header .logout-all-btn{font-size:11px;padding:4px 8px;flex-shrink:0;text-align:right;line-height:1.3}.user-profile-drawer-mobile .profile-kv-row{flex-direction:column;align-items:flex-start;gap:4px;padding:12px 0}.user-profile-drawer-mobile .profile-kv-label{width:auto;flex-shrink:1}.user-profile-drawer-mobile .profile-kv-value{width:100%;word-break:break-word;overflow-wrap:anywhere}.user-profile-drawer-mobile .logout-all-btn{padding:6px 0}.user-profile-drawer-mobile .profile-topstrip{padding:8px 12px;padding-top:max(env(safe-area-inset-top),8px);background:var(--color-brand-500, #5048ED)}.user-profile-drawer-mobile .profile-topstrip .profile-close-btn{width:44px;height:44px}.user-profile-drawer-mobile .profile-topstrip-breadcrumb{font-size:13px}}@keyframes session-active-pulse{0%,to{box-shadow:0 0 #22c55e80}50%{box-shadow:0 0 0 4px #22c55e00}}`)),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(W,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react/jsx-runtime"),require("@zango-core/components"),require("react"),require("react-router-dom"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@zango-core/components","react","react-router-dom","react-dom"],i):(W=typeof globalThis<"u"?globalThis:W||self,i(W.ZangoAppbuilder={},W["react/jsx-runtime"],W.components,W.React,W.ReactRouterDOM,W.ReactDOM))})(this,(function(W,i,A,v,ue,py){"use strict";var ly=W=>{throw TypeError(W)};var uy=(W,i,A)=>i.has(W)||ly("Cannot "+A);var bt=(W,i,A)=>(uy(W,i,"read from private field"),A?A.call(W):i.get(W)),dy=(W,i,A)=>i.has(W)?ly("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(W):i.set(W,A),Kl=(W,i,A,v)=>(uy(W,i,"write to private field"),v?v.call(W,A):i.set(W,A),A);var Ge,$t;function Yl(e){const t=Object.create(null);if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}return t.default=e,Object.freeze(t)}const x=Yl(v),Ba=Yl(py),Ql=x.createContext(void 0),Xo=e=>{const t=x.useContext(Ql);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},my=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(Ql.Provider,{value:e,children:t})),gy={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var by=class{#e=gy;#t=!1;setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&this.#t&&e!==this.#e&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#e,provider:e}),this.#e=e,process.env.NODE_ENV!=="production"&&(this.#t=!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};const Xr=new by;function yy(e){setTimeout(e,0)}const wy=typeof window>"u"||"Deno"in globalThis;function yt(){}function vy(e,t){return typeof e=="function"?e(t):e}function Jl(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ue(e,t){return typeof e=="function"?e(t):e}function eu(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:s,queryKey:a,stale:c}=e;if(a){if(n){if(t.queryHash!==Va(a,t.options))return!1}else if(!kn(t.queryKey,a))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||o&&o!==t.state.fetchStatus||s&&!s(t))}function tu(e,t){const{exact:r,status:n,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(en(t.options.mutationKey)!==en(s))return!1}else if(!kn(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function Va(e,t){return(t?.queryKeyHashFn||en)(e)}function en(e){return JSON.stringify(e,(t,r)=>Ha(r)?Object.keys(r).sort().reduce((n,o)=>(n[o]=r[o],n),{}):r)}function kn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!kn(e[n],t[n]))return!1;return!0}const r=Object.keys(t);for(const n of r)if(!kn(e[n],t[n]))return!1;return!0}return!1}const _y=Object.prototype.hasOwnProperty;function qa(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=ru(e)&&ru(t);if(!n&&!(Ha(e)&&Ha(t)))return t;const o=(n?e:Object.keys(e)).length,s=n?t:Object.keys(t),a=s.length,c=n?new Array(a):{};let l=0;for(let u=0;u<a;u++){const d=n?u:s[u],h=e[d],f=t[d];if(h===f){c[d]=h,(n?u<o:_y.call(e,d))&&l++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){c[d]=f;continue}const p=qa(h,f,r+1);c[d]=p,p===h&&l++}return o===a&&l===o?e:c}function es(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function ru(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ha(e){if(!nu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!nu(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function nu(e){return Object.prototype.toString.call(e)==="[object Object]"}function xy(e){return new Promise(t=>{Xr.setTimeout(t,e)})}function Wa(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return qa(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return qa(e,t)}return t}function Sy(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Cy(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}const ts=Symbol();function ou(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===ts&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ts?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Za(e,t){return typeof e=="function"?e(...t):!!e}function Py(e,t,r){let n=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),n||(n=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}let Ey=()=>wy;const Ra=()=>Ey();var An=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ky=class extends An{#e;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const Ga=new ky,Ay=yy;function Oy(){let e=[],t=0,r=c=>{c()},n=c=>{c()},o=Ay;const s=c=>{t?e.push(c):o(()=>{r(c)})},a=()=>{const c=e;e=[],c.length&&o(()=>{n(()=>{c.forEach(l=>{r(l)})})})};return{batch:c=>{let l;t++;try{l=c()}finally{t--,t||a()}return l},batchCalls:c=>(...l)=>{s(()=>{c(...l)})},schedule:s,setNotifyFunction:c=>{r=c},setBatchNotifyFunction:c=>{n=c},setScheduler:c=>{o=c}}}const Ke=Oy();var Ty=class extends An{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};const rs=new Ty;function Ny(e){return Math.min(1e3*2**e,3e4)}function su(e){return(e??"online")==="online"?rs.isOnline():!0}var Ka=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function au(e){let t=!1,r=0,n,o="pending",s,a;const c=new Promise((w,_)=>{s=w,a=_});c.catch(yt);const l=()=>o!=="pending",u=w=>{if(!l()){const _=new Ka(w);g(_),e.onCancel?.(_)}},d=()=>{t=!0},h=()=>{t=!1},f=()=>Ga.isFocused()&&(e.networkMode==="always"||rs.isOnline())&&e.canRun(),p=()=>su(e.networkMode)&&e.canRun(),m=w=>{l()||(n?.(),o="resolved",s(w))},g=w=>{l()||(n?.(),o="rejected",a(w))},y=()=>new Promise(w=>{n=_=>{(l()||f())&&w(_)},e.onPause?.()}).then(()=>{n=void 0,l()||e.onContinue?.()}),b=()=>{if(l())return;let w;const _=r===0?e.initialPromise:void 0;try{w=_??e.fn()}catch(P){w=Promise.reject(P)}Promise.resolve(w).then(m).catch(P=>{if(l())return;const E=e.retry??(Ra()?0:3),S=e.retryDelay??Ny,O=typeof S=="function"?S(r,P):S,N=E===!0||typeof E=="number"&&r<E||typeof E=="function"&&E(r,P);if(t||!N){g(P);return}r++,e.onFail?.(r,P),xy(O).then(()=>f()?void 0:y()).then(()=>{t?g(P):b()})})};return{promise:c,status:()=>o,cancel:u,continue:()=>(n?.(),c),cancelRetry:d,continueRetry:h,canStart:p,start:()=>(p()?b():y().then(b),c)}}var iu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jl(this.gcTime)&&(this.#e=Xr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ra()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Xr.clearTimeout(this.#e),this.#e=void 0)}};function Ly(e){return{onFetch:(t,r)=>{const n=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},l=0;const u=async()=>{let d=!1;const h=m=>{Py(m,()=>t.signal,()=>d=!0)},f=ou(t.options,t.fetchOptions),p=async(m,g,y)=>{if(d)return Promise.reject(t.signal.reason);if(g==null&&m.pages.length)return Promise.resolve(m);const w=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return h(S),S})(),_=await f(w),{maxPages:P}=t.options,E=y?Cy:Sy;return{pages:E(m.pages,_,P),pageParams:E(m.pageParams,g,P)}};if(o&&s.length){const m=o==="backward",g=m?My:cu,y={pages:s,pageParams:a};c=await p(y,g(n,y),m)}else{const m=e??s.length;do{const g=l===0?a[0]??n.initialPageParam:cu(n,c);if(l>0&&g==null)break;c=await p(c,g),l++}while(l<m)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function cu(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function My(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var Iy=class extends iu{#e;#t;#r;#n;#s;#o;#a;#c;constructor(e){super(),this.#c=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=du(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#o?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=du(this.options);t.data!==void 0&&(this.setState(uu(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const r=Wa(this.state.data,e,this.options);return this.#i({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#i({type:"setState",state:e})}cancel(e){const t=this.#o?.promise;return this.#o?.cancel(e),t?t.then(yt).catch(yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ue(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ts||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ue(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Xl(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#o&&(this.#c||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#o?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(u=>u.options.queryFn);l&&this.setOptions(l.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#c=!0,r.signal)})},o=()=>{const l=ou(this.options,t),d=(()=>{const h={client:this.#s,queryKey:this.queryKey,meta:this.meta};return n(h),h})();return this.#c=!1,this.options.persister?this.options.persister(l,d,this):l(d)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:o};return n(l),l})();(this.#e==="infinite"?Ly(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#r=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#i({type:"fetch",meta:a.fetchOptions?.meta});const c=this.#o=au({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof Ka&&l.revert&&this.setState({...this.#r,fetchStatus:"idle"}),r.abort()},onFail:(l,u)=>{this.#i({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const l=await c.start();if(l===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#n.config.onSuccess?.(l,this),this.#n.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof Ka){if(l.silent)return this.#o.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#i({type:"error",error:l}),this.#n.config.onError?.(l,this),this.#n.config.onSettled?.(this.state.data,l,this),l}finally{this.#o===c&&(this.#o=void 0),this.scheduleGc()}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...lu(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...uu(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#r=e.manual?n:void 0,n;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Ke.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function lu(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:su(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uu(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function du(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Fy=class extends An{#e;#t=void 0;#r=void 0;#n=void 0;#s;#o;#a;#c;#i;#h;#u;#d;#l;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),fu(this.#t,this.options)?this.#f():this.updateResult(),this.#w())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ya(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ya(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#_(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ue(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),t._defaulted&&!es(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&hu(this.#t,r,this.options,t)&&this.#f(),this.updateResult(),n&&(this.#t!==r||Ue(this.options.enabled,this.#t)!==Ue(t.enabled,this.#t)||Ue(this.options.staleTime,this.#t)!==Ue(t.staleTime,this.#t))&&this.#g();const o=this.#b();n&&(this.#t!==r||Ue(this.options.enabled,this.#t)!==Ue(t.enabled,this.#t)||o!==this.#l)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return es(this.getCurrentResult(),r)||(this.#n=r,this.#o=this.options,this.#s=this.#t.state),r}getCurrentResult(){return this.#n}trackResult(e,t){return new Proxy(e,{get:(r,n)=>(this.trackProp(n),t?.(n),Reflect.get(r,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);let n=()=>{},o;const s=new Promise(a=>{o=a,n=this.#e.getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===r.queryHash&&r.state.data!==void 0&&(n(),a(this.createResult(r,t)))})});return Promise.race([r.fetch().then(()=>{const a=this.createResult(r,t);return o?.(a),a}).finally(()=>{n()}),s])}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#f(e){this.#x();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(yt)),t}#m(e){return!Ra()&&Ue(this.options.enabled,this.#t)!==!1&&Jl(e)}#g(){this.#v();const e=Ue(this.options.staleTime,this.#t);if(this.#n.isStale||!this.#m(e))return;const t=Xl(this.#n.dataUpdatedAt,e)+1;this.#u=Xr.setTimeout(()=>{this.#n.isStale||this.updateResult()},t)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#_(),this.#l=e,!(this.#l===0||!this.#m(this.#l))&&(this.#d=Xr.setInterval(()=>{(this.options.refetchIntervalInBackground||Ga.isFocused())&&this.#f()},this.#l))}#w(){this.#g(),this.#y(this.#b())}#v(){this.#u!==void 0&&(Xr.clearTimeout(this.#u),this.#u=void 0)}#_(){this.#d!==void 0&&(Xr.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){const r=this.#t,n=this.options,o=this.#n,s=this.#s,a=this.#o,c=e!==r?e.state:this.#r,{state:l}=e;let u={...l},d=!1,h;if(t._optimisticResults){const E=this.hasListeners(),S=!E&&fu(e,t),O=E&&hu(e,r,t,n);(S||O)&&(u={...u,...lu(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:f,errorUpdatedAt:p,status:m}=u;h=u.data;let g=!1;if(t.placeholderData!==void 0&&h===void 0&&m==="pending"){let E;o?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(E=o.data,g=!0):E=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,E!==void 0&&(m="success",h=Wa(o?.data,E,t),d=!0)}if(t.select&&h!==void 0&&!g)if(o&&h===s?.data&&t.select===this.#c)h=this.#i;else try{this.#c=t.select,h=t.select(h),h=Wa(o?.data,h,t),this.#i=h,this.#a=null}catch(E){this.#a=E}else h===void 0&&(this.#a=null);this.#a&&(f=this.#a,h=this.#i,p=Date.now(),m="error",d=!1);const y=u.fetchStatus==="fetching",b=m==="pending",w=m==="error",_=b&&y,P=h!==void 0;return{status:m,fetchStatus:u.fetchStatus,isPending:b,isSuccess:m==="success",isError:w,isInitialLoading:_,isLoading:_,data:h,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:w&&!P,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&P,isStale:Qa(e,t),refetch:this.refetch,isEnabled:Ue(t.enabled,e)!==!1}}updateResult(){const e=this.#n,t=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#o=this.options,this.#s.data!==void 0&&(this.#h=this.#t),es(t,e))return;this.#n=t;const n=(()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!this.#p.size)return!0;const a=new Set(s??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#n).some(c=>{const l=c;return this.#n[l]!==e[l]&&a.has(l)})})();Ke.batch(()=>{n&&this.listeners.forEach(o=>{o(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#x(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#w()}};function Dy(e,t){return Ue(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ue(t.retryOnMount,e)===!1)}function fu(e,t){return Dy(e,t)||e.state.data!==void 0&&Ya(e,t,t.refetchOnMount)}function Ya(e,t,r){if(Ue(t.enabled,e)!==!1&&Ue(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Qa(e,t)}return!1}function hu(e,t,r,n){return(e!==t||Ue(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Qa(e,r)}function Qa(e,t){return Ue(t.enabled,e)!==!1&&e.isStaleByTime(Ue(t.staleTime,e))}var $y=class extends iu{#e;#t;#r;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||pu(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){const t=()=>{this.#s({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},n=this.#n=au({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(a,c)=>{this.#s({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)}),o=this.state.status==="pending",s=!n.canStart();try{if(o)t();else{this.#s({type:"pending",variables:e,isPaused:s}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);const c=await this.options.onMutate?.(e,r);c!==this.state.context&&this.#s({type:"pending",context:c,variables:e,isPaused:s})}const a=await n.start();return await this.#r.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#r.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#s({type:"success",data:a}),a}catch(a){try{await this.#r.config.onError?.(a,e,this.state.context,this,r)}catch(c){Promise.reject(c)}try{await this.options.onError?.(a,e,this.state.context,r)}catch(c){Promise.reject(c)}try{await this.#r.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,r)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,r)}catch(c){Promise.reject(c)}throw this.#s({type:"error",error:a}),a}finally{this.#n===n&&(this.#n=void 0),this.#r.runNext(this)}}#s(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ke.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function pu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zy=class extends An{#e;#t;#r;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}build(e,t,r){const n=new $y({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#e.add(e);const t=ns(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=ns(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=ns(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(n=>n.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=ns(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ke.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>tu(t,r))}findAll(e={}){return this.getAll().filter(t=>tu(e,t))}notify(e){Ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ke.batch(()=>Promise.all(e.map(t=>t.continue().catch(yt))))}};function ns(e){return e.options.scope?.id}var Uy=class extends An{#e;#t=void 0;#r;#n;constructor(t,r){super(),this.#e=t,this.setOptions(r),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.#e.defaultMutationOptions(t),es(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),r?.mutationKey&&this.options.mutationKey&&en(r.mutationKey)!==en(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#r&&(this.#r.addObserver(this),this.#s())}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#s(),this.#o()}mutate(t,r){return this.#n=r,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#s(){const t=this.#r?.state??pu();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Ke.batch(()=>{if(this.#n&&this.hasListeners()){const r=this.#t.variables,n=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#n.onSuccess?.(t.data,r,n,o)}catch(s){Promise.reject(s)}try{this.#n.onSettled?.(t.data,null,r,n,o)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#n.onError?.(t.error,r,n,o)}catch(s){Promise.reject(s)}try{this.#n.onSettled?.(void 0,t.error,r,n,o)}catch(s){Promise.reject(s)}}}this.listeners.forEach(r=>{r(this.#t)})})}},jy=class extends An{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,r){const n=t.queryKey,o=t.queryHash??Va(n,t);let s=this.get(o);return s||(s=new Iy({client:e,queryKey:n,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ke.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>eu(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>eu(e,r)):t}notify(e){Ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},By=class{#e;#t;#r;#n;#s;#o;#a;#c;constructor(e={}){this.#e=e.queryCache||new jy,this.#t=e.mutationCache||new zy,this.#r=e.defaultOptions||{},this.#n=new Map,this.#s=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=Ga.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#c=rs.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#c?.(),this.#c=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ue(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>[t,r.data])}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(n.queryHash)?.state.data,s=vy(t,o);if(s!==void 0)return this.#e.build(this,n).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return Ke.batch(()=>this.#e.findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Ke.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return Ke.batch(()=>{const n=r.findAll(e),o=new Set(n);return n.forEach(s=>{s.reset()}),this.refetchQueries({type:"active",predicate:s=>o.has(s)},t)})}cancelQueries(e,t={}){const r={revert:!0,...t},n=Ke.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(n).then(yt).catch(yt)}invalidateQueries(e,t={}){return Ke.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Ke.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(yt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(yt)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t),n=r.isStaleByTime(Ue(t.staleTime,r))?await r.fetch(t):r.state.data,o=t.select;return o?o(n):n}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Ue(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(yt).catch(yt)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(yt).catch(yt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return rs.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(en(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(n=>{kn(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){this.#s.set(en(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(n=>{kn(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Va(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ts&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const mu=x.createContext(!1),Vy=()=>x.useContext(mu);mu.Provider;function qy(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Hy=x.createContext(qy()),Wy=()=>x.useContext(Hy),Zy=(e,t,r)=>{const n=r?.state.error&&typeof e.throwOnError=="function"?Za(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||n)&&(t.isReset()||(e.retryOnMount=!1))},Ry=e=>{x.useEffect(()=>{e.clearReset()},[e])},Gy=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&e.data===void 0||Za(r,[e.error,n])),Ky=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...o)=>r(n(...o)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Yy=(e,t)=>e?.suspense&&t.isPending,Qy=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Jy(e,t,r){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Vy(),o=Wy(),s=Xo(),a=s.defaultQueryOptions(e),c=s.getQueryCache().get(a.queryHash);process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));const l=e.subscribed!==!1;a._optimisticResults=n?"isRestoring":l?"optimistic":void 0,Ky(a),Zy(a,o,c),Ry(o);const[u]=x.useState(()=>new t(s,a)),d=u.getOptimisticResult(a),h=!n&&l;if(x.useSyncExternalStore(x.useCallback(f=>{const p=h?u.subscribe(Ke.batchCalls(f)):yt;return u.updateResult(),p},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),x.useEffect(()=>{u.setOptions(a)},[a,u]),Yy(a,d))throw Qy(a,u,o);if(Gy({result:d,errorResetBoundary:o,throwOnError:a.throwOnError,query:c,suspense:a.suspense}))throw d.error;return a.notifyOnChangeProps?d:u.trackResult(d)}function os(e,t){return Jy(e,Fy)}function gu(e,t){const r=Xo(),[n]=x.useState(()=>new Uy(r,e));x.useEffect(()=>{n.setOptions(e)},[n,e]);const o=x.useSyncExternalStore(x.useCallback(a=>n.subscribe(Ke.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=x.useCallback((...a)=>{n.mutate(a[0],a[1]).catch(yt)},[n]);if(o.error&&Za(n.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const Ja=1024;function qe(){const[e,t]=x.useState(!1);return x.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Ja-1}px)`),n=()=>{t(window.innerWidth<Ja)};return r.addEventListener("change",n),t(window.innerWidth<Ja),()=>r.removeEventListener("change",n)},[]),e}class Xy{constructor(){this.isDev=!1}debug(t,r){this.isDev&&console.log(`[DEBUG] ${t}`,r||"")}info(t,r){this.isDev?console.info(`[INFO] ${t}`,r||""):this.sendToMonitoring("info",t,r)}warn(t,r){this.isDev?console.warn(`[WARN] ${t}`,r||""):this.sendToMonitoring("warning",t,r)}error(t,r,n){const o={...n,error:r instanceof Error?{message:r.message,stack:r.stack,name:r.name}:r};this.isDev?console.error(`[ERROR] ${t}`,o):this.sendToMonitoring("error",t,o)}sendToMonitoring(t,r,n){t==="error"?console.error(`[${t.toUpperCase()}] ${r}`,n):t==="warning"?console.warn(`[${t.toUpperCase()}] ${r}`,n):console.log(`[${t.toUpperCase()}] ${r}`,n)}}const J=new Xy;function bu(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=bu(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function yu(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=bu(e))&&(n&&(n+=" "),n+=t);return n}const wu=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vu=yu,_u=(e,t)=>r=>{var n;if(t?.variants==null)return vu(e,r?.class,r?.className);const{variants:o,defaultVariants:s}=t,a=Object.keys(o).map(u=>{const d=r?.[u],h=s?.[u];if(d===null)return null;const f=wu(d)||wu(h);return o[u][f]}),c=r&&Object.entries(r).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:h,className:f,...p}=d;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...s,...c}[g]):{...s,...c}[g]===y})?[...u,h,f]:u},[]);return vu(e,a,l,r?.class,r?.className)};var ew=Object.defineProperty,Xa=(e,t)=>ew(e,"name",{value:t,configurable:!0});function ei(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Xa(ei,"setRef");function xu(...e){return t=>{let r=!1;const n=e.map(o=>{const s=ei(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():ei(e[o],null)}}}}Xa(xu,"composeRefs");function je(...e){return x.useCallback(xu(...e),e)}Xa(je,"useComposedRefs");var tw=Object.defineProperty,Ht=(e,t)=>tw(e,"name",{value:t,configurable:!0});function mr(e){const t=x.forwardRef((r,n)=>{let{children:o,...s}=r,a=null,c=!1;const l=[];ti(o)&&typeof as=="function"&&(o=as(o._payload)),x.Children.forEach(o,f=>{if(ku(f)){c=!0;const p=f;let m="child"in p.props?p.props.child:p.props.children;ti(m)&&typeof as=="function"&&(m=as(m._payload)),a=rw(p,m),l.push(a?.props?.children)}else l.push(f)}),a?a=x.cloneElement(a,void 0,l):!c&&x.Children.count(o)===1&&x.isValidElement(o)&&(a=o);const u=a?Eu(a):void 0,d=je(n,u);if(!a){if(o||o===0)throw new Error(c?sw(e):ow(e));return o}const h=Pu(s,a.props??{});return a.type!==x.Fragment&&(h.ref=n?d:u),x.cloneElement(a,h)});return t.displayName=`${e}.Slot`,t}Ht(mr,"createSlot");var ss=mr("Slot"),Su=Symbol.for("radix.slottable");function Cu(e){const t=Ht(r=>"child"in r?r.children(r.child):r.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Su,t}Ht(Cu,"createSlottable");var rw=Ht((e,t)=>{if("child"in e.props){const r=e.props.child;return x.isValidElement(r)?x.cloneElement(r,void 0,e.props.children(r.props.children)):null}return x.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function Pu(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...c)=>{const l=s(...c);return o(...c),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}Ht(Pu,"mergeProps");function Eu(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}Ht(Eu,"getElementRef");function ku(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Su}Ht(ku,"isSlottable");var nw=Symbol.for("react.lazy");function ti(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===nw&&"_payload"in e&&Au(e._payload)}Ht(ti,"isLazyComponent");function Au(e){return typeof e=="object"&&e!==null&&"then"in e}Ht(Au,"isPromiseLike");var ow=Ht(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),sw=Ht(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),as=x[" use ".trim().toString()],aw=Object.defineProperty,iw=(e,t)=>aw(e,"name",{value:t,configurable:!0}),cw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],He=cw.reduce((e,t)=>{const r=mr(`Primitive.${t}`),n=x.forwardRef((o,s)=>{const{asChild:a,...c}=o,l=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(l,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ri(e,t){e&&Ba.flushSync(()=>e.dispatchEvent(t))}iw(ri,"dispatchDiscreteCustomEvent");var lw=Object.defineProperty,uw=(e,t)=>lw(e,"name",{value:t,configurable:!0}),dw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fw=x.forwardRef(uw(function(t,r){return i.jsx(He.span,{...t,ref:r,style:{...dw,...t.style}})},"VisuallyHidden")),hw=fw,pw=Object.defineProperty,Ut=(e,t)=>pw(e,"name",{value:t,configurable:!0});function mw(e,t){const r=x.createContext(t);r.displayName=e+"Context";const n=Ut(s=>{const{children:a,...c}=s,l=x.useMemo(()=>c,Object.values(c));return i.jsx(r.Provider,{value:l,children:a})},"Provider");n.displayName=e+"Provider";function o(s,a={}){const{optional:c=!1}=a,l=x.useContext(r);if(l)return l;if(t!==void 0)return t;if(!c)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Ut(o,"useContext"),[n,o]}Ut(mw,"createContext");function Xt(e,t=[]){let r=[];function n(s,a){const c=x.createContext(a);c.displayName=s+"Context";const l=r.length;r=[...r,a];const u=Ut(h=>{const{scope:f,children:p,...m}=h,g=f?.[e]?.[l]||c,y=x.useMemo(()=>m,Object.values(m));return i.jsx(g.Provider,{value:y,children:p})},"Provider");u.displayName=s+"Provider";function d(h,f,p={}){const{optional:m=!1}=p,g=f?.[e]?.[l]||c,y=x.useContext(g);if(y)return y;if(a!==void 0)return a;if(!m)throw new Error(`\`${h}\` must be used within \`${s}\``)}return Ut(d,"useContext"),[u,d]}Ut(n,"createContext");const o=Ut(()=>{const s=r.map(a=>x.createContext(a));return Ut(function(c){const l=c?.[e]||s;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])},"useScope")},"createScope");return o.scopeName=e,[n,Ou(o,...t)]}Ut(Xt,"createContextScope");function Ou(...e){const t=e[0];if(e.length===1)return t;const r=Ut(()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return Ut(function(s){const a=n.reduce((c,{useScope:l,scopeName:u})=>{const h=l(s)[`__scope${u}`];return{...c,...h}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return r.scopeName=t.scopeName,r}Ut(Ou,"composeContextScopes");var gw=Object.defineProperty,tt=(e,t)=>gw(e,"name",{value:t,configurable:!0});function ni(e){const t=e+"CollectionProvider",[r,n]=Xt(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=tt(g=>{const{scope:y,children:b}=g,w=x.useRef(null),_=x.useRef(new Map).current;return i.jsx(o,{scope:y,itemMap:_,collectionRef:w,children:b})},"CollectionProvider");a.displayName=t;const c=e+"CollectionSlot",l=mr(c),u=x.forwardRef((g,y)=>{const{scope:b,children:w}=g,_=s(c,b),P=je(y,_.collectionRef);return i.jsx(l,{ref:P,children:w})});u.displayName=c;const d=e+"CollectionItemSlot",h="data-radix-collection-item",f=mr(d),p=x.forwardRef((g,y)=>{const{scope:b,children:w,..._}=g,P=x.useRef(null),E=je(y,P),S=s(d,b);return x.useEffect(()=>(S.itemMap.set(P,{ref:P,..._}),()=>{S.itemMap.delete(P)})),i.jsx(f,{[h]:"",ref:E,children:w})});p.displayName=d;function m(g){const y=s(e+"CollectionConsumer",g);return x.useCallback(()=>{const w=y.collectionRef.current;if(!w)return[];const _=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((S,O)=>_.indexOf(S.ref.current)-_.indexOf(O.ref.current))},[y.collectionRef,y.itemMap])}return tt(m,"useCollection"),[{Provider:a,Slot:u,ItemSlot:p},m,n]}tt(ni,"createCollection");var Tu=new WeakMap,oi=($t=class extends Map{constructor(r){super(r);dy(this,Ge);Kl(this,Ge,[...super.keys()]),Tu.set(this,!0)}set(r,n){return Tu.get(this)&&(this.has(r)?bt(this,Ge)[bt(this,Ge).indexOf(r)]=r:bt(this,Ge).push(r)),super.set(r,n),this}insert(r,n,o){const s=this.has(n),a=bt(this,Ge).length,c=si(r);let l=c>=0?c:a+c;const u=l<0||l>=a?-1:l;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(n,o),this;const d=this.size+(s?0:1);c<0&&l++;const h=[...bt(this,Ge)];let f,p=!1;for(let m=l;m<d;m++)if(l===m){let g=h[m];h[m]===n&&(g=h[m+1]),s&&this.delete(n),f=this.get(g),this.set(n,o)}else{!p&&h[m-1]===n&&(p=!0);const g=h[p?m:m-1],y=f;f=this.get(g),this.delete(g),this.set(g,y)}return this}with(r,n,o){const s=new $t(this);return s.insert(r,n,o),s}before(r){const n=bt(this,Ge).indexOf(r)-1;if(!(n<0))return this.entryAt(n)}setBefore(r,n,o){const s=bt(this,Ge).indexOf(r);return s===-1?this:this.insert(s,n,o)}after(r){let n=bt(this,Ge).indexOf(r);if(n=n===-1||n===this.size-1?-1:n+1,n!==-1)return this.entryAt(n)}setAfter(r,n,o){const s=bt(this,Ge).indexOf(r);return s===-1?this:this.insert(s+1,n,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Kl(this,Ge,[]),super.clear()}delete(r){const n=super.delete(r);return n&&bt(this,Ge).splice(bt(this,Ge).indexOf(r),1),n}deleteAt(r){const n=this.keyAt(r);return n!==void 0?this.delete(n):!1}at(r){const n=is(bt(this,Ge),r);if(n!==void 0)return this.get(n)}entryAt(r){const n=is(bt(this,Ge),r);if(n!==void 0)return[n,this.get(n)]}indexOf(r){return bt(this,Ge).indexOf(r)}keyAt(r){return is(bt(this,Ge),r)}from(r,n){const o=this.indexOf(r);if(o===-1)return;let s=o+n;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(r,n){const o=this.indexOf(r);if(o===-1)return;let s=o+n;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(r,n){let o=0;for(const s of this){if(Reflect.apply(r,n,[s,o,this]))return s;o++}}findIndex(r,n){let o=0;for(const s of this){if(Reflect.apply(r,n,[s,o,this]))return o;o++}return-1}filter(r,n){const o=[];let s=0;for(const a of this)Reflect.apply(r,n,[a,s,this])&&o.push(a),s++;return new $t(o)}map(r,n){const o=[];let s=0;for(const a of this)o.push([a[0],Reflect.apply(r,n,[a,s,this])]),s++;return new $t(o)}reduce(...r){const[n,o]=r;let s=0,a=o??this.at(0);for(const c of this)s===0&&r.length===1?a=c:a=Reflect.apply(n,this,[a,c,s,this]),s++;return a}reduceRight(...r){const[n,o]=r;let s=o??this.at(-1);for(let a=this.size-1;a>=0;a--){const c=this.at(a);a===this.size-1&&r.length===1?s=c:s=Reflect.apply(n,this,[s,c,a,this])}return s}toSorted(r){const n=[...this.entries()].sort(r);return new $t(n)}toReversed(){const r=new $t;for(let n=this.size-1;n>=0;n--){const o=this.keyAt(n),s=this.get(o);r.set(o,s)}return r}toSpliced(...r){const n=[...this.entries()];return n.splice(...r),new $t(n)}slice(r,n){const o=new $t;let s=this.size-1;if(r===void 0)return o;r<0&&(r=r+this.size),n!==void 0&&n>0&&(s=n-1);for(let a=r;a<=s;a++){const c=this.keyAt(a),l=this.get(c);o.set(c,l)}return o}every(r,n){let o=0;for(const s of this){if(!Reflect.apply(r,n,[s,o,this]))return!1;o++}return!0}some(r,n){let o=0;for(const s of this){if(Reflect.apply(r,n,[s,o,this]))return!0;o++}return!1}},Ge=new WeakMap,tt($t,"OrderedDict"),$t);function is(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const r=Nu(e,t);return r===-1?void 0:e[r]}tt(is,"at");function Nu(e,t){const r=e.length,n=si(t),o=n>=0?n:r+n;return o<0||o>=r?-1:o}tt(Nu,"toSafeIndex");function si(e){return e!==e||e===0?0:Math.trunc(e)}tt(si,"toSafeInteger");function bw(e){const t=e+"CollectionProvider",[r,n]=Xt(t),[o,s]=r(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new oi,setItemMap:tt(()=>{},"setItemMap")}),a=tt(({state:_,...P})=>_?i.jsx(l,{...P,state:_}):i.jsx(c,{...P}),"CollectionProvider");a.displayName=t;const c=tt(_=>{const P=y();return i.jsx(l,{..._,state:P})},"CollectionInit");c.displayName=t+"Init";const l=tt(_=>{const{scope:P,children:E,state:S}=_,O=x.useRef(null),[N,k]=x.useState(null),I=je(O,k),[j,q]=S;return x.useEffect(()=>{if(!N)return;const M=Iu(()=>{});return M.observe(N,{childList:!0,subtree:!0}),()=>{M.disconnect()}},[N]),i.jsx(o,{scope:P,itemMap:j,setItemMap:q,collectionRef:I,collectionRefObject:O,collectionElement:N,children:E})},"CollectionProviderImpl");l.displayName=t+"Impl";const u=e+"CollectionSlot",d=mr(u),h=x.forwardRef((_,P)=>{const{scope:E,children:S}=_,O=s(u,E),N=je(P,O.collectionRef);return i.jsx(d,{ref:N,children:S})});h.displayName=u;const f=e+"CollectionItemSlot",p="data-radix-collection-item",m=mr(f),g=x.forwardRef((_,P)=>{const{scope:E,children:S,...O}=_,N=x.useRef(null),[k,I]=x.useState(null),j=je(P,N,I),q=s(f,E),{setItemMap:M}=q,$=x.useRef(O);Lu($.current,O)||($.current=O);const H=$.current;return x.useEffect(()=>{const V=H;return M(R=>k?R.has(k)?R.set(k,{...V,element:k}).toSorted(ai):(R.set(k,{...V,element:k}),R.toSorted(ai)):R),()=>{M(R=>!k||!R.has(k)?R:(R.delete(k),new oi(R)))}},[k,H,M]),i.jsx(m,{[p]:"",ref:j,children:S})});g.displayName=f;function y(){return x.useState(new oi)}tt(y,"useInitCollection");function b(_){const{itemMap:P}=s(e+"CollectionConsumer",_);return P}return tt(b,"useCollection"),[{Provider:a,Slot:h,ItemSlot:g},{createCollectionScope:n,useCollection:b,useInitCollection:y}]}tt(bw,"createCollection");function Lu(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const o of r)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}tt(Lu,"shallowEqual");function Mu(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}tt(Mu,"isElementPreceding");function ai(e,t){return!e[1].element||!t[1].element?0:Mu(e[1].element,t[1].element)?-1:1}tt(ai,"sortByDocumentPosition");function Iu(e){return new MutationObserver(r=>{for(const n of r)if(n.type==="childList"){e();return}})}tt(Iu,"getChildListObserver");var yw=Object.defineProperty,On=(e,t)=>yw(e,"name",{value:t,configurable:!0}),Fu=!!(typeof window<"u"&&window.document&&window.document.createElement);function xe(e,t,{checkForDefaultPrevented:r=!0}={}){return On(function(o){if(e?.(o),r===!1||!o||!o.defaultPrevented)return t?.(o)},"handleEvent")}On(xe,"composeEventHandlers");function ww(e){if(!Fu)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}On(ww,"getOwnerWindow");function ii(e){if(!Fu)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}On(ii,"getOwnerDocument");function Du(e,t=!1){const{activeElement:r}=ii(e);if(!r?.nodeName)return null;if($u(r)&&r.contentDocument)return Du(r.contentDocument.body,t);if(t){const n=r.getAttribute("aria-activedescendant");if(n){const o=ii(r).getElementById(n);if(o)return o}}return r}On(Du,"getActiveElement");function $u(e){return e.tagName==="IFRAME"}On($u,"isFrame");var wt=globalThis?.document?x.useLayoutEffect:()=>{},vw=Object.defineProperty,_w=(e,t)=>vw(e,"name",{value:t,configurable:!0}),zu=x[" useEffectEvent ".trim().toString()],Uu=x[" useInsertionEffect ".trim().toString()];function ju(e){if(typeof zu=="function")return zu(e);const t=x.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Uu=="function"?Uu(()=>{t.current=e}):wt(()=>{t.current=e}),x.useMemo(()=>((...r)=>t.current?.(...r)),[])}_w(ju,"useEffectEvent");var xw=Object.defineProperty,mo=(e,t)=>xw(e,"name",{value:t,configurable:!0}),Sw=x[" useInsertionEffect ".trim().toString()]||wt;function Tn({prop:e,defaultProp:t,onChange:r=mo(()=>{},"onChange"),caller:n}){const[o,s,a]=Bu({defaultProp:t,onChange:r}),c=e!==void 0,l=c?e:o,u=x.useCallback(d=>{if(c){const h=Vu(d)?d(e):d;h!==e&&a.current?.(h)}else s(d)},[c,e,s,a]);return[l,u]}mo(Tn,"useControllableState");function Bu({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),o=x.useRef(r),s=x.useRef(t);return Sw(()=>{s.current=t},[t]),x.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,n,s]}mo(Bu,"useUncontrolledState");function Vu(e){return typeof e=="function"}mo(Vu,"isFunction");var qu=Symbol("RADIX:SYNC_STATE");function Cw(e,t,r,n){const{prop:o,defaultProp:s,onChange:a,caller:c}=t,l=o!==void 0,u=ju(a),d=[{...r,state:s}];n&&d.push(n);const[h,f]=x.useReducer((y,b)=>{if(b.type===qu)return{...y,state:b.state};const w=e(y,b);return l&&!Object.is(w.state,y.state)&&u(w.state),w},...d),p=h.state,m=x.useRef(p);x.useEffect(()=>{m.current!==p&&(m.current=p,l||u(p))},[p,m,l]);const g=x.useMemo(()=>o!==void 0?{...h,state:o}:h,[h,o]);return x.useEffect(()=>{l&&!Object.is(o,h.state)&&f({type:qu,state:o})},[o,h.state,l]),[g,f]}mo(Cw,"useControllableStateReducer");var Pw=Object.defineProperty,gr=(e,t)=>Pw(e,"name",{value:t,configurable:!0});function Hu(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}gr(Hu,"useStateMachine");var Tr=gr(e=>{const{present:t,children:r}=e,n=Wu(t),o=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),s=Zu(n.ref,Ru(o));return typeof r=="function"||n.isPresent?x.cloneElement(o,{ref:s}):null},"Presence");function Wu(e){const[t,r]=x.useState(),n=x.useRef(null),o=x.useRef(e),s=x.useRef("none"),a=x.useRef(void 0),c=e?"mounted":"unmounted",[l,u]=Hu(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{l==="mounted"?(s.current=a.current??Nn(n.current),a.current=void 0):s.current="none"},[l]),wt(()=>{const d=n.current,h=o.current;if(h!==e){const p=s.current,m=Nn(d);e?(a.current=m,u("MOUNT")):m==="none"||d?.display==="none"?u("UNMOUNT"):u(h&&p!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),wt(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,f=gr(m=>{const y=Nn(n.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(u("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},"handleAnimationEnd"),p=gr(m=>{m.target===t&&(s.current=Nn(n.current))},"handleAnimationStart");return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(d=>{if(d){const h=getComputedStyle(d);n.current=h,a.current=Nn(h)}else n.current=null;r(d)},[])}}gr(Wu,"usePresence");function ci(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}gr(ci,"setRef");function Zu(...e){const t=x.useRef(e);return t.current=e,x.useCallback(r=>{const n=t.current;let o=!1;const s=n.map(a=>{const c=ci(a,r);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let a=0;a<s.length;a++){const c=s[a];typeof c=="function"?c():ci(n[a],null)}}},[])}gr(Zu,"useStableComposedRefs");function Nn(e){return e?.animationName||"none"}gr(Nn,"getAnimationName");function Ru(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}gr(Ru,"getElementRef");var Ew=Object.defineProperty,kw=(e,t)=>Ew(e,"name",{value:t,configurable:!0}),Aw=x[" useId ".trim().toString()]||(()=>{}),Ow=0;function br(e){const[t,r]=x.useState(Aw());return wt(()=>{e||r(n=>n??String(Ow++))},[e]),e||(t?`radix-${t}`:"")}kw(br,"useId");var Tw=Object.defineProperty,go=(e,t)=>Tw(e,"name",{value:t,configurable:!0}),li="Collapsible",[Nw,$4]=Xt(li),[Lw,ui]=Nw(li),Mw=x.forwardRef(go(function(t,r){const{__scopeCollapsible:n,open:o,defaultOpen:s,disabled:a,onOpenChange:c,...l}=t,[u,d]=Tn({prop:o,defaultProp:s??!1,onChange:c,caller:li});return i.jsx(Lw,{scope:n,disabled:a,contentId:br(),open:u,onOpenToggle:x.useCallback(()=>d(h=>!h),[d]),children:i.jsx(He.div,{"data-state":cs(u),"data-disabled":a?"":void 0,...l,ref:r})})},"Collapsible")),Iw="CollapsibleTrigger",Fw=x.forwardRef(go(function(t,r){const{__scopeCollapsible:n,...o}=t,s=ui(Iw,n);return i.jsx(He.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":cs(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...o,ref:r,onClick:xe(t.onClick,s.onOpenToggle)})},"CollapsibleTrigger")),Gu="CollapsibleContent",Dw=x.forwardRef(go(function(t,r){const{forceMount:n,...o}=t,s=ui(Gu,t.__scopeCollapsible);return i.jsx(Tr,{present:n||s.open,children:({present:a})=>i.jsx($w,{...o,ref:r,present:a})})},"CollapsibleContent")),$w=x.forwardRef(go(function(t,r){const{__scopeCollapsible:n,present:o,children:s,...a}=t,c=ui(Gu,n),[l,u]=x.useState(o),d=x.useRef(null),h=je(r,d),f=x.useRef(0),p=f.current,m=x.useRef(0),g=m.current,y=c.open||l,b=x.useRef(y),w=x.useRef(void 0);return x.useEffect(()=>{const _=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(_)},[]),wt(()=>{const _=d.current;if(_){w.current=w.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const P=_.getBoundingClientRect();f.current=P.height,m.current=P.width,b.current||(_.style.transitionDuration=w.current.transitionDuration,_.style.animationName=w.current.animationName),u(o)}},[c.open,o]),i.jsx(He.div,{"data-state":cs(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!y,...a,ref:h,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:y&&s})},"CollapsibleContentImpl"));function cs(e){return e?"open":"closed"}go(cs,"getState");var zw=Mw,Uw=Object.defineProperty,jw=(e,t)=>Uw(e,"name",{value:t,configurable:!0}),Bw=x.createContext(void 0);function di(e){const t=x.useContext(Bw);return e||t||"ltr"}jw(di,"useDirection");var Vw=Object.defineProperty,qw=(e,t)=>Vw(e,"name",{value:t,configurable:!0});function yr(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>((...r)=>t.current?.(...r)),[])}qw(yr,"useCallbackRef");var Hw=Object.defineProperty,rt=(e,t)=>Hw(e,"name",{value:t,configurable:!0}),fi="dismissableLayer.update",Ww="dismissableLayer.pointerDownOutside",Zw="dismissableLayer.focusOutside",Ku,Yu=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),hi=x.forwardRef(rt(function(t,r){const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:l,onDismiss:u,...d}=t,h=x.useContext(Yu),[f,p]=x.useState(null),m=f?.ownerDocument??globalThis?.document,[,g]=x.useState({}),y=je(r,p),b=Array.from(h.layers),[w]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),_=w?b.indexOf(w):-1,P=f?b.indexOf(f):-1,E=h.layersWithOutsidePointerEventsDisabled.size>0,S=P>=_,O=x.useRef(!1),N=Ju(q=>{a?.(q),l?.(q),q.defaultPrevented||u?.()},{ownerDocument:m,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:x.useCallback(q=>{if(!(q instanceof Node))return!1;const M=[...h.branches].some($=>$.contains(q));return S&&!M},[h.branches,S])}),k=Xu(q=>{if(o&&O.current)return;const M=q.target;[...h.branches].some(H=>H.contains(M))||(c?.(q),l?.(q),q.defaultPrevented||u?.())},m),I=f?P===b.length-1:!1,j=yr(q=>{q.key==="Escape"&&(s?.(q),!q.defaultPrevented&&u&&(q.preventDefault(),u()))});return x.useEffect(()=>{if(I)return m.addEventListener("keydown",j,{capture:!0}),()=>m.removeEventListener("keydown",j,{capture:!0})},[m,I,j]),x.useEffect(()=>{if(f)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Ku=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(f)),h.layers.add(f),pi(),()=>{n&&(h.layersWithOutsidePointerEventsDisabled.delete(f),h.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Ku))}},[f,m,n,h]),x.useEffect(()=>()=>{f&&(h.layers.delete(f),h.layersWithOutsidePointerEventsDisabled.delete(f),pi())},[f,h]),x.useEffect(()=>{const q=rt(()=>g({}),"handleUpdate");return document.addEventListener(fi,q),()=>document.removeEventListener(fi,q)},[]),i.jsx(He.div,{...d,ref:y,style:{pointerEvents:E?S?"auto":"none":void 0,...t.style},onFocusCapture:xe(t.onFocusCapture,k.onFocusCapture),onBlurCapture:xe(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:xe(t.onPointerDownCapture,N.onPointerDownCapture)})},"DismissableLayer"));function Qu(){const e=x.useContext(Yu),[t,r]=x.useState(null);return x.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}rt(Qu,"useDismissableLayerSurface");var Rw=rt(()=>!0,"IS_TRUE");function Ju(e,t){const{ownerDocument:r=globalThis?.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:a=Rw}=t,c=yr(e),l=x.useRef(!1),u=x.useRef(!1),d=x.useRef(new Map),h=x.useRef(()=>{});return x.useEffect(()=>{function f(){u.current=!1,o.current=!1,d.current.clear()}rt(f,"resetOutsideInteraction");function p(){return Array.from(d.current.values()).some(Boolean)}rt(p,"isOutsideInteractionIntercepted");function m(_){if(!u.current)return;const P=_.target;P instanceof Node&&[...s].some(S=>S.contains(P))||d.current.set(_.type,!0),_.type==="click"&&window.setTimeout(()=>{u.current&&h.current()},0)}rt(m,"handleInteractionCapture");function g(_){u.current&&d.current.set(_.type,!1)}rt(g,"handleInteractionBubble");const y=rt(_=>{if(_.target&&!l.current){let P=function(){r.removeEventListener("click",h.current);const S=p();f(),S||mi(Ww,c,E,{discrete:!0})};if(rt(P,"handleAndDispatchPointerDownOutsideEvent"),!a(_.target)){r.removeEventListener("click",h.current),f(),l.current=!1;return}const E={originalEvent:_};u.current=!0,o.current=n&&_.button===0,d.current.clear(),!n||_.button!==0?P():(r.removeEventListener("click",h.current),h.current=P,r.addEventListener("click",h.current,{once:!0}))}else r.removeEventListener("click",h.current),f();l.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const _ of b)r.addEventListener(_,m,!0),r.addEventListener(_,g);const w=window.setTimeout(()=>{r.addEventListener("pointerdown",y)},0);return()=>{window.clearTimeout(w),r.removeEventListener("pointerdown",y),r.removeEventListener("click",h.current);for(const _ of b)r.removeEventListener(_,m,!0),r.removeEventListener(_,g)}},[r,c,n,o,s,a]),{onPointerDownCapture:rt(()=>l.current=!0,"onPointerDownCapture")}}rt(Ju,"usePointerDownOutside");function Xu(e,t=globalThis?.document){const r=yr(e),n=x.useRef(!1);return x.useEffect(()=>{const o=rt(s=>{s.target&&!n.current&&mi(Zw,r,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:rt(()=>n.current=!0,"onFocusCapture"),onBlurCapture:rt(()=>n.current=!1,"onBlurCapture")}}rt(Xu,"useFocusOutside");function pi(){const e=new CustomEvent(fi);document.dispatchEvent(e)}rt(pi,"dispatchUpdate");function mi(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?ri(o,s):o.dispatchEvent(s)}rt(mi,"handleAndDispatchCustomEvent");var Gw=Object.defineProperty,vt=(e,t)=>Gw(e,"name",{value:t,configurable:!0}),gi="focusScope.autoFocusOnMount",bi="focusScope.autoFocusOnUnmount",ed={bubbles:!1,cancelable:!0},td=x.forwardRef(vt(function(t,r){const{loop:n=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...c}=t,[l,u]=x.useState(null),d=yr(s),h=yr(a),f=x.useRef(null),p=je(r,u),m=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(o){let y=function(P){if(m.paused||!l)return;const E=P.target;l.contains(E)?f.current=E:wr(f.current,{select:!0})},b=function(P){if(m.paused||!l)return;const E=P.relatedTarget;E!==null&&(l.contains(E)||wr(f.current,{select:!0}))},w=function(P){if(document.activeElement===document.body)for(const S of P)S.removedNodes.length>0&&wr(l)};vt(y,"handleFocusIn"),vt(b,"handleFocusOut"),vt(w,"handleMutations"),document.addEventListener("focusin",y),document.addEventListener("focusout",b);const _=new MutationObserver(w);return l&&_.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b),_.disconnect()}}},[o,l,m.paused]),x.useEffect(()=>{if(l){ad.add(m);const y=document.activeElement;if(!l.contains(y)){const w=new CustomEvent(gi,ed);l.addEventListener(gi,d),l.dispatchEvent(w),w.defaultPrevented||(rd(cd(yi(l)),{select:!0}),document.activeElement===y&&wr(l))}return()=>{l.removeEventListener(gi,d),setTimeout(()=>{const w=new CustomEvent(bi,ed);l.addEventListener(bi,h),l.dispatchEvent(w),w.defaultPrevented||wr(y??document.body,{select:!0}),l.removeEventListener(bi,h),ad.remove(m)},0)}}},[l,d,h,m]);const g=x.useCallback(y=>{if(!n&&!o||m.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(b&&w){const _=y.currentTarget,[P,E]=nd(_);P&&E?!y.shiftKey&&w===E?(y.preventDefault(),n&&wr(P,{select:!0})):y.shiftKey&&w===P&&(y.preventDefault(),n&&wr(E,{select:!0})):w===_&&y.preventDefault()}},[n,o,m.paused]);return i.jsx(He.div,{tabIndex:-1,...c,ref:p,onKeyDown:g})},"FocusScope"));function rd(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(wr(n,{select:t}),document.activeElement!==r)return}vt(rd,"focusFirst");function nd(e){const t=yi(e),r=wi(t,e),n=wi(t.reverse(),e);return[r,n]}vt(nd,"getTabbableEdges");function yi(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:vt(n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}vt(yi,"getTabbableCandidates");function wi(e,t){const r=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const n of e)if(!(r?!n.checkVisibility({checkVisibilityCSS:!0}):od(n,{upTo:t})))return n}vt(wi,"findVisible");function od(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}vt(od,"isHidden");function sd(e){return e instanceof HTMLInputElement&&"select"in e}vt(sd,"isSelectableInput");function wr(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&sd(e)&&t&&e.select()}}vt(wr,"focus");var ad=id();function id(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=vi(e,t),e.unshift(t)},remove(t){e=vi(e,t),e[0]?.resume()}}}vt(id,"createFocusScopesStack");function vi(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}vt(vi,"arrayRemove");function cd(e){return e.filter(t=>t.tagName!=="A")}vt(cd,"removeLinks");var Kw=Object.defineProperty,Yw=(e,t)=>Kw(e,"name",{value:t,configurable:!0}),_i=x.forwardRef(Yw(function(t,r){const{container:n,...o}=t,[s,a]=x.useState(!1);wt(()=>a(!0),[]);const c=n||s&&globalThis?.document?.body;return c?Ba.createPortal(i.jsx(He.div,{...o,ref:r}),c):null},"Portal")),Qw=Object.defineProperty,xi=(e,t)=>Qw(e,"name",{value:t,configurable:!0}),ls=0,Ln=null;function Jw(e){return us(),e.children}xi(Jw,"FocusGuards");function us(){x.useEffect(()=>{Ln||(Ln={start:Si(),end:Si()});const{start:e,end:t}=Ln;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ls++,()=>{ls===1&&(Ln?.start.remove(),Ln?.end.remove(),Ln=null),ls=Math.max(0,ls-1)}},[])}xi(us,"useFocusGuards");function Si(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}xi(Si,"createFocusGuard");var er=function(){return er=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},er.apply(this,arguments)};function ld(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Xw(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,s;n<o;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var ds="right-scroll-bar-position",fs="width-before-scroll-bar",e0="with-scroll-bars-hidden",t0="--removed-body-scroll-bar-size";function Ci(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function r0(e,t){var r=v.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var n0=typeof window<"u"?x.useLayoutEffect:x.useEffect,ud=new WeakMap;function o0(e,t){var r=r0(null,function(n){return e.forEach(function(o){return Ci(o,n)})});return n0(function(){var n=ud.get(r);if(n){var o=new Set(n),s=new Set(e),a=r.current;o.forEach(function(c){s.has(c)||Ci(c,null)}),s.forEach(function(c){o.has(c)||Ci(c,a)})}ud.set(r,e)},[e]),r}function s0(e){return e}function a0(e,t){t===void 0&&(t=s0);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var a=t(s,n);return r.push(a),function(){r=r.filter(function(c){return c!==a})}},assignSyncMedium:function(s){for(n=!0;r.length;){var a=r;r=[],a.forEach(s)}r={push:function(c){return s(c)},filter:function(){return r}}},assignMedium:function(s){n=!0;var a=[];if(r.length){var c=r;r=[],c.forEach(s),a=r}var l=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),r={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),r}}}};return o}function i0(e){e===void 0&&(e={});var t=a0(null);return t.options=er({async:!0,ssr:!1},e),t}var dd=function(e){var t=e.sideCar,r=ld(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,er({},r))};dd.isSideCarExport=!0;function c0(e,t){return e.useMedium(t),dd}var fd=i0(),Pi=function(){},hs=x.forwardRef(function(e,t){var r=x.useRef(null),n=x.useState({onScrollCapture:Pi,onWheelCapture:Pi,onTouchMoveCapture:Pi}),o=n[0],s=n[1],a=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,b=e.as,w=b===void 0?"div":b,_=e.gapMode,P=ld(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,S=o0([r,t]),O=er(er({},P),o);return x.createElement(x.Fragment,null,d&&x.createElement(E,{sideCar:fd,removeScrollBar:u,shards:h,noRelative:p,noIsolation:m,inert:g,setCallbacks:s,allowPinchZoom:!!y,lockRef:r,gapMode:_}),a?x.cloneElement(x.Children.only(c),er(er({},O),{ref:S})):x.createElement(w,er({},O,{className:l,ref:S}),c))});hs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},hs.classNames={fullWidth:fs,zeroRight:ds};var l0=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function u0(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=l0();return t&&e.setAttribute("nonce",t),e}function d0(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function f0(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var h0=function(){var e=0,t=null;return{add:function(r){e==0&&(t=u0())&&(d0(t,r),f0(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},p0=function(){var e=h0();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},hd=function(){var e=p0(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},m0={left:0,top:0,right:0,gap:0},Ei=function(e){return parseInt(e||"",10)||0},g0=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ei(r),Ei(n),Ei(o)]},b0=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return m0;var t=g0(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},y0=hd(),Mn="data-scroll-locked",w0=function(e,t,r,n){var o=e.left,s=e.top,a=e.right,c=e.gap;return r===void 0&&(r="margin"),`
|
|
3
|
+
.`.concat(e0,` {
|
|
4
|
+
overflow: hidden `).concat(n,`;
|
|
5
|
+
padding-right: `).concat(c,"px ").concat(n,`;
|
|
6
|
+
}
|
|
7
|
+
body[`).concat(Mn,`] {
|
|
8
|
+
overflow: hidden `).concat(n,`;
|
|
9
|
+
overscroll-behavior: contain;
|
|
10
|
+
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
11
|
+
padding-left: `.concat(o,`px;
|
|
12
|
+
padding-top: `).concat(s,`px;
|
|
13
|
+
padding-right: `).concat(a,`px;
|
|
14
|
+
margin-left:0;
|
|
15
|
+
margin-top:0;
|
|
16
|
+
margin-right: `).concat(c,"px ").concat(n,`;
|
|
17
|
+
`),r==="padding"&&"padding-right: ".concat(c,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.`).concat(ds,` {
|
|
21
|
+
right: `).concat(c,"px ").concat(n,`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.`).concat(fs,` {
|
|
25
|
+
margin-right: `).concat(c,"px ").concat(n,`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.`).concat(ds," .").concat(ds,` {
|
|
29
|
+
right: 0 `).concat(n,`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.`).concat(fs," .").concat(fs,` {
|
|
33
|
+
margin-right: 0 `).concat(n,`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
body[`).concat(Mn,`] {
|
|
37
|
+
`).concat(t0,": ").concat(c,`px;
|
|
38
|
+
}
|
|
39
|
+
`)},pd=function(){var e=parseInt(document.body.getAttribute(Mn)||"0",10);return isFinite(e)?e:0},v0=function(){x.useEffect(function(){return document.body.setAttribute(Mn,(pd()+1).toString()),function(){var e=pd()-1;e<=0?document.body.removeAttribute(Mn):document.body.setAttribute(Mn,e.toString())}},[])},_0=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;v0();var s=x.useMemo(function(){return b0(o)},[o]);return x.createElement(y0,{styles:w0(s,!t,o,r?"":"!important")})},ki=!1;if(typeof window<"u")try{var ps=Object.defineProperty({},"passive",{get:function(){return ki=!0,!0}});window.addEventListener("test",ps,ps),window.removeEventListener("test",ps,ps)}catch{ki=!1}var In=ki?{passive:!1}:!1,x0=function(e){return e.tagName==="TEXTAREA"},md=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!x0(e)&&r[t]==="visible")},S0=function(e){return md(e,"overflowY")},C0=function(e){return md(e,"overflowX")},gd=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=bd(e,n);if(o){var s=yd(e,n),a=s[1],c=s[2];if(a>c)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},P0=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},E0=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},bd=function(e,t){return e==="v"?S0(t):C0(t)},yd=function(e,t){return e==="v"?P0(t):E0(t)},k0=function(e,t){return e==="h"&&t==="rtl"?-1:1},A0=function(e,t,r,n,o){var s=k0(e,window.getComputedStyle(t).direction),a=s*n,c=r.target,l=t.contains(c),u=!1,d=a>0,h=0,f=0;do{if(!c)break;var p=yd(e,c),m=p[0],g=p[1],y=p[2],b=g-y-s*m;(m||b)&&bd(e,c)&&(h+=b,f+=m);var w=c.parentNode;c=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(d&&Math.abs(h)<1||!d&&Math.abs(f)<1)&&(u=!0),u},ms=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wd=function(e){return[e.deltaX,e.deltaY]},vd=function(e){return e&&"current"in e?e.current:e},O0=function(e,t){return e[0]===t[0]&&e[1]===t[1]},T0=function(e){return`
|
|
40
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
41
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
42
|
+
`)},N0=0,Fn=[];function L0(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),o=x.useState(N0++)[0],s=x.useState(hd)[0],a=x.useRef(e);x.useEffect(function(){a.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=Xw([e.lockRef.current],(e.shards||[]).map(vd),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=x.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var b=ms(g),w=r.current,_="deltaX"in g?g.deltaX:w[0]-b[0],P="deltaY"in g?g.deltaY:w[1]-b[1],E,S=g.target,O=Math.abs(_)>Math.abs(P)?"h":"v";if("touches"in g&&O==="h"&&S.type==="range")return!1;var N=window.getSelection(),k=N&&N.anchorNode,I=k?k===S||k.contains(S):!1;if(I)return!1;var j=gd(O,S);if(!j)return!0;if(j?E=O:(E=O==="v"?"h":"v",j=gd(O,S)),!j)return!1;if(!n.current&&"changedTouches"in g&&(_||P)&&(n.current=E),!E)return!0;var q=n.current||E;return A0(q,y,g,q==="h"?_:P)},[]),l=x.useCallback(function(g){var y=g;if(!(!Fn.length||Fn[Fn.length-1]!==s)){var b="deltaY"in y?wd(y):ms(y),w=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&O0(E.delta,b)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var _=(a.current.shards||[]).map(vd).filter(Boolean).filter(function(E){return E.contains(y.target)}),P=_.length>0?c(y,_[0]):!a.current.noIsolation;P&&y.cancelable&&y.preventDefault()}}},[]),u=x.useCallback(function(g,y,b,w){var _={name:g,delta:y,target:b,should:w,shadowParent:M0(b)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(P){return P!==_})},1)},[]),d=x.useCallback(function(g){r.current=ms(g),n.current=void 0},[]),h=x.useCallback(function(g){u(g.type,wd(g),g.target,c(g,e.lockRef.current))},[]),f=x.useCallback(function(g){u(g.type,ms(g),g.target,c(g,e.lockRef.current))},[]);x.useEffect(function(){return Fn.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",l,In),document.addEventListener("touchmove",l,In),document.addEventListener("touchstart",d,In),function(){Fn=Fn.filter(function(g){return g!==s}),document.removeEventListener("wheel",l,In),document.removeEventListener("touchmove",l,In),document.removeEventListener("touchstart",d,In)}},[]);var p=e.removeScrollBar,m=e.inert;return x.createElement(x.Fragment,null,m?x.createElement(s,{styles:T0(o)}):null,p?x.createElement(_0,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function M0(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const I0=c0(fd,L0);var Ai=x.forwardRef(function(e,t){return x.createElement(hs,er({},e,{ref:t,sideCar:I0}))});Ai.classNames=hs.classNames;var F0=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dn=new WeakMap,gs=new WeakMap,bs={},Oi=0,_d=function(e){return e&&(e.host||_d(e.parentNode))},D0=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=_d(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},$0=function(e,t,r,n){var o=D0(t,Array.isArray(e)?e:[e]);bs[r]||(bs[r]=new WeakMap);var s=bs[r],a=[],c=new Set,l=new Set(o),u=function(h){!h||c.has(h)||(c.add(h),u(h.parentNode))};o.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(f){if(c.has(f))d(f);else try{var p=f.getAttribute(n),m=p!==null&&p!=="false",g=(Dn.get(f)||0)+1,y=(s.get(f)||0)+1;Dn.set(f,g),s.set(f,y),a.push(f),g===1&&m&&gs.set(f,!0),y===1&&f.setAttribute(r,"true"),m||f.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),c.clear(),Oi++,function(){a.forEach(function(h){var f=Dn.get(h)-1,p=s.get(h)-1;Dn.set(h,f),s.set(h,p),f||(gs.has(h)||h.removeAttribute(n),gs.delete(h)),p||h.removeAttribute(r)}),Oi--,Oi||(Dn=new WeakMap,Dn=new WeakMap,gs=new WeakMap,bs={})}},xd=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=F0(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),$0(n,o,r,"aria-hidden")):function(){return null}},z0=Object.defineProperty,jt=(e,t)=>z0(e,"name",{value:t,configurable:!0}),Ti="Dialog",[Sd,z4]=Xt(Ti),[U0,tr]=Sd(Ti),Ni=jt(e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,c=x.useRef(null),l=x.useRef(null),[u,d]=Tn({prop:n,defaultProp:o??!1,onChange:s,caller:Ti}),[h,f]=x.useState(0),[p,m]=x.useState(0);return i.jsx(U0,{scope:t,triggerRef:c,contentRef:l,contentId:br(),titleId:br(),descriptionId:br(),titlePresent:h>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:u,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(g=>!g),[d]),modal:a,children:r})},"Dialog"),Cd="DialogPortal",[j0,Pd]=Sd(Cd,{forceMount:void 0}),Li=jt(e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=tr(Cd,t);return i.jsx(j0,{scope:t,forceMount:r,children:x.Children.map(n,a=>i.jsx(Tr,{present:r||s.open,children:i.jsx(_i,{asChild:!0,container:o,children:a})}))})},"DialogPortal"),Mi="DialogOverlay",Ii=x.forwardRef(jt(function(t,r){const n=Pd(Mi,t.__scopeDialog),{forceMount:o=n.forceMount,...s}=t,a=tr(Mi,t.__scopeDialog);return a.modal?i.jsx(Tr,{present:o||a.open,children:i.jsx(V0,{...s,ref:r})}):null},"DialogOverlay")),B0=mr("DialogOverlay.RemoveScroll"),V0=x.forwardRef(jt(function(t,r){const{__scopeDialog:n,...o}=t,s=tr(Mi,n),a=Qu(),c=je(r,a);return i.jsx(Ai,{as:B0,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(He.div,{"data-state":$i(s.open),...o,ref:c,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),bo="DialogContent",Fi=x.forwardRef(jt(function(t,r){const n=Pd(bo,t.__scopeDialog),{forceMount:o=n.forceMount,...s}=t,a=tr(bo,t.__scopeDialog);return i.jsx(Tr,{present:o||a.open,children:a.modal?i.jsx(q0,{...s,ref:r}):i.jsx(H0,{...s,ref:r})})},"DialogContent")),q0=x.forwardRef(jt(function(t,r){const n=tr(bo,t.__scopeDialog),o=x.useRef(null),s=je(r,n.contentRef,o);return x.useEffect(()=>{const a=o.current;if(a)return xd(a)},[]),i.jsx(Ed,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:xe(t.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:xe(t.onPointerDownOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&a.preventDefault()}),onFocusOutside:xe(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),H0=x.forwardRef(jt(function(t,r){const n=tr(bo,t.__scopeDialog),o=x.useRef(!1),s=x.useRef(!1);return i.jsx(Ed,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||n.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=a.target;n.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})},"DialogContentNonModal")),Ed=x.forwardRef(jt(function(t,r){const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...c}=t,l=tr(bo,n);return us(),i.jsx(i.Fragment,{children:i.jsx(td,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(hi,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":$i(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),W0="DialogTitle",Di=x.forwardRef(jt(function(t,r){const{__scopeDialog:n,...o}=t,s=tr(W0,n),{setTitleCount:a}=s;return wt(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),i.jsx(He.h2,{id:s.titleId,...o,ref:r})},"DialogTitle")),Z0="DialogDescription",R0=x.forwardRef(jt(function(t,r){const{__scopeDialog:n,...o}=t,s=tr(Z0,n),{setDescriptionCount:a}=s;return wt(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),i.jsx(He.p,{id:s.descriptionId,...o,ref:r})},"DialogDescription")),G0="DialogClose",K0=x.forwardRef(jt(function(t,r){const{__scopeDialog:n,...o}=t,s=tr(G0,n);return i.jsx(He.button,{type:"button",...o,ref:r,onClick:xe(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function $i(e){return e?"open":"closed"}jt($i,"getState");var Y0=Object.defineProperty,Q0=(e,t)=>Y0(e,"name",{value:t,configurable:!0});function kd(e){const[t,r]=x.useState(void 0);return wt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let a,c;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,c=u.blockSize}else a=e.offsetWidth,c=e.offsetHeight;r({width:a,height:c})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}Q0(kd,"useSize");const J0=["top","right","bottom","left"],Nr=Math.min,vr=Math.max,ys=Math.round,ws=Math.floor,_r=e=>({x:e,y:e}),X0={left:"right",right:"left",bottom:"top",top:"bottom"};function Ad(e,t,r){return vr(e,Nr(t,r))}function xr(e,t){return typeof e=="function"?e(t):e}function Lr(e){return e.split("-")[0]}function $n(e){return e.split("-")[1]}function zi(e){return e==="x"?"y":"x"}function Ui(e){return e==="y"?"height":"width"}function rr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ji(e){return zi(rr(e))}function ev(e,t,r){r===void 0&&(r=!1);const n=$n(e),o=ji(e),s=Ui(o);let a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=vs(a)),[a,vs(a)]}function tv(e){const t=vs(e);return[Bi(e),t,Bi(t)]}function Bi(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Od=["left","right"],Td=["right","left"],rv=["top","bottom"],nv=["bottom","top"];function ov(e,t,r){switch(e){case"top":case"bottom":return r?t?Td:Od:t?Od:Td;case"left":case"right":return t?rv:nv;default:return[]}}function sv(e,t,r,n){const o=$n(e);let s=ov(Lr(e),r==="start",n);return o&&(s=s.map(a=>a+"-"+o),t&&(s=s.concat(s.map(Bi)))),s}function vs(e){const t=Lr(e);return X0[t]+e.slice(t.length)}function av(e){var t,r,n,o;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(n=e.bottom)!=null?n:0,left:(o=e.left)!=null?o:0}}function Nd(e){return typeof e!="number"?av(e):{top:e,right:e,bottom:e,left:e}}function _s(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Ld(e,t,r){let{reference:n,floating:o}=e;const s=rr(t),a=ji(t),c=Ui(a),l=Lr(t),u=s==="y",d=n.x+n.width/2-o.width/2,h=n.y+n.height/2-o.height/2,f=n[c]/2-o[c]/2;let p;switch(l){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:h};break;case"left":p={x:n.x-o.width,y:h};break;default:p={x:n.x,y:n.y}}const m=$n(t);return m&&(p[a]+=f*(m==="end"?1:-1)*(r&&u?-1:1)),p}async function iv(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:a,elements:c,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:p=0}=xr(t,e),m=Nd(p),y=c[f?h==="floating"?"reference":"floating":h],b=_s(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(y)))==null||r?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:u,rootBoundary:d,strategy:l})),w=h==="floating"?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),P=await(s.isElement==null?void 0:s.isElement(_))&&await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1},E=_s(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:_,strategy:l}):w);return{top:(b.top-E.top+m.top)/P.y,bottom:(E.bottom-b.bottom+m.bottom)/P.y,left:(b.left-E.left+m.left)/P.x,right:(E.right-b.right+m.right)/P.x}}const cv=50,lv=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:a}=r,c=a.detectOverflow?a:{...a,detectOverflow:iv},l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=Ld(u,n,l),f=n,p=0;const m={};for(let g=0;g<s.length;g++){const y=s[g];if(!y)continue;const{name:b,fn:w}=y,{x:_,y:P,data:E,reset:S}=await w({x:d,y:h,initialPlacement:n,placement:f,strategy:o,middlewareData:m,rects:u,platform:c,elements:{reference:e,floating:t}});d=_??d,h=P??h,m[b]={...m[b],...E},S&&p<cv&&(p++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(u=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:d,y:h}=Ld(u,f,l)),g=-1)}return{x:d,y:h,placement:f,strategy:o,middlewareData:m}},uv=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:a,elements:c,middlewareData:l}=t,{element:u,padding:d=0}=xr(e,t)||{};if(u==null)return{};const h=Nd(d),f={x:r,y:n},p=ji(o),m=Ui(p),g=await a.getDimensions(u),y=p==="y",b=y?"top":"left",w=y?"bottom":"right",_=y?"clientHeight":"clientWidth",P=s.reference[m]+s.reference[p]-f[p]-s.floating[m],E=f[p]-s.reference[p],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let O=S?S[_]:0;(!O||!await(a.isElement==null?void 0:a.isElement(S)))&&(O=c.floating[_]||s.floating[m]);const N=P/2-E/2,k=O/2-g[m]/2-1,I=Nr(h[b],k),j=Nr(h[w],k),q=O-g[m]-j,M=O/2-g[m]/2+N,$=Ad(I,M,q),H=!l.arrow&&$n(o)!=null&&M!==$&&s.reference[m]/2-(M<I?I:j)-g[m]/2<0,V=H?M<I?M-I:M-q:0;return{[p]:f[p]+V,data:{[p]:$,centerOffset:M-$-V,...H&&{alignmentOffset:V}},reset:H}}}),dv=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:a,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=xr(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const b=Lr(o),w=rr(c),_=Lr(c)===c,P=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=f||(_||!g?[vs(c)]:tv(c)),S=m!=="none";!f&&S&&E.push(...sv(c,g,m,P));const O=[c,...E],N=await l.detectOverflow(t,y),k=[];let I=((n=s.flip)==null?void 0:n.overflows)||[];if(d&&k.push(N[b]),h){const $=ev(o,a,P);k.push(N[$[0]],N[$[1]])}if(I=[...I,{placement:o,overflows:k}],!k.every($=>$<=0)){var j,q;const $=(((j=s.flip)==null?void 0:j.index)||0)+1,H=O[$];if(H&&(!(h==="alignment"?w!==rr(H):!1)||I.every(K=>rr(K.placement)===w?K.overflows[0]>0:!0)))return{data:{index:$,overflows:I},reset:{placement:H}};let V=(q=I.filter(R=>R.overflows[0]<=0).sort((R,K)=>R.overflows[1]-K.overflows[1])[0])==null?void 0:q.placement;if(!V)switch(p){case"bestFit":{var M;const R=(M=I.filter(K=>{if(S){const Y=rr(K.placement);return Y===w||Y==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(Y=>Y>0).reduce((Y,D)=>Y+D,0)]).sort((K,Y)=>K[1]-Y[1])[0])==null?void 0:M[0];R&&(V=R);break}case"initialPlacement":V=c;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function Md(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Id(e){return J0.some(t=>e[t]>=0)}const fv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...s}=xr(e,t);switch(o){case"referenceHidden":{const a=await n.detectOverflow(t,{...s,elementContext:"reference"}),c=Md(a,r.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Id(c)}}}case"escaped":{const a=await n.detectOverflow(t,{...s,altBoundary:!0}),c=Md(a,r.floating);return{data:{escapedOffsets:c,escaped:Id(c)}}}default:return{}}}}},Fd=new Set(["left","top"]);async function hv(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=Lr(r),c=$n(r),l=rr(r)==="y",u=Fd.has(a)?-1:1,d=s&&l?-1:1,h=xr(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof m=="number"&&(p=c==="end"?m*-1:m),l?{x:p*d,y:f*u}:{x:f*u,y:p*d}}const pv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:a,middlewareData:c}=t,l=await hv(t,e);return a===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:a}}}}},mv=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:s}=t,{mainAxis:a=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:_,y:P}=w;return{x:_,y:P}}},...u}=xr(e,t),d={x:r,y:n},h=await s.detectOverflow(t,u),f=rr(o),p=zi(f);let m=d[p],g=d[f];const y=(w,_)=>Ad(_+h[w==="y"?"top":"left"],_,_-h[w==="y"?"bottom":"right"]);a&&(m=y(p,m)),c&&(g=y(f,g));const b=l.fn({...t,[p]:m,[f]:g});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[p]:a,[f]:c}}}}}},gv=function(e){return e===void 0&&(e={}),{options:e,fn(t){var r,n;const{x:o,y:s,placement:a,rects:c,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:h=!0}=xr(e,t),f={x:o,y:s},p=rr(a),m=zi(p);let g=f[m],y=f[p];const b=xr(u,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(r=b.mainAxis)!=null?r:0,crossAxis:(n=b.crossAxis)!=null?n:0};if(d){const E=m==="y"?"height":"width",S=c.reference[m]-c.floating[E]+w.mainAxis,O=c.reference[m]+c.reference[E]-w.mainAxis;g<S?g=S:g>O&&(g=O)}if(h){var _,P;const E=m==="y"?"width":"height",S=Fd.has(Lr(a)),O=c.reference[p]-c.floating[E]+(S&&((_=l.offset)==null?void 0:_[p])||0)+(S?0:w.crossAxis),N=c.reference[p]+c.reference[E]+(S?0:((P=l.offset)==null?void 0:P[p])||0)-(S?w.crossAxis:0);y<O?y=O:y>N&&(y=N)}return{[m]:g,[p]:y}}}},bv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:o,elements:s}=t,{apply:a=()=>{},...c}=xr(e,t),l=await o.detectOverflow(t,c),u=Lr(r),d=$n(r),h=rr(r)==="y",{width:f,height:p}=n.floating;let m,g;u==="top"||u==="bottom"?(m=u,g=d===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(g=u,m=d==="end"?"top":"bottom");const y=p-l.top-l.bottom,b=f-l.left-l.right,w=Nr(p-l[m],y),_=Nr(f-l[g],b),P=t.middlewareData.shift,E=!P;let S=w,O=_;P!=null&&P.enabled.x&&(O=b),P!=null&&P.enabled.y&&(S=y),E&&!d&&(h?O=f-2*vr(l.left,l.right):S=p-2*vr(l.top,l.bottom)),await a({...t,availableWidth:O,availableHeight:S});const N=await o.getDimensions(s.floating);return f!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}};function xs(){return typeof window<"u"}function zn(e){return Dd(e)?(e.nodeName||"").toLowerCase():"#document"}function St(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Sr(e){var t;return(t=(Dd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Dd(e){return xs()?e instanceof Node||e instanceof St(e).Node:!1}function nr(e){return xs()?e instanceof Element||e instanceof St(e).Element:!1}function Mr(e){return xs()?e instanceof HTMLElement||e instanceof St(e).HTMLElement:!1}function $d(e){return!xs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof St(e).ShadowRoot}function Ss(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=or(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&o!=="inline"&&o!=="contents"}function yv(e){return/^(table|td|th)$/.test(zn(e))}function Cs(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const wv=/transform|translate|scale|rotate|perspective|filter/,vv=/paint|layout|strict|content/,tn=e=>!!e&&e!=="none";let Vi;function qi(e){const t=nr(e)?or(e):e;return tn(t.transform)||tn(t.translate)||tn(t.scale)||tn(t.rotate)||tn(t.perspective)||!Hi()&&(tn(t.backdropFilter)||tn(t.filter))||wv.test(t.willChange||"")||vv.test(t.contain||"")}function _v(e){let t=rn(e);for(;Mr(t)&&!yo(t);){if(qi(t))return t;if(Cs(t))return null;t=rn(t)}return null}function Hi(){return Vi==null&&(Vi=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Vi}function yo(e){return/^(html|body|#document)$/.test(zn(e))}function or(e){return St(e).getComputedStyle(e)}function Ps(e){return nr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rn(e){if(zn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$d(e)&&e.host||Sr(e);return $d(t)?t.host:t}function zd(e){const t=rn(e);return yo(t)?(e.ownerDocument||e).body:Mr(t)&&Ss(t)?t:zd(t)}function wo(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=zd(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),a=St(o);if(s){const c=Wi(a);return t.concat(a,a.visualViewport||[],Ss(o)?o:[],c&&r?wo(c):[])}else return t.concat(o,wo(o,[],r))}function Wi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ud(e){const t=or(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Mr(e),s=o?e.offsetWidth:r,a=o?e.offsetHeight:n,c=ys(r)!==s||ys(n)!==a;return c&&(r=s,n=a),{width:r,height:n,$:c}}function Zi(e){return nr(e)?e:e.contextElement}function Un(e){const t=Zi(e);if(!Mr(t))return _r(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=Ud(t);let a=(s?ys(r.width):r.width)/n,c=(s?ys(r.height):r.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const xv=_r(0);function jd(e){const t=St(e);return!Hi()||!t.visualViewport?xv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sv(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===St(e)}function nn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=Zi(e);let a=_r(1);t&&(n?nr(n)&&(a=Un(n)):a=Un(e));const c=Sv(s,r,n)?jd(s):_r(0);let l=(o.left+c.x)/a.x,u=(o.top+c.y)/a.y,d=o.width/a.x,h=o.height/a.y;if(s&&n){const f=St(s),p=nr(n)?St(n):n;let m=f,g=Wi(m);for(;g&&p!==m;){const y=Un(g),b=g.getBoundingClientRect(),w=or(g),_=b.left+(g.clientLeft+parseFloat(w.paddingLeft))*y.x,P=b.top+(g.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,h*=y.y,l+=_,u+=P,m=St(g),g=Wi(m)}}return _s({width:d,height:h,x:l,y:u})}function Es(e,t){const r=Ps(e).scrollLeft;return t?t.left+r:nn(Sr(e)).left+r}function Bd(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Es(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Cv(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",a=Sr(n),c=t?Cs(t.floating):!1;if(n===a||c&&s)return r;let l={scrollLeft:0,scrollTop:0},u=_r(1);const d=_r(0),h=Mr(n);if((h||!s)&&((zn(n)!=="body"||Ss(a))&&(l=Ps(n)),h)){const p=nn(n);u=Un(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const f=a&&!h&&!s?Bd(a,l):_r(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+d.x+f.x,y:r.y*u.y-l.scrollTop*u.y+d.y+f.y}}function Pv(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ev(e){const t=Ps(e),r=e.ownerDocument.body,n=vr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=vr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-t.scrollLeft+Es(e);const a=-t.scrollTop;return or(r).direction==="rtl"&&(s+=vr(e.clientWidth,r.clientWidth)-n),{width:n,height:o,x:s,y:a}}const kv=25;function Av(e,t,r){r===void 0&&(r="viewport");const n=r==="layoutViewport",o=St(e),s=Sr(e),a=o.visualViewport;let c=s.clientWidth,l=s.clientHeight,u=0,d=0;if(a){const f=!Hi()||t==="fixed";n?f||(u=-a.offsetLeft,d=-a.offsetTop):(c=a.width,l=a.height,f&&(u=a.offsetLeft,d=a.offsetTop))}if(Es(s)<=0){const f=s.ownerDocument,p=f.body,m=getComputedStyle(p),g=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(s.clientWidth-p.clientWidth-g),b=getComputedStyle(s).scrollbarGutter==="stable both-edges"?y/2:y;b<=kv&&(c-=b)}return{width:c,height:l,x:u,y:d}}function Ov(e,t){const r=nn(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=Un(e),a=e.clientWidth*s.x,c=e.clientHeight*s.y,l=o*s.x,u=n*s.y;return{width:a,height:c,x:l,y:u}}function Vd(e,t,r){let n;if(t==="viewport"||t==="layoutViewport")n=Av(e,r,t);else if(t==="document")n=Ev(Sr(e));else if(nr(t))n=Ov(t,r);else{const o=jd(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return _s(n)}function Tv(e,t){const r=t.get(e);if(r)return r;let n=wo(e,[],!1).filter(c=>nr(c)&&zn(c)!=="body"),o=null;const s=or(e).position==="fixed";let a=s?rn(e):e;for(;nr(a)&&!yo(a);){const c=or(a),l=qi(a),u=o?o.position:s?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&c.position==="static")?n=n.filter(h=>h!==a):o=c,a=rn(a)}return t.set(e,n),n}function Nv(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[...r==="clippingAncestors"?Cs(t)?[]:Tv(t,this._c):[].concat(r),n],c=Vd(t,a[0],o);let l=c.top,u=c.right,d=c.bottom,h=c.left;for(let f=1;f<a.length;f++){const p=Vd(t,a[f],o);l=vr(p.top,l),u=Nr(p.right,u),d=Nr(p.bottom,d),h=vr(p.left,h)}return{width:u-h,height:d-l,x:h,y:l}}function Lv(e){const{width:t,height:r}=Ud(e);return{width:t,height:r}}function Mv(e,t,r){const n=Mr(t),o=Sr(t),s=r==="fixed",a=nn(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=_r(0);if((n||!s)&&((zn(t)!=="body"||Ss(o))&&(c=Ps(t)),n)){const f=nn(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}!n&&o&&(l.x=Es(o));const u=o&&!n&&!s?Bd(o,c):_r(0),d=a.left+c.scrollLeft-l.x-u.x,h=a.top+c.scrollTop-l.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function Ri(e){return or(e).position==="static"}function qd(e,t){if(!Mr(e)||or(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Sr(e)===r&&(r=r.ownerDocument.body),r}function Hd(e,t){const r=St(e);if(Cs(e))return r;if(!Mr(e)){let o=rn(e);for(;o&&!yo(o);){if(nr(o)&&!Ri(o))return o;o=rn(o)}return r}let n=qd(e,t);for(;n&&yv(n)&&Ri(n);)n=qd(n,t);return n&&yo(n)&&Ri(n)&&!qi(n)?r:n||_v(e)||r}const Iv=async function(e){const t=this.getOffsetParent||Hd,r=this.getDimensions,n=await r(e.floating);return{reference:Mv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Fv(e){return or(e).direction==="rtl"}const Dv={convertOffsetParentRelativeRectToViewportRelativeRect:Cv,getDocumentElement:Sr,getClippingRect:Nv,getOffsetParent:Hd,getElementRects:Iv,getClientRects:Pv,getDimensions:Lv,getScale:Un,isElement:nr,isRTL:Fv};function Wd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $v(e,t,r){let n=null,o;const s=Sr(e);function a(){var d;clearTimeout(o),(d=n)==null||d.disconnect(),n=null}function c(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),a();const f=e.getBoundingClientRect(),{left:p,top:m,width:g,height:y}=f;if(d||t(),!g||!y)return;const b=ws(m),w=ws(s.clientWidth-(p+g)),_=ws(s.clientHeight-(m+y)),P=ws(p),S={rootMargin:-b+"px "+-w+"px "+-_+"px "+-P+"px",threshold:vr(0,Nr(1,h))||1};let O=!0;function N(k){const I=k[0].intersectionRatio;if(!Wd(f,e.getBoundingClientRect()))return c();if(I!==h){if(!O)return c();I?c(!1,I):o=setTimeout(()=>{c(!1,1e-7)},1e3)}O=!1}try{n=new IntersectionObserver(N,{...S,root:s.ownerDocument})}catch{n=new IntersectionObserver(N,S)}n.observe(e)}const l=St(e),u=()=>c(r);return l.addEventListener("resize",u),c(!0),()=>{l.removeEventListener("resize",u),a()}}function zv(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=Zi(e),d=o||s?[...u?wo(u):[],...t?wo(t):[]]:[];d.forEach(b=>{o&&b.addEventListener("scroll",r),s&&b.addEventListener("resize",r)});const h=u&&c?$v(u,r,s):null;let f=-1,p=null;a&&(p=new ResizeObserver(b=>{let[w]=b;w&&w.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var _;(_=p)==null||_.observe(t)})),r()}),u&&!l&&p.observe(u),t&&p.observe(t));let m,g=l?nn(e):null;l&&y();function y(){const b=nn(e);g&&!Wd(g,b)&&r(),g=b,m=requestAnimationFrame(y)}return r(),()=>{var b;d.forEach(w=>{o&&w.removeEventListener("scroll",r),s&&w.removeEventListener("resize",r)}),h?.(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Uv=pv,jv=mv,Bv=dv,Vv=bv,qv=fv,Zd=uv,Hv=gv,Wv=(e,t,r)=>{const n=new Map,o=r??{},s={...Dv,...o.platform,_c:n};return lv(e,t,{...o,platform:s})};var Zv=typeof document<"u",Rv=function(){},ks=Zv?v.useLayoutEffect:Rv;function As(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!As(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!As(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Rd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gd(e,t){const r=Rd(e);return Math.round(t*r)/r}function Gi(e){const t=x.useRef(e);return ks(()=>{t.current=e}),t}function Gv(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,h]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=x.useState(n);As(f,n)||p(n);const[m,g]=x.useState(null),[y,b]=x.useState(null),w=x.useCallback(K=>{K!==S.current&&(S.current=K,g(K))},[]),_=x.useCallback(K=>{K!==O.current&&(O.current=K,b(K))},[]),P=s||m,E=a||y,S=x.useRef(null),O=x.useRef(null),N=x.useRef(d),k=l!=null,I=Gi(l),j=Gi(o),q=Gi(u),M=x.useCallback(()=>{if(!S.current||!O.current)return;const K={placement:t,strategy:r,middleware:f};j.current&&(K.platform=j.current),Wv(S.current,O.current,K).then(Y=>{const D={...Y,isPositioned:q.current!==!1};$.current&&!As(N.current,D)&&(N.current=D,Ba.flushSync(()=>{h(D)}))})},[f,t,r,j,q]);ks(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,h(K=>({...K,isPositioned:!1})))},[u]);const $=x.useRef(!1);ks(()=>($.current=!0,()=>{$.current=!1}),[]),ks(()=>{if(P&&(S.current=P),E&&(O.current=E),P&&E){if(I.current)return I.current(P,E,M);M()}},[P,E,M,I,k]);const H=x.useMemo(()=>({reference:S,floating:O,setReference:w,setFloating:_}),[w,_]),V=x.useMemo(()=>({reference:P,floating:E}),[P,E]),R=x.useMemo(()=>{const K={position:r,left:0,top:0};if(!V.floating)return K;const Y=Gd(V.floating,d.x),D=Gd(V.floating,d.y);return c?{...K,transform:"translate("+Y+"px, "+D+"px)",...Rd(V.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Y,top:D}},[r,c,V.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:M,refs:H,elements:V,floatingStyles:R}),[d,M,H,V,R])}const Kv=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Zd({element:n.current,padding:o}).fn(r):{}:n?Zd({element:n,padding:o}).fn(r):{}}}},Yv=(e,t)=>{const r=Uv(e);return{name:r.name,fn:r.fn,options:[e,t]}},Qv=(e,t)=>{const r=jv(e);return{name:r.name,fn:r.fn,options:[e,t]}},Jv=(e,t)=>({fn:Hv(e).fn,options:[e,t]}),Xv=(e,t)=>{const r=Bv(e);return{name:r.name,fn:r.fn,options:[e,t]}},e1=(e,t)=>{const r=Vv(e);return{name:r.name,fn:r.fn,options:[e,t]}},t1=(e,t)=>{const r=qv(e);return{name:r.name,fn:r.fn,options:[e,t]}},r1=(e,t)=>{const r=Kv(e);return{name:r.name,fn:r.fn,options:[e,t]}};var n1=Object.defineProperty,o1=(e,t)=>n1(e,"name",{value:t,configurable:!0}),s1=x.forwardRef(o1(function(t,r){const{children:n,width:o=10,height:s=5,...a}=t;return i.jsx(He.svg,{...a,ref:r,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),a1=s1,i1=Object.defineProperty,Cr=(e,t)=>i1(e,"name",{value:t,configurable:!0}),Kd="Popper",[Yd,Os]=Xt(Kd),[c1,Qd]=Yd(Kd),l1=Cr(e=>{const{__scopePopper:t,children:r}=e,[n,o]=x.useState(null),[s,a]=x.useState(void 0);return i.jsx(c1,{scope:t,anchor:n,onAnchorChange:o,placementState:s,setPlacementState:a,children:r})},"Popper"),u1="PopperAnchor",d1=x.forwardRef(Cr(function(t,r){const{__scopePopper:n,virtualRef:o,...s}=t,a=Qd(u1,n),c=x.useRef(null),l=a.onAnchorChange,u=x.useCallback(g=>{c.current=g,g&&l(g)},[l]),d=je(r,u),h=x.useRef(null);x.useEffect(()=>{if(!o)return;const g=h.current;h.current=o.current,g!==h.current&&l(h.current)});const f=a.placementState&&Ts(a.placementState),p=f?.[0],m=f?.[1];return o?null:i.jsx(He.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...s,ref:d})},"PopperAnchor")),Jd="PopperContent",[f1,h1]=Yd(Jd),p1=x.forwardRef(Cr(function(t,r){const{__scopePopper:n,side:o="bottom",sideOffset:s=0,align:a="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=t,b=Qd(Jd,n),[w,_]=x.useState(null),P=je(r,_),[E,S]=x.useState(null),O=kd(E),N=O?.width??0,k=O?.height??0,I=o+(a!=="center"?"-"+a:""),j=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},q=Array.isArray(d)?d:[d],M=q.length>0,$={padding:j,boundary:q.filter(Xd),altBoundary:M},{refs:H,floatingStyles:V,placement:R,isPositioned:K,middlewareData:Y}=Gv({strategy:"fixed",placement:I,whileElementsMounted:Cr((...ie)=>zv(...ie,{animationFrame:m==="always"}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[Yv({mainAxis:s+k,alignmentAxis:c}),u&&Qv({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Jv():void 0,...$}),u&&Xv({...$}),e1({...$,apply:Cr(({elements:ie,rects:Ne,availableWidth:Ae,availableHeight:_e})=>{const{width:Se,height:ge}=Ne.reference,Tt=ie.floating.style;Tt.setProperty("--radix-popper-available-width",`${Ae}px`),Tt.setProperty("--radix-popper-available-height",`${_e}px`),Tt.setProperty("--radix-popper-anchor-width",`${Se}px`),Tt.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),E&&r1({element:E,padding:l}),y1({arrowWidth:N,arrowHeight:k}),p&&t1({strategy:"referenceHidden",...$,boundary:M?$.boundary:void 0})]}),D=b.setPlacementState;wt(()=>(D(R),()=>{D(void 0)}),[R,D]);const[ne,T]=Ts(R),F=yr(g);wt(()=>{K&&F?.()},[K,F]);const z=Y.arrow?.x,B=Y.arrow?.y,X=Y.arrow?.centerOffset!==0,[G,te]=x.useState();return wt(()=>{w&&te(window.getComputedStyle(w).zIndex)},[w]),i.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:K?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:i.jsx(f1,{scope:n,placedSide:ne,placedAlign:T,onArrowChange:S,arrowX:z,arrowY:B,shouldHideArrow:X,children:i.jsx(He.div,{"data-side":ne,"data-align":T,...y,ref:P,style:{...y.style,animation:K?y.style?.animation:"none"}})})})},"PopperContent")),m1="PopperArrow",g1={top:"bottom",right:"left",bottom:"top",left:"right"},b1=x.forwardRef(Cr(function(t,r){const{__scopePopper:n,...o}=t,s=h1(m1,n),a=g1[s.placedSide];return i.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:i.jsx(a1,{...o,ref:r,style:{...o.style,display:"block"}})})},"PopperArrow"));function Xd(e){return e!==null}Cr(Xd,"isNotNull");var y1=Cr(e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,d]=Ts(r),h={start:"0%",center:"50%",end:"100%"}[d],f=(o.arrow?.x??0)+c/2,p=(o.arrow?.y??0)+l/2;let m="",g="";return u==="bottom"?(m=a?h:`${f}px`,g=`${-l}px`):u==="top"?(m=a?h:`${f}px`,g=`${n.floating.height+l}px`):u==="right"?(m=`${-l}px`,g=a?h:`${p}px`):u==="left"&&(m=`${n.floating.width+l}px`,g=a?h:`${p}px`),{data:{x:m,y:g}}}}),"transformOrigin");function Ts(e){const[t,r="center"]=e.split("-");return[t,r]}Cr(Ts,"getSideAndAlignFromPlacement");var ef=l1,tf=d1,rf=p1,w1=b1,v1=Object.defineProperty,Ki=(e,t)=>v1(e,"name",{value:t,configurable:!0}),Yi=!1;function nf(){const[e,t]=x.useState(Yi);return x.useEffect(()=>{Yi||(Yi=!0,t(!0))},[]),e}Ki(nf,"useIsHydrated");var of=x[" useSyncExternalStore ".trim().toString()];function sf(){return()=>{}}Ki(sf,"subscribe");function af(){return of(sf,()=>!0,()=>!1)}Ki(af,"useIsHydratedModern");var _1=typeof of=="function"?af:nf,x1=Object.defineProperty,on=(e,t)=>x1(e,"name",{value:t,configurable:!0}),Qi="rovingFocusGroup.onEntryFocus",S1={bubbles:!1,cancelable:!0},Ns="RovingFocusGroup",[Ji,cf,C1]=ni(Ns),[P1,lf]=Xt(Ns,[C1]),[E1,k1]=P1(Ns),A1=x.forwardRef(on(function(t,r){return i.jsx(Ji.Provider,{scope:t.__scopeRovingFocusGroup,children:i.jsx(Ji.Slot,{scope:t.__scopeRovingFocusGroup,children:i.jsx(O1,{...t,ref:r})})})},"RovingFocusGroup")),O1=x.forwardRef(on(function(t,r){const{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:a,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...f}=t,p=x.useRef(null),m=je(r,p),g=di(a),[y,b]=Tn({prop:c,defaultProp:l??null,onChange:u,caller:Ns}),[w,_]=x.useState(!1),P=yr(d),E=cf(n),S=x.useRef(!1),[O,N]=x.useState(0);return x.useEffect(()=>{const k=p.current;if(k)return k.addEventListener(Qi,P),()=>k.removeEventListener(Qi,P)},[P]),i.jsx(E1,{scope:n,orientation:o,dir:g,loop:s,currentTabStopId:y,onItemFocus:x.useCallback(k=>b(k),[b]),onItemShiftTab:x.useCallback(()=>_(!0),[]),onFocusableItemAdd:x.useCallback(()=>N(k=>k+1),[]),onFocusableItemRemove:x.useCallback(()=>N(k=>k-1),[]),children:i.jsx(He.div,{tabIndex:w||O===0?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...t.style},onMouseDown:xe(t.onMouseDown,()=>{S.current=!0}),onFocus:xe(t.onFocus,k=>{const I=!S.current;if(k.target===k.currentTarget&&I&&!w){const j=new CustomEvent(Qi,S1);if(k.currentTarget.dispatchEvent(j),!j.defaultPrevented){const q=E().filter(R=>R.focusable),M=q.find(R=>R.active),$=q.find(R=>R.id===y),V=[M,$,...q].filter(Boolean).map(R=>R.ref.current);Xi(V,h)}}S.current=!1}),onBlur:xe(t.onBlur,()=>_(!1))})})},"RovingFocusGroupImpl")),T1="RovingFocusGroupItem",N1=x.forwardRef(on(function(t,r){const{__scopeRovingFocusGroup:n,focusable:o=!0,active:s=!1,tabStopId:a,children:c,...l}=t,u=br(),d=a||u,h=k1(T1,n),f=h.currentTabStopId===d,p=cf(n),{onFocusableItemAdd:m,onFocusableItemRemove:g,currentTabStopId:y}=h,b=_1();return wt(()=>{if(!(!b||!o))return m(),()=>g()},[b,o,m,g]),x.useEffect(()=>{if(!(b||!o))return m(),()=>g()},[b,o,m,g]),i.jsx(Ji.ItemSlot,{scope:n,id:d,focusable:o,active:s,children:i.jsx(He.span,{tabIndex:f?0:-1,"data-orientation":h.orientation,...l,ref:r,onMouseDown:xe(t.onMouseDown,w=>{o?h.onItemFocus(d):w.preventDefault()}),onFocus:xe(t.onFocus,()=>h.onItemFocus(d)),onKeyDown:xe(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){h.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const _=df(w,h.orientation,h.dir);if(_!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let E=p().filter(S=>S.focusable).map(S=>S.ref.current);if(_==="last")E.reverse();else if(_==="prev"||_==="next"){_==="prev"&&E.reverse();const S=E.indexOf(w.currentTarget);E=h.loop?ff(E,S+1):E.slice(S+1)}setTimeout(()=>Xi(E))}}),children:typeof c=="function"?c({isCurrentTabStop:f,hasTabStop:y!=null}):c})})},"RovingFocusGroupItem")),L1={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uf(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}on(uf,"getDirectionAwareKey");function df(e,t,r){const n=uf(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return L1[n]}on(df,"getFocusIntent");function Xi(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}on(Xi,"focusFirst");function ff(e,t){return e.map((r,n)=>e[(t+n)%e.length])}on(ff,"wrapArray");var M1=A1,I1=N1,F1=Object.defineProperty,Oe=(e,t)=>F1(e,"name",{value:t,configurable:!0}),D1=["Enter"," "],$1=["ArrowDown","PageUp","Home"],hf=["ArrowUp","PageDown","End"],z1=[...$1,...hf],Ls="Menu",[ec,U1,j1]=ni(Ls),[sn,pf]=Xt(Ls,[j1,Os,lf]),tc=Os(),mf=lf(),[B1,vo]=sn(Ls),[V1,rc]=sn(Ls),q1=Oe(e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:s,modal:a=!0}=e,c=tc(t),[l,u]=x.useState(null),d=x.useRef(!1),h=yr(s),f=di(o);return x.useEffect(()=>{const p=Oe(()=>{d.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},"handleKeyDown"),m=Oe(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),x.useEffect(()=>{if(!r)return;const p=Oe(()=>h(!1),"handleBlur");return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[r,h]),i.jsx(ef,{...c,children:i.jsx(B1,{scope:t,open:r,onOpenChange:h,content:l,onContentChange:u,children:i.jsx(V1,{scope:t,onClose:x.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:f,modal:a,children:n})})})},"Menu"),H1=x.forwardRef(Oe(function(t,r){const{__scopeMenu:n,...o}=t,s=tc(n);return i.jsx(tf,{...s,...o,ref:r})},"MenuAnchor")),gf="MenuPortal",[W1,Z1]=sn(gf,{forceMount:void 0}),R1=Oe(e=>{const{__scopeMenu:t,forceMount:r,children:n,container:o}=e,s=vo(gf,t);return i.jsx(W1,{scope:t,forceMount:r,children:i.jsx(Tr,{present:r||s.open,children:i.jsx(_i,{asChild:!0,container:o,children:n})})})},"MenuPortal"),Ir="MenuContent",[G1,bf]=sn(Ir),K1=x.forwardRef(Oe(function(t,r){const n=Z1(Ir,t.__scopeMenu),{forceMount:o=n.forceMount,...s}=t,a=vo(Ir,t.__scopeMenu),c=rc(Ir,t.__scopeMenu);return i.jsx(ec.Provider,{scope:t.__scopeMenu,children:i.jsx(Tr,{present:o||a.open,children:i.jsx(ec.Slot,{scope:t.__scopeMenu,children:c.modal?i.jsx(Y1,{...s,ref:r}):i.jsx(Q1,{...s,ref:r})})})})},"MenuContent")),Y1=x.forwardRef(Oe(function(t,r){const n=vo(Ir,t.__scopeMenu),o=x.useRef(null),s=je(r,o);return x.useEffect(()=>{const a=o.current;if(a)return xd(a)},[]),i.jsx(yf,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:xe(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentModal")),Q1=x.forwardRef(Oe(function(t,r){const n=vo(Ir,t.__scopeMenu);return i.jsx(yf,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),J1=mr("MenuContent.ScrollLock"),yf=x.forwardRef(Oe(function(t,r){const{__scopeMenu:n,loop:o=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,...y}=t,b=vo(Ir,n),w=rc(Ir,n),_=tc(n),P=mf(n),E=U1(n),[S,O]=x.useState(null),N=x.useRef(null),k=je(r,N,b.onContentChange),I=x.useRef(0),j=x.useRef(""),q=x.useRef(0),M=x.useRef(null),$=x.useRef("right"),H=x.useRef(0),V=g?Ai:x.Fragment,R=g?{as:J1,allowPinchZoom:!0}:void 0,K=Oe(D=>{const ne=j.current+D,T=E().filter(te=>!te.disabled),F=document.activeElement,z=T.find(te=>te.ref.current===F)?.textValue,B=T.map(te=>te.textValue),X=Cf(B,ne,z),G=T.find(te=>te.textValue===X)?.ref.current;Oe((function te(ie){j.current=ie,window.clearTimeout(I.current),ie!==""&&(I.current=window.setTimeout(()=>te(""),1e3))}),"updateSearch")(ne),G&&setTimeout(()=>G.focus())},"handleTypeaheadSearch");x.useEffect(()=>()=>window.clearTimeout(I.current),[]),us();const Y=x.useCallback(D=>$.current===M.current?.side&&Ef(D,M.current?.area),[]);return i.jsx(G1,{scope:n,searchRef:j,onItemEnter:x.useCallback(D=>{Y(D)&&D.preventDefault()},[Y]),onItemLeave:x.useCallback(D=>{Y(D)||(N.current?.focus(),O(null))},[Y]),onTriggerLeave:x.useCallback(D=>{Y(D)&&D.preventDefault()},[Y]),pointerGraceTimerRef:q,onPointerGraceIntentChange:x.useCallback(D=>{M.current=D},[]),children:i.jsx(V,{...R,children:i.jsx(td,{asChild:!0,trapped:s,onMountAutoFocus:xe(a,D=>{D.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:i.jsx(hi,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:i.jsx(M1,{asChild:!0,...P,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:S,onCurrentTabStopIdChange:O,onEntryFocus:xe(u,D=>{w.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(rf,{role:"menu","aria-orientation":"vertical","data-state":vf(b.open),"data-radix-menu-content":"",dir:w.dir,..._,...y,ref:k,style:{outline:"none",...y.style},onKeyDown:xe(y.onKeyDown,D=>{const T=D.target.closest("[data-radix-menu-content]")===D.currentTarget,F=D.ctrlKey||D.altKey||D.metaKey,z=D.key.length===1;T&&(D.key==="Tab"&&D.preventDefault(),!F&&z&&K(D.key));const B=N.current;if(D.target!==B||!z1.includes(D.key))return;D.preventDefault();const G=E().filter(te=>!te.disabled).map(te=>te.ref.current);hf.includes(D.key)&&G.reverse(),xf(G)}),onBlur:xe(t.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(I.current),j.current="")}),onPointerMove:xe(t.onPointerMove,Ms(D=>{const ne=D.target,T=H.current!==D.clientX;if(D.currentTarget.contains(ne)&&T){const F=D.clientX>H.current?"right":"left";$.current=F,H.current=D.clientX}}))})})})})})})},"MenuContentImpl")),X1=x.forwardRef(Oe(function(t,r){const{__scopeMenu:n,...o}=t;return i.jsx(He.div,{...o,ref:r})},"MenuLabel")),nc="MenuItem",wf="menu.itemSelect",e_=x.forwardRef(Oe(function(t,r){const{disabled:n=!1,onSelect:o,...s}=t,a=x.useRef(null),c=rc(nc,t.__scopeMenu),l=bf(nc,t.__scopeMenu),u=je(r,a),d=x.useRef(!1),h=Oe(()=>{const f=a.current;if(!n&&f){const p=new CustomEvent(wf,{bubbles:!0,cancelable:!0});f.addEventListener(wf,m=>o?.(m),{once:!0}),ri(f,p),p.defaultPrevented?d.current=!1:c.onClose()}},"handleSelect");return i.jsx(t_,{...s,ref:u,disabled:n,onClick:xe(t.onClick,h),onPointerDown:f=>{t.onPointerDown?.(f),d.current=!0},onPointerUp:xe(t.onPointerUp,f=>{d.current||f.currentTarget?.click()}),onKeyDown:xe(t.onKeyDown,f=>{n||f.target!==f.currentTarget||l.searchRef.current!==""&&f.key===" "||D1.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})},"MenuItem")),t_=x.forwardRef(Oe(function(t,r){const{__scopeMenu:n,disabled:o=!1,textValue:s,...a}=t,c=bf(nc,n),l=mf(n),u=x.useRef(null),d=je(r,u),[h,f]=x.useState(!1),[p,m]=x.useState("");return x.useEffect(()=>{const g=u.current;g&&m((g.textContent??"").trim())},[a.children]),i.jsx(ec.ItemSlot,{scope:n,disabled:o,textValue:s??p,children:i.jsx(I1,{asChild:!0,...l,focusable:!o,children:i.jsx(He.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:xe(t.onPointerMove,Ms(g=>{o?c.onItemLeave(g):(c.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:xe(t.onPointerLeave,Ms(g=>c.onItemLeave(g))),onFocus:xe(t.onFocus,()=>f(!0)),onBlur:xe(t.onBlur,()=>f(!1))})})})},"MenuItemImpl")),r_="MenuRadioGroup",[U4,j4]=sn(r_,{value:void 0,onValueChange:Oe(()=>{},"onValueChange")}),n_="MenuItemIndicator",[B4,V4]=sn(n_,{checked:!1}),o_=x.forwardRef(Oe(function(t,r){const{__scopeMenu:n,...o}=t;return i.jsx(He.div,{role:"separator","aria-orientation":"horizontal",...o,ref:r})},"MenuSeparator")),s_="MenuSub",[q4,H4]=sn(s_);function vf(e){return e?"open":"closed"}Oe(vf,"getOpenState");function _f(e){return e==="indeterminate"}Oe(_f,"isIndeterminate");function a_(e){return _f(e)?"indeterminate":e?"checked":"unchecked"}Oe(a_,"getCheckedState");function xf(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}Oe(xf,"focusFirst");function Sf(e,t){return e.map((r,n)=>e[(t+n)%e.length])}Oe(Sf,"wrapArray");function Cf(e,t,r){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let a=Sf(e,Math.max(s,0));o.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}Oe(Cf,"getNextMatch");function Pf(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const c=t[s],l=t[a],u=c.x,d=c.y,h=l.x,f=l.y;d>n!=f>n&&r<(h-u)*(n-d)/(f-d)+u&&(o=!o)}return o}Oe(Pf,"isPointInPolygon");function Ef(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return Pf(r,t)}Oe(Ef,"isPointerInGraceArea");function Ms(e){return t=>t.pointerType==="mouse"?e(t):void 0}Oe(Ms,"whenMouse");var i_=q1,c_=H1,l_=R1,u_=K1,d_=X1,f_=e_,h_=o_,p_=Object.defineProperty,an=(e,t)=>p_(e,"name",{value:t,configurable:!0}),oc="DropdownMenu",[m_,W4]=Xt(oc,[pf]),cn=pf(),[g_,kf]=m_(oc),b_=an(e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:s,onOpenChange:a,modal:c=!0}=e,l=cn(t),u=x.useRef(null),[d,h]=Tn({prop:o,defaultProp:s??!1,onChange:a,caller:oc});return i.jsx(g_,{scope:t,triggerId:br(),triggerRef:u,contentId:br(),open:d,onOpenChange:h,onOpenToggle:x.useCallback(()=>h(f=>!f),[h]),modal:c,children:i.jsx(i_,{...l,open:d,onOpenChange:h,dir:n,modal:c,children:r})})},"DropdownMenu"),y_="DropdownMenuTrigger",w_=x.forwardRef(an(function(t,r){const{__scopeDropdownMenu:n,disabled:o=!1,...s}=t,a=kf(y_,n),c=cn(n),l=je(r,a.triggerRef);return i.jsx(c_,{asChild:!0,...c,children:i.jsx(He.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:l,onPointerDown:xe(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(a.onOpenToggle(),a.open||u.preventDefault())}),onKeyDown:xe(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&a.onOpenToggle(),u.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),v_=an(e=>{const{__scopeDropdownMenu:t,...r}=e,n=cn(t);return i.jsx(l_,{...n,...r})},"DropdownMenuPortal"),__="DropdownMenuContent",x_=x.forwardRef(an(function(t,r){const{__scopeDropdownMenu:n,...o}=t,s=kf(__,n),a=cn(n),c=x.useRef(!1);return i.jsx(u_,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...o,ref:r,onCloseAutoFocus:xe(t.onCloseAutoFocus,l=>{c.current||s.triggerRef.current?.focus(),c.current=!1,l.preventDefault()}),onInteractOutside:xe(t.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,h=u.button===2||d;(!s.modal||h)&&(c.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),S_=x.forwardRef(an(function(t,r){const{__scopeDropdownMenu:n,...o}=t,s=cn(n);return i.jsx(d_,{...s,...o,ref:r})},"DropdownMenuLabel")),C_=x.forwardRef(an(function(t,r){const{__scopeDropdownMenu:n,...o}=t,s=cn(n);return i.jsx(f_,{...s,...o,ref:r})},"DropdownMenuItem")),P_=x.forwardRef(an(function(t,r){const{__scopeDropdownMenu:n,...o}=t,s=cn(n);return i.jsx(h_,{...s,...o,ref:r})},"DropdownMenuSeparator")),E_=b_,k_=w_,A_=v_,O_=x_,T_=S_,N_=C_,L_=P_,M_=Object.defineProperty,Ye=(e,t)=>M_(e,"name",{value:t,configurable:!0}),[sc,Z4]=Xt("Tooltip",[Os]),Is=Os(),I_="TooltipProvider",F_=700,ac="tooltip.open",[D_,ic]=sc(I_),$_=Ye(e=>{const{__scopeTooltip:t,delayDuration:r=F_,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:s}=e,a=x.useRef(!0),c=x.useRef(!1),l=x.useRef(0);return x.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),i.jsx(D_,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:x.useCallback(()=>{n<=0||(window.clearTimeout(l.current),a.current=!1)},[n]),onClose:x.useCallback(()=>{n<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,n))},[n]),isPointerInTransitRef:c,onPointerInTransitChange:x.useCallback(u=>{c.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),cc="Tooltip",[z_,_o]=sc(cc),U_=Ye(e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:s,disableHoverableContent:a,delayDuration:c}=e,l=ic(cc,e.__scopeTooltip),u=Is(t),[d,h]=x.useState(null),[f,p]=x.useState(void 0),m=br(),g=x.useRef(0),y=a??l.disableHoverableContent,b=c??l.delayDuration,w=x.useRef(!1),[_,P]=Tn({prop:n,defaultProp:o??!1,onChange:Ye(I=>{I?(l.onOpen(),document.dispatchEvent(new CustomEvent(ac))):l.onClose(),s?.(I)},"onChange"),caller:cc}),E=x.useMemo(()=>_?w.current?"delayed-open":"instant-open":"closed",[_]),S=x.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w.current=!1,P(!0)},[P]),O=x.useCallback(()=>{window.clearTimeout(g.current),g.current=0,P(!1)},[P]),N=x.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{w.current=!0,P(!0),g.current=0},b)},[b,P]);x.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]);const k=f??m;return i.jsx(ef,{...u,children:i.jsx(z_,{scope:t,contentId:k,setContentId:p,open:_,stateAttribute:E,trigger:d,onTriggerChange:h,onTriggerEnter:x.useCallback(()=>{l.isOpenDelayedRef.current?N():S()},[l.isOpenDelayedRef,N,S]),onTriggerLeave:x.useCallback(()=>{y?O():(window.clearTimeout(g.current),g.current=0)},[O,y]),onOpen:S,onClose:O,disableHoverableContent:y,children:r})})},"Tooltip"),Af="TooltipTrigger",j_=x.forwardRef(Ye(function(t,r){const{__scopeTooltip:n,...o}=t,s=_o(Af,n),a=ic(Af,n),c=Is(n),l=x.useRef(null),u=je(r,l,s.onTriggerChange),d=x.useRef(!1),h=x.useRef(!1),f=x.useCallback(()=>d.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),i.jsx(tf,{asChild:!0,...c,children:i.jsx(He.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:u,onPointerMove:xe(t.onPointerMove,p=>{p.pointerType!=="touch"&&!h.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:xe(t.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:xe(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:xe(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:xe(t.onBlur,s.onClose),onClick:xe(t.onClick,s.onClose)})})},"TooltipTrigger")),Of="TooltipPortal",[B_,V_]=sc(Of,{forceMount:void 0}),q_=Ye(e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,s=_o(Of,t);return i.jsx(B_,{scope:t,forceMount:r,children:i.jsx(Tr,{present:r||s.open,children:i.jsx(_i,{asChild:!0,container:o,children:n})})})},"TooltipPortal"),xo="TooltipContent",H_=x.forwardRef(Ye(function(t,r){const n=V_(xo,t.__scopeTooltip),{forceMount:o=n.forceMount,side:s="top",...a}=t,c=_o(xo,t.__scopeTooltip);return i.jsx(Tr,{present:o||c.open,children:c.disableHoverableContent?i.jsx(Tf,{side:s,...a,ref:r}):i.jsx(W_,{side:s,...a,ref:r})})},"TooltipContent")),W_=x.forwardRef(Ye(function(t,r){const n=_o(xo,t.__scopeTooltip),o=ic(xo,t.__scopeTooltip),s=x.useRef(null),a=je(r,s),[c,l]=x.useState(null),{trigger:u,onClose:d}=n,h=s.current,{onPointerInTransitChange:f}=o,p=x.useCallback(()=>{l(null),f(!1)},[f]),m=x.useCallback((g,y)=>{const b=g.currentTarget,w={x:g.clientX,y:g.clientY},_=Nf(w,b.getBoundingClientRect()),P=Lf(w,_),E=Mf(y.getBoundingClientRect()),S=Ff([...P,...E]);l(S),f(!0)},[f]);return x.useEffect(()=>()=>p(),[p]),x.useEffect(()=>{if(u&&h){const g=Ye(b=>m(b,h),"handleTriggerLeave"),y=Ye(b=>m(b,u),"handleContentLeave");return u.addEventListener("pointerleave",g),h.addEventListener("pointerleave",y),()=>{u.removeEventListener("pointerleave",g),h.removeEventListener("pointerleave",y)}}},[u,h,m,p]),x.useEffect(()=>{if(c){const g=Ye(y=>{const b=y.target,w={x:y.clientX,y:y.clientY},_=u?.contains(b)||h?.contains(b),P=!If(w,c);_?p():P&&(p(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,h,c,d,p]),i.jsx(Tf,{...t,ref:a})},"TooltipContentHoverable")),Z_=Cu("TooltipContent"),Tf=x.forwardRef(Ye(function(t,r){const{__scopeTooltip:n,children:o,"aria-label":s,id:a,onEscapeKeyDown:c,onPointerDownOutside:l,...u}=t,d=_o(xo,n),h=Is(n),{onClose:f}=d;x.useEffect(()=>(document.addEventListener(ac,f),()=>document.removeEventListener(ac,f)),[f]),x.useEffect(()=>{if(d.trigger){const m=Ye(g=>{g.target instanceof Node&&g.target.contains(d.trigger)&&f()},"handleScroll");return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,f]);const{setContentId:p}=d;return wt(()=>(p(a),()=>{p(void 0)}),[a,p]),i.jsx(hi,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:f,children:i.jsxs(rf,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...h,...u,ref:r,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(Z_,{children:o}),s?i.jsx(hw,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),R_=x.forwardRef(Ye(function(t,r){const{__scopeTooltip:n,...o}=t,s=Is(n);return i.jsx(w1,{...s,...o,ref:r})},"TooltipArrow"));function Nf(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,o,s)){case s:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}Ye(Nf,"getExitSideFromRect");function Lf(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}Ye(Lf,"getPaddedExitPoints");function Mf(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}Ye(Mf,"getPointsFromRect");function If(e,t){const{x:r,y:n}=e;let o=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const c=t[s],l=t[a],u=c.x,d=c.y,h=l.x,f=l.y;d>n!=f>n&&r<(h-u)*(n-d)/(f-d)+u&&(o=!o)}return o}Ye(If,"isPointInPolygon");function Ff(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Df(t)}Ye(Ff,"getHull");function Df(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const s=r[r.length-1],a=r[r.length-2];if((s.x-a.x)*(o.y-a.y)>=(s.y-a.y)*(o.x-a.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}Ye(Df,"getHullPresorted");var G_=$_,K_=U_,Y_=j_,Q_=q_,J_=H_,X_=R_;const ex=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},tx=(e,t)=>({classGroupId:e,validator:t}),$f=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Fs="-",zf=[],rx="arbitrary..",nx=e=>{const t=sx(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return ox(a);const c=a.split(Fs),l=c[0]===""&&c.length>1?1:0;return Uf(c,l,t)},getConflictingClassGroupIds:(a,c)=>{if(c){const l=n[a],u=r[a];return l?u?ex(u,l):l:u||zf}return r[a]||zf}}},Uf=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],s=r.nextPart.get(o);if(s){const u=Uf(e,t+1,s);if(u)return u}const a=r.validators;if(a===null)return;const c=t===0?e.join(Fs):e.slice(t).join(Fs),l=a.length;for(let u=0;u<l;u++){const d=a[u];if(d.validator(c))return d.classGroupId}},ox=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?rx+n:void 0})(),sx=e=>{const{theme:t,classGroups:r}=e;return ax(r,t)},ax=(e,t)=>{const r=$f();for(const n in e){const o=e[n];lc(o,r,n,t)}return r},lc=(e,t,r,n)=>{const o=e.length;for(let s=0;s<o;s++){const a=e[s];ix(a,t,r,n)}},ix=(e,t,r,n)=>{if(typeof e=="string"){cx(e,t,r);return}if(typeof e=="function"){lx(e,t,r,n);return}ux(e,t,r,n)},cx=(e,t,r)=>{const n=e===""?t:jf(t,e);n.classGroupId=r},lx=(e,t,r,n)=>{if(dx(e)){lc(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(tx(r,e))},ux=(e,t,r,n)=>{const o=Object.entries(e),s=o.length;for(let a=0;a<s;a++){const[c,l]=o[a];lc(l,jf(t,c),r,n)}},jf=(e,t)=>{let r=e;const n=t.split(Fs),o=n.length;for(let s=0;s<o;s++){const a=n[s];let c=r.nextPart.get(a);c||(c=$f(),r.nextPart.set(a,c)),r=c}return r},dx=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,fx=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(s,a)=>{r[s]=a,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(s){let a=r[s];if(a!==void 0)return a;if((a=n[s])!==void 0)return o(s,a),a},set(s,a){s in r?r[s]=a:o(s,a)}}},uc="!",Bf=":",hx=[],Vf=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),px=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const s=[];let a=0,c=0,l=0,u;const d=o.length;for(let g=0;g<d;g++){const y=o[g];if(a===0&&c===0){if(y===Bf){s.push(o.slice(l,g)),l=g+1;continue}if(y==="/"){u=g;continue}}y==="["?a++:y==="]"?a--:y==="("?c++:y===")"&&c--}const h=s.length===0?o:o.slice(l);let f=h,p=!1;h.endsWith(uc)?(f=h.slice(0,-1),p=!0):h.startsWith(uc)&&(f=h.slice(1),p=!0);const m=u&&u>l?u-l:void 0;return Vf(s,p,f,m)};if(t){const o=t+Bf,s=n;n=a=>a.startsWith(o)?s(a.slice(o.length)):Vf(hx,!1,a,void 0,!0)}if(r){const o=n;n=s=>r({className:s,parseClassName:o})}return n},mx=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let s=0;s<r.length;s++){const a=r[s],c=a[0]==="[",l=t.has(a);c||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(a)):o.push(a)}return o.length>0&&(o.sort(),n.push(...o)),n}},gx=e=>({cache:fx(e.cacheSize),parseClassName:px(e),sortModifiers:mx(e),postfixLookupClassGroupIds:bx(e),...nx(e)}),bx=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)t[r[n]]=!0;return t},yx=/\s+/,wx=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:a}=t,c=[],l=e.trim().split(yx);let u="";for(let d=l.length-1;d>=0;d-=1){const h=l[d],{isExternal:f,modifiers:p,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:y}=r(h);if(f){u=h+(u.length>0?" "+u:u);continue}let b=!!y,w;if(b){const O=g.substring(0,y);w=n(O);const N=w&&a[w]?n(g):void 0;N&&N!==w&&(w=N,b=!1)}else w=n(g);if(!w){if(!b){u=h+(u.length>0?" "+u:u);continue}if(w=n(g),!w){u=h+(u.length>0?" "+u:u);continue}b=!1}const _=p.length===0?"":p.length===1?p[0]:s(p).join(":"),P=m?_+uc:_,E=P+w;if(c.indexOf(E)>-1)continue;c.push(E);const S=o(w,b);for(let O=0;O<S.length;++O){const N=S[O];c.push(P+N)}u=h+(u.length>0?" "+u:u)}return u},vx=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=qf(r))&&(o&&(o+=" "),o+=n);return o},qf=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=qf(e[n]))&&(r&&(r+=" "),r+=t);return r},_x=(e,...t)=>{let r,n,o,s;const a=l=>{const u=t.reduce((d,h)=>h(d),e());return r=gx(u),n=r.cache.get,o=r.cache.set,s=c,c(l)},c=l=>{const u=n(l);if(u)return u;const d=wx(l,r);return o(l,d),d};return s=a,(...l)=>s(vx(...l))},xx=[],Qe=e=>{const t=r=>r[e]||xx;return t.isThemeGetter=!0,t},Hf=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Wf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Sx=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Px=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ax=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fr=e=>Sx.test(e),ve=e=>!!e&&!Number.isNaN(Number(e)),sr=e=>!!e&&Number.isInteger(Number(e)),dc=e=>e.endsWith("%")&&ve(e.slice(0,-1)),Pr=e=>Cx.test(e),Zf=()=>!0,Ox=e=>Px.test(e)&&!Ex.test(e),fc=()=>!1,Tx=e=>kx.test(e),Nx=e=>Ax.test(e),Lx=e=>!ce(e)&&!le(e),Mx=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Ix=e=>Dr(e,Jf,fc),ce=e=>Hf.test(e),ln=e=>Dr(e,Xf,Ox),Rf=e=>Dr(e,Vx,ve),Fx=e=>Dr(e,th,Zf),Dx=e=>Dr(e,eh,fc),Gf=e=>Dr(e,Yf,fc),$x=e=>Dr(e,Qf,Nx),Ds=e=>Dr(e,rh,Tx),le=e=>Wf.test(e),So=e=>un(e,Xf),zx=e=>un(e,eh),Kf=e=>un(e,Yf),Ux=e=>un(e,Jf),jx=e=>un(e,Qf),$s=e=>un(e,rh,!0),Bx=e=>un(e,th,!0),Dr=(e,t,r)=>{const n=Hf.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},un=(e,t,r=!1)=>{const n=Wf.exec(e);return n?n[1]?t(n[1]):r:!1},Yf=e=>e==="position"||e==="percentage",Qf=e=>e==="image"||e==="url",Jf=e=>e==="length"||e==="size"||e==="bg-size",Xf=e=>e==="length",Vx=e=>e==="number",eh=e=>e==="family-name",th=e=>e==="number"||e==="weight",rh=e=>e==="shadow",qx=_x(()=>{const e=Qe("color"),t=Qe("font"),r=Qe("text"),n=Qe("font-weight"),o=Qe("tracking"),s=Qe("leading"),a=Qe("breakpoint"),c=Qe("container"),l=Qe("spacing"),u=Qe("radius"),d=Qe("shadow"),h=Qe("inset-shadow"),f=Qe("text-shadow"),p=Qe("drop-shadow"),m=Qe("blur"),g=Qe("perspective"),y=Qe("aspect"),b=Qe("ease"),w=Qe("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...P(),le,ce],S=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],N=()=>[le,ce,l],k=()=>[Fr,"full","auto",...N()],I=()=>[sr,"none","subgrid",le,ce],j=()=>["auto",{span:["full",sr,le,ce]},sr,le,ce],q=()=>[sr,"auto",le,ce],M=()=>["auto","min","max","fr",le,ce],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...N()],R=()=>[Fr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],K=()=>[Fr,"screen","full","dvw","lvw","svw","min","max","fit",...N()],Y=()=>[Fr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...N()],D=()=>[e,le,ce],ne=()=>[...P(),Kf,Gf,{position:[le,ce]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",Ux,Ix,{size:[le,ce]}],z=()=>[dc,So,ln],B=()=>["","none","full",u,le,ce],X=()=>["",ve,So,ln],G=()=>["solid","dashed","dotted","double"],te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[ve,dc,Kf,Gf],Ne=()=>["","none",m,le,ce],Ae=()=>["none",ve,le,ce],_e=()=>["none",ve,le,ce],Se=()=>[ve,le,ce],ge=()=>[Fr,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pr],breakpoint:[Pr],color:[Zf],container:[Pr],"drop-shadow":[Pr],ease:["in","out","in-out"],font:[Lx],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pr],shadow:[Pr],spacing:["px",ve],text:[Pr],"text-shadow":[Pr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fr,ce,le,y]}],container:["container"],"container-type":[{"@container":["","normal","size",le,ce]}],"container-named":[Mx],columns:[{columns:[ve,ce,le,c]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{"inset-s":k(),start:k()}],end:[{"inset-e":k(),end:k()}],"inset-bs":[{"inset-bs":k()}],"inset-be":[{"inset-be":k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[sr,"auto",le,ce]}],basis:[{basis:[Fr,"full","auto",c,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ve,Fr,"auto","initial","none",ce]}],grow:[{grow:["",ve,le,ce]}],shrink:[{shrink:["",ve,le,ce]}],order:[{order:[sr,"first","last","none",le,ce]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pbs:[{pbs:N()}],pbe:[{pbe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:R()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[c,"screen",...R()]}],"min-w":[{"min-w":[c,"screen","none",...R()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...R()]}],h:[{h:["screen","lh",...R()]}],"min-h":[{"min-h":["screen","lh","none",...R()]}],"max-h":[{"max-h":["screen","lh",...R()]}],"font-size":[{text:["base",r,So,ln]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Bx,Fx]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",dc,ce]}],"font-family":[{font:[zx,Dx,t]}],"font-features":[{"font-features":[ce]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,le,ce]}],"line-clamp":[{"line-clamp":[ve,"none",le,Rf]}],leading:[{leading:[s,...N()]}],"list-image":[{"list-image":["none",le,ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",le,ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[ve,"from-font","auto",le,ln]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[ve,"auto",le,ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"tab-size":[{tab:[sr,le,ce]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le,ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",le,ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sr,le,ce],radial:["",le,ce],conic:[sr,le,ce]},jx,$x]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-bs":[{"border-bs":X()}],"border-w-be":[{"border-be":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ve,le,ce]}],"outline-w":[{outline:["",ve,So,ln]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,$s,Ds]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",h,$s,Ds]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[ve,ln]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",f,$s,Ds]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[ve,le,ce]}],"mix-blend":[{"mix-blend":[...te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ve]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[le,ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[ve]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",le,ce]}],filter:[{filter:["","none",le,ce]}],blur:[{blur:Ne()}],brightness:[{brightness:[ve,le,ce]}],contrast:[{contrast:[ve,le,ce]}],"drop-shadow":[{"drop-shadow":["","none",p,$s,Ds]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",ve,le,ce]}],"hue-rotate":[{"hue-rotate":[ve,le,ce]}],invert:[{invert:["",ve,le,ce]}],saturate:[{saturate:[ve,le,ce]}],sepia:[{sepia:["",ve,le,ce]}],"backdrop-filter":[{"backdrop-filter":["","none",le,ce]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[ve,le,ce]}],"backdrop-contrast":[{"backdrop-contrast":[ve,le,ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ve,le,ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ve,le,ce]}],"backdrop-invert":[{"backdrop-invert":["",ve,le,ce]}],"backdrop-opacity":[{"backdrop-opacity":[ve,le,ce]}],"backdrop-saturate":[{"backdrop-saturate":[ve,le,ce]}],"backdrop-sepia":[{"backdrop-sepia":["",ve,le,ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",le,ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ve,"initial",le,ce]}],ease:[{ease:["linear","initial",b,le,ce]}],delay:[{delay:[ve,le,ce]}],animate:[{animate:["none",w,le,ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,le,ce]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[le,ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":["translate-none"],zoom:[{zoom:[sr,le,ce]}],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le,ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mbs":[{"scroll-mbs":N()}],"scroll-mbe":[{"scroll-mbe":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pbs":[{"scroll-pbs":N()}],"scroll-pbe":[{"scroll-pbe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",le,ce]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[ve,So,ln,Rf]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ye(...e){return qx(yu(e))}const Hx=_u("appearance-none inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ar({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const s=n?ss:"button";return i.jsx(s,{"data-slot":"button","data-variant":t,"data-size":r,className:ye(Hx({variant:t,size:r,className:e})),...o})}function hc({error:e,resetErrorBoundary:t,variant:r}){return r==="full-page"?i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-foreground",children:i.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[i.jsx("h1",{className:"text-2xl font-semibold",children:"Something went wrong"}),!1,i.jsx(ar,{size:"sm",onClick:()=>window.location.reload(),children:"Reload page"})]})}):r==="page"?i.jsx("div",{className:"flex min-h-[50vh] items-center justify-center px-6 py-12 bg-background text-foreground",children:i.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[i.jsx("h1",{className:"text-2xl font-semibold",children:"Something went wrong"}),!1,i.jsxs("div",{className:"flex gap-3",children:[i.jsx(ar,{variant:"outline",size:"sm",onClick:()=>window.history.back(),children:"Go back"}),i.jsx(ar,{size:"sm",onClick:t,children:"Retry"})]})]})}):i.jsx("div",{className:"flex items-center justify-center rounded-md border border-border bg-muted px-4 py-6",children:i.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load this section"}),!1,i.jsx(ar,{size:"xs",onClick:t,children:"Retry"})]})})}class Wx extends v.Component{constructor(t){super(t),this.state={hasError:!1,error:null},this.handleReset=this.handleReset.bind(this)}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){J.error("[ErrorBoundary] Uncaught error",t,{componentStack:r.componentStack??""})}handleReset(){this.setState({hasError:!1,error:null})}render(){return this.state.hasError&&this.state.error?i.jsx(hc,{error:this.state.error,resetErrorBoundary:this.handleReset,variant:"full-page"}):this.props.children}}class dn extends v.Component{constructor(t){super(t),this.state={hasError:!1,error:null},this.handleReset=this.handleReset.bind(this)}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){J.error("[FeatureErrorBoundary] Uncaught error",t,{componentStack:r.componentStack??""})}handleReset(){this.setState({hasError:!1,error:null})}render(){return this.state.hasError&&this.state.error?i.jsx(hc,{error:this.state.error,resetErrorBoundary:this.handleReset,variant:"inline"}):this.props.children}}function nh(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function oh(e,t="|"){return e.map(r=>ch(r)).join(t)}function pc(e,t){return typeof t=="bigint"?t.toString():t}function mc(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Zx(e){return e==null}function gc(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Rx(e,t){const r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}const sh=Symbol("evaluating");function Gx(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==sh)return n===void 0&&(n=sh,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Ct(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $r(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Kx(e){return JSON.stringify(e)}function Yx(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ah="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function zs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Qx=mc(()=>{if(Wt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function jn(e){if(zs(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(zs(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function ih(e){return jn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Jx=new Set(["string","number","symbol"]);function Us(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zr(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function fe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ch(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Xx(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const eS={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function tS(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=$r(e._zod.def,{get shape(){const a={};for(const c of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(r.shape,c))throw new Error(`Unrecognized key: "${String(c)}"`);t[c]&&Ct(a,c,r.shape[c])}return Ct(this,"shape",a),a},checks:[]});return zr(e,s)}function rS(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=$r(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const c of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(r.shape,c))throw new Error(`Unrecognized key: "${String(c)}"`);t[c]&&delete a[c]}return Ct(this,"shape",a),a},checks:[]});return zr(e,s)}function nS(e,t){if(!jn(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const s=e._zod.def.shape;for(const a of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=$r(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Ct(this,"shape",s),s}});return zr(e,o)}function oS(e,t){if(!jn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=$r(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Ct(this,"shape",n),n}});return zr(e,r)}function sS(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=$r(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Ct(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return zr(e,r)}function lh(e,t,r,n="partial"){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);const c=$r(t._zod.def,{get shape(){const l=t._zod.def.shape,u={...l};if(r)for(const d of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(l,d))throw new Error(`Unrecognized key: "${String(d)}"`);r[d]&&(u[d]=e?new e({type:"optional",innerType:l[d]}):l[d])}else for(const d of Reflect.ownKeys(l))u[d]=e?new e({type:"optional",innerType:l[d]}):l[d];return Ct(this,"shape",u),u},checks:[]});return zr(t,c)}function aS(e,t,r){const n=$r(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const a of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(s,a))throw new Error(`Unrecognized key: "${String(a)}"`);r[a]&&(s[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a of Reflect.ownKeys(o))s[a]=new e({type:"nonoptional",innerType:o[a]});return Ct(this,"shape",s),s}});return zr(t,n)}function Bn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function iS(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Vn(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Co(e){return typeof e=="string"?e:e?.message}function uh(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function Ur(e,t,r){var n;const o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);const s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Co(e.inst?._zod.def?.error?.(e))??Co(s?.(e))??Co(t?.error?.(e))??Co(r.customError?.(e))??Co(r.localeError?.(e))??"Invalid input",{inst:c,schema:l,continue:u,input:d,...h}=e;return h.path??(h.path=[]),h.message=a,t?.reportInput&&(h.input=d),h}const cS=/[\uD800-\uDBFF]/;function bc(e){const t=e.length;if(!cS.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function yc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function lS(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Po(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function uS(e,t){for(const r in t){const n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):dS(e,r,n.value)}}function qn(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function dh(e,t,r){return qn(e,t,r,!1)}function dS(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:qn(this,t,r.bind(this))},set(n){qn(this,t,n)}})}function fS(e,t){const r=Object.getPrototypeOf(e);return t in r?void 0:r}let wc,jr=!1;const hS={configurable:!0,get(){jr=!0}};function Pe(e,t,r){const n=Object.getPrototypeOf(e._zod);if(t in n&&wc!==e._zod){wc=void 0;return}wc=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,hS);const o=jr;jr=!1;try{const s=r(this);return jr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),jr=jr||o,s}catch(s){throw delete this[t],jr=jr||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function pS(e,t,r,n){const o=fS(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){const s={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:s})}})}const mS="~constantCatch";function gS(e){const t=()=>e;return t[mS]=!0,t}var fh;const vc={value:void 0,enumerable:!1};let hh="captureStackTrace"in Error?Error:null;function bS(e){const t=hh;if(t){const r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return hh=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function Z(e,t,r,n){const o={};function s(f){this.def=f,this.constr=h,this.traits=new Set}s.prototype=o;const a=r,c=a&&new WeakSet;function l(f,p){if(!f._zod){vc.value=new s(p);try{Object.defineProperty(f,"_zod",vc)}finally{vc.value=void 0}}if(f._zod.traits.has(e))return;if(f._zod.traits.add(e),t(f,p),c){const g=Object.getPrototypeOf(f),y=f._zod.constr.prototype;let b=g;for(;b&&b!==y;)b=Object.getPrototypeOf(b);const w=b??g;c.has(w)||(c.add(w),uS(w,a))}const m=h.prototype;for(const g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in f||(f[g]=m[g].bind(f)))}const u=n?.Parent??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function h(f){const p=n?.Parent?bS(d):this;l(p,f);const m=p._zod.deferred;if(m){for(const y of m)y();p._zod.deferred=void 0}const g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(p),p}return Object.defineProperty(h,"init",{value:l}),Object.defineProperty(h,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(h,"name",{value:e}),h}class Hn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ph extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(fh=globalThis).__zod_globalConfig??(fh.__zod_globalConfig={});const Wt=globalThis.__zod_globalConfig;function ir(e){return e&&Object.assign(Wt,e),Wt}function yS(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,pc,2)),e.message}function wS(e){this._zod.message=e}const vS={get:yS,set:wS,enumerable:!0,configurable:!0},_c={value:void 0,enumerable:!1},xc={value:void 0,enumerable:!1},mh=new WeakSet([Object.prototype,Error.prototype]),gh=(e,t)=>{e.name="$ZodError",_c.value=e._zod,Object.defineProperty(e,"_zod",_c),xc.value=t,Object.defineProperty(e,"issues",xc),_c.value=void 0,xc.value=void 0,Object.defineProperty(e,"message",vS);const r=Object.getPrototypeOf(e);mh.has(r)||(mh.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){const n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},bh=Z("$ZodError",gh),yh=Z("$ZodError",gh,void 0,{Parent:Error});function _S(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function xS(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?_S(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function SS(e,t=r=>r.message){const r={_errors:[]},n=(o,s=[])=>{for(const a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>n({issues:c},[...s,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...s,...a.path]);else{const c=[...s,...a.path];if(c.length===0)r._errors.push(t(a));else{let l=r,u=0;for(;u<c.length;){const d=c[u],h=u===c.length-1;if(d==="_errors"){h&&l._errors.push(t(a)),u++;continue}Object.prototype.hasOwnProperty.call(l,d)||Object.defineProperty(l,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const f=l[d];h&&f._errors.push(t(a)),l=f,u++}}}};return n(e),r}function js(e,t){return{callee:t?.callee??e,Err:t?.Err}}const Sc=e=>{const t=(r,n,o,s)=>{const a=o?{...o,async:!1}:{async:!1},c=r._zod.run({value:n,issues:[]},a);if(c instanceof Promise)throw new Hn;if(c.issues.length){const l=new(s?.Err??e)(c.issues.map(u=>Ur(u,a,ir())));throw ah(l,s?.callee??t),l}return c.value};return t},Cc=e=>{const t=async(r,n,o,s)=>{const a=o?{...o,async:!0}:{async:!0};let c=r._zod.run({value:n,issues:[]},a);if(c instanceof Promise&&(c=await c),c.issues.length){const l=new(s?.Err??e)(c.issues.map(u=>Ur(u,a,ir())));throw ah(l,s?.callee??t),l}return c.value};return t},Bs=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Hn;return s.issues.length?{success:!1,error:new(e??bh)(s.issues.map(a=>Ur(a,o,ir())))}:{success:!0,data:s.value}},CS=Bs(yh),Vs=e=>async(t,r,n)=>{const o=n?{...n,async:!0}:{async:!0};let s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>Ur(a,o,ir())))}:{success:!0,data:s.value}},PS=Vs(yh),ES=e=>{const t=Sc(e),r=(n,o,s,a)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return t(n,o,c,js(r,a))};return r},kS=e=>{const t=Sc(e),r=(n,o,s,a)=>t(n,o,s,js(r,a));return r},AS=e=>{const t=Cc(e),r=async(n,o,s,a)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(n,o,c,js(r,a))};return r},OS=e=>{const t=Cc(e),r=async(n,o,s,a)=>await t(n,o,s,js(r,a));return r},TS=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return Bs(e)(t,r,o)},NS=e=>(t,r,n)=>Bs(e)(t,r,n),LS=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return Vs(e)(t,r,o)},MS=e=>async(t,r,n)=>Vs(e)(t,r,n),IS=/^[cC][0-9a-z]{6,}$/,FS=/^[0-9a-z]+$/,DS=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,$S=/^[0-9a-vA-V]{20}$/,zS=/^[A-Za-z0-9]{27}$/,US=/^[a-zA-Z0-9_-]{21}$/;function jS(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const BS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,VS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,wh=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,qS=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,HS="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function WS(){return new RegExp(HS,"u")}const ZS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,RS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,GS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,KS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,vh=/^[A-Za-z0-9_-]*$/,QS=/^https?$/,JS=/^\+[1-9]\d{6,14}$/,_h="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function XS(e){return new RegExp(`^${e}$`)}const e2=XS(_h);function Pc(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function t2(e){return new RegExp(`^${Pc(e)}$`)}function r2(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${Pc({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${Pc({precision:e.precision})}`:r;return new RegExp(`^${_h}T(?:${n})$`)}const n2=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},xh=/^-?\d+$/,Ec=/^-?\d+(?:\.\d+)?$/,o2=/^(?:true|false)$/i,s2=/^[^A-Z]*$/,a2=/^[^a-z]*$/,Pt=Z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),kc=e=>{const t=e.value;return!Zx(t)&&t.length!==void 0},qs={number:"number",bigint:"bigint",object:"date"},Sh=Z("$ZodCheckLessThan",(e,t)=>{Pt.init(e,t);const r=qs[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:qs[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ch=Z("$ZodCheckGreaterThan",(e,t)=>{Pt.init(e,t);const r=qs[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:qs[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),i2=Z("$ZodCheckMultipleOf",(e,t)=>{Pt.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Rx(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),c2=Z("$ZodCheckNumberFormat",(e,t)=>{Pt.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,s]=eS[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=o,c.maximum=s,r&&(c.pattern=xh)}),e._zod.check=a=>{const c=a.value;if(r){if(!Number.isInteger(c)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),l2=Z("$ZodCheckMaxLength",(e,t)=>{var r;Pt.init(e,t),(r=e._zod.def).when??(r.when=kc),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value,s=o.length;if((typeof o=="string"&&s>t.maximum?bc(o):s)<=t.maximum)return;const c=yc(o);n.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),u2=Z("$ZodCheckMinLength",(e,t)=>{var r;Pt.init(e,t),(r=e._zod.def).when??(r.when=kc),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?bc(o):s)>=t.minimum)return;const c=yc(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),d2=Z("$ZodCheckLengthEquals",(e,t)=>{var r;Pt.init(e,t),(r=e._zod.def).when??(r.when=kc),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,s=o.length,a=typeof o=="string"&&s>=t.length&&s<=t.length*2?bc(o):s;if(a===t.length)return;const c=yc(o),l=a>t.length;n.issues.push({origin:c,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Hs=Z("$ZodCheckStringFormat",(e,t)=>{var r,n;Pt.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),f2=Z("$ZodCheckRegex",(e,t)=>{Hs.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),h2=Z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=s2),Hs.init(e,t)}),p2=Z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=a2),Hs.init(e,t)}),m2=Z("$ZodCheckIncludes",(e,t)=>{Pt.init(e,t);const r=Us(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),g2=Z("$ZodCheckStartsWith",(e,t)=>{Pt.init(e,t);const r=new RegExp(`^${Us(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),b2=Z("$ZodCheckEndsWith",(e,t)=>{Pt.init(e,t);const r=new RegExp(`.*${Us(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),y2=Z("$ZodCheckOverwrite",(e,t)=>{Pt.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class w2{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
43
|
+
`).filter(a=>a),o=Math.min(...n.map(a=>a.length-a.trimStart().length)),s=n.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
44
|
+
${r.join(`
|
|
45
|
+
`)}
|
|
46
|
+
};`)(...Object.values(this.closed))}}const v2={major:4,minor:5,patch:4},Ie=Z("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=v2;const n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(const s of o)for(const a of s._zod.onattach)a(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(c,l,u)=>{if(c.memo)return c;let d=Bn(c),h;for(const f of l){if(f._zod.def.when){if(iS(c)||!f._zod.def.when(c))continue}else if(d)continue;const p=c.issues.length,m=f._zod.check(c);if(m instanceof Promise&&u?.async===!1)throw new Hn;if(h||m instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await m,c.issues.length!==p&&(uh(c.issues,p,e),d||(d=Bn(c,p)))});else{if(c.issues.length===p)continue;uh(c.issues,p,e),d||(d=Bn(c,p))}}return h?h.then(()=>c):c},a=(c,l,u)=>{if(Bn(c))return c.aborted=!0,c;const d=s(l,o,u);if(d instanceof Promise){if(u.async===!1)throw new Hn;return d.then(h=>e._zod.parse(h,u))}return e._zod.parse(d,u)};e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){const d=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return d instanceof Promise?d.then(h=>a(h,c,l)):a(d,c,l)}const u=e._zod.parse(c,l);if(u instanceof Promise){if(l.async===!1)throw new Hn;return u.then(d=>s(d,o,l))}return s(u,o,l)}}},{get"~standard"(){return dh(this,"~standard",Eh(this))},set"~standard"(e){qn(this,"~standard",e)}}),Ph=e=>e.success?{value:e.data}:{issues:e.error?.issues};function Eh(e){return{validate:t=>{try{return Ph(CS(e,t))}catch{return PS(e,t).then(Ph)}},vendor:"zod",version:1}}const Ac=Z("$ZodString",(e,t)=>{Ie.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??n2(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Le=Z("$ZodStringFormat",(e,t)=>{Hs.init(e,t),Ac.init(e,t)}),_2=Z("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=VS),Le.init(e,t)}),x2=Z("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=wh(n))}else t.pattern??(t.pattern=wh());Le.init(e,t)}),S2=Z("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=qS),Le.init(e,t)}),kh=1,Ah=2;function C2(e,t){if(!t.normalize&&t.protocol?.source===QS.source&&!/^https?:\/\//i.test(e))return kh;try{return new URL(e)}catch{return Ah}}const P2=/[\t\n\r]/g;function E2(e){return e.replace(P2,"")}function k2(e,t){return t.lastIndex=0,t.test(e.hostname)}function A2(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const O2=Z("$ZodURL",(e,t)=>{Le.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),o=C2(n,t);if(o===kh){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===Ah){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}t.hostname&&!k2(o,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!A2(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:E2(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),T2=Z("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=WS()),Le.init(e,t)}),N2=Z("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?US:jS(t.length)),Le.init(e,t)}),L2=Z("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=IS),Le.init(e,t)}),M2=Z("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=FS),Le.init(e,t)}),I2=Z("$ZodULID",(e,t)=>{t.pattern??(t.pattern=DS),Le.init(e,t)}),F2=Z("$ZodXID",(e,t)=>{t.pattern??(t.pattern=$S),Le.init(e,t)}),D2=Z("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=zS),Le.init(e,t)}),$2=Z("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=r2(t)),Le.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(r=>{r._zod.bag.laxFormat=!0}))}),z2=Z("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=e2),Le.init(e,t)}),U2=Z("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=t2(t)),Le.init(e,t)}),j2=Z("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=BS),Le.init(e,t)}),B2=Z("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ZS),Le.init(e,t),e._zod.bag.format="ipv4"}),V2=/^[0-9a-fA-F:.]+$/;function Oh(e){if(!V2.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}const q2=Z("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=RS),Le.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{Oh(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),H2=Z("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=GS),Le.init(e,t)});function W2(e){const t=e.split("/");if(t.length!==2)return!1;const[r,n]=t;if(!n)return!1;const o=Number(n);return`${o}`!==n||o<0||o>128?!1:Oh(r)}const Z2=Z("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=KS),Le.init(e,t),e._zod.check=r=>{W2(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Th(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const R2=Z("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=YS),Le.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Th(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function G2(e){if(!vh.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Th(r)}const K2=Z("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=vh),Le.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{G2(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Y2=Z("$ZodE164",(e,t)=>{t.pattern??(t.pattern=JS),Le.init(e,t)});function Q2(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const J2=Z("$ZodJWT",(e,t)=>{Le.init(e,t),e._zod.check=r=>{Q2(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Nh=Z("$ZodNumber",(e,t)=>{Ie.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ec,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),X2=Z("$ZodNumberFormat",(e,t)=>{c2.init(e,t),Nh.init(e,t)}),eC=Z("$ZodBoolean",(e,t)=>{Ie.init(e,t),e._zod.pattern=o2,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),tC=Z("$ZodUnknown",(e,t)=>{Ie.init(e,t),e._zod.parse=r=>r}),rC=Z("$ZodNever",(e,t)=>{Ie.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Lh(e,t,r){e.issues.length&&t.issues.push(...Vn(r,e.issues)),t.value[r]=e.value}const nC=Z("$ZodArray",(e,t)=>{Ie.init(e,t);const r=Wt.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=r?r.alloc(e,n,Array(s.length),o):Array(s.length);const a=[];for(let c=0;c<s.length;c++){const l=s[c],u=t.element._zod.run({value:l,issues:[]},o);u instanceof Promise?a.push(u.then(d=>Lh(d,n,c))):Lh(u,n,c)}return a.length?Promise.all(a).then(()=>n):n}});function Ws(e,t,r,n,o,s){const a=r in n,c=s==="optional";if(!(!a&&c&&o==="optional")){if(e.issues.length){if(o!==void 0&&c&&!a)return;t.issues.push(...Vn(r,e.issues))}if(!a&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}}const oC=[];function Mh(e){const t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:oC,o=n.length?[...t,...n]:t;for(const a of o)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(a)}": expected a Zod schema`);const s=Xx(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Ih(e,t,r,n,o,s){const a=[],c=o.keySet,l=o.catchall._zod,u=l.def.type,d=l.optin,h=l.optout;for(const f in t){if(c.has(f))continue;if(f==="__proto__"){u==="never"&&a.push(f);continue}if(u==="never"){a.push(f);continue}const p=l.run({value:t[f],issues:[]},n);p instanceof Promise?e.push(p.then(m=>Ws(m,r,f,t,d,h))):Ws(p,r,f,t,d,h)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>r):r}const Fh=new WeakMap,sC=Z("$ZodObject",(e,t)=>{if(Ie.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Fh.set(t,l),Object.defineProperty(t,"shape",{get:()=>{const u={...l};return Object.defineProperty(t,"shape",{value:u}),Fh.set(t,u),u}})}const n=mc(()=>Mh(t));Pe(e,"propValues",l=>{const u=l.def.shape,d={};for(const h in u){const f=u[h]._zod;if(f.values){Object.prototype.hasOwnProperty.call(d,h)||Ct(d,h,new Set);for(const p of f.values)d[h].add(p);f.optin!==void 0&&d[h].add(void 0)}}return d});const o=zs,s=t.catchall;let a;const c=Wt.memoizer;c?.attach(e),e._zod.parse=(l,u)=>{a??(a=n.value);const d=l.value;if(!o(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value=c?c.alloc(e,l,{},u):{};const h=[],f=a.shape;for(const p of a.allKeys){if(p==="__proto__")continue;const m=f[p],g=m._zod.optin,y=m._zod.optout,b=m._zod.run({value:d[p],issues:[]},u);b instanceof Promise?h.push(b.then(w=>Ws(w,l,p,d,g,y))):Ws(b,l,p,d,g,y)}return s?Ih(h,d,l,u,n.value,e):h.length?Promise.all(h).then(()=>l):l}}),aC=Z("$ZodObjectJIT",(e,t)=>{sC.init(e,t);const r=e._zod.parse,n=mc(()=>Mh(t)),o=Wt.memoizer,s=p=>{const m=n.value,g=m.symbolKeys,y=new w2(["payload","ctx"],{shape:p,inst:e,memo:o,syms:g}),b=E=>`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`,w=(E,S)=>`
|
|
47
|
+
for (let i = 0; i < ${E}.issues.length; i++) {
|
|
48
|
+
const iss = ${E}.issues[i];
|
|
49
|
+
iss.path = iss.path ? [${S}, ...iss.path] : [${S}];
|
|
50
|
+
payload.issues.push(iss);
|
|
51
|
+
}`;y.write("const input = payload.value;");const _=Object.create(null);let P=0;for(const E of m.allKeys)_[E]=`key_${P++}`;y.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const E of m.allKeys){if(E==="__proto__")continue;const S=_[E],O=typeof E=="symbol"?`syms[${g.indexOf(E)}]`:Kx(E),N=`${O} in input`,k=p[E],I=k?._zod?.optin,j=I!==void 0,q=k?._zod?.optout==="optional";if(y.write(`const ${S} = ${b(O)};`),j&&q){const M=I==="optional"?`${S}_present`:`${S}.value !== undefined || ${S}_present`;y.write(`
|
|
52
|
+
const ${S}_present = ${N};
|
|
53
|
+
if (!${S}.issues.length || ${S}_present) {
|
|
54
|
+
if (${S}.issues.length) {${w(S,O)}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (${M}) {
|
|
58
|
+
newResult[${O}] = ${S}.value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
`)}else j?y.write(`
|
|
63
|
+
if (${S}.issues.length) {${w(S,O)}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (${S}.value === undefined) {
|
|
67
|
+
if (${N}) {
|
|
68
|
+
newResult[${O}] = undefined;
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
newResult[${O}] = ${S}.value;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
`):y.write(`
|
|
75
|
+
const ${S}_present = ${N};
|
|
76
|
+
if (${S}.issues.length) {${w(S,O)}
|
|
77
|
+
}
|
|
78
|
+
if (!${S}_present && !${S}.issues.length) {
|
|
79
|
+
payload.issues.push({
|
|
80
|
+
code: "invalid_type",
|
|
81
|
+
expected: "nonoptional",
|
|
82
|
+
input: undefined,
|
|
83
|
+
path: [${O}]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (${S}_present) {
|
|
88
|
+
newResult[${O}] = ${S}.value;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
`)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()};let a;const c=zs,l=!Wt.jitless,d=l&&Qx.value,h=t.catchall;let f;e._zod.parse=(p,m)=>{f??(f=n.value);const g=p.value;return c(g)?l&&d&&m?.async===!1&&m.jitless!==!0?(a||(a=s(t.shape)),p=a(p,m),h?Ih([],g,p,m,f,e):p):r(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function Dh(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Bn(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(a=>Ur(a,n,ir())))}),t)}const iC=Z("$ZodUnion",(e,t)=>{Ie.init(e,t),Pe(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),Pe(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Pe(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),Pe(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){const o=n.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>gc(s.source)).join("|")})$`)}});const r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1;const a=[];for(const c of t.options){const l=c._zod.run({value:n.value,issues:[]},o);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(c=>Dh(c,n,e,o)):Dh(a,n,e,o)}}),cC=Z("$ZodIntersection",(e,t)=>{Ie.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,s=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([l,u])=>$h(r,l,u)):$h(r,s,a)}});function Oc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(jn(e)&&jn(t)){const r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const s of n){if(s==="__proto__")continue;const a=Oc(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};o[s]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],s=t[n],a=Oc(o,s);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function $h(e,t,r){const n=new Map;let o;const s=new Map,a=(u,d)=>{let h;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),h=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){const f=String(u.path[0]);s.has(f)||s.set(f,u),h=[f]}else return!1;for(const f of h)n.has(f)||n.set(f,{}),n.get(f)[d]=!0;return!0};for(const u of t.issues)a(u,"l")||e.issues.push(u);for(const u of r.issues)a(u,"r")||e.issues.push(u);const c=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){const u=o?c.filter(d=>o.keys.includes(d)):[];u.length&&e.issues.push({...o,keys:u});for(const d of c)!u.includes(d)&&s.has(d)&&e.issues.push(s.get(d))}const l=Oc(t.value,r.value);if(!l.valid){if(Bn(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}const lC=Z("$ZodRecord",(e,t)=>{Ie.init(e,t);const r=Wt.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{const s=n.value;if(!jn(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const a=[],c=t.keyType._zod.values;if(c&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};const l=new Set;for(const d of c)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){if(l.add(typeof d=="number"?d.toString():d),d==="__proto__")continue;const h=t.keyType._zod.run({value:d,issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(m=>Ur(m,o,ir())),input:d,path:[d],inst:e});continue}const f=h.value;if(f==="__proto__")continue;const p=t.valueType._zod.run({value:s[d],issues:[]},o);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Vn(d,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...Vn(d,p.issues)),n.value[f]=p.value)}let u;for(const d in s)if(!l.has(d))if(t.mode==="loose"){if(d==="__proto__")continue;n.value[d]=s[d]}else u=u??[],u.push(d);u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}else{n.value=r?r.alloc(e,n,{},o):{};let l;for(const u of Reflect.ownKeys(s)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Ec.test(u)&&d.issues.length){const m=t.keyType._zod.run({value:Number(u),issues:[]},o);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(d=m)}if(d.issues.length){t.mode==="loose"?n.value[u]=s[u]:c?(l=l??[],l.push(u)):n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Ur(m,o,ir())),input:u,path:[u],inst:e});continue}const f=d.value;if(f==="__proto__")continue;const p=t.valueType._zod.run({value:s[u],issues:[]},o);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Vn(u,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...Vn(u,p.issues)),n.value[f]=p.value)}l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l,continue:!0})}return a.length?Promise.all(a).then(()=>n):n}}),uC=Z("$ZodEnum",(e,t)=>{Ie.init(e,t);const r=nh(t.entries),n=new Set(r);e._zod.values=n;const o=r.filter(s=>Jx.has(typeof s));e._zod.pattern=new RegExp(o.length?`^(${o.map(s=>Us(s.toString())).join("|")})$`:"^[^\\s\\S]$"),e._zod.parse=(s,a)=>{const c=s.value;return n.has(c)||s.issues.push({code:"invalid_value",values:r,input:c,inst:e}),s}}),dC=Z("$ZodTransform",(e,t)=>{Ie.init(e,t),e._zod.optin="optional",Wt.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ph(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new Hn;return r.value=o,r}});function zh(e,t){return e.value=t.issues.length?void 0:t.value,e}const Uh=Z("$ZodOptional",(e,t)=>{Ie.init(e,t),Pe(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Pe(e,"values",r=>{const n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),Pe(e,"pattern",r=>{const n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${gc(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;const o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(s=>zh(r,s)):zh(r,o)}return t.innerType._zod.run(r,n)}}),fC=Z("$ZodExactOptional",(e,t)=>{Uh.init(e,t),Pe(e,"values",r=>r.def.innerType._zod.values),Pe(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),hC=Z("$ZodNullable",(e,t)=>{Ie.init(e,t),Pe(e,"optin",r=>r.def.innerType._zod.optin),Pe(e,"optout",r=>r.def.innerType._zod.optout),Pe(e,"pattern",r=>{const n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${gc(n.source)}|null)$`):void 0}),Pe(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),pC=Z("$ZodDefault",(e,t)=>{Ie.init(e,t),e._zod.optin="defaulted",Pe(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>jh(s,t)):jh(o,t)}});function jh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const mC=Z("$ZodPrefault",(e,t)=>{Ie.init(e,t),e._zod.optin="defaulted",Pe(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),gC=Z("$ZodNonOptional",(e,t)=>{Ie.init(e,t),Pe(e,"values",r=>{const n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Bh(s,e)):Bh(o,e)}});function Bh(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Vh(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Ur(o,n,ir()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const bC=Z("$ZodCatch",(e,t)=>{Ie.init(e,t),Pe(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Pe(e,"optout",r=>r.def.innerType._zod.optout),Pe(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(s=>Vh(r,s,t,n)):Vh(r,o,t,n)}}),yC=Z("$ZodPipe",(e,t)=>{Ie.init(e,t),Pe(e,"values",r=>r.def.in._zod.values),Pe(e,"optin",r=>r.def.in._zod.optin),Pe(e,"optout",r=>r.def.out._zod.optout),Pe(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(r,n);return s instanceof Promise?s.then(a=>Zs(a,t.in,n)):Zs(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Zs(s,t.out,n)):Zs(o,t.out,n)}});function Zs(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const wC=Z("$ZodReadonly",(e,t)=>{Ie.init(e,t),Pe(e,"propValues",r=>r.def.innerType._zod.propValues),Pe(e,"values",r=>r.def.innerType._zod.values),Pe(e,"optin",r=>r.def.innerType?._zod?.optin),Pe(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(qh):qh(o)}});function qh(e){return e.memo||(e.value=Object.freeze(e.value)),e}const vC=Z("$ZodLazy",(e,t)=>{Ie.init(e,t),Gx(e._zod,"innerType",()=>{const r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),Pe(e,"pattern",r=>r.innerType?._zod?.pattern),Pe(e,"propValues",r=>r.innerType?._zod?.propValues),Pe(e,"optin",r=>r.innerType?._zod?.optin??void 0),Pe(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),_C=Z("$ZodCustom",(e,t)=>{Pt.init(e,t),Ie.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Hh(s,r,n,e));Hh(o,r,n,e)}});function Hh(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Po(o))}}class xC extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Tc="~memo",Wh=[];function Nc(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const Zh=new WeakMap;function Rh(e,t){const r=Zh.get(e);if(r!==void 0)return r;if(t.has(e))return!0;t.add(e);let n=!1;const o=c=>{!n&&c?._zod&&Rh(c,t)&&(n=!0)},s=e._zod.def;switch(s.type){case"object":{for(const c of Reflect.ownKeys(s.shape))o(s.shape[c]);o(s.catchall);break}case"array":o(s.element);break;case"tuple":for(const c of s.items)o(c);o(s.rest);break;case"record":case"map":o(s.keyType),o(s.valueType);break;case"set":o(s.valueType);break;case"union":for(const c of s.options)o(c);break;case"intersection":o(s.left),o(s.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(s.innerType);break;case"pipe":o(s.in),o(s.out);break;case"function":o(s.input),o(s.output);break;case"lazy":o(e._zod.innerType);break;case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const c in s){const l=Object.getOwnPropertyDescriptor(s,c);if(!l||l.get)continue;const u=l.value;if(!(!u||typeof u!="object")){if(u._zod)o(u);else if(Array.isArray(u))for(const d of u)o(d)}}}return t.delete(e),Zh.set(e,n),n}function SC(e,t){let r=e.buckets.get(t);return r||(r=new Map,e.buckets.set(t,r)),r}let Rs;const Gs=[],CC={alloc(e,t,r){const n=Rs;if(!n)return r;Rs=void 0;const o={value:r,issues:null};return n.set(t.value,o),Gs.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const r=e._zod.parse,n=(o,s)=>{if(s.direction!=="backward"&&EC(s,o.value))throw new xC;return r(o,s)};e._zod.parse=n,e._zod.run===r&&(e._zod.run=n)})},attach(e){var t;let r,n,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const s=e._zod.parse,a=(c,l)=>{if(r===void 0&&(r=Rh(e,new Set),!r))return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,l);const u=c.value;if(u===null||typeof u!="object")return s(c,l);let d=l[Tc];d||(d={buckets:new Map,backEdges:void 0},l[Tc]=d);let h;n===l?h=o:(h=SC(d,e),n=l,o=h);const f=h.get(u);if(f)return c.value=f.value,f.issues?f.issues.length&&c.issues.push(...Nc(f.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new Set),d.backEdges.add(f.value)),c;Rs=h;const p=Gs.length,m=s(c,l);Rs=void 0;const g=Gs.length>p?Gs.pop():void 0;return m instanceof Promise?m.then(y=>(g&&(g.issues=y.issues.length?Nc(y.issues):Wh),y)):(g&&(g.issues=m.issues.length?Nc(m.issues):Wh),m)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a)})}};function PC(){return CC}function EC(e,t){const r=e[Tc]?.backEdges;return r!==void 0&&t!==null&&typeof t=="object"&&r.has(t)}const kC=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(s,a){return s==="number"&&typeof a=="number"&&!Number.isFinite(a)?String(a):n[s]??s}return s=>{switch(s.code){case"invalid_type":{const a=o(s.expected),c=lS(s.input),l=o(c,s.input);return`Invalid input: expected ${a}, received ${l}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${ch(s.values[0])}`:`Invalid option: expected one of ${oh(s.values,"|")}`;case"too_big":{const a=s.exact?"exactly ":s.inclusive?"<=":"<",c=t(s.origin);return c?`Too big: expected ${s.origin??"value"} to have ${a}${s.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${a}${s.maximum.toString()}`}case"too_small":{const a=s.exact?"exactly ":s.inclusive?">=":">",c=t(s.origin);return c?`Too small: expected ${s.origin} to have ${a}${s.minimum.toString()} ${c.unit}`:`Too small: expected ${s.origin} to be ${a}${s.minimum.toString()}`}case"invalid_format":{const a=s;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${r[a.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${oh(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(c=>`'${c}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function AC(){return{localeError:kC()}}var Gh;class OC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function TC(){return new OC}(Gh=globalThis).__zod_globalRegistry??(Gh.__zod_globalRegistry=TC());const Eo=globalThis.__zod_globalRegistry;function NC(e,t){return new e({type:"string",...fe(t)})}function LC(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...fe(t)})}function MC(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...fe(t)})}function IC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...fe(t)})}function FC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...fe(t)})}function DC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...fe(t)})}function $C(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...fe(t)})}function zC(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...fe(t)})}function UC(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...fe(t)})}function jC(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...fe(t)})}function BC(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...fe(t)})}function VC(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...fe(t)})}function qC(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...fe(t)})}function HC(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...fe(t)})}function WC(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...fe(t)})}function ZC(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...fe(t)})}function RC(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...fe(t)})}function GC(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...fe(t)})}function KC(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...fe(t)})}function YC(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...fe(t)})}function QC(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...fe(t)})}function JC(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...fe(t)})}function XC(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...fe(t)})}function eP(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...fe(t)})}function tP(e,t){return new e({type:"string",format:"date",check:"string_format",...fe(t)})}function rP(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...fe(t)})}function nP(e,t){return new e({type:"string",format:"duration",check:"string_format",...fe(t)})}function oP(e,t){return new e({type:"number",checks:[],...fe(t)})}function sP(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...fe(t)})}function aP(e,t){return new e({type:"boolean",...fe(t)})}function iP(e){return new e({type:"unknown"})}function cP(e,t){return new e({type:"never",...fe(t)})}function Kh(e,t){return new Sh({check:"less_than",...fe(t),value:e,inclusive:!1})}function Lc(e,t){return new Sh({check:"less_than",...fe(t),value:e,inclusive:!0})}function Yh(e,t){return new Ch({check:"greater_than",...fe(t),value:e,inclusive:!1})}function Mc(e,t){return new Ch({check:"greater_than",...fe(t),value:e,inclusive:!0})}function Qh(e,t){return new i2({check:"multiple_of",...fe(t),value:e})}function Jh(e,t){return new l2({check:"max_length",...fe(t),maximum:e})}function Ks(e,t){return new u2({check:"min_length",...fe(t),minimum:e})}function Xh(e,t){return new d2({check:"length_equals",...fe(t),length:e})}function lP(e,t){return new f2({check:"string_format",format:"regex",...fe(t),pattern:e})}function uP(e){return new h2({check:"string_format",format:"lowercase",...fe(e)})}function dP(e){return new p2({check:"string_format",format:"uppercase",...fe(e)})}function fP(e,t){return new m2({check:"string_format",format:"includes",...fe(t),includes:e})}function hP(e,t){return new g2({check:"string_format",format:"starts_with",...fe(t),prefix:e})}function pP(e,t){return new b2({check:"string_format",format:"ends_with",...fe(t),suffix:e})}function Wn(e){return new y2({check:"overwrite",tx:e})}function mP(e){return Wn(t=>t.normalize(e))}function gP(){return Wn(e=>e.trim())}function bP(){return Wn(e=>e.toLowerCase())}function yP(){return Wn(e=>e.toUpperCase())}function wP(){return Wn(e=>Yx(e))}function vP(e,t,r){return new e({type:"array",element:t,...fe(r)})}function _P(e,t,r){return new e({type:"custom",check:"custom",fn:t,...fe(r)})}function xP(e,t){const r=SP(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Po(o,n.value,r._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(Po(s))}},e(n.value,n)),t);return r}function SP(e,t){const r=new Pt({check:"custom",...fe(t)});return r._zod.check=e,r}function ko(e,...t){for(const r of t)for(const n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&Ct(e,n,r[n]);return e}function ep(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Eo,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Zn(e,t,r,n,o){const s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(o);return Object.assign(r,s),!0}function We(e,t,r={path:[],schemaPath:[]}){var n;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{const d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,d);else{const f=a.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,f,d)}const h=e._zod.parent;h&&(a.ref||(a.ref=h),We(h,t,d),t.seen.get(h).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&ko(a.schema,l),t.io==="input"&&_t(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function tp(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function rp(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const n=new Map;for(const a of e.seen.entries()){const c=e.metadataRegistry.get(a[0])?.id;if(c){const l=n.get(c);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,a[0])}}const o=a=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(a[0])?.id,f=e.external.uri??(m=>m);if(h)return{ref:f(h)};const p=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=p,{defId:p,ref:`${f("__shared")}#/${c}/${tp(p)}`}}const l="#",u=`${l}/${c}/`;if(a[1]===r&&!a[1].schema.id)return{ref:l};const d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+tp(d)}},s=a=>{if(a[1].schema.$ref)return;const c=a[1],{ref:l,defId:u}=o(a);c.def={...c.schema},u&&(c.defId=u);const d=c.schema;for(const h in d)delete d[h];d.$ref=l};if(e.cycles==="throw")for(const a of e.seen.entries()){const c=a[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
92
|
+
|
|
93
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const c=a[1];if(t===a[0]){s(a);continue}if(e.external){const u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){s(a);continue}}if(e.metadataRegistry.get(a[0])?.id){s(a);continue}if(c.cycle){s(a);continue}if(c.count>1&&e.reused==="ref"){s(a);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function np(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const r=[];for(const n of t){if(!n||typeof n!="object")return;np(n);const o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;const s=n.type;for(const a of Array.isArray(s)?s:[s]){if(typeof a!="string")return;r.includes(a)||r.push(a)}}delete e.anyOf,e.type=r.length===1?r[0]:r}const op=new Set(["type","properties","required","additionalProperties"]),sp=["oneOf","anyOf"];function ap(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Ic(e){const t=[];for(const s of e){if(typeof s!="object"||s.type!=="object")return null;for(const a in s)if(!op.has(a))return null;t.push(s)}const r={},n=new Set;for(const s of t){for(const a in s.properties){if(Object.prototype.hasOwnProperty.call(r,a))continue;const c=[];for(const u of t){const d=u.properties?.[a]??ap(u);d!=null&&(c.some(h=>JSON.stringify(h)===JSON.stringify(d))||c.push(d))}const l=c.length===1?c[0]:Ic(c)??{allOf:c};Ct(r,a,l)}for(const a of s.required??[])n.add(a)}const o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(s=>s.additionalProperties===!1))o.additionalProperties=!1;else{const s=[];for(const a of t){const c=ap(a);c&&!s.some(l=>JSON.stringify(l)===JSON.stringify(c))&&s.push(c)}s.length===1?o.additionalProperties=s[0]:s.length>1&&(o.additionalProperties={allOf:s})}return o}function CP(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const o of op)if(o in e)return;const r=t.filter(o=>sp.some(s=>Array.isArray(o[s])));let n=null;if(!r.length)n=Ic(t);else{const o=r[0],s=sp.find(l=>Array.isArray(o[l]));if(Object.keys(o).length!==1)return;const a=t.filter(l=>l!==o),c=o[s].map(l=>Ic([...a,l]));if(c.some(l=>!l))return;n={[s]:c}}n&&(delete e.allOf,ko(e,n))}function ip(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=c=>{const l=e.seen.get(c);if(l.ref===null)return;const u=l.def??l.schema,d={...u},h=l.ref;if(l.ref=null,h){n(h);const p=e.seen.get(h),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):ko(u,m),ko(u,d),c._zod.parent===h)for(const y in u)y==="$ref"||y==="allOf"||y in d||delete u[y];if(m.$ref&&p.def)for(const y in u)y==="$ref"||y==="allOf"||y in p.def&&JSON.stringify(u[y])===JSON.stringify(p.def[y])&&delete u[y]}const f=c._zod.parent;if(f&&f!==h){n(f);const p=e.seen.get(f);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(const m in u)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(u[m])===JSON.stringify(p.def[m])&&delete u[m]}e.override({zodSchema:c,jsonSchema:u,path:l.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const c of[...e.seen.entries()].reverse())n(c[0]);if(e.target!=="openapi-3.0")for(const c of e.seen.entries())np(c[1].def??c[1].schema);for(const c of e.deferred)c();if(e.intersections.length){const c=new Map;for(const l of e.seen.values())for(const u of[l.schema,l.def]){const d=u?.allOf;if(!Array.isArray(d))continue;const h=c.get(d);h?h.push(u):c.set(d,[u])}for(const l of e.intersections)for(const u of c.get(l)??[])CP(u)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}ko(o,r.defId?r.schema:r.def??r.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&o.id===s&&delete o.id;const a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const c of e.seen.entries()){const l=c[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,Ct(a,l.defId,l.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?o.$defs=a:o.definitions=a);try{const c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ys(t,"input",e.processors),output:Ys(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function _t(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return _t(n.element,r);if(n.type==="set")return _t(n.valueType,r);if(n.type==="lazy")return _t(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return _t(n.innerType,r);if(n.type==="intersection")return _t(n.left,r)||_t(n.right,r);if(n.type==="record"||n.type==="map")return _t(n.keyType,r)||_t(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:_t(n.in,r)||_t(n.out,r);if(n.type==="object"){for(const o in n.shape)if(_t(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(_t(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(_t(o,r))return!0;return!!(n.rest&&_t(n.rest,r))}return!1}const PP=(e,t={})=>r=>{const n=ep({...r,processors:t});return We(e,n),rp(n,e),ip(n,e)},Ys=(e,t,r={})=>n=>{const{libraryOptions:o,target:s}=n??{},a=ep({...o??{},target:s,io:t,processors:r});return We(e,a),rp(a,e),ip(a,e)},EP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},kP=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:s,maximum:a,format:c,patterns:l,contentEncoding:u,laxFormat:d}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof a=="number"&&(o.maxLength=a),c&&(o.format=EP[c]??c,o.format===""&&delete o.format,(c==="time"||d)&&delete o.format),u&&(o.contentEncoding=u),l&&l.size>0){const h=[...l];h.length===1?o.pattern=h[0].source:h.length>1&&(o.allOf=[...h.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},AP=(e,t,r,n)=>{const o=r,{minimum:s,maximum:a,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof c=="string"&&c.includes("int")?o.type="integer":o.type="number";const h=typeof d=="number"&&d>=(s??Number.NEGATIVE_INFINITY),f=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";h?p?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d:typeof s=="number"&&(o.minimum=s),f?p?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:typeof a=="number"&&(o.maximum=a),typeof l=="number"&&(Number.isFinite(l)&&l!==0?o.multipleOf=Math.abs(l):Zn(e,t,o,n,`A multipleOf divisor of ${l} cannot be represented in JSON Schema`))},OP=(e,t,r,n)=>{r.type="boolean"},TP=(e,t,r,n)=>{r.not={}},NP=(e,t,r,n)=>{},LP=(e,t,r,n)=>{const o=e._zod.def,s=nh(o.entries);if(s.length===0){r.not={};return}s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},MP=(e,t,r,n)=>{Zn(e,t,r,n,"Custom types cannot be represented in JSON Schema")},IP=(e,t,r,n)=>{Zn(e,t,r,n,"Transforms cannot be represented in JSON Schema")},FP=(e,t,r,n)=>{const o=r,s=e._zod.def,{minimum:a,maximum:c}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=We(s.element,t,{...n,path:[...n.path,"items"]})};function Qs(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Qs(t.out):t.type==="catch"?Qs(t.innerType):e._zod.optin}const DP=(e,t,r,n)=>{const o=r,s=e._zod.def,a=s.shape;if(Object.getOwnPropertySymbols(a).length&&Zn(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const d in a)Ct(o.properties,d,We(a[d],t,{...n,path:[...n.path,"properties",d]}));const l=new Set(Object.keys(a)),u=new Set([...l].filter(d=>{const h=s.shape[d];return t.io==="input"?Qs(h)===void 0:h._zod.optout===void 0}));u.size>0&&(o.required=Array.from(u)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=We(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},$P=(e,t,r,n)=>{const o=e._zod.def,s=o.inclusive===!1,a=o.options.map((c,l)=>We(c,t,{...n,path:[...n.path,s?"oneOf":"anyOf",l]}));s?r.oneOf=a:r.anyOf=a},zP=(e,t,r,n)=>{const o=e._zod.def,s=We(o.left,t,{...n,path:[...n.path,"allOf",0]}),a=We(o.right,t,{...n,path:[...n.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,l=[...c(s)?s.allOf:[s],...c(a)?a.allOf:[a]];r.allOf=l,t.intersections.push(l)};function Fc(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);const m=e.get(t)?.def;if(!m)return t;const g=Fc(e,m,r);return g===m?t:g}for(const m of["anyOf","oneOf"]){const g=t[m];if(!Array.isArray(g))continue;const y=g.map(b=>Fc(e,b,r));y.some((b,w)=>b!==g[w])&&(t={...t,[m]:y})}const n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(m=>m==="number"||m==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!s?.some(m=>typeof m=="number"))return t;const{minimum:a,maximum:c,exclusiveMinimum:l,exclusiveMaximum:u,multipleOf:d,format:h,id:f,...p}=t;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),o&&(p.type="string",s||(p.pattern=(n.includes("number")?Ec:xh).source)),p}const Dc=new WeakMap;function UP(e){const t=new Map;for(const n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);const r=new Map;for(const n of Dc.get(e)??[]){const o=e.seen.get(n),s=(o?.def??o?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;const a=Fc(t,s,new Set);a!==s&&r.set(s,a)}if(r.size)for(const n of e.seen.values())for(const o of[n.schema,n.def]){const s=o&&r.get(o.propertyNames);s&&(o.propertyNames=s)}}const jP=(e,t,r,n)=>{const o=r,s=e._zod.def;o.type="object";const a=s.keyType,l=a._zod.bag?.patterns;if(s.mode==="loose"&&l&&l.size>0){const h=We(s.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(const f of l)Ct(o.patternProperties,f.source,h)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=We(s.keyType,t,{...n,path:[...n.path,"propertyNames"]});let h=Dc.get(t);h||(h=[],Dc.set(t,h),t.deferred.push(()=>UP(t))),h.push(e)}o.additionalProperties=We(s.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}const u=a._zod.values,d=t.io==="input"&&Qs(s.valueType)!==void 0;if(u&&!s.partial&&!d){const h=[...u].filter(f=>typeof f=="string"||typeof f=="number");h.length>0&&(o.required=h.map(String))}},BP=(e,t,r,n)=>{const o=e._zod.def,s=We(o.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},VP=(e,t,r,n)=>{const o=e._zod.def;We(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType},$c=Symbol();function cp(e,t,r,n,o){let s=!1;const a=JSON.stringify(e,(c,l)=>typeof l!="bigint"?l:(s=!0,null));return s?(Zn(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),$c):JSON.parse(a)}const qP=(e,t,r,n)=>{const o=e._zod.def;We(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType;const a=cp(o.defaultValue,e,t,r,n);a!==$c&&(r.default=a)},HP=(e,t,r,n)=>{const o=e._zod.def;We(o.innerType,t,n);const s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;const a=cp(o.defaultValue,e,t,r,n);a!==$c&&(r._prefault=a)},WP=(e,t,r,n)=>{const o=e._zod.def;We(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{Zn(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=a},ZP=(e,t,r,n)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?s?o.out:o.in:o.out;We(a,t,n);const c=t.seen.get(e);c.ref=a},RP=(e,t,r,n)=>{const o=e._zod.def;We(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType,r.readOnly=!0},lp=(e,t,r,n)=>{const o=e._zod.def;We(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType},GP=(e,t,r,n)=>{const o=e._zod.innerType;We(o,t,n);const s=t.seen.get(e);s.ref=o},up=new WeakSet([Object.prototype,Error.prototype]);function Js(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}const Bt=Z("ZodError",(e,t)=>{bh.init(e,t),e.name="ZodError";const r=Object.getPrototypeOf(e);up.has(r)||(up.add(r),Js(r,"format",n=>o=>SS(n,o)),Js(r,"flatten",n=>o=>xS(n,o)),Js(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,pc,2)}),Js(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,pc,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),KP=Sc(Bt),YP=Cc(Bt),QP=Bs(Bt),JP=Vs(Bt),XP=ES(Bt),eE=kS(Bt),tE=AS(Bt),rE=OS(Bt),nE=TS(Bt),oE=NS(Bt),sE=LS(Bt),aE=MS(Bt);function iE(){Wt.localeError||ir(AC())}function Xs(){Wt.memoizer||ir({memoizer:PC()})}const Fe=Z("ZodType",(e,t)=>(iE(),Ie.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone($r(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return zr(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(a3(e,t))},superRefine(e,t){return this.check(i3(e,t))},overwrite(e){return this.check(Wn(e))},optional(){return gp(this)},exactOptional(){return WE(this)},nullable(){return yp(this)},nullish(){return gp(yp(this))},nonoptional(e){return QE(this,e)},array(){return Rn(this)},or(e){return UE([this,e])},and(e){return BE(this,e)},transform(e){return vp(this,HE(e))},default(e){return GE(this,e)},prefault(e){return YE(this,e)},catch(e){return XE(this,e)},pipe(e){return vp(this,e)},readonly(){return r3(this)},describe(e){const t=this.clone();return Eo.add(t,{description:e}),t},meta(...e){if(e.length===0)return Eo.get(this);const t=this.clone();return Eo.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return dh(this,"~standard",{...Eh(this),jsonSchema:{input:Ys(this,"input"),output:Ys(this,"output")}})},set"~standard"(e){qn(this,"~standard",e)},parse:function e(t,r){return KP(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await YP(this,t,r,{callee:e})},safeParse(e,t){return QP(this,e,t)},async safeParseAsync(e,t){return JP(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){qn(this,"spa",e)},encode:function e(t,r){return XP(this,t,r,{callee:e})},decode:function e(t,r){return eE(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await tE(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await rE(this,t,r,{callee:e})},safeEncode(e,t){return nE(this,e,t)},safeDecode(e,t){return oE(this,e,t)},async safeEncodeAsync(e,t){return sE(this,e,t)},async safeDecodeAsync(e,t){return aE(this,e,t)},toJSONSchema(e){return PP(this,{})(e)},get description(){return Eo.get(this)?.description},get _def(){return this._zod.def}}),dp=Z("_ZodString",(e,t)=>{Ac.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,o,s)=>kP(e,n,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null},{regex(...e){return this.check(lP(...e))},includes(...e){return this.check(fP(...e))},startsWith(...e){return this.check(hP(...e))},endsWith(...e){return this.check(pP(...e))},min(...e){return this.check(Ks(...e))},max(...e){return this.check(Jh(...e))},length(...e){return this.check(Xh(...e))},nonempty(...e){return this.check(Ks(1,...e))},lowercase(e){return this.check(uP(e))},uppercase(e){return this.check(dP(e))},trim(){return this.check(gP())},normalize(...e){return this.check(mP(...e))},toLowerCase(){return this.check(bP())},toUpperCase(){return this.check(yP())},slugify(){return this.check(wP())}}),cE=Z("ZodString",(e,t)=>{Ac.init(e,t),dp.init(e,t)},{email(e){return this.check(LC(hE,e))},url(e){return this.check(zC(mE,e))},jwt(e){return this.check(XC(TE,e))},emoji(e){return this.check(UC(gE,e))},guid(e){return this.check(MC(pE,e))},uuid(e){return this.check(IC(ea,e))},uuidv4(e){return this.check(FC(ea,e))},uuidv6(e){return this.check(DC(ea,e))},uuidv7(e){return this.check($C(ea,e))},nanoid(e){return this.check(jC(bE,e))},cuid(e){return this.check(BC(yE,e))},cuid2(e){return this.check(VC(wE,e))},ulid(e){return this.check(qC(vE,e))},base64(e){return this.check(YC(kE,e))},base64url(e){return this.check(QC(AE,e))},xid(e){return this.check(HC(_E,e))},ksuid(e){return this.check(WC(xE,e))},ipv4(e){return this.check(ZC(SE,e))},ipv6(e){return this.check(RC(CE,e))},cidrv4(e){return this.check(GC(PE,e))},cidrv6(e){return this.check(KC(EE,e))},e164(e){return this.check(JC(OE,e))},datetime(e){return this.check(eP(lE,e))},date(e){return this.check(tP(uE,e))},time(e){return this.check(rP(dE,e))},duration(e){return this.check(nP(fE,e))}});function be(e){return NC(cE,e)}const De=Z("ZodStringFormat",(e,t)=>{Le.init(e,t),dp.init(e,t)}),lE=Z("ZodISODateTime",(e,t)=>{$2.init(e,t),De.init(e,t)}),uE=Z("ZodISODate",(e,t)=>{z2.init(e,t),De.init(e,t)}),dE=Z("ZodISOTime",(e,t)=>{U2.init(e,t),De.init(e,t)}),fE=Z("ZodISODuration",(e,t)=>{j2.init(e,t),De.init(e,t)}),hE=Z("ZodEmail",(e,t)=>{S2.init(e,t),De.init(e,t)}),pE=Z("ZodGUID",(e,t)=>{_2.init(e,t),De.init(e,t)}),ea=Z("ZodUUID",(e,t)=>{x2.init(e,t),De.init(e,t)}),mE=Z("ZodURL",(e,t)=>{O2.init(e,t),De.init(e,t)}),gE=Z("ZodEmoji",(e,t)=>{T2.init(e,t),De.init(e,t)}),bE=Z("ZodNanoID",(e,t)=>{N2.init(e,t),De.init(e,t)}),yE=Z("ZodCUID",(e,t)=>{L2.init(e,t),De.init(e,t)}),wE=Z("ZodCUID2",(e,t)=>{M2.init(e,t),De.init(e,t)}),vE=Z("ZodULID",(e,t)=>{I2.init(e,t),De.init(e,t)}),_E=Z("ZodXID",(e,t)=>{F2.init(e,t),De.init(e,t)}),xE=Z("ZodKSUID",(e,t)=>{D2.init(e,t),De.init(e,t)}),SE=Z("ZodIPv4",(e,t)=>{B2.init(e,t),De.init(e,t)}),CE=Z("ZodIPv6",(e,t)=>{q2.init(e,t),De.init(e,t)}),PE=Z("ZodCIDRv4",(e,t)=>{H2.init(e,t),De.init(e,t)}),EE=Z("ZodCIDRv6",(e,t)=>{Z2.init(e,t),De.init(e,t)}),kE=Z("ZodBase64",(e,t)=>{R2.init(e,t),De.init(e,t)}),AE=Z("ZodBase64URL",(e,t)=>{K2.init(e,t),De.init(e,t)}),OE=Z("ZodE164",(e,t)=>{Y2.init(e,t),De.init(e,t)}),TE=Z("ZodJWT",(e,t)=>{J2.init(e,t),De.init(e,t)}),fp=Z("ZodNumber",(e,t)=>{Nh.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,o,s)=>AP(e,n,o,s);const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null},{gt(e,t){return this.check(Yh(e,t))},gte(e,t){return this.check(Mc(e,t))},min(e,t){return this.check(Mc(e,t))},lt(e,t){return this.check(Kh(e,t))},lte(e,t){return this.check(Lc(e,t))},max(e,t){return this.check(Lc(e,t))},int(e){return this.check(hp(e))},safe(e){return this.check(hp(e))},positive(e){return this.check(Yh(0,e))},nonnegative(e){return this.check(Mc(0,e))},negative(e){return this.check(Kh(0,e))},nonpositive(e){return this.check(Lc(0,e))},multipleOf(e,t){return this.check(Qh(e,t))},step(e,t){return this.check(Qh(e,t))},finite(){return this}});function ta(e){return oP(fp,e)}const NE=Z("ZodNumberFormat",(e,t)=>{X2.init(e,t),fp.init(e,t)});function hp(e){return sP(NE,e)}const LE=Z("ZodBoolean",(e,t)=>{eC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>OP(e,r,n)});function Ao(e){return aP(LE,e)}const ME=Z("ZodUnknown",(e,t)=>{tC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>NP()});function Br(){return iP(ME)}const IE=Z("ZodNever",(e,t)=>{rC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>TP(e,r,n)});function FE(e){return cP(IE,e)}const DE=Z("ZodArray",(e,t)=>{Xs(),nC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>FP(e,r,n,o),e.element=t.element},{min(e,t){return this.check(Ks(e,t))},nonempty(e){return this.check(Ks(1,e))},max(e,t){return this.check(Jh(e,t))},length(e,t){return this.check(Xh(e,t))},unwrap(){return this.element}});function Rn(e,t){return vP(DE,e,t)}const $E=Z("ZodObject",(e,t)=>{Xs(),aC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>DP(e,r,n,o),pS(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return VE(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Br()})},loose(){return this.clone({...this._zod.def,catchall:Br()})},strict(){return this.clone({...this._zod.def,catchall:FE()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return nS(this,e)},safeExtend(e){return oS(this,e)},merge(e){return sS(this,e)},pick(e){return tS(this,e)},omit(e){return rS(this,e)},partial(...e){return lh(mp,this,e[0])},exactPartial(...e){return lh(bp,this,e[0],"exactPartial")},required(...e){return aS(wp,this,e[0])}});function cr(e,t){const r={type:"object",shape:e??{},...fe(t)};return new $E(r)}const zE=Z("ZodUnion",(e,t)=>{iC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$P(e,r,n,o),e.options=t.options});function UE(e,t){return new zE({type:"union",options:e,...fe(t)})}const jE=Z("ZodIntersection",(e,t)=>{cC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zP(e,r,n,o)});function BE(e,t){return new jE({type:"intersection",left:e,right:t})}const pp=Z("ZodRecord",(e,t)=>{Xs(),lC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>jP(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function Vr(e,t,r){return!t||!t._zod?new pp({type:"record",keyType:be(),valueType:e,...fe(t)}):new pp({type:"record",keyType:e,valueType:t,...fe(r)})}const zc=Z("ZodEnum",(e,t)=>{uC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,o,s)=>LP(e,n,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const s={};for(const a of n)if(r.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new zc({...t,checks:[],...fe(o),entries:s})},e.exclude=(n,o)=>{const s={...t.entries};for(const a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new zc({...t,checks:[],...fe(o),entries:s})}});function VE(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new zc({type:"enum",entries:r,...fe(t)})}const qE=Z("ZodTransform",(e,t)=>{Xs(),dC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>IP(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ph(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Po(s,r.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Po(a))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function HE(e){return new qE({type:"transform",transform:e})}const mp=Z("ZodOptional",(e,t)=>{Uh.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>lp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function gp(e){return new mp({type:"optional",innerType:e})}const bp=Z("ZodExactOptional",(e,t)=>{fC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>lp(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function WE(e){return new bp({type:"optional",innerType:e})}const ZE=Z("ZodNullable",(e,t)=>{hC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>BP(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function yp(e){return new ZE({type:"nullable",innerType:e})}const RE=Z("ZodDefault",(e,t)=>{pC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qP(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function GE(e,t){return new RE({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ih(t)}})}const KE=Z("ZodPrefault",(e,t)=>{mC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>HP(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function YE(e,t){return new KE({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ih(t)}})}const wp=Z("ZodNonOptional",(e,t)=>{gC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>VP(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function QE(e,t){return new wp({type:"nonoptional",innerType:e,...fe(t)})}const JE=Z("ZodCatch",(e,t)=>{bC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>WP(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function XE(e,t){return new JE({type:"catch",innerType:e,catchValue:typeof t=="function"?t:gS(t)})}const e3=Z("ZodPipe",(e,t)=>{yC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ZP(e,r,n,o),e.in=t.in,e.out=t.out});function vp(e,t){return new e3({type:"pipe",in:e,out:t})}const t3=Z("ZodReadonly",(e,t)=>{wC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>RP(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function r3(e){return new t3({type:"readonly",innerType:e})}const n3=Z("ZodLazy",(e,t)=>{vC.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>GP(e,r,n,o),e.unwrap=()=>e._zod.def.getter()});function o3(e){return new n3({type:"lazy",getter:e})}const s3=Z("ZodCustom",(e,t)=>{_C.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>MP(e,r,n,o)});function a3(e,t={}){return _P(s3,e,t)}function i3(e,t){return xP(e,t)}const c3=cr({path:be(),page_type:be(),entity:be().optional(),component:be().optional(),extra_params:Vr(be(),Br()).optional()}).passthrough(),l3=cr({enabled:Ao(),ping_url:be(),warn_after:ta(),expire_after:ta()}).passthrough(),u3=cr({colors:cr({primary:be().optional(),secondary:be().optional(),success:be().optional(),warning:be().optional(),error:be().optional(),gray:be().optional(),background:be().optional(),text:be().optional()}).default({}),typography:Vr(be(),be()).optional(),borders:Vr(be(),be()).optional(),shadows:Vr(be(),be()).optional(),spacing:Vr(be(),ta()).optional(),fonts:cr({body:be().optional(),heading:be().optional()}).optional(),borderRadius:cr({small:be().optional(),medium:be().optional(),large:be().optional()}).optional()}).passthrough(),_p=o3(()=>cr({id:be(),label:be(),path:be().optional(),uri:be().optional(),icon:be().optional(),type:be().optional(),children:Rn(_p).optional()}).passthrough()),d3=cr({routes:Rn(c3),menu:Rn(_p),app_name:be().optional(),is_user_anonymous:Ao().optional(),profile_info:Br().optional(),app_logo:be().optional(),metadata:Vr(be(),Br()).optional(),theme:u3.optional(),session_security:Ao().optional(),session_security_config:l3.optional()}).passthrough(),f3=cr({name:be(),email:be(),mobile:be(),profile_pic:be().nullable(),roles:Rn(cr({id:ta(),name:be(),is_active:Ao().optional(),is_default:Ao().optional()}).passthrough()),last_password_changed:be().optional(),auth_config:Vr(be(),Br()).optional(),password_policy:Vr(be(),Br()).optional(),tokens:Rn(Br()).optional()}).passthrough(),ra=(e,t={})=>`${t.baseUrl||""}${e}`,h3=(e,t={})=>t.endpoints?.[e]||"",p3=(e={})=>e.timeout??3e4,na=(e={})=>e.baseUrl||"",Uc=(e,t={})=>e?e.startsWith("http://")||e.startsWith("https://")?e:ra(e,t):na(t),oa=()=>{const e=ue.useLocation(),{routes:t,apiConfig:r}=$e(),o=e.pathname.split("/").filter(Boolean)[0],s=[...t].sort((d,h)=>h.path.length-d.path.length);let a=null;for(const d of s){if(d.path===e.pathname){a=d;break}if(d.path?.includes(":")){const h=d.path.replace(/:[^/]+/g,"[^/]+");if(e.pathname.match(new RegExp(`^${h}$`))){a=d;break}}if(e.pathname.startsWith(`${d.path}/`)){a=d;break}}const c=a?.extra_params||{},l=c.api_endpoint||"",u=c.headers||{};return{baseUrl:na(r),apiUrl:l,fullUrl:Uc(l,r),headers:u,entity:o,...c}},m3=()=>{const e=ue.useLocation(),{routes:t}=$e(),r=[...t].sort((n,o)=>o.path.length-n.path.length);for(const n of r){if(n.path===e.pathname)return n;if(n.path?.includes(":")){const o=n.path.replace(/:[^/]+/g,"[^/]+");if(e.pathname.match(new RegExp(`^${o}$`)))return n}if(e.pathname.startsWith(`${n.path}/`))return n}return null},g3=(e,t={},r={})=>({baseUrl:na(t),apiUrl:e,fullUrl:Uc(e,t),headers:r.headers||{},...r});function Et(e,t){if(!e)return"/";const[r,n]=e.split("?"),o=`${r.replace(/\/+$/,"")}/`,s=new URLSearchParams;n&&new URLSearchParams(n).forEach((l,u)=>{s.set(u,l)}),t&&Object.keys(t).length>0&&Object.entries(t).forEach(([c,l])=>{l!=null&&s.set(c,String(l))});const a=s.toString();return a?`${o}?${a}`:o}const b3="csrftoken",y3=8;function xp(e){const t=document.cookie.split(";");for(const r of t){const[n,o]=r.trim().split("=");if(n===e)try{return decodeURIComponent(o)}catch{return o}}return null}function Gn(){let e=xp(b3);return e||(e=document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")??null),e||(e=xp("csrf_token")),e?w3(e)?e:(J.warn("[CSRF] Invalid token format detected"),null):null}function w3(e){return!e||typeof e!="string"||e.length<y3?!1:/^[a-zA-Z0-9_\-+=/]+$/.test(e)}function lr(){const e=Gn();if(!e)throw new Error("CSRF token not available. Ensure you have a valid csrftoken cookie.");return e}const Oo="",To=async()=>{const e=Gn();return e?{"X-CSRFToken":e}:{}},Sp=async({fullUrl:e})=>{const t=`${Oo}${e}${e.includes("?")?"&":"?"}_t=${Date.now()}`;return await fetch(t,{method:"GET",redirect:"follow",headers:{...await To(),"Content-Type":"application/json"}})},Cp=async({fullUrl:e,payload:t})=>await fetch(Oo+e,{method:"POST",redirect:"follow",headers:{...await To(),...!(t instanceof FormData)&&{"Content-Type":"application/json"}},body:t instanceof FormData?t:JSON.stringify(t)}),Pp=async({fullUrl:e,payload:t})=>await fetch(Oo+e,{method:"PUT",redirect:"follow",headers:{...await To(),...!(t instanceof FormData)&&{"Content-Type":"application/json"}},body:t instanceof FormData?t:JSON.stringify(t)}),Ep=async({fullUrl:e,payload:t})=>await fetch(Oo+e,{method:"DELETE",redirect:"follow",headers:{...await To(),"Content-Type":"application/json"},body:t instanceof FormData?t:JSON.stringify(t)}),kp=async({fullUrl:e,payload:t})=>await fetch(Oo+e,{method:"PATCH",redirect:"follow",headers:{...await To(),...!(t instanceof FormData)&&{"Content-Type":"application/json"}},body:t instanceof FormData?t:JSON.stringify(t)}),kt=async e=>{let t;try{const r=ra(e.url);switch(e.type){case"POST":t=await Cp({fullUrl:r,payload:e.payload});break;case"PUT":t=await Pp({fullUrl:r,payload:e.payload});break;case"PATCH":t=await kp({fullUrl:r,payload:e.payload});break;case"DELETE":t=await Ep({fullUrl:r,payload:e.payload});break;default:t=await Sp({fullUrl:r})}if(t.status===200)try{return{response:(await t.json()).response,success:!0,responseStatus:t.status}}catch(n){return J.error("Failed to parse JSON from 200 response",n),{response:{message:"Server Error"},success:!1,responseStatus:t.status}}else{let n;try{n=await t.json()}catch{n=null}return{response:n?.response||{message:"Server Error"},success:!1,responseStatus:t.status}}}catch(r){return J.error("API Request Error",r),{response:{message:"Network Error"},success:!1,responseStatus:0,isNetworkError:!0}}},v3=e=>{if(!e||Object.keys(e).length===0)return"";const t=new URLSearchParams;Object.entries(e).forEach(([n,o])=>{o!=null&&t.append(n,String(o))});const r=t.toString();return r?`?${r}`:""},Ap=()=>{const t=typeof window<"u"&&window.app_initializer_endpoint?window.app_initializer_endpoint:"/app/initializer",r=t.startsWith("/")?t:`/${t}`;return{url:Et(r),type:"GET"}},Op=()=>({url:Et("/api/v1/profile"),type:"GET"}),Tp=e=>({url:Et("/api/v1/profile"),type:"PUT",payload:e}),Np=e=>({url:Et("/api/v1/profile/photo"),type:"POST",payload:e}),Lp=e=>({url:Et("/api/v1/appauth/password/change/"),type:"PUT",payload:e}),Mp=e=>({url:Et("/api/v1/profile/two-factor"),type:"POST",payload:e}),Ip=e=>({url:Et(`/api/v1/appauth/role/switch/?role=${encodeURIComponent(e)}`),type:"POST"}),Fp=()=>({url:Et("/api/v1/appauth/sessions/"),type:"GET"}),Dp=e=>({url:Et("/api/v1/appauth/sessions/"),type:"DELETE",payload:{sessions:[e]}}),$p=e=>({url:Et("/api/v1/appauth/sessions/"),type:"DELETE",payload:{sessions:e}}),zp=()=>({url:Et("/api/v1/appauth/logout"),type:"DELETE"}),Up=()=>({url:Et("/logout"),type:"POST"}),jp=(e,t)=>({url:Et(`${e}${e.includes("?")?"&":"?"}idleFor=${t}`),type:"GET"}),Bp=async()=>kt(Ap()),Vp=async()=>kt(Op()),qp=async()=>kt(Fp()),sa=async e=>kt(Tp(e)),_3=async e=>kt(Np(e)),Hp=async e=>kt(Lp(e)),x3=async e=>kt(Mp({enabled:e})),Wp=async e=>kt(Ip(e)),Zp=async e=>kt(Dp(e)),Rp=async e=>kt($p(e)),Gp=async()=>kt(zp()),Kp=async()=>kt(Up()),Yp=async(e,t)=>kt(jp(e,t)),S3=()=>os({queryKey:["app-init"],queryFn:async()=>{const e=await Bp();if(!e.success)throw new Error(e.response?.message||"Failed to fetch app data");const t=e.response;if(t){const r=d3.safeParse(t);return r.success?r.data:(J.warn("[useAppInitQuery] App init response validation failed",{errors:r.error.issues}),t)}return t},staleTime:1/0,refetchOnWindowFocus:!1,retry:!1}),Qp=({componentName:e,routeConfig:t,customPagesDir:r="src/custom/pages",fileExtension:n="js"})=>{const[o,s]=v.useState(null),a=(b,w)=>{navigator.clipboard.writeText(b).then(()=>{s(w),setTimeout(()=>s(null),2e3)})},c=e||"MyCustomPage",l=r,u=n,d=`import React from 'react';
|
|
94
|
+
|
|
95
|
+
const ${c} = () => {
|
|
96
|
+
return (
|
|
97
|
+
<div style={{ padding: '24px' }}>
|
|
98
|
+
<h1>${c}</h1>
|
|
99
|
+
<p>Welcome to your custom page!</p>
|
|
100
|
+
{/* Add your custom content here */}
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export default ${c};`,h=`// ${l}/index.${u}
|
|
106
|
+
// Export all custom pages here
|
|
107
|
+
export { default as ${c} } from './${c}';`,f=`import React from 'react';
|
|
108
|
+
import { ZangoApp } from '@zango-core/appbuilder';
|
|
109
|
+
import * as customPages from './custom/pages';
|
|
110
|
+
import { Toaster } from '@zango-core/components';
|
|
111
|
+
|
|
112
|
+
const App = () => {
|
|
113
|
+
return (
|
|
114
|
+
<>
|
|
115
|
+
<ZangoApp
|
|
116
|
+
appInitializerEndpoint={<app_init_endpoint>}
|
|
117
|
+
customPages={customPages}
|
|
118
|
+
/>
|
|
119
|
+
<Toaster position="bottom-right" />
|
|
120
|
+
</>
|
|
121
|
+
)
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default App;`,p=`mkdir -p ${l}`,m={container:{padding:"32px",maxWidth:"900px",margin:"0 auto",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},header:{marginBottom:"24px",borderBottom:"2px solid #e5e7eb",paddingBottom:"16px"},title:{fontSize:"28px",fontWeight:"600",color:"#111827",marginBottom:"8px"},subtitle:{fontSize:"16px",color:"#6b7280",marginTop:"8px"},errorBox:{backgroundColor:"#fef2f2",border:"1px solid #fecaca",borderRadius:"8px",padding:"16px",marginBottom:"24px"},errorText:{color:"#dc2626",fontWeight:"500",fontSize:"15px"},setupGuide:{backgroundColor:"#f9fafb",borderRadius:"8px",border:"1px solid #e5e7eb",padding:"24px",marginBottom:"24px"},sectionTitle:{fontSize:"20px",fontWeight:"600",color:"#111827",marginBottom:"16px",marginTop:"0"},stepTitle:{fontSize:"16px",fontWeight:"600",color:"#374151",marginBottom:"12px",marginTop:"20px"},stepList:{paddingLeft:"24px",color:"#4b5563",lineHeight:"1.8"},codeBlock:{position:"relative",marginTop:"12px",marginBottom:"20px"},pre:{backgroundColor:"#1f2937",color:"#f9fafb",padding:"16px",borderRadius:"6px",overflow:"auto",fontSize:"14px",lineHeight:"1.6",margin:"0",fontFamily:'"Fira Code", "Cascadia Code", Consolas, Monaco, "Courier New", monospace'},copyButton:{position:"absolute",top:"8px",right:"8px",backgroundColor:"#374151",color:"#f9fafb",border:"none",borderRadius:"4px",padding:"6px 12px",fontSize:"12px",cursor:"pointer",fontWeight:"500",transition:"background-color 0.2s"},copiedButton:{backgroundColor:"#10b981"},inlineCode:{backgroundColor:"#f3f4f6",color:"#1f2937",padding:"2px 6px",borderRadius:"3px",fontSize:"14px",fontFamily:"monospace"},note:{backgroundColor:"#eff6ff",border:"1px solid #bfdbfe",borderRadius:"6px",padding:"12px 16px",marginTop:"16px",fontSize:"14px",color:"#1e40af"}},g=t?.path??"",y=t?.component??e??"";return i.jsxs("div",{style:m.container,"data-testid":"custom-page-route-config","data-route-path":g,"data-route-component":y,children:[i.jsxs("div",{style:m.header,children:[i.jsx("h1",{style:m.title,children:"Custom Page Setup Guide"}),i.jsx("p",{style:m.subtitle,children:"Follow the steps below to create your custom page component"})]}),i.jsxs("div",{style:m.errorBox,children:[i.jsxs("p",{style:m.errorText,children:['⚠️ Custom page component "',c,'" could not be loaded']}),i.jsxs("p",{style:{fontSize:"13px",color:"#991b1b",marginTop:"8px",marginBottom:"0"},children:["Expected location:"," ",i.jsxs("code",{style:{...m.inlineCode,backgroundColor:"#fee2e2",color:"#991b1b"},children:[l,"/",c,".",u]})]})]}),i.jsxs("div",{style:m.setupGuide,children:[i.jsx("h2",{style:m.sectionTitle,children:"📋 Quick Setup Steps"}),i.jsxs("ol",{style:m.stepList,children:[i.jsx("li",{children:"Create the custom pages directory structure"}),i.jsx("li",{children:"Create your component file with the required code"}),i.jsx("li",{children:"Export your component from the main index file"}),i.jsx("li",{children:"Ensure your App.js imports and passes customPages to ZangoApp"}),i.jsx("li",{children:"Refresh the browser to load your new page"})]}),i.jsx("h3",{style:m.stepTitle,children:"Step 1: Create Directory Structure"}),i.jsx("p",{style:{color:"#4b5563",marginBottom:"12px"},children:"First, ensure the custom pages directory exists. Run this command in your terminal:"}),i.jsxs("div",{style:m.codeBlock,children:[i.jsx("button",{type:"button",style:{...m.copyButton,...o===0?m.copiedButton:{}},onClick:()=>a(p,0),onMouseEnter:b=>{o!==0&&(b.target.style.backgroundColor="#4b5563")},onMouseLeave:b=>{o!==0&&(b.target.style.backgroundColor="#374151")},children:o===0?"✓ Copied!":"Copy"}),i.jsx("pre",{style:m.pre,children:p})]}),i.jsx("p",{style:{fontSize:"13px",color:"#6b7280",marginTop:"8px"},children:"This creates the directory where all your custom page components will live."}),i.jsx("h3",{style:m.stepTitle,children:"Step 2: Create Your Component File"}),i.jsxs("p",{style:{color:"#4b5563",marginBottom:"12px"},children:["Create a new file at"," ",i.jsxs("code",{style:m.inlineCode,children:[l,"/",c,".",u]})," ","and paste this code:"]}),i.jsxs("div",{style:m.codeBlock,children:[i.jsx("button",{type:"button",style:{...m.copyButton,...o===1?m.copiedButton:{}},onClick:()=>a(d,1),onMouseEnter:b=>{o!==1&&(b.target.style.backgroundColor="#4b5563")},onMouseLeave:b=>{o!==1&&(b.target.style.backgroundColor="#374151")},children:o===1?"✓ Copied!":"Copy"}),i.jsx("pre",{style:m.pre,children:d})]}),i.jsx("p",{style:{fontSize:"13px",color:"#6b7280",marginTop:"8px"},children:"This is a basic React component. You can customize it with your own content, styles, and logic."}),i.jsx("h3",{style:m.stepTitle,children:"Step 3: Export from Main Index File"}),i.jsxs("p",{style:{color:"#4b5563",marginBottom:"12px"},children:["Add your component export to"," ",i.jsxs("code",{style:m.inlineCode,children:[l,"/index.",u]}),":"]}),i.jsxs("div",{style:m.codeBlock,children:[i.jsx("button",{type:"button",style:{...m.copyButton,...o===2?m.copiedButton:{}},onClick:()=>a(h,2),onMouseEnter:b=>{o!==2&&(b.target.style.backgroundColor="#4b5563")},onMouseLeave:b=>{o!==2&&(b.target.style.backgroundColor="#374151")},children:o===2?"✓ Copied!":"Copy"}),i.jsx("pre",{style:m.pre,children:h})]}),i.jsx("p",{style:{fontSize:"13px",color:"#6b7280",marginTop:"8px"},children:"The index file exports all custom pages, making them available to the ZangoApp component."}),i.jsx("h3",{style:m.stepTitle,children:"Step 4: Verify App.js Configuration"}),i.jsxs("p",{style:{color:"#4b5563",marginBottom:"12px"},children:["Ensure your ",i.jsx("code",{style:m.inlineCode,children:"App.js"})," imports custom pages and passes them to"," ",i.jsx("code",{style:m.inlineCode,children:"ZangoApp"}),":"]}),i.jsxs("div",{style:m.codeBlock,children:[i.jsx("button",{type:"button",style:{...m.copyButton,...o===3?m.copiedButton:{}},onClick:()=>a(f,3),onMouseEnter:b=>{o!==3&&(b.target.style.backgroundColor="#4b5563")},onMouseLeave:b=>{o!==3&&(b.target.style.backgroundColor="#374151")},children:o===3?"✓ Copied!":"Copy"}),i.jsx("pre",{style:m.pre,children:f})]}),i.jsxs("div",{style:{backgroundColor:"#fef3c7",border:"1px solid #fcd34d",borderRadius:"6px",padding:"12px 16px",marginTop:"12px",fontSize:"13px",color:"#92400e"},children:[i.jsx("strong",{children:"⚠️ Important:"})," The"," ",i.jsx("code",{style:{...m.inlineCode,backgroundColor:"#fde68a",color:"#78350f"},children:"customPages"})," prop is required for ZangoApp to load your custom page components."]}),i.jsx("h3",{style:m.stepTitle,children:"Step 5: Refresh Your Browser"}),i.jsx("p",{style:{color:"#4b5563",marginBottom:"12px"},children:"After saving all files, refresh your browser to load the new component. The custom page should now appear without errors."}),i.jsxs("div",{style:m.note,children:[i.jsx("strong",{children:"💡 Quick Reference:"}),i.jsx("br",{}),i.jsxs("div",{style:{marginTop:"8px",lineHeight:"2"},children:[i.jsx("strong",{children:"Component file:"})," ",i.jsxs("code",{style:{...m.inlineCode,marginLeft:"4px"},children:[l,"/",c,".",u]}),i.jsx("br",{}),i.jsx("strong",{children:"Export name:"})," ",i.jsx("code",{style:{...m.inlineCode,marginLeft:"4px"},children:c}),i.jsx("br",{}),i.jsx("strong",{children:"Index export:"})," ",i.jsxs("code",{style:{...m.inlineCode,marginLeft:"4px"},children:[l,"/index.",u]}),i.jsx("br",{}),i.jsx("strong",{children:"App import:"})," ",i.jsxs("code",{style:{...m.inlineCode,marginLeft:"4px"},children:["import * as customPages from './",l.replace("src/",""),"'"]})]})]})]}),i.jsxs("div",{style:{backgroundColor:"#f0fdf4",border:"1px solid #bbf7d0",borderRadius:"8px",padding:"16px",marginTop:"24px"},children:[i.jsx("h3",{style:{margin:"0 0 8px 0",color:"#15803d",fontSize:"16px"},children:"✅ Need Help?"}),i.jsx("p",{style:{margin:"0",color:"#166534",fontSize:"14px"},children:"Make sure the component name matches exactly between the filename, export statement, and route configuration. Check the browser console for any additional error messages."})]})]})},jc=({componentName:e,routeConfig:t,location:r,customPagesDir:n="src/custom/pages",fileExtension:o="js"})=>{const[s,a]=v.useState(null),[c,l]=v.useState(!1);return v.useEffect(()=>{if(a(null),l(!1),!e){l(!0);return}(async()=>{try{const d=Object.assign({}),h=`../../custom/pages/${e}.${o}`;if(d[h]){const f=await d[h]();a(()=>f.default)}else J.error(`Custom page not found: ${e} at ${h}`),l(!0)}catch(d){J.error("Error loading custom page",d),l(!0)}})()},[e,o]),c?i.jsx(Qp,{componentName:e,routeConfig:t,customPagesDir:n,fileExtension:o}):s?i.jsx(v.Suspense,{fallback:i.jsx("div",{className:"p-6",children:"Loading..."}),children:i.jsx(dn,{children:i.jsx(s,{routeConfig:t,location:r})})}):i.jsx("div",{className:"p-6",children:"Loading custom page..."})},Jp=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),C3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),P3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),Xp=e=>{const t=P3(e);return t.charAt(0).toUpperCase()+t.slice(1)};var E3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const k3=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const A3=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:a,...c},l)=>v.createElement("svg",{ref:l,...E3,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Jp("lucide",o),...!s&&!k3(c)&&{"aria-hidden":"true"},...c},[...a.map(([u,d])=>v.createElement(u,d)),...Array.isArray(s)?s:[s]]));const Je=(e,t)=>{const r=v.forwardRef(({className:n,...o},s)=>v.createElement(A3,{ref:s,iconNode:t,className:Jp(`lucide-${C3(Xp(e))}`,`lucide-${e}`,n),...o}));return r.displayName=Xp(e),r};const Bc=Je("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const O3=Je("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const em=Je("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const Er=Je("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const T3=Je("crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);const N3=Je("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const L3=Je("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);const qr=Je("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const aa=Je("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const ia=Je("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);const M3=Je("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);const I3=Je("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);const F3=Je("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const tm=Je("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const Vc=Je("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);const D3=Je("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);const rm=Je("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const $3=Je("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);const z3=Je("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),nm=v.createContext(void 0),st=()=>{const e=v.useContext(nm);if(!e)throw new Error("useAuthConfig must be used within AuthConfigProvider");return e},om=({children:e,authConfig:t={}})=>{const r={theme:{background:{color:"#f0f2f5"},primaryColor:"#1890ff",secondaryColor:"#6d7280",borderRadius:"8px"},card:{backgroundColor:"#ffffff",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",maxWidth:"400px",padding:"40px"},logo:{position:"center",alt:"Logo"},login:{title:"Welcome Back",subtitle:"Please sign in to your account",submitButtonText:"Sign in",rememberMeText:"Remember me",forgotPasswordText:"Forgot password?",otpButtonText:"Sign in with OTP",showRememberMe:!0,enableTabSwitching:!0,defaultTab:"email",formLabels:{email:"Email",mobile:"Mobile",password:"Password"},formPlaceholders:{email:"Email address",mobile:"Mobile number (+919876543210)",password:"Password"},tabLabels:{email:"Email",mobile:"Mobile"}},roleSelection:{title:"Choose Your Role",subtitle:"Select the role that best matches your current responsibilities",continueButtonText:"Continue as {roleName}",recommendedBadgeText:"Recommended",emptyStateMessage:"No roles available",cardLayout:"grid",gridColumns:3,roleCardStyling:{backgroundColor:"#ffffff",hoverColor:"#f0f2f5",borderRadius:"8px"}},twoFactor:{title:"Two-Factor Authentication",subtitle:"Please enter your verification code",instructionText:"Enter the verification code sent to your device",codeInputLabel:"Verification Code",submitButtonText:"Verify",resendButtonText:"Resend Code",backButtonText:"Back",resendCountdown:60,codeLength:6,methodLabels:{email:"Email",sms:"SMS",mobile:"Mobile"}},resetPassword:{forgotPassword:{title:"Forgot Password",subtitle:"Enter your email address to reset your password",instructionText:"We will send you a reset link",emailLabel:"Email",emailPlaceholder:"Enter your email address",submitButtonText:"Send Reset Link",backToLoginText:"Back to Login",successMessage:"Reset email sent successfully",errorMessage:"Failed to send reset email"},resetForm:{title:"Reset Password",subtitle:"Enter your new password",passwordLabel:"New Password",confirmPasswordLabel:"Confirm Password",passwordPlaceholder:"Enter new password",confirmPasswordPlaceholder:"Confirm new password",submitButtonText:"Reset Password",successMessage:"Password reset successfully",showPasswordRequirements:!0,passwordRequirementsText:"Password requirements:"}},providers:{buttonStyle:"outline",showProviderIcons:!0,separatorText:"OR"},messages:{validation:{required:"Please enter your email address or phone number",passwordRequired:"Please input your password!",invalidEmail:"Please enter a valid email address",invalidMobile:"Please enter a valid phone number",passwordTooShort:"Password is too short",passwordsDoNotMatch:"Passwords do not match"},errors:{loginFailed:"Login failed. Please try again.",networkError:"Network error. Please check your connection.",invalidOTP:"Invalid verification code",expiredToken:"Token has expired"},success:{loginSuccess:"Login successful!",otpSent:"Verification code sent!",passwordReset:"Password reset successfully!",roleSelected:"Role selected successfully!"}}},n=(a,c)=>{const l={...a};for(const u in c){if(!Object.prototype.hasOwnProperty.call(c,u))continue;const d=c[u];d!==null&&typeof d=="object"&&!Array.isArray(d)&&!v.isValidElement(d)?l[u]=n(a[u]||{},d):l[u]=d}return l},o=n(r,t),s={authConfig:o,getLoginConfig:()=>o.login,getRoleSelectionConfig:()=>o.roleSelection,getTwoFactorConfig:()=>o.twoFactor,getResetPasswordConfig:()=>o.resetPassword,getThemeConfig:()=>o.theme,getCardConfig:()=>o.card,getLogoConfig:()=>o.logo,getProvidersConfig:()=>o.providers,getMessagesConfig:()=>o.messages,getCustomComponents:()=>o.customComponents};return i.jsx(nm.Provider,{value:s,children:e})};function ca(e){"@babel/helpers - typeof";return ca=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ca(e)}var U3=/^\s+/,j3=/\s+$/;function ae(e,t){if(e=e||"",t=t||{},e instanceof ae)return e;if(!(this instanceof ae))return new ae(e,t);var r=B3(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}ae.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),r,n,o,s,a,c;return r=t.r/255,n=t.g/255,o=t.b/255,r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),o<=.03928?c=o/12.92:c=Math.pow((o+.055)/1.055,2.4),.2126*s+.7152*a+.0722*c},setAlpha:function(t){return this._a=um(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=am(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=am(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+o+"%)":"hsva("+r+", "+n+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=sm(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=sm(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+o+"%)":"hsla("+r+", "+n+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return im(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return W3(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Me(this._r,255)*100)+"%",g:Math.round(Me(this._g,255)*100)+"%",b:Math.round(Me(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Me(this._r,255)*100)+"%, "+Math.round(Me(this._g,255)*100)+"%, "+Math.round(Me(this._b,255)*100)+"%)":"rgba("+Math.round(Me(this._r,255)*100)+"%, "+Math.round(Me(this._g,255)*100)+"%, "+Math.round(Me(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:nk[im(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+cm(this._r,this._g,this._b,this._a),n=r,o=this._gradientType?"GradientType = 1, ":"";if(t){var s=ae(t);n="#"+cm(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var r=!!t;t=t||this._format;var n=!1,o=this._a<1&&this._a>=0,s=!r&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return s?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return ae(this.toString())},_applyModification:function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(K3,arguments)},brighten:function(){return this._applyModification(Y3,arguments)},darken:function(){return this._applyModification(Q3,arguments)},desaturate:function(){return this._applyModification(Z3,arguments)},saturate:function(){return this._applyModification(R3,arguments)},greyscale:function(){return this._applyModification(G3,arguments)},spin:function(){return this._applyModification(J3,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(tk,arguments)},complement:function(){return this._applyCombination(X3,arguments)},monochromatic:function(){return this._applyCombination(rk,arguments)},splitcomplement:function(){return this._applyCombination(ek,arguments)},triad:function(){return this._applyCombination(lm,[3])},tetrad:function(){return this._applyCombination(lm,[4])}},ae.fromRatio=function(e,t){if(ca(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=No(e[n]));e=r}return ae(e,t)};function B3(e){var t={r:0,g:0,b:0},r=1,n=null,o=null,s=null,a=!1,c=!1;return typeof e=="string"&&(e=ik(e)),ca(e)=="object"&&(kr(e.r)&&kr(e.g)&&kr(e.b)?(t=V3(e.r,e.g,e.b),a=!0,c=String(e.r).substr(-1)==="%"?"prgb":"rgb"):kr(e.h)&&kr(e.s)&&kr(e.v)?(n=No(e.s),o=No(e.v),t=H3(e.h,n,o),a=!0,c="hsv"):kr(e.h)&&kr(e.s)&&kr(e.l)&&(n=No(e.s),s=No(e.l),t=q3(e.h,n,s),a=!0,c="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=um(r),{ok:a,format:e.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}function V3(e,t,r){return{r:Me(e,255)*255,g:Me(t,255)*255,b:Me(r,255)*255}}function sm(e,t,r){e=Me(e,255),t=Me(t,255),r=Me(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),s,a,c=(n+o)/2;if(n==o)s=a=0;else{var l=n-o;switch(a=c>.5?l/(2-n-o):l/(n+o),n){case e:s=(t-r)/l+(t<r?6:0);break;case t:s=(r-e)/l+2;break;case r:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,l:c}}function q3(e,t,r){var n,o,s;e=Me(e,360),t=Me(t,100),r=Me(r,100);function a(u,d,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?u+(d-u)*6*h:h<1/2?d:h<2/3?u+(d-u)*(2/3-h)*6:u}if(t===0)n=o=s=r;else{var c=r<.5?r*(1+t):r+t-r*t,l=2*r-c;n=a(l,c,e+1/3),o=a(l,c,e),s=a(l,c,e-1/3)}return{r:n*255,g:o*255,b:s*255}}function am(e,t,r){e=Me(e,255),t=Me(t,255),r=Me(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),s,a,c=n,l=n-o;if(a=n===0?0:l/n,n==o)s=0;else{switch(n){case e:s=(t-r)/l+(t<r?6:0);break;case t:s=(r-e)/l+2;break;case r:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,v:c}}function H3(e,t,r){e=Me(e,360)*6,t=Me(t,100),r=Me(r,100);var n=Math.floor(e),o=e-n,s=r*(1-t),a=r*(1-o*t),c=r*(1-(1-o)*t),l=n%6,u=[r,a,s,s,c,r][l],d=[c,r,r,a,s,s][l],h=[s,s,c,r,r,a][l];return{r:u*255,g:d*255,b:h*255}}function im(e,t,r,n){var o=[Zt(Math.round(e).toString(16)),Zt(Math.round(t).toString(16)),Zt(Math.round(r).toString(16))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function W3(e,t,r,n,o){var s=[Zt(Math.round(e).toString(16)),Zt(Math.round(t).toString(16)),Zt(Math.round(r).toString(16)),Zt(dm(n))];return o&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function cm(e,t,r,n){var o=[Zt(dm(n)),Zt(Math.round(e).toString(16)),Zt(Math.round(t).toString(16)),Zt(Math.round(r).toString(16))];return o.join("")}ae.equals=function(e,t){return!e||!t?!1:ae(e).toRgbString()==ae(t).toRgbString()},ae.random=function(){return ae.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Z3(e,t){t=t===0?0:t||10;var r=ae(e).toHsl();return r.s-=t/100,r.s=la(r.s),ae(r)}function R3(e,t){t=t===0?0:t||10;var r=ae(e).toHsl();return r.s+=t/100,r.s=la(r.s),ae(r)}function G3(e){return ae(e).desaturate(100)}function K3(e,t){t=t===0?0:t||10;var r=ae(e).toHsl();return r.l+=t/100,r.l=la(r.l),ae(r)}function Y3(e,t){t=t===0?0:t||10;var r=ae(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),ae(r)}function Q3(e,t){t=t===0?0:t||10;var r=ae(e).toHsl();return r.l-=t/100,r.l=la(r.l),ae(r)}function J3(e,t){var r=ae(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,ae(r)}function X3(e){var t=ae(e).toHsl();return t.h=(t.h+180)%360,ae(t)}function lm(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=ae(e).toHsl(),n=[ae(e)],o=360/t,s=1;s<t;s++)n.push(ae({h:(r.h+s*o)%360,s:r.s,l:r.l}));return n}function ek(e){var t=ae(e).toHsl(),r=t.h;return[ae(e),ae({h:(r+72)%360,s:t.s,l:t.l}),ae({h:(r+216)%360,s:t.s,l:t.l})]}function tk(e,t,r){t=t||6,r=r||30;var n=ae(e).toHsl(),o=360/r,s=[ae(e)];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,s.push(ae(n));return s}function rk(e,t){t=t||6;for(var r=ae(e).toHsv(),n=r.h,o=r.s,s=r.v,a=[],c=1/t;t--;)a.push(ae({h:n,s:o,v:s})),s=(s+c)%1;return a}ae.mix=function(e,t,r){r=r===0?0:r||50;var n=ae(e).toRgb(),o=ae(t).toRgb(),s=r/100,a={r:(o.r-n.r)*s+n.r,g:(o.g-n.g)*s+n.g,b:(o.b-n.b)*s+n.b,a:(o.a-n.a)*s+n.a};return ae(a)},ae.readability=function(e,t){var r=ae(e),n=ae(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},ae.isReadable=function(e,t,r){var n=ae.readability(e,t),o,s;switch(s=!1,o=ck(r),o.level+o.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s},ae.mostReadable=function(e,t,r){var n=null,o=0,s,a,c,l;r=r||{},a=r.includeFallbackColors,c=r.level,l=r.size;for(var u=0;u<t.length;u++)s=ae.readability(e,t[u]),s>o&&(o=s,n=ae(t[u]));return ae.isReadable(e,n,{level:c,size:l})||!a?n:(r.includeFallbackColors=!1,ae.mostReadable(e,["#fff","#000"],r))};var qc=ae.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},nk=ae.hexNames=ok(qc);function ok(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function um(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Me(e,t){sk(e)&&(e="100%");var r=ak(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function la(e){return Math.min(1,Math.max(0,e))}function Mt(e){return parseInt(e,16)}function sk(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function ak(e){return typeof e=="string"&&e.indexOf("%")!=-1}function Zt(e){return e.length==1?"0"+e:""+e}function No(e){return e<=1&&(e=e*100+"%"),e}function dm(e){return Math.round(parseFloat(e)*255).toString(16)}function fm(e){return Mt(e)/255}var Rt=(function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function kr(e){return!!Rt.CSS_UNIT.exec(e)}function ik(e){e=e.replace(U3,"").replace(j3,"").toLowerCase();var t=!1;if(qc[e])e=qc[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Rt.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=Rt.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Rt.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=Rt.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Rt.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=Rt.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Rt.hex8.exec(e))?{r:Mt(r[1]),g:Mt(r[2]),b:Mt(r[3]),a:fm(r[4]),format:t?"name":"hex8"}:(r=Rt.hex6.exec(e))?{r:Mt(r[1]),g:Mt(r[2]),b:Mt(r[3]),format:t?"name":"hex"}:(r=Rt.hex4.exec(e))?{r:Mt(r[1]+""+r[1]),g:Mt(r[2]+""+r[2]),b:Mt(r[3]+""+r[3]),a:fm(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=Rt.hex3.exec(e))?{r:Mt(r[1]+""+r[1]),g:Mt(r[2]+""+r[2]),b:Mt(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function ck(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}const fn=e=>({25:ae.mix(e,"#FFFFFF",100).toHexString(),50:ae.mix(e,"#FFFFFF",95).toHexString(),100:ae.mix(e,"#FFFFFF",85).toHexString(),200:ae.mix(e,"#FFFFFF",70).toHexString(),300:ae.mix(e,"#FFFFFF",55).toHexString(),400:ae.mix(e,"#FFFFFF",35).toHexString(),500:ae(e).toHexString(),600:ae.mix(e,"#000000",15).toHexString(),700:ae.mix(e,"#000000",25).toHexString(),800:ae.mix(e,"#000000",35).toHexString(),900:ae.mix(e,"#000000",50).toHexString(),950:ae.mix(e,"#000000",65).toHexString()}),lk=/[{};]|<script|javascript:/i;function Kn(e){const t=String(e).replace(/[{};]/g,"").trim();return lk.test(t)?"":t}const ua=e=>{let t="";const r={brand:fn(e.colors.primary),success:fn(e.colors.success),warning:fn(e.colors.warning),gray:fn(e.colors.gray),error:fn(e.colors.error)};return t=Object.entries(r).map(([n,o])=>Object.entries(o).map(([s,a])=>`--color-${n}-${s}: ${a}`).join(`;
|
|
125
|
+
`)).join(";"),e?.typography&&Object.entries(e.typography).forEach(([n,o])=>{const s=Kn(o);if(!s)return;const a=n.replace(/_/g,"-").replace(/[^a-zA-Z0-9-]/g,"");a&&(t+=`--${a}: ${s}; `)}),e?.borders&&Object.entries(e.borders).forEach(([n,o])=>{const s=Kn(o);if(!s)return;const a=n.replace(/_/g,"-").replace(/[^a-zA-Z0-9-]/g,"");a&&(t+=`--${a}: ${s}; `)}),e?.shadows&&Object.entries(e.shadows).forEach(([n,o])=>{const s=Kn(o);if(!s)return;const a=n.replace(/_/g,"-").replace(/[^a-zA-Z0-9-]/g,"");a&&(t+=`--shadow-${a}: ${s}; `)}),e?.spacing&&Object.entries(e.spacing).forEach(([n,o])=>{const s=Kn(String(o));if(!s)return;const a=String(n).replace(/[^a-zA-Z0-9-]/g,"");a&&(t+=`--spacing-${a}: ${s}px; `)}),t},hm=e=>ae(e).isLight(),uk=e=>hm(e)?"#000000":"#FFFFFF",Hc=(e,t=500)=>{const r=`--color-${e}-${t}`;if(typeof window<"u"&&window.getComputedStyle){const h=window.getComputedStyle(document.documentElement).getPropertyValue(r).trim();if(h)return h}const n=document.documentElement,o=n.style.getPropertyValue("--color-brand-500")||"#5048ED",s=n.style.getPropertyValue("--color-success-500")||"#10B981",a=n.style.getPropertyValue("--color-error-500")||"#F04438",c=n.style.getPropertyValue("--color-warning-500")||"#F59E0B",l=n.style.getPropertyValue("--color-gray-500")||"#6B7280",u={brand:o,success:s,error:a,warning:c,gray:l};return u[e]?fn(u[e])[t]||u[e]:"#5048ED"},dk=e=>{const t=e?.theme||{},r=e?.card||{};let n="";const o=(s,a)=>{if(!a)return;const c=Kn(a);c&&(n+=`${s}: ${c}; `)};if(o("--auth-primary-color",t.primaryColor),o("--auth-secondary-color",t.secondaryColor),o("--auth-font-family",t.fontFamily),o("--auth-border-radius",t.borderRadius),o("--auth-text-color",t.textColor),o("--auth-secondary-text-color",t.secondaryTextColor),o("--auth-muted-text-color",t.mutedTextColor),o("--auth-link-color",t.linkColor),o("--auth-link-hover-color",t.linkHoverColor),o("--auth-bg-color",t.background?.color),o("--auth-bg-gradient",t.background?.gradient),t.background?.image){const s=t.background.image;if(s.startsWith("https://")||s.startsWith("/")){const a=Kn(s);a&&(n+=`--auth-bg-image: url(${a}); `)}}return o("--auth-card-bg",r.backgroundColor),o("--auth-card-border-radius",r.borderRadius),o("--auth-card-shadow",r.boxShadow),o("--auth-card-max-width",r.maxWidth),o("--auth-card-padding",r.padding),o("--auth-card-border",r.border),n},fk=e=>{const t=dk(e);if(!t)return;let r=document.getElementById("auth-theme-variables");r||(r=document.createElement("style"),r.id="auth-theme-variables",document.head.appendChild(r));const n=`
|
|
126
|
+
:root { ${t} }
|
|
127
|
+
|
|
128
|
+
/* Auth component text styling using CSS variables */
|
|
129
|
+
.auth-remember-me,
|
|
130
|
+
.auth-remember-me .ant-checkbox-wrapper,
|
|
131
|
+
.auth-remember-me .ant-checkbox + span,
|
|
132
|
+
.auth-remember-me label,
|
|
133
|
+
.auth-remember-me span {
|
|
134
|
+
color: var(--auth-secondary-text-color, #cbd5e1) !important;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Auth text color classes for easy application */
|
|
138
|
+
.auth-text {
|
|
139
|
+
color: var(--auth-text-color, #f1f5f9) !important;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.auth-secondary-text {
|
|
143
|
+
color: var(--auth-secondary-text-color, #cbd5e1) !important;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.auth-link {
|
|
147
|
+
color: var(--auth-link-color, #60a5fa) !important;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.auth-link:hover {
|
|
151
|
+
color: var(--auth-link-hover-color, #3b82f6) !important;
|
|
152
|
+
}
|
|
153
|
+
`;r.textContent=n},hk=()=>{const e=document.getElementById("auth-theme-variables");e&&e.remove()},Gt=e=>{const t=e?.theme?.background;if(!t)return{};const r={};return t.image&&(t.image.startsWith("https://")||t.image.startsWith("/"))?(r.backgroundImage=`url(${t.image})`,r.backgroundSize="cover",r.backgroundPosition="center",r.backgroundRepeat="no-repeat"):t.gradient?r.background=t.gradient:t.color&&(r.backgroundColor=t.color),r},Yn=e=>{const t=e?.card;if(!t)return{};const r={};return t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.borderRadius&&(r.borderRadius=t.borderRadius),t.boxShadow&&(r.boxShadow=t.boxShadow),t.maxWidth&&(r.maxWidth=t.maxWidth),t.padding&&(r.padding=t.padding),t.border&&(r.border=t.border),r},Qn=e=>{const t=e?.logo;if(!t)return{};const r={};return t.width&&(r.width=t.width),t.height&&(r.height=t.height),t.style&&Object.assign(r,t.style),r},pk=e=>e?.logo?.position||"center",Jn=e=>{const t=pk(e),r=e?.logo;let n="flex items-center mb-6";const o={};switch(t){case"left":n+=" justify-start";break;case"right":n+=" justify-end";break;default:n+=" justify-center";break}return r?.className&&(n+=` ${r.className}`),{className:n,style:o}},Ar=e=>{const t=e?.theme;if(!t)return{};const r={};return t.textColor&&(r.color=t.textColor),t.fontFamily&&(r.fontFamily=t.fontFamily),r.textAlign=t.alignTitle||"center",r},ur=e=>{const t=e?.theme;if(!t)return{textAlign:"center"};const r={};return t.secondaryTextColor&&(r.color=t.secondaryTextColor),t.fontFamily&&(r.fontFamily=t.fontFamily),r.textAlign=t.alignTitle||"center",r},pm=e=>{const t=e?.theme;if(!t)return{};const r={};return t.linkColor&&(r.color=t.linkColor),t.fontFamily&&(r.fontFamily=t.fontFamily),r},mm={AUTH_TOKEN:"authToken",AUTH_STATE:"auth_state",AUTH_CONFIG:"auth_config",PENDING_AUTH_RESULT:"pendingAuthResult",PENDING_AUTH_STEP:"pendingAuthStep",LOGO_CACHE:"zango_app_logo_cache"},it={SSO_NEXT:"sso_next_param",SAML_ERROR:"saml_error",SAML_IN_PROGRESS:"saml_auth_in_progress",PENDING_AUTH_RESULT:"pendingAuthResult",PENDING_AUTH_STEP:"pendingAuthStep"};function mk(e){const t=new Set(Object.values(mm));e&&t.add(e);for(const r of t)try{localStorage.removeItem(r)}catch(n){J.warn("[Storage] Failed to clear localStorage key",{key:r,error:n})}for(const r of Object.values(it))try{sessionStorage.removeItem(r)}catch(n){J.warn("[Storage] Failed to clear sessionStorage key",{key:r,error:n})}}function Kt(e){if(!e||typeof e!="string")return!1;const t=e.trim();if(t.includes("\\")||!t.startsWith("/")||t.startsWith("//")||t.toLowerCase().includes("javascript:")||t.toLowerCase().includes("data:")||t.split("?")[0].includes("://"))return!1;const n=t.split("?")[0];if(n==="/app/login"||n==="/app/login/"){const o=t.indexOf("?"),s=new URLSearchParams(o>=0?t.slice(o+1):"");if(!s.has("step")||!s.get("step")?.trim())return!1}return!0}function It(e){if(!e)return null;try{const r=new URLSearchParams(e).get("next");return r||null}catch(t){return J.error("Error parsing next parameter",t),null}}function Be(e,t,r="/app"){return e&&Kt(e)?e:t&&Kt(t)?t:Kt(r)?r:"/app"}const Xn=it.SSO_NEXT;function gm(e){try{sessionStorage.removeItem(Xn),e&&Kt(e)&&sessionStorage.setItem(Xn,e)}catch{}}function Or(){try{const e=sessionStorage.getItem(Xn);if(sessionStorage.removeItem(Xn),e&&Kt(e))return e}catch{}return null}function gk(){try{sessionStorage.removeItem(Xn)}catch{}}function Xe(e,t="/app"){if(!e){window.location.href=t;return}const r=Be(e,null,t);r!==e&&J.warn(`[Security] Redirect URL sanitized: ${e} -> ${r}`),window.location.href=r}function bm(e){return typeof e!="string"?String(e):e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,"").replace(/<object\b[^<]*(?:(?!<\/object>)<[^<]*)*<\/object>/gi,"").replace(/<embed\b[^>]*>/gi,"").replace(/\s*on\w+\s*=\s*["'][^"']*["']/gi,"").replace(/\s*on\w+\s*=\s*[^\s>]*/gi,"").replace(/javascript:/gi,"").replace(/data:(?!image\/)/gi,"data-sanitized:").replace(/vbscript:/gi,"").replace(/file:/gi,"")}function da(e){if(e==null)return e;if(typeof e=="string")return bm(e);if(typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(t=>da(t));if(typeof e=="object"){const t={};for(const[r,n]of Object.entries(e)){const o=bm(r);t[o]=da(n)}return t}return e}function bk(e,t){try{const r=da(t);sessionStorage.setItem(e,JSON.stringify(r))}catch(r){J.error("[Storage] Failed to store sanitized data",r)}}function yk(e){try{const t=sessionStorage.getItem(e);if(!t)return null;const r=JSON.parse(t);return da(r)}catch(t){return J.error("[Storage] Failed to retrieve data",t),sessionStorage.removeItem(e),null}}function ym(e){sessionStorage.removeItem(e)}const dr=({appName:e,appLogo:t,children:r})=>qe()?i.jsxs("div",{className:"auth-mobile-shell relative min-h-dvh flex flex-col bg-background overflow-hidden [padding:calc(env(safe-area-inset-top)+56px)_28px_max(env(safe-area-inset-bottom),24px)]","data-has-cta":"true",children:[i.jsx("div",{className:"auth-mobile-shell__wash absolute pointer-events-none z-0 [-inset-x-10] [-top-[120px]] h-[320px]","aria-hidden":!0,style:{background:"radial-gradient(60% 70% at 50% 0%, color-mix(in srgb, var(--color-brand-500, #5048ED) 14%, transparent) 0%, transparent 70%)"}}),t?i.jsx("div",{className:"auth-mobile-shell__logo-ring relative z-[1] mx-auto mb-7 flex items-center justify-center",children:i.jsx("img",{src:t,alt:e||"Logo",className:"auth-mobile-shell__logo-img max-w-16 max-h-16 object-contain rounded-[14px] p-2 bg-white"})}):null,i.jsx("main",{className:"auth-mobile-shell__content relative z-[1] flex-1 w-full max-w-[420px] mx-auto",children:r})]}):i.jsx(i.Fragment,{children:r});function wm(e,t){return function(){return e.apply(t,arguments)}}const{toString:wk}=Object.prototype,{getPrototypeOf:Hr}=Object,{iterator:Lo,toStringTag:vm}=Symbol,Mo=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),_m=e=>typeof e=="string"&&(e==="__proto__"||e==="constructor"||e==="prototype"),xm=(e,t,r)=>e===Object.prototype||!r&&t===null,vk=e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(r=>{if(_m(r))return!1;const n=Object.getOwnPropertyDescriptor(e,r);return!!n&&n.configurable&&n.writable===!0})},Io=(e,t)=>{let r=e;const n=[];for(;r!=null;){if(n.indexOf(r)!==-1)return!1;n.push(r);const o=Hr(r);if(xm(r,o,r===e))return!1;if(Mo(r,t))return!0;r=o}return!1},_k=(e,t)=>e!=null&&Io(e,t)?e[t]:void 0,xk=e=>{if(e==null||typeof e!="object"&&typeof e!="function")return e;const t=Hr(e);if(t===null&&vk(e))return e;const r=Object.create(null),n=Object.create(null),o=[];let s=e;for(;s!=null&&o.indexOf(s)===-1;){o.push(s);const a=s===e?t:Hr(s);if(xm(s,a,s===e))break;const c=Object.getOwnPropertyNames(s);Object.getOwnPropertySymbols&&c.push(...Object.getOwnPropertySymbols(s));for(const l of c)_m(l)||Mo(n,l)||(r[l]=e[l],n[l]=!0);s=a}return r},Wc=(e=>t=>{const r=wk.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Vt=e=>(e=e.toLowerCase(),t=>Wc(t)===e),fa=e=>t=>typeof t===e,{isArray:hn}=Array,pn=fa("undefined");function eo(e){return e!==null&&!pn(e)&&e.constructor!==null&&!pn(e.constructor)&&At(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Sm=Vt("ArrayBuffer");function Sk(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Sm(e.buffer),t}const Ck=fa("string"),At=fa("function"),Cm=fa("number"),to=e=>e!==null&&typeof e=="object",Pk=e=>e===!0||e===!1,ha=e=>{if(!to(e))return!1;const t=Hr(e);return(t===null||t===Object.prototype||Hr(t)===null)&&!Io(e,vm)&&!Io(e,Lo)},Ek=e=>{if(!to(e)||eo(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},kk=Vt("Date"),Ak=Vt("File"),Ok=e=>!!(e&&typeof e.uri<"u"),Tk=e=>e&&typeof e.getParts<"u",Nk=Vt("Blob"),Lk=Vt("FileList"),Mk=Vt("Set"),Ik=e=>to(e)&&At(e.pipe);function Fk(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Pm=Fk(),Em=typeof Pm.FormData<"u"?Pm.FormData:void 0,Dk=e=>{if(!e)return!1;if(Em&&e instanceof Em)return!0;const t=Hr(e);if(!t||t===Object.prototype||!At(e.append))return!1;const r=Wc(e);return r==="formdata"||r==="object"&&At(e.toString)&&e.toString()==="[object FormData]"},$k=Vt("URLSearchParams"),[zk,Uk,jk,Bk]=["ReadableStream","Request","Response","Headers"].map(Vt),Vk=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Fo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),hn(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(eo(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let c;for(n=0;n<a;n++)c=s[n],t.call(null,e[c],c,e)}}function km(e,t){if(eo(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const mn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Am=e=>!pn(e)&&e!==mn;function Zc(...e){const{caseless:t,skipUndefined:r}=Am(this)&&this||{},n={},o=(s,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const c=t&&typeof a=="string"&&km(n,a)||a,l=Mo(n,c)?n[c]:void 0;ha(l)&&ha(s)?n[c]=Zc(l,s):ha(s)?n[c]=Zc({},s):hn(s)?n[c]=s.slice():(!r||!pn(s))&&(n[c]=s)};for(let s=0,a=e.length;s<a;s++){const c=e[s];if(!c||eo(c)||(Fo(c,o),typeof c!="object"||hn(c)))continue;const l=Object.getOwnPropertySymbols(c);for(let u=0;u<l.length;u++){const d=l[u];eA.call(c,d)&&o(c[d],d)}}return n}const qk=(e,t,r,{allOwnKeys:n}={})=>(Fo(t,(o,s)=>{r&&At(o)?Object.defineProperty(e,s,{__proto__:null,value:wm(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Hk=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Wk=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},Zk=(e,t,r,n)=>{let o,s,a;const c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],(!n||n(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=r!==!1&&Hr(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Rk=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Gk=e=>{if(!e)return null;if(hn(e))return e;let t=e.length;if(!Cm(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Kk=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Hr(Uint8Array)),Yk=(e,t)=>{const n=(e&&e[Lo]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},Qk=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Jk=Vt("HTMLFormElement"),Xk=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),{propertyIsEnumerable:eA}=Object.prototype,tA=Vt("RegExp"),Om=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Fo(r,(o,s)=>{let a;(a=t(o,s,e))!==!1&&(n[s]=a||o)}),Object.defineProperties(e,n)},rA=e=>{Om(e,(t,r)=>{if(At(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(At(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},nA=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return hn(e)?n(e):n(String(e).split(t)),r},oA=()=>{},sA=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function aA(e){return!!(e&&At(e.append)&&e[vm]==="FormData"&&e[Lo])}const iA=e=>{const t=new WeakSet,r=n=>{if(to(n)){if(t.has(n))return;if(eo(n))return n;if(!("toJSON"in n)){t.add(n);let o;if(Mk(n)){o=[];for(const s of n){const a=r(s);!pn(a)&&o.push(a)}}else o=hn(n)?[]:{},Fo(n,(s,a)=>{const c=r(s);!pn(c)&&(o[a]=c)});return t.delete(n),o}}return n};return r(e)},cA=Vt("AsyncFunction"),lA=e=>e&&(to(e)||At(e))&&At(e.then)&&At(e.catch),Tm=((e,t)=>e?setImmediate:t?((r,n)=>(mn.addEventListener("message",({source:o,data:s})=>{o===mn&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),mn.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",At(mn.postMessage)),uA=typeof queueMicrotask<"u"?queueMicrotask.bind(mn):typeof process<"u"&&process.nextTick||Tm,Nm=e=>e!=null&&At(e[Lo]),L={isArray:hn,isArrayBuffer:Sm,isBuffer:eo,isFormData:Dk,isArrayBufferView:Sk,isString:Ck,isNumber:Cm,isBoolean:Pk,isObject:to,isPlainObject:ha,isEmptyObject:Ek,isReadableStream:zk,isRequest:Uk,isResponse:jk,isHeaders:Bk,isUndefined:pn,isDate:kk,isFile:Ak,isReactNativeBlob:Ok,isReactNative:Tk,isBlob:Nk,isRegExp:tA,isFunction:At,isStream:Ik,isURLSearchParams:$k,isTypedArray:Kk,isFileList:Lk,forEach:Fo,merge:Zc,extend:qk,trim:Vk,stripBOM:Hk,inherits:Wk,toFlatObject:Zk,kindOf:Wc,kindOfTest:Vt,endsWith:Rk,toArray:Gk,forEachEntry:Yk,matchAll:Qk,isHTMLForm:Jk,hasOwnProperty:Mo,hasOwnProp:Mo,hasOwnInPrototypeChain:Io,getSafeProp:_k,toSafeFlatObject:xk,reduceDescriptors:Om,freezeMethods:rA,toObjectSet:nA,toCamelCase:Xk,noop:oA,toFiniteNumber:sA,findKey:km,global:mn,isContextDefined:Am,isSpecCompliantForm:aA,toJSONObject:iA,isAsyncFn:cA,isThenable:lA,setImmediate:Tm,asap:uA,isIterable:Nm,isSafeIterable:e=>e!=null&&Io(e,Lo)&&Nm(e)},dA=L.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"]),fA=e=>{const t={};let r,n,o;return e&&e.split(`
|
|
154
|
+
`).forEach(function(a){o=a.indexOf(":"),r=a.substring(0,o).trim().toLowerCase(),n=a.substring(o+1).trim();const c=L.hasOwnProp(t,r);!r||c&&L.hasOwnProp(dA,r)||(r==="set-cookie"?c?t[r].push(n):t[r]=[n]:t[r]=c?t[r]+", "+n:n)}),t};function hA(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const pA=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),mA=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Rc(e,t){return L.isArray(e)?e.map(r=>Rc(r,t)):hA(String(e).replace(t,""))}const gA=e=>Rc(e,pA),bA=e=>Rc(e,mA);function Lm(e){const t=Object.create(null);return L.forEach(e.toJSON(),(r,n)=>{t[n]=bA(r)}),t}const Mm=Symbol("internals");function Do(e){return e&&String(e).trim().toLowerCase()}function pa(e){return e===!1||e==null?e:L.isArray(e)?e.map(pa):gA(String(e))}function yA(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const wA=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Gc(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}function vA(e){const t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let r="";for(let n=1;n<t;n++){const o=e.charCodeAt(n);if(o===34||o===92&&(n+=1,n>=t))return e;r+=e[n]}return r}function _A(e){const t=Object.create(null),r=String(e);let n=0,o=!1,s=!1;function a(c){const l=Gc(r.slice(n,c)),u=l.indexOf("=");if(u<1)return;const d=Gc(l.slice(0,u));if(!wA.test(d))return;const h=d.toLowerCase();if(h==="__proto__"||h==="constructor"||h==="prototype")return;const f=Gc(l.slice(u+1));t[h]=vA(f)}for(let c=0;c<r.length;c++){const l=r.charCodeAt(c);o?s?s=!1:l===92?s=!0:l===34&&(o=!1):l===34?o=!0:(l===44||l===59)&&(a(c),n=c+1)}return a(r.length),t}const xA=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Kc(e,t,r,n,o){if(L.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!L.isString(t)){if(L.isString(n))return t.indexOf(n)!==-1;if(L.isRegExp(n))return n.test(t)}}function SA(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function CA(e,t){const r=L.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(o,s,a){return this[n].call(this,t,o,s,a)},configurable:!0})})}let ct=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(c,l,u){const d=Do(l);if(!d)return;const h=L.findKey(o,d);(!h||o[h]===void 0||u===!0||u===void 0&&o[h]!==!1)&&(o[h||l]=pa(c))}const a=(c,l)=>L.forEach(c,(u,d)=>s(u,d,l));if(L.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(L.isString(t)&&(t=t.trim())&&!xA(t))a(fA(t),r);else if(L.isObject(t)&&L.isSafeIterable(t)){let c=Object.create(null),l,u;for(const d of t){if(!L.isArray(d))throw new TypeError("Object iterator must return a key-value pair");u=d[0],L.hasOwnProp(c,u)?(l=c[u],c[u]=L.isArray(l)?[...l,d[1]]:[l,d[1]]):c[u]=d[1]}a(c,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=Do(t),t){const n=L.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return yA(o);if(L.isFunction(r))return r.call(this,o,n);if(L.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Do(t),t){const n=L.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Kc(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(a){if(a=Do(a),a){const c=L.findKey(n,a);c&&(!r||Kc(n,n[c],c,r))&&(delete n[c],o=!0)}}return L.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||Kc(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return L.forEach(this,(o,s)=>{const a=L.findKey(n,s);if(a){r[a]=pa(o),delete r[s];return}const c=t?SA(s):String(s).trim();c!==s&&delete r[s],r[c]=pa(o),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return L.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&L.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
155
|
+
`)}getSetCookie(){const t=this.get("set-cookie");return L.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return _A(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Mm]=this[Mm]={accessors:{}}).accessors,o=this.prototype;function s(a){const c=Do(a);n[c]||(CA(o,a),n[c]=!0)}return L.isArray(t)?t.forEach(s):s(t),this}};ct.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(ct.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),L.freezeMethods(ct);const ma="[REDACTED ****]";function PA(e){if(L.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(L.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function EA(e,t){const r=new Set(t.map(s=>String(s).toLowerCase())),n=[],o=s=>{if(s===null||typeof s!="object"||L.isBuffer(s))return s;if(n.indexOf(s)!==-1)return;s instanceof ct&&(s=s.toJSON()),n.push(s);let a;if(L.isArray(s))a=[],s.forEach((c,l)=>{const u=o(c);L.isUndefined(u)||(a[l]=u)});else{if(!L.isPlainObject(s)&&PA(s))return n.pop(),s;a=Object.create(null);for(const[c,l]of Object.entries(s)){const u=r.has(c.toLowerCase())?ma:o(l);L.isUndefined(u)||(a[c]=u)}}return n.pop(),a};return o(e)}function Im(e){try{return String(e)}catch{return""}}function kA(e){return e.errors.map(r=>{try{return r&&r.message?Im(r.message):Im(r)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}let oe=class fy extends Error{static from(t,r,n,o,s,a){let c=t.message;!c&&L.isArray(t.errors)&&t.errors.length&&(c=kA(t));const l=new fy(c,r||t.code,n,o,s);return Object.defineProperty(l,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),l.name=t.name,t.status!=null&&l.status==null&&(l.status=t.status),a&&Object.assign(l,a),l}constructor(t,r,n,o,s){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),o&&(this.request=o),s&&(this.response=s,this.status=s.status)}toJSON(){const t=this.config,r=t&&L.hasOwnProp(t,"redact")?t.redact:void 0,n=L.isArray(r)&&r.length>0?EA(t,r):L.toJSONObject(t);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}}};oe.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",oe.ERR_BAD_OPTION="ERR_BAD_OPTION",oe.ECONNABORTED="ECONNABORTED",oe.ETIMEDOUT="ETIMEDOUT",oe.ECONNREFUSED="ECONNREFUSED",oe.ERR_NETWORK="ERR_NETWORK",oe.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",oe.ERR_DEPRECATED="ERR_DEPRECATED",oe.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",oe.ERR_BAD_REQUEST="ERR_BAD_REQUEST",oe.ERR_CANCELED="ERR_CANCELED",oe.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",oe.ERR_INVALID_URL="ERR_INVALID_URL",oe.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const AA=null,Fm=100;function Yc(e){return L.isPlainObject(e)||L.isArray(e)}function Dm(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function Qc(e,t,r){return e?e.concat(t).map(function(o,s){return o=Dm(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function OA(e){return L.isArray(e)&&!e.some(Yc)}const TA=L.toFlatObject(L,{},null,function(t){return/^is[A-Z]/.test(t)});function ga(e,t,r){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(w,_)=>{const P=L.getSafeProp(r,w);return L.isUndefined(P)?_:P},o=n("metaTokens",!0),s=n("visitor")||g,a=n("dots",!1),c=n("indexes",!1),l=n("Blob")||typeof Blob<"u"&&Blob,u=n("maxDepth",Fm),d=l&&L.isSpecCompliantForm(t),h=[];if(!L.isFunction(s))throw new TypeError("visitor must be a function");function f(w){if(w===null)return"";if(L.isDate(w))return w.toISOString();if(L.isBoolean(w))return w.toString();if(!d&&L.isBlob(w))throw new oe("Blob is not supported. Use a Buffer instead.");if(L.isArrayBuffer(w)||L.isTypedArray(w)){if(d&&typeof l=="function")return new l([w]);throw new oe("Blob is not supported. Use a Buffer instead.",oe.ERR_NOT_SUPPORT)}return w}function p(w){if(w>u)throw new oe("Object is too deeply nested ("+w+" levels). Max depth: "+u,oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(w,_){if(u===1/0)return JSON.stringify(w);const P=[];return JSON.stringify(w,function(S,O){if(!L.isObject(O))return O;for(;P.length&&P[P.length-1]!==this;)P.pop();return P.push(O),p(_+P.length-1),O})}function g(w,_,P){let E=w;if(L.isReactNative(t)&&L.isReactNativeBlob(w))return t.append(Qc(P,_,a),f(w)),!1;if(w&&!P&&typeof w=="object"){if(L.endsWith(_,"{}"))_=o?_:_.slice(0,-2),w=m(w,1);else if(L.isArray(w)&&OA(w)||(L.isFileList(w)||L.endsWith(_,"[]"))&&(E=L.toArray(w)))return _=Dm(_),E.forEach(function(O,N){!(L.isUndefined(O)||O===null)&&t.append(c===!0?Qc([_],N,a):c===null?_:_+"[]",f(O))}),!1}return Yc(w)?!0:(t.append(Qc(P,_,a),f(w)),!1)}const y=Object.assign(TA,{defaultVisitor:g,convertValue:f,isVisitable:Yc});function b(w,_,P=0){if(!L.isUndefined(w)){if(p(P),h.indexOf(w)!==-1)throw new Error("Circular reference detected in "+_.join("."));h.push(w),L.forEach(w,function(S,O){(!(L.isUndefined(S)||S===null)&&s.call(t,S,L.isString(O)?O.trim():O,_,y))===!0&&b(S,_?_.concat(O):[O],P+1)}),h.pop()}}if(!L.isObject(e))throw new TypeError("data must be an object");return b(e),t}function $m(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function Jc(e,t){this._pairs=[],e&&ga(e,this,t)}const zm=Jc.prototype;zm.append=function(t,r){this._pairs.push([t,r])},zm.toString=function(t){const r=t?n=>t.call(this,n,$m):$m;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function NA(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Um(e,t,r){if(!t)return e;e=e||"";const n=L.isFunction(r)?{serialize:r}:r,o=L.getSafeProp(n,"encode")||NA,s=L.getSafeProp(n,"serialize");let a;if(s?a=s(t,n):a=L.isURLSearchParams(t)?t.toString():new Jc(t,n).toString(o),a){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}const $o=Symbol("internals");function jm(e){return e?e.length:0}function Bm(e){if(e)for(;e.length&&e[e.length-1]===null;)e.pop()}function zo(e,t){const r=e.handlers,n=jm(r);r!==t.handlersRef?(t.handlersRef=r,t.handlerEntries.clear()):n!==t.handlersLength&&(n?t.handlerEntries.forEach(function(s,a){r[s.index]!==s.handler&&t.handlerEntries.delete(a)}):t.handlerEntries.clear()),t.handlersLength=n}class Vm{constructor(){this.handlers=[],this[$o]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(t,r,n){const o={fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null},s=this[$o];this.handlers==null&&(this.handlers=[]),zo(this,s);const a=s.nextId++;return this.handlers.push(o),s.handlerEntries.set(a,{handler:o,index:this.handlers.length-1}),s.handlersLength=this.handlers.length,a}eject(t){const r=this[$o];zo(this,r);const n=r.handlerEntries.get(t);if(n){if(r.handlerEntries.delete(t),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,r.iterationDepth||(Bm(this.handlers),r.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],zo(this,this[$o]))}forEach(t){const r=this[$o];zo(this,r),r.iterationDepth++;try{L.forEach(this.handlers,function(o){o!==null&&t(o)})}finally{--r.iterationDepth||(zo(this,r),Bm(this.handlers),r.handlersLength=jm(this.handlers))}}}const Xc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},LA={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Jc,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},el=typeof window<"u"&&typeof document<"u",tl=typeof navigator=="object"&&navigator||void 0,MA=el&&(!tl||["ReactNative","NativeScript","NS"].indexOf(tl.product)<0),IA=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",FA=el&&window.location.href||"http://localhost",nt={...Object.freeze({__proto__:null,hasBrowserEnv:el,hasStandardBrowserEnv:MA,hasStandardBrowserWebWorkerEnv:IA,navigator:tl,origin:FA}),...LA};function DA(e,t){return ga(e,new nt.classes.URLSearchParams,{visitor:function(r,n,o,s){return nt.isNode&&L.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}const qm=Fm;function Hm(e){if(e>qm)throw new oe("FormData field is too deeply nested ("+e+" levels). Max depth: "+qm,oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function $A(e){const t=[],r=/[^.[\]]+|\[([^.[\]]*)]/g;let n;for(;(n=r.exec(e))!==null;)Hm(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function zA(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function Wm(e){function t(r,n,o,s){Hm(s);let a=r[s++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),l=s>=r.length;return a=!a&&L.isArray(o)?o.length:a,l?(L.hasOwnProp(o,a)?o[a]=L.isArray(o[a])?o[a].concat(n):[o[a],n]:o[a]=n,!c):((!L.hasOwnProp(o,a)||!L.isObject(o[a]))&&(o[a]=[]),t(r,n,o[a],s)&&L.isArray(o[a])&&(o[a]=zA(o[a])),!c)}if(L.isFormData(e)&&L.isFunction(e.entries)){const r={};return L.forEachEntry(e,(n,o)=>{t($A(n),o,r,0)}),r}return null}const Zm=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),ro=(e,t)=>e!=null&&L.hasOwnProp(e,t)?e[t]:void 0;function UA(e,t,r){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Uo={transitional:Xc,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=L.isObject(t);if(s&&L.isHTMLForm(t)&&(t=new FormData(t)),L.isFormData(t))return o?JSON.stringify(Wm(t)):t;if(L.isArrayBuffer(t)||L.isBuffer(t)||L.isStream(t)||L.isFile(t)||L.isBlob(t)||L.isReadableStream(t))return t;if(L.isArrayBufferView(t))return t.buffer;if(L.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(s){const l=ro(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return DA(t,l).toString();if((c=L.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=ro(this,"env"),d=u&&u.FormData;return ga(c?{"files[]":t}:t,d&&new d,l)}}return s||o?(r.setContentType("application/json",!1),UA(t)):t}],transformResponse:[function(t){const r=ro(this,"transitional")||Uo.transitional,n=r&&r.forcedJSONParsing,o=ro(this,"responseType"),s=o==="json";if(L.isResponse(t)||L.isReadableStream(t))return t;if(t&&L.isString(t)&&(n&&!o||s)){const c=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,ro(this,"parseReviver"))}catch(l){if(c)throw l.name==="SyntaxError"?oe.from(l,oe.ERR_BAD_RESPONSE,this,null,ro(this,"response")):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:nt.classes.FormData,Blob:nt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(Zm,e=>{Uo.headers[e]={}});function rl(e,t){const r=this||Uo,n=t||r,o=ct.from(n.headers);let s=n.data;return L.forEach(e,function(c){s=c.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Rm(e){return!!(e&&e.__CANCEL__)}let jo=class extends oe{constructor(t,r,n){super(t??"canceled",oe.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function Gm(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new oe("Request failed with status code "+r.status,r.status>=400&&r.status<500?oe.ERR_BAD_REQUEST:oe.ERR_BAD_RESPONSE,r.config,r.request,r))}const jA=/[\t\n\r]/g;function Km(e){if(typeof e!="string")return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(jA,"")}function nl(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function BA(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,a;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),d=n[s];a||(a=u),r[o]=l,n[o]=u;let h=s,f=0;for(;h!==o;)f+=r[h++],h=h%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-a<t)return;const p=d&&u-d;return p?Math.round(f*1e3/p):void 0}}function VA(e,t){let r=0,n=1e3/t,o,s;const a=(d,h=Date.now())=>{r=h,o=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const h=Date.now(),f=h-r;f>=n?a(d,h):(o=d,s||(s=setTimeout(()=>{s=null,a(o)},n-f)))},()=>o&&a(o),(...d)=>a(d)]}const ba=(e,t,r=3)=>{let n=0;const o=BA(50,250);return VA(s=>{if(!s||!L.isNumber(s.loaded))return;const a=s.loaded,c=s.lengthComputable?s.total:void 0,l=Math.max(0,c!=null?Math.min(a,c):a),u=Math.max(0,l-n),d=o(u);n=Math.max(n,l);const h={loaded:l,total:c,progress:c?l/c:void 0,bytes:u,rate:d||void 0,estimated:d&&c?(c-l)/d:void 0,event:s,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},r)},Ym=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Qm=(e,t=L.asap)=>(...r)=>t(()=>e(...r)),qA=nt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,nt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(nt.origin),nt.navigator&&/(msie|trident)/i.test(nt.navigator.userAgent)):()=>!0,HA=nt.hasStandardBrowserEnv?{write(e,t,r,n,o,s,a){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];L.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),L.isString(n)&&c.push(`path=${n}`),L.isString(o)&&c.push(`domain=${o}`),s===!0&&c.push("secure"),L.isString(a)&&c.push(`SameSite=${a}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),o=n.indexOf("=");if(o!==-1&&n.slice(0,o)===e)try{return decodeURIComponent(n.slice(o+1))}catch{return n.slice(o+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function WA(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ZA(e,t){if(!t)return e;let r=e.length;for(;r>0&&e.charCodeAt(r-1)===47;)r--;return e.slice(0,r)+"/"+t.replace(/^\/+/,"")}const RA=/^https?:(?!\/\/)/i;function GA(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,r,n="")=>`${r}${n}${ma}`)}function KA(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${ma}@`),r=t.indexOf("#"),o=(r===-1?t:t.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${ma}`);return r===-1?o:`${o}#${GA(t.slice(r+1))}`}function Jm(e,t){if(typeof e=="string"){const r=Km(e);if(RA.test(r))throw new oe(`Invalid URL ${JSON.stringify(KA(r))}: missing "//" after protocol`,oe.ERR_INVALID_URL,t)}}function Xm(e,t,r,n){Jm(t,n);let o=!WA(t);return e&&(o||r===!1)?(Jm(e,n),ZA(e,t)):t}const eg=e=>e instanceof ct?{...e}:e,YA=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function gn(e,t){e=e||{},t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(d,h,f,p){return L.isPlainObject(d)&&L.isPlainObject(h)?L.merge.call({caseless:p},d,h):L.isPlainObject(h)?L.merge({},h):L.isArray(h)?h.slice():h}function o(d,h,f,p){if(L.isUndefined(h)){if(!L.isUndefined(d))return n(void 0,d,f,p)}else return n(d,h,f,p)}function s(d,h){if(!L.isUndefined(h))return n(void 0,h)}function a(d,h){if(L.isUndefined(h)){if(!L.isUndefined(d))return n(void 0,d)}else return n(void 0,h)}function c(d){const h=L.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!L.isUndefined(h))if(L.isPlainObject(h)){if(L.hasOwnProp(h,d))return h[d]}else return;const f=L.hasOwnProp(e,"transitional")?e.transitional:void 0;if(L.isPlainObject(f)&&L.hasOwnProp(f,d))return f[d]}function l(d,h,f){if(L.hasOwnProp(t,f))return n(d,h);if(L.hasOwnProp(e,f))return n(void 0,d)}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutErrorMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:l,headers:(d,h,f)=>o(eg(d),eg(h),f,!0)};return L.forEach(YA({...e,...t}),function(h){if(h==="__proto__"||h==="constructor"||h==="prototype")return;const f=L.hasOwnProp(u,h)?u[h]:o,p=L.hasOwnProp(e,h)?e[h]:void 0,m=L.hasOwnProp(t,h)?t[h]:void 0,g=f(p,m,h);L.isUndefined(g)&&f!==l||(r[h]=g)}),L.hasOwnProp(t,"validateStatus")&&L.isUndefined(t.validateStatus)&&c("validateStatusUndefinedResolves")===!1&&(L.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const QA=["content-type","content-length"];function JA(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([n,o])=>{QA.includes(n.toLowerCase())&&e.set(n,o)})}const XA=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function tg(e){const t=gn({},e),r=f=>L.hasOwnProp(t,f)?t[f]:void 0,n=r("data");let o=r("withXSRFToken");const s=r("xsrfHeaderName"),a=r("xsrfCookieName");let c=r("headers");const l=r("auth"),u=r("baseURL"),d=r("allowAbsoluteUrls"),h=r("url");if(t.headers=c=ct.from(c),t.url=Um(Xm(u,h,d,t),r("params"),r("paramsSerializer")),l){const f=L.getSafeProp(l,"username")||"",p=L.getSafeProp(l,"password")||"";try{c.set("Authorization","Basic "+btoa(f+":"+(p?XA(p):"")))}catch(m){throw oe.from(m,oe.ERR_BAD_OPTION_VALUE,e)}}if(L.isFormData(n)){const f=L.getSafeProp(n,"getHeaders");nt.hasStandardBrowserEnv||nt.hasStandardBrowserWebWorkerEnv||L.isReactNative(n)?c.setContentType(void 0):L.isFunction(f)&&JA(c,f.call(n),r("formDataHeaderPolicy"))}if(nt.hasStandardBrowserEnv&&(L.isFunction(o)&&(o=o(t)),o===!0||o==null&&qA(t.url))){const p=s&&a&&HA.read(a);p&&c.set(s,p)}return t}const eO=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=tg(e);let s=o.data;const a=ct.from(o.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:u}=o,d,h,f,p,m,g;function y(){p&&p(),m&&m(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function w(P){if(!b)return;if(b.status===0&&(nl(Km(o.url))||nl(nt.origin))!=="file"&&!(b.responseURL&&b.responseURL.startsWith("file:"))){n(new oe("Request aborted",oe.ECONNABORTED,e,b)),y(),b=null;return}try{P?g&&g(P):m&&m()}catch(N){setTimeout(()=>{throw N})}if(!b)return;const E=ct.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),O={data:!c||c==="text"||c==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:E,config:e,request:b};Gm(function(k){r(k),y()},function(k){n(k),y()},O),b=null}"onloadend"in b?b.onloadend=w:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.startsWith("file:"))||setTimeout(w)},b.onabort=function(){b&&(n(new oe("Request aborted",oe.ECONNABORTED,e,b)),y(),b=null)},b.onerror=function(E){const S=E&&E.message?E.message:"Network Error",O=new oe(S,oe.ERR_NETWORK,e,b);O.event=E||null,n(O),y(),b=null},b.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const S=o.transitional||Xc;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),n(new oe(E,S.clarifyTimeoutError?oe.ETIMEDOUT:oe.ECONNABORTED,e,b)),y(),b=null},s===void 0&&a.setContentType(null),"setRequestHeader"in b&&L.forEach(Lm(a),function(E,S){b.setRequestHeader(S,E)}),L.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),c&&c!=="json"&&(b.responseType=o.responseType),u&&([f,m,g]=ba(u,!0),b.addEventListener("progress",f)),l&&b.upload&&([h,p]=ba(l),b.upload.addEventListener("progress",h),b.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(d=P=>{b&&(n(!P||P.type?new jo(null,e,b):P),b.abort(),y(),b=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const _=nl(o.url);if(_&&!nt.protocols.includes(_)){n(new oe("Unsupported protocol "+_+":",oe.ERR_BAD_REQUEST,e)),y();return}b.send(s||null)})},tO=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const o=function(l){if(!n){n=!0,a();const u=l instanceof Error?l:this.reason;r.abort(u instanceof oe?u:new jo(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,o(new oe(`timeout of ${t}ms exceeded`,oe.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>{if(!n){if(l.aborted){o.call(l);return}l.addEventListener("abort",o,{once:!0})}});const{signal:c}=r;return c.unsubscribe=()=>L.asap(a),c},rO=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},nO=async function*(e,t){for await(const r of oO(e))yield*rO(r,t)},oO=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},rg=(e,t,r,n)=>{const o=nO(e,t);let s=0,a,c=l=>{a||(a=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await o.next();if(u){c(),l.close();return}let h=d.byteLength;if(r){let f=s+=h;r(f)}l.enqueue(new Uint8Array(d))}catch(u){throw c(u),u}},cancel(l){return c(l),o.return()}},{highWaterMark:2})},ng=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,og=(e,t,r)=>t+2<r&&ng(e.charCodeAt(t+1))&&ng(e.charCodeAt(t+2)),sg=e=>e<=57?e-48:(e&223)-55,sO=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,aO=e=>e===9||e===10||e===12||e===13||e===32,iO=e=>{const t=Math.floor(e/4),r=e%4;return t*3+(r===2?1:r===3?2:0)},cO=e=>{const t=e.length;let r=0;return t>0&&e.charCodeAt(t-1)===61&&(r++,t>1&&e.charCodeAt(t-2)===61&&r++),Math.floor((t-r)*3/4)},lO=e=>{const t=e.length;let r=0,n=0,o=!1;for(let s=0;s<t;s++){let a=e.charCodeAt(s);if(a===37&&og(e,s,t)&&(a=sg(e.charCodeAt(s+1))*16+sg(e.charCodeAt(s+2)),s+=2),!aO(a)){if(a===61){n++;continue}if(!sO(a)||n>0){o=!0;continue}r++}}return o||n>2||n>0&&(r+n)%4!==0||r%4===1?cO(e):iO(r)},uO=(e,t)=>{if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const r=e.indexOf(",");if(r<0)return 0;const n=e.slice(5,r),o=e.slice(r+1);if(/;base64/i.test(n))return t(o);let a=0;for(let c=0,l=o.length;c<l;c++){const u=o.charCodeAt(c);if(u===37&&og(o,c,l))a+=1,c+=2;else if(u<128)a+=1;else if(u<2048)a+=2;else if(u>=55296&&u<=56319&&c+1<l){const d=o.charCodeAt(c+1);d>=56320&&d<=57343?(a+=4,c++):a+=3}else a+=3}return a};function dO(e){const t=typeof e=="string"?e.indexOf("#"):-1;return uO(t===-1?e:e.slice(0,t),lO)}const ol="1.20.0",ag=64*1024,fO={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:ya}=L,hO=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),ig=e=>{if(!L.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},cg=(e,...t)=>{try{return!!e(...t)}catch{return!1}},pO=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},mO=e=>{const t=L.global!==void 0&&L.global!==null?L.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=L.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:s,Response:a}=e,c=o?ya(o):typeof fetch=="function",l=ya(s),u=ya(a);if(!c)return!1;const d=c&&ya(r),h=c&&(typeof n=="function"?(b=>w=>b.encode(w))(new n):async b=>new Uint8Array(await new s(b).arrayBuffer())),f=l&&d&&cg(()=>{let b=!1;const w=new s(nt.origin,{body:new r,method:"POST",get duplex(){return b=!0,"half"}}),_=w.headers.has("Content-Type");return w.body!=null&&w.body.cancel(),b&&!_}),p=u&&d&&cg(()=>L.isReadableStream(new a("").body)),m={stream:p&&(b=>b.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!m[b]&&(m[b]=(w,_)=>{let P=w&&w[b];if(P)return P.call(w);throw new oe(`Response type '${b}' is not supported`,oe.ERR_NOT_SUPPORT,_)})});const g=async b=>{if(b==null)return 0;if(L.isBlob(b))return b.size;if(L.isSpecCompliantForm(b))return(await new s(nt.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(L.isArrayBufferView(b)||L.isArrayBuffer(b))return b.byteLength;if(L.isURLSearchParams(b)&&(b=b+""),L.isString(b))return(await h(b)).byteLength},y=async(b,w)=>{const _=L.toFiniteNumber(b.getContentLength());return _??g(w)};return async b=>{let{url:w,method:_,data:P,signal:E,cancelToken:S,timeout:O,onDownloadProgress:N,onUploadProgress:k,responseType:I,headers:j,withCredentials:q="same-origin",fetchOptions:M,maxContentLength:$,maxBodyLength:H,maxRedirects:V}=tg(b);const R=L.isNumber($)&&$>-1,K=L.isNumber(H)&&H>-1,Y=G=>L.hasOwnProp(b,G)?b[G]:void 0;let D=o||fetch;I=I?(I+"").toLowerCase():"text";let ne=tO([E,S&&S.toAbortSignal()],O),T=null;const F=ne&&ne.unsubscribe&&(()=>{ne.unsubscribe()});let z,B=null;const X=()=>new oe("Request body larger than maxBodyLength limit",oe.ERR_BAD_REQUEST,b,T);try{let G;const te=Y("auth");if(te){const he=L.getSafeProp(te,"username")||"",Ve=L.getSafeProp(te,"password")||"";G={username:he,password:Ve}}if(pO(w)){const he=new URL(w,nt.origin);if(!G&&(he.username||he.password)){const Ve=ig(he.username),Jt=ig(he.password);G={username:Ve,password:Jt}}(he.username||he.password)&&(he.username="",he.password="",w=he.href)}if(G&&(j.delete("authorization"),j.set("Authorization","Basic "+btoa(hO((G.username||"")+":"+(G.password||""))))),R&&typeof w=="string"&&w.startsWith("data:")&&dO(w)>$)throw new oe("maxContentLength size of "+$+" exceeded",oe.ERR_BAD_RESPONSE,b,T);if(K&&_!=="get"&&_!=="head"){const he=await g(P);if(typeof he=="number"&&isFinite(he)&&(z=he,he>H))throw X()}const ie=K&&(L.isReadableStream(P)||L.isStream(P)),Ne=(he,Ve,Jt)=>rg(he,ag,gt=>{if(K&>>H)throw B=X();Ve&&Ve(gt)},Jt);if(f&&_!=="get"&&_!=="head"&&(k||ie)){if(z=z??await y(j,P),z!==0||ie){let he=new s(w,{method:"POST",body:P,duplex:"half"}),Ve;if(L.isFormData(P)&&(Ve=he.headers.get("content-type"))&&j.setContentType(Ve),he.body){const[Jt,gt]=k&&Ym(z,ba(Qm(k)))||[];P=Ne(he.body,Jt,gt)}}}else if(ie&&!l&&d&&_!=="get"&&_!=="head")P=Ne(P);else if(ie&&l&&!f&&_!=="get"&&_!=="head")throw new oe("Stream request bodies are not supported by the current fetch implementation",oe.ERR_NOT_SUPPORT,b,T);L.isString(q)||(q=q?"include":"omit");const Ae=l&&"credentials"in s.prototype;if(L.isFormData(P)){const he=j.getContentType();he&&/^multipart\/form-data/i.test(he)&&!/boundary=/i.test(he)&&j.delete("content-type")}j.set("User-Agent","axios/"+ol,!1);const _e=M==null?M:Object.assign(Object.create(null),M);_e&&(delete _e.body,delete _e.headers,delete _e.method,delete _e.signal,delete _e.duplex,delete _e.credentials);const Se=Object.assign(Object.create(null),_e,{signal:ne,method:_.toUpperCase(),headers:Lm(j.normalize()),body:P,duplex:"half",credentials:Ae?q:void 0});l&&(L.forEach(fO,(he,Ve)=>{Se[Ve]===void 0&&(Se[Ve]=he)}),Se.signal===void 0&&(Se.signal=null),Se.body===void 0&&(Se.body=null)),V===0&&(Se.redirect="manual",_e&&(_e.redirect="manual")),T=l&&new s(w,Se);let ge=await(l?D(T,_e):D(w,Se));const Tt=ct.from(ge.headers);if(R){const he=L.toFiniteNumber(Tt.getContentLength());if(he!=null&&he>$)throw new oe("maxContentLength size of "+$+" exceeded",oe.ERR_BAD_RESPONSE,b,T)}const ke=p&&(I==="stream"||I==="response");if(p&&ge.body&&(N||R||ke&&F)){const he={};["status","statusText","headers"].forEach(Yr=>{he[Yr]=ge[Yr]});const Ve=L.toFiniteNumber(Tt.getContentLength()),[Jt,gt]=N&&Ym(Ve,ba(Qm(N),!0))||[];let Ko=0;const Yo=Yr=>{if(R&&(Ko=Yr,Ko>$))throw new oe("maxContentLength size of "+$+" exceeded",oe.ERR_BAD_RESPONSE,b,T);Jt&&Jt(Yr)};ge=new a(rg(ge.body,ag,Yo,()=>{gt&>(),F&&F()}),he)}I=I||"text";let zt=await m[L.findKey(m,I)||"text"](ge,b);if(R&&!p&&!ke){let he;if(zt!=null&&(typeof zt.byteLength=="number"?he=zt.byteLength:typeof zt.size=="number"?he=zt.size:typeof zt=="string"&&(he=typeof n=="function"?new n().encode(zt).byteLength:zt.length)),typeof he=="number"&&he>$)throw new oe("maxContentLength size of "+$+" exceeded",oe.ERR_BAD_RESPONSE,b,T)}return!ke&&F&&F(),await new Promise((he,Ve)=>{Gm(he,Ve,{data:zt,headers:ct.from(ge.headers),status:ge.status,statusText:ge.statusText,config:b,request:T})})}catch(G){if(F&&F(),ne&&ne.aborted&&ne.reason instanceof oe){const te=ne.reason;throw te.config=b,T&&(te.request=T),G!==te&&Object.defineProperty(te,"cause",{__proto__:null,value:G,writable:!0,enumerable:!1,configurable:!0}),te}if(B)throw T&&!B.request&&(B.request=T),B;if(G instanceof oe)throw T&&!G.request&&(G.request=T),G;if(G&&G.name==="TypeError"&&/Load failed|fetch/i.test(G.message)){const te=new oe("Network Error",oe.ERR_NETWORK,b,T,G&&G.response);throw Object.defineProperty(te,"cause",{__proto__:null,value:G.cause||G,writable:!0,enumerable:!1,configurable:!0}),te}throw oe.from(G,G&&G.code,b,T,G&&G.response)}}},gO=new Map,lg=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let a=s.length,c=a,l,u,d=gO;for(;c--;)l=s[c],u=d.get(l),u===void 0&&d.set(l,u=c?new Map:mO(t)),d=u;return u};lg();const sl={http:AA,xhr:eO,fetch:{get:lg}};L.forEach(sl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const ug=e=>`- ${e}`,bO=e=>L.isFunction(e)||e===null||e===!1;function yO(e,t){e=L.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let a=0;a<r;a++){n=e[a];let c;if(o=n,!bO(n)&&(o=sl[(c=String(n)).toLowerCase()],o===void 0))throw new oe(`Unknown adapter '${c}'`);if(o&&(L.isFunction(o)||(o=o.get(t))))break;s[c||"#"+a]=o}if(!o){const a=Object.entries(s).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=r?a.length>1?`since :
|
|
156
|
+
`+a.map(ug).join(`
|
|
157
|
+
`):" "+ug(a[0]):"as no adapter specified";throw new oe("There is no suitable adapter to dispatch the request "+c,oe.ERR_NOT_SUPPORT)}return o}const dg={getAdapter:yO,adapters:sl};function al(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jo(null,e)}function il(e){const t=L.toSafeFlatObject(e);return al(t),t.headers=ct.from(L.getSafeProp(t,"headers")),t.data=rl.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),dg.getAdapter(t.adapter||Uo.adapter,t)(t).then(function(o){al(t),t.response=o;try{o.data=rl.call(t,t.transformResponse,o)}finally{delete t.response}return o.headers=ct.from(o.headers),o},function(o){if(!Rm(o)&&(al(t),o&&o.response)){t.response=o.response;try{o.response.data=rl.call(t,t.transformResponse,o.response)}finally{delete t.response}o.response.headers=ct.from(o.response.headers)}return Promise.reject(o)})}const wa={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wa[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const fg={};wa.transitional=function(t,r,n){function o(s,a){return"[Axios v"+ol+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return(s,a,c)=>{if(t===!1)throw new oe(o(a," has been removed"+(r?" in "+r:"")),oe.ERR_DEPRECATED);return r&&!fg[a]&&(fg[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,a,c):!0}},wa.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function wO(e,t,r){if(typeof e!="object"||e===null)throw new oe("options must be an object",oe.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],a=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(a){const c=e[s],l=c===void 0||a(c,s,e);if(l!==!0)throw new oe("option "+s+" must be "+l,oe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new oe("Unknown option "+s,oe.ERR_BAD_OPTION)}}const va={assertOptions:wO,validators:wa},lt=va.validators;let bn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Vm,response:new Vm}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error)try{let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack;let a="";if(typeof s=="string"){const c=s.indexOf(`
|
|
158
|
+
`);a=c===-1?"":s.slice(c+1)}if(!n.stack)n.stack=a;else if(a){const c=a.indexOf(`
|
|
159
|
+
`),l=c===-1?-1:a.indexOf(`
|
|
160
|
+
`,c+1),u=l===-1?"":a.slice(l+1);String(n.stack).endsWith(u)||(n.stack+=`
|
|
161
|
+
`+a)}}catch{}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=gn(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&va.assertOptions(n,{silentJSONParsing:lt.transitional(lt.boolean),forcedJSONParsing:lt.transitional(lt.boolean),clarifyTimeoutError:lt.transitional(lt.boolean),legacyInterceptorReqResOrdering:lt.transitional(lt.boolean),advertiseZstdAcceptEncoding:lt.transitional(lt.boolean),validateStatusUndefinedResolves:lt.transitional(lt.boolean)},!1),o!=null&&(L.isFunction(o)?r.paramsSerializer={serialize:o}:va.assertOptions(o,{encode:lt.function,serialize:lt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),va.assertOptions(r,{baseUrl:lt.spelling("baseURL"),withXsrfToken:lt.spelling("withXSRFToken")},!0),r.method=(L.getSafeProp(r,"method")||L.getSafeProp(this.defaults,"method")||"get").toLowerCase();let a=s&&L.merge(s.common,s[r.method]);s&&L.forEach(Zm.concat("common"),m=>{delete s[m]}),r.headers=ct.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(r)===!1)return;l=l&&g.synchronous;const y=r.transitional||Xc;y&&y.legacyInterceptorReqResOrdering?c.unshift(g.fulfilled,g.rejected):c.push(g.fulfilled,g.rejected)});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let d,h=0,f;if(!l){const m=[il.bind(this),void 0];for(m.unshift(...c),m.push(...u),f=m.length,d=Promise.resolve(r);h<f;)d=d.then(m[h++],m[h++]);return d}f=c.length;let p=r;for(;h<f;){const m=c[h++],g=c[h++];try{p=m?m(p):p}catch(y){if(!g){d=Promise.reject(y);break}try{const b=g.call(this,y);L.isThenable(b)&&(d=Promise.resolve(b).then(()=>il.call(this,p)))}catch(b){d=Promise.reject(b)}break}}if(!d)try{d=il.call(this,p)}catch(m){d=Promise.reject(m)}for(h=0,f=u.length;h<f;)d=d.then(u[h++],u[h++]);return d}getUri(t){t=gn(this.defaults,t);const r=Xm(t.baseURL,t.url,t.allowAbsoluteUrls,t);return Um(r,t.params,t.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(t){bn.prototype[t]=function(r,n){return this.request(gn(n||{},{method:t,url:r,data:n&&L.hasOwnProp(n,"data")?n.data:void 0}))}}),L.forEach(["post","put","patch","query"],function(t){function r(n){return function(s,a,c){return this.request(gn(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}bn.prototype[t]=r(),t!=="query"&&(bn.prototype[t+"Form"]=r(!0))});let vO=class hy{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(c=>{n.subscribe(c),s=c}).then(o);return a.cancel=function(){n.unsubscribe(s)},a},t(function(s,a,c){n.reason||(n.reason=new jo(s,a,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new hy(function(o){t=o}),cancel:t}}};function _O(e){return function(r){return e.apply(null,r)}}function xO(e){return L.isObject(e)&&e.isAxiosError===!0}const _a={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(_a).forEach(([e,t])=>{_a[t]===void 0&&(_a[t]=e)});function hg(e){const t=new bn(e),r=wm(bn.prototype.request,t);return L.extend(r,bn.prototype,t,{allOwnKeys:!0}),L.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return hg(gn(e,o))},r}const we=hg(Uo);we.Axios=bn,we.CanceledError=jo,we.CancelToken=vO,we.isCancel=Rm,we.VERSION=ol,we.toFormData=ga,we.AxiosError=oe,we.Cancel=we.CanceledError,we.all=function(t){return Promise.all(t)},we.spread=_O,we.isAxiosError=xO,we.mergeConfig=gn,we.AxiosHeaders=ct,we.formToJSON=e=>Wm(L.isHTMLForm(e)?new FormData(e):e),we.getAdapter=dg.getAdapter,we.HttpStatusCode=_a,we.default=we;const{Axios:vN,AxiosError:_N,CanceledError:xN,isCancel:SN,CancelToken:CN,VERSION:PN,all:EN,Cancel:kN,isAxiosError:AN,spread:ON,toFormData:TN,AxiosHeaders:NN,HttpStatusCode:LN,formToJSON:MN,getAdapter:IN,mergeConfig:FN,create:DN}=we;function SO(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function CO(e){return e?.min_length??6}function Bo(e,t){const r=CO(e);return{min:r,message:t||`Password must be at least ${r} characters long`}}function pg(e,t,r,n){if(!e)return Promise.reject(new Error(n?.required||"Password is required"));const o=t?.min_length??6;if(e.length<o)return Promise.reject(new Error(n?.tooShort||`Password must be at least ${o} characters long`));const s=r(e);return!s.valid&&s.errors.length>0?Promise.reject(new Error(s.errors[0])):Promise.resolve()}const at="/api/v1/appauth".replace(/\/+$/,"");class Wr{constructor(t,r=at,n=we){this.basePath=r,this.axios=n,t&&(this.configuration=t,this.basePath=t.basePath??r)}}class PO extends Error{constructor(t,r){super(r),this.field=t,this.name="RequiredError"}}const ut={"UserProfileApi.getUserProfile":[{url:"/api/v1",description:"Profile API base URL"}],"UserProfileApi.updateUserProfile":[{url:"/api/v1",description:"Profile API base URL"}]},dt="https://example.com",Ee=function(e,t,r){if(r==null)throw new PO(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function cl(e,t,r=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(n=>cl(e,n,r)):Object.keys(t).forEach(n=>cl(e,t[n],`${r}${r!==""?".":""}${n}`)):e.has(r)?e.append(r,String(t)):e.set(r,String(t)))}const ft=function(e,...t){const r=new URLSearchParams(e.search);cl(r,t),e.search=r.toString()},no=function(e,t,r){const n=typeof e!="string",o=t.headers?.["Content-Type"]??"";return(n&&r&&r.isJsonMime?r.isJsonMime(o):n)?JSON.stringify(e!==void 0?e:{}):e||""},ht=function(e){return e.pathname+e.search+e.hash},pt=function(e,t,r,n){return(o=t,s=r)=>{const a={...e.options,url:(o.defaults.baseURL?"":n?.basePath??s)+e.url};return o.request(a)}},EO=function(e){return{getAppAuthConfig:async(t={})=>{const r="/config/",n=new URL(r,dt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...t},a={};ft(n,{});let l=o&&o.headers?o.headers:{};return s.headers={...a,...l,...t.headers},{url:ht(n),options:s}},updateAppAuthConfig:async(t,r,n={})=>{Ee("updateAppAuthConfig","xCSRFToken",t),Ee("updateAppAuthConfig","authConfig",r);const o="/config/",s=new URL(o,dt);let a;e&&(a=e.baseOptions);const c={method:"PUT",...a,...n},l={},u={},d=new(e&&e.formDataCtor||FormData);r!==void 0&&d.append("auth_config",r),l["Content-Type"]="multipart/form-data",t!=null&&(l["X-CSRFToken"]=String(t)),ft(s,u);let h=a&&a.headers?a.headers:{};return c.headers={...l,...h,...n.headers},c.data=d,{url:ht(s),options:c}}}},mg=function(e){const t=EO(e);return{async getAppAuthConfig(r){const n=await t.getAppAuthConfig(r),o=e?.serverIndex??0,s=ut["ApplicationConfigurationApi.getAppAuthConfig"]?.[o]?.url;return(a,c)=>pt(n,we,at,e)(a,s||c)},async updateAppAuthConfig(r,n,o){const s=await t.updateAppAuthConfig(r,n,o),a=e?.serverIndex??0,c=ut["ApplicationConfigurationApi.updateAppAuthConfig"]?.[a]?.url;return(l,u)=>pt(s,we,at,e)(l,c||u)}}};class kO extends Wr{getAppAuthConfig(t){return mg(this.configuration).getAppAuthConfig(t).then(r=>r(this.axios,this.basePath))}updateAppAuthConfig(t,r,n){return mg(this.configuration).updateAppAuthConfig(t,r,n).then(o=>o(this.axios,this.basePath))}}const AO=function(e){return{loginUser:async(t,r,n={})=>{Ee("loginUser","xCSRFToken",t),Ee("loginUser","loginUserRequest",r);const o="/login/",s=new URL(o,dt);let a;e&&(a=e.baseOptions);const c={method:"POST",...a,...n},l={},u={};l["Content-Type"]="application/json",t!=null&&(l["X-CSRFToken"]=String(t)),ft(s,u);let d=a&&a.headers?a.headers:{};return c.headers={...l,...d,...n.headers},c.data=no(r,c,e),{url:ht(s),options:c}},logoutUser:async(t,r={})=>{Ee("logoutUser","xCSRFToken",t);const n="/logout/",o=new URL(n,dt);let s;e&&(s=e.baseOptions);const a={method:"DELETE",...s,...r},c={},l={};t!=null&&(c["X-CSRFToken"]=String(t)),ft(o,l);let u=s&&s.headers?s.headers:{};return a.headers={...c,...u,...r.headers},{url:ht(o),options:a}}}},gg=function(e){const t=AO(e);return{async loginUser(r,n,o){const s=await t.loginUser(r,n,o),a=e?.serverIndex??0,c=ut["AuthenticationApi.loginUser"]?.[a]?.url;return(l,u)=>pt(s,we,at,e)(l,c||u)},async logoutUser(r,n){const o=await t.logoutUser(r,n),s=e?.serverIndex??0,a=ut["AuthenticationApi.logoutUser"]?.[s]?.url;return(c,l)=>pt(o,we,at,e)(c,a||l)}}};class OO extends Wr{loginUser(t,r,n){return gg(this.configuration).loginUser(t,r,n).then(o=>o(this.axios,this.basePath))}logoutUser(t,r){return gg(this.configuration).logoutUser(t,r).then(n=>n(this.axios,this.basePath))}}const TO=function(e){return{requestLoginOTP:async(t,r,n={})=>{Ee("requestLoginOTP","xCSRFToken",t),Ee("requestLoginOTP","loginOTPRequest",r);const o="/login/code/request/",s=new URL(o,dt);let a;e&&(a=e.baseOptions);const c={method:"POST",...a,...n},l={},u={};l["Content-Type"]="application/json",t!=null&&(l["X-CSRFToken"]=String(t)),ft(s,u);let d=a&&a.headers?a.headers:{};return c.headers={...l,...d,...n.headers},c.data=no(r,c,e),{url:ht(s),options:c}},verifyLoginOTP:async(t,r,n={})=>{Ee("verifyLoginOTP","xCSRFToken",t),Ee("verifyLoginOTP","loginOTPVerifyRequest",r);const o="/login/code/confirm/",s=new URL(o,dt);let a;e&&(a=e.baseOptions);const c={method:"POST",...a,...n},l={},u={};l["Content-Type"]="application/json",t!=null&&(l["X-CSRFToken"]=String(t)),ft(s,u);let d=a&&a.headers?a.headers:{};return c.headers={...l,...d,...n.headers},c.data=no(r,c,e),{url:ht(s),options:c}}}},bg=function(e){const t=TO(e);return{async requestLoginOTP(r,n,o){const s=await t.requestLoginOTP(r,n,o),a=e?.serverIndex??0,c=ut["LoginWithOTPApi.requestLoginOTP"]?.[a]?.url;return(l,u)=>pt(s,we,at,e)(l,c||u)},async verifyLoginOTP(r,n,o){const s=await t.verifyLoginOTP(r,n,o),a=e?.serverIndex??0,c=ut["LoginWithOTPApi.verifyLoginOTP"]?.[a]?.url;return(l,u)=>pt(s,we,at,e)(l,c||u)}}};class NO extends Wr{requestLoginOTP(t,r,n){return bg(this.configuration).requestLoginOTP(t,r,n).then(o=>o(this.axios,this.basePath))}verifyLoginOTP(t,r,n){return bg(this.configuration).verifyLoginOTP(t,r,n).then(o=>o(this.axios,this.basePath))}}const LO=function(e){return{getMfaCode:async(t={})=>{const r="/mfa/getcode/",n=new URL(r,dt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...t},a={};ft(n,{});let l=o&&o.headers?o.headers:{};return s.headers={...a,...l,...t.headers},{url:ht(n),options:s}},verifyMfaCode:async(t,r,n={})=>{Ee("verifyMfaCode","xCSRFToken",t),Ee("verifyMfaCode","mfaVerifyRequest",r);const o="/mfa/verify/",s=new URL(o,dt);let a;e&&(a=e.baseOptions);const c={method:"POST",...a,...n},l={},u={};l["Content-Type"]="application/json",t!=null&&(l["X-CSRFToken"]=String(t)),ft(s,u);let d=a&&a.headers?a.headers:{};return c.headers={...l,...d,...n.headers},c.data=no(r,c,e),{url:ht(s),options:c}}}},yg=function(e){const t=LO(e);return{async getMfaCode(r){const n=await t.getMfaCode(r),o=e?.serverIndex??0,s=ut["MultiFactorAuthenticationApi.getMfaCode"]?.[o]?.url;return(a,c)=>pt(n,we,at,e)(a,s||c)},async verifyMfaCode(r,n,o){const s=await t.verifyMfaCode(r,n,o),a=e?.serverIndex??0,c=ut["MultiFactorAuthenticationApi.verifyMfaCode"]?.[a]?.url;return(l,u)=>pt(s,we,at,e)(l,c||u)}}};class MO extends Wr{getMfaCode(t){return yg(this.configuration).getMfaCode(t).then(r=>r(this.axios,this.basePath))}verifyMfaCode(t,r,n){return yg(this.configuration).verifyMfaCode(t,r,n).then(o=>o(this.axios,this.basePath))}}const IO=function(e){return{oauthCallback:async(t,r,n,o,s,a,c,l,u={})=>{Ee("oauthCallback","provider",t),Ee("oauthCallback","state",r),Ee("oauthCallback","code",n),Ee("oauthCallback","scope",o),Ee("oauthCallback","xCSRFToken",s);const d="/oauth/{provider}/callback/".replace("{provider}",encodeURIComponent(String(t))),h=new URL(d,dt);let f;e&&(f=e.baseOptions);const p={method:"POST",...f,...u},m={},g={};r!==void 0&&(g.state=r),n!==void 0&&(g.code=n),o!==void 0&&(g.scope=o),a!==void 0&&(g.authuser=a),c!==void 0&&(g.hd=c),l!==void 0&&(g.prompt=l),s!=null&&(m["X-CSRFToken"]=String(s)),ft(h,g);let y=f&&f.headers?f.headers:{};return p.headers={...m,...y,...u.headers},{url:ht(h),options:p}},oauthRedirect:async(t,r,n,o,s={})=>{Ee("oauthRedirect","xCsrftoken",t),Ee("oauthRedirect","provider",r),Ee("oauthRedirect","process",n),Ee("oauthRedirect","callbackUrl",o);const a="/oauth/redirect/",c=new URL(a,dt);let l;e&&(l=e.baseOptions);const u={method:"POST",...l,...s},d={},h={},f=new URLSearchParams;r!==void 0&&f.set("provider",r),n!==void 0&&f.set("process",n),o!==void 0&&f.set("callback_url",o),d["Content-Type"]="application/x-www-form-urlencoded",t!=null&&(d["x-csrftoken"]=String(t)),ft(c,h);let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...s.headers},u.data=f.toString(),{url:ht(c),options:u}}}},wg=function(e){const t=IO(e);return{async oauthCallback(r,n,o,s,a,c,l,u,d){const h=await t.oauthCallback(r,n,o,s,a,c,l,u,d),f=e?.serverIndex??0,p=ut["OAuthApi.oauthCallback"]?.[f]?.url;return(m,g)=>pt(h,we,at,e)(m,p||g)},async oauthRedirect(r,n,o,s,a){const c=await t.oauthRedirect(r,n,o,s,a),l=e?.serverIndex??0,u=ut["OAuthApi.oauthRedirect"]?.[l]?.url;return(d,h)=>pt(c,we,at,e)(d,u||h)}}};class FO extends Wr{oauthCallback(t,r,n,o,s,a,c,l,u){return wg(this.configuration).oauthCallback(t,r,n,o,s,a,c,l,u).then(d=>d(this.axios,this.basePath))}oauthRedirect(t,r,n,o,s){return wg(this.configuration).oauthRedirect(t,r,n,o,s).then(a=>a(this.axios,this.basePath))}}const DO=function(e){return{changePassword:async(t,r,n={})=>{Ee("changePassword","xCSRFToken",t),Ee("changePassword","passwordChangeRequest",r);const o="/password/change/",s=new URL(o,dt);let a;e&&(a=e.baseOptions);const c={method:"PUT",...a,...n},l={},u={};l["Content-Type"]="application/json",t!=null&&(l["X-CSRFToken"]=String(t)),ft(s,u);let d=a&&a.headers?a.headers:{};return c.headers={...l,...d,...n.headers},c.data=no(r,c,e),{url:ht(s),options:c}},setPassword:async(t,r,n={})=>{Ee("setPassword","xCSRFToken",t),Ee("setPassword","passwordSetRequest",r);const o="/password/set/",s=new URL(o,dt);let a;e&&(a=e.baseOptions);const c={method:"POST",...a,...n},l={},u={};l["Content-Type"]="application/json",t!=null&&(l["X-CSRFToken"]=String(t)),ft(s,u);let d=a&&a.headers?a.headers:{};return c.headers={...l,...d,...n.headers},c.data=no(r,c,e),{url:ht(s),options:c}}}},vg=function(e){const t=DO(e);return{async changePassword(r,n,o){const s=await t.changePassword(r,n,o),a=e?.serverIndex??0,c=ut["PasswordManagementApi.changePassword"]?.[a]?.url;return(l,u)=>pt(s,we,at,e)(l,c||u)},async setPassword(r,n,o){const s=await t.setPassword(r,n,o),a=e?.serverIndex??0,c=ut["PasswordManagementApi.setPassword"]?.[a]?.url;return(l,u)=>pt(s,we,at,e)(l,c||u)}}};class $O extends Wr{changePassword(t,r,n){return vg(this.configuration).changePassword(t,r,n).then(o=>o(this.axios,this.basePath))}setPassword(t,r,n){return vg(this.configuration).setPassword(t,r,n).then(o=>o(this.axios,this.basePath))}}const zO=function(e){return{setRole:async(t,r,n={})=>{Ee("setRole","xCSRFToken",t),Ee("setRole","role",r);const o="/role/set/",s=new URL(o,dt);let a;e&&(a=e.baseOptions);const c={method:"POST",...a,...n},l={},u={};r!==void 0&&(u.role=r),t!=null&&(l["X-CSRFToken"]=String(t)),ft(s,u);let d=a&&a.headers?a.headers:{};return c.headers={...l,...d,...n.headers},{url:ht(s),options:c}},switchRole:async(t,r,n={})=>{Ee("switchRole","xCSRFToken",t),Ee("switchRole","role",r);const o="/role/switch/",s=new URL(o,dt);let a;e&&(a=e.baseOptions);const c={method:"POST",...a,...n},l={},u={};r!==void 0&&(u.role=r),t!=null&&(l["X-CSRFToken"]=String(t)),ft(s,u);let d=a&&a.headers?a.headers:{};return c.headers={...l,...d,...n.headers},{url:ht(s),options:c}}}},_g=function(e){const t=zO(e);return{async setRole(r,n,o){const s=await t.setRole(r,n,o),a=e?.serverIndex??0,c=ut["RoleManagementApi.setRole"]?.[a]?.url;return(l,u)=>pt(s,we,at,e)(l,c||u)},async switchRole(r,n,o){const s=await t.switchRole(r,n,o),a=e?.serverIndex??0,c=ut["RoleManagementApi.switchRole"]?.[a]?.url;return(l,u)=>pt(s,we,at,e)(l,c||u)}}};class UO extends Wr{setRole(t,r,n){return _g(this.configuration).setRole(t,r,n).then(o=>o(this.axios,this.basePath))}switchRole(t,r,n){return _g(this.configuration).switchRole(t,r,n).then(o=>o(this.axios,this.basePath))}}const jO=function(e){return{getUserProfile:async(t={})=>{const r="/profile/",n=new URL(r,dt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...t},a={};ft(n,{});let l=o&&o.headers?o.headers:{};return s.headers={...a,...l,...t.headers},{url:ht(n),options:s}},updateUserProfile:async(t,r,n,o,s,a={})=>{Ee("updateUserProfile","xCSRFToken",t);const c="/profile/",l=new URL(c,dt);let u;e&&(u=e.baseOptions);const d={method:"PUT",...u,...a},h={},f={},p=new(e&&e.formDataCtor||FormData);r!==void 0&&p.append("name",r),n!==void 0&&p.append("mobile",n),o!==void 0&&p.append("auth_config",o),s!==void 0&&p.append("profile_pic",s),h["Content-Type"]="multipart/form-data",t!=null&&(h["X-CSRFToken"]=String(t)),ft(l,f);let m=u&&u.headers?u.headers:{};return d.headers={...h,...m,...a.headers},d.data=p,{url:ht(l),options:d}}}},xg=function(e){const t=jO(e);return{async getUserProfile(r){const n=await t.getUserProfile(r),o=e?.serverIndex??0,s=ut["UserProfileApi.getUserProfile"]?.[o]?.url;return(a,c)=>pt(n,we,at,e)(a,s||c)},async updateUserProfile(r,n,o,s,a,c){const l=await t.updateUserProfile(r,n,o,s,a,c),u=e?.serverIndex??0,d=ut["UserProfileApi.updateUserProfile"]?.[u]?.url;return(h,f)=>pt(l,we,at,e)(h,d||f)}}};class BO extends Wr{getUserProfile(t){return xg(this.configuration).getUserProfile(t).then(r=>r(this.axios,this.basePath))}updateUserProfile(t,r,n,o,s,a){return xg(this.configuration).updateUserProfile(t,r,n,o,s,a).then(c=>c(this.axios,this.basePath))}}class Sg{constructor(t={}){this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions={...t.baseOptions,headers:{...t.baseOptions?.headers}},this.formDataCtor=t.formDataCtor}isJsonMime(t){const r=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(r.test(t)||t.toLowerCase()==="application/json-patch+json")}}const VO="/api/v1/appauth",yn=new Sg({basePath:VO,baseOptions:{withCredentials:!0}}),Cg=new OO(yn),qO=new kO(yn),Pg=new NO(yn),Eg=new MO(yn),kg=new $O(yn);new UO(yn);const Ag=new FO(yn),me={config:null,configPromise:null,samlSessionToken:null},qt=e=>{const t=e;return t?.response?.data?.errors?.[0]?.message?t.response.data.errors[0].message:t?.response?.data?.response?.errors?.[0]?.message?t.response.data.response.errors[0].message:t?.response?.data?.response?.message?t.response.data.response.message:t?.response?.data?.message?t.response.data.message:t?.message?t.message:"An unexpected error occurred"},HO=(e,t)=>{const r=[];return t.min_length&&e.length<t.min_length&&r.push(`Password must be at least ${t.min_length} characters long`),t.max_length&&e.length>t.max_length&&r.push(`Password must be at most ${t.max_length} characters long`),t.require_numbers&&!/\d/.test(e)&&r.push("Password must contain at least one number"),t.require_lowercase&&!/[a-z]/.test(e)&&r.push("Password must contain at least one lowercase letter"),t.require_uppercase&&!/[A-Z]/.test(e)&&r.push("Password must contain at least one uppercase letter"),t.require_special_chars&&!/[!@#$%^&*(),.?":{}|<>]/.test(e)&&r.push("Password must contain at least one special character"),{valid:r.length===0,errors:r}};async function WO(e,t,r,n,o,s,a,c){try{const l=Gn()||"",u=await Ag.oauthCallback(e,t,r,n,l,o,s,a,c),d=u.data;if(d?.success&&d?.response){const h=d.response,f=h.data;return h.status===401&&f?.next_step?h:h.data||h}return u.data}catch(l){const u=l;if(u?.response?.status===401&&u.response?.data){const h=u.response.data;if(h?.success&&h?.response){const f=h.response;if(f.status===401&&f.data?.next_step)return f}if(h?.response?.data?.next_step||h?.data?.next_step)return h}const d=qt(l);throw d!=="An unexpected error occurred"?new Error(d):l}}async function ZO(e,t,r){try{const n=Gn()||"",o=r?{transformRequest:[a=>{const c=new URLSearchParams(a);return r&&c.set("next",r),c.toString()}]}:void 0;return(await Ag.oauthRedirect(n,e,"login",t,o)).data}catch(n){throw J.error("OAuth redirect error",n),n}}async function RO(e,t){try{const r=Gn()||"",n={saml_id:e,...t&&{next:t}},o=await fetch("/api/v1/appauth/saml/init/",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":r},credentials:"include",body:JSON.stringify(n)}),s=await o.text();if(!o.ok){let c=`SAML init failed: ${o.status} ${o.statusText}`;try{const l=JSON.parse(s);l?.error?.message?c=l.error.message:l?.message?c=l.message:l?.detail&&(c=l.detail)}catch{s&&s.length<500&&(c+=` - ${s}`)}throw new Error(c)}const a=JSON.parse(s);if(a?.success&&a?.response){if(typeof a.response=="string"&&a.response.startsWith("http"))return{redirect_url:a.response};if(a.response?.redirect_url)return{redirect_url:a.response.redirect_url}}else if(a?.redirect_url)return{redirect_url:a.redirect_url};return a}catch(r){throw J.error("SAML init error",r),r}}async function GO(e,t){try{const r=await fetch(`/api/v1/appauth/saml/ops/?token=${encodeURIComponent(e)}&request_id=${encodeURIComponent(t)}&action=get_metadata`,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"}),n=await r.json();if(!r.ok){let o=`SAML auth meta failed: ${r.status} ${r.statusText}`;throw n?.error?.message?o=n.error.message:n?.message?o=n.message:n?.detail&&(o=n.detail),new Error(o)}if(n?.success&&n?.response){const o=n.response;return o.meta?.session_token&&(me.samlSessionToken=o.meta.session_token),o.status===401&&o.data?.next_step?o:o.data||o}return n?.meta?.session_token&&(me.samlSessionToken=n.meta.session_token),n}catch(r){throw J.error("SAML auth meta error",r),r}}async function KO(e){try{const r={"Content-Type":"application/json","X-CSRFToken":Gn()||""};me.samlSessionToken&&(r["X-Session-Token"]=me.samlSessionToken);const n=await fetch(`/api/v1/appauth/role/set/?role=${encodeURIComponent(e)}`,{method:"POST",headers:r,credentials:"include"});if(!n.ok){const s=await n.text();throw new Error(`Role set failed: ${n.status} ${n.statusText} - ${s}`)}const o=await n.json();if(o?.success&&o?.response){const s=o.response;return s.status===401&&s.data?.next_step?s:((s.status===200||s.meta?.is_authenticated)&&(me.samlSessionToken=null),s.data||s)}return o}catch(t){throw J.error("Set role error",t),t}}function YO(){me.samlSessionToken=null}function QO(){return me.samlSessionToken}const ll="/api/v1/appauth",re={async getAuthConfig(){return me.config?me.config:(me.configPromise||(me.configPromise=(async()=>{try{const t=(await qO.getAppAuthConfig()).data,r=t?.response;return r?.auth_config?me.config=r.auth_config:t?.auth_config?me.config=t.auth_config:me.config=t,me.config}catch(e){throw J.error("Failed to fetch auth config",e),me.configPromise=null,e}finally{me.configPromise=null}})()),me.configPromise)},getConfig(){return me.config},isPasswordLoginEnabled(){return me.config?.login_methods?.password?.enabled||!1},isOTPLoginEnabled(){return me.config?.login_methods?.otp?.enabled||!1},isSSOEnabled(){return me.config?.login_methods?.sso?.enabled||!1},isOIDCEnabled(){return me.config?.login_methods?.oidc?.enabled||!1},getOIDCProviders(){return me.config?.login_methods?.oidc?.providers||[]},getSSOProviders(){return me.config?.login_methods?.sso?.providers||[]},getAllowedUsernames(){const e=me.config;return(e?.login_methods?.password?.allowed_usernames||e?.login_methods?.allowed_usernames||["email"]).map(r=>r==="phone"?"mobile":r)},getOtpAllowedUsernames(){const r=me.config?.login_methods?.otp?.allowed_methods;if(Array.isArray(r)&&r.length>0){const n=r.filter(o=>typeof o=="string").map(o=>o==="sms"?"mobile":o);if(n.length>0)return n}return this.getAllowedUsernames()},getAllowedUsernamesForMethod(e){return e==="otp"?this.getOtpAllowedUsernames():this.getAllowedUsernames()},getEnabledLoginMethods(){const e=[];return this.isPasswordLoginEnabled()&&e.push("password"),this.isOTPLoginEnabled()&&e.push("otp"),this.isSSOEnabled()&&e.push("sso"),this.isOIDCEnabled()&&e.push("oidc"),e},isForgotPasswordEnabled(){return me.config?.password_policy?.reset?.enabled||!1},getPasswordResetLinkExpiry(){return me.config?.login_methods?.password?.password_reset_link_expiry_hours??24},getSessionPolicy(){return me.config?.session_policy||{}},isRememberMeEnabled(){return me.config?.session_policy?.remember_me_enabled!==!1},getRememberMeDurationDays(){return me.config?.session_policy?.remember_me_duration_days??30},getPasswordPolicy(){return me.config?.password_policy||{}},getPasswordResetMethods(){return me.config?.password_policy?.reset?.method||[]},isPasswordResetEnabled(){return me.config?.password_policy?.reset?.enabled||!1},getPasswordResetExpiry(){return me.config?.password_policy?.reset?.expiry_hours??24},isTwoFactorRequired(){return me.config?.two_factor_auth?.required||!1},getTwoFactorMethods(){return me.config?.two_factor_auth?.allowedMethods||[]},getTwoFactorHooks(){const e=me.config;return{email:e?.two_factor_auth?.email_hook,sms:e?.two_factor_auth?.sms_hook}},async login(e,t={}){try{me.config||await this.getAuthConfig();const r=lr(),n=e,o=await Cg.loginUser(r,n),s=o.data;if(s?.success&&s?.response){const a=s.response;return a.status===401&&a.data?.next_step,a}return o.data}catch(r){J.error("Login error",r);const n=r,o=n.response?.data;if(o?.response?.error_code==="ACCOUNT_LOCKED")throw new Error("ACCOUNT_LOCKED");if(n.response?.status===401&&o){const a=o,c=a?.response;if(a?.success&&c){const d=c.data;if(c.status===401&&d?.next_step)return c}const l=a?.response?.data,u=a?.data;if(l?.next_step||u?.next_step)return a}const s=qt(r);throw s!=="An unexpected error occurred"?new Error(s):r}},async logout(e={}){try{const t=lr();await Cg.logoutUser(t)}catch(t){J.error("Logout error",t);const r=qt(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async getCurrentUser(){try{const{isAuthenticatedViaCookie:e}=await Promise.resolve().then(function(){return Yg});if(!e())throw new Error("Not authenticated - no valid session cookie");return{authenticated:!0}}catch(e){J.error("Get current user failed",e);const t=qt(e);throw t!=="An unexpected error occurred"?new Error(t):new Error("Authentication verification failed")}},async verifyToken(e,t={}){return this.getCurrentUser()},async forgotPassword(e){return typeof e=="string"?this.requestPasswordReset({email:e}):this.requestPasswordReset(e)},async requestPasswordReset(e){try{const t=lr();return(await we.post(`${ll}/password/reset/request/`,e,{headers:{"X-CSRFToken":t},withCredentials:!0})).data}catch(t){J.error("Request password reset error",t);const r=qt(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async validatePasswordResetKey(e){try{return(await we.get(`${ll}/password/reset/`,{headers:{"x-password-reset-key":e},withCredentials:!0})).data}catch(t){J.error("Validate password reset key error",t);const r=qt(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async confirmResetPassword(e){try{const t=lr();return(await we.post(`${ll}/password/reset/`,e,{headers:{"X-CSRFToken":t},withCredentials:!0})).data}catch(t){J.error("Confirm reset password error",t);const r=t,n=r.response?.data;if(r.response?.status===401&&n){const s=n?.response;if(n?.success&&s){const a=s.data;if(s.status===401&&a?.next_step)return s}}const o=qt(t);throw o!=="An unexpected error occurred"?new Error(o):t}},async fetchLoginMethods(){return(await this.getAuthConfig())?.login_methods||{}},async requestOTP(e){try{const t=lr(),n=SO(e)?{email:e}:{phone:e},o=await Pg.requestLoginOTP(t,n),s=o.data;return s?.success&&s?.response?s.response.status===401&&s.response.data?.message?s.response:s.response.data||s.response:o.data}catch(t){J.error("Send Code error",t);const r=t,n=r.response?.data;if(r.response?.status===401&&n){const o=n?.response;if(n?.success&&o){const s=o.data;if(o.status===401&&s?.message)return o}}if(n){if(n?.errors&&Array.isArray(n.errors)&&n.errors.length>0){const a=n.errors[0];throw new Error(a.message||"Failed to send OTP")}const s=n?.response?.data;if(s?.message)throw new Error(s.message);if(n?.message)throw new Error(n.message)}throw t}},async verifyOTP(e,t){try{const r=lr(),n={code:t},o=await Pg.verifyLoginOTP(r,n),s=o.data;return s?.success&&s?.response?(s.response.status===401&&s.response.data?.next_step,s.response):o.data}catch(r){J.error("Verify OTP error",r);const n=r,o=n.response?.data;if(o?.response?.error_code==="ACCOUNT_LOCKED")throw new Error("ACCOUNT_LOCKED");if(n.response?.status===401&&o){const s=o,a=s?.response;if(s?.success&&a){const u=a.data;if(a.status===401&&u?.next_step)return a}const c=s?.response?.data,l=s?.data;if(c?.next_step||l?.next_step)return s}if(o){if(o?.errors&&Array.isArray(o.errors)&&o.errors.length>0){const c=o.errors[0];throw new Error(c.message||"Verification failed")}const a=o?.response?.data;if(a?.message)throw new Error(a.message);if(o?.message)throw new Error(o.message)}throw r}},async selectRole(e){try{const r={"Content-Type":"application/json","X-CSRFToken":lr()};me.samlSessionToken&&(r["X-Session-Token"]=me.samlSessionToken);const n=await fetch(`/api/v1/appauth/role/set/?role=${encodeURIComponent(e)}`,{method:"POST",headers:r,credentials:"include"}),o=await n.json();if(o?.success&&o?.response){const s=o.response;return s.status===401&&s.data?.next_step||(s.status===200||s.meta?.is_authenticated)&&(me.samlSessionToken=null),s}if(!n.ok){if(n.status===401&&o&&(o?.response?.data?.next_step||o?.data?.next_step))return o;const s=o?.error?.message||o?.message||`Role selection failed: ${n.status}`;throw new Error(s)}return o}catch(t){J.error("Select role error",t);const r=qt(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async sendTwoFactorCode(e){try{const t=e?{params:{method:e}}:{};return(await Eg.getMfaCode(t)).data}catch(t){J.error("Send 2FA code error",t);const r=qt(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async verifyTwoFactorCode(e){try{const t=lr();return(await Eg.verifyMfaCode(t,{code:e})).data}catch(t){J.error("Verify 2FA code error",t);const r=qt(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async changePassword(e,t){try{const r=lr();return(await kg.changePassword(r,{current_password:e,new_password:t})).data}catch(r){J.error("Change password error",r);const n=qt(r);throw n!=="An unexpected error occurred"?new Error(n):r}},async setPassword(e){try{const t=lr();return(await kg.setPassword(t,{new_password:e})).data}catch(t){J.error("Set password error",t);const r=t,n=r.response?.data;if(r.response?.status===401&&n){const s=n?.response?.data,a=n?.data;if(s?.next_step||a?.next_step)return n}const o=qt(t);throw o!=="An unexpected error occurred"?new Error(o):t}},processOAuthCallback:WO,clearConfig(){me.config=null,me.configPromise=null},async isAuthenticated(){const{isAuthenticatedViaCookie:e}=await Promise.resolve().then(function(){return Yg});return e()},validatePassword(e){return HO(e,this.getPasswordPolicy())},oauthRedirect:ZO,async getUserProfile(){try{const e=new Sg({basePath:"/api/v1",baseOptions:{withCredentials:!0}});return(await new BO(e).getUserProfile()).data}catch(e){throw J.error("Get user profile error",e),e}},initiateSAMLAuth:RO,getSAMLAuthMeta:GO,setRole:KO,clearSamlSessionToken:YO,getSamlSessionToken:QO},JO=()=>os({queryKey:["auth-config"],queryFn:()=>re.getAuthConfig(),staleTime:1/0,refetchOnWindowFocus:!1,retry:!1}),Og=v.createContext(null),Zr=()=>{const e=v.useContext(Og);if(!e)throw new Error("useAuthContext must be used within an AuthProvider");return e},Tg=({children:e,config:t={}})=>{const[r,n]=v.useState(null),[o,s]=v.useState(!0),[a,c]=v.useState(null),[l,u]=v.useState(null),[d,h]=v.useState(null),[f,p]=v.useState(null),m=v.useRef(!1),{data:g,error:y}=JO(),b=v.useCallback(async()=>{try{await re.isAuthenticated()?(n({authenticated:!0}),c(null)):(n(null),c(null))}catch(k){J.error("Auth check failed",k),n(null),c(k instanceof Error?k.message:"Authentication check failed")}finally{s(!1)}},[]);v.useEffect(()=>{m.current||(g?(m.current=!0,p(g),b()):y&&(m.current=!0,c(y instanceof Error?y.message:"An error occurred"),s(!1)))},[g,y,b]);const N={user:r,loading:o,error:a,login:async k=>{s(!0),c(null);try{const I=await re.login(k,t);let j=I,q=null;I?.status===401&&I?.data?(j=I.data,q=I.data?.next_step):(j=I?.response?.data||I?.data||I,q=j?.next_step);const M=I?.user||j?.user||{};if(M.email=M.email||k.email,M.username=M.username||k.username,M.phone=M.phone||k.phone,M.name=M.name||k.email||k.username||k.phone,u({user:M,token:I.token||j?.token,roles:I.roles,requires2FA:I.requires2FA,twoFactorMethods:I.twoFactorMethods,requiresPasswordReset:I.requiresPasswordReset,passwordResetReason:I.passwordResetReason}),q?.is_pending&&q.id==="role_selection")return{...I,user:M};if(q?.is_pending&&(q.id==="set_password"||q.id==="password_expiry"||q.id==="first_login"))return u({user:M,token:I.token||j?.token,requiresPasswordReset:!0,passwordResetReason:q.id==="password_expiry"?"Your password has expired":q.id==="first_login"?"Please set up your password for first login":q.metadata?.reason||"Password update required"}),{...I,user:M};if(I.roles&&I.roles.length>1)return h(I.roles),{requiresRoleSelection:!0,roles:I.roles,user:M,token:I.token};const $=I;return I.roles&&I.roles.length===1?$.user={...M,role:I.roles[0]}:$.user=M,I.requires2FA?{...$,requires2FA:!0,twoFactorMethods:I.twoFactorMethods||["email"]}:I.requiresPasswordReset?{...$,requiresPasswordReset:!0,passwordResetReason:I.passwordResetReason}:(n($.user),u(null),h(null),{...$,user:M})}catch(I){J.error("AuthProvider login caught error",I);const j=I instanceof Error?I.message:"Login failed";throw J.error("AuthProvider error.message",void 0,{errorMessage:j}),c(j),I}finally{s(!1)}},logout:async()=>{s(!0);try{await re.logout(t),n(null),u(null),h(null)}catch(k){J.error("Logout failed",k)}finally{s(!1)}},selectRole:async k=>{if(!l)throw new Error("No pending authentication");s(!0);try{t.roleSelectionEndpoint&&await re.selectRole(typeof k=="string"?k:k.id);const I={...l.user,role:k},j={...l,user:I};return j.requires2FA?(u(j),{...j,requires2FA:!0,twoFactorMethods:j.twoFactorMethods||["email"]}):j.requiresPasswordReset?(u(j),{...j,requiresPasswordReset:!0,passwordResetReason:j.passwordResetReason}):(n(I),u(null),h(null),{user:I,token:l.token})}catch(I){throw c(I instanceof Error?I.message:"An error occurred"),I}finally{s(!1)}},checkAuth:b,processAuthResult:k=>{const I=k?.response?.data||k?.data||k,j=I?.next_step||k?.next_step,q=k?.loginUser||k?.user||I?.user||{},M=j?.metadata;if(u({user:q,token:k.token||I?.token}),j?.is_pending&&j?.id==="role_selection"){let $=[];const H=M?.roles;return Array.isArray(H)?$=H:H&&typeof H=="object"&&($=Object.entries(H).map(([V,R])=>({id:V,name:R,is_default:!1}))),$.length>1?(h($),{requiresRoleSelection:!0,roles:$,user:q}):{...k,user:q,autoSelectedRole:$[0]}}return k.roles&&Array.isArray(k.roles)&&k.roles.length>1?(h(k.roles),{requiresRoleSelection:!0,roles:k.roles,user:q}):{...k,user:q}},forgotPassword:async k=>re.forgotPassword(k),resetPassword:async k=>re.confirmResetPassword(k),isAuthenticated:!!r,pendingAuth:l,availableRoles:d,authConfig:f,requiresRoleSelection:!!l&&!!d};return i.jsx(Og.Provider,{value:N,children:e})},{Title:XO,Text:Rr,Paragraph:eT}=A.Typography,ul=({reason:e="Your password has expired",onReset:t,loading:r=!1,title:n="Password Reset Required",subtitle:o="Please create a new password to continue",passwordRules:s,logo:a})=>{const[c]=v.useState(0),[l,u]=v.useState(!1),[d,h]=v.useState(""),[f,p]=v.useState(null),[m,g]=v.useState({minLength:8,requireUppercase:!0,requireLowercase:!0,requireNumbers:!0,requireSpecialChars:!0}),{authConfig:y,getResetPasswordConfig:b,getMessagesConfig:w}=st(),_=b(),P=w(),E=Yn(y),S=Jn(y),O=Qn(y);v.useEffect(()=>{if(s)g(s);else{const M=re.getPasswordPolicy();g({minLength:M.min_length||8,maxLength:M.max_length,requireUppercase:!!M.require_uppercase,requireLowercase:!!M.require_lowercase,requireNumbers:!!M.require_numbers,requireSpecialChars:!!M.require_special_chars})}},[s]);const N=M=>{if(!M)return{percent:0,status:"exception"};let $=0;return M.length>=m.minLength&&($+=20),M.length>=12&&($+=10),m.requireUppercase&&/[A-Z]/.test(M)&&($+=20),m.requireLowercase&&/[a-z]/.test(M)&&($+=20),m.requireNumbers&&/\d/.test(M)&&($+=15),m.requireSpecialChars&&/[!@#$%^&*()_+\-=[\]{}|;:'",.<>?/\\~`]/.test(M)&&($+=15),$<40?{percent:$,status:"exception"}:$<70?{percent:$,status:"normal"}:{percent:$,status:"success"}},k=(M,$)=>pg($,{min_length:m.minLength},H=>{const V=[],{maxLength:R,requireUppercase:K,requireLowercase:Y,requireNumbers:D,requireSpecialChars:ne}=m;return R&&H.length>R&&V.push(`Password must be at most ${R} characters long`),K&&!/[A-Z]/.test(H)&&V.push("Password must contain an uppercase letter"),Y&&!/[a-z]/.test(H)&&V.push("Password must contain a lowercase letter"),D&&!/\d/.test(H)&&V.push("Password must contain a number"),ne&&!/[!@#$%^&*()_+\-=[\]{}|;:'",.<>?/\\~`]/.test(H)&&V.push("Password must contain a special character"),{valid:V.length===0,errors:V}},{required:P?.validation?.required||"Please input your password!",tooShort:P?.validation?.passwordTooShort}),I=async M=>{if(p(null),M.password!==M.confirmPassword){const $=P?.validation?.passwordsDoNotMatch||"Passwords do not match!";p($);return}u(!0);try{await t({password:M.password,confirmPassword:M.confirmPassword})}catch($){const H=$ instanceof Error?$.message:"Failed to set password. Please try again.";p(H)}finally{u(!1)}},j=N(d),q=qe();return i.jsx("div",{className:q?"w-full":"w-full max-w-lg mx-auto",children:i.jsxs(A.Card,{className:q?"shadow-none border-0 px-0":"shadow-lg rounded-lg",bordered:!1,style:q?void 0:E,children:[a&&i.jsx("div",{className:S.className,style:S.style,children:typeof a=="string"?i.jsx("img",{src:a,alt:y?.logo?.alt||"Logo",className:"max-w-logo-max-w h-auto",style:O}):a}),i.jsxs("div",{className:"text-center mb-6",children:[i.jsx(XO,{level:3,className:"!mb-2",style:Ar(y),children:typeof _?.resetForm?.title=="function"?v.createElement(_.resetForm.title):_?.resetForm?.title||n}),i.jsx(eT,{className:"!mb-0 text-sm",type:"secondary",style:ur(y),children:typeof _?.resetForm?.subtitle=="function"?v.createElement(_.resetForm.subtitle):_?.resetForm?.subtitle||o})]}),i.jsx(A.Alert,{message:e,type:"warning",showIcon:!0,className:"mb-6"}),f&&i.jsx(A.Alert,{message:f,type:"error",showIcon:!0,className:"mb-6"}),i.jsxs(A.Form,{name:"password-reset-required",onFinish:M=>I(M),layout:"vertical",className:"mt-6",children:[i.jsx(A.FormItem,{name:"password",label:_?.resetForm?.passwordLabel||"New Password",rules:[{validator:k}],children:i.jsx(A.PasswordInput,{prefix:i.jsx(aa,{size:16}),placeholder:_?.resetForm?.passwordPlaceholder||"New Password",onChange:M=>h(M.target.value)})}),d&&i.jsxs("div",{className:"-mt-4 mb-4",children:[i.jsx(Rr,{type:"secondary",className:"text-xs block mb-1",children:"Password Strength"}),i.jsx(A.Progress,{percent:j.percent,status:j.status,showInfo:!1,strokeWidth:4})]}),i.jsx(A.FormItem,{name:"confirmPassword",label:_?.resetForm?.confirmPasswordLabel||"Confirm Password",rules:[{required:!0,message:P?.validation?.required||"Please confirm your password!"}],children:i.jsx(A.PasswordInput,{prefix:i.jsx(aa,{size:16}),placeholder:_?.resetForm?.confirmPasswordPlaceholder||"Confirm Password"})}),_?.resetForm?.showPasswordRequirements!==!1&&i.jsxs("div",{className:"bg-gray-50 p-4 rounded-md mb-6",children:[i.jsx(Rr,{type:"secondary",className:"block font-medium mb-2",children:_?.resetForm?.passwordRequirementsText||"Password Requirements:"}),i.jsxs(A.Space,{direction:"vertical",size:"small",children:[i.jsxs(Rr,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Er,{size:16,className:d.length>=m.minLength?"text-green-500":"text-gray-300"}),"At least ",m.minLength," characters"]}),m.maxLength&&i.jsxs(Rr,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Er,{size:16,className:d.length<=m.maxLength?"text-green-500":"text-gray-300"}),"At most ",m.maxLength," characters"]}),m.requireUppercase&&i.jsxs(Rr,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Er,{size:16,className:/[A-Z]/.test(d)?"text-green-500":"text-gray-300"}),"One uppercase letter"]}),m.requireLowercase&&i.jsxs(Rr,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Er,{size:16,className:/[a-z]/.test(d)?"text-green-500":"text-gray-300"}),"One lowercase letter"]}),m.requireNumbers&&i.jsxs(Rr,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Er,{size:16,className:/\d/.test(d)?"text-green-500":"text-gray-300"}),"One number"]}),m.requireSpecialChars&&i.jsxs(Rr,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Er,{size:16,className:/[!@#$%^&*()_+\-=[\]{}|;:'",.<>?/\\~`]/.test(d)?"text-green-500":"text-gray-300"}),"One special character"]})]})]}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",fullWidth:!0,disabled:l||r,children:l||r?i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx(qr,{size:16,className:"animate-spin"}),_?.resetForm?.submitButtonText||"Reset Password"]}):_?.resetForm?.submitButtonText||"Reset Password"})})]},c)]})})};function tT({...e}){return i.jsx(zw,{"data-slot":"collapsible",...e})}function rT({...e}){return i.jsx(Fw,{"data-slot":"collapsible-trigger",...e})}function nT({...e}){return i.jsx(Dw,{"data-slot":"collapsible-content",...e})}function oT({...e}){return i.jsx(E_,{"data-slot":"dropdown-menu",...e})}function sT({...e}){return i.jsx(k_,{"data-slot":"dropdown-menu-trigger",...e})}function aT({className:e,sideOffset:t=4,...r}){return i.jsx(A_,{children:i.jsx(O_,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ye("bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})}function iT({className:e,...t}){return i.jsx(N_,{"data-slot":"dropdown-menu-item",className:ye("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t})}function cT({className:e,...t}){return i.jsx(T_,{"data-slot":"dropdown-menu-label",className:ye("px-2 py-1.5 text-xs font-semibold",e),...t})}function lT({className:e,...t}){return i.jsx(L_,{"data-slot":"dropdown-menu-separator",className:ye("bg-muted -mx-1 my-1 h-px",e),...t})}function uT({description:e,className:t,image:r}){return i.jsxs("div",{className:ye("flex flex-col items-center justify-center py-8",t),children:[!r&&i.jsx("div",{className:"mb-4 text-muted-foreground/40",children:i.jsx("svg",{width:"64",height:"41",viewBox:"0 0 64 41",fill:"currentColor",role:"img","aria-label":"Empty state",children:i.jsxs("g",{transform:"translate(0 1)",fillRule:"evenodd",children:[i.jsx("ellipse",{fill:"#f5f5f5",cx:"32",cy:"33",rx:"32",ry:"7"}),i.jsxs("g",{fillRule:"nonzero",stroke:"#d9d9d9",children:[i.jsx("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),i.jsx("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:"#fafafa"})]})]})})}),e&&i.jsx("div",{className:"text-sm text-muted-foreground",children:e})]})}function dT({...e}){return i.jsx(Ni,{"data-slot":"sheet",...e})}function fT({...e}){return i.jsx(Li,{"data-slot":"sheet-portal",...e})}function hT({className:e,...t}){return i.jsx(Ii,{"data-slot":"sheet-overlay",className:ye("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function pT({className:e,children:t,side:r="right",showCloseButton:n=!0,...o}){return i.jsxs(fT,{children:[i.jsx(hT,{}),i.jsxs(Fi,{"data-slot":"sheet-content",className:ye("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...o,children:[t,n&&i.jsxs(K0,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[i.jsx(z3,{className:"size-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function mT({className:e,...t}){return i.jsx("div",{"data-slot":"sheet-header",className:ye("flex flex-col gap-1.5 p-4",e),...t})}function gT({className:e,...t}){return i.jsx(Di,{"data-slot":"sheet-title",className:ye("text-foreground font-semibold",e),...t})}function bT({className:e,...t}){return i.jsx(R0,{"data-slot":"sheet-description",className:ye("text-muted-foreground text-sm",e),...t})}function yT({delayDuration:e=0,...t}){return i.jsx(G_,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function wT({...e}){return i.jsx(K_,{"data-slot":"tooltip",...e})}function vT({...e}){return i.jsx(Y_,{"data-slot":"tooltip-trigger",...e})}function _T({className:e,sideOffset:t=0,children:r,...n}){return i.jsx(Q_,{children:i.jsxs(J_,{"data-slot":"tooltip-content",sideOffset:t,className:ye("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[r,i.jsx(X_,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const xT="sidebar_state",ST=3600*24*7,CT="16rem",PT="100vw",ET="3rem",kT="b",Ng=x.createContext(null);function wn(){const e=x.useContext(Ng);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function AT({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:o,children:s,...a}){const c=qe(),[l,u]=x.useState(!1),[d,h]=x.useState(e),f=t??d,p=x.useCallback(b=>{const w=typeof b=="function"?b(f):b;r?r(w):h(w),document.cookie=`${xT}=${w}; path=/; max-age=${ST}; SameSite=Lax`},[r,f]),m=x.useCallback(()=>c?u(b=>!b):p(b=>!b),[c,p]);x.useEffect(()=>{const b=w=>{w.key===kT&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),m())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[m]);const g=f?"expanded":"collapsed",y=x.useMemo(()=>({state:g,open:f,setOpen:p,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:m}),[g,f,p,c,l,m]);return i.jsx(Ng.Provider,{value:y,children:i.jsx(yT,{delayDuration:0,children:i.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":CT,"--sidebar-width-icon":ET,...o},className:ye("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...a,children:s})})})}function OT({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:o,...s}){const{isMobile:a,state:c,openMobile:l,setOpenMobile:u}=wn();return r==="none"?i.jsx("div",{"data-slot":"sidebar",className:ye("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...s,children:o}):a?i.jsx(dT,{open:l,onOpenChange:u,children:i.jsxs(pT,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:ye("bg-sidebar text-sidebar-foreground w-screen! max-w-none! sm:max-w-none! p-0 [&>button:last-child]:p-2 [&>button:last-child]:opacity-100 [&>button:last-child_svg]:size-7",n),style:{"--sidebar-width":PT},side:e,...s,children:[i.jsxs(mT,{className:"sr-only",children:[i.jsx(gT,{children:"Sidebar"}),i.jsx(bT,{children:"Displays the mobile sidebar."})]}),i.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):i.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":c==="collapsed"?r:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[i.jsx("div",{"data-slot":"sidebar-gap",className:ye("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),i.jsx("div",{"data-slot":"sidebar-container",className:ye("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l"),children:i.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:ye("bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",n),...s,children:o})})]})}function Lg({className:e,onClick:t,...r}){const{toggleSidebar:n}=wn();return i.jsxs(ar,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ye("size-7",e),onClick:o=>{t?.(o),n()},...r,children:[i.jsx(M3,{}),i.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function TT({className:e,...t}){const{toggleSidebar:r}=wn();return i.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:ye("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function NT({className:e,...t}){return i.jsx("main",{"data-slot":"sidebar-inset",className:ye("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function LT({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ye("flex flex-col gap-2",e),...t})}function MT({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ye("flex flex-col",e),...t})}function IT({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ye("flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function dl({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ye("relative flex w-full min-w-0 flex-col p-2",e),...t})}function FT({className:e,asChild:t=!1,...r}){const n=t?ss:"div";return i.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:ye("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})}function fl({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ye("w-full text-sm",e),...t})}function Mg({className:e,...t}){return i.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ye("flex w-full min-w-0 flex-col gap-1",e),...t})}function hl({className:e,...t}){return i.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ye("group/menu-item relative",e),...t})}const DT=_u("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function pl({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:o,className:s,...a}){const c=e?ss:"button",{isMobile:l,state:u}=wn(),d=i.jsx(c,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":t,className:ye(DT({variant:r,size:n}),s),...a});return o?(typeof o=="string"&&(o={children:o}),i.jsxs(wT,{children:[i.jsx(vT,{asChild:!0,children:d}),i.jsx(_T,{side:"right",align:"center",hidden:u!=="collapsed"||l,...o})]})):d}function $T({className:e,...t}){return i.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:ye("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function zT({className:e,...t}){return i.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:ye("group/menu-sub-item relative",e),...t})}function UT({asChild:e=!1,size:t="md",isActive:r=!1,className:n,...o}){const s=e?ss:"a";return i.jsx(s,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:ye("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...o})}const{Title:Ig,Text:ml,Paragraph:jT}=A.Typography,Fg=e=>{const t=e.toLowerCase();return t.includes("admin")?i.jsx(T3,{size:20}):t.includes("manager")||t.includes("supervisor")?i.jsx($3,{size:20}):t.includes("security")||t.includes("compliance")?i.jsx(tm,{size:20}):i.jsx(rm,{size:20})},gl=({roles:e,onRoleSelect:t,loading:r=!1,title:n="Choose Your Role",subtitle:o="Pick a role to continue",logo:s})=>{const[a,c]=v.useState(null),[l,u]=v.useState(!1),d=qe(),{getRoleSelectionConfig:h,authConfig:f}=st(),p=h(),m=Yn(f),g=Jn(f),y=Qn(f),b=async()=>{if(a){u(!0);try{await t(a)}catch(S){J.error("Role selection failed",S),A.toast.error("Failed to set role. Please try again.")}finally{u(!1)}}};if(r)return i.jsx("div",{className:"flex justify-center items-center min-h-[400px]",children:i.jsx(A.Spin,{size:"large",tip:"Loading your available roles..."})});if(!e||e.length===0){const S=p?.customEmptyState;return S?i.jsx(S,{}):d?i.jsxs("div",{className:"role-select-mobile__empty text-center py-12 px-3",children:[i.jsx("p",{className:"role-select-mobile__empty-title text-base font-semibold text-foreground m-0 mb-1.5",children:p?.emptyStateMessage||"No roles available"}),i.jsx("p",{className:"role-select-mobile__empty-sub text-[13px] text-muted-foreground m-0",children:"Please contact your administrator for role assignment"})]}):i.jsx("div",{className:"max-w-lg mx-auto p-5",children:i.jsx("div",{style:d?void 0:m,children:i.jsx(uT,{className:"text-center py-12 px-5 text-gray-500",description:i.jsxs("div",{children:[i.jsx(ml,{className:"text-gray-600 text-base block mb-2",children:p?.emptyStateMessage||"No roles available"}),i.jsx(ml,{type:"secondary",className:"text-sm",children:"Please contact your administrator for role assignment"})]})})})})}const w=(S,O)=>{if(!S)return O;if(typeof S=="string"||v.isValidElement(S))return S;const N=S;return i.jsx(N,{})},_=w(p?.title,n),P=w(p?.subtitle,o),E=p?.gridColumns||(e.length<=2?2:3);if(d){const O=(typeof _=="string"?_:"Choose Your Role").trim().split(/\s+/),N=O.pop(),k=O.join(" "),I=a?p?.continueButtonText?.replace("{roleName}",a.name)||`Continue as ${a.name}`:"Please select a role to continue";return i.jsxs("div",{className:"role-select-mobile flex flex-col h-full min-h-0 w-full",children:[i.jsx("div",{className:"role-select-mobile__sticky-top flex-none flex flex-col gap-[18px] pb-3.5",children:i.jsxs("div",{className:"role-select-mobile__heading text-center",children:[v.isValidElement(_)?_:i.jsxs("h1",{children:[k?`${k} `:"",i.jsxs("em",{className:"accent",children:[N,"."]})]}),v.isValidElement(P)?P:P?i.jsx("p",{children:P}):null]})}),i.jsx("div",{className:"role-select-mobile__list",role:"radiogroup","aria-label":"Available roles",children:e.map(j=>{const q=p?.customRoleCard;if(q)return i.jsx(q,{role:j,selected:a?.id===j.id,onSelect:()=>c(j)},j.id);const M=a?.id===j.id;return i.jsxs("button",{type:"button",role:"radio","aria-checked":M,"data-testid":"role-option",className:`role-select-mobile__row${M?" role-select-mobile__row--selected":""}`,onClick:()=>c(j),children:[i.jsx("span",{className:"role-select-mobile__row-icon",children:Fg(j.name)}),i.jsxs("span",{className:"role-select-mobile__row-body",children:[i.jsx("span",{className:"role-select-mobile__row-name",title:j.name,children:j.name}),j.is_default&&i.jsxs("span",{className:"role-select-mobile__row-recommended",children:[i.jsx(D3,{size:11,fill:"currentColor"}),p?.recommendedBadgeText||"Recommended"]})]}),M&&i.jsx("span",{className:"role-select-mobile__row-check","aria-hidden":!0,children:i.jsx(Er,{size:14})})]},j.id)})}),i.jsx("div",{className:"role-select-mobile__cta",children:i.jsxs("div",{className:"role-select-mobile__cta-inner",children:[i.jsxs("button",{type:"button",className:"role-select-mobile__cta-button",onClick:b,disabled:!a||l,children:[l?i.jsx(A.Spin,{size:"small"}):a?i.jsx(Er,{size:16}):null,i.jsx("span",{children:I})]}),a?.is_default&&i.jsx("p",{className:"role-select-mobile__cta-hint",children:"This is your recommended role based on your permissions"})]})})]})}return i.jsx("div",{className:"max-w-lg mx-auto p-5",children:i.jsxs("div",{style:d?void 0:m,children:[s&&i.jsx("div",{className:g.className,style:g.style,children:typeof s=="string"?i.jsx("img",{src:s,alt:f?.logo?.alt||"Logo",className:"max-w-logo-max-w h-auto",style:y}):s}),i.jsxs("div",{className:"text-center mb-8",children:[v.isValidElement(_)?_:i.jsx(Ig,{level:3,className:"!mb-3 !text-2xl !font-semibold !text-gray-800",style:Ar(f),children:_}),v.isValidElement(P)?P:i.jsx(jT,{className:"!mb-6 text-base text-gray-600 !leading-relaxed",style:ur(f),children:P})]}),i.jsx("div",{className:"mb-8",children:i.jsx("div",{className:"max-h-96 overflow-y-auto px-2 py-2",style:{maxHeight:p?.maxHeight||"24rem"},children:i.jsx("div",{className:`grid gap-4 grid-cols-1 ${E===3?"sm:grid-cols-2 lg:grid-cols-3":"sm:grid-cols-2"}`,children:e.map(S=>{const O=p?.customRoleCard;if(O)return i.jsx(O,{role:S,selected:a?.id===S.id,onSelect:()=>c(S)},S.id);const N=p?.roleCardStyling||{},k=a?.id===S.id;return i.jsxs("button",{type:"button","data-testid":"role-option",className:"cursor-pointer transition-all duration-300 border relative p-4 hover:-translate-y-1 flex flex-col items-center w-full min-h-[8rem] h-32",style:{backgroundColor:k?N.selectedColor||"var(--color-brand-50, #EAE8FF)":N.backgroundColor||"#ffffff",borderColor:k?N.selectedColor||"var(--color-brand-500, #5048ED)":"#d9d9d9",borderRadius:N.borderRadius||"16px",...p?.roleCardStyling},onClick:()=>c(S),children:[a?.id===S.id&&i.jsx("div",{className:"absolute -top-2 -right-2 bg-brand-500 rounded-full p-2",children:i.jsx(Er,{size:16,className:"text-white"})}),i.jsx("div",{className:"flex justify-center mt-2 mb-3",children:i.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-xl flex items-center justify-center",children:Fg(S.name)})}),i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-1",children:[i.jsx(Ig,{level:5,className:"!mb-0 !text-sm !font-semibold !text-gray-900 !leading-tight !line-clamp-2 !text-center",title:S.name,children:S.name}),S.is_default&&i.jsx("div",{className:"mt-1",children:i.jsx(A.Tag,{color:"warning",className:"bg-yellow-50 border-yellow-300 text-yellow-700 font-medium text-xs px-1",children:p?.recommendedBadgeText||"Recommended"})})]})]},S.id)})})})}),i.jsxs("div",{className:"pt-4 border-t border-gray-200",children:[i.jsx(A.Button,{variant:"primary",fullWidth:!0,onClick:b,disabled:!a||l,className:"w-full text-base font-medium",children:a?p?.continueButtonText?.replace("{roleName}",a.name)||`Continue as ${a.name}`:"Please select a role to continue"}),a?.is_default&&i.jsx(ml,{type:"secondary",className:"block text-center mt-3 text-sm",children:"This is your recommended role based on your permissions"})]})]})})},Dg=({length:e=6,value:t="",onChange:r,disabled:n=!1})=>{const[o,s]=v.useState(new Array(e).fill("")),a=v.useRef([]),c=v.useCallback((h,f)=>{a.current[f]=h},[]);v.useEffect(()=>{if(t){const h=t.split("").slice(0,e),f=[...new Array(e).fill("")];h.forEach((p,m)=>{f[m]=p}),s(f)}},[t,e]);const l=(h,f)=>{const p=h.value;if(p&&!/^\d$/.test(p))return;const m=[...o];m[f]=p,s(m),r?.(m.join("")),p&&f<e-1&&a.current[f+1]?.focus()},u=(h,f)=>{h.key==="Backspace"&&!o[f]&&f>0&&a.current[f-1]?.focus()},d=h=>{h.preventDefault();const p=h.clipboardData.getData("text/plain").slice(0,e).split(""),m=[...o];p.forEach((y,b)=>{/^\d$/.test(y)&&b<e&&(m[b]=y)}),s(m),r?.(m.join(""));const g=m.indexOf("");g!==-1?a.current[g]?.focus():a.current[e-1]?.focus()};return i.jsx(A.Space,{className:"flex justify-center gap-2",size:"small",children:o.map((h,f)=>i.jsx(A.Input,{ref:p=>c(p,f),type:"text",inputMode:"numeric",maxLength:1,value:h,onChange:p=>l(p.target,f),onKeyDown:p=>u(p,f),onPaste:d,"aria-label":`Digit ${f+1} of ${e}`,"data-otp-cell":!0,className:"!w-[clamp(40px,11vw,56px)] !h-[clamp(40px,11vw,56px)] text-center text-[clamp(16px,4vw,20px)] font-semibold rounded-lg transition-all duration-300 focus:border-brand-500 focus:shadow-[0_0_0_2px_rgba(106,138,18,0.2)] disabled:bg-gray-100 disabled:cursor-not-allowed",disabled:n},f))})},{Title:BT,Text:bl,Paragraph:VT}=A.Typography,$g=({user:e,availableMethods:t=["email","sms"],onVerify:r,loading:n=!1,otpDigits:o=6,retryInterval:s=30,title:a="Two-Factor Authentication",subtitle:c="For your security, please verify your identity",logo:l})=>{const[u,d]=v.useState(t[0]||"email"),[h,f]=v.useState(""),[p,m]=v.useState(0),[g,y]=v.useState(!1),[b,w]=v.useState(!1),{authConfig:_,getTwoFactorConfig:P,getMessagesConfig:E}=st(),S=P(),O=E(),N=Yn(_),k=Jn(_),I=Qn(_),j=qe();v.useEffect(()=>{if(p>0){const Y=setTimeout(()=>m(p-1),1e3);return()=>clearTimeout(Y)}},[p]);const q=Y=>Y==="sms"?S?.methodLabels?.sms||"SMS":Y==="email"?S?.methodLabels?.email||"Email":S?.methodLabels?.mobile||"Authenticator App",M=Y=>{if(Y==="email"&&e?.email){const[D,ne]=e.email.split("@");return D.length<=3?`${D[0]}****@${ne}`:`${`${D.substring(0,3)}****${D.substring(D.length-1)}`}@${ne}`}return(Y==="sms"||Y==="mobile")&&e?.mobile?`****${e.mobile.substring(e.mobile.length-4)}`:Y==="totp"?"your authenticator app":Y==="email"?"your email":Y==="sms"?"your mobile":"your authenticator app"},$=async()=>{y(!0);try{await re.sendTwoFactorCode(u),w(!0),m(S?.resendCountdown||s);const Y=O?.success?.otpSent||`OTP sent to ${M(u)}`;A.toast.success(Y)}catch(Y){const D=O?.errors?.networkError||(Y instanceof Error?Y.message:null)||"Failed to Request OTP";A.toast.error(D)}finally{y(!1)}},H=async()=>{const Y=S?.codeLength||o;if(h.length!==Y){const D=O?.validation?.required||`Please enter ${Y} digit OTP`;A.toast.error(D);return}y(!0);try{const D=await re.verifyTwoFactorCode(h);await r(D)}catch(D){const ne=O?.errors?.invalidOTP||(D instanceof Error?D.message:null)||"Invalid OTP";A.toast.error(ne),f("")}finally{y(!1)}},V=async()=>{p>0||await $()},R=()=>{if(t.length<=1)return null;const Y=t.map(D=>({label:i.jsxs(A.Space,{children:[D==="email"?i.jsx(ia,{size:16}):D==="sms"?i.jsx(Vc,{size:16}):i.jsx(tm,{size:16}),i.jsx("span",{children:D==="email"?S?.methodLabels?.email||"Email":D==="sms"?S?.methodLabels?.sms||"SMS":S?.methodLabels?.mobile||"Authenticator"})]}),value:D}));return i.jsxs("div",{className:"mb-6",children:[i.jsx(bl,{type:"secondary",className:"block mb-2 text-xs",children:"Verification Method"}),i.jsx(A.Segmented,{options:Y,value:u,onChange:D=>{d(String(D)),w(!1),f("")},block:!0})]})},K=i.jsxs(i.Fragment,{children:[!j&&l&&i.jsx("div",{className:k.className,style:k.style,children:typeof l=="string"?i.jsx("img",{src:l,alt:_?.logo?.alt||"Logo",className:"max-w-logo-max-w h-auto",style:I}):l}),i.jsxs("div",{className:"text-center mb-8",children:[i.jsx(BT,{level:3,className:"!mb-2",style:Ar(_),children:(typeof S?.title=="string"?S.title:null)||a}),i.jsx(VT,{className:"!mb-0 text-sm",style:ur(_),children:(typeof S?.subtitle=="string"?S.subtitle:null)||c})]}),i.jsxs("div",{className:"mt-6",children:[R(),b?i.jsxs("div",{className:"mt-6",children:[i.jsx(bl,{className:"block text-center mb-6 text-gray-700",children:S?.instructionText||`Enter the ${S?.codeLength||o}-digit code sent via ${q(u)} to ${M(u)}`}),i.jsx("div",{className:"flex justify-center mb-6",children:i.jsx(Dg,{length:S?.codeLength||o,value:h,onChange:f,disabled:g})}),i.jsx("div",{className:"auth-mobile-cta-anchor",children:i.jsx(A.Button,{variant:"primary",fullWidth:!0,disabled:g,onClick:H,className:"mb-4",children:g?i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx(qr,{size:16,className:"animate-spin"}),S?.submitButtonText||"Verify"]}):S?.submitButtonText||"Verify"})}),i.jsx("div",{className:"text-center",children:p>0?i.jsxs(bl,{type:"secondary",children:["Resend code in ",p,"s"]}):i.jsx(A.Button,{variant:"link",onClick:V,disabled:g,children:S?.resendButtonText||"Resend Code"})})]}):i.jsxs("div",{className:"mt-6",children:[j?i.jsx("p",{className:"text-center text-sm text-gray-600 mb-6",children:S?.sendInstructionText||`We'll send a verification code via ${q(u)} to ${M(u)}`}):i.jsx(A.Alert,{message:S?.sendInstructionText||`We'll send a verification code via ${q(u)} to ${M(u)}`,type:"info",showIcon:!0,className:"mb-6"}),i.jsx("div",{className:"auth-mobile-cta-anchor",children:i.jsx(A.Button,{variant:"primary",fullWidth:!0,disabled:g,onClick:$,children:g?i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx(qr,{size:16,className:"animate-spin"}),S?.sendButtonText||`Send Code via ${q(u)}`]}):S?.sendButtonText||`Send Code via ${q(u)}`})})]})]})]});return j?i.jsx("div",{className:"w-full",children:K}):i.jsx("div",{className:"w-full max-w-lg mx-auto",children:i.jsx(A.Card,{className:"shadow-lg rounded-lg",bordered:!1,style:N,children:K})})},{Content:Vo}=A.Layout,qT=v.lazy(()=>Promise.resolve().then(function(){return y4}).then(e=>({default:e.LoginPageWithRoleSelection}))),oo=({logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:o=!0,staticConfig:s=null,onAuthComplete:a,roleSelectionTitle:c,roleSelectionSubtitle:l,twoFactorTitle:u,twoFactorSubtitle:d,passwordResetTitle:h,passwordResetSubtitle:f,initialAuthState:p=null,skipLoginStep:m=!1,initialNextParam:g=null})=>{const{user:y,pendingAuth:b}=Zr(),{authConfig:w}=st(),_=qe(),{appName:P,appLogo:E}=$e(),S=typeof e=="string"?e:E,[O,N]=v.useState(()=>{if(p){let T=null;if(p?.status===401&&p?.data?T=p.data?.next_step:p?.response?.status===401&&p?.response?.data?T=p.response.data?.next_step:p?.next_step?T=p.next_step:T=(p?.response?.data||p?.data||p)?.next_step,T?.is_pending)switch(T.id){case"role_selection":return"roleSelection";case"mfa_authenticate":return"twoFactor";case"set_password":case"password_expiry":case"first_login":return"passwordReset"}if(p.roles&&p.roles.length>1)return"roleSelection";if(p.requires2FA)return"twoFactor";if(p.requiresPasswordReset)return"passwordReset"}return"login"}),[k,I]=v.useState(p?.token||null),[j,q]=v.useState(p?.twoFactorMethods||null),[M,$]=v.useState(p?.passwordResetReason||null),[H]=v.useState(g||null);v.useEffect(()=>{if(p&&O==="login"){let T=null;if(p?.status===401&&p?.data?T=p.data?.next_step:p?.response?.status===401&&p?.response?.data?T=p.response.data?.next_step:p?.next_step?T=p.next_step:T=(p?.response?.data||p?.data||p)?.next_step,T?.is_pending)switch(T.id){case"role_selection":{let F=[];Array.isArray(T.metadata?.roles)?F=T.metadata.roles:typeof T.metadata?.roles=="object"&&(F=Object.entries(T.metadata.roles).map(([X,G])=>({id:X,name:G,is_default:!1})));const z=p?.loginUser,B=p?.user||p?.data?.user||z||{};R({...p,roles:F,user:B,nextStep:T,loginUser:z}),N("roleSelection");break}case"mfa_authenticate":{const F=T.metadata?.method?[T.metadata.method]:T.metadata?.type?[T.metadata.type]:T.metadata?.methods||["email"];q(F),N("twoFactor");break}case"set_password":case"password_expiry":case"first_login":$(T.metadata?.reason??"Password update required"),R({...p,passwordPolicy:T.metadata?.password_policy}),N("passwordReset");break}else p.roles&&p.roles.length>1?N("roleSelection"):p.requires2FA?(q(p.twoFactorMethods||["email"]),N("twoFactor")):p.requiresPasswordReset&&($(p.passwordResetReason||"Password reset required"),N("passwordReset"))}},[p,O]);const[V,R]=v.useState(()=>{if(p){let T=null;if(p?.status===401&&p?.data?T=p.data?.next_step:p?.response?.status===401&&p?.response?.data?T=p.response.data?.next_step:p?.next_step?T=p.next_step:T=(p?.response?.data||p?.data||p)?.next_step,T&&T.id==="role_selection"){let F=[];const z=T.metadata?.roles;Array.isArray(z)?F=z:z&&typeof z=="object"?F=Object.entries(z).map(([te,ie])=>({id:te,name:ie,is_default:!1})):J.warn("[CompleteAuthFlow] No valid roles found in metadata");const B=p?.loginUser,X=p?.user||p?.data?.user||B||{};return{...p,roles:F,user:X,nextStep:T,loginUser:B}}}return p||null});v.useEffect(()=>{if(m&&O==="login"&&p&&a){const T=p?.data||p?.response?.data||p;if((p?.next_step||T?.next_step)?.is_pending||p.roles&&p.roles.length>1)return;const z=p?.user||p?.data?.user||{},B=p?.redirect_url||p?.data?.redirect_url||p?.response?.data?.redirect_url,X=Be(H,B,"/app");a({...p,user:z,authenticated:!0,redirect_url:X})}},[m,O,p,a,H]);const K=async T=>{let F=T,z=null,B=!1,X=null;T?.status===401&&T?.data?(F=T.data,z=T.data?.next_step,X=T.status,B=T?.meta?.is_authenticated||!1):T?.next_step?(F=T,z=T.next_step,B=T?.meta?.is_authenticated||!1,X=T?.status):T?.response?(X=T.response.status,F=T.response.data,z=F?.next_step,B=T.response.meta?.is_authenticated||!1):(F=T?.response?.data||T?.data||T,z=F?.next_step,B=T?.meta?.is_authenticated||F?.meta?.is_authenticated||!1,X=T?.status||F?.status);const G=T?.loginUser;(T?.token||F?.token)&&I(T.token??F?.token??null);let te=T?.user||F?.user||G||{};if((typeof te!="object"||te===null)&&(te={}),G&&typeof G=="object"){const ie=G;te={...te,email:te.email||ie.email,username:te.username||ie.username,phone:te.phone||ie.phone,name:te.name||ie.display}}if(X===200&&B){A.toast.success("Login successful!"),a&&a({...T,user:te,authenticated:!0,redirect_url:Be(H,F?.redirect_url??T?.redirect_url,"/app")});return}if(z?.is_pending)switch(z.id){case"role_selection":{let ie=[];const Ne=z.metadata?.roles;Array.isArray(Ne)?ie=Ne:Ne&&typeof Ne=="object"&&(ie=Object.entries(Ne).map(([Ae,_e])=>({id:Ae,name:_e,is_default:!1}))),R({...T,roles:ie,user:te,nextStep:z,loginUser:G}),N("roleSelection");return}case"mfa_authenticate":{I(T.token??F?.token??null);const ie=z.metadata?.method?[z.metadata.method]:z.metadata?.type?[z.metadata.type]:z.metadata?.methods||["email"];q(ie),R({...T,user:te,loginUser:G}),N("twoFactor");return}case"set_password":{I(T.token??F?.token??null);const ie=z.metadata?.password_policy;$(z.metadata?.reason??"Password update required"),R({...T,passwordPolicy:ie,user:te,loginUser:G}),N("passwordReset");return}case"password_expiry":I(T.token??F?.token??null),$("Your password has expired"),R({...T,passwordPolicy:z.metadata?.password_policy,user:te,loginUser:G}),N("passwordReset");return;case"first_login":I(T.token??F?.token??null),$("Please set up your password for first login"),R({...T,passwordPolicy:z.metadata?.password_policy,user:te,loginUser:G}),N("passwordReset");return;case"login_by_code":I(T.token??F?.token??null),A.toast.info("OTP verification required"),a&&a({...T,user:te,requiresOTP:!0});return}if(T.requires2FA){I(T.token??null),q(T.twoFactorMethods||["email"]),R({...T,user:te,loginUser:G}),N("twoFactor");return}if(T.requiresPasswordReset){I(T.token??null),$(T.passwordResetReason??"Your password has expired"),R({...T,user:te,loginUser:G}),N("passwordReset");return}a&&a({...T,user:te})},Y=async T=>{let F=T,z=null,B=!1,X=null;if(T?.status===401&&T?.data?(F=T.data,z=T.data?.next_step,X=T.status,B=T?.meta?.is_authenticated||!1):T?.response?(X=T.response.status,F=T.response.data,z=F?.next_step,B=T.response.meta?.is_authenticated||!1):(F=T?.data||T,z=F?.next_step,B=T?.meta?.is_authenticated||F?.meta?.is_authenticated||!1,X=T?.status||F?.status),X===200&&B){A.toast.success("Two-factor authentication successful!"),a&&a({...T,token:k??void 0,user:V?.user,authenticated:!0,redirect_url:Be(H,F?.redirect_url??T?.redirect_url,"/app")});return}if(z?.is_pending)if(z.id==="set_password"){const G=z.metadata?.password_policy;$(z.metadata?.reason??"Password reset required"),R({...V,passwordPolicy:G}),N("passwordReset");return}else J.warn("Unknown next step after 2FA",{nextStepId:z.id});if(T.requiresPasswordReset){$(T.passwordResetReason??"Your password has expired"),N("passwordReset");return}A.toast.success("Two-factor authentication successful!"),a&&a({...T,token:k??void 0,user:V?.user,authenticated:!0})},D=async T=>{try{const F=await re.setPassword(T.password);let z=F,B=null,X=!1,G=null;if(F?.status===401&&F?.data?(z=F.data,B=F.data?.next_step,G=F.status,X=F?.meta?.is_authenticated||!1):F?.response?(G=F.response.status,z=F.response.data,B=z?.next_step,X=F.response.meta?.is_authenticated||!1):(z=F?.data||F,B=z?.next_step,X=F?.meta?.is_authenticated||z?.meta?.is_authenticated||!1,G=F?.status||z?.status),G===200&&X){A.toast.success("Password reset successful!"),a&&a({...F,token:k??void 0,user:V?.user,authenticated:!0,redirect_url:Be(H,z?.redirect_url??F?.redirect_url,"/app")});return}if(B?.is_pending)switch(B.id){case"login":A.toast.success("Password reset successful!"),a&&a({...F,token:k??void 0,user:V?.user,authenticated:!1,redirect_url:Be(H,z?.redirect_url??F?.redirect_url,"/app/login")});return;case"mfa_authenticate":{const te=B.metadata?.method?[B.metadata.method]:B.metadata?.type?[B.metadata.type]:B.metadata?.methods||["email"];q(te),N("twoFactor");return}default:J.warn("Unknown next step after password reset",{nextStepId:B.id});break}A.toast.success("Password reset successful!"),a&&a({...F,token:k??void 0,user:V?.user,authenticated:!0})}catch(F){throw A.toast.error(F instanceof Error?F.message:"Failed to reset password"),F}};return(()=>{if(p&&O==="login"){let T=null;if(p?.status===401&&p?.data?T=p.data?.next_step:p?.response?.status===401&&p?.response?.data?T=p.response.data?.next_step:p?.next_step?T=p.next_step:T=(p?.response?.data||p?.data||p)?.next_step,T?.is_pending)return i.jsx(A.Layout,{className:"min-h-screen",style:Gt(w),children:i.jsx(Vo,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx("div",{className:"text-center py-16 px-5",children:i.jsx(A.Spin,{size:"large",tip:"Processing authentication..."})})})})}switch(O){case"login":return m?(J.warn("CompleteAuthFlow: in login step but skipLoginStep=true"),null):i.jsx(v.Suspense,{fallback:i.jsx("div",{className:"flex justify-center items-center h-full",children:i.jsx(A.Spin,{size:"large"})}),children:i.jsx(qT,{onLoginSuccess:T=>{K(T)},logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:o,staticConfig:s,roleSelectionTitle:c,roleSelectionSubtitle:l})});case"roleSelection":{if(Array.isArray(V?.roles)&&V.roles.length>0){const F=i.jsx("div",{className:"w-full",children:i.jsx(gl,{user:V?.user,roles:V?.roles||[],logo:e,onRoleSelect:async z=>{try{const B=await re.selectRole(z.id);let X=B,G=null,te=!1,ie=null;if(B?.status===401&&B?.data?(X=B.data,G=B.data?.next_step,ie=B.status,te=B?.meta?.is_authenticated||!1):B?.response?(ie=B.response.status,X=B.response.data,G=X?.next_step,te=B.response.meta?.is_authenticated||!1):(X=B?.data||B,G=X?.next_step,te=B?.meta?.is_authenticated||X?.meta?.is_authenticated||!1,ie=B?.status||X?.status),ie===200&&te){A.toast.success("Role selected successfully!"),a&&a({...B,user:{...V?.user,role:z},authenticated:!0,redirect_url:Be(H,X?.redirect_url??B?.redirect_url,"/app")});return}if(G?.is_pending)switch(G.id){case"mfa_authenticate":{const Ne=G.metadata?.method?[G.metadata.method]:G.metadata?.type?[G.metadata.type]:G.metadata?.methods||["email"];q(Ne),N("twoFactor");return}case"set_password":{const Ne=G.metadata?.password_policy;$(G.metadata?.reason??"Password update required"),R({...V,passwordPolicy:Ne}),N("passwordReset");return}case"password_expiry":$("Your password has expired"),R({...V,passwordPolicy:G.metadata?.password_policy}),N("passwordReset");return;case"first_login":$("Please set up your password for first login"),R({...V,passwordPolicy:G.metadata?.password_policy}),N("passwordReset");return;case"login_by_code":A.toast.info("OTP verification required"),a&&a({...B,user:{...V?.user,role:z},requiresOTP:!0});return;default:J.warn("Unknown next step",{nextStepId:G.id});break}A.toast.success("Role selected successfully!"),a&&a({...B,user:{...V?.user,role:z}})}catch(B){throw A.toast.error(B instanceof Error?B.message:"Failed to select role"),B}},title:c||"Select Your Role",subtitle:l||"Choose a role to continue"})});return _?i.jsx(dr,{appName:P,appLogo:S,children:F}):i.jsx(A.Layout,{className:"min-h-screen",style:Gt(w),children:i.jsx(Vo,{className:"flex justify-center items-center min-h-screen p-5",children:F})})}J.error("[CompleteAuthFlow] roleSelection case but authData.roles is empty or invalid!",void 0,{authData:V,initialAuthState:p});const T=i.jsxs("div",{className:"text-center py-16 px-5",children:[i.jsx("p",{className:"text-red-600",children:"Error: Role selection data not available"}),i.jsx("p",{className:"mt-2 text-gray-600",children:"Please contact support or try logging in again."})]});return _?i.jsx(dr,{appName:P,appLogo:S,children:T}):i.jsx(A.Layout,{className:"min-h-screen",style:Gt(w),children:i.jsx(Vo,{className:"flex justify-center items-center min-h-screen p-5",children:T})})}case"twoFactor":{const T=i.jsx($g,{user:V?.user||b?.user||y,availableMethods:j,onVerify:F=>Y(F),title:u,subtitle:d});return _?i.jsx(dr,{appName:P,appLogo:S,children:T}):i.jsx(A.Layout,{className:"min-h-screen",style:Gt(w),children:i.jsx(Vo,{className:"flex justify-center items-center min-h-screen p-5",children:T})})}case"passwordReset":{const T=V?.passwordPolicy,F=T?{minLength:T.min_length||8,maxLength:T.max_length,requireUppercase:T.require_uppercase||!1,requireLowercase:T.require_lowercase||!1,requireNumbers:T.require_numbers||!1,requireSpecialChars:T.require_special_chars||!1}:void 0,z=i.jsx(ul,{reason:M||void 0,onReset:D,title:h,subtitle:f,passwordRules:F});return _?i.jsx(dr,{appName:P,appLogo:S,children:z}):i.jsx(A.Layout,{className:"min-h-screen",style:Gt(w),children:i.jsx(Vo,{className:"flex justify-center items-center min-h-screen p-5",children:z})})}default:return null}})()},zg=e=>{let t;const r=new Set,n=(u,d)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const f=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),r.forEach(p=>p(t,f))}},o=()=>t,c={setState:n,getState:o,getInitialState:()=>l,subscribe:u=>(r.add(u),()=>r.delete(u))},l=t=e(n,o,c);return c},HT=(e=>e?zg(e):zg),WT=e=>e;function ZT(e,t=WT){const r=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(r),r}const Ug=e=>{const t=HT(e),r=n=>ZT(t,n);return Object.assign(r,t),r},xa=(e=>e?Ug(e):Ug)(e=>({basePath:"/login",setBasePath:t=>e({basePath:t})})),RT=({onSuccess:e,onError:t,apiConfig:r={},redirectPath:n="/",title:o="Completing sign in...",errorTitle:s="Authentication Error",logo:a,roleSelectionTitle:c,roleSelectionSubtitle:l,twoFactorTitle:u,twoFactorSubtitle:d,passwordResetTitle:h,passwordResetSubtitle:f})=>{const[p,m]=v.useState(!0),[g,y]=v.useState(null),[b,w]=v.useState(!1),[_,P]=v.useState(null),[,E]=v.useState("login"),[S,O]=v.useState({}),[,N]=v.useState(["email"]),[,k]=v.useState(""),[I,j]=v.useState(null),q=v.useRef(!1),M=ue.useLocation(),$=ue.useNavigate(),{basePath:H}=xa(),{authConfig:V}=st(),R=qe(),K=v.useCallback(async F=>{let z=F,B=null;F?.status===401&&F?.data?(z=F.data,B=F.data?.next_step):(z=F?.response?.data||F?.data||F,B=z?.next_step);const X=F?.loginUser;let G=F?.user||z?.user||X||{};if((typeof G!="object"||G===null)&&(G={}),X&&typeof X=="object"&&(G={...G,email:G.email||X.email,username:G.username||X.username,phone:G.phone||X.phone,name:G.name||X.display}),B?.is_pending)switch(B.id){case"role_selection":{let te=[];return Array.isArray(B.metadata?.roles)?te=B.metadata.roles:B.metadata?.roles&&typeof B.metadata.roles=="object"&&(te=Object.entries(B.metadata.roles).map(([ie,Ne])=>({id:ie,name:Ne,is_default:!1}))),O({...F,roles:te,user:G,nextStep:B,loginUser:X}),E("roleSelection"),w(!0),m(!1),!0}case"mfa_authenticate":return N(B.metadata?.methods||["email"]),E("twoFactor"),w(!0),m(!1),!0;case"set_password":{const te=B.metadata?.password_policy;return k(String(B.metadata?.reason||"Password update required")),O({...F,passwordPolicy:te,user:G,loginUser:X}),E("passwordReset"),w(!0),m(!1),!0}case"password_expiry":return k("Your password has expired"),O({...F,passwordPolicy:B.metadata?.password_policy,user:G,loginUser:X}),E("passwordReset"),w(!0),m(!1),!0;case"first_login":return k("Please set up your password for first login"),O({...F,passwordPolicy:B.metadata?.password_policy,user:G,loginUser:X}),E("passwordReset"),w(!0),m(!1),!0;case"login_by_code":return A.toast.info("OTP verification required"),e&&e({...F,user:G,requiresOTP:!0}),!0}return F.requires2FA?(N(F.twoFactorMethods||["email"]),O({...F,user:G,loginUser:X}),E("twoFactor"),w(!0),m(!1),!0):F.requiresPasswordReset?(k(F.passwordResetReason||"Your password has expired"),O({...F,user:G,loginUser:X}),E("passwordReset"),w(!0),m(!1),!0):!1},[e]),Y=v.useCallback(async()=>{try{q.current=!0;const F=new URLSearchParams(M.search),z=new URLSearchParams(M.hash.slice(1)),B=It(M.search)||It(M.hash.slice(1));j(B);const X=F.get("error")||z.get("error"),G=F.get("error_description")||z.get("error_description");if(X)throw new Error(G||`Authentication failed: ${X}`);const te=F.get("code"),ie=F.get("state"),Ne=F.get("scope")||"",Ae=F.get("authuser"),_e=F.get("hd"),Se=F.get("prompt"),ge=F.get("provider")||ie?.split(":")[0];if(!te||!ge)throw new Error("Missing required OAuth parameters (code or provider)");const Tt=await re.processOAuthCallback(ge,ie||"",te,Ne,Ae||void 0,_e||void 0,Se||void 0);if(await K(Tt))return;m(!1),setTimeout(e?()=>{e(Tt)}:()=>{$(n,{replace:!0})},1e3)}catch(F){J.error("OAuth callback error",F);const z=F instanceof Error?F.message:"Authentication failed";y(z),m(!1),t&&t(F instanceof Error?F:new Error(z))}},[K,M.search,M.hash,e,$,n,t]);v.useEffect(()=>{q.current||Y()},[Y]);const D=()=>{$(H,{replace:!0})},ne=async F=>{A.toast.success("Authentication complete!");try{const z=F?.response?.data?.redirect_url||F?.data?.redirect_url||F?.redirect_url,B=Or(),X=Be(B,z,"/app"),G=window.location.pathname,te=new URLSearchParams(window.location.search),ie=te.get("code")!==null||te.get("token")!==null;G.startsWith("/app/login")&&ie&&Xe(X)}catch(z){J.error("Error handling auth completion",z)}};if(b)return i.jsx(oo,{logo:a,apiConfig:r,initialAuthState:_||S,onAuthComplete:ne,roleSelectionTitle:c,roleSelectionSubtitle:l,twoFactorTitle:u,twoFactorSubtitle:d,passwordResetTitle:h,passwordResetSubtitle:f,redirectPath:n,initialRedirectUrl:I});if(p){const F=i.jsxs("div",{className:"text-center py-10 px-5",children:[i.jsx(A.Spin,{size:"large"}),i.jsx("h2",{className:"mt-6 mb-2 text-gray-800 text-xl font-medium",style:Ar(V),children:o}),i.jsx("p",{className:"text-gray-500 text-sm mb-0",style:ur(V),children:"Please wait while we complete your authentication..."})]});return R?i.jsx("div",{className:"w-full",children:F}):i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100 p-5",children:i.jsx(A.Card,{className:"w-full max-w-md shadow-md",bordered:!1,children:F})})}if(g){const F=i.jsx("div",{className:"text-center py-10 px-5",children:i.jsx(A.Alert,{message:s,description:g,type:"error",showIcon:!0,action:i.jsx("button",{type:"button",onClick:D,children:"Return to login"})})});return R?i.jsx("div",{className:"w-full",children:F}):i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100 p-5",children:i.jsx(A.Card,{className:"w-full max-w-md shadow-md",bordered:!1,children:F})})}const T=i.jsx("div",{className:"text-center py-10 px-5",children:i.jsx(A.Alert,{message:"Authentication Successful",description:"You have been successfully authenticated. Redirecting...",type:"success",showIcon:!0})});return R?i.jsx("div",{className:"w-full",children:T}):i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100 p-5",children:i.jsx(A.Card,{className:"w-full max-w-md shadow-md",bordered:!1,children:T})})},{Content:GT}=A.Layout,KT=({logo:e,apiConfig:t,onAuthComplete:r,roleSelectionTitle:n,roleSelectionSubtitle:o,twoFactorTitle:s,twoFactorSubtitle:a,passwordResetTitle:c,passwordResetSubtitle:l,redirectPath:u="/"})=>{const[d,h]=v.useState(null),[f,p]=v.useState(!1),m=qe(),{appName:g,appLogo:y}=$e(),b=async E=>{E.requiresRoleSelection||E.requires2FA||E.requiresPasswordReset?(h(E),p(!0)):(E.token&&localStorage.setItem(t?.tokenKey||"authToken",E.token),r&&r(E))},w=E=>{J.error("OAuth callback error",E)},_=E=>{const S={...d,...E,authMethod:"oauth",provider:d?.provider};r&&r(S)};if(f&&d)return i.jsx(oo,{logo:e,apiConfig:t,onAuthComplete:_,roleSelectionTitle:n,roleSelectionSubtitle:o,twoFactorTitle:s,twoFactorSubtitle:a,passwordResetTitle:c,passwordResetSubtitle:l,initialAuthState:{user:d.user,token:d.token,roles:d.roles,requires2FA:d.requires2FA,twoFactorMethods:d.twoFactorMethods,requiresPasswordReset:d.requiresPasswordReset,passwordResetReason:d.passwordResetReason}});const P=i.jsx(dn,{children:i.jsx(RT,{onSuccess:b,onError:w,apiConfig:t,redirectPath:u,logo:e,roleSelectionTitle:n,roleSelectionSubtitle:o,twoFactorTitle:s,twoFactorSubtitle:a,passwordResetTitle:c,passwordResetSubtitle:l})});return m?i.jsx(dr,{appName:g,appLogo:typeof e=="string"?e:y,children:P}):i.jsx(A.Layout,{className:"min-h-screen",style:Gt(t||{}),children:i.jsx(GT,{className:"flex justify-center items-center min-h-screen p-5",children:P})})},{Content:YT}=A.Layout,jg=({logo:e,title:t="Processing Authentication",subtitle:r="Please wait while we complete your login",onAuthComplete:n,roleSelectionTitle:o="Select Your Role",roleSelectionSubtitle:s="Choose a role to continue",twoFactorTitle:a="Two-Factor Authentication",twoFactorSubtitle:c="Please enter your verification code",passwordResetTitle:l="Reset Password",passwordResetSubtitle:u="Please enter your new password"})=>{const[d]=ue.useSearchParams(),{authConfig:h}=st(),[f,p]=v.useState(!0),[m,g]=v.useState(null),[y,b]=v.useState(null),[w,_]=v.useState(null),[P,E]=v.useState(!1),[S,O]=v.useState(null),N=qe(),{appName:k,appLogo:I}=$e(),j=d.get("next"),q=v.useRef(!1),M=v.useCallback(async()=>{if(!q.current){q.current=!0;try{p(!0),g(null),sessionStorage.setItem(it.SAML_IN_PROGRESS,"true");const K=d.get("token"),Y=d.get("request_id");if(!K||!Y)throw new Error("Missing required SAML parameters (token or request_id)");if(!window.location.pathname.startsWith("/app/login")){p(!1),sessionStorage.removeItem(it.SAML_IN_PROGRESS);return}const ne=await re.getSAMLAuthMeta(K,Y);if(ne?.code==="user_not_found"){sessionStorage.setItem(it.SAML_ERROR,JSON.stringify({message:ne.message||"User does not exist",timestamp:Date.now()})),sessionStorage.removeItem(it.SAML_IN_PROGRESS),Xe("/app/login");return}if(ne?.status===401&&ne?.data?.next_step){if(ne.data.next_step.is_pending){let F=d.get("email")||d.get("user_email")||null,z=d.get("name")||d.get("user_name")||F;!F&&ne?.data?.user&&(F=ne.data.user.email||ne.data.user.username,z=ne.data.user.name||F);const X={...ne,loginUser:{email:F,username:z||F||"SAML User",display:z||F||"SAML User"}};O(X),E(!0),p(!1);return}b(ne.data),_(ne.data.next_step.id),p(!1);return}if(ne?.roles&&ne.roles.length>1){const T={status:401,data:{next_step:{id:"role_selection",is_pending:!0,metadata:{roles:ne.roles}}},loginUser:{email:d.get("email")||d.get("user_email")||"SAML User",username:d.get("name")||d.get("user_name")||"SAML User",display:d.get("name")||d.get("user_name")||"SAML User"}};O(T),E(!0),p(!1);return}if(n)J.info("SAML callback complete, calling onAuthComplete",{result:ne}),sessionStorage.removeItem(it.SAML_IN_PROGRESS),n(ne);else{J.info("SAML callback complete, redirecting",{redirectUrl:ne?.redirect_url||"/app"});const T=Or(),F=Be(T,ne?.redirect_url,"/app");sessionStorage.removeItem(it.SAML_IN_PROGRESS),Xe(F)}}catch(K){J.error("SAML callback error",K),g(K instanceof Error?K.message:"Failed to process SAML authentication"),p(!1),sessionStorage.removeItem(it.SAML_IN_PROGRESS)}}},[d,n]);v.useEffect(()=>{M()},[M]);const $=async K=>{try{if(K?.status===401&&K?.data?.next_step){b(K.data),_(K.data.next_step.id??null);return}if(n)sessionStorage.removeItem(it.SAML_IN_PROGRESS),n(K);else{const Y=Or(),D=Be(Y,K?.redirect_url,"/app");sessionStorage.removeItem(it.SAML_IN_PROGRESS),Xe(D)}}catch(Y){J.error("Two-factor completion error",Y),A.toast.error(Y instanceof Error?Y.message:"Failed to complete two-factor authentication"),sessionStorage.removeItem(it.SAML_IN_PROGRESS)}},H=async K=>{try{if(K?.status===401&&K?.data?.next_step){b(K.data),_(K.data.next_step.id??null);return}if(n)sessionStorage.removeItem(it.SAML_IN_PROGRESS),n(K);else{const Y=Or(),D=Be(Y,K?.redirect_url,"/app");sessionStorage.removeItem(it.SAML_IN_PROGRESS),Xe(D)}}catch(Y){J.error("Password reset completion error",Y),A.toast.error(Y instanceof Error?Y.message:"Failed to complete password reset"),sessionStorage.removeItem(it.SAML_IN_PROGRESS)}},V=()=>{if(f)return i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-loading-min-h text-center",children:[i.jsx(A.Spin,{size:"large"}),i.jsx("p",{className:"mt-4 text-gray-600",children:r})]});if(m)return i.jsx(A.Alert,{message:"Authentication Error",description:m,type:"error",showIcon:!0,action:i.jsx("a",{href:"/app/login",children:"Return to Login"})});switch(w){case"2fa_required":return i.jsx($g,{user:y?.user,onVerify:K=>$(K),title:a,subtitle:c,logo:e});case"password_reset_required":return i.jsx(ul,{onReset:H,title:l,subtitle:u,reason:y?.metadata?.reason,logo:e});default:{const K=i.jsxs(i.Fragment,{children:[e&&i.jsx("div",{className:"text-center mb-6",children:typeof e=="string"?i.jsx("img",{src:e,alt:"Logo",className:"max-w-logo-max-w h-auto mx-auto"}):e}),i.jsx("div",{className:"text-center mb-[18px]",children:i.jsx("h1",{className:"text-3xl font-semibold text-gray-900 mb-2",children:t})}),i.jsx(A.Alert,{message:"Unknown authentication step",description:`Unhandled auth step: ${w}`,type:"warning",showIcon:!0})]});return N?i.jsx("div",{className:"w-full",children:K}):i.jsx(A.Card,{className:"w-full max-w-md shadow-lg rounded-lg",bordered:!1,children:K})}}},R=()=>f||m||!w;return P&&S?i.jsx(oo,{initialAuthState:S,onAuthComplete:K=>{const Y=Or(),D=Be(Y,K?.redirect_url,"/app");sessionStorage.removeItem(it.SAML_IN_PROGRESS),window.location.href=D},skipLoginStep:!0,logo:e,roleSelectionTitle:o,roleSelectionSubtitle:s,twoFactorTitle:a,twoFactorSubtitle:c,passwordResetTitle:l,passwordResetSubtitle:u,initialNextParam:j}):N?i.jsxs(dr,{appName:k,appLogo:typeof e=="string"?e:I,children:[i.jsx("div",{className:"text-center mb-[18px]",children:i.jsx("h1",{className:"text-2xl font-semibold text-gray-900 mb-2",children:t})}),i.jsx(dn,{children:V()})]}):i.jsx(A.Layout,{className:"min-h-screen",style:Gt(h),children:i.jsx(YT,{className:"flex justify-center items-center min-h-screen p-5",children:R()?i.jsxs(A.Card,{className:"w-full max-w-md shadow-lg rounded-lg",bordered:!1,children:[e&&i.jsx("div",{className:"text-center mb-6",children:typeof e=="string"?i.jsx("img",{src:e,alt:"Logo",className:"max-w-logo-max-w h-auto mx-auto"}):e}),i.jsx("div",{className:"text-center mb-[18px]",children:i.jsx("h1",{className:"text-3xl font-semibold text-gray-900 mb-2",children:t})}),i.jsx(dn,{children:V()})]}):i.jsx(dn,{children:V()})})})},yl=({onSubmit:e,logo:t})=>{const[r,n]=v.useState(!1),[o,s]=v.useState(null),[a,c]=v.useState(!1),[l,u]=v.useState(0),[d,h]=v.useState(["email"]),[f,p]=v.useState("email"),{basePath:m}=xa(),{authConfig:g,getResetPasswordConfig:y,getMessagesConfig:b}=st(),w=y(),_=b(),P=qe(),E=Yn(g),S=Jn(g),O=Qn(g);v.useEffect(()=>{(async()=>{try{await re.getAuthConfig();const M=re.getPasswordResetMethods();M&&M.length>0&&(h(M),p(M[0]))}catch(M){J.error("Failed to load reset configuration",M)}})()},[]);const N=async q=>{n(!0),s(null);try{if(e){const M={email:f==="email"?q.contact:void 0,phone:f==="sms"?q.contact:void 0,method:f};await e(M)}c(!0),u(M=>M+1)}catch(M){const $=f==="email"?"email":"SMS",H=(M instanceof Error?M.message:null)||_?.errors?.networkError||`Failed to send reset ${$}. Please try again.`;s(H)}finally{n(!1)}},k=()=>f==="email"?w?.forgotPassword?.emailPlaceholder||"Email address":"Phone number",I=()=>f==="email"?[{required:!0,message:_?.validation?.required||"Please enter your email address"},{type:"email",message:_?.validation?.invalidEmail||"Please enter a valid email address!"}]:[{required:!0,message:_?.validation?.required||"Please input your phone number!"},{pattern:/^\+?[1-9]\d{1,14}$/,message:_?.validation?.invalidMobile||"Please enter a valid phone number!"}],j=()=>{const q=f==="email"?"Email":"SMS",M=f==="email"?"email":"phone";return{title:w?.forgotPassword?.successMessage||`${q} Sent!`,subTitle:`Please check your ${M} for password reset instructions.`}};if(a){const q=j();return i.jsx(A.Result,{status:"success",title:q.title,subTitle:q.subTitle,extra:[i.jsx(ue.Link,{to:m,children:i.jsx(A.Button,{variant:"primary",children:w?.forgotPassword?.backToLoginText||"Back to Login"})},"login")]})}return i.jsxs("div",{className:"w-full max-w-md mx-auto",style:P?void 0:E,children:[i.jsx(ue.Link,{to:m,className:"inline-block mb-6",children:i.jsxs(A.Button,{variant:"link",size:"small",className:"inline-flex items-center gap-1",children:[i.jsx(Bc,{size:16}),w?.forgotPassword?.backToLoginText||"Back to Login"]})}),t&&i.jsx("div",{className:S.className,style:S.style,children:typeof t=="string"?i.jsx("img",{src:t,alt:g?.logo?.alt||"Logo",className:"max-w-logo-max-w h-auto",style:O}):t}),i.jsx("h2",{className:"text-2xl font-semibold mb-3",style:Ar(g),children:typeof w?.forgotPassword?.title=="function"?v.createElement(w.forgotPassword.title):w?.forgotPassword?.title||"Forgot Password"}),i.jsx("p",{className:"text-sm mb-6",style:ur(g),children:typeof w?.forgotPassword?.subtitle=="function"?v.createElement(w.forgotPassword.subtitle):w?.forgotPassword?.subtitle||w?.forgotPassword?.instructionText||`Enter your ${f==="email"?"email address":"phone number"} and we'll send you instructions to reset your password.`}),i.jsxs(A.Form,{name:"forgot-password",className:"space-y-4",onFinish:q=>N(q),layout:"vertical",children:[o&&i.jsx(A.Alert,{message:o,type:"error",showIcon:!0,closable:!0,onClose:()=>s(null),className:"mb-4"}),d.length>1&&i.jsx(A.FormItem,{label:"Reset method",children:i.jsx(A.Select,{value:f,onChange:q=>{p(String(q)),u(M=>M+1)},options:d.map(q=>({value:q,label:i.jsxs(A.Space,{children:[q==="email"?i.jsx(ia,{size:16}):i.jsx(I3,{size:16}),q==="email"?"Email":"SMS"]})}))})}),i.jsx(A.FormItem,{name:"contact",label:f==="email"?w?.forgotPassword?.emailLabel||"Email":"Phone",rules:I(),children:i.jsx(A.Input,{className:"w-full",placeholder:k(),autoComplete:f==="email"?"email":"tel"})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",className:"w-full text-base font-medium",disabled:r,fullWidth:!0,children:r?i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx(qr,{size:16,className:"animate-spin"}),w?.forgotPassword?.submitButtonText||`Send Reset ${f==="email"?"Email":"SMS"}`]}):w?.forgotPassword?.submitButtonText||`Send Reset ${f==="email"?"Email":"SMS"}`})})]},l)]})},wl=({onSubmit:e,token:t,logo:r})=>{const[n,o]=v.useState(!1),[s,a]=v.useState(!0),[c,l]=v.useState(!1),[u,d]=v.useState(""),[h,f]=v.useState(!1),[p,m]=v.useState(0),[g,y]=v.useState(null),{basePath:b}=xa(),{authConfig:w,getResetPasswordConfig:_,getMessagesConfig:P}=st(),E=_(),S=P(),O=qe(),N=Yn(w),k=Jn(w),I=Qn(w);v.useEffect(()=>{t?(async()=>{try{const $=await re.validatePasswordResetKey(t);$?.data?.metadata?.password_policy&&y($.data.metadata.password_policy),l(!0)}catch($){J.error("Invalid reset key",$),l(!1);const H=$ instanceof Error?$.message:"This password reset link is invalid or has expired.";d(H)}finally{a(!1)}})():(a(!1),l(!1),d("Invalid link."))},[t]);const j=(M,$)=>pg($,g,g?()=>({valid:!0,errors:[]}):H=>re.validatePassword(H),{required:S?.validation?.required||"Please input your new password!",tooShort:S?.validation?.passwordTooShort}),q=async M=>{if(M.password!==M.confirmPassword){const $=S?.validation?.passwordsDoNotMatch||"The two passwords do not match!";A.toast.error($);return}o(!0);try{if((await re.confirmResetPassword({key:t,password:M.password}))?.data?.next_step?.id==="login"){A.toast.success("Password reset successful! Redirecting to login..."),setTimeout(()=>{Xe("/app/login")},1500);return}f(!0),e&&await e({...M,token:t}),m(H=>H+1)}catch($){const H=S?.errors?.networkError||($ instanceof Error?$.message:"Failed to reset password. Please try again.");A.toast.error(H)}finally{o(!1)}};return s?i.jsxs("div",{className:"w-full max-w-md mx-auto p-8 text-center",style:O?void 0:N,children:[i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900 mx-auto mb-4"}),i.jsx("p",{children:"Validating reset link..."})]}):c?h?i.jsx(A.Result,{status:"success",title:E?.resetForm?.successMessage||"Password Reset Successful!",subTitle:"Your password has been successfully reset. You can now login with your new password.",extra:[i.jsx(ue.Link,{to:b,children:i.jsx(A.Button,{variant:"primary",children:"Go to Login"})},"login")]}):i.jsxs("div",{className:"w-full max-w-md mx-auto",style:O?void 0:N,children:[r&&i.jsx("div",{className:k.className,style:k.style,children:typeof r=="string"?i.jsx("img",{src:r,alt:w?.logo?.alt||"Logo",className:"max-w-logo-max-w h-auto",style:I}):r}),i.jsx("h2",{className:"text-2xl font-semibold mb-3",style:Ar(w),children:(typeof E?.resetForm?.title=="string"?E.resetForm.title:null)||"Reset Password"}),i.jsx("p",{className:"text-sm mb-6",style:ur(w),children:(typeof E?.resetForm?.subtitle=="string"?E.resetForm.subtitle:null)||"Please enter your new password below."}),i.jsxs(A.Form,{name:"reset-password",className:"space-y-4",onFinish:M=>q(M),layout:"vertical",children:[i.jsx(A.FormItem,{name:"password",label:E?.resetForm?.passwordLabel||"New Password",rules:[{validator:j}],children:i.jsx(A.PasswordInput,{className:"w-full",prefix:i.jsx(aa,{size:16,className:"text-gray-400"}),placeholder:E?.resetForm?.passwordPlaceholder||"New Password",autoComplete:"new-password"})}),i.jsx(A.FormItem,{name:"confirmPassword",label:E?.resetForm?.confirmPasswordLabel||"Confirm Password",rules:[{required:!0,message:S?.validation?.required||"Please confirm your password!"}],children:i.jsx(A.PasswordInput,{className:"w-full",prefix:i.jsx(aa,{size:16,className:"text-gray-400"}),placeholder:E?.resetForm?.confirmPasswordPlaceholder||"Confirm Password",autoComplete:"new-password"})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",className:"w-full text-base font-medium",disabled:n,fullWidth:!0,children:n?i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx(qr,{size:16,className:"animate-spin"}),E?.resetForm?.submitButtonText||"Reset Password"]}):E?.resetForm?.submitButtonText||"Reset Password"})})]},p)]}):i.jsx(A.Result,{status:"error",title:"Invalid Link",subTitle:u,extra:[i.jsx(ue.Link,{to:b,children:i.jsx(A.Button,{variant:"primary",children:"Back to Login"})},"login")]})},{Content:vl}=A.Layout,QT=({backgroundStyle:e,mergedConfig:t})=>{const[r,n]=v.useState(!1),o=qe(),[s,a]=v.useState(null);v.useEffect(()=>{(async()=>{const f=new URLSearchParams(window.location.search),p=f.get("token"),m=f.get("request_id");if(p&&m){n(!0);try{const g=await re.getSAMLAuthMeta(p,m);if(g?.code==="user_not_found"){bk("saml_error",{message:g.message||"User does not exist",timestamp:Date.now()}),Xe("/app/login");return}a(g),n(!1)}catch(g){J.error("[LoginWrapper] SAML callback error",g),A.toast.error("Failed to process SSO authentication"),n(!1)}}})()},[]);const c=yk("pendingAuthResult");let l=s;!l&&c&&(l=c,ym("pendingAuthResult"),ym("pendingAuthStep"));const u=async h=>{A.toast.success("Authentication complete!");try{const f=It(window.location.search),p=Or(),m=f||p,g=h?.redirect_url||h?.response?.data?.redirect_url,y=Be(m,g,"/app");J.info("[LoginRouter] Redirecting",{redirectUrl:y}),window.location.pathname.startsWith("/app/login")&&Xe(y)}catch(f){J.error("[LoginRouter] Error handling auth completion",f),Xe("/app")}},d=v.useMemo(()=>{const f=new URLSearchParams(window.location.search).get("next");if(f)return decodeURIComponent(f);try{return sessionStorage.getItem(Xn)||null}catch{return null}},[]);if(r){const h=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-loading-min-h text-center",children:[i.jsx(A.Spin,{size:"large"}),i.jsx("p",{className:"mt-4 text-gray-600",children:"Processing SSO authentication..."})]});return i.jsx("div",{style:{...e,minHeight:"100dvh"},children:i.jsx(A.Layout,{className:"min-h-screen",style:e,children:i.jsx(vl,{className:"flex justify-center items-center min-h-screen",children:o?i.jsx("div",{className:"w-full px-5",children:h}):i.jsx(A.Card,{className:"w-full max-w-md shadow-lg rounded-lg",bordered:!1,children:h})})})})}return i.jsx("div",{style:{...e,minHeight:"100dvh"},children:i.jsx(oo,{onAuthComplete:u,logo:t.logo,title:t.title,subtitle:t.subtitle,useDynamicConfig:!0,roleSelectionTitle:t.roleSelectionTitle,roleSelectionSubtitle:t.roleSelectionSubtitle,twoFactorTitle:t.twoFactorTitle,twoFactorSubtitle:t.twoFactorSubtitle,passwordResetTitle:t.passwordResetTitle,passwordResetSubtitle:t.passwordResetSubtitle,initialAuthState:l??void 0,skipLoginStep:!!s,initialNextParam:d})})},JT=({backgroundStyle:e,mergedConfig:t})=>{const r=qe(),{appName:n,appLogo:o}=$e(),{getCustomComponents:s}=st(),a=s()?.ForgotPasswordPage,c=async l=>{await re.forgotPassword({email:l.email,phone:l.phone})};return a?i.jsx(a,{}):r?i.jsx(dr,{appName:n,appLogo:typeof t.logo=="string"?t.logo:o,children:i.jsx(yl,{onSubmit:c,logo:t.logo})}):i.jsx(A.Layout,{style:{...e,minHeight:"100dvh"},children:i.jsx(vl,{className:"flex justify-center items-center p-5",children:i.jsx(yl,{onSubmit:c,logo:t.logo})})})},XT=({backgroundStyle:e,mergedConfig:t,basePath:r})=>{const{key:n}=ue.useParams(),o=ue.useNavigate(),s=qe(),{appName:a,appLogo:c}=$e(),{getCustomComponents:l}=st(),u=l()?.ResetPasswordPage;if(v.useEffect(()=>{n||o(r)},[n,o,r]),!n)return null;const d=async h=>{};return u?i.jsx(u,{token:n}):s?i.jsx(dr,{appName:a,appLogo:typeof t.logo=="string"?t.logo:c,children:i.jsx(wl,{onSubmit:d,token:n,logo:t.logo})}):i.jsx(A.Layout,{style:{...e,minHeight:"100dvh"},children:i.jsx(vl,{className:"flex justify-center items-center p-5",children:i.jsx(wl,{onSubmit:d,token:n,logo:t.logo})})})},e5=({basePath:e="/login",apiConfig:t={},onAuthComplete:r,logo:n,title:o="Welcome Back",subtitle:s="Please sign in to your account",roleSelectionTitle:a="Select Your Role",roleSelectionSubtitle:c="Choose a role to continue",twoFactorTitle:l="Two-Factor Authentication",twoFactorSubtitle:u="Please enter your verification code",passwordResetTitle:d="Reset Password",passwordResetSubtitle:h="Please enter your new password"})=>{const{authConfig:f}=$e(),[p,m]=v.useState(null),{setBasePath:g}=xa();v.useEffect(()=>{g(e)},[e,g]),v.useEffect(()=>(f&&fk(f),()=>{hk()}),[f]);const y=v.useMemo(()=>{const _=f?.login||{},P=f?.logo||{};return{logo:P.url?i.jsx("img",{src:P.url,alt:P.alt||"Logo",style:{width:P.width||"auto",height:P.height||"auto",...P.style},className:P.className}):n,title:(typeof _.title=="string"?_.title:void 0)||o,subtitle:(typeof _.subtitle=="string"?_.subtitle:void 0)||s,roleSelectionTitle:(typeof f?.roleSelection?.title=="string"?f.roleSelection.title:void 0)||a,roleSelectionSubtitle:(typeof f?.roleSelection?.subtitle=="string"?f.roleSelection.subtitle:void 0)||c,twoFactorTitle:(typeof f?.twoFactor?.title=="string"?f.twoFactor.title:void 0)||l,twoFactorSubtitle:(typeof f?.twoFactor?.subtitle=="string"?f.twoFactor.subtitle:void 0)||u,passwordResetTitle:(typeof f?.resetPassword?.resetForm?.title=="string"?f.resetPassword.resetForm.title:void 0)||d,passwordResetSubtitle:(typeof f?.resetPassword?.resetForm?.subtitle=="string"?f.resetPassword.resetForm.subtitle:void 0)||h}},[f,n,o,s,a,c,l,u,d,h]),b=v.useMemo(()=>Gt(f),[f]),w=_=>{m(_),r&&r(_)};return i.jsx(om,{authConfig:f,children:i.jsx(Tg,{children:i.jsxs(ue.Routes,{children:[i.jsx(ue.Route,{path:"/",element:i.jsx(QT,{backgroundStyle:b,mergedConfig:y})}),i.jsx(ue.Route,{path:"forgot-password",element:i.jsx(JT,{backgroundStyle:b,mergedConfig:y})}),i.jsx(ue.Route,{path:"reset-password/:key",element:i.jsx(XT,{backgroundStyle:b,mergedConfig:y,basePath:e})}),i.jsx(ue.Route,{path:"reset-password",element:i.jsx(ue.Navigate,{to:"/app",replace:!0})}),i.jsx(ue.Route,{path:"/oauth/callback",element:i.jsx("div",{style:{...b,minHeight:"100dvh"},children:i.jsx(KT,{logo:y.logo,onAuthComplete:_=>{(async()=>{const E=_?.redirect_url||_?.response?.data?.redirect_url,S=Or(),O=Be(S,E,"/app");Xe(O)})()},roleSelectionTitle:y.roleSelectionTitle,roleSelectionSubtitle:y.roleSelectionSubtitle,twoFactorTitle:y.twoFactorTitle,twoFactorSubtitle:y.twoFactorSubtitle,passwordResetTitle:y.passwordResetTitle,passwordResetSubtitle:y.passwordResetSubtitle})})}),i.jsx(ue.Route,{path:"/saml",element:i.jsx(jg,{logo:i.jsx(L3,{size:48,className:"text-blue-500"}),onAuthComplete:_=>{const P=Or(),E=Be(P,_?.redirect_url,"/app");Xe(E)},roleSelectionTitle:"Select Your Role",roleSelectionSubtitle:"Choose a role to continue",twoFactorTitle:"Two-Factor Authentication",twoFactorSubtitle:"For your security, please verify your identity",passwordResetTitle:"Password Update Required",passwordResetSubtitle:"Please create a new password to continue"})}),i.jsx(ue.Route,{path:"/complete",element:i.jsx(oo,{initialAuthState:p??void 0,apiConfig:t,logo:n,onAuthComplete:w,roleSelectionTitle:a,roleSelectionSubtitle:c,twoFactorTitle:l,twoFactorSubtitle:u,passwordResetTitle:d,passwordResetSubtitle:h})}),i.jsx(ue.Route,{path:"*",element:i.jsx(ue.Navigate,{to:"/404",replace:!0})})]})})})},Sa=({basePath:e="/app"})=>{const t=oa();return i.jsx("div",{className:"h-full",children:i.jsx(e5,{basePath:e,apiConfig:t})})},t5=Object.freeze({__proto__:null,LoginPage:Sa}),qo=({message:e})=>i.jsx("div",{className:"min-h-dvh flex items-center justify-center p-6 bg-muted text-center",children:i.jsxs("div",{className:"bg-background rounded-xl shadow-md p-12 w-full max-w-[500px] max-lg:rounded-none max-lg:shadow-none max-lg:max-w-full max-lg:p-6 max-sm:p-7 max-sm:px-5",children:[i.jsx("h1",{className:"text-7xl font-bold text-muted-foreground/30 m-0 leading-none max-sm:text-6xl",children:"404"}),i.jsx("h2",{className:"text-2xl font-semibold text-foreground my-4 max-sm:text-xl",children:"Page Not Found"}),i.jsx("p",{className:"text-base text-muted-foreground leading-relaxed mb-8 max-sm:text-sm max-sm:mb-6",children:e||"The page you are looking for doesn't exist or has been moved."}),i.jsxs("div",{className:"flex gap-3 justify-center max-sm:flex-col",children:[i.jsx(ar,{size:"lg",className:"max-sm:w-full max-sm:min-h-[44px]",onClick:()=>window.history.back(),children:"Go Back"}),i.jsx(ar,{variant:"outline",size:"lg",className:"max-sm:w-full max-sm:min-h-[44px]",onClick:()=>window.location.href="/",children:"Go Home"})]})]})}),_l=({basePath:e})=>{const t=oa(),[r,n]=v.useState(null),[o,s]=v.useState(null);return v.useEffect(()=>{(async()=>{try{const c=await import("@zango-core/crud/table");n(()=>c.CrudHandler)}catch(c){J.error("Failed to load crud module",c),s("CRUD module could not be loaded")}})()},[]),o?i.jsx("div",{className:"h-full p-5",children:i.jsxs("div",{children:[i.jsx("h3",{children:"CRUD Module Error"}),i.jsx("p",{children:o})]})}):r?i.jsx("div",{className:"h-full",children:i.jsx(dn,{children:i.jsx(r,{api_endpoint:t.apiUrl})})}):i.jsx("div",{className:"h-full flex items-center justify-center min-h-loading-min-h",children:i.jsx(A.Spin,{size:"large"})})},Bg=({basePath:e})=>{const[t,r]=v.useState(null),[n,o]=v.useState(null);return v.useEffect(()=>{(async()=>{try{const a=await import("@zango-core/training");r(()=>a.TrainingRouter)}catch(a){J.error("Failed to load training module",a),o("Training module could not be loaded")}})()},[]),n?i.jsx("div",{className:"h-full p-5",children:i.jsxs("div",{children:[i.jsx("h3",{children:"Training Module Error"}),i.jsx("p",{children:n})]})}):t?i.jsx("div",{className:"h-full",children:i.jsx(dn,{children:i.jsx(t,{})})}):i.jsx("div",{className:"h-full p-5",children:i.jsx("div",{children:"Loading training module..."})})},xl={crud:{requiredPackage:"@zango-core/crud",component:_l},training:{requiredPackage:"@zango-core/training",component:Bg}};Object.fromEntries(Object.entries(xl).map(([e,t])=>[e,()=>import(t.requiredPackage)])),Object.fromEntries(Object.keys(xl).map(e=>[e,[e]]));const Vg=Object.fromEntries(Object.entries(xl).map(([e,t])=>[e,t.component])),r5=e=>e.filter(t=>t in Vg),n5=e=>Vg[e]||null,o5=async(e=[])=>{const t=r5(e),r={login:{component:Sa,includeBasePath:!0,standalone:!0,propsBuilder:({matchedRoutePath:o})=>({basePath:o})},custom:{component:null,includeBasePath:!1,handler:o=>{const s=o.customPages,a=o.customPagePath,c=o.location,u=o.matchedRoute||a&&{path:null,component:a},d=s&&a?s[a]:void 0;return d?v.createElement(d,{routeConfig:u,location:c}):v.createElement(jc,{componentName:a,routeConfig:u,location:c})}},404:{component:qo,standalone:!0,includeBasePath:!1,propsBuilder:()=>({})},default:{component:qo,includeBasePath:!1,standalone:!0,propsBuilder:({pageType:o})=>({message:`Unknown page type: ${o}`})}};for(const o of t){const s=n5(o);s?r[o]={component:s,includeBasePath:!0,propsBuilder:({matchedRoutePath:a})=>({basePath:a})}:J.warn(`Failed to get component for page type: ${o}`)}const n=e.filter(o=>!t.includes(o));return n.length>0&&J.warn(`Unconfigured page types (not in PAGE_CONFIG): ${n.join(", ")}`),r},s5=e=>{const t=new Set;return e.forEach(r=>{r.page_type&&r.page_type!=="custom"&&r.page_type!=="login"&&t.add(r.page_type)}),Array.from(t)},qg=async e=>{const t=s5(e);return o5(t)},a5=mm.LOGO_CACHE,i5=1440*60*1e3,c5=100;class l5{constructor(){this.cacheKey=a5}getCachedLogo(){try{const t=localStorage.getItem(this.cacheKey);if(!t)return null;const r=JSON.parse(t);return this.isCacheExpired(r.timestamp)?(this.clearCache(),null):r.base64Data&&!r.base64Data.startsWith("data:image/")?(J.warn("Invalid cached logo format, clearing cache"),this.clearCache(),null):r}catch(t){return J.error("Error reading logo cache",t),null}}async cacheLogoUrl(t,r){if(t)try{const n=await this.generateHash(t),o=this.getCachedLogo();if(o&&o.version===n)return o.timestamp=Date.now(),localStorage.setItem(this.cacheKey,JSON.stringify(o)),o;const s=await this.fetchAndConvertToBase64(t),a={url:t,base64Data:s,version:n,timestamp:Date.now(),appName:r||"Zango CRM"};return localStorage.setItem(this.cacheKey,JSON.stringify(a)),a}catch(n){return J.error("Error caching logo",n),{url:t,base64Data:null,version:null,timestamp:Date.now(),appName:r||"Zango CRM"}}}async fetchAndConvertToBase64(t){try{if(t.startsWith("data:"))return t.startsWith("data:image/")?t:(J.error("Invalid logo format: data URL must be an image"),null);const r=t.startsWith("http")?t:`${window.location.origin}${t}`,n=await fetch(r);if(!n.ok)throw new Error(`Failed to fetch logo: ${n.status}`);const o=n.headers.get("content-type");if(o&&!o.startsWith("image/"))throw new Error(`Invalid logo content type: ${o}`);const s=await n.blob();return new Promise((a,c)=>{const l=new FileReader;l.onloadend=()=>a(typeof l.result=="string"?l.result:null),l.onerror=c,l.readAsDataURL(s)})}catch(r){return J.error("Error converting logo to base64",r),null}}async generateHash(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("").slice(0,12)}isCacheExpired(t){return Date.now()-t>i5}clearCache(){try{localStorage.removeItem(this.cacheKey)}catch(t){J.error("Error clearing logo cache",t)}}async needsUpdate(t){const r=this.getCachedLogo();return!!(!r||r.url!==t||this.isCacheExpired(r.timestamp))}async updateInBackground(t,r,n){try{if(!await this.needsUpdate(t))return;setTimeout(async()=>{const s=await this.cacheLogoUrl(t,r);s&&n&&n(s)},c5)}catch(o){J.error("Error updating logo in background",o)}}}const vn=new l5,Hg={login:{component:null},custom:{component:null},404:{component:null},default:{component:null}},u5=()=>typeof window<"u"&&window.app_initializer_endpoint?window.app_initializer_endpoint:"/app/initializer",Wg=v.createContext(void 0),$e=()=>{const e=v.useContext(Wg);if(!e)throw new Error("useAppContext must be used within AppProvider");return e},Zg=({children:e,config:t={},layoutConfig:r={},topbarConfig:n={},navbarConfig:o={},customComponents:s={},authConfig:a={}})=>{const c=ue.useNavigate(),l=ue.useLocation(),{data:u,isLoading:d,error:h}=S3(),f=u??null,p=h?.message??null,[m,g]=v.useState(null),[y,b]=v.useState(null),[w,_]=v.useState(!1),[P,E]=v.useState(null),S=t,O=S.apiConfig||{};v.useEffect(()=>{const k={colors:{primary:"#5048ed",secondary:"#6d7280",success:"#10b981",warning:"#f59e0b",error:"#f04438",gray:"#6d7280",background:"#f9fafb",text:"#252b37"}},I="default-theme-variables";let j=document.getElementById(I);j||(j=document.createElement("style"),j.id=I,document.head.appendChild(j)),j.innerHTML=`:root { ${ua(k)} }`},[]),v.useEffect(()=>{const k=vn.getCachedLogo();k&&g(k.base64Data||k.url)},[]),v.useEffect(()=>{if(f){if(f.theme){const k=document.getElementById("default-theme-variables"),I=f.theme;if(k)k.innerHTML=`:root { ${ua(I)} }`;else{const j=document.createElement("style");j.id="default-theme-variables",j.innerHTML=`:root { ${ua(I)} }`,document.head.appendChild(j)}}f.app_logo&&vn.updateInBackground(f.app_logo,f.app_name,k=>{k.base64Data&&g(k.base64Data)})}},[f]),v.useEffect(()=>{if(d||!f)return;const k=l.pathname,I=l.search,j=k==="/app/configuration-error",q=k==="/app/logout",M=T=>{if(!T)return"";const F=new URLSearchParams(T);F.delete("token"),F.delete("request_id");const z=F.toString();return z?`?${z}`:""},$=M(I);if($!==I&&!q){c(k+$,{replace:!0});return}if(q)return;const H=f.menu&&f.menu.length>0,V=f.routes&&f.routes.length>0,R=f.is_user_anonymous,K=!f.is_user_anonymous,Y=V&&f.routes?.some(T=>{const F=T.path?.startsWith("/")?T.path:`/${T.path}`;if(k===F)return!0;if(F?.includes(":")){const z=F.replace(/:[^/]+/g,"[^/]+");if(new RegExp(`^${z}(/.*)?$`).test(k))return!0}return!!k.startsWith(`${F}/`)}),D=T=>{const F=M(I),z=F?`${T}${F}`:T;c(z,{replace:!0})};if(K&&!H&&!j){D("/app/configuration-error");return}const ne=k==="/app/login"||k.startsWith("/app/login/");if(R&&!H&&!ne){const T=new URLSearchParams(I);k!=="/app"&&k!=="/app/"&&T.set("next",k+I);const F=T.toString();c(`/app/login${F?`?${F}`:""}`,{replace:!0});return}if(H&&f.menu){if(sessionStorage.getItem("saml_auth_in_progress")){sessionStorage.removeItem("saml_auth_in_progress");return}if(R){if(!Y&&!ne){const B=new URLSearchParams;k!=="/app"&&k!=="/app/"&&B.set("next",k+I);const X=B.toString();c(`/app/login${X?`?${X}`:""}`,{replace:!0})}return}const F=f.menu[0]?.path||f.menu[0]?.uri;if(k==="/app"||k==="/app/"||!Y&&!j){const B=It(I);if(B&&Kt(B)){c(B,{replace:!0});return}if(F){D(F);return}}}},[d,f,l.pathname,l.search,c]),v.useEffect(()=>{let k=!1;return(async()=>{if(!d&&f){if(f.is_user_anonymous){const{pageTypeRegistry:j}=await Promise.resolve().then(function(){return w4});if(f.routes&&f.routes.length>0)try{k||_(!0);const q=await qg(f.routes);k||(b(q),_(!1));return}catch(q){J.error("Failed to create registry from routes for anonymous user",q)}k||(b(j),_(!1));return}if(!f.routes||f.routes.length===0){k||(b(Hg),_(!1));return}try{k||(_(!0),E(null));const j=await qg(f.routes);k||(b(j),_(!1))}catch(j){J.error("Failed to create dynamic page registry",j),k||(E(j instanceof Error?j.message:"Failed to create page registry"),b(Hg),_(!1))}}})(),()=>{k=!0}},[f,d]);const N=v.useMemo(()=>({appData:f,loading:d,error:p,config:S,apiConfig:O,menu:f?.menu||[],routes:f?.routes||[],profileInfo:f?.profile_info||{},appLogo:m||f?.app_logo||"",appName:f?.app_name||"Zango CRM",metadata:f?.metadata||{},theme:f?.theme||{},layoutConfig:r,topbarConfig:n,navbarConfig:o,customComponents:s,authConfig:a,sessionSecurity:f?.session_security_config??null,pageTypeRegistry:y,registryLoading:w,registryError:P,initializerEndpoint:u5()}),[f,d,p,S,O,m,r,n,o,s,a,y,w,P]);return i.jsx(Wg.Provider,{value:N,children:e})},d5=1e4,Rg=()=>{const{metadata:e,appName:t,apiConfig:r,theme:n}=$e(),o=e,s=n,a=v.useRef(new Set),c=v.useCallback(()=>{a.current.forEach(d=>{d.parentNode&&d.parentNode.removeChild(d)}),a.current.clear()},[]),l=v.useCallback((d,h,f)=>{let p=document.querySelector(d);return p||(p=h(),document.head.appendChild(p),a.current.add(p)),f(p),p},[]),u=v.useCallback((d,h="image")=>new Promise((f,p)=>{const m=document.createElement("link");m.rel="preload",m.as=h,m.href=d,m.onload=()=>f(),m.onerror=()=>p(new Error(`Failed to preload ${h}: ${d}`)),a.current.add(m),document.head.appendChild(m),setTimeout(()=>{m.parentNode&&(m.parentNode.removeChild(m),a.current.delete(m))},d5)}),[]);return v.useEffect(()=>{if(!o)return;c();const d=(f,p)=>{if(!f)return p||null;if(f.startsWith("http://")||f.startsWith("https://")||f.startsWith("//"))return f;try{return ra(f,r)}catch(m){return J.warn(`Failed to build asset URL for ${f}`,{error:m}),p||null}};if(o.title?document.title=o.title:t&&(document.title=t),o.description){const f=o.description;l('meta[name="description"]',()=>{const p=document.createElement("meta");return p.name="description",p},p=>{p.content=f})}if(o.keywords){const f=o.keywords;l('meta[name="keywords"]',()=>{const p=document.createElement("meta");return p.name="keywords",p},p=>{p.content=f})}l('meta[name="viewport"]',()=>{const f=document.createElement("meta");return f.name="viewport",f},f=>{f.content="width=device-width, initial-scale=1.0"});const h=s?.colors?.primary;if(h&&l('meta[name="theme-color"]',()=>{const f=document.createElement("meta");return f.name="theme-color",f},f=>{f.content=h}),o.favicon){const f=d(o.favicon,"/favicon.ico");f&&l('link[rel="icon"][type="image/x-icon"], link[rel="shortcut icon"]',()=>{const p=document.createElement("link");return p.rel="icon",p.type="image/x-icon",p},p=>{p.href=f,u(f).catch(m=>J.warn("Failed to preload favicon",{message:m.message}))})}if(o.favicon_png){const f=d(o.favicon_png,"/favicon-32x32.png");f&&l('link[rel="icon"][type="image/png"]',()=>{const p=document.createElement("link");return p.rel="icon",p.type="image/png",p.sizes="32x32",p},p=>{p.href=f,u(f).catch(m=>J.warn("Failed to preload PNG favicon",{message:m.message}))})}if(o.apple_touch_icon){const f=d(o.apple_touch_icon,"/apple-touch-icon.png");f&&l('link[rel="apple-touch-icon"]',()=>{const p=document.createElement("link");return p.rel="apple-touch-icon",p},p=>{p.href=f,u(f).catch(m=>J.warn("Failed to preload Apple touch icon",{message:m.message}))})}if(o.og_image){const f=d(o.og_image,"/og-image.png");f&&(u(f).catch(p=>J.warn("Failed to preload OG image",{message:p.message})),l('meta[property="og:image"]',()=>{const p=document.createElement("meta");return p.setAttribute("property","og:image"),p},p=>{p.content=f}),(o.og_image_alt||o.title)&&l('meta[property="og:image:alt"]',()=>{const p=document.createElement("meta");return p.setAttribute("property","og:image:alt"),p},p=>{p.content=o.og_image_alt||o.title||t||"Zango CRM"}))}if(l('meta[property="og:title"]',()=>{const f=document.createElement("meta");return f.setAttribute("property","og:title"),f},f=>{f.content=o.title||t||"Zango CRM"}),o.description){const f=o.description;l('meta[property="og:description"]',()=>{const p=document.createElement("meta");return p.setAttribute("property","og:description"),p},p=>{p.content=f})}if(l('meta[property="og:type"]',()=>{const f=document.createElement("meta");return f.setAttribute("property","og:type"),f},f=>{f.content="website"}),l('meta[property="og:url"]',()=>{const f=document.createElement("meta");return f.setAttribute("property","og:url"),f},f=>{f.content=window.location.href}),l('meta[name="twitter:card"]',()=>{const f=document.createElement("meta");return f.name="twitter:card",f},f=>{f.content=o.og_image?"summary_large_image":"summary"}),l('meta[name="twitter:title"]',()=>{const f=document.createElement("meta");return f.name="twitter:title",f},f=>{f.content=o.title||t||"Zango CRM"}),o.description){const f=o.description;l('meta[name="twitter:description"]',()=>{const p=document.createElement("meta");return p.name="twitter:description",p},p=>{p.content=f})}if(o.og_image){const f=d(o.og_image,"/og-image.png");f&&l('meta[name="twitter:image"]',()=>{const p=document.createElement("meta");return p.name="twitter:image",p},p=>{p.content=f})}if(l('link[rel="canonical"]',()=>{const f=document.createElement("link");return f.rel="canonical",f},f=>{f.href=window.location.href.split("?")[0]}),o.manifest||o.webmanifest){const f=d(o.manifest||o.webmanifest,"/manifest.json");f&&l('link[rel="manifest"]',()=>{const p=document.createElement("link");return p.rel="manifest",p},p=>{p.href=f})}return c},[o,t,s,u,c,l,r]),null};class so extends v.Component{constructor(t){super(t),this.state={hasError:!1,error:null},this.handleReset=this.handleReset.bind(this)}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){J.error("[RouteErrorBoundary] Uncaught error",t,{componentStack:r.componentStack??""})}handleReset(){this.setState({hasError:!1,error:null})}render(){return this.state.hasError&&this.state.error?i.jsx(hc,{error:this.state.error,resetErrorBoundary:this.handleReset,variant:"page"}):this.props.children}}const fr=(e,t="/",r=null)=>{let n=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${t};`;r&&(n+=` domain=${r};`),document.cookie=n,r||(document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${t}; domain=${window.location.hostname};`,document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${t};`)},Sl=e=>{const t=`${e}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let o=r[n];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return o.substring(t.length,o.length)}return null},Gg=(e,t,r=null,n="/",o=null)=>{let s="";if(r){const l=new Date;l.setTime(l.getTime()+r*24*60*60*1e3),s=`; expires=${l.toUTCString()}`}const a=window.location.protocol==="https:"?"; Secure":"";let c=`${e}=${t}${s}; path=${n}${a}; SameSite=Lax`;o&&(c+=`; domain=${o}`),document.cookie=c},Kg=()=>{const e=Sl("zangocookie");return e!==null&&e.trim().length>0},Yg=Object.freeze({__proto__:null,deleteCookie:fr,getCookie:Sl,isAuthenticatedViaCookie:Kg,setCookie:Gg}),Qg={error:A.toast.error},Jg=100,Xg=e=>{const t=Kt(e.redirectUrl??null)?e.redirectUrl??"/app/login":Kt(e.theme?.login_url??null)?e.theme?.login_url??"/app/login":"/app/login";if(!e.preserveCurrentPath)return t;const r=window.location.pathname+window.location.search,n=t.includes("?")?"&":"?";return`${t}${n}next=${encodeURIComponent(r)}`},Ca=async(e={})=>{try{const t=await Gp();if(t.success||t.responseStatus===401){fr("zangocookie","/"),fr("zangocookie","/app"),fr("zangocookie","/app/"),fr("zangocookie");const r=window.location.hostname;if(fr("zangocookie","/",r),fr("zangocookie","/app",r),r.includes(".")){const n=`.${r.split(".").slice(-2).join(".")}`;fr("zangocookie","/",n),fr("zangocookie","/app",n)}mk(e.tokenKey),setTimeout(()=>{window.location.href=Xg(e)},Jg)}else{const r=t.response;Qg.error({title:"Logout Failed",description:r?.message||"Unable to logout. Please try again.",duration:5e3})}}catch(t){J.error("Logout error",t),Qg.error({title:"Logout Error",description:"An error occurred while logging out. Please try again.",duration:5e3}),setTimeout(()=>{window.location.href=Xg(e)},Jg)}},Cl=e=>{const t=document.createElement("div");t.style.cssText=`
|
|
162
|
+
position: fixed;
|
|
163
|
+
top: 0;
|
|
164
|
+
left: 0;
|
|
165
|
+
right: 0;
|
|
166
|
+
bottom: 0;
|
|
167
|
+
background-color: rgba(0, 0, 0, 0);
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
z-index: 10000;
|
|
172
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
173
|
+
transition: background-color 0.25s ease;
|
|
174
|
+
`;const r=document.createElement("div");r.style.cssText=`
|
|
175
|
+
background: white;
|
|
176
|
+
border-radius: 8px;
|
|
177
|
+
padding: 24px;
|
|
178
|
+
max-width: 400px;
|
|
179
|
+
width: 90%;
|
|
180
|
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
181
|
+
opacity: 0;
|
|
182
|
+
transform: translateY(-8px) scale(0.96);
|
|
183
|
+
transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
|
|
184
|
+
transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
|
|
185
|
+
`,r.innerHTML=`
|
|
186
|
+
<div style="margin-bottom: 16px;">
|
|
187
|
+
<h3 style="margin: 0 0 8px 0; font-size: 18px; font-weight: 600; color: #111827;">Confirm Logout</h3>
|
|
188
|
+
<p style="margin: 0; color: #6b7280; font-size: 14px;">Are you sure you want to log out? You will need to sign in again to access your account.</p>
|
|
189
|
+
</div>
|
|
190
|
+
<div style="display: flex; gap: 12px; justify-content: flex-end;">
|
|
191
|
+
<button id="cancel-logout" style="
|
|
192
|
+
padding: 8px 16px;
|
|
193
|
+
border: 1px solid #d1d5db;
|
|
194
|
+
background: white;
|
|
195
|
+
color: #374151;
|
|
196
|
+
border-radius: 6px;
|
|
197
|
+
font-size: 14px;
|
|
198
|
+
font-weight: 500;
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
transition: all 0.15s ease;
|
|
201
|
+
">Cancel</button>
|
|
202
|
+
<button id="confirm-logout" style="
|
|
203
|
+
padding: 8px 16px;
|
|
204
|
+
border: none;
|
|
205
|
+
background: #dc2626;
|
|
206
|
+
color: white;
|
|
207
|
+
border-radius: 6px;
|
|
208
|
+
font-size: 14px;
|
|
209
|
+
font-weight: 500;
|
|
210
|
+
cursor: pointer;
|
|
211
|
+
transition: all 0.15s ease;
|
|
212
|
+
">Log Out</button>
|
|
213
|
+
</div>
|
|
214
|
+
`;const n=r.querySelector("#cancel-logout"),o=r.querySelector("#confirm-logout");n.addEventListener("mouseenter",()=>{n.style.backgroundColor="#f9fafb",n.style.borderColor="#9ca3af"}),n.addEventListener("mouseleave",()=>{n.style.backgroundColor="white",n.style.borderColor="#d1d5db"}),o.addEventListener("mouseenter",()=>{o.style.backgroundColor="#b91c1c"}),o.addEventListener("mouseleave",()=>{o.style.backgroundColor="#dc2626"});const s=c=>{t.style.backgroundColor="rgba(0, 0, 0, 0)",r.style.opacity="0",r.style.transform="translateY(-8px) scale(0.96)",setTimeout(()=>{document.removeEventListener("keydown",a),document.body.contains(t)&&document.body.removeChild(t),c?.()},200)};n.addEventListener("click",()=>s()),o.addEventListener("click",()=>s(e)),t.addEventListener("click",c=>{c.target===t&&s()});const a=c=>{c.key==="Escape"&&s()};document.addEventListener("keydown",a),t.appendChild(r),document.body.appendChild(t),requestAnimationFrame(()=>{t.style.backgroundColor="rgba(0, 0, 0, 0.5)",r.style.opacity="1",r.style.transform="translateY(0) scale(1)",n.focus()})},f5=2147483647,h5=["mousemove","scroll","keyup","click","touchstart","touchend","touchmove"],p5=({config:e,onExpire:t,onWarning:r,onActivity:n})=>{const[o,s]=v.useState(!1),[a,c]=v.useState(0),l=v.useRef(new Date),u=v.useRef(null),d=v.useRef(null),h=v.useRef(!1),f=v.useRef(!1),p=v.useRef(!1),m=v.useRef(!1),g=v.useRef(0),y=v.useRef(t),b=v.useRef(r),w=v.useRef(n),_=v.useRef(()=>{}),P=v.useRef(()=>{}),E=v.useRef(()=>{}),S=v.useRef(()=>{});v.useEffect(()=>{y.current=t,b.current=r,w.current=n},[t,r,n]),v.useEffect(()=>{p.current=o},[o]);const O=h5,N=v.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),k=v.useCallback(()=>{h.current=!0,m.current=!1,N(),d.current&&(clearInterval(d.current),d.current=null),y.current&&y.current(),Ca({preserveCurrentPath:!0})},[N]),I=v.useCallback(()=>{m.current=!1,s(!1),d.current&&(clearInterval(d.current),d.current=null),f.current=!1},[]),j=v.useCallback(()=>{m.current=!0,s(!1)},[]),q=v.useCallback(()=>{const{warn_after:D,expire_after:ne}=e,T=ne-D;if(f.current)return;c(T),f.current=!0;const F=new Date;F.setSeconds(F.getSeconds()+T),d.current=setInterval(()=>{const z=Date.now(),B=F.getTime()-z,X=Math.floor(B/1e3);X>0?c(X):(d.current&&(clearInterval(d.current),d.current=null),c(0))},1e3)},[e]),M=v.useCallback(()=>{d.current&&(clearInterval(d.current),d.current=null),f.current=!1;const D=e.expire_after-e.warn_after;c(D)},[e]),$=v.useCallback(D=>{if(D==="logout"||D?.response==="logout"){k();return}_.current()},[k]);v.useLayoutEffect(()=>{E.current=$},[$]);const H=v.useCallback(async()=>{const D=Math.floor((Date.now()-l.current.getTime())/1e3);try{const ne=await Yp(e.ping_url,D);ne.success?(g.current=0,E.current(ne.response)):(g.current++,J.warn(`Session ping failed (attempt ${g.current})`),_.current())}catch{g.current++,J.warn(`Session ping network error (attempt ${g.current})`),_.current()}},[e.ping_url]);v.useLayoutEffect(()=>{P.current=H},[H]);const V=v.useCallback(()=>{N();const D=Math.floor((Date.now()-l.current.getTime())/1e3),{warn_after:ne,expire_after:T}=e;let F;if(D>=T){k();return}else D>=ne?(f.current||q(),s(!0),b.current&&b.current(),F=T-D):(I(),f.current&&M(),F=ne-D);const z=Math.min(F*1e3,f5);u.current=setTimeout(()=>{P.current()},z)},[e,N,k,q,I,M]);v.useLayoutEffect(()=>{_.current=V},[V]);const R=v.useCallback(()=>{const D=new Date;if(D.getTime()-l.current.getTime()<1e3)return;const T=Math.floor((D.getTime()-l.current.getTime())/1e3);if(m.current&&T>=e.warn_after&&T<e.expire_after){m.current=!1,_.current(),w.current&&w.current();return}if(l.current=D,T>=e.expire_after){k();return}p.current&&(P.current(),I()),w.current&&w.current()},[e.expire_after,e.warn_after,k,I]);v.useLayoutEffect(()=>{S.current=R},[R]);const K=v.useCallback(()=>{m.current=!1,l.current=new Date,I(),P.current()},[I]),Y=v.useCallback(()=>{k()},[k]);return v.useEffect(()=>{if(!e.enabled)return;const D=()=>S.current();return O.forEach(ne=>{document.addEventListener(ne,D,!0)}),_.current(),()=>{O.forEach(ne=>{document.removeEventListener(ne,D,!0)}),u.current&&(clearTimeout(u.current),u.current=null),d.current&&(clearInterval(d.current),d.current=null)}},[e.enabled]),{showWarning:o,countdown:a,hideWarning:I,dismissWarning:j,renewSession:K,logoutNow:Y}},m5=({open:e,countdown:t,onContinue:r,onLogout:n,onDismiss:o})=>{const s=c=>{if(c>=60){const l=Math.floor(c/60),u=c%60;return u===0?`${l} min`:`${l} min ${u} sec`}return`${c} sec`},a=c=>{!c&&o&&o()};return i.jsxs(Ni,{open:e,onOpenChange:a,children:[i.jsxs(Li,{children:[i.jsx(Ii,{className:"fixed inset-0 bg-black/75 z-[10001] session-security-fade-in","data-testid":"session-security-overlay"}),i.jsxs(Fi,{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white rounded-lg p-6 max-w-[420px] w-[90%] z-[10002] shadow-2xl session-security-content-show focus:outline-none max-lg:w-screen max-lg:max-w-screen max-lg:h-dvh max-lg:max-h-dvh max-lg:inset-0 max-lg:top-0 max-lg:left-0 max-lg:translate-x-0 max-lg:translate-y-0 max-lg:rounded-none","aria-describedby":"session-security-description",onEscapeKeyDown:c=>{o?o():c.preventDefault()},onPointerDownOutside:c=>{o?(c.preventDefault(),o()):c.preventDefault()},children:[i.jsx(Di,{className:"m-0 mb-4 text-lg font-semibold text-foreground text-center",children:"Your session is about to expire"}),i.jsxs("div",{id:"session-security-description",className:"text-center mb-5",children:[i.jsxs("p",{className:"text-2xl font-bold text-destructive m-0 mb-3 tabular-nums",children:[i.jsx("span",{id:"session_security_counter",children:s(t)})," remaining"]}),i.jsx("p",{className:"m-0 text-muted-foreground text-sm",children:"Click or type to extend your session."})]}),i.jsxs("div",{className:"flex gap-3 justify-center",children:[i.jsx(ar,{onClick:r,children:"Continue Session"}),o&&i.jsx(ar,{variant:"outline",onClick:o,"data-testid":"session-security-dismiss",children:"Dismiss"}),i.jsx(ar,{variant:"outline",onClick:n,children:"Logout"})]})]})]}),i.jsx("style",{children:`
|
|
215
|
+
@keyframes session-security-fade-in-kf {
|
|
216
|
+
from { opacity: 0; }
|
|
217
|
+
to { opacity: 1; }
|
|
218
|
+
}
|
|
219
|
+
@keyframes session-security-content-show-kf {
|
|
220
|
+
from {
|
|
221
|
+
opacity: 0;
|
|
222
|
+
transform: translate(-50%, -48%) scale(0.96);
|
|
223
|
+
}
|
|
224
|
+
to {
|
|
225
|
+
opacity: 1;
|
|
226
|
+
transform: translate(-50%, -50%) scale(1);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
.session-security-fade-in {
|
|
230
|
+
animation: session-security-fade-in-kf 200ms ease-out;
|
|
231
|
+
}
|
|
232
|
+
.session-security-content-show {
|
|
233
|
+
animation: session-security-content-show-kf 200ms ease-out;
|
|
234
|
+
}
|
|
235
|
+
`})]})},g5=({config:e,children:t})=>{const{showWarning:r,countdown:n,renewSession:o,dismissWarning:s,logoutNow:a}=p5({config:e,onWarning:()=>{J.info("Session security warning displayed")},onExpire:()=>{J.info("Session expired")},onActivity:()=>{}});return e?.enabled?i.jsxs(i.Fragment,{children:[t,i.jsx(m5,{open:r,countdown:n,onContinue:o,onLogout:a,onDismiss:s})]}):i.jsx(i.Fragment,{children:t})},b5=(e,t,r)=>{if(!e){const c=t.default;return c?.component?v.createElement(c.component,{message:"No page type specified"}):v.createElement("div",{style:{padding:"24px",color:"#f04438"}},"No page type specified")}const n=t[e]||t.default;if(!n)return v.createElement("div",{style:{padding:"24px",color:"#f04438"}},`Unknown page type: ${e}`);if(n.handler)return n.handler(r);if(!n.component){const c=t.default;if(c?.component){const l=c.propsBuilder?c.propsBuilder({...r,pageType:e}):{message:`No component configured for page type: ${e}`};return v.createElement(c.component,l)}return v.createElement("div",{style:{padding:"24px",color:"#f04438"}},`No component configured for page type: ${e}`)}let o=n.propsBuilder?n.propsBuilder({...r,pageType:e}):{};n.includeBasePath!==!1&&r.matchedRoutePath&&(o={basePath:r.matchedRoutePath,...o});const a=n.component;return v.createElement(a,o)},Pl=({customPages:e={},forceRoute:t})=>{const r=ue.useLocation(),{routes:n,pageTypeRegistry:o,registryLoading:s,registryError:a,initializerEndpoint:c}=$e(),l=oa(),[u,d]=v.useState({pageType:null,customPagePath:null,matchedRoutePath:null,matchedRoute:null,loading:!0});if(v.useEffect(()=>{d(b=>({...b,loading:!0})),(()=>{const b=r.pathname;if(t){d({pageType:t.page_type,customPagePath:t.component||null,matchedRoutePath:t.path,matchedRoute:t,loading:!1});return}if(r.state?.page_type&&(r.state.page_type!=="custom"||r.state.custom_page_path)){let w=b;if(n&&n.length>0){for(const _ of n)if(b===_.path||b.startsWith(`${_.path}/`)){w=_.path;break}}d({pageType:r.state.page_type,customPagePath:r.state.custom_page_path||null,matchedRoutePath:w,matchedRoute:null,loading:!1});return}if(n&&n.length>0){const w=[...n].sort((_,P)=>{const E=_.path.split("/").filter(O=>O).length;return P.path.split("/").filter(O=>O).length-E});for(const _ of w){let P=ue.matchPath(_.path,b);if(!P&&b.startsWith(`${_.path}/`)){const E=_.path.endsWith("/*")?_.path:`${_.path}/*`;P=ue.matchPath(E,b)}if(P){d({pageType:_.page_type,customPagePath:_.component||null,matchedRoutePath:_.path,matchedRoute:_,loading:!1});return}}}d({pageType:"404",customPagePath:null,matchedRoutePath:null,matchedRoute:null,loading:!1})})()},[r,n,t]),u.loading||s)return i.jsx("div",{className:"content-spinner-container active",children:i.jsx("div",{className:"spinner",children:i.jsxs("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",children:[i.jsx("path",{d:"M32 5.33331V16",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M43.2002 20.7999L50.9335 13.0665",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M48 32H58.6667",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M43.2002 43.2L50.9335 50.9333",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M32 48V58.6667",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M13.0664 50.9333L20.7997 43.2",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M5.33301 32H15.9997",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M13.0664 13.0665L20.7997 20.7999",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"})]})})});if(a)return i.jsxs("div",{className:"p-6 text-destructive",children:["Failed to load page registry: ",a]});if(!o)return i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[60vh] text-center p-6",children:i.jsxs("div",{className:"bg-white rounded-xl p-8 shadow-sm max-w-[500px] w-full border border-border",children:[i.jsx("h1",{className:"text-[32px] m-0 text-destructive font-bold leading-none",children:"⚠️"}),i.jsx("h3",{className:"text-lg my-3 text-foreground font-semibold",children:"Configuration Issue"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4 leading-normal",children:"Unable to load page configuration from:"}),i.jsx("code",{className:"block bg-muted/50 border border-border rounded p-2 px-3 text-xs text-foreground font-mono mb-4 break-all",children:c}),i.jsx("p",{className:"text-[13px] text-muted-foreground/60 m-0",children:"Please check your configuration or contact your administrator."})]})});const{pageType:h,customPagePath:f,matchedRoutePath:p,matchedRoute:m}=u,g=`${h}-${f||"default"}-${p||"none"}`;return i.jsx("div",{className:"h-full",children:b5(h,o,{matchedRoutePath:p,customPagePath:f,matchedRoute:m,customPages:e,location:r,apiConfig:l})},g)},y5=v.lazy(()=>Promise.resolve().then(function(){return K6}).then(e=>({default:e.Layout}))),w5=v.lazy(()=>Promise.resolve().then(function(){return v4}).then(e=>({default:e.ConfigurePage}))),v5=v.lazy(()=>Promise.resolve().then(function(){return t5}).then(e=>({default:e.LoginPage}))),_5=v.lazy(()=>Promise.resolve().then(function(){return d4}).then(e=>({default:e.LogoutPage}))),x5=({customPages:e})=>{const t=ue.useParams(),n=`${ue.useLocation().pathname}-${Object.values(t).join("-")}`;return i.jsx(Pl,{customPages:e},n)},S5=({firstMenuUri:e})=>{const t=ue.useLocation(),r=It(t.search);return r&&Kt(r)?i.jsx(ue.Navigate,{to:r,replace:!0}):e?i.jsx(ue.Navigate,{to:e,replace:!0}):i.jsx("div",{className:"flex items-center justify-center h-screen min-h-dvh text-base text-muted-foreground",children:"No menu items available"})},eb=e=>{if(!e)return null;for(const t of e){if(t.uri)return t.uri;const r=eb(t.children);if(r)return r}return null},C5=e=>e.startsWith("/")?e.slice(1):e,tb=(e,t)=>{const r=C5(e);return i.jsxs(v.Fragment,{children:[i.jsx(ue.Route,{path:`${r}/*`,element:t}),i.jsx(ue.Route,{path:r,element:t})]},e)},rb=({customPages:e})=>{const{routes:t,loading:r,menu:n,pageTypeRegistry:o,registryError:s}=$e(),a=eb(n);if(r)return i.jsx("div",{className:"zango-loading flex items-center justify-center h-screen min-h-dvh text-base text-muted-foreground",children:"Loading..."});if(s)return i.jsxs("div",{className:"zango-error",children:["Failed to load page registry: ",s]});const c=[],l=[];return o&&t.forEach(u=>{const d=o[u.page_type];let h=!1;if(u.page_type==="custom"){const f=u.extra_params||{};h=f.standalone!==void 0?f.standalone===!0:d!=null&&d.standalone===!0}else h=d!=null&&d.standalone===!0;h?c.push(u):l.push(u)}),i.jsxs(ue.Routes,{children:[i.jsx(ue.Route,{path:"app/login/*",element:i.jsx(so,{children:i.jsx(v.Suspense,{fallback:null,children:i.jsx(v5,{basePath:"/app/login"})})})}),i.jsx(ue.Route,{path:"app/logout",element:i.jsx(so,{children:i.jsx(v.Suspense,{fallback:null,children:i.jsx(_5,{})})})}),i.jsx(ue.Route,{path:"app/configuration-error",element:i.jsx(so,{children:i.jsx(v.Suspense,{fallback:null,children:i.jsx(w5,{})})})}),c.map(u=>tb(u.path,i.jsx(so,{children:i.jsx(Pl,{customPages:e,forceRoute:u})}))),i.jsxs(ue.Route,{path:"/",element:i.jsx(v.Suspense,{fallback:null,children:i.jsx(y5,{})}),children:[i.jsx(ue.Route,{index:!0,element:a?i.jsx(ue.Navigate,{to:a}):i.jsx("div",{children:"No menu items available"})}),i.jsx(ue.Route,{path:"app",element:i.jsx(S5,{firstMenuUri:a})}),l.map(u=>tb(u.path,i.jsx(so,{children:i.jsx(x5,{customPages:e})})))]}),i.jsx(ue.Route,{path:"*",element:i.jsx(so,{children:i.jsx(Pl,{customPages:e,forceRoute:{path:"*",page_type:"404"}})})})]})},P5=({customPages:e})=>{const{appData:t,sessionSecurity:r}=$e(),n=t&&!t.is_user_anonymous,o={enabled:!0,ping_url:"/session_security/ping/",warn_after:1700,expire_after:1800},s=n?r?{...o,...r,enabled:!0}:o:null;return i.jsxs(i.Fragment,{children:[i.jsx(Rg,{}),n&&s?i.jsx(g5,{config:s,children:i.jsx(rb,{customPages:e})}):i.jsx(rb,{customPages:e})]})},E5=({config:e={},customPages:t={},layoutConfig:r={},topbarConfig:n={},navbarConfig:o={},customComponents:s={},authConfig:a={},appInitializerEndpoint:c})=>(c&&typeof window<"u"&&(window.app_initializer_endpoint=c),i.jsx(ue.BrowserRouter,{children:i.jsx(Zg,{config:e,layoutConfig:r,topbarConfig:n,navbarConfig:o,customComponents:s,authConfig:a,children:i.jsx(P5,{customPages:t})})})),k5=new By({defaultOptions:{queries:{staleTime:1/0,refetchOnWindowFocus:!1,retry:!1}}}),A5=({customPages:e={},config:t={},layoutConfig:r={},topbarConfig:n={},navbarConfig:o={},customComponents:s={},authConfig:a={},appInitializerEndpoint:c="appbuilder/initializer"})=>{const l=qe();return i.jsx(Wx,{children:i.jsxs(my,{client:k5,children:[i.jsx(E5,{config:t,customPages:e,layoutConfig:r,topbarConfig:n,navbarConfig:o,customComponents:s,authConfig:a,appInitializerEndpoint:c}),i.jsx(A.Toaster,{position:l?"top-center":"bottom-right",expand:!0,richColors:!0})]})})},Ho=v.createContext(null),El=()=>v.useContext(Ho),nb=e=>{const t=e;if(t?.status===401&&t?.data?.next_step)return t.data.next_step;if(t?.next_step)return t.next_step;const r=t?.response?.data||t?.data||t;return r?.next_step?r.next_step:null},{Text:ob,Title:O5}=A.Typography,Pa=({onSuccess:e,onBack:t,submitButtonText:r,verifyButtonText:n,resendButtonText:o})=>{const[s,a]=v.useState("request"),[c,l]=v.useState(!1),[u,d]=v.useState(""),[h,f]=v.useState("email"),[p,m]=v.useState(""),[g,y]=v.useState(""),[b,w]=v.useState(""),[_,P]=v.useState(0),[E,S]=v.useState(0),{authConfig:O}=Zr();v.useEffect(()=>{if(O){const H=re.getOtpAllowedUsernames();H&&H.length>0&&f(H[0])}},[O]),v.useEffect(()=>{if(_>0){const H=setTimeout(()=>P(_-1),1e3);return()=>clearTimeout(H)}},[_]);const N=H=>H==="email"?"Enter your email address":"Enter your mobile number",k=H=>H==="email"?[{required:!0,message:"Please enter your email address"},{type:"email",message:"Please enter a valid email!"}]:H==="mobile"?[{required:!0,message:"Please input your mobile number!"},{pattern:/^\+?[1-9]\d{1,14}$/,message:"Please enter a valid mobile number!"}]:[{required:!0,message:"Please input your username!"},{min:3,message:"Username must be at least 3 characters long"}],I=async H=>{w(""),l(!0);try{const V=await re.requestOTP(H.username),R=V?.data;V?.status===401&&R?.message?(d(H.username),a("verify"),P(30),A.toast.success(R.message||"Code sent successfully!")):(d(H.username),a("verify"),P(30),A.toast.success("Code sent successfully!"))}catch(V){J.error("Failed to Send Code",V);const R=V instanceof Error?V.message:"Failed to Send Code";w(R)}finally{l(!1)}},j=async()=>{if(y(""),p.length!==6){y("Please enter 6 digit Code");return}l(!0);try{const R={...await re.verifyOTP(u,p)||{},loginUser:{email:h==="email"?u:void 0,phone:h==="mobile"?u:void 0,username:u,display:u}};e(R)}catch(V){const R=V instanceof Error?V.message:"Invalid Code";y(R)}finally{l(!1)}},q=async()=>{if(!(_>0)){l(!0);try{await re.requestOTP(u),P(30),A.toast.success("Code resent successfully!")}catch(H){const V=H instanceof Error?H.message:"Failed to resend Code";A.toast.error(V)}finally{l(!1)}}};if(!O)return i.jsx("div",{className:"flex justify-center items-center min-h-loading-min-h",children:"Loading..."});const M=re.getOtpAllowedUsernames(),$=6;return s==="verify"?i.jsxs("div",{className:"w-full",children:[i.jsxs(A.Button,{variant:"link",icon:i.jsx(Bc,{size:16}),onClick:()=>{a("request"),m(""),y(""),P(0)},className:"mb-4 flex gap-2",children:["Change ",h?.slice(0,1).toUpperCase()+h?.slice(1)," ",h==="email"?"Address":"Number"]}),i.jsx(O5,{level:4,className:"!mb-2 text-center",style:Ar(O),children:"Enter Verification Code"}),i.jsxs(ob,{className:"block text-center text-gray-500 mb-6",style:ur(O),children:["Please enter the ",$,"-digit code sent to ",u]}),g&&i.jsx(A.Alert,{message:g,type:"error",showIcon:!1,closable:!0,onClose:()=>y(""),className:"mb-4"}),i.jsx("div",{className:"my-8 flex justify-center",children:i.jsx(Dg,{length:$,value:p,onChange:H=>{m(H),g&&y("")},disabled:c})}),i.jsx("div",{className:"auth-mobile-cta-anchor",children:i.jsx(A.Button,{variant:"primary",fullWidth:!0,disabled:c,onClick:j,className:"mt-6 w-full",children:c?i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx(qr,{size:16,className:"animate-spin"}),n||"Verify & Sign In"]}):n||"Verify & Sign In"})}),i.jsx("div",{className:"text-center mt-4",children:_>0?i.jsxs(ob,{type:"secondary",children:["Resend Code in ",_,"s"]}):i.jsx(A.Button,{variant:"link",onClick:q,loading:c,disabled:c,children:o||"Resend Code"})})]}):i.jsxs("div",{className:"w-full",children:[t&&i.jsxs(A.Button,{variant:"link",onClick:t,className:"mb-4 inline-flex items-center gap-1",children:[i.jsx(Bc,{size:16}),"Back to login"]}),b&&i.jsx(A.Alert,{message:b,type:"error",showIcon:!1,closable:!0,onClose:()=>w(""),className:"mb-4"}),M.length>1&&i.jsx(A.Tabs,{className:"login-tabs",activeKey:h,onChange:H=>{f(H),S(V=>V+1),w("")},items:M.map(H=>({key:H,label:i.jsxs("span",{className:"flex items-center gap-1",children:[H==="email"?i.jsx(ia,{size:16}):H==="mobile"?i.jsx(Vc,{size:16}):i.jsx(rm,{size:16}),H==="mobile"?"Mobile":H==="email"?"Email":"Username"]})}))}),i.jsxs(A.Form,{name:"otp-request",onFinish:H=>I(H),layout:"vertical",children:[i.jsx(A.FormItem,{name:"username",rules:k(h),children:i.jsx(A.Input,{className:"w-full",placeholder:N(h)})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",fullWidth:!0,disabled:c,className:"w-full",children:c?i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx(qr,{size:16,className:"animate-spin"}),r||"Send Code"]}):r||"Send Code"})})]},E)]})},T5=({onSuccess:e,onBack:t,submitButtonText:r,verifyButtonText:n,resendButtonText:o})=>{const s=El(),a=c=>{if(nb(c)?.is_pending){if(e){e(c);return}if(s?.onLogin){s.onLogin(c);return}J.warn("OTPLoginForm: Multi-step auth required but no parent handler found");return}const u=c,d=u?.meta?.is_authenticated||u?.response?.meta?.is_authenticated;if((u?.status||u?.response?.status)===200&&d){const f=It(window.location.search),p=u?.redirect_url||u?.response?.data?.redirect_url,m=Be(f,p,"/app");Xe(m);return}if(e){e(c);return}if(s?.onLogin){s.onLogin(c);return}J.warn("OTPLoginForm: No onSuccess prop or LoginContext found. Authentication result not handled.")};return i.jsx(Pa,{onSuccess:a,onBack:t,submitButtonText:r,verifyButtonText:n,resendButtonText:o})},N5=({onSuccess:e,showRememberMe:t=!0,submitButtonText:r})=>{const[n,o]=v.useState(!1),[s,a]=v.useState(null),[c,l]=v.useState("email"),[u,d]=v.useState(0),[h,f]=v.useState(!1),{authConfig:p}=Zr(),{getLoginConfig:m,getMessagesConfig:g,authConfig:y}=st(),b=El(),w=y||p,_=ur(w),P=pm(w);if(v.useEffect(()=>{(async()=>{try{await re.getAuthConfig();const $=re.getAllowedUsernames();if($&&$.length>0){const H=$.includes("email"),V=$.includes("mobile");H?l("email"):V&&l("mobile")}f(!0)}catch($){J.error("Failed to load auth config",$),f(!0)}})()},[]),!h)return i.jsx("div",{className:"flex justify-center items-center min-h-[200px]",children:i.jsx(A.Spin,{size:"large"})});const E=re.getAllowedUsernames(),S=E.includes("email"),O=E.includes("mobile"),N=S&&O,k=M=>{const $=g();return M==="email"?[{required:!0,message:$?.validation?.required||"Please enter your email address"},{type:"email",message:$?.validation?.invalidEmail||"Please enter a valid email address!"}]:[{required:!0,message:$?.validation?.required||"Please input your mobile number!"},{pattern:/^\+?[1-9]\d{1,14}$/,message:$?.validation?.invalidMobile||"Please enter a valid mobile number with country code (e.g., +919876543210)"}]},I=async M=>{o(!0),a(null);try{const $=c==="email"?{email:M.username,password:M.password}:{phone:M.username,password:M.password},V={...await re.login($),loginUser:{email:c==="email"?M.username:void 0,phone:c==="mobile"?M.username:void 0,username:M.username,display:M.username}};if(nb(V)?.is_pending){if(e){e(V);return}if(b?.onLogin){b.onLogin(V);return}J.warn("PasswordLoginForm: Multi-step auth required but no parent handler found");return}const K=V?.meta?.is_authenticated||V?.response?.meta?.is_authenticated;if((V?.status||V?.response?.status)===200&&K){if(e){e(V);return}if(b?.onLogin){b.onLogin(V);return}const D=It(window.location.search),ne=V?.redirect_url||V?.response?.data?.redirect_url,T=Be(D,ne,"/app");Xe(T);return}if(e){e(V);return}if(b?.onLogin){b.onLogin(V);return}J.warn("PasswordLoginForm: No onSuccess prop or LoginContext found. Authentication result not handled.")}catch($){const H=g(),V=$,R=V?.response?.data?.message||V?.message||H?.errors?.loginFailed||"Login failed. Please check your credentials and try again.";a(R)}finally{o(!1)}},j=M=>{const $=m(),H=g();return i.jsxs(A.Form,{name:`${M}-password-login`,className:"w-full",onFinish:V=>I(V),layout:"vertical",initialValues:{remember:!1,username:""},children:[s&&i.jsx(A.Alert,{message:s,type:"error",showIcon:!0,closable:!0,onClose:()=>a(null),className:"mb-4"}),i.jsx(A.FormItem,{name:"username",rules:k(M),children:i.jsx(A.Input,{className:"w-full",placeholder:M==="email"?$?.formPlaceholders?.email||"Email address":$?.formPlaceholders?.mobile||"Mobile number (+919876543210)",autoComplete:M==="email"?"email":"tel",onKeyDown:M==="mobile"?V=>{const R=["Backspace","Delete","Tab","Enter","ArrowLeft","ArrowRight"],K=V.key;!R.includes(K)&&!V.ctrlKey&&!V.metaKey&&!/[0-9+]/.test(K)&&V.preventDefault()}:void 0})}),i.jsx(A.FormItem,{name:"password",rules:[{required:!0,message:H?.validation?.passwordRequired||"Please input your password!"},{...Bo(p?.password_policy??null),message:H?.validation?.passwordTooShort||Bo(p?.password_policy??null).message}],children:i.jsx(A.PasswordInput,{className:"w-full",placeholder:$?.formPlaceholders?.password||"Password",autoComplete:"current-password"})}),i.jsx(A.FormItem,{children:i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsx("div",{children:$?.showRememberMe!==!1&&t&&re.isRememberMeEnabled()&&i.jsx(A.FormItem,{name:"remember",valuePropName:"checked",noStyle:!0,children:i.jsx("div",{className:"auth-remember-me",style:_,children:i.jsx(A.Checkbox,{label:$?.rememberMeText||"Remember me"})})})}),i.jsx("div",{children:re.isForgotPasswordEnabled()&&i.jsx(ue.Link,{to:"forgot-password",className:"text-sm transition-colors duration-300",style:P,children:$?.forgotPasswordText||"Forgot password?"})})]})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",className:"w-full text-base font-medium",disabled:n,fullWidth:!0,children:r||$?.submitButtonText||"Sign in"})})]},`${M}-${u}`)};if(N){const M=[...S?[{key:"email",label:"Email",children:j("email")}]:[],...O?[{key:"mobile",label:"Mobile",children:j("mobile")}]:[]];return i.jsx("div",{className:"w-full",children:i.jsx(A.Tabs,{activeKey:c,onChange:$=>{l($),d(H=>H+1),a(null)},items:M,className:"password-login-tabs"})})}return j(S?"email":"mobile")},L5=()=>i.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[i.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),i.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),i.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),i.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),M5=()=>i.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[i.jsx("path",{d:"M11.4 24H0V12.6h11.4V24z",fill:"#f25022"}),i.jsx("path",{d:"M24 24H12.6V12.6H24V24z",fill:"#00a4ef"}),i.jsx("path",{d:"M11.4 11.4H0V0h11.4v11.4z",fill:"#7fba00"}),i.jsx("path",{d:"M24 11.4H12.6V0H24v11.4z",fill:"#ffb900"})]}),I5=()=>i.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:i.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})}),F5=()=>i.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"#0077b5",children:i.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})}),D5=()=>i.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"#1877f2",children:i.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),$5=()=>i.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:i.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),z5=()=>i.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:i.jsx("path",{d:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"})}),U5=()=>i.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[i.jsx("path",{d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52z",fill:"#e01e5a"}),i.jsx("path",{d:"M6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313z",fill:"#e01e5a"}),i.jsx("path",{d:"M8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834z",fill:"#36c5f0"}),i.jsx("path",{d:"M8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312z",fill:"#36c5f0"}),i.jsx("path",{d:"M18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834z",fill:"#2eb67d"}),i.jsx("path",{d:"M17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312z",fill:"#2eb67d"}),i.jsx("path",{d:"M15.165 18.956a2.527 2.527 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52z",fill:"#ecb22e"}),i.jsx("path",{d:"M15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z",fill:"#ecb22e"})]}),j5=()=>i.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:i.jsx("path",{d:"M12 2l3.09 6.26L22 9l-5 4.87L18.18 22 12 18.27 5.82 22 7 13.87 2 9l6.91-.74L12 2z"})}),B5=()=>i.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[i.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0z",fill:"#00D924"}),i.jsx("path",{d:"M12 18c-3.314 0-6-2.686-6-6s2.686-6 6-6 6 2.686 6 6-2.686 6-6 6z",fill:"#FFFFFF"})]}),V5=(e,t="default")=>{const r=e?e.toLowerCase():"";return r.includes("google")?i.jsx(L5,{}):r.includes("microsoft")||r.includes("azure")?i.jsx(M5,{}):r.includes("github")?i.jsx(I5,{}):r.includes("linkedin")?i.jsx(F5,{}):r.includes("facebook")?i.jsx(D5,{}):r.includes("twitter")||r.includes("x.com")?i.jsx($5,{}):r.includes("apple")?i.jsx(z5,{}):r.includes("slack")?i.jsx(U5,{}):r.includes("okta")?i.jsx(B5,{}):r.includes("saml")||r.includes("sso")||t==="sso"?i.jsx(j5,{}):i.jsx(N3,{size:16})},Yt=({provider:e,type:t="default",prefix:r="Continue with",postfix:n=""})=>{const[o,s]=v.useState(!1),a=()=>{if(t==="sso"){const h=String(e.label||e.id||"");return h.toLowerCase().includes("azure")?"Azure AD":h.toLowerCase().includes("okta")?"Okta":h.toLowerCase().includes("google")?"Google":h.toLowerCase().includes("microsoft")?"Microsoft":h.toLowerCase().includes("saml")?"SSO":h.charAt(0).toUpperCase()+h.slice(1)}else return e.name||e.provider},c=String(t==="sso"?e.label||e.id||"":e.provider||""),l=a(),u=V5(c,t),d=async()=>{try{s(!0);const h=It(window.location.search),f=h||"/app";if(gm(h),t==="sso"){const p=String(e.id||""),g=(await re.initiateSAMLAuth(p,f))?.redirect_url;g&&(g.startsWith("https://")||g.startsWith("/"))?window.location.href=g:J.error("No valid redirect URL received from SAML init")}else{const p=await re.oauthRedirect(String(e.provider||""),window.location.href,f);if(p.success){const m=p.response.redirect_url;m&&(m.startsWith("https://")||m.startsWith("/"))&&(window.location.href=m)}else J.error("Error authenticating with OAuth provider")}}catch(h){J.error(`Error authenticating with ${t} provider`,h);let f=`Failed to authenticate with ${l}`;const p=h instanceof Error?h.message:"";p.includes("500")?f+=". The authentication service appears to be unavailable. Please try again later or contact support.":p.includes("404")?f+=". The authentication service is not configured properly.":p.includes("403")?f+=". You do not have permission to use this authentication method.":p?f+=`. ${p}`:f+=". Please try again or contact support.",A.toast.error(f)}finally{s(!1)}};return i.jsx(A.Button,{className:`flex w-full items-center justify-center gap-2 h-[42px] text-sm font-medium rounded-md transition-all duration-300 mb-2 last:mb-0 ${t==="oidc"?"bg-gray-100 border border-gray-200 text-gray-800 hover:bg-gray-200 hover:border-gray-300":t==="sso"?"bg-brand-500 border border-brand-500 text-white hover:bg-brand-600 hover:border-brand-600":"bg-white border border-gray-300 text-gray-800 hover:border-brand-500 hover:text-brand-500"}`,icon:u,block:!0,onClick:d,disabled:o,loading:o,children:o?"Redirecting...":`${r} ${l} ${n}`})},q5=({layout:e="column",gap:t,className:r,buttonTextPrefix:n="Continue with",buttonTextPostfix:o=""})=>{const[s,a]=v.useState(!0),[c,l]=v.useState(null),[u,d]=v.useState(!1),{getCustomComponents:h}=st();if(v.useEffect(()=>{(async()=>{try{const j=await re.getAuthConfig();l(j)}catch(j){J.error("Failed to load auth config",j),d(!0)}finally{a(!1)}})()},[]),s)return i.jsx("div",{className:"flex justify-center items-center p-4",children:i.jsx(A.Spin,{size:"small"})});if(u||!c)return null;const f=re.isSSOEnabled(),p=re.isOIDCEnabled(),m=re.getSSOProviders(),g=re.getOIDCProviders();if(!f&&!p||m.length===0&&g.length===0)return null;const b=h()?.ProviderButton,w=[...m.map(I=>({...I,providerType:"sso"})),...g.map(I=>({...I,providerType:"oidc"}))],P=w.length===1,O={1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6"}[t??(e==="grid"?3:2)]||"gap-2",k=`w-full sso-buttons-container ${(()=>{if(P)return"";switch(e){case"grid":return`grid grid-cols-1 sm:grid-cols-2 ${O}`;case"row":return`flex flex-row flex-wrap ${O}`;default:return`flex flex-col ${O}`}})()} ${r||""}`.trim();return i.jsx("div",{className:k,children:w.map(I=>{const j=b||Yt;return i.jsx(j,{provider:I,type:I.providerType,prefix:n,postfix:o},I.id)})})},{Content:H5}=A.Layout,W5=(e,t)=>r=>{const[n,o]=v.useState(null),[s,a]=v.useState(!1),[c,l]=v.useState(!1),u=st(),d=qe(),h=u?.authConfig??null;v.useEffect(()=>{(async()=>{const g=new URLSearchParams(window.location.search),y=g.get("token"),b=g.get("request_id");if(y&&b){l(!0);try{const w=await re.getSAMLAuthMeta(y,b);if(w?.code==="user_not_found"){A.toast.error(w.message||"User does not exist");const E=window.location.pathname;window.history.replaceState({},"",E),l(!1);return}if(w?.status===401&&w?.data?.next_step&&w.data.next_step.is_pending){let S=g.get("email")||g.get("user_email")||null,O=g.get("name")||g.get("user_name")||S;!S&&w?.data?.user&&(S=w.data.user.email||w.data.user.username,O=w.data.user.name||S);const k={...w,loginUser:{email:S,username:O||S||"SAML User",display:O||S||"SAML User"}};o(k),a(!0),l(!1);return}if(w?.roles&&w.roles.length>1){const E={status:401,data:{next_step:{id:"role_selection",is_pending:!0,metadata:{roles:w.roles}}},loginUser:{email:g.get("email")||"SAML User",username:g.get("name")||"SAML User",display:g.get("name")||"SAML User"}};o(E),a(!0),l(!1);return}const _=It(window.location.search),P=Be(_,w?.redirect_url,"/app");Xe(P)}catch(w){J.error("[withMultiStepAuth] SAML callback error",w);const _=w instanceof Error?w.message:"Failed to process SSO authentication";A.toast.error(_);const P=window.location.pathname;window.history.replaceState({},"",P),l(!1)}}})()},[]);const f=m=>{let g=null,y=!1,b=null;if(m?.status===401&&m?.data)g=m.data?.next_step,b=m.status,y=m?.meta?.is_authenticated??!1;else if(m?.response?.status===401&&m?.response?.data)g=m.response.data?.next_step,b=m.response.status,y=m.response?.meta?.is_authenticated??!1;else if(m?.next_step)g=m.next_step,y=m?.meta?.is_authenticated??!1,b=m?.status;else{const E=m?.response?.data||m?.data||m;g=E?.next_step,y=E?.meta?.is_authenticated||m?.meta?.is_authenticated||!1,b=m?.status||m?.response?.status}if(g?.is_pending){o(m),a(!0);return}if(b===200&&y){const E=It(window.location.search),S=m?.redirect_url||m?.response?.data?.redirect_url||m?.data?.redirect_url,O=Be(E,S,"/app");Xe(O);return}const w=It(window.location.search),_=m?.redirect_url||m?.response?.data?.redirect_url||m?.data?.redirect_url,P=Be(w,_,"/app");window.location.href=P},p=m=>{try{const g=It(window.location.search),y=m?.redirect_url||m?.response?.data?.redirect_url||m?.data?.redirect_url,b=Be(g,y,"/app");Xe(b)}catch(g){J.error("[withMultiStepAuth] Auth completion error",g),Xe("/app")}};if(c){const m=Gt(h||{}),g=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-loading-min-h text-center",children:[i.jsx(A.Spin,{size:"large"}),i.jsx("p",{className:"mt-4 text-gray-600",children:"Processing SSO authentication..."})]});return i.jsx(A.Layout,{className:"min-h-screen",style:m,children:i.jsx(H5,{className:"flex justify-center items-center min-h-screen",children:d?i.jsx("div",{className:"w-full px-5",children:g}):i.jsx(A.Card,{className:"w-full max-w-md shadow-lg rounded-lg",bordered:!1,children:g})})})}return s&&n?i.jsx(oo,{initialAuthState:n,onAuthComplete:p,skipLoginStep:!0,logo:t?.logo,roleSelectionTitle:t?.roleSelectionTitle,roleSelectionSubtitle:t?.roleSelectionSubtitle,twoFactorTitle:t?.twoFactorTitle,twoFactorSubtitle:t?.twoFactorSubtitle,passwordResetTitle:t?.passwordResetTitle,passwordResetSubtitle:t?.passwordResetSubtitle,...r}):i.jsx(Ho.Provider,{value:{onLogin:m=>f(m)},children:i.jsx(e,{...r})})},Z5=()=>Zr(),R5=()=>i.jsxs("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"62",height:"20",viewBox:"0 0 62 20",fill:"none",children:[i.jsx("path",{d:"M0 15.5495L0 13.7372L5.34244 6.80918L0.527365 6.80918L0.527365 4.17101L9.53843 4.17101L9.53843 5.96037L4.19599 12.9114L9.69894 12.9114V15.5495L0 15.5495Z",fill:"var(--Colours-Base-black, #000)"}),i.jsx("path",{d:"M16.605 15.8248C15.7949 15.8248 15.0382 15.6948 14.3351 15.4348C13.6319 15.1595 13.0205 14.7695 12.5007 14.2649C11.981 13.7449 11.5759 13.1178 11.2855 12.3837C10.9951 11.6496 10.8499 10.8085 10.8499 9.86027C10.8499 8.94265 11.0027 8.11679 11.3084 7.38269C11.6142 6.6333 12.0116 6.00626 12.5007 5.50156C13.0052 4.98158 13.5784 4.58394 14.2204 4.30865C14.8624 4.03337 15.5274 3.89573 16.2152 3.89573C17.0254 3.89573 17.7285 4.03337 18.3247 4.30865C18.9361 4.58394 19.4406 4.96628 19.838 5.45568C20.2507 5.94508 20.5564 6.52624 20.7552 7.19916C20.9539 7.85679 21.0532 8.5756 21.0532 9.35558C21.0532 9.66145 21.0379 9.95203 21.0074 10.2273C20.9768 10.5026 20.9462 10.7091 20.9157 10.8467L14.1058 10.8467C14.2586 11.6726 14.5949 12.2843 15.1146 12.682C15.6497 13.0643 16.2993 13.2555 17.0636 13.2555C17.8738 13.2555 18.6916 13.0031 19.517 12.4984L20.6405 14.5401C20.0596 14.9378 19.41 15.2513 18.6916 15.4807C17.9884 15.7101 17.2929 15.8248 16.605 15.8248ZM14.0828 8.62148L18.1871 8.62148C18.1871 7.97914 18.0419 7.45916 17.7515 7.06152C17.461 6.66389 16.9719 6.46507 16.284 6.46507C15.749 6.46507 15.2751 6.64094 14.8624 6.9927C14.465 7.34445 14.2051 7.88738 14.0828 8.62148Z",fill:"currentColor"}),i.jsx("path",{d:"M26.4777 15.8248C25.8969 15.8248 25.4077 15.7331 25.0103 15.5495C24.6128 15.366 24.2918 15.1137 24.0472 14.7925C23.818 14.456 23.6498 14.0584 23.5428 13.5996C23.4358 13.1255 23.3823 12.5978 23.3823 12.0167L23.3823 0L26.7529 0L26.7529 12.1543C26.7529 12.5061 26.814 12.7508 26.9363 12.8884C27.0739 13.0261 27.2114 13.0949 27.349 13.0949C27.4254 13.0949 27.4866 13.0949 27.5324 13.0949C27.5936 13.0949 27.67 13.0796 27.7617 13.049L28.1745 15.5495C27.991 15.626 27.7541 15.6872 27.4637 15.7331C27.1885 15.7942 26.8599 15.8248 26.4777 15.8248Z",fill:"currentColor"}),i.jsx("path",{d:"M34.3225 15.8248C33.6193 15.8248 33.0155 15.7178 32.5111 15.5036C32.0219 15.2895 31.6168 14.9913 31.2958 14.609C30.9901 14.2266 30.7608 13.7678 30.608 13.2325C30.4704 12.682 30.4016 12.0779 30.4016 11.4202L30.4016 6.80918L28.8424 6.80918V4.30865L30.585 4.17101L30.9748 1.14286L33.7722 1.14286V4.17101L36.5007 4.17101V6.80918L33.7722 6.80918V11.3743C33.7722 12.0167 33.9021 12.4831 34.162 12.7737C34.4371 13.049 34.7963 13.1867 35.2396 13.1867C35.423 13.1867 35.6065 13.1637 35.7899 13.1178C35.9886 13.0719 36.1644 13.0184 36.3173 12.9572L36.8446 15.4119C36.5389 15.5036 36.1797 15.5954 35.767 15.6872C35.3543 15.7789 34.8727 15.8248 34.3225 15.8248Z",fill:"currentColor"}),i.jsx("path",{d:"M38.7205 15.5495V0L42.0911 0V3.41397L41.9306 5.45568C42.3586 5.07334 42.8554 4.72158 43.4209 4.40042C43.9865 4.06396 44.6591 3.89573 45.4387 3.89573C46.6768 3.89573 47.5711 4.30101 48.1214 5.11157C48.687 5.92214 48.9697 7.04623 48.9697 8.48384V15.5495H45.5992V8.91971C45.5992 8.09385 45.4845 7.52798 45.2553 7.22211C45.0413 6.91623 44.6897 6.7633 44.2005 6.7633C43.7725 6.7633 43.4057 6.8627 43.0999 7.06152C42.7942 7.24505 42.4579 7.51269 42.0911 7.86444V15.5495H38.7205Z",fill:"currentColor"}),i.jsx("path",{d:"M53.0807 20C52.7291 20 52.431 19.9771 52.1864 19.9312C51.9418 19.9006 51.7049 19.8471 51.4756 19.7706L52.0718 17.2013C52.1788 17.2318 52.3011 17.2624 52.4386 17.293C52.5762 17.3236 52.7061 17.3389 52.8284 17.3389C53.394 17.3389 53.8297 17.2013 54.1354 16.926C54.4411 16.6507 54.6704 16.2913 54.8233 15.8478L54.9837 15.2513L50.6043 4.17101L53.9978 4.17101L55.6258 9.05735C55.7939 9.57734 55.9468 10.105 56.0843 10.6402C56.2219 11.1755 56.3671 11.7261 56.52 12.292H56.6117C56.734 11.7567 56.8563 11.2214 56.9786 10.6861C57.1161 10.1356 57.2537 9.59263 57.3913 9.05735L58.767 4.17101H62L58.0562 15.6642C57.7811 16.383 57.4906 17.0101 57.1849 17.5454C56.8945 18.0959 56.5506 18.5471 56.1531 18.8989C55.771 19.2659 55.3277 19.5412 54.8233 19.7247C54.3341 19.9082 53.7532 20 53.0807 20Z",fill:"currentColor"})]}),sb=({logoUrl:e,appName:t,height:r="28px",linkTo:n="/"})=>{const[o,s]=v.useState(()=>{const f=vn.getCachedLogo();return f&&(f.base64Data||f.url)?f.base64Data||f.url:e||null}),[a,c]=v.useState(!1),l=v.useRef(t);v.useEffect(()=>{l.current=t},[t]),v.useEffect(()=>{e&&vn.updateInBackground(e,l.current,f=>{f.base64Data&&s(f.base64Data)})},[e]);const u=v.useCallback(()=>{J.error("Logo failed to load"),c(!0);const f=vn.getCachedLogo();f&&o===f.base64Data&&vn.clearCache()},[o]),d=v.useCallback(()=>{c(!1)},[]),h=()=>a||!o?i.jsx(R5,{}):i.jsx("img",{src:o,height:r,alt:t||"Logo",onError:u,onLoad:d,className:"object-contain",style:{maxHeight:r}});return i.jsx(ue.Link,{to:n,className:"logo-link",children:h()})},Gr={LOGIN:"/app/login",APP:"/app",LOGOUT:"/app/logout"},G5=()=>{const{routes:e,pageTypeRegistry:t,registryLoading:r,registryError:n}=$e(),o=v.useCallback(s=>{if(!s)return!1;const a=s.endsWith("/")&&s!=="/"?s.slice(0,-1):s;return e.some(c=>{const l=c.path?.startsWith("/")?c.path:`/${c.path}`,u=l.endsWith("/")&&l!=="/"?l.slice(0,-1):l;if(u===a)return!0;if(u.includes(":")){const d=u.split("/").map(f=>f.startsWith(":")?"[^/]+":f).join("/");if(new RegExp(`^${d}(/.*)?$`).test(a))return!0}return!!(c.exact===!1&&(a.startsWith(`${u}/`)||a===u))})},[e]);return{routes:e,pageTypeRegistry:t,registryLoading:r,registryError:n,isValidRoute:o}},kl=()=>{const e=ue.useNavigate(),{isValidRoute:t}=G5();return{navigateTo:v.useCallback((n,o={})=>{if(!n)return;let s=!1;try{s=new URL(n,window.location.origin).origin!==window.location.origin}catch{}if(s){o.newTab?window.open(n,"_blank"):window.location.href=n;return}t(n)?e(n,o):o.newTab?window.open(n,"_blank"):window.location.href=n},[e,t]),isInternalRoute:t}},_n=v.forwardRef(({to:e,children:t,className:r,onClick:n,...o},s)=>{const{isInternalRoute:a}=kl(),c=u=>{n&&n(u)};return!(e&&(e.startsWith("http://")||e.startsWith("https://")))&&a(e)?i.jsx(ue.Link,{ref:s,to:e,className:r,onClick:c,...o,children:t}):i.jsx("a",{ref:s,href:e,className:r,onClick:c,...o,children:t})});_n.displayName="SmartLink";function ab(e,t,r=[]){const n=t.replace(/\/+$/,"")||"/";for(const o of e){const s=o.url||o.uri,a=s?.replace(/\/+$/,"")||"";if(a&&n===a)return[...r,{name:o.name||o.label,url:s}];if(o.children?.length){const c=[...r,{name:o.name||o.label,url:s}],l=ab(o.children,t,c);if(l)return l}}return null}function K5(e){return e.replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function Y5(e){const t=e.replace(/\/+$/,"").split("/").filter(Boolean),r=[{name:"Home",url:Gr.APP}],n=t[0]==="app"?1:0;for(let o=n;o<t.length;o++){const s=`/${t.slice(0,o+1).join("/")}`;r.push({name:K5(t[o]),url:s})}return r}const ib=()=>{const{pathname:e}=ue.useLocation(),{menu:t}=$e(),r=v.useMemo(()=>{const n=e.replace(/\/+$/,"")||"/";if(n===Gr.APP||n==="/")return[{name:"Home"}];const o=ab(t||[],e);if(o){const a=o[0]?.url?.replace(/\/+$/,"");return a!==Gr.APP&&a!=="/"?[{name:"Home",url:Gr.APP},...o]:o}return Y5(e)},[e,t]);return r.length===0?null:i.jsx("nav",{"aria-label":"Breadcrumb",className:"breadcrumbs",children:i.jsxs("ol",{className:"flex items-center gap-1.5 text-sm",children:[r.map((n,o)=>{const s=o===r.length-1;return i.jsxs("li",{className:`flex items-center gap-1.5 ${o>0&&o<r.length-1?"hidden sm:flex":""}`,children:[o>0&&i.jsx(em,{className:"h-3.5 w-3.5 text-muted-foreground breadcrumb-separator flex-shrink-0"}),s||!n.url?i.jsx("span",{className:"text-foreground font-medium breadcrumb-current truncate max-w-[200px]",children:n.name}):i.jsx(_n,{to:n.url,className:"text-muted-foreground hover:text-foreground transition-colors truncate max-w-[200px]",children:n.name})]},o)}),r.length>2&&i.jsxs("li",{className:"order-1 flex items-center gap-1.5 sm:hidden",children:[i.jsx(em,{className:"h-3.5 w-3.5 text-muted-foreground breadcrumb-separator flex-shrink-0"}),i.jsx("span",{className:"text-muted-foreground",children:"..."})]})]})})};function cb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Q5(e){if(Array.isArray(e))return e}function J5(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,s,a,c=[],l=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(l=(n=s.call(r)).done)&&(c.push(n.value),c.length!==t);l=!0);}catch(d){u=!0,o=d}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}function X5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
236
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e6(e,t){return Q5(e)||J5(e,t)||t6(e,t)||X5()}function t6(e,t){if(e){if(typeof e=="string")return cb(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?cb(e,t):void 0}}const lb=Object.entries,ub=Object.setPrototypeOf,r6=Object.isFrozen,n6=Object.getPrototypeOf,o6=Object.getOwnPropertyDescriptor;let et=Object.freeze,ot=Object.seal,ao=Object.create,db=typeof Reflect<"u"&&Reflect,Al=db.apply,Ol=db.construct;et||(et=function(t){return t}),ot||(ot=function(t){return t}),Al||(Al=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),s=2;s<n;s++)o[s-2]=arguments[s];return t.apply(r,o)}),Ol||(Ol=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return new t(...n)});const xn=Re(Array.prototype.forEach),s6=Re(Array.prototype.lastIndexOf),fb=Re(Array.prototype.pop),Wo=Re(Array.prototype.push),a6=Re(Array.prototype.splice),io=Array.isArray,Zo=Re(String.prototype.toLowerCase),Tl=Re(String.prototype.toString),hb=Re(String.prototype.match),Ro=Re(String.prototype.replace),pb=Re(String.prototype.indexOf),i6=Re(String.prototype.trim),c6=Re(Number.prototype.toString),l6=Re(Boolean.prototype.toString),mb=typeof BigInt>"u"?null:Re(BigInt.prototype.toString),gb=typeof Symbol>"u"?null:Re(Symbol.prototype.toString),Ot=Re(Object.prototype.hasOwnProperty),Go=Re(Object.prototype.toString),mt=Re(RegExp.prototype.test),Sn=u6(TypeError);function Re(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return Al(e,t,n)}}function u6(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ol(e,r)}}function Ce(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zo;if(ub&&ub(e,null),!io(t))return e;let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){const s=r(o);s!==o&&(r6(t)||(t[n]=s),o=s)}e[o]=!0}return e}function d6(e){for(let t=0;t<e.length;t++)Ot(e,t)||(e[t]=null);return e}function Ft(e){const t=ao(null);for(const n of lb(e)){var r=e6(n,2);const o=r[0],s=r[1];Ot(e,o)&&(io(s)?t[o]=d6(s):s&&typeof s=="object"&&s.constructor===Object?t[o]=Ft(s):t[o]=s)}return t}function f6(e){switch(typeof e){case"string":return e;case"number":return c6(e);case"boolean":return l6(e);case"bigint":return mb?mb(e):"0";case"symbol":return gb?gb(e):"Symbol()";case"undefined":return Go(e);case"function":case"object":{if(e===null)return Go(e);const t=e,r=Qt(t,"toString");if(typeof r=="function"){const n=r(t);return typeof n=="string"?n:Go(n)}return Go(e)}default:return Go(e)}}function Qt(e,t){for(;e!==null;){const n=o6(e,t);if(n){if(n.get)return Re(n.get);if(typeof n.value=="function")return Re(n.value)}e=n6(e)}function r(){return null}return r}function h6(e){try{return mt(e,""),!0}catch{return!1}}const bb=et(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Nl=et(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ll=et(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),p6=et(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ml=et(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),m6=et(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),yb=et(["#text"]),wb=et(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Il=et(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),vb=et(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ea=et(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),g6=ot(/{{[\w\W]*|^[\w\W]*}}/g),b6=ot(/<%[\w\W]*|^[\w\W]*%>/g),y6=ot(/\${[\w\W]*/g),w6=ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),v6=ot(/^aria-[\-\w]+$/),_b=ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_6=ot(/^(?:\w+script|data):/i),x6=ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),S6=ot(/^html$/i),C6=ot(/^[a-z][.\w]*(-[.\w]+)+$/i),xb=ot(/<[/\w!]/g),Sb=ot(/<[/\w]/g),P6=ot(/<\/no(script|embed|frames)/i),E6=ot(/\/>/i),Dt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Cb=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],k6=et(Ce({},Cb)),A6=(function(){const e={};return xn(Cb,t=>{e[t]=ot(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),et(e)})(),O6=function(){return typeof window>"u"?null:window},T6=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(n=r.getAttribute(o));const s="dompurify"+(n?"#"+n:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Pb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Kr=function(t,r,n,o){return Ot(t,r)&&io(t[r])?Ce(o.base?Ft(o.base):{},t[r],o.transform):n},Fl=function(t,r,n){const o=Ot(t,r)?t[r]:void 0;return o&&typeof o=="object"?Ft(o):n()};function Eb(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O6();const t=ee=>Eb(ee);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Dt.document||!e.Element)return t.isSupported=!1,t;let r=e.document;const n=r,o=n.currentScript;e.DocumentFragment;const s=e.HTMLTemplateElement,a=e.Node,c=e.Element,l=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,h=e.trustedTypes,f=c.prototype,p=Qt(f,"cloneNode"),m=Qt(f,"remove"),g=Qt(f,"nextSibling"),y=Qt(f,"childNodes"),b=Qt(f,"parentNode"),w=Qt(f,"shadowRoot"),_=Qt(f,"attributes"),P=a&&a.prototype?Qt(a.prototype,"nodeType"):null,E=a&&a.prototype?Qt(a.prototype,"nodeName"):null,S=a&&a.prototype?Qt(a.prototype,"ownerDocument"):null,O=function(C){return P?P(C):C.nodeType},N=function(C){return E?E(C):C.nodeName};if(typeof s=="function"){const ee=r.createElement("template");ee.content&&ee.content.ownerDocument&&(r=ee.content.ownerDocument)}let k,I="",j,q=!1,M=0;const $=function(){if(M>0)throw Sn('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},H=function(C){$(),M++;try{return k.createHTML(C)}finally{M--}},V=function(C){$(),M++;try{return k.createScriptURL(C)}finally{M--}},R=function(){return q||(j=T6(h,o),q=!0),j},K=r,Y=K.implementation,D=K.createNodeIterator,ne=K.createDocumentFragment,T=K.getElementsByTagName,F=n.importNode;let z=Pb();t.isSupported=typeof lb=="function"&&typeof b=="function"&&Y&&Y.createHTMLDocument!==void 0;const B=g6,X=b6,G=y6,te=w6,ie=v6,Ne=_6,Ae=x6,_e=C6;let Se=_b,ge=null;const Tt=Ce({},[...bb,...Nl,...Ll,...Ml,...yb]);let ke=null;const zt=Ce({},[...wb,...Il,...vb,...Ea]);let he=Object.seal(ao(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ve=null,Jt=null;const gt=Object.seal(ao(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ko=!0,Yo=!0,Yr=!1,Ub=!0,Qr=!1,Cn=!0,Pn=!1,$l=!1,Oa=null,Ta=null,zl=!1,co=!1,Na=!1,La=!1,jb=!0,Bb=!1;const Vb="user-content-";let Ul=!0,jl=!1,lo={},uo=null;const qb=Ce({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Hb=null;const Wb=Ce({},["audio","video","img","source","image","track"]);let Zb=null;const Rb=Ce({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ma="http://www.w3.org/1998/Math/MathML",Ia="http://www.w3.org/2000/svg",hr="http://www.w3.org/1999/xhtml";let fo=hr,Bl=!1,Vl=null;const _4=Ce({},[Ma,Ia,hr],Tl),Gb=et(["mi","mo","mn","ms","mtext"]);let ql=Ce({},Gb);const Kb=et(["annotation-xml"]);let Hl=Ce({},Kb);const x4=Ce({},["title","style","font","a","script"]);let Qo=null;const S4=["application/xhtml+xml","text/html"],C4="text/html";let Ze=null,ho=null;const P4=r.createElement("form"),Yb=function(C){return C instanceof RegExp||C instanceof Function},Wl=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ho&&ho===C)return;(!C||typeof C!="object")&&(C={}),C=Ft(C),Qo=S4.indexOf(C.PARSER_MEDIA_TYPE)===-1?C4:C.PARSER_MEDIA_TYPE,Ze=Qo==="application/xhtml+xml"?Tl:Zo,ge=Kr(C,"ALLOWED_TAGS",Tt,{transform:Ze}),ke=Kr(C,"ALLOWED_ATTR",zt,{transform:Ze}),Vl=Kr(C,"ALLOWED_NAMESPACES",_4,{transform:Tl}),Zb=Kr(C,"ADD_URI_SAFE_ATTR",Rb,{transform:Ze,base:Rb}),Hb=Kr(C,"ADD_DATA_URI_TAGS",Wb,{transform:Ze,base:Wb}),uo=Kr(C,"FORBID_CONTENTS",qb,{transform:Ze}),Ve=Kr(C,"FORBID_TAGS",Ft({}),{transform:Ze}),Jt=Kr(C,"FORBID_ATTR",Ft({}),{transform:Ze}),lo=Ot(C,"USE_PROFILES")?C.USE_PROFILES&&typeof C.USE_PROFILES=="object"?Ft(C.USE_PROFILES):C.USE_PROFILES:!1,Ko=C.ALLOW_ARIA_ATTR!==!1,Yo=C.ALLOW_DATA_ATTR!==!1,Yr=C.ALLOW_UNKNOWN_PROTOCOLS||!1,Ub=C.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Qr=C.SAFE_FOR_TEMPLATES||!1,Cn=C.SAFE_FOR_XML!==!1,Pn=C.WHOLE_DOCUMENT||!1,co=C.RETURN_DOM||!1,Na=C.RETURN_DOM_FRAGMENT||!1,La=C.RETURN_TRUSTED_TYPE||!1,zl=C.FORCE_BODY||!1,jb=C.SANITIZE_DOM!==!1,Bb=C.SANITIZE_NAMED_PROPS||!1,Ul=C.KEEP_CONTENT!==!1,jl=C.IN_PLACE||!1,Se=h6(C.ALLOWED_URI_REGEXP)?C.ALLOWED_URI_REGEXP:_b,fo=typeof C.NAMESPACE=="string"?C.NAMESPACE:hr,ql=Fl(C,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ce({},Gb)),Hl=Fl(C,"HTML_INTEGRATION_POINTS",()=>Ce({},Kb));const U=Fl(C,"CUSTOM_ELEMENT_HANDLING",()=>ao(null));if(he=ao(null),Ot(U,"tagNameCheck")&&Yb(U.tagNameCheck)&&(he.tagNameCheck=U.tagNameCheck),Ot(U,"attributeNameCheck")&&Yb(U.attributeNameCheck)&&(he.attributeNameCheck=U.attributeNameCheck),Ot(U,"allowCustomizedBuiltInElements")&&typeof U.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=U.allowCustomizedBuiltInElements),ot(he),Qr&&(Yo=!1),Na&&(co=!0),lo&&(ge=Ce({},yb),ke=ao(null),lo.html===!0&&(Ce(ge,bb),Ce(ke,wb)),lo.svg===!0&&(Ce(ge,Nl),Ce(ke,Il),Ce(ke,Ea)),lo.svgFilters===!0&&(Ce(ge,Ll),Ce(ke,Il),Ce(ke,Ea)),lo.mathMl===!0&&(Ce(ge,Ml),Ce(ke,vb),Ce(ke,Ea))),gt.tagCheck=null,gt.attributeCheck=null,Ot(C,"ADD_TAGS")&&(typeof C.ADD_TAGS=="function"?gt.tagCheck=C.ADD_TAGS:io(C.ADD_TAGS)&&(ge===Tt&&(ge=Ft(ge)),Ce(ge,C.ADD_TAGS,Ze))),Ot(C,"ADD_ATTR")&&(typeof C.ADD_ATTR=="function"?gt.attributeCheck=C.ADD_ATTR:io(C.ADD_ATTR)&&(ke===zt&&(ke=Ft(ke)),Ce(ke,C.ADD_ATTR,Ze))),Ot(C,"ADD_FORBID_CONTENTS")&&io(C.ADD_FORBID_CONTENTS)&&(uo===qb&&(uo=Ft(uo)),Ce(uo,C.ADD_FORBID_CONTENTS,Ze)),Ul&&(ge["#text"]=!0),Pn&&Ce(ge,["html","head","body"]),ge.table&&(Ce(ge,["tbody"]),delete Ve.tbody),C.TRUSTED_TYPES_POLICY){if(typeof C.TRUSTED_TYPES_POLICY.createHTML!="function")throw Sn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof C.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Sn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Q=k;k=C.TRUSTED_TYPES_POLICY;try{I=H("")}catch(se){throw k=Q,se}}else C.TRUSTED_TYPES_POLICY===null?(k=void 0,I=""):(k===void 0&&(k=R()),k&&typeof I=="string"&&(I=H("")));et&&et(C),ho=C},Qb=Ce({},[...Nl,...Ll,...p6]),Jb=Ce({},[...Ml,...m6]),E4=function(C,U,Q){return U.namespaceURI===hr?C==="svg":U.namespaceURI===Ma?C==="svg"&&(Q==="annotation-xml"||ql[Q]):!!Qb[C]},k4=function(C,U,Q){return U.namespaceURI===hr?C==="math":U.namespaceURI===Ia?C==="math"&&Hl[Q]:!!Jb[C]},A4=function(C,U,Q){return U.namespaceURI===Ia&&!Hl[Q]||U.namespaceURI===Ma&&!ql[Q]?!1:!Jb[C]&&(x4[C]||!Qb[C])},O4=function(C){let U=b(C);(!U||!U.tagName)&&(U={namespaceURI:fo,tagName:"template"});const Q=Zo(C.tagName),se=Zo(U.tagName);return Vl[C.namespaceURI]?C.namespaceURI===Ia?E4(Q,U,se):C.namespaceURI===Ma?k4(Q,U,se):C.namespaceURI===hr?A4(Q,U,se):!!(Qo==="application/xhtml+xml"&&Vl[C.namespaceURI]):!1},Jr=function(C){Wo(t.removed,{element:C});try{b(C).removeChild(C)}catch{if(m(C),!b(C))throw Sn("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Xb=function(C,U,Q){try{C.removeAttributeNode(U)}catch{try{C.removeAttribute(Q)}catch{}}},Fa=function(C){Da(C);const U=y(C);if(U){const se=[];xn(U,de=>{Wo(se,de)}),xn(se,de=>{try{m(de)}catch{}})}const Q=_(C);if(Q)for(let se=Q.length-1;se>=0;--se){const de=Q[se],pe=de&&de.name;typeof pe=="string"&&Xb(C,de,pe)}},En=function(C,U,Q){if(!Q)try{Q=U.getAttributeNode(C)}catch{Q=null}Wo(t.removed,{attribute:Q||null,from:U});try{Q?U.removeAttributeNode(Q):U.removeAttribute(C)}catch{try{U.removeAttribute(C)}catch{}}if(C==="is")if(co||Na)try{Jr(U)}catch{}else try{U.setAttribute(C,"")}catch{}},T4=function(C){const U=_(C);if(U)for(let Q=U.length-1;Q>=0;--Q){const se=U[Q],de=se&&se.name;typeof de!="string"||ke[Ze(de)]||Xb(C,se,de)}},Da=function(C){const U=[C];for(;U.length>0;){const Q=U.pop();O(Q)===Dt.element&&T4(Q);const de=y(Q);if(de)for(let pe=de.length-1;pe>=0;--pe)U.push(de[pe])}},ey=function(C,U){return Cn?C==="patchsrc"?!0:C==="for"&&U!=="label"&&U!=="output":!1},N4=function(C){if(!Cn)return;const U=[C];for(;U.length>0;){const Q=U.pop(),se=O(Q);if(se===Dt.processingInstruction||se===Dt.comment&&mt(Sb,Q.data)){try{m(Q)}catch{}continue}if(se===Dt.element){const pe=Q,Te=Ze(N(Q));try{pe.hasAttribute&&pe.hasAttribute("patchsrc")&&pe.removeAttribute("patchsrc"),pe.hasAttribute&&pe.hasAttribute("for")&&ey("for",Te)&&pe.removeAttribute("for")}catch{}}const de=y(Q);if(de)for(let pe=de.length-1;pe>=0;--pe)U.push(de[pe])}},ty=function(C){let U=null,Q=null;if(zl)C="<remove></remove>"+C;else{const pe=hb(C,/^[\r\n\t ]+/);Q=pe&&pe[0]}Qo==="application/xhtml+xml"&&fo===hr&&(C='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+C+"</body></html>");const se=k?H(C):C;if(fo===hr)try{U=new d().parseFromString(se,Qo)}catch{}if(!U||!U.documentElement){U=Y.createDocument(fo,"template",null);try{U.documentElement.innerHTML=Bl?I:se}catch{}}const de=U.body||U.documentElement;return C&&Q&&de.insertBefore(r.createTextNode(Q),de.childNodes[0]||null),fo===hr?T.call(U,Pn?"html":"body")[0]:Pn?U.documentElement:de},ry=function(C){const U=S?S(C):C.ownerDocument;return D.call(U||C,C,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},$a=function(C){return C=Ro(C,B," "),C=Ro(C,X," "),C=Ro(C,G," "),C},Zl=function(C){var U;C.normalize();const Q=S?S(C):C.ownerDocument,se=D.call(Q||C,C,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let de=se.nextNode();for(;de;)de.data=$a(de.data),de=se.nextNode();const pe=(U=C.querySelectorAll)===null||U===void 0?void 0:U.call(C,"template");pe&&xn(pe,Te=>{po(Te.content)&&Zl(Te.content)})},za=function(C){const U=E?E(C):null;return typeof U!="string"||Ze(U)!=="form"?!1:typeof C.nodeName!="string"||typeof C.textContent!="string"||typeof C.removeChild!="function"||C.attributes!==_(C)||typeof C.removeAttribute!="function"||typeof C.setAttribute!="function"||typeof C.namespaceURI!="string"||typeof C.insertBefore!="function"||typeof C.hasChildNodes!="function"||C.nodeType!==P(C)||C.childNodes!==y(C)},po=function(C){if(!P||typeof C!="object"||C===null)return!1;try{return P(C)===Dt.documentFragment}catch{return!1}},Jo=function(C){if(!P||typeof C!="object"||C===null)return!1;try{return typeof P(C)=="number"}catch{return!1}};function pr(ee,C,U){ee.length!==0&&xn(ee,Q=>{Q.call(t,C,U,ho)})}const L4=function(C,U){return!!(Cn&&C.hasChildNodes()&&!Jo(C.firstElementChild)&&mt(xb,C.textContent)&&mt(xb,C.innerHTML)||Cn&&C.namespaceURI===hr&&k6[U]&&(Jo(C.firstElementChild)||typeof C.textContent=="string"&&mt(A6[U],C.textContent))||C.nodeType===Dt.processingInstruction||Cn&&C.nodeType===Dt.comment&&mt(Sb,C.data))},Ua=function(C,U){if(C instanceof RegExp)return mt(C,U);if(C instanceof Function){for(var Q=arguments.length,se=new Array(Q>2?Q-2:0),de=2;de<Q;de++)se[de-2]=arguments[de];return!!C(U,...se)}return!1},M4=function(C,U,Q){if(!Ve[U]&&iy(U)&&Ua(he.tagNameCheck,U))return!1;if(Ul&&!uo[U]){const se=b(C),de=y(C);if(de&&se){const pe=de.length;for(let Te=pe-1;Te>=0;--Te){const ze=C===Q?p(de[Te],!0):de[Te];se.insertBefore(ze,g(C))}}}return Jr(C),!0},ny=function(C,U,Q,se){return C.length===0?U:U===Q||U===se?Ft(U):U},oy=function(C,U){return C===U||b(C)!==null?!1:(jl&&Da(C),!0)},sy=function(C,U){if(pr(z.beforeSanitizeElements,C,null),oy(C,U))return!0;if(za(C))return Jr(C),!0;const Q=Ze(N(C));if(ge=ny(z.uponSanitizeElement,ge,Tt,Oa),pr(z.uponSanitizeElement,C,{tagName:Q,allowedTags:ge}),oy(C,U))return!0;if(L4(C,Q))return Jr(C),!0;if(Ve[Q]||!(gt.tagCheck instanceof Function&>.tagCheck(Q))&&!ge[Q]){const de=M4(C,Q,U);return de===!1&&pr(z.afterSanitizeElements,C,null),de}if(O(C)===Dt.element&&!O4(C)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&mt(P6,C.innerHTML))return Jr(C),!0;if(Qr&&C.nodeType===Dt.text){const de=$a(C.textContent);C.textContent!==de&&(Wo(t.removed,{element:C.cloneNode()}),C.textContent=de)}return pr(z.afterSanitizeElements,C,null),!1},ay=function(C,U,Q){if(Jt[U]||ey(U,C)||jb&&(U==="id"||U==="name")&&(Q in r||Q in P4))return!1;const se=ke[U]||gt.attributeCheck instanceof Function&>.attributeCheck(U,C);return Yo&&mt(te,U)||Ko&&mt(ie,U)?!0:se?Zb[U]||mt(Se,Ro(Q,Ae,""))||(U==="src"||U==="xlink:href"||U==="href")&&C!=="script"&&pb(Q,"data:")===0&&Hb[C]||Yr&&!mt(Ne,Ro(Q,Ae,""))?!0:!Q:iy(C)&&Ua(he.tagNameCheck,C)&&Ua(he.attributeNameCheck,U,C)||U==="is"&&he.allowCustomizedBuiltInElements&&Ua(he.tagNameCheck,Q)},I4=Ce({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),iy=function(C){return!I4[Zo(C)]&&mt(_e,C)},F4=function(C,U,Q,se){if(k&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Q)switch(h.getAttributeType(C,U)){case"TrustedHTML":return H(se);case"TrustedScriptURL":return V(se)}return se},D4=function(C,U,Q,se){try{Q?C.setAttributeNS(Q,U,se):C.setAttribute(U,se),za(C)?Jr(C):fb(t.removed)}catch{En(U,C)}},cy=function(C){pr(z.beforeSanitizeAttributes,C,null);const U=C.attributes;if(!U||za(C))return;ke=ny(z.uponSanitizeAttribute,ke,zt,Ta);const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ke,forceKeepAttr:void 0};let se=U.length;const de=Ze(C.nodeName);for(;se--;){const pe=U[se],Te=pe.name,ze=pe.namespaceURI,Nt=pe.value,Lt=Ze(Te),Gl=Nt;let xt=Te==="value"?Gl:i6(Gl);if(Q.attrName=Lt,Q.attrValue=xt,Q.keepAttr=!0,Q.forceKeepAttr=void 0,pr(z.uponSanitizeAttribute,C,Q),xt=Q.attrValue,Bb&&(Lt==="id"||Lt==="name")&&pb(xt,Vb)!==0&&(En(Te,C,pe),xt=Vb+xt),Cn&&mt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,xt)){En(Te,C,pe);continue}if(Lt==="attributename"&&hb(xt,"href")){En(Te,C,pe);continue}if(!Q.forceKeepAttr){if(!Q.keepAttr){En(Te,C,pe);continue}if(!Ub&&mt(E6,xt)){En(Te,C,pe);continue}if(Qr&&(xt=$a(xt)),!ay(de,Lt,xt)){En(Te,C,pe);continue}xt=F4(de,Lt,ze,xt),xt!==Gl&&D4(C,Te,ze,xt)}}pr(z.afterSanitizeAttributes,C,null)},ja=function(C){let U=null;const Q=ry(C);for(pr(z.beforeSanitizeShadowDOM,C,null);U=Q.nextNode();)if(pr(z.uponSanitizeShadowNode,U,null),sy(U,C),cy(U),po(U.content)&&ja(U.content),O(U)===Dt.element){const se=w(U);po(se)&&(Rl(se),ja(se))}pr(z.afterSanitizeShadowDOM,C,null)},Rl=function(C){const U=[{node:C,shadow:null}];for(;U.length>0;){const Q=U.pop();if(Q.shadow){ja(Q.shadow);continue}const se=Q.node,pe=O(se)===Dt.element,Te=y(se);if(Te)for(let ze=Te.length-1;ze>=0;--ze)U.push({node:Te[ze],shadow:null});if(pe){const ze=E?E(se):null;if(typeof ze=="string"&&Ze(ze)==="template"){const Nt=se.content;po(Nt)&&U.push({node:Nt,shadow:null})}}if(pe){const ze=w(se);po(ze)&&U.push({node:null,shadow:ze},{node:ze,shadow:null})}}};return t.sanitize=function(ee){let C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},U=null,Q=null,se=null,de=null;if(Bl=!ee,Bl&&(ee="<!-->"),typeof ee!="string"&&!Jo(ee)&&(ee=f6(ee),typeof ee!="string"))throw Sn("dirty is not a string, aborting");if(!t.isSupported)return ee;$l?(ge=Oa,ke=Ta):Wl(C),(z.uponSanitizeElement.length>0||z.uponSanitizeAttribute.length>0)&&(ge=Ft(ge)),z.uponSanitizeAttribute.length>0&&(ke=Ft(ke)),t.removed=[];const pe=jl&&typeof ee!="string"&&Jo(ee);if(pe){N4(ee);const Nt=N(ee);if(typeof Nt=="string"){const Lt=Ze(Nt);if(!ge[Lt]||Ve[Lt])throw Fa(ee),Sn("root node is forbidden and cannot be sanitized in-place")}if(za(ee))throw Fa(ee),Sn("root node is clobbered and cannot be sanitized in-place");try{Rl(ee)}catch(Lt){throw Fa(ee),Lt}}else if(Jo(ee))U=ty("<!---->"),Q=U.ownerDocument.importNode(ee,!0),Q.nodeType===Dt.element&&Q.nodeName==="BODY"||Q.nodeName==="HTML"?U=Q:U.appendChild(Q),Rl(Q);else{if(!co&&!Qr&&!Pn&&ee.indexOf("<")===-1)return k&&La?H(ee):ee;if(U=ty(ee),!U)return co?null:La?I:""}U&&zl&&Jr(U.firstChild);const Te=pe?ee:U;try{const Nt=ry(Te);for(;se=Nt.nextNode();)sy(se,Te),cy(se),po(se.content)&&ja(se.content)}catch(Nt){throw pe&&(Fa(ee),xn(t.removed,Lt=>{Lt.element&&Da(Lt.element)})),Nt}if(pe)return xn(t.removed,Nt=>{Nt.element&&Da(Nt.element)}),Qr&&Zl(ee),ee;if(co){if(Qr&&Zl(U),Na)for(de=ne.call(U.ownerDocument);U.firstChild;)de.appendChild(U.firstChild);else de=U;return(ke.shadowroot||ke.shadowrootmode)&&(de=F.call(n,de,!0)),de}let ze=Pn?U.outerHTML:U.innerHTML;return Pn&&ge["!doctype"]&&U.ownerDocument&&U.ownerDocument.doctype&&U.ownerDocument.doctype.name&&mt(S6,U.ownerDocument.doctype.name)&&(ze="<!DOCTYPE "+U.ownerDocument.doctype.name+`>
|
|
237
|
+
`+ze),Qr&&(ze=$a(ze)),k&&La?H(ze):ze},t.setConfig=function(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wl(ee),$l=!0,Oa=ge,Ta=ke},t.clearConfig=function(){ho=null,$l=!1,Oa=null,Ta=null,k=j,I=""},t.isValidAttribute=function(ee,C,U){ho||Wl({});const Q=Ze(ee),se=Ze(C);return ay(Q,se,U)},t.addHook=function(ee,C){typeof C=="function"&&Ot(z,ee)&&Wo(z[ee],C)},t.removeHook=function(ee,C){if(Ot(z,ee)){if(C!==void 0){const U=s6(z[ee],C);return U===-1?void 0:a6(z[ee],U,1)[0]}return fb(z[ee])}},t.removeHooks=function(ee){Ot(z,ee)&&(z[ee]=[])},t.removeAllHooks=function(){z=Pb()},t}var N6=Eb();const L6=i.jsxs("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("path",{d:"M1.66675 8.00002C1.66675 5.1802 1.66675 3.77029 2.46539 2.83519C2.5788 2.70241 2.70247 2.57874 2.83525 2.46533C3.77035 1.66669 5.18026 1.66669 8.00008 1.66669C10.8199 1.66669 12.2298 1.66669 13.1649 2.46533C13.2977 2.57874 13.4213 2.70241 13.5347 2.83519C14.3334 3.77029 14.3334 5.1802 14.3334 8.00002C14.3334 10.8198 14.3334 12.2298 13.5347 13.1648C13.4213 13.2976 13.2977 13.4213 13.1649 13.5347C12.2298 14.3334 10.8199 14.3334 8.00008 14.3334C5.18026 14.3334 3.77035 14.3334 2.83525 13.5347C2.70247 13.4213 2.5788 13.2976 2.46539 13.1648C1.66675 12.2298 1.66675 10.8198 1.66675 8.00002Z",stroke:"currentColor",strokeLinejoin:"round"}),i.jsx("path",{d:"M7.69235 4.83562C7.83568 4.61038 8.16448 4.61038 8.30782 4.83562L8.72255 5.48724C9.18115 6.20782 9.79228 6.81896 10.5129 7.27756L11.1645 7.69229C11.3897 7.83562 11.3897 8.16442 11.1645 8.30776L10.5129 8.72249C9.79228 9.18109 9.18115 9.79222 8.72255 10.5128L8.30782 11.1644C8.16448 11.3897 7.83568 11.3897 7.69235 11.1644L7.27762 10.5128C6.81902 9.79222 6.20788 9.18109 5.4873 8.72249L4.83568 8.30776C4.61044 8.16442 4.61044 7.83562 4.83568 7.69229L5.4873 7.27756C6.20788 6.81896 6.81902 6.20782 7.27762 5.48724L7.69235 4.83562Z",stroke:"currentColor",strokeLinejoin:"round"})]}),M6=/^[\u{1F300}-\u{1F9FF}\u{1F600}-\u{1F64F}\u{1F680}-\u{1F6FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}\u{1F900}-\u{1F9FF}\u{1F1E0}-\u{1F1FF}]|[\u{1F300}-\u{1F5FF}\u{1F600}-\u{1F64F}\u{1F680}-\u{1F6FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/u,ka=({item:e})=>e.icon?e.icon.includes("<svg")?i.jsx("span",{className:"navbar-icon",dangerouslySetInnerHTML:{__html:N6.sanitize(e.icon)}}):M6.test(e.icon)||e.icon.length<=4?i.jsx("span",{className:"navbar-icon navbar-icon-emoji",children:e.icon}):i.jsx("span",{className:"navbar-icon",children:i.jsx("img",{src:e.icon,alt:e.name,width:"16",height:"16"})}):i.jsx("span",{className:"navbar-icon",children:L6});function kb(e,t){const r=[],n=new Set;for(const o of e){const s=o.url||o.uri;if(s&&!n.has(s)&&(n.add(s),r.push({name:o.name||o.label,url:s,icon:o.icon,parentName:t})),o.children?.length){const a=kb(o.children,o.name);for(const c of a)n.has(c.url)||(n.add(c.url),r.push(c))}}return r}const Ab=()=>{const[e,t]=v.useState(!1),[r,n]=v.useState(""),[o,s]=v.useState(0),a=v.useRef(null),c=v.useRef(null),{menu:l}=$e(),{navigateTo:u}=kl(),d=qe(),h=v.useMemo(()=>kb(l||[]),[l]),f=v.useMemo(()=>{if(!r.trim())return h;const g=r.toLowerCase();return h.filter(y=>y.name.toLowerCase().includes(g)||y.parentName?.toLowerCase().includes(g))},[h,r]);v.useEffect(()=>{s(0)},[r]),v.useEffect(()=>{e&&(n(""),s(0),requestAnimationFrame(()=>{a.current?.focus()}))},[e]),v.useEffect(()=>{const g=y=>{(y.metaKey||y.ctrlKey)&&y.key==="k"&&(y.preventDefault(),t(b=>!b))};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[]),v.useEffect(()=>{if(!c.current)return;const g=c.current.querySelector('[data-selected="true"]');g&&g.scrollIntoView({block:"nearest"})},[o]);const p=v.useCallback(g=>{t(!1),u(g.url)},[u]),m=g=>{switch(g.key){case"ArrowDown":g.preventDefault(),s(y=>y<f.length-1?y+1:y);break;case"ArrowUp":g.preventDefault(),s(y=>y>0?y-1:y);break;case"Enter":g.preventDefault(),f[o]&&p(f[o]);break}};return i.jsx(Ni,{open:e,onOpenChange:t,children:i.jsxs(Li,{children:[i.jsx(Ii,{className:"fixed inset-0 z-50 bg-black/50"}),i.jsxs(Fi,{className:d?"fixed inset-0 z-50 flex flex-col bg-white outline-none [padding-top:env(safe-area-inset-top)] [padding-bottom:env(safe-area-inset-bottom)]":"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-50 w-full max-w-md bg-white rounded-xl shadow-2xl overflow-hidden outline-none",children:[i.jsx(Di,{className:"sr-only",children:"Search pages"}),i.jsxs("div",{role:"search",className:d?"flex items-center px-4 py-3 border-b border-border sticky top-0 bg-white z-[1]":"flex items-center px-4 py-3 border-b border-border",onKeyDown:m,children:[i.jsx(F3,{className:"w-4 h-4 text-muted-foreground mr-3 flex-shrink-0"}),i.jsx("input",{ref:a,type:"text",placeholder:"Search pages...",value:r,onChange:g=>n(g.target.value),"aria-label":"Search pages",className:"flex-1 bg-transparent text-sm outline-none border-none text-foreground"}),i.jsx("kbd",{className:"pointer-events-none ml-2 inline-flex h-5 items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground select-none",children:"ESC"})]}),i.jsx("div",{ref:c,className:d?"flex-1 overflow-y-auto p-1":"max-h-[300px] overflow-y-auto p-1",role:"listbox",children:f.length===0?i.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No results found"}):f.map((g,y)=>{const b=y===o;return i.jsxs("button",{type:"button",role:"option","aria-selected":b,"data-selected":b,className:`flex items-center gap-3 px-3 py-2 rounded-md w-full text-left text-sm border-none cursor-pointer transition-colors ${b?"bg-accent text-primary":"bg-transparent text-foreground"}`,onClick:()=>p(g),onMouseEnter:()=>s(y),children:[i.jsx("span",{className:`flex-shrink-0 ${b?"text-primary":"text-muted-foreground"}`,children:i.jsx(ka,{item:g})}),i.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:g.name}),g.parentName&&i.jsxs("span",{className:"text-muted-foreground ml-auto text-xs flex-shrink-0",children:["in ",g.parentName]})]},g.url)})})]})]})})},I6={showTopbar:!0,showNavbar:!0,layoutType:"wide",showCommandPalette:!0},F6={showProfile:!0,showLeftSection:!0,showRightSection:!0,showBreadcrumbs:!1,customLeftContent:void 0,customRightContent:void 0,customProfileMenu:void 0,customTopbar:void 0,customViewProfile:void 0,theme:"light",profileMenuConfig:{showViewProfile:!0,showLogout:!0,showRoleSwitch:!0,customMenuItems:[]},className:"",style:{}},D6={showLogo:!0,showMenu:!0,isCollapsed:!1,collapsible:!1,customLogo:void 0,customMenuContent:void 0,customBottomContent:void 0,customNavbar:void 0,customMenu:void 0,theme:"light",menuConfig:{showIcons:!0,showSubmenus:!0,expandOnHover:!1,customMenuItemRenderer:void 0},className:"",style:{}};function Aa(e={},t={}){const r={...t},n=e;return Object.keys(n).forEach(o=>{if(n[o]===void 0||n[o]===null)return;const s=n[o];s&&(s.$$typeof||typeof s=="function")||typeof n[o]=="function"||Array.isArray(n[o])?r[o]=n[o]:typeof n[o]=="object"&&typeof r[o]=="object"&&!Array.isArray(r[o])?r[o]=Aa(n[o],r[o]):r[o]=n[o]}),r}const $6=({appLogo:e,appName:t,linkTo:r="/app",collapsed:n=!1})=>{if(n){const o=t?t.charAt(0).toUpperCase():"A";return i.jsx("div",{className:"navbar-logo-container frame-logo-container",children:i.jsx(_n,{to:r,className:"no-underline",children:i.jsx("div",{className:"collapsed-logo-initial w-8 h-8 text-white rounded-lg flex items-center justify-center text-base font-bold bg-primary",children:o})})})}return i.jsx("div",{className:"navbar-logo-container frame-logo-container",children:i.jsx(sb,{logoUrl:e,appName:t,height:"28px",linkTo:r})})};function z6(e,t){const r=e.url??e.uri;if(!r)return!1;const n=r.endsWith("/")?r:`${r}/`,o=t.endsWith("/")?t:`${t}/`;return o.startsWith(n)?!0:e.children?.length?e.children.some(s=>{const a=s.url??s.uri;if(!a)return!1;const c=a.endsWith("/")?a:`${a}/`;return o.startsWith(c)}):!1}const U6=({item:e,isActive:t,location:r,isDark:n})=>{const[o,s]=v.useState(t),{state:a}=wn(),c=a==="collapsed";return v.useEffect(()=>{c&&s(!1)},[c]),c?i.jsx(hl,{className:ye("menu-list-item menu-list-item-with-sub-menu",t&&"active"),children:i.jsxs(oT,{children:[i.jsx(sT,{asChild:!0,children:i.jsx(pl,{isActive:t,tooltip:e.name??e.label,className:"menu-item",children:i.jsx(ka,{item:e})})}),i.jsxs(aT,{side:"right",align:"start",className:ye("min-w-[180px]",n&&"sidebar-dropdown-dark"),children:[i.jsx(cT,{children:e.name??e.label}),i.jsx(lT,{}),(e.children??[]).map(l=>{const u=l.url??l.uri??"#",d=r.pathname===u||r.pathname===`${u}/`;return i.jsx(iT,{asChild:!0,children:i.jsx(_n,{to:u,className:d?"font-semibold":"",children:l.name??l.label})},u)})]})]})}):i.jsx(tT,{open:o,onOpenChange:s,className:"group/collapsible",children:i.jsxs(hl,{className:ye("menu-list-item menu-list-item-with-sub-menu",t&&"active"),children:[i.jsx(rT,{asChild:!0,children:i.jsxs(pl,{isActive:t,tooltip:e.name??e.label,className:"menu-item",children:[i.jsx(ka,{item:e}),i.jsx("span",{className:"menu-title",children:e.name??e.label}),i.jsx("div",{className:ye("ml-auto transition-transform duration-200",o&&"rotate-180"),children:i.jsx(O3,{className:"h-4 w-4"})})]})}),o&&i.jsx(nT,{forceMount:!0,children:i.jsx("div",{className:"overflow-hidden animate-in fade-in slide-in-from-top-1 duration-200",children:i.jsx($T,{className:"submenu-list",children:(e.children??[]).map(l=>{const u=l.url??l.uri??"#",d=r.pathname===u||r.pathname===`${u}/`;return i.jsx(zT,{className:ye("submenu-list-item",d&&"active"),children:i.jsx(UT,{asChild:!0,isActive:d,children:i.jsxs(_n,{to:u,children:[i.jsx("span",{className:"submenu-arrow-slot",children:d&&i.jsx("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10",viewBox:"0 0 14 10",fill:"none",children:i.jsx("path",{d:"M13.3538 6.85375L10.3538 9.85375C10.2599 9.94757 10.1327 10.0003 10 10.0003C9.86732 10.0003 9.74007 9.94757 9.64625 9.85375C9.55243 9.75993 9.49972 9.63268 9.49972 9.5C9.49972 9.36732 9.55243 9.24007 9.64625 9.14625L11.7931 7H7C5.27665 6.99818 3.62441 6.31278 2.40582 5.09418C1.18722 3.87559 0.50182 2.22335 0.5 0.5C0.5 0.367392 0.552678 0.240215 0.646447 0.146447C0.740215 0.0526785 0.867392 0 1 0C1.13261 0 1.25979 0.0526785 1.35355 0.146447C1.44732 0.240215 1.5 0.367392 1.5 0.5C1.50165 1.95818 2.08165 3.35617 3.11274 4.38726C4.14383 5.41835 5.54182 5.99835 7 6H11.7931L9.64625 3.85375C9.55243 3.75993 9.49972 3.63268 9.49972 3.5C9.49972 3.36732 9.55243 3.24007 9.64625 3.14625C9.74007 3.05243 9.86732 2.99972 10 2.99972C10.1327 2.99972 10.2599 3.05243 10.3538 3.14625L13.3538 6.14625C13.4002 6.19269 13.4371 6.24783 13.4623 6.30853C13.4874 6.36923 13.5004 6.43429 13.5004 6.5C13.5004 6.56571 13.4874 6.63077 13.4623 6.69147C13.4371 6.75217 13.4002 6.80731 13.3538 6.85375Z",fill:"var(--color-brand-500, #5048ED)"})})}),i.jsx("span",{children:l.name??l.label})]})})},u)})})})})]})})};function j6(e){if(e.type==="section")return!0;const t=!!e.children,r=!!e.icon,n=!!(e.url||e.uri),o=!!e.route_id;return t&&!r&&!n&&!o}function B6(e){const t=[];let r=[];for(const n of e)j6(n)?(r.length&&(t.push({kind:"items",items:r}),r=[]),t.push({kind:"section",section:n})):r.push(n);return r.length&&t.push({kind:"items",items:r}),t}const V6=({menuItems:e=[],isDark:t=!1})=>{const r=ue.useLocation(),n=s=>{const a=s.url||s.uri,c=z6(s,r.pathname);return s.children&&s.children.length>0?i.jsx(U6,{item:s,isActive:c,location:r,isDark:t},s.name??s.id):i.jsx(hl,{className:ye("menu-list-item",c&&"active"),children:i.jsx(pl,{asChild:!0,isActive:c,tooltip:s.name??s.label,className:"menu-item",children:i.jsxs(_n,{to:a??"#",children:[i.jsx(ka,{item:s}),i.jsx("span",{className:"menu-title",children:s.name??s.label})]})})},s.name??s.id)},o=B6(e);return i.jsx(i.Fragment,{children:o.map((s,a)=>s.kind==="section"?i.jsxs(dl,{className:"sidebar-section",children:[i.jsx(FT,{className:"sidebar-section-label font-bold",children:s.section.name??s.section.label}),i.jsx(fl,{children:i.jsx(Mg,{className:"navbar-menu",children:(s.section.children??[]).map(n)})})]},s.section.name??s.section.id):i.jsx(dl,{className:"sidebar-section sidebar-section-unlabeled",children:i.jsx(fl,{children:i.jsx(Mg,{id:"wideSidebarMenu",className:"navbar-menu",children:s.items.map(n)})})},`items-${a}`))})},q6={"--sidebar":"var(--color-brand-500, #5048ED)","--sidebar-foreground":"rgba(255, 255, 255, 0.7)","--sidebar-accent":"var(--color-brand-800, rgba(255, 255, 255, 0.1))","--sidebar-accent-foreground":"#FFFFFF","--sidebar-border":"var(--color-brand-500, #5048ED)","--sidebar-primary":"#FFFFFF","--sidebar-primary-foreground":"var(--color-brand-500, #5048ED)"},Ob=({menuItems:e=[],appLogo:t,config:r={}})=>{const{appName:n}=$e(),{state:o,isMobile:s}=wn(),a=o==="collapsed",{showLogo:c=!0,showMenu:l=!0,collapsible:u=!1,customLogo:d=null,customMenuContent:h=null,customBottomContent:f=null,customNavbar:p=null,customMenu:m=null,theme:g="light",className:y="",style:b={}}=r,w=g==="dark";if(p)return i.jsx(i.Fragment,{children:p});const _=w?q6:{};return i.jsxs(OT,{collapsible:s?"offcanvas":u?"icon":"none",className:ye("navbar",!a&&"wide-sidebar",a&&"collapsed-sidebar",w&&"sidebar-theme-dark",y),style:{..._,...b},children:[i.jsxs(LT,{children:[c&&(d?i.jsx("div",{className:"navbar-logo-container frame-logo-container",children:d}):i.jsx($6,{appLogo:t,appName:n,collapsed:a})),u&&i.jsx("div",{className:a?"flex justify-center py-1":"flex justify-end px-3 pb-1",children:i.jsx(Lg,{className:"navbar-toggle-btn"})})]}),i.jsxs(IT,{className:"navbar-menu-container",children:[l&&(m||i.jsx(V6,{menuItems:e,isDark:w})),h&&i.jsx(dl,{children:i.jsx(fl,{children:h})})]}),f&&i.jsx(MT,{className:"navbar-bottom-content",children:f}),u&&i.jsx(TT,{})]})},Tb=v.lazy(()=>Promise.resolve().then(function(){return u4}).then(e=>({default:e.UserProfileDrawer}))),H6=({onLogout:e,className:t=""})=>i.jsxs("button",{type:"button",className:`dropdown-item profile-logout ${t}`,onClick:e,children:[i.jsxs("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("path",{d:"M10 11.75C9.95093 12.9846 8.92207 14.0329 7.54373 13.9992C7.22307 13.9913 6.82673 13.8796 6.03408 13.656C4.12641 13.1179 2.47037 12.2135 2.07304 10.1877C2 9.81533 2 9.39627 2 8.5582V7.4418C2 6.60374 2 6.1847 2.07304 5.81231C2.47037 3.78643 4.12641 2.8821 6.03408 2.34402C6.82673 2.12042 7.22307 2.00863 7.54373 2.00079C8.92207 1.96707 9.95093 3.01538 10 4.25",stroke:"#717680",strokeLinecap:"round"}),i.jsx("path",{d:"M14 7.99998H6.66663M14 7.99998C14 7.53318 12.6704 6.661 12.3333 6.33331M14 7.99998C14 8.46678 12.6704 9.33898 12.3333 9.66665",stroke:"#717680",strokeLinecap:"round",strokeLinejoin:"round"})]}),i.jsx("span",{className:"profile-name",children:"Log Out"})]}),W6=({onViewProfile:e,className:t=""})=>i.jsxs("button",{type:"button",className:`dropdown-item profile-view ${t}`,onClick:e,children:[i.jsxs("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("path",{d:"M8.00004 7.33329C9.47281 7.33329 10.6667 6.13948 10.6667 4.66663C10.6667 3.19377 9.47281 1.99996 8.00004 1.99996C6.52719 1.99996 5.33337 3.19377 5.33337 4.66663C5.33337 6.13948 6.52719 7.33329 8.00004 7.33329Z",stroke:"#717680",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M4.00004 14V12.6666C4.00004 11.9594 4.28099 11.2811 4.78109 10.781C5.28119 10.2809 5.95947 9.99996 6.66671 9.99996H9.33337C10.0406 9.99996 10.7189 10.2809 11.219 10.781C11.7191 11.2811 12 11.9594 12 12.6666V14",stroke:"#717680",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})]}),i.jsx("span",{className:"profile-name",children:"View Profile"})]}),Nb=({profileInfo:e,theme:t={},config:r={},hidden:n=!1})=>{const[o,s]=v.useState(!1),[a,c]=v.useState(!1),[l,u]=v.useState(!1),d=v.useRef(!1),h=()=>{a?(d.current=!0,u(!0)):c(!0)},f=()=>{d.current=!1,u(!1)};v.useEffect(()=>{if(!a)return;let T=0,F=0;const z=()=>{d.current||(d.current=!0,u(!0))};T=requestAnimationFrame(()=>{F=requestAnimationFrame(z)});const B=setTimeout(z,50);return()=>{cancelAnimationFrame(T),cancelAnimationFrame(F),clearTimeout(B)}},[a]);const p=v.useRef(null),m=qe(),{appLogo:g,appName:y}=$e();v.useEffect(()=>{const T=F=>{p.current&&!p.current.contains(F.target)&&s(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);const b=()=>{s(!o)},w=()=>{Cl(()=>{Ca({theme:t})})},_=e?.current_role||e?.user_role,{showProfile:P=!0,showLeftSection:E=!0,showRightSection:S=!0,showBreadcrumbs:O=!1,customLeftContent:N=null,customRightContent:k=null,customProfileMenu:I=null,customViewProfile:j=null,theme:q="light",profileMenuConfig:M={},className:$="",style:H={}}=r,V=q==="dark",{showViewProfile:R=!0,showLogout:K=!0,showRoleSwitch:Y=!0,customMenuItems:D=[]}=M,ne=()=>{h(),s(!1)};return!n&&m?i.jsxs(i.Fragment,{children:[i.jsx("header",{className:`topbar topbar-mobile header-container ${V?"topbar-theme-dark":""} ${$}`,style:H,children:i.jsxs("div",{className:"topbar-mobile-content",children:[i.jsx(Lg,{className:"topbar-mobile-trigger","aria-label":"Open menu"}),i.jsx("div",{className:"topbar-mobile-logo",children:g?i.jsx("img",{src:g,alt:y||"Logo"}):i.jsx("span",{className:"topbar-mobile-logo-text",children:y||"App"})}),P&&i.jsx("button",{type:"button",className:"topbar-mobile-avatar-button",onClick:h,"aria-label":"Open profile",children:i.jsx("img",{src:e?.profile_pic||`https://ui-avatars.com/api/?name=${encodeURIComponent(e?.name||"User")}&background=${Hc("brand",500).split("#")[1]}&color=fff`,alt:"Profile",className:"profile-avatar"})})]})}),j?j({user:e,isOpen:l,onClose:f}):a?i.jsx(v.Suspense,{fallback:null,children:i.jsx(Tb,{isOpen:l,onClose:f})}):null]}):i.jsxs(i.Fragment,{children:[!n&&i.jsx("header",{className:`topbar header-container h-14 w-full bg-white justify-end border-b border-border items-center px-5 flex relative ${V?"topbar-theme-dark":""} ${$}`,style:H,children:i.jsxs("div",{className:"topbar-content w-full flex justify-between items-center",children:[E&&i.jsx("div",{className:"topbar-left flex items-center gap-4",children:N||O&&i.jsx(ib,{})||null}),S&&i.jsxs("div",{className:"topbar-right flex items-center gap-4",children:[k,P&&i.jsxs("div",{className:"dropdown profile-dropdown-container",ref:p,children:[i.jsxs("button",{type:"button",className:"profile-dropdown-menu-button",onClick:b,children:[i.jsxs("div",{className:"profile-info-wrapper",children:[i.jsx("img",{src:e?.profile_pic||`https://ui-avatars.com/api/?name=${encodeURIComponent(e?.name||"User")}&background=${Hc("brand",500).split("#")[1]}&color=fff`,alt:"Profile",className:"profile-avatar"}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"profile-name",children:e?.name||"User"}),i.jsx("span",{className:`text-xs ${V?"text-white/70":"text-muted-foreground"}`,children:_})]})]}),i.jsx("svg",{"aria-hidden":"true",className:`dropdown-arrow ${o?"open":""}`,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M13.3538 6.35354L8.35378 11.3535C8.30735 11.4 8.2522 11.4369 8.1915 11.4621C8.13081 11.4872 8.06574 11.5002 8.00003 11.5002C7.93433 11.5002 7.86926 11.4872 7.80856 11.4621C7.74786 11.4369 7.69272 11.4 7.64628 11.3535L2.64628 6.35354C2.55246 6.25972 2.49976 6.13247 2.49976 5.99979C2.49976 5.86711 2.55246 5.73986 2.64628 5.64604C2.7401 5.55222 2.86735 5.49951 3.00003 5.49951C3.13272 5.49951 3.25996 5.55222 3.35378 5.64604L8.00003 10.2929L12.6463 5.64604C12.6927 5.59958 12.7479 5.56273 12.8086 5.53759C12.8693 5.51245 12.9343 5.49951 13 5.49951C13.0657 5.49951 13.1308 5.51245 13.1915 5.53759C13.2522 5.56273 13.3073 5.59958 13.3538 5.64604C13.4002 5.69249 13.4371 5.74764 13.4622 5.80834C13.4874 5.86904 13.5003 5.93409 13.5003 5.99979C13.5003 6.06549 13.4874 6.13054 13.4622 6.19124C13.4371 6.25193 13.4002 6.30708 13.3538 6.35354Z",fill:V?"#FFFFFF":"#414651"})})]}),i.jsxs("ul",{className:`profile-dropdown-menu ${o?"show":""}`,children:[i.jsx("li",{children:i.jsx("hr",{className:"profile-dropdown-divider"})}),D.map((T,F)=>i.jsx("li",{children:T},F)),R&&i.jsx("li",{children:i.jsx(W6,{onViewProfile:ne})}),K&&i.jsx("li",{children:i.jsx(H6,{onLogout:w})})]})]})]})]})}),j?j({user:e,isOpen:l,onClose:f}):a?i.jsx(v.Suspense,{fallback:null,children:i.jsx(Tb,{isOpen:l,onClose:f})}):null]})},Z6="244px",R6="56px",G6=()=>{const{setOpenMobile:e,isMobile:t}=wn(),r=ue.useLocation();return v.useEffect(()=>{t&&e(!1)},[r.pathname,t,e]),null},Lb=()=>{const{loading:e,error:t,menu:r,profileInfo:n,appLogo:o,theme:s={},layoutConfig:a={},topbarConfig:c={},navbarConfig:l={},customComponents:u={}}=$e(),d=ue.useLocation(),h=Aa(a,I6),f=Aa(c,F6),p=Aa(l,D6),[m,g]=v.useState(!p.isCollapsed),y=v.useCallback(j=>{g(j),p.onCollapseChange?.(!j)},[p.onCollapseChange]),b=v.useCallback(()=>{const j=document.getElementById("contentSpinner");j&&j.classList.add("active")},[]),w=v.useCallback(()=>{const j=document.getElementById("contentSpinner");j&&j.classList.remove("active")},[]);if(v.useEffect(()=>{b();const j=300,q=500,M=Date.now(),$=setTimeout(()=>{const H=Date.now()-M;H>=j?w():setTimeout(w,j-H)},q);return()=>{clearTimeout($)}},[d.pathname,w,b]),v.useEffect(()=>(window.addEventListener("beforeunload",b),()=>{window.removeEventListener("beforeunload",b)}),[b]),e)return i.jsx("div",{className:"layout-loading flex items-center justify-center h-dvh text-lg text-muted-foreground",children:"Loading..."});if(t)return i.jsxs("div",{className:"layout-error flex items-center justify-center h-dvh text-lg text-destructive",children:["Error: ",t]});const _=s,P=h.layoutType||_?.layout||"wide",E=_?.menu_config,S=h.showNavbar&&E?.display_sidebar!==!1,O=h.showTopbar,N=u?.Layout,k=u?.Topbar||f.customTopbar,I=u?.Navbar||p.customNavbar;return N?i.jsx(N,{menu:r,profileInfo:n,appLogo:o,theme:s,layoutConfig:h,topbarConfig:f,navbarConfig:p,children:i.jsx(ue.Outlet,{})}):i.jsxs(AT,{defaultOpen:!p.isCollapsed,open:m,onOpenChange:y,className:`layout layout-${P} h-dvh min-h-dvh overflow-hidden bg-[var(--color-background,#ffffff)]`,style:{"--sidebar-width":Z6,"--sidebar-width-icon":R6},children:[S?I?i.jsx(I,{menuItems:r,appLogo:o,theme:s,config:p}):i.jsx(Ob,{menuItems:r,appLogo:o,theme:s,config:p}):null,i.jsx(G6,{}),i.jsxs(NT,{children:[k?i.jsx(k,{profileInfo:n,theme:s,config:f,hidden:!O}):i.jsx(Nb,{profileInfo:n,theme:s,config:f,hidden:!O}),i.jsxs("main",{className:"layout-content flex-1 overflow-y-auto bg-[var(--color-background,#ffffff)] relative",children:[i.jsx("div",{className:"content-spinner-container",id:"contentSpinner",children:i.jsx("div",{className:"spinner",children:i.jsxs("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",children:[i.jsx("path",{d:"M32 5.33331V16",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M43.2002 20.7999L50.9335 13.0665",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M48 32H58.6667",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M43.2002 43.2L50.9335 50.9333",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M32 48V58.6667",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M13.0664 50.9333L20.7997 43.2",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M5.33301 32H15.9997",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M13.0664 13.0665L20.7997 20.7999",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"5.33333",strokeLinecap:"round",strokeLinejoin:"round"})]})})}),i.jsx(ue.Outlet,{})]}),h.showCommandPalette?i.jsx(Ab,{}):null]})]})},K6=Object.freeze({__proto__:null,Layout:Lb}),Y6=({enabled:e=!0}={})=>os({queryKey:["profile"],queryFn:async()=>{const t=await Vp();if(!t.success)throw new Error(t.response?.message||"Failed to fetch profile data");const r=t.response,n=r.profile_data||r;r.password_policy&&!n.password_policy&&(n.password_policy=r.password_policy);const o=f3.safeParse(n);o.success||J.warn("[useProfileQuery] Profile response validation failed",{errors:o.error.issues});const s=o.success?o.data:n,a=r.should_set_password||!1;return{profileData:s,shouldSetPassword:a}},enabled:e,staleTime:300*1e3,refetchOnWindowFocus:!0,retry:!1}),Q6=(e=!0)=>{const t=Y6({enabled:e});return{profileData:t.data?.profileData??null,loading:t.isLoading,error:t.error?.message??null,refetch:()=>{t.refetch()},shouldSetPassword:t.data?.shouldSetPassword??!1}},Mb={success:A.toast.success,error:A.toast.error},J6=v.memo(function({canSetPassword:t,shouldSetPassword:r,passwordPolicy:n,lastPasswordChange:o,nextPasswordDue:s,onServerMessage:a,onPasswordUpdated:c}){const[l,u]=v.useState(!1),[d,h]=v.useState(!1),[f,p]=v.useState({currentPassword:"",newPassword:"",confirmPassword:""}),[m,g]=v.useState({}),[y,b]=v.useState({minLength:!1,hasUpperCase:!1,hasLowerCase:!1,hasNumber:!1,hasSpecialChar:!1});v.useEffect(()=>{const{newPassword:S}=f;b(n?{minLength:S.length>=(n.min_length||8),hasUpperCase:n.require_uppercase?/[A-Z]/.test(S):!0,hasLowerCase:n.require_lowercase?/[a-z]/.test(S):!0,hasNumber:n.require_numbers?/[0-9]/.test(S):!0,hasSpecialChar:n.require_special_chars?/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(S):!0}:{minLength:S.length>=8,hasUpperCase:/[A-Z]/.test(S),hasLowerCase:/[a-z]/.test(S),hasNumber:/[0-9]/.test(S),hasSpecialChar:/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(S)})},[f.newPassword,n,f]);const w=S=>{const{name:O,value:N}=S.target;p(k=>({...k,[O]:N})),g(k=>({...k,[O]:""}))},_=()=>{const S={};return!r&&!f.currentPassword&&(S.currentPassword="Current password is required"),f.newPassword?Object.values(y).some(O=>!O)&&(S.newPassword="Password must meet all requirements"):S.newPassword=r?"Password is required":"New password is required",f.newPassword!==f.confirmPassword&&(S.confirmPassword="Passwords do not match"),S},P=async S=>{S.preventDefault();const O=_();if(Object.keys(O).length>0){g(O);return}h(!0),a("");try{const N={old_password:r?"":f.currentPassword,new_password:f.newPassword,confirm_password:f.confirmPassword},k=await Hp(N);if(k.success)Mb.success({title:r?"Password Set":"Password Updated",description:`Password ${r?"set":"updated"} successfully`,duration:3e3}),u(!1),p({currentPassword:"",newPassword:"",confirmPassword:""}),c();else{const j=k.response?.message||`Failed to ${r?"set":"update"} password`;a(j),Mb.error({title:`${r?"Set":"Update"} Failed`,description:j,duration:5e3})}}catch{a(`Failed to ${r?"set":"update"} password`)}finally{h(!1)}};if(!t)return null;const E=i.jsx("svg",{"aria-hidden":"true",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M6 11.375C3.0315 11.375 0.625 8.9685 0.625 6C0.625 3.0315 3.0315 0.625 6 0.625C8.9685 0.625 11.375 3.0315 11.375 6C11.375 8.9685 8.9685 11.375 6 11.375ZM1.375 6C1.375 8.5545 3.4455 10.625 6 10.625C8.5545 10.625 10.625 8.5545 10.625 6C10.625 3.4455 8.5545 1.375 6 1.375C3.4455 1.375 1.375 3.4455 1.375 6ZM8.2765 4.7535L5.5265 7.7535C5.4575 7.829 5.3605 7.8725 5.258 7.875C5.156 7.877 5.057 7.8375 4.985 7.765L3.735 6.515C3.5885 6.3685 3.5885 6.1315 3.735 5.985C3.8815 5.8385 4.1185 5.8385 4.265 5.985L5.238 6.958L7.7235 4.2465C7.8635 4.094 8.1005 4.0835 8.2535 4.2235C8.406 4.3635 8.4165 4.6005 8.2765 4.7535Z",fill:"currentColor"})});return i.jsxs("section",{className:"profile-card security-block",children:[i.jsxs("div",{className:"security-header",children:[i.jsxs("div",{children:[i.jsxs("h4",{className:"security-title",children:["Password",n&&!n.allow_change&&i.jsx("span",{className:"password-disabled-badge",children:"Disabled"})]}),!r&&i.jsxs("p",{className:"security-subtitle",children:["Last changed: ",o,s&&i.jsxs(i.Fragment,{children:[" "," • ",i.jsxs("span",{className:s==="Expired"?"password-expired":"",children:["Next due: ",s]})]})]}),r&&i.jsx("p",{className:"security-subtitle",children:"Set your password to secure your account"})]}),!l&&n?.allow_change!==!1&&i.jsx("button",{type:"button",className:"profile-field-edit-btn",onClick:()=>{u(!0),p({currentPassword:"",newPassword:"",confirmPassword:""}),g({})},children:r?"Set Password":"Change Password"})]}),l&&i.jsxs("form",{onSubmit:P,className:"password-form",children:[!r&&i.jsxs("div",{className:"profile-form-group",children:[i.jsx("label",{htmlFor:"currentPassword",className:"profile-form-label",children:"Current Password"}),i.jsx("input",{id:"currentPassword",type:"password",name:"currentPassword",className:"profile-form-input",value:f.currentPassword,onChange:w,placeholder:"Enter current password",autoComplete:"new-password"}),m.currentPassword&&i.jsx("div",{className:"profile-form-error",children:m.currentPassword})]}),i.jsxs("div",{className:"profile-form-group",children:[i.jsx("label",{htmlFor:"newPassword",className:"profile-form-label",children:r?"Password":"New Password"}),i.jsx("input",{id:"newPassword",type:"password",name:"newPassword",className:"profile-form-input",value:f.newPassword,onChange:w,placeholder:r?"Enter password":"Enter new password",autoComplete:"new-password"}),m.newPassword&&i.jsx("div",{className:"profile-form-error",children:m.newPassword})]}),i.jsx("div",{className:"password-requirements",children:n&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:`password-requirement ${y.minLength?"met":""}`,children:[E,i.jsxs("span",{children:["Minimum ",n.min_length," characters"]})]}),n.require_uppercase&&i.jsxs("div",{className:`password-requirement ${y.hasUpperCase?"met":""}`,children:[E,i.jsx("span",{children:"One uppercase character"})]}),n.require_lowercase&&i.jsxs("div",{className:`password-requirement ${y.hasLowerCase?"met":""}`,children:[E,i.jsx("span",{children:"One lowercase character"})]}),n.require_numbers&&i.jsxs("div",{className:`password-requirement ${y.hasNumber?"met":""}`,children:[E,i.jsx("span",{children:"One number"})]}),n.require_special_chars&&i.jsxs("div",{className:`password-requirement ${y.hasSpecialChar?"met":""}`,children:[E,i.jsx("span",{children:"One special character"})]})]})}),i.jsxs("div",{className:"profile-form-group",children:[i.jsx("label",{htmlFor:"confirmPassword",className:"profile-form-label",children:"Confirm Password"}),i.jsx("input",{id:"confirmPassword",type:"password",name:"confirmPassword",className:"profile-form-input",value:f.confirmPassword,onChange:w,placeholder:r?"Confirm password":"Confirm new password",autoComplete:"new-password"}),m.confirmPassword&&i.jsx("div",{className:"profile-form-error",children:m.confirmPassword})]}),i.jsxs("div",{className:"profile-form-actions",children:[i.jsx("button",{type:"button",className:"profile-cancel-btn",onClick:()=>{u(!1),g({}),p({currentPassword:"",newPassword:"",confirmPassword:""})},children:"Cancel"}),i.jsx("button",{type:"submit",className:"profile-submit-btn",disabled:d,children:d?r?"Setting...":"Updating...":r?"Set Password":"Update Password"})]})]})]})}),X6=v.memo(function({name:t,email:r,mobile:n,originalName:o,isMobile:s,onNameSaved:a,onServerMessage:c}){const[l,u]=v.useState(!1),[d,h]=v.useState(t),[f,p]=v.useState(!1),[m,g]=v.useState(""),y=async b=>{if(b.preventDefault(),!d.trim()){g("Name is required");return}p(!0),c("");try{const w=new FormData;w.append("name",d);const _=await sa(w);if(_.success)A.toast.success({title:"Profile Updated",description:"Name updated successfully",duration:3e3}),u(!1),a(d);else{const P=_.response;c(P?.message||"Failed to update name")}}catch{c("Failed to update profile")}finally{p(!1)}};return i.jsxs("section",{className:"profile-card",children:[i.jsxs("div",{className:"profile-card-header",children:[i.jsx("div",{className:"profile-card-title-group",children:i.jsx("h3",{className:"profile-card-title",children:"Personal Information"})}),!l&&i.jsx("button",{type:"button",className:"profile-field-edit-btn",onClick:()=>u(!0),children:"Edit"})]}),!t&&!r&&!n&&i.jsxs("div",{className:"welcome-banner",children:[i.jsxs("svg",{"aria-hidden":"true",width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("circle",{cx:"24",cy:"24",r:"24",fill:"rgba(80, 72, 237, 0.1)"}),i.jsx("path",{d:"M24 16V20M24 28H24.01M34 24C34 29.5228 29.5228 34 24 34C18.4772 34 14 29.5228 14 24C14 18.4772 18.4772 14 24 14C29.5228 14 34 18.4772 34 24Z",stroke:"var(--color-brand-500, #5048ED)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),i.jsx("h3",{children:"Complete Your Profile"}),i.jsx("p",{children:"Add your name and other details to personalize your account. Click the edit button next to each field to get started."})]}),l?i.jsxs("form",{onSubmit:y,className:"profile-inline-form",children:[i.jsx("input",{type:"text",className:"profile-form-input",value:d,onChange:b=>{h(b.target.value),g("")},placeholder:"Enter your full name"}),i.jsxs("div",{className:"profile-inline-actions",children:[i.jsx(A.Button,{variant:"secondary",type:"button",size:"lg",fullWidth:s,onClick:()=>{u(!1),g(""),h(o)},children:"Cancel"}),i.jsx(A.Button,{variant:"primary",type:"submit",size:"lg",fullWidth:s,disabled:f,children:f?"Saving...":"Save"})]}),m&&i.jsx("div",{className:"profile-form-error",children:m})]}):i.jsxs("div",{className:"profile-kv-row",children:[i.jsx("span",{className:"profile-kv-label",children:"Name"}),i.jsx("span",{className:"profile-kv-value",children:t||i.jsx("span",{className:"empty-value",children:"Click edit to add your name"})})]}),r&&i.jsxs("div",{className:"profile-kv-row",children:[i.jsx("span",{className:"profile-kv-label",children:"Email"}),i.jsxs("span",{className:"profile-kv-value",children:[i.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M2.66667 5.33333L7.2786 8.60289C7.67788 8.86886 8.32212 8.86886 8.7214 8.60289L13.3333 5.33333M4 12H12C12.7364 12 13.3333 11.4031 13.3333 10.6667V5.33333C13.3333 4.59695 12.7364 4 12 4H4C3.26362 4 2.66667 4.59695 2.66667 5.33333V10.6667C2.66667 11.4031 3.26362 12 4 12Z",stroke:"#6B7280",strokeLinecap:"round",strokeLinejoin:"round"})}),r]})]}),n&&i.jsxs("div",{className:"profile-kv-row",children:[i.jsx("span",{className:"profile-kv-label",children:"Mobile Number"}),i.jsxs("span",{className:"profile-kv-value",children:[i.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M5.33333 2.66667H10.6667C11.4031 2.66667 12 3.26362 12 4V12C12 12.7364 11.4031 13.3333 10.6667 13.3333H5.33333C4.59695 13.3333 4 12.7364 4 12V4C4 3.26362 4.59695 2.66667 5.33333 2.66667ZM5.33333 2.66667V3.33333C5.33333 3.70152 5.63181 4 6 4H10C10.3682 4 10.6667 3.70152 10.6667 3.33333V2.66667M8 11.3333H8.00667",stroke:"#6B7280",strokeLinecap:"round",strokeLinejoin:"round"})}),n]})]})]})}),Ib={error:A.toast.error},e4=({name:e,email:t,currentRole:r,roles:n,profilePhoto:o,isMobile:s,onPhotoUpload:a})=>{const[c,l]=v.useState(!1),[u,d]=v.useState(null),h=async m=>{d(m);try{const g=await Wp(String(m));if(g.success){const b=g.response?.redirect_url;b?window.location.href=b:window.location.reload()}else{const y=g.response;Ib.error({title:"Role Switch Failed",description:y?.message||"Failed to switch role",duration:5e3})}}catch{Ib.error({title:"Role Switch Error",description:"An error occurred while switching roles",duration:5e3})}finally{d(null)}},f=()=>{Cl(()=>{Ca({redirectUrl:"/app/login"})})},p=e?e.split(" ").map(m=>m[0]).join("").toUpperCase().slice(0,2):"";return i.jsxs("aside",{className:"profile-rail",children:[i.jsxs("div",{className:"profile-rail-header",children:[i.jsxs("div",{className:"profile-avatar-circle",children:[o?i.jsx("img",{src:o,alt:"Profile",className:"profile-avatar-img"}):p?i.jsx("span",{className:"profile-initials",children:p}):i.jsx("svg",{"aria-hidden":"true",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M20 20C23.6819 20 26.6667 17.0152 26.6667 13.3333C26.6667 9.65143 23.6819 6.66667 20 6.66667C16.3181 6.66667 13.3333 9.65143 13.3333 13.3333C13.3333 17.0152 16.3181 20 20 20ZM20 20C13.3726 20 8 25.3726 8 32C8 33.1046 8.89543 34 10 34H30C31.1046 34 32 33.1046 32 32C32 25.3726 26.6274 20 20 20Z",stroke:"#6B7280",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),i.jsxs("label",{className:"profile-avatar-edit",children:[i.jsx("input",{type:"file",accept:"image/*",onChange:a,hidden:!0}),i.jsx("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M2.52121 10.8728L2 14L5.12724 13.4788C5.67029 13.3883 6.1715 13.1304 6.56079 12.7411L13.6132 5.68859C14.1289 5.17281 14.1289 4.3366 13.6131 3.82084L12.1791 2.38682C11.6633 1.87105 10.8271 1.87106 10.3113 2.38685L3.25894 9.43933C2.86965 9.8286 2.61171 10.3298 2.52121 10.8728Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),i.jsx("h3",{className:"profile-rail-name",children:e||"Welcome!"}),t&&i.jsx("p",{className:"profile-rail-email",children:t}),i.jsxs("div",{className:"profile-user-role-badge",children:[i.jsxs("svg",{"aria-hidden":"true",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M9.5 6.5V4.5C9.5 3.39543 8.60457 2.5 7.5 2.5H6.5C5.39543 2.5 4.5 3.39543 4.5 4.5V6.5M3 6.5H11C11.5523 6.5 12 6.94772 12 7.5V10.5C12 11.0523 11.5523 11.5 11 11.5H3C2.44772 11.5 2 11.0523 2 10.5V7.5C2 6.94772 2.44772 6.5 3 6.5Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("circle",{cx:"7",cy:"9",r:"0.75",fill:"currentColor"})]}),i.jsx("span",{children:r})]})]}),i.jsx("div",{className:"profile-rail-divider"}),i.jsxs("div",{className:`profile-rail-section ${s&&c?"expanded":""}`,children:[s?i.jsxs("button",{type:"button",className:"profile-rail-section-toggle",onClick:()=>l(m=>!m),"aria-expanded":c,children:[i.jsxs("span",{className:"profile-rail-section-label",children:["Your Roles",n.length>0?` (${n.length})`:""]}),i.jsx("svg",{"aria-hidden":"true",className:`profile-rail-section-chevron ${c?"open":""}`,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})]}):i.jsx("div",{className:"profile-rail-section-label",children:"Your Roles"}),i.jsx("div",{className:"profile-rail-roles-collapsible",children:i.jsx("div",{className:"roles-list",children:n.length>0?n.map(m=>i.jsxs("div",{className:`role-item ${m.name===r?"active":""}`,children:[i.jsxs("div",{className:"role-info",children:[i.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M10.6667 7V5C10.6667 3.89543 9.77124 3 8.66667 3H7.33333C6.22876 3 5.33333 3.89543 5.33333 5V7M4 7H12C12.5523 7 13 7.44772 13 8V12C13 12.5523 12.5523 13 12 13H4C3.44772 13 3 12.5523 3 12V8C3 7.44772 3.44772 7 4 7Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("circle",{cx:"8",cy:"10",r:"0.75",fill:"currentColor"})]}),i.jsx("span",{className:"role-name",children:m.name})]}),m.name===r?i.jsx("span",{className:"role-badge",children:"Current"}):i.jsx("button",{type:"button",className:"role-switch-btn",onClick:()=>h(m.id),disabled:u!==null,children:u===m.id?"Switching...":"Switch"})]},m.id)):i.jsxs("div",{className:"role-item active",children:[i.jsxs("div",{className:"role-info",children:[i.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M10.6667 7V5C10.6667 3.89543 9.77124 3 8.66667 3H7.33333C6.22876 3 5.33333 3.89543 5.33333 5V7M4 7H12C12.5523 7 13 7.44772 13 8V12C13 12.5523 12.5523 13 12 13H4C3.44772 13 3 12.5523 3 12V8C3 7.44772 3.44772 7 4 7Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("circle",{cx:"8",cy:"10",r:"0.75",fill:"currentColor"})]}),i.jsx("span",{className:"role-name",children:r||"Admin"})]}),i.jsx("span",{className:"role-badge",children:"Current"})]})})})]}),i.jsx("div",{className:"profile-rail-spacer"}),i.jsx("div",{className:"profile-rail-mobile-actions",children:i.jsxs("button",{type:"button",className:"logout-button",onClick:f,children:[i.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M10 11.75C9.95093 12.9846 8.92207 14.0329 7.54373 13.9992C7.22307 13.9913 6.82673 13.8796 6.03408 13.656C4.12641 13.1179 2.47037 12.2135 2.07304 10.1877C2 9.81533 2 9.39627 2 8.5582V7.4418C2 6.60374 2 6.1847 2.07304 5.81231C2.47037 3.78643 4.12641 2.8821 6.03408 2.34402C6.82673 2.12042 7.22307 2.00863 7.54373 2.00079C8.92207 1.96707 9.95093 3.01538 10 4.25",stroke:"currentColor",strokeLinecap:"round"}),i.jsx("path",{d:"M14 7.99998H6.66663M14 7.99998C14 7.53318 12.6704 6.661 12.3333 6.33331M14 7.99998C14 8.46678 12.6704 9.33898 12.3333 9.66665",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]}),i.jsx("span",{children:"Log Out"})]})})]})},t4=({enabled:e=!0}={})=>os({queryKey:["sessions"],queryFn:async()=>{const t=await qp();if(!t.success)throw new Error(t.response?.message||"Failed to fetch sessions");const r=t.response;return r.data||r},enabled:e,staleTime:30*1e3,refetchOnWindowFocus:!0,retry:!1}),r4=()=>{const e=Xo();return gu({mutationFn:t=>Zp(t),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})},n4=()=>{const e=Xo();return gu({mutationFn:t=>Rp(t),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})};function Fb(e){if(!e)return"Unknown";const t=e.replace(" IST",""),r=new Date(t),o=new Date().getTime()-r.getTime(),s=Math.floor(o/1e3),a=Math.floor(s/60),c=Math.floor(a/60),l=Math.floor(c/24);return l>0?`${l} day${l>1?"s":""} ago`:c>0?`${c} hour${c>1?"s":""} ago`:a>0?`${a} minute${a>1?"s":""} ago`:s>0?`${s} second${s>1?"s":""} ago`:"Just now"}function o4(e){return e.includes("Chrome")?"Chrome":e.includes("Firefox")?"Firefox":e.includes("Safari")?"Safari":e.includes("Edge")?"Edge":"Unknown Browser"}function s4(e){return e.includes("Mac")?"macOS":e.includes("Windows")?"Windows":e.includes("Linux")?"Linux":e.includes("iPhone")||e.includes("iOS")?"iOS":e.includes("Android")?"Android":"Unknown OS"}function a4(e){const t=e.user_agent||e.browser_agent||"Unknown Browser",r=e.ip||e.location||"Unknown Location",n=o4(t),o=s4(t),s=()=>{if(e.is_current)return!0;if(!e.last_seen_at)return!1;const a=typeof e.last_seen_at=="string"?e.last_seen_at.replace(" IST",""):String(e.last_seen_at);return new Date(a)>new Date(Date.now()-3600*1e3)};return{...e,deviceName:`${n} on ${o}`,os:o,location:r==="127.0.0.1"?"Local Device":r,sessionStartTime:Fb(e.created_at),lastSeen:Fb(e.last_seen_at||e.last_activity),isActive:s()}}const i4=v.memo(function({isOpen:t,isMobile:r,onServerMessage:n}){const{data:o=[],isLoading:s,error:a,refetch:c}=t4({enabled:t}),l=a?.message||null,u=r4(),d=n4(),h=p=>{u.mutate(p,{onSuccess:m=>{const g=m;g.success?n("Session logged out successfully"):n(g.response?.message||"Failed to logout session")},onError:()=>{n("Failed to logout session")}})},f=()=>{const m=o.filter(g=>!g.is_current).map(g=>g.id);d.mutate(m,{onSuccess:g=>{const y=g;y.success?n("All other sessions logged out successfully"):n(y.response?.message||"Failed to logout all sessions")},onError:()=>{n("Failed to logout all sessions")}})};return i.jsxs("section",{className:"profile-card security-block",children:[i.jsxs("div",{className:"security-header",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"security-title",children:"Where you're logged in"}),i.jsx("p",{className:"security-subtitle",children:"Manage your active sessions"})]}),o.length>1&&i.jsx("button",{type:"button",className:"logout-all-btn",onClick:f,children:r?"Sign out all":"Sign me out of all other sessions"})]}),i.jsx("div",{className:"sessions-list",children:s?i.jsxs("div",{className:"flex items-center justify-center p-8",children:[i.jsx(A.Spin,{size:"small"}),i.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading sessions..."})]}):l?i.jsxs("div",{className:"p-4 bg-destructive/10 border border-destructive/30 rounded-lg text-center",children:[i.jsx("p",{className:"text-destructive m-0 mb-2",children:"Failed to load sessions"}),i.jsx("p",{className:"text-destructive text-sm m-0 mb-2",children:l}),i.jsx("button",{type:"button",onClick:()=>c(),className:"text-sm text-destructive underline bg-transparent border-none cursor-pointer p-0",children:"Try again"})]}):o.length>0?o.map((p,m)=>{const g=a4(p);return i.jsxs("div",{className:"session-item",children:[i.jsx("div",{className:"session-info",children:i.jsxs("div",{className:"session-device",children:[i.jsxs("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M2.5 4.16667C2.5 3.24619 3.24619 2.5 4.16667 2.5H15.8333C16.7538 2.5 17.5 3.24619 17.5 4.16667V12.5C17.5 13.4205 16.7538 14.1667 15.8333 14.1667H4.16667C3.24619 14.1667 2.5 13.4205 2.5 12.5V4.16667Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M6.66667 17.5H13.3333",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M10 14.1667V17.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"session-device-header",children:[i.jsx("p",{className:"session-device-name",children:g.deviceName}),p.is_current?i.jsx("span",{className:"session-status-tag current",children:"Current"}):i.jsx("button",{type:"button",className:`logout-tag-btn ${g.isActive?"logout-tag-btn-ghost":""}`,onClick:()=>h(p.id),children:"Logout"})]}),i.jsxs("p",{className:"session-details",children:[g.os," • ",g.location]})]})]})}),i.jsx("div",{className:"session-time",children:i.jsxs("div",{className:"session-time-info",children:[i.jsxs("p",{className:"session-start-time",children:["Started: ",g.sessionStartTime]}),i.jsx("p",{className:"session-last-active",children:g.isActive?"Active now":`Last seen: ${g.lastSeen}`})]})})]},p.id||m)}):i.jsx("p",{className:"no-sessions",children:"No active sessions found"})})]})}),c4=v.memo(function({tokens:t}){return i.jsxs("section",{className:"profile-card security-block",children:[i.jsx("div",{className:"security-header",children:i.jsxs("div",{children:[i.jsx("h4",{className:"security-title",children:"Authentication Tokens"}),i.jsx("p",{className:"security-subtitle",children:"Manage your bearer tokens for API authentication"})]})}),i.jsx("div",{className:"tokens-list",children:t&&t.length>0?t.map((r,n)=>i.jsx("div",{className:"token-item",children:i.jsx("div",{className:"token-info",children:i.jsxs("div",{className:"token-details",children:[i.jsxs("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M15 8.33333V6.66667C15 4.08934 12.9107 2 10.3333 2H9.66667C7.08934 2 5 4.08934 5 6.66667V8.33333M6.66667 8.33333H13.3333C14.2538 8.33333 15 9.07953 15 10V15C15 15.9205 14.2538 16.6667 13.3333 16.6667H6.66667C5.74619 16.6667 5 15.9205 5 15V10C5 9.07953 5.74619 8.33333 6.66667 8.33333Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("circle",{cx:"10",cy:"12.5",r:"1.25",fill:"currentColor"})]}),i.jsxs("div",{children:[i.jsxs("p",{className:"token-name",children:[r.role," - Bearer Token"]}),i.jsx("p",{className:"token-type",children:"Type: Bearer Authentication Token"}),i.jsxs("p",{className:"token-created",children:["Created: ",new Date(r.created).toLocaleDateString()]}),r.expiry?i.jsxs("p",{className:"token-expiry",children:["Expires: ",new Date(r.expiry).toLocaleDateString()]}):i.jsx("p",{className:"token-expiry",children:"Expires: Never"})]})]})})},n)):i.jsxs("div",{className:"no-tokens",children:[i.jsx("p",{children:"No authentication tokens found"}),i.jsx("p",{className:"no-tokens-hint",children:"Bearer tokens will appear here for API authentication"})]})})]})}),Dl={success:A.toast.success,error:A.toast.error},l4=({initialEnabled:e,profileData:t})=>{const[r,n]=v.useState(e),s=t?.auth_config?.two_factor_auth,a=async()=>{try{const c=!r,l=new FormData;l.append("auth_config",JSON.stringify({two_factor_auth:{required:c}}));const u=await sa(l);if(u.success)n(c),Dl.success({title:"Two-Factor Authentication Updated",description:`Two-factor authentication ${c?"enabled":"disabled"} successfully`,duration:3e3});else{const d=u.response;Dl.error({title:"Update Failed",description:d?.message||"Failed to update two-factor authentication",duration:5e3})}}catch{Dl.error({title:"Update Error",description:"An error occurred while updating two-factor authentication",duration:5e3})}};return i.jsx("section",{className:"profile-card security-block",children:i.jsxs("div",{className:"security-header",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"security-title",children:"Two-Factor Authentication"}),i.jsxs("p",{className:"security-subtitle",children:[r?"Enabled":"Disabled"," ",r?"":" - Add an extra layer of security"]}),!r&&s?.can_enable===!1&&!!s?.issue&&i.jsx("p",{className:"text-destructive text-sm mt-2",children:String(s.issue)})]}),!r&&s?.can_enable===!0&&i.jsx("button",{type:"button",className:"toggle-btn",onClick:a,children:"Enable"}),r&&s?.can_disable===!0&&i.jsx("button",{type:"button",className:"toggle-btn enabled",onClick:a,children:"Disable"})]})})},Db=({isOpen:e,onClose:t})=>{const[r,n]=v.useState(null),[o,s]=v.useState(""),[a,c]=v.useState(!0),[l,u]=v.useState(null),[d,h]=v.useState([]),{appData:f}=$e(),p=qe(),m=v.useRef(null),[g,y]=v.useState(!1);v.useEffect(()=>{if(!e){y(!1);return}const M=m.current,$=()=>y(!0),H=R=>{R.propertyName==="transform"&&R.target===M&&$()};M?.addEventListener("transitionend",H);const V=setTimeout($,400);return()=>{M?.removeEventListener("transitionend",H),clearTimeout(V)}},[e]);const{profileData:b,loading:w,error:_,refetch:P,shouldSetPassword:E}=Q6(g),S=b,[O,N]=v.useState({name:"",email:"",mobile:"",roles:[],currentRole:"",lastPasswordChange:"Never",nextPasswordDue:null});v.useEffect(()=>{if(S){const H=S.last_password_changed||"Never";let V=null;if(S.last_password_changed&&S?.password_policy?.password_expiry_days){const K=new Date(S.last_password_changed),Y=new Date(K);Y.setDate(Y.getDate()+S.password_policy.password_expiry_days),Y>new Date?V=Y.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):V="Expired"}N({name:S.name||"",email:S.email||"",mobile:S.mobile||"",roles:S.roles||[],currentRole:f?.profile_info?.user_role||S.roles?.[0]?.name||"Admin",lastPasswordChange:H,nextPasswordDue:V}),c(S?.can_set_password??!0),S.profile_pic&&n(S.profile_pic),S.tokens&&h(S.tokens);let R=null;S.auth_config?.password_policy?R=S.auth_config.password_policy:S.password_policy&&(R=S.password_policy),R&&u(R)}const M=f,$=M?.sessions;$?.tokens&&h($.tokens),M?.password_policy&&u(M.password_policy)},[S,f]);const[k,I]=v.useState(g);v.useEffect(()=>{g&&!k&&(P&&P(),s("")),I(g)},[g,k,P]);const j=async M=>{const $=M.target.files?.[0];if(!$)return;const H=new FormData;H.append("profile_pic",$);try{const V=await sa(H),R=V.response;V.success?(n(R?.profile_pic||URL.createObjectURL($)),s("Profile photo updated successfully!")):s(R?.message||"Failed to upload photo")}catch{s("Failed to upload photo")}},q=()=>{Cl(()=>{Ca({redirectUrl:"/app/login"})})};return i.jsxs("div",{ref:m,className:`user-profile-drawer ${e?"open":""} ${p?"user-profile-drawer-mobile":""}`,children:[i.jsxs("div",{className:"profile-topstrip",children:[i.jsx("div",{className:"profile-topstrip-breadcrumb",children:i.jsx("span",{children:"My Profile"})}),i.jsx("button",{type:"button",className:"profile-close-btn",onClick:t,"aria-label":"Close profile drawer",children:i.jsx("svg",{"aria-hidden":"true",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M1 1L13 13M13 1L1 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})})]}),w&&i.jsx("div",{className:"profile-body profile-body-loading",children:i.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 p-8",children:[i.jsx(A.Spin,{size:"large"}),i.jsx("span",{className:"text-muted-foreground",children:"Loading profile..."})]})}),_&&!w&&i.jsxs("div",{className:"mx-6 my-4 p-4 bg-destructive/10 border border-destructive/30 rounded-lg",children:[i.jsxs("div",{className:"flex items-center",children:[i.jsx("svg",{"aria-hidden":"true",className:"h-5 w-5 text-destructive/70 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:i.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),i.jsx("span",{className:"text-destructive font-medium",children:"Failed to load profile"})]}),i.jsx("p",{className:"text-destructive text-sm mt-1 mb-2",children:_}),i.jsx("button",{type:"button",onClick:P,className:"text-sm text-destructive underline bg-transparent border-none cursor-pointer p-0",children:"Try again"})]}),!w&&!_&&i.jsxs("div",{className:"profile-body",children:[i.jsx(e4,{name:O.name,email:O.email,currentRole:O.currentRole,roles:O.roles,profilePhoto:r,isMobile:p,onPhotoUpload:j}),i.jsxs("main",{className:"profile-right-col",children:[o&&i.jsx("div",{className:`profile-alert ${o.includes("successfully")?"success":"error"}`,children:i.jsx("span",{children:o})}),i.jsx(X6,{name:O.name,email:O.email,mobile:O.mobile,originalName:S?.name||"",isMobile:p,onNameSaved:M=>N($=>({...$,name:M})),onServerMessage:s}),i.jsx(J6,{canSetPassword:a,shouldSetPassword:E,passwordPolicy:l,lastPasswordChange:O.lastPasswordChange,nextPasswordDue:O.nextPasswordDue,isMobile:p,onServerMessage:s,onPasswordUpdated:()=>{P&&P()}}),i.jsx(l4,{initialEnabled:S?.auth_config?.two_factor_auth?.required||!1,profileData:S}),i.jsx(i4,{isOpen:g,isMobile:p,onServerMessage:s}),i.jsx(c4,{tokens:d})]}),p&&i.jsx("div",{className:"profile-mobile-footer-actions",children:i.jsxs("button",{type:"button",className:"logout-button",onClick:q,children:[i.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M10 11.75C9.95093 12.9846 8.92207 14.0329 7.54373 13.9992C7.22307 13.9913 6.82673 13.8796 6.03408 13.656C4.12641 13.1179 2.47037 12.2135 2.07304 10.1877C2 9.81533 2 9.39627 2 8.5582V7.4418C2 6.60374 2 6.1847 2.07304 5.81231C2.47037 3.78643 4.12641 2.8821 6.03408 2.34402C6.82673 2.12042 7.22307 2.00863 7.54373 2.00079C8.92207 1.96707 9.95093 3.01538 10 4.25",stroke:"currentColor",strokeLinecap:"round"}),i.jsx("path",{d:"M14 7.99998H6.66663M14 7.99998C14 7.53318 12.6704 6.661 12.3333 6.33331M14 7.99998C14 8.46678 12.6704 9.33898 12.3333 9.66665",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]}),i.jsx("span",{children:"Log Out"})]})})]})]})},u4=Object.freeze({__proto__:null,UserProfileDrawer:Db}),$b=()=>{const e=ue.useNavigate(),[t,r]=v.useState(null);return v.useEffect(()=>{let n=null;return(async()=>{try{const s=await Kp();if(s.success||s.responseStatus===401)n=setTimeout(()=>{e(Gr.LOGIN)},1500);else{const a=s.response;r(a?.message||"An error occurred while logging out. Redirecting to login..."),n=setTimeout(()=>{e(Gr.LOGIN)},2e3)}}catch(s){J.error("Logout error",s),r("An error occurred. Redirecting to login..."),n=setTimeout(()=>{e(Gr.LOGIN)},2e3)}})(),()=>{n&&clearTimeout(n)}},[e]),i.jsxs("div",{className:"flex justify-center items-center min-h-screen bg-muted",children:[i.jsx("div",{className:"bg-white p-10 rounded-lg shadow-md text-center max-w-sm w-full",children:t?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mb-5 text-destructive",children:i.jsx("svg",{"aria-hidden":"true",width:"50",height:"50",fill:"none",viewBox:"0 0 24 24",className:"mx-auto",children:i.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),i.jsx("h2",{className:"text-2xl font-semibold mb-3 text-foreground",children:"Logout Error"}),i.jsx("p",{className:"text-base text-muted-foreground m-0",children:t})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mb-5",children:i.jsx("div",{className:"logout-spinner w-[50px] h-[50px] border-[3px] border-border rounded-full mx-auto"})}),i.jsx("h2",{className:"text-2xl font-semibold mb-3 text-foreground",children:"Logging you out..."}),i.jsx("p",{className:"text-base text-muted-foreground m-0",children:"Please wait while we securely log you out."})]})}),i.jsx("style",{children:`
|
|
238
|
+
.logout-spinner {
|
|
239
|
+
border-top-color: var(--primary-color, #3b82f6);
|
|
240
|
+
animation: logout-spinner-spin 1s linear infinite;
|
|
241
|
+
}
|
|
242
|
+
@keyframes logout-spinner-spin {
|
|
243
|
+
0% { transform: rotate(0deg); }
|
|
244
|
+
100% { transform: rotate(360deg); }
|
|
245
|
+
}
|
|
246
|
+
`})]})},d4=Object.freeze({__proto__:null,LogoutPage:$b});let zb=!1;class f4{constructor(){zb||(zb=!0,this.setupInterceptors())}handleRedirect(t){if(Kt(t)){const r=window.location.pathname+window.location.search+window.location.hash;if(r==="/app/logout/"||r==="/app/logout"){window.location.href=t;return}const n=encodeURIComponent(r),o=`${t}?next=${n}`;window.location.href=o}}setupInterceptors(){const t=window.fetch,r=this;window.fetch=async(...s)=>{const[a,c={}]=s,l=typeof a=="string"?a:a.toString();if(l.startsWith("http")&&!l.startsWith(window.location.origin))return await t(a,c);let d=c;try{const f=Date.now().toString(),p=new Headers(c.headers||{});p.set("X-Client-Timestamp",f),p.set("X-Client-Timezone",Intl.DateTimeFormat().resolvedOptions().timeZone),p.set("X-Client-Platform",navigator.platform),d={...c,headers:p}}catch{}const h=await t(a,d);try{const f=`${window.location.origin}/login/`;h.url&&h.url===f&&r.handleRedirect("/app/login/")}catch{}return h};const n=XMLHttpRequest.prototype.open,o=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(s,a,c=!0,l,u){return this._requestUrl=a,n.call(this,s,a,c,l,u)},XMLHttpRequest.prototype.send=function(...s){const a=String(this._requestUrl||"");if(!(a.startsWith("http")&&!a.startsWith(window.location.origin)))try{const l=Date.now().toString();this.setRequestHeader("X-Client-Timestamp",l),this.setRequestHeader("X-User-Agent",navigator.userAgent),this.setRequestHeader("X-Client-Timezone",Intl.DateTimeFormat().resolvedOptions().timeZone),this.setRequestHeader("X-Client-Platform",navigator.platform)}catch{}return this.addEventListener("load",()=>{try{const l=this.responseURL||String(this._requestUrl||""),u=`${window.location.origin}/login/`;l&&l===u&&r.handleRedirect("/app/login/")}catch{}}),o.apply(this,s)}}}const h4=new f4,p4=({onLogin:e,showRememberMe:t=!0})=>{const[r,n]=v.useState(!1),[o,s]=v.useState(null),[,a]=v.useState(null),[c,l]=v.useState("email"),[u,d]=v.useState(!1),[h,f]=v.useState(0),[p,m]=v.useState(!1),[g,y]=v.useState(!1),[b,w]=v.useState(""),[_,P]=v.useState(""),{authConfig:E}=Zr(),{getLoginConfig:S,getMessagesConfig:O,getProvidersConfig:N,authConfig:k}=st(),I=k||E,j=Ar(I),q=ur(I),M=pm(I),$=v.useCallback(async()=>{try{return await re.isAuthenticated()}catch{return!1}},[]);if(v.useEffect(()=>{if(E){const z=re.isPasswordLoginEnabled()?"password":re.isOTPLoginEnabled()?"otp":null;z&&a(z);const B=re.getAllowedUsernamesForMethod(z??"password");if(B&&B.length>0){const X=B.includes("email"),G=B.includes("mobile");X?l("email"):G&&l("mobile")}}},[E]),v.useEffect(()=>{(async()=>{const B=await $();m(B)})()},[$]),!E)return i.jsx("div",{className:"flex justify-center items-center min-h-loading-min-h",children:i.jsx(A.Spin,{size:"large"})});const H=z=>{const B=O();return z==="email"?[{required:!0,message:B?.validation?.required||"Please enter your email address"},{type:"email",message:B?.validation?.invalidEmail||"Please enter a valid email address!"}]:z==="mobile"?[{required:!0,message:B?.validation?.required||"Please input your mobile number!"},{pattern:/^\+\d{7,15}$/,message:B?.validation?.invalidMobile||"Please enter a valid mobile number with country code (e.g., +919876543210)"}]:[{required:!0,message:B?.validation?.required||"Please enter your email address"},{type:"email",message:B?.validation?.invalidEmail||"Please enter a valid email address!"}]},V=z=>{!["Backspace","Delete","Tab","Enter","ArrowLeft","ArrowRight"].includes(z.key)&&!z.ctrlKey&&!z.metaKey&&!/[0-9+]/.test(z.key)&&z.preventDefault()},R=async z=>{n(!0),s(null);try{const B=re.getAllowedUsernames(),X=B.includes("email"),G=B.includes("mobile"),te=X&&G?c:X?"email":"mobile",ie={email:te==="email"?z.username:void 0,phone:te==="mobile"?z.username:void 0,password:z.password,remember_me:z.remember||!1};await e(ie)}catch(B){const X=O(),G=(B instanceof Error?B.message:null)||X?.errors?.loginFailed||"Login failed. Please try again.";s(G)}finally{n(!1)}},K=async z=>{await e(z)},Y=async()=>{n(!0);try{await re.logout(),A.toast.success("Logged out successfully"),m(!1)}catch(z){A.toast.error(z instanceof Error?z.message:"Failed to logout")}finally{n(!1)}},D=async()=>{if(!b||!_){A.toast.error("Please fill in all password fields");return}if(b!==_){A.toast.error("Passwords do not match");return}if(b.length<8){A.toast.error("Password must be at least 8 characters long");return}n(!0);try{await re.setPassword(b),A.toast.success("Password changed successfully!"),y(!1),w(""),P("")}catch(z){A.toast.error(z instanceof Error?z.message:"Failed to change password")}finally{n(!1)}},ne=z=>{const B=S(),X=O();return i.jsxs(A.Form,{name:`${z}-password-login`,className:"w-full",onFinish:R,layout:"vertical",initialValues:{remember:!1},children:[o&&i.jsx(A.Alert,{message:o,type:"error",showIcon:!0,closable:!0,onClose:()=>s(null),className:"mb-4"}),i.jsx(A.FormItem,{name:"username",rules:H(z),children:i.jsx(A.Input,{placeholder:z==="email"?B?.formPlaceholders?.email||"Enter your email address":B?.formPlaceholders?.mobile||"Enter your mobile number (+919876543210)",autoComplete:z==="email"?"email":"tel",onKeyDown:z==="mobile"?V:void 0})}),i.jsx(A.FormItem,{name:"password",rules:[{required:!0,message:X?.validation?.passwordRequired||"Please input your password!"},{...Bo(E?.password_policy??null),message:X?.validation?.passwordTooShort||Bo(E?.password_policy??null).message}],children:i.jsx(A.PasswordInput,{placeholder:B?.formPlaceholders?.password||"Enter your password",autoComplete:"current-password"})}),i.jsx(A.FormItem,{children:i.jsxs("div",{className:"flex justify-between items-center w-full",children:[i.jsx("div",{children:B?.showRememberMe!==!1&&t&&re.isRememberMeEnabled()&&i.jsx(A.FormItem,{name:"remember",valuePropName:"checked",noStyle:!0,children:i.jsx("div",{className:"auth-remember-me",style:q,children:i.jsx(A.Checkbox,{label:B?.rememberMeText||"Remember me"})})})}),i.jsx("div",{children:re.isForgotPasswordEnabled()&&i.jsx(ue.Link,{to:"forgot-password",className:"text-sm transition-colors duration-300",style:M,children:B?.forgotPasswordText||"Forgot password?"})})]})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",className:"w-full text-base font-medium",disabled:r,fullWidth:!0,children:r?i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx(qr,{size:16,className:"animate-spin"}),B?.submitButtonText||"Sign in"]}):B?.submitButtonText||"Sign in"})})]},`${z}-${h}`)},T=()=>{if(!re.isOTPLoginEnabled())return null;const z=S();return u?i.jsx(Pa,{onSuccess:K,onBack:()=>d(!1)}):i.jsx(A.Button,{variant:"secondary",fullWidth:!0,onClick:()=>d(!0),className:"bg-gray-100 border-gray-300",children:z?.otpButtonText||"Sign in with OTP"})},F=()=>{if(!E)return null;const z=re.getAllowedUsernames(),B=z.includes("email"),X=z.includes("mobile"),G=re.isSSOEnabled()||re.isOIDCEnabled(),te=re.isPasswordLoginEnabled(),ie=re.isOTPLoginEnabled();if(!te&&!ie&&!G)return J.error("[Auth] No login method is enabled in the auth config",void 0,{enabledMethods:re.getEnabledLoginMethods()}),i.jsx(A.Alert,{type:"warning",showIcon:!1,message:"No sign-in method is configured. Please contact your administrator."});if(u&&ie&&te)return i.jsx("div",{className:"w-full",children:i.jsx(Pa,{onSuccess:K,onBack:()=>d(!1)})});if(G&&!te&&!ie)return i.jsxs("div",{className:"w-full",children:[re.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:re.getSSOProviders().map(Ae=>i.jsx(Yt,{provider:Ae,type:"sso"},Ae.id))})}),re.isOIDCEnabled()&&i.jsx("div",{className:"space-y-2",children:re.getOIDCProviders().map(Ae=>i.jsx(Yt,{provider:Ae,type:"oidc"},Ae.id))})]});if(ie&&!te){const Ae=N();return i.jsxs("div",{className:"w-full",children:[i.jsx(Pa,{onSuccess:K}),G&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:Ae?.separatorText||"OR"}),re.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:re.getSSOProviders().map(_e=>i.jsx(Yt,{provider:_e,type:"sso"},_e.id))})}),re.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:re.getOIDCProviders().map(_e=>i.jsx(Yt,{provider:_e,type:"oidc"},_e.id))})})]})]})}if(B&&X&&te){const Ae=S(),_e=N();return i.jsx("div",{className:"w-full",children:i.jsx(A.Tabs,{className:"login-tabs",activeKey:c,onChange:Se=>{l(Se),f(ge=>ge+1),s(null)},items:[{key:"email",label:i.jsxs("span",{className:"flex items-center gap-1",style:j,children:[i.jsx(ia,{size:16}),Ae?.tabLabels?.email||"Email"]}),children:i.jsxs(i.Fragment,{children:[ne("email"),ie&&te&&!u&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:_e?.separatorText||"OR"}),T()]}),u&&T(),!u&&G&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:_e?.separatorText||"OR"}),re.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:re.getSSOProviders().map(Se=>i.jsx(Yt,{provider:Se,type:"sso"},Se.id))})}),re.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:re.getOIDCProviders().map(Se=>i.jsx(Yt,{provider:Se,type:"oidc"},Se.id))})})]})]})},{key:"mobile",label:i.jsxs("span",{className:"flex items-center gap-1",style:j,children:[i.jsx(Vc,{size:16}),Ae?.tabLabels?.mobile||"Mobile"]}),children:i.jsxs(i.Fragment,{children:[ne("mobile"),ie&&te&&!u&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),T()]}),u&&T(),!u&&G&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),re.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:re.getSSOProviders().map(Se=>i.jsx(Yt,{provider:Se,type:"sso"},Se.id))})}),re.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:re.getOIDCProviders().map(Se=>i.jsx(Yt,{provider:Se,type:"oidc"},Se.id))})})]})]})}]})})}else{const Ae=B?"email":"mobile";return i.jsxs("div",{className:"w-full",children:[ne(Ae),ie&&te&&!u&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),T()]}),u&&T(),!u&&G&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),re.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:re.getSSOProviders().map(_e=>i.jsx(Yt,{provider:_e,type:"sso"},_e.id))})}),re.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:re.getOIDCProviders().map(_e=>i.jsx(Yt,{provider:_e,type:"oidc"},_e.id))})})]})]})}};return E?p?i.jsx("div",{className:"w-full",children:g?i.jsxs("div",{className:"space-y-4",children:[i.jsx("h4",{className:"text-base font-medium mb-4",children:"Change Your Password"}),i.jsx(A.FormItem,{label:"New Password",children:i.jsx(A.PasswordInput,{value:b,onChange:z=>w(z.target.value),placeholder:"Enter new password",disabled:r})}),i.jsx(A.FormItem,{label:"Confirm Password",children:i.jsx(A.PasswordInput,{value:_,onChange:z=>P(z.target.value),placeholder:"Confirm new password",disabled:r})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(A.Button,{type:"primary",onClick:D,loading:r,className:"flex-1",children:"Change Password"}),i.jsx(A.Button,{onClick:()=>{y(!1),w(""),P("")},disabled:r,className:"flex-1",children:"Cancel"})]})]}):i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"text-center mb-4",children:[i.jsx("h3",{className:"text-lg font-medium",style:j,children:"Already Logged In"}),i.jsx("p",{className:"text-sm mt-2",style:q,children:"You are currently logged in."})]}),i.jsx(A.Button,{block:!0,onClick:()=>y(!0),children:"Change Password"}),i.jsx(A.Button,{block:!0,danger:!0,onClick:Y,loading:r,children:"Logout"})]})}):F():i.jsx("div",{className:"flex justify-center items-center min-h-loading-min-h",children:i.jsx(A.Spin,{size:"large"})})},m4=({onLogin:e,showRememberMe:t=!0,showForgotPassword:r=!0})=>{const[n,o]=v.useState(!1),[s]=v.useState(0),[a,c]=v.useState("email"),{authConfig:l}=Zr();v.useEffect(()=>{if(l){const y=re.getAllowedUsernames();y&&y.length>0&&c(y[0])}},[l]);const u=async y=>{o(!0);try{if(e){const b={email:a==="email"?y.username:void 0,phone:a==="mobile"?y.username:void 0,username:y.username,password:y.password,remember_me:y.remember||!1};await e(b)}}catch(b){A.toast.error(b instanceof Error?b.message:"Login failed. Please try again.")}finally{o(!1)}},d=()=>{switch(a){case"email":return"Email address";case"mobile":return"Phone number";case"username":return"Username";default:return"Username"}},h=()=>{const y=[{required:!0,message:`Please input your ${a}!`}];switch(a){case"email":return[...y,{type:"email",message:"Please enter a valid email address!"}];case"mobile":return[...y,{pattern:/^\+?[1-9]\d{1,14}$/,message:"Please enter a valid phone number!"}];case"username":return[...y,{min:3,message:"Username must be at least 3 characters long"}];default:return y}};if(!l)return i.jsx("div",{className:"flex justify-center items-center min-h-loading-min-h",children:"Loading..."});const f=re.getAllowedUsernames(),p=f.length>1,m=re.isRememberMeEnabled(),g=re.isForgotPasswordEnabled();return i.jsxs(A.Form,{name:"login",className:"w-full space-y-4",initialValues:{remember:!1},onFinish:y=>u(y),autoComplete:"off",layout:"vertical",children:[p&&i.jsx(A.FormItem,{label:"Login with",className:"mb-4",children:i.jsx(A.Select,{value:a,onChange:y=>c(String(y)),options:f.map(y=>({value:y,label:y==="mobile"?"Phone":y.charAt(0).toUpperCase()+y.slice(1)}))})}),i.jsx(A.FormItem,{name:"username",rules:h(),children:i.jsx(A.Input,{className:"w-full",placeholder:d(),autoComplete:a==="email"?"email":"username"})}),i.jsx(A.FormItem,{name:"password",rules:[{required:!0,message:"Please input your password!"},Bo(l?.password_policy)],children:i.jsx(A.PasswordInput,{className:"w-full",placeholder:"Password",autoComplete:"current-password"})}),i.jsx(A.FormItem,{children:i.jsxs(A.Space,{className:"flex justify-between items-center w-full",children:[t&&m&&i.jsx(A.FormItem,{name:"remember",valuePropName:"checked",noStyle:!0,children:i.jsx(A.Checkbox,{label:"Remember me"})}),r&&g&&i.jsx(ue.Link,{to:"forgot-password",className:"text-brand-500 text-sm hover:text-brand-600 transition-colors",children:"Forgot password?"})]})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",className:"w-full text-base font-medium",disabled:n,fullWidth:!0,children:"Log in"})})]},s)},g4=({onLogin:e,logo:t,title:r,subtitle:n,apiConfig:o={},useDynamicConfig:s=!0,staticConfig:a=null})=>{const[c]=ue.useSearchParams(),[l,u]=v.useState(null),[d,h]=v.useState(s),[f,p]=v.useState(null),m=v.useRef(!1),{appLogo:g,appName:y}=$e(),b=qe(),w=c.get("token"),_=c.get("request_id"),P=!!(w&&_);v.useLayoutEffect(()=>{if(m.current)return;const K=sessionStorage.getItem("saml_error");if(K){m.current=!0,sessionStorage.removeItem("saml_error");try{const Y=JSON.parse(K);A.toast.error(Y.message,{duration:5e3})}catch(Y){J.error("Failed to parse SAML error",Y)}}},[]);const{authConfig:E,getCustomComponents:S}=st(),O=S(),N=Yn(E),k=Gt(E),I=Ar(E),j=ur(E),q=Jn(E),M=Qn(E),$=O?.LoginPage,H=O?.LoginCard,V=v.useCallback(async()=>{try{const K=await re.getAuthConfig();u(K),p(null)}catch(K){J.error("Failed to fetch login methods",K),u({login_methods:{password:{enabled:!0,allowed_usernames:["email"]},otp:{enabled:!1},sso:{enabled:!1},oidc:{enabled:!1}},password_policy:{min_length:8,reset:{enabled:!0}},session_policy:{remember_me_enabled:!0,remember_me_duration_days:30}}),p(null),J.warn("Using default auth configuration due to config fetch failure")}finally{h(!1)}},[]);if(v.useEffect(()=>{s&&!a?V():a&&(u(a),h(!1))},[s,a,V]),P)return i.jsx(jg,{logo:t,title:r||"Processing Authentication",subtitle:n||"Please wait while we complete your login",onAuthComplete:K=>{const Y=K?.redirect_url||"/app";try{const D=new URL(Y,window.location.origin);D.searchParams.delete("token"),D.searchParams.delete("request_id");const ne=D.pathname+(D.search?D.search:"");Xe(ne)}catch{Xe(Y)}},roleSelectionTitle:"Select Your Role",roleSelectionSubtitle:"Choose a role to continue",twoFactorTitle:"Two-Factor Authentication",twoFactorSubtitle:"For your security, please verify your identity",passwordResetTitle:"Password Update Required",passwordResetSubtitle:"Please create a new password to continue"});const R=()=>d?i.jsx("div",{className:"flex justify-center items-center min-h-loading-min-h",children:i.jsx(A.Spin,{size:"large",tip:"Loading login methods..."})}):f?i.jsx(A.Alert,{message:"Error",description:f,type:"error",showIcon:!0,action:i.jsx("button",{type:"button",onClick:V,children:"Retry"})}):l&&s?i.jsx(p4,{onLogin:e}):i.jsx(m4,{onLogin:e});return $&&!w&&!_?i.jsx(Ho.Provider,{value:{onLogin:e||(()=>{})},children:i.jsx($,{})}):H?i.jsx(Ho.Provider,{value:{onLogin:e||(()=>{})},children:i.jsx(A.Layout,{className:"min-h-screen",style:k,children:i.jsx(A.Layout.Content,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx(A.Card,{className:"w-full max-w-md",bordered:!1,style:N,children:i.jsx(H,{})})})})}):b?i.jsxs(dr,{appName:y,appLogo:typeof t=="string"?t:g,children:[i.jsxs("div",{className:"text-center mb-[22px]",children:[(()=>{const Y=(r||"Welcome Back").trim().split(/\s+/),D=Y.pop(),ne=Y.join(" ");return i.jsxs("h1",{className:"mb-2",style:I,children:[ne?`${ne} `:"",i.jsxs("em",{className:"accent",children:[D,"."]})]})})(),n&&i.jsx("p",{className:"text-sm",style:j,children:n})]}),R()]}):i.jsx(A.Layout,{className:"min-h-screen",style:k,children:i.jsx(A.Layout.Content,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsxs(A.Card,{className:"w-full max-w-md",bordered:!1,style:N,children:[t&&i.jsx("div",{className:q.className,style:q.style,children:typeof t=="string"?i.jsx("img",{src:t,alt:E?.logo?.alt||"Logo",className:"max-w-logo-max-w h-auto",style:M}):t}),i.jsxs("div",{className:"text-center mb-[18px]",children:[i.jsx("h1",{className:"text-3xl font-semibold mb-2",style:I,children:r||"Welcome Back"}),n&&i.jsx("p",{className:"text-base",style:j,children:n})]}),R()]})})})},{Content:b4}=A.Layout,y4=Object.freeze({__proto__:null,LoginPageWithRoleSelection:({logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:o=!0,staticConfig:s=null,onLoginSuccess:a,roleSelectionTitle:c,roleSelectionSubtitle:l,initialAuthResult:u=null})=>{const{pendingAuth:d,availableRoles:h,login:f,processAuthResult:p}=Zr(),[,m]=v.useState(null),g=qe(),{appName:y,appLogo:b}=$e(),{getCustomComponents:w}=st(),_=w()?.LoginPage?"custom":w()?.LoginCard?"card":"default",P=v.useCallback(async S=>{m(null);try{if(S&&(S.status||S.data||S.next_step||S.response)){const k=p(S);if(k?.requiresRoleSelection)return;if(k?.autoSelectedRole){const I=await re.selectRole(k.autoSelectedRole.id);a&&a(I);return}a&&a(S);return}const O=await f(S),N={email:S.email,username:S.username,phone:S.phone,display:S.email||S.username||S.phone};if(O.requiresRoleSelection)return;a&&a({...O,loginUser:N})}catch(O){const N=O instanceof Error?O.message:"Login failed";throw m(N),O}},[f,p,a]);v.useEffect(()=>{u&&P(u)},[u,P]);const E=async S=>{try{const O=await re.selectRole(S.id);a&&a(O)}catch(O){throw J.error("Role selection failed",O),O}};if(d&&h){const S=Gt(n||s||{}),O=i.jsx(gl,{user:d.user,roles:h,onRoleSelect:E,title:c,subtitle:l});return g?i.jsx(dr,{appName:y,appLogo:typeof e=="string"?e:b,children:O}):i.jsx(A.Layout,{className:"min-h-screen",style:S,children:i.jsx(b4,{className:"flex justify-center items-center min-h-screen p-5",children:O})})}return i.jsx(g4,{onLogin:P,logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:o,staticConfig:s},_)}}),w4=Object.freeze({__proto__:null,pageTypeRegistry:{crud:{component:_l,includeBasePath:!0,propsBuilder:({matchedRoutePath:e})=>({})},training:{component:Bg,includeBasePath:!0,propsBuilder:({matchedRoutePath:e})=>({})},login:{component:Sa,includeBasePath:!0,standalone:!0,propsBuilder:({matchedRoutePath:e})=>({})},custom:{component:null,includeBasePath:!1,handler:({customPages:e,customPagePath:t,location:r,matchedRoute:n})=>{const o=n||t&&{path:null,component:t},s=e[t];return s?v.createElement(s,{routeConfig:o,location:r}):v.createElement(jc,{componentName:t,routeConfig:o,location:r})}},404:{component:qo,standalone:!0,includeBasePath:!1,propsBuilder:()=>({})},default:{component:qo,includeBasePath:!1,standalone:!0,propsBuilder:({pageType:e})=>({message:`Unknown page type: ${e}`})}}}),v4=Object.freeze({__proto__:null,ConfigurePage:()=>{const{initializerEndpoint:e}=$e();return i.jsx("div",{className:"flex flex-col items-center justify-center h-screen text-center p-6 bg-muted",children:i.jsxs("div",{className:"bg-white rounded-xl p-6 sm:p-12 shadow-md max-w-2xl w-full",children:[i.jsx("h1",{className:"text-[40px] m-0 text-destructive font-bold leading-none",children:"⚙️"}),i.jsx("h2",{className:"text-2xl my-4 text-foreground font-semibold",children:"Configuration Error"}),i.jsx("p",{className:"text-base text-muted-foreground mb-6 leading-relaxed",children:"The application is trying to fetch configuration from:"}),i.jsx("div",{className:"overflow-x-auto mb-6",children:i.jsx("code",{className:"block bg-muted/50 border border-border rounded-md p-3 text-sm text-foreground font-mono break-all",children:e})}),i.jsxs("div",{className:"text-left mb-8 p-4 bg-muted/50 rounded-lg",children:[i.jsx("p",{className:"text-sm text-muted-foreground mb-3 font-semibold",children:"The response is either missing or invalid. Please check:"}),i.jsxs("ul",{className:"text-sm text-muted-foreground pl-5 m-0 list-disc space-y-2 pl-4",children:[i.jsx("li",{children:"Appbuilder package routes are configured correctly"}),i.jsx("li",{children:"Required policies are properly mapped"}),i.jsx("li",{children:"The endpoint is accessible and returns valid data"})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[i.jsx(A.Button,{type:"primary",onClick:()=>window.location.reload(),children:"Retry"}),i.jsx(A.Button,{onClick:()=>window.location.href=Gr.APP,children:"Go Home"})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-6",children:"Contact your administrator if this issue persists."})]})})}});W.AppProvider=Zg,W.AuthConfigProvider=om,W.AuthProvider=Tg,W.Breadcrumbs=ib,W.CachedLogo=sb,W.CommandPalette=Ab,W.CrudPage=_l,W.CustomPageFallback=Qp,W.CustomPageLoader=jc,W.DocumentHead=Rg,W.ForgotPasswordForm=yl,W.Layout=Lb,W.LoginContext=Ho,W.LoginPage=Sa,W.LogoutPage=$b,W.Navbar=Ob,W.NotFoundPage=qo,W.OTPLoginForm=T5,W.PasswordLoginForm=N5,W.PasswordResetRequired=ul,W.ResetPasswordForm=wl,W.RoleSelection=gl,W.SSOButtons=q5,W.SmartLink=_n,W.Topbar=Nb,W.UserProfileDrawer=Db,W.ZangoApp=A5,W.apiInterceptor=h4,W.authService=re,W.buildApiUrl=Et,W.callApi=kt,W.callDeleteApi=Ep,W.callGetApi=Sp,W.callPatchApi=kp,W.callPostApi=Cp,W.callPutApi=Pp,W.changePassword=Lp,W.changeRole=Wp,W.clearNextParamFromSession=gk,W.deleteCookie=fr,W.fetchAppInitData=Bp,W.fetchUserProfile=Vp,W.fetchUserSessions=qp,W.generateCSSVariables=ua,W.generatePalette=fn,W.generateQueryString=v3,W.getApiConfig=g3,W.getApiTimeout=p3,W.getApiUrl=ra,W.getAppInitData=Ap,W.getBaseUrl=na,W.getColor=Hc,W.getContrastColor=uk,W.getCookie=Sl,W.getEndpoint=h3,W.getNextParam=It,W.getNextParamFromSession=Or,W.getUserProfile=Op,W.getUserSessions=Fp,W.getValidRedirectUrl=Be,W.isAuthenticatedViaCookie=Kg,W.isLightColor=hm,W.logoCache=vn,W.logout=zp,W.logoutAllSessions=$p,W.logoutSession=Dp,W.performAppLogout=Gp,W.performDirectLogout=Kp,W.performLogout=Up,W.pingSession=Yp,W.pingSessionSecurity=jp,W.removeAllSessions=Rp,W.removeSession=Zp,W.resolveApiUrl=Uc,W.saveNextParamToSession=gm,W.saveUserProfile=sa,W.setCookie=Gg,W.setTwoFactor=x3,W.switchRole=Ip,W.toggleTwoFactor=Mp,W.updatePassword=Hp,W.updateUserProfile=Tp,W.uploadPhoto=_3,W.uploadProfilePhoto=Np,W.useApiConfig=oa,W.useAppContext=$e,W.useAuth=Z5,W.useAuthConfig=st,W.useAuthContext=Zr,W.useLoginContext=El,W.useRouteConfig=m3,W.useSmartNavigation=kl,W.validateRedirectUrl=Kt,W.withMultiStepAuth=W5}));
|
|
247
|
+
//# sourceMappingURL=zango-appbuilder.umd.cjs.map
|