@zango-core/crm-framework 1.0.16-rc.2 → 1.0.16-rc.4
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/{PageTypeRegistry-K-HAJFaw.js → PageTypeRegistry-B4dzpygu.js} +2 -2
- package/dist/{PageTypeRegistry-K-HAJFaw.js.map → PageTypeRegistry-B4dzpygu.js.map} +1 -1
- package/dist/{index.framework-CkpC2U5b.js → index.framework-0Xpqk0Y0.js} +5219 -5209
- package/dist/index.framework-0Xpqk0Y0.js.map +1 -0
- package/dist/zango-crm-framework.js +2 -2
- package/dist/zango-crm-framework.umd.cjs +8 -8
- package/dist/zango-crm-framework.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/dist/index.framework-CkpC2U5b.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.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:ui-sans-serif,system-ui,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-500:oklch(63.7% .237 25.331);--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-50:oklch(97% .014 254.604);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--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-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-6xl:72rem;--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 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-tight:1.25;--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)}}@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,ui-sans-serif,system-ui,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{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}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.-top-2{top:calc(var(--spacing)*-2)}.top-0{top:calc(var(--spacing)*0)}.top-1\\.5{top:calc(var(--spacing)*1.5)}.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:calc(var(--spacing)*0)}.right-1{right:calc(var(--spacing)*1)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-\\[50\\%\\]{left:50%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.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:calc(var(--spacing)*0)!important}.m-0{margin:calc(var(--spacing)*0)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3\\.5{margin-inline:calc(var(--spacing)*3.5)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.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:calc(var(--spacing)*1)}.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)}.\\!mb-0{margin-bottom:calc(var(--spacing)*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:calc(var(--spacing)*0)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.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-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.mb-\\[18px\\]{margin-bottom:18px}.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-12{height:calc(var(--spacing)*12)!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-12{height:calc(var(--spacing)*12)}.h-32{height:calc(var(--spacing)*32)}.h-\\[42px\\]{height:42px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-96{max-height:calc(var(--spacing)*96)}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\\[8rem\\]{min-height:8rem}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[300px\\]{min-height:300px}.min-h-\\[400px\\]{min-height:400px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.\\!w-12{width:calc(var(--spacing)*12)!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-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\(--skeleton-width\\){max-width:var(--skeleton-width)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\\[150px\\]{max-width:150px}.max-w-\\[200px\\]{max-width:200px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*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-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-\\[-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}.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}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,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:calc(var(--spacing)*1)}.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)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}: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-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*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-y-auto{overflow-y:auto}.\\!rounded-\\[8px\\]{border-radius:8px!important}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.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-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-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-sidebar-border{border-color:var(--sidebar-border)}.border-yellow-300{border-color:var(--color-yellow-300)}.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-blue-50{background-color:var(--color-blue-50)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-900{background-color:var(--color-gray-900)}.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)}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.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-12{padding:calc(var(--spacing)*12)}.px-1{padding-inline:calc(var(--spacing)*1)}.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:calc(var(--spacing)*1)}.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-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)}.pt-4{padding-top:calc(var(--spacing)*4)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.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-3xl{font-size:var(--text-3xl)!important;line-height:var(--tw-leading,var(--text-3xl--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-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-\\[12px\\]{font-size:12px}.text-\\[40px\\]{font-size:40px}.\\!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-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}.whitespace-nowrap{white-space:nowrap}.\\!text-gray-800{color:var(--color-gray-800)!important}.\\!text-gray-900{color:var(--color-gray-900)!important}.\\!text-white{color:var(--color-white)!important}.text-blue-600{color:var(--color-blue-600)}.text-blue-800{color:var(--color-blue-800)}.text-gray-200{color:var(--color-gray-200)}.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-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.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,)}.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-\\[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-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-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.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}.running{animation-play-state:running}.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:calc(var(--spacing)*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:calc(var(--spacing)*0)}.group-data-\\[collapsible\\=offcanvas\\]\\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x:calc(var(--spacing)*0);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:calc(var(--spacing)*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:calc(var(--spacing)*1)}.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)}.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:calc(var(--spacing)*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:calc(var(--spacing)*0)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\\:-translate-y-0\\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.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-blue-700:hover{background-color:var(--color-blue-700)}.hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\\:text-gray-800:hover{color:var(--color-gray-800)}.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\\:shadow-lg:hover{--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)}.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\\: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-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-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)}.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}.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\\]\\: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(min-width:40rem){.sm\\:flex{display:flex}.sm\\:hidden{display:none}.sm\\:max-w-sm{max-width:var(--container-sm)}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@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:calc(var(--spacing)*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\\:w-1\\/2{width:50%}.lg\\:w-full{width:100%}}.\\[\\&_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\\]\\:hidden>button{display:none}.\\[\\&\\>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}*{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}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-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-font-weight{syntax:"*";inherits:false}@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))}}/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@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-border-style:solid;--tw-leading: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:""}}}.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}.top-\\[50\\%\\]{top:50%}.left-\\[50\\%\\]{left:50%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}.mx-auto{margin-inline:auto}.mt-auto{margin-top:auto}.mb-\\[18px\\]{margin-bottom:18px}.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}.h-\\[42px\\]{height:42px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.min-h-\\[8rem\\]{min-height:8rem}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[300px\\]{min-height:300px}.min-h-\\[400px\\]{min-height:400px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-\\(--sidebar-width\\){width:var(--sidebar-width)}.w-3\\/4{width:75%}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\(--skeleton-width\\){max-width:var(--skeleton-width)}.max-w-\\[150px\\]{max-width:150px}.max-w-\\[200px\\]{max-width:200px}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[180px\\]{min-width:180px}.flex-1{flex:1}.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-\\[-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}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,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}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.\\!rounded-\\[8px\\]{border-radius:8px!important}.rounded-\\[2px\\]{border-radius:2px}.rounded-full{border-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.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}.bg-transparent{background-color:#0000}.object-cover{object-fit:cover}.\\!text-center{text-align:center!important}.text-center{text-align:center}.text-left{text-align:left}.text-\\[12px\\]{font-size:12px}.text-\\[40px\\]{font-size:40px}.leading-none{--tw-leading:1;line-height:1}.text-balance{text-wrap:balance}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.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,)}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-70{opacity:.7}.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-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)}.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,ease);transition-duration:var(--tw-duration,0s)}.transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-\\[left\\,right\\,width\\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-\\[margin\\,opacity\\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-\\[width\\,height\\,padding\\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.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,ease);transition-duration:var(--tw-duration,0s)}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.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-data-\\[collapsible\\=icon\\]\\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\\[collapsible\\=icon\\]\\:w-\\(--sidebar-width-icon\\):is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\\[collapsible\\=icon\\]\\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.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-\\[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\\]\\: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\\]\\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.file\\:inline-flex::file-selector-button{display:inline-flex}.file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\\:bg-transparent::file-selector-button{background-color:#0000}.after\\:absolute:after{content:var(--tw-content);position:absolute}.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\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.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)}}.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-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-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)}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.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}.aria-disabled\\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\\:opacity-50[aria-disabled=true]{opacity:.5}.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-\\[state\\=closed\\]\\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\\[state\\=open\\]\\:opacity-100[data-state=open]{opacity:1}.data-\\[state\\=open\\]\\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&\\>button\\]\\:hidden>button{display:none}.\\[\\&\\>span\\:last-child\\]\\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\\[\\&\\>svg\\]\\:shrink-0>svg{flex-shrink:0}[data-side=left][data-state=collapsed] .\\[\\[data-side\\=left\\]\\[data-state\\=collapsed\\]_\\&\\]\\:cursor-e-resize{cursor:e-resize}[data-side=right][data-state=collapsed] .\\[\\[data-side\\=right\\]\\[data-state\\=collapsed\\]_\\&\\]\\:cursor-w-resize{cursor:w-resize}.brand-500{background-color:var(--color-brand-500)!important}.border-brand-500{border-color:var(--color-brand-500)!important}.login-tabs .ant-tabs-tab-active{border-bottom-width:2px!important;border-bottom-color:var(--color-brand-500)!important}.login-tabs .ant-tabs-ink-bar{background-color:var(--color-brand-500)!important}@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-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{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:""}[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-slot=sidebar]:not([data-collapsible=icon]) [data-slot=sidebar-footer]{padding:8px 12px}[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-inset]{overflow:hidden}.user-profile-drawer{position:fixed;top:0;right:-100%;width:100%;height:100vh;background-color:var(--zango-gray-50, #F9FAFB);transition:right .3s ease-in-out;z-index:1300;overflow:hidden;display:flex;flex-direction:column}.user-profile-drawer *{box-sizing:border-box}.user-profile-drawer.open{right:0}.profile-header-gradient{height:100px;background:linear-gradient(135deg,var(--color-brand-500, #5048ED) 0%,#7C3AED 50%,#EC4899 100%);position:relative}.profile-close-btn{position:absolute;top:16px;right:16px;background:#fff3;border:none;width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;color:#fff}.profile-close-btn:hover{background:#ffffff4d}.profile-info-section{background:#fff;padding:0 40px 20px;text-align:center;position:relative;border-bottom:1px solid var(--zango-gray-300, #E5E7EB);width:100%;box-sizing:border-box}.profile-avatar-container{margin-top:-40px;margin-bottom:12px}.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 4px 6px #0000001a;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-name-section{margin-bottom:0}.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:linear-gradient(135deg,#5048ed1a,#7c3aed1a,#ec48991a);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}.profile-main-content{flex:1;overflow-y:auto;overflow-x:hidden;padding:20px;display:flex;justify-content:center;width:100%;box-sizing:border-box}.profile-content-wrapper{background:#fff;border-radius:12px;padding:20px;width:100%;max-width:700px;margin:0 auto;box-shadow:0 1px 3px #0000001a;box-sizing:border-box;height:fit-content}.profile-tabs{display:flex;border-bottom:1px solid var(--zango-gray-300, #E5E7EB);margin-bottom:20px;width:100%;box-sizing:border-box}.profile-tab{padding:10px 20px;background:none;border:none;font-size:14px;font-weight:500;color:var(--zango-gray-600, #6B7280);cursor:pointer;position:relative;transition:all .2s ease}.profile-tab:hover{color:var(--zango-gray-700, #4B5563)}.profile-tab.active{color:var(--color-brand-500, #5048ED)}.profile-tab.active:after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:2px;background:var(--color-brand-500, #5048ED)}.profile-tab-content{padding:0;width:100%;box-sizing:border-box}.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}.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:linear-gradient(135deg,#5048ed0d,#7c3aed0d,#ec48990d);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}.header-container{height:56px;width:100%;background:#fff;justify-content:flex-end;border-bottom:1px solid #E9EAEB;align-items:center;padding:0 20px;display:flex;position:relative}.topbar-content{width:100%;display:flex;justify-content:space-between;align-items:center}.topbar-left,.topbar-right{display:flex;align-items:center;gap:16px}.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}.flex-row{flex-direction:row!important}.justify-content-between{justify-content:space-between!important}.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}@media(max-width:768px){.topbar{padding:0 16px}.profile-dropdown-menu{right:-16px}}.layout{height:100vh;min-height:100vh;overflow:hidden;background-color:var(--color-background, #ffffff)}.layout-content{flex:1;overflow-y:auto;background-color:var(--color-background, #ffffff);position:relative}.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}.layout-loading,.layout-error{display:flex;align-items:center;justify-content:center;height:100vh;font-size:18px;color:var(--color-Gray-700, #717680)}.layout-error{color:var(--color-error-500, #f04438)}@media(max-width:768px){.layout-content{padding:16px}}.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)}}.noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.d-flex{display:flex!important}.flex-column{flex-direction:column!important}.flex-grow-1{flex-grow:1!important}.p-0{padding:0!important}.dvh-100{height:100dvh!important}.complete-hidden-scroll-style::-webkit-scrollbar{display:none}.complete-hidden-scroll-style{-ms-overflow-style:none;scrollbar-width:none}.zango-loading{display:flex;align-items:center;justify-content:center;height:100vh;font-size:16px;color:#6d7280}.zango-no-menu{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100vh;padding:2rem;text-align:center;color:#374151}.zango-no-menu h2{font-size:1.5rem;font-weight:600;margin-bottom:.5rem;color:#1f2937}.zango-no-menu p{font-size:1rem;color:#6b7280;margin:0;max-width:400px}*{box-sizing:border-box}body{margin:0;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#root{height:100vh}`)),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.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:ui-sans-serif,system-ui,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-500:oklch(63.7% .237 25.331);--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-50:oklch(97% .014 254.604);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--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-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-6xl:72rem;--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 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-tight:1.25;--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)}}@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,ui-sans-serif,system-ui,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{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}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.-top-2{top:calc(var(--spacing)*-2)}.top-0{top:calc(var(--spacing)*0)}.top-1\\.5{top:calc(var(--spacing)*1.5)}.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:calc(var(--spacing)*0)}.right-1{right:calc(var(--spacing)*1)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-\\[50\\%\\]{left:50%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.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:calc(var(--spacing)*0)!important}.m-0{margin:calc(var(--spacing)*0)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3\\.5{margin-inline:calc(var(--spacing)*3.5)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.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:calc(var(--spacing)*1)}.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)}.\\!mb-0{margin-bottom:calc(var(--spacing)*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:calc(var(--spacing)*0)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.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-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.mb-\\[18px\\]{margin-bottom:18px}.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-12{height:calc(var(--spacing)*12)!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-12{height:calc(var(--spacing)*12)}.h-32{height:calc(var(--spacing)*32)}.h-\\[42px\\]{height:42px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-96{max-height:calc(var(--spacing)*96)}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\\[8rem\\]{min-height:8rem}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[300px\\]{min-height:300px}.min-h-\\[400px\\]{min-height:400px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.\\!w-12{width:calc(var(--spacing)*12)!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-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\(--skeleton-width\\){max-width:var(--skeleton-width)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\\[150px\\]{max-width:150px}.max-w-\\[200px\\]{max-width:200px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*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-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-\\[-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}.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}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,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:calc(var(--spacing)*1)}.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)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}: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-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*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-y-auto{overflow-y:auto}.\\!rounded-\\[8px\\]{border-radius:8px!important}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.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-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-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-sidebar-border{border-color:var(--sidebar-border)}.border-yellow-300{border-color:var(--color-yellow-300)}.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-blue-50{background-color:var(--color-blue-50)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-900{background-color:var(--color-gray-900)}.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)}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.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-12{padding:calc(var(--spacing)*12)}.px-1{padding-inline:calc(var(--spacing)*1)}.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:calc(var(--spacing)*1)}.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-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)}.pt-4{padding-top:calc(var(--spacing)*4)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.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-3xl{font-size:var(--text-3xl)!important;line-height:var(--tw-leading,var(--text-3xl--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-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-\\[12px\\]{font-size:12px}.text-\\[40px\\]{font-size:40px}.\\!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-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}.whitespace-nowrap{white-space:nowrap}.\\!text-gray-800{color:var(--color-gray-800)!important}.\\!text-gray-900{color:var(--color-gray-900)!important}.\\!text-white{color:var(--color-white)!important}.text-blue-600{color:var(--color-blue-600)}.text-blue-800{color:var(--color-blue-800)}.text-gray-200{color:var(--color-gray-200)}.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-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.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,)}.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-\\[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-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-sidebar-ring{--tw-ring-color:var(--sidebar-ring)}.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}.running{animation-play-state:running}.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:calc(var(--spacing)*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:calc(var(--spacing)*0)}.group-data-\\[collapsible\\=offcanvas\\]\\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x:calc(var(--spacing)*0);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:calc(var(--spacing)*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:calc(var(--spacing)*1)}.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)}.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:calc(var(--spacing)*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:calc(var(--spacing)*0)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\\:-translate-y-0\\.5:hover{--tw-translate-y:calc(var(--spacing)*-.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.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-blue-700:hover{background-color:var(--color-blue-700)}.hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}.hover\\:text-gray-800:hover{color:var(--color-gray-800)}.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\\:shadow-lg:hover{--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)}.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\\: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-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-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)}.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}.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\\]\\: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(min-width:40rem){.sm\\:flex{display:flex}.sm\\:hidden{display:none}.sm\\:max-w-sm{max-width:var(--container-sm)}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@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:calc(var(--spacing)*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\\:w-1\\/2{width:50%}.lg\\:w-full{width:100%}}.\\[\\&_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\\]\\:hidden>button{display:none}.\\[\\&\\>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}*{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}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-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-font-weight{syntax:"*";inherits:false}@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))}}/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@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-border-style:solid;--tw-leading: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:""}}}.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}.top-\\[50\\%\\]{top:50%}.left-\\[50\\%\\]{left:50%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}.mx-auto{margin-inline:auto}.mt-auto{margin-top:auto}.mb-\\[18px\\]{margin-bottom:18px}.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}.h-\\[42px\\]{height:42px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.min-h-\\[8rem\\]{min-height:8rem}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[300px\\]{min-height:300px}.min-h-\\[400px\\]{min-height:400px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-\\(--sidebar-width\\){width:var(--sidebar-width)}.w-3\\/4{width:75%}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\(--skeleton-width\\){max-width:var(--skeleton-width)}.max-w-\\[150px\\]{max-width:150px}.max-w-\\[200px\\]{max-width:200px}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[180px\\]{min-width:180px}.flex-1{flex:1}.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-\\[-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}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,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}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.\\!rounded-\\[8px\\]{border-radius:8px!important}.rounded-\\[2px\\]{border-radius:2px}.rounded-full{border-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.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}.bg-transparent{background-color:#0000}.object-cover{object-fit:cover}.\\!text-center{text-align:center!important}.text-center{text-align:center}.text-left{text-align:left}.text-\\[12px\\]{font-size:12px}.text-\\[40px\\]{font-size:40px}.leading-none{--tw-leading:1;line-height:1}.text-balance{text-wrap:balance}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.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,)}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-70{opacity:.7}.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-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)}.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,ease);transition-duration:var(--tw-duration,0s)}.transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-\\[left\\,right\\,width\\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-\\[margin\\,opacity\\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-\\[width\\,height\\,padding\\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.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,ease);transition-duration:var(--tw-duration,0s)}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,ease);transition-duration:var(--tw-duration,0s)}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.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-data-\\[collapsible\\=icon\\]\\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\\[collapsible\\=icon\\]\\:w-\\(--sidebar-width-icon\\):is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\\[collapsible\\=icon\\]\\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.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-\\[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\\]\\: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\\]\\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.file\\:inline-flex::file-selector-button{display:inline-flex}.file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\\:bg-transparent::file-selector-button{background-color:#0000}.after\\:absolute:after{content:var(--tw-content);position:absolute}.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\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.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)}}.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-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-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)}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.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}.aria-disabled\\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\\:opacity-50[aria-disabled=true]{opacity:.5}.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-\\[state\\=closed\\]\\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\\[state\\=open\\]\\:opacity-100[data-state=open]{opacity:1}.data-\\[state\\=open\\]\\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&\\>button\\]\\:hidden>button{display:none}.\\[\\&\\>span\\:last-child\\]\\:truncate>span:last-child{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\\[\\&\\>svg\\]\\:shrink-0>svg{flex-shrink:0}[data-side=left][data-state=collapsed] .\\[\\[data-side\\=left\\]\\[data-state\\=collapsed\\]_\\&\\]\\:cursor-e-resize{cursor:e-resize}[data-side=right][data-state=collapsed] .\\[\\[data-side\\=right\\]\\[data-state\\=collapsed\\]_\\&\\]\\:cursor-w-resize{cursor:w-resize}.brand-500{background-color:var(--color-brand-500)!important}.border-brand-500{border-color:var(--color-brand-500)!important}.login-tabs .ant-tabs-tab-active{border-bottom-width:2px!important;border-bottom-color:var(--color-brand-500)!important}.login-tabs .ant-tabs-ink-bar{background-color:var(--color-brand-500)!important}@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-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{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:""}[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-inset]{overflow:hidden}.user-profile-drawer{position:fixed;top:0;right:-100%;width:100%;height:100vh;background-color:var(--zango-gray-50, #F9FAFB);transition:right .3s ease-in-out;z-index:1300;overflow:hidden;display:flex;flex-direction:column}.user-profile-drawer *{box-sizing:border-box}.user-profile-drawer.open{right:0}.profile-header-gradient{height:100px;background:linear-gradient(135deg,var(--color-brand-500, #5048ED) 0%,#7C3AED 50%,#EC4899 100%);position:relative}.profile-close-btn{position:absolute;top:16px;right:16px;background:#fff3;border:none;width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;color:#fff}.profile-close-btn:hover{background:#ffffff4d}.profile-info-section{background:#fff;padding:0 40px 20px;text-align:center;position:relative;border-bottom:1px solid var(--zango-gray-300, #E5E7EB);width:100%;box-sizing:border-box}.profile-avatar-container{margin-top:-40px;margin-bottom:12px}.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 4px 6px #0000001a;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-name-section{margin-bottom:0}.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:linear-gradient(135deg,#5048ed1a,#7c3aed1a,#ec48991a);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}.profile-main-content{flex:1;overflow-y:auto;overflow-x:hidden;padding:20px;display:flex;justify-content:center;width:100%;box-sizing:border-box}.profile-content-wrapper{background:#fff;border-radius:12px;padding:20px;width:100%;max-width:700px;margin:0 auto;box-shadow:0 1px 3px #0000001a;box-sizing:border-box;height:fit-content}.profile-tabs{display:flex;border-bottom:1px solid var(--zango-gray-300, #E5E7EB);margin-bottom:20px;width:100%;box-sizing:border-box}.profile-tab{padding:10px 20px;background:none;border:none;font-size:14px;font-weight:500;color:var(--zango-gray-600, #6B7280);cursor:pointer;position:relative;transition:all .2s ease}.profile-tab:hover{color:var(--zango-gray-700, #4B5563)}.profile-tab.active{color:var(--color-brand-500, #5048ED)}.profile-tab.active:after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:2px;background:var(--color-brand-500, #5048ED)}.profile-tab-content{padding:0;width:100%;box-sizing:border-box}.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}.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:linear-gradient(135deg,#5048ed0d,#7c3aed0d,#ec48990d);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}.header-container{height:56px;width:100%;background:#fff;justify-content:flex-end;border-bottom:1px solid #E9EAEB;align-items:center;padding:0 20px;display:flex;position:relative}.topbar-content{width:100%;display:flex;justify-content:space-between;align-items:center}.topbar-left,.topbar-right{display:flex;align-items:center;gap:16px}.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}.flex-row{flex-direction:row!important}.justify-content-between{justify-content:space-between!important}.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}@media(max-width:768px){.topbar{padding:0 16px}.profile-dropdown-menu{right:-16px}}.layout{height:100vh;min-height:100vh;overflow:hidden;background-color:var(--color-background, #ffffff)}.layout-content{flex:1;overflow-y:auto;background-color:var(--color-background, #ffffff);position:relative}.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}.layout-loading,.layout-error{display:flex;align-items:center;justify-content:center;height:100vh;font-size:18px;color:var(--color-Gray-700, #717680)}.layout-error{color:var(--color-error-500, #f04438)}@media(max-width:768px){.layout-content{padding:16px}}.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)}}.noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.d-flex{display:flex!important}.flex-column{flex-direction:column!important}.flex-grow-1{flex-grow:1!important}.p-0{padding:0!important}.dvh-100{height:100dvh!important}.complete-hidden-scroll-style::-webkit-scrollbar{display:none}.complete-hidden-scroll-style{-ms-overflow-style:none;scrollbar-width:none}.zango-loading{display:flex;align-items:center;justify-content:center;height:100vh;font-size:16px;color:#6d7280}.zango-no-menu{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100vh;padding:2rem;text-align:center;color:#374151}.zango-no-menu h2{font-size:1.5rem;font-weight:600;margin-bottom:.5rem;color:#1f2937}.zango-no-menu p{font-size:1rem;color:#6b7280;margin:0;max-width:400px}*{box-sizing:border-box}body{margin:0;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#root{height:100vh}`)),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
2
|
(function(K,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react/jsx-runtime"),require("react"),require("react-router-dom"),require("react-dom"),require("@zango-core/components")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-router-dom","react-dom","@zango-core/components"],i):(K=typeof globalThis<"u"?globalThis:K||self,i(K.ZangoCRMFramework={},K["react/jsx-runtime"],K.React,K.ReactRouterDOM,K.ReactDOM,K.components))})(this,(function(K,i,b,R,Dl,A){"use strict";function Il(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 C=Il(b),Vl=Il(Dl);/**
|
|
3
3
|
* @license lucide-react v0.575.0 - ISC
|
|
4
4
|
*
|
|
@@ -172,11 +172,11 @@
|
|
|
172
172
|
`)},Ef=function(){var e=parseInt(document.body.getAttribute(jr)||"0",10);return isFinite(e)?e:0},jx=function(){C.useEffect(function(){return document.body.setAttribute(jr,(Ef()+1).toString()),function(){var e=Ef()-1;e<=0?document.body.removeAttribute(jr):document.body.setAttribute(jr,e.toString())}},[])},zx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;jx();var o=C.useMemo(function(){return Bx(s)},[s]);return C.createElement(Ux,{styles:$x(o,!t,s,r?"":"!important")})},ii=!1;if(typeof window<"u")try{var Ms=Object.defineProperty({},"passive",{get:function(){return ii=!0,!0}});window.addEventListener("test",Ms,Ms),window.removeEventListener("test",Ms,Ms)}catch{ii=!1}var zr=ii?{passive:!1}:!1,Hx=function(e){return e.tagName==="TEXTAREA"},Tf=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Hx(e)&&r[t]==="visible")},Wx=function(e){return Tf(e,"overflowY")},qx=function(e){return Tf(e,"overflowX")},Af=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=kf(e,n);if(s){var o=_f(e,n),a=o[1],l=o[2];if(a>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Kx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Gx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},kf=function(e,t){return e==="v"?Wx(t):qx(t)},_f=function(e,t){return e==="v"?Kx(t):Gx(t)},Xx=function(e,t){return e==="h"&&t==="rtl"?-1:1},Yx=function(e,t,r,n,s){var o=Xx(e,window.getComputedStyle(t).direction),a=o*n,l=r.target,d=t.contains(l),c=!1,u=a>0,f=0,p=0;do{if(!l)break;var h=_f(e,l),m=h[0],g=h[1],y=h[2],w=g-y-o*m;(m||w)&&kf(e,l)&&(f+=w,p+=m);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!d&&l!==document.body||d&&(t.contains(l)||t===l));return(u&&Math.abs(f)<1||!u&&Math.abs(p)<1)&&(c=!0),c},Ns=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Mf=function(e){return[e.deltaX,e.deltaY]},Nf=function(e){return e&&"current"in e?e.current:e},Zx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Jx=function(e){return`
|
|
173
173
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
174
174
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
175
|
-
`)},Qx=0,Hr=[];function Rx(e){var t=C.useRef([]),r=C.useRef([0,0]),n=C.useRef(),s=C.useState(Qx++)[0],o=C.useState(Pf)[0],a=C.useRef(e);C.useEffect(function(){a.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=vx([e.lockRef.current],(e.shards||[]).map(Nf),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=C.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var w=Ns(g),v=r.current,x="deltaX"in g?g.deltaX:v[0]-w[0],S="deltaY"in g?g.deltaY:v[1]-w[1],T,k=g.target,M=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in g&&M==="h"&&k.type==="range")return!1;var P=Af(M,k);if(!P)return!0;if(P?T=M:(T=M==="v"?"h":"v",P=Af(M,k)),!P)return!1;if(!n.current&&"changedTouches"in g&&(x||S)&&(n.current=T),!T)return!0;var N=n.current||T;return Yx(N,y,g,N==="h"?x:S)},[]),d=C.useCallback(function(g){var y=g;if(!(!Hr.length||Hr[Hr.length-1]!==o)){var w="deltaY"in y?Mf(y):Ns(y),v=t.current.filter(function(T){return T.name===y.type&&(T.target===y.target||y.target===T.shadowParent)&&Zx(T.delta,w)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(a.current.shards||[]).map(Nf).filter(Boolean).filter(function(T){return T.contains(y.target)}),S=x.length>0?l(y,x[0]):!a.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),c=C.useCallback(function(g,y,w,v){var x={name:g,delta:y,target:w,should:v,shadowParent:e2(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=C.useCallback(function(g){r.current=Ns(g),n.current=void 0},[]),f=C.useCallback(function(g){c(g.type,Mf(g),g.target,l(g,e.lockRef.current))},[]),p=C.useCallback(function(g){c(g.type,Ns(g),g.target,l(g,e.lockRef.current))},[]);C.useEffect(function(){return Hr.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",d,zr),document.addEventListener("touchmove",d,zr),document.addEventListener("touchstart",u,zr),function(){Hr=Hr.filter(function(g){return g!==o}),document.removeEventListener("wheel",d,zr),document.removeEventListener("touchmove",d,zr),document.removeEventListener("touchstart",u,zr)}},[]);var h=e.removeScrollBar,m=e.inert;return C.createElement(C.Fragment,null,m?C.createElement(o,{styles:Jx(s)}):null,h?C.createElement(zx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function e2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const t2=_x(Sf,Rx);var li=C.forwardRef(function(e,t){return C.createElement(_s,Et({},e,{ref:t,sideCar:t2}))});li.classNames=_s.classNames;var r2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Wr=new WeakMap,Ls=new WeakMap,Os={},ci=0,Lf=function(e){return e&&(e.host||Lf(e.parentNode))},n2=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Lf(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})},s2=function(e,t,r,n){var s=n2(t,Array.isArray(e)?e:[e]);Os[r]||(Os[r]=new WeakMap);var o=Os[r],a=[],l=new Set,d=new Set(s),c=function(f){!f||l.has(f)||(l.add(f),c(f.parentNode))};s.forEach(c);var u=function(f){!f||d.has(f)||Array.prototype.forEach.call(f.children,function(p){if(l.has(p))u(p);else try{var h=p.getAttribute(n),m=h!==null&&h!=="false",g=(Wr.get(p)||0)+1,y=(o.get(p)||0)+1;Wr.set(p,g),o.set(p,y),a.push(p),g===1&&m&&Ls.set(p,!0),y===1&&p.setAttribute(r,"true"),m||p.setAttribute(n,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return u(t),l.clear(),ci++,function(){a.forEach(function(f){var p=Wr.get(f)-1,h=o.get(f)-1;Wr.set(f,p),o.set(f,h),p||(Ls.has(f)||f.removeAttribute(n),Ls.delete(f)),h||f.removeAttribute(r)}),ci--,ci||(Wr=new WeakMap,Wr=new WeakMap,Ls=new WeakMap,Os={})}},Of=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=r2(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),s2(n,s,r,"aria-hidden")):function(){return null}},Fs="Dialog",[Ff]=Yt(Fs),[o2,ft]=Ff(Fs),Df=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=C.useRef(null),d=C.useRef(null),[c,u]=wn({prop:n,defaultProp:s??!1,onChange:o,caller:Fs});return i.jsx(o2,{scope:t,triggerRef:l,contentRef:d,contentId:Zt(),titleId:Zt(),descriptionId:Zt(),open:c,onOpenChange:u,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),modal:a,children:r})};Df.displayName=Fs;var If="DialogTrigger",a2=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ft(If,r),o=Te(t,s.triggerRef);return i.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":fi(s.open),...n,ref:o,onClick:oe(e.onClick,s.onOpenToggle)})});a2.displayName=If;var di="DialogPortal",[i2,Vf]=Ff(di,{forceMount:void 0}),Bf=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=ft(di,t);return i.jsx(i2,{scope:t,forceMount:r,children:C.Children.map(n,a=>i.jsx(ut,{present:r||o.open,children:i.jsx(Ts,{asChild:!0,container:s,children:a})}))})};Bf.displayName=di;var Ds="DialogOverlay",Uf=C.forwardRef((e,t)=>{const r=Vf(Ds,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=ft(Ds,e.__scopeDialog);return o.modal?i.jsx(ut,{present:n||o.open,children:i.jsx(c2,{...s,ref:t})}):null});Uf.displayName=Ds;var l2=$r("DialogOverlay.RemoveScroll"),c2=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ft(Ds,r);return i.jsx(li,{as:l2,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(be.div,{"data-state":fi(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),pr="DialogContent",$f=C.forwardRef((e,t)=>{const r=Vf(pr,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=ft(pr,e.__scopeDialog);return i.jsx(ut,{present:n||o.open,children:o.modal?i.jsx(d2,{...s,ref:t}):i.jsx(u2,{...s,ref:t})})});$f.displayName=pr;var d2=C.forwardRef((e,t)=>{const r=ft(pr,e.__scopeDialog),n=C.useRef(null),s=Te(t,r.contentRef,n);return C.useEffect(()=>{const o=n.current;if(o)return Of(o)},[]),i.jsx(jf,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(e.onCloseAutoFocus,o=>{o.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:oe(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&o.preventDefault()}),onFocusOutside:oe(e.onFocusOutside,o=>o.preventDefault())})}),u2=C.forwardRef((e,t)=>{const r=ft(pr,e.__scopeDialog),n=C.useRef(!1),s=C.useRef(!1);return i.jsx(jf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(n.current||r.triggerRef.current?.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;r.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),jf=C.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,l=ft(pr,r),d=C.useRef(null),c=Te(t,d);return wf(),i.jsxs(i.Fragment,{children:[i.jsx(ri,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx(Es,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":fi(l.open),...a,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(f2,{titleId:l.titleId}),i.jsx(p2,{contentRef:d,descriptionId:l.descriptionId})]})]})}),ui="DialogTitle",zf=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ft(ui,r);return i.jsx(be.h2,{id:s.titleId,...n,ref:t})});zf.displayName=ui;var Hf="DialogDescription",Wf=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ft(Hf,r);return i.jsx(be.p,{id:s.descriptionId,...n,ref:t})});Wf.displayName=Hf;var qf="DialogClose",Kf=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ft(qf,r);return i.jsx(be.button,{type:"button",...n,ref:t,onClick:oe(e.onClick,()=>s.onOpenChange(!1))})});Kf.displayName=qf;function fi(e){return e?"open":"closed"}var Gf="DialogTitleWarning",[
|
|
175
|
+
`)},Qx=0,Hr=[];function Rx(e){var t=C.useRef([]),r=C.useRef([0,0]),n=C.useRef(),s=C.useState(Qx++)[0],o=C.useState(Pf)[0],a=C.useRef(e);C.useEffect(function(){a.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=vx([e.lockRef.current],(e.shards||[]).map(Nf),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=C.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var w=Ns(g),v=r.current,x="deltaX"in g?g.deltaX:v[0]-w[0],S="deltaY"in g?g.deltaY:v[1]-w[1],T,k=g.target,M=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in g&&M==="h"&&k.type==="range")return!1;var P=Af(M,k);if(!P)return!0;if(P?T=M:(T=M==="v"?"h":"v",P=Af(M,k)),!P)return!1;if(!n.current&&"changedTouches"in g&&(x||S)&&(n.current=T),!T)return!0;var N=n.current||T;return Yx(N,y,g,N==="h"?x:S)},[]),d=C.useCallback(function(g){var y=g;if(!(!Hr.length||Hr[Hr.length-1]!==o)){var w="deltaY"in y?Mf(y):Ns(y),v=t.current.filter(function(T){return T.name===y.type&&(T.target===y.target||y.target===T.shadowParent)&&Zx(T.delta,w)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(a.current.shards||[]).map(Nf).filter(Boolean).filter(function(T){return T.contains(y.target)}),S=x.length>0?l(y,x[0]):!a.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),c=C.useCallback(function(g,y,w,v){var x={name:g,delta:y,target:w,should:v,shadowParent:e2(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=C.useCallback(function(g){r.current=Ns(g),n.current=void 0},[]),f=C.useCallback(function(g){c(g.type,Mf(g),g.target,l(g,e.lockRef.current))},[]),p=C.useCallback(function(g){c(g.type,Ns(g),g.target,l(g,e.lockRef.current))},[]);C.useEffect(function(){return Hr.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",d,zr),document.addEventListener("touchmove",d,zr),document.addEventListener("touchstart",u,zr),function(){Hr=Hr.filter(function(g){return g!==o}),document.removeEventListener("wheel",d,zr),document.removeEventListener("touchmove",d,zr),document.removeEventListener("touchstart",u,zr)}},[]);var h=e.removeScrollBar,m=e.inert;return C.createElement(C.Fragment,null,m?C.createElement(o,{styles:Jx(s)}):null,h?C.createElement(zx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function e2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const t2=_x(Sf,Rx);var li=C.forwardRef(function(e,t){return C.createElement(_s,Et({},e,{ref:t,sideCar:t2}))});li.classNames=_s.classNames;var r2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Wr=new WeakMap,Ls=new WeakMap,Os={},ci=0,Lf=function(e){return e&&(e.host||Lf(e.parentNode))},n2=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Lf(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})},s2=function(e,t,r,n){var s=n2(t,Array.isArray(e)?e:[e]);Os[r]||(Os[r]=new WeakMap);var o=Os[r],a=[],l=new Set,d=new Set(s),c=function(f){!f||l.has(f)||(l.add(f),c(f.parentNode))};s.forEach(c);var u=function(f){!f||d.has(f)||Array.prototype.forEach.call(f.children,function(p){if(l.has(p))u(p);else try{var h=p.getAttribute(n),m=h!==null&&h!=="false",g=(Wr.get(p)||0)+1,y=(o.get(p)||0)+1;Wr.set(p,g),o.set(p,y),a.push(p),g===1&&m&&Ls.set(p,!0),y===1&&p.setAttribute(r,"true"),m||p.setAttribute(n,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return u(t),l.clear(),ci++,function(){a.forEach(function(f){var p=Wr.get(f)-1,h=o.get(f)-1;Wr.set(f,p),o.set(f,h),p||(Ls.has(f)||f.removeAttribute(n),Ls.delete(f)),h||f.removeAttribute(r)}),ci--,ci||(Wr=new WeakMap,Wr=new WeakMap,Ls=new WeakMap,Os={})}},Of=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=r2(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),s2(n,s,r,"aria-hidden")):function(){return null}},Fs="Dialog",[Ff]=Yt(Fs),[o2,ft]=Ff(Fs),Df=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=C.useRef(null),d=C.useRef(null),[c,u]=wn({prop:n,defaultProp:s??!1,onChange:o,caller:Fs});return i.jsx(o2,{scope:t,triggerRef:l,contentRef:d,contentId:Zt(),titleId:Zt(),descriptionId:Zt(),open:c,onOpenChange:u,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),modal:a,children:r})};Df.displayName=Fs;var If="DialogTrigger",a2=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ft(If,r),o=Te(t,s.triggerRef);return i.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":fi(s.open),...n,ref:o,onClick:oe(e.onClick,s.onOpenToggle)})});a2.displayName=If;var di="DialogPortal",[i2,Vf]=Ff(di,{forceMount:void 0}),Bf=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=ft(di,t);return i.jsx(i2,{scope:t,forceMount:r,children:C.Children.map(n,a=>i.jsx(ut,{present:r||o.open,children:i.jsx(Ts,{asChild:!0,container:s,children:a})}))})};Bf.displayName=di;var Ds="DialogOverlay",Uf=C.forwardRef((e,t)=>{const r=Vf(Ds,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=ft(Ds,e.__scopeDialog);return o.modal?i.jsx(ut,{present:n||o.open,children:i.jsx(c2,{...s,ref:t})}):null});Uf.displayName=Ds;var l2=$r("DialogOverlay.RemoveScroll"),c2=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ft(Ds,r);return i.jsx(li,{as:l2,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(be.div,{"data-state":fi(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),pr="DialogContent",$f=C.forwardRef((e,t)=>{const r=Vf(pr,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=ft(pr,e.__scopeDialog);return i.jsx(ut,{present:n||o.open,children:o.modal?i.jsx(d2,{...s,ref:t}):i.jsx(u2,{...s,ref:t})})});$f.displayName=pr;var d2=C.forwardRef((e,t)=>{const r=ft(pr,e.__scopeDialog),n=C.useRef(null),s=Te(t,r.contentRef,n);return C.useEffect(()=>{const o=n.current;if(o)return Of(o)},[]),i.jsx(jf,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(e.onCloseAutoFocus,o=>{o.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:oe(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&o.preventDefault()}),onFocusOutside:oe(e.onFocusOutside,o=>o.preventDefault())})}),u2=C.forwardRef((e,t)=>{const r=ft(pr,e.__scopeDialog),n=C.useRef(!1),s=C.useRef(!1);return i.jsx(jf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(n.current||r.triggerRef.current?.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;r.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),jf=C.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,l=ft(pr,r),d=C.useRef(null),c=Te(t,d);return wf(),i.jsxs(i.Fragment,{children:[i.jsx(ri,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx(Es,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":fi(l.open),...a,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(f2,{titleId:l.titleId}),i.jsx(p2,{contentRef:d,descriptionId:l.descriptionId})]})]})}),ui="DialogTitle",zf=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ft(ui,r);return i.jsx(be.h2,{id:s.titleId,...n,ref:t})});zf.displayName=ui;var Hf="DialogDescription",Wf=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ft(Hf,r);return i.jsx(be.p,{id:s.descriptionId,...n,ref:t})});Wf.displayName=Hf;var qf="DialogClose",Kf=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ft(qf,r);return i.jsx(be.button,{type:"button",...n,ref:t,onClick:oe(e.onClick,()=>s.onOpenChange(!1))})});Kf.displayName=qf;function fi(e){return e?"open":"closed"}var Gf="DialogTitleWarning",[jT,Xf]=Hv(Gf,{contentName:pr,titleName:ui,docsSlug:"dialog"}),f2=({titleId:e})=>{const t=Xf(Gf),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
176
176
|
|
|
177
177
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
178
178
|
|
|
179
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},h2="DialogDescriptionWarning",p2=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xf(h2).contentName}}.`;return C.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},hi=Df,pi=Bf,mi=Uf,gi=$f,yi=zf,m2=Wf,g2=Kf;function y2(e){const[t,r]=C.useState(void 0);return It(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,l;if("borderBoxSize"in o){const d=o.borderBoxSize,c=Array.isArray(d)?d[0]:d;a=c.inlineSize,l=c.blockSize}else a=e.offsetWidth,l=e.offsetHeight;r({width:a,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}const w2=["top","right","bottom","left"],Qt=Math.min,Re=Math.max,Is=Math.round,Vs=Math.floor,Tt=e=>({x:e,y:e}),b2={left:"right",right:"left",bottom:"top",top:"bottom"},v2={start:"end",end:"start"};function wi(e,t,r){return Re(e,Qt(t,r))}function Bt(e,t){return typeof e=="function"?e(t):e}function Ut(e){return e.split("-")[0]}function qr(e){return e.split("-")[1]}function bi(e){return e==="x"?"y":"x"}function vi(e){return e==="y"?"height":"width"}const x2=new Set(["top","bottom"]);function At(e){return x2.has(Ut(e))?"y":"x"}function xi(e){return bi(At(e))}function C2(e,t,r){r===void 0&&(r=!1);const n=qr(e),s=xi(e),o=vi(s);let a=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Bs(a)),[a,Bs(a)]}function S2(e){const t=Bs(e);return[Ci(e),t,Ci(t)]}function Ci(e){return e.replace(/start|end/g,t=>v2[t])}const Yf=["left","right"],Zf=["right","left"],P2=["top","bottom"],E2=["bottom","top"];function T2(e,t,r){switch(e){case"top":case"bottom":return r?t?Zf:Yf:t?Yf:Zf;case"left":case"right":return t?P2:E2;default:return[]}}function A2(e,t,r,n){const s=qr(e);let o=T2(Ut(e),r==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Ci)))),o}function Bs(e){return e.replace(/left|right|bottom|top/g,t=>b2[t])}function k2(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jf(e){return typeof e!="number"?k2(e):{top:e,right:e,bottom:e,left:e}}function Us(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Qf(e,t,r){let{reference:n,floating:s}=e;const o=At(t),a=xi(t),l=vi(a),d=Ut(t),c=o==="y",u=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,p=n[l]/2-s[l]/2;let h;switch(d){case"top":h={x:u,y:n.y-s.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-s.width,y:f};break;default:h={x:n.x,y:n.y}}switch(qr(t)){case"start":h[a]-=p*(r&&c?-1:1);break;case"end":h[a]+=p*(r&&c?-1:1);break}return h}const _2=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=Qf(c,n,d),p=n,h={},m=0;for(let g=0;g<l.length;g++){const{name:y,fn:w}=l[g],{x:v,y:x,data:S,reset:T}=await w({x:u,y:f,initialPlacement:n,placement:p,strategy:s,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=v??u,f=x??f,h={...h,[y]:{...h[y],...S}},T&&m<=50&&(m++,typeof T=="object"&&(T.placement&&(p=T.placement),T.rects&&(c=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):T.rects),{x:u,y:f}=Qf(c,p,d)),g=-1)}return{x:u,y:f,placement:p,strategy:s,middlewareData:h}};async function bn(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:a,elements:l,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Bt(t,e),m=Jf(h),y=l[p?f==="floating"?"reference":"floating":f],w=Us(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(y)))==null||r?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:d})),v=f==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),S=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},T=Us(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:x,strategy:d}):v);return{top:(w.top-T.top+m.top)/S.y,bottom:(T.bottom-w.bottom+m.bottom)/S.y,left:(w.left-T.left+m.left)/S.x,right:(T.right-w.right+m.right)/S.x}}const M2=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:a,elements:l,middlewareData:d}=t,{element:c,padding:u=0}=Bt(e,t)||{};if(c==null)return{};const f=Jf(u),p={x:r,y:n},h=xi(s),m=vi(h),g=await a.getDimensions(c),y=h==="y",w=y?"top":"left",v=y?"bottom":"right",x=y?"clientHeight":"clientWidth",S=o.reference[m]+o.reference[h]-p[h]-o.floating[m],T=p[h]-o.reference[h],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let M=k?k[x]:0;(!M||!await(a.isElement==null?void 0:a.isElement(k)))&&(M=l.floating[x]||o.floating[m]);const P=S/2-T/2,N=M/2-g[m]/2-1,D=Qt(f[w],N),V=Qt(f[v],N),O=D,L=M-g[m]-V,_=M/2-g[m]/2+P,B=wi(O,_,L),F=!d.arrow&&qr(s)!=null&&_!==B&&o.reference[m]/2-(_<O?D:V)-g[m]/2<0,W=F?_<O?_-O:_-L:0;return{[h]:p[h]+W,data:{[h]:B,centerOffset:_-B-W,...F&&{alignmentOffset:W}},reset:F}}}),N2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:a,initialPlacement:l,platform:d,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Bt(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const w=Ut(s),v=At(l),x=Ut(l)===l,S=await(d.isRTL==null?void 0:d.isRTL(c.floating)),T=p||(x||!g?[Bs(l)]:S2(l)),k=m!=="none";!p&&k&&T.push(...A2(l,g,m,S));const M=[l,...T],P=await bn(t,y),N=[];let D=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&N.push(P[w]),f){const _=C2(s,a,S);N.push(P[_[0]],P[_[1]])}if(D=[...D,{placement:s,overflows:N}],!N.every(_=>_<=0)){var V,O;const _=(((V=o.flip)==null?void 0:V.index)||0)+1,B=M[_];if(B&&(!(f==="alignment"?v!==At(B):!1)||D.every($=>At($.placement)===v?$.overflows[0]>0:!0)))return{data:{index:_,overflows:D},reset:{placement:B}};let F=(O=D.filter(W=>W.overflows[0]<=0).sort((W,$)=>W.overflows[1]-$.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(h){case"bestFit":{var L;const W=(L=D.filter($=>{if(k){const j=At($.placement);return j===v||j==="y"}return!0}).map($=>[$.placement,$.overflows.filter(j=>j>0).reduce((j,E)=>j+E,0)]).sort(($,j)=>$[1]-j[1])[0])==null?void 0:L[0];W&&(F=W);break}case"initialPlacement":F=l;break}if(s!==F)return{reset:{placement:F}}}return{}}}};function Rf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eh(e){return w2.some(t=>e[t]>=0)}const L2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=Bt(e,t);switch(n){case"referenceHidden":{const o=await bn(t,{...s,elementContext:"reference"}),a=Rf(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:eh(a)}}}case"escaped":{const o=await bn(t,{...s,altBoundary:!0}),a=Rf(o,r.floating);return{data:{escapedOffsets:a,escaped:eh(a)}}}default:return{}}}}},th=new Set(["left","top"]);async function O2(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=Ut(r),l=qr(r),d=At(r)==="y",c=th.has(a)?-1:1,u=o&&d?-1:1,f=Bt(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof m=="number"&&(h=l==="end"?m*-1:m),d?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const F2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:a,middlewareData:l}=t,d=await O2(t,e);return a===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+d.x,y:o+d.y,data:{...d,placement:a}}}}},D2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:w,y:v}=y;return{x:w,y:v}}},...d}=Bt(e,t),c={x:r,y:n},u=await bn(t,d),f=At(Ut(s)),p=bi(f);let h=c[p],m=c[f];if(o){const y=p==="y"?"top":"left",w=p==="y"?"bottom":"right",v=h+u[y],x=h-u[w];h=wi(v,h,x)}if(a){const y=f==="y"?"top":"left",w=f==="y"?"bottom":"right",v=m+u[y],x=m-u[w];m=wi(v,m,x)}const g=l.fn({...t,[p]:h,[f]:m});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[p]:o,[f]:a}}}}}},I2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:a}=t,{offset:l=0,mainAxis:d=!0,crossAxis:c=!0}=Bt(e,t),u={x:r,y:n},f=At(s),p=bi(f);let h=u[p],m=u[f];const g=Bt(l,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(d){const x=p==="y"?"height":"width",S=o.reference[p]-o.floating[x]+y.mainAxis,T=o.reference[p]+o.reference[x]-y.mainAxis;h<S?h=S:h>T&&(h=T)}if(c){var w,v;const x=p==="y"?"width":"height",S=th.has(Ut(s)),T=o.reference[f]-o.floating[x]+(S&&((w=a.offset)==null?void 0:w[f])||0)+(S?0:y.crossAxis),k=o.reference[f]+o.reference[x]+(S?0:((v=a.offset)==null?void 0:v[f])||0)-(S?y.crossAxis:0);m<T?m=T:m>k&&(m=k)}return{[p]:h,[f]:m}}}},V2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:a,elements:l}=t,{apply:d=()=>{},...c}=Bt(e,t),u=await bn(t,c),f=Ut(s),p=qr(s),h=At(s)==="y",{width:m,height:g}=o.floating;let y,w;f==="top"||f==="bottom"?(y=f,w=p===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(w=f,y=p==="end"?"top":"bottom");const v=g-u.top-u.bottom,x=m-u.left-u.right,S=Qt(g-u[y],v),T=Qt(m-u[w],x),k=!t.middlewareData.shift;let M=S,P=T;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(M=v),k&&!p){const D=Re(u.left,0),V=Re(u.right,0),O=Re(u.top,0),L=Re(u.bottom,0);h?P=m-2*(D!==0||V!==0?D+V:Re(u.left,u.right)):M=g-2*(O!==0||L!==0?O+L:Re(u.top,u.bottom))}await d({...t,availableWidth:P,availableHeight:M});const N=await a.getDimensions(l.floating);return m!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function $s(){return typeof window<"u"}function Kr(e){return rh(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kt(e){var t;return(t=(rh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function rh(e){return $s()?e instanceof Node||e instanceof et(e).Node:!1}function ht(e){return $s()?e instanceof Element||e instanceof et(e).Element:!1}function _t(e){return $s()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function nh(e){return!$s()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}const B2=new Set(["inline","contents"]);function vn(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!B2.has(s)}const U2=new Set(["table","td","th"]);function $2(e){return U2.has(Kr(e))}const j2=[":popover-open",":modal"];function js(e){return j2.some(t=>{try{return e.matches(t)}catch{return!1}})}const z2=["transform","translate","scale","rotate","perspective"],H2=["transform","translate","scale","rotate","perspective","filter"],W2=["paint","layout","strict","content"];function Si(e){const t=Pi(),r=ht(e)?pt(e):e;return z2.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||H2.some(n=>(r.willChange||"").includes(n))||W2.some(n=>(r.contain||"").includes(n))}function q2(e){let t=Rt(e);for(;_t(t)&&!Gr(t);){if(Si(t))return t;if(js(t))return null;t=Rt(t)}return null}function Pi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const K2=new Set(["html","body","#document"]);function Gr(e){return K2.has(Kr(e))}function pt(e){return et(e).getComputedStyle(e)}function zs(e){return ht(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rt(e){if(Kr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nh(e)&&e.host||kt(e);return nh(t)?t.host:t}function sh(e){const t=Rt(e);return Gr(t)?e.ownerDocument?e.ownerDocument.body:e.body:_t(t)&&vn(t)?t:sh(t)}function xn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=sh(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=et(s);if(o){const l=Ei(a);return t.concat(a,a.visualViewport||[],vn(s)?s:[],l&&r?xn(l):[])}return t.concat(s,xn(s,[],r))}function Ei(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oh(e){const t=pt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=_t(e),o=s?e.offsetWidth:r,a=s?e.offsetHeight:n,l=Is(r)!==o||Is(n)!==a;return l&&(r=o,n=a),{width:r,height:n,$:l}}function Ti(e){return ht(e)?e:e.contextElement}function Xr(e){const t=Ti(e);if(!_t(t))return Tt(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=oh(t);let a=(o?Is(r.width):r.width)/n,l=(o?Is(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const G2=Tt(0);function ah(e){const t=et(e);return!Pi()||!t.visualViewport?G2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function X2(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==et(e)?!1:t}function mr(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Ti(e);let a=Tt(1);t&&(n?ht(n)&&(a=Xr(n)):a=Xr(e));const l=X2(o,r,n)?ah(o):Tt(0);let d=(s.left+l.x)/a.x,c=(s.top+l.y)/a.y,u=s.width/a.x,f=s.height/a.y;if(o){const p=et(o),h=n&&ht(n)?et(n):n;let m=p,g=Ei(m);for(;g&&n&&h!==m;){const y=Xr(g),w=g.getBoundingClientRect(),v=pt(g),x=w.left+(g.clientLeft+parseFloat(v.paddingLeft))*y.x,S=w.top+(g.clientTop+parseFloat(v.paddingTop))*y.y;d*=y.x,c*=y.y,u*=y.x,f*=y.y,d+=x,c+=S,m=et(g),g=Ei(m)}}return Us({width:u,height:f,x:d,y:c})}function Hs(e,t){const r=zs(e).scrollLeft;return t?t.left+r:mr(kt(e)).left+r}function ih(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Hs(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function Y2(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",a=kt(n),l=t?js(t.floating):!1;if(n===a||l&&o)return r;let d={scrollLeft:0,scrollTop:0},c=Tt(1);const u=Tt(0),f=_t(n);if((f||!f&&!o)&&((Kr(n)!=="body"||vn(a))&&(d=zs(n)),_t(n))){const h=mr(n);c=Xr(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const p=a&&!f&&!o?ih(a,d):Tt(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-d.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-d.scrollTop*c.y+u.y+p.y}}function Z2(e){return Array.from(e.getClientRects())}function J2(e){const t=kt(e),r=zs(e),n=e.ownerDocument.body,s=Re(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Re(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Hs(e);const l=-r.scrollTop;return pt(n).direction==="rtl"&&(a+=Re(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:a,y:l}}const lh=25;function Q2(e,t){const r=et(e),n=kt(e),s=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,l=0,d=0;if(s){o=s.width,a=s.height;const u=Pi();(!u||u&&t==="fixed")&&(l=s.offsetLeft,d=s.offsetTop)}const c=Hs(n);if(c<=0){const u=n.ownerDocument,f=u.body,p=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(n.clientWidth-f.clientWidth-h);m<=lh&&(o-=m)}else c<=lh&&(o+=c);return{width:o,height:a,x:l,y:d}}const R2=new Set(["absolute","fixed"]);function eC(e,t){const r=mr(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=_t(e)?Xr(e):Tt(1),a=e.clientWidth*o.x,l=e.clientHeight*o.y,d=s*o.x,c=n*o.y;return{width:a,height:l,x:d,y:c}}function ch(e,t,r){let n;if(t==="viewport")n=Q2(e,r);else if(t==="document")n=J2(kt(e));else if(ht(t))n=eC(t,r);else{const s=ah(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Us(n)}function dh(e,t){const r=Rt(e);return r===t||!ht(r)||Gr(r)?!1:pt(r).position==="fixed"||dh(r,t)}function tC(e,t){const r=t.get(e);if(r)return r;let n=xn(e,[],!1).filter(l=>ht(l)&&Kr(l)!=="body"),s=null;const o=pt(e).position==="fixed";let a=o?Rt(e):e;for(;ht(a)&&!Gr(a);){const l=pt(a),d=Si(a);!d&&l.position==="fixed"&&(s=null),(o?!d&&!s:!d&&l.position==="static"&&!!s&&R2.has(s.position)||vn(a)&&!d&&dh(e,a))?n=n.filter(u=>u!==a):s=l,a=Rt(a)}return t.set(e,n),n}function rC(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[...r==="clippingAncestors"?js(t)?[]:tC(t,this._c):[].concat(r),n],l=a[0],d=a.reduce((c,u)=>{const f=ch(t,u,s);return c.top=Re(f.top,c.top),c.right=Qt(f.right,c.right),c.bottom=Qt(f.bottom,c.bottom),c.left=Re(f.left,c.left),c},ch(t,l,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function nC(e){const{width:t,height:r}=oh(e);return{width:t,height:r}}function sC(e,t,r){const n=_t(t),s=kt(t),o=r==="fixed",a=mr(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const d=Tt(0);function c(){d.x=Hs(s)}if(n||!n&&!o)if((Kr(t)!=="body"||vn(s))&&(l=zs(t)),n){const h=mr(t,!0,o,t);d.x=h.x+t.clientLeft,d.y=h.y+t.clientTop}else s&&c();o&&!n&&s&&c();const u=s&&!n&&!o?ih(s,l):Tt(0),f=a.left+l.scrollLeft-d.x-u.x,p=a.top+l.scrollTop-d.y-u.y;return{x:f,y:p,width:a.width,height:a.height}}function Ai(e){return pt(e).position==="static"}function uh(e,t){if(!_t(e)||pt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return kt(e)===r&&(r=r.ownerDocument.body),r}function fh(e,t){const r=et(e);if(js(e))return r;if(!_t(e)){let s=Rt(e);for(;s&&!Gr(s);){if(ht(s)&&!Ai(s))return s;s=Rt(s)}return r}let n=uh(e,t);for(;n&&$2(n)&&Ai(n);)n=uh(n,t);return n&&Gr(n)&&Ai(n)&&!Si(n)?r:n||q2(e)||r}const oC=async function(e){const t=this.getOffsetParent||fh,r=this.getDimensions,n=await r(e.floating);return{reference:sC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function aC(e){return pt(e).direction==="rtl"}const iC={convertOffsetParentRelativeRectToViewportRelativeRect:Y2,getDocumentElement:kt,getClippingRect:rC,getOffsetParent:fh,getElementRects:oC,getClientRects:Z2,getDimensions:nC,getScale:Xr,isElement:ht,isRTL:aC};function hh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lC(e,t){let r=null,n;const s=kt(e);function o(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function a(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),o();const c=e.getBoundingClientRect(),{left:u,top:f,width:p,height:h}=c;if(l||t(),!p||!h)return;const m=Vs(f),g=Vs(s.clientWidth-(u+p)),y=Vs(s.clientHeight-(f+h)),w=Vs(u),x={rootMargin:-m+"px "+-g+"px "+-y+"px "+-w+"px",threshold:Re(0,Qt(1,d))||1};let S=!0;function T(k){const M=k[0].intersectionRatio;if(M!==d){if(!S)return a();M?a(!1,M):n=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!hh(c,e.getBoundingClientRect())&&a(),S=!1}try{r=new IntersectionObserver(T,{...x,root:s.ownerDocument})}catch{r=new IntersectionObserver(T,x)}r.observe(e)}return a(!0),o}function cC(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,c=Ti(e),u=s||o?[...c?xn(c):[],...xn(t)]:[];u.forEach(w=>{s&&w.addEventListener("scroll",r,{passive:!0}),o&&w.addEventListener("resize",r)});const f=c&&l?lC(c,r):null;let p=-1,h=null;a&&(h=new ResizeObserver(w=>{let[v]=w;v&&v.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),r()}),c&&!d&&h.observe(c),h.observe(t));let m,g=d?mr(e):null;d&&y();function y(){const w=mr(e);g&&!hh(g,w)&&r(),g=w,m=requestAnimationFrame(y)}return r(),()=>{var w;u.forEach(v=>{s&&v.removeEventListener("scroll",r),o&&v.removeEventListener("resize",r)}),f?.(),(w=h)==null||w.disconnect(),h=null,d&&cancelAnimationFrame(m)}}const dC=F2,uC=D2,fC=N2,hC=V2,pC=L2,ph=M2,mC=I2,gC=(e,t,r)=>{const n=new Map,s={platform:iC,...r},o={...s.platform,_c:n};return _2(e,t,{...s,platform:o})};var yC=typeof document<"u",wC=function(){},Ws=yC?b.useLayoutEffect:wC;function qs(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,s;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(!qs(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!qs(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function mh(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gh(e,t){const r=mh(e);return Math.round(t*r)/r}function ki(e){const t=C.useRef(e);return Ws(()=>{t.current=e}),t}function bC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:d,open:c}=e,[u,f]=C.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=C.useState(n);qs(p,n)||h(n);const[m,g]=C.useState(null),[y,w]=C.useState(null),v=C.useCallback($=>{$!==k.current&&(k.current=$,g($))},[]),x=C.useCallback($=>{$!==M.current&&(M.current=$,w($))},[]),S=o||m,T=a||y,k=C.useRef(null),M=C.useRef(null),P=C.useRef(u),N=d!=null,D=ki(d),V=ki(s),O=ki(c),L=C.useCallback(()=>{if(!k.current||!M.current)return;const $={placement:t,strategy:r,middleware:p};V.current&&($.platform=V.current),gC(k.current,M.current,$).then(j=>{const E={...j,isPositioned:O.current!==!1};_.current&&!qs(P.current,E)&&(P.current=E,Vl.flushSync(()=>{f(E)}))})},[p,t,r,V,O]);Ws(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[c]);const _=C.useRef(!1);Ws(()=>(_.current=!0,()=>{_.current=!1}),[]),Ws(()=>{if(S&&(k.current=S),T&&(M.current=T),S&&T){if(D.current)return D.current(S,T,L);L()}},[S,T,L,D,N]);const B=C.useMemo(()=>({reference:k,floating:M,setReference:v,setFloating:x}),[v,x]),F=C.useMemo(()=>({reference:S,floating:T}),[S,T]),W=C.useMemo(()=>{const $={position:r,left:0,top:0};if(!F.floating)return $;const j=gh(F.floating,u.x),E=gh(F.floating,u.y);return l?{...$,transform:"translate("+j+"px, "+E+"px)",...mh(F.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:j,top:E}},[r,l,F.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:L,refs:B,elements:F,floatingStyles:W}),[u,L,B,F,W])}const vC=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?ph({element:n.current,padding:s}).fn(r):{}:n?ph({element:n,padding:s}).fn(r):{}}}},xC=(e,t)=>({...dC(e),options:[e,t]}),CC=(e,t)=>({...uC(e),options:[e,t]}),SC=(e,t)=>({...mC(e),options:[e,t]}),PC=(e,t)=>({...fC(e),options:[e,t]}),EC=(e,t)=>({...hC(e),options:[e,t]}),TC=(e,t)=>({...pC(e),options:[e,t]}),AC=(e,t)=>({...vC(e),options:[e,t]});var kC="Arrow",yh=C.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return i.jsx(be.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});yh.displayName=kC;var _C=yh,_i="Popper",[wh,Ks]=Yt(_i),[MC,bh]=wh(_i),vh=e=>{const{__scopePopper:t,children:r}=e,[n,s]=C.useState(null);return i.jsx(MC,{scope:t,anchor:n,onAnchorChange:s,children:r})};vh.displayName=_i;var xh="PopperAnchor",Ch=C.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=bh(xh,r),a=C.useRef(null),l=Te(t,a),d=C.useRef(null);return C.useEffect(()=>{const c=d.current;d.current=n?.current||a.current,c!==d.current&&o.onAnchorChange(d.current)}),n?null:i.jsx(be.div,{...s,ref:l})});Ch.displayName=xh;var Mi="PopperContent",[NC,LC]=wh(Mi),Sh=C.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...g}=e,y=bh(Mi,r),[w,v]=C.useState(null),x=Te(t,J=>v(J)),[S,T]=C.useState(null),k=y2(S),M=k?.width??0,P=k?.height??0,N=n+(o!=="center"?"-"+o:""),D=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},V=Array.isArray(c)?c:[c],O=V.length>0,L={padding:D,boundary:V.filter(FC),altBoundary:O},{refs:_,floatingStyles:B,placement:F,isPositioned:W,middlewareData:$}=bC({strategy:"fixed",placement:N,whileElementsMounted:(...J)=>cC(...J,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[xC({mainAxis:s+P,alignmentAxis:a}),d&&CC({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?SC():void 0,...L}),d&&PC({...L}),EC({...L,apply:({elements:J,rects:ne,availableWidth:se,availableHeight:Pe})=>{const{width:ve,height:ge}=ne.reference,he=J.floating.style;he.setProperty("--radix-popper-available-width",`${se}px`),he.setProperty("--radix-popper-available-height",`${Pe}px`),he.setProperty("--radix-popper-anchor-width",`${ve}px`),he.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),S&&AC({element:S,padding:l}),DC({arrowWidth:M,arrowHeight:P}),p&&TC({strategy:"referenceHidden",...L})]}),[j,E]=Th(F),z=Vt(m);It(()=>{W&&z?.()},[W,z]);const X=$.arrow?.x,G=$.arrow?.y,U=$.arrow?.centerOffset!==0,[H,q]=C.useState();return It(()=>{w&&q(window.getComputedStyle(w).zIndex)},[w]),i.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:W?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(NC,{scope:r,placedSide:j,onArrowChange:T,arrowX:X,arrowY:G,shouldHideArrow:U,children:i.jsx(be.div,{"data-side":j,"data-align":E,...g,ref:x,style:{...g.style,animation:W?void 0:"none"}})})})});Sh.displayName=Mi;var Ph="PopperArrow",OC={top:"bottom",right:"left",bottom:"top",left:"right"},Eh=C.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=LC(Ph,n),a=OC[o.placedSide];return i.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i.jsx(_C,{...s,ref:r,style:{...s.style,display:"block"}})})});Eh.displayName=Ph;function FC(e){return e!==null}var DC=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:s}=t,a=s.arrow?.centerOffset!==0,l=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[c,u]=Th(r),f={start:"0%",center:"50%",end:"100%"}[u],p=(s.arrow?.x??0)+l/2,h=(s.arrow?.y??0)+d/2;let m="",g="";return c==="bottom"?(m=a?f:`${p}px`,g=`${-d}px`):c==="top"?(m=a?f:`${p}px`,g=`${n.floating.height+d}px`):c==="right"?(m=`${-d}px`,g=a?f:`${h}px`):c==="left"&&(m=`${n.floating.width+d}px`,g=a?f:`${h}px`),{data:{x:m,y:g}}}});function Th(e){const[t,r="center"]=e.split("-");return[t,r]}var Ah=vh,kh=Ch,_h=Sh,Mh=Eh,Ni="rovingFocusGroup.onEntryFocus",IC={bubbles:!1,cancelable:!0},Cn="RovingFocusGroup",[Li,Nh,VC]=rf(Cn),[BC,Lh]=Yt(Cn,[VC]),[UC,$C]=BC(Cn),Oh=C.forwardRef((e,t)=>i.jsx(Li.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Li.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(jC,{...e,ref:t})})}));Oh.displayName=Cn;var jC=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...f}=e,p=C.useRef(null),h=Te(t,p),m=lf(o),[g,y]=wn({prop:a,defaultProp:l??null,onChange:d,caller:Cn}),[w,v]=C.useState(!1),x=Vt(c),S=Nh(r),T=C.useRef(!1),[k,M]=C.useState(0);return C.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(Ni,x),()=>P.removeEventListener(Ni,x)},[x]),i.jsx(UC,{scope:r,orientation:n,dir:m,loop:s,currentTabStopId:g,onItemFocus:C.useCallback(P=>y(P),[y]),onItemShiftTab:C.useCallback(()=>v(!0),[]),onFocusableItemAdd:C.useCallback(()=>M(P=>P+1),[]),onFocusableItemRemove:C.useCallback(()=>M(P=>P-1),[]),children:i.jsx(be.div,{tabIndex:w||k===0?-1:0,"data-orientation":n,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:oe(e.onMouseDown,()=>{T.current=!0}),onFocus:oe(e.onFocus,P=>{const N=!T.current;if(P.target===P.currentTarget&&N&&!w){const D=new CustomEvent(Ni,IC);if(P.currentTarget.dispatchEvent(D),!D.defaultPrevented){const V=S().filter(F=>F.focusable),O=V.find(F=>F.active),L=V.find(F=>F.id===g),B=[O,L,...V].filter(Boolean).map(F=>F.ref.current);Ih(B,u)}}T.current=!1}),onBlur:oe(e.onBlur,()=>v(!1))})})}),Fh="RovingFocusGroupItem",Dh=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,children:a,...l}=e,d=Zt(),c=o||d,u=$C(Fh,r),f=u.currentTabStopId===c,p=Nh(r),{onFocusableItemAdd:h,onFocusableItemRemove:m,currentTabStopId:g}=u;return C.useEffect(()=>{if(n)return h(),()=>m()},[n,h,m]),i.jsx(Li.ItemSlot,{scope:r,id:c,focusable:n,active:s,children:i.jsx(be.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:oe(e.onMouseDown,y=>{n?u.onItemFocus(c):y.preventDefault()}),onFocus:oe(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:oe(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const w=WC(y,u.orientation,u.dir);if(w!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=p().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")x.reverse();else if(w==="prev"||w==="next"){w==="prev"&&x.reverse();const S=x.indexOf(y.currentTarget);x=u.loop?qC(x,S+1):x.slice(S+1)}setTimeout(()=>Ih(x))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:g!=null}):a})})});Dh.displayName=Fh;var zC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function HC(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function WC(e,t,r){const n=HC(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return zC[n]}function Ih(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function qC(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var KC=Oh,GC=Dh,Oi=["Enter"," "],XC=["ArrowDown","PageUp","Home"],Vh=["ArrowUp","PageDown","End"],YC=[...XC,...Vh],ZC={ltr:[...Oi,"ArrowRight"],rtl:[...Oi,"ArrowLeft"]},JC={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sn="Menu",[Pn,QC,RC]=rf(Sn),[gr,Bh]=Yt(Sn,[RC,Ks,Lh]),Gs=Ks(),Uh=Lh(),[e5,yr]=gr(Sn),[t5,En]=gr(Sn),$h=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:a=!0}=e,l=Gs(t),[d,c]=C.useState(null),u=C.useRef(!1),f=Vt(o),p=lf(s);return C.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),i.jsx(Ah,{...l,children:i.jsx(e5,{scope:t,open:r,onOpenChange:f,content:d,onContentChange:c,children:i.jsx(t5,{scope:t,onClose:C.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:a,children:n})})})};$h.displayName=Sn;var r5="MenuAnchor",Fi=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Gs(r);return i.jsx(kh,{...s,...n,ref:t})});Fi.displayName=r5;var Di="MenuPortal",[n5,jh]=gr(Di,{forceMount:void 0}),zh=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=yr(Di,t);return i.jsx(n5,{scope:t,forceMount:r,children:i.jsx(ut,{present:r||o.open,children:i.jsx(Ts,{asChild:!0,container:s,children:n})})})};zh.displayName=Di;var at="MenuContent",[s5,Ii]=gr(at),Hh=C.forwardRef((e,t)=>{const r=jh(at,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=yr(at,e.__scopeMenu),a=En(at,e.__scopeMenu);return i.jsx(Pn.Provider,{scope:e.__scopeMenu,children:i.jsx(ut,{present:n||o.open,children:i.jsx(Pn.Slot,{scope:e.__scopeMenu,children:a.modal?i.jsx(o5,{...s,ref:t}):i.jsx(a5,{...s,ref:t})})})})}),o5=C.forwardRef((e,t)=>{const r=yr(at,e.__scopeMenu),n=C.useRef(null),s=Te(t,n);return C.useEffect(()=>{const o=n.current;if(o)return Of(o)},[]),i.jsx(Vi,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:oe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),a5=C.forwardRef((e,t)=>{const r=yr(at,e.__scopeMenu);return i.jsx(Vi,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),i5=$r("MenuContent.ScrollLock"),Vi=C.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:d,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:h,disableOutsideScroll:m,...g}=e,y=yr(at,r),w=En(at,r),v=Gs(r),x=Uh(r),S=QC(r),[T,k]=C.useState(null),M=C.useRef(null),P=Te(t,M,y.onContentChange),N=C.useRef(0),D=C.useRef(""),V=C.useRef(0),O=C.useRef(null),L=C.useRef("right"),_=C.useRef(0),B=m?li:C.Fragment,F=m?{as:i5,allowPinchZoom:!0}:void 0,W=j=>{const E=D.current+j,z=S().filter(J=>!J.disabled),X=document.activeElement,G=z.find(J=>J.ref.current===X)?.textValue,U=z.map(J=>J.textValue),H=b5(U,E,G),q=z.find(J=>J.textValue===H)?.ref.current;(function J(ne){D.current=ne,window.clearTimeout(N.current),ne!==""&&(N.current=window.setTimeout(()=>J(""),1e3))})(E),q&&setTimeout(()=>q.focus())};C.useEffect(()=>()=>window.clearTimeout(N.current),[]),wf();const $=C.useCallback(j=>L.current===O.current?.side&&x5(j,O.current?.area),[]);return i.jsx(s5,{scope:r,searchRef:D,onItemEnter:C.useCallback(j=>{$(j)&&j.preventDefault()},[$]),onItemLeave:C.useCallback(j=>{$(j)||(M.current?.focus(),k(null))},[$]),onTriggerLeave:C.useCallback(j=>{$(j)&&j.preventDefault()},[$]),pointerGraceTimerRef:V,onPointerGraceIntentChange:C.useCallback(j=>{O.current=j},[]),children:i.jsx(B,{...F,children:i.jsx(ri,{asChild:!0,trapped:s,onMountAutoFocus:oe(o,j=>{j.preventDefault(),M.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:i.jsx(Es,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:h,children:i.jsx(KC,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:n,currentTabStopId:T,onCurrentTabStopIdChange:k,onEntryFocus:oe(d,j=>{w.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(_h,{role:"menu","aria-orientation":"vertical","data-state":ap(y.open),"data-radix-menu-content":"",dir:w.dir,...v,...g,ref:P,style:{outline:"none",...g.style},onKeyDown:oe(g.onKeyDown,j=>{const z=j.target.closest("[data-radix-menu-content]")===j.currentTarget,X=j.ctrlKey||j.altKey||j.metaKey,G=j.key.length===1;z&&(j.key==="Tab"&&j.preventDefault(),!X&&G&&W(j.key));const U=M.current;if(j.target!==U||!YC.includes(j.key))return;j.preventDefault();const q=S().filter(J=>!J.disabled).map(J=>J.ref.current);Vh.includes(j.key)&&q.reverse(),y5(q)}),onBlur:oe(e.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(N.current),D.current="")}),onPointerMove:oe(e.onPointerMove,An(j=>{const E=j.target,z=_.current!==j.clientX;if(j.currentTarget.contains(E)&&z){const X=j.clientX>_.current?"right":"left";L.current=X,_.current=j.clientX}}))})})})})})})});Hh.displayName=at;var l5="MenuGroup",Bi=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(be.div,{role:"group",...n,ref:t})});Bi.displayName=l5;var c5="MenuLabel",Wh=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(be.div,{...n,ref:t})});Wh.displayName=c5;var Xs="MenuItem",qh="menu.itemSelect",Ys=C.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=C.useRef(null),a=En(Xs,e.__scopeMenu),l=Ii(Xs,e.__scopeMenu),d=Te(t,o),c=C.useRef(!1),u=()=>{const f=o.current;if(!r&&f){const p=new CustomEvent(qh,{bubbles:!0,cancelable:!0});f.addEventListener(qh,h=>n?.(h),{once:!0}),ef(f,p),p.defaultPrevented?c.current=!1:a.onClose()}};return i.jsx(Kh,{...s,ref:d,disabled:r,onClick:oe(e.onClick,u),onPointerDown:f=>{e.onPointerDown?.(f),c.current=!0},onPointerUp:oe(e.onPointerUp,f=>{c.current||f.currentTarget?.click()}),onKeyDown:oe(e.onKeyDown,f=>{const p=l.searchRef.current!=="";r||p&&f.key===" "||Oi.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Ys.displayName=Xs;var Kh=C.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,a=Ii(Xs,r),l=Uh(r),d=C.useRef(null),c=Te(t,d),[u,f]=C.useState(!1),[p,h]=C.useState("");return C.useEffect(()=>{const m=d.current;m&&h((m.textContent??"").trim())},[o.children]),i.jsx(Pn.ItemSlot,{scope:r,disabled:n,textValue:s??p,children:i.jsx(GC,{asChild:!0,...l,focusable:!n,children:i.jsx(be.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:c,onPointerMove:oe(e.onPointerMove,An(m=>{n?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:oe(e.onPointerLeave,An(m=>a.onItemLeave(m))),onFocus:oe(e.onFocus,()=>f(!0)),onBlur:oe(e.onBlur,()=>f(!1))})})})}),d5="MenuCheckboxItem",Gh=C.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return i.jsx(Qh,{scope:e.__scopeMenu,checked:r,children:i.jsx(Ys,{role:"menuitemcheckbox","aria-checked":Zs(r)?"mixed":r,...s,ref:t,"data-state":$i(r),onSelect:oe(s.onSelect,()=>n?.(Zs(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Gh.displayName=d5;var Xh="MenuRadioGroup",[u5,f5]=gr(Xh,{value:void 0,onValueChange:()=>{}}),Yh=C.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=Vt(n);return i.jsx(u5,{scope:e.__scopeMenu,value:r,onValueChange:o,children:i.jsx(Bi,{...s,ref:t})})});Yh.displayName=Xh;var Zh="MenuRadioItem",Jh=C.forwardRef((e,t)=>{const{value:r,...n}=e,s=f5(Zh,e.__scopeMenu),o=r===s.value;return i.jsx(Qh,{scope:e.__scopeMenu,checked:o,children:i.jsx(Ys,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":$i(o),onSelect:oe(n.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});Jh.displayName=Zh;var Ui="MenuItemIndicator",[Qh,h5]=gr(Ui,{checked:!1}),Rh=C.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=h5(Ui,r);return i.jsx(ut,{present:n||Zs(o.checked)||o.checked===!0,children:i.jsx(be.span,{...s,ref:t,"data-state":$i(o.checked)})})});Rh.displayName=Ui;var p5="MenuSeparator",ep=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(be.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});ep.displayName=p5;var m5="MenuArrow",tp=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Gs(r);return i.jsx(Mh,{...s,...n,ref:t})});tp.displayName=m5;var g5="MenuSub",[jT,rp]=gr(g5),Tn="MenuSubTrigger",np=C.forwardRef((e,t)=>{const r=yr(Tn,e.__scopeMenu),n=En(Tn,e.__scopeMenu),s=rp(Tn,e.__scopeMenu),o=Ii(Tn,e.__scopeMenu),a=C.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:d}=o,c={__scopeMenu:e.__scopeMenu},u=C.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return C.useEffect(()=>u,[u]),C.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),d(null)}},[l,d]),i.jsx(Fi,{asChild:!0,...c,children:i.jsx(Kh,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":ap(r.open),...e,ref:Cs(t,s.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:oe(e.onPointerMove,An(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:oe(e.onPointerLeave,An(f=>{u();const p=r.content?.getBoundingClientRect();if(p){const h=r.content?.dataset.side,m=h==="right",g=m?-5:5,y=p[m?"left":"right"],w=p[m?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+g,y:f.clientY},{x:y,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x:y,y:p.bottom}],side:h}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:oe(e.onKeyDown,f=>{const p=o.searchRef.current!=="";e.disabled||p&&f.key===" "||ZC[n.dir].includes(f.key)&&(r.onOpenChange(!0),r.content?.focus(),f.preventDefault())})})})});np.displayName=Tn;var sp="MenuSubContent",op=C.forwardRef((e,t)=>{const r=jh(at,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=yr(at,e.__scopeMenu),a=En(at,e.__scopeMenu),l=rp(sp,e.__scopeMenu),d=C.useRef(null),c=Te(t,d);return i.jsx(Pn.Provider,{scope:e.__scopeMenu,children:i.jsx(ut,{present:n||o.open,children:i.jsx(Pn.Slot,{scope:e.__scopeMenu,children:i.jsx(Vi,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{a.isUsingKeyboardRef.current&&d.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:oe(e.onFocusOutside,u=>{u.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:oe(e.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:oe(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),p=JC[a.dir].includes(u.key);f&&p&&(o.onOpenChange(!1),l.trigger?.focus(),u.preventDefault())})})})})})});op.displayName=sp;function ap(e){return e?"open":"closed"}function Zs(e){return e==="indeterminate"}function $i(e){return Zs(e)?"indeterminate":e?"checked":"unchecked"}function y5(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function w5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function b5(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=w5(e,Math.max(o,0));s.length===1&&(a=a.filter(c=>c!==r));const d=a.find(c=>c.toLowerCase().startsWith(s.toLowerCase()));return d!==r?d:void 0}function v5(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],d=t[a],c=l.x,u=l.y,f=d.x,p=d.y;u>n!=p>n&&r<(f-c)*(n-u)/(p-u)+c&&(s=!s)}return s}function x5(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return v5(r,t)}function An(e){return t=>t.pointerType==="mouse"?e(t):void 0}var C5=$h,S5=Fi,P5=zh,E5=Hh,T5=Bi,A5=Wh,k5=Ys,_5=Gh,M5=Yh,N5=Jh,L5=Rh,O5=ep,F5=tp,D5=np,I5=op,Js="DropdownMenu",[V5]=Yt(Js,[Bh]),We=Bh(),[B5,ip]=V5(Js),lp=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,d=We(t),c=C.useRef(null),[u,f]=wn({prop:s,defaultProp:o??!1,onChange:a,caller:Js});return i.jsx(B5,{scope:t,triggerId:Zt(),triggerRef:c,contentId:Zt(),open:u,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(p=>!p),[f]),modal:l,children:i.jsx(C5,{...d,open:u,onOpenChange:f,dir:n,modal:l,children:r})})};lp.displayName=Js;var cp="DropdownMenuTrigger",dp=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=ip(cp,r),a=We(r);return i.jsx(S5,{asChild:!0,...a,children:i.jsx(be.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:Cs(t,o.triggerRef),onPointerDown:oe(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:oe(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});dp.displayName=cp;var U5="DropdownMenuPortal",up=e=>{const{__scopeDropdownMenu:t,...r}=e,n=We(t);return i.jsx(P5,{...n,...r})};up.displayName=U5;var fp="DropdownMenuContent",hp=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=ip(fp,r),o=We(r),a=C.useRef(!1);return i.jsx(E5,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:oe(e.onCloseAutoFocus,l=>{a.current||s.triggerRef.current?.focus(),a.current=!1,l.preventDefault()}),onInteractOutside:oe(e.onInteractOutside,l=>{const d=l.detail.originalEvent,c=d.button===0&&d.ctrlKey===!0,u=d.button===2||c;(!s.modal||u)&&(a.current=!0)}),style:{...e.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)"}})});hp.displayName=fp;var $5="DropdownMenuGroup",j5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(T5,{...s,...n,ref:t})});j5.displayName=$5;var z5="DropdownMenuLabel",pp=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(A5,{...s,...n,ref:t})});pp.displayName=z5;var H5="DropdownMenuItem",mp=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(k5,{...s,...n,ref:t})});mp.displayName=H5;var W5="DropdownMenuCheckboxItem",q5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(_5,{...s,...n,ref:t})});q5.displayName=W5;var K5="DropdownMenuRadioGroup",G5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(M5,{...s,...n,ref:t})});G5.displayName=K5;var X5="DropdownMenuRadioItem",Y5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(N5,{...s,...n,ref:t})});Y5.displayName=X5;var Z5="DropdownMenuItemIndicator",J5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(L5,{...s,...n,ref:t})});J5.displayName=Z5;var Q5="DropdownMenuSeparator",gp=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(O5,{...s,...n,ref:t})});gp.displayName=Q5;var R5="DropdownMenuArrow",e3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(F5,{...s,...n,ref:t})});e3.displayName=R5;var t3="DropdownMenuSubTrigger",r3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(D5,{...s,...n,ref:t})});r3.displayName=t3;var n3="DropdownMenuSubContent",s3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(I5,{...s,...n,ref:t,style:{...e.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)"}})});s3.displayName=n3;var o3=lp,a3=dp,i3=up,l3=hp,c3=pp,d3=mp,u3=gp,[Qs]=Yt("Tooltip",[Ks]),Rs=Ks(),yp="TooltipProvider",f3=700,ji="tooltip.open",[h3,zi]=Qs(yp),wp=e=>{const{__scopeTooltip:t,delayDuration:r=f3,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,a=C.useRef(!0),l=C.useRef(!1),d=C.useRef(0);return C.useEffect(()=>{const c=d.current;return()=>window.clearTimeout(c)},[]),i.jsx(h3,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:C.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:C.useCallback(c=>{l.current=c},[]),disableHoverableContent:s,children:o})};wp.displayName=yp;var kn="Tooltip",[p3,_n]=Qs(kn),bp=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:o,disableHoverableContent:a,delayDuration:l}=e,d=zi(kn,e.__scopeTooltip),c=Rs(t),[u,f]=C.useState(null),p=Zt(),h=C.useRef(0),m=a??d.disableHoverableContent,g=l??d.delayDuration,y=C.useRef(!1),[w,v]=wn({prop:n,defaultProp:s??!1,onChange:M=>{M?(d.onOpen(),document.dispatchEvent(new CustomEvent(ji))):d.onClose(),o?.(M)},caller:kn}),x=C.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),S=C.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,v(!0)},[v]),T=C.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v(!1)},[v]),k=C.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,v(!0),h.current=0},g)},[g,v]);return C.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),i.jsx(Ah,{...c,children:i.jsx(p3,{scope:t,contentId:p,open:w,stateAttribute:x,trigger:u,onTriggerChange:f,onTriggerEnter:C.useCallback(()=>{d.isOpenDelayedRef.current?k():S()},[d.isOpenDelayedRef,k,S]),onTriggerLeave:C.useCallback(()=>{m?T():(window.clearTimeout(h.current),h.current=0)},[T,m]),onOpen:S,onClose:T,disableHoverableContent:m,children:r})})};bp.displayName=kn;var Hi="TooltipTrigger",vp=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=_n(Hi,r),o=zi(Hi,r),a=Rs(r),l=C.useRef(null),d=Te(t,l,s.onTriggerChange),c=C.useRef(!1),u=C.useRef(!1),f=C.useCallback(()=>c.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),i.jsx(kh,{asChild:!0,...a,children:i.jsx(be.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:d,onPointerMove:oe(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:oe(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:oe(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:oe(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:oe(e.onBlur,s.onClose),onClick:oe(e.onClick,s.onClose)})})});vp.displayName=Hi;var Wi="TooltipPortal",[m3,g3]=Qs(Wi,{forceMount:void 0}),xp=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,o=_n(Wi,t);return i.jsx(m3,{scope:t,forceMount:r,children:i.jsx(ut,{present:r||o.open,children:i.jsx(Ts,{asChild:!0,container:s,children:n})})})};xp.displayName=Wi;var Yr="TooltipContent",Cp=C.forwardRef((e,t)=>{const r=g3(Yr,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,a=_n(Yr,e.__scopeTooltip);return i.jsx(ut,{present:n||a.open,children:a.disableHoverableContent?i.jsx(Sp,{side:s,...o,ref:t}):i.jsx(y3,{side:s,...o,ref:t})})}),y3=C.forwardRef((e,t)=>{const r=_n(Yr,e.__scopeTooltip),n=zi(Yr,e.__scopeTooltip),s=C.useRef(null),o=Te(t,s),[a,l]=C.useState(null),{trigger:d,onClose:c}=r,u=s.current,{onPointerInTransitChange:f}=n,p=C.useCallback(()=>{l(null),f(!1)},[f]),h=C.useCallback((m,g)=>{const y=m.currentTarget,w={x:m.clientX,y:m.clientY},v=x3(w,y.getBoundingClientRect()),x=C3(w,v),S=S3(g.getBoundingClientRect()),T=E3([...x,...S]);l(T),f(!0)},[f]);return C.useEffect(()=>()=>p(),[p]),C.useEffect(()=>{if(d&&u){const m=y=>h(y,u),g=y=>h(y,d);return d.addEventListener("pointerleave",m),u.addEventListener("pointerleave",g),()=>{d.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",g)}}},[d,u,h,p]),C.useEffect(()=>{if(a){const m=g=>{const y=g.target,w={x:g.clientX,y:g.clientY},v=d?.contains(y)||u?.contains(y),x=!P3(w,a);v?p():x&&(p(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[d,u,a,c,p]),i.jsx(Sp,{...e,ref:o})}),[w3,b3]=Qs(kn,{isInside:!1}),v3=Dv("TooltipContent"),Sp=C.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...l}=e,d=_n(Yr,r),c=Rs(r),{onClose:u}=d;return C.useEffect(()=>(document.addEventListener(ji,u),()=>document.removeEventListener(ji,u)),[u]),C.useEffect(()=>{if(d.trigger){const f=p=>{p.target?.contains(d.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[d.trigger,u]),i.jsx(Es,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:i.jsxs(_h,{"data-state":d.stateAttribute,...c,...l,ref:t,style:{...l.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(v3,{children:n}),i.jsx(w3,{scope:r,isInside:!0,children:i.jsx(zv,{id:d.contentId,role:"tooltip",children:s||n})})]})})});Cp.displayName=Yr;var Pp="TooltipArrow",Ep=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Rs(r);return b3(Pp,r).isInside?null:i.jsx(Mh,{...s,...n,ref:t})});Ep.displayName=Pp;function x3(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function C3(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}function S3(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function P3(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],d=t[a],c=l.x,u=l.y,f=d.x,p=d.y;u>n!=p>n&&r<(f-c)*(n-u)/(p-u)+c&&(s=!s)}return s}function E3(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),T3(t)}function T3(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],a=r[r.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))r.pop();else break}r.push(s)}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)}var A3=wp,k3=bp,_3=vp,M3=xp,N3=Cp,L3=Ep;const qi=768;function O3(){const[e,t]=C.useState(void 0);return C.useEffect(()=>{const r=window.matchMedia(`(max-width: ${qi-1}px)`),n=()=>{t(window.innerWidth<qi)};return r.addEventListener("change",n),t(window.innerWidth<qi),()=>r.removeEventListener("change",n)},[]),!!e}const F3=(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},D3=(e,t)=>({classGroupId:e,validator:t}),Tp=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),eo="-",Ap=[],I3="arbitrary..",V3=e=>{const t=U3(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return B3(a);const l=a.split(eo),d=l[0]===""&&l.length>1?1:0;return kp(l,d,t)},getConflictingClassGroupIds:(a,l)=>{if(l){const d=n[a],c=r[a];return d?c?F3(c,d):d:c||Ap}return r[a]||Ap}}},kp=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],o=r.nextPart.get(s);if(o){const c=kp(e,t+1,o);if(c)return c}const a=r.validators;if(a===null)return;const l=t===0?e.join(eo):e.slice(t).join(eo),d=a.length;for(let c=0;c<d;c++){const u=a[c];if(u.validator(l))return u.classGroupId}},B3=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?I3+n:void 0})(),U3=e=>{const{theme:t,classGroups:r}=e;return $3(r,t)},$3=(e,t)=>{const r=Tp();for(const n in e){const s=e[n];Ki(s,r,n,t)}return r},Ki=(e,t,r,n)=>{const s=e.length;for(let o=0;o<s;o++){const a=e[o];j3(a,t,r,n)}},j3=(e,t,r,n)=>{if(typeof e=="string"){z3(e,t,r);return}if(typeof e=="function"){H3(e,t,r,n);return}W3(e,t,r,n)},z3=(e,t,r)=>{const n=e===""?t:_p(t,e);n.classGroupId=r},H3=(e,t,r,n)=>{if(q3(e)){Ki(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(D3(r,e))},W3=(e,t,r,n)=>{const s=Object.entries(e),o=s.length;for(let a=0;a<o;a++){const[l,d]=s[a];Ki(d,_p(t,l),r,n)}},_p=(e,t)=>{let r=e;const n=t.split(eo),s=n.length;for(let o=0;o<s;o++){const a=n[o];let l=r.nextPart.get(a);l||(l=Tp(),r.nextPart.set(a,l)),r=l}return r},q3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,K3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(o,a)=>{r[o]=a,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(o){let a=r[o];if(a!==void 0)return a;if((a=n[o])!==void 0)return s(o,a),a},set(o,a){o in r?r[o]=a:s(o,a)}}},Gi="!",Mp=":",G3=[],Np=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),X3=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const o=[];let a=0,l=0,d=0,c;const u=s.length;for(let g=0;g<u;g++){const y=s[g];if(a===0&&l===0){if(y===Mp){o.push(s.slice(d,g)),d=g+1;continue}if(y==="/"){c=g;continue}}y==="["?a++:y==="]"?a--:y==="("?l++:y===")"&&l--}const f=o.length===0?s:s.slice(d);let p=f,h=!1;f.endsWith(Gi)?(p=f.slice(0,-1),h=!0):f.startsWith(Gi)&&(p=f.slice(1),h=!0);const m=c&&c>d?c-d:void 0;return Np(o,h,p,m)};if(t){const s=t+Mp,o=n;n=a=>a.startsWith(s)?o(a.slice(s.length)):Np(G3,!1,a,void 0,!0)}if(r){const s=n;n=o=>r({className:o,parseClassName:s})}return n},Y3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let o=0;o<r.length;o++){const a=r[o],l=a[0]==="[",d=t.has(a);l||d?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(a)):s.push(a)}return s.length>0&&(s.sort(),n.push(...s)),n}},Z3=e=>({cache:K3(e.cacheSize),parseClassName:X3(e),sortModifiers:Y3(e),...V3(e)}),J3=/\s+/,Q3=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:o}=t,a=[],l=e.trim().split(J3);let d="";for(let c=l.length-1;c>=0;c-=1){const u=l[c],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=r(u);if(f){d=u+(d.length>0?" "+d:d);continue}let y=!!g,w=n(y?m.substring(0,g):m);if(!w){if(!y){d=u+(d.length>0?" "+d:d);continue}if(w=n(m),!w){d=u+(d.length>0?" "+d:d);continue}y=!1}const v=p.length===0?"":p.length===1?p[0]:o(p).join(":"),x=h?v+Gi:v,S=x+w;if(a.indexOf(S)>-1)continue;a.push(S);const T=s(w,y);for(let k=0;k<T.length;++k){const M=T[k];a.push(x+M)}d=u+(d.length>0?" "+d:d)}return d},R3=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=Lp(r))&&(s&&(s+=" "),s+=n);return s},Lp=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Lp(e[n]))&&(r&&(r+=" "),r+=t);return r},eS=(e,...t)=>{let r,n,s,o;const a=d=>{const c=t.reduce((u,f)=>f(u),e());return r=Z3(c),n=r.cache.get,s=r.cache.set,o=l,l(d)},l=d=>{const c=n(d);if(c)return c;const u=Q3(d,r);return s(d,u),u};return o=a,(...d)=>o(R3(...d))},tS=[],ke=e=>{const t=r=>r[e]||tS;return t.isThemeGetter=!0,t},Op=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rS=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,nS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sS=/\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$/,oS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,aS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,er=e=>rS.test(e),le=e=>!!e&&!Number.isNaN(Number(e)),tr=e=>!!e&&Number.isInteger(Number(e)),Xi=e=>e.endsWith("%")&&le(e.slice(0,-1)),$t=e=>nS.test(e),Dp=()=>!0,lS=e=>sS.test(e)&&!oS.test(e),Yi=()=>!1,cS=e=>aS.test(e),dS=e=>iS.test(e),uS=e=>!te(e)&&!re(e),fS=e=>rr(e,jp,Yi),te=e=>Op.test(e),wr=e=>rr(e,zp,lS),Ip=e=>rr(e,vS,le),hS=e=>rr(e,Wp,Dp),pS=e=>rr(e,Hp,Yi),Vp=e=>rr(e,Up,Yi),mS=e=>rr(e,$p,dS),to=e=>rr(e,qp,cS),re=e=>Fp.test(e),Mn=e=>br(e,zp),gS=e=>br(e,Hp),Bp=e=>br(e,Up),yS=e=>br(e,jp),wS=e=>br(e,$p),ro=e=>br(e,qp,!0),bS=e=>br(e,Wp,!0),rr=(e,t,r)=>{const n=Op.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},br=(e,t,r=!1)=>{const n=Fp.exec(e);return n?n[1]?t(n[1]):r:!1},Up=e=>e==="position"||e==="percentage",$p=e=>e==="image"||e==="url",jp=e=>e==="length"||e==="size"||e==="bg-size",zp=e=>e==="length",vS=e=>e==="number",Hp=e=>e==="family-name",Wp=e=>e==="number"||e==="weight",qp=e=>e==="shadow",xS=eS(()=>{const e=ke("color"),t=ke("font"),r=ke("text"),n=ke("font-weight"),s=ke("tracking"),o=ke("leading"),a=ke("breakpoint"),l=ke("container"),d=ke("spacing"),c=ke("radius"),u=ke("shadow"),f=ke("inset-shadow"),p=ke("text-shadow"),h=ke("drop-shadow"),m=ke("blur"),g=ke("perspective"),y=ke("aspect"),w=ke("ease"),v=ke("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...S(),re,te],k=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],P=()=>[re,te,d],N=()=>[er,"full","auto",...P()],D=()=>[tr,"none","subgrid",re,te],V=()=>["auto",{span:["full",tr,re,te]},tr,re,te],O=()=>[tr,"auto",re,te],L=()=>["auto","min","max","fr",re,te],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...P()],W=()=>[er,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],$=()=>[er,"screen","full","dvw","lvw","svw","min","max","fit",...P()],j=()=>[er,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],E=()=>[e,re,te],z=()=>[...S(),Bp,Vp,{position:[re,te]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",yS,fS,{size:[re,te]}],U=()=>[Xi,Mn,wr],H=()=>["","none","full",c,re,te],q=()=>["",le,Mn,wr],J=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[le,Xi,Bp,Vp],Pe=()=>["","none",m,re,te],ve=()=>["none",le,re,te],ge=()=>["none",le,re,te],he=()=>[le,re,te],Me=()=>[er,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$t],breakpoint:[$t],color:[Dp],container:[$t],"drop-shadow":[$t],ease:["in","out","in-out"],font:[uS],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$t],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$t],shadow:[$t],spacing:["px",le],text:[$t],"text-shadow":[$t],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",er,te,re,y]}],container:["container"],columns:[{columns:[le,te,re,l]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"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:T()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[tr,"auto",re,te]}],basis:[{basis:[er,"full","auto",l,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[le,er,"auto","initial","none",te]}],grow:[{grow:["",le,re,te]}],shrink:[{shrink:["",le,re,te]}],order:[{order:[tr,"first","last","none",re,te]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...j()]}],"min-block-size":[{"min-block":["auto",...j()]}],"max-block-size":[{"max-block":["none",...j()]}],w:[{w:[l,"screen",...W()]}],"min-w":[{"min-w":[l,"screen","none",...W()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",r,Mn,wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,bS,hS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xi,te]}],"font-family":[{font:[gS,pS,t]}],"font-features":[{"font-features":[te]}],"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:[s,re,te]}],"line-clamp":[{"line-clamp":[le,"none",re,Ip]}],leading:[{leading:[o,...P()]}],"list-image":[{"list-image":["none",re,te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",re,te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[le,"from-font","auto",re,wr]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[le,"auto",re,te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re,te]}],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",re,te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},tr,re,te],radial:["",re,te],conic:[tr,re,te]},wS,mS]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-bs":[{"border-bs":q()}],"border-w-be":[{"border-be":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[le,re,te]}],"outline-w":[{outline:["",le,Mn,wr]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",u,ro,to]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",f,ro,to]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[le,wr]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",p,ro,to]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[le,re,te]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"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":[le]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[re,te]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"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":S()}],"mask-image-conic-pos":[{"mask-conic":[le]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",re,te]}],filter:[{filter:["","none",re,te]}],blur:[{blur:Pe()}],brightness:[{brightness:[le,re,te]}],contrast:[{contrast:[le,re,te]}],"drop-shadow":[{"drop-shadow":["","none",h,ro,to]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",le,re,te]}],"hue-rotate":[{"hue-rotate":[le,re,te]}],invert:[{invert:["",le,re,te]}],saturate:[{saturate:[le,re,te]}],sepia:[{sepia:["",le,re,te]}],"backdrop-filter":[{"backdrop-filter":["","none",re,te]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[le,re,te]}],"backdrop-contrast":[{"backdrop-contrast":[le,re,te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",le,re,te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[le,re,te]}],"backdrop-invert":[{"backdrop-invert":["",le,re,te]}],"backdrop-opacity":[{"backdrop-opacity":[le,re,te]}],"backdrop-saturate":[{"backdrop-saturate":[le,re,te]}],"backdrop-sepia":[{"backdrop-sepia":["",le,re,te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",re,te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[le,"initial",re,te]}],ease:[{ease:["linear","initial",w,re,te]}],delay:[{delay:[le,re,te]}],animate:[{animate:["none",v,re,te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,re,te]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[re,te,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Me()}],"translate-x":[{"translate-x":Me()}],"translate-y":[{"translate-y":Me()}],"translate-z":[{"translate-z":Me()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"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",re,te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",re,te]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[le,Mn,wr,Ip]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ue(...e){return xS(Xu(e))}const CS=Ju("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 SS({className:e,variant:t="default",size:r="default",asChild:n=!1,...s}){const o=n?Ya:"button";return i.jsx(o,{"data-slot":"button","data-variant":t,"data-size":r,className:ue(CS({variant:t,size:r,className:e})),...s})}function PS({...e}){return i.jsx(hi,{"data-slot":"sheet",...e})}function ES({...e}){return i.jsx(pi,{"data-slot":"sheet-portal",...e})}function TS({className:e,...t}){return i.jsx(mi,{"data-slot":"sheet-overlay",className:ue("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 AS({className:e,children:t,side:r="right",showCloseButton:n=!0,...s}){return i.jsxs(ES,{children:[i.jsx(TS,{}),i.jsxs(gi,{"data-slot":"sheet-content",className:ue("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),...s,children:[t,n&&i.jsxs(g2,{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(Uy,{className:"size-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function kS({className:e,...t}){return i.jsx("div",{"data-slot":"sheet-header",className:ue("flex flex-col gap-1.5 p-4",e),...t})}function _S({className:e,...t}){return i.jsx(yi,{"data-slot":"sheet-title",className:ue("text-foreground font-semibold",e),...t})}function MS({className:e,...t}){return i.jsx(m2,{"data-slot":"sheet-description",className:ue("text-muted-foreground text-sm",e),...t})}function NS({delayDuration:e=0,...t}){return i.jsx(A3,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function LS({...e}){return i.jsx(k3,{"data-slot":"tooltip",...e})}function OS({...e}){return i.jsx(_3,{"data-slot":"tooltip-trigger",...e})}function FS({className:e,sideOffset:t=0,children:r,...n}){return i.jsx(M3,{children:i.jsxs(N3,{"data-slot":"tooltip-content",sideOffset:t,className:ue("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(L3,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const DS="sidebar_state",IS=3600*24*7,VS="16rem",BS="18rem",US="3rem",$S="b",Kp=C.createContext(null);function Zr(){const e=C.useContext(Kp);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function jS({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:s,children:o,...a}){const l=O3(),[d,c]=C.useState(!1),[u,f]=C.useState(e),p=t??u,h=C.useCallback(w=>{const v=typeof w=="function"?w(p):w;r?r(v):f(v),document.cookie=`${DS}=${v}; path=/; max-age=${IS}`},[r,p]),m=C.useCallback(()=>l?c(w=>!w):h(w=>!w),[l,h,c]);C.useEffect(()=>{const w=v=>{v.key===$S&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),m())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[m]);const g=p?"expanded":"collapsed",y=C.useMemo(()=>({state:g,open:p,setOpen:h,isMobile:l,openMobile:d,setOpenMobile:c,toggleSidebar:m}),[g,p,h,l,d,c,m]);return i.jsx(Kp.Provider,{value:y,children:i.jsx(NS,{delayDuration:0,children:i.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":VS,"--sidebar-width-icon":US,...s},className:ue("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...a,children:o})})})}function zS({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...o}){const{isMobile:a,state:l,openMobile:d,setOpenMobile:c}=Zr();return r==="none"?i.jsx("div",{"data-slot":"sidebar",className:ue("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...o,children:s}):a?i.jsx(PS,{open:d,onOpenChange:c,...o,children:i.jsxs(AS,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":BS},side:e,children:[i.jsxs(kS,{className:"sr-only",children:[i.jsx(_S,{children:"Sidebar"}),i.jsx(MS,{children:"Displays the mobile sidebar."})]}),i.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):i.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[i.jsx("div",{"data-slot":"sidebar-gap",className:ue("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:ue("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",n),...o,children:i.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"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",children:s})})]})}function HS({className:e,onClick:t,...r}){const{toggleSidebar:n}=Zr();return i.jsxs(SS,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ue("size-7",e),onClick:s=>{t?.(s),n()},...r,children:[i.jsx(Dy,{}),i.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function WS({className:e,...t}){const{toggleSidebar:r}=Zr();return i.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:ue("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 qS({className:e,...t}){return i.jsx("main",{"data-slot":"sidebar-inset",className:ue("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 KS({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ue("flex flex-col gap-2",e),...t})}function GS({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ue("flex flex-col gap-2 p-2",e),...t})}function XS({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ue("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Gp({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ue("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Xp({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ue("w-full text-sm",e),...t})}function YS({className:e,...t}){return i.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ue("flex w-full min-w-0 flex-col gap-1",e),...t})}function Zi({className:e,...t}){return i.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ue("group/menu-item relative",e),...t})}const ZS=Ju("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 Ji({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:s,className:o,...a}){const l=e?Ya:"button",{isMobile:d,state:c}=Zr(),u=i.jsx(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":t,className:ue(ZS({variant:r,size:n}),o),...a});return s?(typeof s=="string"&&(s={children:s}),i.jsxs(LS,{children:[i.jsx(OS,{asChild:!0,children:u}),i.jsx(FS,{side:"right",align:"center",hidden:c!=="collapsed"||d,...s})]})):u}function JS({className:e,...t}){return i.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:ue("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 QS({className:e,...t}){return i.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:ue("group/menu-sub-item relative",e),...t})}function RS({asChild:e=!1,size:t="md",isActive:r=!1,className:n,...s}){const o=e?Ya:"a";return i.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:ue("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),...s})}function eP({...e}){return i.jsx(rx,{"data-slot":"collapsible",...e})}function tP({...e}){return i.jsx(of,{"data-slot":"collapsible-trigger",...e})}function rP({...e}){return i.jsx(af,{"data-slot":"collapsible-content",...e})}function nP({...e}){return i.jsx(o3,{"data-slot":"dropdown-menu",...e})}function sP({...e}){return i.jsx(a3,{"data-slot":"dropdown-menu-trigger",...e})}function oP({className:e,sideOffset:t=4,...r}){return i.jsx(i3,{children:i.jsx(l3,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ue("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 aP({className:e,...t}){return i.jsx(d3,{"data-slot":"dropdown-menu-item",className:ue("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 iP({className:e,...t}){return i.jsx(c3,{"data-slot":"dropdown-menu-label",className:ue("px-2 py-1.5 text-xs font-semibold",e),...t})}function lP({className:e,...t}){return i.jsx(u3,{"data-slot":"dropdown-menu-separator",className:ue("bg-muted -mx-1 my-1 h-px",e),...t})}const cP="zango_app_logo_cache",dP=1440*60*1e3;class uP{constructor(){this.cacheKey=cP}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/")?(console.warn("Invalid cached logo format, clearing cache"),this.clearCache(),null):r}catch(t){return console.error("Error reading logo cache:",t),null}}async cacheLogoUrl(t,r){if(t)try{const n=await this.generateHash(t),s=this.getCachedLogo();if(s&&s.version===n)return s.timestamp=Date.now(),localStorage.setItem(this.cacheKey,JSON.stringify(s)),s;const o=await this.fetchAndConvertToBase64(t),a={url:t,base64Data:o,version:n,timestamp:Date.now(),appName:r||"Zango CRM"};return localStorage.setItem(this.cacheKey,JSON.stringify(a)),a}catch(n){return console.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:(console.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 s=n.headers.get("content-type");if(s&&!s.startsWith("image/"))throw new Error(`Invalid logo content type: ${s}`);const o=await n.blob();return new Promise((a,l)=>{const d=new FileReader;d.onloadend=()=>a(d.result),d.onerror=l,d.readAsDataURL(o)})}catch(r){return console.error("Error converting logo to base64:",r),null}}async generateHash(t){let r=0;for(let n=0;n<t.length;n++){const s=t.charCodeAt(n);r=(r<<5)-r+s,r=r&r}return Math.abs(r).toString(36)}isCacheExpired(t){return Date.now()-t>dP}clearCache(){try{localStorage.removeItem(this.cacheKey)}catch(t){console.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 o=await this.cacheLogoUrl(t,r);o&&n&&n(o)},100)}catch(s){console.error("Error updating logo in background:",s)}}}const vr=new uP,fP=()=>i.jsxs("svg",{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"})]}),Yp=({logoUrl:e,appName:t,height:r="28px",linkTo:n="/"})=>{const[s,o]=b.useState(()=>{const f=vr.getCachedLogo();return f&&(f.base64Data||f.url)?f.base64Data||f.url:e||null}),[a,l]=b.useState(!1);b.useEffect(()=>{e&&vr.updateInBackground(e,t,f=>{f.base64Data&&o(f.base64Data)})},[e,t]);const d=b.useCallback(()=>{console.error("Logo failed to load"),l(!0);const f=vr.getCachedLogo();f&&s===f.base64Data&&vr.clearCache()},[s]),c=b.useCallback(()=>{l(!1)},[]),u=()=>a||!s?i.jsx(fP,{}):i.jsx("img",{src:s,height:r,alt:t||"Logo",onError:d,onLoad:c,style:{maxHeight:r,objectFit:"contain"}});return i.jsx(R.Link,{to:n,className:"logo-link",children:u()})},no=(e,t={})=>`${t.baseUrl||""}${e}`,hP=(e,t={})=>t.endpoints?.[e]||"",pP=(e={})=>e.timeout||3e4;function Ge(e,t){if(!e)return"/";const[r,n]=e.split("?"),s=r.replace(/\/+$/,"")+"/",o=new URLSearchParams;n&&new URLSearchParams(n).forEach((d,c)=>{o.set(c,d)}),t&&Object.keys(t).length>0&&Object.entries(t).forEach(([l,d])=>{d!=null&&o.set(l,String(d))});const a=o.toString();return a?`${s}?${a}`:s}const mP="csrftoken",gP=8;function yP(e){const t=document.cookie.split(";");for(const r of t){const[n,s]=r.trim().split("=");if(n===e)try{return decodeURIComponent(s)}catch{return s}}return null}function wP(){const e=yP(mP);return e?bP(e)?e:(console.warn("[CSRF] Invalid token format detected"),null):null}function bP(e){return!e||typeof e!="string"||e.length<gP?!1:/^[a-zA-Z0-9_\-+=/]+$/.test(e)}const Nn="",Ln=async()=>{const e=wP();return e?{"X-CSRFToken":e}:{}},Zp=async({fullUrl:e})=>{const t=`${Nn}${e}${e.includes("?")?"&":"?"}_t=${Date.now()}`;return await fetch(t,{method:"GET",redirect:"follow",headers:{...await Ln(),"Content-Type":"application/json"}})},Jp=async({fullUrl:e,payload:t})=>await fetch(Nn+e,{method:"POST",redirect:"follow",headers:{...await Ln(),...!(t instanceof FormData)&&{"Content-Type":"application/json"}},body:t instanceof FormData?t:JSON.stringify(t)}),Qp=async({fullUrl:e,payload:t})=>await fetch(Nn+e,{method:"PUT",redirect:"follow",headers:{...await Ln(),...!(t instanceof FormData)&&{"Content-Type":"application/json"}},body:t instanceof FormData?t:JSON.stringify(t)}),Rp=async({fullUrl:e,payload:t})=>await fetch(Nn+e,{method:"DELETE",redirect:"follow",headers:{...await Ln(),"Content-Type":"application/json"},body:t instanceof FormData?t:JSON.stringify(t)}),em=async({fullUrl:e,payload:t})=>await fetch(Nn+e,{method:"PATCH",redirect:"follow",headers:{...await Ln(),...!(t instanceof FormData)&&{"Content-Type":"application/json"}},body:t instanceof FormData?t:JSON.stringify(t)}),Xe=async e=>{let t;try{const r=no(e.url);switch(e.type){case"POST":t=await Jp({fullUrl:r,payload:e.payload});break;case"PUT":t=await Qp({fullUrl:r,payload:e.payload});break;case"PATCH":t=await em({fullUrl:r,payload:e.payload});break;case"DELETE":t=await Rp({fullUrl:r,payload:e.payload});break;case"GET":default:t=await Zp({fullUrl:r})}if(t.status===200)try{return{response:(await t.json()).response,success:!0,responseStatus:t.status}}catch{return{response:{message:"Server Error"},success:!1,responseStatus:t.status}}else return{response:(await t.json()).response||{message:"Server Error"},success:!1,responseStatus:t.status}}catch(r){return console.error("API Request Error:",r),{response:{message:"Network Error"},success:!1,responseStatus:500}}},vP=e=>{if(!e||Object.keys(e).length===0)return"";const t=new URLSearchParams;Object.entries(e).forEach(([n,s])=>{s!=null&&t.append(n,String(s))});const r=t.toString();return r?`?${r}`:""},tm=()=>{const t=typeof window<"u"&&window.app_initializer_endpoint?window.app_initializer_endpoint:"/app/initializer",r=t.startsWith("/")?t:`/${t}`;return{url:Ge(r),type:"GET"}},rm=()=>({url:Ge("/api/v1/profile"),type:"GET"}),nm=e=>({url:Ge("/api/v1/profile"),type:"PUT",payload:e}),sm=e=>({url:Ge("/api/v1/profile/photo"),type:"POST",payload:e}),om=e=>({url:Ge("/api/v1/appauth/password/change/"),type:"PUT",payload:e}),am=e=>({url:Ge("/api/v1/profile/two-factor"),type:"POST",payload:e}),im=e=>({url:Ge(`/api/v1/appauth/role/switch/?role=${encodeURIComponent(e)}`),type:"POST"}),lm=()=>({url:Ge("/api/v1/appauth/sessions/"),type:"GET"}),cm=e=>({url:Ge("/api/v1/appauth/sessions/"),type:"DELETE",payload:{sessions:[e]}}),dm=e=>({url:Ge("/api/v1/appauth/sessions/"),type:"DELETE",payload:{sessions:e}}),um=()=>({url:Ge("/api/v1/appauth/logout"),type:"DELETE"}),fm=()=>({url:Ge("/logout"),type:"POST"}),hm=(e,t)=>({url:Ge(`${e}${e.includes("?")?"&":"?"}idleFor=${t}`),type:"GET"}),pm=async()=>Xe(tm()),mm=async()=>Xe(rm()),gm=async()=>Xe(lm()),so=async e=>Xe(nm(e)),xP=async e=>Xe(sm(e)),ym=async e=>Xe(om(e)),CP=async e=>Xe(am({enabled:e})),wm=async e=>Xe(im(e)),bm=async e=>Xe(cm(e)),vm=async e=>Xe(dm(e)),xm=async()=>Xe(um()),Cm=async()=>Xe(fm()),Sm=async(e,t)=>Xe(hm(e,t));function oo(e){"@babel/helpers - typeof";return oo=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},oo(e)}var SP=/^\s+/,PP=/\s+$/;function Q(e,t){if(e=e||"",t=t||{},e instanceof Q)return e;if(!(this instanceof Q))return new Q(e,t);var r=EP(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}Q.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,s,o,a,l;return r=t.r/255,n=t.g/255,s=t.b/255,r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),s<=.03928?l=s/12.92:l=Math.pow((s+.055)/1.055,2.4),.2126*o+.7152*a+.0722*l},setAlpha:function(t){return this._a=_m(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Em(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Em(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),s=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+s+"%)":"hsva("+r+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var t=Pm(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Pm(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),s=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+s+"%)":"hsla("+r+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(t){return Tm(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return _P(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(xe(this._r,255)*100)+"%",g:Math.round(xe(this._g,255)*100)+"%",b:Math.round(xe(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(xe(this._r,255)*100)+"%, "+Math.round(xe(this._g,255)*100)+"%, "+Math.round(xe(this._b,255)*100)+"%)":"rgba("+Math.round(xe(this._r,255)*100)+"%, "+Math.round(xe(this._g,255)*100)+"%, "+Math.round(xe(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:jP[Tm(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+Am(this._r,this._g,this._b,this._a),n=r,s=this._gradientType?"GradientType = 1, ":"";if(t){var o=Q(t);n="#"+Am(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var r=!!t;t=t||this._format;var n=!1,s=this._a<1&&this._a>=0,o=!r&&s&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return o?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 Q(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(OP,arguments)},brighten:function(){return this._applyModification(FP,arguments)},darken:function(){return this._applyModification(DP,arguments)},desaturate:function(){return this._applyModification(MP,arguments)},saturate:function(){return this._applyModification(NP,arguments)},greyscale:function(){return this._applyModification(LP,arguments)},spin:function(){return this._applyModification(IP,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(UP,arguments)},complement:function(){return this._applyCombination(VP,arguments)},monochromatic:function(){return this._applyCombination($P,arguments)},splitcomplement:function(){return this._applyCombination(BP,arguments)},triad:function(){return this._applyCombination(km,[3])},tetrad:function(){return this._applyCombination(km,[4])}},Q.fromRatio=function(e,t){if(oo(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=On(e[n]));e=r}return Q(e,t)};function EP(e){var t={r:0,g:0,b:0},r=1,n=null,s=null,o=null,a=!1,l=!1;return typeof e=="string"&&(e=qP(e)),oo(e)=="object"&&(jt(e.r)&&jt(e.g)&&jt(e.b)?(t=TP(e.r,e.g,e.b),a=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):jt(e.h)&&jt(e.s)&&jt(e.v)?(n=On(e.s),s=On(e.v),t=kP(e.h,n,s),a=!0,l="hsv"):jt(e.h)&&jt(e.s)&&jt(e.l)&&(n=On(e.s),o=On(e.l),t=AP(e.h,n,o),a=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=_m(r),{ok:a,format:e.format||l,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 TP(e,t,r){return{r:xe(e,255)*255,g:xe(t,255)*255,b:xe(r,255)*255}}function Pm(e,t,r){e=xe(e,255),t=xe(t,255),r=xe(r,255);var n=Math.max(e,t,r),s=Math.min(e,t,r),o,a,l=(n+s)/2;if(n==s)o=a=0;else{var d=n-s;switch(a=l>.5?d/(2-n-s):d/(n+s),n){case e:o=(t-r)/d+(t<r?6:0);break;case t:o=(r-e)/d+2;break;case r:o=(e-t)/d+4;break}o/=6}return{h:o,s:a,l}}function AP(e,t,r){var n,s,o;e=xe(e,360),t=xe(t,100),r=xe(r,100);function a(c,u,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?c+(u-c)*6*f:f<1/2?u:f<2/3?c+(u-c)*(2/3-f)*6:c}if(t===0)n=s=o=r;else{var l=r<.5?r*(1+t):r+t-r*t,d=2*r-l;n=a(d,l,e+1/3),s=a(d,l,e),o=a(d,l,e-1/3)}return{r:n*255,g:s*255,b:o*255}}function Em(e,t,r){e=xe(e,255),t=xe(t,255),r=xe(r,255);var n=Math.max(e,t,r),s=Math.min(e,t,r),o,a,l=n,d=n-s;if(a=n===0?0:d/n,n==s)o=0;else{switch(n){case e:o=(t-r)/d+(t<r?6:0);break;case t:o=(r-e)/d+2;break;case r:o=(e-t)/d+4;break}o/=6}return{h:o,s:a,v:l}}function kP(e,t,r){e=xe(e,360)*6,t=xe(t,100),r=xe(r,100);var n=Math.floor(e),s=e-n,o=r*(1-t),a=r*(1-s*t),l=r*(1-(1-s)*t),d=n%6,c=[r,a,o,o,l,r][d],u=[l,r,r,a,o,o][d],f=[o,o,l,r,r,a][d];return{r:c*255,g:u*255,b:f*255}}function Tm(e,t,r,n){var s=[mt(Math.round(e).toString(16)),mt(Math.round(t).toString(16)),mt(Math.round(r).toString(16))];return n&&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[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function _P(e,t,r,n,s){var o=[mt(Math.round(e).toString(16)),mt(Math.round(t).toString(16)),mt(Math.round(r).toString(16)),mt(Mm(n))];return s&&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[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function Am(e,t,r,n){var s=[mt(Mm(n)),mt(Math.round(e).toString(16)),mt(Math.round(t).toString(16)),mt(Math.round(r).toString(16))];return s.join("")}Q.equals=function(e,t){return!e||!t?!1:Q(e).toRgbString()==Q(t).toRgbString()},Q.random=function(){return Q.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function MP(e,t){t=t===0?0:t||10;var r=Q(e).toHsl();return r.s-=t/100,r.s=ao(r.s),Q(r)}function NP(e,t){t=t===0?0:t||10;var r=Q(e).toHsl();return r.s+=t/100,r.s=ao(r.s),Q(r)}function LP(e){return Q(e).desaturate(100)}function OP(e,t){t=t===0?0:t||10;var r=Q(e).toHsl();return r.l+=t/100,r.l=ao(r.l),Q(r)}function FP(e,t){t=t===0?0:t||10;var r=Q(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)))),Q(r)}function DP(e,t){t=t===0?0:t||10;var r=Q(e).toHsl();return r.l-=t/100,r.l=ao(r.l),Q(r)}function IP(e,t){var r=Q(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,Q(r)}function VP(e){var t=Q(e).toHsl();return t.h=(t.h+180)%360,Q(t)}function km(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=Q(e).toHsl(),n=[Q(e)],s=360/t,o=1;o<t;o++)n.push(Q({h:(r.h+o*s)%360,s:r.s,l:r.l}));return n}function BP(e){var t=Q(e).toHsl(),r=t.h;return[Q(e),Q({h:(r+72)%360,s:t.s,l:t.l}),Q({h:(r+216)%360,s:t.s,l:t.l})]}function UP(e,t,r){t=t||6,r=r||30;var n=Q(e).toHsl(),s=360/r,o=[Q(e)];for(n.h=(n.h-(s*t>>1)+720)%360;--t;)n.h=(n.h+s)%360,o.push(Q(n));return o}function $P(e,t){t=t||6;for(var r=Q(e).toHsv(),n=r.h,s=r.s,o=r.v,a=[],l=1/t;t--;)a.push(Q({h:n,s,v:o})),o=(o+l)%1;return a}Q.mix=function(e,t,r){r=r===0?0:r||50;var n=Q(e).toRgb(),s=Q(t).toRgb(),o=r/100,a={r:(s.r-n.r)*o+n.r,g:(s.g-n.g)*o+n.g,b:(s.b-n.b)*o+n.b,a:(s.a-n.a)*o+n.a};return Q(a)},Q.readability=function(e,t){var r=Q(e),n=Q(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},Q.isReadable=function(e,t,r){var n=Q.readability(e,t),s,o;switch(o=!1,s=KP(r),s.level+s.size){case"AAsmall":case"AAAlarge":o=n>=4.5;break;case"AAlarge":o=n>=3;break;case"AAAsmall":o=n>=7;break}return o},Q.mostReadable=function(e,t,r){var n=null,s=0,o,a,l,d;r=r||{},a=r.includeFallbackColors,l=r.level,d=r.size;for(var c=0;c<t.length;c++)o=Q.readability(e,t[c]),o>s&&(s=o,n=Q(t[c]));return Q.isReadable(e,n,{level:l,size:d})||!a?n:(r.includeFallbackColors=!1,Q.mostReadable(e,["#fff","#000"],r))};var Qi=Q.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"},jP=Q.hexNames=zP(Qi);function zP(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function _m(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function xe(e,t){HP(e)&&(e="100%");var r=WP(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 ao(e){return Math.min(1,Math.max(0,e))}function tt(e){return parseInt(e,16)}function HP(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function WP(e){return typeof e=="string"&&e.indexOf("%")!=-1}function mt(e){return e.length==1?"0"+e:""+e}function On(e){return e<=1&&(e=e*100+"%"),e}function Mm(e){return Math.round(parseFloat(e)*255).toString(16)}function Nm(e){return tt(e)/255}var gt=(function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",s="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+s),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+s),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+s),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 jt(e){return!!gt.CSS_UNIT.exec(e)}function qP(e){e=e.replace(SP,"").replace(PP,"").toLowerCase();var t=!1;if(Qi[e])e=Qi[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=gt.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=gt.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=gt.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=gt.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=gt.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=gt.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=gt.hex8.exec(e))?{r:tt(r[1]),g:tt(r[2]),b:tt(r[3]),a:Nm(r[4]),format:t?"name":"hex8"}:(r=gt.hex6.exec(e))?{r:tt(r[1]),g:tt(r[2]),b:tt(r[3]),format:t?"name":"hex"}:(r=gt.hex4.exec(e))?{r:tt(r[1]+""+r[1]),g:tt(r[2]+""+r[2]),b:tt(r[3]+""+r[3]),a:Nm(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=gt.hex3.exec(e))?{r:tt(r[1]+""+r[1]),g:tt(r[2]+""+r[2]),b:tt(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function KP(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 xr=e=>({25:Q.mix(e,"#FFFFFF",95).toHexString(),50:Q.mix(e,"#FFFFFF",90).toHexString(),100:Q.mix(e,"#FFFFFF",80).toHexString(),200:Q.mix(e,"#FFFFFF",65).toHexString(),300:Q.mix(e,"#FFFFFF",50).toHexString(),400:Q.mix(e,"#FFFFFF",30).toHexString(),500:Q(e).toHexString(),600:Q.mix(e,"#000000",10).toHexString(),700:Q.mix(e,"#000000",20).toHexString(),800:Q.mix(e,"#000000",30).toHexString(),900:Q.mix(e,"#000000",45).toHexString(),950:Q.mix(e,"#000000",60).toHexString()}),io=e=>{let t="";const r={brand:xr(e.colors.primary),success:xr(e.colors.success),warning:xr(e.colors.warning),gray:xr(e.colors.gray),error:xr(e.colors.error)};return t=Object.entries(r).map(([n,s])=>Object.entries(s).map(([o,a])=>`--color-${n}-${o}: ${a}`).join(`;
|
|
179
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},h2="DialogDescriptionWarning",p2=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xf(h2).contentName}}.`;return C.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},hi=Df,pi=Bf,mi=Uf,gi=$f,yi=zf,m2=Wf,g2=Kf;function y2(e){const[t,r]=C.useState(void 0);return It(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,l;if("borderBoxSize"in o){const d=o.borderBoxSize,c=Array.isArray(d)?d[0]:d;a=c.inlineSize,l=c.blockSize}else a=e.offsetWidth,l=e.offsetHeight;r({width:a,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}const w2=["top","right","bottom","left"],Qt=Math.min,Re=Math.max,Is=Math.round,Vs=Math.floor,Tt=e=>({x:e,y:e}),b2={left:"right",right:"left",bottom:"top",top:"bottom"},v2={start:"end",end:"start"};function wi(e,t,r){return Re(e,Qt(t,r))}function Bt(e,t){return typeof e=="function"?e(t):e}function Ut(e){return e.split("-")[0]}function qr(e){return e.split("-")[1]}function bi(e){return e==="x"?"y":"x"}function vi(e){return e==="y"?"height":"width"}const x2=new Set(["top","bottom"]);function At(e){return x2.has(Ut(e))?"y":"x"}function xi(e){return bi(At(e))}function C2(e,t,r){r===void 0&&(r=!1);const n=qr(e),s=xi(e),o=vi(s);let a=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Bs(a)),[a,Bs(a)]}function S2(e){const t=Bs(e);return[Ci(e),t,Ci(t)]}function Ci(e){return e.replace(/start|end/g,t=>v2[t])}const Yf=["left","right"],Zf=["right","left"],P2=["top","bottom"],E2=["bottom","top"];function T2(e,t,r){switch(e){case"top":case"bottom":return r?t?Zf:Yf:t?Yf:Zf;case"left":case"right":return t?P2:E2;default:return[]}}function A2(e,t,r,n){const s=qr(e);let o=T2(Ut(e),r==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Ci)))),o}function Bs(e){return e.replace(/left|right|bottom|top/g,t=>b2[t])}function k2(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jf(e){return typeof e!="number"?k2(e):{top:e,right:e,bottom:e,left:e}}function Us(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Qf(e,t,r){let{reference:n,floating:s}=e;const o=At(t),a=xi(t),l=vi(a),d=Ut(t),c=o==="y",u=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,p=n[l]/2-s[l]/2;let h;switch(d){case"top":h={x:u,y:n.y-s.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-s.width,y:f};break;default:h={x:n.x,y:n.y}}switch(qr(t)){case"start":h[a]-=p*(r&&c?-1:1);break;case"end":h[a]+=p*(r&&c?-1:1);break}return h}const _2=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=Qf(c,n,d),p=n,h={},m=0;for(let g=0;g<l.length;g++){const{name:y,fn:w}=l[g],{x:v,y:x,data:S,reset:T}=await w({x:u,y:f,initialPlacement:n,placement:p,strategy:s,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=v??u,f=x??f,h={...h,[y]:{...h[y],...S}},T&&m<=50&&(m++,typeof T=="object"&&(T.placement&&(p=T.placement),T.rects&&(c=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):T.rects),{x:u,y:f}=Qf(c,p,d)),g=-1)}return{x:u,y:f,placement:p,strategy:s,middlewareData:h}};async function bn(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:a,elements:l,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Bt(t,e),m=Jf(h),y=l[p?f==="floating"?"reference":"floating":f],w=Us(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(y)))==null||r?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:d})),v=f==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),S=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},T=Us(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:x,strategy:d}):v);return{top:(w.top-T.top+m.top)/S.y,bottom:(T.bottom-w.bottom+m.bottom)/S.y,left:(w.left-T.left+m.left)/S.x,right:(T.right-w.right+m.right)/S.x}}const M2=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:a,elements:l,middlewareData:d}=t,{element:c,padding:u=0}=Bt(e,t)||{};if(c==null)return{};const f=Jf(u),p={x:r,y:n},h=xi(s),m=vi(h),g=await a.getDimensions(c),y=h==="y",w=y?"top":"left",v=y?"bottom":"right",x=y?"clientHeight":"clientWidth",S=o.reference[m]+o.reference[h]-p[h]-o.floating[m],T=p[h]-o.reference[h],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let M=k?k[x]:0;(!M||!await(a.isElement==null?void 0:a.isElement(k)))&&(M=l.floating[x]||o.floating[m]);const P=S/2-T/2,N=M/2-g[m]/2-1,D=Qt(f[w],N),V=Qt(f[v],N),O=D,L=M-g[m]-V,_=M/2-g[m]/2+P,B=wi(O,_,L),F=!d.arrow&&qr(s)!=null&&_!==B&&o.reference[m]/2-(_<O?D:V)-g[m]/2<0,W=F?_<O?_-O:_-L:0;return{[h]:p[h]+W,data:{[h]:B,centerOffset:_-B-W,...F&&{alignmentOffset:W}},reset:F}}}),N2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:a,initialPlacement:l,platform:d,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Bt(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const w=Ut(s),v=At(l),x=Ut(l)===l,S=await(d.isRTL==null?void 0:d.isRTL(c.floating)),T=p||(x||!g?[Bs(l)]:S2(l)),k=m!=="none";!p&&k&&T.push(...A2(l,g,m,S));const M=[l,...T],P=await bn(t,y),N=[];let D=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&N.push(P[w]),f){const _=C2(s,a,S);N.push(P[_[0]],P[_[1]])}if(D=[...D,{placement:s,overflows:N}],!N.every(_=>_<=0)){var V,O;const _=(((V=o.flip)==null?void 0:V.index)||0)+1,B=M[_];if(B&&(!(f==="alignment"?v!==At(B):!1)||D.every($=>At($.placement)===v?$.overflows[0]>0:!0)))return{data:{index:_,overflows:D},reset:{placement:B}};let F=(O=D.filter(W=>W.overflows[0]<=0).sort((W,$)=>W.overflows[1]-$.overflows[1])[0])==null?void 0:O.placement;if(!F)switch(h){case"bestFit":{var L;const W=(L=D.filter($=>{if(k){const j=At($.placement);return j===v||j==="y"}return!0}).map($=>[$.placement,$.overflows.filter(j=>j>0).reduce((j,E)=>j+E,0)]).sort(($,j)=>$[1]-j[1])[0])==null?void 0:L[0];W&&(F=W);break}case"initialPlacement":F=l;break}if(s!==F)return{reset:{placement:F}}}return{}}}};function Rf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eh(e){return w2.some(t=>e[t]>=0)}const L2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=Bt(e,t);switch(n){case"referenceHidden":{const o=await bn(t,{...s,elementContext:"reference"}),a=Rf(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:eh(a)}}}case"escaped":{const o=await bn(t,{...s,altBoundary:!0}),a=Rf(o,r.floating);return{data:{escapedOffsets:a,escaped:eh(a)}}}default:return{}}}}},th=new Set(["left","top"]);async function O2(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=Ut(r),l=qr(r),d=At(r)==="y",c=th.has(a)?-1:1,u=o&&d?-1:1,f=Bt(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof m=="number"&&(h=l==="end"?m*-1:m),d?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const F2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:a,middlewareData:l}=t,d=await O2(t,e);return a===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+d.x,y:o+d.y,data:{...d,placement:a}}}}},D2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:w,y:v}=y;return{x:w,y:v}}},...d}=Bt(e,t),c={x:r,y:n},u=await bn(t,d),f=At(Ut(s)),p=bi(f);let h=c[p],m=c[f];if(o){const y=p==="y"?"top":"left",w=p==="y"?"bottom":"right",v=h+u[y],x=h-u[w];h=wi(v,h,x)}if(a){const y=f==="y"?"top":"left",w=f==="y"?"bottom":"right",v=m+u[y],x=m-u[w];m=wi(v,m,x)}const g=l.fn({...t,[p]:h,[f]:m});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[p]:o,[f]:a}}}}}},I2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:a}=t,{offset:l=0,mainAxis:d=!0,crossAxis:c=!0}=Bt(e,t),u={x:r,y:n},f=At(s),p=bi(f);let h=u[p],m=u[f];const g=Bt(l,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(d){const x=p==="y"?"height":"width",S=o.reference[p]-o.floating[x]+y.mainAxis,T=o.reference[p]+o.reference[x]-y.mainAxis;h<S?h=S:h>T&&(h=T)}if(c){var w,v;const x=p==="y"?"width":"height",S=th.has(Ut(s)),T=o.reference[f]-o.floating[x]+(S&&((w=a.offset)==null?void 0:w[f])||0)+(S?0:y.crossAxis),k=o.reference[f]+o.reference[x]+(S?0:((v=a.offset)==null?void 0:v[f])||0)-(S?y.crossAxis:0);m<T?m=T:m>k&&(m=k)}return{[p]:h,[f]:m}}}},V2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:a,elements:l}=t,{apply:d=()=>{},...c}=Bt(e,t),u=await bn(t,c),f=Ut(s),p=qr(s),h=At(s)==="y",{width:m,height:g}=o.floating;let y,w;f==="top"||f==="bottom"?(y=f,w=p===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(w=f,y=p==="end"?"top":"bottom");const v=g-u.top-u.bottom,x=m-u.left-u.right,S=Qt(g-u[y],v),T=Qt(m-u[w],x),k=!t.middlewareData.shift;let M=S,P=T;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(M=v),k&&!p){const D=Re(u.left,0),V=Re(u.right,0),O=Re(u.top,0),L=Re(u.bottom,0);h?P=m-2*(D!==0||V!==0?D+V:Re(u.left,u.right)):M=g-2*(O!==0||L!==0?O+L:Re(u.top,u.bottom))}await d({...t,availableWidth:P,availableHeight:M});const N=await a.getDimensions(l.floating);return m!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function $s(){return typeof window<"u"}function Kr(e){return rh(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kt(e){var t;return(t=(rh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function rh(e){return $s()?e instanceof Node||e instanceof et(e).Node:!1}function ht(e){return $s()?e instanceof Element||e instanceof et(e).Element:!1}function _t(e){return $s()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function nh(e){return!$s()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}const B2=new Set(["inline","contents"]);function vn(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!B2.has(s)}const U2=new Set(["table","td","th"]);function $2(e){return U2.has(Kr(e))}const j2=[":popover-open",":modal"];function js(e){return j2.some(t=>{try{return e.matches(t)}catch{return!1}})}const z2=["transform","translate","scale","rotate","perspective"],H2=["transform","translate","scale","rotate","perspective","filter"],W2=["paint","layout","strict","content"];function Si(e){const t=Pi(),r=ht(e)?pt(e):e;return z2.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||H2.some(n=>(r.willChange||"").includes(n))||W2.some(n=>(r.contain||"").includes(n))}function q2(e){let t=Rt(e);for(;_t(t)&&!Gr(t);){if(Si(t))return t;if(js(t))return null;t=Rt(t)}return null}function Pi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const K2=new Set(["html","body","#document"]);function Gr(e){return K2.has(Kr(e))}function pt(e){return et(e).getComputedStyle(e)}function zs(e){return ht(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rt(e){if(Kr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nh(e)&&e.host||kt(e);return nh(t)?t.host:t}function sh(e){const t=Rt(e);return Gr(t)?e.ownerDocument?e.ownerDocument.body:e.body:_t(t)&&vn(t)?t:sh(t)}function xn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=sh(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=et(s);if(o){const l=Ei(a);return t.concat(a,a.visualViewport||[],vn(s)?s:[],l&&r?xn(l):[])}return t.concat(s,xn(s,[],r))}function Ei(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oh(e){const t=pt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=_t(e),o=s?e.offsetWidth:r,a=s?e.offsetHeight:n,l=Is(r)!==o||Is(n)!==a;return l&&(r=o,n=a),{width:r,height:n,$:l}}function Ti(e){return ht(e)?e:e.contextElement}function Xr(e){const t=Ti(e);if(!_t(t))return Tt(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=oh(t);let a=(o?Is(r.width):r.width)/n,l=(o?Is(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const G2=Tt(0);function ah(e){const t=et(e);return!Pi()||!t.visualViewport?G2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function X2(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==et(e)?!1:t}function mr(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Ti(e);let a=Tt(1);t&&(n?ht(n)&&(a=Xr(n)):a=Xr(e));const l=X2(o,r,n)?ah(o):Tt(0);let d=(s.left+l.x)/a.x,c=(s.top+l.y)/a.y,u=s.width/a.x,f=s.height/a.y;if(o){const p=et(o),h=n&&ht(n)?et(n):n;let m=p,g=Ei(m);for(;g&&n&&h!==m;){const y=Xr(g),w=g.getBoundingClientRect(),v=pt(g),x=w.left+(g.clientLeft+parseFloat(v.paddingLeft))*y.x,S=w.top+(g.clientTop+parseFloat(v.paddingTop))*y.y;d*=y.x,c*=y.y,u*=y.x,f*=y.y,d+=x,c+=S,m=et(g),g=Ei(m)}}return Us({width:u,height:f,x:d,y:c})}function Hs(e,t){const r=zs(e).scrollLeft;return t?t.left+r:mr(kt(e)).left+r}function ih(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Hs(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function Y2(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",a=kt(n),l=t?js(t.floating):!1;if(n===a||l&&o)return r;let d={scrollLeft:0,scrollTop:0},c=Tt(1);const u=Tt(0),f=_t(n);if((f||!f&&!o)&&((Kr(n)!=="body"||vn(a))&&(d=zs(n)),_t(n))){const h=mr(n);c=Xr(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const p=a&&!f&&!o?ih(a,d):Tt(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-d.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-d.scrollTop*c.y+u.y+p.y}}function Z2(e){return Array.from(e.getClientRects())}function J2(e){const t=kt(e),r=zs(e),n=e.ownerDocument.body,s=Re(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Re(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Hs(e);const l=-r.scrollTop;return pt(n).direction==="rtl"&&(a+=Re(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:a,y:l}}const lh=25;function Q2(e,t){const r=et(e),n=kt(e),s=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,l=0,d=0;if(s){o=s.width,a=s.height;const u=Pi();(!u||u&&t==="fixed")&&(l=s.offsetLeft,d=s.offsetTop)}const c=Hs(n);if(c<=0){const u=n.ownerDocument,f=u.body,p=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(n.clientWidth-f.clientWidth-h);m<=lh&&(o-=m)}else c<=lh&&(o+=c);return{width:o,height:a,x:l,y:d}}const R2=new Set(["absolute","fixed"]);function eC(e,t){const r=mr(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=_t(e)?Xr(e):Tt(1),a=e.clientWidth*o.x,l=e.clientHeight*o.y,d=s*o.x,c=n*o.y;return{width:a,height:l,x:d,y:c}}function ch(e,t,r){let n;if(t==="viewport")n=Q2(e,r);else if(t==="document")n=J2(kt(e));else if(ht(t))n=eC(t,r);else{const s=ah(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Us(n)}function dh(e,t){const r=Rt(e);return r===t||!ht(r)||Gr(r)?!1:pt(r).position==="fixed"||dh(r,t)}function tC(e,t){const r=t.get(e);if(r)return r;let n=xn(e,[],!1).filter(l=>ht(l)&&Kr(l)!=="body"),s=null;const o=pt(e).position==="fixed";let a=o?Rt(e):e;for(;ht(a)&&!Gr(a);){const l=pt(a),d=Si(a);!d&&l.position==="fixed"&&(s=null),(o?!d&&!s:!d&&l.position==="static"&&!!s&&R2.has(s.position)||vn(a)&&!d&&dh(e,a))?n=n.filter(u=>u!==a):s=l,a=Rt(a)}return t.set(e,n),n}function rC(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[...r==="clippingAncestors"?js(t)?[]:tC(t,this._c):[].concat(r),n],l=a[0],d=a.reduce((c,u)=>{const f=ch(t,u,s);return c.top=Re(f.top,c.top),c.right=Qt(f.right,c.right),c.bottom=Qt(f.bottom,c.bottom),c.left=Re(f.left,c.left),c},ch(t,l,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function nC(e){const{width:t,height:r}=oh(e);return{width:t,height:r}}function sC(e,t,r){const n=_t(t),s=kt(t),o=r==="fixed",a=mr(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const d=Tt(0);function c(){d.x=Hs(s)}if(n||!n&&!o)if((Kr(t)!=="body"||vn(s))&&(l=zs(t)),n){const h=mr(t,!0,o,t);d.x=h.x+t.clientLeft,d.y=h.y+t.clientTop}else s&&c();o&&!n&&s&&c();const u=s&&!n&&!o?ih(s,l):Tt(0),f=a.left+l.scrollLeft-d.x-u.x,p=a.top+l.scrollTop-d.y-u.y;return{x:f,y:p,width:a.width,height:a.height}}function Ai(e){return pt(e).position==="static"}function uh(e,t){if(!_t(e)||pt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return kt(e)===r&&(r=r.ownerDocument.body),r}function fh(e,t){const r=et(e);if(js(e))return r;if(!_t(e)){let s=Rt(e);for(;s&&!Gr(s);){if(ht(s)&&!Ai(s))return s;s=Rt(s)}return r}let n=uh(e,t);for(;n&&$2(n)&&Ai(n);)n=uh(n,t);return n&&Gr(n)&&Ai(n)&&!Si(n)?r:n||q2(e)||r}const oC=async function(e){const t=this.getOffsetParent||fh,r=this.getDimensions,n=await r(e.floating);return{reference:sC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function aC(e){return pt(e).direction==="rtl"}const iC={convertOffsetParentRelativeRectToViewportRelativeRect:Y2,getDocumentElement:kt,getClippingRect:rC,getOffsetParent:fh,getElementRects:oC,getClientRects:Z2,getDimensions:nC,getScale:Xr,isElement:ht,isRTL:aC};function hh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lC(e,t){let r=null,n;const s=kt(e);function o(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function a(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),o();const c=e.getBoundingClientRect(),{left:u,top:f,width:p,height:h}=c;if(l||t(),!p||!h)return;const m=Vs(f),g=Vs(s.clientWidth-(u+p)),y=Vs(s.clientHeight-(f+h)),w=Vs(u),x={rootMargin:-m+"px "+-g+"px "+-y+"px "+-w+"px",threshold:Re(0,Qt(1,d))||1};let S=!0;function T(k){const M=k[0].intersectionRatio;if(M!==d){if(!S)return a();M?a(!1,M):n=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!hh(c,e.getBoundingClientRect())&&a(),S=!1}try{r=new IntersectionObserver(T,{...x,root:s.ownerDocument})}catch{r=new IntersectionObserver(T,x)}r.observe(e)}return a(!0),o}function cC(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,c=Ti(e),u=s||o?[...c?xn(c):[],...xn(t)]:[];u.forEach(w=>{s&&w.addEventListener("scroll",r,{passive:!0}),o&&w.addEventListener("resize",r)});const f=c&&l?lC(c,r):null;let p=-1,h=null;a&&(h=new ResizeObserver(w=>{let[v]=w;v&&v.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),r()}),c&&!d&&h.observe(c),h.observe(t));let m,g=d?mr(e):null;d&&y();function y(){const w=mr(e);g&&!hh(g,w)&&r(),g=w,m=requestAnimationFrame(y)}return r(),()=>{var w;u.forEach(v=>{s&&v.removeEventListener("scroll",r),o&&v.removeEventListener("resize",r)}),f?.(),(w=h)==null||w.disconnect(),h=null,d&&cancelAnimationFrame(m)}}const dC=F2,uC=D2,fC=N2,hC=V2,pC=L2,ph=M2,mC=I2,gC=(e,t,r)=>{const n=new Map,s={platform:iC,...r},o={...s.platform,_c:n};return _2(e,t,{...s,platform:o})};var yC=typeof document<"u",wC=function(){},Ws=yC?b.useLayoutEffect:wC;function qs(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,s;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(!qs(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!qs(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function mh(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gh(e,t){const r=mh(e);return Math.round(t*r)/r}function ki(e){const t=C.useRef(e);return Ws(()=>{t.current=e}),t}function bC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:d,open:c}=e,[u,f]=C.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=C.useState(n);qs(p,n)||h(n);const[m,g]=C.useState(null),[y,w]=C.useState(null),v=C.useCallback($=>{$!==k.current&&(k.current=$,g($))},[]),x=C.useCallback($=>{$!==M.current&&(M.current=$,w($))},[]),S=o||m,T=a||y,k=C.useRef(null),M=C.useRef(null),P=C.useRef(u),N=d!=null,D=ki(d),V=ki(s),O=ki(c),L=C.useCallback(()=>{if(!k.current||!M.current)return;const $={placement:t,strategy:r,middleware:p};V.current&&($.platform=V.current),gC(k.current,M.current,$).then(j=>{const E={...j,isPositioned:O.current!==!1};_.current&&!qs(P.current,E)&&(P.current=E,Vl.flushSync(()=>{f(E)}))})},[p,t,r,V,O]);Ws(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[c]);const _=C.useRef(!1);Ws(()=>(_.current=!0,()=>{_.current=!1}),[]),Ws(()=>{if(S&&(k.current=S),T&&(M.current=T),S&&T){if(D.current)return D.current(S,T,L);L()}},[S,T,L,D,N]);const B=C.useMemo(()=>({reference:k,floating:M,setReference:v,setFloating:x}),[v,x]),F=C.useMemo(()=>({reference:S,floating:T}),[S,T]),W=C.useMemo(()=>{const $={position:r,left:0,top:0};if(!F.floating)return $;const j=gh(F.floating,u.x),E=gh(F.floating,u.y);return l?{...$,transform:"translate("+j+"px, "+E+"px)",...mh(F.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:j,top:E}},[r,l,F.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:L,refs:B,elements:F,floatingStyles:W}),[u,L,B,F,W])}const vC=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?ph({element:n.current,padding:s}).fn(r):{}:n?ph({element:n,padding:s}).fn(r):{}}}},xC=(e,t)=>({...dC(e),options:[e,t]}),CC=(e,t)=>({...uC(e),options:[e,t]}),SC=(e,t)=>({...mC(e),options:[e,t]}),PC=(e,t)=>({...fC(e),options:[e,t]}),EC=(e,t)=>({...hC(e),options:[e,t]}),TC=(e,t)=>({...pC(e),options:[e,t]}),AC=(e,t)=>({...vC(e),options:[e,t]});var kC="Arrow",yh=C.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return i.jsx(be.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});yh.displayName=kC;var _C=yh,_i="Popper",[wh,Ks]=Yt(_i),[MC,bh]=wh(_i),vh=e=>{const{__scopePopper:t,children:r}=e,[n,s]=C.useState(null);return i.jsx(MC,{scope:t,anchor:n,onAnchorChange:s,children:r})};vh.displayName=_i;var xh="PopperAnchor",Ch=C.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=bh(xh,r),a=C.useRef(null),l=Te(t,a),d=C.useRef(null);return C.useEffect(()=>{const c=d.current;d.current=n?.current||a.current,c!==d.current&&o.onAnchorChange(d.current)}),n?null:i.jsx(be.div,{...s,ref:l})});Ch.displayName=xh;var Mi="PopperContent",[NC,LC]=wh(Mi),Sh=C.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...g}=e,y=bh(Mi,r),[w,v]=C.useState(null),x=Te(t,J=>v(J)),[S,T]=C.useState(null),k=y2(S),M=k?.width??0,P=k?.height??0,N=n+(o!=="center"?"-"+o:""),D=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},V=Array.isArray(c)?c:[c],O=V.length>0,L={padding:D,boundary:V.filter(FC),altBoundary:O},{refs:_,floatingStyles:B,placement:F,isPositioned:W,middlewareData:$}=bC({strategy:"fixed",placement:N,whileElementsMounted:(...J)=>cC(...J,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[xC({mainAxis:s+P,alignmentAxis:a}),d&&CC({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?SC():void 0,...L}),d&&PC({...L}),EC({...L,apply:({elements:J,rects:ne,availableWidth:se,availableHeight:Pe})=>{const{width:ve,height:ge}=ne.reference,he=J.floating.style;he.setProperty("--radix-popper-available-width",`${se}px`),he.setProperty("--radix-popper-available-height",`${Pe}px`),he.setProperty("--radix-popper-anchor-width",`${ve}px`),he.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),S&&AC({element:S,padding:l}),DC({arrowWidth:M,arrowHeight:P}),p&&TC({strategy:"referenceHidden",...L})]}),[j,E]=Th(F),z=Vt(m);It(()=>{W&&z?.()},[W,z]);const X=$.arrow?.x,G=$.arrow?.y,U=$.arrow?.centerOffset!==0,[H,q]=C.useState();return It(()=>{w&&q(window.getComputedStyle(w).zIndex)},[w]),i.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:W?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(NC,{scope:r,placedSide:j,onArrowChange:T,arrowX:X,arrowY:G,shouldHideArrow:U,children:i.jsx(be.div,{"data-side":j,"data-align":E,...g,ref:x,style:{...g.style,animation:W?void 0:"none"}})})})});Sh.displayName=Mi;var Ph="PopperArrow",OC={top:"bottom",right:"left",bottom:"top",left:"right"},Eh=C.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=LC(Ph,n),a=OC[o.placedSide];return i.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i.jsx(_C,{...s,ref:r,style:{...s.style,display:"block"}})})});Eh.displayName=Ph;function FC(e){return e!==null}var DC=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:s}=t,a=s.arrow?.centerOffset!==0,l=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[c,u]=Th(r),f={start:"0%",center:"50%",end:"100%"}[u],p=(s.arrow?.x??0)+l/2,h=(s.arrow?.y??0)+d/2;let m="",g="";return c==="bottom"?(m=a?f:`${p}px`,g=`${-d}px`):c==="top"?(m=a?f:`${p}px`,g=`${n.floating.height+d}px`):c==="right"?(m=`${-d}px`,g=a?f:`${h}px`):c==="left"&&(m=`${n.floating.width+d}px`,g=a?f:`${h}px`),{data:{x:m,y:g}}}});function Th(e){const[t,r="center"]=e.split("-");return[t,r]}var Ah=vh,kh=Ch,_h=Sh,Mh=Eh,Ni="rovingFocusGroup.onEntryFocus",IC={bubbles:!1,cancelable:!0},Cn="RovingFocusGroup",[Li,Nh,VC]=rf(Cn),[BC,Lh]=Yt(Cn,[VC]),[UC,$C]=BC(Cn),Oh=C.forwardRef((e,t)=>i.jsx(Li.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Li.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(jC,{...e,ref:t})})}));Oh.displayName=Cn;var jC=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...f}=e,p=C.useRef(null),h=Te(t,p),m=lf(o),[g,y]=wn({prop:a,defaultProp:l??null,onChange:d,caller:Cn}),[w,v]=C.useState(!1),x=Vt(c),S=Nh(r),T=C.useRef(!1),[k,M]=C.useState(0);return C.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(Ni,x),()=>P.removeEventListener(Ni,x)},[x]),i.jsx(UC,{scope:r,orientation:n,dir:m,loop:s,currentTabStopId:g,onItemFocus:C.useCallback(P=>y(P),[y]),onItemShiftTab:C.useCallback(()=>v(!0),[]),onFocusableItemAdd:C.useCallback(()=>M(P=>P+1),[]),onFocusableItemRemove:C.useCallback(()=>M(P=>P-1),[]),children:i.jsx(be.div,{tabIndex:w||k===0?-1:0,"data-orientation":n,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:oe(e.onMouseDown,()=>{T.current=!0}),onFocus:oe(e.onFocus,P=>{const N=!T.current;if(P.target===P.currentTarget&&N&&!w){const D=new CustomEvent(Ni,IC);if(P.currentTarget.dispatchEvent(D),!D.defaultPrevented){const V=S().filter(F=>F.focusable),O=V.find(F=>F.active),L=V.find(F=>F.id===g),B=[O,L,...V].filter(Boolean).map(F=>F.ref.current);Ih(B,u)}}T.current=!1}),onBlur:oe(e.onBlur,()=>v(!1))})})}),Fh="RovingFocusGroupItem",Dh=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,children:a,...l}=e,d=Zt(),c=o||d,u=$C(Fh,r),f=u.currentTabStopId===c,p=Nh(r),{onFocusableItemAdd:h,onFocusableItemRemove:m,currentTabStopId:g}=u;return C.useEffect(()=>{if(n)return h(),()=>m()},[n,h,m]),i.jsx(Li.ItemSlot,{scope:r,id:c,focusable:n,active:s,children:i.jsx(be.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:oe(e.onMouseDown,y=>{n?u.onItemFocus(c):y.preventDefault()}),onFocus:oe(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:oe(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const w=WC(y,u.orientation,u.dir);if(w!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=p().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")x.reverse();else if(w==="prev"||w==="next"){w==="prev"&&x.reverse();const S=x.indexOf(y.currentTarget);x=u.loop?qC(x,S+1):x.slice(S+1)}setTimeout(()=>Ih(x))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:g!=null}):a})})});Dh.displayName=Fh;var zC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function HC(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function WC(e,t,r){const n=HC(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return zC[n]}function Ih(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function qC(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var KC=Oh,GC=Dh,Oi=["Enter"," "],XC=["ArrowDown","PageUp","Home"],Vh=["ArrowUp","PageDown","End"],YC=[...XC,...Vh],ZC={ltr:[...Oi,"ArrowRight"],rtl:[...Oi,"ArrowLeft"]},JC={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sn="Menu",[Pn,QC,RC]=rf(Sn),[gr,Bh]=Yt(Sn,[RC,Ks,Lh]),Gs=Ks(),Uh=Lh(),[e5,yr]=gr(Sn),[t5,En]=gr(Sn),$h=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:o,modal:a=!0}=e,l=Gs(t),[d,c]=C.useState(null),u=C.useRef(!1),f=Vt(o),p=lf(s);return C.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),i.jsx(Ah,{...l,children:i.jsx(e5,{scope:t,open:r,onOpenChange:f,content:d,onContentChange:c,children:i.jsx(t5,{scope:t,onClose:C.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:a,children:n})})})};$h.displayName=Sn;var r5="MenuAnchor",Fi=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Gs(r);return i.jsx(kh,{...s,...n,ref:t})});Fi.displayName=r5;var Di="MenuPortal",[n5,jh]=gr(Di,{forceMount:void 0}),zh=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=yr(Di,t);return i.jsx(n5,{scope:t,forceMount:r,children:i.jsx(ut,{present:r||o.open,children:i.jsx(Ts,{asChild:!0,container:s,children:n})})})};zh.displayName=Di;var at="MenuContent",[s5,Ii]=gr(at),Hh=C.forwardRef((e,t)=>{const r=jh(at,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=yr(at,e.__scopeMenu),a=En(at,e.__scopeMenu);return i.jsx(Pn.Provider,{scope:e.__scopeMenu,children:i.jsx(ut,{present:n||o.open,children:i.jsx(Pn.Slot,{scope:e.__scopeMenu,children:a.modal?i.jsx(o5,{...s,ref:t}):i.jsx(a5,{...s,ref:t})})})})}),o5=C.forwardRef((e,t)=>{const r=yr(at,e.__scopeMenu),n=C.useRef(null),s=Te(t,n);return C.useEffect(()=>{const o=n.current;if(o)return Of(o)},[]),i.jsx(Vi,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:oe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),a5=C.forwardRef((e,t)=>{const r=yr(at,e.__scopeMenu);return i.jsx(Vi,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),i5=$r("MenuContent.ScrollLock"),Vi=C.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:d,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:h,disableOutsideScroll:m,...g}=e,y=yr(at,r),w=En(at,r),v=Gs(r),x=Uh(r),S=QC(r),[T,k]=C.useState(null),M=C.useRef(null),P=Te(t,M,y.onContentChange),N=C.useRef(0),D=C.useRef(""),V=C.useRef(0),O=C.useRef(null),L=C.useRef("right"),_=C.useRef(0),B=m?li:C.Fragment,F=m?{as:i5,allowPinchZoom:!0}:void 0,W=j=>{const E=D.current+j,z=S().filter(J=>!J.disabled),X=document.activeElement,G=z.find(J=>J.ref.current===X)?.textValue,U=z.map(J=>J.textValue),H=b5(U,E,G),q=z.find(J=>J.textValue===H)?.ref.current;(function J(ne){D.current=ne,window.clearTimeout(N.current),ne!==""&&(N.current=window.setTimeout(()=>J(""),1e3))})(E),q&&setTimeout(()=>q.focus())};C.useEffect(()=>()=>window.clearTimeout(N.current),[]),wf();const $=C.useCallback(j=>L.current===O.current?.side&&x5(j,O.current?.area),[]);return i.jsx(s5,{scope:r,searchRef:D,onItemEnter:C.useCallback(j=>{$(j)&&j.preventDefault()},[$]),onItemLeave:C.useCallback(j=>{$(j)||(M.current?.focus(),k(null))},[$]),onTriggerLeave:C.useCallback(j=>{$(j)&&j.preventDefault()},[$]),pointerGraceTimerRef:V,onPointerGraceIntentChange:C.useCallback(j=>{O.current=j},[]),children:i.jsx(B,{...F,children:i.jsx(ri,{asChild:!0,trapped:s,onMountAutoFocus:oe(o,j=>{j.preventDefault(),M.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:i.jsx(Es,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:h,children:i.jsx(KC,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:n,currentTabStopId:T,onCurrentTabStopIdChange:k,onEntryFocus:oe(d,j=>{w.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(_h,{role:"menu","aria-orientation":"vertical","data-state":ap(y.open),"data-radix-menu-content":"",dir:w.dir,...v,...g,ref:P,style:{outline:"none",...g.style},onKeyDown:oe(g.onKeyDown,j=>{const z=j.target.closest("[data-radix-menu-content]")===j.currentTarget,X=j.ctrlKey||j.altKey||j.metaKey,G=j.key.length===1;z&&(j.key==="Tab"&&j.preventDefault(),!X&&G&&W(j.key));const U=M.current;if(j.target!==U||!YC.includes(j.key))return;j.preventDefault();const q=S().filter(J=>!J.disabled).map(J=>J.ref.current);Vh.includes(j.key)&&q.reverse(),y5(q)}),onBlur:oe(e.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(N.current),D.current="")}),onPointerMove:oe(e.onPointerMove,An(j=>{const E=j.target,z=_.current!==j.clientX;if(j.currentTarget.contains(E)&&z){const X=j.clientX>_.current?"right":"left";L.current=X,_.current=j.clientX}}))})})})})})})});Hh.displayName=at;var l5="MenuGroup",Bi=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(be.div,{role:"group",...n,ref:t})});Bi.displayName=l5;var c5="MenuLabel",Wh=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(be.div,{...n,ref:t})});Wh.displayName=c5;var Xs="MenuItem",qh="menu.itemSelect",Ys=C.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=C.useRef(null),a=En(Xs,e.__scopeMenu),l=Ii(Xs,e.__scopeMenu),d=Te(t,o),c=C.useRef(!1),u=()=>{const f=o.current;if(!r&&f){const p=new CustomEvent(qh,{bubbles:!0,cancelable:!0});f.addEventListener(qh,h=>n?.(h),{once:!0}),ef(f,p),p.defaultPrevented?c.current=!1:a.onClose()}};return i.jsx(Kh,{...s,ref:d,disabled:r,onClick:oe(e.onClick,u),onPointerDown:f=>{e.onPointerDown?.(f),c.current=!0},onPointerUp:oe(e.onPointerUp,f=>{c.current||f.currentTarget?.click()}),onKeyDown:oe(e.onKeyDown,f=>{const p=l.searchRef.current!=="";r||p&&f.key===" "||Oi.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Ys.displayName=Xs;var Kh=C.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,a=Ii(Xs,r),l=Uh(r),d=C.useRef(null),c=Te(t,d),[u,f]=C.useState(!1),[p,h]=C.useState("");return C.useEffect(()=>{const m=d.current;m&&h((m.textContent??"").trim())},[o.children]),i.jsx(Pn.ItemSlot,{scope:r,disabled:n,textValue:s??p,children:i.jsx(GC,{asChild:!0,...l,focusable:!n,children:i.jsx(be.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:c,onPointerMove:oe(e.onPointerMove,An(m=>{n?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:oe(e.onPointerLeave,An(m=>a.onItemLeave(m))),onFocus:oe(e.onFocus,()=>f(!0)),onBlur:oe(e.onBlur,()=>f(!1))})})})}),d5="MenuCheckboxItem",Gh=C.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return i.jsx(Qh,{scope:e.__scopeMenu,checked:r,children:i.jsx(Ys,{role:"menuitemcheckbox","aria-checked":Zs(r)?"mixed":r,...s,ref:t,"data-state":$i(r),onSelect:oe(s.onSelect,()=>n?.(Zs(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Gh.displayName=d5;var Xh="MenuRadioGroup",[u5,f5]=gr(Xh,{value:void 0,onValueChange:()=>{}}),Yh=C.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=Vt(n);return i.jsx(u5,{scope:e.__scopeMenu,value:r,onValueChange:o,children:i.jsx(Bi,{...s,ref:t})})});Yh.displayName=Xh;var Zh="MenuRadioItem",Jh=C.forwardRef((e,t)=>{const{value:r,...n}=e,s=f5(Zh,e.__scopeMenu),o=r===s.value;return i.jsx(Qh,{scope:e.__scopeMenu,checked:o,children:i.jsx(Ys,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":$i(o),onSelect:oe(n.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});Jh.displayName=Zh;var Ui="MenuItemIndicator",[Qh,h5]=gr(Ui,{checked:!1}),Rh=C.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=h5(Ui,r);return i.jsx(ut,{present:n||Zs(o.checked)||o.checked===!0,children:i.jsx(be.span,{...s,ref:t,"data-state":$i(o.checked)})})});Rh.displayName=Ui;var p5="MenuSeparator",ep=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return i.jsx(be.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});ep.displayName=p5;var m5="MenuArrow",tp=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Gs(r);return i.jsx(Mh,{...s,...n,ref:t})});tp.displayName=m5;var g5="MenuSub",[zT,rp]=gr(g5),Tn="MenuSubTrigger",np=C.forwardRef((e,t)=>{const r=yr(Tn,e.__scopeMenu),n=En(Tn,e.__scopeMenu),s=rp(Tn,e.__scopeMenu),o=Ii(Tn,e.__scopeMenu),a=C.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:d}=o,c={__scopeMenu:e.__scopeMenu},u=C.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return C.useEffect(()=>u,[u]),C.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),d(null)}},[l,d]),i.jsx(Fi,{asChild:!0,...c,children:i.jsx(Kh,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":ap(r.open),...e,ref:Cs(t,s.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:oe(e.onPointerMove,An(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:oe(e.onPointerLeave,An(f=>{u();const p=r.content?.getBoundingClientRect();if(p){const h=r.content?.dataset.side,m=h==="right",g=m?-5:5,y=p[m?"left":"right"],w=p[m?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+g,y:f.clientY},{x:y,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x:y,y:p.bottom}],side:h}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:oe(e.onKeyDown,f=>{const p=o.searchRef.current!=="";e.disabled||p&&f.key===" "||ZC[n.dir].includes(f.key)&&(r.onOpenChange(!0),r.content?.focus(),f.preventDefault())})})})});np.displayName=Tn;var sp="MenuSubContent",op=C.forwardRef((e,t)=>{const r=jh(at,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=yr(at,e.__scopeMenu),a=En(at,e.__scopeMenu),l=rp(sp,e.__scopeMenu),d=C.useRef(null),c=Te(t,d);return i.jsx(Pn.Provider,{scope:e.__scopeMenu,children:i.jsx(ut,{present:n||o.open,children:i.jsx(Pn.Slot,{scope:e.__scopeMenu,children:i.jsx(Vi,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{a.isUsingKeyboardRef.current&&d.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:oe(e.onFocusOutside,u=>{u.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:oe(e.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:oe(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),p=JC[a.dir].includes(u.key);f&&p&&(o.onOpenChange(!1),l.trigger?.focus(),u.preventDefault())})})})})})});op.displayName=sp;function ap(e){return e?"open":"closed"}function Zs(e){return e==="indeterminate"}function $i(e){return Zs(e)?"indeterminate":e?"checked":"unchecked"}function y5(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function w5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function b5(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=w5(e,Math.max(o,0));s.length===1&&(a=a.filter(c=>c!==r));const d=a.find(c=>c.toLowerCase().startsWith(s.toLowerCase()));return d!==r?d:void 0}function v5(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],d=t[a],c=l.x,u=l.y,f=d.x,p=d.y;u>n!=p>n&&r<(f-c)*(n-u)/(p-u)+c&&(s=!s)}return s}function x5(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return v5(r,t)}function An(e){return t=>t.pointerType==="mouse"?e(t):void 0}var C5=$h,S5=Fi,P5=zh,E5=Hh,T5=Bi,A5=Wh,k5=Ys,_5=Gh,M5=Yh,N5=Jh,L5=Rh,O5=ep,F5=tp,D5=np,I5=op,Js="DropdownMenu",[V5]=Yt(Js,[Bh]),We=Bh(),[B5,ip]=V5(Js),lp=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,d=We(t),c=C.useRef(null),[u,f]=wn({prop:s,defaultProp:o??!1,onChange:a,caller:Js});return i.jsx(B5,{scope:t,triggerId:Zt(),triggerRef:c,contentId:Zt(),open:u,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(p=>!p),[f]),modal:l,children:i.jsx(C5,{...d,open:u,onOpenChange:f,dir:n,modal:l,children:r})})};lp.displayName=Js;var cp="DropdownMenuTrigger",dp=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=ip(cp,r),a=We(r);return i.jsx(S5,{asChild:!0,...a,children:i.jsx(be.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:Cs(t,o.triggerRef),onPointerDown:oe(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:oe(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});dp.displayName=cp;var U5="DropdownMenuPortal",up=e=>{const{__scopeDropdownMenu:t,...r}=e,n=We(t);return i.jsx(P5,{...n,...r})};up.displayName=U5;var fp="DropdownMenuContent",hp=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=ip(fp,r),o=We(r),a=C.useRef(!1);return i.jsx(E5,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:oe(e.onCloseAutoFocus,l=>{a.current||s.triggerRef.current?.focus(),a.current=!1,l.preventDefault()}),onInteractOutside:oe(e.onInteractOutside,l=>{const d=l.detail.originalEvent,c=d.button===0&&d.ctrlKey===!0,u=d.button===2||c;(!s.modal||u)&&(a.current=!0)}),style:{...e.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)"}})});hp.displayName=fp;var $5="DropdownMenuGroup",j5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(T5,{...s,...n,ref:t})});j5.displayName=$5;var z5="DropdownMenuLabel",pp=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(A5,{...s,...n,ref:t})});pp.displayName=z5;var H5="DropdownMenuItem",mp=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(k5,{...s,...n,ref:t})});mp.displayName=H5;var W5="DropdownMenuCheckboxItem",q5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(_5,{...s,...n,ref:t})});q5.displayName=W5;var K5="DropdownMenuRadioGroup",G5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(M5,{...s,...n,ref:t})});G5.displayName=K5;var X5="DropdownMenuRadioItem",Y5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(N5,{...s,...n,ref:t})});Y5.displayName=X5;var Z5="DropdownMenuItemIndicator",J5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(L5,{...s,...n,ref:t})});J5.displayName=Z5;var Q5="DropdownMenuSeparator",gp=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(O5,{...s,...n,ref:t})});gp.displayName=Q5;var R5="DropdownMenuArrow",e3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(F5,{...s,...n,ref:t})});e3.displayName=R5;var t3="DropdownMenuSubTrigger",r3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(D5,{...s,...n,ref:t})});r3.displayName=t3;var n3="DropdownMenuSubContent",s3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=We(r);return i.jsx(I5,{...s,...n,ref:t,style:{...e.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)"}})});s3.displayName=n3;var o3=lp,a3=dp,i3=up,l3=hp,c3=pp,d3=mp,u3=gp,[Qs]=Yt("Tooltip",[Ks]),Rs=Ks(),yp="TooltipProvider",f3=700,ji="tooltip.open",[h3,zi]=Qs(yp),wp=e=>{const{__scopeTooltip:t,delayDuration:r=f3,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,a=C.useRef(!0),l=C.useRef(!1),d=C.useRef(0);return C.useEffect(()=>{const c=d.current;return()=>window.clearTimeout(c)},[]),i.jsx(h3,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:C.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:C.useCallback(c=>{l.current=c},[]),disableHoverableContent:s,children:o})};wp.displayName=yp;var kn="Tooltip",[p3,_n]=Qs(kn),bp=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:o,disableHoverableContent:a,delayDuration:l}=e,d=zi(kn,e.__scopeTooltip),c=Rs(t),[u,f]=C.useState(null),p=Zt(),h=C.useRef(0),m=a??d.disableHoverableContent,g=l??d.delayDuration,y=C.useRef(!1),[w,v]=wn({prop:n,defaultProp:s??!1,onChange:M=>{M?(d.onOpen(),document.dispatchEvent(new CustomEvent(ji))):d.onClose(),o?.(M)},caller:kn}),x=C.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),S=C.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,v(!0)},[v]),T=C.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v(!1)},[v]),k=C.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,v(!0),h.current=0},g)},[g,v]);return C.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),i.jsx(Ah,{...c,children:i.jsx(p3,{scope:t,contentId:p,open:w,stateAttribute:x,trigger:u,onTriggerChange:f,onTriggerEnter:C.useCallback(()=>{d.isOpenDelayedRef.current?k():S()},[d.isOpenDelayedRef,k,S]),onTriggerLeave:C.useCallback(()=>{m?T():(window.clearTimeout(h.current),h.current=0)},[T,m]),onOpen:S,onClose:T,disableHoverableContent:m,children:r})})};bp.displayName=kn;var Hi="TooltipTrigger",vp=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=_n(Hi,r),o=zi(Hi,r),a=Rs(r),l=C.useRef(null),d=Te(t,l,s.onTriggerChange),c=C.useRef(!1),u=C.useRef(!1),f=C.useCallback(()=>c.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),i.jsx(kh,{asChild:!0,...a,children:i.jsx(be.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:d,onPointerMove:oe(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:oe(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:oe(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:oe(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:oe(e.onBlur,s.onClose),onClick:oe(e.onClick,s.onClose)})})});vp.displayName=Hi;var Wi="TooltipPortal",[m3,g3]=Qs(Wi,{forceMount:void 0}),xp=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,o=_n(Wi,t);return i.jsx(m3,{scope:t,forceMount:r,children:i.jsx(ut,{present:r||o.open,children:i.jsx(Ts,{asChild:!0,container:s,children:n})})})};xp.displayName=Wi;var Yr="TooltipContent",Cp=C.forwardRef((e,t)=>{const r=g3(Yr,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,a=_n(Yr,e.__scopeTooltip);return i.jsx(ut,{present:n||a.open,children:a.disableHoverableContent?i.jsx(Sp,{side:s,...o,ref:t}):i.jsx(y3,{side:s,...o,ref:t})})}),y3=C.forwardRef((e,t)=>{const r=_n(Yr,e.__scopeTooltip),n=zi(Yr,e.__scopeTooltip),s=C.useRef(null),o=Te(t,s),[a,l]=C.useState(null),{trigger:d,onClose:c}=r,u=s.current,{onPointerInTransitChange:f}=n,p=C.useCallback(()=>{l(null),f(!1)},[f]),h=C.useCallback((m,g)=>{const y=m.currentTarget,w={x:m.clientX,y:m.clientY},v=x3(w,y.getBoundingClientRect()),x=C3(w,v),S=S3(g.getBoundingClientRect()),T=E3([...x,...S]);l(T),f(!0)},[f]);return C.useEffect(()=>()=>p(),[p]),C.useEffect(()=>{if(d&&u){const m=y=>h(y,u),g=y=>h(y,d);return d.addEventListener("pointerleave",m),u.addEventListener("pointerleave",g),()=>{d.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",g)}}},[d,u,h,p]),C.useEffect(()=>{if(a){const m=g=>{const y=g.target,w={x:g.clientX,y:g.clientY},v=d?.contains(y)||u?.contains(y),x=!P3(w,a);v?p():x&&(p(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[d,u,a,c,p]),i.jsx(Sp,{...e,ref:o})}),[w3,b3]=Qs(kn,{isInside:!1}),v3=Dv("TooltipContent"),Sp=C.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...l}=e,d=_n(Yr,r),c=Rs(r),{onClose:u}=d;return C.useEffect(()=>(document.addEventListener(ji,u),()=>document.removeEventListener(ji,u)),[u]),C.useEffect(()=>{if(d.trigger){const f=p=>{p.target?.contains(d.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[d.trigger,u]),i.jsx(Es,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:i.jsxs(_h,{"data-state":d.stateAttribute,...c,...l,ref:t,style:{...l.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(v3,{children:n}),i.jsx(w3,{scope:r,isInside:!0,children:i.jsx(zv,{id:d.contentId,role:"tooltip",children:s||n})})]})})});Cp.displayName=Yr;var Pp="TooltipArrow",Ep=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Rs(r);return b3(Pp,r).isInside?null:i.jsx(Mh,{...s,...n,ref:t})});Ep.displayName=Pp;function x3(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function C3(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}function S3(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function P3(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const l=t[o],d=t[a],c=l.x,u=l.y,f=d.x,p=d.y;u>n!=p>n&&r<(f-c)*(n-u)/(p-u)+c&&(s=!s)}return s}function E3(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),T3(t)}function T3(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],a=r[r.length-2];if((o.x-a.x)*(s.y-a.y)>=(o.y-a.y)*(s.x-a.x))r.pop();else break}r.push(s)}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)}var A3=wp,k3=bp,_3=vp,M3=xp,N3=Cp,L3=Ep;const qi=768;function O3(){const[e,t]=C.useState(void 0);return C.useEffect(()=>{const r=window.matchMedia(`(max-width: ${qi-1}px)`),n=()=>{t(window.innerWidth<qi)};return r.addEventListener("change",n),t(window.innerWidth<qi),()=>r.removeEventListener("change",n)},[]),!!e}const F3=(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},D3=(e,t)=>({classGroupId:e,validator:t}),Tp=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),eo="-",Ap=[],I3="arbitrary..",V3=e=>{const t=U3(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return B3(a);const l=a.split(eo),d=l[0]===""&&l.length>1?1:0;return kp(l,d,t)},getConflictingClassGroupIds:(a,l)=>{if(l){const d=n[a],c=r[a];return d?c?F3(c,d):d:c||Ap}return r[a]||Ap}}},kp=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],o=r.nextPart.get(s);if(o){const c=kp(e,t+1,o);if(c)return c}const a=r.validators;if(a===null)return;const l=t===0?e.join(eo):e.slice(t).join(eo),d=a.length;for(let c=0;c<d;c++){const u=a[c];if(u.validator(l))return u.classGroupId}},B3=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?I3+n:void 0})(),U3=e=>{const{theme:t,classGroups:r}=e;return $3(r,t)},$3=(e,t)=>{const r=Tp();for(const n in e){const s=e[n];Ki(s,r,n,t)}return r},Ki=(e,t,r,n)=>{const s=e.length;for(let o=0;o<s;o++){const a=e[o];j3(a,t,r,n)}},j3=(e,t,r,n)=>{if(typeof e=="string"){z3(e,t,r);return}if(typeof e=="function"){H3(e,t,r,n);return}W3(e,t,r,n)},z3=(e,t,r)=>{const n=e===""?t:_p(t,e);n.classGroupId=r},H3=(e,t,r,n)=>{if(q3(e)){Ki(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(D3(r,e))},W3=(e,t,r,n)=>{const s=Object.entries(e),o=s.length;for(let a=0;a<o;a++){const[l,d]=s[a];Ki(d,_p(t,l),r,n)}},_p=(e,t)=>{let r=e;const n=t.split(eo),s=n.length;for(let o=0;o<s;o++){const a=n[o];let l=r.nextPart.get(a);l||(l=Tp(),r.nextPart.set(a,l)),r=l}return r},q3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,K3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(o,a)=>{r[o]=a,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(o){let a=r[o];if(a!==void 0)return a;if((a=n[o])!==void 0)return s(o,a),a},set(o,a){o in r?r[o]=a:s(o,a)}}},Gi="!",Mp=":",G3=[],Np=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),X3=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const o=[];let a=0,l=0,d=0,c;const u=s.length;for(let g=0;g<u;g++){const y=s[g];if(a===0&&l===0){if(y===Mp){o.push(s.slice(d,g)),d=g+1;continue}if(y==="/"){c=g;continue}}y==="["?a++:y==="]"?a--:y==="("?l++:y===")"&&l--}const f=o.length===0?s:s.slice(d);let p=f,h=!1;f.endsWith(Gi)?(p=f.slice(0,-1),h=!0):f.startsWith(Gi)&&(p=f.slice(1),h=!0);const m=c&&c>d?c-d:void 0;return Np(o,h,p,m)};if(t){const s=t+Mp,o=n;n=a=>a.startsWith(s)?o(a.slice(s.length)):Np(G3,!1,a,void 0,!0)}if(r){const s=n;n=o=>r({className:o,parseClassName:s})}return n},Y3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let o=0;o<r.length;o++){const a=r[o],l=a[0]==="[",d=t.has(a);l||d?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(a)):s.push(a)}return s.length>0&&(s.sort(),n.push(...s)),n}},Z3=e=>({cache:K3(e.cacheSize),parseClassName:X3(e),sortModifiers:Y3(e),...V3(e)}),J3=/\s+/,Q3=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:o}=t,a=[],l=e.trim().split(J3);let d="";for(let c=l.length-1;c>=0;c-=1){const u=l[c],{isExternal:f,modifiers:p,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}=r(u);if(f){d=u+(d.length>0?" "+d:d);continue}let y=!!g,w=n(y?m.substring(0,g):m);if(!w){if(!y){d=u+(d.length>0?" "+d:d);continue}if(w=n(m),!w){d=u+(d.length>0?" "+d:d);continue}y=!1}const v=p.length===0?"":p.length===1?p[0]:o(p).join(":"),x=h?v+Gi:v,S=x+w;if(a.indexOf(S)>-1)continue;a.push(S);const T=s(w,y);for(let k=0;k<T.length;++k){const M=T[k];a.push(x+M)}d=u+(d.length>0?" "+d:d)}return d},R3=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=Lp(r))&&(s&&(s+=" "),s+=n);return s},Lp=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Lp(e[n]))&&(r&&(r+=" "),r+=t);return r},eS=(e,...t)=>{let r,n,s,o;const a=d=>{const c=t.reduce((u,f)=>f(u),e());return r=Z3(c),n=r.cache.get,s=r.cache.set,o=l,l(d)},l=d=>{const c=n(d);if(c)return c;const u=Q3(d,r);return s(d,u),u};return o=a,(...d)=>o(R3(...d))},tS=[],ke=e=>{const t=r=>r[e]||tS;return t.isThemeGetter=!0,t},Op=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rS=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,nS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sS=/\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$/,oS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,aS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,er=e=>rS.test(e),le=e=>!!e&&!Number.isNaN(Number(e)),tr=e=>!!e&&Number.isInteger(Number(e)),Xi=e=>e.endsWith("%")&&le(e.slice(0,-1)),$t=e=>nS.test(e),Dp=()=>!0,lS=e=>sS.test(e)&&!oS.test(e),Yi=()=>!1,cS=e=>aS.test(e),dS=e=>iS.test(e),uS=e=>!te(e)&&!re(e),fS=e=>rr(e,jp,Yi),te=e=>Op.test(e),wr=e=>rr(e,zp,lS),Ip=e=>rr(e,vS,le),hS=e=>rr(e,Wp,Dp),pS=e=>rr(e,Hp,Yi),Vp=e=>rr(e,Up,Yi),mS=e=>rr(e,$p,dS),to=e=>rr(e,qp,cS),re=e=>Fp.test(e),Mn=e=>br(e,zp),gS=e=>br(e,Hp),Bp=e=>br(e,Up),yS=e=>br(e,jp),wS=e=>br(e,$p),ro=e=>br(e,qp,!0),bS=e=>br(e,Wp,!0),rr=(e,t,r)=>{const n=Op.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},br=(e,t,r=!1)=>{const n=Fp.exec(e);return n?n[1]?t(n[1]):r:!1},Up=e=>e==="position"||e==="percentage",$p=e=>e==="image"||e==="url",jp=e=>e==="length"||e==="size"||e==="bg-size",zp=e=>e==="length",vS=e=>e==="number",Hp=e=>e==="family-name",Wp=e=>e==="number"||e==="weight",qp=e=>e==="shadow",xS=eS(()=>{const e=ke("color"),t=ke("font"),r=ke("text"),n=ke("font-weight"),s=ke("tracking"),o=ke("leading"),a=ke("breakpoint"),l=ke("container"),d=ke("spacing"),c=ke("radius"),u=ke("shadow"),f=ke("inset-shadow"),p=ke("text-shadow"),h=ke("drop-shadow"),m=ke("blur"),g=ke("perspective"),y=ke("aspect"),w=ke("ease"),v=ke("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...S(),re,te],k=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],P=()=>[re,te,d],N=()=>[er,"full","auto",...P()],D=()=>[tr,"none","subgrid",re,te],V=()=>["auto",{span:["full",tr,re,te]},tr,re,te],O=()=>[tr,"auto",re,te],L=()=>["auto","min","max","fr",re,te],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...P()],W=()=>[er,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],$=()=>[er,"screen","full","dvw","lvw","svw","min","max","fit",...P()],j=()=>[er,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],E=()=>[e,re,te],z=()=>[...S(),Bp,Vp,{position:[re,te]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",yS,fS,{size:[re,te]}],U=()=>[Xi,Mn,wr],H=()=>["","none","full",c,re,te],q=()=>["",le,Mn,wr],J=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[le,Xi,Bp,Vp],Pe=()=>["","none",m,re,te],ve=()=>["none",le,re,te],ge=()=>["none",le,re,te],he=()=>[le,re,te],Me=()=>[er,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$t],breakpoint:[$t],color:[Dp],container:[$t],"drop-shadow":[$t],ease:["in","out","in-out"],font:[uS],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$t],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$t],shadow:[$t],spacing:["px",le],text:[$t],"text-shadow":[$t],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",er,te,re,y]}],container:["container"],columns:[{columns:[le,te,re,l]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"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:T()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[tr,"auto",re,te]}],basis:[{basis:[er,"full","auto",l,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[le,er,"auto","initial","none",te]}],grow:[{grow:["",le,re,te]}],shrink:[{shrink:["",le,re,te]}],order:[{order:[tr,"first","last","none",re,te]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...j()]}],"min-block-size":[{"min-block":["auto",...j()]}],"max-block-size":[{"max-block":["none",...j()]}],w:[{w:[l,"screen",...W()]}],"min-w":[{"min-w":[l,"screen","none",...W()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",r,Mn,wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,bS,hS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xi,te]}],"font-family":[{font:[gS,pS,t]}],"font-features":[{"font-features":[te]}],"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:[s,re,te]}],"line-clamp":[{"line-clamp":[le,"none",re,Ip]}],leading:[{leading:[o,...P()]}],"list-image":[{"list-image":["none",re,te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",re,te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[le,"from-font","auto",re,wr]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[le,"auto",re,te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re,te]}],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",re,te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},tr,re,te],radial:["",re,te],conic:[tr,re,te]},wS,mS]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-bs":[{"border-bs":q()}],"border-w-be":[{"border-be":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[le,re,te]}],"outline-w":[{outline:["",le,Mn,wr]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",u,ro,to]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",f,ro,to]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[le,wr]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",p,ro,to]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[le,re,te]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"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":[le]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[re,te]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"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":S()}],"mask-image-conic-pos":[{"mask-conic":[le]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",re,te]}],filter:[{filter:["","none",re,te]}],blur:[{blur:Pe()}],brightness:[{brightness:[le,re,te]}],contrast:[{contrast:[le,re,te]}],"drop-shadow":[{"drop-shadow":["","none",h,ro,to]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",le,re,te]}],"hue-rotate":[{"hue-rotate":[le,re,te]}],invert:[{invert:["",le,re,te]}],saturate:[{saturate:[le,re,te]}],sepia:[{sepia:["",le,re,te]}],"backdrop-filter":[{"backdrop-filter":["","none",re,te]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[le,re,te]}],"backdrop-contrast":[{"backdrop-contrast":[le,re,te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",le,re,te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[le,re,te]}],"backdrop-invert":[{"backdrop-invert":["",le,re,te]}],"backdrop-opacity":[{"backdrop-opacity":[le,re,te]}],"backdrop-saturate":[{"backdrop-saturate":[le,re,te]}],"backdrop-sepia":[{"backdrop-sepia":["",le,re,te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",re,te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[le,"initial",re,te]}],ease:[{ease:["linear","initial",w,re,te]}],delay:[{delay:[le,re,te]}],animate:[{animate:["none",v,re,te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,re,te]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[re,te,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Me()}],"translate-x":[{"translate-x":Me()}],"translate-y":[{"translate-y":Me()}],"translate-z":[{"translate-z":Me()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"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",re,te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",re,te]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[le,Mn,wr,Ip]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ue(...e){return xS(Xu(e))}const CS=Ju("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 SS({className:e,variant:t="default",size:r="default",asChild:n=!1,...s}){const o=n?Ya:"button";return i.jsx(o,{"data-slot":"button","data-variant":t,"data-size":r,className:ue(CS({variant:t,size:r,className:e})),...s})}function PS({...e}){return i.jsx(hi,{"data-slot":"sheet",...e})}function ES({...e}){return i.jsx(pi,{"data-slot":"sheet-portal",...e})}function TS({className:e,...t}){return i.jsx(mi,{"data-slot":"sheet-overlay",className:ue("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 AS({className:e,children:t,side:r="right",showCloseButton:n=!0,...s}){return i.jsxs(ES,{children:[i.jsx(TS,{}),i.jsxs(gi,{"data-slot":"sheet-content",className:ue("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),...s,children:[t,n&&i.jsxs(g2,{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(Uy,{className:"size-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function kS({className:e,...t}){return i.jsx("div",{"data-slot":"sheet-header",className:ue("flex flex-col gap-1.5 p-4",e),...t})}function _S({className:e,...t}){return i.jsx(yi,{"data-slot":"sheet-title",className:ue("text-foreground font-semibold",e),...t})}function MS({className:e,...t}){return i.jsx(m2,{"data-slot":"sheet-description",className:ue("text-muted-foreground text-sm",e),...t})}function NS({delayDuration:e=0,...t}){return i.jsx(A3,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function LS({...e}){return i.jsx(k3,{"data-slot":"tooltip",...e})}function OS({...e}){return i.jsx(_3,{"data-slot":"tooltip-trigger",...e})}function FS({className:e,sideOffset:t=0,children:r,...n}){return i.jsx(M3,{children:i.jsxs(N3,{"data-slot":"tooltip-content",sideOffset:t,className:ue("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(L3,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const DS="sidebar_state",IS=3600*24*7,VS="16rem",BS="18rem",US="3rem",$S="b",Kp=C.createContext(null);function Zr(){const e=C.useContext(Kp);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function jS({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:s,children:o,...a}){const l=O3(),[d,c]=C.useState(!1),[u,f]=C.useState(e),p=t??u,h=C.useCallback(w=>{const v=typeof w=="function"?w(p):w;r?r(v):f(v),document.cookie=`${DS}=${v}; path=/; max-age=${IS}`},[r,p]),m=C.useCallback(()=>l?c(w=>!w):h(w=>!w),[l,h,c]);C.useEffect(()=>{const w=v=>{v.key===$S&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),m())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[m]);const g=p?"expanded":"collapsed",y=C.useMemo(()=>({state:g,open:p,setOpen:h,isMobile:l,openMobile:d,setOpenMobile:c,toggleSidebar:m}),[g,p,h,l,d,c,m]);return i.jsx(Kp.Provider,{value:y,children:i.jsx(NS,{delayDuration:0,children:i.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":VS,"--sidebar-width-icon":US,...s},className:ue("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...a,children:o})})})}function zS({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...o}){const{isMobile:a,state:l,openMobile:d,setOpenMobile:c}=Zr();return r==="none"?i.jsx("div",{"data-slot":"sidebar",className:ue("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...o,children:s}):a?i.jsx(PS,{open:d,onOpenChange:c,...o,children:i.jsxs(AS,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":BS},side:e,children:[i.jsxs(kS,{className:"sr-only",children:[i.jsx(_S,{children:"Sidebar"}),i.jsx(MS,{children:"Displays the mobile sidebar."})]}),i.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):i.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[i.jsx("div",{"data-slot":"sidebar-gap",className:ue("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:ue("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",n),...o,children:i.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"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",children:s})})]})}function HS({className:e,onClick:t,...r}){const{toggleSidebar:n}=Zr();return i.jsxs(SS,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ue("size-7",e),onClick:s=>{t?.(s),n()},...r,children:[i.jsx(Dy,{}),i.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function WS({className:e,...t}){const{toggleSidebar:r}=Zr();return i.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:ue("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 qS({className:e,...t}){return i.jsx("main",{"data-slot":"sidebar-inset",className:ue("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 KS({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ue("flex flex-col gap-2",e),...t})}function GS({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ue("flex flex-col",e),...t})}function XS({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ue("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Gp({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ue("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Xp({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ue("w-full text-sm",e),...t})}function YS({className:e,...t}){return i.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ue("flex w-full min-w-0 flex-col gap-1",e),...t})}function Zi({className:e,...t}){return i.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ue("group/menu-item relative",e),...t})}const ZS=Ju("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 Ji({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:s,className:o,...a}){const l=e?Ya:"button",{isMobile:d,state:c}=Zr(),u=i.jsx(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":t,className:ue(ZS({variant:r,size:n}),o),...a});return s?(typeof s=="string"&&(s={children:s}),i.jsxs(LS,{children:[i.jsx(OS,{asChild:!0,children:u}),i.jsx(FS,{side:"right",align:"center",hidden:c!=="collapsed"||d,...s})]})):u}function JS({className:e,...t}){return i.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:ue("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 QS({className:e,...t}){return i.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:ue("group/menu-sub-item relative",e),...t})}function RS({asChild:e=!1,size:t="md",isActive:r=!1,className:n,...s}){const o=e?Ya:"a";return i.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:ue("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),...s})}function eP({...e}){return i.jsx(rx,{"data-slot":"collapsible",...e})}function tP({...e}){return i.jsx(of,{"data-slot":"collapsible-trigger",...e})}function rP({...e}){return i.jsx(af,{"data-slot":"collapsible-content",...e})}function nP({...e}){return i.jsx(o3,{"data-slot":"dropdown-menu",...e})}function sP({...e}){return i.jsx(a3,{"data-slot":"dropdown-menu-trigger",...e})}function oP({className:e,sideOffset:t=4,...r}){return i.jsx(i3,{children:i.jsx(l3,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ue("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 aP({className:e,...t}){return i.jsx(d3,{"data-slot":"dropdown-menu-item",className:ue("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 iP({className:e,...t}){return i.jsx(c3,{"data-slot":"dropdown-menu-label",className:ue("px-2 py-1.5 text-xs font-semibold",e),...t})}function lP({className:e,...t}){return i.jsx(u3,{"data-slot":"dropdown-menu-separator",className:ue("bg-muted -mx-1 my-1 h-px",e),...t})}const cP="zango_app_logo_cache",dP=1440*60*1e3;class uP{constructor(){this.cacheKey=cP}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/")?(console.warn("Invalid cached logo format, clearing cache"),this.clearCache(),null):r}catch(t){return console.error("Error reading logo cache:",t),null}}async cacheLogoUrl(t,r){if(t)try{const n=await this.generateHash(t),s=this.getCachedLogo();if(s&&s.version===n)return s.timestamp=Date.now(),localStorage.setItem(this.cacheKey,JSON.stringify(s)),s;const o=await this.fetchAndConvertToBase64(t),a={url:t,base64Data:o,version:n,timestamp:Date.now(),appName:r||"Zango CRM"};return localStorage.setItem(this.cacheKey,JSON.stringify(a)),a}catch(n){return console.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:(console.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 s=n.headers.get("content-type");if(s&&!s.startsWith("image/"))throw new Error(`Invalid logo content type: ${s}`);const o=await n.blob();return new Promise((a,l)=>{const d=new FileReader;d.onloadend=()=>a(d.result),d.onerror=l,d.readAsDataURL(o)})}catch(r){return console.error("Error converting logo to base64:",r),null}}async generateHash(t){let r=0;for(let n=0;n<t.length;n++){const s=t.charCodeAt(n);r=(r<<5)-r+s,r=r&r}return Math.abs(r).toString(36)}isCacheExpired(t){return Date.now()-t>dP}clearCache(){try{localStorage.removeItem(this.cacheKey)}catch(t){console.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 o=await this.cacheLogoUrl(t,r);o&&n&&n(o)},100)}catch(s){console.error("Error updating logo in background:",s)}}}const vr=new uP,fP=()=>i.jsxs("svg",{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"})]}),Yp=({logoUrl:e,appName:t,height:r="28px",linkTo:n="/"})=>{const[s,o]=b.useState(()=>{const f=vr.getCachedLogo();return f&&(f.base64Data||f.url)?f.base64Data||f.url:e||null}),[a,l]=b.useState(!1);b.useEffect(()=>{e&&vr.updateInBackground(e,t,f=>{f.base64Data&&o(f.base64Data)})},[e,t]);const d=b.useCallback(()=>{console.error("Logo failed to load"),l(!0);const f=vr.getCachedLogo();f&&s===f.base64Data&&vr.clearCache()},[s]),c=b.useCallback(()=>{l(!1)},[]),u=()=>a||!s?i.jsx(fP,{}):i.jsx("img",{src:s,height:r,alt:t||"Logo",onError:d,onLoad:c,style:{maxHeight:r,objectFit:"contain"}});return i.jsx(R.Link,{to:n,className:"logo-link",children:u()})},no=(e,t={})=>`${t.baseUrl||""}${e}`,hP=(e,t={})=>t.endpoints?.[e]||"",pP=(e={})=>e.timeout||3e4;function Ge(e,t){if(!e)return"/";const[r,n]=e.split("?"),s=r.replace(/\/+$/,"")+"/",o=new URLSearchParams;n&&new URLSearchParams(n).forEach((d,c)=>{o.set(c,d)}),t&&Object.keys(t).length>0&&Object.entries(t).forEach(([l,d])=>{d!=null&&o.set(l,String(d))});const a=o.toString();return a?`${s}?${a}`:s}const mP="csrftoken",gP=8;function yP(e){const t=document.cookie.split(";");for(const r of t){const[n,s]=r.trim().split("=");if(n===e)try{return decodeURIComponent(s)}catch{return s}}return null}function wP(){const e=yP(mP);return e?bP(e)?e:(console.warn("[CSRF] Invalid token format detected"),null):null}function bP(e){return!e||typeof e!="string"||e.length<gP?!1:/^[a-zA-Z0-9_\-+=/]+$/.test(e)}const Nn="",Ln=async()=>{const e=wP();return e?{"X-CSRFToken":e}:{}},Zp=async({fullUrl:e})=>{const t=`${Nn}${e}${e.includes("?")?"&":"?"}_t=${Date.now()}`;return await fetch(t,{method:"GET",redirect:"follow",headers:{...await Ln(),"Content-Type":"application/json"}})},Jp=async({fullUrl:e,payload:t})=>await fetch(Nn+e,{method:"POST",redirect:"follow",headers:{...await Ln(),...!(t instanceof FormData)&&{"Content-Type":"application/json"}},body:t instanceof FormData?t:JSON.stringify(t)}),Qp=async({fullUrl:e,payload:t})=>await fetch(Nn+e,{method:"PUT",redirect:"follow",headers:{...await Ln(),...!(t instanceof FormData)&&{"Content-Type":"application/json"}},body:t instanceof FormData?t:JSON.stringify(t)}),Rp=async({fullUrl:e,payload:t})=>await fetch(Nn+e,{method:"DELETE",redirect:"follow",headers:{...await Ln(),"Content-Type":"application/json"},body:t instanceof FormData?t:JSON.stringify(t)}),em=async({fullUrl:e,payload:t})=>await fetch(Nn+e,{method:"PATCH",redirect:"follow",headers:{...await Ln(),...!(t instanceof FormData)&&{"Content-Type":"application/json"}},body:t instanceof FormData?t:JSON.stringify(t)}),Xe=async e=>{let t;try{const r=no(e.url);switch(e.type){case"POST":t=await Jp({fullUrl:r,payload:e.payload});break;case"PUT":t=await Qp({fullUrl:r,payload:e.payload});break;case"PATCH":t=await em({fullUrl:r,payload:e.payload});break;case"DELETE":t=await Rp({fullUrl:r,payload:e.payload});break;case"GET":default:t=await Zp({fullUrl:r})}if(t.status===200)try{return{response:(await t.json()).response,success:!0,responseStatus:t.status}}catch{return{response:{message:"Server Error"},success:!1,responseStatus:t.status}}else return{response:(await t.json()).response||{message:"Server Error"},success:!1,responseStatus:t.status}}catch(r){return console.error("API Request Error:",r),{response:{message:"Network Error"},success:!1,responseStatus:500}}},vP=e=>{if(!e||Object.keys(e).length===0)return"";const t=new URLSearchParams;Object.entries(e).forEach(([n,s])=>{s!=null&&t.append(n,String(s))});const r=t.toString();return r?`?${r}`:""},tm=()=>{const t=typeof window<"u"&&window.app_initializer_endpoint?window.app_initializer_endpoint:"/app/initializer",r=t.startsWith("/")?t:`/${t}`;return{url:Ge(r),type:"GET"}},rm=()=>({url:Ge("/api/v1/profile"),type:"GET"}),nm=e=>({url:Ge("/api/v1/profile"),type:"PUT",payload:e}),sm=e=>({url:Ge("/api/v1/profile/photo"),type:"POST",payload:e}),om=e=>({url:Ge("/api/v1/appauth/password/change/"),type:"PUT",payload:e}),am=e=>({url:Ge("/api/v1/profile/two-factor"),type:"POST",payload:e}),im=e=>({url:Ge(`/api/v1/appauth/role/switch/?role=${encodeURIComponent(e)}`),type:"POST"}),lm=()=>({url:Ge("/api/v1/appauth/sessions/"),type:"GET"}),cm=e=>({url:Ge("/api/v1/appauth/sessions/"),type:"DELETE",payload:{sessions:[e]}}),dm=e=>({url:Ge("/api/v1/appauth/sessions/"),type:"DELETE",payload:{sessions:e}}),um=()=>({url:Ge("/api/v1/appauth/logout"),type:"DELETE"}),fm=()=>({url:Ge("/logout"),type:"POST"}),hm=(e,t)=>({url:Ge(`${e}${e.includes("?")?"&":"?"}idleFor=${t}`),type:"GET"}),pm=async()=>Xe(tm()),mm=async()=>Xe(rm()),gm=async()=>Xe(lm()),so=async e=>Xe(nm(e)),xP=async e=>Xe(sm(e)),ym=async e=>Xe(om(e)),CP=async e=>Xe(am({enabled:e})),wm=async e=>Xe(im(e)),bm=async e=>Xe(cm(e)),vm=async e=>Xe(dm(e)),xm=async()=>Xe(um()),Cm=async()=>Xe(fm()),Sm=async(e,t)=>Xe(hm(e,t));function oo(e){"@babel/helpers - typeof";return oo=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},oo(e)}var SP=/^\s+/,PP=/\s+$/;function Q(e,t){if(e=e||"",t=t||{},e instanceof Q)return e;if(!(this instanceof Q))return new Q(e,t);var r=EP(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}Q.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,s,o,a,l;return r=t.r/255,n=t.g/255,s=t.b/255,r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),s<=.03928?l=s/12.92:l=Math.pow((s+.055)/1.055,2.4),.2126*o+.7152*a+.0722*l},setAlpha:function(t){return this._a=_m(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Em(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Em(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),s=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+s+"%)":"hsva("+r+", "+n+"%, "+s+"%, "+this._roundA+")"},toHsl:function(){var t=Pm(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Pm(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),s=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+s+"%)":"hsla("+r+", "+n+"%, "+s+"%, "+this._roundA+")"},toHex:function(t){return Tm(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return _P(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(xe(this._r,255)*100)+"%",g:Math.round(xe(this._g,255)*100)+"%",b:Math.round(xe(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(xe(this._r,255)*100)+"%, "+Math.round(xe(this._g,255)*100)+"%, "+Math.round(xe(this._b,255)*100)+"%)":"rgba("+Math.round(xe(this._r,255)*100)+"%, "+Math.round(xe(this._g,255)*100)+"%, "+Math.round(xe(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:jP[Tm(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+Am(this._r,this._g,this._b,this._a),n=r,s=this._gradientType?"GradientType = 1, ":"";if(t){var o=Q(t);n="#"+Am(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+s+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var r=!!t;t=t||this._format;var n=!1,s=this._a<1&&this._a>=0,o=!r&&s&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return o?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 Q(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(OP,arguments)},brighten:function(){return this._applyModification(FP,arguments)},darken:function(){return this._applyModification(DP,arguments)},desaturate:function(){return this._applyModification(MP,arguments)},saturate:function(){return this._applyModification(NP,arguments)},greyscale:function(){return this._applyModification(LP,arguments)},spin:function(){return this._applyModification(IP,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(UP,arguments)},complement:function(){return this._applyCombination(VP,arguments)},monochromatic:function(){return this._applyCombination($P,arguments)},splitcomplement:function(){return this._applyCombination(BP,arguments)},triad:function(){return this._applyCombination(km,[3])},tetrad:function(){return this._applyCombination(km,[4])}},Q.fromRatio=function(e,t){if(oo(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=On(e[n]));e=r}return Q(e,t)};function EP(e){var t={r:0,g:0,b:0},r=1,n=null,s=null,o=null,a=!1,l=!1;return typeof e=="string"&&(e=qP(e)),oo(e)=="object"&&(jt(e.r)&&jt(e.g)&&jt(e.b)?(t=TP(e.r,e.g,e.b),a=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):jt(e.h)&&jt(e.s)&&jt(e.v)?(n=On(e.s),s=On(e.v),t=kP(e.h,n,s),a=!0,l="hsv"):jt(e.h)&&jt(e.s)&&jt(e.l)&&(n=On(e.s),o=On(e.l),t=AP(e.h,n,o),a=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=_m(r),{ok:a,format:e.format||l,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 TP(e,t,r){return{r:xe(e,255)*255,g:xe(t,255)*255,b:xe(r,255)*255}}function Pm(e,t,r){e=xe(e,255),t=xe(t,255),r=xe(r,255);var n=Math.max(e,t,r),s=Math.min(e,t,r),o,a,l=(n+s)/2;if(n==s)o=a=0;else{var d=n-s;switch(a=l>.5?d/(2-n-s):d/(n+s),n){case e:o=(t-r)/d+(t<r?6:0);break;case t:o=(r-e)/d+2;break;case r:o=(e-t)/d+4;break}o/=6}return{h:o,s:a,l}}function AP(e,t,r){var n,s,o;e=xe(e,360),t=xe(t,100),r=xe(r,100);function a(c,u,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?c+(u-c)*6*f:f<1/2?u:f<2/3?c+(u-c)*(2/3-f)*6:c}if(t===0)n=s=o=r;else{var l=r<.5?r*(1+t):r+t-r*t,d=2*r-l;n=a(d,l,e+1/3),s=a(d,l,e),o=a(d,l,e-1/3)}return{r:n*255,g:s*255,b:o*255}}function Em(e,t,r){e=xe(e,255),t=xe(t,255),r=xe(r,255);var n=Math.max(e,t,r),s=Math.min(e,t,r),o,a,l=n,d=n-s;if(a=n===0?0:d/n,n==s)o=0;else{switch(n){case e:o=(t-r)/d+(t<r?6:0);break;case t:o=(r-e)/d+2;break;case r:o=(e-t)/d+4;break}o/=6}return{h:o,s:a,v:l}}function kP(e,t,r){e=xe(e,360)*6,t=xe(t,100),r=xe(r,100);var n=Math.floor(e),s=e-n,o=r*(1-t),a=r*(1-s*t),l=r*(1-(1-s)*t),d=n%6,c=[r,a,o,o,l,r][d],u=[l,r,r,a,o,o][d],f=[o,o,l,r,r,a][d];return{r:c*255,g:u*255,b:f*255}}function Tm(e,t,r,n){var s=[mt(Math.round(e).toString(16)),mt(Math.round(t).toString(16)),mt(Math.round(r).toString(16))];return n&&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[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0):s.join("")}function _P(e,t,r,n,s){var o=[mt(Math.round(e).toString(16)),mt(Math.round(t).toString(16)),mt(Math.round(r).toString(16)),mt(Mm(n))];return s&&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[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function Am(e,t,r,n){var s=[mt(Mm(n)),mt(Math.round(e).toString(16)),mt(Math.round(t).toString(16)),mt(Math.round(r).toString(16))];return s.join("")}Q.equals=function(e,t){return!e||!t?!1:Q(e).toRgbString()==Q(t).toRgbString()},Q.random=function(){return Q.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function MP(e,t){t=t===0?0:t||10;var r=Q(e).toHsl();return r.s-=t/100,r.s=ao(r.s),Q(r)}function NP(e,t){t=t===0?0:t||10;var r=Q(e).toHsl();return r.s+=t/100,r.s=ao(r.s),Q(r)}function LP(e){return Q(e).desaturate(100)}function OP(e,t){t=t===0?0:t||10;var r=Q(e).toHsl();return r.l+=t/100,r.l=ao(r.l),Q(r)}function FP(e,t){t=t===0?0:t||10;var r=Q(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)))),Q(r)}function DP(e,t){t=t===0?0:t||10;var r=Q(e).toHsl();return r.l-=t/100,r.l=ao(r.l),Q(r)}function IP(e,t){var r=Q(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,Q(r)}function VP(e){var t=Q(e).toHsl();return t.h=(t.h+180)%360,Q(t)}function km(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=Q(e).toHsl(),n=[Q(e)],s=360/t,o=1;o<t;o++)n.push(Q({h:(r.h+o*s)%360,s:r.s,l:r.l}));return n}function BP(e){var t=Q(e).toHsl(),r=t.h;return[Q(e),Q({h:(r+72)%360,s:t.s,l:t.l}),Q({h:(r+216)%360,s:t.s,l:t.l})]}function UP(e,t,r){t=t||6,r=r||30;var n=Q(e).toHsl(),s=360/r,o=[Q(e)];for(n.h=(n.h-(s*t>>1)+720)%360;--t;)n.h=(n.h+s)%360,o.push(Q(n));return o}function $P(e,t){t=t||6;for(var r=Q(e).toHsv(),n=r.h,s=r.s,o=r.v,a=[],l=1/t;t--;)a.push(Q({h:n,s,v:o})),o=(o+l)%1;return a}Q.mix=function(e,t,r){r=r===0?0:r||50;var n=Q(e).toRgb(),s=Q(t).toRgb(),o=r/100,a={r:(s.r-n.r)*o+n.r,g:(s.g-n.g)*o+n.g,b:(s.b-n.b)*o+n.b,a:(s.a-n.a)*o+n.a};return Q(a)},Q.readability=function(e,t){var r=Q(e),n=Q(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},Q.isReadable=function(e,t,r){var n=Q.readability(e,t),s,o;switch(o=!1,s=KP(r),s.level+s.size){case"AAsmall":case"AAAlarge":o=n>=4.5;break;case"AAlarge":o=n>=3;break;case"AAAsmall":o=n>=7;break}return o},Q.mostReadable=function(e,t,r){var n=null,s=0,o,a,l,d;r=r||{},a=r.includeFallbackColors,l=r.level,d=r.size;for(var c=0;c<t.length;c++)o=Q.readability(e,t[c]),o>s&&(s=o,n=Q(t[c]));return Q.isReadable(e,n,{level:l,size:d})||!a?n:(r.includeFallbackColors=!1,Q.mostReadable(e,["#fff","#000"],r))};var Qi=Q.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"},jP=Q.hexNames=zP(Qi);function zP(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function _m(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function xe(e,t){HP(e)&&(e="100%");var r=WP(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 ao(e){return Math.min(1,Math.max(0,e))}function tt(e){return parseInt(e,16)}function HP(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function WP(e){return typeof e=="string"&&e.indexOf("%")!=-1}function mt(e){return e.length==1?"0"+e:""+e}function On(e){return e<=1&&(e=e*100+"%"),e}function Mm(e){return Math.round(parseFloat(e)*255).toString(16)}function Nm(e){return tt(e)/255}var gt=(function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",s="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+s),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+s),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+s),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 jt(e){return!!gt.CSS_UNIT.exec(e)}function qP(e){e=e.replace(SP,"").replace(PP,"").toLowerCase();var t=!1;if(Qi[e])e=Qi[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=gt.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=gt.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=gt.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=gt.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=gt.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=gt.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=gt.hex8.exec(e))?{r:tt(r[1]),g:tt(r[2]),b:tt(r[3]),a:Nm(r[4]),format:t?"name":"hex8"}:(r=gt.hex6.exec(e))?{r:tt(r[1]),g:tt(r[2]),b:tt(r[3]),format:t?"name":"hex"}:(r=gt.hex4.exec(e))?{r:tt(r[1]+""+r[1]),g:tt(r[2]+""+r[2]),b:tt(r[3]+""+r[3]),a:Nm(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=gt.hex3.exec(e))?{r:tt(r[1]+""+r[1]),g:tt(r[2]+""+r[2]),b:tt(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function KP(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 xr=e=>({25:Q.mix(e,"#FFFFFF",100).toHexString(),50:Q.mix(e,"#FFFFFF",95).toHexString(),100:Q.mix(e,"#FFFFFF",85).toHexString(),200:Q.mix(e,"#FFFFFF",70).toHexString(),300:Q.mix(e,"#FFFFFF",55).toHexString(),400:Q.mix(e,"#FFFFFF",35).toHexString(),500:Q(e).toHexString(),600:Q.mix(e,"#000000",15).toHexString(),700:Q.mix(e,"#000000",25).toHexString(),800:Q.mix(e,"#000000",35).toHexString(),900:Q.mix(e,"#000000",50).toHexString(),950:Q.mix(e,"#000000",65).toHexString()}),io=e=>{let t="";const r={brand:xr(e.colors.primary),success:xr(e.colors.success),warning:xr(e.colors.warning),gray:xr(e.colors.gray),error:xr(e.colors.error)};return t=Object.entries(r).map(([n,s])=>Object.entries(s).map(([o,a])=>`--color-${n}-${o}: ${a}`).join(`;
|
|
180
180
|
`)).join(";"),e?.typography&&Object.entries(e.typography).forEach(([n,s])=>{const o=n.replace(/_/g,"-");t+=`--${o}: ${s}; `}),e?.borders&&Object.entries(e.borders).forEach(([n,s])=>{const o=n.replace(/_/g,"-");t+=`--${o}: ${s}; `}),e?.shadows&&Object.entries(e.shadows).forEach(([n,s])=>{const o=n.replace(/_/g,"-");t+=`--shadow-${o}: ${s}; `}),e?.spacing&&Object.entries(e.spacing).forEach(([n,s])=>{t+=`--spacing-${n}: ${s}px; `}),t},Lm=e=>Q(e).isLight(),GP=e=>Lm(e)?"#000000":"#FFFFFF",Om=(e,t=500)=>{const r=`--color-${e}-${t}`;if(typeof window<"u"&&window.getComputedStyle){const f=window.getComputedStyle(document.documentElement).getPropertyValue(r).trim();if(f)return f}const n=document.documentElement,s=n.style.getPropertyValue("--color-brand-500")||"#5048ED",o=n.style.getPropertyValue("--color-success-500")||"#10B981",a=n.style.getPropertyValue("--color-error-500")||"#F04438",l=n.style.getPropertyValue("--color-warning-500")||"#F59E0B",d=n.style.getPropertyValue("--color-gray-500")||"#6B7280",c={brand:s,success:o,error:a,warning:l,gray:d};return c[e]?xr(c[e])[t]||c[e]:"#5048ED"},Ri=(e={})=>e.baseUrl||"",Fm=(e,t={})=>e?e.startsWith("http://")||e.startsWith("https://")?e:no(e,t):Ri(t),Fn=()=>{const e=R.useLocation(),{routes:t,apiConfig:r}=qe(),s=e.pathname.split("/").filter(Boolean)[0],o=[...t].sort((d,c)=>c.path.length-d.path.length);let a=null;for(const d of o){if(d.path===e.pathname){a=d;break}if(d.path?.includes(":")){const c=d.path.replace(/:[^/]+/g,"[^/]+");if(e.pathname.match(new RegExp(`^${c}$`))){a=d;break}}if(e.pathname.startsWith(d.path+"/")){a=d;break}}const l=a?.extra_params||{};return{baseUrl:Ri(r),apiUrl:l.api_endpoint||"",fullUrl:Fm(l.api_endpoint||"",r),headers:l.headers||{},entity:s,...l}},XP=()=>{const e=R.useLocation(),{routes:t}=qe(),r=[...t].sort((n,s)=>s.path.length-n.path.length);for(const n of r){if(n.path===e.pathname)return n;if(n.path?.includes(":")){const s=n.path.replace(/:[^/]+/g,"[^/]+");if(e.pathname.match(new RegExp(`^${s}$`)))return n}if(e.pathname.startsWith(n.path+"/"))return n}return null},YP=(e,t={},r={})=>({baseUrl:Ri(t),apiUrl:e,fullUrl:Fm(e,t),headers:r.headers||{},...r}),el=({basePath:e})=>{const t=Fn(),[r,n]=b.useState(null),[s,o]=b.useState(null);return b.useEffect(()=>{(async()=>{try{const l=await import("@zango-core/crud/table");n(()=>l.CrudHandler)}catch(l){console.error("Failed to load crud module:",l),o("CRUD module could not be loaded")}})()},[]),s?i.jsx("div",{className:"page-container",style:{height:"100%",padding:"20px"},children:i.jsxs("div",{className:"error-message",children:[i.jsx("h3",{children:"CRUD Module Error"}),i.jsx("p",{children:s})]})}):r?i.jsx("div",{className:"page-container",style:{height:"100%"},children:i.jsx(r,{api_endpoint:t.apiUrl})}):i.jsx("div",{className:"page-container",style:{height:"100%",padding:"20px"},children:i.jsx("div",{className:"loading-spinner",children:"Loading CRUD module..."})})},Dm=({basePath:e})=>{Fn();const[t,r]=b.useState(null),[n,s]=b.useState(null);return b.useEffect(()=>{(async()=>{try{const a=await import("@zango-core/training");r(()=>a.TrainingRouter)}catch(a){console.error("Failed to load training module:",a),s("Training module could not be loaded")}})()},[]),n?i.jsx("div",{className:"page-container",style:{height:"100%",padding:"20px"},children:i.jsxs("div",{className:"error-message",children:[i.jsx("h3",{children:"Training Module Error"}),i.jsx("p",{children:n})]})}):t?i.jsx("div",{className:"page-container",style:{height:"100%"},children:i.jsx(t,{})}):i.jsx("div",{className:"page-container",style:{height:"100%",padding:"20px"},children:i.jsx("div",{className:"loading-spinner",children:"Loading training module..."})})},tl={crud:{requiredPackage:"@zango-core/crud",component:el},training:{requiredPackage:"@zango-core/training",component:Dm}};Object.fromEntries(Object.entries(tl).map(([e,t])=>[e,()=>import(t.requiredPackage)])),Object.fromEntries(Object.keys(tl).map(e=>[e,[e]]));const Im=Object.fromEntries(Object.entries(tl).map(([e,t])=>[e,t.component])),ZP=e=>e.filter(t=>t in Im),JP=e=>Im[e]||null,Vm=({componentName:e,routeConfig:t,customPagesDir:r="src/custom/pages",fileExtension:n="js"})=>{const[s,o]=b.useState(null),a=(w,v)=>{navigator.clipboard.writeText(w).then(()=>{o(v),setTimeout(()=>o(null),2e3)})},l=e||"MyCustomPage",d=r,c=n,u=`import React from 'react';
|
|
181
181
|
|
|
182
182
|
const ${l} = () => {
|
|
@@ -213,7 +213,7 @@ export default App;`,h=`mkdir -p ${d}`,m={container:{padding:"32px",maxWidth:"90
|
|
|
213
213
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[ng]=this[ng]={accessors:{}}).accessors,s=this.prototype;function o(a){const l=$n(a);n[l]||(R6(s,a),n[l]=!0)}return I.isArray(t)?t.forEach(o):o(t),this}};Ze.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.reduceDescriptors(Ze.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),I.freezeMethods(Ze);function dl(e,t){const r=this||Un,n=t||r,s=Ze.from(n.headers);let o=n.data;return I.forEach(e,function(l){o=l.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function sg(e){return!!(e&&e.__CANCEL__)}function Rr(e,t,r){ie.call(this,e??"canceled",ie.ERR_CANCELED,t,r),this.name="CanceledError"}I.inherits(Rr,ie,{__CANCEL__:!0});function og(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ie("Request failed with status code "+r.status,[ie.ERR_BAD_REQUEST,ie.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function e4(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function t4(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),u=n[o];a||(a=c),r[s]=d,n[s]=c;let f=o,p=0;for(;f!==s;)p+=r[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-a<t)return;const h=u&&c-u;return h?Math.round(p*1e3/h):void 0}}function r4(e,t){let r=0,n=1e3/t,s,o;const a=(c,u=Date.now())=>{r=u,s=null,o&&(clearTimeout(o),o=null),e(...c)};return[(...c)=>{const u=Date.now(),f=u-r;f>=n?a(c,u):(s=c,o||(o=setTimeout(()=>{o=null,a(s)},n-f)))},()=>s&&a(s)]}const mo=(e,t,r=3)=>{let n=0;const s=t4(50,250);return r4(o=>{const a=o.loaded,l=o.lengthComputable?o.total:void 0,d=a-n,c=s(d),u=a<=l;n=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:d,rate:c||void 0,estimated:c&&l&&u?(l-a)/c:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},r)},ag=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},ig=e=>(...t)=>I.asap(()=>e(...t)),n4=De.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,De.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(De.origin),De.navigator&&/(msie|trident)/i.test(De.navigator.userAgent)):()=>!0,s4=De.hasStandardBrowserEnv?{write(e,t,r,n,s,o,a){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];I.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),I.isString(n)&&l.push(`path=${n}`),I.isString(s)&&l.push(`domain=${s}`),o===!0&&l.push("secure"),I.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function o4(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function a4(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function lg(e,t,r){let n=!o4(t);return e&&(n||r==!1)?a4(e,t):t}const cg=e=>e instanceof Ze?{...e}:e;function Sr(e,t){t=t||{};const r={};function n(c,u,f,p){return I.isPlainObject(c)&&I.isPlainObject(u)?I.merge.call({caseless:p},c,u):I.isPlainObject(u)?I.merge({},u):I.isArray(u)?u.slice():u}function s(c,u,f,p){if(I.isUndefined(u)){if(!I.isUndefined(c))return n(void 0,c,f,p)}else return n(c,u,f,p)}function o(c,u){if(!I.isUndefined(u))return n(void 0,u)}function a(c,u){if(I.isUndefined(u)){if(!I.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function l(c,u,f){if(f in t)return n(c,u);if(f in e)return n(void 0,c)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage: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,responseEncoding:a,validateStatus:l,headers:(c,u,f)=>s(cg(c),cg(u),f,!0)};return I.forEach(Object.keys({...e,...t}),function(u){const f=d[u]||s,p=f(e[u],t[u],u);I.isUndefined(p)&&f!==l||(r[u]=p)}),r}const dg=e=>{const t=Sr({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=t;if(t.headers=a=Ze.from(a),t.url=Rm(lg(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),I.isFormData(r)){if(De.hasStandardBrowserEnv||De.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(I.isFunction(r.getHeaders)){const d=r.getHeaders(),c=["content-type","content-length"];Object.entries(d).forEach(([u,f])=>{c.includes(u.toLowerCase())&&a.set(u,f)})}}if(De.hasStandardBrowserEnv&&(n&&I.isFunction(n)&&(n=n(t)),n||n!==!1&&n4(t.url))){const d=s&&o&&s4.read(o);d&&a.set(s,d)}return t},i4=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=dg(e);let o=s.data;const a=Ze.from(s.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:c}=s,u,f,p,h,m;function g(){h&&h(),m&&m(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function w(){if(!y)return;const x=Ze.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),T={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:e,request:y};og(function(M){r(M),g()},function(M){n(M),g()},T),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(n(new ie("Request aborted",ie.ECONNABORTED,e,y)),y=null)},y.onerror=function(S){const T=S&&S.message?S.message:"Network Error",k=new ie(T,ie.ERR_NETWORK,e,y);k.event=S||null,n(k),y=null},y.ontimeout=function(){let S=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const T=s.transitional||tg;s.timeoutErrorMessage&&(S=s.timeoutErrorMessage),n(new ie(S,T.clarifyTimeoutError?ie.ETIMEDOUT:ie.ECONNABORTED,e,y)),y=null},o===void 0&&a.setContentType(null),"setRequestHeader"in y&&I.forEach(a.toJSON(),function(S,T){y.setRequestHeader(T,S)}),I.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),l&&l!=="json"&&(y.responseType=s.responseType),c&&([p,m]=mo(c,!0),y.addEventListener("progress",p)),d&&y.upload&&([f,h]=mo(d),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",h)),(s.cancelToken||s.signal)&&(u=x=>{y&&(n(!x||x.type?new Rr(null,e,y):x),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const v=e4(s.url);if(v&&De.protocols.indexOf(v)===-1){n(new ie("Unsupported protocol "+v+":",ie.ERR_BAD_REQUEST,e));return}y.send(o||null)})},l4=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,s;const o=function(c){if(!s){s=!0,l();const u=c instanceof Error?c:this.reason;n.abort(u instanceof ie?u:new Rr(u instanceof Error?u.message:u))}};let a=t&&setTimeout(()=>{a=null,o(new ie(`timeout ${t} of ms exceeded`,ie.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),e=null)};e.forEach(c=>c.addEventListener("abort",o));const{signal:d}=n;return d.unsubscribe=()=>I.asap(l),d}},c4=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},d4=async function*(e,t){for await(const r of u4(e))yield*c4(r,t)},u4=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()}},ug=(e,t,r,n)=>{const s=d4(e,t);let o=0,a,l=d=>{a||(a=!0,n&&n(d))};return new ReadableStream({async pull(d){try{const{done:c,value:u}=await s.next();if(c){l(),d.close();return}let f=u.byteLength;if(r){let p=o+=f;r(p)}d.enqueue(new Uint8Array(u))}catch(c){throw l(c),c}},cancel(d){return l(d),s.return()}},{highWaterMark:2})},fg=64*1024,{isFunction:go}=I,f4=(({Request:e,Response:t})=>({Request:e,Response:t}))(I.global),{ReadableStream:hg,TextEncoder:pg}=I.global,mg=(e,...t)=>{try{return!!e(...t)}catch{return!1}},h4=e=>{e=I.merge.call({skipUndefined:!0},f4,e);const{fetch:t,Request:r,Response:n}=e,s=t?go(t):typeof fetch=="function",o=go(r),a=go(n);if(!s)return!1;const l=s&&go(hg),d=s&&(typeof pg=="function"?(m=>g=>m.encode(g))(new pg):async m=>new Uint8Array(await new r(m).arrayBuffer())),c=o&&l&&mg(()=>{let m=!1;const g=new r(De.origin,{body:new hg,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!g}),u=a&&l&&mg(()=>I.isReadableStream(new n("").body)),f={stream:u&&(m=>m.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(g,y)=>{let w=g&&g[m];if(w)return w.call(g);throw new ie(`Response type '${m}' is not supported`,ie.ERR_NOT_SUPPORT,y)})});const p=async m=>{if(m==null)return 0;if(I.isBlob(m))return m.size;if(I.isSpecCompliantForm(m))return(await new r(De.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(I.isArrayBufferView(m)||I.isArrayBuffer(m))return m.byteLength;if(I.isURLSearchParams(m)&&(m=m+""),I.isString(m))return(await d(m)).byteLength},h=async(m,g)=>{const y=I.toFiniteNumber(m.getContentLength());return y??p(g)};return async m=>{let{url:g,method:y,data:w,signal:v,cancelToken:x,timeout:S,onDownloadProgress:T,onUploadProgress:k,responseType:M,headers:P,withCredentials:N="same-origin",fetchOptions:D}=dg(m),V=t||fetch;M=M?(M+"").toLowerCase():"text";let O=l4([v,x&&x.toAbortSignal()],S),L=null;const _=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let B;try{if(k&&c&&y!=="get"&&y!=="head"&&(B=await h(P,w))!==0){let z=new r(g,{method:"POST",body:w,duplex:"half"}),X;if(I.isFormData(w)&&(X=z.headers.get("content-type"))&&P.setContentType(X),z.body){const[G,U]=ag(B,mo(ig(k)));w=ug(z.body,fg,G,U)}}I.isString(N)||(N=N?"include":"omit");const F=o&&"credentials"in r.prototype,W={...D,signal:O,method:y.toUpperCase(),headers:P.normalize().toJSON(),body:w,duplex:"half",credentials:F?N:void 0};L=o&&new r(g,W);let $=await(o?V(L,D):V(g,W));const j=u&&(M==="stream"||M==="response");if(u&&(T||j&&_)){const z={};["status","statusText","headers"].forEach(H=>{z[H]=$[H]});const X=I.toFiniteNumber($.headers.get("content-length")),[G,U]=T&&ag(X,mo(ig(T),!0))||[];$=new n(ug($.body,fg,G,()=>{U&&U(),_&&_()}),z)}M=M||"text";let E=await f[I.findKey(f,M)||"text"]($,m);return!j&&_&&_(),await new Promise((z,X)=>{og(z,X,{data:E,headers:Ze.from($.headers),status:$.status,statusText:$.statusText,config:m,request:L})})}catch(F){throw _&&_(),F&&F.name==="TypeError"&&/Load failed|fetch/i.test(F.message)?Object.assign(new ie("Network Error",ie.ERR_NETWORK,m,L),{cause:F.cause||F}):ie.from(F,F&&F.code,m,L)}}},p4=new Map,gg=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let a=o.length,l=a,d,c,u=p4;for(;l--;)d=o[l],c=u.get(d),c===void 0&&u.set(d,c=l?new Map:h4(t)),u=c;return c};gg();const ul={http:I6,xhr:i4,fetch:{get:gg}};I.forEach(ul,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const yg=e=>`- ${e}`,m4=e=>I.isFunction(e)||e===null||e===!1;function g4(e,t){e=I.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let a=0;a<r;a++){n=e[a];let l;if(s=n,!m4(n)&&(s=ul[(l=String(n)).toLowerCase()],s===void 0))throw new ie(`Unknown adapter '${l}'`);if(s&&(I.isFunction(s)||(s=s.get(t))))break;o[l||"#"+a]=s}if(!s){const a=Object.entries(o).map(([d,c])=>`adapter ${d} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=r?a.length>1?`since :
|
|
214
214
|
`+a.map(yg).join(`
|
|
215
215
|
`):" "+yg(a[0]):"as no adapter specified";throw new ie("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return s}const wg={getAdapter:g4,adapters:ul};function fl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Rr(null,e)}function bg(e){return fl(e),e.headers=Ze.from(e.headers),e.data=dl.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),wg.getAdapter(e.adapter||Un.adapter,e)(e).then(function(n){return fl(e),n.data=dl.call(e,e.transformResponse,n),n.headers=Ze.from(n.headers),n},function(n){return sg(n)||(fl(e),n&&n.response&&(n.response.data=dl.call(e,e.transformResponse,n.response),n.response.headers=Ze.from(n.response.headers))),Promise.reject(n)})}const vg="1.13.0",yo={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{yo[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const xg={};yo.transitional=function(t,r,n){function s(o,a){return"[Axios v"+vg+"] Transitional option '"+o+"'"+a+(n?". "+n:"")}return(o,a,l)=>{if(t===!1)throw new ie(s(a," has been removed"+(r?" in "+r:"")),ie.ERR_DEPRECATED);return r&&!xg[a]&&(xg[a]=!0,console.warn(s(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,a,l):!0}},yo.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function y4(e,t,r){if(typeof e!="object")throw new ie("options must be an object",ie.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],a=t[o];if(a){const l=e[o],d=l===void 0||a(l,o,e);if(d!==!0)throw new ie("option "+o+" must be "+d,ie.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ie("Unknown option "+o,ie.ERR_BAD_OPTION)}}const wo={assertOptions:y4,validators:yo},Mt=wo.validators;let Pr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new eg,response:new eg}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
216
|
-
`+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Sr(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&wo.assertOptions(n,{silentJSONParsing:Mt.transitional(Mt.boolean),forcedJSONParsing:Mt.transitional(Mt.boolean),clarifyTimeoutError:Mt.transitional(Mt.boolean)},!1),s!=null&&(I.isFunction(s)?r.paramsSerializer={serialize:s}:wo.assertOptions(s,{encode:Mt.function,serialize:Mt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),wo.assertOptions(r,{baseUrl:Mt.spelling("baseURL"),withXsrfToken:Mt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=o&&I.merge(o.common,o[r.method]);o&&I.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),r.headers=Ze.concat(a,o);const l=[];let d=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(r)===!1||(d=d&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,f=0,p;if(!d){const m=[bg.bind(this),void 0];for(m.unshift(...l),m.push(...c),p=m.length,u=Promise.resolve(r);f<p;)u=u.then(m[f++],m[f++]);return u}p=l.length;let h=r;for(;f<p;){const m=l[f++],g=l[f++];try{h=m(h)}catch(y){g.call(this,y);break}}try{u=bg.call(this,h)}catch(m){return Promise.reject(m)}for(f=0,p=c.length;f<p;)u=u.then(c[f++],c[f++]);return u}getUri(t){t=Sr(this.defaults,t);const r=lg(t.baseURL,t.url,t.allowAbsoluteUrls);return Rm(r,t.params,t.paramsSerializer)}};I.forEach(["delete","get","head","options"],function(t){Pr.prototype[t]=function(r,n){return this.request(Sr(n||{},{method:t,url:r,data:(n||{}).data}))}}),I.forEach(["post","put","patch"],function(t){function r(n){return function(o,a,l){return this.request(Sr(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}Pr.prototype[t]=r(),Pr.prototype[t+"Form"]=r(!0)});let w4=class Ey{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(l=>{n.subscribe(l),o=l}).then(s);return a.cancel=function(){n.unsubscribe(o)},a},t(function(o,a,l){n.reason||(n.reason=new Rr(o,a,l),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 Ey(function(s){t=s}),cancel:t}}};function b4(e){return function(r){return e.apply(null,r)}}function v4(e){return I.isObject(e)&&e.isAxiosError===!0}const hl={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,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity: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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(hl).forEach(([e,t])=>{hl[t]=e});function Cg(e){const t=new Pr(e),r=Bm(Pr.prototype.request,t);return I.extend(r,Pr.prototype,t,{allOwnKeys:!0}),I.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Cg(Sr(e,s))},r}const ce=Cg(Un);ce.Axios=Pr,ce.CanceledError=Rr,ce.CancelToken=w4,ce.isCancel=sg,ce.VERSION=vg,ce.toFormData=ho,ce.AxiosError=ie,ce.Cancel=ce.CanceledError,ce.all=function(t){return Promise.all(t)},ce.spread=b4,ce.isAxiosError=v4,ce.mergeConfig=Sr,ce.AxiosHeaders=Ze,ce.formToJSON=e=>rg(I.isHTMLForm(e)?new FormData(e):e),ce.getAdapter=wg.getAdapter,ce.HttpStatusCode=hl,ce.default=ce;const{Axios:YT,AxiosError:ZT,CanceledError:JT,isCancel:QT,CancelToken:RT,VERSION:eA,all:tA,Cancel:rA,isAxiosError:nA,spread:sA,toFormData:oA,AxiosHeaders:aA,HttpStatusCode:iA,formToJSON:lA,getAdapter:cA,mergeConfig:dA}=ce,Fe="/api/v1/appauth".replace(/\/+$/,"");class nr{constructor(t,r=Fe,n=ce){this.basePath=r,this.axios=n,t&&(this.configuration=t,this.basePath=t.basePath??r)}}class x4 extends Error{constructor(t,r){super(r),this.field=t,this.name="RequiredError"}}const Ie={"UserProfileApi.getUserProfile":[{url:"/api/v1",description:"Profile API base URL"}],"UserProfileApi.updateUserProfile":[{url:"/api/v1",description:"Profile API base URL"}]},Ve="https://example.com",me=function(e,t,r){if(r==null)throw new x4(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function pl(e,t,r=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(n=>pl(e,n,r)):Object.keys(t).forEach(n=>pl(e,t[n],`${r}${r!==""?".":""}${n}`)):e.has(r)?e.append(r,String(t)):e.set(r,String(t)))}const Be=function(e,...t){const r=new URLSearchParams(e.search);pl(r,t),e.search=r.toString()},en=function(e,t,r){const n=typeof e!="string";return(n&&r&&r.isJsonMime?r.isJsonMime(t.headers?.["Content-Type"]):n)?JSON.stringify(e!==void 0?e:{}):e||""},Ue=function(e){return e.pathname+e.search+e.hash},$e=function(e,t,r,n){return(s=t,o=r)=>{const a={...e.options,url:(s.defaults.baseURL?"":n?.basePath??o)+e.url};return s.request(a)}},C4=function(e){return{getAppAuthConfig:async(t={})=>{const r="/config/",n=new URL(r,Ve);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...t},a={};Be(n,{});let d=s&&s.headers?s.headers:{};return o.headers={...a,...d,...t.headers},{url:Ue(n),options:o}},updateAppAuthConfig:async(t,r,n={})=>{me("updateAppAuthConfig","xCSRFToken",t),me("updateAppAuthConfig","authConfig",r);const s="/config/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"PUT",...a,...n},d={},c={},u=new(e&&e.formDataCtor||FormData);r!==void 0&&u.append("auth_config",r),d["Content-Type"]="multipart/form-data",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let f=a&&a.headers?a.headers:{};return l.headers={...d,...f,...n.headers},l.data=u,{url:Ue(o),options:l}}}},Sg=function(e){const t=C4(e);return{async getAppAuthConfig(r){const n=await t.getAppAuthConfig(r),s=e?.serverIndex??0,o=Ie["ApplicationConfigurationApi.getAppAuthConfig"]?.[s]?.url;return(a,l)=>$e(n,ce,Fe,e)(a,o||l)},async updateAppAuthConfig(r,n,s){const o=await t.updateAppAuthConfig(r,n,s),a=e?.serverIndex??0,l=Ie["ApplicationConfigurationApi.updateAppAuthConfig"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)}}};class S4 extends nr{getAppAuthConfig(t){return Sg(this.configuration).getAppAuthConfig(t).then(r=>r(this.axios,this.basePath))}updateAppAuthConfig(t,r,n){return Sg(this.configuration).updateAppAuthConfig(t,r,n).then(s=>s(this.axios,this.basePath))}}const P4=function(e){return{loginUser:async(t,r,n={})=>{me("loginUser","xCSRFToken",t),me("loginUser","loginUserRequest",r);const s="/login/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}},logoutUser:async(t,r={})=>{me("logoutUser","xCSRFToken",t);const n="/logout/",s=new URL(n,Ve);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...r},l={},d={};t!=null&&(l["X-CSRFToken"]=String(t)),Be(s,d);let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:Ue(s),options:a}}}},Pg=function(e){const t=P4(e);return{async loginUser(r,n,s){const o=await t.loginUser(r,n,s),a=e?.serverIndex??0,l=Ie["AuthenticationApi.loginUser"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)},async logoutUser(r,n){const s=await t.logoutUser(r,n),o=e?.serverIndex??0,a=Ie["AuthenticationApi.logoutUser"]?.[o]?.url;return(l,d)=>$e(s,ce,Fe,e)(l,a||d)}}};class E4 extends nr{loginUser(t,r,n){return Pg(this.configuration).loginUser(t,r,n).then(s=>s(this.axios,this.basePath))}logoutUser(t,r){return Pg(this.configuration).logoutUser(t,r).then(n=>n(this.axios,this.basePath))}}const T4=function(e){return{requestLoginOTP:async(t,r,n={})=>{me("requestLoginOTP","xCSRFToken",t),me("requestLoginOTP","loginOTPRequest",r);const s="/login/code/request/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}},verifyLoginOTP:async(t,r,n={})=>{me("verifyLoginOTP","xCSRFToken",t),me("verifyLoginOTP","loginOTPVerifyRequest",r);const s="/login/code/confirm/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}}}},Eg=function(e){const t=T4(e);return{async requestLoginOTP(r,n,s){const o=await t.requestLoginOTP(r,n,s),a=e?.serverIndex??0,l=Ie["LoginWithOTPApi.requestLoginOTP"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)},async verifyLoginOTP(r,n,s){const o=await t.verifyLoginOTP(r,n,s),a=e?.serverIndex??0,l=Ie["LoginWithOTPApi.verifyLoginOTP"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)}}};class A4 extends nr{requestLoginOTP(t,r,n){return Eg(this.configuration).requestLoginOTP(t,r,n).then(s=>s(this.axios,this.basePath))}verifyLoginOTP(t,r,n){return Eg(this.configuration).verifyLoginOTP(t,r,n).then(s=>s(this.axios,this.basePath))}}const k4=function(e){return{getMfaCode:async(t={})=>{const r="/mfa/getcode/",n=new URL(r,Ve);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...t},a={};Be(n,{});let d=s&&s.headers?s.headers:{};return o.headers={...a,...d,...t.headers},{url:Ue(n),options:o}},verifyMfaCode:async(t,r,n={})=>{me("verifyMfaCode","xCSRFToken",t),me("verifyMfaCode","mfaVerifyRequest",r);const s="/mfa/verify/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}}}},Tg=function(e){const t=k4(e);return{async getMfaCode(r){const n=await t.getMfaCode(r),s=e?.serverIndex??0,o=Ie["MultiFactorAuthenticationApi.getMfaCode"]?.[s]?.url;return(a,l)=>$e(n,ce,Fe,e)(a,o||l)},async verifyMfaCode(r,n,s){const o=await t.verifyMfaCode(r,n,s),a=e?.serverIndex??0,l=Ie["MultiFactorAuthenticationApi.verifyMfaCode"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)}}};class _4 extends nr{getMfaCode(t){return Tg(this.configuration).getMfaCode(t).then(r=>r(this.axios,this.basePath))}verifyMfaCode(t,r,n){return Tg(this.configuration).verifyMfaCode(t,r,n).then(s=>s(this.axios,this.basePath))}}const M4=function(e){return{oauthCallback:async(t,r,n,s,o,a,l,d,c={})=>{me("oauthCallback","provider",t),me("oauthCallback","state",r),me("oauthCallback","code",n),me("oauthCallback","scope",s),me("oauthCallback","xCSRFToken",o);const u="/oauth/{provider}/callback/".replace("{provider}",encodeURIComponent(String(t))),f=new URL(u,Ve);let p;e&&(p=e.baseOptions);const h={method:"POST",...p,...c},m={},g={};r!==void 0&&(g.state=r),n!==void 0&&(g.code=n),s!==void 0&&(g.scope=s),a!==void 0&&(g.authuser=a),l!==void 0&&(g.hd=l),d!==void 0&&(g.prompt=d),o!=null&&(m["X-CSRFToken"]=String(o)),Be(f,g);let y=p&&p.headers?p.headers:{};return h.headers={...m,...y,...c.headers},{url:Ue(f),options:h}},oauthRedirect:async(t,r,n,s,o={})=>{me("oauthRedirect","xCsrftoken",t),me("oauthRedirect","provider",r),me("oauthRedirect","process",n),me("oauthRedirect","callbackUrl",s);const a="/oauth/redirect/",l=new URL(a,Ve);let d;e&&(d=e.baseOptions);const c={method:"POST",...d,...o},u={},f={},p=new URLSearchParams;r!==void 0&&p.set("provider",r),n!==void 0&&p.set("process",n),s!==void 0&&p.set("callback_url",s),u["Content-Type"]="application/x-www-form-urlencoded",t!=null&&(u["x-csrftoken"]=String(t)),Be(l,f);let h=d&&d.headers?d.headers:{};return c.headers={...u,...h,...o.headers},c.data=p.toString(),{url:Ue(l),options:c}}}},Ag=function(e){const t=M4(e);return{async oauthCallback(r,n,s,o,a,l,d,c,u){const f=await t.oauthCallback(r,n,s,o,a,l,d,c,u),p=e?.serverIndex??0,h=Ie["OAuthApi.oauthCallback"]?.[p]?.url;return(m,g)=>$e(f,ce,Fe,e)(m,h||g)},async oauthRedirect(r,n,s,o,a){const l=await t.oauthRedirect(r,n,s,o,a),d=e?.serverIndex??0,c=Ie["OAuthApi.oauthRedirect"]?.[d]?.url;return(u,f)=>$e(l,ce,Fe,e)(u,c||f)}}};class N4 extends nr{oauthCallback(t,r,n,s,o,a,l,d,c){return Ag(this.configuration).oauthCallback(t,r,n,s,o,a,l,d,c).then(u=>u(this.axios,this.basePath))}oauthRedirect(t,r,n,s,o){return Ag(this.configuration).oauthRedirect(t,r,n,s,o).then(a=>a(this.axios,this.basePath))}}const L4=function(e){return{changePassword:async(t,r,n={})=>{me("changePassword","xCSRFToken",t),me("changePassword","passwordChangeRequest",r);const s="/password/change/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"PUT",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}},setPassword:async(t,r,n={})=>{me("setPassword","xCSRFToken",t),me("setPassword","passwordSetRequest",r);const s="/password/set/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}}}},kg=function(e){const t=L4(e);return{async changePassword(r,n,s){const o=await t.changePassword(r,n,s),a=e?.serverIndex??0,l=Ie["PasswordManagementApi.changePassword"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)},async setPassword(r,n,s){const o=await t.setPassword(r,n,s),a=e?.serverIndex??0,l=Ie["PasswordManagementApi.setPassword"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)}}};class O4 extends nr{changePassword(t,r,n){return kg(this.configuration).changePassword(t,r,n).then(s=>s(this.axios,this.basePath))}setPassword(t,r,n){return kg(this.configuration).setPassword(t,r,n).then(s=>s(this.axios,this.basePath))}}const F4=function(e){return{setRole:async(t,r,n={})=>{me("setRole","xCSRFToken",t),me("setRole","role",r);const s="/role/set/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};r!==void 0&&(c.role=r),t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},{url:Ue(o),options:l}},switchRole:async(t,r,n={})=>{me("switchRole","xCSRFToken",t),me("switchRole","role",r);const s="/role/switch/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};r!==void 0&&(c.role=r),t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},{url:Ue(o),options:l}}}},_g=function(e){const t=F4(e);return{async setRole(r,n,s){const o=await t.setRole(r,n,s),a=e?.serverIndex??0,l=Ie["RoleManagementApi.setRole"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)},async switchRole(r,n,s){const o=await t.switchRole(r,n,s),a=e?.serverIndex??0,l=Ie["RoleManagementApi.switchRole"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)}}};class D4 extends nr{setRole(t,r,n){return _g(this.configuration).setRole(t,r,n).then(s=>s(this.axios,this.basePath))}switchRole(t,r,n){return _g(this.configuration).switchRole(t,r,n).then(s=>s(this.axios,this.basePath))}}const I4=function(e){return{getUserProfile:async(t={})=>{const r="/profile/",n=new URL(r,Ve);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...t},a={};Be(n,{});let d=s&&s.headers?s.headers:{};return o.headers={...a,...d,...t.headers},{url:Ue(n),options:o}},updateUserProfile:async(t,r,n,s,o,a={})=>{me("updateUserProfile","xCSRFToken",t);const l="/profile/",d=new URL(l,Ve);let c;e&&(c=e.baseOptions);const u={method:"PUT",...c,...a},f={},p={},h=new(e&&e.formDataCtor||FormData);r!==void 0&&h.append("name",r),n!==void 0&&h.append("mobile",n),s!==void 0&&h.append("auth_config",s),o!==void 0&&h.append("profile_pic",o),f["Content-Type"]="multipart/form-data",t!=null&&(f["X-CSRFToken"]=String(t)),Be(d,p);let m=c&&c.headers?c.headers:{};return u.headers={...f,...m,...a.headers},u.data=h,{url:Ue(d),options:u}}}},Mg=function(e){const t=I4(e);return{async getUserProfile(r){const n=await t.getUserProfile(r),s=e?.serverIndex??0,o=Ie["UserProfileApi.getUserProfile"]?.[s]?.url;return(a,l)=>$e(n,ce,Fe,e)(a,o||l)},async updateUserProfile(r,n,s,o,a,l){const d=await t.updateUserProfile(r,n,s,o,a,l),c=e?.serverIndex??0,u=Ie["UserProfileApi.updateUserProfile"]?.[c]?.url;return(f,p)=>$e(d,ce,Fe,e)(f,u||p)}}};class Ng extends nr{getUserProfile(t){return Mg(this.configuration).getUserProfile(t).then(r=>r(this.axios,this.basePath))}updateUserProfile(t,r,n,s,o,a){return Mg(this.configuration).updateUserProfile(t,r,n,s,o,a).then(l=>l(this.axios,this.basePath))}}class Lg{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 bo="/api/v1/appauth",sr=new Lg({basePath:bo,baseOptions:{withCredentials:!0}}),ml=new E4(sr),Og=new S4(sr),gl=new A4(sr),yl=new _4(sr),tn=new O4(sr),V4=new D4(sr),Fg=new N4(sr);new Ng(sr);const Je=()=>{const e=document.cookie.match(/csrftoken=([^;]+)/);if(e)return decodeURIComponent(e[1]);const t=document.querySelector('meta[name="csrf-token"]');if(t)return t.getAttribute("content");const r=document.cookie.match(/csrf_token=([^;]+)/);return r?decodeURIComponent(r[1]):(console.warn("CSRF token not found. OTP requests may fail."),"")};let fe=null,Er=null,Nt=null;const it=e=>e.response?.data?.errors?.[0]?.message?e.response.data.errors[0].message:e.response?.data?.response?.errors?.[0]?.message?e.response.data.response.errors[0].message:e.response?.data?.response?.message?e.response.data.response.message:e.response?.data?.message?e.response.data.message:e.message?e.message:"An unexpected error occurred",Z={async getAuthConfig(){return fe||Er||(Er=(async()=>{try{const t=(await Og.getAppAuthConfig()).data;return t?.response?.auth_config?fe=t.response.auth_config:t?.auth_config?fe=t.auth_config:fe=t,fe}catch(e){throw console.error("Failed to fetch auth config:",e),Er=null,e}finally{Er=null}})(),Er)},getConfig(){return fe},isPasswordLoginEnabled(){return fe?.login_methods?.password?.enabled||!1},isOTPLoginEnabled(){return fe?.login_methods?.otp?.enabled||!1},isSSOEnabled(){return fe?.login_methods?.sso?.enabled||!1},isOIDCEnabled(){return fe?.login_methods?.oidc?.enabled||!1},getOIDCProviders(){return fe?.login_methods?.oidc?.providers||[]},getSSOProviders(){return fe?.login_methods?.sso?.providers||[]},getAllowedUsernames(){return(fe?.login_methods?.password?.allowed_usernames||fe?.login_methods?.allowed_usernames||["email"]).map(t=>t==="phone"?"mobile":t)},isForgotPasswordEnabled(){return fe?.password_policy?.reset?.enabled||!1},getPasswordResetLinkExpiry(){return fe?.login_methods?.password?.password_reset_link_expiry_hours||24},getSessionPolicy(){return fe?.session_policy||{}},isRememberMeEnabled(){return fe?.session_policy?.remember_me_enabled!==!1},getRememberMeDurationDays(){return fe?.session_policy?.remember_me_duration_days||30},getPasswordPolicy(){return fe?.password_policy||{}},getPasswordResetMethods(){return fe?.password_policy?.reset?.method||[]},isPasswordResetEnabled(){return fe?.password_policy?.reset?.enabled||!1},getPasswordResetExpiry(){return fe?.password_policy?.reset?.expiry_hours||24},isTwoFactorRequired(){return fe?.two_factor_auth?.required||!1},getTwoFactorMethods(){return fe?.two_factor_auth?.allowedMethods||[]},getTwoFactorHooks(){return{email:fe?.two_factor_auth?.email_hook,sms:fe?.two_factor_auth?.sms_hook}},async login(e,t={}){try{fe||await this.getAuthConfig();const r=Je()||"",n=e,s=await ml.loginUser(r,n),o=s.data;if(o?.success&&o?.response){const a=o.response;return a.status===401&&a.data?.next_step?a:a.data||a}return s.data}catch(r){if(console.error("Login error:",r),r.response?.data?.response?.error_code==="ACCOUNT_LOCKED")throw new Error("ACCOUNT_LOCKED");if(r.response?.status===401&&r.response?.data){const s=r.response.data;if(s?.success&&s?.response){const o=s.response;if(o.status===401&&o.data?.next_step)return o}if(s?.response?.data?.next_step||s?.data?.next_step)return s}const n=it(r);throw n!=="An unexpected error occurred"?new Error(n):r}},async logout(e={}){try{const t=Je()||"";await ml.logoutUser(t)}catch(t){console.error("Logout error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async getCurrentUser(){try{const{isAuthenticatedViaCookie:e}=await Promise.resolve().then(function(){return ay});if(!e())throw new Error("Not authenticated - no valid session cookie");return{id:1,username:"authenticated_user",email:"user@example.com",authenticated:!0}}catch(e){console.error("Get current user failed:",e);const t=it(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){try{return typeof e=="string"?this.requestPasswordReset({email:e}):this.requestPasswordReset(e)}catch(t){throw t}},async requestPasswordReset(e){try{const t=Je()||"";return(await tn.axios.post(`${bo}/password/reset/request/`,e,{headers:{"X-CSRFToken":t}})).data}catch(t){console.error("Request password reset error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async validatePasswordResetKey(e){try{return(await tn.axios.get(`${bo}/password/reset/`,{headers:{"x-password-reset-key":e}})).data}catch(t){console.error("Validate password reset key error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async confirmResetPassword(e){try{const t=Je()||"";return(await tn.axios.post(`${bo}/password/reset/`,e,{headers:{"X-CSRFToken":t}})).data}catch(t){if(console.error("Confirm reset password error:",t),t.response?.status===401&&t.response?.data){const n=t.response.data;if(n?.success&&n?.response){const s=n.response;if(s.status===401&&s.data?.next_step)return s}}const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async fetchLoginMethods(){try{return(await this.getAuthConfig())?.login_methods||{}}catch(e){throw e}},async requestOTP(e){try{const t=Je()||"",n=e.includes("@")?{email:e}:{phone:e},s=await gl.requestLoginOTP(t,n),o=s.data;return o?.success&&o?.response?o.response.status===401&&o.response.data?.message?o.response:o.response.data||o.response:s.data}catch(t){if(console.error("Send Code error:",t),t.response?.status===401&&t.response?.data){const r=t.response.data;if(r?.success&&r?.response){const n=r.response;if(n.status===401&&n.data?.message)return n}}if(t.response?.data){const r=t.response.data;if(r?.errors&&Array.isArray(r.errors)&&r.errors.length>0){const n=r.errors[0];throw new Error(n.message||"Failed to send OTP")}if(r?.response?.data?.message)throw new Error(r.response.data.message);if(r?.message)throw new Error(r.message)}throw t}},async verifyOTP(e,t){try{const r=Je()||"",n={code:t},s=await gl.verifyLoginOTP(r,n),o=s.data;return o?.success&&o?.response?(o.response.status===401&&o.response.data?.next_step,o.response):s.data}catch(r){if(console.error("Verify OTP error:",r),r.response?.data?.response?.error_code==="ACCOUNT_LOCKED")throw new Error("ACCOUNT_LOCKED");if(r.response?.status===401&&r.response?.data){const n=r.response.data;if(n?.success&&n?.response){const s=n.response;if(s.status===401&&s.data?.next_step)return s}if(n?.response?.data?.next_step||n?.data?.next_step)return n}if(r.response?.data){const n=r.response.data;if(n?.errors&&Array.isArray(n.errors)&&n.errors.length>0){const s=n.errors[0];throw new Error(s.message||"Verification failed")}if(n?.response?.data?.message)throw new Error(n.response.data.message);if(n?.message)throw new Error(n.message)}throw r}},async selectRole(e){try{const r={"Content-Type":"application/json","X-CSRFToken":Je()||""};Nt&&(r["X-Session-Token"]=Nt);const n=await fetch(`/api/v1/appauth/role/set/?role=${encodeURIComponent(e)}`,{method:"POST",headers:r,credentials:"include"}),s=await n.json();if(s?.success&&s?.response){const o=s.response;return o.status===401&&o.data?.next_step?o:((o.status===200||o.meta?.is_authenticated)&&(Nt=null),o.data||o)}if(!n.ok){if(n.status===401&&s&&(s?.response?.data?.next_step||s?.data?.next_step))return s;const o=s?.error?.message||s?.message||`Role selection failed: ${n.status}`;throw new Error(o)}return s}catch(t){console.error("Select role error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async sendTwoFactorCode(e){try{const t=e?{params:{method:e}}:{};return(await yl.getMfaCode(t)).data}catch(t){console.error("Send 2FA code error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async verifyTwoFactorCode(e){try{const t=Je()||"";return(await yl.verifyMfaCode(t,{code:e})).data}catch(t){console.error("Verify 2FA code error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async changePassword(e,t){try{const r=Je()||"";return(await tn.changePassword(r,{current_password:e,new_password:t})).data}catch(r){console.error("Change password error:",r);const n=it(r);throw n!=="An unexpected error occurred"?new Error(n):r}},async setPassword(e){try{const t=Je()||"";return(await tn.setPassword(t,{new_password:e})).data}catch(t){if(console.error("Set password error:",t),t.response?.status===401&&t.response?.data){const n=t.response.data;if(n?.response?.data?.next_step||n?.data?.next_step)return n}const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async processOAuthCallback(e,t,r,n,s,o,a,l){try{const d=Je()||"",c=await Fg.oauthCallback(e,t,r,n,d,s,o,a,l),u=c.data;if(u?.success&&u?.response){const f=u.response;return f.status===401&&f.data?.next_step?f:f.data||f}return c.data}catch(d){if(d.response?.status===401&&d.response?.data){const u=d.response.data;if(u?.success&&u?.response){const f=u.response;if(f.status===401&&f.data?.next_step)return f}if(u?.response?.data?.next_step||u?.data?.next_step)return u}const c=it(d);throw c!=="An unexpected error occurred"?new Error(c):d}},clearConfig(){fe=null,Er=null},async isAuthenticated(){try{const{isAuthenticatedViaCookie:e}=await Promise.resolve().then(function(){return ay});return e()}catch(e){return console.error("Authentication check failed:",e),!1}},validatePassword(e){const t=this.getPasswordPolicy(),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 oauthRedirect(e,t,r){try{const n=Je()||"",s=r?{transformRequest:[(a,l)=>{const d=new URLSearchParams(a);return r&&d.set("next",r),d.toString()}]}:void 0;return(await Fg.oauthRedirect(n,e,"login",t,s)).data}catch(n){throw n}},async getUserProfile(){try{const e=new Lg({basePath:"/api/v1",baseOptions:{withCredentials:!0}});return(await new Ng(e).getUserProfile()).data}catch(e){throw console.error("Get user profile error:",e),e}},async initiateSAMLAuth(e,t){try{const r=Je()||"",n={saml_id:e,...t&&{next:t}},s=await fetch("/api/v1/appauth/saml/init/",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":r},credentials:"include",body:JSON.stringify(n)}),o=await s.text();if(!s.ok){let l=`SAML init failed: ${s.status} ${s.statusText}`;try{const d=JSON.parse(o);d?.error?.message?l=d.error.message:d?.message?l=d.message:d?.detail&&(l=d.detail)}catch{o&&o.length<500&&(l+=` - ${o}`)}throw new Error(l)}const a=JSON.parse(o);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 console.error("SAML init error:",r),r}},async getSAMLAuthMeta(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 s=`SAML auth meta failed: ${r.status} ${r.statusText}`;throw n?.error?.message?s=n.error.message:n?.message?s=n.message:n?.detail&&(s=n.detail),new Error(s)}if(n?.success&&n?.response){const s=n.response;return s.meta?.session_token&&(Nt=s.meta.session_token),s.status===401&&s.data?.next_step?s:s.data||s}return n?.meta?.session_token&&(Nt=n.meta.session_token),n}catch(r){throw console.error("SAML auth meta error:",r),r}},async setRole(e){try{const r={"Content-Type":"application/json","X-CSRFToken":Je()||""};Nt&&(r["X-Session-Token"]=Nt);const n=await fetch(`/api/v1/appauth/role/set/?role=${encodeURIComponent(e)}`,{method:"POST",headers:r,credentials:"include"});if(!n.ok){const o=await n.text();throw new Error(`Role set failed: ${n.status} ${n.statusText} - ${o}`)}const s=await n.json();if(s?.success&&s?.response){const o=s.response;return o.status===401&&o.data?.next_step?o:((o.status===200||o.meta?.is_authenticated)&&(Nt=null),o.data||o)}return s}catch(t){throw console.error("Set role error:",t),t}},clearSamlSessionToken(){Nt=null},getSamlSessionToken(){return Nt}},Dg=e=>{let t;const r=new Set,n=(c,u)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(h=>h(t,p))}},s=()=>t,l={setState:n,getState:s,getInitialState:()=>d,subscribe:c=>(r.add(c),()=>r.delete(c))},d=t=e(n,s,l);return l},B4=(e=>e?Dg(e):Dg),U4=e=>e;function $4(e,t=U4){const r=b.useSyncExternalStore(e.subscribe,b.useCallback(()=>t(e.getState()),[e,t]),b.useCallback(()=>t(e.getInitialState()),[e,t]));return b.useDebugValue(r),r}const Ig=e=>{const t=B4(e),r=n=>$4(t,n);return Object.assign(r,t),r},vo=(e=>e?Ig(e):Ig)(e=>({basePath:"/login",setBasePath:t=>e({basePath:t})})),Vg=b.createContext(void 0),Qe=()=>{const e=b.useContext(Vg);if(!e)throw new Error("useAuthConfig must be used within AuthConfigProvider");return e},Bg=({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",selectedColor:"#1890ff",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",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,l)=>{const d={...a};for(const c in l)Object.prototype.hasOwnProperty.call(l,c)&&(l[c]!==null&&typeof l[c]=="object"&&!Array.isArray(l[c])&&!b.isValidElement(l[c])?d[c]=n(a[c]||{},l[c]):d[c]=l[c]);return d},s=n(r,t),o={authConfig:s,getLoginConfig:()=>s.login||{},getRoleSelectionConfig:()=>s.roleSelection||{},getTwoFactorConfig:()=>s.twoFactor||{},getResetPasswordConfig:()=>s.resetPassword||{},getThemeConfig:()=>s.theme||{},getCardConfig:()=>s.card||{},getLogoConfig:()=>s.logo||{},getProvidersConfig:()=>s.providers||{},getMessagesConfig:()=>s.messages||{},getCustomComponents:()=>s.customComponents||{}};return i.jsx(Vg.Provider,{value:o,children:e})},j4=e=>{const t=e?.theme||{},r=e?.card||{};let n="";if(t.primaryColor&&(n+=`--auth-primary-color: ${t.primaryColor}; `),t.secondaryColor&&(n+=`--auth-secondary-color: ${t.secondaryColor}; `),t.fontFamily&&(n+=`--auth-font-family: ${t.fontFamily}; `),t.borderRadius&&(n+=`--auth-border-radius: ${t.borderRadius}; `),t.textColor&&(n+=`--auth-text-color: ${t.textColor}; `),t.secondaryTextColor&&(n+=`--auth-secondary-text-color: ${t.secondaryTextColor}; `),t.mutedTextColor&&(n+=`--auth-muted-text-color: ${t.mutedTextColor}; `),t.linkColor&&(n+=`--auth-link-color: ${t.linkColor}; `),t.linkHoverColor&&(n+=`--auth-link-hover-color: ${t.linkHoverColor}; `),t.background?.color&&(n+=`--auth-bg-color: ${t.background.color}; `),t.background?.gradient&&(n+=`--auth-bg-gradient: ${t.background.gradient}; `),t.background?.image){const s=t.background.image;(s.startsWith("https://")||s.startsWith("/"))&&(n+=`--auth-bg-image: url(${s}); `)}return r.backgroundColor&&(n+=`--auth-card-bg: ${r.backgroundColor}; `),r.borderRadius&&(n+=`--auth-card-border-radius: ${r.borderRadius}; `),r.boxShadow&&(n+=`--auth-card-shadow: ${r.boxShadow}; `),r.maxWidth&&(n+=`--auth-card-max-width: ${r.maxWidth}; `),r.padding&&(n+=`--auth-card-padding: ${r.padding}; `),r.border&&(n+=`--auth-card-border: ${r.border}; `),n},z4=e=>{const t=j4(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=`
|
|
216
|
+
`+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Sr(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&wo.assertOptions(n,{silentJSONParsing:Mt.transitional(Mt.boolean),forcedJSONParsing:Mt.transitional(Mt.boolean),clarifyTimeoutError:Mt.transitional(Mt.boolean)},!1),s!=null&&(I.isFunction(s)?r.paramsSerializer={serialize:s}:wo.assertOptions(s,{encode:Mt.function,serialize:Mt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),wo.assertOptions(r,{baseUrl:Mt.spelling("baseURL"),withXsrfToken:Mt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=o&&I.merge(o.common,o[r.method]);o&&I.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),r.headers=Ze.concat(a,o);const l=[];let d=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(r)===!1||(d=d&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,f=0,p;if(!d){const m=[bg.bind(this),void 0];for(m.unshift(...l),m.push(...c),p=m.length,u=Promise.resolve(r);f<p;)u=u.then(m[f++],m[f++]);return u}p=l.length;let h=r;for(;f<p;){const m=l[f++],g=l[f++];try{h=m(h)}catch(y){g.call(this,y);break}}try{u=bg.call(this,h)}catch(m){return Promise.reject(m)}for(f=0,p=c.length;f<p;)u=u.then(c[f++],c[f++]);return u}getUri(t){t=Sr(this.defaults,t);const r=lg(t.baseURL,t.url,t.allowAbsoluteUrls);return Rm(r,t.params,t.paramsSerializer)}};I.forEach(["delete","get","head","options"],function(t){Pr.prototype[t]=function(r,n){return this.request(Sr(n||{},{method:t,url:r,data:(n||{}).data}))}}),I.forEach(["post","put","patch"],function(t){function r(n){return function(o,a,l){return this.request(Sr(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}Pr.prototype[t]=r(),Pr.prototype[t+"Form"]=r(!0)});let w4=class Ey{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(l=>{n.subscribe(l),o=l}).then(s);return a.cancel=function(){n.unsubscribe(o)},a},t(function(o,a,l){n.reason||(n.reason=new Rr(o,a,l),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 Ey(function(s){t=s}),cancel:t}}};function b4(e){return function(r){return e.apply(null,r)}}function v4(e){return I.isObject(e)&&e.isAxiosError===!0}const hl={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,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity: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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(hl).forEach(([e,t])=>{hl[t]=e});function Cg(e){const t=new Pr(e),r=Bm(Pr.prototype.request,t);return I.extend(r,Pr.prototype,t,{allOwnKeys:!0}),I.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Cg(Sr(e,s))},r}const ce=Cg(Un);ce.Axios=Pr,ce.CanceledError=Rr,ce.CancelToken=w4,ce.isCancel=sg,ce.VERSION=vg,ce.toFormData=ho,ce.AxiosError=ie,ce.Cancel=ce.CanceledError,ce.all=function(t){return Promise.all(t)},ce.spread=b4,ce.isAxiosError=v4,ce.mergeConfig=Sr,ce.AxiosHeaders=Ze,ce.formToJSON=e=>rg(I.isHTMLForm(e)?new FormData(e):e),ce.getAdapter=wg.getAdapter,ce.HttpStatusCode=hl,ce.default=ce;const{Axios:ZT,AxiosError:JT,CanceledError:QT,isCancel:RT,CancelToken:eA,VERSION:tA,all:rA,Cancel:nA,isAxiosError:sA,spread:oA,toFormData:aA,AxiosHeaders:iA,HttpStatusCode:lA,formToJSON:cA,getAdapter:dA,mergeConfig:uA}=ce,Fe="/api/v1/appauth".replace(/\/+$/,"");class nr{constructor(t,r=Fe,n=ce){this.basePath=r,this.axios=n,t&&(this.configuration=t,this.basePath=t.basePath??r)}}class x4 extends Error{constructor(t,r){super(r),this.field=t,this.name="RequiredError"}}const Ie={"UserProfileApi.getUserProfile":[{url:"/api/v1",description:"Profile API base URL"}],"UserProfileApi.updateUserProfile":[{url:"/api/v1",description:"Profile API base URL"}]},Ve="https://example.com",me=function(e,t,r){if(r==null)throw new x4(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function pl(e,t,r=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(n=>pl(e,n,r)):Object.keys(t).forEach(n=>pl(e,t[n],`${r}${r!==""?".":""}${n}`)):e.has(r)?e.append(r,String(t)):e.set(r,String(t)))}const Be=function(e,...t){const r=new URLSearchParams(e.search);pl(r,t),e.search=r.toString()},en=function(e,t,r){const n=typeof e!="string";return(n&&r&&r.isJsonMime?r.isJsonMime(t.headers?.["Content-Type"]):n)?JSON.stringify(e!==void 0?e:{}):e||""},Ue=function(e){return e.pathname+e.search+e.hash},$e=function(e,t,r,n){return(s=t,o=r)=>{const a={...e.options,url:(s.defaults.baseURL?"":n?.basePath??o)+e.url};return s.request(a)}},C4=function(e){return{getAppAuthConfig:async(t={})=>{const r="/config/",n=new URL(r,Ve);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...t},a={};Be(n,{});let d=s&&s.headers?s.headers:{};return o.headers={...a,...d,...t.headers},{url:Ue(n),options:o}},updateAppAuthConfig:async(t,r,n={})=>{me("updateAppAuthConfig","xCSRFToken",t),me("updateAppAuthConfig","authConfig",r);const s="/config/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"PUT",...a,...n},d={},c={},u=new(e&&e.formDataCtor||FormData);r!==void 0&&u.append("auth_config",r),d["Content-Type"]="multipart/form-data",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let f=a&&a.headers?a.headers:{};return l.headers={...d,...f,...n.headers},l.data=u,{url:Ue(o),options:l}}}},Sg=function(e){const t=C4(e);return{async getAppAuthConfig(r){const n=await t.getAppAuthConfig(r),s=e?.serverIndex??0,o=Ie["ApplicationConfigurationApi.getAppAuthConfig"]?.[s]?.url;return(a,l)=>$e(n,ce,Fe,e)(a,o||l)},async updateAppAuthConfig(r,n,s){const o=await t.updateAppAuthConfig(r,n,s),a=e?.serverIndex??0,l=Ie["ApplicationConfigurationApi.updateAppAuthConfig"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)}}};class S4 extends nr{getAppAuthConfig(t){return Sg(this.configuration).getAppAuthConfig(t).then(r=>r(this.axios,this.basePath))}updateAppAuthConfig(t,r,n){return Sg(this.configuration).updateAppAuthConfig(t,r,n).then(s=>s(this.axios,this.basePath))}}const P4=function(e){return{loginUser:async(t,r,n={})=>{me("loginUser","xCSRFToken",t),me("loginUser","loginUserRequest",r);const s="/login/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}},logoutUser:async(t,r={})=>{me("logoutUser","xCSRFToken",t);const n="/logout/",s=new URL(n,Ve);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...r},l={},d={};t!=null&&(l["X-CSRFToken"]=String(t)),Be(s,d);let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:Ue(s),options:a}}}},Pg=function(e){const t=P4(e);return{async loginUser(r,n,s){const o=await t.loginUser(r,n,s),a=e?.serverIndex??0,l=Ie["AuthenticationApi.loginUser"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)},async logoutUser(r,n){const s=await t.logoutUser(r,n),o=e?.serverIndex??0,a=Ie["AuthenticationApi.logoutUser"]?.[o]?.url;return(l,d)=>$e(s,ce,Fe,e)(l,a||d)}}};class E4 extends nr{loginUser(t,r,n){return Pg(this.configuration).loginUser(t,r,n).then(s=>s(this.axios,this.basePath))}logoutUser(t,r){return Pg(this.configuration).logoutUser(t,r).then(n=>n(this.axios,this.basePath))}}const T4=function(e){return{requestLoginOTP:async(t,r,n={})=>{me("requestLoginOTP","xCSRFToken",t),me("requestLoginOTP","loginOTPRequest",r);const s="/login/code/request/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}},verifyLoginOTP:async(t,r,n={})=>{me("verifyLoginOTP","xCSRFToken",t),me("verifyLoginOTP","loginOTPVerifyRequest",r);const s="/login/code/confirm/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}}}},Eg=function(e){const t=T4(e);return{async requestLoginOTP(r,n,s){const o=await t.requestLoginOTP(r,n,s),a=e?.serverIndex??0,l=Ie["LoginWithOTPApi.requestLoginOTP"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)},async verifyLoginOTP(r,n,s){const o=await t.verifyLoginOTP(r,n,s),a=e?.serverIndex??0,l=Ie["LoginWithOTPApi.verifyLoginOTP"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)}}};class A4 extends nr{requestLoginOTP(t,r,n){return Eg(this.configuration).requestLoginOTP(t,r,n).then(s=>s(this.axios,this.basePath))}verifyLoginOTP(t,r,n){return Eg(this.configuration).verifyLoginOTP(t,r,n).then(s=>s(this.axios,this.basePath))}}const k4=function(e){return{getMfaCode:async(t={})=>{const r="/mfa/getcode/",n=new URL(r,Ve);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...t},a={};Be(n,{});let d=s&&s.headers?s.headers:{};return o.headers={...a,...d,...t.headers},{url:Ue(n),options:o}},verifyMfaCode:async(t,r,n={})=>{me("verifyMfaCode","xCSRFToken",t),me("verifyMfaCode","mfaVerifyRequest",r);const s="/mfa/verify/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}}}},Tg=function(e){const t=k4(e);return{async getMfaCode(r){const n=await t.getMfaCode(r),s=e?.serverIndex??0,o=Ie["MultiFactorAuthenticationApi.getMfaCode"]?.[s]?.url;return(a,l)=>$e(n,ce,Fe,e)(a,o||l)},async verifyMfaCode(r,n,s){const o=await t.verifyMfaCode(r,n,s),a=e?.serverIndex??0,l=Ie["MultiFactorAuthenticationApi.verifyMfaCode"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)}}};class _4 extends nr{getMfaCode(t){return Tg(this.configuration).getMfaCode(t).then(r=>r(this.axios,this.basePath))}verifyMfaCode(t,r,n){return Tg(this.configuration).verifyMfaCode(t,r,n).then(s=>s(this.axios,this.basePath))}}const M4=function(e){return{oauthCallback:async(t,r,n,s,o,a,l,d,c={})=>{me("oauthCallback","provider",t),me("oauthCallback","state",r),me("oauthCallback","code",n),me("oauthCallback","scope",s),me("oauthCallback","xCSRFToken",o);const u="/oauth/{provider}/callback/".replace("{provider}",encodeURIComponent(String(t))),f=new URL(u,Ve);let p;e&&(p=e.baseOptions);const h={method:"POST",...p,...c},m={},g={};r!==void 0&&(g.state=r),n!==void 0&&(g.code=n),s!==void 0&&(g.scope=s),a!==void 0&&(g.authuser=a),l!==void 0&&(g.hd=l),d!==void 0&&(g.prompt=d),o!=null&&(m["X-CSRFToken"]=String(o)),Be(f,g);let y=p&&p.headers?p.headers:{};return h.headers={...m,...y,...c.headers},{url:Ue(f),options:h}},oauthRedirect:async(t,r,n,s,o={})=>{me("oauthRedirect","xCsrftoken",t),me("oauthRedirect","provider",r),me("oauthRedirect","process",n),me("oauthRedirect","callbackUrl",s);const a="/oauth/redirect/",l=new URL(a,Ve);let d;e&&(d=e.baseOptions);const c={method:"POST",...d,...o},u={},f={},p=new URLSearchParams;r!==void 0&&p.set("provider",r),n!==void 0&&p.set("process",n),s!==void 0&&p.set("callback_url",s),u["Content-Type"]="application/x-www-form-urlencoded",t!=null&&(u["x-csrftoken"]=String(t)),Be(l,f);let h=d&&d.headers?d.headers:{};return c.headers={...u,...h,...o.headers},c.data=p.toString(),{url:Ue(l),options:c}}}},Ag=function(e){const t=M4(e);return{async oauthCallback(r,n,s,o,a,l,d,c,u){const f=await t.oauthCallback(r,n,s,o,a,l,d,c,u),p=e?.serverIndex??0,h=Ie["OAuthApi.oauthCallback"]?.[p]?.url;return(m,g)=>$e(f,ce,Fe,e)(m,h||g)},async oauthRedirect(r,n,s,o,a){const l=await t.oauthRedirect(r,n,s,o,a),d=e?.serverIndex??0,c=Ie["OAuthApi.oauthRedirect"]?.[d]?.url;return(u,f)=>$e(l,ce,Fe,e)(u,c||f)}}};class N4 extends nr{oauthCallback(t,r,n,s,o,a,l,d,c){return Ag(this.configuration).oauthCallback(t,r,n,s,o,a,l,d,c).then(u=>u(this.axios,this.basePath))}oauthRedirect(t,r,n,s,o){return Ag(this.configuration).oauthRedirect(t,r,n,s,o).then(a=>a(this.axios,this.basePath))}}const L4=function(e){return{changePassword:async(t,r,n={})=>{me("changePassword","xCSRFToken",t),me("changePassword","passwordChangeRequest",r);const s="/password/change/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"PUT",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}},setPassword:async(t,r,n={})=>{me("setPassword","xCSRFToken",t),me("setPassword","passwordSetRequest",r);const s="/password/set/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};d["Content-Type"]="application/json",t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},l.data=en(r,l,e),{url:Ue(o),options:l}}}},kg=function(e){const t=L4(e);return{async changePassword(r,n,s){const o=await t.changePassword(r,n,s),a=e?.serverIndex??0,l=Ie["PasswordManagementApi.changePassword"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)},async setPassword(r,n,s){const o=await t.setPassword(r,n,s),a=e?.serverIndex??0,l=Ie["PasswordManagementApi.setPassword"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)}}};class O4 extends nr{changePassword(t,r,n){return kg(this.configuration).changePassword(t,r,n).then(s=>s(this.axios,this.basePath))}setPassword(t,r,n){return kg(this.configuration).setPassword(t,r,n).then(s=>s(this.axios,this.basePath))}}const F4=function(e){return{setRole:async(t,r,n={})=>{me("setRole","xCSRFToken",t),me("setRole","role",r);const s="/role/set/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};r!==void 0&&(c.role=r),t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},{url:Ue(o),options:l}},switchRole:async(t,r,n={})=>{me("switchRole","xCSRFToken",t),me("switchRole","role",r);const s="/role/switch/",o=new URL(s,Ve);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...n},d={},c={};r!==void 0&&(c.role=r),t!=null&&(d["X-CSRFToken"]=String(t)),Be(o,c);let u=a&&a.headers?a.headers:{};return l.headers={...d,...u,...n.headers},{url:Ue(o),options:l}}}},_g=function(e){const t=F4(e);return{async setRole(r,n,s){const o=await t.setRole(r,n,s),a=e?.serverIndex??0,l=Ie["RoleManagementApi.setRole"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)},async switchRole(r,n,s){const o=await t.switchRole(r,n,s),a=e?.serverIndex??0,l=Ie["RoleManagementApi.switchRole"]?.[a]?.url;return(d,c)=>$e(o,ce,Fe,e)(d,l||c)}}};class D4 extends nr{setRole(t,r,n){return _g(this.configuration).setRole(t,r,n).then(s=>s(this.axios,this.basePath))}switchRole(t,r,n){return _g(this.configuration).switchRole(t,r,n).then(s=>s(this.axios,this.basePath))}}const I4=function(e){return{getUserProfile:async(t={})=>{const r="/profile/",n=new URL(r,Ve);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...t},a={};Be(n,{});let d=s&&s.headers?s.headers:{};return o.headers={...a,...d,...t.headers},{url:Ue(n),options:o}},updateUserProfile:async(t,r,n,s,o,a={})=>{me("updateUserProfile","xCSRFToken",t);const l="/profile/",d=new URL(l,Ve);let c;e&&(c=e.baseOptions);const u={method:"PUT",...c,...a},f={},p={},h=new(e&&e.formDataCtor||FormData);r!==void 0&&h.append("name",r),n!==void 0&&h.append("mobile",n),s!==void 0&&h.append("auth_config",s),o!==void 0&&h.append("profile_pic",o),f["Content-Type"]="multipart/form-data",t!=null&&(f["X-CSRFToken"]=String(t)),Be(d,p);let m=c&&c.headers?c.headers:{};return u.headers={...f,...m,...a.headers},u.data=h,{url:Ue(d),options:u}}}},Mg=function(e){const t=I4(e);return{async getUserProfile(r){const n=await t.getUserProfile(r),s=e?.serverIndex??0,o=Ie["UserProfileApi.getUserProfile"]?.[s]?.url;return(a,l)=>$e(n,ce,Fe,e)(a,o||l)},async updateUserProfile(r,n,s,o,a,l){const d=await t.updateUserProfile(r,n,s,o,a,l),c=e?.serverIndex??0,u=Ie["UserProfileApi.updateUserProfile"]?.[c]?.url;return(f,p)=>$e(d,ce,Fe,e)(f,u||p)}}};class Ng extends nr{getUserProfile(t){return Mg(this.configuration).getUserProfile(t).then(r=>r(this.axios,this.basePath))}updateUserProfile(t,r,n,s,o,a){return Mg(this.configuration).updateUserProfile(t,r,n,s,o,a).then(l=>l(this.axios,this.basePath))}}class Lg{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 bo="/api/v1/appauth",sr=new Lg({basePath:bo,baseOptions:{withCredentials:!0}}),ml=new E4(sr),Og=new S4(sr),gl=new A4(sr),yl=new _4(sr),tn=new O4(sr),V4=new D4(sr),Fg=new N4(sr);new Ng(sr);const Je=()=>{const e=document.cookie.match(/csrftoken=([^;]+)/);if(e)return decodeURIComponent(e[1]);const t=document.querySelector('meta[name="csrf-token"]');if(t)return t.getAttribute("content");const r=document.cookie.match(/csrf_token=([^;]+)/);return r?decodeURIComponent(r[1]):(console.warn("CSRF token not found. OTP requests may fail."),"")};let fe=null,Er=null,Nt=null;const it=e=>e.response?.data?.errors?.[0]?.message?e.response.data.errors[0].message:e.response?.data?.response?.errors?.[0]?.message?e.response.data.response.errors[0].message:e.response?.data?.response?.message?e.response.data.response.message:e.response?.data?.message?e.response.data.message:e.message?e.message:"An unexpected error occurred",Z={async getAuthConfig(){return fe||Er||(Er=(async()=>{try{const t=(await Og.getAppAuthConfig()).data;return t?.response?.auth_config?fe=t.response.auth_config:t?.auth_config?fe=t.auth_config:fe=t,fe}catch(e){throw console.error("Failed to fetch auth config:",e),Er=null,e}finally{Er=null}})(),Er)},getConfig(){return fe},isPasswordLoginEnabled(){return fe?.login_methods?.password?.enabled||!1},isOTPLoginEnabled(){return fe?.login_methods?.otp?.enabled||!1},isSSOEnabled(){return fe?.login_methods?.sso?.enabled||!1},isOIDCEnabled(){return fe?.login_methods?.oidc?.enabled||!1},getOIDCProviders(){return fe?.login_methods?.oidc?.providers||[]},getSSOProviders(){return fe?.login_methods?.sso?.providers||[]},getAllowedUsernames(){return(fe?.login_methods?.password?.allowed_usernames||fe?.login_methods?.allowed_usernames||["email"]).map(t=>t==="phone"?"mobile":t)},isForgotPasswordEnabled(){return fe?.password_policy?.reset?.enabled||!1},getPasswordResetLinkExpiry(){return fe?.login_methods?.password?.password_reset_link_expiry_hours||24},getSessionPolicy(){return fe?.session_policy||{}},isRememberMeEnabled(){return fe?.session_policy?.remember_me_enabled!==!1},getRememberMeDurationDays(){return fe?.session_policy?.remember_me_duration_days||30},getPasswordPolicy(){return fe?.password_policy||{}},getPasswordResetMethods(){return fe?.password_policy?.reset?.method||[]},isPasswordResetEnabled(){return fe?.password_policy?.reset?.enabled||!1},getPasswordResetExpiry(){return fe?.password_policy?.reset?.expiry_hours||24},isTwoFactorRequired(){return fe?.two_factor_auth?.required||!1},getTwoFactorMethods(){return fe?.two_factor_auth?.allowedMethods||[]},getTwoFactorHooks(){return{email:fe?.two_factor_auth?.email_hook,sms:fe?.two_factor_auth?.sms_hook}},async login(e,t={}){try{fe||await this.getAuthConfig();const r=Je()||"",n=e,s=await ml.loginUser(r,n),o=s.data;if(o?.success&&o?.response){const a=o.response;return a.status===401&&a.data?.next_step?a:a.data||a}return s.data}catch(r){if(console.error("Login error:",r),r.response?.data?.response?.error_code==="ACCOUNT_LOCKED")throw new Error("ACCOUNT_LOCKED");if(r.response?.status===401&&r.response?.data){const s=r.response.data;if(s?.success&&s?.response){const o=s.response;if(o.status===401&&o.data?.next_step)return o}if(s?.response?.data?.next_step||s?.data?.next_step)return s}const n=it(r);throw n!=="An unexpected error occurred"?new Error(n):r}},async logout(e={}){try{const t=Je()||"";await ml.logoutUser(t)}catch(t){console.error("Logout error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async getCurrentUser(){try{const{isAuthenticatedViaCookie:e}=await Promise.resolve().then(function(){return ay});if(!e())throw new Error("Not authenticated - no valid session cookie");return{id:1,username:"authenticated_user",email:"user@example.com",authenticated:!0}}catch(e){console.error("Get current user failed:",e);const t=it(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){try{return typeof e=="string"?this.requestPasswordReset({email:e}):this.requestPasswordReset(e)}catch(t){throw t}},async requestPasswordReset(e){try{const t=Je()||"";return(await tn.axios.post(`${bo}/password/reset/request/`,e,{headers:{"X-CSRFToken":t}})).data}catch(t){console.error("Request password reset error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async validatePasswordResetKey(e){try{return(await tn.axios.get(`${bo}/password/reset/`,{headers:{"x-password-reset-key":e}})).data}catch(t){console.error("Validate password reset key error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async confirmResetPassword(e){try{const t=Je()||"";return(await tn.axios.post(`${bo}/password/reset/`,e,{headers:{"X-CSRFToken":t}})).data}catch(t){if(console.error("Confirm reset password error:",t),t.response?.status===401&&t.response?.data){const n=t.response.data;if(n?.success&&n?.response){const s=n.response;if(s.status===401&&s.data?.next_step)return s}}const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async fetchLoginMethods(){try{return(await this.getAuthConfig())?.login_methods||{}}catch(e){throw e}},async requestOTP(e){try{const t=Je()||"",n=e.includes("@")?{email:e}:{phone:e},s=await gl.requestLoginOTP(t,n),o=s.data;return o?.success&&o?.response?o.response.status===401&&o.response.data?.message?o.response:o.response.data||o.response:s.data}catch(t){if(console.error("Send Code error:",t),t.response?.status===401&&t.response?.data){const r=t.response.data;if(r?.success&&r?.response){const n=r.response;if(n.status===401&&n.data?.message)return n}}if(t.response?.data){const r=t.response.data;if(r?.errors&&Array.isArray(r.errors)&&r.errors.length>0){const n=r.errors[0];throw new Error(n.message||"Failed to send OTP")}if(r?.response?.data?.message)throw new Error(r.response.data.message);if(r?.message)throw new Error(r.message)}throw t}},async verifyOTP(e,t){try{const r=Je()||"",n={code:t},s=await gl.verifyLoginOTP(r,n),o=s.data;return o?.success&&o?.response?(o.response.status===401&&o.response.data?.next_step,o.response):s.data}catch(r){if(console.error("Verify OTP error:",r),r.response?.data?.response?.error_code==="ACCOUNT_LOCKED")throw new Error("ACCOUNT_LOCKED");if(r.response?.status===401&&r.response?.data){const n=r.response.data;if(n?.success&&n?.response){const s=n.response;if(s.status===401&&s.data?.next_step)return s}if(n?.response?.data?.next_step||n?.data?.next_step)return n}if(r.response?.data){const n=r.response.data;if(n?.errors&&Array.isArray(n.errors)&&n.errors.length>0){const s=n.errors[0];throw new Error(s.message||"Verification failed")}if(n?.response?.data?.message)throw new Error(n.response.data.message);if(n?.message)throw new Error(n.message)}throw r}},async selectRole(e){try{const r={"Content-Type":"application/json","X-CSRFToken":Je()||""};Nt&&(r["X-Session-Token"]=Nt);const n=await fetch(`/api/v1/appauth/role/set/?role=${encodeURIComponent(e)}`,{method:"POST",headers:r,credentials:"include"}),s=await n.json();if(s?.success&&s?.response){const o=s.response;return o.status===401&&o.data?.next_step?o:((o.status===200||o.meta?.is_authenticated)&&(Nt=null),o.data||o)}if(!n.ok){if(n.status===401&&s&&(s?.response?.data?.next_step||s?.data?.next_step))return s;const o=s?.error?.message||s?.message||`Role selection failed: ${n.status}`;throw new Error(o)}return s}catch(t){console.error("Select role error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async sendTwoFactorCode(e){try{const t=e?{params:{method:e}}:{};return(await yl.getMfaCode(t)).data}catch(t){console.error("Send 2FA code error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async verifyTwoFactorCode(e){try{const t=Je()||"";return(await yl.verifyMfaCode(t,{code:e})).data}catch(t){console.error("Verify 2FA code error:",t);const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async changePassword(e,t){try{const r=Je()||"";return(await tn.changePassword(r,{current_password:e,new_password:t})).data}catch(r){console.error("Change password error:",r);const n=it(r);throw n!=="An unexpected error occurred"?new Error(n):r}},async setPassword(e){try{const t=Je()||"";return(await tn.setPassword(t,{new_password:e})).data}catch(t){if(console.error("Set password error:",t),t.response?.status===401&&t.response?.data){const n=t.response.data;if(n?.response?.data?.next_step||n?.data?.next_step)return n}const r=it(t);throw r!=="An unexpected error occurred"?new Error(r):t}},async processOAuthCallback(e,t,r,n,s,o,a,l){try{const d=Je()||"",c=await Fg.oauthCallback(e,t,r,n,d,s,o,a,l),u=c.data;if(u?.success&&u?.response){const f=u.response;return f.status===401&&f.data?.next_step?f:f.data||f}return c.data}catch(d){if(d.response?.status===401&&d.response?.data){const u=d.response.data;if(u?.success&&u?.response){const f=u.response;if(f.status===401&&f.data?.next_step)return f}if(u?.response?.data?.next_step||u?.data?.next_step)return u}const c=it(d);throw c!=="An unexpected error occurred"?new Error(c):d}},clearConfig(){fe=null,Er=null},async isAuthenticated(){try{const{isAuthenticatedViaCookie:e}=await Promise.resolve().then(function(){return ay});return e()}catch(e){return console.error("Authentication check failed:",e),!1}},validatePassword(e){const t=this.getPasswordPolicy(),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 oauthRedirect(e,t,r){try{const n=Je()||"",s=r?{transformRequest:[(a,l)=>{const d=new URLSearchParams(a);return r&&d.set("next",r),d.toString()}]}:void 0;return(await Fg.oauthRedirect(n,e,"login",t,s)).data}catch(n){throw n}},async getUserProfile(){try{const e=new Lg({basePath:"/api/v1",baseOptions:{withCredentials:!0}});return(await new Ng(e).getUserProfile()).data}catch(e){throw console.error("Get user profile error:",e),e}},async initiateSAMLAuth(e,t){try{const r=Je()||"",n={saml_id:e,...t&&{next:t}},s=await fetch("/api/v1/appauth/saml/init/",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":r},credentials:"include",body:JSON.stringify(n)}),o=await s.text();if(!s.ok){let l=`SAML init failed: ${s.status} ${s.statusText}`;try{const d=JSON.parse(o);d?.error?.message?l=d.error.message:d?.message?l=d.message:d?.detail&&(l=d.detail)}catch{o&&o.length<500&&(l+=` - ${o}`)}throw new Error(l)}const a=JSON.parse(o);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 console.error("SAML init error:",r),r}},async getSAMLAuthMeta(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 s=`SAML auth meta failed: ${r.status} ${r.statusText}`;throw n?.error?.message?s=n.error.message:n?.message?s=n.message:n?.detail&&(s=n.detail),new Error(s)}if(n?.success&&n?.response){const s=n.response;return s.meta?.session_token&&(Nt=s.meta.session_token),s.status===401&&s.data?.next_step?s:s.data||s}return n?.meta?.session_token&&(Nt=n.meta.session_token),n}catch(r){throw console.error("SAML auth meta error:",r),r}},async setRole(e){try{const r={"Content-Type":"application/json","X-CSRFToken":Je()||""};Nt&&(r["X-Session-Token"]=Nt);const n=await fetch(`/api/v1/appauth/role/set/?role=${encodeURIComponent(e)}`,{method:"POST",headers:r,credentials:"include"});if(!n.ok){const o=await n.text();throw new Error(`Role set failed: ${n.status} ${n.statusText} - ${o}`)}const s=await n.json();if(s?.success&&s?.response){const o=s.response;return o.status===401&&o.data?.next_step?o:((o.status===200||o.meta?.is_authenticated)&&(Nt=null),o.data||o)}return s}catch(t){throw console.error("Set role error:",t),t}},clearSamlSessionToken(){Nt=null},getSamlSessionToken(){return Nt}},Dg=e=>{let t;const r=new Set,n=(c,u)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),r.forEach(h=>h(t,p))}},s=()=>t,l={setState:n,getState:s,getInitialState:()=>d,subscribe:c=>(r.add(c),()=>r.delete(c))},d=t=e(n,s,l);return l},B4=(e=>e?Dg(e):Dg),U4=e=>e;function $4(e,t=U4){const r=b.useSyncExternalStore(e.subscribe,b.useCallback(()=>t(e.getState()),[e,t]),b.useCallback(()=>t(e.getInitialState()),[e,t]));return b.useDebugValue(r),r}const Ig=e=>{const t=B4(e),r=n=>$4(t,n);return Object.assign(r,t),r},vo=(e=>e?Ig(e):Ig)(e=>({basePath:"/login",setBasePath:t=>e({basePath:t})})),Vg=b.createContext(void 0),Qe=()=>{const e=b.useContext(Vg);if(!e)throw new Error("useAuthConfig must be used within AuthConfigProvider");return e},Bg=({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",selectedColor:"#1890ff",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",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,l)=>{const d={...a};for(const c in l)Object.prototype.hasOwnProperty.call(l,c)&&(l[c]!==null&&typeof l[c]=="object"&&!Array.isArray(l[c])&&!b.isValidElement(l[c])?d[c]=n(a[c]||{},l[c]):d[c]=l[c]);return d},s=n(r,t),o={authConfig:s,getLoginConfig:()=>s.login||{},getRoleSelectionConfig:()=>s.roleSelection||{},getTwoFactorConfig:()=>s.twoFactor||{},getResetPasswordConfig:()=>s.resetPassword||{},getThemeConfig:()=>s.theme||{},getCardConfig:()=>s.card||{},getLogoConfig:()=>s.logo||{},getProvidersConfig:()=>s.providers||{},getMessagesConfig:()=>s.messages||{},getCustomComponents:()=>s.customComponents||{}};return i.jsx(Vg.Provider,{value:o,children:e})},j4=e=>{const t=e?.theme||{},r=e?.card||{};let n="";if(t.primaryColor&&(n+=`--auth-primary-color: ${t.primaryColor}; `),t.secondaryColor&&(n+=`--auth-secondary-color: ${t.secondaryColor}; `),t.fontFamily&&(n+=`--auth-font-family: ${t.fontFamily}; `),t.borderRadius&&(n+=`--auth-border-radius: ${t.borderRadius}; `),t.textColor&&(n+=`--auth-text-color: ${t.textColor}; `),t.secondaryTextColor&&(n+=`--auth-secondary-text-color: ${t.secondaryTextColor}; `),t.mutedTextColor&&(n+=`--auth-muted-text-color: ${t.mutedTextColor}; `),t.linkColor&&(n+=`--auth-link-color: ${t.linkColor}; `),t.linkHoverColor&&(n+=`--auth-link-hover-color: ${t.linkHoverColor}; `),t.background?.color&&(n+=`--auth-bg-color: ${t.background.color}; `),t.background?.gradient&&(n+=`--auth-bg-gradient: ${t.background.gradient}; `),t.background?.image){const s=t.background.image;(s.startsWith("https://")||s.startsWith("/"))&&(n+=`--auth-bg-image: url(${s}); `)}return r.backgroundColor&&(n+=`--auth-card-bg: ${r.backgroundColor}; `),r.borderRadius&&(n+=`--auth-card-border-radius: ${r.borderRadius}; `),r.boxShadow&&(n+=`--auth-card-shadow: ${r.boxShadow}; `),r.maxWidth&&(n+=`--auth-card-max-width: ${r.maxWidth}; `),r.padding&&(n+=`--auth-card-padding: ${r.padding}; `),r.border&&(n+=`--auth-card-border: ${r.border}; `),n},z4=e=>{const t=j4(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=`
|
|
217
217
|
:root { ${t} }
|
|
218
218
|
|
|
219
219
|
/* Auth component text styling using CSS variables */
|
|
@@ -241,7 +241,7 @@ export default App;`,h=`mkdir -p ${d}`,m={container:{padding:"32px",maxWidth:"90
|
|
|
241
241
|
.auth-link:hover {
|
|
242
242
|
color: var(--auth-link-hover-color, #3b82f6) !important;
|
|
243
243
|
}
|
|
244
|
-
`;r.innerHTML=n},H4=()=>{const e=document.getElementById("auth-theme-variables");e&&e.remove()},wt=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},or=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},Tr=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},W4=e=>e?.logo?.position||"center",Ar=e=>{const t=W4(e),r=e?.logo;let n="flex items-center mb-6";const s={};switch(t){case"left":n+=" justify-start";break;case"right":n+=" justify-end";break;case"center":default:n+=" justify-center";break}return r?.className&&(n+=` ${r.className}`),{className:n,style:s}},bt=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},Lt=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},Ug=e=>{const t=e?.theme;if(!t)return{};const r={};return t.linkColor&&(r.color=t.linkColor),t.fontFamily&&(r.fontFamily=t.fontFamily),r},q4=({onSubmit:e,logo:t})=>{const[r,n]=b.useState(!1),[s,o]=b.useState(null),[a,l]=b.useState(!1),[d,c]=b.useState(0),[u,f]=b.useState(["email"]),[p,h]=b.useState("email"),{basePath:m}=vo(),{authConfig:g,getResetPasswordConfig:y,getMessagesConfig:w}=Qe(),v=y(),x=w(),S=or(g),T=Ar(g),k=Tr(g);b.useEffect(()=>{(async()=>{try{await Z.getAuthConfig();const O=Z.getPasswordResetMethods();O&&O.length>0&&(f(O),h(O[0]))}catch(O){console.error("Failed to load reset configuration:",O)}})()},[]);const M=async V=>{n(!0),o(null);try{if(e){const O={email:p==="email"?V.contact:void 0,phone:p==="sms"?V.contact:void 0};await e(O)}l(!0),c(O=>O+1)}catch(O){const L=p==="email"?"email":"SMS",_=O.message||x?.errors?.networkError||`Failed to send reset ${L}. Please try again.`;o(_)}finally{n(!1)}},P=()=>p==="email"?v?.forgotPassword?.emailPlaceholder||"Email address":"Phone number",N=()=>p==="email"?[{required:!0,message:x?.validation?.required||"Please enter your email address"},{type:"email",message:x?.validation?.invalidEmail||"Please enter a valid email address!"}]:[{required:!0,message:x?.validation?.required||"Please input your phone number!"},{pattern:/^\+?[1-9]\d{1,14}$/,message:x?.validation?.invalidMobile||"Please enter a valid phone number!"}],D=()=>{const V=p==="email"?"Email":"SMS",O=p==="email"?"email":"phone";return{title:v?.forgotPassword?.successMessage||`${V} Sent!`,subTitle:`Please check your ${O} for password reset instructions.`}};if(a){const V=D();return i.jsx(A.Result,{status:"success",title:V.title,subTitle:V.subTitle,extra:[i.jsx(R.Link,{to:m,children:i.jsx(A.Button,{variant:"primary",children:v?.forgotPassword?.backToLoginText||"Back to Login"})},"login")]})}return i.jsxs("div",{className:"w-full max-w-md mx-auto",style:S,children:[i.jsx(R.Link,{to:m,className:"inline-block mb-6",children:i.jsx(A.Button,{variant:"link",size:"link",className:"flex gap-2",icon:i.jsx(Mo,{size:16}),children:v?.forgotPassword?.backToLoginText||"Back to Login"})}),t&&i.jsx("div",{className:T.className,style:T.style,children:typeof t=="string"?i.jsx("img",{src:t,alt:g?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:k}):t}),i.jsx("h2",{className:"text-2xl font-semibold mb-3",style:bt(g),children:v?.forgotPassword?.title||"Forgot Password"}),i.jsx("p",{className:"text-sm mb-6",style:Lt(g),children:v?.forgotPassword?.subtitle||v?.forgotPassword?.instructionText||`Enter your ${p==="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:M,layout:"vertical",children:[s&&i.jsx(A.Alert,{message:s,type:"error",showIcon:!0,closable:!0,onClose:()=>o(null),className:"mb-4"}),u.length>1&&i.jsx(A.FormItem,{label:"Reset method",children:i.jsx(A.Select,{value:p,onChange:V=>{h(V),c(O=>O+1)},options:u.map(V=>({value:V,label:i.jsxs(A.Space,{children:[V==="email"?i.jsx(Gn,{size:16}):i.jsx(Iy,{size:16}),V==="email"?"Email":"SMS"]})}))})}),i.jsx(A.FormItem,{name:"contact",label:p==="email"?v?.forgotPassword?.emailLabel||"Email":"Phone",rules:N(),children:i.jsx(A.Input,{placeholder:P(),autoComplete:p==="email"?"email":"tel"})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",className:"w-full h-10 text-base font-medium",disabled:r,fullWidth:!0,children:v?.forgotPassword?.submitButtonText||`Send Reset ${p==="email"?"Email":"SMS"}`})})]},d)]})};function rt(e){if(!e||typeof e!="string")return!1;const t=e.trim();return!(t.includes("\\")||!t.startsWith("/")||t.startsWith("//")||t.toLowerCase().includes("javascript:")||t.toLowerCase().includes("data:")||t.split("?")[0].includes("://")||t.startsWith("/app/login")&&(t.indexOf("?")===-1||!t.includes("step=")))}function nt(e){if(!e)return null;try{const r=new URLSearchParams(e).get("next");return r||null}catch(t){return console.error("Error parsing next parameter:",t),null}}function Se(e,t,r="/app"){return e&&rt(e)?e:t&&rt(t)?t:rt(r)?r:"/app"}const jn="sso_next_param";function $g(e){try{sessionStorage.removeItem(jn),e&&rt(e)&&sessionStorage.setItem(jn,e)}catch{}}function zt(){try{const e=sessionStorage.getItem(jn);if(sessionStorage.removeItem(jn),e&&rt(e))return e}catch{}return null}function K4(){try{sessionStorage.removeItem(jn)}catch{}}function _e(e,t="/app"){if(!e){window.location.href=t;return}const r=Se(e,null,t);r!==e&&console.warn(`[Security] Redirect URL sanitized: ${e} -> ${r}`),window.location.href=r}const G4=({onSubmit:e,token:t,logo:r})=>{const[n,s]=b.useState(!1),[o,a]=b.useState(!0),[l,d]=b.useState(!1),[c,u]=b.useState(""),[f,p]=b.useState(!1),[h,m]=b.useState(0),[g,y]=b.useState(null),{basePath:w}=vo(),{authConfig:v,getResetPasswordConfig:x,getMessagesConfig:S}=Qe(),T=x(),k=S(),M=or(v),P=Ar(v),N=Tr(v);b.useEffect(()=>{t?(async()=>{try{const L=await Z.validatePasswordResetKey(t);L?.data?.metadata?.password_policy&&y(L.data.metadata.password_policy),d(!0)}catch(L){console.error("Invalid reset key:",L),d(!1);const _=L instanceof Error?L.message:"This password reset link is invalid or has expired.";u(_)}finally{a(!1)}})():(a(!1),d(!1),u("Invalid link."))},[t]);const D=(O,L)=>{if(!L){const _=k?.validation?.required||"Please input your new password!";return Promise.reject(new Error(_))}if(g){if(g.min_length&&L.length<g.min_length)return Promise.reject(new Error(`Password must be at least ${g.min_length} characters long`))}else{const _=Z.validatePassword(L);if(!_.valid){const B=k?.validation?.passwordTooShort||_.errors.join(", ");return Promise.reject(new Error(B))}}return Promise.resolve()},V=async O=>{if(O.password!==O.confirmPassword){const L=k?.validation?.passwordsDoNotMatch||"The two passwords do not match!";A.toast.error(L);return}s(!0);try{if((await Z.confirmResetPassword({key:t,password:O.password}))?.data?.next_step?.id==="login"){A.toast.success("Password reset successful! Redirecting to login..."),setTimeout(()=>{_e("/app/login")},1500);return}p(!0),e&&await e({...O,token:t}),m(_=>_+1)}catch(L){const _=k?.errors?.networkError||(L instanceof Error?L.message:"Failed to reset password. Please try again.");A.toast.error(_)}finally{s(!1)}};return o?i.jsxs("div",{className:"w-full max-w-md mx-auto p-8 text-center",style:M,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..."})]}):l?f?i.jsx(A.Result,{status:"success",title:T?.resetForm?.successMessage||"Password Reset Successful!",subTitle:"Your password has been successfully reset. You can now login with your new password.",extra:[i.jsx(R.Link,{to:w,children:i.jsx(A.Button,{variant:"primary",children:"Go to Login"})},"login")]}):i.jsxs("div",{className:"w-full max-w-md mx-auto",style:M,children:[r&&i.jsx("div",{className:P.className,style:P.style,children:typeof r=="string"?i.jsx("img",{src:r,alt:v?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:N}):r}),i.jsx("h2",{className:"text-2xl font-semibold mb-3",style:bt(v),children:T?.resetForm?.title||"Reset Password"}),i.jsx("p",{className:"text-sm mb-6",style:Lt(v),children:T?.resetForm?.subtitle||"Please enter your new password below."}),i.jsxs(A.Form,{name:"reset-password",className:"space-y-4",onFinish:V,layout:"vertical",children:[i.jsx(A.FormItem,{name:"password",label:T?.resetForm?.passwordLabel||"New Password",rules:[{validator:D}],children:i.jsx(A.PasswordInput,{prefix:i.jsx(Kn,{size:16,className:"text-gray-400"}),placeholder:T?.resetForm?.passwordPlaceholder||"New Password",autoComplete:"new-password"})}),i.jsx(A.FormItem,{name:"confirmPassword",label:T?.resetForm?.confirmPasswordLabel||"Confirm Password",rules:[{required:!0,message:k?.validation?.required||"Please confirm your password!"}],children:i.jsx(A.PasswordInput,{prefix:i.jsx(Kn,{size:16,className:"text-gray-400"}),placeholder:T?.resetForm?.confirmPasswordPlaceholder||"Confirm Password",autoComplete:"new-password"})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",className:"w-full h-10 text-base font-medium",disabled:n,fullWidth:!0,children:T?.resetForm?.submitButtonText||"Reset Password"})})]},h)]}):i.jsx(A.Result,{status:"error",title:"Invalid Link",subTitle:c,extra:[i.jsx(R.Link,{to:w,children:i.jsx(A.Button,{variant:"primary",children:"Back to Login"})},"login")]})},X4=()=>i.jsxs("svg",{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"})]}),Y4=()=>i.jsxs("svg",{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"})]}),Z4=()=>i.jsx("svg",{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"})}),J4=()=>i.jsx("svg",{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"})}),Q4=()=>i.jsx("svg",{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"})}),R4=()=>i.jsx("svg",{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"})}),eE=()=>i.jsx("svg",{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"})}),tE=()=>i.jsxs("svg",{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"})]}),rE=()=>i.jsx("svg",{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"})}),nE=()=>i.jsxs("svg",{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"})]}),sE=(e,t="default")=>{const r=e?e.toLowerCase():"";return r.includes("google")?i.jsx(X4,{}):r.includes("microsoft")||r.includes("azure")?i.jsx(Y4,{}):r.includes("github")?i.jsx(Z4,{}):r.includes("linkedin")?i.jsx(J4,{}):r.includes("facebook")?i.jsx(Q4,{}):r.includes("twitter")||r.includes("x.com")?i.jsx(R4,{}):r.includes("apple")?i.jsx(eE,{}):r.includes("slack")?i.jsx(tE,{}):r.includes("okta")?i.jsx(nE,{}):r.includes("saml")||r.includes("sso")||t==="sso"?i.jsx(rE,{}):i.jsx(Oy,{size:16})},vt=({provider:e,type:t="default",prefix:r="Continue with",postfix:n=""})=>{const[s,o]=b.useState(!1),a=()=>{if(t==="sso"){const f=e.label||e.id;return f.toLowerCase().includes("azure")?"Azure AD":f.toLowerCase().includes("okta")?"Okta":f.toLowerCase().includes("google")?"Google":f.toLowerCase().includes("microsoft")?"Microsoft":f.toLowerCase().includes("saml")?"SSO":f.charAt(0).toUpperCase()+f.slice(1)}else return e.name||e.provider},l=t==="sso"?e.label||e.id:e.provider,d=a(),c=sE(l,t),u=async()=>{try{o(!0);const f=nt(window.location.search),p=f||"/app";if($g(f),t==="sso"){const h=e.id,g=(await Z.initiateSAMLAuth(h,p))?.redirect_url;g&&(g.startsWith("https://")||g.startsWith("/"))?window.location.href=g:console.error("No valid redirect URL received from SAML init")}else{const h=await Z.oauthRedirect(e.provider,window.location.href,p);if(h.success){const m=h.response.redirect_url;m&&(m.startsWith("https://")||m.startsWith("/"))&&(window.location.href=m)}else console.error("Error authenticating with OAuth provider")}}catch(f){console.error(`Error authenticating with ${t} provider:`,f);let p=`Failed to authenticate with ${d}`;f.message?.includes("500")?p+=". The authentication service appears to be unavailable. Please try again later or contact support.":f.message?.includes("404")?p+=". The authentication service is not configured properly.":f.message?.includes("403")?p+=". You do not have permission to use this authentication method.":f.message?p+=`. ${f.message}`:p+=". Please try again or contact support.",A.toast.error(p)}finally{o(!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:c,block:!0,onClick:u,disabled:s,loading:s,children:s?"Redirecting...":`${r} ${d} ${n}`})},jg=({length:e=6,value:t="",onChange:r,disabled:n=!1})=>{const[s,o]=b.useState(new Array(e).fill("")),a=b.useRef([]);b.useEffect(()=>{if(t){const u=t.split("").slice(0,e),f=[...new Array(e).fill("")];u.forEach((p,h)=>{f[h]=p}),o(f)}},[t,e]);const l=(u,f)=>{const p=u.value;if(isNaN(p))return;const h=[...s];h[f]=p,o(h),r&&r(h.join("")),p&&f<e-1&&a.current[f+1].focus()},d=(u,f)=>{u.key==="Backspace"&&!s[f]&&f>0&&a.current[f-1].focus()},c=u=>{u.preventDefault();const p=u.clipboardData.getData("text/plain").slice(0,e).split(""),h=[...s];p.forEach((g,y)=>{!isNaN(g)&&y<e&&(h[y]=g)}),o(h),r&&r(h.join(""));const m=h.findIndex(g=>g==="");m!==-1?a.current[m].focus():a.current[e-1].focus()};return i.jsx(A.Space,{className:"flex justify-center gap-2",size:"small",children:s.map((u,f)=>i.jsx(A.Input,{ref:p=>a.current[f]=p,type:"text",inputMode:"numeric",maxLength:1,value:u,onChange:p=>l(p.target,f),onKeyDown:p=>d(p,f),onPaste:c,"aria-label":`Digit ${f+1} of ${e}`,className:"!w-12 !h-12 text-center text-xl 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))})},zg=b.createContext(null),ar=()=>{const e=b.useContext(zg);if(!e)throw new Error("useAuthContext must be used within an AuthProvider");return e},Hg=({children:e,config:t={}})=>{const[r,n]=b.useState(null),[s,o]=b.useState(!0),[a,l]=b.useState(null),[d,c]=b.useState(null),[u,f]=b.useState(null),[p,h]=b.useState(null),m=b.useRef(!1);b.useEffect(()=>{m.current||(m.current=!0,g())},[]);const g=async()=>{try{const M=await Z.getAuthConfig();h(M),await y()}catch(M){l(M instanceof Error?M.message:"An error occurred"),o(!1)}},y=async()=>{try{await Z.isAuthenticated()?(n({id:1,username:"authenticated_user",email:"user@example.com",authenticated:!0}),l(null)):(n(null),l(null))}catch(M){console.error("Auth check failed:",M),n(null),l(null)}finally{o(!1)}},k={user:r,loading:s,error:a,login:async M=>{o(!0),l(null);try{const P=await Z.login(M,t);let N=P,D=null;P?.status===401&&P?.data?(N=P.data,D=P.data?.next_step):(N=P?.response?.data||P?.data||P,D=N?.next_step);const V=P?.user||N?.user||{};if(V.email=V.email||M.email,V.username=V.username||M.username,V.phone=V.phone||M.phone,V.name=V.name||M.email||M.username||M.phone,c({user:V,token:P.token||N?.token,roles:P.roles,requires2FA:P.requires2FA,twoFactorMethods:P.twoFactorMethods,requiresPasswordReset:P.requiresPasswordReset,passwordResetReason:P.passwordResetReason}),D&&D.is_pending&&D.id==="role_selection")return{...P,user:V};if(D&&D.is_pending&&(D.id==="set_password"||D.id==="password_expiry"||D.id==="first_login"))return c({user:V,token:P.token||N?.token,requiresPasswordReset:!0,passwordResetReason:D.id==="password_expiry"?"Your password has expired":D.id==="first_login"?"Please set up your password for first login":D.metadata?.reason||"Password update required"}),{...P,user:V};if(P.roles&&P.roles.length>1)return f(P.roles),{requiresRoleSelection:!0,roles:P.roles,user:V,token:P.token};let O=P;return P.roles&&P.roles.length===1?O.user={...V,role:P.roles[0]}:O.user=V,P.requires2FA?{...O,requires2FA:!0,twoFactorMethods:P.twoFactorMethods||["email"]}:P.requiresPasswordReset?{...O,requiresPasswordReset:!0,passwordResetReason:P.passwordResetReason}:(n(O.user),c(null),f(null),{...O,user:V})}catch(P){console.error("AuthProvider login caught error:",P);const N=P instanceof Error?P.message:"Login failed";throw console.error("AuthProvider error.message:",N),l(N),P}finally{o(!1)}},logout:async()=>{o(!0);try{await Z.logout(t),n(null),c(null),f(null)}catch(M){console.error("Logout failed:",M)}finally{o(!1)}},selectRole:async M=>{if(!d)throw new Error("No pending authentication");o(!0);try{t.roleSelectionEndpoint&&await Z.selectRole(typeof M=="string"?M:M.id);const P={...d.user,role:M},N={...d,user:P};return N.requires2FA?(c(N),{...N,requires2FA:!0,twoFactorMethods:N.twoFactorMethods||["email"]}):N.requiresPasswordReset?(c(N),{...N,requiresPasswordReset:!0,passwordResetReason:N.passwordResetReason}):(n(P),c(null),f(null),{user:P,token:d.token})}catch(P){throw l(P instanceof Error?P.message:"An error occurred"),P}finally{o(!1)}},checkAuth:y,forgotPassword:async M=>Z.forgotPassword(M),resetPassword:async M=>Z.confirmResetPassword(M),isAuthenticated:!!r,pendingAuth:d,availableRoles:u,authConfig:p,requiresRoleSelection:!!d&&!!u};return i.jsx(zg.Provider,{value:k,children:e})},{Text:Wg,Title:qg}=A.Typography,wl=({onSuccess:e,onBack:t,submitButtonText:r,verifyButtonText:n,resendButtonText:s})=>{const[o,a]=b.useState("request"),[l,d]=b.useState(!1),[c,u]=b.useState(""),[f,p]=b.useState("email"),[h,m]=b.useState(""),[g,y]=b.useState(""),[w,v]=b.useState(""),[x,S]=b.useState(0),[T,k]=b.useState(0),{authConfig:M}=ar();b.useEffect(()=>{if(M){const B=Z.getAllowedUsernames();B&&B.length>0&&p(B[0])}},[M]),b.useEffect(()=>{if(x>0){const B=setTimeout(()=>S(x-1),1e3);return()=>clearTimeout(B)}},[x]);const P=B=>B==="email"?"Enter your email address":"Enter your mobile number",N=B=>B==="email"?[{required:!0,message:"Please enter your email address"},{type:"email",message:"Please enter a valid email!"}]:B==="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"}],D=async B=>{v(""),d(!0);try{const F=await Z.requestOTP(B.username);F?.status===401&&F?.data?.message?(u(B.username),a("verify"),S(30),A.toast.success(F.data.message||"Code sent successfully!")):(u(B.username),a("verify"),S(30),A.toast.success("Code sent successfully!"))}catch(F){console.error("Failed to Send Code:",F);const W=F instanceof Error?F.message:"Failed to Send Code";v(W)}finally{d(!1)}},V=async()=>{if(y(""),h.length!==6){y("Please enter 6 digit Code");return}d(!0);try{const W={...await Z.verifyOTP(c,h),loginUser:{email:f==="email"?c:void 0,phone:f==="mobile"?c:void 0,username:c,display:c}};e(W)}catch(F){const W=F instanceof Error?F.message:"Invalid Code";y(W)}finally{d(!1)}},O=async()=>{if(!(x>0)){d(!0);try{await Z.requestOTP(c),S(30),A.toast.success("Code resent successfully!")}catch(B){const F=B instanceof Error?B.message:"Failed to resend Code";A.toast.error(F)}finally{d(!1)}}};if(!M)return i.jsx("div",{className:"flex justify-center items-center min-h-[300px]",children:"Loading..."});const L=Z.getAllowedUsernames(),_=6;return o==="verify"?i.jsxs("div",{className:"w-full",children:[i.jsxs(A.Button,{variant:"link",icon:i.jsx(Mo,{size:16}),onClick:()=>{a("request"),m(""),y(""),S(0)},className:"mb-4 flex gap-2",children:["Change ",f?.slice(0,1).toUpperCase()+f?.slice(1)," ",f==="email"?"Address":"Number"]}),i.jsx(qg,{level:4,className:"!mb-2 text-center",style:bt(M),children:"Enter Verification Code"}),i.jsxs(Wg,{className:"block text-center text-gray-500 mb-6",style:Lt(M),children:["Please enter the ",_,"-digit code sent to ",c]}),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(jg,{length:_,value:h,onChange:B=>{m(B),g&&y("")},disabled:l})}),i.jsx(A.Button,{type:"primary",block:!0,fullWidth:!0,loading:l,onClick:V,className:"mt-6",children:n||"Verify & Sign In"}),i.jsx("div",{className:"text-center mt-4",children:x>0?i.jsxs(Wg,{type:"secondary",children:["Resend Code in ",x,"s"]}):i.jsx(A.Button,{variant:"link",onClick:O,loading:l,disabled:l,children:s||"Resend Code"})})]}):i.jsxs("div",{className:"w-full",children:[t&&i.jsx(A.Button,{variant:"link",icon:i.jsx(Mo,{size:16}),onClick:t,className:"mb-4",children:"Back to login"}),i.jsx(qg,{level:4,className:"!mb-2 text-center",style:bt(M),children:"Sign in with a One-Time Pin"}),w&&i.jsx(A.Alert,{message:w,type:"error",showIcon:!1,closable:!0,onClose:()=>v(""),className:"mb-4"}),i.jsxs(A.Form,{name:"otp-request",onFinish:D,layout:"vertical",children:[L.length>1&&i.jsx(A.FormItem,{children:i.jsx(A.Segmented,{options:L.map(B=>({label:i.jsxs(A.Space,{children:[B==="email"?i.jsx(Gn,{size:16}):B==="mobile"?i.jsx(No,{size:16}):i.jsx(Lo,{size:16}),i.jsx("span",{children:B==="mobile"?"Phone":B==="email"?"Email":"Username"})]}),value:B})),value:f,onChange:B=>p(B),block:!0,className:"bg-gray-100 mb-2"})}),i.jsx(A.FormItem,{name:"username",rules:N(f),children:i.jsx(A.Input,{placeholder:P(f)})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",fullWidth:!0,disabled:l,children:r||"Send Code"})})]},T)]})},oE=({onLogin:e,showRememberMe:t=!0})=>{const[r,n]=b.useState(!1),[s,o]=b.useState(null),[a,l]=b.useState(null),[d,c]=b.useState("email"),[u,f]=b.useState(!1),[p,h]=b.useState(0),[m,g]=b.useState(!1),[y,w]=b.useState(!1),[v,x]=b.useState(""),[S,T]=b.useState(""),{authConfig:k}=ar(),{getLoginConfig:M,getMessagesConfig:P,getProvidersConfig:N,authConfig:D}=Qe(),V=D||k,O=bt(V),L=Lt(V),_=Ug(V),B=async()=>{try{return await Z.isAuthenticated()}catch{return!1}};if(b.useEffect(()=>{if(k){const U=Z.getAllowedUsernames();if(U&&U.length>0){const H=U.includes("email"),q=U.includes("mobile");H?c("email"):q&&c("mobile")}Z.isPasswordLoginEnabled()?l("password"):Z.isOTPLoginEnabled()&&l("otp")}},[k]),b.useEffect(()=>{(async()=>{const H=await B();g(H)})()},[]),!k)return i.jsx("div",{className:"flex justify-center items-center min-h-[300px]",children:i.jsx(A.Spin,{size:"large"})});const F=U=>{const H=P();return U==="email"?[{required:!0,message:H?.validation?.required||"Please enter your email address"},{type:"email",message:H?.validation?.invalidEmail||"Please enter a valid email address!"}]:U==="mobile"?[{required:!0,message:H?.validation?.required||"Please input your mobile number!"},{pattern:/^\+\d{7,15}$/,message:H?.validation?.invalidMobile||"Please enter a valid mobile number with country code (e.g., +919876543210)"}]:[{required:!0,message:H?.validation?.required||"Please enter your email address"},{type:"email",message:H?.validation?.invalidEmail||"Please enter a valid email address!"}]},W=async U=>{n(!0),o(null);try{const H=Z.getAllowedUsernames(),q=H.includes("email"),J=H.includes("mobile"),ne=q&&J?d:q?"email":"mobile",se={email:ne==="email"?U.username:void 0,phone:ne==="mobile"?U.username:void 0,password:U.password,remember_me:U.remember||!1},Pe=await e(se)}catch(H){const q=P(),J=H.message||q?.errors?.loginFailed||"Login failed. Please try again.";o(J)}finally{n(!1)}},$=async U=>{await e(U)},j=async()=>{n(!0);try{await Z.logout(),A.toast.success("Logged out successfully"),g(!1)}catch(U){A.toast.error(U.message||"Failed to logout")}finally{n(!1)}},E=async()=>{if(!v||!S){A.toast.error("Please fill in all password fields");return}if(v!==S){A.toast.error("Passwords do not match");return}if(v.length<8){A.toast.error("Password must be at least 8 characters long");return}n(!0);try{await Z.setPassword(v),A.toast.success("Password changed successfully!"),w(!1),x(""),T("")}catch(U){A.toast.error(U.message||"Failed to change password")}finally{n(!1)}},z=U=>{const H=M(),q=P();return i.jsxs(A.Form,{name:`${U}-password-login`,className:"w-full",onFinish:W,layout:"vertical",initialValues:{remember:!1},children:[s&&i.jsx(A.Alert,{message:s,type:"error",showIcon:!0,closable:!0,onClose:()=>o(null),className:"mb-4"}),i.jsx(A.FormItem,{name:"username",rules:F(U),children:i.jsx(A.Input,{placeholder:U==="email"?H?.formPlaceholders?.email||"Enter your email address":H?.formPlaceholders?.mobile||"Enter your mobile number (+919876543210)",autoComplete:U==="email"?"email":"tel",onKeyDown:U==="mobile"?J=>{const ne=["Backspace","Delete","Tab","Enter","ArrowLeft","ArrowRight"],se=J.key;!ne.includes(se)&&!J.ctrlKey&&!J.metaKey&&!/[0-9+]/.test(se)&&J.preventDefault()}:void 0})}),i.jsx(A.FormItem,{name:"password",rules:[{required:!0,message:q?.validation?.passwordRequired||"Please input your password!"},{min:k?.password_policy?.min_length||6,message:q?.validation?.passwordTooShort||`Password must be at least ${k?.password_policy?.min_length||6} characters long`}],children:i.jsx(A.PasswordInput,{placeholder:H?.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:H?.showRememberMe!==!1&&t&&Z.isRememberMeEnabled()&&i.jsx(A.FormItem,{name:"remember",valuePropName:"checked",noStyle:!0,children:i.jsx("div",{className:"auth-remember-me",style:L,children:i.jsx(A.Checkbox,{label:H?.rememberMeText||"Remember me"})})})}),i.jsx("div",{children:Z.isForgotPasswordEnabled()&&i.jsx(R.Link,{to:"forgot-password",className:"text-sm transition-colors duration-300",style:_,children:H?.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:H?.submitButtonText||"Sign in"})})]},`${U}-${p}`)},X=()=>{if(!Z.isOTPLoginEnabled())return null;const U=M();return u?i.jsx(wl,{onSuccess:$,onBack:()=>f(!1)}):i.jsx(A.Button,{variant:"secondary",fullWidth:!0,onClick:()=>f(!0),className:"bg-gray-100 border-gray-300",children:U?.otpButtonText||"Sign in with OTP"})},G=()=>{if(!k)return null;const U=Z.getAllowedUsernames(),H=U.includes("email"),q=U.includes("mobile"),J=Z.isSSOEnabled()||Z.isOIDCEnabled(),ne=Z.isPasswordLoginEnabled(),se=Z.isOTPLoginEnabled();if(!ne&&!se&&!J)return null;if(J&&!ne&&!se)return i.jsxs("div",{className:"w-full",children:[Z.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:Z.getSSOProviders().map((ve,ge)=>i.jsx(vt,{provider:ve,type:"sso"},`sso-standalone-${ge}`))})}),Z.isOIDCEnabled()&&i.jsx("div",{className:"space-y-2",children:Z.getOIDCProviders().map((ve,ge)=>i.jsx(vt,{provider:ve,type:"oidc"},`oidc-standalone-${ge}`))})]});if(se&&!ne){const ve=N();return i.jsxs("div",{className:"w-full",children:[i.jsx(wl,{onSuccess:$}),J&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:ve?.separatorText||"OR"}),Z.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:Z.getSSOProviders().map((ge,he)=>i.jsx(vt,{provider:ge,type:"sso"},`sso-otp-${he}`))})}),Z.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:Z.getOIDCProviders().map((ge,he)=>i.jsx(vt,{provider:ge,type:"oidc"},`oidc-otp-${he}`))})})]})]})}if(H&&q&&ne){const ve=M(),ge=N();return i.jsx("div",{className:"w-full",children:i.jsx(A.Tabs,{className:"login-tabs",activeKey:d,onChange:he=>{c(he),h(Me=>Me+1),o(null)},items:[{key:"email",label:i.jsxs("span",{className:"flex items-center gap-1",style:O,children:[i.jsx(Gn,{size:16}),ve?.tabLabels?.email||"Email"]}),children:i.jsxs(i.Fragment,{children:[z("email"),se&&ne&&!u&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:ge?.separatorText||"OR"}),X()]}),u&&X(),!u&&J&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:ge?.separatorText||"OR"}),Z.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:Z.getSSOProviders().map((he,Me)=>i.jsx(vt,{provider:he,type:"sso"},`sso-email-${Me}`))})}),Z.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:Z.getOIDCProviders().map((he,Me)=>i.jsx(vt,{provider:he,type:"oidc"},`oidc-email-${Me}`))})})]})]})},{key:"mobile",label:i.jsxs("span",{className:"flex items-center gap-1",style:O,children:[i.jsx(No,{size:16}),ve?.tabLabels?.mobile||"Mobile"]}),children:i.jsxs(i.Fragment,{children:[z("mobile"),se&&ne&&!u&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),X()]}),u&&X(),!u&&J&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),Z.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:Z.getSSOProviders().map((he,Me)=>i.jsx(vt,{provider:he,type:"sso"},`sso-mobile-${Me}`))})}),Z.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:Z.getOIDCProviders().map((he,Me)=>i.jsx(vt,{provider:he,type:"oidc",onClick:()=>{}},`oidc-${Me}`))})})]})]})}]})})}else{const ve=H?"email":"mobile";return i.jsxs("div",{className:"w-full",children:[z(ve),se&&ne&&!u&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),X()]}),u&&X(),!u&&J&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),Z.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:Z.getSSOProviders().map((ge,he)=>i.jsx(vt,{provider:ge,type:"sso"},`sso-single-${he}`))})}),Z.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:Z.getOIDCProviders().map((ge,he)=>i.jsx(vt,{provider:ge,type:"oidc"},`oidc-single-${he}`))})})]})]})}};return k?m?i.jsx("div",{className:"w-full",children:y?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:v,onChange:U=>x(U.target.value),placeholder:"Enter new password",disabled:r})}),i.jsx(A.FormItem,{label:"Confirm Password",children:i.jsx(A.PasswordInput,{value:S,onChange:U=>T(U.target.value),placeholder:"Confirm new password",disabled:r})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(A.Button,{type:"primary",onClick:E,loading:r,className:"flex-1",children:"Change Password"}),i.jsx(A.Button,{onClick:()=>{w(!1),x(""),T("")},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:O,children:"Already Logged In"}),i.jsx("p",{className:"text-sm mt-2",style:L,children:"You are currently logged in."})]}),i.jsx(A.Button,{block:!0,onClick:()=>w(!0),children:"Change Password"}),i.jsx(A.Button,{block:!0,danger:!0,onClick:j,loading:r,children:"Logout"})]})}):G():i.jsx("div",{className:"flex justify-center items-center min-h-[300px]",children:i.jsx(A.Spin,{size:"large"})})},aE=({onLogin:e,showRememberMe:t=!0,showForgotPassword:r=!0})=>{const[n,s]=b.useState(!1),[o,a]=b.useState(0),[l,d]=b.useState("email"),{authConfig:c}=ar();b.useEffect(()=>{if(c){const w=Z.getAllowedUsernames();w&&w.length>0&&d(w[0])}},[c]);const u=async w=>{s(!0);try{if(e){const v={email:l==="email"?w.username:void 0,phone:l==="mobile"?w.username:void 0,username:w.username,password:w.password,remember_me:w.remember||!1};await e(v)}}catch(v){A.toast.error(v.message||"Login failed. Please try again.")}finally{s(!1)}},f=()=>{switch(l){case"email":return"Email address";case"mobile":return"Phone number";case"username":return"Username";default:return"Username"}},p=()=>{const w=[{required:!0,message:`Please input your ${l}!`}];switch(l){case"email":return[...w,{type:"email",message:"Please enter a valid email address!"}];case"mobile":return[...w,{pattern:/^\+?[1-9]\d{1,14}$/,message:"Please enter a valid phone number!"}];case"username":return[...w,{min:3,message:"Username must be at least 3 characters long"}];default:return w}};if(!c)return i.jsx("div",{className:"flex justify-center items-center min-h-[300px]",children:"Loading..."});const h=Z.getAllowedUsernames(),m=h.length>1,g=Z.isRememberMeEnabled(),y=Z.isForgotPasswordEnabled();return i.jsxs(A.Form,{name:"login",className:"w-full space-y-4",initialValues:{remember:!1},onFinish:u,autoComplete:"off",layout:"vertical",children:[m&&i.jsx(A.FormItem,{label:"Login with",className:"mb-4",children:i.jsx(A.Select,{value:l,onChange:d,options:h.map(w=>({value:w,label:w==="mobile"?"Phone":w.charAt(0).toUpperCase()+w.slice(1)}))})}),i.jsx(A.FormItem,{name:"username",rules:p(),children:i.jsx(A.Input,{placeholder:f(),autoComplete:l==="email"?"email":"username"})}),i.jsx(A.FormItem,{name:"password",rules:[{required:!0,message:"Please input your password!"},{min:c?.password_policy?.min_length||6,message:`Password must be at least ${c?.password_policy?.min_length||6} characters long`}],children:i.jsx(A.PasswordInput,{placeholder:"Password",autoComplete:"current-password"})}),i.jsx(A.FormItem,{children:i.jsxs(A.Space,{className:"flex justify-between items-center w-full",children:[t&&g&&i.jsx(A.FormItem,{name:"remember",valuePropName:"checked",noStyle:!0,children:i.jsx(A.Checkbox,{label:"Remember me"})}),r&&y&&i.jsx(R.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 h-10 text-base font-medium",disabled:n,fullWidth:!0,children:"Log in"})})]},o)},iE=({layout:e="column",gap:t,className:r,buttonTextPrefix:n="Continue with",buttonTextPostfix:s=""})=>{const[o,a]=b.useState(!0),[l,d]=b.useState(null),{getProvidersConfig:c,getCustomComponents:u}=Qe();if(b.useEffect(()=>{(async()=>{try{const D=await Z.getAuthConfig();d(D)}catch(D){console.error("Failed to load auth config:",D)}finally{a(!1)}})()},[]),o)return i.jsx("div",{className:"flex justify-center items-center p-4",children:i.jsx(A.Spin,{size:"small"})});if(!l)return null;const f=Z.isSSOEnabled(),p=Z.isOIDCEnabled(),h=Z.getSSOProviders(),m=Z.getOIDCProviders();if(!f&&!p||h.length===0&&m.length===0)return null;const y=u()?.ProviderButton,w=[...h.map(N=>({...N,providerType:"sso"})),...m.map(N=>({...N,providerType:"oidc"}))],x=w.length===1,k={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",P=`w-full sso-buttons-container ${(()=>{if(x)return"";switch(e){case"grid":return`grid grid-cols-1 sm:grid-cols-2 ${k}`;case"row":return`flex flex-row flex-wrap ${k}`;case"column":default:return`flex flex-col ${k}`}})()} ${r||""}`.trim();return i.jsx("div",{className:P,children:w.map((N,D)=>{const V=y||vt;return i.jsx(V,{provider:N,type:N.providerType,prefix:n,postfix:s},`${N.providerType}-${D}`)})})},xo=b.createContext(null),bl=()=>b.useContext(xo),Kg=e=>{if(e?.status===401&&e?.data?.next_step)return e.data.next_step;if(e?.next_step)return e.next_step;const t=e?.response?.data||e?.data||e;return t?.next_step?t.next_step:null},lE=({onSuccess:e,showRememberMe:t=!0,submitButtonText:r})=>{const[n,s]=b.useState(!1),[o,a]=b.useState(null),[l,d]=b.useState("email"),[c,u]=b.useState(0),[f,p]=b.useState(!1),{authConfig:h}=ar(),{getLoginConfig:m,getMessagesConfig:g,authConfig:y}=Qe(),w=bl(),v=y||h;bt(v);const x=Lt(v),S=Ug(v);if(b.useEffect(()=>{(async()=>{try{await Z.getAuthConfig();const _=Z.getAllowedUsernames();if(_&&_.length>0){const B=_.includes("email"),F=_.includes("mobile");B?d("email"):F&&d("mobile")}p(!0)}catch(_){console.error("Failed to load auth config:",_),p(!0)}})()},[]),!f)return i.jsx("div",{className:"flex justify-center items-center min-h-[200px]",children:i.jsx(A.Spin,{size:"large"})});const T=Z.getAllowedUsernames(),k=T.includes("email"),M=T.includes("mobile"),P=k&&M,N=L=>{const _=g();return L==="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)"}]},D=async L=>{s(!0),a(null);try{const _=l==="email"?{email:L.username,password:L.password}:{phone:L.username,password:L.password},F={...await Z.login(_),loginUser:{email:l==="email"?L.username:void 0,phone:l==="mobile"?L.username:void 0,username:L.username,display:L.username}},W=Kg(F);if(W&&W.is_pending){if(e){e(F);return}if(w?.onLogin){w.onLogin(F);return}console.warn("PasswordLoginForm: Multi-step auth required but no parent handler found");return}const $=F?.meta?.is_authenticated||F?.response?.meta?.is_authenticated;if((F?.status||F?.response?.status)===200&&$){if(e){e(F);return}if(w?.onLogin){w.onLogin(F);return}const E=nt(window.location.search),z=F?.redirect_url||F?.response?.data?.redirect_url,X=Se(E,z,"/app");_e(X);return}if(e){e(F);return}if(w?.onLogin){w.onLogin(F);return}console.warn("PasswordLoginForm: No onSuccess prop or LoginContext found. Authentication result not handled.")}catch(_){const B=g(),F=_?.response?.data?.message||_?.message||B?.error?.login||"Login failed. Please check your credentials and try again.";a(F)}finally{s(!1)}},V=L=>{const _=m(),B=g();return i.jsxs(A.Form,{name:`${L}-password-login`,className:"w-full",onFinish:D,layout:"vertical",initialValues:{remember:!1,username:""},children:[o&&i.jsx(A.Alert,{message:o,type:"error",showIcon:!0,closable:!0,onClose:()=>a(null),className:"mb-4"}),i.jsx(A.FormItem,{name:"username",rules:N(L),children:i.jsx(A.Input,{placeholder:L==="email"?_?.formPlaceholders?.email||"Email address":_?.formPlaceholders?.mobile||"Mobile number (+919876543210)",autoComplete:L==="email"?"email":"tel",onKeyDown:L==="mobile"?F=>{const W=["Backspace","Delete","Tab","Enter","ArrowLeft","ArrowRight"],$=F.key;!W.includes($)&&!F.ctrlKey&&!F.metaKey&&!/[0-9+]/.test($)&&F.preventDefault()}:void 0})}),i.jsx(A.FormItem,{name:"password",rules:[{required:!0,message:B?.validation?.required||"Please input your password!"},{min:h?.password_policy?.min_length||6,message:B?.validation?.passwordTooShort||`Password must be at least ${h?.password_policy?.min_length||6} characters long`}],children:i.jsx(A.PasswordInput,{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&&Z.isRememberMeEnabled()&&i.jsx(A.FormItem,{name:"remember",valuePropName:"checked",noStyle:!0,children:i.jsx("div",{className:"auth-remember-me",style:x,children:i.jsx(A.Checkbox,{label:_?.rememberMeText||"Remember me"})})})}),i.jsx("div",{children:Z.isForgotPasswordEnabled()&&i.jsx(R.Link,{to:"forgot-password",className:"text-sm transition-colors duration-300",style:S,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"})})]},`${L}-${c}`)};if(P){const L=[...k?[{key:"email",label:"Email",children:V("email")}]:[],...M?[{key:"mobile",label:"Mobile",children:V("mobile")}]:[]];return i.jsx("div",{className:"w-full",children:i.jsx(A.Tabs,{activeKey:l,onChange:_=>{d(_),u(B=>B+1),a(null)},items:L,className:"password-login-tabs"})})}return V(k?"email":"mobile")},cE=({onSuccess:e,onBack:t,submitButtonText:r,verifyButtonText:n,resendButtonText:s})=>{const o=bl(),a=l=>{const d=Kg(l);if(d&&d.is_pending){if(e){e(l);return}if(o?.onLogin){o.onLogin(l);return}console.warn("OTPLoginForm: Multi-step auth required but no parent handler found");return}const c=l?.meta?.is_authenticated||l?.response?.meta?.is_authenticated;if((l?.status||l?.response?.status)===200&&c){const f=nt(window.location.search),p=l?.redirect_url||l?.response?.data?.redirect_url,h=Se(f,p,"/app");_e(h);return}if(e){e(l);return}if(o?.onLogin){o.onLogin(l);return}console.warn("OTPLoginForm: No onSuccess prop or LoginContext found. Authentication result not handled.")};return i.jsx(wl,{onSuccess:a,onBack:t,submitButtonText:r,verifyButtonText:n,resendButtonText:s})},{Title:dE,Text:ir,Paragraph:uE}=A.Typography,vl=({reason:e="Your password has expired",onReset:t,loading:r=!1,title:n="Password Reset Required",subtitle:s="Please create a new password to continue",passwordRules:o,logo:a})=>{const[l,d]=b.useState(0),[c,u]=b.useState(!1),[f,p]=b.useState(""),[h,m]=b.useState(null),[g,y]=b.useState({minLength:8,requireUppercase:!0,requireLowercase:!0,requireNumbers:!0,requireSpecialChars:!0}),{authConfig:w,getResetPasswordConfig:v,getMessagesConfig:x}=Qe(),S=v(),T=x(),k=or(w),M=Ar(w),P=Tr(w);b.useEffect(()=>{if(o)y(o);else{const L=Z.getPasswordPolicy();y({minLength:L.min_length||8,maxLength:L.max_length,requireUppercase:L.require_uppercase||!1,requireLowercase:L.require_lowercase||!1,requireNumbers:L.require_numbers||!1,requireSpecialChars:L.require_special_chars||!1})}},[o]);const N=L=>{if(!L)return{percent:0,status:"exception"};let _=0;return L.length>=g.minLength&&(_+=20),L.length>=12&&(_+=10),g.requireUppercase&&/[A-Z]/.test(L)&&(_+=20),g.requireLowercase&&/[a-z]/.test(L)&&(_+=20),g.requireNumbers&&/\d/.test(L)&&(_+=15),g.requireSpecialChars&&/[!@#$%^&*()_+\-=\[\]{}|;:'",.<>?\/\\~`]/.test(L)&&(_+=15),_<40?{percent:_,status:"exception"}:_<70?{percent:_,status:"normal"}:{percent:_,status:"success"}},D=(L,_)=>{if(!_){const F=T?.validation?.required||"Please input your password!";return Promise.reject(new Error(F))}const B=Z.validatePassword(_);if(!B.valid){const F=T?.validation?.passwordTooShort||B.errors.join(", ");return Promise.reject(new Error(F))}return Promise.resolve()},V=async L=>{if(m(null),L.password!==L.confirmPassword){const _=T?.validation?.passwordsDoNotMatch||"Passwords do not match!";m(_);return}u(!0);try{await t({password:L.password,confirmPassword:L.confirmPassword})}catch(_){const B=_?.message||"Failed to set password. Please try again.";m(B)}finally{u(!1)}},O=N(f);return i.jsx("div",{className:"w-full max-w-lg mx-auto",children:i.jsxs(A.Card,{className:"shadow-lg rounded-lg",bordered:!1,style:k,children:[a&&i.jsx("div",{className:M.className,style:M.style,children:typeof a=="string"?i.jsx("img",{src:a,alt:w?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:P}):a}),i.jsxs("div",{className:"text-center mb-6",children:[i.jsx(dE,{level:3,className:"!mb-2",style:bt(w),children:S?.resetForm?.title||n}),i.jsx(uE,{className:"!mb-0 text-sm",type:"secondary",style:Lt(w),children:S?.resetForm?.subtitle||s})]}),i.jsx(A.Alert,{message:e,type:"warning",showIcon:!0,className:"mb-6"}),h&&i.jsx(A.Alert,{message:h,type:"error",showIcon:!0,className:"mb-6"}),i.jsxs(A.Form,{name:"password-reset-required",onFinish:V,layout:"vertical",className:"mt-6",children:[i.jsx(A.FormItem,{name:"password",label:S?.resetForm?.passwordLabel||"New Password",rules:[{validator:D}],children:i.jsx(A.PasswordInput,{prefix:i.jsx(Kn,{size:16}),placeholder:S?.resetForm?.passwordPlaceholder||"New Password",onChange:L=>p(L.target.value)})}),f&&i.jsxs("div",{className:"-mt-4 mb-4",children:[i.jsx(ir,{type:"secondary",className:"text-xs block mb-1",children:"Password Strength"}),i.jsx(A.Progress,{percent:O.percent,status:O.status,showInfo:!1,strokeWidth:4})]}),i.jsx(A.FormItem,{name:"confirmPassword",label:S?.resetForm?.confirmPasswordLabel||"Confirm Password",rules:[{required:!0,message:T?.validation?.required||"Please confirm your password!"}],children:i.jsx(A.PasswordInput,{prefix:i.jsx(Kn,{size:16}),placeholder:S?.resetForm?.confirmPasswordPlaceholder||"Confirm Password"})}),S?.resetForm?.showPasswordRequirements!==!1&&i.jsxs("div",{className:"bg-gray-50 p-4 rounded-md mb-6",children:[i.jsx(ir,{type:"secondary",className:"block font-medium mb-2",children:S?.resetForm?.passwordRequirementsText||"Password Requirements:"}),i.jsxs(A.Space,{direction:"vertical",size:"small",children:[i.jsxs(ir,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:f.length>=g.minLength?"text-green-500":"text-gray-300"}),"At least ",g.minLength," characters"]}),g.maxLength&&i.jsxs(ir,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:f.length<=g.maxLength?"text-green-500":"text-gray-300"}),"At most ",g.maxLength," characters"]}),g.requireUppercase&&i.jsxs(ir,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:/[A-Z]/.test(f)?"text-green-500":"text-gray-300"}),"One uppercase letter"]}),g.requireLowercase&&i.jsxs(ir,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:/[a-z]/.test(f)?"text-green-500":"text-gray-300"}),"One lowercase letter"]}),g.requireNumbers&&i.jsxs(ir,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:/\d/.test(f)?"text-green-500":"text-gray-300"}),"One number"]}),g.requireSpecialChars&&i.jsxs(ir,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:/[!@#$%^&*()_+\-=\[\]{}|;:'",.<>?\/\\~`]/.test(f)?"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:c||r,children:S?.resetForm?.submitButtonText||"Reset Password"})})]},l)]})})},{Title:Gg,Text:zn,Paragraph:fE}=A.Typography,hE=({size:e="default",icon:t,src:r,style:n,className:s,children:o})=>{const l=typeof e=="number"?e:{small:24,default:32,large:40}[e];return i.jsx("div",{className:`inline-flex items-center justify-center bg-blue-500 text-white rounded-full overflow-hidden ${s||""}`,style:{width:l,height:l,fontSize:l*.45,...n},children:r?i.jsx("img",{src:r,alt:"Avatar",className:"w-full h-full object-cover"}):t||o||i.jsx(Lo,{size:l*.6})})},pE=({description:e,className:t,image:r})=>i.jsxs("div",{className:`flex flex-col items-center justify-center py-8 ${t||""}`,children:[!r&&i.jsx("div",{className:"mb-4 text-gray-400",children:i.jsx("svg",{width:"64",height:"41",viewBox:"0 0 64 41",fill:"currentColor",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-gray-500",children:e})]}),mE=e=>{const t=e.toLowerCase();return t.includes("admin")?i.jsx(Ly,{size:20}):t.includes("manager")||t.includes("supervisor")?i.jsx(By,{size:20}):t.includes("security")||t.includes("compliance")?i.jsx(jl,{size:20}):i.jsx(Lo,{size:20})},xl=({user:e,roles:t,onRoleSelect:r,loading:n=!1,title:s="Choose Your Role",subtitle:o="Select the role that best matches your current responsibilities",logo:a})=>{const[l,d]=b.useState(null),[c,u]=b.useState(!1),{getRoleSelectionConfig:f,getCardConfig:p,authConfig:h}=Qe(),m=f(),g=or(h),y=Ar(h),w=Tr(h),v=async()=>{if(l){u(!0);try{await r(l)}catch(k){console.error("Role selection failed:",k)}finally{u(!1)}}};if(n)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(!t||t.length===0){const k=m?.customEmptyState;return k?i.jsx(k,{}):i.jsx("div",{className:"max-w-lg mx-auto p-5",children:i.jsx("div",{style:g,children:i.jsx(pE,{className:"text-center py-12 px-5 text-gray-500",description:i.jsxs("div",{children:[i.jsx(zn,{className:"text-gray-600 text-base block mb-2",children:m?.emptyStateMessage||"No roles available"}),i.jsx(zn,{type:"secondary",className:"text-sm",children:"Please contact your administrator for role assignment"})]})})})})}const x=b.isValidElement(m?.title)?m.title:m?.title||s,S=b.isValidElement(m?.subtitle)?m.subtitle:m?.subtitle||o,T=m?.gridColumns||(t.length<=2?2:3);return i.jsx("div",{className:"max-w-lg mx-auto p-5",children:i.jsxs("div",{style:g,children:[a&&i.jsx("div",{className:y.className,style:y.style,children:typeof a=="string"?i.jsx("img",{src:a,alt:h?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:w}):a}),i.jsxs("div",{className:"text-center mb-8",children:[b.isValidElement(x)?x:i.jsx(Gg,{level:3,className:"!mb-3 !text-2xl !font-semibold !text-gray-800",style:bt(h),children:x}),b.isValidElement(S)?S:i.jsx(fE,{className:"!mb-6 text-base text-gray-600 !leading-relaxed",style:Lt(h),children:S}),e&&i.jsxs("div",{className:"inline-flex items-center gap-3 px-4 py-3 bg-gray-50 rounded-xl border border-gray-200",children:[i.jsx(hE,{size:"default",className:"bg-blue-500",children:(e.name||e.username||"U").split(" ").map(k=>k[0]).join("").toUpperCase().slice(0,2)}),i.jsxs("div",{className:"text-left",children:[i.jsx(zn,{strong:!0,className:"text-sm block text-gray-800",children:e.name||e.username||"User"}),e.email&&i.jsx(zn,{type:"secondary",className:"text-xs",children:e.email})]})]})]}),i.jsx("div",{className:"mb-8",children:i.jsx("div",{className:"max-h-96 overflow-y-auto px-2 py-2",style:{maxHeight:m?.maxHeight||"24rem"},children:i.jsx("div",{className:`grid gap-4 ${T===3?"grid-cols-3":"grid-cols-2"}`,children:t.map(k=>{const M=m?.customRoleCard;if(M)return i.jsx(M,{role:k,selected:l?.id===k.id,onSelect:()=>d(k)},k.id);const P=m?.roleCardStyling||{},N=l?.id===k.id;return i.jsxs("div",{role:"button",tabIndex:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),d(k))},className:"cursor-pointer transition-all duration-300 border relative p-4 hover:-translate-y-1 flex flex-col items-center h-32 min-h-[8rem]",style:{backgroundColor:N?P.selectedColor||"#e6f7ff":P.backgroundColor||"#ffffff",borderColor:N?P.selectedColor||"#1890ff":"#d9d9d9",borderRadius:P.borderRadius||"16px",...m?.roleCardStyling},onClick:()=>d(k),children:[l?.id===k.id&&i.jsx("div",{className:"absolute -top-2 -right-2 bg-brand-500 rounded-full p-2",children:i.jsx(Ht,{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:mE(k.name)})}),i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-1",children:[i.jsx(Gg,{level:5,className:"!mb-0 !text-sm !font-semibold !text-gray-900 !leading-tight !line-clamp-2 !text-center",title:k.name,children:k.name}),k.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:m?.recommendedBadgeText||"Recommended"})})]})]},k.id)})})})}),i.jsxs("div",{className:"pt-4 border-t border-gray-200",children:[i.jsx(A.Button,{type:"primary",block:!0,onClick:v,disabled:!l||c,loading:c,icon:l?i.jsx(Ht,{size:16}):null,className:"w-full",children:l?m?.continueButtonText?.replace("{roleName}",l.name)||`Continue as ${l.name}`:"Please select a role to continue"}),l?.is_default&&i.jsx(zn,{type:"secondary",className:"block text-center mt-3 text-sm",children:"This is your recommended role based on your permissions"})]})]})})},{Title:gE,Text:Cl,Paragraph:yE}=A.Typography,Xg=({user:e,availableMethods:t=["email","sms"],onVerify:r,loading:n=!1,otpDigits:s=6,retryInterval:o=30,title:a="Two-Factor Authentication",subtitle:l="For your security, please verify your identity",logo:d})=>{const[c,u]=b.useState(t[0]||"email"),[f,p]=b.useState(""),[h,m]=b.useState(0),[g,y]=b.useState(!1),[w,v]=b.useState(!1),{authConfig:x,getTwoFactorConfig:S,getMessagesConfig:T}=Qe(),k=S(),M=T(),P=or(x),N=Ar(x),D=Tr(x);b.useEffect(()=>{if(h>0){const W=setTimeout(()=>m(h-1),1e3);return()=>clearTimeout(W)}},[h]);const V=W=>W==="sms"?k?.methodLabels?.sms||"SMS":W==="email"?k?.methodLabels?.email||"Email":k?.methodLabels?.mobile||"Authenticator App",O=W=>{if(W==="email"&&e?.email){const[$,j]=e.email.split("@");return $.length<=3?`${$[0]}****@${j}`:`${$.substring(0,3)+"****"+$.substring($.length-1)}@${j}`}return(W==="sms"||W==="mobile")&&e?.mobile?`****${e.mobile.substring(e.mobile.length-4)}`:W==="totp"?"your authenticator app":W==="email"?"your email":W==="sms"?"your mobile":"your authenticator app"},L=async()=>{y(!0);try{await Z.sendTwoFactorCode(c),v(!0),m(k?.resendCountdown||o);const W=M?.success?.otpSent||`OTP sent to ${O(c)}`;A.toast.success(W)}catch(W){const $=M?.errors?.networkError||W.message||"Failed to Request OTP";A.toast.error($)}finally{y(!1)}},_=async()=>{const W=k?.codeLength||s;if(f.length!==W){const $=M?.validation?.required||`Please enter ${W} digit OTP`;A.toast.error($);return}y(!0);try{const $=await Z.verifyTwoFactorCode(f);await r($)}catch($){const j=M?.errors?.invalidOTP||$.message||"Invalid OTP";A.toast.error(j),p("")}finally{y(!1)}},B=async()=>{h>0||await L()},F=()=>{if(t.length<=1)return null;const W=t.map($=>({label:i.jsxs(A.Space,{children:[$==="email"?i.jsx(Gn,{size:16}):$==="sms"?i.jsx(No,{size:16}):i.jsx(jl,{size:16}),i.jsx("span",{children:$==="email"?k?.methodLabels?.email||"Email":$==="sms"?k?.methodLabels?.sms||"SMS":k?.methodLabels?.mobile||"Authenticator"})]}),value:$}));return i.jsxs("div",{className:"mb-6",children:[i.jsx(Cl,{type:"secondary",className:"block mb-2 text-xs",children:"Verification Method"}),i.jsx(A.Segmented,{options:W,value:c,onChange:$=>{u($),v(!1),p("")},block:!0})]})};return i.jsx("div",{className:"w-full max-w-lg mx-auto",children:i.jsxs(A.Card,{className:"shadow-lg rounded-lg",bordered:!1,style:P,children:[d&&i.jsx("div",{className:N.className,style:N.style,children:typeof d=="string"?i.jsx("img",{src:d,alt:x?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:D}):d}),i.jsxs("div",{className:"text-center mb-8",children:[i.jsx(gE,{level:3,className:"!mb-2",style:bt(x),children:k?.title||a}),i.jsx(yE,{className:"!mb-0 text-sm",type:"secondary",style:Lt(x),children:k?.subtitle||l})]}),i.jsxs("div",{className:"mt-6",children:[F(),w?i.jsxs("div",{className:"mt-6",children:[i.jsx(Cl,{className:"block text-center mb-6 text-gray-700",children:k?.instructionText||`Enter the ${k?.codeLength||s}-digit code sent via ${V(c)} to ${O(c)}`}),i.jsx("div",{className:"flex justify-center mb-6",children:i.jsx(jg,{length:k?.codeLength||s,value:f,onChange:p,disabled:g})}),i.jsx(A.Button,{variant:"primary",fullWidth:!0,disabled:g,onClick:_,className:"mb-4",children:k?.submitButtonText||"Verify"}),i.jsx("div",{className:"text-center",children:h>0?i.jsxs(Cl,{type:"secondary",children:["Resend code in ",h,"s"]}):i.jsx(A.Button,{variant:"link",onClick:B,disabled:g,children:k?.resendButtonText||"Resend Code"})})]}):i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Alert,{message:k?.sendInstructionText||`We'll send a verification code via ${V(c)} to ${O(c)}`,type:"info",showIcon:!0,className:"mb-6"}),i.jsx(A.Button,{variant:"primary",fullWidth:!0,disabled:g,onClick:L,children:k?.sendButtonText||`Send Code via ${V(c)}`})]})]})]})})},{Content:wE}=A.Layout,Yg=({logo:e,title:t="Processing Authentication",subtitle:r="Please wait while we complete your login",onAuthComplete:n,roleSelectionTitle:s="Select Your Role",roleSelectionSubtitle:o="Choose a role to continue",twoFactorTitle:a="Two-Factor Authentication",twoFactorSubtitle:l="Please enter your verification code",passwordResetTitle:d="Reset Password",passwordResetSubtitle:c="Please enter your new password"})=>{const[u]=R.useSearchParams(),{authConfig:f}=Qe(),[p,h]=b.useState(!0),[m,g]=b.useState(null),[y,w]=b.useState(null),[v,x]=b.useState(null),[S,T]=b.useState(!1),[k,M]=b.useState(null),P=u.get("next");b.useEffect(()=>{N()},[]);const N=async()=>{try{h(!0),g(null),sessionStorage.setItem("saml_auth_in_progress","true");const _=u.get("token"),B=u.get("request_id");if(!_||!B)throw new Error("Missing required SAML parameters (token or request_id)");if(!window.location.pathname.startsWith("/app/login")){h(!1),sessionStorage.removeItem("saml_auth_in_progress");return}const W=await Z.getSAMLAuthMeta(_,B);if(W?.code==="user_not_found"){sessionStorage.setItem("saml_error",JSON.stringify({message:W.message||"User does not exist",timestamp:Date.now()})),sessionStorage.removeItem("saml_auth_in_progress"),_e("/app/login");return}if(W?.status===401&&W?.data?.next_step){if(W.data.next_step.is_pending){let j=u.get("email")||u.get("user_email")||null,E=u.get("name")||u.get("user_name")||j;!j&&W?.data?.user&&(j=W.data.user.email||W.data.user.username,E=W.data.user.name||j);const X={...W,loginUser:{email:j,username:E||j||"SAML User",display:E||j||"SAML User"}};M(X),T(!0),h(!1);return}w(W.data),x(W.data.next_step.id),h(!1);return}if(W?.roles&&W.roles.length>1){const $={status:401,data:{next_step:{id:"role_selection",is_pending:!0,metadata:{roles:W.roles}}},loginUser:{email:u.get("email")||u.get("user_email")||"SAML User",username:u.get("name")||u.get("user_name")||"SAML User",display:u.get("name")||u.get("user_name")||"SAML User"}};M($),T(!0),h(!1);return}if(n)console.log("SAML callback complete, calling onAuthComplete:",W),sessionStorage.removeItem("saml_auth_in_progress"),n(W);else{console.log("SAML callback complete, redirecting to:",W?.redirect_url||"/app");const $=zt(),j=Se($,W?.redirect_url,"/app");sessionStorage.removeItem("saml_auth_in_progress"),_e(j)}}catch(_){console.error("SAML callback error:",_),g(_ instanceof Error?_.message:"Failed to process SAML authentication"),h(!1),sessionStorage.removeItem("saml_auth_in_progress")}},D=async _=>{try{if(_?.status===401&&_?.data?.next_step){w(_.data),x(_.data.next_step);return}if(n)sessionStorage.removeItem("saml_auth_in_progress"),n(_);else{const B=zt(),F=Se(B,_?.redirect_url,"/app");sessionStorage.removeItem("saml_auth_in_progress"),_e(F)}}catch(B){console.error("Two-factor completion error:",B),A.toast.error(B instanceof Error?B.message:"Failed to complete two-factor authentication"),sessionStorage.removeItem("saml_auth_in_progress")}},V=async _=>{try{if(_?.status===401&&_?.data?.next_step){w(_.data),x(_.data.next_step);return}if(n)sessionStorage.removeItem("saml_auth_in_progress"),n(_);else{const B=zt(),F=Se(B,_?.redirect_url,"/app");sessionStorage.removeItem("saml_auth_in_progress"),_e(F)}}catch(B){console.error("Password reset completion error:",B),A.toast.error(B instanceof Error?B.message:"Failed to complete password reset"),sessionStorage.removeItem("saml_auth_in_progress")}},O=()=>{if(p)return i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[300px] 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(v){case"2fa_required":return i.jsx(Xg,{user:y?.user,onVerify:D,title:a,subtitle:l,logo:e});case"password_reset_required":return i.jsx(vl,{onReset:V,title:d,subtitle:c,reason:y?.metadata?.reason,logo:e});default:return 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-[150px] 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: ${v}`,type:"warning",showIcon:!0})]})}},L=()=>p||m||!v;return S&&k?i.jsx(rn,{initialAuthState:k,onAuthComplete:_=>{const B=zt(),F=Se(B,_?.redirect_url,"/app");sessionStorage.removeItem("saml_auth_in_progress"),window.location.href=F},skipLoginStep:!0,logo:e,roleSelectionTitle:s,roleSelectionSubtitle:o,twoFactorTitle:a,twoFactorSubtitle:l,passwordResetTitle:d,passwordResetSubtitle:c,initialNextParam:P}):i.jsx(A.Layout,{className:"min-h-screen",style:wt(f),children:i.jsx(wE,{className:"flex justify-center items-center min-h-screen p-5",children:L()?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-[150px] 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})}),O()]}):O()})})},bE=({onLogin:e,logo:t,title:r,subtitle:n,apiConfig:s={},useDynamicConfig:o=!0,staticConfig:a=null})=>{const[l,d]=R.useSearchParams();R.useNavigate();const[c,u]=b.useState(null),[f,p]=b.useState(o),[h,m]=b.useState(null),g=b.useRef(!1),y=l.get("token"),w=l.get("request_id");l.get("next");const v=!!(y&&w);b.useLayoutEffect(()=>{if(g.current)return;const F=sessionStorage.getItem("saml_error");if(F){g.current=!0,sessionStorage.removeItem("saml_error");try{const W=JSON.parse(F);A.toast.error(W.message,{duration:5e3})}catch(W){console.error("Failed to parse SAML error:",W)}}},[]);const{authConfig:x,getCustomComponents:S}=Qe(),T=S(),k=or(x),M=wt(x),P=bt(x),N=Lt(x),D=Ar(x),V=Tr(x),O=T?.LoginPage,L=T?.LoginCard;if(b.useEffect(()=>{o&&!a?_():a&&(u(a),p(!1))},[o,a]),v)return i.jsx(Yg,{logo:t,title:r||"Processing Authentication",subtitle:n||"Please wait while we complete your login",onAuthComplete:F=>{const W=F?.redirect_url||"/app";try{const $=new URL(W,window.location.origin);$.searchParams.delete("token"),$.searchParams.delete("request_id");const j=$.pathname+($.search?$.search:"");_e(j)}catch{_e(W)}},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 _=async()=>{try{const F=await Z.getAuthConfig();u(F),m(null)}catch(F){console.error("Failed to fetch login methods:",F),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}}),m(null),console.warn("Using default auth configuration due to config fetch failure")}finally{p(!1)}},B=()=>f?i.jsx("div",{className:"flex justify-center items-center min-h-[300px]",children:i.jsx(A.Spin,{size:"large",tip:"Loading login methods..."})}):h?i.jsx(A.Alert,{message:"Error",description:h,type:"error",showIcon:!0,action:i.jsx("a",{onClick:_,children:"Retry"})}):c&&o?i.jsx(oE,{onLogin:e}):i.jsx(aE,{onLogin:e});return O&&!y&&!w?i.jsx(O,{}):L?i.jsx(xo.Provider,{value:{onLogin:e||(()=>{})},children:i.jsx(A.Layout,{className:"min-h-screen",style:M,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:k,children:i.jsx(L,{})})})})}):i.jsx(A.Layout,{className:"min-h-screen",style:M,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:k,children:[t&&i.jsx("div",{className:D.className,style:D.style,children:typeof t=="string"?i.jsx("img",{src:t,alt:x?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:V}):t}),i.jsxs("div",{className:"text-center mb-[18px]",children:[i.jsx("h1",{className:"text-3xl font-semibold mb-2",style:P,children:r||"Welcome Back"}),n&&i.jsx("p",{className:"text-base",style:N,children:n})]}),B()]})})})},{Content:vE}=A.Layout,xE=({logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:s=!0,staticConfig:o=null,onLoginSuccess:a,roleSelectionTitle:l,roleSelectionSubtitle:d,initialAuthResult:c=null})=>{const{pendingAuth:u,availableRoles:f,selectRole:p,login:h}=ar(),[m,g]=b.useState(null);b.useEffect(()=>{c&&y(c)},[c]);const y=async v=>{g(null);try{if(v&&(v.status||v.data||v.next_step||v.response)){a&&a(v);return}const x=await h(v),S={email:v.email,username:v.username,phone:v.phone,display:v.email||v.username||v.phone};if(x.requiresRoleSelection)return;a&&a({...x,loginUser:S})}catch(x){throw g(x.message),x}},w=async v=>{try{const x=await p(v);a&&a(x)}catch(x){throw console.error("Role selection failed:",x),x}};if(u&&f){const v=wt(n||o||{});return i.jsx(A.Layout,{className:"min-h-screen",style:v,children:i.jsx(vE,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx(xl,{user:u.user,roles:f,onRoleSelect:w,title:l,subtitle:d})})})}return i.jsx(bE,{onLogin:y,logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:s,staticConfig:o})},{Content:Hn}=A.Layout,rn=({logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:s=!0,staticConfig:o=null,onAuthComplete:a,roleSelectionTitle:l,roleSelectionSubtitle:d,twoFactorTitle:c,twoFactorSubtitle:u,passwordResetTitle:f,passwordResetSubtitle:p,initialAuthState:h=null,initialRedirectUrl:m=null,skipLoginStep:g=!1,initialNextParam:y=null})=>{const{user:w,pendingAuth:v}=ar(),{authConfig:x}=Qe();Ar(x),Tr(x);const[S,T]=b.useState(()=>{if(h){let E=null;if(h?.status===401&&h?.data?E=h.data?.next_step:h?.response?.status===401&&h?.response?.data?E=h.response.data?.next_step:h?.next_step?E=h.next_step:E=(h?.response?.data||h?.data||h)?.next_step,E&&E.is_pending)switch(E.id){case"role_selection":return"roleSelection";case"mfa_authenticate":return"twoFactor";case"set_password":case"password_expiry":case"first_login":return"passwordReset"}if(h.roles&&h.roles.length>1)return"roleSelection";if(h.requires2FA)return"twoFactor";if(h.requiresPasswordReset)return"passwordReset"}return"login"}),[k,M]=b.useState(h?.token||null),[P,N]=b.useState(h?.twoFactorMethods||null),[D,V]=b.useState(h?.passwordResetReason||null),[O]=b.useState(y||null);b.useEffect(()=>{if(h&&S==="login"){let E=null;if(h?.status===401&&h?.data?E=h.data?.next_step:h?.response?.status===401&&h?.response?.data?E=h.response.data?.next_step:h?.next_step?E=h.next_step:E=(h?.response?.data||h?.data||h)?.next_step,E&&E.is_pending)switch(E.id){case"role_selection":let z=[];Array.isArray(E.metadata?.roles)?z=E.metadata.roles:typeof E.metadata?.roles=="object"&&(z=Object.entries(E.metadata.roles).map(([H,q])=>({id:H,name:q,is_default:!1})));const X=h?.loginUser,G=h?.user||h?.data?.user||X||{};_({...h,roles:z,user:G,nextStep:E,loginUser:X}),T("roleSelection");break;case"mfa_authenticate":const U=E.metadata?.method?[E.metadata.method]:E.metadata?.type?[E.metadata.type]:E.metadata?.methods||["email"];N(U),T("twoFactor");break;case"set_password":case"password_expiry":case"first_login":V(E.metadata?.reason||"Password update required"),_({...h,passwordPolicy:E.metadata?.password_policy}),T("passwordReset");break}else h.roles&&h.roles.length>1?T("roleSelection"):h.requires2FA?(N(h.twoFactorMethods||["email"]),T("twoFactor")):h.requiresPasswordReset&&(V(h.passwordResetReason||"Password reset required"),T("passwordReset"))}},[h,S]);const[L,_]=b.useState(()=>{if(h){let E=null;if(h?.status===401&&h?.data?E=h.data?.next_step:h?.response?.status===401&&h?.response?.data?E=h.response.data?.next_step:h?.next_step?E=h.next_step:E=(h?.response?.data||h?.data||h)?.next_step,E&&E.id==="role_selection"){let z=[];Array.isArray(E.metadata?.roles)?z=E.metadata.roles:typeof E.metadata?.roles=="object"?z=Object.entries(E.metadata.roles).map(([H,q])=>({id:H,name:q,is_default:!1})):console.warn("[CompleteAuthFlow] No valid roles found in metadata");const X=h?.loginUser;let G=h?.user||h?.data?.user||X||{};return{...h,roles:z,user:G,nextStep:E,loginUser:X}}}return h||null}),[B]=b.useState(m||null);b.useEffect(()=>{if(g&&S==="login"&&h&&a){const E=h?.data||h?.response?.data||h,z=h?.next_step||E?.next_step;if(z&&z.is_pending||h.roles&&h.roles.length>1)return;const X=h?.user||h?.data?.user||{},G=h?.redirect_url||h?.data?.redirect_url||h?.response?.data?.redirect_url,U=Se(O,G,"/app");a({...h,user:X,authenticated:!0,redirect_url:U})}},[g,S,h,a,O]);const F=async E=>{let z=E,X=null,G=!1,U=null;E?.status===401&&E?.data?(z=E.data,X=E.data?.next_step,U=E.status,G=E?.meta?.is_authenticated||!1):E?.next_step?(z=E,X=E.next_step,G=E?.meta?.is_authenticated||!1,U=E?.status):E?.response?(U=E.response.status,z=E.response.data,X=z?.next_step,G=E.response.meta?.is_authenticated||!1):(z=E?.response?.data||E?.data||E,X=z?.next_step,G=E?.meta?.is_authenticated||z?.meta?.is_authenticated||!1,U=E?.status||z?.status);const H=E?.loginUser;(E?.token||z?.token)&&M(E.token||z.token);let q=E?.user||z?.user||H||{};if((typeof q!="object"||q===null)&&(q={}),H&&typeof H=="object"&&(q={...q,email:q.email||H.email,username:q.username||H.username,phone:q.phone||H.phone,name:q.name||H.display}),U===200&&G){A.toast.success("Login successful!"),a&&a({...E,user:q,authenticated:!0,redirect_url:Se(O,z?.redirect_url||E?.redirect_url,"/app")});return}if(X&&X.is_pending)switch(X.id){case"role_selection":let J=[];Array.isArray(X.metadata.roles)?J=X.metadata.roles:typeof X.metadata.roles=="object"&&(J=Object.entries(X.metadata.roles).map(([Pe,ve])=>({id:Pe,name:ve,is_default:!1}))),_({...E,roles:J,user:q,nextStep:X,loginUser:H}),T("roleSelection");return;case"mfa_authenticate":M(E.token||z?.token);const ne=X.metadata?.method?[X.metadata.method]:X.metadata?.type?[X.metadata.type]:X.metadata?.methods||["email"];N(ne),_({...E,user:q,loginUser:H}),T("twoFactor");return;case"set_password":M(E.token||z?.token);const se=X.metadata?.password_policy;V(X.metadata?.reason||"Password update required"),_({...E,passwordPolicy:se,user:q,loginUser:H}),T("passwordReset");return;case"password_expiry":M(E.token||z?.token),V("Your password has expired"),_({...E,passwordPolicy:X.metadata?.password_policy,user:q,loginUser:H}),T("passwordReset");return;case"first_login":M(E.token||z?.token),V("Please set up your password for first login"),_({...E,passwordPolicy:X.metadata?.password_policy,user:q,loginUser:H}),T("passwordReset");return;case"login_by_code":M(E.token||z?.token),A.toast.info("OTP verification required"),a&&a({...E,user:q,requiresOTP:!0});return}if(E.requires2FA){M(E.token),N(E.twoFactorMethods||["email"]),_({...E,user:q,loginUser:H}),T("twoFactor");return}if(E.requiresPasswordReset){M(E.token),V(E.passwordResetReason||"Your password has expired"),_({...E,user:q,loginUser:H}),T("passwordReset");return}a&&a({...E,user:q})},W=async E=>{try{let z=E,X=null,G=!1,U=null;if(E?.status===401&&E?.data?(z=E.data,X=E.data?.next_step,U=E.status,G=E?.meta?.is_authenticated||!1):E?.response?(U=E.response.status,z=E.response.data,X=z?.next_step,G=E.response.meta?.is_authenticated||!1):(z=E?.data||E,X=z?.next_step,G=E?.meta?.is_authenticated||z?.meta?.is_authenticated||!1,U=E?.status||z?.status),U===200&&G){A.toast.success("Two-factor authentication successful!"),a&&a({...E,token:k,user:L?.user,authenticated:!0,redirect_url:Se(O,z?.redirect_url||E?.redirect_url,"/app")});return}if(X&&X.is_pending)switch(X.id){case"set_password":const H=X.metadata?.password_policy;V(X.metadata?.reason||"Password reset required"),_({...L,passwordPolicy:H}),T("passwordReset");return;default:console.warn("Unknown next step after 2FA:",X.id);break}if(E.requiresPasswordReset){V(E.passwordResetReason||"Your password has expired"),T("passwordReset");return}A.toast.success("Two-factor authentication successful!"),a&&a({...E,token:k,user:L?.user,authenticated:!0})}catch(z){throw z}},$=async E=>{try{const z=await Z.setPassword(E.password);let X=z,G=null,U=!1,H=null;if(z?.status===401&&z?.data?(X=z.data,G=z.data?.next_step,H=z.status,U=z?.meta?.is_authenticated||!1):z?.response?(H=z.response.status,X=z.response.data,G=X?.next_step,U=z.response.meta?.is_authenticated||!1):(X=z?.data||z,G=X?.next_step,U=z?.meta?.is_authenticated||X?.meta?.is_authenticated||!1,H=z?.status||X?.status),H===200&&U){A.toast.success("Password reset successful!"),a&&a({...z,token:k,user:L?.user,authenticated:!0,redirect_url:Se(O,X?.redirect_url||z?.redirect_url,"/app")});return}if(G&&G.is_pending)switch(G.id){case"login":A.toast.success("Password reset successful!"),a&&a({...z,token:k,user:L?.user,authenticated:!1,redirect_url:Se(O,X?.redirect_url||z?.redirect_url,"/app/login")});return;case"mfa_authenticate":const q=G.metadata?.method?[G.metadata.method]:G.metadata?.type?[G.metadata.type]:G.metadata?.methods||["email"];N(q),T("twoFactor");return;default:console.warn("Unknown next step after password reset:",G.id);break}A.toast.success("Password reset successful!"),a&&a({...z,token:k,user:L?.user,authenticated:!0})}catch(z){throw A.toast.error(z.message||"Failed to reset password"),z}};return(()=>{if(h&&S==="login"){let E=null;if(h?.status===401&&h?.data?E=h.data?.next_step:h?.response?.status===401&&h?.response?.data?E=h.response.data?.next_step:h?.next_step?E=h.next_step:E=(h?.response?.data||h?.data||h)?.next_step,E&&E.is_pending)return i.jsx(A.Layout,{className:"min-h-screen",style:wt(x),children:i.jsx(Hn,{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(S){case"login":return g?(console.warn("CompleteAuthFlow: in login step but skipLoginStep=true"),null):i.jsx(xE,{onLoginSuccess:F,logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:s,staticConfig:o,roleSelectionTitle:l,roleSelectionSubtitle:d});case"roleSelection":return Array.isArray(L?.roles)&&L.roles.length>0?i.jsx(A.Layout,{className:"min-h-screen",style:wt(x),children:i.jsx(Hn,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx("div",{className:"w-full",children:i.jsx(xl,{user:L?.user,roles:L?.roles||[],logo:e,onRoleSelect:async X=>{try{const G=await Z.selectRole(X.id);let U=G,H=null,q=!1,J=null;if(G?.status===401&&G?.data?(U=G.data,H=G.data?.next_step,J=G.status,q=G?.meta?.is_authenticated||!1):G?.response?(J=G.response.status,U=G.response.data,H=U?.next_step,q=G.response.meta?.is_authenticated||!1):(U=G?.data||G,H=U?.next_step,q=G?.meta?.is_authenticated||U?.meta?.is_authenticated||!1,J=G?.status||U?.status),J===200&&q){A.toast.success("Role selected successfully!"),a&&a({...G,user:{...L.user,role:X},authenticated:!0,redirect_url:Se(O,U?.redirect_url||G?.redirect_url,"/app")});return}if(H&&H.is_pending)switch(H.id){case"mfa_authenticate":const ne=H.metadata?.method?[H.metadata.method]:H.metadata?.type?[H.metadata.type]:H.metadata?.methods||["email"];N(ne),T("twoFactor");return;case"set_password":const se=H.metadata?.password_policy;V(H.metadata?.reason||"Password update required"),_({...L,passwordPolicy:se}),T("passwordReset");return;case"password_expiry":V("Your password has expired"),_({...L,passwordPolicy:H.metadata?.password_policy}),T("passwordReset");return;case"first_login":V("Please set up your password for first login"),_({...L,passwordPolicy:H.metadata?.password_policy}),T("passwordReset");return;case"login_by_code":A.toast.info("OTP verification required"),a&&a({...G,user:{...L.user,role:X},requiresOTP:!0});return;default:console.warn("Unknown next step:",H.id);break}A.toast.success("Role selected successfully!"),a&&a({...G,user:{...L.user,role:X}})}catch(G){throw A.toast.error(G.message||"Failed to select role"),G}},title:l||"Select Your Role",subtitle:d||"Choose a role to continue"})})})}):(console.error("[CompleteAuthFlow] roleSelection case but authData.roles is empty or invalid!",{authData:L,initialAuthState:h}),i.jsx(A.Layout,{className:"min-h-screen",style:wt(x),children:i.jsx(Hn,{className:"flex justify-center items-center min-h-screen p-5",children: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."})]})})}));case"twoFactor":return i.jsx(A.Layout,{className:"min-h-screen",style:wt(x),children:i.jsx(Hn,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx(Xg,{user:L?.user||v?.user||w,availableMethods:P,onVerify:W,title:c,subtitle:u})})});case"passwordReset":const E=L?.passwordPolicy,z=E?{minLength:E.min_length||8,maxLength:E.max_length,requireUppercase:E.require_uppercase||!1,requireLowercase:E.require_lowercase||!1,requireNumbers:E.require_numbers||!1,requireSpecialChars:E.require_special_chars||!1}:void 0;return i.jsx(A.Layout,{className:"min-h-screen",style:wt(x),children:i.jsx(Hn,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx(vl,{reason:D||void 0,onReset:$,title:f,subtitle:p,passwordRules:z})})});default:return null}})()},CE=({onSuccess:e,onError:t,apiConfig:r={},redirectPath:n="/",title:s="Completing sign in...",errorTitle:o="Authentication Error",logo:a,roleSelectionTitle:l,roleSelectionSubtitle:d,twoFactorTitle:c,twoFactorSubtitle:u,passwordResetTitle:f,passwordResetSubtitle:p})=>{const[h,m]=b.useState(!0),[g,y]=b.useState(null),[w,v]=b.useState(!1),[x,S]=b.useState(null),[T,k]=b.useState("login"),[M,P]=b.useState({}),[N,D]=b.useState(["email"]),[V,O]=b.useState(""),[L,_]=b.useState(null),B=b.useRef(!1),F=R.useLocation(),W=R.useNavigate(),{basePath:$}=vo(),{authConfig:j}=Qe(),E=async U=>{let H=U,q=null;U?.status===401&&U?.data?(H=U.data,q=U.data?.next_step):(H=U?.response?.data||U?.data||U,q=H?.next_step);const J=U?.loginUser;let ne=U?.user||H?.user||J||{};if((typeof ne!="object"||ne===null)&&(ne={}),J&&typeof J=="object"&&(ne={...ne,email:ne.email||J.email,username:ne.username||J.username,phone:ne.phone||J.phone,name:ne.name||J.display}),q&&q.is_pending)switch(q.id){case"role_selection":let se=[];return Array.isArray(q.metadata.roles)?se=q.metadata.roles:typeof q.metadata.roles=="object"&&(se=Object.entries(q.metadata.roles).map(([ve,ge])=>({id:ve,name:ge,is_default:!1}))),P({...U,roles:se,user:ne,nextStep:q,loginUser:J}),k("roleSelection"),v(!0),m(!1),!0;case"mfa_authenticate":return D(q.metadata?.methods||["email"]),k("twoFactor"),v(!0),m(!1),!0;case"set_password":const Pe=q.metadata?.password_policy;return O(q.metadata?.reason||"Password update required"),P({...U,passwordPolicy:Pe,user:ne,loginUser:J}),k("passwordReset"),v(!0),m(!1),!0;case"password_expiry":return O("Your password has expired"),P({...U,passwordPolicy:q.metadata?.password_policy,user:ne,loginUser:J}),k("passwordReset"),v(!0),m(!1),!0;case"first_login":return O("Please set up your password for first login"),P({...U,passwordPolicy:q.metadata?.password_policy,user:ne,loginUser:J}),k("passwordReset"),v(!0),m(!1),!0;case"login_by_code":return A.toast.info("OTP verification required"),e&&e({...U,user:ne,requiresOTP:!0}),!0}return U.requires2FA?(D(U.twoFactorMethods||["email"]),P({...U,user:ne,loginUser:J}),k("twoFactor"),v(!0),m(!1),!0):U.requiresPasswordReset?(O(U.passwordResetReason||"Your password has expired"),P({...U,user:ne,loginUser:J}),k("passwordReset"),v(!0),m(!1),!0):!1};b.useEffect(()=>{B.current||z()},[]);const z=async()=>{try{B.current=!0;const U=new URLSearchParams(F.search),H=new URLSearchParams(F.hash.slice(1)),q=nt(F.search)||nt(F.hash.slice(1));_(q);const J=U.get("error")||H.get("error"),ne=U.get("error_description")||H.get("error_description");if(J)throw new Error(ne||`Authentication failed: ${J}`);const se=U.get("code"),Pe=U.get("state"),ve=U.get("scope")||"",ge=U.get("authuser"),he=U.get("hd"),Me=U.get("prompt"),nn=U.get("provider")||Pe?.split(":")[0];if(!se||!nn)throw new Error("Missing required OAuth parameters (code or provider)");const To=await Z.processOAuthCallback(nn,Pe||"",se,ve,ge||void 0,he||void 0,Me||void 0);if(await E(To))return;m(!1),setTimeout(e?()=>{e(To)}:()=>{W(n,{replace:!0})},1e3)}catch(U){console.error("OAuth callback error:",U);const H=U instanceof Error?U.message:"Authentication failed";y(H),m(!1),t&&t(U instanceof Error?U:new Error(H))}},X=()=>{W($,{replace:!0})},G=async U=>{A.toast.success("Authentication complete!");try{const H=U?.response?.data?.redirect_url||U?.data?.redirect_url||U?.redirect_url,q=zt(),J=Se(q,H,"/app"),ne=window.location.pathname,se=new URLSearchParams(window.location.search),Pe=se.get("code")!==null||se.get("token")!==null;ne.startsWith("/app/login")&&Pe&&_e(J)}catch(H){console.error("Error handling auth completion:",H)}};return w?i.jsx(rn,{logo:a,apiConfig:r,initialAuthState:x||M,onAuthComplete:G,roleSelectionTitle:l,roleSelectionSubtitle:d,twoFactorTitle:c,twoFactorSubtitle:u,passwordResetTitle:f,passwordResetSubtitle:p,redirectPath:n,initialRedirectUrl:L}):h?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: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:bt(j),children:s}),i.jsx("p",{className:"text-gray-500 text-sm mb-0",style:Lt(j),children:"Please wait while we complete your authentication..."})]})})}):g?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:i.jsx("div",{className:"text-center py-10 px-5",children:i.jsx(A.Alert,{message:o,description:g,type:"error",showIcon:!0,action:i.jsx("a",{onClick:X,children:"Return to login"})})})})}):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: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})})})})},{Content:SE}=A.Layout,PE=({logo:e,apiConfig:t,onAuthComplete:r,roleSelectionTitle:n,roleSelectionSubtitle:s,twoFactorTitle:o,twoFactorSubtitle:a,passwordResetTitle:l,passwordResetSubtitle:d,redirectPath:c="/"})=>{const[u,f]=b.useState(null),[p,h]=b.useState(!1),m=async w=>{w.requiresRoleSelection||w.requires2FA||w.requiresPasswordReset?(f(w),h(!0)):(w.token&&localStorage.setItem(t?.tokenKey||"authToken",w.token),r&&r(w))},g=w=>{console.error("OAuth callback error:",w)},y=w=>{const v={...u,...w,authMethod:"oauth",provider:u?.provider};r&&r(v)};return p&&u?i.jsx(rn,{logo:e,apiConfig:t,onAuthComplete:y,roleSelectionTitle:n,roleSelectionSubtitle:s,twoFactorTitle:o,twoFactorSubtitle:a,passwordResetTitle:l,passwordResetSubtitle:d,initialAuthState:{user:u.user,token:u.token,roles:u.roles,requires2FA:u.requires2FA,twoFactorMethods:u.twoFactorMethods,requiresPasswordReset:u.requiresPasswordReset,passwordResetReason:u.passwordResetReason}}):i.jsx(A.Layout,{className:"min-h-screen",style:wt(t||{}),children:i.jsx(SE,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx(CE,{onSuccess:m,onError:g,apiConfig:t,redirectPath:c,logo:e,roleSelectionTitle:n,roleSelectionSubtitle:s,twoFactorTitle:o,twoFactorSubtitle:a,passwordResetTitle:l,passwordResetSubtitle:d})})})},Sl=()=>ar();function Zg(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 Co(e){if(e==null)return e;if(typeof e=="string")return Zg(e);if(typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(t=>Co(t));if(typeof e=="object"){const t={};for(const[r,n]of Object.entries(e)){const s=Zg(r);t[s]=Co(n)}return t}return e}function EE(e,t){try{const r=Co(t);sessionStorage.setItem(e,JSON.stringify(r))}catch(r){console.error("[Storage] Failed to store sanitized data:",r)}}function Jg(e){try{const t=sessionStorage.getItem(e);if(!t)return null;const r=JSON.parse(t);return Co(r)}catch(t){return console.error("[Storage] Failed to retrieve data:",t),sessionStorage.removeItem(e),null}}function Qg(e){sessionStorage.removeItem(e)}const{Header:fA,Content:Pl}=A.Layout,TE=({backgroundStyle:e,mergedConfig:t,apiConfig:r})=>{R.useNavigate();const[n,s]=b.useState(!1),[o,a]=b.useState(null);b.useEffect(()=>{(async()=>{const p=new URLSearchParams(window.location.search),h=p.get("token"),m=p.get("request_id");if(h&&m){s(!0);try{const g=await Z.getSAMLAuthMeta(h,m);if(g?.code==="user_not_found"){EE("saml_error",{message:g.message||"User does not exist",timestamp:Date.now()}),_e("/app/login");return}a(g),s(!1)}catch(g){console.error("[LoginWrapper] SAML callback error:",g),A.toast.error("Failed to process SSO authentication"),s(!1)}}})()},[]);const l=Jg("pendingAuthResult");Jg("pendingAuthStep");let d=o;!d&&l&&(d=l,Qg("pendingAuthResult"),Qg("pendingAuthStep"));const c=async f=>{A.toast.success("Authentication complete!");try{const p=nt(window.location.search),h=zt(),m=p||h,g=f?.redirect_url||f?.response?.data?.redirect_url,y=Se(m,g,"/app");console.log("[LoginRouter] Redirecting to:",y),window.location.pathname.startsWith("/app/login")&&_e(y)}catch(p){console.error("[LoginRouter] Error handling auth completion:",p),_e("/app")}},u=b.useMemo(()=>{const p=new URLSearchParams(window.location.search).get("next");return p?decodeURIComponent(p):null},[]);return n?i.jsx("div",{style:{...e,minHeight:"100vh"},children:i.jsx(A.Layout,{className:"min-h-screen",style:e,children:i.jsx(Pl,{className:"flex justify-center items-center min-h-screen",children:i.jsx(A.Card,{className:"w-full max-w-md shadow-lg rounded-lg",bordered:!1,children:i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[300px] text-center",children:[i.jsx(A.Spin,{size:"large"}),i.jsx("p",{className:"mt-4 text-gray-600",children:"Processing SSO authentication..."})]})})})})}):i.jsx("div",{style:{...e,minHeight:"100vh"},children:i.jsx(rn,{onAuthComplete:c,logo:t.logo,title:t.title,subtitle:t.subtitle,apiConfig:r,useDynamicConfig:!0,roleSelectionTitle:t.roleSelectionTitle,roleSelectionSubtitle:t.roleSelectionSubtitle,twoFactorTitle:t.twoFactorTitle,twoFactorSubtitle:t.twoFactorSubtitle,passwordResetTitle:t.passwordResetTitle,passwordResetSubtitle:t.passwordResetSubtitle,initialAuthState:d,skipLoginStep:!!o,initialNextParam:u})})},AE=({authConfig:e,backgroundStyle:t,mergedConfig:r})=>{const{forgotPassword:n}=Sl();or(e);const s=async o=>{try{await n(o);const a=e?.resetPassword?.forgotPassword?.successMessage||"Reset email sent successfully!";A.toast.success(a)}catch(a){const l=e?.resetPassword?.forgotPassword?.errorMessage||(a instanceof Error?a.message:"Failed to send reset email");A.toast.error(l)}};return i.jsx(A.Layout,{style:{...t,minHeight:"100vh"},children:i.jsx(Pl,{style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"20px"},children:i.jsx(q4,{onSubmit:s,authConfig:e,logo:r.logo})})})},kE=({authConfig:e,backgroundStyle:t,mergedConfig:r,basePath:n})=>{const{resetPassword:s}=Sl(),{key:o}=R.useParams();or(e);const a=R.useNavigate();if(b.useEffect(()=>{o||a(n)},[o,a,n]),!o)return null;const l=async d=>{};return i.jsx(A.Layout,{style:{...t,minHeight:"100vh"},children:i.jsx(Pl,{style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"20px"},children:i.jsx(G4,{onSubmit:l,authConfig:e,token:o,logo:r.logo})})})},El={},Tl={},Al={"admin@example.com":{requires2FA:!0,requiresPasswordReset:!1,twoFactorMethods:["email","mobile"]},"+919876543210":{requires2FA:!0,requiresPasswordReset:!0,passwordResetReason:"Your password will expire in 7 days",twoFactorMethods:["mobile"]},"test@example.com":{requires2FA:!1,requiresPasswordReset:!0,passwordResetReason:"Password has expired"}},Wn={"admin@example.com":[{id:1,name:"Super Admin",description:"Full system access with all administrative privileges",permissions:["system.manage","users.manage","roles.manage","settings.manage"],is_default:!1},{id:2,name:"Organization Admin",description:"Manage organization settings and users",permissions:["org.manage","users.manage","reports.view"],is_default:!0},{id:3,name:"Compliance Officer",description:"Monitor compliance and security settings",permissions:["compliance.view","audit.view","reports.generate"],is_default:!1}],"+919876543210":[{id:4,name:"Team Manager",description:"Manage team members and projects",permissions:["team.manage","projects.manage","reports.view"],is_default:!0},{id:5,name:"Employee",description:"Standard employee access",permissions:["profile.edit","tasks.manage","reports.view"],is_default:!1}],default:[{id:6,name:"User",description:"Standard user access",permissions:["profile.view","profile.edit"],is_default:!0}]},Rg=e=>({loginEndpoint:"/api/auth/login",logoutEndpoint:"/api/auth/logout",verifyEndpoint:"/api/auth/verify",forgotPasswordEndpoint:"/api/auth/forgot-password",resetPasswordEndpoint:"/api/auth/reset-password",loginMethodsEndpoint:"/api/v1/login/?action=fetch_methods",otpRequestEndpoint:"/api/auth/otp/request",otpVerifyEndpoint:"/api/auth/otp/verify",apiClient:{post:async(t,r)=>{if(await new Promise(n=>setTimeout(n,1e3)),t.includes("login")){const n=r.email||r.phone||r.username;if(["admin@example.com","+919876543210","test@example.com","admin"].includes(n)&&r.password==="password"){const a=Wn[n]||Wn.default,l=Al[n]||{};return{user:{id:1,username:n,email:n.includes("@")?n:"user@example.com",mobile:n.startsWith("+")?n:"+919876543210",name:n==="admin@example.com"?"John Admin":n.startsWith("+")?"Mobile User":"Test User"},token:"mock-jwt-token-12345",roles:a,...l}}throw new Error("Invalid credentials")}if(t.includes("otp/request")){const n=r.email_or_phone||r.email||r.phone||r.username,s=Math.floor(Math.random()*9e5+1e5).toString().slice(0,6);return El[n]=s,A.toast.info(`Mock OTP sent! Check console for OTP: ${s}`),{success:!0,message:"OTP sent successfully"}}if(t.includes("otp/verify")){const n=r.email_or_phone||r.email||r.phone||r.username;if(El[n]===r.otp){delete El[n];const o=Wn[n]||Wn.default;return{user:{id:1,username:n,email:n.includes("@")?n:"user@example.com",mobile:n.startsWith("+")?n:"+919876543210",name:n.includes("@")?"OTP User":"Mobile User"},token:"mock-jwt-token-otp-12345",roles:o}}throw new Error("Invalid OTP")}if(t.includes("forgot-password"))return{message:"Reset email sent successfully"};if(t.includes("reset-password"))return{message:"Password reset successfully"};if(t.includes("role/select"))return{success:!0,...Al["admin@example.com"]||{}};if(t.includes("2fa/send")){const n=Math.floor(Math.random()*9e5+1e5).toString().slice(0,6);return Tl[r.method]=n,A.toast.info(`2FA OTP sent! Check console for OTP: ${n}`),{success:!0,message:"2FA code sent successfully"}}if(t.includes("2fa/verify")){if(Tl[r.method]===r.otp){delete Tl[r.method];const o=Al["admin@example.com"]||{};return{success:!0,requiresPasswordReset:o.requiresPasswordReset,passwordResetReason:o.passwordResetReason}}throw new Error("Invalid 2FA code")}if(t.includes("password/change"))return{success:!0,message:"Password changed successfully"};if(t.includes("oauth/callback")){const n=r.provider||"google",s={id:1,email:`user@${n}.com`,name:`${n.charAt(0).toUpperCase()+n.slice(1)} User`,username:`user@${n}.com`};return n==="google"?{user:s,token:"mock-oauth-token-12345",roles:Wn["admin@example.com"],requires2FA:!0,twoFactorMethods:["email"]}:n==="microsoft"?{user:s,token:"mock-oauth-token-12345",requiresPasswordReset:!0,passwordResetReason:"first_login"}:{user:s,token:"mock-oauth-token-12345"}}return{success:!0}},get:async t=>{if(await new Promise(r=>setTimeout(r,500)),t.includes("fetch_methods")||t.includes("config"))return{success:!0,response:{auth_config:{login_methods:{password:{enabled:!0,forgot_password_enabled:!0,allowed_usernames:["email","phone"]},otp:{enabled:!0,allowed_methods:["email","sms"]},sso:{enabled:!0,providers:[{id:1,label:"zsaml"}]},oidc:{enabled:!1}},password_policy:{min_length:8,require_numbers:!0,require_lowercase:!0,require_uppercase:!0,require_special_chars:!0,password_expiry_days:90,password_history_count:3,allow_change:!0,reset:{enabled:!0,method:["email"],expiry_hours:2}},session_policy:{remember_me_enabled:!0,remember_me_duration_days:30},two_factor_auth:{required:!0,allowed_methods:[]}}}};if(t.includes("verify")){const r=localStorage.getItem("authToken");if(r&&r.startsWith("mock-jwt-token"))return{id:1,username:"admin",email:"admin@example.com"};throw new Error("Invalid token")}return{}}}}),_E=({basePath:e="/login",apiConfig:t={},onAuthComplete:r,logo:n,title:s="Welcome Back",subtitle:o="Please sign in to your account",roleSelectionTitle:a="Select Your Role",roleSelectionSubtitle:l="Choose a role to continue",twoFactorTitle:d="Two-Factor Authentication",twoFactorSubtitle:c="Please enter your verification code",passwordResetTitle:u="Reset Password",passwordResetSubtitle:f="Please enter your new password"})=>{const{authConfig:p}=qe();R.useLocation(),R.useNavigate();const[h,m]=b.useState(null),{setBasePath:g}=vo();b.useEffect(()=>{g(e)},[e,g]),b.useEffect(()=>(p&&z4(p),()=>{H4()}),[p]);const y=b.useMemo(()=>{const S=p?.login||{},T=p?.logo||{};return{logo:T.url?i.jsx("img",{src:T.url,alt:T.alt||"Logo",style:{width:T.width||"auto",height:T.height||"auto",...T.style},className:T.className}):n,title:S.title||s,subtitle:S.subtitle||o,roleSelectionTitle:p?.roleSelection?.title||a,roleSelectionSubtitle:p?.roleSelection?.subtitle||l,twoFactorTitle:p?.twoFactor?.title||d,twoFactorSubtitle:p?.twoFactor?.subtitle||c,passwordResetTitle:p?.resetPassword?.resetForm?.title||u,passwordResetSubtitle:p?.resetPassword?.resetForm?.subtitle||f}},[p,n,s,o,a,l,d,c,u,f]),w=b.useMemo(()=>wt(p),[p]),v=S=>{m(S),r&&r(S)},x=b.useMemo(()=>Rg(),[]);return e.endsWith("/")&&e.slice(0,-1),i.jsx(Bg,{authConfig:p,children:i.jsx(Hg,{config:x,children:i.jsxs(R.Routes,{children:[i.jsx(R.Route,{path:"/",element:i.jsx(TE,{backgroundStyle:w,mergedConfig:y,apiConfig:x})}),i.jsx(R.Route,{path:"forgot-password",element:i.jsx(AE,{authConfig:p,backgroundStyle:w,mergedConfig:y})}),i.jsx(R.Route,{path:"reset-password/:key",element:i.jsx(kE,{authConfig:p,backgroundStyle:w,mergedConfig:y,basePath:e})}),i.jsx(R.Route,{path:"reset-password",element:i.jsx(R.Navigate,{to:"/app",replace:!0})}),i.jsx(R.Route,{path:"/oauth/callback",element:i.jsx("div",{style:{...w,minHeight:"100vh"},children:i.jsx(PE,{logo:y.logo,apiConfig:Rg(),onAuthComplete:S=>{(async()=>{const k=S?.redirect_url||S?.response?.data?.redirect_url,M=zt(),P=Se(M,k,"/app");_e(P)})()},roleSelectionTitle:y.roleSelectionTitle,roleSelectionSubtitle:y.roleSelectionSubtitle,twoFactorTitle:y.twoFactorTitle,twoFactorSubtitle:y.twoFactorSubtitle,passwordResetTitle:y.passwordResetTitle,passwordResetSubtitle:y.passwordResetSubtitle})})}),i.jsx(R.Route,{path:"/saml",element:i.jsx(Yg,{logo:i.jsx(Fy,{size:48,style:{color:"#1890ff"}}),onAuthComplete:S=>{const T=zt(),k=Se(T,S?.redirect_url,"/app");_e(k)},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(R.Route,{path:"/complete",element:i.jsx(rn,{authData:h,apiConfig:t,logo:n,onComplete:v,roleSelectionTitle:a,roleSelectionSubtitle:l,twoFactorTitle:d,twoFactorSubtitle:c,passwordResetTitle:u,passwordResetSubtitle:f})}),i.jsx(R.Route,{path:"*",element:i.jsx(R.Navigate,{to:"/404",replace:!0})})]})})})},So=({basePath:e="/app"})=>{const t=Fn();return i.jsx("div",{className:"page-container",children:i.jsx(_E,{basePath:e,apiConfig:t})})},ME=async(e=[])=>{const t=ZP(e),r={login:{component:So,includeBasePath:!0,standalone:!0,propsBuilder:({matchedRoutePath:s})=>({basePath:s})},custom:{component:null,includeBasePath:!1,handler:({customPages:s,customPagePath:o,location:a,matchedRoute:l})=>{const d=l||o&&{path:null,component:o},c=s[o];return c?b.createElement(c,{routeConfig:d,location:a}):b.createElement(rl,{componentName:o,routeConfig:d,location:a})}},404:{component:Dn,standalone:!0,includeBasePath:!1,propsBuilder:()=>({})},default:{component:Dn,includeBasePath:!1,standalone:!0,propsBuilder:({pageType:s})=>({message:`Unknown page type: ${s}`})}};for(const s of t){const o=JP(s);o?r[s]={component:o,includeBasePath:!0,propsBuilder:({matchedRoutePath:a})=>({basePath:a})}:console.warn(`⚠️ Failed to get component for page type: ${s}`)}t.length;const n=e.filter(s=>!t.includes(s));return n.length>0&&console.warn(`⚠️ Unconfigured page types (not in PAGE_CONFIG): ${n.join(", ")}`),r},NE=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)},ey=async e=>{const t=NE(e);return ME(t)},ty=b.createContext(void 0),qe=()=>{const e=b.useContext(ty);if(!e)throw new Error("useAppContext must be used within AppProvider");return e},ry=({children:e,config:t={},layoutConfig:r={},topbarConfig:n={},navbarConfig:s={},customComponents:o={},authConfig:a={}})=>{const l=R.useNavigate(),d=R.useLocation(),c=b.useRef(!1),[u,f]=b.useState(null),[p,h]=b.useState(!0),[m,g]=b.useState(null),[y,w]=b.useState(null),[v,x]=b.useState(null),[S,T]=b.useState(!1),[k,M]=b.useState(null),P=()=>typeof window<"u"&&window.app_initializer_endpoint?window.app_initializer_endpoint:"/app/initializer",N=t,D=N.apiConfig||{};b.useEffect(()=>{const O={colors:{primary:"#5048ed",secondary:"#6d7280",success:"#10b981",warning:"#f59e0b",error:"#f04438",gray:"#6d7280",background:"#f9fafb",text:"#252b37"}},L="default-theme-variables";let _=document.getElementById(L);_||(_=document.createElement("style"),_.id=L,document.head.appendChild(_)),_.innerHTML=`:root { ${io(O)} }`},[]),b.useEffect(()=>{const O=vr.getCachedLogo();O&&w(O.base64Data||O.url)},[]),b.useEffect(()=>((async()=>{if(window.location.pathname.startsWith("/app/login"),!c.current){c.current=!0;try{const _=await pm(),B=_.success?_.response:null;if(!_.success)throw new Error(_.response?.message||"Failed to fetch app data");if(f(B),B?.theme){const F=document.getElementById("default-theme-variables");if(F)F.innerHTML=`:root { ${io(B.theme)} }`;else{const W=document.createElement("style");W.id="default-theme-variables",W.innerHTML=`:root { ${io(B.theme)} }`,document.head.appendChild(W)}B?.app_logo&&vr.updateInBackground(B.app_logo,B.app_name,W=>{W.base64Data&&w(W.base64Data)})}}catch(_){console.error("❌ fetchAppInitData error:",_),g(_.message)}finally{h(!1),c.current=!1}}})(),()=>{}),[]),b.useEffect(()=>{if(p||!u)return;const O=d.pathname,L=d.search,_=O==="/app/configuration-error",B=O==="/app/logout",F=H=>{if(!H)return"";const q=new URLSearchParams(H);q.delete("token"),q.delete("request_id");const J=q.toString();return J?`?${J}`:""},W=F(L);if(W!==L&&!B){l(O+W,{replace:!0});return}if(B)return;const $=u.menu&&u.menu.length>0,j=u.routes&&u.routes.length>0;u.profile_info?.user_role;const E=u.is_user_anonymous,z=!u.is_user_anonymous,X=j&&u.routes.some(H=>{const q=H.path;if(O===q)return!0;if(q?.includes(":")){const J=q.replace(/:[^/]+/g,"[^/]+");if(new RegExp(`^${J}(/.*)?$`).test(O))return!0}return!!O.startsWith(q+"/")}),G=H=>{const q=F(L),J=q?`${H}${q}`:H;l(J,{replace:!0})};if(z&&!$&&!_){G("/app/configuration-error");return}const U=O==="/app/login"||O.startsWith("/app/login/");if(E&&!$&&!U){const H=new URLSearchParams(L);O!=="/app"&&O!=="/app/"&&H.set("next",O+L);const q=H.toString();l(`/app/login${q?`?${q}`:""}`,{replace:!0});return}if($&&u.menu){if(sessionStorage.getItem("saml_auth_in_progress")){sessionStorage.removeItem("saml_auth_in_progress");return}const q=u.menu[0]?.path||u.menu[0]?.uri;if(O==="/app"||O==="/app/"||!X&&!_){const ne=nt(L);if(ne&&rt(ne)){l(ne,{replace:!0});return}if(q){G(q);return}}}},[p,u,d.pathname,d.search,l]),b.useEffect(()=>{let O=!1;return(async()=>{if(!p&&u){if(u.is_user_anonymous){const{default:_}=await Promise.resolve().then(function(){return iT});if(u.routes&&u.routes.length>0)try{O||T(!0);const B=await ey(u.routes);O||(x(B),T(!1));return}catch(B){console.error("❌ Failed to create registry from routes for anonymous user:",B)}O||(x(_),T(!1));return}if(!u.routes||u.routes.length===0){O||(x({login:{component:null},custom:{component:null},404:{component:null},default:{component:null}}),T(!1));return}try{O||(T(!0),M(null));const _=await ey(u.routes);O||(x(_),T(!1))}catch(_){console.error("❌ Failed to create dynamic page registry:",_),O||(M(_.message||"Failed to create page registry"),x({login:{component:null},custom:{component:null},404:{component:null},default:{component:null}}),T(!1))}}})(),()=>{O=!0}},[u,p]);const V={appData:u,loading:p,error:m,config:N,apiConfig:D,menu:u?.menu||[],routes:u?.routes||[],profileInfo:u?.profile_info||{},appLogo:y||u?.app_logo||"",appName:u?.app_name||"Zango CRM",metadata:u?.metadata||{},theme:u?.theme||{},layoutConfig:r,topbarConfig:n,navbarConfig:s,customComponents:o,authConfig:a,sessionSecurity:u?.session_security_config||null,pageTypeRegistry:v,registryLoading:S,registryError:k,initializerEndpoint:P()};return i.jsx(ty.Provider,{value:V,children:e})},kl=()=>{const e=R.useNavigate(),{routes:t}=qe(),r=b.useCallback(s=>{if(!s)return!1;const o=s.endsWith("/")&&s!=="/"?s.slice(0,-1):s;return t.some(a=>{const l=a.path,d=l.endsWith("/")&&l!=="/"?l.slice(0,-1):l;if(d===o)return!0;if(d.includes(":")){const c=d.split("/").map(f=>f.startsWith(":")?"[^/]+":f).join("/");return new RegExp(`^${c}(/.*)?$`).test(o)}return a.exact===!1?o.startsWith(d):!1})},[t]);return{navigateTo:b.useCallback((s,o={})=>{if(s){if(s.startsWith("http://")||s.startsWith("https://")){o.newTab?window.open(s,"_blank"):window.location.href=s;return}r(s)?e(s,o):o.newTab?window.open(s,"_blank"):window.location.href=s}},[e,r]),isInternalRoute:r}},kr=b.forwardRef(({to:e,children:t,className:r,onClick:n,...s},o)=>{const{isInternalRoute:a}=kl(),l=c=>{n&&n(c)};return!(e&&(e.startsWith("http://")||e.startsWith("https://")))&&a(e)?i.jsx(R.Link,{ref:o,to:e,className:r,onClick:l,...s,children:t}):i.jsx("a",{ref:o,href:e,className:r,onClick:l,...s,children:t})});kr.displayName="SmartLink";const LE=i.jsxs("svg",{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"})]}),OE=/^[\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,Po=({item:e})=>e.icon?e.icon.includes("<svg")?i.jsx("span",{className:"navbar-icon",dangerouslySetInnerHTML:{__html:e.icon}}):OE.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:LE}),FE=({appLogo:e,appName:t,linkTo:r="/app",collapsed:n=!1})=>{if(n){const s=t?t.charAt(0).toUpperCase():"A";return i.jsx("div",{className:"navbar-logo-container frame-logo-container",children:i.jsx(kr,{to:r,style:{textDecoration:"none"},children:i.jsx("div",{className:"collapsed-logo-initial",style:{width:"32px",height:"32px",backgroundColor:"var(--color-brand-500, #5048ED)",color:"white",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",fontWeight:"bold"},children:s})})})}return i.jsx("div",{className:"navbar-logo-container frame-logo-container",children:i.jsx(Yp,{logoUrl:e,appName:t,height:"28px",linkTo:r})})};function DE(e,t){const r=e.url||e.uri,n=r?.endsWith("/")?r:`${r}/`,s=t.endsWith("/")?t:`${t}/`;return s.startsWith(n)?!0:e.children?.length?e.children.some(o=>{const a=o.url||o.uri,l=a?.endsWith("/")?a:`${a}/`;return s.startsWith(l)}):!1}const IE=({item:e,isActive:t,location:r,isDark:n})=>{const[s,o]=b.useState(t),{state:a}=Zr(),l=a==="collapsed";return b.useEffect(()=>{l&&o(!1)},[l]),l?i.jsx(Zi,{className:ue("menu-list-item menu-list-item-with-sub-menu",t&&"active"),children:i.jsxs(nP,{children:[i.jsx(sP,{asChild:!0,children:i.jsx(Ji,{isActive:t,tooltip:e.name,className:"menu-item",children:i.jsx(Po,{item:e})})}),i.jsxs(oP,{side:"right",align:"start",className:ue("min-w-[180px]",n&&"sidebar-dropdown-dark"),children:[i.jsx(iP,{children:e.name}),i.jsx(lP,{}),e.children.map(d=>{const c=d.url||d.uri,u=r.pathname===c||r.pathname===`${c}/`;return i.jsx(aP,{asChild:!0,children:i.jsx(kr,{to:c,className:u?"font-semibold":"",children:d.name})},c)})]})]})}):i.jsx(eP,{open:s,onOpenChange:o,className:"group/collapsible",children:i.jsxs(Zi,{className:ue("menu-list-item menu-list-item-with-sub-menu",t&&"active"),children:[i.jsx(tP,{asChild:!0,children:i.jsxs(Ji,{isActive:t,tooltip:e.name,className:"menu-item",children:[i.jsx(Po,{item:e}),i.jsx("span",{className:"menu-title",children:e.name}),i.jsx(Ku.div,{className:"ml-auto",animate:{rotate:s?180:0},transition:{type:"spring",stiffness:300,damping:25},children:i.jsx(Ny,{className:"h-4 w-4"})})]})}),i.jsx(k1,{initial:!1,children:s&&i.jsx(rP,{forceMount:!0,children:i.jsx(Ku.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",stiffness:300,damping:30},style:{overflow:"hidden"},children:i.jsx(JS,{className:"submenu-list",children:e.children.map(d=>{const c=d.url||d.uri,u=r.pathname===c||r.pathname===`${c}/`;return i.jsx(QS,{className:ue("submenu-list-item",u&&"active"),children:i.jsx(RS,{asChild:!0,isActive:u,children:i.jsxs(kr,{to:c,children:[i.jsx("span",{className:"submenu-arrow-slot",children:u&&i.jsx("svg",{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:d.name})]})})},c)})})})})})]})})},VE=({menuItems:e=[],isDark:t=!1})=>{const r=R.useLocation();return i.jsx(YS,{id:"wideSidebarMenu",children:e.map(n=>{const s=n.url||n.uri,o=DE(n,r.pathname);return n.children&&n.children.length>0?i.jsx(IE,{item:n,isActive:o,location:r,isDark:t},n.name):i.jsx(Zi,{className:ue("menu-list-item",o&&"active"),children:i.jsx(Ji,{asChild:!0,isActive:o,tooltip:n.name,className:"menu-item",children:i.jsxs(kr,{to:s,children:[i.jsx(Po,{item:n}),i.jsx("span",{className:"menu-title",children:n.name})]})})},n.name)})})},ny=({menuItems:e=[],appLogo:t,config:r={}})=>{const{appName:n}=qe(),{state:s}=Zr(),o=s==="collapsed",{showLogo:a=!0,showMenu:l=!0,collapsible:d=!1,customLogo:c=null,customMenuContent:u=null,customBottomContent:f=null,customNavbar:p=null,customMenu:h=null,theme:m="light",className:g="",style:y={}}=r,w=m==="dark";if(p)return p;const v=w?{"--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)"}:{};return i.jsxs(zS,{collapsible:d?"icon":"none",className:ue("navbar",w&&"sidebar-theme-dark",o&&"collapsed-sidebar",g),style:{...v,...y},children:[i.jsxs(KS,{children:[a&&(c?i.jsx("div",{className:"navbar-logo-container frame-logo-container",children:c}):i.jsx(FE,{appLogo:t,appName:n,collapsed:o})),d&&i.jsx("div",{className:o?"flex justify-center py-1":"flex justify-end px-3 pb-1",children:i.jsx(HS,{className:"navbar-toggle-btn"})})]}),i.jsxs(XS,{className:"navbar-menu-container",children:[i.jsx(Gp,{children:i.jsx(Xp,{children:l&&(h||i.jsx(VE,{menuItems:e,isDark:w}))})}),u&&i.jsx(Gp,{children:i.jsx(Xp,{children:u})})]}),f&&i.jsx(GS,{children:f}),d&&i.jsx(WS,{})]})},BE=(e=!0)=>{const[t,r]=b.useState(null),[n,s]=b.useState(!1),[o,a]=b.useState(null),[l,d]=b.useState(!1),[c,u]=b.useState(!1),f=async()=>{if(!(!e||t&&!l)){s(!0),a(null);try{const h=await mm();if(h.success&&h.response){const m=h.response.profile_data||h.response;h.response.password_policy&&!m.password_policy&&(m.password_policy=h.response.password_policy),u(h.response.should_set_password||!1),r(m),a(null)}else{const m=h.response?.message||"Failed to fetch profile data";a(m),console.error("Profile API Error:",h)}}catch(h){const m=h.message||"Network error while fetching profile";a(m),console.error("Profile fetch error:",h)}finally{s(!1),d(!0)}}},p=()=>{d(!1),f()};return b.useEffect(()=>{e&&!l&&f()},[e]),{profileData:t,loading:n,error:o,refetch:p,shouldSetPassword:c}},Ot=(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};`)},_l=e=>{const t=e+"=",r=document.cookie.split(";");for(let n=0;n<r.length;n++){let s=r[n];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return s.substring(t.length,s.length)}return null},sy=(e,t,r=null,n="/",s=null)=>{let o="";if(r){const d=new Date;d.setTime(d.getTime()+r*24*60*60*1e3),o="; expires="+d.toUTCString()}const a=window.location.protocol==="https:"?"; Secure":"";let l=`${e}=${t}${o}; path=${n}${a}; SameSite=Lax`;s&&(l+=`; domain=${s}`),document.cookie=l},oy=()=>{const e=_l("zangocookie");return e!==null&&e!==""},ay=Object.freeze({__proto__:null,deleteCookie:Ot,getCookie:_l,isAuthenticatedViaCookie:oy,setCookie:sy}),Ml=async(e={})=>{try{const t=await xm();if(t.success||t.responseStatus===401){Ot("zangocookie","/"),Ot("zangocookie","/app"),Ot("zangocookie","/app/"),Ot("zangocookie");const r=window.location.hostname;if(Ot("zangocookie","/",r),Ot("zangocookie","/app",r),r.includes(".")){const o="."+r.split(".").slice(-2).join(".");Ot("zangocookie","/",o),Ot("zangocookie","/app",o)}localStorage.removeItem("authToken"),localStorage.clear(),sessionStorage.clear();const n=rt(e.redirectUrl)?e.redirectUrl:rt(e.theme?.login_url)?e.theme.login_url:"/app/login";let s=n;if(e.preserveCurrentPath){const o=window.location.pathname+window.location.search,a=n.includes("?")?"&":"?";s=`${n}${a}next=${encodeURIComponent(o)}`}setTimeout(()=>{window.location.href=s},100)}else A.toast.error({title:"Logout Failed",description:t.response?.message||"Unable to logout. Please try again.",duration:5e3})}catch(t){console.error("Logout error:",t),A.toast.error({title:"Logout Error",description:"An error occurred while logging out. Please try again.",duration:5e3});const r=rt(e.redirectUrl)?e.redirectUrl:rt(e.theme?.login_url)?e.theme.login_url:"/app/login";let n=r;if(e.preserveCurrentPath){const s=window.location.pathname+window.location.search,o=r.includes("?")?"&":"?";n=`${r}${o}next=${encodeURIComponent(s)}`}setTimeout(()=>{window.location.href=n},100)}},iy=e=>{const t=document.createElement("div");t.style.cssText=`
|
|
244
|
+
`;r.innerHTML=n},H4=()=>{const e=document.getElementById("auth-theme-variables");e&&e.remove()},wt=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},or=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},Tr=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},W4=e=>e?.logo?.position||"center",Ar=e=>{const t=W4(e),r=e?.logo;let n="flex items-center mb-6";const s={};switch(t){case"left":n+=" justify-start";break;case"right":n+=" justify-end";break;case"center":default:n+=" justify-center";break}return r?.className&&(n+=` ${r.className}`),{className:n,style:s}},bt=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},Lt=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},Ug=e=>{const t=e?.theme;if(!t)return{};const r={};return t.linkColor&&(r.color=t.linkColor),t.fontFamily&&(r.fontFamily=t.fontFamily),r},q4=({onSubmit:e,logo:t})=>{const[r,n]=b.useState(!1),[s,o]=b.useState(null),[a,l]=b.useState(!1),[d,c]=b.useState(0),[u,f]=b.useState(["email"]),[p,h]=b.useState("email"),{basePath:m}=vo(),{authConfig:g,getResetPasswordConfig:y,getMessagesConfig:w}=Qe(),v=y(),x=w(),S=or(g),T=Ar(g),k=Tr(g);b.useEffect(()=>{(async()=>{try{await Z.getAuthConfig();const O=Z.getPasswordResetMethods();O&&O.length>0&&(f(O),h(O[0]))}catch(O){console.error("Failed to load reset configuration:",O)}})()},[]);const M=async V=>{n(!0),o(null);try{if(e){const O={email:p==="email"?V.contact:void 0,phone:p==="sms"?V.contact:void 0};await e(O)}l(!0),c(O=>O+1)}catch(O){const L=p==="email"?"email":"SMS",_=O.message||x?.errors?.networkError||`Failed to send reset ${L}. Please try again.`;o(_)}finally{n(!1)}},P=()=>p==="email"?v?.forgotPassword?.emailPlaceholder||"Email address":"Phone number",N=()=>p==="email"?[{required:!0,message:x?.validation?.required||"Please enter your email address"},{type:"email",message:x?.validation?.invalidEmail||"Please enter a valid email address!"}]:[{required:!0,message:x?.validation?.required||"Please input your phone number!"},{pattern:/^\+?[1-9]\d{1,14}$/,message:x?.validation?.invalidMobile||"Please enter a valid phone number!"}],D=()=>{const V=p==="email"?"Email":"SMS",O=p==="email"?"email":"phone";return{title:v?.forgotPassword?.successMessage||`${V} Sent!`,subTitle:`Please check your ${O} for password reset instructions.`}};if(a){const V=D();return i.jsx(A.Result,{status:"success",title:V.title,subTitle:V.subTitle,extra:[i.jsx(R.Link,{to:m,children:i.jsx(A.Button,{variant:"primary",children:v?.forgotPassword?.backToLoginText||"Back to Login"})},"login")]})}return i.jsxs("div",{className:"w-full max-w-md mx-auto",style:S,children:[i.jsx(R.Link,{to:m,className:"inline-block mb-6",children:i.jsx(A.Button,{variant:"link",size:"link",className:"flex gap-2",icon:i.jsx(Mo,{size:16}),children:v?.forgotPassword?.backToLoginText||"Back to Login"})}),t&&i.jsx("div",{className:T.className,style:T.style,children:typeof t=="string"?i.jsx("img",{src:t,alt:g?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:k}):t}),i.jsx("h2",{className:"text-2xl font-semibold mb-3",style:bt(g),children:v?.forgotPassword?.title||"Forgot Password"}),i.jsx("p",{className:"text-sm mb-6",style:Lt(g),children:v?.forgotPassword?.subtitle||v?.forgotPassword?.instructionText||`Enter your ${p==="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:M,layout:"vertical",children:[s&&i.jsx(A.Alert,{message:s,type:"error",showIcon:!0,closable:!0,onClose:()=>o(null),className:"mb-4"}),u.length>1&&i.jsx(A.FormItem,{label:"Reset method",children:i.jsx(A.Select,{value:p,onChange:V=>{h(V),c(O=>O+1)},options:u.map(V=>({value:V,label:i.jsxs(A.Space,{children:[V==="email"?i.jsx(Gn,{size:16}):i.jsx(Iy,{size:16}),V==="email"?"Email":"SMS"]})}))})}),i.jsx(A.FormItem,{name:"contact",label:p==="email"?v?.forgotPassword?.emailLabel||"Email":"Phone",rules:N(),children:i.jsx(A.Input,{placeholder:P(),autoComplete:p==="email"?"email":"tel"})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",className:"w-full h-10 text-base font-medium",disabled:r,fullWidth:!0,children:v?.forgotPassword?.submitButtonText||`Send Reset ${p==="email"?"Email":"SMS"}`})})]},d)]})};function rt(e){if(!e||typeof e!="string")return!1;const t=e.trim();return!(t.includes("\\")||!t.startsWith("/")||t.startsWith("//")||t.toLowerCase().includes("javascript:")||t.toLowerCase().includes("data:")||t.split("?")[0].includes("://")||t.startsWith("/app/login")&&(t.indexOf("?")===-1||!t.includes("step=")))}function nt(e){if(!e)return null;try{const r=new URLSearchParams(e).get("next");return r||null}catch(t){return console.error("Error parsing next parameter:",t),null}}function Se(e,t,r="/app"){return e&&rt(e)?e:t&&rt(t)?t:rt(r)?r:"/app"}const jn="sso_next_param";function $g(e){try{sessionStorage.removeItem(jn),e&&rt(e)&&sessionStorage.setItem(jn,e)}catch{}}function zt(){try{const e=sessionStorage.getItem(jn);if(sessionStorage.removeItem(jn),e&&rt(e))return e}catch{}return null}function K4(){try{sessionStorage.removeItem(jn)}catch{}}function _e(e,t="/app"){if(!e){window.location.href=t;return}const r=Se(e,null,t);r!==e&&console.warn(`[Security] Redirect URL sanitized: ${e} -> ${r}`),window.location.href=r}const G4=({onSubmit:e,token:t,logo:r})=>{const[n,s]=b.useState(!1),[o,a]=b.useState(!0),[l,d]=b.useState(!1),[c,u]=b.useState(""),[f,p]=b.useState(!1),[h,m]=b.useState(0),[g,y]=b.useState(null),{basePath:w}=vo(),{authConfig:v,getResetPasswordConfig:x,getMessagesConfig:S}=Qe(),T=x(),k=S(),M=or(v),P=Ar(v),N=Tr(v);b.useEffect(()=>{t?(async()=>{try{const L=await Z.validatePasswordResetKey(t);L?.data?.metadata?.password_policy&&y(L.data.metadata.password_policy),d(!0)}catch(L){console.error("Invalid reset key:",L),d(!1);const _=L instanceof Error?L.message:"This password reset link is invalid or has expired.";u(_)}finally{a(!1)}})():(a(!1),d(!1),u("Invalid link."))},[t]);const D=(O,L)=>{if(!L){const _=k?.validation?.required||"Please input your new password!";return Promise.reject(new Error(_))}if(g){if(g.min_length&&L.length<g.min_length)return Promise.reject(new Error(`Password must be at least ${g.min_length} characters long`))}else{const _=Z.validatePassword(L);if(!_.valid){const B=k?.validation?.passwordTooShort||_.errors.join(", ");return Promise.reject(new Error(B))}}return Promise.resolve()},V=async O=>{if(O.password!==O.confirmPassword){const L=k?.validation?.passwordsDoNotMatch||"The two passwords do not match!";A.toast.error(L);return}s(!0);try{if((await Z.confirmResetPassword({key:t,password:O.password}))?.data?.next_step?.id==="login"){A.toast.success("Password reset successful! Redirecting to login..."),setTimeout(()=>{_e("/app/login")},1500);return}p(!0),e&&await e({...O,token:t}),m(_=>_+1)}catch(L){const _=k?.errors?.networkError||(L instanceof Error?L.message:"Failed to reset password. Please try again.");A.toast.error(_)}finally{s(!1)}};return o?i.jsxs("div",{className:"w-full max-w-md mx-auto p-8 text-center",style:M,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..."})]}):l?f?i.jsx(A.Result,{status:"success",title:T?.resetForm?.successMessage||"Password Reset Successful!",subTitle:"Your password has been successfully reset. You can now login with your new password.",extra:[i.jsx(R.Link,{to:w,children:i.jsx(A.Button,{variant:"primary",children:"Go to Login"})},"login")]}):i.jsxs("div",{className:"w-full max-w-md mx-auto",style:M,children:[r&&i.jsx("div",{className:P.className,style:P.style,children:typeof r=="string"?i.jsx("img",{src:r,alt:v?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:N}):r}),i.jsx("h2",{className:"text-2xl font-semibold mb-3",style:bt(v),children:T?.resetForm?.title||"Reset Password"}),i.jsx("p",{className:"text-sm mb-6",style:Lt(v),children:T?.resetForm?.subtitle||"Please enter your new password below."}),i.jsxs(A.Form,{name:"reset-password",className:"space-y-4",onFinish:V,layout:"vertical",children:[i.jsx(A.FormItem,{name:"password",label:T?.resetForm?.passwordLabel||"New Password",rules:[{validator:D}],children:i.jsx(A.PasswordInput,{prefix:i.jsx(Kn,{size:16,className:"text-gray-400"}),placeholder:T?.resetForm?.passwordPlaceholder||"New Password",autoComplete:"new-password"})}),i.jsx(A.FormItem,{name:"confirmPassword",label:T?.resetForm?.confirmPasswordLabel||"Confirm Password",rules:[{required:!0,message:k?.validation?.required||"Please confirm your password!"}],children:i.jsx(A.PasswordInput,{prefix:i.jsx(Kn,{size:16,className:"text-gray-400"}),placeholder:T?.resetForm?.confirmPasswordPlaceholder||"Confirm Password",autoComplete:"new-password"})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",className:"w-full h-10 text-base font-medium",disabled:n,fullWidth:!0,children:T?.resetForm?.submitButtonText||"Reset Password"})})]},h)]}):i.jsx(A.Result,{status:"error",title:"Invalid Link",subTitle:c,extra:[i.jsx(R.Link,{to:w,children:i.jsx(A.Button,{variant:"primary",children:"Back to Login"})},"login")]})},jg=({length:e=6,value:t="",onChange:r,disabled:n=!1})=>{const[s,o]=b.useState(new Array(e).fill("")),a=b.useRef([]);b.useEffect(()=>{if(t){const u=t.split("").slice(0,e),f=[...new Array(e).fill("")];u.forEach((p,h)=>{f[h]=p}),o(f)}},[t,e]);const l=(u,f)=>{const p=u.value;if(isNaN(p))return;const h=[...s];h[f]=p,o(h),r&&r(h.join("")),p&&f<e-1&&a.current[f+1].focus()},d=(u,f)=>{u.key==="Backspace"&&!s[f]&&f>0&&a.current[f-1].focus()},c=u=>{u.preventDefault();const p=u.clipboardData.getData("text/plain").slice(0,e).split(""),h=[...s];p.forEach((g,y)=>{!isNaN(g)&&y<e&&(h[y]=g)}),o(h),r&&r(h.join(""));const m=h.findIndex(g=>g==="");m!==-1?a.current[m].focus():a.current[e-1].focus()};return i.jsx(A.Space,{className:"flex justify-center gap-2",size:"small",children:s.map((u,f)=>i.jsx(A.Input,{ref:p=>a.current[f]=p,type:"text",inputMode:"numeric",maxLength:1,value:u,onChange:p=>l(p.target,f),onKeyDown:p=>d(p,f),onPaste:c,"aria-label":`Digit ${f+1} of ${e}`,className:"!w-12 !h-12 text-center text-xl 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:X4,Text:wl,Paragraph:Y4}=A.Typography,zg=({user:e,availableMethods:t=["email","sms"],onVerify:r,loading:n=!1,otpDigits:s=6,retryInterval:o=30,title:a="Two-Factor Authentication",subtitle:l="For your security, please verify your identity",logo:d})=>{const[c,u]=b.useState(t[0]||"email"),[f,p]=b.useState(""),[h,m]=b.useState(0),[g,y]=b.useState(!1),[w,v]=b.useState(!1),{authConfig:x,getTwoFactorConfig:S,getMessagesConfig:T}=Qe(),k=S(),M=T(),P=or(x),N=Ar(x),D=Tr(x);b.useEffect(()=>{if(h>0){const W=setTimeout(()=>m(h-1),1e3);return()=>clearTimeout(W)}},[h]);const V=W=>W==="sms"?k?.methodLabels?.sms||"SMS":W==="email"?k?.methodLabels?.email||"Email":k?.methodLabels?.mobile||"Authenticator App",O=W=>{if(W==="email"&&e?.email){const[$,j]=e.email.split("@");return $.length<=3?`${$[0]}****@${j}`:`${$.substring(0,3)+"****"+$.substring($.length-1)}@${j}`}return(W==="sms"||W==="mobile")&&e?.mobile?`****${e.mobile.substring(e.mobile.length-4)}`:W==="totp"?"your authenticator app":W==="email"?"your email":W==="sms"?"your mobile":"your authenticator app"},L=async()=>{y(!0);try{await Z.sendTwoFactorCode(c),v(!0),m(k?.resendCountdown||o);const W=M?.success?.otpSent||`OTP sent to ${O(c)}`;A.toast.success(W)}catch(W){const $=M?.errors?.networkError||W.message||"Failed to Request OTP";A.toast.error($)}finally{y(!1)}},_=async()=>{const W=k?.codeLength||s;if(f.length!==W){const $=M?.validation?.required||`Please enter ${W} digit OTP`;A.toast.error($);return}y(!0);try{const $=await Z.verifyTwoFactorCode(f);await r($)}catch($){const j=M?.errors?.invalidOTP||$.message||"Invalid OTP";A.toast.error(j),p("")}finally{y(!1)}},B=async()=>{h>0||await L()},F=()=>{if(t.length<=1)return null;const W=t.map($=>({label:i.jsxs(A.Space,{children:[$==="email"?i.jsx(Gn,{size:16}):$==="sms"?i.jsx(No,{size:16}):i.jsx(jl,{size:16}),i.jsx("span",{children:$==="email"?k?.methodLabels?.email||"Email":$==="sms"?k?.methodLabels?.sms||"SMS":k?.methodLabels?.mobile||"Authenticator"})]}),value:$}));return i.jsxs("div",{className:"mb-6",children:[i.jsx(wl,{type:"secondary",className:"block mb-2 text-xs",children:"Verification Method"}),i.jsx(A.Segmented,{options:W,value:c,onChange:$=>{u($),v(!1),p("")},block:!0})]})};return i.jsx("div",{className:"w-full max-w-lg mx-auto",children:i.jsxs(A.Card,{className:"shadow-lg rounded-lg",bordered:!1,style:P,children:[d&&i.jsx("div",{className:N.className,style:N.style,children:typeof d=="string"?i.jsx("img",{src:d,alt:x?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:D}):d}),i.jsxs("div",{className:"text-center mb-8",children:[i.jsx(X4,{level:3,className:"!mb-2",style:bt(x),children:k?.title||a}),i.jsx(Y4,{className:"!mb-0 text-sm",type:"secondary",style:Lt(x),children:k?.subtitle||l})]}),i.jsxs("div",{className:"mt-6",children:[F(),w?i.jsxs("div",{className:"mt-6",children:[i.jsx(wl,{className:"block text-center mb-6 text-gray-700",children:k?.instructionText||`Enter the ${k?.codeLength||s}-digit code sent via ${V(c)} to ${O(c)}`}),i.jsx("div",{className:"flex justify-center mb-6",children:i.jsx(jg,{length:k?.codeLength||s,value:f,onChange:p,disabled:g})}),i.jsx(A.Button,{variant:"primary",fullWidth:!0,disabled:g,onClick:_,className:"mb-4",children:k?.submitButtonText||"Verify"}),i.jsx("div",{className:"text-center",children:h>0?i.jsxs(wl,{type:"secondary",children:["Resend code in ",h,"s"]}):i.jsx(A.Button,{variant:"link",onClick:B,disabled:g,children:k?.resendButtonText||"Resend Code"})})]}):i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Alert,{message:k?.sendInstructionText||`We'll send a verification code via ${V(c)} to ${O(c)}`,type:"info",showIcon:!0,className:"mb-6"}),i.jsx(A.Button,{variant:"primary",fullWidth:!0,disabled:g,onClick:L,children:k?.sendButtonText||`Send Code via ${V(c)}`})]})]})]})})},{Title:Z4,Text:ar,Paragraph:J4}=A.Typography,bl=({reason:e="Your password has expired",onReset:t,loading:r=!1,title:n="Password Reset Required",subtitle:s="Please create a new password to continue",passwordRules:o,logo:a})=>{const[l,d]=b.useState(0),[c,u]=b.useState(!1),[f,p]=b.useState(""),[h,m]=b.useState(null),[g,y]=b.useState({minLength:8,requireUppercase:!0,requireLowercase:!0,requireNumbers:!0,requireSpecialChars:!0}),{authConfig:w,getResetPasswordConfig:v,getMessagesConfig:x}=Qe(),S=v(),T=x(),k=or(w),M=Ar(w),P=Tr(w);b.useEffect(()=>{if(o)y(o);else{const L=Z.getPasswordPolicy();y({minLength:L.min_length||8,maxLength:L.max_length,requireUppercase:L.require_uppercase||!1,requireLowercase:L.require_lowercase||!1,requireNumbers:L.require_numbers||!1,requireSpecialChars:L.require_special_chars||!1})}},[o]);const N=L=>{if(!L)return{percent:0,status:"exception"};let _=0;return L.length>=g.minLength&&(_+=20),L.length>=12&&(_+=10),g.requireUppercase&&/[A-Z]/.test(L)&&(_+=20),g.requireLowercase&&/[a-z]/.test(L)&&(_+=20),g.requireNumbers&&/\d/.test(L)&&(_+=15),g.requireSpecialChars&&/[!@#$%^&*()_+\-=\[\]{}|;:'",.<>?\/\\~`]/.test(L)&&(_+=15),_<40?{percent:_,status:"exception"}:_<70?{percent:_,status:"normal"}:{percent:_,status:"success"}},D=(L,_)=>{if(!_){const F=T?.validation?.required||"Please input your password!";return Promise.reject(new Error(F))}const B=Z.validatePassword(_);if(!B.valid){const F=T?.validation?.passwordTooShort||B.errors.join(", ");return Promise.reject(new Error(F))}return Promise.resolve()},V=async L=>{if(m(null),L.password!==L.confirmPassword){const _=T?.validation?.passwordsDoNotMatch||"Passwords do not match!";m(_);return}u(!0);try{await t({password:L.password,confirmPassword:L.confirmPassword})}catch(_){const B=_?.message||"Failed to set password. Please try again.";m(B)}finally{u(!1)}},O=N(f);return i.jsx("div",{className:"w-full max-w-lg mx-auto",children:i.jsxs(A.Card,{className:"shadow-lg rounded-lg",bordered:!1,style:k,children:[a&&i.jsx("div",{className:M.className,style:M.style,children:typeof a=="string"?i.jsx("img",{src:a,alt:w?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:P}):a}),i.jsxs("div",{className:"text-center mb-6",children:[i.jsx(Z4,{level:3,className:"!mb-2",style:bt(w),children:S?.resetForm?.title||n}),i.jsx(J4,{className:"!mb-0 text-sm",type:"secondary",style:Lt(w),children:S?.resetForm?.subtitle||s})]}),i.jsx(A.Alert,{message:e,type:"warning",showIcon:!0,className:"mb-6"}),h&&i.jsx(A.Alert,{message:h,type:"error",showIcon:!0,className:"mb-6"}),i.jsxs(A.Form,{name:"password-reset-required",onFinish:V,layout:"vertical",className:"mt-6",children:[i.jsx(A.FormItem,{name:"password",label:S?.resetForm?.passwordLabel||"New Password",rules:[{validator:D}],children:i.jsx(A.PasswordInput,{prefix:i.jsx(Kn,{size:16}),placeholder:S?.resetForm?.passwordPlaceholder||"New Password",onChange:L=>p(L.target.value)})}),f&&i.jsxs("div",{className:"-mt-4 mb-4",children:[i.jsx(ar,{type:"secondary",className:"text-xs block mb-1",children:"Password Strength"}),i.jsx(A.Progress,{percent:O.percent,status:O.status,showInfo:!1,strokeWidth:4})]}),i.jsx(A.FormItem,{name:"confirmPassword",label:S?.resetForm?.confirmPasswordLabel||"Confirm Password",rules:[{required:!0,message:T?.validation?.required||"Please confirm your password!"}],children:i.jsx(A.PasswordInput,{prefix:i.jsx(Kn,{size:16}),placeholder:S?.resetForm?.confirmPasswordPlaceholder||"Confirm Password"})}),S?.resetForm?.showPasswordRequirements!==!1&&i.jsxs("div",{className:"bg-gray-50 p-4 rounded-md mb-6",children:[i.jsx(ar,{type:"secondary",className:"block font-medium mb-2",children:S?.resetForm?.passwordRequirementsText||"Password Requirements:"}),i.jsxs(A.Space,{direction:"vertical",size:"small",children:[i.jsxs(ar,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:f.length>=g.minLength?"text-green-500":"text-gray-300"}),"At least ",g.minLength," characters"]}),g.maxLength&&i.jsxs(ar,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:f.length<=g.maxLength?"text-green-500":"text-gray-300"}),"At most ",g.maxLength," characters"]}),g.requireUppercase&&i.jsxs(ar,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:/[A-Z]/.test(f)?"text-green-500":"text-gray-300"}),"One uppercase letter"]}),g.requireLowercase&&i.jsxs(ar,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:/[a-z]/.test(f)?"text-green-500":"text-gray-300"}),"One lowercase letter"]}),g.requireNumbers&&i.jsxs(ar,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:/\d/.test(f)?"text-green-500":"text-gray-300"}),"One number"]}),g.requireSpecialChars&&i.jsxs(ar,{type:"secondary",className:"flex items-center gap-2 text-sm",children:[i.jsx(Ht,{size:16,className:/[!@#$%^&*()_+\-=\[\]{}|;:'",.<>?\/\\~`]/.test(f)?"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:c||r,children:S?.resetForm?.submitButtonText||"Reset Password"})})]},l)]})})},{Title:Hg,Text:zn,Paragraph:Q4}=A.Typography,R4=({size:e="default",icon:t,src:r,style:n,className:s,children:o})=>{const l=typeof e=="number"?e:{small:24,default:32,large:40}[e];return i.jsx("div",{className:`inline-flex items-center justify-center bg-blue-500 text-white rounded-full overflow-hidden ${s||""}`,style:{width:l,height:l,fontSize:l*.45,...n},children:r?i.jsx("img",{src:r,alt:"Avatar",className:"w-full h-full object-cover"}):t||o||i.jsx(Lo,{size:l*.6})})},eE=({description:e,className:t,image:r})=>i.jsxs("div",{className:`flex flex-col items-center justify-center py-8 ${t||""}`,children:[!r&&i.jsx("div",{className:"mb-4 text-gray-400",children:i.jsx("svg",{width:"64",height:"41",viewBox:"0 0 64 41",fill:"currentColor",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-gray-500",children:e})]}),tE=e=>{const t=e.toLowerCase();return t.includes("admin")?i.jsx(Ly,{size:20}):t.includes("manager")||t.includes("supervisor")?i.jsx(By,{size:20}):t.includes("security")||t.includes("compliance")?i.jsx(jl,{size:20}):i.jsx(Lo,{size:20})},vl=({user:e,roles:t,onRoleSelect:r,loading:n=!1,title:s="Choose Your Role",subtitle:o="Select the role that best matches your current responsibilities",logo:a})=>{const[l,d]=b.useState(null),[c,u]=b.useState(!1),{getRoleSelectionConfig:f,getCardConfig:p,authConfig:h}=Qe(),m=f(),g=or(h),y=Ar(h),w=Tr(h),v=async()=>{if(l){u(!0);try{await r(l)}catch(k){console.error("Role selection failed:",k)}finally{u(!1)}}};if(n)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(!t||t.length===0){const k=m?.customEmptyState;return k?i.jsx(k,{}):i.jsx("div",{className:"max-w-lg mx-auto p-5",children:i.jsx("div",{style:g,children:i.jsx(eE,{className:"text-center py-12 px-5 text-gray-500",description:i.jsxs("div",{children:[i.jsx(zn,{className:"text-gray-600 text-base block mb-2",children:m?.emptyStateMessage||"No roles available"}),i.jsx(zn,{type:"secondary",className:"text-sm",children:"Please contact your administrator for role assignment"})]})})})})}const x=b.isValidElement(m?.title)?m.title:m?.title||s,S=b.isValidElement(m?.subtitle)?m.subtitle:m?.subtitle||o,T=m?.gridColumns||(t.length<=2?2:3);return i.jsx("div",{className:"max-w-lg mx-auto p-5",children:i.jsxs("div",{style:g,children:[a&&i.jsx("div",{className:y.className,style:y.style,children:typeof a=="string"?i.jsx("img",{src:a,alt:h?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:w}):a}),i.jsxs("div",{className:"text-center mb-8",children:[b.isValidElement(x)?x:i.jsx(Hg,{level:3,className:"!mb-3 !text-2xl !font-semibold !text-gray-800",style:bt(h),children:x}),b.isValidElement(S)?S:i.jsx(Q4,{className:"!mb-6 text-base text-gray-600 !leading-relaxed",style:Lt(h),children:S}),e&&i.jsxs("div",{className:"inline-flex items-center gap-3 px-4 py-3 bg-gray-50 rounded-xl border border-gray-200",children:[i.jsx(R4,{size:"default",className:"bg-blue-500",children:(e.name||e.username||"U").split(" ").map(k=>k[0]).join("").toUpperCase().slice(0,2)}),i.jsxs("div",{className:"text-left",children:[i.jsx(zn,{strong:!0,className:"text-sm block text-gray-800",children:e.name||e.username||"User"}),e.email&&i.jsx(zn,{type:"secondary",className:"text-xs",children:e.email})]})]})]}),i.jsx("div",{className:"mb-8",children:i.jsx("div",{className:"max-h-96 overflow-y-auto px-2 py-2",style:{maxHeight:m?.maxHeight||"24rem"},children:i.jsx("div",{className:`grid gap-4 ${T===3?"grid-cols-3":"grid-cols-2"}`,children:t.map(k=>{const M=m?.customRoleCard;if(M)return i.jsx(M,{role:k,selected:l?.id===k.id,onSelect:()=>d(k)},k.id);const P=m?.roleCardStyling||{},N=l?.id===k.id;return i.jsxs("div",{role:"button",tabIndex:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),d(k))},className:"cursor-pointer transition-all duration-300 border relative p-4 hover:-translate-y-1 flex flex-col items-center h-32 min-h-[8rem]",style:{backgroundColor:N?P.selectedColor||"#e6f7ff":P.backgroundColor||"#ffffff",borderColor:N?P.selectedColor||"#1890ff":"#d9d9d9",borderRadius:P.borderRadius||"16px",...m?.roleCardStyling},onClick:()=>d(k),children:[l?.id===k.id&&i.jsx("div",{className:"absolute -top-2 -right-2 bg-brand-500 rounded-full p-2",children:i.jsx(Ht,{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:tE(k.name)})}),i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-1",children:[i.jsx(Hg,{level:5,className:"!mb-0 !text-sm !font-semibold !text-gray-900 !leading-tight !line-clamp-2 !text-center",title:k.name,children:k.name}),k.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:m?.recommendedBadgeText||"Recommended"})})]})]},k.id)})})})}),i.jsxs("div",{className:"pt-4 border-t border-gray-200",children:[i.jsx(A.Button,{type:"primary",block:!0,onClick:v,disabled:!l||c,loading:c,icon:l?i.jsx(Ht,{size:16}):null,className:"w-full",children:l?m?.continueButtonText?.replace("{roleName}",l.name)||`Continue as ${l.name}`:"Please select a role to continue"}),l?.is_default&&i.jsx(zn,{type:"secondary",className:"block text-center mt-3 text-sm",children:"This is your recommended role based on your permissions"})]})]})})},Wg=b.createContext(null),ir=()=>{const e=b.useContext(Wg);if(!e)throw new Error("useAuthContext must be used within an AuthProvider");return e},qg=({children:e,config:t={}})=>{const[r,n]=b.useState(null),[s,o]=b.useState(!0),[a,l]=b.useState(null),[d,c]=b.useState(null),[u,f]=b.useState(null),[p,h]=b.useState(null),m=b.useRef(!1);b.useEffect(()=>{m.current||(m.current=!0,g())},[]);const g=async()=>{try{const M=await Z.getAuthConfig();h(M),await y()}catch(M){l(M instanceof Error?M.message:"An error occurred"),o(!1)}},y=async()=>{try{await Z.isAuthenticated()?(n({id:1,username:"authenticated_user",email:"user@example.com",authenticated:!0}),l(null)):(n(null),l(null))}catch(M){console.error("Auth check failed:",M),n(null),l(null)}finally{o(!1)}},k={user:r,loading:s,error:a,login:async M=>{o(!0),l(null);try{const P=await Z.login(M,t);let N=P,D=null;P?.status===401&&P?.data?(N=P.data,D=P.data?.next_step):(N=P?.response?.data||P?.data||P,D=N?.next_step);const V=P?.user||N?.user||{};if(V.email=V.email||M.email,V.username=V.username||M.username,V.phone=V.phone||M.phone,V.name=V.name||M.email||M.username||M.phone,c({user:V,token:P.token||N?.token,roles:P.roles,requires2FA:P.requires2FA,twoFactorMethods:P.twoFactorMethods,requiresPasswordReset:P.requiresPasswordReset,passwordResetReason:P.passwordResetReason}),D&&D.is_pending&&D.id==="role_selection")return{...P,user:V};if(D&&D.is_pending&&(D.id==="set_password"||D.id==="password_expiry"||D.id==="first_login"))return c({user:V,token:P.token||N?.token,requiresPasswordReset:!0,passwordResetReason:D.id==="password_expiry"?"Your password has expired":D.id==="first_login"?"Please set up your password for first login":D.metadata?.reason||"Password update required"}),{...P,user:V};if(P.roles&&P.roles.length>1)return f(P.roles),{requiresRoleSelection:!0,roles:P.roles,user:V,token:P.token};let O=P;return P.roles&&P.roles.length===1?O.user={...V,role:P.roles[0]}:O.user=V,P.requires2FA?{...O,requires2FA:!0,twoFactorMethods:P.twoFactorMethods||["email"]}:P.requiresPasswordReset?{...O,requiresPasswordReset:!0,passwordResetReason:P.passwordResetReason}:(n(O.user),c(null),f(null),{...O,user:V})}catch(P){console.error("AuthProvider login caught error:",P);const N=P instanceof Error?P.message:"Login failed";throw console.error("AuthProvider error.message:",N),l(N),P}finally{o(!1)}},logout:async()=>{o(!0);try{await Z.logout(t),n(null),c(null),f(null)}catch(M){console.error("Logout failed:",M)}finally{o(!1)}},selectRole:async M=>{if(!d)throw new Error("No pending authentication");o(!0);try{t.roleSelectionEndpoint&&await Z.selectRole(typeof M=="string"?M:M.id);const P={...d.user,role:M},N={...d,user:P};return N.requires2FA?(c(N),{...N,requires2FA:!0,twoFactorMethods:N.twoFactorMethods||["email"]}):N.requiresPasswordReset?(c(N),{...N,requiresPasswordReset:!0,passwordResetReason:N.passwordResetReason}):(n(P),c(null),f(null),{user:P,token:d.token})}catch(P){throw l(P instanceof Error?P.message:"An error occurred"),P}finally{o(!1)}},checkAuth:y,forgotPassword:async M=>Z.forgotPassword(M),resetPassword:async M=>Z.confirmResetPassword(M),isAuthenticated:!!r,pendingAuth:d,availableRoles:u,authConfig:p,requiresRoleSelection:!!d&&!!u};return i.jsx(Wg.Provider,{value:k,children:e})},{Content:Hn}=A.Layout,rE=b.lazy(()=>Promise.resolve().then(function(){return ME})),rn=({logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:s=!0,staticConfig:o=null,onAuthComplete:a,roleSelectionTitle:l,roleSelectionSubtitle:d,twoFactorTitle:c,twoFactorSubtitle:u,passwordResetTitle:f,passwordResetSubtitle:p,initialAuthState:h=null,initialRedirectUrl:m=null,skipLoginStep:g=!1,initialNextParam:y=null})=>{const{user:w,pendingAuth:v}=ir(),{authConfig:x}=Qe();Ar(x),Tr(x);const[S,T]=b.useState(()=>{if(h){let E=null;if(h?.status===401&&h?.data?E=h.data?.next_step:h?.response?.status===401&&h?.response?.data?E=h.response.data?.next_step:h?.next_step?E=h.next_step:E=(h?.response?.data||h?.data||h)?.next_step,E&&E.is_pending)switch(E.id){case"role_selection":return"roleSelection";case"mfa_authenticate":return"twoFactor";case"set_password":case"password_expiry":case"first_login":return"passwordReset"}if(h.roles&&h.roles.length>1)return"roleSelection";if(h.requires2FA)return"twoFactor";if(h.requiresPasswordReset)return"passwordReset"}return"login"}),[k,M]=b.useState(h?.token||null),[P,N]=b.useState(h?.twoFactorMethods||null),[D,V]=b.useState(h?.passwordResetReason||null),[O]=b.useState(y||null);b.useEffect(()=>{if(h&&S==="login"){let E=null;if(h?.status===401&&h?.data?E=h.data?.next_step:h?.response?.status===401&&h?.response?.data?E=h.response.data?.next_step:h?.next_step?E=h.next_step:E=(h?.response?.data||h?.data||h)?.next_step,E&&E.is_pending)switch(E.id){case"role_selection":let z=[];Array.isArray(E.metadata?.roles)?z=E.metadata.roles:typeof E.metadata?.roles=="object"&&(z=Object.entries(E.metadata.roles).map(([H,q])=>({id:H,name:q,is_default:!1})));const X=h?.loginUser,G=h?.user||h?.data?.user||X||{};_({...h,roles:z,user:G,nextStep:E,loginUser:X}),T("roleSelection");break;case"mfa_authenticate":const U=E.metadata?.method?[E.metadata.method]:E.metadata?.type?[E.metadata.type]:E.metadata?.methods||["email"];N(U),T("twoFactor");break;case"set_password":case"password_expiry":case"first_login":V(E.metadata?.reason||"Password update required"),_({...h,passwordPolicy:E.metadata?.password_policy}),T("passwordReset");break}else h.roles&&h.roles.length>1?T("roleSelection"):h.requires2FA?(N(h.twoFactorMethods||["email"]),T("twoFactor")):h.requiresPasswordReset&&(V(h.passwordResetReason||"Password reset required"),T("passwordReset"))}},[h,S]);const[L,_]=b.useState(()=>{if(h){let E=null;if(h?.status===401&&h?.data?E=h.data?.next_step:h?.response?.status===401&&h?.response?.data?E=h.response.data?.next_step:h?.next_step?E=h.next_step:E=(h?.response?.data||h?.data||h)?.next_step,E&&E.id==="role_selection"){let z=[];Array.isArray(E.metadata?.roles)?z=E.metadata.roles:typeof E.metadata?.roles=="object"?z=Object.entries(E.metadata.roles).map(([H,q])=>({id:H,name:q,is_default:!1})):console.warn("[CompleteAuthFlow] No valid roles found in metadata");const X=h?.loginUser;let G=h?.user||h?.data?.user||X||{};return{...h,roles:z,user:G,nextStep:E,loginUser:X}}}return h||null}),[B]=b.useState(m||null);b.useEffect(()=>{if(g&&S==="login"&&h&&a){const E=h?.data||h?.response?.data||h,z=h?.next_step||E?.next_step;if(z&&z.is_pending||h.roles&&h.roles.length>1)return;const X=h?.user||h?.data?.user||{},G=h?.redirect_url||h?.data?.redirect_url||h?.response?.data?.redirect_url,U=Se(O,G,"/app");a({...h,user:X,authenticated:!0,redirect_url:U})}},[g,S,h,a,O]);const F=async E=>{let z=E,X=null,G=!1,U=null;E?.status===401&&E?.data?(z=E.data,X=E.data?.next_step,U=E.status,G=E?.meta?.is_authenticated||!1):E?.next_step?(z=E,X=E.next_step,G=E?.meta?.is_authenticated||!1,U=E?.status):E?.response?(U=E.response.status,z=E.response.data,X=z?.next_step,G=E.response.meta?.is_authenticated||!1):(z=E?.response?.data||E?.data||E,X=z?.next_step,G=E?.meta?.is_authenticated||z?.meta?.is_authenticated||!1,U=E?.status||z?.status);const H=E?.loginUser;(E?.token||z?.token)&&M(E.token||z.token);let q=E?.user||z?.user||H||{};if((typeof q!="object"||q===null)&&(q={}),H&&typeof H=="object"&&(q={...q,email:q.email||H.email,username:q.username||H.username,phone:q.phone||H.phone,name:q.name||H.display}),U===200&&G){A.toast.success("Login successful!"),a&&a({...E,user:q,authenticated:!0,redirect_url:Se(O,z?.redirect_url||E?.redirect_url,"/app")});return}if(X&&X.is_pending)switch(X.id){case"role_selection":let J=[];Array.isArray(X.metadata.roles)?J=X.metadata.roles:typeof X.metadata.roles=="object"&&(J=Object.entries(X.metadata.roles).map(([Pe,ve])=>({id:Pe,name:ve,is_default:!1}))),_({...E,roles:J,user:q,nextStep:X,loginUser:H}),T("roleSelection");return;case"mfa_authenticate":M(E.token||z?.token);const ne=X.metadata?.method?[X.metadata.method]:X.metadata?.type?[X.metadata.type]:X.metadata?.methods||["email"];N(ne),_({...E,user:q,loginUser:H}),T("twoFactor");return;case"set_password":M(E.token||z?.token);const se=X.metadata?.password_policy;V(X.metadata?.reason||"Password update required"),_({...E,passwordPolicy:se,user:q,loginUser:H}),T("passwordReset");return;case"password_expiry":M(E.token||z?.token),V("Your password has expired"),_({...E,passwordPolicy:X.metadata?.password_policy,user:q,loginUser:H}),T("passwordReset");return;case"first_login":M(E.token||z?.token),V("Please set up your password for first login"),_({...E,passwordPolicy:X.metadata?.password_policy,user:q,loginUser:H}),T("passwordReset");return;case"login_by_code":M(E.token||z?.token),A.toast.info("OTP verification required"),a&&a({...E,user:q,requiresOTP:!0});return}if(E.requires2FA){M(E.token),N(E.twoFactorMethods||["email"]),_({...E,user:q,loginUser:H}),T("twoFactor");return}if(E.requiresPasswordReset){M(E.token),V(E.passwordResetReason||"Your password has expired"),_({...E,user:q,loginUser:H}),T("passwordReset");return}a&&a({...E,user:q})},W=async E=>{try{let z=E,X=null,G=!1,U=null;if(E?.status===401&&E?.data?(z=E.data,X=E.data?.next_step,U=E.status,G=E?.meta?.is_authenticated||!1):E?.response?(U=E.response.status,z=E.response.data,X=z?.next_step,G=E.response.meta?.is_authenticated||!1):(z=E?.data||E,X=z?.next_step,G=E?.meta?.is_authenticated||z?.meta?.is_authenticated||!1,U=E?.status||z?.status),U===200&&G){A.toast.success("Two-factor authentication successful!"),a&&a({...E,token:k,user:L?.user,authenticated:!0,redirect_url:Se(O,z?.redirect_url||E?.redirect_url,"/app")});return}if(X&&X.is_pending)switch(X.id){case"set_password":const H=X.metadata?.password_policy;V(X.metadata?.reason||"Password reset required"),_({...L,passwordPolicy:H}),T("passwordReset");return;default:console.warn("Unknown next step after 2FA:",X.id);break}if(E.requiresPasswordReset){V(E.passwordResetReason||"Your password has expired"),T("passwordReset");return}A.toast.success("Two-factor authentication successful!"),a&&a({...E,token:k,user:L?.user,authenticated:!0})}catch(z){throw z}},$=async E=>{try{const z=await Z.setPassword(E.password);let X=z,G=null,U=!1,H=null;if(z?.status===401&&z?.data?(X=z.data,G=z.data?.next_step,H=z.status,U=z?.meta?.is_authenticated||!1):z?.response?(H=z.response.status,X=z.response.data,G=X?.next_step,U=z.response.meta?.is_authenticated||!1):(X=z?.data||z,G=X?.next_step,U=z?.meta?.is_authenticated||X?.meta?.is_authenticated||!1,H=z?.status||X?.status),H===200&&U){A.toast.success("Password reset successful!"),a&&a({...z,token:k,user:L?.user,authenticated:!0,redirect_url:Se(O,X?.redirect_url||z?.redirect_url,"/app")});return}if(G&&G.is_pending)switch(G.id){case"login":A.toast.success("Password reset successful!"),a&&a({...z,token:k,user:L?.user,authenticated:!1,redirect_url:Se(O,X?.redirect_url||z?.redirect_url,"/app/login")});return;case"mfa_authenticate":const q=G.metadata?.method?[G.metadata.method]:G.metadata?.type?[G.metadata.type]:G.metadata?.methods||["email"];N(q),T("twoFactor");return;default:console.warn("Unknown next step after password reset:",G.id);break}A.toast.success("Password reset successful!"),a&&a({...z,token:k,user:L?.user,authenticated:!0})}catch(z){throw A.toast.error(z.message||"Failed to reset password"),z}};return(()=>{if(h&&S==="login"){let E=null;if(h?.status===401&&h?.data?E=h.data?.next_step:h?.response?.status===401&&h?.response?.data?E=h.response.data?.next_step:h?.next_step?E=h.next_step:E=(h?.response?.data||h?.data||h)?.next_step,E&&E.is_pending)return i.jsx(A.Layout,{className:"min-h-screen",style:wt(x),children:i.jsx(Hn,{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(S){case"login":return g?(console.warn("CompleteAuthFlow: in login step but skipLoginStep=true"),null):i.jsx(b.Suspense,{fallback:i.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:i.jsx(A.Spin,{size:"large"})}),children:i.jsx(rE,{onLoginSuccess:F,logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:s,staticConfig:o,roleSelectionTitle:l,roleSelectionSubtitle:d})});case"roleSelection":return Array.isArray(L?.roles)&&L.roles.length>0?i.jsx(A.Layout,{className:"min-h-screen",style:wt(x),children:i.jsx(Hn,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx("div",{className:"w-full",children:i.jsx(vl,{user:L?.user,roles:L?.roles||[],logo:e,onRoleSelect:async X=>{try{const G=await Z.selectRole(X.id);let U=G,H=null,q=!1,J=null;if(G?.status===401&&G?.data?(U=G.data,H=G.data?.next_step,J=G.status,q=G?.meta?.is_authenticated||!1):G?.response?(J=G.response.status,U=G.response.data,H=U?.next_step,q=G.response.meta?.is_authenticated||!1):(U=G?.data||G,H=U?.next_step,q=G?.meta?.is_authenticated||U?.meta?.is_authenticated||!1,J=G?.status||U?.status),J===200&&q){A.toast.success("Role selected successfully!"),a&&a({...G,user:{...L.user,role:X},authenticated:!0,redirect_url:Se(O,U?.redirect_url||G?.redirect_url,"/app")});return}if(H&&H.is_pending)switch(H.id){case"mfa_authenticate":const ne=H.metadata?.method?[H.metadata.method]:H.metadata?.type?[H.metadata.type]:H.metadata?.methods||["email"];N(ne),T("twoFactor");return;case"set_password":const se=H.metadata?.password_policy;V(H.metadata?.reason||"Password update required"),_({...L,passwordPolicy:se}),T("passwordReset");return;case"password_expiry":V("Your password has expired"),_({...L,passwordPolicy:H.metadata?.password_policy}),T("passwordReset");return;case"first_login":V("Please set up your password for first login"),_({...L,passwordPolicy:H.metadata?.password_policy}),T("passwordReset");return;case"login_by_code":A.toast.info("OTP verification required"),a&&a({...G,user:{...L.user,role:X},requiresOTP:!0});return;default:console.warn("Unknown next step:",H.id);break}A.toast.success("Role selected successfully!"),a&&a({...G,user:{...L.user,role:X}})}catch(G){throw A.toast.error(G.message||"Failed to select role"),G}},title:l||"Select Your Role",subtitle:d||"Choose a role to continue"})})})}):(console.error("[CompleteAuthFlow] roleSelection case but authData.roles is empty or invalid!",{authData:L,initialAuthState:h}),i.jsx(A.Layout,{className:"min-h-screen",style:wt(x),children:i.jsx(Hn,{className:"flex justify-center items-center min-h-screen p-5",children: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."})]})})}));case"twoFactor":return i.jsx(A.Layout,{className:"min-h-screen",style:wt(x),children:i.jsx(Hn,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx(zg,{user:L?.user||v?.user||w,availableMethods:P,onVerify:W,title:c,subtitle:u})})});case"passwordReset":const E=L?.passwordPolicy,z=E?{minLength:E.min_length||8,maxLength:E.max_length,requireUppercase:E.require_uppercase||!1,requireLowercase:E.require_lowercase||!1,requireNumbers:E.require_numbers||!1,requireSpecialChars:E.require_special_chars||!1}:void 0;return i.jsx(A.Layout,{className:"min-h-screen",style:wt(x),children:i.jsx(Hn,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx(bl,{reason:D||void 0,onReset:$,title:f,subtitle:p,passwordRules:z})})});default:return null}})()},nE=({onSuccess:e,onError:t,apiConfig:r={},redirectPath:n="/",title:s="Completing sign in...",errorTitle:o="Authentication Error",logo:a,roleSelectionTitle:l,roleSelectionSubtitle:d,twoFactorTitle:c,twoFactorSubtitle:u,passwordResetTitle:f,passwordResetSubtitle:p})=>{const[h,m]=b.useState(!0),[g,y]=b.useState(null),[w,v]=b.useState(!1),[x,S]=b.useState(null),[T,k]=b.useState("login"),[M,P]=b.useState({}),[N,D]=b.useState(["email"]),[V,O]=b.useState(""),[L,_]=b.useState(null),B=b.useRef(!1),F=R.useLocation(),W=R.useNavigate(),{basePath:$}=vo(),{authConfig:j}=Qe(),E=async U=>{let H=U,q=null;U?.status===401&&U?.data?(H=U.data,q=U.data?.next_step):(H=U?.response?.data||U?.data||U,q=H?.next_step);const J=U?.loginUser;let ne=U?.user||H?.user||J||{};if((typeof ne!="object"||ne===null)&&(ne={}),J&&typeof J=="object"&&(ne={...ne,email:ne.email||J.email,username:ne.username||J.username,phone:ne.phone||J.phone,name:ne.name||J.display}),q&&q.is_pending)switch(q.id){case"role_selection":let se=[];return Array.isArray(q.metadata.roles)?se=q.metadata.roles:typeof q.metadata.roles=="object"&&(se=Object.entries(q.metadata.roles).map(([ve,ge])=>({id:ve,name:ge,is_default:!1}))),P({...U,roles:se,user:ne,nextStep:q,loginUser:J}),k("roleSelection"),v(!0),m(!1),!0;case"mfa_authenticate":return D(q.metadata?.methods||["email"]),k("twoFactor"),v(!0),m(!1),!0;case"set_password":const Pe=q.metadata?.password_policy;return O(q.metadata?.reason||"Password update required"),P({...U,passwordPolicy:Pe,user:ne,loginUser:J}),k("passwordReset"),v(!0),m(!1),!0;case"password_expiry":return O("Your password has expired"),P({...U,passwordPolicy:q.metadata?.password_policy,user:ne,loginUser:J}),k("passwordReset"),v(!0),m(!1),!0;case"first_login":return O("Please set up your password for first login"),P({...U,passwordPolicy:q.metadata?.password_policy,user:ne,loginUser:J}),k("passwordReset"),v(!0),m(!1),!0;case"login_by_code":return A.toast.info("OTP verification required"),e&&e({...U,user:ne,requiresOTP:!0}),!0}return U.requires2FA?(D(U.twoFactorMethods||["email"]),P({...U,user:ne,loginUser:J}),k("twoFactor"),v(!0),m(!1),!0):U.requiresPasswordReset?(O(U.passwordResetReason||"Your password has expired"),P({...U,user:ne,loginUser:J}),k("passwordReset"),v(!0),m(!1),!0):!1};b.useEffect(()=>{B.current||z()},[]);const z=async()=>{try{B.current=!0;const U=new URLSearchParams(F.search),H=new URLSearchParams(F.hash.slice(1)),q=nt(F.search)||nt(F.hash.slice(1));_(q);const J=U.get("error")||H.get("error"),ne=U.get("error_description")||H.get("error_description");if(J)throw new Error(ne||`Authentication failed: ${J}`);const se=U.get("code"),Pe=U.get("state"),ve=U.get("scope")||"",ge=U.get("authuser"),he=U.get("hd"),Me=U.get("prompt"),nn=U.get("provider")||Pe?.split(":")[0];if(!se||!nn)throw new Error("Missing required OAuth parameters (code or provider)");const To=await Z.processOAuthCallback(nn,Pe||"",se,ve,ge||void 0,he||void 0,Me||void 0);if(await E(To))return;m(!1),setTimeout(e?()=>{e(To)}:()=>{W(n,{replace:!0})},1e3)}catch(U){console.error("OAuth callback error:",U);const H=U instanceof Error?U.message:"Authentication failed";y(H),m(!1),t&&t(U instanceof Error?U:new Error(H))}},X=()=>{W($,{replace:!0})},G=async U=>{A.toast.success("Authentication complete!");try{const H=U?.response?.data?.redirect_url||U?.data?.redirect_url||U?.redirect_url,q=zt(),J=Se(q,H,"/app"),ne=window.location.pathname,se=new URLSearchParams(window.location.search),Pe=se.get("code")!==null||se.get("token")!==null;ne.startsWith("/app/login")&&Pe&&_e(J)}catch(H){console.error("Error handling auth completion:",H)}};return w?i.jsx(rn,{logo:a,apiConfig:r,initialAuthState:x||M,onAuthComplete:G,roleSelectionTitle:l,roleSelectionSubtitle:d,twoFactorTitle:c,twoFactorSubtitle:u,passwordResetTitle:f,passwordResetSubtitle:p,redirectPath:n,initialRedirectUrl:L}):h?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: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:bt(j),children:s}),i.jsx("p",{className:"text-gray-500 text-sm mb-0",style:Lt(j),children:"Please wait while we complete your authentication..."})]})})}):g?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:i.jsx("div",{className:"text-center py-10 px-5",children:i.jsx(A.Alert,{message:o,description:g,type:"error",showIcon:!0,action:i.jsx("a",{onClick:X,children:"Return to login"})})})})}):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: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})})})})},{Content:sE}=A.Layout,oE=({logo:e,apiConfig:t,onAuthComplete:r,roleSelectionTitle:n,roleSelectionSubtitle:s,twoFactorTitle:o,twoFactorSubtitle:a,passwordResetTitle:l,passwordResetSubtitle:d,redirectPath:c="/"})=>{const[u,f]=b.useState(null),[p,h]=b.useState(!1),m=async w=>{w.requiresRoleSelection||w.requires2FA||w.requiresPasswordReset?(f(w),h(!0)):(w.token&&localStorage.setItem(t?.tokenKey||"authToken",w.token),r&&r(w))},g=w=>{console.error("OAuth callback error:",w)},y=w=>{const v={...u,...w,authMethod:"oauth",provider:u?.provider};r&&r(v)};return p&&u?i.jsx(rn,{logo:e,apiConfig:t,onAuthComplete:y,roleSelectionTitle:n,roleSelectionSubtitle:s,twoFactorTitle:o,twoFactorSubtitle:a,passwordResetTitle:l,passwordResetSubtitle:d,initialAuthState:{user:u.user,token:u.token,roles:u.roles,requires2FA:u.requires2FA,twoFactorMethods:u.twoFactorMethods,requiresPasswordReset:u.requiresPasswordReset,passwordResetReason:u.passwordResetReason}}):i.jsx(A.Layout,{className:"min-h-screen",style:wt(t||{}),children:i.jsx(sE,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx(nE,{onSuccess:m,onError:g,apiConfig:t,redirectPath:c,logo:e,roleSelectionTitle:n,roleSelectionSubtitle:s,twoFactorTitle:o,twoFactorSubtitle:a,passwordResetTitle:l,passwordResetSubtitle:d})})})},{Content:aE}=A.Layout,Kg=({logo:e,title:t="Processing Authentication",subtitle:r="Please wait while we complete your login",onAuthComplete:n,roleSelectionTitle:s="Select Your Role",roleSelectionSubtitle:o="Choose a role to continue",twoFactorTitle:a="Two-Factor Authentication",twoFactorSubtitle:l="Please enter your verification code",passwordResetTitle:d="Reset Password",passwordResetSubtitle:c="Please enter your new password"})=>{const[u]=R.useSearchParams(),{authConfig:f}=Qe(),[p,h]=b.useState(!0),[m,g]=b.useState(null),[y,w]=b.useState(null),[v,x]=b.useState(null),[S,T]=b.useState(!1),[k,M]=b.useState(null),P=u.get("next");b.useEffect(()=>{N()},[]);const N=async()=>{try{h(!0),g(null),sessionStorage.setItem("saml_auth_in_progress","true");const _=u.get("token"),B=u.get("request_id");if(!_||!B)throw new Error("Missing required SAML parameters (token or request_id)");if(!window.location.pathname.startsWith("/app/login")){h(!1),sessionStorage.removeItem("saml_auth_in_progress");return}const W=await Z.getSAMLAuthMeta(_,B);if(W?.code==="user_not_found"){sessionStorage.setItem("saml_error",JSON.stringify({message:W.message||"User does not exist",timestamp:Date.now()})),sessionStorage.removeItem("saml_auth_in_progress"),_e("/app/login");return}if(W?.status===401&&W?.data?.next_step){if(W.data.next_step.is_pending){let j=u.get("email")||u.get("user_email")||null,E=u.get("name")||u.get("user_name")||j;!j&&W?.data?.user&&(j=W.data.user.email||W.data.user.username,E=W.data.user.name||j);const X={...W,loginUser:{email:j,username:E||j||"SAML User",display:E||j||"SAML User"}};M(X),T(!0),h(!1);return}w(W.data),x(W.data.next_step.id),h(!1);return}if(W?.roles&&W.roles.length>1){const $={status:401,data:{next_step:{id:"role_selection",is_pending:!0,metadata:{roles:W.roles}}},loginUser:{email:u.get("email")||u.get("user_email")||"SAML User",username:u.get("name")||u.get("user_name")||"SAML User",display:u.get("name")||u.get("user_name")||"SAML User"}};M($),T(!0),h(!1);return}if(n)console.log("SAML callback complete, calling onAuthComplete:",W),sessionStorage.removeItem("saml_auth_in_progress"),n(W);else{console.log("SAML callback complete, redirecting to:",W?.redirect_url||"/app");const $=zt(),j=Se($,W?.redirect_url,"/app");sessionStorage.removeItem("saml_auth_in_progress"),_e(j)}}catch(_){console.error("SAML callback error:",_),g(_ instanceof Error?_.message:"Failed to process SAML authentication"),h(!1),sessionStorage.removeItem("saml_auth_in_progress")}},D=async _=>{try{if(_?.status===401&&_?.data?.next_step){w(_.data),x(_.data.next_step);return}if(n)sessionStorage.removeItem("saml_auth_in_progress"),n(_);else{const B=zt(),F=Se(B,_?.redirect_url,"/app");sessionStorage.removeItem("saml_auth_in_progress"),_e(F)}}catch(B){console.error("Two-factor completion error:",B),A.toast.error(B instanceof Error?B.message:"Failed to complete two-factor authentication"),sessionStorage.removeItem("saml_auth_in_progress")}},V=async _=>{try{if(_?.status===401&&_?.data?.next_step){w(_.data),x(_.data.next_step);return}if(n)sessionStorage.removeItem("saml_auth_in_progress"),n(_);else{const B=zt(),F=Se(B,_?.redirect_url,"/app");sessionStorage.removeItem("saml_auth_in_progress"),_e(F)}}catch(B){console.error("Password reset completion error:",B),A.toast.error(B instanceof Error?B.message:"Failed to complete password reset"),sessionStorage.removeItem("saml_auth_in_progress")}},O=()=>{if(p)return i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[300px] 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(v){case"2fa_required":return i.jsx(zg,{user:y?.user,onVerify:D,title:a,subtitle:l,logo:e});case"password_reset_required":return i.jsx(bl,{onReset:V,title:d,subtitle:c,reason:y?.metadata?.reason,logo:e});default:return 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-[150px] 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: ${v}`,type:"warning",showIcon:!0})]})}},L=()=>p||m||!v;return S&&k?i.jsx(rn,{initialAuthState:k,onAuthComplete:_=>{const B=zt(),F=Se(B,_?.redirect_url,"/app");sessionStorage.removeItem("saml_auth_in_progress"),window.location.href=F},skipLoginStep:!0,logo:e,roleSelectionTitle:s,roleSelectionSubtitle:o,twoFactorTitle:a,twoFactorSubtitle:l,passwordResetTitle:d,passwordResetSubtitle:c,initialNextParam:P}):i.jsx(A.Layout,{className:"min-h-screen",style:wt(f),children:i.jsx(aE,{className:"flex justify-center items-center min-h-screen p-5",children:L()?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-[150px] 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})}),O()]}):O()})})},xl=()=>ir();function Gg(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 xo(e){if(e==null)return e;if(typeof e=="string")return Gg(e);if(typeof e=="number"||typeof e=="boolean")return e;if(Array.isArray(e))return e.map(t=>xo(t));if(typeof e=="object"){const t={};for(const[r,n]of Object.entries(e)){const s=Gg(r);t[s]=xo(n)}return t}return e}function iE(e,t){try{const r=xo(t);sessionStorage.setItem(e,JSON.stringify(r))}catch(r){console.error("[Storage] Failed to store sanitized data:",r)}}function Xg(e){try{const t=sessionStorage.getItem(e);if(!t)return null;const r=JSON.parse(t);return xo(r)}catch(t){return console.error("[Storage] Failed to retrieve data:",t),sessionStorage.removeItem(e),null}}function Yg(e){sessionStorage.removeItem(e)}const{Header:hA,Content:Cl}=A.Layout,lE=({backgroundStyle:e,mergedConfig:t,apiConfig:r})=>{R.useNavigate();const[n,s]=b.useState(!1),[o,a]=b.useState(null);b.useEffect(()=>{(async()=>{const p=new URLSearchParams(window.location.search),h=p.get("token"),m=p.get("request_id");if(h&&m){s(!0);try{const g=await Z.getSAMLAuthMeta(h,m);if(g?.code==="user_not_found"){iE("saml_error",{message:g.message||"User does not exist",timestamp:Date.now()}),_e("/app/login");return}a(g),s(!1)}catch(g){console.error("[LoginWrapper] SAML callback error:",g),A.toast.error("Failed to process SSO authentication"),s(!1)}}})()},[]);const l=Xg("pendingAuthResult");Xg("pendingAuthStep");let d=o;!d&&l&&(d=l,Yg("pendingAuthResult"),Yg("pendingAuthStep"));const c=async f=>{A.toast.success("Authentication complete!");try{const p=nt(window.location.search),h=zt(),m=p||h,g=f?.redirect_url||f?.response?.data?.redirect_url,y=Se(m,g,"/app");console.log("[LoginRouter] Redirecting to:",y),window.location.pathname.startsWith("/app/login")&&_e(y)}catch(p){console.error("[LoginRouter] Error handling auth completion:",p),_e("/app")}},u=b.useMemo(()=>{const p=new URLSearchParams(window.location.search).get("next");if(p)return decodeURIComponent(p);try{return sessionStorage.getItem("sso_next_param")||null}catch{return null}},[]);return n?i.jsx("div",{style:{...e,minHeight:"100vh"},children:i.jsx(A.Layout,{className:"min-h-screen",style:e,children:i.jsx(Cl,{className:"flex justify-center items-center min-h-screen",children:i.jsx(A.Card,{className:"w-full max-w-md shadow-lg rounded-lg",bordered:!1,children:i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[300px] text-center",children:[i.jsx(A.Spin,{size:"large"}),i.jsx("p",{className:"mt-4 text-gray-600",children:"Processing SSO authentication..."})]})})})})}):i.jsx("div",{style:{...e,minHeight:"100vh"},children:i.jsx(rn,{onAuthComplete:c,logo:t.logo,title:t.title,subtitle:t.subtitle,apiConfig:r,useDynamicConfig:!0,roleSelectionTitle:t.roleSelectionTitle,roleSelectionSubtitle:t.roleSelectionSubtitle,twoFactorTitle:t.twoFactorTitle,twoFactorSubtitle:t.twoFactorSubtitle,passwordResetTitle:t.passwordResetTitle,passwordResetSubtitle:t.passwordResetSubtitle,initialAuthState:d,skipLoginStep:!!o,initialNextParam:u})})},cE=({authConfig:e,backgroundStyle:t,mergedConfig:r})=>{const{forgotPassword:n}=xl();or(e);const s=async o=>{try{await n(o);const a=e?.resetPassword?.forgotPassword?.successMessage||"Reset email sent successfully!";A.toast.success(a)}catch(a){const l=e?.resetPassword?.forgotPassword?.errorMessage||(a instanceof Error?a.message:"Failed to send reset email");A.toast.error(l)}};return i.jsx(A.Layout,{style:{...t,minHeight:"100vh"},children:i.jsx(Cl,{style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"20px"},children:i.jsx(q4,{onSubmit:s,authConfig:e,logo:r.logo})})})},dE=({authConfig:e,backgroundStyle:t,mergedConfig:r,basePath:n})=>{const{resetPassword:s}=xl(),{key:o}=R.useParams();or(e);const a=R.useNavigate();if(b.useEffect(()=>{o||a(n)},[o,a,n]),!o)return null;const l=async d=>{};return i.jsx(A.Layout,{style:{...t,minHeight:"100vh"},children:i.jsx(Cl,{style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"20px"},children:i.jsx(G4,{onSubmit:l,authConfig:e,token:o,logo:r.logo})})})},Sl={},Pl={},El={"admin@example.com":{requires2FA:!0,requiresPasswordReset:!1,twoFactorMethods:["email","mobile"]},"+919876543210":{requires2FA:!0,requiresPasswordReset:!0,passwordResetReason:"Your password will expire in 7 days",twoFactorMethods:["mobile"]},"test@example.com":{requires2FA:!1,requiresPasswordReset:!0,passwordResetReason:"Password has expired"}},Wn={"admin@example.com":[{id:1,name:"Super Admin",description:"Full system access with all administrative privileges",permissions:["system.manage","users.manage","roles.manage","settings.manage"],is_default:!1},{id:2,name:"Organization Admin",description:"Manage organization settings and users",permissions:["org.manage","users.manage","reports.view"],is_default:!0},{id:3,name:"Compliance Officer",description:"Monitor compliance and security settings",permissions:["compliance.view","audit.view","reports.generate"],is_default:!1}],"+919876543210":[{id:4,name:"Team Manager",description:"Manage team members and projects",permissions:["team.manage","projects.manage","reports.view"],is_default:!0},{id:5,name:"Employee",description:"Standard employee access",permissions:["profile.edit","tasks.manage","reports.view"],is_default:!1}],default:[{id:6,name:"User",description:"Standard user access",permissions:["profile.view","profile.edit"],is_default:!0}]},Zg=e=>({loginEndpoint:"/api/auth/login",logoutEndpoint:"/api/auth/logout",verifyEndpoint:"/api/auth/verify",forgotPasswordEndpoint:"/api/auth/forgot-password",resetPasswordEndpoint:"/api/auth/reset-password",loginMethodsEndpoint:"/api/v1/login/?action=fetch_methods",otpRequestEndpoint:"/api/auth/otp/request",otpVerifyEndpoint:"/api/auth/otp/verify",apiClient:{post:async(t,r)=>{if(await new Promise(n=>setTimeout(n,1e3)),t.includes("login")){const n=r.email||r.phone||r.username;if(["admin@example.com","+919876543210","test@example.com","admin"].includes(n)&&r.password==="password"){const a=Wn[n]||Wn.default,l=El[n]||{};return{user:{id:1,username:n,email:n.includes("@")?n:"user@example.com",mobile:n.startsWith("+")?n:"+919876543210",name:n==="admin@example.com"?"John Admin":n.startsWith("+")?"Mobile User":"Test User"},token:"mock-jwt-token-12345",roles:a,...l}}throw new Error("Invalid credentials")}if(t.includes("otp/request")){const n=r.email_or_phone||r.email||r.phone||r.username,s=Math.floor(Math.random()*9e5+1e5).toString().slice(0,6);return Sl[n]=s,A.toast.info(`Mock OTP sent! Check console for OTP: ${s}`),{success:!0,message:"OTP sent successfully"}}if(t.includes("otp/verify")){const n=r.email_or_phone||r.email||r.phone||r.username;if(Sl[n]===r.otp){delete Sl[n];const o=Wn[n]||Wn.default;return{user:{id:1,username:n,email:n.includes("@")?n:"user@example.com",mobile:n.startsWith("+")?n:"+919876543210",name:n.includes("@")?"OTP User":"Mobile User"},token:"mock-jwt-token-otp-12345",roles:o}}throw new Error("Invalid OTP")}if(t.includes("forgot-password"))return{message:"Reset email sent successfully"};if(t.includes("reset-password"))return{message:"Password reset successfully"};if(t.includes("role/select"))return{success:!0,...El["admin@example.com"]||{}};if(t.includes("2fa/send")){const n=Math.floor(Math.random()*9e5+1e5).toString().slice(0,6);return Pl[r.method]=n,A.toast.info(`2FA OTP sent! Check console for OTP: ${n}`),{success:!0,message:"2FA code sent successfully"}}if(t.includes("2fa/verify")){if(Pl[r.method]===r.otp){delete Pl[r.method];const o=El["admin@example.com"]||{};return{success:!0,requiresPasswordReset:o.requiresPasswordReset,passwordResetReason:o.passwordResetReason}}throw new Error("Invalid 2FA code")}if(t.includes("password/change"))return{success:!0,message:"Password changed successfully"};if(t.includes("oauth/callback")){const n=r.provider||"google",s={id:1,email:`user@${n}.com`,name:`${n.charAt(0).toUpperCase()+n.slice(1)} User`,username:`user@${n}.com`};return n==="google"?{user:s,token:"mock-oauth-token-12345",roles:Wn["admin@example.com"],requires2FA:!0,twoFactorMethods:["email"]}:n==="microsoft"?{user:s,token:"mock-oauth-token-12345",requiresPasswordReset:!0,passwordResetReason:"first_login"}:{user:s,token:"mock-oauth-token-12345"}}return{success:!0}},get:async t=>{if(await new Promise(r=>setTimeout(r,500)),t.includes("fetch_methods")||t.includes("config"))return{success:!0,response:{auth_config:{login_methods:{password:{enabled:!0,forgot_password_enabled:!0,allowed_usernames:["email","phone"]},otp:{enabled:!0,allowed_methods:["email","sms"]},sso:{enabled:!0,providers:[{id:1,label:"zsaml"}]},oidc:{enabled:!1}},password_policy:{min_length:8,require_numbers:!0,require_lowercase:!0,require_uppercase:!0,require_special_chars:!0,password_expiry_days:90,password_history_count:3,allow_change:!0,reset:{enabled:!0,method:["email"],expiry_hours:2}},session_policy:{remember_me_enabled:!0,remember_me_duration_days:30},two_factor_auth:{required:!0,allowed_methods:[]}}}};if(t.includes("verify")){const r=localStorage.getItem("authToken");if(r&&r.startsWith("mock-jwt-token"))return{id:1,username:"admin",email:"admin@example.com"};throw new Error("Invalid token")}return{}}}}),uE=({basePath:e="/login",apiConfig:t={},onAuthComplete:r,logo:n,title:s="Welcome Back",subtitle:o="Please sign in to your account",roleSelectionTitle:a="Select Your Role",roleSelectionSubtitle:l="Choose a role to continue",twoFactorTitle:d="Two-Factor Authentication",twoFactorSubtitle:c="Please enter your verification code",passwordResetTitle:u="Reset Password",passwordResetSubtitle:f="Please enter your new password"})=>{const{authConfig:p}=qe();R.useLocation(),R.useNavigate();const[h,m]=b.useState(null),{setBasePath:g}=vo();b.useEffect(()=>{g(e)},[e,g]),b.useEffect(()=>(p&&z4(p),()=>{H4()}),[p]);const y=b.useMemo(()=>{const S=p?.login||{},T=p?.logo||{};return{logo:T.url?i.jsx("img",{src:T.url,alt:T.alt||"Logo",style:{width:T.width||"auto",height:T.height||"auto",...T.style},className:T.className}):n,title:S.title||s,subtitle:S.subtitle||o,roleSelectionTitle:p?.roleSelection?.title||a,roleSelectionSubtitle:p?.roleSelection?.subtitle||l,twoFactorTitle:p?.twoFactor?.title||d,twoFactorSubtitle:p?.twoFactor?.subtitle||c,passwordResetTitle:p?.resetPassword?.resetForm?.title||u,passwordResetSubtitle:p?.resetPassword?.resetForm?.subtitle||f}},[p,n,s,o,a,l,d,c,u,f]),w=b.useMemo(()=>wt(p),[p]),v=S=>{m(S),r&&r(S)},x=b.useMemo(()=>Zg(),[]);return e.endsWith("/")&&e.slice(0,-1),i.jsx(Bg,{authConfig:p,children:i.jsx(qg,{config:x,children:i.jsxs(R.Routes,{children:[i.jsx(R.Route,{path:"/",element:i.jsx(lE,{backgroundStyle:w,mergedConfig:y,apiConfig:x})}),i.jsx(R.Route,{path:"forgot-password",element:i.jsx(cE,{authConfig:p,backgroundStyle:w,mergedConfig:y})}),i.jsx(R.Route,{path:"reset-password/:key",element:i.jsx(dE,{authConfig:p,backgroundStyle:w,mergedConfig:y,basePath:e})}),i.jsx(R.Route,{path:"reset-password",element:i.jsx(R.Navigate,{to:"/app",replace:!0})}),i.jsx(R.Route,{path:"/oauth/callback",element:i.jsx("div",{style:{...w,minHeight:"100vh"},children:i.jsx(oE,{logo:y.logo,apiConfig:Zg(),onAuthComplete:S=>{(async()=>{const k=S?.redirect_url||S?.response?.data?.redirect_url,M=zt(),P=Se(M,k,"/app");_e(P)})()},roleSelectionTitle:y.roleSelectionTitle,roleSelectionSubtitle:y.roleSelectionSubtitle,twoFactorTitle:y.twoFactorTitle,twoFactorSubtitle:y.twoFactorSubtitle,passwordResetTitle:y.passwordResetTitle,passwordResetSubtitle:y.passwordResetSubtitle})})}),i.jsx(R.Route,{path:"/saml",element:i.jsx(Kg,{logo:i.jsx(Fy,{size:48,style:{color:"#1890ff"}}),onAuthComplete:S=>{const T=zt(),k=Se(T,S?.redirect_url,"/app");_e(k)},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(R.Route,{path:"/complete",element:i.jsx(rn,{authData:h,apiConfig:t,logo:n,onComplete:v,roleSelectionTitle:a,roleSelectionSubtitle:l,twoFactorTitle:d,twoFactorSubtitle:c,passwordResetTitle:u,passwordResetSubtitle:f})}),i.jsx(R.Route,{path:"*",element:i.jsx(R.Navigate,{to:"/404",replace:!0})})]})})})},fE=()=>i.jsxs("svg",{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"})]}),hE=()=>i.jsxs("svg",{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"})]}),pE=()=>i.jsx("svg",{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"})}),mE=()=>i.jsx("svg",{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"})}),gE=()=>i.jsx("svg",{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"})}),yE=()=>i.jsx("svg",{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"})}),wE=()=>i.jsx("svg",{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"})}),bE=()=>i.jsxs("svg",{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"})]}),vE=()=>i.jsx("svg",{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"})}),xE=()=>i.jsxs("svg",{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"})]}),CE=(e,t="default")=>{const r=e?e.toLowerCase():"";return r.includes("google")?i.jsx(fE,{}):r.includes("microsoft")||r.includes("azure")?i.jsx(hE,{}):r.includes("github")?i.jsx(pE,{}):r.includes("linkedin")?i.jsx(mE,{}):r.includes("facebook")?i.jsx(gE,{}):r.includes("twitter")||r.includes("x.com")?i.jsx(yE,{}):r.includes("apple")?i.jsx(wE,{}):r.includes("slack")?i.jsx(bE,{}):r.includes("okta")?i.jsx(xE,{}):r.includes("saml")||r.includes("sso")||t==="sso"?i.jsx(vE,{}):i.jsx(Oy,{size:16})},vt=({provider:e,type:t="default",prefix:r="Continue with",postfix:n=""})=>{const[s,o]=b.useState(!1),a=()=>{if(t==="sso"){const f=e.label||e.id;return f.toLowerCase().includes("azure")?"Azure AD":f.toLowerCase().includes("okta")?"Okta":f.toLowerCase().includes("google")?"Google":f.toLowerCase().includes("microsoft")?"Microsoft":f.toLowerCase().includes("saml")?"SSO":f.charAt(0).toUpperCase()+f.slice(1)}else return e.name||e.provider},l=t==="sso"?e.label||e.id:e.provider,d=a(),c=CE(l,t),u=async()=>{try{o(!0);const f=nt(window.location.search),p=f||"/app";if($g(f),t==="sso"){const h=e.id,g=(await Z.initiateSAMLAuth(h,p))?.redirect_url;g&&(g.startsWith("https://")||g.startsWith("/"))?window.location.href=g:console.error("No valid redirect URL received from SAML init")}else{const h=await Z.oauthRedirect(e.provider,window.location.href,p);if(h.success){const m=h.response.redirect_url;m&&(m.startsWith("https://")||m.startsWith("/"))&&(window.location.href=m)}else console.error("Error authenticating with OAuth provider")}}catch(f){console.error(`Error authenticating with ${t} provider:`,f);let p=`Failed to authenticate with ${d}`;f.message?.includes("500")?p+=". The authentication service appears to be unavailable. Please try again later or contact support.":f.message?.includes("404")?p+=". The authentication service is not configured properly.":f.message?.includes("403")?p+=". You do not have permission to use this authentication method.":f.message?p+=`. ${f.message}`:p+=". Please try again or contact support.",A.toast.error(p)}finally{o(!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:c,block:!0,onClick:u,disabled:s,loading:s,children:s?"Redirecting...":`${r} ${d} ${n}`})},{Text:Jg,Title:Qg}=A.Typography,Tl=({onSuccess:e,onBack:t,submitButtonText:r,verifyButtonText:n,resendButtonText:s})=>{const[o,a]=b.useState("request"),[l,d]=b.useState(!1),[c,u]=b.useState(""),[f,p]=b.useState("email"),[h,m]=b.useState(""),[g,y]=b.useState(""),[w,v]=b.useState(""),[x,S]=b.useState(0),[T,k]=b.useState(0),{authConfig:M}=ir();b.useEffect(()=>{if(M){const B=Z.getAllowedUsernames();B&&B.length>0&&p(B[0])}},[M]),b.useEffect(()=>{if(x>0){const B=setTimeout(()=>S(x-1),1e3);return()=>clearTimeout(B)}},[x]);const P=B=>B==="email"?"Enter your email address":"Enter your mobile number",N=B=>B==="email"?[{required:!0,message:"Please enter your email address"},{type:"email",message:"Please enter a valid email!"}]:B==="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"}],D=async B=>{v(""),d(!0);try{const F=await Z.requestOTP(B.username);F?.status===401&&F?.data?.message?(u(B.username),a("verify"),S(30),A.toast.success(F.data.message||"Code sent successfully!")):(u(B.username),a("verify"),S(30),A.toast.success("Code sent successfully!"))}catch(F){console.error("Failed to Send Code:",F);const W=F instanceof Error?F.message:"Failed to Send Code";v(W)}finally{d(!1)}},V=async()=>{if(y(""),h.length!==6){y("Please enter 6 digit Code");return}d(!0);try{const W={...await Z.verifyOTP(c,h),loginUser:{email:f==="email"?c:void 0,phone:f==="mobile"?c:void 0,username:c,display:c}};e(W)}catch(F){const W=F instanceof Error?F.message:"Invalid Code";y(W)}finally{d(!1)}},O=async()=>{if(!(x>0)){d(!0);try{await Z.requestOTP(c),S(30),A.toast.success("Code resent successfully!")}catch(B){const F=B instanceof Error?B.message:"Failed to resend Code";A.toast.error(F)}finally{d(!1)}}};if(!M)return i.jsx("div",{className:"flex justify-center items-center min-h-[300px]",children:"Loading..."});const L=Z.getAllowedUsernames(),_=6;return o==="verify"?i.jsxs("div",{className:"w-full",children:[i.jsxs(A.Button,{variant:"link",icon:i.jsx(Mo,{size:16}),onClick:()=>{a("request"),m(""),y(""),S(0)},className:"mb-4 flex gap-2",children:["Change ",f?.slice(0,1).toUpperCase()+f?.slice(1)," ",f==="email"?"Address":"Number"]}),i.jsx(Qg,{level:4,className:"!mb-2 text-center",style:bt(M),children:"Enter Verification Code"}),i.jsxs(Jg,{className:"block text-center text-gray-500 mb-6",style:Lt(M),children:["Please enter the ",_,"-digit code sent to ",c]}),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(jg,{length:_,value:h,onChange:B=>{m(B),g&&y("")},disabled:l})}),i.jsx(A.Button,{type:"primary",block:!0,fullWidth:!0,loading:l,onClick:V,className:"mt-6",children:n||"Verify & Sign In"}),i.jsx("div",{className:"text-center mt-4",children:x>0?i.jsxs(Jg,{type:"secondary",children:["Resend Code in ",x,"s"]}):i.jsx(A.Button,{variant:"link",onClick:O,loading:l,disabled:l,children:s||"Resend Code"})})]}):i.jsxs("div",{className:"w-full",children:[t&&i.jsx(A.Button,{variant:"link",icon:i.jsx(Mo,{size:16}),onClick:t,className:"mb-4",children:"Back to login"}),i.jsx(Qg,{level:4,className:"!mb-2 text-center",style:bt(M),children:"Sign in with a One-Time Pin"}),w&&i.jsx(A.Alert,{message:w,type:"error",showIcon:!1,closable:!0,onClose:()=>v(""),className:"mb-4"}),i.jsxs(A.Form,{name:"otp-request",onFinish:D,layout:"vertical",children:[L.length>1&&i.jsx(A.FormItem,{children:i.jsx(A.Segmented,{options:L.map(B=>({label:i.jsxs(A.Space,{children:[B==="email"?i.jsx(Gn,{size:16}):B==="mobile"?i.jsx(No,{size:16}):i.jsx(Lo,{size:16}),i.jsx("span",{children:B==="mobile"?"Phone":B==="email"?"Email":"Username"})]}),value:B})),value:f,onChange:B=>p(B),block:!0,className:"bg-gray-100 mb-2"})}),i.jsx(A.FormItem,{name:"username",rules:N(f),children:i.jsx(A.Input,{placeholder:P(f)})}),i.jsx(A.FormItem,{children:i.jsx(A.Button,{variant:"primary",type:"submit",fullWidth:!0,disabled:l,children:r||"Send Code"})})]},T)]})},SE=({onLogin:e,showRememberMe:t=!0})=>{const[r,n]=b.useState(!1),[s,o]=b.useState(null),[a,l]=b.useState(null),[d,c]=b.useState("email"),[u,f]=b.useState(!1),[p,h]=b.useState(0),[m,g]=b.useState(!1),[y,w]=b.useState(!1),[v,x]=b.useState(""),[S,T]=b.useState(""),{authConfig:k}=ir(),{getLoginConfig:M,getMessagesConfig:P,getProvidersConfig:N,authConfig:D}=Qe(),V=D||k,O=bt(V),L=Lt(V),_=Ug(V),B=async()=>{try{return await Z.isAuthenticated()}catch{return!1}};if(b.useEffect(()=>{if(k){const U=Z.getAllowedUsernames();if(U&&U.length>0){const H=U.includes("email"),q=U.includes("mobile");H?c("email"):q&&c("mobile")}Z.isPasswordLoginEnabled()?l("password"):Z.isOTPLoginEnabled()&&l("otp")}},[k]),b.useEffect(()=>{(async()=>{const H=await B();g(H)})()},[]),!k)return i.jsx("div",{className:"flex justify-center items-center min-h-[300px]",children:i.jsx(A.Spin,{size:"large"})});const F=U=>{const H=P();return U==="email"?[{required:!0,message:H?.validation?.required||"Please enter your email address"},{type:"email",message:H?.validation?.invalidEmail||"Please enter a valid email address!"}]:U==="mobile"?[{required:!0,message:H?.validation?.required||"Please input your mobile number!"},{pattern:/^\+\d{7,15}$/,message:H?.validation?.invalidMobile||"Please enter a valid mobile number with country code (e.g., +919876543210)"}]:[{required:!0,message:H?.validation?.required||"Please enter your email address"},{type:"email",message:H?.validation?.invalidEmail||"Please enter a valid email address!"}]},W=async U=>{n(!0),o(null);try{const H=Z.getAllowedUsernames(),q=H.includes("email"),J=H.includes("mobile"),ne=q&&J?d:q?"email":"mobile",se={email:ne==="email"?U.username:void 0,phone:ne==="mobile"?U.username:void 0,password:U.password,remember_me:U.remember||!1},Pe=await e(se)}catch(H){const q=P(),J=H.message||q?.errors?.loginFailed||"Login failed. Please try again.";o(J)}finally{n(!1)}},$=async U=>{await e(U)},j=async()=>{n(!0);try{await Z.logout(),A.toast.success("Logged out successfully"),g(!1)}catch(U){A.toast.error(U.message||"Failed to logout")}finally{n(!1)}},E=async()=>{if(!v||!S){A.toast.error("Please fill in all password fields");return}if(v!==S){A.toast.error("Passwords do not match");return}if(v.length<8){A.toast.error("Password must be at least 8 characters long");return}n(!0);try{await Z.setPassword(v),A.toast.success("Password changed successfully!"),w(!1),x(""),T("")}catch(U){A.toast.error(U.message||"Failed to change password")}finally{n(!1)}},z=U=>{const H=M(),q=P();return i.jsxs(A.Form,{name:`${U}-password-login`,className:"w-full",onFinish:W,layout:"vertical",initialValues:{remember:!1},children:[s&&i.jsx(A.Alert,{message:s,type:"error",showIcon:!0,closable:!0,onClose:()=>o(null),className:"mb-4"}),i.jsx(A.FormItem,{name:"username",rules:F(U),children:i.jsx(A.Input,{placeholder:U==="email"?H?.formPlaceholders?.email||"Enter your email address":H?.formPlaceholders?.mobile||"Enter your mobile number (+919876543210)",autoComplete:U==="email"?"email":"tel",onKeyDown:U==="mobile"?J=>{const ne=["Backspace","Delete","Tab","Enter","ArrowLeft","ArrowRight"],se=J.key;!ne.includes(se)&&!J.ctrlKey&&!J.metaKey&&!/[0-9+]/.test(se)&&J.preventDefault()}:void 0})}),i.jsx(A.FormItem,{name:"password",rules:[{required:!0,message:q?.validation?.passwordRequired||"Please input your password!"},{min:k?.password_policy?.min_length||6,message:q?.validation?.passwordTooShort||`Password must be at least ${k?.password_policy?.min_length||6} characters long`}],children:i.jsx(A.PasswordInput,{placeholder:H?.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:H?.showRememberMe!==!1&&t&&Z.isRememberMeEnabled()&&i.jsx(A.FormItem,{name:"remember",valuePropName:"checked",noStyle:!0,children:i.jsx("div",{className:"auth-remember-me",style:L,children:i.jsx(A.Checkbox,{label:H?.rememberMeText||"Remember me"})})})}),i.jsx("div",{children:Z.isForgotPasswordEnabled()&&i.jsx(R.Link,{to:"forgot-password",className:"text-sm transition-colors duration-300",style:_,children:H?.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:H?.submitButtonText||"Sign in"})})]},`${U}-${p}`)},X=()=>{if(!Z.isOTPLoginEnabled())return null;const U=M();return u?i.jsx(Tl,{onSuccess:$,onBack:()=>f(!1)}):i.jsx(A.Button,{variant:"secondary",fullWidth:!0,onClick:()=>f(!0),className:"bg-gray-100 border-gray-300",children:U?.otpButtonText||"Sign in with OTP"})},G=()=>{if(!k)return null;const U=Z.getAllowedUsernames(),H=U.includes("email"),q=U.includes("mobile"),J=Z.isSSOEnabled()||Z.isOIDCEnabled(),ne=Z.isPasswordLoginEnabled(),se=Z.isOTPLoginEnabled();if(!ne&&!se&&!J)return null;if(J&&!ne&&!se)return i.jsxs("div",{className:"w-full",children:[Z.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:Z.getSSOProviders().map((ve,ge)=>i.jsx(vt,{provider:ve,type:"sso"},`sso-standalone-${ge}`))})}),Z.isOIDCEnabled()&&i.jsx("div",{className:"space-y-2",children:Z.getOIDCProviders().map((ve,ge)=>i.jsx(vt,{provider:ve,type:"oidc"},`oidc-standalone-${ge}`))})]});if(se&&!ne){const ve=N();return i.jsxs("div",{className:"w-full",children:[i.jsx(Tl,{onSuccess:$}),J&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:ve?.separatorText||"OR"}),Z.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:Z.getSSOProviders().map((ge,he)=>i.jsx(vt,{provider:ge,type:"sso"},`sso-otp-${he}`))})}),Z.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:Z.getOIDCProviders().map((ge,he)=>i.jsx(vt,{provider:ge,type:"oidc"},`oidc-otp-${he}`))})})]})]})}if(H&&q&&ne){const ve=M(),ge=N();return i.jsx("div",{className:"w-full",children:i.jsx(A.Tabs,{className:"login-tabs",activeKey:d,onChange:he=>{c(he),h(Me=>Me+1),o(null)},items:[{key:"email",label:i.jsxs("span",{className:"flex items-center gap-1",style:O,children:[i.jsx(Gn,{size:16}),ve?.tabLabels?.email||"Email"]}),children:i.jsxs(i.Fragment,{children:[z("email"),se&&ne&&!u&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:ge?.separatorText||"OR"}),X()]}),u&&X(),!u&&J&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:ge?.separatorText||"OR"}),Z.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:Z.getSSOProviders().map((he,Me)=>i.jsx(vt,{provider:he,type:"sso"},`sso-email-${Me}`))})}),Z.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:Z.getOIDCProviders().map((he,Me)=>i.jsx(vt,{provider:he,type:"oidc"},`oidc-email-${Me}`))})})]})]})},{key:"mobile",label:i.jsxs("span",{className:"flex items-center gap-1",style:O,children:[i.jsx(No,{size:16}),ve?.tabLabels?.mobile||"Mobile"]}),children:i.jsxs(i.Fragment,{children:[z("mobile"),se&&ne&&!u&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),X()]}),u&&X(),!u&&J&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),Z.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:Z.getSSOProviders().map((he,Me)=>i.jsx(vt,{provider:he,type:"sso"},`sso-mobile-${Me}`))})}),Z.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:Z.getOIDCProviders().map((he,Me)=>i.jsx(vt,{provider:he,type:"oidc",onClick:()=>{}},`oidc-${Me}`))})})]})]})}]})})}else{const ve=H?"email":"mobile";return i.jsxs("div",{className:"w-full",children:[z(ve),se&&ne&&!u&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),X()]}),u&&X(),!u&&J&&i.jsxs("div",{className:"mt-6",children:[i.jsx(A.Divider,{children:"OR"}),Z.isSSOEnabled()&&i.jsx("div",{className:"mb-4",children:i.jsx("div",{className:"space-y-2",children:Z.getSSOProviders().map((ge,he)=>i.jsx(vt,{provider:ge,type:"sso"},`sso-single-${he}`))})}),Z.isOIDCEnabled()&&i.jsx("div",{className:"mt-4",children:i.jsx("div",{className:"space-y-2",children:Z.getOIDCProviders().map((ge,he)=>i.jsx(vt,{provider:ge,type:"oidc"},`oidc-single-${he}`))})})]})]})}};return k?m?i.jsx("div",{className:"w-full",children:y?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:v,onChange:U=>x(U.target.value),placeholder:"Enter new password",disabled:r})}),i.jsx(A.FormItem,{label:"Confirm Password",children:i.jsx(A.PasswordInput,{value:S,onChange:U=>T(U.target.value),placeholder:"Confirm new password",disabled:r})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(A.Button,{type:"primary",onClick:E,loading:r,className:"flex-1",children:"Change Password"}),i.jsx(A.Button,{onClick:()=>{w(!1),x(""),T("")},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:O,children:"Already Logged In"}),i.jsx("p",{className:"text-sm mt-2",style:L,children:"You are currently logged in."})]}),i.jsx(A.Button,{block:!0,onClick:()=>w(!0),children:"Change Password"}),i.jsx(A.Button,{block:!0,danger:!0,onClick:j,loading:r,children:"Logout"})]})}):G():i.jsx("div",{className:"flex justify-center items-center min-h-[300px]",children:i.jsx(A.Spin,{size:"large"})})},PE=({onLogin:e,showRememberMe:t=!0,showForgotPassword:r=!0})=>{const[n,s]=b.useState(!1),[o,a]=b.useState(0),[l,d]=b.useState("email"),{authConfig:c}=ir();b.useEffect(()=>{if(c){const w=Z.getAllowedUsernames();w&&w.length>0&&d(w[0])}},[c]);const u=async w=>{s(!0);try{if(e){const v={email:l==="email"?w.username:void 0,phone:l==="mobile"?w.username:void 0,username:w.username,password:w.password,remember_me:w.remember||!1};await e(v)}}catch(v){A.toast.error(v.message||"Login failed. Please try again.")}finally{s(!1)}},f=()=>{switch(l){case"email":return"Email address";case"mobile":return"Phone number";case"username":return"Username";default:return"Username"}},p=()=>{const w=[{required:!0,message:`Please input your ${l}!`}];switch(l){case"email":return[...w,{type:"email",message:"Please enter a valid email address!"}];case"mobile":return[...w,{pattern:/^\+?[1-9]\d{1,14}$/,message:"Please enter a valid phone number!"}];case"username":return[...w,{min:3,message:"Username must be at least 3 characters long"}];default:return w}};if(!c)return i.jsx("div",{className:"flex justify-center items-center min-h-[300px]",children:"Loading..."});const h=Z.getAllowedUsernames(),m=h.length>1,g=Z.isRememberMeEnabled(),y=Z.isForgotPasswordEnabled();return i.jsxs(A.Form,{name:"login",className:"w-full space-y-4",initialValues:{remember:!1},onFinish:u,autoComplete:"off",layout:"vertical",children:[m&&i.jsx(A.FormItem,{label:"Login with",className:"mb-4",children:i.jsx(A.Select,{value:l,onChange:d,options:h.map(w=>({value:w,label:w==="mobile"?"Phone":w.charAt(0).toUpperCase()+w.slice(1)}))})}),i.jsx(A.FormItem,{name:"username",rules:p(),children:i.jsx(A.Input,{placeholder:f(),autoComplete:l==="email"?"email":"username"})}),i.jsx(A.FormItem,{name:"password",rules:[{required:!0,message:"Please input your password!"},{min:c?.password_policy?.min_length||6,message:`Password must be at least ${c?.password_policy?.min_length||6} characters long`}],children:i.jsx(A.PasswordInput,{placeholder:"Password",autoComplete:"current-password"})}),i.jsx(A.FormItem,{children:i.jsxs(A.Space,{className:"flex justify-between items-center w-full",children:[t&&g&&i.jsx(A.FormItem,{name:"remember",valuePropName:"checked",noStyle:!0,children:i.jsx(A.Checkbox,{label:"Remember me"})}),r&&y&&i.jsx(R.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 h-10 text-base font-medium",disabled:n,fullWidth:!0,children:"Log in"})})]},o)},EE=({layout:e="column",gap:t,className:r,buttonTextPrefix:n="Continue with",buttonTextPostfix:s=""})=>{const[o,a]=b.useState(!0),[l,d]=b.useState(null),{getProvidersConfig:c,getCustomComponents:u}=Qe();if(b.useEffect(()=>{(async()=>{try{const D=await Z.getAuthConfig();d(D)}catch(D){console.error("Failed to load auth config:",D)}finally{a(!1)}})()},[]),o)return i.jsx("div",{className:"flex justify-center items-center p-4",children:i.jsx(A.Spin,{size:"small"})});if(!l)return null;const f=Z.isSSOEnabled(),p=Z.isOIDCEnabled(),h=Z.getSSOProviders(),m=Z.getOIDCProviders();if(!f&&!p||h.length===0&&m.length===0)return null;const y=u()?.ProviderButton,w=[...h.map(N=>({...N,providerType:"sso"})),...m.map(N=>({...N,providerType:"oidc"}))],x=w.length===1,k={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",P=`w-full sso-buttons-container ${(()=>{if(x)return"";switch(e){case"grid":return`grid grid-cols-1 sm:grid-cols-2 ${k}`;case"row":return`flex flex-row flex-wrap ${k}`;case"column":default:return`flex flex-col ${k}`}})()} ${r||""}`.trim();return i.jsx("div",{className:P,children:w.map((N,D)=>{const V=y||vt;return i.jsx(V,{provider:N,type:N.providerType,prefix:n,postfix:s},`${N.providerType}-${D}`)})})},Co=b.createContext(null),Al=()=>b.useContext(Co),Rg=e=>{if(e?.status===401&&e?.data?.next_step)return e.data.next_step;if(e?.next_step)return e.next_step;const t=e?.response?.data||e?.data||e;return t?.next_step?t.next_step:null},TE=({onSuccess:e,showRememberMe:t=!0,submitButtonText:r})=>{const[n,s]=b.useState(!1),[o,a]=b.useState(null),[l,d]=b.useState("email"),[c,u]=b.useState(0),[f,p]=b.useState(!1),{authConfig:h}=ir(),{getLoginConfig:m,getMessagesConfig:g,authConfig:y}=Qe(),w=Al(),v=y||h;bt(v);const x=Lt(v),S=Ug(v);if(b.useEffect(()=>{(async()=>{try{await Z.getAuthConfig();const _=Z.getAllowedUsernames();if(_&&_.length>0){const B=_.includes("email"),F=_.includes("mobile");B?d("email"):F&&d("mobile")}p(!0)}catch(_){console.error("Failed to load auth config:",_),p(!0)}})()},[]),!f)return i.jsx("div",{className:"flex justify-center items-center min-h-[200px]",children:i.jsx(A.Spin,{size:"large"})});const T=Z.getAllowedUsernames(),k=T.includes("email"),M=T.includes("mobile"),P=k&&M,N=L=>{const _=g();return L==="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)"}]},D=async L=>{s(!0),a(null);try{const _=l==="email"?{email:L.username,password:L.password}:{phone:L.username,password:L.password},F={...await Z.login(_),loginUser:{email:l==="email"?L.username:void 0,phone:l==="mobile"?L.username:void 0,username:L.username,display:L.username}},W=Rg(F);if(W&&W.is_pending){if(e){e(F);return}if(w?.onLogin){w.onLogin(F);return}console.warn("PasswordLoginForm: Multi-step auth required but no parent handler found");return}const $=F?.meta?.is_authenticated||F?.response?.meta?.is_authenticated;if((F?.status||F?.response?.status)===200&&$){if(e){e(F);return}if(w?.onLogin){w.onLogin(F);return}const E=nt(window.location.search),z=F?.redirect_url||F?.response?.data?.redirect_url,X=Se(E,z,"/app");_e(X);return}if(e){e(F);return}if(w?.onLogin){w.onLogin(F);return}console.warn("PasswordLoginForm: No onSuccess prop or LoginContext found. Authentication result not handled.")}catch(_){const B=g(),F=_?.response?.data?.message||_?.message||B?.error?.login||"Login failed. Please check your credentials and try again.";a(F)}finally{s(!1)}},V=L=>{const _=m(),B=g();return i.jsxs(A.Form,{name:`${L}-password-login`,className:"w-full",onFinish:D,layout:"vertical",initialValues:{remember:!1,username:""},children:[o&&i.jsx(A.Alert,{message:o,type:"error",showIcon:!0,closable:!0,onClose:()=>a(null),className:"mb-4"}),i.jsx(A.FormItem,{name:"username",rules:N(L),children:i.jsx(A.Input,{placeholder:L==="email"?_?.formPlaceholders?.email||"Email address":_?.formPlaceholders?.mobile||"Mobile number (+919876543210)",autoComplete:L==="email"?"email":"tel",onKeyDown:L==="mobile"?F=>{const W=["Backspace","Delete","Tab","Enter","ArrowLeft","ArrowRight"],$=F.key;!W.includes($)&&!F.ctrlKey&&!F.metaKey&&!/[0-9+]/.test($)&&F.preventDefault()}:void 0})}),i.jsx(A.FormItem,{name:"password",rules:[{required:!0,message:B?.validation?.required||"Please input your password!"},{min:h?.password_policy?.min_length||6,message:B?.validation?.passwordTooShort||`Password must be at least ${h?.password_policy?.min_length||6} characters long`}],children:i.jsx(A.PasswordInput,{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&&Z.isRememberMeEnabled()&&i.jsx(A.FormItem,{name:"remember",valuePropName:"checked",noStyle:!0,children:i.jsx("div",{className:"auth-remember-me",style:x,children:i.jsx(A.Checkbox,{label:_?.rememberMeText||"Remember me"})})})}),i.jsx("div",{children:Z.isForgotPasswordEnabled()&&i.jsx(R.Link,{to:"forgot-password",className:"text-sm transition-colors duration-300",style:S,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"})})]},`${L}-${c}`)};if(P){const L=[...k?[{key:"email",label:"Email",children:V("email")}]:[],...M?[{key:"mobile",label:"Mobile",children:V("mobile")}]:[]];return i.jsx("div",{className:"w-full",children:i.jsx(A.Tabs,{activeKey:l,onChange:_=>{d(_),u(B=>B+1),a(null)},items:L,className:"password-login-tabs"})})}return V(k?"email":"mobile")},AE=({onSuccess:e,onBack:t,submitButtonText:r,verifyButtonText:n,resendButtonText:s})=>{const o=Al(),a=l=>{const d=Rg(l);if(d&&d.is_pending){if(e){e(l);return}if(o?.onLogin){o.onLogin(l);return}console.warn("OTPLoginForm: Multi-step auth required but no parent handler found");return}const c=l?.meta?.is_authenticated||l?.response?.meta?.is_authenticated;if((l?.status||l?.response?.status)===200&&c){const f=nt(window.location.search),p=l?.redirect_url||l?.response?.data?.redirect_url,h=Se(f,p,"/app");_e(h);return}if(e){e(l);return}if(o?.onLogin){o.onLogin(l);return}console.warn("OTPLoginForm: No onSuccess prop or LoginContext found. Authentication result not handled.")};return i.jsx(Tl,{onSuccess:a,onBack:t,submitButtonText:r,verifyButtonText:n,resendButtonText:s})},kE=({onLogin:e,logo:t,title:r,subtitle:n,apiConfig:s={},useDynamicConfig:o=!0,staticConfig:a=null})=>{const[l,d]=R.useSearchParams();R.useNavigate();const[c,u]=b.useState(null),[f,p]=b.useState(o),[h,m]=b.useState(null),g=b.useRef(!1),y=l.get("token"),w=l.get("request_id");l.get("next");const v=!!(y&&w);b.useLayoutEffect(()=>{if(g.current)return;const F=sessionStorage.getItem("saml_error");if(F){g.current=!0,sessionStorage.removeItem("saml_error");try{const W=JSON.parse(F);A.toast.error(W.message,{duration:5e3})}catch(W){console.error("Failed to parse SAML error:",W)}}},[]);const{authConfig:x,getCustomComponents:S}=Qe(),T=S(),k=or(x),M=wt(x),P=bt(x),N=Lt(x),D=Ar(x),V=Tr(x),O=T?.LoginPage,L=T?.LoginCard,_=async()=>{try{const F=await Z.getAuthConfig();u(F),m(null)}catch(F){console.error("Failed to fetch login methods:",F),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}}),m(null),console.warn("Using default auth configuration due to config fetch failure")}finally{p(!1)}};if(b.useEffect(()=>{o&&!a?_():a&&(u(a),p(!1))},[o,a]),v)return i.jsx(Kg,{logo:t,title:r||"Processing Authentication",subtitle:n||"Please wait while we complete your login",onAuthComplete:F=>{const W=F?.redirect_url||"/app";try{const $=new URL(W,window.location.origin);$.searchParams.delete("token"),$.searchParams.delete("request_id");const j=$.pathname+($.search?$.search:"");_e(j)}catch{_e(W)}},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 B=()=>f?i.jsx("div",{className:"flex justify-center items-center min-h-[300px]",children:i.jsx(A.Spin,{size:"large",tip:"Loading login methods..."})}):h?i.jsx(A.Alert,{message:"Error",description:h,type:"error",showIcon:!0,action:i.jsx("a",{onClick:_,children:"Retry"})}):c&&o?i.jsx(SE,{onLogin:e}):i.jsx(PE,{onLogin:e});return O&&!y&&!w?i.jsx(O,{}):L?i.jsx(Co.Provider,{value:{onLogin:e||(()=>{})},children:i.jsx(A.Layout,{className:"min-h-screen",style:M,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:k,children:i.jsx(L,{})})})})}):i.jsx(A.Layout,{className:"min-h-screen",style:M,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:k,children:[t&&i.jsx("div",{className:D.className,style:D.style,children:typeof t=="string"?i.jsx("img",{src:t,alt:x?.logo?.alt||"Logo",className:"max-w-[150px] h-auto",style:V}):t}),i.jsxs("div",{className:"text-center mb-[18px]",children:[i.jsx("h1",{className:"text-3xl font-semibold mb-2",style:P,children:r||"Welcome Back"}),n&&i.jsx("p",{className:"text-base",style:N,children:n})]}),B()]})})})},{Content:_E}=A.Layout,ME=Object.freeze({__proto__:null,default:({logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:s=!0,staticConfig:o=null,onLoginSuccess:a,roleSelectionTitle:l,roleSelectionSubtitle:d,initialAuthResult:c=null})=>{const{pendingAuth:u,availableRoles:f,selectRole:p,login:h}=ir(),[m,g]=b.useState(null);b.useEffect(()=>{c&&y(c)},[c]);const y=async v=>{g(null);try{if(v&&(v.status||v.data||v.next_step||v.response)){a&&a(v);return}const x=await h(v),S={email:v.email,username:v.username,phone:v.phone,display:v.email||v.username||v.phone};if(x.requiresRoleSelection)return;a&&a({...x,loginUser:S})}catch(x){throw g(x.message),x}},w=async v=>{try{const x=await p(v);a&&a(x)}catch(x){throw console.error("Role selection failed:",x),x}};if(u&&f){const v=wt(n||o||{});return i.jsx(A.Layout,{className:"min-h-screen",style:v,children:i.jsx(_E,{className:"flex justify-center items-center min-h-screen p-5",children:i.jsx(vl,{user:u.user,roles:f,onRoleSelect:w,title:l,subtitle:d})})})}return i.jsx(kE,{onLogin:y,logo:e,title:t,subtitle:r,apiConfig:n,useDynamicConfig:s,staticConfig:o})}}),So=({basePath:e="/app"})=>{const t=Fn();return i.jsx("div",{className:"page-container",children:i.jsx(uE,{basePath:e,apiConfig:t})})},NE=async(e=[])=>{const t=ZP(e),r={login:{component:So,includeBasePath:!0,standalone:!0,propsBuilder:({matchedRoutePath:s})=>({basePath:s})},custom:{component:null,includeBasePath:!1,handler:({customPages:s,customPagePath:o,location:a,matchedRoute:l})=>{const d=l||o&&{path:null,component:o},c=s[o];return c?b.createElement(c,{routeConfig:d,location:a}):b.createElement(rl,{componentName:o,routeConfig:d,location:a})}},404:{component:Dn,standalone:!0,includeBasePath:!1,propsBuilder:()=>({})},default:{component:Dn,includeBasePath:!1,standalone:!0,propsBuilder:({pageType:s})=>({message:`Unknown page type: ${s}`})}};for(const s of t){const o=JP(s);o?r[s]={component:o,includeBasePath:!0,propsBuilder:({matchedRoutePath:a})=>({basePath:a})}:console.warn(`⚠️ Failed to get component for page type: ${s}`)}t.length;const n=e.filter(s=>!t.includes(s));return n.length>0&&console.warn(`⚠️ Unconfigured page types (not in PAGE_CONFIG): ${n.join(", ")}`),r},LE=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)},ey=async e=>{const t=LE(e);return NE(t)},ty=b.createContext(void 0),qe=()=>{const e=b.useContext(ty);if(!e)throw new Error("useAppContext must be used within AppProvider");return e},ry=({children:e,config:t={},layoutConfig:r={},topbarConfig:n={},navbarConfig:s={},customComponents:o={},authConfig:a={}})=>{const l=R.useNavigate(),d=R.useLocation(),c=b.useRef(!1),[u,f]=b.useState(null),[p,h]=b.useState(!0),[m,g]=b.useState(null),[y,w]=b.useState(null),[v,x]=b.useState(null),[S,T]=b.useState(!1),[k,M]=b.useState(null),P=()=>typeof window<"u"&&window.app_initializer_endpoint?window.app_initializer_endpoint:"/app/initializer",N=t,D=N.apiConfig||{};b.useEffect(()=>{const O={colors:{primary:"#5048ed",secondary:"#6d7280",success:"#10b981",warning:"#f59e0b",error:"#f04438",gray:"#6d7280",background:"#f9fafb",text:"#252b37"}},L="default-theme-variables";let _=document.getElementById(L);_||(_=document.createElement("style"),_.id=L,document.head.appendChild(_)),_.innerHTML=`:root { ${io(O)} }`},[]),b.useEffect(()=>{const O=vr.getCachedLogo();O&&w(O.base64Data||O.url)},[]),b.useEffect(()=>((async()=>{if(window.location.pathname.startsWith("/app/login"),!c.current){c.current=!0;try{const _=await pm(),B=_.success?_.response:null;if(!_.success)throw new Error(_.response?.message||"Failed to fetch app data");if(f(B),B?.theme){const F=document.getElementById("default-theme-variables");if(F)F.innerHTML=`:root { ${io(B.theme)} }`;else{const W=document.createElement("style");W.id="default-theme-variables",W.innerHTML=`:root { ${io(B.theme)} }`,document.head.appendChild(W)}B?.app_logo&&vr.updateInBackground(B.app_logo,B.app_name,W=>{W.base64Data&&w(W.base64Data)})}}catch(_){console.error("❌ fetchAppInitData error:",_),g(_.message)}finally{h(!1),c.current=!1}}})(),()=>{}),[]),b.useEffect(()=>{if(p||!u)return;const O=d.pathname,L=d.search,_=O==="/app/configuration-error",B=O==="/app/logout",F=H=>{if(!H)return"";const q=new URLSearchParams(H);q.delete("token"),q.delete("request_id");const J=q.toString();return J?`?${J}`:""},W=F(L);if(W!==L&&!B){l(O+W,{replace:!0});return}if(B)return;const $=u.menu&&u.menu.length>0,j=u.routes&&u.routes.length>0;u.profile_info?.user_role;const E=u.is_user_anonymous,z=!u.is_user_anonymous,X=j&&u.routes.some(H=>{const q=H.path;if(O===q)return!0;if(q?.includes(":")){const J=q.replace(/:[^/]+/g,"[^/]+");if(new RegExp(`^${J}(/.*)?$`).test(O))return!0}return!!O.startsWith(q+"/")}),G=H=>{const q=F(L),J=q?`${H}${q}`:H;l(J,{replace:!0})};if(z&&!$&&!_){G("/app/configuration-error");return}const U=O==="/app/login"||O.startsWith("/app/login/");if(E&&!$&&!U){const H=new URLSearchParams(L);O!=="/app"&&O!=="/app/"&&H.set("next",O+L);const q=H.toString();l(`/app/login${q?`?${q}`:""}`,{replace:!0});return}if($&&u.menu){if(sessionStorage.getItem("saml_auth_in_progress")){sessionStorage.removeItem("saml_auth_in_progress");return}const q=u.menu[0]?.path||u.menu[0]?.uri;if(O==="/app"||O==="/app/"||!X&&!_){const ne=nt(L);if(ne&&rt(ne)){l(ne,{replace:!0});return}if(q){G(q);return}}}},[p,u,d.pathname,d.search,l]),b.useEffect(()=>{let O=!1;return(async()=>{if(!p&&u){if(u.is_user_anonymous){const{default:_}=await Promise.resolve().then(function(){return lT});if(u.routes&&u.routes.length>0)try{O||T(!0);const B=await ey(u.routes);O||(x(B),T(!1));return}catch(B){console.error("❌ Failed to create registry from routes for anonymous user:",B)}O||(x(_),T(!1));return}if(!u.routes||u.routes.length===0){O||(x({login:{component:null},custom:{component:null},404:{component:null},default:{component:null}}),T(!1));return}try{O||(T(!0),M(null));const _=await ey(u.routes);O||(x(_),T(!1))}catch(_){console.error("❌ Failed to create dynamic page registry:",_),O||(M(_.message||"Failed to create page registry"),x({login:{component:null},custom:{component:null},404:{component:null},default:{component:null}}),T(!1))}}})(),()=>{O=!0}},[u,p]);const V={appData:u,loading:p,error:m,config:N,apiConfig:D,menu:u?.menu||[],routes:u?.routes||[],profileInfo:u?.profile_info||{},appLogo:y||u?.app_logo||"",appName:u?.app_name||"Zango CRM",metadata:u?.metadata||{},theme:u?.theme||{},layoutConfig:r,topbarConfig:n,navbarConfig:s,customComponents:o,authConfig:a,sessionSecurity:u?.session_security_config||null,pageTypeRegistry:v,registryLoading:S,registryError:k,initializerEndpoint:P()};return i.jsx(ty.Provider,{value:V,children:e})},kl=()=>{const e=R.useNavigate(),{routes:t}=qe(),r=b.useCallback(s=>{if(!s)return!1;const o=s.endsWith("/")&&s!=="/"?s.slice(0,-1):s;return t.some(a=>{const l=a.path,d=l.endsWith("/")&&l!=="/"?l.slice(0,-1):l;if(d===o)return!0;if(d.includes(":")){const c=d.split("/").map(f=>f.startsWith(":")?"[^/]+":f).join("/");return new RegExp(`^${c}(/.*)?$`).test(o)}return a.exact===!1?o.startsWith(d):!1})},[t]);return{navigateTo:b.useCallback((s,o={})=>{if(s){if(s.startsWith("http://")||s.startsWith("https://")){o.newTab?window.open(s,"_blank"):window.location.href=s;return}r(s)?e(s,o):o.newTab?window.open(s,"_blank"):window.location.href=s}},[e,r]),isInternalRoute:r}},kr=b.forwardRef(({to:e,children:t,className:r,onClick:n,...s},o)=>{const{isInternalRoute:a}=kl(),l=c=>{n&&n(c)};return!(e&&(e.startsWith("http://")||e.startsWith("https://")))&&a(e)?i.jsx(R.Link,{ref:o,to:e,className:r,onClick:l,...s,children:t}):i.jsx("a",{ref:o,href:e,className:r,onClick:l,...s,children:t})});kr.displayName="SmartLink";const OE=i.jsxs("svg",{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"})]}),FE=/^[\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,Po=({item:e})=>e.icon?e.icon.includes("<svg")?i.jsx("span",{className:"navbar-icon",dangerouslySetInnerHTML:{__html:e.icon}}):FE.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:OE}),DE=({appLogo:e,appName:t,linkTo:r="/app",collapsed:n=!1})=>{if(n){const s=t?t.charAt(0).toUpperCase():"A";return i.jsx("div",{className:"navbar-logo-container frame-logo-container",children:i.jsx(kr,{to:r,style:{textDecoration:"none"},children:i.jsx("div",{className:"collapsed-logo-initial",style:{width:"32px",height:"32px",backgroundColor:"var(--color-brand-500, #5048ED)",color:"white",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",fontWeight:"bold"},children:s})})})}return i.jsx("div",{className:"navbar-logo-container frame-logo-container",children:i.jsx(Yp,{logoUrl:e,appName:t,height:"28px",linkTo:r})})};function IE(e,t){const r=e.url||e.uri,n=r?.endsWith("/")?r:`${r}/`,s=t.endsWith("/")?t:`${t}/`;return s.startsWith(n)?!0:e.children?.length?e.children.some(o=>{const a=o.url||o.uri,l=a?.endsWith("/")?a:`${a}/`;return s.startsWith(l)}):!1}const VE=({item:e,isActive:t,location:r,isDark:n})=>{const[s,o]=b.useState(t),{state:a}=Zr(),l=a==="collapsed";return b.useEffect(()=>{l&&o(!1)},[l]),l?i.jsx(Zi,{className:ue("menu-list-item menu-list-item-with-sub-menu",t&&"active"),children:i.jsxs(nP,{children:[i.jsx(sP,{asChild:!0,children:i.jsx(Ji,{isActive:t,tooltip:e.name,className:"menu-item",children:i.jsx(Po,{item:e})})}),i.jsxs(oP,{side:"right",align:"start",className:ue("min-w-[180px]",n&&"sidebar-dropdown-dark"),children:[i.jsx(iP,{children:e.name}),i.jsx(lP,{}),e.children.map(d=>{const c=d.url||d.uri,u=r.pathname===c||r.pathname===`${c}/`;return i.jsx(aP,{asChild:!0,children:i.jsx(kr,{to:c,className:u?"font-semibold":"",children:d.name})},c)})]})]})}):i.jsx(eP,{open:s,onOpenChange:o,className:"group/collapsible",children:i.jsxs(Zi,{className:ue("menu-list-item menu-list-item-with-sub-menu",t&&"active"),children:[i.jsx(tP,{asChild:!0,children:i.jsxs(Ji,{isActive:t,tooltip:e.name,className:"menu-item",children:[i.jsx(Po,{item:e}),i.jsx("span",{className:"menu-title",children:e.name}),i.jsx(Ku.div,{className:"ml-auto",animate:{rotate:s?180:0},transition:{type:"spring",stiffness:300,damping:25},children:i.jsx(Ny,{className:"h-4 w-4"})})]})}),i.jsx(k1,{initial:!1,children:s&&i.jsx(rP,{forceMount:!0,children:i.jsx(Ku.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",stiffness:300,damping:30},style:{overflow:"hidden"},children:i.jsx(JS,{className:"submenu-list",children:e.children.map(d=>{const c=d.url||d.uri,u=r.pathname===c||r.pathname===`${c}/`;return i.jsx(QS,{className:ue("submenu-list-item",u&&"active"),children:i.jsx(RS,{asChild:!0,isActive:u,children:i.jsxs(kr,{to:c,children:[i.jsx("span",{className:"submenu-arrow-slot",children:u&&i.jsx("svg",{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:d.name})]})})},c)})})})})})]})})},BE=({menuItems:e=[],isDark:t=!1})=>{const r=R.useLocation();return i.jsx(YS,{id:"wideSidebarMenu",children:e.map(n=>{const s=n.url||n.uri,o=IE(n,r.pathname);return n.children&&n.children.length>0?i.jsx(VE,{item:n,isActive:o,location:r,isDark:t},n.name):i.jsx(Zi,{className:ue("menu-list-item",o&&"active"),children:i.jsx(Ji,{asChild:!0,isActive:o,tooltip:n.name,className:"menu-item",children:i.jsxs(kr,{to:s,children:[i.jsx(Po,{item:n}),i.jsx("span",{className:"menu-title",children:n.name})]})})},n.name)})})},ny=({menuItems:e=[],appLogo:t,config:r={}})=>{const{appName:n}=qe(),{state:s}=Zr(),o=s==="collapsed",{showLogo:a=!0,showMenu:l=!0,collapsible:d=!1,customLogo:c=null,customMenuContent:u=null,customBottomContent:f=null,customNavbar:p=null,customMenu:h=null,theme:m="light",className:g="",style:y={}}=r,w=m==="dark";if(p)return p;const v=w?{"--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)"}:{};return i.jsxs(zS,{collapsible:d?"icon":"none",className:ue("navbar",w&&"sidebar-theme-dark",o&&"collapsed-sidebar",g),style:{...v,...y},children:[i.jsxs(KS,{children:[a&&(c?i.jsx("div",{className:"navbar-logo-container frame-logo-container",children:c}):i.jsx(DE,{appLogo:t,appName:n,collapsed:o})),d&&i.jsx("div",{className:o?"flex justify-center py-1":"flex justify-end px-3 pb-1",children:i.jsx(HS,{className:"navbar-toggle-btn"})})]}),i.jsxs(XS,{className:"navbar-menu-container",children:[i.jsx(Gp,{children:i.jsx(Xp,{children:l&&(h||i.jsx(BE,{menuItems:e,isDark:w}))})}),u&&i.jsx(Gp,{children:i.jsx(Xp,{children:u})})]}),f&&i.jsx(GS,{children:f}),d&&i.jsx(WS,{})]})},UE=(e=!0)=>{const[t,r]=b.useState(null),[n,s]=b.useState(!1),[o,a]=b.useState(null),[l,d]=b.useState(!1),[c,u]=b.useState(!1),f=async()=>{if(!(!e||t&&!l)){s(!0),a(null);try{const h=await mm();if(h.success&&h.response){const m=h.response.profile_data||h.response;h.response.password_policy&&!m.password_policy&&(m.password_policy=h.response.password_policy),u(h.response.should_set_password||!1),r(m),a(null)}else{const m=h.response?.message||"Failed to fetch profile data";a(m),console.error("Profile API Error:",h)}}catch(h){const m=h.message||"Network error while fetching profile";a(m),console.error("Profile fetch error:",h)}finally{s(!1),d(!0)}}},p=()=>{d(!1),f()};return b.useEffect(()=>{e&&!l&&f()},[e]),{profileData:t,loading:n,error:o,refetch:p,shouldSetPassword:c}},Ot=(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};`)},_l=e=>{const t=e+"=",r=document.cookie.split(";");for(let n=0;n<r.length;n++){let s=r[n];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return s.substring(t.length,s.length)}return null},sy=(e,t,r=null,n="/",s=null)=>{let o="";if(r){const d=new Date;d.setTime(d.getTime()+r*24*60*60*1e3),o="; expires="+d.toUTCString()}const a=window.location.protocol==="https:"?"; Secure":"";let l=`${e}=${t}${o}; path=${n}${a}; SameSite=Lax`;s&&(l+=`; domain=${s}`),document.cookie=l},oy=()=>{const e=_l("zangocookie");return e!==null&&e!==""},ay=Object.freeze({__proto__:null,deleteCookie:Ot,getCookie:_l,isAuthenticatedViaCookie:oy,setCookie:sy}),Ml=async(e={})=>{try{const t=await xm();if(t.success||t.responseStatus===401){Ot("zangocookie","/"),Ot("zangocookie","/app"),Ot("zangocookie","/app/"),Ot("zangocookie");const r=window.location.hostname;if(Ot("zangocookie","/",r),Ot("zangocookie","/app",r),r.includes(".")){const o="."+r.split(".").slice(-2).join(".");Ot("zangocookie","/",o),Ot("zangocookie","/app",o)}localStorage.removeItem("authToken"),localStorage.clear(),sessionStorage.clear();const n=rt(e.redirectUrl)?e.redirectUrl:rt(e.theme?.login_url)?e.theme.login_url:"/app/login";let s=n;if(e.preserveCurrentPath){const o=window.location.pathname+window.location.search,a=n.includes("?")?"&":"?";s=`${n}${a}next=${encodeURIComponent(o)}`}setTimeout(()=>{window.location.href=s},100)}else A.toast.error({title:"Logout Failed",description:t.response?.message||"Unable to logout. Please try again.",duration:5e3})}catch(t){console.error("Logout error:",t),A.toast.error({title:"Logout Error",description:"An error occurred while logging out. Please try again.",duration:5e3});const r=rt(e.redirectUrl)?e.redirectUrl:rt(e.theme?.login_url)?e.theme.login_url:"/app/login";let n=r;if(e.preserveCurrentPath){const s=window.location.pathname+window.location.search,o=r.includes("?")?"&":"?";n=`${r}${o}next=${encodeURIComponent(s)}`}setTimeout(()=>{window.location.href=n},100)}},iy=e=>{const t=document.createElement("div");t.style.cssText=`
|
|
245
245
|
position: fixed;
|
|
246
246
|
top: 0;
|
|
247
247
|
left: 0;
|
|
@@ -294,7 +294,7 @@ export default App;`,h=`mkdir -p ${d}`,m={container:{padding:"32px",maxWidth:"90
|
|
|
294
294
|
transition: all 0.15s ease;
|
|
295
295
|
">Log Out</button>
|
|
296
296
|
</div>
|
|
297
|
-
`;const n=r.querySelector("#cancel-logout"),s=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"}),s.addEventListener("mouseenter",()=>{s.style.backgroundColor="#b91c1c"}),s.addEventListener("mouseleave",()=>{s.style.backgroundColor="#dc2626"});const o=l=>{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),l?.()},200)};n.addEventListener("click",()=>o()),s.addEventListener("click",()=>o(e)),t.addEventListener("click",l=>{l.target===t&&o()});const a=l=>{l.key==="Escape"&&o()};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()})},ly=({isOpen:e,onClose:t})=>{const[r,n]=b.useState("account"),[s,o]=b.useState(!1),[a,l]=b.useState(!1),[d,c]=b.useState(null),[u,f]=b.useState(!1),[p,h]=b.useState(!0),[m,g]=b.useState([]),[y,w]=b.useState(!1),[v,x]=b.useState(null),[S,T]=b.useState([]),[k,M]=b.useState(null),{appData:P}=qe(),{profileData:N,loading:D,error:V,refetch:O,shouldSetPassword:L}=BE(e),[_,B]=b.useState({name:"",email:"",mobile:"",roles:[],currentRole:"",lastPasswordChange:"Never",nextPasswordDue:null}),[F,W]=b.useState({currentPassword:"",newPassword:"",confirmPassword:""}),[$,j]=b.useState({}),[E,z]=b.useState({}),[X,G]=b.useState(""),[U,H]=b.useState(!1),[q,J]=b.useState(null),[ne,se]=b.useState({minLength:!1,hasUpperCase:!1,hasLowerCase:!1,hasNumber:!1,hasSpecialChar:!1}),Pe=async()=>{w(!0),x(null);try{const Y=await gm();if(Y.success&&Y.response){const ae=Y.response.data||Y.response;g(ae),x(null)}else{const ae=Y.response?.message||"Failed to fetch sessions";x(ae),console.error("Sessions API Error:",Y)}}catch(Y){const ae=Y instanceof Error?Y.message:"Network error while fetching sessions";x(ae),console.error("Sessions fetch error:",Y)}finally{w(!1)}};b.useEffect(()=>{if(N){let Y=N.last_password_changed||"Never",ae=null;if(N.last_password_changed&&N?.password_policy?.password_expiry_days){const Nl=new Date(N.last_password_changed),Ft=new Date(Nl);Ft.setDate(Ft.getDate()+N.password_policy.password_expiry_days),Ft>new Date?ae=Ft.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):ae="Expired"}B({name:N.name||"",email:N.email||"",mobile:N.mobile||"",roles:N.roles||[],currentRole:P?.profile_info?.user_role||N.roles?.[0]?.name||"Admin",lastPasswordChange:Y,nextPasswordDue:ae}),f(N.auth_config?.two_factor_auth?.required||!1);const de=N?.can_set_password;h(de),N.profile_pic&&c(N.profile_pic);let pe=null;N.auth_config?.password_policy?pe=N.auth_config.password_policy:N.password_policy&&(pe=N.password_policy),pe&&M(pe),N.tokens&&T(N.tokens)}N&&N.tokens&&T(N.tokens),P?.sessions?.tokens&&T(P.sessions.tokens),P?.password_policy&&M(P.password_policy)},[N,P]);const ve=(Y,ae)=>{const de=Y.user_agent||Y.browser_agent||"Unknown Browser",pe=Y.ip||Y.location||"Unknown Location",Nl=Y.created_at,Ft=Y.last_seen_at,Cy=je=>je.includes("Chrome")?"Chrome":je.includes("Firefox")?"Firefox":je.includes("Safari")?"Safari":je.includes("Edge")?"Edge":"Unknown Browser",pT=je=>je.includes("Mac")?"macOS":je.includes("Windows")?"Windows":je.includes("Linux")?"Linux":je.includes("iPhone")||je.includes("iOS")?"iOS":je.includes("Android")?"Android":"Unknown OS",Sy=je=>{if(!je)return"Unknown";const Ll=je.replace(" IST",""),Ol=new Date(Ll),yT=new Date().getTime()-Ol.getTime(),Ao=Math.floor(yT/1e3),ko=Math.floor(Ao/60),_o=Math.floor(ko/60),Fl=Math.floor(_o/24);return Fl>0?`${Fl} day${Fl>1?"s":""} ago`:_o>0?`${_o} hour${_o>1?"s":""} ago`:ko>0?`${ko} minute${ko>1?"s":""} ago`:Ao>0?`${Ao} second${Ao>1?"s":""} ago`:"Just now"},mT=Cy(de),Py=pT(de),gT=()=>{if(Y.is_current)return!0;if(!Ft)return!1;const je=typeof Ft=="string"?Ft.replace(" IST",""):Ft,Ll=new Date(je),Ol=new Date(Date.now()-3600*1e3);return Ll>Ol};return{...Y,deviceName:`${mT} on ${Py}`,os:Py,location:pe==="127.0.0.1"?"Local Device":pe,sessionStartTime:Sy(Nl),lastSeen:Sy(Ft),isActive:gT()}};b.useEffect(()=>{const{newPassword:Y}=F;se(k?{minLength:Y.length>=(k.min_length||8),hasUpperCase:k.require_uppercase?/[A-Z]/.test(Y):!0,hasLowerCase:k.require_lowercase?/[a-z]/.test(Y):!0,hasNumber:k.require_numbers?/[0-9]/.test(Y):!0,hasSpecialChar:k.require_special_chars?/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(Y):!0}:{minLength:Y.length>=8,hasUpperCase:/[A-Z]/.test(Y),hasLowerCase:/[a-z]/.test(Y),hasNumber:/[0-9]/.test(Y),hasSpecialChar:/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(Y)})},[F.newPassword,k]);const[ge,he]=b.useState(e);b.useEffect(()=>{e&&!ge&&(O&&O(),Pe(),o(!1),l(!1),j({}),z({}),G(""),W({currentPassword:"",newPassword:"",confirmPassword:""})),he(e)},[e,ge,O]),b.useEffect(()=>{r==="security"&&e&&Pe()},[r,e]);const Me=Y=>{const{name:ae,value:de}=Y.target;B(pe=>({...pe,[ae]:de})),j(pe=>({...pe,[ae]:""}))},nn=Y=>{const{name:ae,value:de}=Y.target;W(pe=>({...pe,[ae]:de})),z(pe=>({...pe,[ae]:""}))},To=()=>{const Y={};return _.name.trim()||(Y.name="Name is required"),Y},by=async Y=>{const ae=Y.target.files?.[0];if(ae){const de=new FormData;de.append("profile_pic",ae);try{const pe=await so(de);pe.success?(c(pe.response?.profile_pic||URL.createObjectURL(ae)),G("Profile photo updated successfully!")):G(pe.response?.message||"Failed to upload photo")}catch{G("Failed to upload photo")}}},vy=async()=>{try{const Y=!u,ae={two_factor_auth:{required:Y}},de=new FormData;de.append("auth_config",JSON.stringify(ae));const pe=await so(de);pe.success?(f(Y),G(`Two-factor authentication ${Y?"enabled":"disabled"}`),A.toast.success({title:"Two-Factor Authentication Updated",description:`Two-factor authentication ${Y?"enabled":"disabled"} successfully`,duration:3e3})):(G(pe.response?.message||"Failed to update two-factor authentication"),A.toast.error({title:"Update Failed",description:pe.response?.message||"Failed to update two-factor authentication",duration:5e3}))}catch{G("Failed to update two-factor authentication"),A.toast.error({title:"Update Error",description:"An error occurred while updating two-factor authentication",duration:5e3})}},xy=async Y=>{try{const ae=await bm(Y);ae.success?(Pe(),G("Session logged out successfully")):G(ae.response?.message||"Failed to logout session")}catch{G("Failed to logout session")}},lT=async()=>{try{const Y=m.filter(de=>!de.is_current).map(de=>de.id),ae=await vm(Y);ae.success?(G("All other sessions logged out successfully"),Pe()):G(ae.response?.message||"Failed to logout all sessions")}catch{G("Failed to logout all sessions")}},cT=()=>{const Y={};return!L&&!F.currentPassword&&(Y.currentPassword="Current password is required"),F.newPassword?Object.values(ne).some(de=>!de)&&(Y.newPassword="Password must meet all requirements"):Y.newPassword=L?"Password is required":"New password is required",F.newPassword!==F.confirmPassword&&(Y.confirmPassword="Passwords do not match"),Y},dT=async Y=>{Y.preventDefault();const ae=To();if(Object.keys(ae).length>0){j(ae);return}H(!0),G("");try{const de=new FormData;de.append("name",_.name);const pe=await so(de);pe.success?(G("Name updated successfully!"),o(!1),setTimeout(()=>{G("")},3e3)):G(pe.response?.message||"Failed to update name")}catch{G("An error occurred. Please try again.")}finally{H(!1)}},uT=async Y=>{Y.preventDefault();const ae=cT();if(Object.keys(ae).length>0){z(ae);return}H(!0),G("");try{const de={new_password:F.newPassword};L||(de.current_password=F.currentPassword);const pe=await ym(de);pe.success?(G(L?"Password set successfully!":"Password changed successfully!"),W({currentPassword:"",newPassword:"",confirmPassword:""}),l(!1),O&&O(),setTimeout(()=>{G("")},3e3)):G(pe.response?.message||"Failed to change password")}catch{G("An error occurred. Please try again.")}finally{H(!1)}},fT=async Y=>{J(Y);try{const ae=await wm(Y);ae.success?(A.toast.success({title:"Role Switched",description:"Role switched successfully! Redirecting...",duration:2e3}),setTimeout(()=>{window.location.href="/app"},1e3)):(A.toast.error({title:"Role Switch Failed",description:ae.response?.message||"Failed to switch role",duration:5e3}),J(null))}catch{A.toast.error({title:"Role Switch Error",description:"An error occurred while switching role",duration:5e3}),J(null)}},hT=()=>{iy(()=>{Ml({redirectUrl:"/app/login"})})};return i.jsxs("div",{className:`user-profile-drawer ${e?"open":""}`,children:[i.jsx("div",{className:"profile-header-gradient",children:i.jsx("button",{className:"profile-close-btn",onClick:t,children:i.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})}),D&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"2rem"},children:[i.jsx(A.Spin,{size:"large"}),i.jsx("span",{style:{marginLeft:"12px",color:"#6b7280"},children:"Loading profile..."})]}),U&&i.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:i.jsxs("div",{style:{backgroundColor:"white",padding:"2rem",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 10px 25px rgba(0, 0, 0, 0.1)"},children:[i.jsx(A.Spin,{size:"large"}),i.jsx("span",{style:{marginLeft:"12px",color:"#6b7280",fontSize:"16px"},children:"Updating password..."})]})}),V&&!D&&i.jsxs("div",{style:{margin:"1rem 1.5rem",padding:"1rem",backgroundColor:"#fef2f2",border:"1px solid #fecaca",borderRadius:"8px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[i.jsx("svg",{style:{height:"20px",width:"20px",color:"#f87171",marginRight:"8px"},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",{style:{color:"#b91c1c",fontWeight:"500"},children:"Failed to load profile"})]}),i.jsx("p",{style:{color:"#dc2626",fontSize:"14px",marginTop:"4px",marginBottom:"8px"},children:V}),i.jsx("button",{onClick:O,style:{fontSize:"14px",color:"#dc2626",textDecoration:"underline",background:"none",border:"none",cursor:"pointer"},children:"Try again"})]}),!D&&!V&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"profile-info-section",children:[i.jsx("div",{className:"profile-avatar-container",children:i.jsxs("div",{className:"profile-avatar-circle",children:[d?i.jsx("img",{src:d,alt:"Profile",className:"profile-avatar-img"}):_.name?i.jsx("span",{className:"profile-initials",children:_.name.split(" ").map(Y=>Y[0]).join("").toUpperCase().slice(0,2)}):i.jsx("svg",{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:by,hidden:!0}),i.jsx("svg",{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.jsxs("div",{className:"profile-name-section",children:[i.jsx("h2",{className:"profile-user-name",children:_.name||"Welcome!"}),i.jsxs("div",{className:"profile-user-role-badge",children:[i.jsxs("svg",{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:_.currentRole})]})]})]}),i.jsx("div",{className:"profile-main-content",children:i.jsxs("div",{className:"profile-content-wrapper",children:[i.jsxs("div",{className:"profile-tabs",children:[i.jsx("button",{className:`profile-tab ${r==="account"?"active":""}`,onClick:()=>{n("account"),o(!1),G("")},children:"Account"}),i.jsx("button",{className:`profile-tab ${r==="security"?"active":""}`,onClick:()=>{n("security"),l(!1),G("")},children:"Security"})]}),X&&i.jsx("div",{className:`profile-alert ${X.includes("successfully")?"success":"error"}`,children:i.jsx("span",{children:X})}),$.general&&i.jsx("div",{className:"profile-alert error",children:i.jsx("span",{children:$.general})}),i.jsx("div",{className:"profile-tab-content",children:r==="account"?i.jsxs("div",{className:"account-section",children:[!_.name&&!_.email&&!_.mobile&&i.jsxs("div",{className:"welcome-banner",children:[i.jsxs("svg",{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."})]}),i.jsxs("div",{className:"profile-field-section",children:[i.jsxs("div",{className:"profile-field-header",children:[i.jsx("label",{className:"profile-field-label",children:"Name"}),!s&&i.jsx("button",{className:"profile-field-edit-btn",onClick:()=>o(!0),children:"Edit"})]}),s?i.jsxs("form",{onSubmit:dT,className:"profile-inline-form",children:[i.jsx("input",{type:"text",name:"name",className:"profile-form-input",value:_.name,onChange:Me,placeholder:"Enter your full name",autoFocus:!0}),i.jsxs("div",{className:"profile-inline-actions",children:[i.jsx("button",{type:"button",className:"profile-cancel-btn",onClick:()=>{o(!1),j({}),B(Y=>({...Y,name:N?.name||""}))},children:"Cancel"}),i.jsx("button",{type:"submit",className:"profile-save-btn",disabled:U,children:U?"Saving...":"Save"})]}),$.name&&i.jsx("div",{className:"profile-form-error",children:$.name})]}):i.jsx("div",{className:"profile-field-value",children:_.name||i.jsx("span",{className:"empty-value",children:"Click edit to add your name"})})]}),_.email&&i.jsxs("div",{className:"profile-field-section",children:[i.jsx("label",{className:"profile-field-label",children:"Email"}),i.jsxs("div",{className:"profile-field-value readonly",children:[i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"field-icon",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"})}),_.email]})]}),_.mobile&&i.jsxs("div",{className:"profile-field-section",children:[i.jsx("label",{className:"profile-field-label",children:"Mobile Number"}),i.jsxs("div",{className:"profile-field-value readonly",children:[i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"field-icon",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"})}),_.mobile]})]}),i.jsxs("div",{className:"profile-field-section",children:[i.jsx("label",{className:"profile-field-label",children:"Roles"}),i.jsx("div",{className:"roles-list",children:_.roles&&_.roles.length>0?_.roles.map((Y,ae)=>i.jsxs("div",{className:`role-item ${Y.name===_.currentRole?"active":""}`,children:[i.jsxs("div",{className:"role-info",children:[i.jsxs("svg",{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:Y.name})]}),Y.name===_.currentRole?i.jsx("span",{className:"role-badge",children:"Current"}):i.jsx("button",{className:"role-switch-btn",onClick:()=>fT(Y.id),disabled:q!==null,children:q===Y.id?"Switching...":"Switch"})]},Y.id)):i.jsxs("div",{className:"role-item active",children:[i.jsxs("div",{className:"role-info",children:[i.jsxs("svg",{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:_.currentRole||"Admin"})]}),i.jsx("span",{className:"role-badge",children:"Current"})]})})]}),i.jsx("div",{className:"profile-field-section logout-section",children:i.jsxs("button",{className:"logout-button",onClick:hT,children:[i.jsxs("svg",{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"})]})})]}):i.jsxs("div",{className:"security-section",children:[p&&i.jsxs("div",{className:"security-block",children:[i.jsxs("div",{className:"security-header",children:[i.jsxs("div",{children:[i.jsxs("h4",{className:"security-title",children:["Password",k&&!k.allow_change&&i.jsx("span",{className:"password-disabled-badge",children:"Disabled"})]}),!L&&i.jsxs("p",{className:"security-subtitle",children:["Last changed: ",_.lastPasswordChange,_.nextPasswordDue&&i.jsxs(i.Fragment,{children:[" • ",i.jsxs("span",{className:_.nextPasswordDue==="Expired"?"password-expired":"",children:["Next due: ",_.nextPasswordDue]})]})]}),L&&i.jsx("p",{className:"security-subtitle",children:"Set your password to secure your account"})]}),!a&&k?.allow_change!==!1&&i.jsx("button",{className:"profile-field-edit-btn",onClick:()=>{l(!0),W({currentPassword:"",newPassword:"",confirmPassword:""}),z({})},children:L?"Set Password":"Change Password"})]}),a&&i.jsxs("form",{onSubmit:uT,className:"password-form",children:[!L&&i.jsxs("div",{className:"profile-form-group",children:[i.jsx("label",{className:"profile-form-label",children:"Current Password"}),i.jsx("input",{type:"password",name:"currentPassword",className:"profile-form-input",value:F.currentPassword,onChange:nn,placeholder:"Enter current password",autoComplete:"new-password"}),E.currentPassword&&i.jsx("div",{className:"profile-form-error",children:E.currentPassword})]}),i.jsxs("div",{className:"profile-form-group",children:[i.jsx("label",{className:"profile-form-label",children:L?"Password":"New Password"}),i.jsx("input",{type:"password",name:"newPassword",className:"profile-form-input",value:F.newPassword,onChange:nn,placeholder:L?"Enter password":"Enter new password",autoComplete:"new-password"}),E.newPassword&&i.jsx("div",{className:"profile-form-error",children:E.newPassword})]}),i.jsx("div",{className:"password-requirements",children:k&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:`password-requirement ${ne.minLength?"met":""}`,children:[i.jsx("svg",{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"})}),i.jsxs("span",{children:["Minimum ",k.min_length," characters"]})]}),k.require_uppercase&&i.jsxs("div",{className:`password-requirement ${ne.hasUpperCase?"met":""}`,children:[i.jsx("svg",{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"})}),i.jsx("span",{children:"One uppercase character"})]}),k.require_lowercase&&i.jsxs("div",{className:`password-requirement ${ne.hasLowerCase?"met":""}`,children:[i.jsx("svg",{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"})}),i.jsx("span",{children:"One lowercase character"})]}),k.require_numbers&&i.jsxs("div",{className:`password-requirement ${ne.hasNumber?"met":""}`,children:[i.jsx("svg",{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"})}),i.jsx("span",{children:"One number"})]}),k.require_special_chars&&i.jsxs("div",{className:`password-requirement ${ne.hasSpecialChar?"met":""}`,children:[i.jsx("svg",{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"})}),i.jsx("span",{children:"One special character"})]})]})}),i.jsxs("div",{className:"profile-form-group",children:[i.jsx("label",{className:"profile-form-label",children:"Confirm Password"}),i.jsx("input",{type:"password",name:"confirmPassword",className:"profile-form-input",value:F.confirmPassword,onChange:nn,placeholder:L?"Confirm password":"Confirm new password",autoComplete:"new-password"}),E.confirmPassword&&i.jsx("div",{className:"profile-form-error",children:E.confirmPassword})]}),i.jsxs("div",{className:"profile-form-actions",children:[i.jsx("button",{type:"button",className:"profile-cancel-btn",onClick:()=>{l(!1),z({}),W({currentPassword:"",newPassword:"",confirmPassword:""})},children:"Cancel"}),i.jsx("button",{type:"submit",className:"profile-submit-btn",disabled:U,children:U?L?"Setting...":"Updating...":L?"Set Password":"Update Password"})]})]})]}),i.jsx("div",{className:"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:[u?"Enabled":"Disabled"," ",u?"":" - Add an extra layer of security"]}),!u&&N?.auth_config?.two_factor_auth?.can_enable===!1&&N?.auth_config?.two_factor_auth?.issue&&i.jsx("p",{style:{color:"#dc2626",fontSize:"14px",marginTop:"8px"},children:N.auth_config.two_factor_auth.issue})]}),!u&&N?.auth_config?.two_factor_auth?.can_enable===!0&&i.jsx("button",{className:"toggle-btn",onClick:vy,children:"Enable"}),u&&N?.auth_config?.two_factor_auth?.can_disable===!0&&i.jsx("button",{className:"toggle-btn enabled",onClick:vy,children:"Disable"})]})}),i.jsxs("div",{className:"security-block",children:[i.jsx("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"})]})}),i.jsx("div",{className:"sessions-list",children:y?i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"2rem"},children:[i.jsx(A.Spin,{size:"small"}),i.jsx("span",{style:{marginLeft:"8px",color:"#6b7280"},children:"Loading sessions..."})]}):v?i.jsxs("div",{style:{padding:"1rem",backgroundColor:"#fef2f2",border:"1px solid #fecaca",borderRadius:"8px",textAlign:"center"},children:[i.jsx("p",{style:{color:"#b91c1c",margin:"0 0 8px 0"},children:"Failed to load sessions"}),i.jsx("p",{style:{color:"#dc2626",fontSize:"14px",margin:"0 0 8px 0"},children:v}),i.jsx("button",{onClick:Pe,style:{fontSize:"14px",color:"#dc2626",textDecoration:"underline",background:"none",border:"none",cursor:"pointer"},children:"Try again"})]}):m.length>0?m.map((Y,ae)=>{const de=ve(Y);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",{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:de.deviceName}),Y.is_current?i.jsx("span",{className:"session-status-tag current",children:"Current"}):de.isActive?i.jsx("button",{className:"logout-tag-btn logout-tag-btn-ghost",onClick:()=>xy(Y.id),children:"Logout"}):i.jsx("button",{className:"logout-tag-btn",onClick:()=>xy(Y.id),children:"Logout"})]}),i.jsxs("p",{className:"session-details",children:[de.os," • ",de.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: ",de.sessionStartTime]}),i.jsx("p",{className:"session-last-active",children:de.isActive?"Active now":`Last seen: ${de.lastSeen}`})]})})]},Y.id||ae)}):i.jsx("p",{className:"no-sessions",children:"No active sessions found"})}),m.length>1&&i.jsx("button",{className:"logout-all-btn",onClick:lT,children:"Sign me out of all other sessions"})]}),i.jsxs("div",{className:"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:S&&S.length>0?S.map((Y,ae)=>i.jsx("div",{className:"token-item",children:i.jsx("div",{className:"token-info",children:i.jsxs("div",{className:"token-details",children:[i.jsxs("svg",{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:[Y.role," - Bearer Token"]}),i.jsx("p",{className:"token-type",children:"Type: Bearer Authentication Token"}),i.jsxs("p",{className:"token-created",children:["Created: ",new Date(Y.created).toLocaleDateString()]}),Y.expiry?i.jsxs("p",{className:"token-expiry",children:["Expires: ",new Date(Y.expiry).toLocaleDateString()]}):i.jsx("p",{className:"token-expiry",children:"Expires: Never"})]})]})})},ae)):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"})]})})]})]})})]})})]})]})};function cy(e,t,r=[]){const n=t.replace(/\/+$/,"")||"/";for(const s of e){const o=s.url||s.uri,a=o?.replace(/\/+$/,"")||"";if(a&&n===a)return[...r,{name:s.name,url:o}];if(s.children?.length){const l=[...r,{name:s.name,url:o}],d=cy(s.children,t,l);if(d)return d}}return null}function UE(e){return e.replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function $E(e){const t=e.replace(/\/+$/,"").split("/").filter(Boolean),r=[{name:"Home",url:"/app"}],n=t[0]==="app"?1:0;for(let s=n;s<t.length;s++){const o="/"+t.slice(0,s+1).join("/");r.push({name:UE(t[s]),url:o})}return r}const dy=()=>{const{pathname:e}=R.useLocation(),{menu:t}=qe(),r=b.useMemo(()=>{const n=e.replace(/\/+$/,"")||"/";if(n==="/app"||n==="/")return[{name:"Home"}];const s=cy(t||[],e);if(s){const a=s[0]?.url?.replace(/\/+$/,"");return a!=="/app"&&a!=="/"?[{name:"Home",url:"/app"},...s]:s}return $E(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,s)=>{const o=s===r.length-1;return i.jsxs("li",{className:`flex items-center gap-1.5 ${s>0&&s<r.length-1?"hidden sm:flex":""}`,children:[s>0&&i.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground breadcrumb-separator flex-shrink-0"}),o||!n.url?i.jsx("span",{className:"text-foreground font-medium breadcrumb-current truncate max-w-[200px]",children:n.name}):i.jsx(kr,{to:n.url,className:"text-muted-foreground hover:text-foreground transition-colors truncate max-w-[200px]",children:n.name})]},s)}),r.length>2&&i.jsxs("li",{className:"flex items-center gap-1.5 sm:hidden",style:{order:1},children:[i.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground breadcrumb-separator flex-shrink-0"}),i.jsx("span",{className:"text-muted-foreground",children:"..."})]})]})})},jE=({onLogout:e,className:t=""})=>i.jsxs("a",{className:`dropdown-item profile-logout ${t}`,href:"#",onClick:r=>{r.preventDefault(),e()},children:[i.jsxs("svg",{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"})]}),zE=({onViewProfile:e,className:t=""})=>i.jsxs("a",{className:`dropdown-item profile-view ${t}`,href:"#",onClick:r=>{r.preventDefault(),e()},children:[i.jsxs("svg",{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"})]}),uy=({profileInfo:e,theme:t={},config:r={},hidden:n=!1})=>{const[s,o]=b.useState(!1),[a,l]=b.useState(!1),[d,c]=b.useState(!1),[u,f]=b.useState(null),p=b.useRef(null);R.useNavigate(),b.useEffect(()=>{const E=z=>{p.current&&!p.current.contains(z.target)&&(o(!1),l(!1))};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]);const h=()=>{o(!s),s||l(!1)},m=()=>{iy(()=>{Ml({theme:t})})},g=E=>{window.location.href=E},y=e?.current_role||e?.user_role,w=e?.other_roles||[],{showProfile:v=!0,showLeftSection:x=!0,showRightSection:S=!0,showBreadcrumbs:T=!1,customLeftContent:k=null,customRightContent:M=null,customProfileMenu:P=null,customViewProfile:N=null,theme:D="light",profileMenuConfig:V={},className:O="",style:L={}}=r,_=D==="dark",{showViewProfile:B=!0,showLogout:F=!0,showRoleSwitch:W=!0,customMenuItems:$=[]}=V,j=()=>{c(!0),o(!1)};return i.jsxs(i.Fragment,{children:[!n&&i.jsx("header",{className:`topbar header-container ${_?"topbar-theme-dark":""} ${O}`,style:L,children:i.jsxs("div",{className:"topbar-content",children:[x&&i.jsx("div",{className:"topbar-left",children:k||T&&i.jsx(dy,{})||null}),S&&i.jsxs("div",{className:"topbar-right",children:[M,v&&i.jsxs("div",{className:"dropdown profile-dropdown-container",ref:p,children:[i.jsxs("div",{className:"profile-dropdown-menu-button",onClick:h,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=${Om("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-[12px] ${_?"text-white/70":"text-gray-600"}`,children:y})]})]}),i.jsx("svg",{className:`dropdown-arrow ${s?"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:_?"#FFFFFF":"#414651"})})]}),i.jsxs("ul",{className:`profile-dropdown-menu ${s?"show":""}`,children:[w.length>0&&a&&i.jsx("li",{children:i.jsx("div",{className:"profile-roles complete-hidden-scroll-style",children:w.map((E,z)=>i.jsxs("div",{className:"dropdown-item profile-each-role",onClick:()=>g(E.url),children:[i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("g",{clipPath:"url(#clip0_1427_392)",children:i.jsx("path",{d:"M0.833374 7.99998C0.833374 4.04198 4.04204 0.833313 8.00004 0.833313C11.958 0.833313 15.1667 4.04198 15.1667 7.99998C15.1667 11.958 11.958 15.1666 8.00004 15.1666C4.04204 15.1666 0.833374 11.958 0.833374 7.99998ZM8.00004 1.83331C4.59404 1.83331 1.83337 4.59398 1.83337 7.99998C1.83337 9.58131 2.42804 11.0233 3.40671 12.1146L3.60604 11.7646C4.28871 10.5706 5.55871 9.83331 6.93471 9.83331H9.06604C10.4414 9.83331 11.7114 10.5706 12.394 11.7646L12.5934 12.114C13.572 11.0226 14.1667 9.58065 14.1667 7.99998C14.1667 4.59398 11.406 1.83331 8.00004 1.83331ZM11.8454 12.8206L11.5254 12.2606C11.0214 11.378 10.0827 10.8333 9.06604 10.8333H6.93471C5.91804 10.8333 4.97871 11.378 4.47471 12.2606L4.15471 12.8213C5.20871 13.6633 6.54537 14.1666 8.00004 14.1666C9.45471 14.1666 10.7914 13.6633 11.8454 12.8206ZM5.66671 6.33331C5.66671 5.04465 6.71137 3.99998 8.00004 3.99998C9.28871 3.99998 10.3334 5.04465 10.3334 6.33331C10.3334 7.62198 9.28871 8.66665 8.00004 8.66665C6.71137 8.66665 5.66671 7.62198 5.66671 6.33331ZM8.00004 4.99998C7.26337 4.99998 6.66671 5.59665 6.66671 6.33331C6.66671 7.06998 7.26337 7.66665 8.00004 7.66665C8.73671 7.66665 9.33337 7.06998 9.33337 6.33331C9.33337 5.59665 8.73671 4.99998 8.00004 4.99998Z",fill:"#717680"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_1427_392",children:i.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),i.jsx("span",{className:"label",children:E.label})]},z))})}),i.jsx("li",{children:i.jsx("hr",{className:"profile-dropdown-divider"})}),$.map((E,z)=>i.jsx("li",{children:E},z)),B&&i.jsx("li",{children:i.jsx(zE,{onViewProfile:j})}),F&&i.jsx("li",{children:i.jsx(jE,{onLogout:m})})]})]})]})]})}),N?N({user:e,isOpen:d,onClose:()=>c(!1)}):i.jsx(ly,{isOpen:d,onClose:()=>c(!1),profileData:u})]})};function fy(e,t){const r=[],n=new Set;for(const s of e){const o=s.url||s.uri;if(o&&!n.has(o)&&(n.add(o),r.push({name:s.name,url:o,icon:s.icon,parentName:t})),s.children?.length){const a=fy(s.children,s.name);for(const l of a)n.has(l.url)||(n.add(l.url),r.push(l))}}return r}const hy=()=>{const[e,t]=b.useState(!1),[r,n]=b.useState(""),[s,o]=b.useState(0),a=b.useRef(null),l=b.useRef(null),{menu:d}=qe(),{navigateTo:c}=kl(),u=b.useMemo(()=>fy(d||[]),[d]),f=b.useMemo(()=>{if(!r.trim())return u;const m=r.toLowerCase();return u.filter(g=>g.name.toLowerCase().includes(m)||g.parentName&&g.parentName.toLowerCase().includes(m))},[u,r]);b.useEffect(()=>{o(0)},[r]),b.useEffect(()=>{e&&(n(""),o(0),requestAnimationFrame(()=>{a.current?.focus()}))},[e]),b.useEffect(()=>{const m=g=>{(g.metaKey||g.ctrlKey)&&g.key==="k"&&(g.preventDefault(),t(y=>!y))};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[]),b.useEffect(()=>{if(!l.current)return;const m=l.current.querySelector('[data-selected="true"]');m&&m.scrollIntoView({block:"nearest"})},[s]);const p=b.useCallback(m=>{t(!1),c(m.url)},[c]),h=m=>{switch(m.key){case"ArrowDown":m.preventDefault(),o(g=>g<f.length-1?g+1:g);break;case"ArrowUp":m.preventDefault(),o(g=>g>0?g-1:g);break;case"Enter":m.preventDefault(),f[s]&&p(f[s]);break}};return i.jsx(hi,{open:e,onOpenChange:t,children:i.jsxs(pi,{children:[i.jsx(mi,{style:{position:"fixed",inset:0,zIndex:50,backgroundColor:"rgba(0, 0, 0, 0.5)"}}),i.jsxs(gi,{style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:50,width:"100%",maxWidth:"28rem",backgroundColor:"#fff",borderRadius:"12px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",overflow:"hidden",outline:"none"},children:[i.jsx(yi,{className:"sr-only",children:"Search pages"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid #E9EAEB"},onKeyDown:h,children:[i.jsx(Vy,{style:{width:16,height:16,color:"#717680",marginRight:12,flexShrink:0}}),i.jsx("input",{ref:a,type:"text",placeholder:"Search pages...",value:r,onChange:m=>n(m.target.value),"aria-label":"Search pages",style:{flex:1,backgroundColor:"transparent",fontSize:14,outline:"none",border:"none",color:"#252b37"}}),i.jsx("kbd",{style:{pointerEvents:"none",marginLeft:8,display:"inline-flex",height:20,alignItems:"center",gap:4,borderRadius:4,border:"1px solid #E9EAEB",backgroundColor:"#F5F5F5",padding:"0 6px",fontFamily:"monospace",fontSize:10,fontWeight:500,color:"#717680",userSelect:"none"},children:"ESC"})]}),i.jsx("div",{ref:l,style:{maxHeight:300,overflowY:"auto",padding:4},role:"listbox",children:f.length===0?i.jsx("div",{style:{padding:"24px 12px",textAlign:"center",fontSize:14,color:"#717680"},children:"No results found"}):f.map((m,g)=>{const y=g===s;return i.jsxs("button",{role:"option","aria-selected":y,"data-selected":y,style:{display:"flex",alignItems:"center",gap:12,padding:"8px 12px",borderRadius:6,width:"100%",textAlign:"left",fontSize:14,border:"none",cursor:"pointer",transition:"background-color 0.15s",backgroundColor:y?"var(--color-brand-50, #EAE8FF)":"transparent",color:y?"var(--color-brand-500, #5048ED)":"#414651"},onClick:()=>p(m),onMouseEnter:()=>o(g),children:[i.jsx("span",{style:{flexShrink:0,color:y?"var(--color-brand-500, #5048ED)":"#717680"},children:i.jsx(Po,{item:m})}),i.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m.name}),m.parentName&&i.jsxs("span",{style:{color:"#717680",marginLeft:"auto",fontSize:12,flexShrink:0},children:["in ",m.parentName]})]},m.url)})})]})]})})},HE={showTopbar:!0,showNavbar:!0,layoutType:"wide",showCommandPalette:!0},WE={showProfile:!0,showLeftSection:!0,showRightSection:!0,showBreadcrumbs:!1,customLeftContent:null,customRightContent:null,customProfileMenu:null,customTopbar:null,customViewProfile:null,theme:"light",profileMenuConfig:{showViewProfile:!0,showLogout:!0,showRoleSwitch:!0,customMenuItems:[]},className:"",style:{}},qE={showLogo:!0,showMenu:!0,isCollapsed:!1,collapsible:!1,customLogo:null,customMenuContent:null,customBottomContent:null,customNavbar:null,customMenu:null,theme:"light",menuConfig:{showIcons:!0,showSubmenus:!0,expandOnHover:!1,customMenuItemRenderer:null},className:"",style:{}},Eo=(e={},t={})=>{const r={...t};return Object.keys(e).forEach(n=>{if(e[n]===void 0||e[n]===null)return;e[n]&&(e[n].$$typeof||typeof e[n]=="function")||typeof e[n]=="function"||Array.isArray(e[n])?r[n]=e[n]:typeof e[n]=="object"&&typeof t[n]=="object"&&!Array.isArray(t[n])?r[n]=Eo(e[n],t[n]):r[n]=e[n]}),r},KE="244px",GE="56px",py=()=>{const{loading:e,error:t,menu:r,profileInfo:n,appLogo:s,theme:o={},layoutConfig:a={},topbarConfig:l={},navbarConfig:d={},customComponents:c={}}=qe(),u=R.useLocation(),f=Eo(a,HE),p=Eo(l,WE),h=Eo(d,qE),[m,g]=b.useState(!h.isCollapsed),y=b.useCallback(N=>{g(N),h.onCollapseChange?.(!N)},[h.onCollapseChange]),w=()=>{const N=document.getElementById("contentSpinner");N&&N.classList.add("active")},v=()=>{const N=document.getElementById("contentSpinner");N&&N.classList.remove("active")};if(b.useEffect(()=>{w();const N=300,D=Date.now(),V=setTimeout(()=>{const O=Date.now()-D;O>=N?v():setTimeout(v,N-O)},500);return()=>{clearTimeout(V)}},[u.pathname]),b.useEffect(()=>(window.addEventListener("beforeunload",w),()=>{window.removeEventListener("beforeunload",w)}),[]),e)return i.jsx("div",{className:"layout-loading",children:"Loading..."});if(t)return i.jsxs("div",{className:"layout-error",children:["Error: ",t]});const x=f.layoutType||o?.layout||"wide",S=f.showNavbar&&o?.menu_config?.display_sidebar!==!1,T=f.showTopbar,k=c?.Layout,M=c?.Topbar||p.customTopbar,P=c?.Navbar||h.customNavbar;return k?i.jsx(k,{menu:r,profileInfo:n,appLogo:s,theme:o,layoutConfig:f,topbarConfig:p,navbarConfig:h,children:i.jsx(R.Outlet,{})}):i.jsxs(jS,{defaultOpen:!h.isCollapsed,open:m,onOpenChange:y,className:`layout layout-${x}`,style:{"--sidebar-width":KE,"--sidebar-width-icon":GE},children:[S&&(P?i.jsx(P,{menuItems:r,appLogo:s,theme:o,config:h}):i.jsx(ny,{menuItems:r,appLogo:s,theme:o,config:h})),i.jsxs(qS,{children:[M?i.jsx(M,{profileInfo:n,theme:o,config:p,hidden:!T}):i.jsx(uy,{profileInfo:n,theme:o,config:p,hidden:!T}),i.jsxs("div",{className:"layout-content",children:[i.jsx("div",{className:"content-spinner-container",id:"contentSpinner",children:i.jsx("div",{className:"spinner",children:i.jsxs("svg",{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(R.Outlet,{})]}),f.showCommandPalette&&i.jsx(hy,{})]})]})},XE=(e,t,r)=>{if(!e){const l=t.default;return l?.component?b.createElement(l.component,{message:"No page type specified"}):b.createElement("div",{style:{padding:"24px",color:"#f04438"}},"No page type specified")}const n=t[e]||t.default;if(!n)return b.createElement("div",{style:{padding:"24px",color:"#f04438"}},`Unknown page type: ${e}`);if(n.handler)return n.handler(r);if(!n.component){const l=t.default;if(l?.component){const d=l.propsBuilder?l.propsBuilder({...r,pageType:e}):{message:`No component configured for page type: ${e}`};return b.createElement(l.component,d)}return b.createElement("div",{style:{padding:"24px",color:"#f04438"}},`No component configured for page type: ${e}`)}let s=n.propsBuilder?n.propsBuilder({...r,pageType:e}):{};n.includeBasePath!==!1&&r.matchedRoutePath&&(s={basePath:r.matchedRoutePath,...s});const a=n.component;return b.createElement(a,s)},qn=({customPages:e={},forceRoute:t})=>{const r=R.useLocation(),{routes:n,pageTypeRegistry:s,registryLoading:o,registryError:a,initializerEndpoint:l}=qe(),d=Fn(),[c,u]=b.useState({pageType:null,customPagePath:null,matchedRoutePath:null,matchedRoute:null,loading:!0});if(b.useEffect(()=>{u(w=>({...w,loading:!0})),(()=>{const w=r.pathname;if(t){u({pageType:t.page_type,customPagePath:t.component||null,matchedRoutePath:t.path,matchedRoute:t,loading:!1});return}if(r.state&&r.state.page_type&&(r.state.page_type!=="custom"||r.state.custom_page_path)){let v=w;if(n&&n.length>0){for(const x of n)if(w===x.path||w.startsWith(x.path+"/")){v=x.path;break}}u({pageType:r.state.page_type,customPagePath:r.state.custom_page_path||null,matchedRoutePath:v,matchedRoute:null,loading:!1});return}if(n&&n.length>0){const v=[...n].sort((x,S)=>{const T=x.path.split("/").filter(M=>M).length;return S.path.split("/").filter(M=>M).length-T});for(const x of v){let S=R.matchPath({path:x.path,exact:!0},w);if(!S&&w.startsWith(x.path+"/")){const T=x.path.endsWith("/*")?x.path:`${x.path}/*`;S=R.matchPath({path:T,exact:!1},w)}if(S){u({pageType:x.page_type,customPagePath:x.component||null,matchedRoutePath:x.path,matchedRoute:x,loading:!1});return}}}u({pageType:"404",customPagePath:null,matchedRoutePath:null,matchedRoute:null,loading:!1})})()},[r,n,t]),c.loading||o)return i.jsx("div",{className:"content-spinner-container active",children:i.jsx("div",{className:"spinner",children:i.jsxs("svg",{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",{style:{padding:"24px",color:"#f04438"},children:["Failed to load page registry: ",a]});if(!s)return i.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"60vh",textAlign:"center",padding:"24px"},children:i.jsxs("div",{style:{backgroundColor:"white",borderRadius:"12px",padding:"32px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)",maxWidth:"500px",width:"100%",border:"1px solid #e1e3e6"},children:[i.jsx("h1",{style:{fontSize:"32px",margin:"0",color:"#f04438",fontWeight:"bold",lineHeight:"1"},children:"⚠️"}),i.jsx("h3",{style:{fontSize:"18px",margin:"12px 0",color:"#252b37",fontWeight:"600"},children:"Configuration Issue"}),i.jsx("p",{style:{fontSize:"14px",color:"#717680",marginBottom:"16px",lineHeight:"1.5"},children:"Unable to load page configuration from:"}),i.jsx("code",{style:{display:"block",backgroundColor:"#f9fafb",border:"1px solid #e1e3e6",borderRadius:"4px",padding:"8px 12px",fontSize:"12px",color:"#252b37",fontFamily:"Monaco, Menlo, monospace",marginBottom:"16px",wordBreak:"break-all"},children:l}),i.jsx("p",{style:{fontSize:"13px",color:"#8b909a",margin:"0"},children:"Please check your configuration or contact your administrator."})]})});const{pageType:f,customPagePath:p,matchedRoutePath:h,matchedRoute:m}=c,g=`${f}-${p||"default"}-${h||"none"}`;return i.jsx("div",{className:"h-full",children:XE(f,s,{matchedRoutePath:h,customPagePath:p,matchedRoute:m,customPages:e,location:r,apiConfig:d})},g)},my=()=>{const{metadata:e,appName:t,apiConfig:r,theme:n}=qe(),s=b.useRef(new Set),o=()=>{s.current.forEach(d=>{d.parentNode&&d.parentNode.removeChild(d)}),s.current.clear()},a=(d,c,u)=>{let f=document.querySelector(d);return f||(f=c(),document.head.appendChild(f),s.current.add(f)),u(f),f},l=(d,c="image")=>new Promise((u,f)=>{const p=document.createElement("link");p.rel="preload",p.as=c,p.href=d,p.onload=()=>u(),p.onerror=()=>f(new Error(`Failed to preload ${c}: ${d}`)),s.current.add(p),document.head.appendChild(p),setTimeout(()=>{p.parentNode&&(p.parentNode.removeChild(p),s.current.delete(p))},1e4)});return b.useEffect(()=>{if(!e)return;o();const d=(c,u)=>{if(!c)return u||null;if(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("//"))return c;try{return no(c,r)}catch(f){return console.warn(`Failed to build asset URL for ${c}:`,f),u||null}};if(e.title?document.title=e.title:t&&(document.title=t),e.description&&a('meta[name="description"]',()=>{const c=document.createElement("meta");return c.name="description",c},c=>{c.content=e.description}),e.keywords&&a('meta[name="keywords"]',()=>{const c=document.createElement("meta");return c.name="keywords",c},c=>{c.content=e.keywords}),a('meta[name="viewport"]',()=>{const c=document.createElement("meta");return c.name="viewport",c},c=>{c.content="width=device-width, initial-scale=1.0"}),n?.colors?.primary&&a('meta[name="theme-color"]',()=>{const c=document.createElement("meta");return c.name="theme-color",c},c=>{c.content=n.colors.primary}),e.favicon){const c=d(e.favicon,"/favicon.ico");c&&a('link[rel="icon"][type="image/x-icon"], link[rel="shortcut icon"]',()=>{const u=document.createElement("link");return u.rel="icon",u.type="image/x-icon",u},u=>{u.href=c,l(c).catch(f=>console.warn("Failed to preload favicon:",f.message))})}if(e.favicon_png){const c=d(e.favicon_png,"/favicon-32x32.png");c&&a('link[rel="icon"][type="image/png"]',()=>{const u=document.createElement("link");return u.rel="icon",u.type="image/png",u.sizes="32x32",u},u=>{u.href=c,l(c).catch(f=>console.warn("Failed to preload PNG favicon:",f.message))})}if(e.apple_touch_icon){const c=d(e.apple_touch_icon,"/apple-touch-icon.png");c&&a('link[rel="apple-touch-icon"]',()=>{const u=document.createElement("link");return u.rel="apple-touch-icon",u},u=>{u.href=c,l(c).catch(f=>console.warn("Failed to preload Apple touch icon:",f.message))})}if(e.og_image){const c=d(e.og_image,"/og-image.png");c&&(l(c).catch(u=>console.warn("Failed to preload OG image:",u.message)),a('meta[property="og:image"]',()=>{const u=document.createElement("meta");return u.setAttribute("property","og:image"),u},u=>{u.content=c}),(e.og_image_alt||e.title)&&a('meta[property="og:image:alt"]',()=>{const u=document.createElement("meta");return u.setAttribute("property","og:image:alt"),u},u=>{u.content=e.og_image_alt||e.title||t||"Zango CRM"}))}if(a('meta[property="og:title"]',()=>{const c=document.createElement("meta");return c.setAttribute("property","og:title"),c},c=>{c.content=e.title||t||"Zango CRM"}),e.description&&a('meta[property="og:description"]',()=>{const c=document.createElement("meta");return c.setAttribute("property","og:description"),c},c=>{c.content=e.description}),a('meta[property="og:type"]',()=>{const c=document.createElement("meta");return c.setAttribute("property","og:type"),c},c=>{c.content="website"}),a('meta[property="og:url"]',()=>{const c=document.createElement("meta");return c.setAttribute("property","og:url"),c},c=>{c.content=window.location.href}),a('meta[name="twitter:card"]',()=>{const c=document.createElement("meta");return c.name="twitter:card",c},c=>{c.content=e.og_image?"summary_large_image":"summary"}),a('meta[name="twitter:title"]',()=>{const c=document.createElement("meta");return c.name="twitter:title",c},c=>{c.content=e.title||t||"Zango CRM"}),e.description&&a('meta[name="twitter:description"]',()=>{const c=document.createElement("meta");return c.name="twitter:description",c},c=>{c.content=e.description}),e.og_image){const c=d(e.og_image,"/og-image.png");c&&a('meta[name="twitter:image"]',()=>{const u=document.createElement("meta");return u.name="twitter:image",u},u=>{u.content=c})}if(a('link[rel="canonical"]',()=>{const c=document.createElement("link");return c.rel="canonical",c},c=>{c.href=window.location.href.split("?")[0]}),e.manifest||e.webmanifest){const c=d(e.manifest||e.webmanifest,"/manifest.json");c&&a('link[rel="manifest"]',()=>{const u=document.createElement("link");return u.rel="manifest",u},u=>{u.href=c})}return o},[e,t,n]),null},YE=({config:e,onExpire:t,onWarning:r,onActivity:n})=>{const[s,o]=b.useState(!1),[a,l]=b.useState(0),d=b.useRef(new Date),c=b.useRef(null),u=b.useRef(null),f=b.useRef(!1),p=b.useRef(!1),h=b.useRef(!1),m=b.useRef(!1),g=b.useRef(t),y=b.useRef(r),w=b.useRef(n),v=b.useRef(()=>{}),x=b.useRef(()=>{}),S=b.useRef(()=>{}),T=b.useRef(()=>{});b.useEffect(()=>{g.current=t,y.current=r,w.current=n},[t,r,n]),b.useEffect(()=>{h.current=s},[s]);const k=["mousemove","scroll","keyup","click","touchstart","touchend","touchmove"],M=b.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]),P=b.useCallback(()=>{f.current=!0,m.current=!1,M(),u.current&&(clearInterval(u.current),u.current=null),g.current&&g.current(),Ml({preserveCurrentPath:!0})},[M]),N=b.useCallback(()=>{m.current=!1,o(!1),u.current&&(clearInterval(u.current),u.current=null),p.current=!1},[]),D=b.useCallback(()=>{m.current=!0,o(!1)},[]),V=b.useCallback(()=>{const{warn_after:j,expire_after:E}=e,z=E-j;if(p.current)return;l(z),p.current=!0;const X=new Date;X.setSeconds(X.getSeconds()+z),u.current=setInterval(()=>{const G=new Date().getTime(),U=X.getTime()-G,H=Math.floor(U/1e3);H>0?l(H):(u.current&&(clearInterval(u.current),u.current=null),l(0))},1e3)},[e]),O=b.useCallback(()=>{u.current&&(clearInterval(u.current),u.current=null),p.current=!1;const j=e.expire_after-e.warn_after;l(j)},[e]),L=b.useCallback(j=>{if(j==="logout"||j?.response==="logout"){P();return}v.current()},[P]);b.useLayoutEffect(()=>{S.current=L},[L]);const _=b.useCallback(async()=>{const j=Math.floor((new Date().getTime()-d.current.getTime())/1e3);try{const E=await Sm(e.ping_url,j);E.success?S.current(E.response):v.current()}catch{v.current()}},[e.ping_url]);b.useLayoutEffect(()=>{x.current=_},[_]);const B=b.useCallback(()=>{M();const j=Math.floor((new Date().getTime()-d.current.getTime())/1e3),{warn_after:E,expire_after:z}=e;let X;if(j>=z){P();return}else j>=E?(p.current||V(),o(!0),y.current&&y.current(),X=z-j):(N(),p.current&&O(),X=E-j);const G=Math.min(X*1e3,2147483647);c.current=setTimeout(()=>{x.current()},G)},[e,M,P,V,N,O]);b.useLayoutEffect(()=>{v.current=B},[B]);const F=b.useCallback(()=>{const j=new Date;if(j.getTime()-d.current.getTime()<1e3)return;const E=Math.floor((j.getTime()-d.current.getTime())/1e3);if(m.current&&E>=e.warn_after&&E<e.expire_after){m.current=!1,v.current(),w.current&&w.current();return}if(d.current=j,E>=e.expire_after){P();return}h.current&&(x.current(),N()),w.current&&w.current()},[e.expire_after,e.warn_after,P,N]);b.useLayoutEffect(()=>{T.current=F},[F]);const W=b.useCallback(()=>{m.current=!1,d.current=new Date,N(),x.current()},[N]),$=b.useCallback(()=>{P()},[P]);return b.useEffect(()=>{if(!e.enabled)return;const j=()=>T.current();return k.forEach(E=>{document.addEventListener(E,j,!0)}),v.current(),()=>{k.forEach(E=>{document.removeEventListener(E,j,!0)}),c.current&&(clearTimeout(c.current),c.current=null),u.current&&(clearInterval(u.current),u.current=null)}},[e.enabled]),{showWarning:s,countdown:a,hideWarning:N,dismissWarning:D,renewSession:W,logoutNow:$}},ZE=({open:e,countdown:t,onContinue:r,onLogout:n,onDismiss:s})=>{const o=l=>{if(l>=60){const d=Math.floor(l/60),c=l%60;return c===0?`${d} min`:`${d} min ${c} sec`}return`${l} sec`},a=l=>{!l&&s&&s()};return i.jsxs(hi,{open:e,onOpenChange:a,children:[i.jsxs(pi,{children:[i.jsx(mi,{className:"session-security-overlay","data-testid":"session-security-overlay"}),i.jsxs(gi,{className:"session-security-modal","aria-describedby":"session-security-description",onEscapeKeyDown:l=>{s?s():l.preventDefault()},onPointerDownOutside:l=>{s?(l.preventDefault(),s()):l.preventDefault()},children:[i.jsx(yi,{className:"session-security-title",children:"Your session is about to expire"}),i.jsxs("div",{id:"session-security-description",className:"session-security-content",children:[i.jsxs("p",{className:"session-security-countdown",children:[i.jsx("span",{id:"session_security_counter",children:o(t)})," remaining"]}),i.jsx("p",{className:"session-security-instruction",children:"Click or type to extend your session."})]}),i.jsxs("div",{className:"session-security-actions",children:[i.jsx("button",{onClick:r,className:"session-security-btn session-security-btn-primary",children:"Continue Session"}),s&&i.jsx("button",{type:"button",onClick:s,className:"session-security-btn session-security-btn-secondary","data-testid":"session-security-dismiss",children:"Dismiss"}),i.jsx("button",{onClick:n,className:"session-security-btn session-security-btn-secondary",children:"Logout"})]})]})]}),i.jsx("style",{children:`
|
|
297
|
+
`;const n=r.querySelector("#cancel-logout"),s=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"}),s.addEventListener("mouseenter",()=>{s.style.backgroundColor="#b91c1c"}),s.addEventListener("mouseleave",()=>{s.style.backgroundColor="#dc2626"});const o=l=>{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),l?.()},200)};n.addEventListener("click",()=>o()),s.addEventListener("click",()=>o(e)),t.addEventListener("click",l=>{l.target===t&&o()});const a=l=>{l.key==="Escape"&&o()};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()})},ly=({isOpen:e,onClose:t})=>{const[r,n]=b.useState("account"),[s,o]=b.useState(!1),[a,l]=b.useState(!1),[d,c]=b.useState(null),[u,f]=b.useState(!1),[p,h]=b.useState(!0),[m,g]=b.useState([]),[y,w]=b.useState(!1),[v,x]=b.useState(null),[S,T]=b.useState([]),[k,M]=b.useState(null),{appData:P}=qe(),{profileData:N,loading:D,error:V,refetch:O,shouldSetPassword:L}=UE(e),[_,B]=b.useState({name:"",email:"",mobile:"",roles:[],currentRole:"",lastPasswordChange:"Never",nextPasswordDue:null}),[F,W]=b.useState({currentPassword:"",newPassword:"",confirmPassword:""}),[$,j]=b.useState({}),[E,z]=b.useState({}),[X,G]=b.useState(""),[U,H]=b.useState(!1),[q,J]=b.useState(null),[ne,se]=b.useState({minLength:!1,hasUpperCase:!1,hasLowerCase:!1,hasNumber:!1,hasSpecialChar:!1}),Pe=async()=>{w(!0),x(null);try{const Y=await gm();if(Y.success&&Y.response){const ae=Y.response.data||Y.response;g(ae),x(null)}else{const ae=Y.response?.message||"Failed to fetch sessions";x(ae),console.error("Sessions API Error:",Y)}}catch(Y){const ae=Y instanceof Error?Y.message:"Network error while fetching sessions";x(ae),console.error("Sessions fetch error:",Y)}finally{w(!1)}};b.useEffect(()=>{if(N){let Y=N.last_password_changed||"Never",ae=null;if(N.last_password_changed&&N?.password_policy?.password_expiry_days){const Nl=new Date(N.last_password_changed),Ft=new Date(Nl);Ft.setDate(Ft.getDate()+N.password_policy.password_expiry_days),Ft>new Date?ae=Ft.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):ae="Expired"}B({name:N.name||"",email:N.email||"",mobile:N.mobile||"",roles:N.roles||[],currentRole:P?.profile_info?.user_role||N.roles?.[0]?.name||"Admin",lastPasswordChange:Y,nextPasswordDue:ae}),f(N.auth_config?.two_factor_auth?.required||!1);const de=N?.can_set_password;h(de),N.profile_pic&&c(N.profile_pic);let pe=null;N.auth_config?.password_policy?pe=N.auth_config.password_policy:N.password_policy&&(pe=N.password_policy),pe&&M(pe),N.tokens&&T(N.tokens)}N&&N.tokens&&T(N.tokens),P?.sessions?.tokens&&T(P.sessions.tokens),P?.password_policy&&M(P.password_policy)},[N,P]);const ve=(Y,ae)=>{const de=Y.user_agent||Y.browser_agent||"Unknown Browser",pe=Y.ip||Y.location||"Unknown Location",Nl=Y.created_at,Ft=Y.last_seen_at,Cy=je=>je.includes("Chrome")?"Chrome":je.includes("Firefox")?"Firefox":je.includes("Safari")?"Safari":je.includes("Edge")?"Edge":"Unknown Browser",mT=je=>je.includes("Mac")?"macOS":je.includes("Windows")?"Windows":je.includes("Linux")?"Linux":je.includes("iPhone")||je.includes("iOS")?"iOS":je.includes("Android")?"Android":"Unknown OS",Sy=je=>{if(!je)return"Unknown";const Ll=je.replace(" IST",""),Ol=new Date(Ll),wT=new Date().getTime()-Ol.getTime(),Ao=Math.floor(wT/1e3),ko=Math.floor(Ao/60),_o=Math.floor(ko/60),Fl=Math.floor(_o/24);return Fl>0?`${Fl} day${Fl>1?"s":""} ago`:_o>0?`${_o} hour${_o>1?"s":""} ago`:ko>0?`${ko} minute${ko>1?"s":""} ago`:Ao>0?`${Ao} second${Ao>1?"s":""} ago`:"Just now"},gT=Cy(de),Py=mT(de),yT=()=>{if(Y.is_current)return!0;if(!Ft)return!1;const je=typeof Ft=="string"?Ft.replace(" IST",""):Ft,Ll=new Date(je),Ol=new Date(Date.now()-3600*1e3);return Ll>Ol};return{...Y,deviceName:`${gT} on ${Py}`,os:Py,location:pe==="127.0.0.1"?"Local Device":pe,sessionStartTime:Sy(Nl),lastSeen:Sy(Ft),isActive:yT()}};b.useEffect(()=>{const{newPassword:Y}=F;se(k?{minLength:Y.length>=(k.min_length||8),hasUpperCase:k.require_uppercase?/[A-Z]/.test(Y):!0,hasLowerCase:k.require_lowercase?/[a-z]/.test(Y):!0,hasNumber:k.require_numbers?/[0-9]/.test(Y):!0,hasSpecialChar:k.require_special_chars?/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(Y):!0}:{minLength:Y.length>=8,hasUpperCase:/[A-Z]/.test(Y),hasLowerCase:/[a-z]/.test(Y),hasNumber:/[0-9]/.test(Y),hasSpecialChar:/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(Y)})},[F.newPassword,k]);const[ge,he]=b.useState(e);b.useEffect(()=>{e&&!ge&&(O&&O(),Pe(),o(!1),l(!1),j({}),z({}),G(""),W({currentPassword:"",newPassword:"",confirmPassword:""})),he(e)},[e,ge,O]),b.useEffect(()=>{r==="security"&&e&&Pe()},[r,e]);const Me=Y=>{const{name:ae,value:de}=Y.target;B(pe=>({...pe,[ae]:de})),j(pe=>({...pe,[ae]:""}))},nn=Y=>{const{name:ae,value:de}=Y.target;W(pe=>({...pe,[ae]:de})),z(pe=>({...pe,[ae]:""}))},To=()=>{const Y={};return _.name.trim()||(Y.name="Name is required"),Y},by=async Y=>{const ae=Y.target.files?.[0];if(ae){const de=new FormData;de.append("profile_pic",ae);try{const pe=await so(de);pe.success?(c(pe.response?.profile_pic||URL.createObjectURL(ae)),G("Profile photo updated successfully!")):G(pe.response?.message||"Failed to upload photo")}catch{G("Failed to upload photo")}}},vy=async()=>{try{const Y=!u,ae={two_factor_auth:{required:Y}},de=new FormData;de.append("auth_config",JSON.stringify(ae));const pe=await so(de);pe.success?(f(Y),G(`Two-factor authentication ${Y?"enabled":"disabled"}`),A.toast.success({title:"Two-Factor Authentication Updated",description:`Two-factor authentication ${Y?"enabled":"disabled"} successfully`,duration:3e3})):(G(pe.response?.message||"Failed to update two-factor authentication"),A.toast.error({title:"Update Failed",description:pe.response?.message||"Failed to update two-factor authentication",duration:5e3}))}catch{G("Failed to update two-factor authentication"),A.toast.error({title:"Update Error",description:"An error occurred while updating two-factor authentication",duration:5e3})}},xy=async Y=>{try{const ae=await bm(Y);ae.success?(Pe(),G("Session logged out successfully")):G(ae.response?.message||"Failed to logout session")}catch{G("Failed to logout session")}},cT=async()=>{try{const Y=m.filter(de=>!de.is_current).map(de=>de.id),ae=await vm(Y);ae.success?(G("All other sessions logged out successfully"),Pe()):G(ae.response?.message||"Failed to logout all sessions")}catch{G("Failed to logout all sessions")}},dT=()=>{const Y={};return!L&&!F.currentPassword&&(Y.currentPassword="Current password is required"),F.newPassword?Object.values(ne).some(de=>!de)&&(Y.newPassword="Password must meet all requirements"):Y.newPassword=L?"Password is required":"New password is required",F.newPassword!==F.confirmPassword&&(Y.confirmPassword="Passwords do not match"),Y},uT=async Y=>{Y.preventDefault();const ae=To();if(Object.keys(ae).length>0){j(ae);return}H(!0),G("");try{const de=new FormData;de.append("name",_.name);const pe=await so(de);pe.success?(G("Name updated successfully!"),o(!1),setTimeout(()=>{G("")},3e3)):G(pe.response?.message||"Failed to update name")}catch{G("An error occurred. Please try again.")}finally{H(!1)}},fT=async Y=>{Y.preventDefault();const ae=dT();if(Object.keys(ae).length>0){z(ae);return}H(!0),G("");try{const de={new_password:F.newPassword};L||(de.current_password=F.currentPassword);const pe=await ym(de);pe.success?(G(L?"Password set successfully!":"Password changed successfully!"),W({currentPassword:"",newPassword:"",confirmPassword:""}),l(!1),O&&O(),setTimeout(()=>{G("")},3e3)):G(pe.response?.message||"Failed to change password")}catch{G("An error occurred. Please try again.")}finally{H(!1)}},hT=async Y=>{J(Y);try{const ae=await wm(Y);ae.success?(A.toast.success({title:"Role Switched",description:"Role switched successfully! Redirecting...",duration:2e3}),setTimeout(()=>{window.location.href="/app"},1e3)):(A.toast.error({title:"Role Switch Failed",description:ae.response?.message||"Failed to switch role",duration:5e3}),J(null))}catch{A.toast.error({title:"Role Switch Error",description:"An error occurred while switching role",duration:5e3}),J(null)}},pT=()=>{iy(()=>{Ml({redirectUrl:"/app/login"})})};return i.jsxs("div",{className:`user-profile-drawer ${e?"open":""}`,children:[i.jsx("div",{className:"profile-header-gradient",children:i.jsx("button",{className:"profile-close-btn",onClick:t,children:i.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})}),D&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"2rem"},children:[i.jsx(A.Spin,{size:"large"}),i.jsx("span",{style:{marginLeft:"12px",color:"#6b7280"},children:"Loading profile..."})]}),U&&i.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:i.jsxs("div",{style:{backgroundColor:"white",padding:"2rem",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 10px 25px rgba(0, 0, 0, 0.1)"},children:[i.jsx(A.Spin,{size:"large"}),i.jsx("span",{style:{marginLeft:"12px",color:"#6b7280",fontSize:"16px"},children:"Updating password..."})]})}),V&&!D&&i.jsxs("div",{style:{margin:"1rem 1.5rem",padding:"1rem",backgroundColor:"#fef2f2",border:"1px solid #fecaca",borderRadius:"8px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[i.jsx("svg",{style:{height:"20px",width:"20px",color:"#f87171",marginRight:"8px"},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",{style:{color:"#b91c1c",fontWeight:"500"},children:"Failed to load profile"})]}),i.jsx("p",{style:{color:"#dc2626",fontSize:"14px",marginTop:"4px",marginBottom:"8px"},children:V}),i.jsx("button",{onClick:O,style:{fontSize:"14px",color:"#dc2626",textDecoration:"underline",background:"none",border:"none",cursor:"pointer"},children:"Try again"})]}),!D&&!V&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"profile-info-section",children:[i.jsx("div",{className:"profile-avatar-container",children:i.jsxs("div",{className:"profile-avatar-circle",children:[d?i.jsx("img",{src:d,alt:"Profile",className:"profile-avatar-img"}):_.name?i.jsx("span",{className:"profile-initials",children:_.name.split(" ").map(Y=>Y[0]).join("").toUpperCase().slice(0,2)}):i.jsx("svg",{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:by,hidden:!0}),i.jsx("svg",{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.jsxs("div",{className:"profile-name-section",children:[i.jsx("h2",{className:"profile-user-name",children:_.name||"Welcome!"}),i.jsxs("div",{className:"profile-user-role-badge",children:[i.jsxs("svg",{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:_.currentRole})]})]})]}),i.jsx("div",{className:"profile-main-content",children:i.jsxs("div",{className:"profile-content-wrapper",children:[i.jsxs("div",{className:"profile-tabs",children:[i.jsx("button",{className:`profile-tab ${r==="account"?"active":""}`,onClick:()=>{n("account"),o(!1),G("")},children:"Account"}),i.jsx("button",{className:`profile-tab ${r==="security"?"active":""}`,onClick:()=>{n("security"),l(!1),G("")},children:"Security"})]}),X&&i.jsx("div",{className:`profile-alert ${X.includes("successfully")?"success":"error"}`,children:i.jsx("span",{children:X})}),$.general&&i.jsx("div",{className:"profile-alert error",children:i.jsx("span",{children:$.general})}),i.jsx("div",{className:"profile-tab-content",children:r==="account"?i.jsxs("div",{className:"account-section",children:[!_.name&&!_.email&&!_.mobile&&i.jsxs("div",{className:"welcome-banner",children:[i.jsxs("svg",{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."})]}),i.jsxs("div",{className:"profile-field-section",children:[i.jsxs("div",{className:"profile-field-header",children:[i.jsx("label",{className:"profile-field-label",children:"Name"}),!s&&i.jsx("button",{className:"profile-field-edit-btn",onClick:()=>o(!0),children:"Edit"})]}),s?i.jsxs("form",{onSubmit:uT,className:"profile-inline-form",children:[i.jsx("input",{type:"text",name:"name",className:"profile-form-input",value:_.name,onChange:Me,placeholder:"Enter your full name",autoFocus:!0}),i.jsxs("div",{className:"profile-inline-actions",children:[i.jsx("button",{type:"button",className:"profile-cancel-btn",onClick:()=>{o(!1),j({}),B(Y=>({...Y,name:N?.name||""}))},children:"Cancel"}),i.jsx("button",{type:"submit",className:"profile-save-btn",disabled:U,children:U?"Saving...":"Save"})]}),$.name&&i.jsx("div",{className:"profile-form-error",children:$.name})]}):i.jsx("div",{className:"profile-field-value",children:_.name||i.jsx("span",{className:"empty-value",children:"Click edit to add your name"})})]}),_.email&&i.jsxs("div",{className:"profile-field-section",children:[i.jsx("label",{className:"profile-field-label",children:"Email"}),i.jsxs("div",{className:"profile-field-value readonly",children:[i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"field-icon",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"})}),_.email]})]}),_.mobile&&i.jsxs("div",{className:"profile-field-section",children:[i.jsx("label",{className:"profile-field-label",children:"Mobile Number"}),i.jsxs("div",{className:"profile-field-value readonly",children:[i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"field-icon",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"})}),_.mobile]})]}),i.jsxs("div",{className:"profile-field-section",children:[i.jsx("label",{className:"profile-field-label",children:"Roles"}),i.jsx("div",{className:"roles-list",children:_.roles&&_.roles.length>0?_.roles.map((Y,ae)=>i.jsxs("div",{className:`role-item ${Y.name===_.currentRole?"active":""}`,children:[i.jsxs("div",{className:"role-info",children:[i.jsxs("svg",{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:Y.name})]}),Y.name===_.currentRole?i.jsx("span",{className:"role-badge",children:"Current"}):i.jsx("button",{className:"role-switch-btn",onClick:()=>hT(Y.id),disabled:q!==null,children:q===Y.id?"Switching...":"Switch"})]},Y.id)):i.jsxs("div",{className:"role-item active",children:[i.jsxs("div",{className:"role-info",children:[i.jsxs("svg",{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:_.currentRole||"Admin"})]}),i.jsx("span",{className:"role-badge",children:"Current"})]})})]}),i.jsx("div",{className:"profile-field-section logout-section",children:i.jsxs("button",{className:"logout-button",onClick:pT,children:[i.jsxs("svg",{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"})]})})]}):i.jsxs("div",{className:"security-section",children:[p&&i.jsxs("div",{className:"security-block",children:[i.jsxs("div",{className:"security-header",children:[i.jsxs("div",{children:[i.jsxs("h4",{className:"security-title",children:["Password",k&&!k.allow_change&&i.jsx("span",{className:"password-disabled-badge",children:"Disabled"})]}),!L&&i.jsxs("p",{className:"security-subtitle",children:["Last changed: ",_.lastPasswordChange,_.nextPasswordDue&&i.jsxs(i.Fragment,{children:[" • ",i.jsxs("span",{className:_.nextPasswordDue==="Expired"?"password-expired":"",children:["Next due: ",_.nextPasswordDue]})]})]}),L&&i.jsx("p",{className:"security-subtitle",children:"Set your password to secure your account"})]}),!a&&k?.allow_change!==!1&&i.jsx("button",{className:"profile-field-edit-btn",onClick:()=>{l(!0),W({currentPassword:"",newPassword:"",confirmPassword:""}),z({})},children:L?"Set Password":"Change Password"})]}),a&&i.jsxs("form",{onSubmit:fT,className:"password-form",children:[!L&&i.jsxs("div",{className:"profile-form-group",children:[i.jsx("label",{className:"profile-form-label",children:"Current Password"}),i.jsx("input",{type:"password",name:"currentPassword",className:"profile-form-input",value:F.currentPassword,onChange:nn,placeholder:"Enter current password",autoComplete:"new-password"}),E.currentPassword&&i.jsx("div",{className:"profile-form-error",children:E.currentPassword})]}),i.jsxs("div",{className:"profile-form-group",children:[i.jsx("label",{className:"profile-form-label",children:L?"Password":"New Password"}),i.jsx("input",{type:"password",name:"newPassword",className:"profile-form-input",value:F.newPassword,onChange:nn,placeholder:L?"Enter password":"Enter new password",autoComplete:"new-password"}),E.newPassword&&i.jsx("div",{className:"profile-form-error",children:E.newPassword})]}),i.jsx("div",{className:"password-requirements",children:k&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:`password-requirement ${ne.minLength?"met":""}`,children:[i.jsx("svg",{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"})}),i.jsxs("span",{children:["Minimum ",k.min_length," characters"]})]}),k.require_uppercase&&i.jsxs("div",{className:`password-requirement ${ne.hasUpperCase?"met":""}`,children:[i.jsx("svg",{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"})}),i.jsx("span",{children:"One uppercase character"})]}),k.require_lowercase&&i.jsxs("div",{className:`password-requirement ${ne.hasLowerCase?"met":""}`,children:[i.jsx("svg",{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"})}),i.jsx("span",{children:"One lowercase character"})]}),k.require_numbers&&i.jsxs("div",{className:`password-requirement ${ne.hasNumber?"met":""}`,children:[i.jsx("svg",{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"})}),i.jsx("span",{children:"One number"})]}),k.require_special_chars&&i.jsxs("div",{className:`password-requirement ${ne.hasSpecialChar?"met":""}`,children:[i.jsx("svg",{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"})}),i.jsx("span",{children:"One special character"})]})]})}),i.jsxs("div",{className:"profile-form-group",children:[i.jsx("label",{className:"profile-form-label",children:"Confirm Password"}),i.jsx("input",{type:"password",name:"confirmPassword",className:"profile-form-input",value:F.confirmPassword,onChange:nn,placeholder:L?"Confirm password":"Confirm new password",autoComplete:"new-password"}),E.confirmPassword&&i.jsx("div",{className:"profile-form-error",children:E.confirmPassword})]}),i.jsxs("div",{className:"profile-form-actions",children:[i.jsx("button",{type:"button",className:"profile-cancel-btn",onClick:()=>{l(!1),z({}),W({currentPassword:"",newPassword:"",confirmPassword:""})},children:"Cancel"}),i.jsx("button",{type:"submit",className:"profile-submit-btn",disabled:U,children:U?L?"Setting...":"Updating...":L?"Set Password":"Update Password"})]})]})]}),i.jsx("div",{className:"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:[u?"Enabled":"Disabled"," ",u?"":" - Add an extra layer of security"]}),!u&&N?.auth_config?.two_factor_auth?.can_enable===!1&&N?.auth_config?.two_factor_auth?.issue&&i.jsx("p",{style:{color:"#dc2626",fontSize:"14px",marginTop:"8px"},children:N.auth_config.two_factor_auth.issue})]}),!u&&N?.auth_config?.two_factor_auth?.can_enable===!0&&i.jsx("button",{className:"toggle-btn",onClick:vy,children:"Enable"}),u&&N?.auth_config?.two_factor_auth?.can_disable===!0&&i.jsx("button",{className:"toggle-btn enabled",onClick:vy,children:"Disable"})]})}),i.jsxs("div",{className:"security-block",children:[i.jsx("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"})]})}),i.jsx("div",{className:"sessions-list",children:y?i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"2rem"},children:[i.jsx(A.Spin,{size:"small"}),i.jsx("span",{style:{marginLeft:"8px",color:"#6b7280"},children:"Loading sessions..."})]}):v?i.jsxs("div",{style:{padding:"1rem",backgroundColor:"#fef2f2",border:"1px solid #fecaca",borderRadius:"8px",textAlign:"center"},children:[i.jsx("p",{style:{color:"#b91c1c",margin:"0 0 8px 0"},children:"Failed to load sessions"}),i.jsx("p",{style:{color:"#dc2626",fontSize:"14px",margin:"0 0 8px 0"},children:v}),i.jsx("button",{onClick:Pe,style:{fontSize:"14px",color:"#dc2626",textDecoration:"underline",background:"none",border:"none",cursor:"pointer"},children:"Try again"})]}):m.length>0?m.map((Y,ae)=>{const de=ve(Y);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",{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:de.deviceName}),Y.is_current?i.jsx("span",{className:"session-status-tag current",children:"Current"}):de.isActive?i.jsx("button",{className:"logout-tag-btn logout-tag-btn-ghost",onClick:()=>xy(Y.id),children:"Logout"}):i.jsx("button",{className:"logout-tag-btn",onClick:()=>xy(Y.id),children:"Logout"})]}),i.jsxs("p",{className:"session-details",children:[de.os," • ",de.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: ",de.sessionStartTime]}),i.jsx("p",{className:"session-last-active",children:de.isActive?"Active now":`Last seen: ${de.lastSeen}`})]})})]},Y.id||ae)}):i.jsx("p",{className:"no-sessions",children:"No active sessions found"})}),m.length>1&&i.jsx("button",{className:"logout-all-btn",onClick:cT,children:"Sign me out of all other sessions"})]}),i.jsxs("div",{className:"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:S&&S.length>0?S.map((Y,ae)=>i.jsx("div",{className:"token-item",children:i.jsx("div",{className:"token-info",children:i.jsxs("div",{className:"token-details",children:[i.jsxs("svg",{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:[Y.role," - Bearer Token"]}),i.jsx("p",{className:"token-type",children:"Type: Bearer Authentication Token"}),i.jsxs("p",{className:"token-created",children:["Created: ",new Date(Y.created).toLocaleDateString()]}),Y.expiry?i.jsxs("p",{className:"token-expiry",children:["Expires: ",new Date(Y.expiry).toLocaleDateString()]}):i.jsx("p",{className:"token-expiry",children:"Expires: Never"})]})]})})},ae)):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"})]})})]})]})})]})})]})]})};function cy(e,t,r=[]){const n=t.replace(/\/+$/,"")||"/";for(const s of e){const o=s.url||s.uri,a=o?.replace(/\/+$/,"")||"";if(a&&n===a)return[...r,{name:s.name,url:o}];if(s.children?.length){const l=[...r,{name:s.name,url:o}],d=cy(s.children,t,l);if(d)return d}}return null}function $E(e){return e.replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function jE(e){const t=e.replace(/\/+$/,"").split("/").filter(Boolean),r=[{name:"Home",url:"/app"}],n=t[0]==="app"?1:0;for(let s=n;s<t.length;s++){const o="/"+t.slice(0,s+1).join("/");r.push({name:$E(t[s]),url:o})}return r}const dy=()=>{const{pathname:e}=R.useLocation(),{menu:t}=qe(),r=b.useMemo(()=>{const n=e.replace(/\/+$/,"")||"/";if(n==="/app"||n==="/")return[{name:"Home"}];const s=cy(t||[],e);if(s){const a=s[0]?.url?.replace(/\/+$/,"");return a!=="/app"&&a!=="/"?[{name:"Home",url:"/app"},...s]:s}return jE(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,s)=>{const o=s===r.length-1;return i.jsxs("li",{className:`flex items-center gap-1.5 ${s>0&&s<r.length-1?"hidden sm:flex":""}`,children:[s>0&&i.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground breadcrumb-separator flex-shrink-0"}),o||!n.url?i.jsx("span",{className:"text-foreground font-medium breadcrumb-current truncate max-w-[200px]",children:n.name}):i.jsx(kr,{to:n.url,className:"text-muted-foreground hover:text-foreground transition-colors truncate max-w-[200px]",children:n.name})]},s)}),r.length>2&&i.jsxs("li",{className:"flex items-center gap-1.5 sm:hidden",style:{order:1},children:[i.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground breadcrumb-separator flex-shrink-0"}),i.jsx("span",{className:"text-muted-foreground",children:"..."})]})]})})},zE=({onLogout:e,className:t=""})=>i.jsxs("a",{className:`dropdown-item profile-logout ${t}`,href:"#",onClick:r=>{r.preventDefault(),e()},children:[i.jsxs("svg",{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"})]}),HE=({onViewProfile:e,className:t=""})=>i.jsxs("a",{className:`dropdown-item profile-view ${t}`,href:"#",onClick:r=>{r.preventDefault(),e()},children:[i.jsxs("svg",{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"})]}),uy=({profileInfo:e,theme:t={},config:r={},hidden:n=!1})=>{const[s,o]=b.useState(!1),[a,l]=b.useState(!1),[d,c]=b.useState(!1),[u,f]=b.useState(null),p=b.useRef(null);R.useNavigate(),b.useEffect(()=>{const E=z=>{p.current&&!p.current.contains(z.target)&&(o(!1),l(!1))};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]);const h=()=>{o(!s),s||l(!1)},m=()=>{iy(()=>{Ml({theme:t})})},g=E=>{window.location.href=E},y=e?.current_role||e?.user_role,w=e?.other_roles||[],{showProfile:v=!0,showLeftSection:x=!0,showRightSection:S=!0,showBreadcrumbs:T=!1,customLeftContent:k=null,customRightContent:M=null,customProfileMenu:P=null,customViewProfile:N=null,theme:D="light",profileMenuConfig:V={},className:O="",style:L={}}=r,_=D==="dark",{showViewProfile:B=!0,showLogout:F=!0,showRoleSwitch:W=!0,customMenuItems:$=[]}=V,j=()=>{c(!0),o(!1)};return i.jsxs(i.Fragment,{children:[!n&&i.jsx("header",{className:`topbar header-container ${_?"topbar-theme-dark":""} ${O}`,style:L,children:i.jsxs("div",{className:"topbar-content",children:[x&&i.jsx("div",{className:"topbar-left",children:k||T&&i.jsx(dy,{})||null}),S&&i.jsxs("div",{className:"topbar-right",children:[M,v&&i.jsxs("div",{className:"dropdown profile-dropdown-container",ref:p,children:[i.jsxs("div",{className:"profile-dropdown-menu-button",onClick:h,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=${Om("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-[12px] ${_?"text-white/70":"text-gray-600"}`,children:y})]})]}),i.jsx("svg",{className:`dropdown-arrow ${s?"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:_?"#FFFFFF":"#414651"})})]}),i.jsxs("ul",{className:`profile-dropdown-menu ${s?"show":""}`,children:[w.length>0&&a&&i.jsx("li",{children:i.jsx("div",{className:"profile-roles complete-hidden-scroll-style",children:w.map((E,z)=>i.jsxs("div",{className:"dropdown-item profile-each-role",onClick:()=>g(E.url),children:[i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("g",{clipPath:"url(#clip0_1427_392)",children:i.jsx("path",{d:"M0.833374 7.99998C0.833374 4.04198 4.04204 0.833313 8.00004 0.833313C11.958 0.833313 15.1667 4.04198 15.1667 7.99998C15.1667 11.958 11.958 15.1666 8.00004 15.1666C4.04204 15.1666 0.833374 11.958 0.833374 7.99998ZM8.00004 1.83331C4.59404 1.83331 1.83337 4.59398 1.83337 7.99998C1.83337 9.58131 2.42804 11.0233 3.40671 12.1146L3.60604 11.7646C4.28871 10.5706 5.55871 9.83331 6.93471 9.83331H9.06604C10.4414 9.83331 11.7114 10.5706 12.394 11.7646L12.5934 12.114C13.572 11.0226 14.1667 9.58065 14.1667 7.99998C14.1667 4.59398 11.406 1.83331 8.00004 1.83331ZM11.8454 12.8206L11.5254 12.2606C11.0214 11.378 10.0827 10.8333 9.06604 10.8333H6.93471C5.91804 10.8333 4.97871 11.378 4.47471 12.2606L4.15471 12.8213C5.20871 13.6633 6.54537 14.1666 8.00004 14.1666C9.45471 14.1666 10.7914 13.6633 11.8454 12.8206ZM5.66671 6.33331C5.66671 5.04465 6.71137 3.99998 8.00004 3.99998C9.28871 3.99998 10.3334 5.04465 10.3334 6.33331C10.3334 7.62198 9.28871 8.66665 8.00004 8.66665C6.71137 8.66665 5.66671 7.62198 5.66671 6.33331ZM8.00004 4.99998C7.26337 4.99998 6.66671 5.59665 6.66671 6.33331C6.66671 7.06998 7.26337 7.66665 8.00004 7.66665C8.73671 7.66665 9.33337 7.06998 9.33337 6.33331C9.33337 5.59665 8.73671 4.99998 8.00004 4.99998Z",fill:"#717680"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_1427_392",children:i.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),i.jsx("span",{className:"label",children:E.label})]},z))})}),i.jsx("li",{children:i.jsx("hr",{className:"profile-dropdown-divider"})}),$.map((E,z)=>i.jsx("li",{children:E},z)),B&&i.jsx("li",{children:i.jsx(HE,{onViewProfile:j})}),F&&i.jsx("li",{children:i.jsx(zE,{onLogout:m})})]})]})]})]})}),N?N({user:e,isOpen:d,onClose:()=>c(!1)}):i.jsx(ly,{isOpen:d,onClose:()=>c(!1),profileData:u})]})};function fy(e,t){const r=[],n=new Set;for(const s of e){const o=s.url||s.uri;if(o&&!n.has(o)&&(n.add(o),r.push({name:s.name,url:o,icon:s.icon,parentName:t})),s.children?.length){const a=fy(s.children,s.name);for(const l of a)n.has(l.url)||(n.add(l.url),r.push(l))}}return r}const hy=()=>{const[e,t]=b.useState(!1),[r,n]=b.useState(""),[s,o]=b.useState(0),a=b.useRef(null),l=b.useRef(null),{menu:d}=qe(),{navigateTo:c}=kl(),u=b.useMemo(()=>fy(d||[]),[d]),f=b.useMemo(()=>{if(!r.trim())return u;const m=r.toLowerCase();return u.filter(g=>g.name.toLowerCase().includes(m)||g.parentName&&g.parentName.toLowerCase().includes(m))},[u,r]);b.useEffect(()=>{o(0)},[r]),b.useEffect(()=>{e&&(n(""),o(0),requestAnimationFrame(()=>{a.current?.focus()}))},[e]),b.useEffect(()=>{const m=g=>{(g.metaKey||g.ctrlKey)&&g.key==="k"&&(g.preventDefault(),t(y=>!y))};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[]),b.useEffect(()=>{if(!l.current)return;const m=l.current.querySelector('[data-selected="true"]');m&&m.scrollIntoView({block:"nearest"})},[s]);const p=b.useCallback(m=>{t(!1),c(m.url)},[c]),h=m=>{switch(m.key){case"ArrowDown":m.preventDefault(),o(g=>g<f.length-1?g+1:g);break;case"ArrowUp":m.preventDefault(),o(g=>g>0?g-1:g);break;case"Enter":m.preventDefault(),f[s]&&p(f[s]);break}};return i.jsx(hi,{open:e,onOpenChange:t,children:i.jsxs(pi,{children:[i.jsx(mi,{style:{position:"fixed",inset:0,zIndex:50,backgroundColor:"rgba(0, 0, 0, 0.5)"}}),i.jsxs(gi,{style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:50,width:"100%",maxWidth:"28rem",backgroundColor:"#fff",borderRadius:"12px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",overflow:"hidden",outline:"none"},children:[i.jsx(yi,{className:"sr-only",children:"Search pages"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid #E9EAEB"},onKeyDown:h,children:[i.jsx(Vy,{style:{width:16,height:16,color:"#717680",marginRight:12,flexShrink:0}}),i.jsx("input",{ref:a,type:"text",placeholder:"Search pages...",value:r,onChange:m=>n(m.target.value),"aria-label":"Search pages",style:{flex:1,backgroundColor:"transparent",fontSize:14,outline:"none",border:"none",color:"#252b37"}}),i.jsx("kbd",{style:{pointerEvents:"none",marginLeft:8,display:"inline-flex",height:20,alignItems:"center",gap:4,borderRadius:4,border:"1px solid #E9EAEB",backgroundColor:"#F5F5F5",padding:"0 6px",fontFamily:"monospace",fontSize:10,fontWeight:500,color:"#717680",userSelect:"none"},children:"ESC"})]}),i.jsx("div",{ref:l,style:{maxHeight:300,overflowY:"auto",padding:4},role:"listbox",children:f.length===0?i.jsx("div",{style:{padding:"24px 12px",textAlign:"center",fontSize:14,color:"#717680"},children:"No results found"}):f.map((m,g)=>{const y=g===s;return i.jsxs("button",{role:"option","aria-selected":y,"data-selected":y,style:{display:"flex",alignItems:"center",gap:12,padding:"8px 12px",borderRadius:6,width:"100%",textAlign:"left",fontSize:14,border:"none",cursor:"pointer",transition:"background-color 0.15s",backgroundColor:y?"var(--color-brand-50, #EAE8FF)":"transparent",color:y?"var(--color-brand-500, #5048ED)":"#414651"},onClick:()=>p(m),onMouseEnter:()=>o(g),children:[i.jsx("span",{style:{flexShrink:0,color:y?"var(--color-brand-500, #5048ED)":"#717680"},children:i.jsx(Po,{item:m})}),i.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m.name}),m.parentName&&i.jsxs("span",{style:{color:"#717680",marginLeft:"auto",fontSize:12,flexShrink:0},children:["in ",m.parentName]})]},m.url)})})]})]})})},WE={showTopbar:!0,showNavbar:!0,layoutType:"wide",showCommandPalette:!0},qE={showProfile:!0,showLeftSection:!0,showRightSection:!0,showBreadcrumbs:!1,customLeftContent:null,customRightContent:null,customProfileMenu:null,customTopbar:null,customViewProfile:null,theme:"light",profileMenuConfig:{showViewProfile:!0,showLogout:!0,showRoleSwitch:!0,customMenuItems:[]},className:"",style:{}},KE={showLogo:!0,showMenu:!0,isCollapsed:!1,collapsible:!1,customLogo:null,customMenuContent:null,customBottomContent:null,customNavbar:null,customMenu:null,theme:"light",menuConfig:{showIcons:!0,showSubmenus:!0,expandOnHover:!1,customMenuItemRenderer:null},className:"",style:{}},Eo=(e={},t={})=>{const r={...t};return Object.keys(e).forEach(n=>{if(e[n]===void 0||e[n]===null)return;e[n]&&(e[n].$$typeof||typeof e[n]=="function")||typeof e[n]=="function"||Array.isArray(e[n])?r[n]=e[n]:typeof e[n]=="object"&&typeof t[n]=="object"&&!Array.isArray(t[n])?r[n]=Eo(e[n],t[n]):r[n]=e[n]}),r},GE="244px",XE="56px",py=()=>{const{loading:e,error:t,menu:r,profileInfo:n,appLogo:s,theme:o={},layoutConfig:a={},topbarConfig:l={},navbarConfig:d={},customComponents:c={}}=qe(),u=R.useLocation(),f=Eo(a,WE),p=Eo(l,qE),h=Eo(d,KE),[m,g]=b.useState(!h.isCollapsed),y=b.useCallback(N=>{g(N),h.onCollapseChange?.(!N)},[h.onCollapseChange]),w=()=>{const N=document.getElementById("contentSpinner");N&&N.classList.add("active")},v=()=>{const N=document.getElementById("contentSpinner");N&&N.classList.remove("active")};if(b.useEffect(()=>{w();const N=300,D=Date.now(),V=setTimeout(()=>{const O=Date.now()-D;O>=N?v():setTimeout(v,N-O)},500);return()=>{clearTimeout(V)}},[u.pathname]),b.useEffect(()=>(window.addEventListener("beforeunload",w),()=>{window.removeEventListener("beforeunload",w)}),[]),e)return i.jsx("div",{className:"layout-loading",children:"Loading..."});if(t)return i.jsxs("div",{className:"layout-error",children:["Error: ",t]});const x=f.layoutType||o?.layout||"wide",S=f.showNavbar&&o?.menu_config?.display_sidebar!==!1,T=f.showTopbar,k=c?.Layout,M=c?.Topbar||p.customTopbar,P=c?.Navbar||h.customNavbar;return k?i.jsx(k,{menu:r,profileInfo:n,appLogo:s,theme:o,layoutConfig:f,topbarConfig:p,navbarConfig:h,children:i.jsx(R.Outlet,{})}):i.jsxs(jS,{defaultOpen:!h.isCollapsed,open:m,onOpenChange:y,className:`layout layout-${x}`,style:{"--sidebar-width":GE,"--sidebar-width-icon":XE},children:[S&&(P?i.jsx(P,{menuItems:r,appLogo:s,theme:o,config:h}):i.jsx(ny,{menuItems:r,appLogo:s,theme:o,config:h})),i.jsxs(qS,{children:[M?i.jsx(M,{profileInfo:n,theme:o,config:p,hidden:!T}):i.jsx(uy,{profileInfo:n,theme:o,config:p,hidden:!T}),i.jsxs("div",{className:"layout-content",children:[i.jsx("div",{className:"content-spinner-container",id:"contentSpinner",children:i.jsx("div",{className:"spinner",children:i.jsxs("svg",{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(R.Outlet,{})]}),f.showCommandPalette&&i.jsx(hy,{})]})]})},YE=(e,t,r)=>{if(!e){const l=t.default;return l?.component?b.createElement(l.component,{message:"No page type specified"}):b.createElement("div",{style:{padding:"24px",color:"#f04438"}},"No page type specified")}const n=t[e]||t.default;if(!n)return b.createElement("div",{style:{padding:"24px",color:"#f04438"}},`Unknown page type: ${e}`);if(n.handler)return n.handler(r);if(!n.component){const l=t.default;if(l?.component){const d=l.propsBuilder?l.propsBuilder({...r,pageType:e}):{message:`No component configured for page type: ${e}`};return b.createElement(l.component,d)}return b.createElement("div",{style:{padding:"24px",color:"#f04438"}},`No component configured for page type: ${e}`)}let s=n.propsBuilder?n.propsBuilder({...r,pageType:e}):{};n.includeBasePath!==!1&&r.matchedRoutePath&&(s={basePath:r.matchedRoutePath,...s});const a=n.component;return b.createElement(a,s)},qn=({customPages:e={},forceRoute:t})=>{const r=R.useLocation(),{routes:n,pageTypeRegistry:s,registryLoading:o,registryError:a,initializerEndpoint:l}=qe(),d=Fn(),[c,u]=b.useState({pageType:null,customPagePath:null,matchedRoutePath:null,matchedRoute:null,loading:!0});if(b.useEffect(()=>{u(w=>({...w,loading:!0})),(()=>{const w=r.pathname;if(t){u({pageType:t.page_type,customPagePath:t.component||null,matchedRoutePath:t.path,matchedRoute:t,loading:!1});return}if(r.state&&r.state.page_type&&(r.state.page_type!=="custom"||r.state.custom_page_path)){let v=w;if(n&&n.length>0){for(const x of n)if(w===x.path||w.startsWith(x.path+"/")){v=x.path;break}}u({pageType:r.state.page_type,customPagePath:r.state.custom_page_path||null,matchedRoutePath:v,matchedRoute:null,loading:!1});return}if(n&&n.length>0){const v=[...n].sort((x,S)=>{const T=x.path.split("/").filter(M=>M).length;return S.path.split("/").filter(M=>M).length-T});for(const x of v){let S=R.matchPath({path:x.path,exact:!0},w);if(!S&&w.startsWith(x.path+"/")){const T=x.path.endsWith("/*")?x.path:`${x.path}/*`;S=R.matchPath({path:T,exact:!1},w)}if(S){u({pageType:x.page_type,customPagePath:x.component||null,matchedRoutePath:x.path,matchedRoute:x,loading:!1});return}}}u({pageType:"404",customPagePath:null,matchedRoutePath:null,matchedRoute:null,loading:!1})})()},[r,n,t]),c.loading||o)return i.jsx("div",{className:"content-spinner-container active",children:i.jsx("div",{className:"spinner",children:i.jsxs("svg",{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",{style:{padding:"24px",color:"#f04438"},children:["Failed to load page registry: ",a]});if(!s)return i.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"60vh",textAlign:"center",padding:"24px"},children:i.jsxs("div",{style:{backgroundColor:"white",borderRadius:"12px",padding:"32px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)",maxWidth:"500px",width:"100%",border:"1px solid #e1e3e6"},children:[i.jsx("h1",{style:{fontSize:"32px",margin:"0",color:"#f04438",fontWeight:"bold",lineHeight:"1"},children:"⚠️"}),i.jsx("h3",{style:{fontSize:"18px",margin:"12px 0",color:"#252b37",fontWeight:"600"},children:"Configuration Issue"}),i.jsx("p",{style:{fontSize:"14px",color:"#717680",marginBottom:"16px",lineHeight:"1.5"},children:"Unable to load page configuration from:"}),i.jsx("code",{style:{display:"block",backgroundColor:"#f9fafb",border:"1px solid #e1e3e6",borderRadius:"4px",padding:"8px 12px",fontSize:"12px",color:"#252b37",fontFamily:"Monaco, Menlo, monospace",marginBottom:"16px",wordBreak:"break-all"},children:l}),i.jsx("p",{style:{fontSize:"13px",color:"#8b909a",margin:"0"},children:"Please check your configuration or contact your administrator."})]})});const{pageType:f,customPagePath:p,matchedRoutePath:h,matchedRoute:m}=c,g=`${f}-${p||"default"}-${h||"none"}`;return i.jsx("div",{className:"h-full",children:YE(f,s,{matchedRoutePath:h,customPagePath:p,matchedRoute:m,customPages:e,location:r,apiConfig:d})},g)},my=()=>{const{metadata:e,appName:t,apiConfig:r,theme:n}=qe(),s=b.useRef(new Set),o=()=>{s.current.forEach(d=>{d.parentNode&&d.parentNode.removeChild(d)}),s.current.clear()},a=(d,c,u)=>{let f=document.querySelector(d);return f||(f=c(),document.head.appendChild(f),s.current.add(f)),u(f),f},l=(d,c="image")=>new Promise((u,f)=>{const p=document.createElement("link");p.rel="preload",p.as=c,p.href=d,p.onload=()=>u(),p.onerror=()=>f(new Error(`Failed to preload ${c}: ${d}`)),s.current.add(p),document.head.appendChild(p),setTimeout(()=>{p.parentNode&&(p.parentNode.removeChild(p),s.current.delete(p))},1e4)});return b.useEffect(()=>{if(!e)return;o();const d=(c,u)=>{if(!c)return u||null;if(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("//"))return c;try{return no(c,r)}catch(f){return console.warn(`Failed to build asset URL for ${c}:`,f),u||null}};if(e.title?document.title=e.title:t&&(document.title=t),e.description&&a('meta[name="description"]',()=>{const c=document.createElement("meta");return c.name="description",c},c=>{c.content=e.description}),e.keywords&&a('meta[name="keywords"]',()=>{const c=document.createElement("meta");return c.name="keywords",c},c=>{c.content=e.keywords}),a('meta[name="viewport"]',()=>{const c=document.createElement("meta");return c.name="viewport",c},c=>{c.content="width=device-width, initial-scale=1.0"}),n?.colors?.primary&&a('meta[name="theme-color"]',()=>{const c=document.createElement("meta");return c.name="theme-color",c},c=>{c.content=n.colors.primary}),e.favicon){const c=d(e.favicon,"/favicon.ico");c&&a('link[rel="icon"][type="image/x-icon"], link[rel="shortcut icon"]',()=>{const u=document.createElement("link");return u.rel="icon",u.type="image/x-icon",u},u=>{u.href=c,l(c).catch(f=>console.warn("Failed to preload favicon:",f.message))})}if(e.favicon_png){const c=d(e.favicon_png,"/favicon-32x32.png");c&&a('link[rel="icon"][type="image/png"]',()=>{const u=document.createElement("link");return u.rel="icon",u.type="image/png",u.sizes="32x32",u},u=>{u.href=c,l(c).catch(f=>console.warn("Failed to preload PNG favicon:",f.message))})}if(e.apple_touch_icon){const c=d(e.apple_touch_icon,"/apple-touch-icon.png");c&&a('link[rel="apple-touch-icon"]',()=>{const u=document.createElement("link");return u.rel="apple-touch-icon",u},u=>{u.href=c,l(c).catch(f=>console.warn("Failed to preload Apple touch icon:",f.message))})}if(e.og_image){const c=d(e.og_image,"/og-image.png");c&&(l(c).catch(u=>console.warn("Failed to preload OG image:",u.message)),a('meta[property="og:image"]',()=>{const u=document.createElement("meta");return u.setAttribute("property","og:image"),u},u=>{u.content=c}),(e.og_image_alt||e.title)&&a('meta[property="og:image:alt"]',()=>{const u=document.createElement("meta");return u.setAttribute("property","og:image:alt"),u},u=>{u.content=e.og_image_alt||e.title||t||"Zango CRM"}))}if(a('meta[property="og:title"]',()=>{const c=document.createElement("meta");return c.setAttribute("property","og:title"),c},c=>{c.content=e.title||t||"Zango CRM"}),e.description&&a('meta[property="og:description"]',()=>{const c=document.createElement("meta");return c.setAttribute("property","og:description"),c},c=>{c.content=e.description}),a('meta[property="og:type"]',()=>{const c=document.createElement("meta");return c.setAttribute("property","og:type"),c},c=>{c.content="website"}),a('meta[property="og:url"]',()=>{const c=document.createElement("meta");return c.setAttribute("property","og:url"),c},c=>{c.content=window.location.href}),a('meta[name="twitter:card"]',()=>{const c=document.createElement("meta");return c.name="twitter:card",c},c=>{c.content=e.og_image?"summary_large_image":"summary"}),a('meta[name="twitter:title"]',()=>{const c=document.createElement("meta");return c.name="twitter:title",c},c=>{c.content=e.title||t||"Zango CRM"}),e.description&&a('meta[name="twitter:description"]',()=>{const c=document.createElement("meta");return c.name="twitter:description",c},c=>{c.content=e.description}),e.og_image){const c=d(e.og_image,"/og-image.png");c&&a('meta[name="twitter:image"]',()=>{const u=document.createElement("meta");return u.name="twitter:image",u},u=>{u.content=c})}if(a('link[rel="canonical"]',()=>{const c=document.createElement("link");return c.rel="canonical",c},c=>{c.href=window.location.href.split("?")[0]}),e.manifest||e.webmanifest){const c=d(e.manifest||e.webmanifest,"/manifest.json");c&&a('link[rel="manifest"]',()=>{const u=document.createElement("link");return u.rel="manifest",u},u=>{u.href=c})}return o},[e,t,n]),null},ZE=({config:e,onExpire:t,onWarning:r,onActivity:n})=>{const[s,o]=b.useState(!1),[a,l]=b.useState(0),d=b.useRef(new Date),c=b.useRef(null),u=b.useRef(null),f=b.useRef(!1),p=b.useRef(!1),h=b.useRef(!1),m=b.useRef(!1),g=b.useRef(t),y=b.useRef(r),w=b.useRef(n),v=b.useRef(()=>{}),x=b.useRef(()=>{}),S=b.useRef(()=>{}),T=b.useRef(()=>{});b.useEffect(()=>{g.current=t,y.current=r,w.current=n},[t,r,n]),b.useEffect(()=>{h.current=s},[s]);const k=["mousemove","scroll","keyup","click","touchstart","touchend","touchmove"],M=b.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]),P=b.useCallback(()=>{f.current=!0,m.current=!1,M(),u.current&&(clearInterval(u.current),u.current=null),g.current&&g.current(),Ml({preserveCurrentPath:!0})},[M]),N=b.useCallback(()=>{m.current=!1,o(!1),u.current&&(clearInterval(u.current),u.current=null),p.current=!1},[]),D=b.useCallback(()=>{m.current=!0,o(!1)},[]),V=b.useCallback(()=>{const{warn_after:j,expire_after:E}=e,z=E-j;if(p.current)return;l(z),p.current=!0;const X=new Date;X.setSeconds(X.getSeconds()+z),u.current=setInterval(()=>{const G=new Date().getTime(),U=X.getTime()-G,H=Math.floor(U/1e3);H>0?l(H):(u.current&&(clearInterval(u.current),u.current=null),l(0))},1e3)},[e]),O=b.useCallback(()=>{u.current&&(clearInterval(u.current),u.current=null),p.current=!1;const j=e.expire_after-e.warn_after;l(j)},[e]),L=b.useCallback(j=>{if(j==="logout"||j?.response==="logout"){P();return}v.current()},[P]);b.useLayoutEffect(()=>{S.current=L},[L]);const _=b.useCallback(async()=>{const j=Math.floor((new Date().getTime()-d.current.getTime())/1e3);try{const E=await Sm(e.ping_url,j);E.success?S.current(E.response):v.current()}catch{v.current()}},[e.ping_url]);b.useLayoutEffect(()=>{x.current=_},[_]);const B=b.useCallback(()=>{M();const j=Math.floor((new Date().getTime()-d.current.getTime())/1e3),{warn_after:E,expire_after:z}=e;let X;if(j>=z){P();return}else j>=E?(p.current||V(),o(!0),y.current&&y.current(),X=z-j):(N(),p.current&&O(),X=E-j);const G=Math.min(X*1e3,2147483647);c.current=setTimeout(()=>{x.current()},G)},[e,M,P,V,N,O]);b.useLayoutEffect(()=>{v.current=B},[B]);const F=b.useCallback(()=>{const j=new Date;if(j.getTime()-d.current.getTime()<1e3)return;const E=Math.floor((j.getTime()-d.current.getTime())/1e3);if(m.current&&E>=e.warn_after&&E<e.expire_after){m.current=!1,v.current(),w.current&&w.current();return}if(d.current=j,E>=e.expire_after){P();return}h.current&&(x.current(),N()),w.current&&w.current()},[e.expire_after,e.warn_after,P,N]);b.useLayoutEffect(()=>{T.current=F},[F]);const W=b.useCallback(()=>{m.current=!1,d.current=new Date,N(),x.current()},[N]),$=b.useCallback(()=>{P()},[P]);return b.useEffect(()=>{if(!e.enabled)return;const j=()=>T.current();return k.forEach(E=>{document.addEventListener(E,j,!0)}),v.current(),()=>{k.forEach(E=>{document.removeEventListener(E,j,!0)}),c.current&&(clearTimeout(c.current),c.current=null),u.current&&(clearInterval(u.current),u.current=null)}},[e.enabled]),{showWarning:s,countdown:a,hideWarning:N,dismissWarning:D,renewSession:W,logoutNow:$}},JE=({open:e,countdown:t,onContinue:r,onLogout:n,onDismiss:s})=>{const o=l=>{if(l>=60){const d=Math.floor(l/60),c=l%60;return c===0?`${d} min`:`${d} min ${c} sec`}return`${l} sec`},a=l=>{!l&&s&&s()};return i.jsxs(hi,{open:e,onOpenChange:a,children:[i.jsxs(pi,{children:[i.jsx(mi,{className:"session-security-overlay","data-testid":"session-security-overlay"}),i.jsxs(gi,{className:"session-security-modal","aria-describedby":"session-security-description",onEscapeKeyDown:l=>{s?s():l.preventDefault()},onPointerDownOutside:l=>{s?(l.preventDefault(),s()):l.preventDefault()},children:[i.jsx(yi,{className:"session-security-title",children:"Your session is about to expire"}),i.jsxs("div",{id:"session-security-description",className:"session-security-content",children:[i.jsxs("p",{className:"session-security-countdown",children:[i.jsx("span",{id:"session_security_counter",children:o(t)})," remaining"]}),i.jsx("p",{className:"session-security-instruction",children:"Click or type to extend your session."})]}),i.jsxs("div",{className:"session-security-actions",children:[i.jsx("button",{onClick:r,className:"session-security-btn session-security-btn-primary",children:"Continue Session"}),s&&i.jsx("button",{type:"button",onClick:s,className:"session-security-btn session-security-btn-secondary","data-testid":"session-security-dismiss",children:"Dismiss"}),i.jsx("button",{onClick:n,className:"session-security-btn session-security-btn-secondary",children:"Logout"})]})]})]}),i.jsx("style",{children:`
|
|
298
298
|
.session-security-overlay {
|
|
299
299
|
position: fixed;
|
|
300
300
|
inset: 0;
|
|
@@ -418,10 +418,10 @@ export default App;`,h=`mkdir -p ${d}`,m={container:{padding:"32px",maxWidth:"90
|
|
|
418
418
|
transform: translate(-50%, -50%) scale(1);
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
`})]})},
|
|
421
|
+
`})]})},QE=({config:e,children:t})=>{const{showWarning:r,countdown:n,renewSession:s,dismissWarning:o,logoutNow:a}=ZE({config:e,onWarning:()=>{console.log("Session security warning displayed")},onExpire:()=>{console.log("Session expired")},onActivity:()=>{}});return!e||!e.enabled?i.jsx(i.Fragment,{children:t}):i.jsxs(i.Fragment,{children:[t,i.jsx(JE,{open:r,countdown:n,onContinue:s,onLogout:a,onDismiss:o})]})},gy=()=>{const e=R.useNavigate(),[t,r]=b.useState(null);return b.useEffect(()=>{(async()=>{try{const s=await Cm();s.success||s.responseStatus===401?setTimeout(()=>{e("/app/login")},1500):(r(s.response?.message||"An error occurred while logging out. Redirecting to login..."),setTimeout(()=>{e("/app/login")},2e3))}catch(s){console.error("Logout error:",s),r("An error occurred. Redirecting to login..."),setTimeout(()=>{e("/app/login")},2e3)}})()},[e]),i.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",backgroundColor:"#f5f5f5"},children:[i.jsx("div",{style:{backgroundColor:"white",padding:"40px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",textAlign:"center",maxWidth:"400px",width:"100%"},children:t?i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{marginBottom:"20px",color:"#ef4444"},children:i.jsx("svg",{width:"50",height:"50",fill:"none",viewBox:"0 0 24 24",style:{margin:"0 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",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"12px",color:"#333"},children:"Logout Error"}),i.jsx("p",{style:{fontSize:"16px",color:"#666",margin:0},children:t})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{marginBottom:"20px"},children:i.jsx("div",{style:{width:"50px",height:"50px",border:"3px solid #f3f3f3",borderTop:"3px solid var(--primary-color, #3b82f6)",borderRadius:"50%",margin:"0 auto",animation:"spin 1s linear infinite"}})}),i.jsx("h2",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"12px",color:"#333"},children:"Logging you out..."}),i.jsx("p",{style:{fontSize:"16px",color:"#666",margin:0},children:"Please wait while we securely log you out."})]})}),i.jsx("style",{children:`
|
|
422
422
|
@keyframes spin {
|
|
423
423
|
0% { transform: rotate(0deg); }
|
|
424
424
|
100% { transform: rotate(360deg); }
|
|
425
425
|
}
|
|
426
|
-
`})]})},QE=()=>{const{menu:e,profileInfo:t,initializerEndpoint:r}=qe();return e.length===0&&t?.user_role&&t.user_role,i.jsx("div",{className:"flex flex-col items-center justify-center h-screen text-center p-6 bg-gray-100",children:i.jsxs("div",{className:"bg-white rounded-xl p-12 shadow-md max-w-2xl w-full",children:[i.jsx("h1",{className:"text-[40px] m-0 text-red-500 font-bold leading-none",children:"⚙️"}),i.jsx("h2",{className:"text-2xl my-4 text-gray-800 font-semibold",children:"Configuration Error"}),i.jsx("p",{className:"text-base text-gray-600 mb-6 leading-relaxed",children:"The application is trying to fetch configuration from:"}),i.jsx("code",{className:"block bg-gray-50 border border-gray-200 rounded-md p-3 text-sm text-gray-800 font-mono mb-6 break-all",children:r}),i.jsxs("div",{className:"text-left mb-8 p-4 bg-gray-50 rounded-lg",children:[i.jsx("p",{className:"text-sm text-gray-600 mb-3 font-semibold",children:"The response is either missing or invalid. Please check:"}),i.jsxs("ul",{className:"text-sm text-gray-600 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 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="/app",children:"Go Home"})]}),i.jsx("p",{className:"text-xs text-gray-500 mt-6",children:"Contact your administrator if this issue persists."})]})})},yy=({customPages:e})=>{const t=R.useParams(),n=`${R.useLocation().pathname}-${Object.values(t).join("-")}`;return i.jsx(qn,{customPages:e},n)},RE=({firstMenuUri:e})=>{const t=R.useLocation(),r=nt(t.search);return r&&rt(r)?i.jsx(R.Navigate,{to:r,replace:!0}):e?i.jsx(R.Navigate,{to:e,replace:!0}):i.jsx("div",{className:"zango-loading",children:"No menu items available"})},wy=({customPages:e})=>{const{routes:t,loading:r,menu:n,pageTypeRegistry:s,registryError:o}=qe(),a=n.length>0?n[0].uri:null;if(r)return i.jsx("div",{className:"zango-loading",children:"Loading..."});if(o)return i.jsxs("div",{className:"zango-error",children:["Failed to load page registry: ",o]});const l=[],d=[];return s&&t.forEach(c=>{const u=s[c.page_type];let f=!1;if(c.page_type==="custom"){const p=c.extra_params||{};f=p.standalone!==void 0?p.standalone===!0:u&&u.standalone===!0}else f=u&&u.standalone===!0;f?l.push(c):d.push(c)}),i.jsxs(R.Routes,{children:[i.jsx(R.Route,{path:"app/login/*",element:i.jsx(So,{basePath:"/app/login"})}),i.jsx(R.Route,{path:"app/logout",element:i.jsx(gy,{})}),i.jsx(R.Route,{path:"app/configuration-error",element:i.jsx(QE,{})}),l.map(c=>{const u=c.path.startsWith("/")?c.path.slice(1):c.path;return i.jsxs(b.Fragment,{children:[i.jsx(R.Route,{path:`${u}/*`,element:i.jsx(qn,{customPages:e,forceRoute:c})}),i.jsx(R.Route,{path:u,element:i.jsx(qn,{customPages:e,forceRoute:c})})]},c.path)}),i.jsxs(R.Route,{path:"/",element:i.jsx(py,{}),children:[i.jsx(R.Route,{index:!0,element:a?i.jsx(R.Navigate,{to:a}):i.jsx("div",{children:"No menu items available"})}),i.jsx(R.Route,{path:"app",element:i.jsx(RE,{firstMenuUri:a})}),d.map(c=>{const u=c.path.startsWith("/")?c.path.slice(1):c.path;return i.jsxs(b.Fragment,{children:[i.jsx(R.Route,{path:`${u}/*`,element:i.jsx(yy,{customPages:e})}),i.jsx(R.Route,{path:u,element:i.jsx(yy,{customPages:e})})]},c.path)})]}),i.jsx(R.Route,{path:"*",element:i.jsx(qn,{customPages:e,forceRoute:{path:"*",page_type:"404"}})}),i.jsx(R.Route,{path:"/404",element:i.jsx(qn,{customPages:e,forceRoute:{path:"/404",page_type:"404"}})})]})},eT=({customPages:e})=>{const{appData:t,sessionSecurity:r}=qe(),n=t&&!t.is_user_anonymous,s={enabled:!0,ping_url:"/session_security/ping/",warn_after:1700,expire_after:1800},o=n?r?{...s,...r,enabled:!0}:s:null;return i.jsxs(i.Fragment,{children:[i.jsx(my,{}),n&&o?i.jsx(JE,{config:o,children:i.jsx(wy,{customPages:e})}):i.jsx(wy,{customPages:e})]})},tT=({config:e={},customPages:t={},layoutConfig:r={},topbarConfig:n={},navbarConfig:s={},customComponents:o={},authConfig:a={},appInitializerEndpoint:l})=>(l&&typeof window<"u"&&(window.app_initializer_endpoint=l),i.jsx(R.BrowserRouter,{children:i.jsx(ry,{config:e,layoutConfig:r,topbarConfig:n,navbarConfig:s,customComponents:o,authConfig:a,children:i.jsx(eT,{customPages:t})})})),rT=({customPages:e={},config:t={},layoutConfig:r={},topbarConfig:n={},navbarConfig:s={},customComponents:o={},authConfig:a={},appInitializerEndpoint:l="appbuilder/initializer"})=>i.jsxs(i.Fragment,{children:[i.jsx(tT,{config:t,customPages:e,layoutConfig:r,topbarConfig:n,navbarConfig:s,customComponents:o,authConfig:a,appInitializerEndpoint:l}),i.jsx(A.Toaster,{position:"bottom-right",expand:!0,richColors:!0,toastOptions:{className:"!rounded-[8px]"}})]});class nT{constructor(){this.setupInterceptors()}handleRedirect(t){if(rt(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),s=`${t}?next=${n}`;window.location.href=s}}setupInterceptors(){const t=window.fetch,r=this;window.fetch=async(...o)=>{try{const[a,l={}]=o,d=typeof a=="string"?a:a.toString();if(d.startsWith("http")&&!d.startsWith(window.location.origin))return await t(a,l);const u=Date.now().toString(),f=new Headers(l.headers||{});f.set("X-Client-Timestamp",u),f.set("X-Client-Timezone",Intl.DateTimeFormat().resolvedOptions().timeZone),f.set("X-Client-Platform",navigator.platform);const p={...l,headers:f},h=await t(a,p),m=window.location.origin+"/login/";return h.url&&h.url===m&&r.handleRedirect("/app/login/"),h}catch(a){throw a}};const n=XMLHttpRequest.prototype.open,s=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(...o){return this._requestUrl=o[1],n.apply(this,o)},XMLHttpRequest.prototype.send=function(...o){const a=this,l=this._requestUrl||"";if(!(l.startsWith("http")&&!l.startsWith(window.location.origin))){const c=Date.now().toString();this.setRequestHeader("X-Client-Timestamp",c),this.setRequestHeader("X-User-Agent",navigator.userAgent),this.setRequestHeader("X-Client-Timezone",Intl.DateTimeFormat().resolvedOptions().timeZone),this.setRequestHeader("X-Client-Platform",navigator.platform)}return this.addEventListener("load",function(){const c=a.responseURL||a._requestUrl,u=window.location.origin+"/login/";c&&c===u&&r.handleRedirect("/app/login/")}),s.apply(this,o)}}}new nT;const sT=(e,t)=>{if(!e)return;e.querySelectorAll("svg").forEach(n=>{n.getAttribute("fill")&&n.getAttribute("fill")!=="none"&&n.setAttribute("fill",t),n.getAttribute("stroke")&&n.getAttribute("stroke")!=="none"&&n.setAttribute("stroke",t),n.querySelectorAll("*").forEach(o=>{o.getAttribute("fill")&&o.getAttribute("fill")!=="none"&&o.setAttribute("fill",t),o.getAttribute("stroke")&&o.getAttribute("stroke")!=="none"&&o.setAttribute("stroke",t)})})},{Content:oT}=A.Layout,aT=(e,t)=>r=>{const[n,s]=b.useState(null),[o,a]=b.useState(!1),[l,d]=b.useState(!1),u=Qe()?.authConfig??null;b.useEffect(()=>{(async()=>{const m=new URLSearchParams(window.location.search),g=m.get("token"),y=m.get("request_id");if(g&&y){d(!0);try{const w=await Z.getSAMLAuthMeta(g,y);if(w?.code==="user_not_found"){A.toast.error(w.message||"User does not exist");const S=window.location.pathname;window.history.replaceState({},"",S),d(!1);return}if(w?.status===401&&w?.data?.next_step&&w.data.next_step.is_pending){let T=m.get("email")||m.get("user_email")||null,k=m.get("name")||m.get("user_name")||T;!T&&w?.data?.user&&(T=w.data.user.email||w.data.user.username,k=w.data.user.name||T);const P={...w,loginUser:{email:T,username:k||T||"SAML User",display:k||T||"SAML User"}};s(P),a(!0),d(!1);return}if(w?.roles&&w.roles.length>1){const S={status:401,data:{next_step:{id:"role_selection",is_pending:!0,metadata:{roles:w.roles}}},loginUser:{email:m.get("email")||"SAML User",username:m.get("name")||"SAML User",display:m.get("name")||"SAML User"}};s(S),a(!0),d(!1);return}const v=nt(window.location.search),x=Se(v,w?.redirect_url,"/app");_e(x)}catch(w){console.error("[withMultiStepAuth] SAML callback error:",w);const v=w instanceof Error?w.message:"Failed to process SSO authentication";A.toast.error(v);const x=window.location.pathname;window.history.replaceState({},"",x),d(!1)}}})()},[]);const f=h=>{let m=null,g=!1,y=null;if(h?.status===401&&h?.data)m=h.data?.next_step,y=h.status,g=h?.meta?.is_authenticated||!1;else if(h?.response?.status===401&&h?.response?.data)m=h.response.data?.next_step,y=h.response.status,g=h.response?.meta?.is_authenticated||!1;else if(h?.next_step)m=h.next_step,g=h?.meta?.is_authenticated||!1,y=h?.status;else{const S=h?.response?.data||h?.data||h;m=S?.next_step,g=S?.meta?.is_authenticated||h?.meta?.is_authenticated||!1,y=h?.status||h?.response?.status}if(m&&m.is_pending){s(h),a(!0);return}if(y===200&&g){const S=nt(window.location.search),T=h?.redirect_url||h?.response?.data?.redirect_url||h?.data?.redirect_url,k=Se(S,T,"/app");_e(k);return}const w=nt(window.location.search),v=h?.redirect_url||h?.response?.data?.redirect_url||h?.data?.redirect_url,x=Se(w,v,"/app");window.location.href=x},p=h=>{try{const m=nt(window.location.search),g=h?.redirect_url||h?.response?.data?.redirect_url||h?.data?.redirect_url,y=Se(m,g,"/app");_e(y)}catch(m){console.error("[withMultiStepAuth] Auth completion error:",m),_e("/app")}};if(l){const h=wt(u);return i.jsx(A.Layout,{className:"min-h-screen",style:h,children:i.jsx(oT,{className:"flex justify-center items-center min-h-screen",children:i.jsx(A.Card,{className:"w-full max-w-md shadow-lg rounded-lg",bordered:!1,children:i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[300px] text-center",children:[i.jsx(A.Spin,{size:"large"}),i.jsx("p",{className:"mt-4 text-gray-600",children:"Processing SSO authentication..."})]})})})})}return o&&n?i.jsx(rn,{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(xo.Provider,{value:{onLogin:f},children:i.jsx(e,{...r})})},iT=Object.freeze({__proto__:null,default:{crud:{component:el,includeBasePath:!0,propsBuilder:({matchedRoutePath:e})=>({})},training:{component:Dm,includeBasePath:!0,propsBuilder:({matchedRoutePath:e})=>({})},login:{component:So,includeBasePath:!0,standalone:!0,propsBuilder:({matchedRoutePath:e})=>({})},custom:{component:null,includeBasePath:!1,handler:({customPages:e,customPagePath:t,location:r,matchedRoute:n})=>{const s=n||t&&{path:null,component:t},o=e[t];return o?b.createElement(o,{routeConfig:s,location:r}):b.createElement(rl,{componentName:t,routeConfig:s,location:r})}},404:{component:Dn,standalone:!0,includeBasePath:!1,propsBuilder:()=>({})},default:{component:Dn,includeBasePath:!1,standalone:!0,propsBuilder:({pageType:e})=>({message:`Unknown page type: ${e}`})}}});K.AppProvider=ry,K.AuthConfigProvider=Bg,K.AuthProvider=Hg,K.Breadcrumbs=dy,K.CachedLogo=Yp,K.CommandPalette=hy,K.CrudPage=el,K.CustomPageFallback=Vm,K.CustomPageLoader=rl,K.DocumentHead=my,K.Layout=py,K.LoginContext=xo,K.LoginPage=So,K.LogoutPage=gy,K.Navbar=ny,K.NotFoundPage=Dn,K.OTPLoginForm=cE,K.PasswordLoginForm=lE,K.PasswordResetRequired=vl,K.RoleSelection=xl,K.SSOButtons=iE,K.SmartLink=kr,K.Topbar=uy,K.UserProfileDrawer=ly,K.ZangoApp=rT,K.authApi=ml,K.authService=Z,K.buildApiUrl=Ge,K.callApi=Xe,K.callDeleteApi=Rp,K.callGetApi=Zp,K.callPatchApi=em,K.callPostApi=Jp,K.callPutApi=Qp,K.changePassword=om,K.changeRole=wm,K.clearNextParamFromSession=K4,K.configApi=Og,K.deleteCookie=Ot,K.fetchAppInitData=pm,K.fetchUserProfile=mm,K.fetchUserSessions=gm,K.generateCSSVariables=io,K.generatePalette=xr,K.generateQueryString=vP,K.getApiConfig=YP,K.getApiTimeout=pP,K.getApiUrl=no,K.getAppInitData=tm,K.getColor=Om,K.getContrastColor=GP,K.getCookie=_l,K.getEndpoint=hP,K.getNextParam=nt,K.getNextParamFromSession=zt,K.getUserProfile=rm,K.getUserSessions=lm,K.getValidRedirectUrl=Se,K.isAuthenticatedViaCookie=oy,K.isLightColor=Lm,K.logoCache=vr,K.logout=um,K.logoutAllSessions=dm,K.logoutSession=cm,K.mfaApi=yl,K.otpApi=gl,K.passwordApi=tn,K.performAppLogout=xm,K.performDirectLogout=Cm,K.performLogout=fm,K.pingSession=Sm,K.pingSessionSecurity=hm,K.removeAllSessions=vm,K.removeSession=bm,K.roleApi=V4,K.saveNextParamToSession=$g,K.saveUserProfile=so,K.setCookie=sy,K.setTwoFactor=CP,K.switchRole=im,K.toggleTwoFactor=am,K.updatePassword=ym,K.updateSvgColors=sT,K.updateUserProfile=nm,K.uploadPhoto=xP,K.uploadProfilePhoto=sm,K.useApiConfig=Fn,K.useAppContext=qe,K.useAuth=Sl,K.useAuthConfig=Qe,K.useAuthContext=ar,K.useLoginContext=bl,K.useRouteConfig=XP,K.useSmartNavigation=kl,K.validateRedirectUrl=rt,K.withMultiStepAuth=aT}));
|
|
426
|
+
`})]})},RE=()=>{const{menu:e,profileInfo:t,initializerEndpoint:r}=qe();return e.length===0&&t?.user_role&&t.user_role,i.jsx("div",{className:"flex flex-col items-center justify-center h-screen text-center p-6 bg-gray-100",children:i.jsxs("div",{className:"bg-white rounded-xl p-12 shadow-md max-w-2xl w-full",children:[i.jsx("h1",{className:"text-[40px] m-0 text-red-500 font-bold leading-none",children:"⚙️"}),i.jsx("h2",{className:"text-2xl my-4 text-gray-800 font-semibold",children:"Configuration Error"}),i.jsx("p",{className:"text-base text-gray-600 mb-6 leading-relaxed",children:"The application is trying to fetch configuration from:"}),i.jsx("code",{className:"block bg-gray-50 border border-gray-200 rounded-md p-3 text-sm text-gray-800 font-mono mb-6 break-all",children:r}),i.jsxs("div",{className:"text-left mb-8 p-4 bg-gray-50 rounded-lg",children:[i.jsx("p",{className:"text-sm text-gray-600 mb-3 font-semibold",children:"The response is either missing or invalid. Please check:"}),i.jsxs("ul",{className:"text-sm text-gray-600 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 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="/app",children:"Go Home"})]}),i.jsx("p",{className:"text-xs text-gray-500 mt-6",children:"Contact your administrator if this issue persists."})]})})},yy=({customPages:e})=>{const t=R.useParams(),n=`${R.useLocation().pathname}-${Object.values(t).join("-")}`;return i.jsx(qn,{customPages:e},n)},eT=({firstMenuUri:e})=>{const t=R.useLocation(),r=nt(t.search);return r&&rt(r)?i.jsx(R.Navigate,{to:r,replace:!0}):e?i.jsx(R.Navigate,{to:e,replace:!0}):i.jsx("div",{className:"zango-loading",children:"No menu items available"})},wy=({customPages:e})=>{const{routes:t,loading:r,menu:n,pageTypeRegistry:s,registryError:o}=qe(),a=n.length>0?n[0].uri:null;if(r)return i.jsx("div",{className:"zango-loading",children:"Loading..."});if(o)return i.jsxs("div",{className:"zango-error",children:["Failed to load page registry: ",o]});const l=[],d=[];return s&&t.forEach(c=>{const u=s[c.page_type];let f=!1;if(c.page_type==="custom"){const p=c.extra_params||{};f=p.standalone!==void 0?p.standalone===!0:u&&u.standalone===!0}else f=u&&u.standalone===!0;f?l.push(c):d.push(c)}),i.jsxs(R.Routes,{children:[i.jsx(R.Route,{path:"app/login/*",element:i.jsx(So,{basePath:"/app/login"})}),i.jsx(R.Route,{path:"app/logout",element:i.jsx(gy,{})}),i.jsx(R.Route,{path:"app/configuration-error",element:i.jsx(RE,{})}),l.map(c=>{const u=c.path.startsWith("/")?c.path.slice(1):c.path;return i.jsxs(b.Fragment,{children:[i.jsx(R.Route,{path:`${u}/*`,element:i.jsx(qn,{customPages:e,forceRoute:c})}),i.jsx(R.Route,{path:u,element:i.jsx(qn,{customPages:e,forceRoute:c})})]},c.path)}),i.jsxs(R.Route,{path:"/",element:i.jsx(py,{}),children:[i.jsx(R.Route,{index:!0,element:a?i.jsx(R.Navigate,{to:a}):i.jsx("div",{children:"No menu items available"})}),i.jsx(R.Route,{path:"app",element:i.jsx(eT,{firstMenuUri:a})}),d.map(c=>{const u=c.path.startsWith("/")?c.path.slice(1):c.path;return i.jsxs(b.Fragment,{children:[i.jsx(R.Route,{path:`${u}/*`,element:i.jsx(yy,{customPages:e})}),i.jsx(R.Route,{path:u,element:i.jsx(yy,{customPages:e})})]},c.path)})]}),i.jsx(R.Route,{path:"*",element:i.jsx(qn,{customPages:e,forceRoute:{path:"*",page_type:"404"}})}),i.jsx(R.Route,{path:"/404",element:i.jsx(qn,{customPages:e,forceRoute:{path:"/404",page_type:"404"}})})]})},tT=({customPages:e})=>{const{appData:t,sessionSecurity:r}=qe(),n=t&&!t.is_user_anonymous,s={enabled:!0,ping_url:"/session_security/ping/",warn_after:1700,expire_after:1800},o=n?r?{...s,...r,enabled:!0}:s:null;return i.jsxs(i.Fragment,{children:[i.jsx(my,{}),n&&o?i.jsx(QE,{config:o,children:i.jsx(wy,{customPages:e})}):i.jsx(wy,{customPages:e})]})},rT=({config:e={},customPages:t={},layoutConfig:r={},topbarConfig:n={},navbarConfig:s={},customComponents:o={},authConfig:a={},appInitializerEndpoint:l})=>(l&&typeof window<"u"&&(window.app_initializer_endpoint=l),i.jsx(R.BrowserRouter,{children:i.jsx(ry,{config:e,layoutConfig:r,topbarConfig:n,navbarConfig:s,customComponents:o,authConfig:a,children:i.jsx(tT,{customPages:t})})})),nT=({customPages:e={},config:t={},layoutConfig:r={},topbarConfig:n={},navbarConfig:s={},customComponents:o={},authConfig:a={},appInitializerEndpoint:l="appbuilder/initializer"})=>i.jsxs(i.Fragment,{children:[i.jsx(rT,{config:t,customPages:e,layoutConfig:r,topbarConfig:n,navbarConfig:s,customComponents:o,authConfig:a,appInitializerEndpoint:l}),i.jsx(A.Toaster,{position:"bottom-right",expand:!0,richColors:!0,toastOptions:{className:"!rounded-[8px]"}})]});class sT{constructor(){this.setupInterceptors()}handleRedirect(t){if(rt(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),s=`${t}?next=${n}`;window.location.href=s}}setupInterceptors(){const t=window.fetch,r=this;window.fetch=async(...o)=>{try{const[a,l={}]=o,d=typeof a=="string"?a:a.toString();if(d.startsWith("http")&&!d.startsWith(window.location.origin))return await t(a,l);const u=Date.now().toString(),f=new Headers(l.headers||{});f.set("X-Client-Timestamp",u),f.set("X-Client-Timezone",Intl.DateTimeFormat().resolvedOptions().timeZone),f.set("X-Client-Platform",navigator.platform);const p={...l,headers:f},h=await t(a,p),m=window.location.origin+"/login/";return h.url&&h.url===m&&r.handleRedirect("/app/login/"),h}catch(a){throw a}};const n=XMLHttpRequest.prototype.open,s=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(...o){return this._requestUrl=o[1],n.apply(this,o)},XMLHttpRequest.prototype.send=function(...o){const a=this,l=this._requestUrl||"";if(!(l.startsWith("http")&&!l.startsWith(window.location.origin))){const c=Date.now().toString();this.setRequestHeader("X-Client-Timestamp",c),this.setRequestHeader("X-User-Agent",navigator.userAgent),this.setRequestHeader("X-Client-Timezone",Intl.DateTimeFormat().resolvedOptions().timeZone),this.setRequestHeader("X-Client-Platform",navigator.platform)}return this.addEventListener("load",function(){const c=a.responseURL||a._requestUrl,u=window.location.origin+"/login/";c&&c===u&&r.handleRedirect("/app/login/")}),s.apply(this,o)}}}new sT;const oT=(e,t)=>{if(!e)return;e.querySelectorAll("svg").forEach(n=>{n.getAttribute("fill")&&n.getAttribute("fill")!=="none"&&n.setAttribute("fill",t),n.getAttribute("stroke")&&n.getAttribute("stroke")!=="none"&&n.setAttribute("stroke",t),n.querySelectorAll("*").forEach(o=>{o.getAttribute("fill")&&o.getAttribute("fill")!=="none"&&o.setAttribute("fill",t),o.getAttribute("stroke")&&o.getAttribute("stroke")!=="none"&&o.setAttribute("stroke",t)})})},{Content:aT}=A.Layout,iT=(e,t)=>r=>{const[n,s]=b.useState(null),[o,a]=b.useState(!1),[l,d]=b.useState(!1),u=Qe()?.authConfig??null;b.useEffect(()=>{(async()=>{const m=new URLSearchParams(window.location.search),g=m.get("token"),y=m.get("request_id");if(g&&y){d(!0);try{const w=await Z.getSAMLAuthMeta(g,y);if(w?.code==="user_not_found"){A.toast.error(w.message||"User does not exist");const S=window.location.pathname;window.history.replaceState({},"",S),d(!1);return}if(w?.status===401&&w?.data?.next_step&&w.data.next_step.is_pending){let T=m.get("email")||m.get("user_email")||null,k=m.get("name")||m.get("user_name")||T;!T&&w?.data?.user&&(T=w.data.user.email||w.data.user.username,k=w.data.user.name||T);const P={...w,loginUser:{email:T,username:k||T||"SAML User",display:k||T||"SAML User"}};s(P),a(!0),d(!1);return}if(w?.roles&&w.roles.length>1){const S={status:401,data:{next_step:{id:"role_selection",is_pending:!0,metadata:{roles:w.roles}}},loginUser:{email:m.get("email")||"SAML User",username:m.get("name")||"SAML User",display:m.get("name")||"SAML User"}};s(S),a(!0),d(!1);return}const v=nt(window.location.search),x=Se(v,w?.redirect_url,"/app");_e(x)}catch(w){console.error("[withMultiStepAuth] SAML callback error:",w);const v=w instanceof Error?w.message:"Failed to process SSO authentication";A.toast.error(v);const x=window.location.pathname;window.history.replaceState({},"",x),d(!1)}}})()},[]);const f=h=>{let m=null,g=!1,y=null;if(h?.status===401&&h?.data)m=h.data?.next_step,y=h.status,g=h?.meta?.is_authenticated||!1;else if(h?.response?.status===401&&h?.response?.data)m=h.response.data?.next_step,y=h.response.status,g=h.response?.meta?.is_authenticated||!1;else if(h?.next_step)m=h.next_step,g=h?.meta?.is_authenticated||!1,y=h?.status;else{const S=h?.response?.data||h?.data||h;m=S?.next_step,g=S?.meta?.is_authenticated||h?.meta?.is_authenticated||!1,y=h?.status||h?.response?.status}if(m&&m.is_pending){s(h),a(!0);return}if(y===200&&g){const S=nt(window.location.search),T=h?.redirect_url||h?.response?.data?.redirect_url||h?.data?.redirect_url,k=Se(S,T,"/app");_e(k);return}const w=nt(window.location.search),v=h?.redirect_url||h?.response?.data?.redirect_url||h?.data?.redirect_url,x=Se(w,v,"/app");window.location.href=x},p=h=>{try{const m=nt(window.location.search),g=h?.redirect_url||h?.response?.data?.redirect_url||h?.data?.redirect_url,y=Se(m,g,"/app");_e(y)}catch(m){console.error("[withMultiStepAuth] Auth completion error:",m),_e("/app")}};if(l){const h=wt(u);return i.jsx(A.Layout,{className:"min-h-screen",style:h,children:i.jsx(aT,{className:"flex justify-center items-center min-h-screen",children:i.jsx(A.Card,{className:"w-full max-w-md shadow-lg rounded-lg",bordered:!1,children:i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[300px] text-center",children:[i.jsx(A.Spin,{size:"large"}),i.jsx("p",{className:"mt-4 text-gray-600",children:"Processing SSO authentication..."})]})})})})}return o&&n?i.jsx(rn,{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(Co.Provider,{value:{onLogin:f},children:i.jsx(e,{...r})})},lT=Object.freeze({__proto__:null,default:{crud:{component:el,includeBasePath:!0,propsBuilder:({matchedRoutePath:e})=>({})},training:{component:Dm,includeBasePath:!0,propsBuilder:({matchedRoutePath:e})=>({})},login:{component:So,includeBasePath:!0,standalone:!0,propsBuilder:({matchedRoutePath:e})=>({})},custom:{component:null,includeBasePath:!1,handler:({customPages:e,customPagePath:t,location:r,matchedRoute:n})=>{const s=n||t&&{path:null,component:t},o=e[t];return o?b.createElement(o,{routeConfig:s,location:r}):b.createElement(rl,{componentName:t,routeConfig:s,location:r})}},404:{component:Dn,standalone:!0,includeBasePath:!1,propsBuilder:()=>({})},default:{component:Dn,includeBasePath:!1,standalone:!0,propsBuilder:({pageType:e})=>({message:`Unknown page type: ${e}`})}}});K.AppProvider=ry,K.AuthConfigProvider=Bg,K.AuthProvider=qg,K.Breadcrumbs=dy,K.CachedLogo=Yp,K.CommandPalette=hy,K.CrudPage=el,K.CustomPageFallback=Vm,K.CustomPageLoader=rl,K.DocumentHead=my,K.Layout=py,K.LoginContext=Co,K.LoginPage=So,K.LogoutPage=gy,K.Navbar=ny,K.NotFoundPage=Dn,K.OTPLoginForm=AE,K.PasswordLoginForm=TE,K.PasswordResetRequired=bl,K.RoleSelection=vl,K.SSOButtons=EE,K.SmartLink=kr,K.Topbar=uy,K.UserProfileDrawer=ly,K.ZangoApp=nT,K.authApi=ml,K.authService=Z,K.buildApiUrl=Ge,K.callApi=Xe,K.callDeleteApi=Rp,K.callGetApi=Zp,K.callPatchApi=em,K.callPostApi=Jp,K.callPutApi=Qp,K.changePassword=om,K.changeRole=wm,K.clearNextParamFromSession=K4,K.configApi=Og,K.deleteCookie=Ot,K.fetchAppInitData=pm,K.fetchUserProfile=mm,K.fetchUserSessions=gm,K.generateCSSVariables=io,K.generatePalette=xr,K.generateQueryString=vP,K.getApiConfig=YP,K.getApiTimeout=pP,K.getApiUrl=no,K.getAppInitData=tm,K.getColor=Om,K.getContrastColor=GP,K.getCookie=_l,K.getEndpoint=hP,K.getNextParam=nt,K.getNextParamFromSession=zt,K.getUserProfile=rm,K.getUserSessions=lm,K.getValidRedirectUrl=Se,K.isAuthenticatedViaCookie=oy,K.isLightColor=Lm,K.logoCache=vr,K.logout=um,K.logoutAllSessions=dm,K.logoutSession=cm,K.mfaApi=yl,K.otpApi=gl,K.passwordApi=tn,K.performAppLogout=xm,K.performDirectLogout=Cm,K.performLogout=fm,K.pingSession=Sm,K.pingSessionSecurity=hm,K.removeAllSessions=vm,K.removeSession=bm,K.roleApi=V4,K.saveNextParamToSession=$g,K.saveUserProfile=so,K.setCookie=sy,K.setTwoFactor=CP,K.switchRole=im,K.toggleTwoFactor=am,K.updatePassword=ym,K.updateSvgColors=oT,K.updateUserProfile=nm,K.uploadPhoto=xP,K.uploadProfilePhoto=sm,K.useApiConfig=Fn,K.useAppContext=qe,K.useAuth=xl,K.useAuthConfig=Qe,K.useAuthContext=ir,K.useLoginContext=Al,K.useRouteConfig=XP,K.useSmartNavigation=kl,K.validateRedirectUrl=rt,K.withMultiStepAuth=iT}));
|
|
427
427
|
//# sourceMappingURL=zango-crm-framework.umd.cjs.map
|