diff --git a/backend/__pycache__/app.cpython-312.pyc b/backend/__pycache__/app.cpython-312.pyc new file mode 100644 index 0000000..b785637 Binary files /dev/null and b/backend/__pycache__/app.cpython-312.pyc differ diff --git a/backend/__pycache__/database.cpython-312.pyc b/backend/__pycache__/database.cpython-312.pyc new file mode 100644 index 0000000..b035ec1 Binary files /dev/null and b/backend/__pycache__/database.cpython-312.pyc differ diff --git a/backend/__pycache__/roehn_converter.cpython-312.pyc b/backend/__pycache__/roehn_converter.cpython-312.pyc new file mode 100644 index 0000000..fc70ede Binary files /dev/null and b/backend/__pycache__/roehn_converter.cpython-312.pyc differ diff --git a/backend/app.py b/backend/app.py index dc6cd20..9fa286f 100644 --- a/backend/app.py +++ b/backend/app.py @@ -4072,15 +4072,12 @@ def delete_cena(cena_id): return jsonify({"ok": True}) -@app.route("/", defaults={"path": ""}) -@app.route("/") -def spa_catch_all(path): - # Não intercepta APIs ou arquivos estáticos - if path.startswith("api/") or path.startswith("exportar-pdf/"): +@app.route('/', defaults={'path': ''}) +@app.route('/') +def catch_all(path): + if path.startswith("api/"): abort(404) - if os.path.exists(os.path.join(app.static_folder, path)): - return send_from_directory(app.static_folder, path) - return send_from_directory(app.static_folder, "index.html") + return send_from_directory(app.static_folder, 'index.html') if __name__ == '__main__': diff --git a/backend/instance/projetos.db b/backend/instance/projetos.db new file mode 100644 index 0000000..a6da6f8 Binary files /dev/null and b/backend/instance/projetos.db differ diff --git a/backend/static/assets/index-1-wYBxU_.css b/backend/static/assets/index-1-wYBxU_.css new file mode 100644 index 0000000..4f7a960 --- /dev/null +++ b/backend/static/assets/index-1-wYBxU_.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 99%;--foreground: 215 25% 27%;--card: 0 0% 100%;--card-foreground: 215 25% 27%;--popover: 0 0% 100%;--popover-foreground: 215 25% 27%;--primary: 217 91% 60%;--primary-foreground: 0 0% 98%;--primary-glow: 217 91% 70%;--secondary: 210 40% 96%;--secondary-foreground: 215 25% 27%;--muted: 210 40% 96%;--muted-foreground: 215 16% 47%;--accent: 142 76% 36%;--accent-foreground: 0 0% 98%;--destructive: 0 84% 60%;--destructive-foreground: 0 0% 98%;--warning: 43 96% 56%;--warning-foreground: 0 0% 98%;--border: 214 31% 91%;--input: 214 31% 91%;--ring: 217 91% 60%;--radius: .75rem;--gradient-primary: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary-glow)));--gradient-subtle: linear-gradient(180deg, hsl(var(--background)), hsl(var(--muted)));--shadow-soft: 0 4px 20px -2px hsl(var(--primary) / .1);--shadow-medium: 0 8px 30px -4px hsl(var(--primary) / .15);--sidebar-background: 0 0% 98%;--sidebar-foreground: 240 5.3% 26.1%;--sidebar-primary: 240 5.9% 10%;--sidebar-primary-foreground: 0 0% 98%;--sidebar-accent: 240 4.8% 95.9%;--sidebar-accent-foreground: 240 5.9% 10%;--sidebar-border: 220 13% 91%;--sidebar-ring: 217.2 91.2% 59.8%}.dark{--background: 224 71% 4%;--foreground: 210 40% 98%;--card: 224 21% 9%;--card-foreground: 210 40% 98%;--popover: 224 21% 9%;--popover-foreground: 210 40% 98%;--primary: 217 91% 60%;--primary-foreground: 215 28% 17%;--primary-glow: 217 91% 70%;--secondary: 224 10% 14%;--secondary-foreground: 210 40% 98%;--muted: 224 10% 14%;--muted-foreground: 215 20% 65%;--accent: 142 76% 36%;--accent-foreground: 210 40% 98%;--destructive: 0 62% 30%;--destructive-foreground: 210 40% 98%;--warning: 43 96% 56%;--warning-foreground: 215 28% 17%;--border: 224 10% 14%;--input: 224 10% 14%;--ring: 217 91% 60%;--sidebar-background: 224 71% 4%;--sidebar-foreground: 210 40% 98%;--sidebar-primary: 217 91% 60%;--sidebar-primary-foreground: 215 28% 17%;--sidebar-accent: 224 10% 14%;--sidebar-accent-foreground: 210 40% 98%;--sidebar-border: 224 10% 14%;--sidebar-ring: 217.2 91.2% 59.8%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";color:hsl(var(--foreground));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*{transition:border-color .2s ease,background-color .2s ease,color .2s ease,box-shadow .2s ease}.dark .bg-white,.dark .bg-slate-50,.dark .bg-slate-100{background-color:hsl(var(--card))!important}.dark [class*="bg-white/"]{background-color:hsl(var(--card) / .85)!important}.dark [class*=bg-slate-50],.dark [class*=bg-slate-100],.dark [class*=bg-slate-200]{background-color:hsl(var(--muted))!important}.dark [class*="bg-slate-50/"],.dark [class*="bg-slate-100/"],.dark [class*="bg-slate-200/"]{background-color:hsl(var(--muted) / .85)!important}.dark .bg-slate-900{background-color:hsl(var(--primary))!important}.dark .text-slate-900,.dark .text-slate-800{color:hsl(var(--foreground))!important}.dark .text-slate-600,.dark .text-slate-500,.dark .text-slate-400{color:hsl(var(--muted-foreground))!important}.dark .border-slate-200,.dark .border-slate-200\/60,.dark .border-slate-300{border-color:#fff3!important;background-color:#20222700!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-bottom-12{bottom:-3rem}.-left-12{left:-3rem}.-right-12{right:-3rem}.-right-8{right:-2rem}.-top-12{top:-3rem}.-top-8{top:-2rem}.bottom-0{bottom:0}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[1\]{z-index:1}.order-1{order:1}.order-2{order:2}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.\!mt-0{margin-top:0!important}.-ml-4{margin-left:-1rem}.-mt-4{margin-top:-1rem}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.size-4{width:1rem;height:1rem}.h-0{height:0px}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[1px\]{height:1px}.h-\[400px\]{height:400px}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.max-h-\[--radix-popover-content-available-height\]{max-height:var(--radix-popover-content-available-height)}.max-h-\[300px\]{max-height:300px}.max-h-\[400px\]{max-height:400px}.max-h-\[500px\]{max-height:500px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[90vh\]{max-height:90vh}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-\[100px\]{min-height:100px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-0{width:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-2\/3{width:66.666667%}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[--radix-popover-trigger-width\]{width:var(--radix-popover-trigger-width)}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[1px\]{width:1px}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-5{min-width:1.25rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-7xl{max-width:80rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-px{--tw-translate-x: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-px{--tw-translate-x: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-\[1\.5px\]{border-width:1.5px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-l-\[40px\]{border-left-width:40px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-t-\[40px\]{border-top-width:40px}.border-dashed{border-style:dashed}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-300{--tw-border-opacity: 1;border-color:rgb(252 211 77 / var(--tw-border-opacity, 1))}.border-amber-400\/40{border-color:#fbbf2466}.border-amber-500\/60{border-color:#f59e0b99}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-emerald-200{--tw-border-opacity: 1;border-color:rgb(167 243 208 / var(--tw-border-opacity, 1))}.border-emerald-500\/60{border-color:#10b98199}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-300{--tw-border-opacity: 1;border-color:rgb(134 239 172 / var(--tw-border-opacity, 1))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-indigo-500{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted\/60{border-color:hsl(var(--muted) / .6)}.border-primary{border-color:hsl(var(--primary))}.border-primary\/40{border-color:hsl(var(--primary) / .4)}.border-purple-300{--tw-border-opacity: 1;border-color:rgb(216 180 254 / var(--tw-border-opacity, 1))}.border-purple-500{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-white\/30{border-color:#ffffff4d}.border-b-current{border-bottom-color:currentColor}.border-l-transparent{border-left-color:transparent}.border-t-amber-500{--tw-border-opacity: 1;border-top-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-t-emerald-500{--tw-border-opacity: 1;border-top-color:rgb(16 185 129 / var(--tw-border-opacity, 1))}.border-t-slate-400{--tw-border-opacity: 1;border-top-color:rgb(148 163 184 / var(--tw-border-opacity, 1))}.border-t-slate-600{--tw-border-opacity: 1;border-top-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-t-transparent{border-top-color:transparent}.border-t-white{--tw-border-opacity: 1;border-top-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black\/50{background-color:#00000080}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-card\/50{background-color:hsl(var(--card) / .5)}.bg-card\/85{background-color:hsl(var(--card) / .85)}.bg-card\/90{background-color:hsl(var(--card) / .9)}.bg-card\/95{background-color:hsl(var(--card) / .95)}.bg-current{background-color:currentColor}.bg-destructive{background-color:hsl(var(--destructive))}.bg-emerald-100{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-foreground{background-color:hsl(var(--foreground))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/40{background-color:hsl(var(--muted) / .4)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-muted\/60{background-color:hsl(var(--muted) / .6)}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-600{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-slate-50\/50{background-color:#f8fafc80}.bg-slate-600{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-violet-400{--tw-bg-opacity: 1;background-color:rgb(167 139 250 / var(--tw-bg-opacity, 1))}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-amber-500{--tw-gradient-from: #f59e0b var(--tw-gradient-from-position);--tw-gradient-to: rgb(245 158 11 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-50{--tw-gradient-from: #eff6ff var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 246 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-600{--tw-gradient-from: #2563eb var(--tw-gradient-from-position);--tw-gradient-to: rgb(37 99 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-500{--tw-gradient-from: #6b7280 var(--tw-gradient-from-position);--tw-gradient-to: rgb(107 114 128 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-600{--tw-gradient-from: #16a34a var(--tw-gradient-from-position);--tw-gradient-to: rgb(22 163 74 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-500{--tw-gradient-from: #6366f1 var(--tw-gradient-from-position);--tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-indigo-600{--tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);--tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary{--tw-gradient-from: hsl(var(--primary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/15{--tw-gradient-from: hsl(var(--primary) / .15) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-600{--tw-gradient-from: #9333ea var(--tw-gradient-from-position);--tw-gradient-to: rgb(147 51 234 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-600{--tw-gradient-from: #dc2626 var(--tw-gradient-from-position);--tw-gradient-to: rgb(220 38 38 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-rose-500{--tw-gradient-from: #f43f5e var(--tw-gradient-from-position);--tw-gradient-to: rgb(244 63 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-50{--tw-gradient-from: #f8fafc var(--tw-gradient-from-position);--tw-gradient-to: rgb(248 250 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-700{--tw-gradient-from: #334155 var(--tw-gradient-from-position);--tw-gradient-to: rgb(51 65 85 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-yellow-500{--tw-gradient-from: #eab308 var(--tw-gradient-from-position);--tw-gradient-to: rgb(234 179 8 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-blue-50\/30{--tw-gradient-to: rgb(239 246 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(239 246 255 / .3) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-primary\/10{--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--primary) / .1) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.to-blue-700{--tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position)}.to-emerald-600{--tw-gradient-to: #059669 var(--tw-gradient-to-position)}.to-gray-600{--tw-gradient-to: #4b5563 var(--tw-gradient-to-position)}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position)}.to-indigo-50{--tw-gradient-to: #eef2ff var(--tw-gradient-to-position)}.to-indigo-50\/20{--tw-gradient-to: rgb(238 242 255 / .2) var(--tw-gradient-to-position)}.to-indigo-500{--tw-gradient-to: #6366f1 var(--tw-gradient-to-position)}.to-indigo-600{--tw-gradient-to: #4f46e5 var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-orange-600{--tw-gradient-to: #ea580c var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-primary\/5{--tw-gradient-to: hsl(var(--primary) / .05) var(--tw-gradient-to-position)}.to-primary\/70{--tw-gradient-to: hsl(var(--primary) / .7) var(--tw-gradient-to-position)}.to-primary\/80{--tw-gradient-to: hsl(var(--primary) / .8) var(--tw-gradient-to-position)}.to-purple-500{--tw-gradient-to: #a855f7 var(--tw-gradient-to-position)}.to-purple-600{--tw-gradient-to: #9333ea var(--tw-gradient-to-position)}.to-slate-800{--tw-gradient-to: #1e293b var(--tw-gradient-to-position)}.to-violet-500{--tw-gradient-to: #8b5cf6 var(--tw-gradient-to-position)}.to-violet-600{--tw-gradient-to: #7c3aed var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-6{padding-bottom:1.5rem}.pl-10{padding-left:2.5rem}.pl-2\.5{padding-left:.625rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pr-10{padding-right:2.5rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-4{padding-right:1rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[0\.8rem\]{font-size:.8rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.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)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-amber-100{--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-emerald-800{--tw-text-opacity: 1;color:rgb(6 95 70 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-indigo-800{--tw-text-opacity: 1;color:rgb(55 48 163 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/80{color:hsl(var(--muted-foreground) / .8)}.text-muted-foreground\/90{color:hsl(var(--muted-foreground) / .9)}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-50{--tw-text-opacity: 1;color:rgb(250 245 255 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-sky-600{--tw-text-opacity: 1;color:rgb(2 132 199 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-violet-600{--tw-text-opacity: 1;color:rgb(124 58 237 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-blue-500\/25{--tw-shadow-color: rgb(59 130 246 / .25);--tw-shadow: var(--tw-shadow-colored)}.shadow-primary\/10{--tw-shadow-color: hsl(var(--primary) / .1);--tw-shadow: var(--tw-shadow-colored)}.shadow-primary\/15{--tw-shadow-color: hsl(var(--primary) / .15);--tw-shadow: var(--tw-shadow-colored)}.shadow-primary\/30{--tw-shadow-color: hsl(var(--primary) / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-primary\/5{--tw-shadow-color: hsl(var(--primary) / .05);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-500\/25{--tw-shadow-color: rgb(168 85 247 / .25);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-700\/30{--tw-shadow-color: rgb(126 34 206 / .3);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-blue-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity, 1))}.ring-ring{--tw-ring-color: hsl(var(--ring))}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.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)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opa\]{transition-property:margin,opa;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-1000{transition-duration:1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}@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))}}@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))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.fade-in-80{--tw-enter-opacity: .8}.zoom-in-95{--tw-enter-scale: .95}.duration-1000{animation-duration:1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{animation-timing-function:linear}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:left-0:before{content:var(--tw-content);left:0}.before\:top-3:before{content:var(--tw-content);top:.75rem}.before\:h-px:before{content:var(--tw-content);height:1px}.before\:w-3:before{content:var(--tw-content);width:.75rem}.before\:bg-slate-200:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.before\:content-\[\'\'\]:before{--tw-content: "";content:var(--tw-content)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-width:1px}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.hover\:-translate-y-1:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-purple-400:hover{--tw-border-opacity: 1;border-color:rgb(192 132 252 / var(--tw-border-opacity, 1))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-card:hover{background-color:hsl(var(--card))}.hover\:bg-card\/90:hover{background-color:hsl(var(--card) / .9)}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-green-200:hover{--tw-bg-opacity: 1;background-color:rgb(187 247 208 / var(--tw-bg-opacity, 1))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-purple-700:hover{--tw-bg-opacity: 1;background-color:rgb(126 34 206 / var(--tw-bg-opacity, 1))}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:from-amber-600:hover{--tw-gradient-from: #d97706 var(--tw-gradient-from-position);--tw-gradient-to: rgb(217 119 6 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-blue-700:hover{--tw-gradient-from: #1d4ed8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(29 78 216 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-green-700:hover{--tw-gradient-from: #15803d var(--tw-gradient-from-position);--tw-gradient-to: rgb(21 128 61 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-purple-700:hover{--tw-gradient-from: #7e22ce var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 34 206 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-red-700:hover{--tw-gradient-from: #b91c1c var(--tw-gradient-from-position);--tw-gradient-to: rgb(185 28 28 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-blue-800:hover{--tw-gradient-to: #1e40af var(--tw-gradient-to-position)}.hover\:to-emerald-700:hover{--tw-gradient-to: #047857 var(--tw-gradient-to-position)}.hover\:to-indigo-700:hover{--tw-gradient-to: #4338ca var(--tw-gradient-to-position)}.hover\:to-orange-600:hover{--tw-gradient-to: #ea580c var(--tw-gradient-to-position)}.hover\:to-orange-700:hover{--tw-gradient-to: #c2410c var(--tw-gradient-to-position)}.hover\:to-violet-700:hover{--tw-gradient-to: #6d28d9 var(--tw-gradient-to-position)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(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 hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-slate-900\/5:hover{--tw-shadow-color: rgb(15 23 42 / .05);--tw-shadow: var(--tw-shadow-colored)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-indigo-500:focus{--tw-border-opacity: 1;border-color:rgb(99 102 241 / var(--tw-border-opacity, 1))}.focus\:border-purple-500:focus{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-primary:focus{background-color:hsl(var(--primary))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-primary-foreground:focus{color:hsl(var(--primary-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-blue-500\/20:focus{--tw-ring-color: rgb(59 130 246 / .2)}.focus\:ring-indigo-500\/20:focus{--tw-ring-color: rgb(99 102 241 / .2)}.focus\:ring-primary\/40:focus{--tw-ring-color: hsl(var(--primary) / .4)}.focus\:ring-purple-500\/20:focus{--tw-ring-color: rgb(168 85 247 / .2)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group:hover .group-hover\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.has-\[\:disabled\]\:opacity-50:has(:disabled){opacity:.5}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:bg-accent\/50[aria-selected=true]{background-color:hsl(var(--accent) / .5)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.aria-selected\:opacity-30[aria-selected=true]{opacity:.3}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:accordion-up .2s ease-out}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:accordion-down .2s ease-out}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[active\]\:bg-accent\/50[data-active]{background-color:hsl(var(--accent) / .5)}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=on\]\:bg-accent[data-state=on],.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:hsl(var(--accent) / .5)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=on\]\:text-accent-foreground[data-state=on],.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-],.data-\[state\=open\]\:animate-in[data-state=open],.data-\[state\=visible\]\:animate-in[data-state=visible]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-],.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[state\=hidden\]\:animate-out[data-state=hidden],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity: 0}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-],.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open],.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale: .9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: 13rem}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: -13rem}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: 13rem}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: -13rem}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.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-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed],.data-\[state\=closed\]\:slide-out-to-right-full[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\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.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-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.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%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180,.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer[data-variant=inset]~.peer-data-\[variant\=inset\]\:min-h-\[calc\(100svh-theme\(spacing\.4\)\)\]{min-height:calc(100svh - 1rem)}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.dark\:border-blue-800\/30:is(.dark *){border-color:#1e40af4d}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:border-green-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.dark\:border-purple-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity, 1))}.dark\:border-red-500\/40:is(.dark *){border-color:#ef444466}.dark\:border-slate-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.dark\:bg-amber-500\/20:is(.dark *){background-color:#f59e0b33}.dark\:bg-blue-900\/20:is(.dark *){background-color:#1e3a8a33}.dark\:bg-blue-900\/30:is(.dark *){background-color:#1e3a8a4d}.dark\:bg-card\/85:is(.dark *){background-color:hsl(var(--card) / .85)}.dark\:bg-card\/90:is(.dark *){background-color:hsl(var(--card) / .9)}.dark\:bg-emerald-500\/20:is(.dark *){background-color:#10b98133}.dark\:bg-muted\/40:is(.dark *){background-color:hsl(var(--muted) / .4)}.dark\:bg-slate-800\/50:is(.dark *){background-color:#1e293b80}.dark\:from-background:is(.dark *){--tw-gradient-from: hsl(var(--background)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-blue-900\/10:is(.dark *){--tw-gradient-from: rgb(30 58 138 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(30 58 138 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:from-primary\/25:is(.dark *){--tw-gradient-from: hsl(var(--primary) / .25) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\:via-background\/40:is(.dark *){--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background) / .4) var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:via-primary\/15:is(.dark *){--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--primary) / .15) var(--tw-gradient-via-position), var(--tw-gradient-to)}.dark\:to-indigo-900\/10:is(.dark *){--tw-gradient-to: rgb(49 46 129 / .1) var(--tw-gradient-to-position)}.dark\:to-primary\/10:is(.dark *){--tw-gradient-to: hsl(var(--primary) / .1) var(--tw-gradient-to-position)}.dark\:to-primary\/25:is(.dark *){--tw-gradient-to: hsl(var(--primary) / .25) var(--tw-gradient-to-position)}.dark\:text-amber-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.dark\:text-amber-200:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.dark\:text-amber-50:is(.dark *){--tw-text-opacity: 1;color:rgb(255 251 235 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-emerald-200:is(.dark *){--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity, 1))}.dark\:text-muted-foreground:is(.dark *){color:hsl(var(--muted-foreground))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-slate-300:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark\:shadow-primary\/20:is(.dark *){--tw-shadow-color: hsl(var(--primary) / .2);--tw-shadow: var(--tw-shadow-colored)}.dark\:before\:bg-slate-600:is(.dark *):before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.dark\:hover\:border-purple-300:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(216 180 254 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:top-auto{top:auto}.sm\:order-1{order:1}.sm\:order-2{order:2}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:mb-8{margin-bottom:2rem}.sm\:ml-4{margin-left:1rem}.sm\:mr-2{margin-right:.5rem}.sm\:mt-0{margin-top:0}.sm\:mt-2{margin-top:.5rem}.sm\:mt-3{margin-top:.75rem}.sm\:mt-4{margin-top:1rem}.sm\:mt-6{margin-top:1.5rem}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:h-10{height:2.5rem}.sm\:h-12{height:3rem}.sm\:h-16{height:4rem}.sm\:h-20{height:5rem}.sm\:h-4{height:1rem}.sm\:h-5{height:1.25rem}.sm\:h-6{height:1.5rem}.sm\:h-8{height:2rem}.sm\:h-9{height:2.25rem}.sm\:h-\[500px\]{height:500px}.sm\:max-h-96{max-height:24rem}.sm\:max-h-\[500px\]{max-height:500px}.sm\:w-10{width:2.5rem}.sm\:w-12{width:3rem}.sm\:w-16{width:4rem}.sm\:w-20{width:5rem}.sm\:w-4{width:1rem}.sm\:w-5{width:1.25rem}.sm\:w-6{width:1.5rem}.sm\:w-8{width:2rem}.sm\:w-9{width:2.25rem}.sm\:w-auto{width:auto}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-2{gap:.5rem}.sm\:gap-2\.5{gap:.625rem}.sm\:gap-4{gap:1rem}.sm\:gap-8{gap:2rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.sm\:space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.sm\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:self-auto{align-self:auto}.sm\:rounded-3xl{border-radius:1.5rem}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-12{padding-top:3rem;padding-bottom:3rem}.sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\:py-8{padding-top:2rem;padding-bottom:2rem}.sm\:pb-6{padding-bottom:1.5rem}.sm\:pl-4{padding-left:1rem}.sm\:pl-6{padding-left:1.5rem}.sm\:pr-4{padding-right:1rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:opacity-0{opacity:0}.sm\:before\:w-4:before{content:var(--tw-content);width:1rem}.group:hover .sm\:group-hover\:opacity-100{opacity:1}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:col-span-2{grid-column:span 2 / span 2}.md\:col-span-3{grid-column:span 3 / span 3}.md\:block{display:block}.md\:flex{display:flex}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:max-w-\[420px\]{max-width:420px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:p-8{padding:2rem}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}@media (min-width: 1024px){.lg\:order-1{order:1}.lg\:order-2{order:2}.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:hidden{display:none}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:hsl(var(--accent))}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:has([aria-selected]):first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:has([aria-selected]):last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\.day-outside\)\]\:bg-accent\/50:has([aria-selected].day-outside){background-color:hsl(var(--accent) / .5)}.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:size-3\.5>svg{width:.875rem;height:.875rem}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize} diff --git a/backend/static/assets/index-B2z0OTMZ.js b/backend/static/assets/index-B2z0OTMZ.js new file mode 100644 index 0000000..f8ea6eb --- /dev/null +++ b/backend/static/assets/index-B2z0OTMZ.js @@ -0,0 +1,458 @@ +var ky=e=>{throw TypeError(e)};var uh=(e,t,r)=>t.has(e)||ky("Cannot "+r);var P=(e,t,r)=>(uh(e,t,"read from private field"),r?r.call(e):t.get(e)),Pe=(e,t,r)=>t.has(e)?ky("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),pe=(e,t,r,n)=>(uh(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Ue=(e,t,r)=>(uh(e,t,"access private method"),r);var nu=(e,t,r,n)=>({set _(s){pe(e,t,s,r)},get _(){return P(e,t,n)}});function OT(e,t){for(var r=0;rn[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();function U1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var H1={exports:{}},cf={},W1={exports:{}},We={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ic=Symbol.for("react.element"),DT=Symbol.for("react.portal"),IT=Symbol.for("react.fragment"),LT=Symbol.for("react.strict_mode"),FT=Symbol.for("react.profiler"),VT=Symbol.for("react.provider"),$T=Symbol.for("react.context"),zT=Symbol.for("react.forward_ref"),BT=Symbol.for("react.suspense"),UT=Symbol.for("react.memo"),HT=Symbol.for("react.lazy"),Ey=Symbol.iterator;function WT(e){return e===null||typeof e!="object"?null:(e=Ey&&e[Ey]||e["@@iterator"],typeof e=="function"?e:null)}var K1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},q1=Object.assign,G1={};function Qa(e,t,r){this.props=e,this.context=t,this.refs=G1,this.updater=r||K1}Qa.prototype.isReactComponent={};Qa.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Qa.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Q1(){}Q1.prototype=Qa.prototype;function zg(e,t,r){this.props=e,this.context=t,this.refs=G1,this.updater=r||K1}var Bg=zg.prototype=new Q1;Bg.constructor=zg;q1(Bg,Qa.prototype);Bg.isPureReactComponent=!0;var _y=Array.isArray,Z1=Object.prototype.hasOwnProperty,Ug={current:null},Y1={key:!0,ref:!0,__self:!0,__source:!0};function X1(e,t,r){var n,s={},o=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)Z1.call(t,n)&&!Y1.hasOwnProperty(n)&&(s[n]=t[n]);var l=arguments.length-2;if(l===1)s.children=r;else if(1>>1,F=A[q];if(0>>1;qs(ee,I))xes(G,ee)?(A[q]=G,A[xe]=I,q=xe):(A[q]=ee,A[X]=I,q=X);else if(xes(G,I))A[q]=G,A[xe]=I,q=xe;else break e}}return E}function s(A,E){var I=A.sortIndex-E.sortIndex;return I!==0?I:A.id-E.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,h=null,m=3,p=!1,b=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(A){for(var E=r(u);E!==null;){if(E.callback===null)n(u);else if(E.startTime<=A)n(u),E.sortIndex=E.expirationTime,t(c,E);else break;E=r(u)}}function j(A){if(g=!1,w(A),!b)if(r(c)!==null)b=!0,W(S);else{var E=r(u);E!==null&&H(j,E.startTime-A)}}function S(A,E){b=!1,g&&(g=!1,v(_),_=-1),p=!0;var I=m;try{for(w(E),h=r(c);h!==null&&(!(h.expirationTime>E)||A&&!z());){var q=h.callback;if(typeof q=="function"){h.callback=null,m=h.priorityLevel;var F=q(h.expirationTime<=E);E=e.unstable_now(),typeof F=="function"?h.callback=F:h===r(c)&&n(c),w(E)}else n(c);h=r(c)}if(h!==null)var Z=!0;else{var X=r(u);X!==null&&H(j,X.startTime-E),Z=!1}return Z}finally{h=null,m=I,p=!1}}var N=!1,C=null,_=-1,$=5,D=-1;function z(){return!(e.unstable_now()-D<$)}function T(){if(C!==null){var A=e.unstable_now();D=A;var E=!0;try{E=C(!0,A)}finally{E?L():(N=!1,C=null)}}else N=!1}var L;if(typeof x=="function")L=function(){x(T)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,B=M.port2;M.port1.onmessage=T,L=function(){B.postMessage(null)}}else L=function(){y(T,0)};function W(A){C=A,N||(N=!0,L())}function H(A,E){_=y(function(){A(e.unstable_now())},E)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(A){A.callback=null},e.unstable_continueExecution=function(){b||p||(b=!0,W(S))},e.unstable_forceFrameRate=function(A){0>A||125q?(A.sortIndex=I,t(u,A),r(c)===null&&A===r(u)&&(g?(v(_),_=-1):g=!0,H(j,I-q))):(A.sortIndex=F,t(c,A),b||p||(b=!0,W(S))),A},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(A){var E=m;return function(){var I=m;m=E;try{return A.apply(this,arguments)}finally{m=I}}}})(nj);rj.exports=nj;var rP=rj.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var nP=f,Dr=rP;function te(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_m=Object.prototype.hasOwnProperty,sP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Py={},Ay={};function oP(e){return _m.call(Ay,e)?!0:_m.call(Py,e)?!1:sP.test(e)?Ay[e]=!0:(Py[e]=!0,!1)}function iP(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function aP(e,t,r,n){if(t===null||typeof t>"u"||iP(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function dr(e,t,r,n,s,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Wt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Wt[e]=new dr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Wt[t]=new dr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Wt[e]=new dr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Wt[e]=new dr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Wt[e]=new dr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Wt[e]=new dr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Wt[e]=new dr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Wt[e]=new dr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Wt[e]=new dr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Kg=/[\-:]([a-z])/g;function qg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Kg,qg);Wt[t]=new dr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Kg,qg);Wt[t]=new dr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Kg,qg);Wt[t]=new dr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Wt[e]=new dr(e,1,!1,e.toLowerCase(),null,!1,!1)});Wt.xlinkHref=new dr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Wt[e]=new dr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gg(e,t,r,n){var s=Wt.hasOwnProperty(t)?Wt[t]:null;(s!==null?s.type!==0:n||!(2l||s[a]!==o[l]){var c=` +`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{hh=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?_l(e):""}function lP(e){switch(e.tag){case 5:return _l(e.type);case 16:return _l("Lazy");case 13:return _l("Suspense");case 19:return _l("SuspenseList");case 0:case 2:case 15:return e=mh(e.type,!1),e;case 11:return e=mh(e.type.render,!1),e;case 1:return e=mh(e.type,!0),e;default:return""}}function Rm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $i:return"Fragment";case Vi:return"Portal";case Tm:return"Profiler";case Qg:return"StrictMode";case Pm:return"Suspense";case Am:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ij:return(e.displayName||"Context")+".Consumer";case oj:return(e._context.displayName||"Context")+".Provider";case Zg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Yg:return t=e.displayName||null,t!==null?t:Rm(e.type)||"Memo";case As:t=e._payload,e=e._init;try{return Rm(e(t))}catch{}}return null}function cP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Rm(t);case 8:return t===Qg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ao(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uP(e){var t=lj(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){n=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function iu(e){e._valueTracker||(e._valueTracker=uP(e))}function cj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=lj(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function ad(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Mm(e,t){var r=t.checked;return jt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function My(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ao(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function uj(e,t){t=t.checked,t!=null&&Gg(e,"checked",t,!1)}function Om(e,t){uj(e,t);var r=ao(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Dm(e,t.type,r):t.hasOwnProperty("defaultValue")&&Dm(e,t.type,ao(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Oy(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Dm(e,t,r){(t!=="number"||ad(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Tl=Array.isArray;function na(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=au.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ec(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Il={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},dP=["Webkit","ms","Moz","O"];Object.keys(Il).forEach(function(e){dP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Il[t]=Il[e]})});function mj(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Il.hasOwnProperty(e)&&Il[e]?(""+t).trim():t+"px"}function pj(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=mj(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var fP=jt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Fm(e,t){if(t){if(fP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(te(62))}}function Vm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $m=null;function Xg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zm=null,sa=null,oa=null;function Ly(e){if(e=Vc(e)){if(typeof zm!="function")throw Error(te(280));var t=e.stateNode;t&&(t=mf(t),zm(e.stateNode,e.type,t))}}function gj(e){sa?oa?oa.push(e):oa=[e]:sa=e}function xj(){if(sa){var e=sa,t=oa;if(oa=sa=null,Ly(e),t)for(e=0;e>>=0,e===0?32:31-(SP(e)/NP|0)|0}var lu=64,cu=4194304;function Pl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,a=r&268435455;if(a!==0){var l=a&~s;l!==0?n=Pl(l):(o&=a,o!==0&&(n=Pl(o)))}else a=r&~s,a!==0?n=Pl(a):o!==0&&(n=Pl(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Lc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-bn(t),e[t]=r}function _P(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Fl),Ky=" ",qy=!1;function Lj(e,t){switch(e){case"keyup":return rA.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zi=!1;function sA(e,t){switch(e){case"compositionend":return Fj(t);case"keypress":return t.which!==32?null:(qy=!0,Ky);case"textInput":return e=t.data,e===Ky&&qy?null:e;default:return null}}function oA(e,t){if(zi)return e==="compositionend"||!ix&&Lj(e,t)?(e=Dj(),Fu=nx=Ks=null,zi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Yy(r)}}function Bj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Uj(){for(var e=window,t=ad();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ad(e.document)}return t}function ax(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function mA(e){var t=Uj(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Bj(r.ownerDocument.documentElement,r)){if(n!==null&&ax(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=Xy(r,o);var a=Xy(r,n);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Bi=null,qm=null,$l=null,Gm=!1;function Jy(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Gm||Bi==null||Bi!==ad(n)||(n=Bi,"selectionStart"in n&&ax(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),$l&&ic($l,n)||($l=n,n=md(qm,"onSelect"),0Wi||(e.current=ep[Wi],ep[Wi]=null,Wi--)}function st(e,t){Wi++,ep[Wi]=e.current,e.current=t}var lo={},Jt=bo(lo),wr=bo(!1),ti=lo;function Ta(e,t){var r=e.type.contextTypes;if(!r)return lo;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function jr(e){return e=e.childContextTypes,e!=null}function gd(){ft(wr),ft(Jt)}function i0(e,t,r){if(Jt.current!==lo)throw Error(te(168));st(Jt,t),st(wr,r)}function Xj(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(te(108,cP(e)||"Unknown",s));return jt({},r,n)}function xd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lo,ti=Jt.current,st(Jt,e),st(wr,wr.current),!0}function a0(e,t,r){var n=e.stateNode;if(!n)throw Error(te(169));r?(e=Xj(e,t,ti),n.__reactInternalMemoizedMergedChildContext=e,ft(wr),ft(Jt),st(Jt,e)):ft(wr),st(wr,r)}var Jn=null,pf=!1,_h=!1;function Jj(e){Jn===null?Jn=[e]:Jn.push(e)}function kA(e){pf=!0,Jj(e)}function wo(){if(!_h&&Jn!==null){_h=!0;var e=0,t=tt;try{var r=Jn;for(tt=1;e>=a,s-=a,ns=1<<32-bn(t)+s|r<_?($=C,C=null):$=C.sibling;var D=m(v,C,w[_],j);if(D===null){C===null&&(C=$);break}e&&C&&D.alternate===null&&t(v,C),x=o(D,x,_),N===null?S=D:N.sibling=D,N=D,C=$}if(_===w.length)return r(v,C),mt&&Po(v,_),S;if(C===null){for(;__?($=C,C=null):$=C.sibling;var z=m(v,C,D.value,j);if(z===null){C===null&&(C=$);break}e&&C&&z.alternate===null&&t(v,C),x=o(z,x,_),N===null?S=z:N.sibling=z,N=z,C=$}if(D.done)return r(v,C),mt&&Po(v,_),S;if(C===null){for(;!D.done;_++,D=w.next())D=h(v,D.value,j),D!==null&&(x=o(D,x,_),N===null?S=D:N.sibling=D,N=D);return mt&&Po(v,_),S}for(C=n(v,C);!D.done;_++,D=w.next())D=p(C,v,_,D.value,j),D!==null&&(e&&D.alternate!==null&&C.delete(D.key===null?_:D.key),x=o(D,x,_),N===null?S=D:N.sibling=D,N=D);return e&&C.forEach(function(T){return t(v,T)}),mt&&Po(v,_),S}function y(v,x,w,j){if(typeof w=="object"&&w!==null&&w.type===$i&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case ou:e:{for(var S=w.key,N=x;N!==null;){if(N.key===S){if(S=w.type,S===$i){if(N.tag===7){r(v,N.sibling),x=s(N,w.props.children),x.return=v,v=x;break e}}else if(N.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===As&&u0(S)===N.type){r(v,N.sibling),x=s(N,w.props),x.ref=vl(v,N,w),x.return=v,v=x;break e}r(v,N);break}else t(v,N);N=N.sibling}w.type===$i?(x=Zo(w.props.children,v.mode,j,w.key),x.return=v,v=x):(j=Ku(w.type,w.key,w.props,null,v.mode,j),j.ref=vl(v,x,w),j.return=v,v=j)}return a(v);case Vi:e:{for(N=w.key;x!==null;){if(x.key===N)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){r(v,x.sibling),x=s(x,w.children||[]),x.return=v,v=x;break e}else{r(v,x);break}else t(v,x);x=x.sibling}x=Ih(w,v.mode,j),x.return=v,v=x}return a(v);case As:return N=w._init,y(v,x,N(w._payload),j)}if(Tl(w))return b(v,x,w,j);if(hl(w))return g(v,x,w,j);gu(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(r(v,x.sibling),x=s(x,w),x.return=v,v=x):(r(v,x),x=Dh(w,v.mode,j),x.return=v,v=x),a(v)):r(v,x)}return y}var Aa=nS(!0),sS=nS(!1),bd=bo(null),wd=null,Gi=null,dx=null;function fx(){dx=Gi=wd=null}function hx(e){var t=bd.current;ft(bd),e._currentValue=t}function np(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function aa(e,t){wd=e,dx=Gi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(gr=!0),e.firstContext=null)}function Yr(e){var t=e._currentValue;if(dx!==e)if(e={context:e,memoizedValue:t,next:null},Gi===null){if(wd===null)throw Error(te(308));Gi=e,wd.dependencies={lanes:0,firstContext:e}}else Gi=Gi.next=e;return t}var Do=null;function mx(e){Do===null?Do=[e]:Do.push(e)}function oS(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,mx(t)):(r.next=s.next,s.next=r),t.interleaved=r,ds(e,n)}function ds(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Rs=!1;function px(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function iS(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function as(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Js(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Qe&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,ds(e,r)}return s=n.interleaved,s===null?(t.next=t,mx(n)):(t.next=s.next,s.next=t),n.interleaved=t,ds(e,r)}function $u(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ex(e,r)}}function d0(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=a:o=o.next=a,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function jd(e,t,r,n){var s=e.updateQueue;Rs=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?o=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(o!==null){var h=s.baseState;a=0,d=u=c=null,l=o;do{var m=l.lane,p=l.eventTime;if((n&m)===m){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var b=e,g=l;switch(m=t,p=r,g.tag){case 1:if(b=g.payload,typeof b=="function"){h=b.call(p,h,m);break e}h=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=g.payload,m=typeof b=="function"?b.call(p,h,m):b,m==null)break e;h=jt({},h,m);break e;case 2:Rs=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[l]:m.push(l))}else p={eventTime:p,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=h):d=d.next=p,a|=m;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;m=l,l=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(d===null&&(c=h),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);si|=a,e.lanes=a,e.memoizedState=h}}function f0(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Ph.transition;Ph.transition={};try{e(!1),t()}finally{tt=r,Ph.transition=n}}function SS(){return Xr().memoizedState}function PA(e,t,r){var n=to(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},NS(e))CS(t,r);else if(r=oS(e,t,r,n),r!==null){var s=cr();wn(r,e,n,s),kS(r,t,n)}}function AA(e,t,r){var n=to(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(NS(e))CS(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,l=o(a,r);if(s.hasEagerState=!0,s.eagerState=l,jn(l,a)){var c=t.interleaved;c===null?(s.next=s,mx(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=oS(e,t,s,n),r!==null&&(s=cr(),wn(r,e,n,s),kS(r,t,n))}}function NS(e){var t=e.alternate;return e===wt||t!==null&&t===wt}function CS(e,t){zl=Nd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function kS(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ex(e,r)}}var Cd={readContext:Yr,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useInsertionEffect:qt,useLayoutEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useMutableSource:qt,useSyncExternalStore:qt,useId:qt,unstable_isNewReconciler:!1},RA={readContext:Yr,useCallback:function(e,t){return _n().memoizedState=[e,t===void 0?null:t],e},useContext:Yr,useEffect:m0,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Bu(4194308,4,vS.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Bu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bu(4,2,e,t)},useMemo:function(e,t){var r=_n();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=_n();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=PA.bind(null,wt,e),[n.memoizedState,e]},useRef:function(e){var t=_n();return e={current:e},t.memoizedState=e},useState:h0,useDebugValue:Sx,useDeferredValue:function(e){return _n().memoizedState=e},useTransition:function(){var e=h0(!1),t=e[0];return e=TA.bind(null,e[1]),_n().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=wt,s=_n();if(mt){if(r===void 0)throw Error(te(407));r=r()}else{if(r=t(),$t===null)throw Error(te(349));ni&30||uS(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,m0(fS.bind(null,n,o,e),[e]),n.flags|=2048,mc(9,dS.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=_n(),t=$t.identifierPrefix;if(mt){var r=ss,n=ns;r=(n&~(1<<32-bn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=fc++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[Rn]=t,e[cc]=n,IS(e,t,!1,!1),t.stateNode=e;e:{switch(a=Vm(r,n),r){case"dialog":ct("cancel",e),ct("close",e),s=n;break;case"iframe":case"object":case"embed":ct("load",e),s=n;break;case"video":case"audio":for(s=0;sOa&&(t.flags|=128,n=!0,yl(o,!1),t.lanes=4194304)}else{if(!n)if(e=Sd(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),yl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!mt)return Gt(t),null}else 2*Tt()-o.renderingStartTime>Oa&&r!==1073741824&&(t.flags|=128,n=!0,yl(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(r=o.last,r!==null?r.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Tt(),t.sibling=null,r=vt.current,st(vt,n?r&1|2:r&1),t):(Gt(t),null);case 22:case 23:return Tx(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Tr&1073741824&&(Gt(t),t.subtreeFlags&6&&(t.flags|=8192)):Gt(t),null;case 24:return null;case 25:return null}throw Error(te(156,t.tag))}function $A(e,t){switch(cx(t),t.tag){case 1:return jr(t.type)&&gd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ra(),ft(wr),ft(Jt),vx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xx(t),null;case 13:if(ft(vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));Pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(vt),null;case 4:return Ra(),null;case 10:return hx(t.type._context),null;case 22:case 23:return Tx(),null;case 24:return null;default:return null}}var vu=!1,Yt=!1,zA=typeof WeakSet=="function"?WeakSet:Set,je=null;function Qi(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){kt(e,t,n)}else r.current=null}function fp(e,t,r){try{r()}catch(n){kt(e,t,n)}}var C0=!1;function BA(e,t){if(Qm=fd,e=Uj(),ax(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var a=0,l=-1,c=-1,u=0,d=0,h=e,m=null;t:for(;;){for(var p;h!==r||s!==0&&h.nodeType!==3||(l=a+s),h!==o||n!==0&&h.nodeType!==3||(c=a+n),h.nodeType===3&&(a+=h.nodeValue.length),(p=h.firstChild)!==null;)m=h,h=p;for(;;){if(h===e)break t;if(m===r&&++u===s&&(l=a),m===o&&++d===n&&(c=a),(p=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Zm={focusedElem:e,selectionRange:r},fd=!1,je=t;je!==null;)if(t=je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,je=e;else for(;je!==null;){t=je;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var g=b.memoizedProps,y=b.memoizedState,v=t.stateNode,x=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:mn(t.type,g),y);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(j){kt(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,je=e;break}je=t.return}return b=C0,C0=!1,b}function Bl(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&fp(t,r,o)}s=s.next}while(s!==n)}}function vf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function hp(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function VS(e){var t=e.alternate;t!==null&&(e.alternate=null,VS(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rn],delete t[cc],delete t[Jm],delete t[NA],delete t[CA])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $S(e){return e.tag===5||e.tag===3||e.tag===4}function k0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$S(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function mp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=pd));else if(n!==4&&(e=e.child,e!==null))for(mp(e,t,r),e=e.sibling;e!==null;)mp(e,t,r),e=e.sibling}function pp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(pp(e,t,r),e=e.sibling;e!==null;)pp(e,t,r),e=e.sibling}var Bt=null,xn=!1;function Ns(e,t,r){for(r=r.child;r!==null;)zS(e,t,r),r=r.sibling}function zS(e,t,r){if(In&&typeof In.onCommitFiberUnmount=="function")try{In.onCommitFiberUnmount(uf,r)}catch{}switch(r.tag){case 5:Yt||Qi(r,t);case 6:var n=Bt,s=xn;Bt=null,Ns(e,t,r),Bt=n,xn=s,Bt!==null&&(xn?(e=Bt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Bt.removeChild(r.stateNode));break;case 18:Bt!==null&&(xn?(e=Bt,r=r.stateNode,e.nodeType===8?Eh(e.parentNode,r):e.nodeType===1&&Eh(e,r),sc(e)):Eh(Bt,r.stateNode));break;case 4:n=Bt,s=xn,Bt=r.stateNode.containerInfo,xn=!0,Ns(e,t,r),Bt=n,xn=s;break;case 0:case 11:case 14:case 15:if(!Yt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&fp(r,t,a),s=s.next}while(s!==n)}Ns(e,t,r);break;case 1:if(!Yt&&(Qi(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){kt(r,t,l)}Ns(e,t,r);break;case 21:Ns(e,t,r);break;case 22:r.mode&1?(Yt=(n=Yt)||r.memoizedState!==null,Ns(e,t,r),Yt=n):Ns(e,t,r);break;default:Ns(e,t,r)}}function E0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new zA),t.forEach(function(n){var s=YA.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function ln(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=a),n&=~o}if(n=s,n=Tt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*HA(n/1960))-n,10e?16:e,qs===null)var n=!1;else{if(e=qs,qs=null,_d=0,Qe&6)throw Error(te(331));var s=Qe;for(Qe|=4,je=e.current;je!==null;){var o=je,a=o.child;if(je.flags&16){var l=o.deletions;if(l!==null){for(var c=0;cTt()-Ex?Qo(e,0):kx|=r),Sr(e,t)}function QS(e,t){t===0&&(e.mode&1?(t=cu,cu<<=1,!(cu&130023424)&&(cu=4194304)):t=1);var r=cr();e=ds(e,t),e!==null&&(Lc(e,t,r),Sr(e,r))}function ZA(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),QS(e,r)}function YA(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(te(314))}n!==null&&n.delete(t),QS(e,r)}var ZS;ZS=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||wr.current)gr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return gr=!1,FA(e,t,r);gr=!!(e.flags&131072)}else gr=!1,mt&&t.flags&1048576&&eS(t,yd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Uu(e,t),e=t.pendingProps;var s=Ta(t,Jt.current);aa(t,r),s=bx(null,t,n,e,s,r);var o=wx();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,jr(n)?(o=!0,xd(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,px(t),s.updater=xf,t.stateNode=s,s._reactInternals=t,op(t,n,e,r),t=lp(null,t,n,!0,o,r)):(t.tag=0,mt&&o&&lx(t),nr(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Uu(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=JA(n),e=mn(n,e),s){case 0:t=ap(null,t,n,e,r);break e;case 1:t=j0(null,t,n,e,r);break e;case 11:t=b0(null,t,n,e,r);break e;case 14:t=w0(null,t,n,mn(n.type,e),r);break e}throw Error(te(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:mn(n,s),ap(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:mn(n,s),j0(e,t,n,s,r);case 3:e:{if(MS(t),e===null)throw Error(te(387));n=t.pendingProps,o=t.memoizedState,s=o.element,iS(e,t),jd(t,n,null,r);var a=t.memoizedState;if(n=a.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Ma(Error(te(423)),t),t=S0(e,t,n,r,s);break e}else if(n!==s){s=Ma(Error(te(424)),t),t=S0(e,t,n,r,s);break e}else for(Rr=Xs(t.stateNode.containerInfo.firstChild),Mr=t,mt=!0,vn=null,r=sS(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Pa(),n===s){t=fs(e,t,r);break e}nr(e,t,n,r)}t=t.child}return t;case 5:return aS(t),e===null&&rp(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,a=s.children,Ym(n,s)?a=null:o!==null&&Ym(n,o)&&(t.flags|=32),RS(e,t),nr(e,t,a,r),t.child;case 6:return e===null&&rp(t),null;case 13:return OS(e,t,r);case 4:return gx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Aa(t,null,n,r):nr(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:mn(n,s),b0(e,t,n,s,r);case 7:return nr(e,t,t.pendingProps,r),t.child;case 8:return nr(e,t,t.pendingProps.children,r),t.child;case 12:return nr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,a=s.value,st(bd,n._currentValue),n._currentValue=a,o!==null)if(jn(o.value,a)){if(o.children===s.children&&!wr.current){t=fs(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){a=o.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(o.tag===1){c=as(-1,r&-r),c.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}o.lanes|=r,c=o.alternate,c!==null&&(c.lanes|=r),np(o.return,r,t),l.lanes|=r;break}c=c.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(te(341));a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),np(a,r,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}nr(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,aa(t,r),s=Yr(s),n=n(s),t.flags|=1,nr(e,t,n,r),t.child;case 14:return n=t.type,s=mn(n,t.pendingProps),s=mn(n.type,s),w0(e,t,n,s,r);case 15:return PS(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:mn(n,s),Uu(e,t),t.tag=1,jr(n)?(e=!0,xd(t)):e=!1,aa(t,r),ES(t,n,s),op(t,n,s,r),lp(null,t,n,!0,e,r);case 19:return DS(e,t,r);case 22:return AS(e,t,r)}throw Error(te(156,t.tag))};function YS(e,t){return Nj(e,t)}function XA(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(e,t,r,n){return new XA(e,t,r,n)}function Ax(e){return e=e.prototype,!(!e||!e.isReactComponent)}function JA(e){if(typeof e=="function")return Ax(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zg)return 11;if(e===Yg)return 14}return 2}function ro(e,t){var r=e.alternate;return r===null?(r=Gr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Ku(e,t,r,n,s,o){var a=2;if(n=e,typeof e=="function")Ax(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case $i:return Zo(r.children,s,o,t);case Qg:a=8,s|=8;break;case Tm:return e=Gr(12,r,t,s|2),e.elementType=Tm,e.lanes=o,e;case Pm:return e=Gr(13,r,t,s),e.elementType=Pm,e.lanes=o,e;case Am:return e=Gr(19,r,t,s),e.elementType=Am,e.lanes=o,e;case aj:return bf(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case oj:a=10;break e;case ij:a=9;break e;case Zg:a=11;break e;case Yg:a=14;break e;case As:a=16,n=null;break e}throw Error(te(130,e==null?e:typeof e,""))}return t=Gr(a,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function Zo(e,t,r,n){return e=Gr(7,e,n,t),e.lanes=r,e}function bf(e,t,r,n){return e=Gr(22,e,n,t),e.elementType=aj,e.lanes=r,e.stateNode={isHidden:!1},e}function Dh(e,t,r){return e=Gr(6,e,null,t),e.lanes=r,e}function Ih(e,t,r){return t=Gr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function eR(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gh(0),this.expirationTimes=gh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gh(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Rx(e,t,r,n,s,o,a,l,c){return e=new eR(e,t,r,l,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Gr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},px(o),e}function tR(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tN)}catch(e){console.error(e)}}tN(),tj.exports=Fr;var bi=tj.exports;const rN=U1(bi);var nN,D0=bi;nN=D0.createRoot,D0.hydrateRoot;const iR=1,aR=1e6;let Lh=0;function lR(){return Lh=(Lh+1)%Number.MAX_SAFE_INTEGER,Lh.toString()}const Fh=new Map,I0=e=>{if(Fh.has(e))return;const t=setTimeout(()=>{Fh.delete(e),Wl({type:"REMOVE_TOAST",toastId:e})},aR);Fh.set(e,t)},cR=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,iR)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?I0(r):e.toasts.forEach(n=>{I0(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},qu=[];let Gu={toasts:[]};function Wl(e){Gu=cR(Gu,e),qu.forEach(t=>{t(Gu)})}function co({...e}){const t=lR(),r=s=>Wl({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>Wl({type:"DISMISS_TOAST",toastId:t});return Wl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Kt(){const[e,t]=f.useState(Gu);return f.useEffect(()=>(qu.push(t),()=>{const r=qu.indexOf(t);r>-1&&qu.splice(r,1)}),[e]),{...e,toast:co,dismiss:r=>Wl({type:"DISMISS_TOAST",toastId:r})}}function ke(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function L0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ii(...e){return t=>{let r=!1;const n=e.map(s=>{const o=L0(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s{const{children:a,...l}=o,c=f.useMemo(()=>l,Object.values(l));return i.jsx(r.Provider,{value:c,children:a})};n.displayName=e+"Provider";function s(o){const a=f.useContext(r);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,s]}function Wn(e,t=[]){let r=[];function n(o,a){const l=f.createContext(a),c=r.length;r=[...r,a];const u=h=>{var v;const{scope:m,children:p,...b}=h,g=((v=m==null?void 0:m[e])==null?void 0:v[c])||l,y=f.useMemo(()=>b,Object.values(b));return i.jsx(g.Provider,{value:y,children:p})};u.displayName=o+"Provider";function d(h,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,b=f.useContext(p);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[u,d]}const s=()=>{const o=r.map(a=>f.createContext(a));return function(l){const c=(l==null?void 0:l[e])||o;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,dR(s,...t)]}function dR(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=n.reduce((l,{useScope:c,scopeName:u})=>{const h=c(o)[`__scope${u}`];return{...l,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function ai(e){const t=fR(e),r=f.forwardRef((n,s)=>{const{children:o,...a}=n,l=f.Children.toArray(o),c=l.find(mR);if(c){const u=c.props.children,d=l.map(h=>h===c?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:h);return i.jsx(t,{...a,ref:s,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return i.jsx(t,{...a,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var wi=ai("Slot");function fR(e){const t=f.forwardRef((r,n)=>{const{children:s,...o}=r;if(f.isValidElement(s)){const a=gR(s),l=pR(o,s.props);return s.type!==f.Fragment&&(l.ref=n?ii(n,a):a),f.cloneElement(s,l)}return f.Children.count(s)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sN=Symbol("radix.slottable");function hR(e){const t=({children:r})=>i.jsx(i.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=sN,t}function mR(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sN}function pR(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...l)=>{const c=o(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function gR(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Ix(e){const t=e+"CollectionProvider",[r,n]=Wn(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:y,children:v}=g,x=U.useRef(null),w=U.useRef(new Map).current;return i.jsx(s,{scope:y,itemMap:w,collectionRef:x,children:v})};a.displayName=t;const l=e+"CollectionSlot",c=ai(l),u=U.forwardRef((g,y)=>{const{scope:v,children:x}=g,w=o(l,v),j=ze(y,w.collectionRef);return i.jsx(c,{ref:j,children:x})});u.displayName=l;const d=e+"CollectionItemSlot",h="data-radix-collection-item",m=ai(d),p=U.forwardRef((g,y)=>{const{scope:v,children:x,...w}=g,j=U.useRef(null),S=ze(y,j),N=o(d,v);return U.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),i.jsx(m,{[h]:"",ref:S,children:x})});p.displayName=d;function b(g){const y=o(e+"CollectionConsumer",g);return U.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((N,C)=>w.indexOf(N.ref.current)-w.indexOf(C.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:u,ItemSlot:p},b,n]}var xR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Te=xR.reduce((e,t)=>{const r=ai(`Primitive.${t}`),n=f.forwardRef((s,o)=>{const{asChild:a,...l}=s,c=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function oN(e,t){e&&bi.flushSync(()=>e.dispatchEvent(t))}function Vt(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function vR(e,t=globalThis==null?void 0:globalThis.document){const r=Vt(e);f.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var yR="DismissableLayer",bp="dismissableLayer.update",bR="dismissableLayer.pointerDownOutside",wR="dismissableLayer.focusOutside",F0,iN=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xa=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=e,u=f.useContext(iN),[d,h]=f.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=f.useState({}),b=ze(t,C=>h(C)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),x=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,j=x>=v,S=SR(C=>{const _=C.target,$=[...u.branches].some(D=>D.contains(_));!j||$||(s==null||s(C),a==null||a(C),C.defaultPrevented||l==null||l())},m),N=NR(C=>{const _=C.target;[...u.branches].some(D=>D.contains(_))||(o==null||o(C),a==null||a(C),C.defaultPrevented||l==null||l())},m);return vR(C=>{x===u.layers.size-1&&(n==null||n(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},m),f.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(F0=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),V0(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=F0)}},[d,m,r,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),V0())},[d,u]),f.useEffect(()=>{const C=()=>p({});return document.addEventListener(bp,C),()=>document.removeEventListener(bp,C)},[]),i.jsx(Te.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,S.onPointerDownCapture)})});Xa.displayName=yR;var jR="DismissableLayerBranch",aN=f.forwardRef((e,t)=>{const r=f.useContext(iN),n=f.useRef(null),s=ze(t,n);return f.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),i.jsx(Te.div,{...e,ref:s})});aN.displayName=jR;function SR(e,t=globalThis==null?void 0:globalThis.document){const r=Vt(e),n=f.useRef(!1),s=f.useRef(()=>{});return f.useEffect(()=>{const o=l=>{if(l.target&&!n.current){let c=function(){lN(bR,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function NR(e,t=globalThis==null?void 0:globalThis.document){const r=Vt(e),n=f.useRef(!1);return f.useEffect(()=>{const s=o=>{o.target&&!n.current&&lN(wR,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function V0(){const e=new CustomEvent(bp);document.dispatchEvent(e)}function lN(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?oN(s,o):s.dispatchEvent(o)}var CR=Xa,kR=aN,zt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},ER="Portal",zc=f.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[s,o]=f.useState(!1);zt(()=>o(!0),[]);const a=r||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?rN.createPortal(i.jsx(Te.div,{...n,ref:t}),a):null});zc.displayName=ER;function _R(e,t){return f.useReducer((r,n)=>t[r][n]??r,e)}var $r=e=>{const{present:t,children:r}=e,n=TR(t),s=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),o=ze(n.ref,PR(s));return typeof r=="function"||n.isPresent?f.cloneElement(s,{ref:o}):null};$r.displayName="Presence";function TR(e){const[t,r]=f.useState(),n=f.useRef(null),s=f.useRef(e),o=f.useRef("none"),a=e?"mounted":"unmounted",[l,c]=_R(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=wu(n.current);o.current=l==="mounted"?u:"none"},[l]),zt(()=>{const u=n.current,d=s.current;if(d!==e){const m=o.current,p=wu(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),zt(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=p=>{const g=wu(n.current).includes(p.animationName);if(p.target===t&&g&&(c("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=p=>{p.target===t&&(o.current=wu(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function wu(e){return(e==null?void 0:e.animationName)||"none"}function PR(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var AR=Wg[" useInsertionEffect ".trim().toString()]||zt;function uo({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,a]=RR({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:s;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const h=d.current;h!==l&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,n])}const u=f.useCallback(d=>{var h;if(l){const m=MR(d)?d(e):d;m!==e&&((h=a.current)==null||h.call(a,m))}else o(d)},[l,e,o,a]);return[c,u]}function RR({defaultProp:e,onChange:t}){const[r,n]=f.useState(e),s=f.useRef(r),o=f.useRef(t);return AR(()=>{o.current=t},[t]),f.useEffect(()=>{var a;s.current!==r&&((a=o.current)==null||a.call(o,r),s.current=r)},[r,s]),[r,n,o]}function MR(e){return typeof e=="function"}var cN=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),OR="VisuallyHidden",Cf=f.forwardRef((e,t)=>i.jsx(Te.span,{...e,ref:t,style:{...cN,...e.style}}));Cf.displayName=OR;var DR=Cf,Lx="ToastProvider",[Fx,IR,LR]=Ix("Toast"),[uN,PB]=Wn("Toast",[LR]),[FR,kf]=uN(Lx),dN=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:a}=e,[l,c]=f.useState(null),[u,d]=f.useState(0),h=f.useRef(!1),m=f.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Lx}\`. Expected non-empty \`string\`.`),i.jsx(Fx.Provider,{scope:t,children:i.jsx(FR,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:f.useCallback(()=>d(p=>p+1),[]),onToastRemove:f.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:m,children:a})})};dN.displayName=Lx;var fN="ToastViewport",VR=["F8"],wp="toast.viewportPause",jp="toast.viewportResume",hN=f.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=VR,label:s="Notifications ({hotkey})",...o}=e,a=kf(fN,r),l=IR(r),c=f.useRef(null),u=f.useRef(null),d=f.useRef(null),h=f.useRef(null),m=ze(t,h,a.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=a.toastCount>0;f.useEffect(()=>{const y=v=>{var w;n.length!==0&&n.every(j=>v[j]||v.code===j)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]),f.useEffect(()=>{const y=c.current,v=h.current;if(b&&y&&v){const x=()=>{if(!a.isClosePausedRef.current){const N=new CustomEvent(wp);v.dispatchEvent(N),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const N=new CustomEvent(jp);v.dispatchEvent(N),a.isClosePausedRef.current=!1}},j=N=>{!y.contains(N.relatedTarget)&&w()},S=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",x),y.addEventListener("focusout",j),y.addEventListener("pointermove",x),y.addEventListener("pointerleave",S),window.addEventListener("blur",x),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",x),y.removeEventListener("focusout",j),y.removeEventListener("pointermove",x),y.removeEventListener("pointerleave",S),window.removeEventListener("blur",x),window.removeEventListener("focus",w)}}},[b,a.isClosePausedRef]);const g=f.useCallback(({tabbingDirection:y})=>{const x=l().map(w=>{const j=w.ref.current,S=[j,...XR(j)];return y==="forwards"?S:S.reverse()});return(y==="forwards"?x.reverse():x).flat()},[l]);return f.useEffect(()=>{const y=h.current;if(y){const v=x=>{var S,N,C;const w=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!w){const _=document.activeElement,$=x.shiftKey;if(x.target===y&&$){(S=u.current)==null||S.focus();return}const T=g({tabbingDirection:$?"backwards":"forwards"}),L=T.findIndex(M=>M===_);Vh(T.slice(L+1))?x.preventDefault():$?(N=u.current)==null||N.focus():(C=d.current)==null||C.focus()}};return y.addEventListener("keydown",v),()=>y.removeEventListener("keydown",v)}},[l,g]),i.jsxs(kR,{ref:c,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&i.jsx(Sp,{ref:u,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"forwards"});Vh(y)}}),i.jsx(Fx.Slot,{scope:r,children:i.jsx(Te.ol,{tabIndex:-1,...o,ref:m})}),b&&i.jsx(Sp,{ref:d,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"backwards"});Vh(y)}})]})});hN.displayName=fN;var mN="ToastFocusProxy",Sp=f.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=kf(mN,r);return i.jsx(Cf,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:a=>{var u;const l=a.relatedTarget;!((u=o.viewport)!=null&&u.contains(l))&&n()}})});Sp.displayName=mN;var Bc="Toast",$R="toast.swipeStart",zR="toast.swipeMove",BR="toast.swipeCancel",UR="toast.swipeEnd",pN=f.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...a}=e,[l,c]=uo({prop:n,defaultProp:s??!0,onChange:o,caller:Bc});return i.jsx($r,{present:r||l,children:i.jsx(KR,{open:l,...a,ref:t,onClose:()=>c(!1),onPause:Vt(e.onPause),onResume:Vt(e.onResume),onSwipeStart:ke(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ke(e.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:ke(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ke(e.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});pN.displayName=Bc;var[HR,WR]=uN(Bc,{onClose(){}}),KR=f.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:m,onSwipeEnd:p,...b}=e,g=kf(Bc,r),[y,v]=f.useState(null),x=ze(t,M=>v(M)),w=f.useRef(null),j=f.useRef(null),S=s||g.duration,N=f.useRef(0),C=f.useRef(S),_=f.useRef(0),{onToastAdd:$,onToastRemove:D}=g,z=Vt(()=>{var B;(y==null?void 0:y.contains(document.activeElement))&&((B=g.viewport)==null||B.focus()),a()}),T=f.useCallback(M=>{!M||M===1/0||(window.clearTimeout(_.current),N.current=new Date().getTime(),_.current=window.setTimeout(z,M))},[z]);f.useEffect(()=>{const M=g.viewport;if(M){const B=()=>{T(C.current),u==null||u()},W=()=>{const H=new Date().getTime()-N.current;C.current=C.current-H,window.clearTimeout(_.current),c==null||c()};return M.addEventListener(wp,W),M.addEventListener(jp,B),()=>{M.removeEventListener(wp,W),M.removeEventListener(jp,B)}}},[g.viewport,S,c,u,T]),f.useEffect(()=>{o&&!g.isClosePausedRef.current&&T(S)},[o,S,g.isClosePausedRef,T]),f.useEffect(()=>($(),()=>D()),[$,D]);const L=f.useMemo(()=>y?jN(y):null,[y]);return g.viewport?i.jsxs(i.Fragment,{children:[L&&i.jsx(qR,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),i.jsx(HR,{scope:r,onClose:z,children:bi.createPortal(i.jsx(Fx.ItemSlot,{scope:r,children:i.jsx(CR,{asChild:!0,onEscapeKeyDown:ke(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||z(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(Te.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":g.swipeDirection,...b,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ke(e.onKeyDown,M=>{M.key==="Escape"&&(l==null||l(M.nativeEvent),M.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:ke(e.onPointerDown,M=>{M.button===0&&(w.current={x:M.clientX,y:M.clientY})}),onPointerMove:ke(e.onPointerMove,M=>{if(!w.current)return;const B=M.clientX-w.current.x,W=M.clientY-w.current.y,H=!!j.current,A=["left","right"].includes(g.swipeDirection),E=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,I=A?E(0,B):0,q=A?0:E(0,W),F=M.pointerType==="touch"?10:2,Z={x:I,y:q},X={originalEvent:M,delta:Z};H?(j.current=Z,ju(zR,h,X,{discrete:!1})):$0(Z,g.swipeDirection,F)?(j.current=Z,ju($R,d,X,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(B)>F||Math.abs(W)>F)&&(w.current=null)}),onPointerUp:ke(e.onPointerUp,M=>{const B=j.current,W=M.target;if(W.hasPointerCapture(M.pointerId)&&W.releasePointerCapture(M.pointerId),j.current=null,w.current=null,B){const H=M.currentTarget,A={originalEvent:M,delta:B};$0(B,g.swipeDirection,g.swipeThreshold)?ju(UR,p,A,{discrete:!0}):ju(BR,m,A,{discrete:!0}),H.addEventListener("click",E=>E.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),qR=e=>{const{__scopeToast:t,children:r,...n}=e,s=kf(Bc,t),[o,a]=f.useState(!1),[l,c]=f.useState(!1);return ZR(()=>a(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:i.jsx(zc,{asChild:!0,children:i.jsx(Cf,{...n,children:o&&i.jsxs(i.Fragment,{children:[s.label," ",r]})})})},GR="ToastTitle",gN=f.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return i.jsx(Te.div,{...n,ref:t})});gN.displayName=GR;var QR="ToastDescription",xN=f.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return i.jsx(Te.div,{...n,ref:t})});xN.displayName=QR;var vN="ToastAction",yN=f.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?i.jsx(wN,{altText:r,asChild:!0,children:i.jsx(Vx,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${vN}\`. Expected non-empty \`string\`.`),null)});yN.displayName=vN;var bN="ToastClose",Vx=f.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=WR(bN,r);return i.jsx(wN,{asChild:!0,children:i.jsx(Te.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,s.onClose)})})});Vx.displayName=bN;var wN=f.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return i.jsx(Te.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function jN(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),YR(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...jN(n))}}),t}function ju(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?oN(s,o):s.dispatchEvent(o)}var $0=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function ZR(e=()=>{}){const t=Vt(e);zt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function YR(e){return e.nodeType===e.ELEMENT_NODE}function XR(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Vh(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var JR=dN,SN=hN,NN=pN,CN=gN,kN=xN,EN=yN,_N=Vx;function TN(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,B0=PN,ji=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return B0(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(u=>{const d=r==null?void 0:r[u],h=o==null?void 0:o[u];if(d===null)return null;const m=z0(d)||z0(h);return s[u][m]}),l=r&&Object.entries(r).reduce((u,d)=>{let[h,m]=d;return m===void 0||(u[h]=m),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:h,className:m,...p}=d;return Object.entries(p).every(b=>{let[g,y]=b;return Array.isArray(y)?y.includes({...o,...l}[g]):{...o,...l}[g]===y})?[...u,h,m]:u},[]);return B0(e,a,c,r==null?void 0:r.class,r==null?void 0:r.className)};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),AN=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var tM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rM=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:a,...l},c)=>f.createElement("svg",{ref:c,...tM,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:AN("lucide",s),...l},[...a.map(([u,d])=>f.createElement(u,d)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ne=(e,t)=>{const r=f.forwardRef(({className:n,...s},o)=>f.createElement(rM,{ref:o,iconNode:t,className:AN(`lucide-${eM(e)}`,n),...s}));return r.displayName=`${e}`,r};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nM=Ne("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Da=Ne("Blinds",[["path",{d:"M3 3h18",key:"o7r712"}],["path",{d:"M20 7H8",key:"gd2fo2"}],["path",{d:"M20 11H8",key:"1ynp89"}],["path",{d:"M10 19h10",key:"19hjk5"}],["path",{d:"M8 15h12",key:"1yqzne"}],["path",{d:"M4 3v14",key:"fggqzn"}],["circle",{cx:"4",cy:"19",r:"2",key:"p3m9r0"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kl=Ne("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $x=Ne("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ef=Ne("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RN=Ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sM=Ne("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oM=Ne("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iM=Ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aM=Ne("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lM=Ne("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Un=Ne("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ad=Ne("CircuitBoard",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M11 9h4a2 2 0 0 0 2-2V3",key:"1ve2rv"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"M7 21v-4a2 2 0 0 1 2-2h4",key:"1fwkro"}],["circle",{cx:"15",cy:"15",r:"2",key:"3i40o0"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qu=Ne("Clapperboard",[["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z",key:"1tn4o7"}],["path",{d:"m6.2 5.3 3.1 3.9",key:"iuk76l"}],["path",{d:"m12.4 3.4 3.1 4",key:"6hsd6n"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z",key:"ltgou9"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const MN=Ne("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zu=Ne("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zx=Ne("DoorOpen",[["path",{d:"M13 4h3a2 2 0 0 1 2 2v14",key:"hrm0s9"}],["path",{d:"M2 20h3",key:"1gaodv"}],["path",{d:"M13 20h9",key:"s90cdi"}],["path",{d:"M10 12v.01",key:"vx6srw"}],["path",{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",key:"199qr4"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cM=Ne("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uM=Ne("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ON=Ne("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U0=Ne("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dM=Ne("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H0=Ne("FileOutput",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fM=Ne("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hM=Ne("Film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mM=Ne("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DN=Ne("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uc=Ne("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pM=Ne("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Np=Ne("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gM=Ne("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xM=Ne("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cp=Ne("KeySquare",[["path",{d:"M12.4 2.7a2.5 2.5 0 0 1 3.4 0l5.5 5.5a2.5 2.5 0 0 1 0 3.4l-3.7 3.7a2.5 2.5 0 0 1-3.4 0L8.7 9.8a2.5 2.5 0 0 1 0-3.4z",key:"165ttr"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"m9.4 10.6-6.814 6.814A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814",key:"1ubxi2"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W0=Ne("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Su=Ne("LayoutList",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ia=Ne("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ca=Ne("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vM=Ne("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K0=Ne("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q0=Ne("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kp=Ne("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yM=Ne("MoonStar",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9",key:"4ay0iu"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bM=Ne("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wM=Ne("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jM=Ne("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ja=Ne("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G0=Ne("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const SM=Ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const IN=Ne("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const NM=Ne("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const La=Ne("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ep=Ne("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gc=Ne("Snowflake",[["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"m20 16-4-4 4-4",key:"rquw4f"}],["path",{d:"m4 8 4 4-4 4",key:"12s3z9"}],["path",{d:"m16 4-4 4-4-4",key:"1tumq1"}],["path",{d:"m8 20 4-4 4 4",key:"9p200w"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ot=Ne("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CM=Ne("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kM=Ne("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cn=Ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _p=Ne("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tp=Ne("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yu=Ne("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const EM=Ne("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nr=Ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const os=Ne("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Bx="-",_M=e=>{const t=PM(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const l=a.split(Bx);return l[0]===""&&l.length!==1&&l.shift(),LN(l,t)||TM(a)},getConflictingClassGroupIds:(a,l)=>{const c=r[a]||[];return l&&n[a]?[...c,...n[a]]:c}}},LN=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?LN(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Bx);return(a=t.validators.find(({validator:l})=>l(o)))==null?void 0:a.classGroupId},Q0=/^\[(.+)\]$/,TM=e=>{if(Q0.test(e)){const t=Q0.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},PM=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return RM(Object.entries(e.classGroups),r).forEach(([o,a])=>{Pp(a,n,o,t)}),n},Pp=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Z0(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(AM(s)){Pp(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,a])=>{Pp(a,Z0(t,o),r,n)})})},Z0=(e,t)=>{let r=e;return t.split(Bx).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},AM=e=>e.isThemeGetter,RM=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,l])=>[t+a,l])):o);return[r,s]}):e,MM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return s(o,a),a},set(o,a){r.has(o)?r.set(o,a):s(o,a)}}},FN="!",OM=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,a=l=>{const c=[];let u=0,d=0,h;for(let y=0;yd?h-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:g}};return r?l=>r({className:l,parseClassName:a}):a},DM=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},IM=e=>({cache:MM(e.cacheSize),parseClassName:OM(e),..._M(e)}),LM=/\s+/,FM=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],a=e.trim().split(LM);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}=r(u);let b=!!p,g=n(b?m.substring(0,p):m);if(!g){if(!b){l=u+(l.length>0?" "+l:l);continue}if(g=n(m),!g){l=u+(l.length>0?" "+l:l);continue}b=!1}const y=DM(d).join(":"),v=h?y+FN:y,x=v+g;if(o.includes(x))continue;o.push(x);const w=s(g,b);for(let j=0;j0?" "+l:l)}return l};function VM(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nh(d),e());return r=IM(u),n=r.cache.get,s=r.cache.set,o=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=FM(c,r);return s(c,d),d}return function(){return o(VM.apply(null,arguments))}}const lt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},$N=/^\[(?:([a-z-]+):)?(.+)\]$/i,zM=/^\d+\/\d+$/,BM=new Set(["px","full","screen"]),UM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,HM=/\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$/,WM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,KM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qn=e=>ua(e)||BM.has(e)||zM.test(e),Cs=e=>el(e,"length",t4),ua=e=>!!e&&!Number.isNaN(Number(e)),$h=e=>el(e,"number",ua),wl=e=>!!e&&Number.isInteger(Number(e)),GM=e=>e.endsWith("%")&&ua(e.slice(0,-1)),$e=e=>$N.test(e),ks=e=>UM.test(e),QM=new Set(["length","size","percentage"]),ZM=e=>el(e,QM,zN),YM=e=>el(e,"position",zN),XM=new Set(["image","url"]),JM=e=>el(e,XM,n4),e4=e=>el(e,"",r4),jl=()=>!0,el=(e,t,r)=>{const n=$N.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},t4=e=>HM.test(e)&&!WM.test(e),zN=()=>!1,r4=e=>KM.test(e),n4=e=>qM.test(e),s4=()=>{const e=lt("colors"),t=lt("spacing"),r=lt("blur"),n=lt("brightness"),s=lt("borderColor"),o=lt("borderRadius"),a=lt("borderSpacing"),l=lt("borderWidth"),c=lt("contrast"),u=lt("grayscale"),d=lt("hueRotate"),h=lt("invert"),m=lt("gap"),p=lt("gradientColorStops"),b=lt("gradientColorStopPositions"),g=lt("inset"),y=lt("margin"),v=lt("opacity"),x=lt("padding"),w=lt("saturate"),j=lt("scale"),S=lt("sepia"),N=lt("skew"),C=lt("space"),_=lt("translate"),$=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",$e,t],T=()=>[$e,t],L=()=>["",Qn,Cs],M=()=>["auto",ua,$e],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],E=()=>["","0",$e],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[ua,$e];return{cacheSize:500,separator:":",theme:{colors:[jl],spacing:[Qn,Cs],blur:["none","",ks,$e],brightness:q(),borderColor:[e],borderRadius:["none","","full",ks,$e],borderSpacing:T(),borderWidth:L(),contrast:q(),grayscale:E(),hueRotate:q(),invert:E(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[GM,Cs],inset:z(),margin:z(),opacity:q(),padding:T(),saturate:q(),scale:q(),sepia:E(),skew:q(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[ks]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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"],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:[...B(),$e]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",wl,$e]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:E()}],shrink:[{shrink:E()}],order:[{order:["first","last","none",wl,$e]}],"grid-cols":[{"grid-cols":[jl]}],"col-start-end":[{col:["auto",{span:["full",wl,$e]},$e]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[jl]}],"row-start-end":[{row:["auto",{span:[wl,$e]},$e]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[ks]},ks]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ks,Cs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",$h]}],"font-family":[{font:[jl]}],"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:["tighter","tight","normal","wide","wider","widest",$e]}],"line-clamp":[{"line-clamp":["none",ua,$h]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Qn,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Qn,Cs]}],"underline-offset":[{"underline-offset":["auto",Qn,$e]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),YM]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ZM]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},JM]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:W()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[Qn,$e]}],"outline-w":[{outline:[Qn,Cs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Qn,Cs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ks,e4]}],"shadow-color":[{shadow:[jl]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ks,$e]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[wl,$e]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Qn,Cs,$h]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},o4=$M(s4);function he(...e){return o4(PN(e))}const i4=JR,BN=f.forwardRef(({className:e,...t},r)=>i.jsx(SN,{ref:r,className:he("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));BN.displayName=SN.displayName;const a4=ji("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),UN=f.forwardRef(({className:e,variant:t,...r},n)=>i.jsx(NN,{ref:n,className:he(a4({variant:t}),e),...r}));UN.displayName=NN.displayName;const l4=f.forwardRef(({className:e,...t},r)=>i.jsx(EN,{ref:r,className:he("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));l4.displayName=EN.displayName;const HN=f.forwardRef(({className:e,...t},r)=>i.jsx(_N,{ref:r,className:he("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:i.jsx(Nr,{className:"h-4 w-4"})}));HN.displayName=_N.displayName;const WN=f.forwardRef(({className:e,...t},r)=>i.jsx(CN,{ref:r,className:he("text-sm font-semibold",e),...t}));WN.displayName=CN.displayName;const KN=f.forwardRef(({className:e,...t},r)=>i.jsx(kN,{ref:r,className:he("text-sm opacity-90",e),...t}));KN.displayName=kN.displayName;function c4(){const{toasts:e}=Kt();return i.jsxs(i4,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return i.jsxs(UN,{...o,children:[i.jsxs("div",{className:"grid gap-1",children:[r&&i.jsx(WN,{children:r}),n&&i.jsx(KN,{children:n})]}),s,i.jsx(HN,{})]},t)}),i.jsx(BN,{})]})}var Rd=["light","dark"],Ux="(prefers-color-scheme: dark)",u4=typeof window>"u",Hx=f.createContext(void 0),d4={setTheme:e=>{},themes:[]},qN=()=>{var e;return(e=f.useContext(Hx))!=null?e:d4},f4=e=>f.useContext(Hx)?e.children:f.createElement(m4,{...e}),h4=["light","dark"],m4=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:n=!0,storageKey:s="theme",themes:o=h4,defaultTheme:a=r?"system":"light",attribute:l="data-theme",value:c,children:u,nonce:d})=>{let[h,m]=f.useState(()=>Y0(s,a)),[p,b]=f.useState(()=>Y0(s)),g=c?Object.values(c):o,y=f.useCallback(j=>{let S=j;if(!S)return;j==="system"&&r&&(S=X0());let N=c?c[S]:S,C=t?g4():null,_=document.documentElement;if(l==="class"?(_.classList.remove(...g),N&&_.classList.add(N)):N?_.setAttribute(l,N):_.removeAttribute(l),n){let $=Rd.includes(a)?a:null,D=Rd.includes(S)?S:$;_.style.colorScheme=D}C==null||C()},[]),v=f.useCallback(j=>{let S=typeof j=="function"?j(j):j;m(S);try{localStorage.setItem(s,S)}catch{}},[e]),x=f.useCallback(j=>{let S=X0(j);b(S),h==="system"&&r&&!e&&y("system")},[h,e]);f.useEffect(()=>{let j=window.matchMedia(Ux);return j.addListener(x),x(j),()=>j.removeListener(x)},[x]),f.useEffect(()=>{let j=S=>{if(S.key!==s)return;let N=S.newValue||a;v(N)};return window.addEventListener("storage",j),()=>window.removeEventListener("storage",j)},[v]),f.useEffect(()=>{y(e??h)},[e,h]);let w=f.useMemo(()=>({theme:h,setTheme:v,forcedTheme:e,resolvedTheme:h==="system"?p:h,themes:r?[...o,"system"]:o,systemTheme:r?p:void 0}),[h,v,e,p,r,o]);return f.createElement(Hx.Provider,{value:w},f.createElement(p4,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:r,enableColorScheme:n,storageKey:s,themes:o,defaultTheme:a,attribute:l,value:c,children:u,attrs:g,nonce:d}),u)},p4=f.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:a,attrs:l,nonce:c})=>{let u=o==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(b=>`'${b}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=s?Rd.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(b,g=!1,y=!0)=>{let v=a?a[b]:b,x=g?b+"|| ''":`'${v}'`,w="";return s&&y&&!g&&Rd.includes(b)&&(w+=`d.style.colorScheme = '${b}';`),r==="class"?g||v?w+=`c.add(${x})`:w+="null":v&&(w+=`d[s](n,${x})`),w},p=e?`!function(){${d}${m(e)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${Ux}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${m(a?"x[e]":"e",!0)}}${u?"":"else{"+m(o,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${m(a?"x[e]":"e",!0)}}else{${m(o,!1,!1)};}${h}}catch(t){}}();`;return f.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})}),Y0=(e,t)=>{if(u4)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},g4=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},X0=e=>(e||(e=window.matchMedia(Ux)),e.matches?"dark":"light"),x4=e=>{switch(e){case"success":return b4;case"info":return j4;case"warning":return w4;case"error":return S4;default:return null}},v4=Array(12).fill(0),y4=({visible:e,className:t})=>U.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},U.createElement("div",{className:"sonner-spinner"},v4.map((r,n)=>U.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),b4=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),w4=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),j4=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),S4=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),N4=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},U.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),U.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),C4=()=>{let[e,t]=U.useState(document.hidden);return U.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Ap=1,k4=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Ap++,o=this.toasts.find(l=>l.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:a,title:r}):l):this.addToast({title:r,...n,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,o,a=n.then(async c=>{if(o=["resolve",c],U.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(_4(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:d})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:d})}}).catch(async c=>{if(o=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:d})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>a.then(()=>o[0]==="reject"?u(o[1]):c(o[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Ap++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},mr=new k4,E4=(e,t)=>{let r=(t==null?void 0:t.id)||Ap++;return mr.addToast({title:e,...t,id:r}),r},_4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",T4=E4,P4=()=>mr.toasts,A4=()=>mr.getActiveToasts();Object.assign(T4,{success:mr.success,info:mr.info,warning:mr.warning,error:mr.error,custom:mr.custom,message:mr.message,promise:mr.promise,dismiss:mr.dismiss,loading:mr.loading},{getHistory:P4,getToasts:A4});function R4(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}R4(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} +`);function Nu(e){return e.label!==void 0}var M4=3,O4="32px",D4="16px",J0=4e3,I4=356,L4=14,F4=20,V4=200;function cn(...e){return e.filter(Boolean).join(" ")}function $4(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var z4=e=>{var t,r,n,s,o,a,l,c,u,d,h;let{invert:m,toast:p,unstyled:b,interacting:g,setHeights:y,visibleToasts:v,heights:x,index:w,toasts:j,expanded:S,removeToast:N,defaultRichColors:C,closeButton:_,style:$,cancelButtonStyle:D,actionButtonStyle:z,className:T="",descriptionClassName:L="",duration:M,position:B,gap:W,loadingIcon:H,expandByDefault:A,classNames:E,icons:I,closeButtonAriaLabel:q="Close toast",pauseWhenPageIsHidden:F}=e,[Z,X]=U.useState(null),[ee,xe]=U.useState(null),[G,Se]=U.useState(!1),[Ae,Re]=U.useState(!1),[se,we]=U.useState(!1),[ve,Xe]=U.useState(!1),[Q,ae]=U.useState(!1),[O,ye]=U.useState(0),[J,k]=U.useState(0),V=U.useRef(p.duration||M||J0),K=U.useRef(null),ue=U.useRef(null),oe=w===0,re=w+1<=v,me=p.type,Ve=p.dismissible!==!1,Ge=p.className||"",R=p.descriptionClassName||"",Y=U.useMemo(()=>x.findIndex(Le=>Le.toastId===p.id)||0,[x,p.id]),ie=U.useMemo(()=>{var Le;return(Le=p.closeButton)!=null?Le:_},[p.closeButton,_]),be=U.useMemo(()=>p.duration||M||J0,[p.duration,M]),Fe=U.useRef(0),Be=U.useRef(0),Ke=U.useRef(0),nt=U.useRef(null),[xt,_r]=B.split("-"),_i=U.useMemo(()=>x.reduce((Le,rt,ht)=>ht>=Y?Le:Le+rt.height,0),[x,Y]),Ti=C4(),lh=p.invert||m,ch=me==="loading";Be.current=U.useMemo(()=>Y*W+_i,[Y,_i]),U.useEffect(()=>{V.current=be},[be]),U.useEffect(()=>{Se(!0)},[]),U.useEffect(()=>{let Le=ue.current;if(Le){let rt=Le.getBoundingClientRect().height;return k(rt),y(ht=>[{toastId:p.id,height:rt,position:p.position},...ht]),()=>y(ht=>ht.filter(sn=>sn.toastId!==p.id))}},[y,p.id]),U.useLayoutEffect(()=>{if(!G)return;let Le=ue.current,rt=Le.style.height;Le.style.height="auto";let ht=Le.getBoundingClientRect().height;Le.style.height=rt,k(ht),y(sn=>sn.find(on=>on.toastId===p.id)?sn.map(on=>on.toastId===p.id?{...on,height:ht}:on):[{toastId:p.id,height:ht,position:p.position},...sn])},[G,p.title,p.description,y,p.id]);let ws=U.useCallback(()=>{Re(!0),ye(Be.current),y(Le=>Le.filter(rt=>rt.toastId!==p.id)),setTimeout(()=>{N(p)},V4)},[p,N,y,Be]);U.useEffect(()=>{if(p.promise&&me==="loading"||p.duration===1/0||p.type==="loading")return;let Le;return S||g||F&&Ti?(()=>{if(Ke.current{var rt;(rt=p.onAutoClose)==null||rt.call(p,p),ws()},V.current)),()=>clearTimeout(Le)},[S,g,p,me,F,Ti,ws]),U.useEffect(()=>{p.delete&&ws()},[ws,p.delete]);function MT(){var Le,rt,ht;return I!=null&&I.loading?U.createElement("div",{className:cn(E==null?void 0:E.loader,(Le=p==null?void 0:p.classNames)==null?void 0:Le.loader,"sonner-loader"),"data-visible":me==="loading"},I.loading):H?U.createElement("div",{className:cn(E==null?void 0:E.loader,(rt=p==null?void 0:p.classNames)==null?void 0:rt.loader,"sonner-loader"),"data-visible":me==="loading"},H):U.createElement(y4,{className:cn(E==null?void 0:E.loader,(ht=p==null?void 0:p.classNames)==null?void 0:ht.loader),visible:me==="loading"})}return U.createElement("li",{tabIndex:0,ref:ue,className:cn(T,Ge,E==null?void 0:E.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,E==null?void 0:E.default,E==null?void 0:E[me],(r=p==null?void 0:p.classNames)==null?void 0:r[me]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:C,"data-styled":!(p.jsx||p.unstyled||b),"data-mounted":G,"data-promise":!!p.promise,"data-swiped":Q,"data-removed":Ae,"data-visible":re,"data-y-position":xt,"data-x-position":_r,"data-index":w,"data-front":oe,"data-swiping":se,"data-dismissible":Ve,"data-type":me,"data-invert":lh,"data-swipe-out":ve,"data-swipe-direction":ee,"data-expanded":!!(S||A&&G),style:{"--index":w,"--toasts-before":w,"--z-index":j.length-w,"--offset":`${Ae?O:Be.current}px`,"--initial-height":A?"auto":`${J}px`,...$,...p.style},onDragEnd:()=>{we(!1),X(null),nt.current=null},onPointerDown:Le=>{ch||!Ve||(K.current=new Date,ye(Be.current),Le.target.setPointerCapture(Le.pointerId),Le.target.tagName!=="BUTTON"&&(we(!0),nt.current={x:Le.clientX,y:Le.clientY}))},onPointerUp:()=>{var Le,rt,ht,sn;if(ve||!Ve)return;nt.current=null;let on=Number(((Le=ue.current)==null?void 0:Le.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),js=Number(((rt=ue.current)==null?void 0:rt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_o=new Date().getTime()-((ht=K.current)==null?void 0:ht.getTime()),an=Z==="x"?on:js,Ss=Math.abs(an)/_o;if(Math.abs(an)>=F4||Ss>.11){ye(Be.current),(sn=p.onDismiss)==null||sn.call(p,p),xe(Z==="x"?on>0?"right":"left":js>0?"down":"up"),ws(),Xe(!0),ae(!1);return}we(!1),X(null)},onPointerMove:Le=>{var rt,ht,sn,on;if(!nt.current||!Ve||((rt=window.getSelection())==null?void 0:rt.toString().length)>0)return;let js=Le.clientY-nt.current.y,_o=Le.clientX-nt.current.x,an=(ht=e.swipeDirections)!=null?ht:$4(B);!Z&&(Math.abs(_o)>1||Math.abs(js)>1)&&X(Math.abs(_o)>Math.abs(js)?"x":"y");let Ss={x:0,y:0};Z==="y"?(an.includes("top")||an.includes("bottom"))&&(an.includes("top")&&js<0||an.includes("bottom")&&js>0)&&(Ss.y=js):Z==="x"&&(an.includes("left")||an.includes("right"))&&(an.includes("left")&&_o<0||an.includes("right")&&_o>0)&&(Ss.x=_o),(Math.abs(Ss.x)>0||Math.abs(Ss.y)>0)&&ae(!0),(sn=ue.current)==null||sn.style.setProperty("--swipe-amount-x",`${Ss.x}px`),(on=ue.current)==null||on.style.setProperty("--swipe-amount-y",`${Ss.y}px`)}},ie&&!p.jsx?U.createElement("button",{"aria-label":q,"data-disabled":ch,"data-close-button":!0,onClick:ch||!Ve?()=>{}:()=>{var Le;ws(),(Le=p.onDismiss)==null||Le.call(p,p)},className:cn(E==null?void 0:E.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(o=I==null?void 0:I.close)!=null?o:N4):null,p.jsx||f.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:U.createElement(U.Fragment,null,me||p.icon||p.promise?U.createElement("div",{"data-icon":"",className:cn(E==null?void 0:E.icon,(a=p==null?void 0:p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||MT():null,p.type!=="loading"?p.icon||(I==null?void 0:I[me])||x4(me):null):null,U.createElement("div",{"data-content":"",className:cn(E==null?void 0:E.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},U.createElement("div",{"data-title":"",className:cn(E==null?void 0:E.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?U.createElement("div",{"data-description":"",className:cn(L,R,E==null?void 0:E.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),f.isValidElement(p.cancel)?p.cancel:p.cancel&&Nu(p.cancel)?U.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||D,onClick:Le=>{var rt,ht;Nu(p.cancel)&&Ve&&((ht=(rt=p.cancel).onClick)==null||ht.call(rt,Le),ws())},className:cn(E==null?void 0:E.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,f.isValidElement(p.action)?p.action:p.action&&Nu(p.action)?U.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||z,onClick:Le=>{var rt,ht;Nu(p.action)&&((ht=(rt=p.action).onClick)==null||ht.call(rt,Le),!Le.defaultPrevented&&ws())},className:cn(E==null?void 0:E.actionButton,(h=p==null?void 0:p.classNames)==null?void 0:h.actionButton)},p.action.label):null))};function eb(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function B4(e,t){let r={};return[e,t].forEach((n,s)=>{let o=s===1,a=o?"--mobile-offset":"--offset",l=o?D4:O4;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${a}-${u}`]=l:r[`${a}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}var U4=f.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:h,duration:m,style:p,visibleToasts:b=M4,toastOptions:g,dir:y=eb(),gap:v=L4,loadingIcon:x,icons:w,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:S}=e,[N,C]=U.useState([]),_=U.useMemo(()=>Array.from(new Set([n].concat(N.filter(F=>F.position).map(F=>F.position)))),[N,n]),[$,D]=U.useState([]),[z,T]=U.useState(!1),[L,M]=U.useState(!1),[B,W]=U.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=U.useRef(null),A=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=U.useRef(null),I=U.useRef(!1),q=U.useCallback(F=>{C(Z=>{var X;return(X=Z.find(ee=>ee.id===F.id))!=null&&X.delete||mr.dismiss(F.id),Z.filter(({id:ee})=>ee!==F.id)})},[]);return U.useEffect(()=>mr.subscribe(F=>{if(F.dismiss){C(Z=>Z.map(X=>X.id===F.id?{...X,delete:!0}:X));return}setTimeout(()=>{rN.flushSync(()=>{C(Z=>{let X=Z.findIndex(ee=>ee.id===F.id);return X!==-1?[...Z.slice(0,X),{...Z[X],...F},...Z.slice(X+1)]:[F,...Z]})})})}),[]),U.useEffect(()=>{if(d!=="system"){W(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:Z})=>{W(Z?"dark":"light")})}catch{F.addListener(({matches:X})=>{try{W(X?"dark":"light")}catch(ee){console.error(ee)}})}},[d]),U.useEffect(()=>{N.length<=1&&T(!1)},[N]),U.useEffect(()=>{let F=Z=>{var X,ee;s.every(xe=>Z[xe]||Z.code===xe)&&(T(!0),(X=H.current)==null||X.focus()),Z.code==="Escape"&&(document.activeElement===H.current||(ee=H.current)!=null&&ee.contains(document.activeElement))&&T(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[s]),U.useEffect(()=>{if(H.current)return()=>{E.current&&(E.current.focus({preventScroll:!0}),E.current=null,I.current=!1)}},[H.current]),U.createElement("section",{ref:t,"aria-label":`${j} ${A}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map((F,Z)=>{var X;let[ee,xe]=F.split("-");return N.length?U.createElement("ol",{key:F,dir:y==="auto"?eb():y,tabIndex:-1,ref:H,className:l,"data-sonner-toaster":!0,"data-theme":B,"data-y-position":ee,"data-lifted":z&&N.length>1&&!o,"data-x-position":xe,style:{"--front-toast-height":`${((X=$[0])==null?void 0:X.height)||0}px`,"--width":`${I4}px`,"--gap":`${v}px`,...p,...B4(c,u)},onBlur:G=>{I.current&&!G.currentTarget.contains(G.relatedTarget)&&(I.current=!1,E.current&&(E.current.focus({preventScroll:!0}),E.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||I.current||(I.current=!0,E.current=G.relatedTarget)},onMouseEnter:()=>T(!0),onMouseMove:()=>T(!0),onMouseLeave:()=>{L||T(!1)},onDragEnd:()=>T(!1),onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||M(!0)},onPointerUp:()=>M(!1)},N.filter(G=>!G.position&&Z===0||G.position===F).map((G,Se)=>{var Ae,Re;return U.createElement(z4,{key:G.id,icons:w,index:Se,toast:G,defaultRichColors:h,duration:(Ae=g==null?void 0:g.duration)!=null?Ae:m,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:b,closeButton:(Re=g==null?void 0:g.closeButton)!=null?Re:a,interacting:L,position:F,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:q,toasts:N.filter(se=>se.position==G.position),heights:$.filter(se=>se.position==G.position),setHeights:D,expandByDefault:o,gap:v,loadingIcon:x,expanded:z,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections})})):null}))});const H4=({...e})=>{const{theme:t="system"}=qN();return i.jsx(U4,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var W4=Wg[" useId ".trim().toString()]||(()=>{}),K4=0;function Cr(e){const[t,r]=f.useState(W4());return zt(()=>{r(n=>n??String(K4++))},[e]),t?`radix-${t}`:""}const q4=["top","right","bottom","left"],fo=Math.min,Ar=Math.max,Md=Math.round,Cu=Math.floor,Fn=e=>({x:e,y:e}),G4={left:"right",right:"left",bottom:"top",top:"bottom"},Q4={start:"end",end:"start"};function Rp(e,t,r){return Ar(e,fo(t,r))}function hs(e,t){return typeof e=="function"?e(t):e}function ms(e){return e.split("-")[0]}function tl(e){return e.split("-")[1]}function Wx(e){return e==="x"?"y":"x"}function Kx(e){return e==="y"?"height":"width"}const Z4=new Set(["top","bottom"]);function On(e){return Z4.has(ms(e))?"y":"x"}function qx(e){return Wx(On(e))}function Y4(e,t,r){r===void 0&&(r=!1);const n=tl(e),s=qx(e),o=Kx(s);let a=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Od(a)),[a,Od(a)]}function X4(e){const t=Od(e);return[Mp(e),t,Mp(t)]}function Mp(e){return e.replace(/start|end/g,t=>Q4[t])}const tb=["left","right"],rb=["right","left"],J4=["top","bottom"],eO=["bottom","top"];function tO(e,t,r){switch(e){case"top":case"bottom":return r?t?rb:tb:t?tb:rb;case"left":case"right":return t?J4:eO;default:return[]}}function rO(e,t,r,n){const s=tl(e);let o=tO(ms(e),r==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Mp)))),o}function Od(e){return e.replace(/left|right|bottom|top/g,t=>G4[t])}function nO(e){return{top:0,right:0,bottom:0,left:0,...e}}function GN(e){return typeof e!="number"?nO(e):{top:e,right:e,bottom:e,left:e}}function Dd(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 nb(e,t,r){let{reference:n,floating:s}=e;const o=On(t),a=qx(t),l=Kx(a),c=ms(t),u=o==="y",d=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,m=n[l]/2-s[l]/2;let p;switch(c){case"top":p={x:d,y:n.y-s.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:h};break;case"left":p={x:n.x-s.width,y:h};break;default:p={x:n.x,y:n.y}}switch(tl(t)){case"start":p[a]-=m*(r&&u?-1:1);break;case"end":p[a]+=m*(r&&u?-1:1);break}return p}const sO=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:h}=nb(u,n,c),m=n,p={},b=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=hs(e,t)||{};if(u==null)return{};const h=GN(d),m={x:r,y:n},p=qx(s),b=Kx(p),g=await a.getDimensions(u),y=p==="y",v=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",j=o.reference[b]+o.reference[p]-m[p]-o.floating[b],S=m[p]-o.reference[p],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let C=N?N[w]:0;(!C||!await(a.isElement==null?void 0:a.isElement(N)))&&(C=l.floating[w]||o.floating[b]);const _=j/2-S/2,$=C/2-g[b]/2-1,D=fo(h[v],$),z=fo(h[x],$),T=D,L=C-g[b]-z,M=C/2-g[b]/2+_,B=Rp(T,M,L),W=!c.arrow&&tl(s)!=null&&M!==B&&o.reference[b]/2-(MM<=0)){var z,T;const M=(((z=o.flip)==null?void 0:z.index)||0)+1,B=C[M];if(B&&(!(h==="alignment"?x!==On(B):!1)||D.every(A=>A.overflows[0]>0&&On(A.placement)===x)))return{data:{index:M,overflows:D},reset:{placement:B}};let W=(T=D.filter(H=>H.overflows[0]<=0).sort((H,A)=>H.overflows[1]-A.overflows[1])[0])==null?void 0:T.placement;if(!W)switch(p){case"bestFit":{var L;const H=(L=D.filter(A=>{if(N){const E=On(A.placement);return E===x||E==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(E=>E>0).reduce((E,I)=>E+I,0)]).sort((A,E)=>A[1]-E[1])[0])==null?void 0:L[0];H&&(W=H);break}case"initialPlacement":W=l;break}if(s!==W)return{reset:{placement:W}}}return{}}}};function sb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ob(e){return q4.some(t=>e[t]>=0)}const aO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=hs(e,t);switch(n){case"referenceHidden":{const o=await xc(t,{...s,elementContext:"reference"}),a=sb(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ob(a)}}}case"escaped":{const o=await xc(t,{...s,altBoundary:!0}),a=sb(o,r.floating);return{data:{escapedOffsets:a,escaped:ob(a)}}}default:return{}}}}},QN=new Set(["left","top"]);async function lO(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=ms(r),l=tl(r),c=On(r)==="y",u=QN.has(a)?-1:1,d=o&&c?-1:1,h=hs(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof b=="number"&&(p=l==="end"?b*-1:b),c?{x:p*d,y:m*u}:{x:m*u,y:p*d}}const cO=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,c=await lO(t,e);return a===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:a}}}}},uO=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:v,y:x}=y;return{x:v,y:x}}},...c}=hs(e,t),u={x:r,y:n},d=await xc(t,c),h=On(ms(s)),m=Wx(h);let p=u[m],b=u[h];if(o){const y=m==="y"?"top":"left",v=m==="y"?"bottom":"right",x=p+d[y],w=p-d[v];p=Rp(x,p,w)}if(a){const y=h==="y"?"top":"left",v=h==="y"?"bottom":"right",x=b+d[y],w=b-d[v];b=Rp(x,b,w)}const g=l.fn({...t,[m]:p,[h]:b});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:o,[h]:a}}}}}},dO=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:c=!0,crossAxis:u=!0}=hs(e,t),d={x:r,y:n},h=On(s),m=Wx(h);let p=d[m],b=d[h];const g=hs(l,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=m==="y"?"height":"width",j=o.reference[m]-o.floating[w]+y.mainAxis,S=o.reference[m]+o.reference[w]-y.mainAxis;pS&&(p=S)}if(u){var v,x;const w=m==="y"?"width":"height",j=QN.has(ms(s)),S=o.reference[h]-o.floating[w]+(j&&((v=a.offset)==null?void 0:v[h])||0)+(j?0:y.crossAxis),N=o.reference[h]+o.reference[w]+(j?0:((x=a.offset)==null?void 0:x[h])||0)-(j?y.crossAxis:0);bN&&(b=N)}return{[m]:p,[h]:b}}}},fO=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:c=()=>{},...u}=hs(e,t),d=await xc(t,u),h=ms(s),m=tl(s),p=On(s)==="y",{width:b,height:g}=o.floating;let y,v;h==="top"||h==="bottom"?(y=h,v=m===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(v=h,y=m==="end"?"top":"bottom");const x=g-d.top-d.bottom,w=b-d.left-d.right,j=fo(g-d[y],x),S=fo(b-d[v],w),N=!t.middlewareData.shift;let C=j,_=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(_=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=x),N&&!m){const D=Ar(d.left,0),z=Ar(d.right,0),T=Ar(d.top,0),L=Ar(d.bottom,0);p?_=b-2*(D!==0||z!==0?D+z:Ar(d.left,d.right)):C=g-2*(T!==0||L!==0?T+L:Ar(d.top,d.bottom))}await c({...t,availableWidth:_,availableHeight:C});const $=await a.getDimensions(l.floating);return b!==$.width||g!==$.height?{reset:{rects:!0}}:{}}}};function _f(){return typeof window<"u"}function rl(e){return ZN(e)?(e.nodeName||"").toLowerCase():"#document"}function Or(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Kn(e){var t;return(t=(ZN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ZN(e){return _f()?e instanceof Node||e instanceof Or(e).Node:!1}function Sn(e){return _f()?e instanceof Element||e instanceof Or(e).Element:!1}function Hn(e){return _f()?e instanceof HTMLElement||e instanceof Or(e).HTMLElement:!1}function ib(e){return!_f()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Or(e).ShadowRoot}const hO=new Set(["inline","contents"]);function Hc(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Nn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!hO.has(s)}const mO=new Set(["table","td","th"]);function pO(e){return mO.has(rl(e))}const gO=[":popover-open",":modal"];function Tf(e){return gO.some(t=>{try{return e.matches(t)}catch{return!1}})}const xO=["transform","translate","scale","rotate","perspective"],vO=["transform","translate","scale","rotate","perspective","filter"],yO=["paint","layout","strict","content"];function Gx(e){const t=Qx(),r=Sn(e)?Nn(e):e;return xO.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)||vO.some(n=>(r.willChange||"").includes(n))||yO.some(n=>(r.contain||"").includes(n))}function bO(e){let t=ho(e);for(;Hn(t)&&!Fa(t);){if(Gx(t))return t;if(Tf(t))return null;t=ho(t)}return null}function Qx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wO=new Set(["html","body","#document"]);function Fa(e){return wO.has(rl(e))}function Nn(e){return Or(e).getComputedStyle(e)}function Pf(e){return Sn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ho(e){if(rl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ib(e)&&e.host||Kn(e);return ib(t)?t.host:t}function YN(e){const t=ho(e);return Fa(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hn(t)&&Hc(t)?t:YN(t)}function vc(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=YN(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=Or(s);if(o){const l=Op(a);return t.concat(a,a.visualViewport||[],Hc(s)?s:[],l&&r?vc(l):[])}return t.concat(s,vc(s,[],r))}function Op(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function XN(e){const t=Nn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Hn(e),o=s?e.offsetWidth:r,a=s?e.offsetHeight:n,l=Md(r)!==o||Md(n)!==a;return l&&(r=o,n=a),{width:r,height:n,$:l}}function Zx(e){return Sn(e)?e:e.contextElement}function da(e){const t=Zx(e);if(!Hn(t))return Fn(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=XN(t);let a=(o?Md(r.width):r.width)/n,l=(o?Md(r.height):r.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const jO=Fn(0);function JN(e){const t=Or(e);return!Qx()||!t.visualViewport?jO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function SO(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Or(e)?!1:t}function li(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Zx(e);let a=Fn(1);t&&(n?Sn(n)&&(a=da(n)):a=da(e));const l=SO(o,r,n)?JN(o):Fn(0);let c=(s.left+l.x)/a.x,u=(s.top+l.y)/a.y,d=s.width/a.x,h=s.height/a.y;if(o){const m=Or(o),p=n&&Sn(n)?Or(n):n;let b=m,g=Op(b);for(;g&&n&&p!==b;){const y=da(g),v=g.getBoundingClientRect(),x=Nn(g),w=v.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,j=v.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,h*=y.y,c+=w,u+=j,b=Or(g),g=Op(b)}}return Dd({width:d,height:h,x:c,y:u})}function Yx(e,t){const r=Pf(e).scrollLeft;return t?t.left+r:li(Kn(e)).left+r}function eC(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(r?0:Yx(e,n)),o=n.top+t.scrollTop;return{x:s,y:o}}function NO(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",a=Kn(n),l=t?Tf(t.floating):!1;if(n===a||l&&o)return r;let c={scrollLeft:0,scrollTop:0},u=Fn(1);const d=Fn(0),h=Hn(n);if((h||!h&&!o)&&((rl(n)!=="body"||Hc(a))&&(c=Pf(n)),Hn(n))){const p=li(n);u=da(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const m=a&&!h&&!o?eC(a,c,!0):Fn(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+m.x,y:r.y*u.y-c.scrollTop*u.y+d.y+m.y}}function CO(e){return Array.from(e.getClientRects())}function kO(e){const t=Kn(e),r=Pf(e),n=e.ownerDocument.body,s=Ar(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Ar(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Yx(e);const l=-r.scrollTop;return Nn(n).direction==="rtl"&&(a+=Ar(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:a,y:l}}function EO(e,t){const r=Or(e),n=Kn(e),s=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,l=0,c=0;if(s){o=s.width,a=s.height;const u=Qx();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:o,height:a,x:l,y:c}}const _O=new Set(["absolute","fixed"]);function TO(e,t){const r=li(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=Hn(e)?da(e):Fn(1),a=e.clientWidth*o.x,l=e.clientHeight*o.y,c=s*o.x,u=n*o.y;return{width:a,height:l,x:c,y:u}}function ab(e,t,r){let n;if(t==="viewport")n=EO(e,r);else if(t==="document")n=kO(Kn(e));else if(Sn(t))n=TO(t,r);else{const s=JN(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Dd(n)}function tC(e,t){const r=ho(e);return r===t||!Sn(r)||Fa(r)?!1:Nn(r).position==="fixed"||tC(r,t)}function PO(e,t){const r=t.get(e);if(r)return r;let n=vc(e,[],!1).filter(l=>Sn(l)&&rl(l)!=="body"),s=null;const o=Nn(e).position==="fixed";let a=o?ho(e):e;for(;Sn(a)&&!Fa(a);){const l=Nn(a),c=Gx(a);!c&&l.position==="fixed"&&(s=null),(o?!c&&!s:!c&&l.position==="static"&&!!s&&_O.has(s.position)||Hc(a)&&!c&&tC(e,a))?n=n.filter(d=>d!==a):s=l,a=ho(a)}return t.set(e,n),n}function AO(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const a=[...r==="clippingAncestors"?Tf(t)?[]:PO(t,this._c):[].concat(r),n],l=a[0],c=a.reduce((u,d)=>{const h=ab(t,d,s);return u.top=Ar(h.top,u.top),u.right=fo(h.right,u.right),u.bottom=fo(h.bottom,u.bottom),u.left=Ar(h.left,u.left),u},ab(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function RO(e){const{width:t,height:r}=XN(e);return{width:t,height:r}}function MO(e,t,r){const n=Hn(t),s=Kn(t),o=r==="fixed",a=li(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const c=Fn(0);function u(){c.x=Yx(s)}if(n||!n&&!o)if((rl(t)!=="body"||Hc(s))&&(l=Pf(t)),n){const p=li(t,!0,o,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else s&&u();o&&!n&&s&&u();const d=s&&!n&&!o?eC(s,l):Fn(0),h=a.left+l.scrollLeft-c.x-d.x,m=a.top+l.scrollTop-c.y-d.y;return{x:h,y:m,width:a.width,height:a.height}}function zh(e){return Nn(e).position==="static"}function lb(e,t){if(!Hn(e)||Nn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Kn(e)===r&&(r=r.ownerDocument.body),r}function rC(e,t){const r=Or(e);if(Tf(e))return r;if(!Hn(e)){let s=ho(e);for(;s&&!Fa(s);){if(Sn(s)&&!zh(s))return s;s=ho(s)}return r}let n=lb(e,t);for(;n&&pO(n)&&zh(n);)n=lb(n,t);return n&&Fa(n)&&zh(n)&&!Gx(n)?r:n||bO(e)||r}const OO=async function(e){const t=this.getOffsetParent||rC,r=this.getDimensions,n=await r(e.floating);return{reference:MO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function DO(e){return Nn(e).direction==="rtl"}const IO={convertOffsetParentRelativeRectToViewportRelativeRect:NO,getDocumentElement:Kn,getClippingRect:AO,getOffsetParent:rC,getElementRects:OO,getClientRects:CO,getDimensions:RO,getScale:da,isElement:Sn,isRTL:DO};function nC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function LO(e,t){let r=null,n;const s=Kn(e);function o(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const u=e.getBoundingClientRect(),{left:d,top:h,width:m,height:p}=u;if(l||t(),!m||!p)return;const b=Cu(h),g=Cu(s.clientWidth-(d+m)),y=Cu(s.clientHeight-(h+p)),v=Cu(d),w={rootMargin:-b+"px "+-g+"px "+-y+"px "+-v+"px",threshold:Ar(0,fo(1,c))||1};let j=!0;function S(N){const C=N[0].intersectionRatio;if(C!==c){if(!j)return a();C?a(!1,C):n=setTimeout(()=>{a(!1,1e-7)},1e3)}C===1&&!nC(u,e.getBoundingClientRect())&&a(),j=!1}try{r=new IntersectionObserver(S,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,w)}r.observe(e)}return a(!0),o}function FO(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:c=!1}=n,u=Zx(e),d=s||o?[...u?vc(u):[],...vc(t)]:[];d.forEach(v=>{s&&v.addEventListener("scroll",r,{passive:!0}),o&&v.addEventListener("resize",r)});const h=u&&l?LO(u,r):null;let m=-1,p=null;a&&(p=new ResizeObserver(v=>{let[x]=v;x&&x.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),r()}),u&&!c&&p.observe(u),p.observe(t));let b,g=c?li(e):null;c&&y();function y(){const v=li(e);g&&!nC(g,v)&&r(),g=v,b=requestAnimationFrame(y)}return r(),()=>{var v;d.forEach(x=>{s&&x.removeEventListener("scroll",r),o&&x.removeEventListener("resize",r)}),h==null||h(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(b)}}const VO=cO,$O=uO,zO=iO,BO=fO,UO=aO,cb=oO,HO=dO,WO=(e,t,r)=>{const n=new Map,s={platform:IO,...r},o={...s.platform,_c:n};return sO(e,t,{...s,platform:o})};var KO=typeof document<"u",qO=function(){},Xu=KO?f.useLayoutEffect:qO;function Id(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(!Id(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)&&!Id(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function sC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ub(e,t){const r=sC(e);return Math.round(t*r)/r}function Bh(e){const t=f.useRef(e);return Xu(()=>{t.current=e}),t}function GO(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:c,open:u}=e,[d,h]=f.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=f.useState(n);Id(m,n)||p(n);const[b,g]=f.useState(null),[y,v]=f.useState(null),x=f.useCallback(A=>{A!==N.current&&(N.current=A,g(A))},[]),w=f.useCallback(A=>{A!==C.current&&(C.current=A,v(A))},[]),j=o||b,S=a||y,N=f.useRef(null),C=f.useRef(null),_=f.useRef(d),$=c!=null,D=Bh(c),z=Bh(s),T=Bh(u),L=f.useCallback(()=>{if(!N.current||!C.current)return;const A={placement:t,strategy:r,middleware:m};z.current&&(A.platform=z.current),WO(N.current,C.current,A).then(E=>{const I={...E,isPositioned:T.current!==!1};M.current&&!Id(_.current,I)&&(_.current=I,bi.flushSync(()=>{h(I)}))})},[m,t,r,z,T]);Xu(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,h(A=>({...A,isPositioned:!1})))},[u]);const M=f.useRef(!1);Xu(()=>(M.current=!0,()=>{M.current=!1}),[]),Xu(()=>{if(j&&(N.current=j),S&&(C.current=S),j&&S){if(D.current)return D.current(j,S,L);L()}},[j,S,L,D,$]);const B=f.useMemo(()=>({reference:N,floating:C,setReference:x,setFloating:w}),[x,w]),W=f.useMemo(()=>({reference:j,floating:S}),[j,S]),H=f.useMemo(()=>{const A={position:r,left:0,top:0};if(!W.floating)return A;const E=ub(W.floating,d.x),I=ub(W.floating,d.y);return l?{...A,transform:"translate("+E+"px, "+I+"px)",...sC(W.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:E,top:I}},[r,l,W.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:L,refs:B,elements:W,floatingStyles:H}),[d,L,B,W,H])}const QO=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?cb({element:n.current,padding:s}).fn(r):{}:n?cb({element:n,padding:s}).fn(r):{}}}},ZO=(e,t)=>({...VO(e),options:[e,t]}),YO=(e,t)=>({...$O(e),options:[e,t]}),XO=(e,t)=>({...HO(e),options:[e,t]}),JO=(e,t)=>({...zO(e),options:[e,t]}),e5=(e,t)=>({...BO(e),options:[e,t]}),t5=(e,t)=>({...UO(e),options:[e,t]}),r5=(e,t)=>({...QO(e),options:[e,t]});var n5="Arrow",oC=f.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return i.jsx(Te.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"})})});oC.displayName=n5;var s5=oC;function Xx(e){const[t,r]=f.useState(void 0);return zt(()=>{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 c=o.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.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}var Jx="Popper",[iC,nl]=Wn(Jx),[o5,aC]=iC(Jx),lC=e=>{const{__scopePopper:t,children:r}=e,[n,s]=f.useState(null);return i.jsx(o5,{scope:t,anchor:n,onAnchorChange:s,children:r})};lC.displayName=Jx;var cC="PopperAnchor",uC=f.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=aC(cC,r),a=f.useRef(null),l=ze(t,a);return f.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:i.jsx(Te.div,{...s,ref:l})});uC.displayName=cC;var ev="PopperContent",[i5,a5]=iC(ev),dC=f.forwardRef((e,t)=>{var G,Se,Ae,Re,se,we;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:b,...g}=e,y=aC(ev,r),[v,x]=f.useState(null),w=ze(t,ve=>x(ve)),[j,S]=f.useState(null),N=Xx(j),C=(N==null?void 0:N.width)??0,_=(N==null?void 0:N.height)??0,$=n+(o!=="center"?"-"+o:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},z=Array.isArray(u)?u:[u],T=z.length>0,L={padding:D,boundary:z.filter(c5),altBoundary:T},{refs:M,floatingStyles:B,placement:W,isPositioned:H,middlewareData:A}=GO({strategy:"fixed",placement:$,whileElementsMounted:(...ve)=>FO(...ve,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[ZO({mainAxis:s+_,alignmentAxis:a}),c&&YO({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?XO():void 0,...L}),c&&JO({...L}),e5({...L,apply:({elements:ve,rects:Xe,availableWidth:Q,availableHeight:ae})=>{const{width:O,height:ye}=Xe.reference,J=ve.floating.style;J.setProperty("--radix-popper-available-width",`${Q}px`),J.setProperty("--radix-popper-available-height",`${ae}px`),J.setProperty("--radix-popper-anchor-width",`${O}px`),J.setProperty("--radix-popper-anchor-height",`${ye}px`)}}),j&&r5({element:j,padding:l}),u5({arrowWidth:C,arrowHeight:_}),m&&t5({strategy:"referenceHidden",...L})]}),[E,I]=mC(W),q=Vt(b);zt(()=>{H&&(q==null||q())},[H,q]);const F=(G=A.arrow)==null?void 0:G.x,Z=(Se=A.arrow)==null?void 0:Se.y,X=((Ae=A.arrow)==null?void 0:Ae.centerOffset)!==0,[ee,xe]=f.useState();return zt(()=>{v&&xe(window.getComputedStyle(v).zIndex)},[v]),i.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:H?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(Re=A.transformOrigin)==null?void 0:Re.x,(se=A.transformOrigin)==null?void 0:se.y].join(" "),...((we=A.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(i5,{scope:r,placedSide:E,onArrowChange:S,arrowX:F,arrowY:Z,shouldHideArrow:X,children:i.jsx(Te.div,{"data-side":E,"data-align":I,...g,ref:w,style:{...g.style,animation:H?void 0:"none"}})})})});dC.displayName=ev;var fC="PopperArrow",l5={top:"bottom",right:"left",bottom:"top",left:"right"},hC=f.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=a5(fC,n),a=l5[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(s5,{...s,ref:r,style:{...s.style,display:"block"}})})});hC.displayName=fC;function c5(e){return e!==null}var u5=e=>({name:"transformOrigin",options:e,fn(t){var y,v,x;const{placement:r,rects:n,middlewareData:s}=t,a=((y=s.arrow)==null?void 0:y.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,d]=mC(r),h={start:"0%",center:"50%",end:"100%"}[d],m=(((v=s.arrow)==null?void 0:v.x)??0)+l/2,p=(((x=s.arrow)==null?void 0:x.y)??0)+c/2;let b="",g="";return u==="bottom"?(b=a?h:`${m}px`,g=`${-c}px`):u==="top"?(b=a?h:`${m}px`,g=`${n.floating.height+c}px`):u==="right"?(b=`${-c}px`,g=a?h:`${p}px`):u==="left"&&(b=`${n.floating.width+c}px`,g=a?h:`${p}px`),{data:{x:b,y:g}}}});function mC(e){const[t,r="center"]=e.split("-");return[t,r]}var tv=lC,Af=uC,rv=dC,nv=hC,[Rf,AB]=Wn("Tooltip",[nl]),Mf=nl(),pC="TooltipProvider",d5=700,Dp="tooltip.open",[f5,sv]=Rf(pC),gC=e=>{const{__scopeTooltip:t,delayDuration:r=d5,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,a=f.useRef(!0),l=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),i.jsx(f5,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:f.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:f.useCallback(u=>{l.current=u},[]),disableHoverableContent:s,children:o})};gC.displayName=pC;var yc="Tooltip",[h5,Of]=Rf(yc),xC=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:o,disableHoverableContent:a,delayDuration:l}=e,c=sv(yc,e.__scopeTooltip),u=Mf(t),[d,h]=f.useState(null),m=Cr(),p=f.useRef(0),b=a??c.disableHoverableContent,g=l??c.delayDuration,y=f.useRef(!1),[v,x]=uo({prop:n,defaultProp:s??!1,onChange:C=>{C?(c.onOpen(),document.dispatchEvent(new CustomEvent(Dp))):c.onClose(),o==null||o(C)},caller:yc}),w=f.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),j=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,x(!0)},[x]),S=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),N=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,x(!0),p.current=0},g)},[g,x]);return f.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),i.jsx(tv,{...u,children:i.jsx(h5,{scope:t,contentId:m,open:v,stateAttribute:w,trigger:d,onTriggerChange:h,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayedRef.current?N():j()},[c.isOpenDelayedRef,N,j]),onTriggerLeave:f.useCallback(()=>{b?S():(window.clearTimeout(p.current),p.current=0)},[S,b]),onOpen:j,onClose:S,disableHoverableContent:b,children:r})})};xC.displayName=yc;var Ip="TooltipTrigger",vC=f.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Of(Ip,r),o=sv(Ip,r),a=Mf(r),l=f.useRef(null),c=ze(t,l,s.onTriggerChange),u=f.useRef(!1),d=f.useRef(!1),h=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),i.jsx(Af,{asChild:!0,...a,children:i.jsx(Te.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:ke(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ke(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:ke(e.onBlur,s.onClose),onClick:ke(e.onClick,s.onClose)})})});vC.displayName=Ip;var m5="TooltipPortal",[RB,p5]=Rf(m5,{forceMount:void 0}),Va="TooltipContent",yC=f.forwardRef((e,t)=>{const r=p5(Va,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,a=Of(Va,e.__scopeTooltip);return i.jsx($r,{present:n||a.open,children:a.disableHoverableContent?i.jsx(bC,{side:s,...o,ref:t}):i.jsx(g5,{side:s,...o,ref:t})})}),g5=f.forwardRef((e,t)=>{const r=Of(Va,e.__scopeTooltip),n=sv(Va,e.__scopeTooltip),s=f.useRef(null),o=ze(t,s),[a,l]=f.useState(null),{trigger:c,onClose:u}=r,d=s.current,{onPointerInTransitChange:h}=n,m=f.useCallback(()=>{l(null),h(!1)},[h]),p=f.useCallback((b,g)=>{const y=b.currentTarget,v={x:b.clientX,y:b.clientY},x=w5(v,y.getBoundingClientRect()),w=j5(v,x),j=S5(g.getBoundingClientRect()),S=C5([...w,...j]);l(S),h(!0)},[h]);return f.useEffect(()=>()=>m(),[m]),f.useEffect(()=>{if(c&&d){const b=y=>p(y,d),g=y=>p(y,c);return c.addEventListener("pointerleave",b),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",b),d.removeEventListener("pointerleave",g)}}},[c,d,p,m]),f.useEffect(()=>{if(a){const b=g=>{const y=g.target,v={x:g.clientX,y:g.clientY},x=(c==null?void 0:c.contains(y))||(d==null?void 0:d.contains(y)),w=!N5(v,a);x?m():w&&(m(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,d,a,u,m]),i.jsx(bC,{...e,ref:o})}),[x5,v5]=Rf(yc,{isInside:!1}),y5=hR("TooltipContent"),bC=f.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:a,...l}=e,c=Of(Va,r),u=Mf(r),{onClose:d}=c;return f.useEffect(()=>(document.addEventListener(Dp,d),()=>document.removeEventListener(Dp,d)),[d]),f.useEffect(()=>{if(c.trigger){const h=m=>{const p=m.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),i.jsx(Xa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:i.jsxs(rv,{"data-state":c.stateAttribute,...u,...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(y5,{children:n}),i.jsx(x5,{scope:r,isInside:!0,children:i.jsx(DR,{id:c.contentId,role:"tooltip",children:s||n})})]})})});yC.displayName=Va;var wC="TooltipArrow",b5=f.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Mf(r);return v5(wC,r).isInside?null:i.jsx(nv,{...s,...n,ref:t})});b5.displayName=wC;function w5(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 j5(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 S5(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 N5(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,a=t.length-1;on!=m>n&&r<(h-u)*(n-d)/(m-d)+u&&(s=!s)}return s}function C5(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),k5(t)}function k5(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=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 E5=gC,_5=xC,T5=vC,jC=yC;const SC=E5,NC=_5,CC=T5,ov=f.forwardRef(({className:e,sideOffset:t=4,...r},n)=>i.jsx(jC,{ref:n,sideOffset:t,className:he("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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",e),...r}));ov.displayName=jC.displayName;var sl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ci=typeof window>"u"||"Deno"in globalThis;function sr(){}function P5(e,t){return typeof e=="function"?e(t):e}function Lp(e){return typeof e=="number"&&e>=0&&e!==1/0}function kC(e,t){return Math.max(e+(t||0)-Date.now(),0)}function no(e,t){return typeof e=="function"?e(t):e}function Hr(e,t){return typeof e=="function"?e(t):e}function db(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:a,stale:l}=e;if(a){if(n){if(t.queryHash!==iv(a,t.options))return!1}else if(!bc(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||o&&!o(t))}function fb(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(ui(t.options.mutationKey)!==ui(o))return!1}else if(!bc(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function iv(e,t){return((t==null?void 0:t.queryKeyHashFn)||ui)(e)}function ui(e){return JSON.stringify(e,(t,r)=>Fp(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function bc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>bc(e[r],t[r])):!1}function EC(e,t){if(e===t)return e;const r=hb(e)&&hb(t);if(r||Fp(e)&&Fp(t)){const n=r?e:Object.keys(e),s=n.length,o=r?t:Object.keys(t),a=o.length,l=r?[]:{},c=new Set(n);let u=0;for(let d=0;d{setTimeout(t,e)})}function Vp(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?EC(e,t):t}function R5(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function M5(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var av=Symbol();function _C(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===av?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function TC(e,t){return typeof e=="function"?e(...t):!!e}var $o,Is,ga,M1,O5=(M1=class extends sl{constructor(){super();Pe(this,$o);Pe(this,Is);Pe(this,ga);pe(this,ga,t=>{if(!ci&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){P(this,Is)||this.setEventListener(P(this,ga))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Is))==null||t.call(this),pe(this,Is,void 0))}setEventListener(t){var r;pe(this,ga,t),(r=P(this,Is))==null||r.call(this),pe(this,Is,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){P(this,$o)!==t&&(pe(this,$o,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof P(this,$o)=="boolean"?P(this,$o):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$o=new WeakMap,Is=new WeakMap,ga=new WeakMap,M1),lv=new O5,xa,Ls,va,O1,D5=(O1=class extends sl{constructor(){super();Pe(this,xa,!0);Pe(this,Ls);Pe(this,va);pe(this,va,t=>{if(!ci&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){P(this,Ls)||this.setEventListener(P(this,va))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Ls))==null||t.call(this),pe(this,Ls,void 0))}setEventListener(t){var r;pe(this,va,t),(r=P(this,Ls))==null||r.call(this),pe(this,Ls,t(this.setOnline.bind(this)))}setOnline(t){P(this,xa)!==t&&(pe(this,xa,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return P(this,xa)}},xa=new WeakMap,Ls=new WeakMap,va=new WeakMap,O1),Fd=new D5;function $p(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function I5(e){return Math.min(1e3*2**e,3e4)}function PC(e){return(e??"online")==="online"?Fd.isOnline():!0}var AC=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Uh(e){return e instanceof AC}function RC(e){let t=!1,r=0,n=!1,s;const o=$p(),a=g=>{var y;n||(m(new AC(g)),(y=e.abort)==null||y.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>lv.isFocused()&&(e.networkMode==="always"||Fd.isOnline())&&e.canRun(),d=()=>PC(e.networkMode)&&e.canRun(),h=g=>{var y;n||(n=!0,(y=e.onSuccess)==null||y.call(e,g),s==null||s(),o.resolve(g))},m=g=>{var y;n||(n=!0,(y=e.onError)==null||y.call(e,g),s==null||s(),o.reject(g))},p=()=>new Promise(g=>{var y;s=v=>{(n||u())&&g(v)},(y=e.onPause)==null||y.call(e)}).then(()=>{var g;s=void 0,n||(g=e.onContinue)==null||g.call(e)}),b=()=>{if(n)return;let g;const y=r===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(h).catch(v=>{var N;if(n)return;const x=e.retry??(ci?0:3),w=e.retryDelay??I5,j=typeof w=="function"?w(r,v):w,S=x===!0||typeof x=="number"&&ru()?void 0:p()).then(()=>{t?m(v):b()})})};return{promise:o,cancel:a,continue:()=>(s==null||s(),o),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?b():p().then(b),o)}}var L5=e=>setTimeout(e,0);function F5(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=L5;const o=l=>{t?e.push(l):s(()=>{r(l)})},a=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||a()}return c},batchCalls:l=>(...c)=>{o(()=>{l(...c)})},schedule:o,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var It=F5(),zo,D1,MC=(D1=class{constructor(){Pe(this,zo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Lp(this.gcTime)&&pe(this,zo,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ci?1/0:5*60*1e3))}clearGcTimeout(){P(this,zo)&&(clearTimeout(P(this,zo)),pe(this,zo,void 0))}},zo=new WeakMap,D1),ya,Bo,Ur,Uo,Zt,Rc,Ho,pn,Yn,I1,V5=(I1=class extends MC{constructor(t){super();Pe(this,pn);Pe(this,ya);Pe(this,Bo);Pe(this,Ur);Pe(this,Uo);Pe(this,Zt);Pe(this,Rc);Pe(this,Ho);pe(this,Ho,!1),pe(this,Rc,t.defaultOptions),this.setOptions(t.options),this.observers=[],pe(this,Uo,t.client),pe(this,Ur,P(this,Uo).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,pe(this,ya,$5(this.options)),this.state=t.state??P(this,ya),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,Zt))==null?void 0:t.promise}setOptions(t){this.options={...P(this,Rc),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,Ur).remove(this)}setData(t,r){const n=Vp(this.state.data,t,this.options);return Ue(this,pn,Yn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Ue(this,pn,Yn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=P(this,Zt))==null?void 0:n.promise;return(s=P(this,Zt))==null||s.cancel(t),r?r.then(sr).catch(sr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,ya))}isActive(){return this.observers.some(t=>Hr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===av||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>no(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!kC(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Zt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Zt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,Ur).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(P(this,Zt)&&(P(this,Ho)?P(this,Zt).cancel({revert:!0}):P(this,Zt).cancelRetry()),this.scheduleGc()),P(this,Ur).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ue(this,pn,Yn).call(this,{type:"invalidate"})}fetch(t,r){var u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(P(this,Zt))return P(this,Zt).continueRetry(),P(this,Zt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const n=new AbortController,s=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(pe(this,Ho,!0),n.signal)})},o=()=>{const m=_C(this.options,r),b=(()=>{const g={client:P(this,Uo),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return pe(this,Ho,!1),this.options.persister?this.options.persister(m,b,this):m(b)},l=(()=>{const m={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:P(this,Uo),state:this.state,fetchFn:o};return s(m),m})();(u=this.options.behavior)==null||u.onFetch(l,this),pe(this,Bo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Ue(this,pn,Yn).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta});const c=m=>{var p,b,g,y;Uh(m)&&m.silent||Ue(this,pn,Yn).call(this,{type:"error",error:m}),Uh(m)||((b=(p=P(this,Ur).config).onError)==null||b.call(p,m,this),(y=(g=P(this,Ur).config).onSettled)==null||y.call(g,this.state.data,m,this)),this.scheduleGc()};return pe(this,Zt,RC({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:m=>{var p,b,g,y;if(m===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(v){c(v);return}(b=(p=P(this,Ur).config).onSuccess)==null||b.call(p,m,this),(y=(g=P(this,Ur).config).onSettled)==null||y.call(g,m,this.state.error,this),this.scheduleGc()},onError:c,onFail:(m,p)=>{Ue(this,pn,Yn).call(this,{type:"failed",failureCount:m,error:p})},onPause:()=>{Ue(this,pn,Yn).call(this,{type:"pause"})},onContinue:()=>{Ue(this,pn,Yn).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),P(this,Zt).start()}},ya=new WeakMap,Bo=new WeakMap,Ur=new WeakMap,Uo=new WeakMap,Zt=new WeakMap,Rc=new WeakMap,Ho=new WeakMap,pn=new WeakSet,Yn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...OC(n.data,this.options),fetchMeta:t.meta??null};case"success":return pe(this,Bo,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Uh(s)&&s.revert&&P(this,Bo)?{...P(this,Bo),fetchStatus:"idle"}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),It.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),P(this,Ur).notify({query:this,type:"updated",action:t})})},I1);function OC(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:PC(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $5(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Tn,L1,z5=(L1=class extends sl{constructor(t={}){super();Pe(this,Tn);this.config=t,pe(this,Tn,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??iv(s,r);let a=this.get(o);return a||(a=new V5({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){P(this,Tn).has(t.queryHash)||(P(this,Tn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=P(this,Tn).get(t.queryHash);r&&(t.destroy(),r===t&&P(this,Tn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){It.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,Tn).get(t)}getAll(){return[...P(this,Tn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>db(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>db(t,n)):r}notify(t){It.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){It.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){It.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Tn=new WeakMap,L1),Pn,er,Wo,An,_s,F1,B5=(F1=class extends MC{constructor(t){super();Pe(this,An);Pe(this,Pn);Pe(this,er);Pe(this,Wo);this.mutationId=t.mutationId,pe(this,er,t.mutationCache),pe(this,Pn,[]),this.state=t.state||DC(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,Pn).includes(t)||(P(this,Pn).push(t),this.clearGcTimeout(),P(this,er).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){pe(this,Pn,P(this,Pn).filter(r=>r!==t)),this.scheduleGc(),P(this,er).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,Pn).length||(this.state.status==="pending"?this.scheduleGc():P(this,er).remove(this))}continue(){var t;return((t=P(this,Wo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,l,c,u,d,h,m,p,b,g,y,v,x,w,j,S,N,C,_;const r=()=>{Ue(this,An,_s).call(this,{type:"continue"})};pe(this,Wo,RC({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:($,D)=>{Ue(this,An,_s).call(this,{type:"failed",failureCount:$,error:D})},onPause:()=>{Ue(this,An,_s).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,er).canRun(this)}));const n=this.state.status==="pending",s=!P(this,Wo).canStart();try{if(n)r();else{Ue(this,An,_s).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(o=P(this,er).config).onMutate)==null?void 0:a.call(o,t,this));const D=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));D!==this.state.context&&Ue(this,An,_s).call(this,{type:"pending",context:D,variables:t,isPaused:s})}const $=await P(this,Wo).start();return await((d=(u=P(this,er).config).onSuccess)==null?void 0:d.call(u,$,t,this.state.context,this)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,$,t,this.state.context)),await((b=(p=P(this,er).config).onSettled)==null?void 0:b.call(p,$,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,$,null,t,this.state.context)),Ue(this,An,_s).call(this,{type:"success",data:$}),$}catch($){try{throw await((x=(v=P(this,er).config).onError)==null?void 0:x.call(v,$,t,this.state.context,this)),await((j=(w=this.options).onError)==null?void 0:j.call(w,$,t,this.state.context)),await((N=(S=P(this,er).config).onSettled)==null?void 0:N.call(S,void 0,$,this.state.variables,this.state.context,this)),await((_=(C=this.options).onSettled)==null?void 0:_.call(C,void 0,$,t,this.state.context)),$}finally{Ue(this,An,_s).call(this,{type:"error",error:$})}}finally{P(this,er).runNext(this)}}},Pn=new WeakMap,er=new WeakMap,Wo=new WeakMap,An=new WeakSet,_s=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),It.batch(()=>{P(this,Pn).forEach(n=>{n.onMutationUpdate(t)}),P(this,er).notify({mutation:this,type:"updated",action:t})})},F1);function DC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var es,gn,Mc,V1,U5=(V1=class extends sl{constructor(t={}){super();Pe(this,es);Pe(this,gn);Pe(this,Mc);this.config=t,pe(this,es,new Set),pe(this,gn,new Map),pe(this,Mc,0)}build(t,r,n){const s=new B5({mutationCache:this,mutationId:++nu(this,Mc)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){P(this,es).add(t);const r=ku(t);if(typeof r=="string"){const n=P(this,gn).get(r);n?n.push(t):P(this,gn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,es).delete(t)){const r=ku(t);if(typeof r=="string"){const n=P(this,gn).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&P(this,gn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=ku(t);if(typeof r=="string"){const n=P(this,gn).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=ku(t);if(typeof r=="string"){const s=(n=P(this,gn).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){It.batch(()=>{P(this,es).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,es).clear(),P(this,gn).clear()})}getAll(){return Array.from(P(this,es))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>fb(r,n))}findAll(t={}){return this.getAll().filter(r=>fb(t,r))}notify(t){It.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return It.batch(()=>Promise.all(t.map(r=>r.continue().catch(sr))))}},es=new WeakMap,gn=new WeakMap,Mc=new WeakMap,V1);function ku(e){var t;return(t=e.options.scope)==null?void 0:t.id}function pb(e){return{onFetch:(t,r)=>{var d,h,m,p,b;const n=t.options,s=(m=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=_C(t.options,t.fetchOptions),x=async(w,j,S)=>{if(g)return Promise.reject();if(j==null&&w.pages.length)return Promise.resolve(w);const C=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:j,direction:S?"backward":"forward",meta:t.options.meta};return y(z),z})(),_=await v(C),{maxPages:$}=t.options,D=S?M5:R5;return{pages:D(w.pages,_,$),pageParams:D(w.pageParams,j,$)}};if(s&&o.length){const w=s==="backward",j=w?H5:gb,S={pages:o,pageParams:a},N=j(n,S);l=await x(S,N,w)}else{const w=e??o.length;do{const j=c===0?a[0]??n.initialPageParam:gb(n,l);if(c>0&&j==null)break;l=await x(l,j),c++}while(c{var g,y;return(y=(g=t.options).persister)==null?void 0:y.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function gb(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function H5(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var St,Fs,Vs,ba,wa,$s,ja,Sa,$1,W5=($1=class{constructor(e={}){Pe(this,St);Pe(this,Fs);Pe(this,Vs);Pe(this,ba);Pe(this,wa);Pe(this,$s);Pe(this,ja);Pe(this,Sa);pe(this,St,e.queryCache||new z5),pe(this,Fs,e.mutationCache||new U5),pe(this,Vs,e.defaultOptions||{}),pe(this,ba,new Map),pe(this,wa,new Map),pe(this,$s,0)}mount(){nu(this,$s)._++,P(this,$s)===1&&(pe(this,ja,lv.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,St).onFocus())})),pe(this,Sa,Fd.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,St).onOnline())})))}unmount(){var e,t;nu(this,$s)._--,P(this,$s)===0&&((e=P(this,ja))==null||e.call(this),pe(this,ja,void 0),(t=P(this,Sa))==null||t.call(this),pe(this,Sa,void 0))}isFetching(e){return P(this,St).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,Fs).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=P(this,St).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=P(this,St).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(no(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return P(this,St).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=P(this,St).get(n.queryHash),o=s==null?void 0:s.state.data,a=P5(t,o);if(a!==void 0)return P(this,St).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return It.batch(()=>P(this,St).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=P(this,St).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=P(this,St);It.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=P(this,St);return It.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=It.batch(()=>P(this,St).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(sr).catch(sr)}invalidateQueries(e,t={}){return It.batch(()=>(P(this,St).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=It.batch(()=>P(this,St).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(sr)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(sr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=P(this,St).build(this,t);return r.isStaleByTime(no(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(sr).catch(sr)}fetchInfiniteQuery(e){return e.behavior=pb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(sr).catch(sr)}ensureInfiniteQueryData(e){return e.behavior=pb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Fd.isOnline()?P(this,Fs).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,St)}getMutationCache(){return P(this,Fs)}getDefaultOptions(){return P(this,Vs)}setDefaultOptions(e){pe(this,Vs,e)}setQueryDefaults(e,t){P(this,ba).set(ui(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,ba).values()],r={};return t.forEach(n=>{bc(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){P(this,wa).set(ui(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,wa).values()],r={};return t.forEach(n=>{bc(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Vs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=iv(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===av&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,Vs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,St).clear(),P(this,Fs).clear()}},St=new WeakMap,Fs=new WeakMap,Vs=new WeakMap,ba=new WeakMap,wa=new WeakMap,$s=new WeakMap,ja=new WeakMap,Sa=new WeakMap,$1),fr,qe,Oc,tr,Ko,Na,zs,Bs,Dc,Ca,ka,qo,Go,Us,Ea,et,Rl,zp,Bp,Up,Hp,Wp,Kp,qp,IC,z1,K5=(z1=class extends sl{constructor(t,r){super();Pe(this,et);Pe(this,fr);Pe(this,qe);Pe(this,Oc);Pe(this,tr);Pe(this,Ko);Pe(this,Na);Pe(this,zs);Pe(this,Bs);Pe(this,Dc);Pe(this,Ca);Pe(this,ka);Pe(this,qo);Pe(this,Go);Pe(this,Us);Pe(this,Ea,new Set);this.options=r,pe(this,fr,t),pe(this,Bs,null),pe(this,zs,$p()),this.options.experimental_prefetchInRender||P(this,zs).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,qe).addObserver(this),xb(P(this,qe),this.options)?Ue(this,et,Rl).call(this):this.updateResult(),Ue(this,et,Hp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gp(P(this,qe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gp(P(this,qe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ue(this,et,Wp).call(this),Ue(this,et,Kp).call(this),P(this,qe).removeObserver(this)}setOptions(t){const r=this.options,n=P(this,qe);if(this.options=P(this,fr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Hr(this.options.enabled,P(this,qe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ue(this,et,qp).call(this),P(this,qe).setOptions(this.options),r._defaulted&&!Ld(this.options,r)&&P(this,fr).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,qe),observer:this});const s=this.hasListeners();s&&vb(P(this,qe),n,this.options,r)&&Ue(this,et,Rl).call(this),this.updateResult(),s&&(P(this,qe)!==n||Hr(this.options.enabled,P(this,qe))!==Hr(r.enabled,P(this,qe))||no(this.options.staleTime,P(this,qe))!==no(r.staleTime,P(this,qe)))&&Ue(this,et,zp).call(this);const o=Ue(this,et,Bp).call(this);s&&(P(this,qe)!==n||Hr(this.options.enabled,P(this,qe))!==Hr(r.enabled,P(this,qe))||o!==P(this,Us))&&Ue(this,et,Up).call(this,o)}getOptimisticResult(t){const r=P(this,fr).getQueryCache().build(P(this,fr),t),n=this.createResult(r,t);return G5(this,n)&&(pe(this,tr,n),pe(this,Na,this.options),pe(this,Ko,P(this,qe).state)),n}getCurrentResult(){return P(this,tr)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),Reflect.get(n,s))})}trackProp(t){P(this,Ea).add(t)}getCurrentQuery(){return P(this,qe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=P(this,fr).defaultQueryOptions(t),n=P(this,fr).getQueryCache().build(P(this,fr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ue(this,et,Rl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,tr)))}createResult(t,r){var $;const n=P(this,qe),s=this.options,o=P(this,tr),a=P(this,Ko),l=P(this,Na),u=t!==n?t.state:P(this,Oc),{state:d}=t;let h={...d},m=!1,p;if(r._optimisticResults){const D=this.hasListeners(),z=!D&&xb(t,r),T=D&&vb(t,n,r,s);(z||T)&&(h={...h,...OC(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:y}=h;p=h.data;let v=!1;if(r.placeholderData!==void 0&&p===void 0&&y==="pending"){let D;o!=null&&o.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(D=o.data,v=!0):D=typeof r.placeholderData=="function"?r.placeholderData(($=P(this,ka))==null?void 0:$.state.data,P(this,ka)):r.placeholderData,D!==void 0&&(y="success",p=Vp(o==null?void 0:o.data,D,r),m=!0)}if(r.select&&p!==void 0&&!v)if(o&&p===(a==null?void 0:a.data)&&r.select===P(this,Dc))p=P(this,Ca);else try{pe(this,Dc,r.select),p=r.select(p),p=Vp(o==null?void 0:o.data,p,r),pe(this,Ca,p),pe(this,Bs,null)}catch(D){pe(this,Bs,D)}P(this,Bs)&&(b=P(this,Bs),p=P(this,Ca),g=Date.now(),y="error");const x=h.fetchStatus==="fetching",w=y==="pending",j=y==="error",S=w&&x,N=p!==void 0,_={status:y,fetchStatus:h.fetchStatus,isPending:w,isSuccess:y==="success",isError:j,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:j&&!N,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:j&&N,isStale:cv(t,r),refetch:this.refetch,promise:P(this,zs),isEnabled:Hr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const D=L=>{_.status==="error"?L.reject(_.error):_.data!==void 0&&L.resolve(_.data)},z=()=>{const L=pe(this,zs,_.promise=$p());D(L)},T=P(this,zs);switch(T.status){case"pending":t.queryHash===n.queryHash&&D(T);break;case"fulfilled":(_.status==="error"||_.data!==T.value)&&z();break;case"rejected":(_.status!=="error"||_.error!==T.reason)&&z();break}}return _}updateResult(){const t=P(this,tr),r=this.createResult(P(this,qe),this.options);if(pe(this,Ko,P(this,qe).state),pe(this,Na,this.options),P(this,Ko).data!==void 0&&pe(this,ka,P(this,qe)),Ld(r,t))return;pe(this,tr,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!P(this,Ea).size)return!0;const a=new Set(o??P(this,Ea));return this.options.throwOnError&&a.add("error"),Object.keys(P(this,tr)).some(l=>{const c=l;return P(this,tr)[c]!==t[c]&&a.has(c)})};Ue(this,et,IC).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ue(this,et,Hp).call(this)}},fr=new WeakMap,qe=new WeakMap,Oc=new WeakMap,tr=new WeakMap,Ko=new WeakMap,Na=new WeakMap,zs=new WeakMap,Bs=new WeakMap,Dc=new WeakMap,Ca=new WeakMap,ka=new WeakMap,qo=new WeakMap,Go=new WeakMap,Us=new WeakMap,Ea=new WeakMap,et=new WeakSet,Rl=function(t){Ue(this,et,qp).call(this);let r=P(this,qe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(sr)),r},zp=function(){Ue(this,et,Wp).call(this);const t=no(this.options.staleTime,P(this,qe));if(ci||P(this,tr).isStale||!Lp(t))return;const n=kC(P(this,tr).dataUpdatedAt,t)+1;pe(this,qo,setTimeout(()=>{P(this,tr).isStale||this.updateResult()},n))},Bp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,qe)):this.options.refetchInterval)??!1},Up=function(t){Ue(this,et,Kp).call(this),pe(this,Us,t),!(ci||Hr(this.options.enabled,P(this,qe))===!1||!Lp(P(this,Us))||P(this,Us)===0)&&pe(this,Go,setInterval(()=>{(this.options.refetchIntervalInBackground||lv.isFocused())&&Ue(this,et,Rl).call(this)},P(this,Us)))},Hp=function(){Ue(this,et,zp).call(this),Ue(this,et,Up).call(this,Ue(this,et,Bp).call(this))},Wp=function(){P(this,qo)&&(clearTimeout(P(this,qo)),pe(this,qo,void 0))},Kp=function(){P(this,Go)&&(clearInterval(P(this,Go)),pe(this,Go,void 0))},qp=function(){const t=P(this,fr).getQueryCache().build(P(this,fr),this.options);if(t===P(this,qe))return;const r=P(this,qe);pe(this,qe,t),pe(this,Oc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},IC=function(t){It.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(P(this,tr))}),P(this,fr).getQueryCache().notify({query:P(this,qe),type:"observerResultsUpdated"})})},z1);function q5(e,t){return Hr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function xb(e,t){return q5(e,t)||e.state.data!==void 0&&Gp(e,t,t.refetchOnMount)}function Gp(e,t,r){if(Hr(t.enabled,e)!==!1&&no(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&cv(e,t)}return!1}function vb(e,t,r,n){return(e!==t||Hr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&cv(e,r)}function cv(e,t){return Hr(t.enabled,e)!==!1&&e.isStaleByTime(no(t.staleTime,e))}function G5(e,t){return!Ld(e.getCurrentResult(),t)}var Hs,Ws,hr,ts,ls,Ju,Qp,B1,Q5=(B1=class extends sl{constructor(r,n){super();Pe(this,ls);Pe(this,Hs);Pe(this,Ws);Pe(this,hr);Pe(this,ts);pe(this,Hs,r),this.setOptions(n),this.bindMethods(),Ue(this,ls,Ju).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=P(this,Hs).defaultMutationOptions(r),Ld(this.options,n)||P(this,Hs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,hr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&ui(n.mutationKey)!==ui(this.options.mutationKey)?this.reset():((s=P(this,hr))==null?void 0:s.state.status)==="pending"&&P(this,hr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=P(this,hr))==null||r.removeObserver(this)}onMutationUpdate(r){Ue(this,ls,Ju).call(this),Ue(this,ls,Qp).call(this,r)}getCurrentResult(){return P(this,Ws)}reset(){var r;(r=P(this,hr))==null||r.removeObserver(this),pe(this,hr,void 0),Ue(this,ls,Ju).call(this),Ue(this,ls,Qp).call(this)}mutate(r,n){var s;return pe(this,ts,n),(s=P(this,hr))==null||s.removeObserver(this),pe(this,hr,P(this,Hs).getMutationCache().build(P(this,Hs),this.options)),P(this,hr).addObserver(this),P(this,hr).execute(r)}},Hs=new WeakMap,Ws=new WeakMap,hr=new WeakMap,ts=new WeakMap,ls=new WeakSet,Ju=function(){var n;const r=((n=P(this,hr))==null?void 0:n.state)??DC();pe(this,Ws,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Qp=function(r){It.batch(()=>{var n,s,o,a,l,c,u,d;if(P(this,ts)&&this.hasListeners()){const h=P(this,Ws).variables,m=P(this,Ws).context;(r==null?void 0:r.type)==="success"?((s=(n=P(this,ts)).onSuccess)==null||s.call(n,r.data,h,m),(a=(o=P(this,ts)).onSettled)==null||a.call(o,r.data,null,h,m)):(r==null?void 0:r.type)==="error"&&((c=(l=P(this,ts)).onError)==null||c.call(l,r.error,h,m),(d=(u=P(this,ts)).onSettled)==null||d.call(u,void 0,r.error,h,m))}this.listeners.forEach(h=>{h(P(this,Ws))})})},B1),LC=f.createContext(void 0),Wc=e=>{const t=f.useContext(LC);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Z5=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(LC.Provider,{value:e,children:t})),FC=f.createContext(!1),Y5=()=>f.useContext(FC);FC.Provider;function X5(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var J5=f.createContext(X5()),eD=()=>f.useContext(J5),tD=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},rD=e=>{f.useEffect(()=>{e.clearReset()},[e])},nD=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||TC(r,[e.error,n])),sD=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},oD=(e,t)=>e.isLoading&&e.isFetching&&!t,iD=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,yb=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function aD(e,t,r){var h,m,p,b,g;const n=Y5(),s=eD(),o=Wc(),a=o.defaultQueryOptions(e);(m=(h=o.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||m.call(h,a),a._optimisticResults=n?"isRestoring":"optimistic",sD(a),tD(a,s),rD(s);const l=!o.getQueryCache().get(a.queryHash),[c]=f.useState(()=>new t(o,a)),u=c.getOptimisticResult(a),d=!n&&e.subscribed!==!1;if(f.useSyncExternalStore(f.useCallback(y=>{const v=d?c.subscribe(It.batchCalls(y)):sr;return c.updateResult(),v},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),f.useEffect(()=>{c.setOptions(a)},[a,c]),iD(a,u))throw yb(a,c,s);if(nD({result:u,errorResetBoundary:s,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((b=(p=o.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||b.call(p,a,u),a.experimental_prefetchInRender&&!ci&&oD(u,n)){const y=l?yb(a,c,s):(g=o.getQueryCache().get(a.queryHash))==null?void 0:g.promise;y==null||y.catch(sr).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?u:c.trackResult(u)}function lD(e,t){return aD(e,K5)}function uv(e,t){const r=Wc(),[n]=f.useState(()=>new Q5(r,e));f.useEffect(()=>{n.setOptions(e)},[n,e]);const s=f.useSyncExternalStore(f.useCallback(a=>n.subscribe(It.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=f.useCallback((a,l)=>{n.mutate(a,l).catch(sr)},[n]);if(s.error&&TC(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}/** + * @remix-run/router v1.23.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function wc(){return wc=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function VC(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function uD(){return Math.random().toString(36).substr(2,8)}function wb(e,t){return{usr:e.state,key:e.key,idx:t}}function Zp(e,t,r,n){return r===void 0&&(r=null),wc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ol(t):t,{state:r,key:t&&t.key||n||uD()})}function Vd(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ol(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function dD(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,a=s.history,l=Gs.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(wc({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function h(){l=Gs.Pop;let y=d(),v=y==null?null:y-u;u=y,c&&c({action:l,location:g.location,delta:v})}function m(y,v){l=Gs.Push;let x=Zp(g.location,y,v);u=d()+1;let w=wb(x,u),j=g.createHref(x);try{a.pushState(w,"",j)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(j)}o&&c&&c({action:l,location:g.location,delta:1})}function p(y,v){l=Gs.Replace;let x=Zp(g.location,y,v);u=d();let w=wb(x,u),j=g.createHref(x);a.replaceState(w,"",j),o&&c&&c({action:l,location:g.location,delta:0})}function b(y){let v=s.location.origin!=="null"?s.location.origin:s.location.href,x=typeof y=="string"?y:Vd(y);return x=x.replace(/ $/,"%20"),Pt(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let g={get action(){return l},get location(){return e(s,a)},listen(y){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(bb,h),c=y,()=>{s.removeEventListener(bb,h),c=null}},createHref(y){return t(s,y)},createURL:b,encodeLocation(y){let v=b(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:p,go(y){return a.go(y)}};return g}var jb;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(jb||(jb={}));function fD(e,t,r){return r===void 0&&(r="/"),hD(e,t,r,!1)}function hD(e,t,r,n){let s=typeof t=="string"?ol(t):t,o=dv(s.pathname||"/",r);if(o==null)return null;let a=$C(e);mD(a);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};c.relativePath.startsWith("/")&&(Pt(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=so([n,c.relativePath]),d=r.concat(c);o.children&&o.children.length>0&&(Pt(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),$C(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:wD(u,o.index),routesMeta:d})};return e.forEach((o,a)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,a);else for(let c of zC(o.path))s(o,a,c)}),t}function zC(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let a=zC(n.join("/")),l=[];return l.push(...a.map(c=>c===""?o:[o,c].join("/"))),s&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function mD(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:jD(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const pD=/^:[\w-]+$/,gD=3,xD=2,vD=1,yD=10,bD=-2,Sb=e=>e==="*";function wD(e,t){let r=e.split("/"),n=r.length;return r.some(Sb)&&(n+=bD),t&&(n+=xD),r.filter(s=>!Sb(s)).reduce((s,o)=>s+(pD.test(o)?gD:o===""?vD:yD),n)}function jD(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function SD(e,t,r){let{routesMeta:n}=e,s={},o="/",a=[];for(let l=0;l{let{paramName:m,isOptional:p}=d;if(m==="*"){let g=l[h]||"";a=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"$1")}const b=l[h];return p&&!b?u[m]=void 0:u[m]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:a,pattern:e}}function ND(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),VC(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function CD(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return VC(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function dv(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function kD(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?ol(e):e;return{pathname:r?r.startsWith("/")?r:ED(r,t):t,search:PD(n),hash:AD(s)}}function ED(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Hh(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function _D(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function fv(e,t){let r=_D(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function hv(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=ol(e):(s=wc({},e),Pt(!s.pathname||!s.pathname.includes("?"),Hh("?","pathname","search",s)),Pt(!s.pathname||!s.pathname.includes("#"),Hh("#","pathname","hash",s)),Pt(!s.search||!s.search.includes("#"),Hh("#","search","hash",s)));let o=e===""||s.pathname==="",a=o?"/":s.pathname,l;if(a==null)l=r;else{let h=t.length-1;if(!n&&a.startsWith("..")){let m=a.split("/");for(;m[0]==="..";)m.shift(),h-=1;s.pathname=m.join("/")}l=h>=0?t[h]:"/"}let c=kD(s,l),u=a&&a!=="/"&&a.endsWith("/"),d=(o||a===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const so=e=>e.join("/").replace(/\/\/+/g,"/"),TD=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),PD=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,AD=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function RD(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const BC=["post","put","patch","delete"];new Set(BC);const MD=["get",...BC];new Set(MD);/** + * React Router v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function jc(){return jc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),f.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let h=hv(u,JSON.parse(a),o,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:so([t,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[t,n,a,o,e])}const LD=f.createContext(null);function FD(e){let t=f.useContext(ys).outlet;return t&&f.createElement(LD.Provider,{value:e},t)}function WC(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=f.useContext(jo),{matches:s}=f.useContext(ys),{pathname:o}=qn(),a=JSON.stringify(fv(s,n.v7_relativeSplatPath));return f.useMemo(()=>hv(e,JSON.parse(a),o,r==="path"),[e,a,o,r])}function VD(e,t){return $D(e,t)}function $D(e,t,r,n){il()||Pt(!1);let{navigator:s}=f.useContext(jo),{matches:o}=f.useContext(ys),a=o[o.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=qn(),d;if(t){var h;let y=typeof t=="string"?ol(t):t;c==="/"||(h=y.pathname)!=null&&h.startsWith(c)||Pt(!1),d=y}else d=u;let m=d.pathname||"/",p=m;if(c!=="/"){let y=c.replace(/^\//,"").split("/");p="/"+m.replace(/^\//,"").split("/").slice(y.length).join("/")}let b=fD(e,{pathname:p}),g=WD(b&&b.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:so([c,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:so([c,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,r,n);return t&&g?f.createElement(Df.Provider,{value:{location:jc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Gs.Pop}},g):g}function zD(){let e=QD(),t=RD(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:s},r):null,null)}const BD=f.createElement(zD,null);class UD extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?f.createElement(ys.Provider,{value:this.props.routeContext},f.createElement(UC.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function HD(e){let{routeContext:t,match:r,children:n}=e,s=f.useContext(mv);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),f.createElement(ys.Provider,{value:t},n)}function WD(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=n)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,l=(s=r)==null?void 0:s.errors;if(l!=null){let d=a.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);d>=0||Pt(!1),a=a.slice(0,Math.min(a.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,h,m)=>{let p,b=!1,g=null,y=null;r&&(p=l&&h.route.id?l[h.route.id]:void 0,g=h.route.errorElement||BD,c&&(u<0&&m===0?(b=!0,y=null):u===m&&(b=!0,y=h.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,m+1)),x=()=>{let w;return p?w=g:b?w=y:h.route.Component?w=f.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=d,f.createElement(HD,{match:h,routeContext:{outlet:d,matches:v,isDataRoute:r!=null},children:w})};return r&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?f.createElement(UD,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var KC=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(KC||{}),$d=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}($d||{});function KD(e){let t=f.useContext(mv);return t||Pt(!1),t}function qD(e){let t=f.useContext(OD);return t||Pt(!1),t}function GD(e){let t=f.useContext(ys);return t||Pt(!1),t}function qC(e){let t=GD(),r=t.matches[t.matches.length-1];return r.route.id||Pt(!1),r.route.id}function QD(){var e;let t=f.useContext(UC),r=qD($d.UseRouteError),n=qC($d.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function ZD(){let{router:e}=KD(KC.UseNavigateStable),t=qC($d.UseNavigateStable),r=f.useRef(!1);return HC(()=>{r.current=!0}),f.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,jc({fromRouteId:t},o)))},[e,t])}function YD(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function zd(e){let{to:t,replace:r,state:n,relative:s}=e;il()||Pt(!1);let{future:o,static:a}=f.useContext(jo),{matches:l}=f.useContext(ys),{pathname:c}=qn(),u=Si(),d=hv(t,fv(l,o.v7_relativeSplatPath),c,s==="path"),h=JSON.stringify(d);return f.useEffect(()=>u(JSON.parse(h),{replace:r,state:n,relative:s}),[u,h,s,r,n]),null}function XD(e){return FD(e.context)}function Qt(e){Pt(!1)}function JD(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Gs.Pop,navigator:o,static:a=!1,future:l}=e;il()&&Pt(!1);let c=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:c,navigator:o,static:a,future:jc({v7_relativeSplatPath:!1},l)}),[c,l,o,a]);typeof n=="string"&&(n=ol(n));let{pathname:d="/",search:h="",hash:m="",state:p=null,key:b="default"}=n,g=f.useMemo(()=>{let y=dv(d,c);return y==null?null:{location:{pathname:y,search:h,hash:m,state:p,key:b},navigationType:s}},[c,d,h,m,p,b,s]);return g==null?null:f.createElement(jo.Provider,{value:u},f.createElement(Df.Provider,{children:r,value:g}))}function eI(e){let{children:t,location:r}=e;return VD(Yp(t),r)}new Promise(()=>{});function Yp(e,t){t===void 0&&(t=[]);let r=[];return f.Children.forEach(e,(n,s)=>{if(!f.isValidElement(n))return;let o=[...t,s];if(n.type===f.Fragment){r.push.apply(r,Yp(n.props.children,o));return}n.type!==Qt&&Pt(!1),!n.props.index||!n.props.children||Pt(!1);let a={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(a.children=Yp(n.props.children,o)),r.push(a)}),r}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Xp(){return Xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[s]=e[s]);return r}function rI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function nI(e,t){return e.button===0&&(!t||t==="_self")&&!rI(e)}const sI=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],oI="6";try{window.__reactRouterVersion=oI}catch{}const iI="startTransition",Cb=Wg[iI];function aI(e){let{basename:t,children:r,future:n,window:s}=e,o=f.useRef();o.current==null&&(o.current=cD({window:s,v5Compat:!0}));let a=o.current,[l,c]=f.useState({action:a.action,location:a.location}),{v7_startTransition:u}=n||{},d=f.useCallback(h=>{u&&Cb?Cb(()=>c(h)):c(h)},[c,u]);return f.useLayoutEffect(()=>a.listen(d),[a,d]),f.useEffect(()=>YD(n),[n]),f.createElement(JD,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:a,future:n})}const lI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pv=f.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:o,replace:a,state:l,target:c,to:u,preventScrollReset:d,viewTransition:h}=t,m=tI(t,sI),{basename:p}=f.useContext(jo),b,g=!1;if(typeof u=="string"&&cI.test(u)&&(b=u,lI))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=dv(j.pathname,p);j.origin===w.origin&&S!=null?u=S+j.search+j.hash:g=!0}catch{}let y=DD(u,{relative:s}),v=uI(u,{replace:a,state:l,target:c,preventScrollReset:d,relative:s,viewTransition:h});function x(w){n&&n(w),w.defaultPrevented||v(w)}return f.createElement("a",Xp({},m,{href:b||y,onClick:g||o?n:x,ref:r,target:c}))});var kb;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(kb||(kb={}));var Eb;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Eb||(Eb={}));function uI(e,t){let{target:r,replace:n,state:s,preventScrollReset:o,relative:a,viewTransition:l}=t===void 0?{}:t,c=Si(),u=qn(),d=WC(e,{relative:a});return f.useCallback(h=>{if(nI(h,r)){h.preventDefault();let m=n!==void 0?n:Vd(u)===Vd(d);c(e,{replace:m,state:s,preventScrollReset:o,relative:a,viewTransition:l})}},[u,c,d,n,s,r,e,o,a,l])}const _b=e=>{let t;const r=new Set,n=(u,d)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const m=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),r.forEach(p=>p(t,m))}},s=()=>t,l={setState:n,getState:s,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=t=e(n,s,l);return l},dI=e=>e?_b(e):_b,fI=e=>e;function hI(e,t=fI){const r=U.useSyncExternalStore(e.subscribe,U.useCallback(()=>t(e.getState()),[e,t]),U.useCallback(()=>t(e.getInitialState()),[e,t]));return U.useDebugValue(r),r}const mI=e=>{const t=dI(e),r=n=>hI(t,n);return Object.assign(r,t),r},GC=e=>mI;function pI(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var o;const a=c=>c===null?null:JSON.parse(c,void 0),l=(o=r.getItem(s))!=null?o:null;return l instanceof Promise?l.then(a):a(l)},setItem:(s,o)=>r.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>r.removeItem(s)}}const Jp=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return Jp(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Jp(n)(r)}}}},gI=(e,t)=>(r,n,s)=>{let o={storage:pI(()=>localStorage),partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},a=!1;const l=new Set,c=new Set;let u=o.storage;if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...g)},n,s);const d=()=>{const g=o.partialize({...n()});return u.setItem(o.name,{state:g,version:o.version})},h=s.setState;s.setState=(g,y)=>(h(g,y),d());const m=e((...g)=>(r(...g),d()),n,s);s.getInitialState=()=>m;let p;const b=()=>{var g,y;if(!u)return;a=!1,l.forEach(x=>{var w;return x((w=n())!=null?w:m)});const v=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(g=n())!=null?g:m))||void 0;return Jp(u.getItem.bind(u))(o.name).then(x=>{if(x)if(typeof x.version=="number"&&x.version!==o.version){if(o.migrate){const w=o.migrate(x.state,x.version);return w instanceof Promise?w.then(j=>[!0,j]):[!0,w]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,x.state];return[!1,void 0]}).then(x=>{var w;const[j,S]=x;if(p=o.merge(S,(w=n())!=null?w:m),r(p,!0),j)return d()}).then(()=>{v==null||v(p,void 0),p=n(),a=!0,c.forEach(x=>x(p))}).catch(x=>{v==null||v(void 0,x)})};return s.persist={setOptions:g=>{o={...o,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>b(),hasHydrated:()=>a,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(c.add(g),()=>{c.delete(g)})},o.skipHydration||b(),p||m},QC=gI,So=GC()(QC((e,t)=>({user:null,loading:!0,loadSession:async()=>{try{const r=await fetch("/api/session",{credentials:"same-origin"}),n=await r.json();r.ok&&(n!=null&&n.authenticated)?e({user:n.user??null,loading:!1}):e({user:null,loading:!1})}catch{e({user:null,loading:!1})}},fetchSession:async()=>{await t().loadSession()},login:async(r,n)=>{try{const s=await fetch("/api/login",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({username:r,password:n})}),o=await s.json();if(s.ok&&(o!=null&&o.ok||o!=null&&o.success))return await t().loadSession(),!0}catch{}return!1},logout:async()=>{try{await fetch("/api/logout",{method:"POST",credentials:"same-origin"})}catch{}e({user:null})},setUser:r=>e({user:r})}),{name:"auth",partialize:e=>({user:e.user})}));function un({children:e}){const{user:t,loading:r}=So(),n=qn();if(r)return null;if(!t){const s=`${n.pathname}${n.search}${n.hash}`;return n.pathname==="/login"?null:i.jsx(zd,{to:"/login",replace:!0,state:{from:s}})}return i.jsx(i.Fragment,{children:e})}function xI({children:e}){const{user:t,loading:r}=So(),[n,s]=f.useState(!1);return f.useEffect(()=>{r||(t&&t.role,s(!0))},[t,r]),r?i.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"Verificando permissões…"}):t?t.role!=="admin"?i.jsx(zd,{to:"/",replace:!0}):i.jsx(i.Fragment,{children:e}):i.jsx(zd,{to:"/login",replace:!0})}function vI(){return i.jsx(un,{children:i.jsx(xI,{children:i.jsx(XD,{})})})}function yI({children:e,...t}){return i.jsx(f4,{attribute:"class",defaultTheme:"light",enableSystem:!1,...t,children:e})}const Jr=GC()(QC((e,t)=>({projeto:null,loading:!0,setProjeto:r=>e({projeto:r,loading:!1}),clearProjeto:()=>e({projeto:null,loading:!1}),fetchProjeto:async()=>{e({loading:!0});try{const r=await fetch("/api/projeto_atual",{credentials:"same-origin",headers:{Accept:"application/json"}});if(r.status===401)return;const n=await r.json().catch(()=>null);if(r.ok){const s=(n==null?void 0:n.projeto_atual)??(n==null?void 0:n.projeto)??null;s&&typeof s.id=="number"?e({projeto:{id:s.id,nome:s.nome}}):e({projeto:null})}}catch{}finally{e({loading:!1})}}}),{name:"project",partialize:e=>({projeto:e.projeto})})),Wh=768;function bI(){const[e,t]=f.useState(void 0);return f.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Wh-1}px)`),n=()=>{t(window.innerWidthr.removeEventListener("change",n)},[]),!!e}const wI=ji("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),de=f.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const a=n?wi:"button";return i.jsx(a,{className:he(wI({variant:t,size:r,className:e})),ref:o,...s})});de.displayName="Button";const Oe=f.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{type:t,className:he("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));Oe.displayName="Input";var jI="Separator",Tb="horizontal",SI=["horizontal","vertical"],ZC=f.forwardRef((e,t)=>{const{decorative:r,orientation:n=Tb,...s}=e,o=NI(n)?n:Tb,l=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return i.jsx(Te.div,{"data-orientation":o,...l,...s,ref:t})});ZC.displayName=jI;function NI(e){return SI.includes(e)}var YC=ZC;const XC=f.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>i.jsx(YC,{ref:s,decorative:r,orientation:t,className:he("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));XC.displayName=YC.displayName;var Kh="focusScope.autoFocusOnMount",qh="focusScope.autoFocusOnUnmount",Pb={bubbles:!1,cancelable:!0},CI="FocusScope",If=f.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[l,c]=f.useState(null),u=Vt(s),d=Vt(o),h=f.useRef(null),m=ze(t,g=>c(g)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(n){let g=function(w){if(p.paused||!l)return;const j=w.target;l.contains(j)?h.current=j:Ts(h.current,{select:!0})},y=function(w){if(p.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||Ts(h.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&Ts(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const x=new MutationObserver(v);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),x.disconnect()}}},[n,l,p.paused]),f.useEffect(()=>{if(l){Rb.add(p);const g=document.activeElement;if(!l.contains(g)){const v=new CustomEvent(Kh,Pb);l.addEventListener(Kh,u),l.dispatchEvent(v),v.defaultPrevented||(kI(AI(JC(l)),{select:!0}),document.activeElement===g&&Ts(l))}return()=>{l.removeEventListener(Kh,u),setTimeout(()=>{const v=new CustomEvent(qh,Pb);l.addEventListener(qh,d),l.dispatchEvent(v),v.defaultPrevented||Ts(g??document.body,{select:!0}),l.removeEventListener(qh,d),Rb.remove(p)},0)}}},[l,u,d,p]);const b=f.useCallback(g=>{if(!r&&!n||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const x=g.currentTarget,[w,j]=EI(x);w&&j?!g.shiftKey&&v===j?(g.preventDefault(),r&&Ts(w,{select:!0})):g.shiftKey&&v===w&&(g.preventDefault(),r&&Ts(j,{select:!0})):v===x&&g.preventDefault()}},[r,n,p.paused]);return i.jsx(Te.div,{tabIndex:-1,...a,ref:m,onKeyDown:b})});If.displayName=CI;function kI(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ts(n,{select:t}),document.activeElement!==r)return}function EI(e){const t=JC(e),r=Ab(t,e),n=Ab(t.reverse(),e);return[r,n]}function JC(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ab(e,t){for(const r of e)if(!_I(r,{upTo:t}))return r}function _I(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function TI(e){return e instanceof HTMLInputElement&&"select"in e}function Ts(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&TI(e)&&t&&e.select()}}var Rb=PI();function PI(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Mb(e,t),e.unshift(t)},remove(t){var r;e=Mb(e,t),(r=e[0])==null||r.resume()}}}function Mb(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function AI(e){return e.filter(t=>t.tagName!=="A")}var Gh=0;function gv(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ob()),document.body.insertAdjacentElement("beforeend",e[1]??Ob()),Gh++,()=>{Gh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Gh--}},[])}function Ob(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Mn=function(){return Mn=Object.assign||function(t){for(var r,n=1,s=arguments.length;n"u")return GI;var t=QI(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},YI=n2(),fa="data-scroll-locked",XI=function(e,t,r,n){var s=e.left,o=e.top,a=e.right,l=e.gap;return r===void 0&&(r="margin"),` + .`.concat(MI,` { + overflow: hidden `).concat(n,`; + padding-right: `).concat(l,"px ").concat(n,`; + } + body[`).concat(fa,`] { + overflow: hidden `).concat(n,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` + padding-left: `.concat(s,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(a,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(l,"px ").concat(n,`; + `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),` + } + + .`).concat(ed,` { + right: `).concat(l,"px ").concat(n,`; + } + + .`).concat(td,` { + margin-right: `).concat(l,"px ").concat(n,`; + } + + .`).concat(ed," .").concat(ed,` { + right: 0 `).concat(n,`; + } + + .`).concat(td," .").concat(td,` { + margin-right: 0 `).concat(n,`; + } + + body[`).concat(fa,`] { + `).concat(OI,": ").concat(l,`px; + } +`)},Ib=function(){var e=parseInt(document.body.getAttribute(fa)||"0",10);return isFinite(e)?e:0},JI=function(){f.useEffect(function(){return document.body.setAttribute(fa,(Ib()+1).toString()),function(){var e=Ib()-1;e<=0?document.body.removeAttribute(fa):document.body.setAttribute(fa,e.toString())}},[])},eL=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;JI();var o=f.useMemo(function(){return ZI(s)},[s]);return f.createElement(YI,{styles:XI(o,!t,s,r?"":"!important")})},eg=!1;if(typeof window<"u")try{var Eu=Object.defineProperty({},"passive",{get:function(){return eg=!0,!0}});window.addEventListener("test",Eu,Eu),window.removeEventListener("test",Eu,Eu)}catch{eg=!1}var Ai=eg?{passive:!1}:!1,tL=function(e){return e.tagName==="TEXTAREA"},s2=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!tL(e)&&r[t]==="visible")},rL=function(e){return s2(e,"overflowY")},nL=function(e){return s2(e,"overflowX")},Lb=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=o2(e,n);if(s){var o=i2(e,n),a=o[1],l=o[2];if(a>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},sL=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},oL=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},o2=function(e,t){return e==="v"?rL(t):nL(t)},i2=function(e,t){return e==="v"?sL(t):oL(t)},iL=function(e,t){return e==="h"&&t==="rtl"?-1:1},aL=function(e,t,r,n,s){var o=iL(e,window.getComputedStyle(t).direction),a=o*n,l=r.target,c=t.contains(l),u=!1,d=a>0,h=0,m=0;do{if(!l)break;var p=i2(e,l),b=p[0],g=p[1],y=p[2],v=g-y-o*b;(b||v)&&o2(e,l)&&(h+=v,m+=b);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(m)<1||!s))&&(u=!0),u},_u=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fb=function(e){return[e.deltaX,e.deltaY]},Vb=function(e){return e&&"current"in e?e.current:e},lL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cL=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},uL=0,Ri=[];function dL(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),s=f.useState(uL++)[0],o=f.useState(n2)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=RI([e.lockRef.current],(e.shards||[]).map(Vb),!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=f.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var v=_u(g),x=r.current,w="deltaX"in g?g.deltaX:x[0]-v[0],j="deltaY"in g?g.deltaY:x[1]-v[1],S,N=g.target,C=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in g&&C==="h"&&N.type==="range")return!1;var _=Lb(C,N);if(!_)return!0;if(_?S=C:(S=C==="v"?"h":"v",_=Lb(C,N)),!_)return!1;if(!n.current&&"changedTouches"in g&&(w||j)&&(n.current=S),!S)return!0;var $=n.current||S;return aL($,y,g,$==="h"?w:j,!0)},[]),c=f.useCallback(function(g){var y=g;if(!(!Ri.length||Ri[Ri.length-1]!==o)){var v="deltaY"in y?Fb(y):_u(y),x=t.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&lL(S.delta,v)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(a.current.shards||[]).map(Vb).filter(Boolean).filter(function(S){return S.contains(y.target)}),j=w.length>0?l(y,w[0]):!a.current.noIsolation;j&&y.cancelable&&y.preventDefault()}}},[]),u=f.useCallback(function(g,y,v,x){var w={name:g,delta:y,target:v,should:x,shadowParent:fL(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),d=f.useCallback(function(g){r.current=_u(g),n.current=void 0},[]),h=f.useCallback(function(g){u(g.type,Fb(g),g.target,l(g,e.lockRef.current))},[]),m=f.useCallback(function(g){u(g.type,_u(g),g.target,l(g,e.lockRef.current))},[]);f.useEffect(function(){return Ri.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Ai),document.addEventListener("touchmove",c,Ai),document.addEventListener("touchstart",d,Ai),function(){Ri=Ri.filter(function(g){return g!==o}),document.removeEventListener("wheel",c,Ai),document.removeEventListener("touchmove",c,Ai),document.removeEventListener("touchstart",d,Ai)}},[]);var p=e.removeScrollBar,b=e.inert;return f.createElement(f.Fragment,null,b?f.createElement(o,{styles:cL(s)}):null,p?f.createElement(eL,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hL=zI(r2,dL);var Ff=f.forwardRef(function(e,t){return f.createElement(Lf,Mn({},e,{ref:t,sideCar:hL}))});Ff.classNames=Lf.classNames;var mL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mi=new WeakMap,Tu=new WeakMap,Pu={},Xh=0,a2=function(e){return e&&(e.host||a2(e.parentNode))},pL=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=a2(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})},gL=function(e,t,r,n){var s=pL(t,Array.isArray(e)?e:[e]);Pu[r]||(Pu[r]=new WeakMap);var o=Pu[r],a=[],l=new Set,c=new Set(s),u=function(h){!h||l.has(h)||(l.add(h),u(h.parentNode))};s.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(m){if(l.has(m))d(m);else try{var p=m.getAttribute(n),b=p!==null&&p!=="false",g=(Mi.get(m)||0)+1,y=(o.get(m)||0)+1;Mi.set(m,g),o.set(m,y),a.push(m),g===1&&b&&Tu.set(m,!0),y===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",m,v)}})};return d(t),l.clear(),Xh++,function(){a.forEach(function(h){var m=Mi.get(h)-1,p=o.get(h)-1;Mi.set(h,m),o.set(h,p),m||(Tu.has(h)||h.removeAttribute(n),Tu.delete(h)),p||h.removeAttribute(r)}),Xh--,Xh||(Mi=new WeakMap,Mi=new WeakMap,Tu=new WeakMap,Pu={})}},xv=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=mL(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),gL(n,s,r,"aria-hidden")):function(){return null}},Vf="Dialog",[l2,OB]=Wn(Vf),[xL,kn]=l2(Vf),c2=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=f.useRef(null),c=f.useRef(null),[u,d]=uo({prop:n,defaultProp:s??!1,onChange:o,caller:Vf});return i.jsx(xL,{scope:t,triggerRef:l,contentRef:c,contentId:Cr(),titleId:Cr(),descriptionId:Cr(),open:u,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(h=>!h),[d]),modal:a,children:r})};c2.displayName=Vf;var u2="DialogTrigger",vL=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=kn(u2,r),o=ze(t,s.triggerRef);return i.jsx(Te.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":bv(s.open),...n,ref:o,onClick:ke(e.onClick,s.onOpenToggle)})});vL.displayName=u2;var vv="DialogPortal",[yL,d2]=l2(vv,{forceMount:void 0}),f2=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=kn(vv,t);return i.jsx(yL,{scope:t,forceMount:r,children:f.Children.map(n,a=>i.jsx($r,{present:r||o.open,children:i.jsx(zc,{asChild:!0,container:s,children:a})}))})};f2.displayName=vv;var Bd="DialogOverlay",h2=f.forwardRef((e,t)=>{const r=d2(Bd,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=kn(Bd,e.__scopeDialog);return o.modal?i.jsx($r,{present:n||o.open,children:i.jsx(wL,{...s,ref:t})}):null});h2.displayName=Bd;var bL=ai("DialogOverlay.RemoveScroll"),wL=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=kn(Bd,r);return i.jsx(Ff,{as:bL,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(Te.div,{"data-state":bv(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),di="DialogContent",m2=f.forwardRef((e,t)=>{const r=d2(di,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=kn(di,e.__scopeDialog);return i.jsx($r,{present:n||o.open,children:o.modal?i.jsx(jL,{...s,ref:t}):i.jsx(SL,{...s,ref:t})})});m2.displayName=di;var jL=f.forwardRef((e,t)=>{const r=kn(di,e.__scopeDialog),n=f.useRef(null),s=ze(t,r.contentRef,n);return f.useEffect(()=>{const o=n.current;if(o)return xv(o)},[]),i.jsx(p2,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&o.preventDefault()}),onFocusOutside:ke(e.onFocusOutside,o=>o.preventDefault())})}),SL=f.forwardRef((e,t)=>{const r=kn(di,e.__scopeDialog),n=f.useRef(!1),s=f.useRef(!1);return i.jsx(p2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((u=r.triggerRef.current)==null?void 0:u.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),p2=f.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,l=kn(di,r),c=f.useRef(null),u=ze(t,c);return gv(),i.jsxs(i.Fragment,{children:[i.jsx(If,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx(Xa,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":bv(l.open),...a,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(NL,{titleId:l.titleId}),i.jsx(kL,{contentRef:c,descriptionId:l.descriptionId})]})]})}),yv="DialogTitle",g2=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=kn(yv,r);return i.jsx(Te.h2,{id:s.titleId,...n,ref:t})});g2.displayName=yv;var x2="DialogDescription",v2=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=kn(x2,r);return i.jsx(Te.p,{id:s.descriptionId,...n,ref:t})});v2.displayName=x2;var y2="DialogClose",b2=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=kn(y2,r);return i.jsx(Te.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,()=>s.onOpenChange(!1))})});b2.displayName=y2;function bv(e){return e?"open":"closed"}var w2="DialogTitleWarning",[DB,j2]=uR(w2,{contentName:di,titleName:yv,docsSlug:"dialog"}),NL=({titleId:e})=>{const t=j2(w2),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},CL="DialogDescriptionWarning",kL=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${j2(CL).contentName}}.`;return f.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},wv=c2,jv=f2,Kc=h2,qc=m2,$f=g2,zf=v2,Sv=b2;const EL=wv,_L=jv,S2=f.forwardRef(({className:e,...t},r)=>i.jsx(Kc,{className:he("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));S2.displayName=Kc.displayName;const TL=ji("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),N2=f.forwardRef(({side:e="right",className:t,children:r,...n},s)=>i.jsxs(_L,{children:[i.jsx(S2,{}),i.jsxs(qc,{ref:s,className:he(TL({side:e}),t),...n,children:[r,i.jsxs(Sv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[i.jsx(Nr,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));N2.displayName=qc.displayName;const PL=f.forwardRef(({className:e,...t},r)=>i.jsx($f,{ref:r,className:he("text-lg font-semibold text-foreground",e),...t}));PL.displayName=$f.displayName;const AL=f.forwardRef(({className:e,...t},r)=>i.jsx(zf,{ref:r,className:he("text-sm text-muted-foreground",e),...t}));AL.displayName=zf.displayName;function Mo({className:e,...t}){return i.jsx("div",{className:he("animate-pulse rounded-md bg-muted",e),...t})}const RL="sidebar:state",ML=60*60*24*7,OL="16rem",DL="18rem",IL="3rem",LL="b",C2=f.createContext(null);function Bf(){const e=f.useContext(C2);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const k2=f.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:s,children:o,...a},l)=>{const c=bI(),[u,d]=f.useState(!1),[h,m]=f.useState(e),p=t??h,b=f.useCallback(x=>{const w=typeof x=="function"?x(p):x;r?r(w):m(w),document.cookie=`${RL}=${w}; path=/; max-age=${ML}`},[r,p]),g=f.useCallback(()=>c?d(x=>!x):b(x=>!x),[c,b,d]);f.useEffect(()=>{const x=w=>{w.key===LL&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),g())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[g]);const y=p?"expanded":"collapsed",v=f.useMemo(()=>({state:y,open:p,setOpen:b,isMobile:c,openMobile:u,setOpenMobile:d,toggleSidebar:g}),[y,p,b,c,u,d,g]);return i.jsx(C2.Provider,{value:v,children:i.jsx(SC,{delayDuration:0,children:i.jsx("div",{style:{"--sidebar-width":OL,"--sidebar-width-icon":IL,...s},className:he("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:l,...a,children:o})})})});k2.displayName="SidebarProvider";const E2=f.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...o},a)=>{const{isMobile:l,state:c,openMobile:u,setOpenMobile:d}=Bf();return r==="none"?i.jsx("div",{className:he("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:a,...o,children:s}):l?i.jsx(EL,{open:u,onOpenChange:d,...o,children:i.jsx(N2,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":DL},side:e,children:i.jsx("div",{className:"flex h-full w-full flex-col",children:s})})}):i.jsxs("div",{ref:a,className:"group peer hidden md:block text-sidebar-foreground","data-state":c,"data-collapsible":c==="collapsed"?r:"","data-variant":t,"data-side":e,children:[i.jsx("div",{className:he("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] 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)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),i.jsx("div",{className:he("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] 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)_+_theme(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",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:s})})]})});E2.displayName="Sidebar";const _2=f.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:s}=Bf();return i.jsxs(de,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:he("h-7 w-7",e),onClick:o=>{t==null||t(o),s()},...r,children:[i.jsx(bM,{}),i.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});_2.displayName="SidebarTrigger";const FL=f.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=Bf();return i.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:he("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});FL.displayName="SidebarRail";const VL=f.forwardRef(({className:e,...t},r)=>i.jsx("main",{ref:r,className:he("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));VL.displayName="SidebarInset";const $L=f.forwardRef(({className:e,...t},r)=>i.jsx(Oe,{ref:r,"data-sidebar":"input",className:he("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));$L.displayName="SidebarInput";const T2=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"header",className:he("flex flex-col gap-2 p-2",e),...t}));T2.displayName="SidebarHeader";const P2=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"footer",className:he("flex flex-col gap-2 p-2",e),...t}));P2.displayName="SidebarFooter";const zL=f.forwardRef(({className:e,...t},r)=>i.jsx(XC,{ref:r,"data-sidebar":"separator",className:he("mx-2 w-auto bg-sidebar-border",e),...t}));zL.displayName="SidebarSeparator";const A2=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"content",className:he("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));A2.displayName="SidebarContent";const R2=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"group",className:he("relative flex w-full min-w-0 flex-col p-2",e),...t}));R2.displayName="SidebarGroup";const M2=f.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const s=t?wi:"div";return i.jsx(s,{ref:n,"data-sidebar":"group-label",className:he("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});M2.displayName="SidebarGroupLabel";const BL=f.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const s=t?wi:"button";return i.jsx(s,{ref:n,"data-sidebar":"group-action",className:he("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})});BL.displayName="SidebarGroupAction";const O2=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"group-content",className:he("w-full text-sm",e),...t}));O2.displayName="SidebarGroupContent";const D2=f.forwardRef(({className:e,...t},r)=>i.jsx("ul",{ref:r,"data-sidebar":"menu",className:he("flex w-full min-w-0 flex-col gap-1",e),...t}));D2.displayName="SidebarMenu";const I2=f.forwardRef(({className:e,...t},r)=>i.jsx("li",{ref:r,"data-sidebar":"menu-item",className:he("group/menu-item relative",e),...t}));I2.displayName="SidebarMenuItem";const UL=ji("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none 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"}}),L2=f.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:s,className:o,...a},l)=>{const c=e?wi:"button",{isMobile:u,state:d}=Bf(),h=i.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:he(UL({variant:r,size:n}),o),...a});return s?(typeof s=="string"&&(s={children:s}),i.jsxs(NC,{children:[i.jsx(CC,{asChild:!0,children:h}),i.jsx(ov,{side:"right",align:"center",hidden:d!=="collapsed"||u,...s})]})):h});L2.displayName="SidebarMenuButton";const HL=f.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},s)=>{const o=t?wi:"button";return i.jsx(o,{ref:s,"data-sidebar":"menu-action",className:he("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});HL.displayName="SidebarMenuAction";const WL=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:he("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));WL.displayName="SidebarMenuBadge";const KL=f.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const s=f.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return i.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:he("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&i.jsx(Mo,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),i.jsx(Mo,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});KL.displayName="SidebarMenuSkeleton";const qL=f.forwardRef(({className:e,...t},r)=>i.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:he("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));qL.displayName="SidebarMenuSub";const GL=f.forwardRef(({...e},t)=>i.jsx("li",{ref:t,...e}));GL.displayName="SidebarMenuSubItem";const QL=f.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...s},o)=>{const a=e?wi:"a";return i.jsx(a,{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:he("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","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})});QL.displayName="SidebarMenuSubButton";function $b(){const{setTheme:e,theme:t,resolvedTheme:r}=qN(),[n,s]=f.useState(!1);f.useEffect(()=>{s(!0)},[]);const a=(t==="system"?r:t)==="dark",l=()=>{e(a?"light":"dark")};return n?i.jsxs(NC,{children:[i.jsx(CC,{asChild:!0,children:i.jsxs(de,{type:"button",variant:"ghost",size:"icon",onClick:l,className:"h-9 w-9 rounded-xl bg-muted/60 hover:bg-muted transition","aria-label":a?"Ativar modo claro":"Ativar modo escuro",children:[i.jsx(kM,{className:`h-4 w-4 transition-transform ${a?"scale-0 rotate-90":"scale-100 rotate-0"}`}),i.jsx(yM,{className:`absolute h-4 w-4 transition-transform ${a?"scale-100 rotate-0":"scale-0 -rotate-90"}`}),i.jsx("span",{className:"sr-only",children:a?"Usando modo escuro":"Usando modo claro"})]})}),i.jsx(ov,{side:"bottom",align:"center",children:a?"Modo claro":"Modo escuro"})]}):i.jsx(de,{variant:"ghost",size:"icon",className:"h-9 w-9 rounded-xl bg-muted/50","aria-hidden":"true"})}const dn=e=>"/"+e.toLowerCase(),zb=[{title:"Dashboard",url:dn(""),icon:gM,requiresProject:!1},{title:"Áreas",url:dn("areas"),icon:kp,requiresProject:!0},{title:"Ambientes",url:dn("ambientes"),icon:Np,requiresProject:!0},{title:"Quadros",url:dn("quadros"),icon:Ep,requiresProject:!0},{title:"Circuitos",url:dn("circuitos"),icon:os,requiresProject:!0},{title:"Módulos",url:dn("modulos"),icon:Kl,requiresProject:!0},{title:"Vinculação",url:dn("vinculacao"),icon:pM,requiresProject:!0},{title:"Keypads",url:dn("keypads"),icon:Cp,requiresProject:!0},{title:"Cenas",url:dn("cenas"),icon:Qu,requiresProject:!0},{title:"Visualizar Projeto",url:dn("projeto"),icon:ON,requiresProject:!0}],kr=({children:e})=>{var g,y;const t=qn(),r=Si(),{toast:n}=Kt(),{projeto:s,loading:o}=Jr(),{user:a,loading:l,logout:c}=So(),u=!!(s!=null&&s.id),d=(a==null?void 0:a.role)==="admin",h=f.useMemo(()=>d?[...zb,{title:"Usuários",url:dn("usuarios"),icon:Yu,requiresProject:!1}]:zb,[d]),[m,p]=f.useState(!1),b=async()=>{if(!m){p(!0);try{await c(),n({title:"Sessão encerrada"})}catch{}finally{p(!1),r("/login",{replace:!0})}}};return i.jsx(k2,{children:i.jsxs("div",{className:"min-h-screen flex w-full bg-background text-foreground",children:[i.jsxs(E2,{className:"border-r border-border bg-sidebar text-sidebar-foreground",children:[i.jsx(T2,{className:"border-b border-border p-6",children:i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-primary to-primary/80 rounded-xl flex items-center justify-center shadow-lg shadow-primary/30",children:i.jsx(DN,{className:"w-5 h-5 text-primary-foreground"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"font-bold text-lg text-foreground",children:"Roehn"}),i.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Gerenciador de Projetos"})]})]}),i.jsx($b,{})]})}),i.jsx(A2,{className:"p-4",children:i.jsxs(R2,{children:[i.jsx(M2,{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider px-3 py-3",children:"Navegação"}),i.jsx(O2,{children:i.jsx(D2,{className:"space-y-1",children:h.map(v=>{const x=t.pathname===v.url||t.pathname.startsWith(v.url+"/"),w=o||l,j=v.requiresProject&&(w||!u),S=["transition-all duration-200 rounded-xl h-11","hover:bg-muted hover:text-foreground",x?"bg-primary text-primary-foreground shadow-lg hover:bg-primary/90":"text-muted-foreground",j?"opacity-60":""].join(" ");return i.jsx(I2,{children:i.jsx(L2,{asChild:!0,className:S,children:i.jsxs(pv,{to:v.url,onClick:N=>{j&&(N.preventDefault(),n({title:"Selecione um projeto",description:"Algumas seções exigem um projeto ativo."}),r("/",{replace:!1}))},className:"flex items-center gap-3 px-4",children:[i.jsx(v.icon,{className:"w-4 h-4"}),i.jsx("span",{className:"font-medium",children:v.title})]})})},v.title)})})})]})}),i.jsxs(P2,{className:"border-t border-border p-4",children:[i.jsxs("div",{className:"flex items-center gap-3 px-2 mb-3",children:[i.jsx("div",{className:"w-9 h-9 bg-muted rounded-full flex items-center justify-center",children:i.jsx("span",{className:"text-muted-foreground font-semibold text-sm",children:l?"":((y=(g=a==null?void 0:a.username)==null?void 0:g.charAt(0))==null?void 0:y.toUpperCase())||"U"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-semibold text-sm truncate text-foreground",children:l?"Carregando...":(a==null?void 0:a.username)||"Usuário"}),i.jsx("p",{className:"text-xs text-muted-foreground truncate",children:l?"":a!=null&&a.role?`Função: ${a.role}`:"Gerenciar projetos"})]})]}),i.jsxs(de,{variant:"outline",size:"sm",className:"w-full justify-center rounded-xl border-border text-foreground",onClick:b,disabled:m,children:[i.jsx(q0,{className:"w-4 h-4 mr-2"}),m?"Saindo...":"Sair"]})]})]}),i.jsxs("main",{className:"flex-1 flex flex-col bg-background",children:[i.jsx("header",{className:"bg-card/90 backdrop-blur-sm border-b border-border px-6 py-4 lg:hidden",children:i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(_2,{className:"hover:bg-muted p-2 rounded-xl transition-colors duration-200"}),i.jsx("h1",{className:"text-xl font-bold text-foreground",children:"Roehn"}),i.jsx($b,{}),i.jsx(de,{variant:"ghost",size:"icon",className:"ml-auto",onClick:b,disabled:m,title:"Sair",children:i.jsx(q0,{className:"w-5 h-5"})})]})}),i.jsx("div",{className:"flex-1 overflow-auto",children:e})]})]})})},ot=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:he("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ot.displayName="Card";const it=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:he("flex flex-col space-y-1.5 p-6",e),...t}));it.displayName="CardHeader";const gt=f.forwardRef(({className:e,...t},r)=>i.jsx("h3",{ref:r,className:he("text-2xl font-semibold leading-none tracking-tight",e),...t}));gt.displayName="CardTitle";const ZL=f.forwardRef(({className:e,...t},r)=>i.jsx("p",{ref:r,className:he("text-sm text-muted-foreground",e),...t}));ZL.displayName="CardDescription";const at=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:he("p-6 pt-0",e),...t}));at.displayName="CardContent";const YL=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:he("flex items-center p-6 pt-0",e),...t}));YL.displayName="CardFooter";var XL="Label",F2=f.forwardRef((e,t)=>i.jsx(Te.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));F2.displayName=XL;var V2=F2;const JL=ji("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),le=f.forwardRef(({className:e,...t},r)=>i.jsx(V2,{ref:r,className:he(JL(),e),...t}));le.displayName=V2.displayName;const e3=ji("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),en=f.forwardRef(({className:e,variant:t,...r},n)=>i.jsx("div",{ref:n,role:"alert",className:he(e3({variant:t}),e),...r}));en.displayName="Alert";const t3=f.forwardRef(({className:e,...t},r)=>i.jsx("h5",{ref:r,className:he("mb-1 font-medium leading-none tracking-tight",e),...t}));t3.displayName="AlertTitle";const tn=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:he("text-sm [&_p]:leading-relaxed",e),...t}));tn.displayName="AlertDescription";const Nv=f.createContext({});function Cv(e){const t=f.useRef(null);return t.current===null&&(t.current=e()),t.current}const kv=typeof window<"u",$2=kv?f.useLayoutEffect:f.useEffect,Uf=f.createContext(null);function Ev(e,t){e.indexOf(t)===-1&&e.push(t)}function _v(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const ps=(e,t,r)=>r>t?t:r{};const gs={},z2=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function B2(e){return typeof e=="object"&&e!==null}const U2=e=>/^0[^.\s]+$/u.test(e);function Tv(e){let t;return()=>(t===void 0&&(t=e()),t)}const Zr=e=>e,r3=(e,t)=>r=>t(e(r)),Gc=(...e)=>e.reduce(r3),Sc=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n};class Pv{constructor(){this.subscriptions=[]}add(t){return Ev(this.subscriptions,t),()=>_v(this.subscriptions,t)}notify(t,r,n){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,r,n);else for(let o=0;oe*1e3,$n=e=>e/1e3;function H2(e,t){return t?e*(1e3/t):0}const W2=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,n3=1e-7,s3=12;function o3(e,t,r,n,s){let o,a,l=0;do a=t+(r-t)/2,o=W2(a,n,s)-e,o>0?r=a:t=a;while(Math.abs(o)>n3&&++lo3(o,0,1,e,r);return o=>o===0||o===1?o:W2(s(o),t,n)}const K2=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,q2=e=>t=>1-e(1-t),G2=Qc(.33,1.53,.69,.99),Av=q2(G2),Q2=K2(Av),Z2=e=>(e*=2)<1?.5*Av(e):.5*(2-Math.pow(2,-10*(e-1))),Rv=e=>1-Math.sin(Math.acos(e)),Y2=q2(Rv),X2=K2(Rv),i3=Qc(.42,0,1,1),a3=Qc(0,0,.58,1),J2=Qc(.42,0,.58,1),l3=e=>Array.isArray(e)&&typeof e[0]!="number",ek=e=>Array.isArray(e)&&typeof e[0]=="number",Bb={linear:Zr,easeIn:i3,easeInOut:J2,easeOut:a3,circIn:Rv,circInOut:X2,circOut:Y2,backIn:Av,backInOut:Q2,backOut:G2,anticipate:Z2},c3=e=>typeof e=="string",Ub=e=>{if(ek(e)){Ud(e.length===4);const[t,r,n,s]=e;return Qc(t,r,n,s)}else if(c3(e))return Ud(Bb[e]!==void 0),Bb[e];return e},Au=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Hb={value:null,addProjectionMetrics:null};function u3(e,t){let r=new Set,n=new Set,s=!1,o=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(h){a.has(h)&&(d.schedule(h),e()),c++,h(l)}const d={schedule:(h,m=!1,p=!1)=>{const g=p&&s?r:n;return m&&a.add(h),g.has(h)||g.add(h),h},cancel:h=>{n.delete(h),a.delete(h)},process:h=>{if(l=h,s){o=!0;return}s=!0,[r,n]=[n,r],r.forEach(u),t&&Hb.value&&Hb.value.frameloop[t].push(c),c=0,r.clear(),s=!1,o&&(o=!1,d.process(h))}};return d}const d3=40;function tk(e,t){let r=!1,n=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>r=!0,a=Au.reduce((w,j)=>(w[j]=u3(o,t?j:void 0),w),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:h,preRender:m,render:p,postRender:b}=a,g=()=>{const w=gs.useManualTiming?s.timestamp:performance.now();r=!1,gs.useManualTiming||(s.delta=n?1e3/60:Math.max(Math.min(w-s.timestamp,d3),1)),s.timestamp=w,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),h.process(s),m.process(s),p.process(s),b.process(s),s.isProcessing=!1,r&&t&&(n=!1,e(g))},y=()=>{r=!0,n=!0,s.isProcessing||e(g)};return{schedule:Au.reduce((w,j)=>{const S=a[j];return w[j]=(N,C=!1,_=!1)=>(r||y(),S.schedule(N,C,_)),w},{}),cancel:w=>{for(let j=0;j(rd===void 0&&xr.set(Ut.isProcessing||gs.useManualTiming?Ut.timestamp:performance.now()),rd),set:e=>{rd=e,queueMicrotask(f3)}},rk=e=>t=>typeof t=="string"&&t.startsWith(e),Mv=rk("--"),h3=rk("var(--"),Ov=e=>h3(e)?m3.test(e.split("/*")[0].trim()):!1,m3=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,al={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Nc={...al,transform:e=>ps(0,1,e)},Ru={...al,default:1},ql=e=>Math.round(e*1e5)/1e5,Dv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function p3(e){return e==null}const g3=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Iv=(e,t)=>r=>!!(typeof r=="string"&&g3.test(r)&&r.startsWith(e)||t&&!p3(r)&&Object.prototype.hasOwnProperty.call(r,t)),nk=(e,t,r)=>n=>{if(typeof n!="string")return n;const[s,o,a,l]=n.match(Dv);return{[e]:parseFloat(s),[t]:parseFloat(o),[r]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},x3=e=>ps(0,255,e),em={...al,transform:e=>Math.round(x3(e))},Lo={test:Iv("rgb","red"),parse:nk("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+em.transform(e)+", "+em.transform(t)+", "+em.transform(r)+", "+ql(Nc.transform(n))+")"};function v3(e){let t="",r="",n="",s="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),s=e.substring(4,5),t+=t,r+=r,n+=n,s+=s),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}}const tg={test:Iv("#"),parse:v3,transform:Lo.transform},Zc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ps=Zc("deg"),zn=Zc("%"),Me=Zc("px"),y3=Zc("vh"),b3=Zc("vw"),Wb={...zn,parse:e=>zn.parse(e)/100,transform:e=>zn.transform(e*100)},Yi={test:Iv("hsl","hue"),parse:nk("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+zn.transform(ql(t))+", "+zn.transform(ql(r))+", "+ql(Nc.transform(n))+")"},Rt={test:e=>Lo.test(e)||tg.test(e)||Yi.test(e),parse:e=>Lo.test(e)?Lo.parse(e):Yi.test(e)?Yi.parse(e):tg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Lo.transform(e):Yi.transform(e),getAnimatableNone:e=>{const t=Rt.parse(e);return t.alpha=0,Rt.transform(t)}},w3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function j3(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Dv))==null?void 0:t.length)||0)+(((r=e.match(w3))==null?void 0:r.length)||0)>0}const sk="number",ok="color",S3="var",N3="var(",Kb="${}",C3=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Cc(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},s=[];let o=0;const l=t.replace(C3,c=>(Rt.test(c)?(n.color.push(o),s.push(ok),r.push(Rt.parse(c))):c.startsWith(N3)?(n.var.push(o),s.push(S3),r.push(c)):(n.number.push(o),s.push(sk),r.push(parseFloat(c))),++o,Kb)).split(Kb);return{values:r,split:l,indexes:n,types:s}}function ik(e){return Cc(e).values}function ak(e){const{split:t,types:r}=Cc(e),n=t.length;return s=>{let o="";for(let a=0;atypeof e=="number"?0:Rt.test(e)?Rt.getAnimatableNone(e):e;function E3(e){const t=ik(e);return ak(e)(t.map(k3))}const po={test:j3,parse:ik,createTransformer:ak,getAnimatableNone:E3};function tm(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function _3({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let s=0,o=0,a=0;if(!t)s=o=a=r;else{const l=r<.5?r*(1+t):r+t-r*t,c=2*r-l;s=tm(c,l,e+1/3),o=tm(c,l,e),a=tm(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:n}}function Hd(e,t){return r=>r>0?t:e}const bt=(e,t,r)=>e+(t-e)*r,rm=(e,t,r)=>{const n=e*e,s=r*(t*t-n)+n;return s<0?0:Math.sqrt(s)},T3=[tg,Lo,Yi],P3=e=>T3.find(t=>t.test(e));function qb(e){const t=P3(e);if(!t)return!1;let r=t.parse(e);return t===Yi&&(r=_3(r)),r}const Gb=(e,t)=>{const r=qb(e),n=qb(t);if(!r||!n)return Hd(e,t);const s={...r};return o=>(s.red=rm(r.red,n.red,o),s.green=rm(r.green,n.green,o),s.blue=rm(r.blue,n.blue,o),s.alpha=bt(r.alpha,n.alpha,o),Lo.transform(s))},rg=new Set(["none","hidden"]);function A3(e,t){return rg.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function R3(e,t){return r=>bt(e,t,r)}function Lv(e){return typeof e=="number"?R3:typeof e=="string"?Ov(e)?Hd:Rt.test(e)?Gb:D3:Array.isArray(e)?lk:typeof e=="object"?Rt.test(e)?Gb:M3:Hd}function lk(e,t){const r=[...e],n=r.length,s=e.map((o,a)=>Lv(o)(o,t[a]));return o=>{for(let a=0;a{for(const o in n)r[o]=n[o](s);return r}}function O3(e,t){const r=[],n={color:0,var:0,number:0};for(let s=0;s{const r=po.createTransformer(t),n=Cc(e),s=Cc(t);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?rg.has(e)&&!s.values.length||rg.has(t)&&!n.values.length?A3(e,t):Gc(lk(O3(n,s),s.values),r):Hd(e,t)};function ck(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?bt(e,t,r):Lv(e)(e,t)}const I3=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>pt.update(t,r),stop:()=>mo(t),now:()=>Ut.isProcessing?Ut.timestamp:xr.now()}},uk=(e,t,r=10)=>{let n="";const s=Math.max(Math.round(t/r),2);for(let o=0;o=Wd?1/0:t}function L3(e,t=100,r){const n=r({...e,keyframes:[0,t]}),s=Math.min(Fv(n),Wd);return{type:"keyframes",ease:o=>n.next(s*o).value/t,duration:$n(s)}}const F3=5;function dk(e,t,r){const n=Math.max(t-F3,0);return H2(r-e(n),t-n)}const Nt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},nm=.001;function V3({duration:e=Nt.duration,bounce:t=Nt.bounce,velocity:r=Nt.velocity,mass:n=Nt.mass}){let s,o,a=1-t;a=ps(Nt.minDamping,Nt.maxDamping,a),e=ps(Nt.minDuration,Nt.maxDuration,$n(e)),a<1?(s=u=>{const d=u*a,h=d*e,m=d-r,p=ng(u,a),b=Math.exp(-h);return nm-m/p*b},o=u=>{const h=u*a*e,m=h*r+r,p=Math.pow(a,2)*Math.pow(u,2)*e,b=Math.exp(-h),g=ng(Math.pow(u,2),a);return(-s(u)+nm>0?-1:1)*((m-p)*b)/g}):(s=u=>{const d=Math.exp(-u*e),h=(u-r)*e+1;return-nm+d*h},o=u=>{const d=Math.exp(-u*e),h=(r-u)*(e*e);return d*h});const l=5/e,c=z3(s,o,l);if(e=Vn(e),isNaN(c))return{stiffness:Nt.stiffness,damping:Nt.damping,duration:e};{const u=Math.pow(c,2)*n;return{stiffness:u,damping:a*2*Math.sqrt(n*u),duration:e}}}const $3=12;function z3(e,t,r){let n=r;for(let s=1;s<$3;s++)n=n-e(n)/t(n);return n}function ng(e,t){return e*Math.sqrt(1-t*t)}const B3=["duration","bounce"],U3=["stiffness","damping","mass"];function Qb(e,t){return t.some(r=>e[r]!==void 0)}function H3(e){let t={velocity:Nt.velocity,stiffness:Nt.stiffness,damping:Nt.damping,mass:Nt.mass,isResolvedFromDuration:!1,...e};if(!Qb(e,U3)&&Qb(e,B3))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),s=n*n,o=2*ps(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Nt.mass,stiffness:s,damping:o}}else{const r=V3(e);t={...t,...r,mass:Nt.mass},t.isResolvedFromDuration=!0}return t}function Kd(e=Nt.visualDuration,t=Nt.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:s}=r;const o=r.keyframes[0],a=r.keyframes[r.keyframes.length-1],l={done:!1,value:o},{stiffness:c,damping:u,mass:d,duration:h,velocity:m,isResolvedFromDuration:p}=H3({...r,velocity:-$n(r.velocity||0)}),b=m||0,g=u/(2*Math.sqrt(c*d)),y=a-o,v=$n(Math.sqrt(c/d)),x=Math.abs(y)<5;n||(n=x?Nt.restSpeed.granular:Nt.restSpeed.default),s||(s=x?Nt.restDelta.granular:Nt.restDelta.default);let w;if(g<1){const S=ng(v,g);w=N=>{const C=Math.exp(-g*v*N);return a-C*((b+g*v*y)/S*Math.sin(S*N)+y*Math.cos(S*N))}}else if(g===1)w=S=>a-Math.exp(-v*S)*(y+(b+v*y)*S);else{const S=v*Math.sqrt(g*g-1);w=N=>{const C=Math.exp(-g*v*N),_=Math.min(S*N,300);return a-C*((b+g*v*y)*Math.sinh(_)+S*y*Math.cosh(_))/S}}const j={calculatedDuration:p&&h||null,next:S=>{const N=w(S);if(p)l.done=S>=h;else{let C=S===0?b:0;g<1&&(C=S===0?Vn(b):dk(w,S,N));const _=Math.abs(C)<=n,$=Math.abs(a-N)<=s;l.done=_&&$}return l.value=l.done?a:N,l},toString:()=>{const S=Math.min(Fv(j),Wd),N=uk(C=>j.next(S*C).value,S,30);return S+"ms "+N},toTransition:()=>{}};return j}Kd.applyToOptions=e=>{const t=L3(e,100,Kd);return e.ease=t.ease,e.duration=Vn(t.duration),e.type="keyframes",e};function sg({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const h=e[0],m={done:!1,value:h},p=_=>l!==void 0&&_c,b=_=>l===void 0?c:c===void 0||Math.abs(l-_)-g*Math.exp(-_/n),w=_=>v+x(_),j=_=>{const $=x(_),D=w(_);m.done=Math.abs($)<=u,m.value=m.done?v:D};let S,N;const C=_=>{p(m.value)&&(S=_,N=Kd({keyframes:[m.value,b(m.value)],velocity:dk(w,_,m.value),damping:s,stiffness:o,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:_=>{let $=!1;return!N&&S===void 0&&($=!0,j(_),C(_)),S!==void 0&&_>=S?N.next(_-S):(!$&&j(_),m)}}}function W3(e,t,r){const n=[],s=r||gs.mix||ck,o=e.length-1;for(let a=0;at[0];if(o===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=W3(t,n,s),c=l.length,u=d=>{if(a&&d1)for(;hu(ps(e[0],e[o-1],d)):u}function q3(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const s=Sc(0,t,n);e.push(bt(r,1,s))}}function G3(e){const t=[0];return q3(t,e.length-1),t}function Q3(e,t){return e.map(r=>r*t)}function Z3(e,t){return e.map(()=>t||J2).splice(0,e.length-1)}function Gl({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const s=l3(n)?n.map(Ub):Ub(n),o={done:!1,value:t[0]},a=Q3(r&&r.length===t.length?r:G3(t),e),l=K3(a,t,{ease:Array.isArray(s)?s:Z3(t,s)});return{calculatedDuration:e,next:c=>(o.value=l(c),o.done=c>=e,o)}}const Y3=e=>e!==null;function Vv(e,{repeat:t,repeatType:r="loop"},n,s=1){const o=e.filter(Y3),l=s<0||t&&r!=="loop"&&t%2===1?0:o.length-1;return!l||n===void 0?o[l]:n}const X3={decay:sg,inertia:sg,tween:Gl,keyframes:Gl,spring:Kd};function fk(e){typeof e.type=="string"&&(e.type=X3[e.type])}class $v{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}const J3=e=>e/100;class zv extends $v{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,s;const{motionValue:r}=this.options;r&&r.updatedAt!==xr.now()&&this.tick(xr.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(n=this.options).onStop)==null||s.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;fk(t);const{type:r=Gl,repeat:n=0,repeatDelay:s=0,repeatType:o,velocity:a=0}=t;let{keyframes:l}=t;const c=r||Gl;c!==Gl&&typeof l[0]!="number"&&(this.mixKeyframes=Gc(J3,ck(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=Fv(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:s,mixKeyframes:o,mirroredGenerator:a,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:m,repeatDelay:p,type:b,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?v<0:v>s;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let w=this.currentTime,j=n;if(h){const _=Math.min(this.currentTime,s)/l;let $=Math.floor(_),D=_%1;!D&&_>=1&&(D=1),D===1&&$--,$=Math.min($,h+1),!!($%2)&&(m==="reverse"?(D=1-D,p&&(D-=p/l)):m==="mirror"&&(j=a)),w=ps(0,1,D)*l}const S=x?{done:!1,value:d[0]}:j.next(w);o&&(S.value=o(S.value));let{done:N}=S;!x&&c!==null&&(N=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return C&&b!==sg&&(S.value=Vv(d,this.options,y,this.speed)),g&&g(S.value),C&&this.finish(),S}then(t,r){return this.finished.then(t,r)}get duration(){return $n(this.calculatedDuration)}get time(){return $n(this.currentTime)}set time(t){var r;t=Vn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(xr.now());const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=$n(this.currentTime))}play(){var s,o;if(this.isStopped)return;const{driver:t=I3,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),(o=(s=this.options).onPlay)==null||o.call(s);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(xr.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}function eF(e){for(let t=1;te*180/Math.PI,og=e=>{const t=Fo(Math.atan2(e[1],e[0]));return ig(t)},tF={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:og,rotateZ:og,skewX:e=>Fo(Math.atan(e[1])),skewY:e=>Fo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ig=e=>(e=e%360,e<0&&(e+=360),e),Zb=og,Yb=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Xb=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),rF={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yb,scaleY:Xb,scale:e=>(Yb(e)+Xb(e))/2,rotateX:e=>ig(Fo(Math.atan2(e[6],e[5]))),rotateY:e=>ig(Fo(Math.atan2(-e[2],e[0]))),rotateZ:Zb,rotate:Zb,skewX:e=>Fo(Math.atan(e[4])),skewY:e=>Fo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ag(e){return e.includes("scale")?1:0}function lg(e,t){if(!e||e==="none")return ag(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,s;if(r)n=rF,s=r;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=tF,s=l}if(!s)return ag(t);const o=n[t],a=s[1].split(",").map(sF);return typeof o=="function"?o(a):a[o]}const nF=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return lg(r,t)};function sF(e){return parseFloat(e.trim())}const ll=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cl=new Set(ll),Jb=e=>e===al||e===Me,oF=new Set(["x","y","z"]),iF=ll.filter(e=>!oF.has(e));function aF(e){const t=[];return iF.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const Yo={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>lg(t,"x"),y:(e,{transform:t})=>lg(t,"y")};Yo.translateX=Yo.x;Yo.translateY=Yo.y;const Xo=new Set;let cg=!1,ug=!1,dg=!1;function hk(){if(ug){const e=Array.from(Xo).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const s=aF(n);s.length&&(r.set(n,s),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const s=r.get(n);s&&s.forEach(([o,a])=>{var l;(l=n.getValue(o))==null||l.set(a)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}ug=!1,cg=!1,Xo.forEach(e=>e.complete(dg)),Xo.clear()}function mk(){Xo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ug=!0)})}function lF(){dg=!0,mk(),hk(),dg=!1}class Bv{constructor(t,r,n,s,o,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=s,this.element=o,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Xo.add(this),cg||(cg=!0,pt.read(mk),pt.resolveKeyframes(hk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:s}=this;if(t[0]===null){const o=s==null?void 0:s.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(n&&r){const l=n.readValue(r,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}eF(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Xo.delete(this)}cancel(){this.state==="scheduled"&&(Xo.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const cF=e=>e.startsWith("--");function uF(e,t,r){cF(t)?e.style.setProperty(t,r):e.style[t]=r}const dF=Tv(()=>window.ScrollTimeline!==void 0),fF={};function hF(e,t){const r=Tv(e);return()=>fF[t]??r()}const pk=hF(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ml=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,ew={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ml([0,.65,.55,1]),circOut:Ml([.55,0,1,.45]),backIn:Ml([.31,.01,.66,-.59]),backOut:Ml([.33,1.53,.69,.99])};function gk(e,t){if(e)return typeof e=="function"?pk()?uk(e,t):"ease-out":ek(e)?Ml(e):Array.isArray(e)?e.map(r=>gk(r,t)||ew.easeOut):ew[e]}function mF(e,t,r,{delay:n=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:r};c&&(d.offset=c);const h=gk(l,s);Array.isArray(h)&&(d.easing=h);const m={delay:n,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"};return u&&(m.pseudoElement=u),e.animate(d,m)}function xk(e){return typeof e=="function"&&"applyToOptions"in e}function pF({type:e,...t}){return xk(e)&&pk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class gF extends $v{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:r,name:n,keyframes:s,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=a,this.options=t,Ud(typeof t.type!="string");const u=pF(t);this.animation=mF(r,n,s,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const d=Vv(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):uF(r,n,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,r;this.isPseudoElement||(r=(t=this.animation).commitStyles)==null||r.call(t)}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return $n(Number(t))}get time(){return $n(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Vn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&dF()?(this.animation.timeline=t,Zr):r(this)}}const vk={anticipate:Z2,backInOut:Q2,circInOut:X2};function xF(e){return e in vk}function vF(e){typeof e.ease=="string"&&xF(e.ease)&&(e.ease=vk[e.ease])}const tw=10;class yF extends gF{constructor(t){vF(t),fk(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:s,element:o,...a}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const l=new zv({...a,autoplay:!1}),c=Vn(this.finishedTime??this.time);r.setWithVelocity(l.sample(c-tw).value,l.sample(c).value,tw),l.stop()}}const rw=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(po.test(e)||e==="0")&&!e.startsWith("url("));function bF(e){const t=e[0];if(e.length===1)return!0;for(let r=0;rObject.hasOwnProperty.call(Element.prototype,"animate"));function NF(e){var d;const{motionValue:t,name:r,repeatDelay:n,repeatType:s,damping:o,type:a}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return SF()&&r&&jF.has(r)&&(r!=="transform"||!u)&&!c&&!n&&s!=="mirror"&&o!==0&&a!=="inertia"}const CF=40;class kF extends $v{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",keyframes:l,name:c,motionValue:u,element:d,...h}){var b;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=xr.now();const m={autoplay:t,delay:r,type:n,repeat:s,repeatDelay:o,repeatType:a,name:c,motionValue:u,element:d,...h},p=(d==null?void 0:d.KeyframeResolver)||Bv;this.keyframeResolver=new p(l,(g,y,v)=>this.onKeyframesResolved(g,y,m,!v),c,u,d),(b=this.keyframeResolver)==null||b.scheduleResolve()}onKeyframesResolved(t,r,n,s){this.keyframeResolver=void 0;const{name:o,type:a,velocity:l,delay:c,isHandoff:u,onUpdate:d}=n;this.resolvedAt=xr.now(),wF(t,o,a,l)||((gs.instantAnimations||!c)&&(d==null||d(Vv(t,n,r))),t[0]=t[t.length-1],fg(n),n.repeat=0);const m={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>CF?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},p=!u&&NF(m)?new yF({...m,element:m.motionValue.owner.current}):new zv(m);p.finished.then(()=>this.notifyFinished()).catch(Zr),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),lF()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const EF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _F(e){const t=EF.exec(e);if(!t)return[,];const[,r,n,s]=t;return[`--${r??n}`,s]}function yk(e,t,r=1){const[n,s]=_F(e);if(!n)return;const o=window.getComputedStyle(t).getPropertyValue(n);if(o){const a=o.trim();return z2(a)?parseFloat(a):a}return Ov(s)?yk(s,t,r+1):s}function Uv(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const bk=new Set(["width","height","top","left","right","bottom",...ll]),TF={test:e=>e==="auto",parse:e=>e},wk=e=>t=>t.test(e),jk=[al,Me,zn,Ps,b3,y3,TF],nw=e=>jk.find(wk(e));function PF(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||U2(e):!0}const AF=new Set(["brightness","contrast","saturate","opacity"]);function RF(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(Dv)||[];if(!n)return e;const s=r.replace(n,"");let o=AF.has(t)?1:0;return n!==r&&(o*=100),t+"("+o+s+")"}const MF=/\b([a-z-]*)\(.*?\)/gu,hg={...po,getAnimatableNone:e=>{const t=e.match(MF);return t?t.map(RF).join(" "):e}},sw={...al,transform:Math.round},OF={rotate:Ps,rotateX:Ps,rotateY:Ps,rotateZ:Ps,scale:Ru,scaleX:Ru,scaleY:Ru,scaleZ:Ru,skew:Ps,skewX:Ps,skewY:Ps,distance:Me,translateX:Me,translateY:Me,translateZ:Me,x:Me,y:Me,z:Me,perspective:Me,transformPerspective:Me,opacity:Nc,originX:Wb,originY:Wb,originZ:Me},Hv={borderWidth:Me,borderTopWidth:Me,borderRightWidth:Me,borderBottomWidth:Me,borderLeftWidth:Me,borderRadius:Me,radius:Me,borderTopLeftRadius:Me,borderTopRightRadius:Me,borderBottomRightRadius:Me,borderBottomLeftRadius:Me,width:Me,maxWidth:Me,height:Me,maxHeight:Me,top:Me,right:Me,bottom:Me,left:Me,padding:Me,paddingTop:Me,paddingRight:Me,paddingBottom:Me,paddingLeft:Me,margin:Me,marginTop:Me,marginRight:Me,marginBottom:Me,marginLeft:Me,backgroundPositionX:Me,backgroundPositionY:Me,...OF,zIndex:sw,fillOpacity:Nc,strokeOpacity:Nc,numOctaves:sw},DF={...Hv,color:Rt,backgroundColor:Rt,outlineColor:Rt,fill:Rt,stroke:Rt,borderColor:Rt,borderTopColor:Rt,borderRightColor:Rt,borderBottomColor:Rt,borderLeftColor:Rt,filter:hg,WebkitFilter:hg},Sk=e=>DF[e];function Nk(e,t){let r=Sk(e);return r!==hg&&(r=po),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const IF=new Set(["auto","none","0"]);function LF(e,t,r){let n=0,s;for(;n{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function VF(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const Ck=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function kk(e){return B2(e)&&"offsetHeight"in e}const ow=30,$F=e=>!isNaN(parseFloat(e));class zF{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var o;const s=xr.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=xr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=$F(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new Pv);const n=this.events[t].add(r);return t==="change"?()=>{n(),pt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=xr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ow)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,ow);return H2(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function $a(e,t){return new zF(e,t)}const{schedule:Wv,cancel:IB}=tk(queueMicrotask,!1),fn={x:!1,y:!1};function Ek(){return fn.x||fn.y}function BF(e){return e==="x"||e==="y"?fn[e]?null:(fn[e]=!0,()=>{fn[e]=!1}):fn.x||fn.y?null:(fn.x=fn.y=!0,()=>{fn.x=fn.y=!1})}function _k(e,t){const r=VF(e),n=new AbortController,s={passive:!0,...t,signal:n.signal};return[r,s,()=>n.abort()]}function iw(e){return!(e.pointerType==="touch"||Ek())}function UF(e,t,r={}){const[n,s,o]=_k(e,r),a=l=>{if(!iw(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=h=>{iw(h)&&(u(h),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,s)};return n.forEach(l=>{l.addEventListener("pointerenter",a,s)}),o}const Tk=(e,t)=>t?e===t?!0:Tk(e,t.parentElement):!1,Kv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,HF=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function WF(e){return HF.has(e.tagName)||e.tabIndex!==-1}const nd=new WeakSet;function aw(e){return t=>{t.key==="Enter"&&e(t)}}function sm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const KF=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=aw(()=>{if(nd.has(r))return;sm(r,"down");const s=aw(()=>{sm(r,"up")}),o=()=>sm(r,"cancel");r.addEventListener("keyup",s,t),r.addEventListener("blur",o,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function lw(e){return Kv(e)&&!Ek()}function qF(e,t,r={}){const[n,s,o]=_k(e,r),a=l=>{const c=l.currentTarget;if(!lw(l))return;nd.add(c);const u=t(c,l),d=(p,b)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",m),nd.has(c)&&nd.delete(c),lw(p)&&typeof u=="function"&&u(p,{success:b})},h=p=>{d(p,c===window||c===document||r.useGlobalTarget||Tk(c,p.target))},m=p=>{d(p,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",m,s)};return n.forEach(l=>{(r.useGlobalTarget?window:l).addEventListener("pointerdown",a,s),kk(l)&&(l.addEventListener("focus",u=>KF(u,s)),!WF(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),o}function Pk(e){return B2(e)&&"ownerSVGElement"in e}function GF(e){return Pk(e)&&e.tagName==="svg"}const Xt=e=>!!(e&&e.getVelocity),QF=[...jk,Rt,po],ZF=e=>QF.find(wk(e)),qv=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class YF extends f.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=r.offsetParent,s=kk(n)&&n.offsetWidth||0,o=this.props.sizeRef.current;o.height=r.offsetHeight||0,o.width=r.offsetWidth||0,o.top=r.offsetTop,o.left=r.offsetLeft,o.right=s-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function XF({children:e,isPresent:t,anchorX:r,root:n}){const s=f.useId(),o=f.useRef(null),a=f.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=f.useContext(qv);return f.useInsertionEffect(()=>{const{width:c,height:u,top:d,left:h,right:m}=a.current;if(t||!o.current||!c||!u)return;const p=r==="left"?`left: ${h}`:`right: ${m}`;o.current.dataset.motionPopId=s;const b=document.createElement("style");l&&(b.nonce=l);const g=n??document.head;return g.appendChild(b),b.sheet&&b.sheet.insertRule(` + [data-motion-pop-id="${s}"] { + position: absolute !important; + width: ${c}px !important; + height: ${u}px !important; + ${p}px !important; + top: ${d}px !important; + } + `),()=>{g.contains(b)&&g.removeChild(b)}},[t]),i.jsx(YF,{isPresent:t,childRef:o,sizeRef:a,children:f.cloneElement(e,{ref:o})})}const JF=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:s,presenceAffectsLayout:o,mode:a,anchorX:l,root:c})=>{const u=Cv(eV),d=f.useId();let h=!0,m=f.useMemo(()=>(h=!1,{id:d,initial:t,isPresent:r,custom:s,onExitComplete:p=>{u.set(p,!0);for(const b of u.values())if(!b)return;n&&n()},register:p=>(u.set(p,!1),()=>u.delete(p))}),[r,u,n]);return o&&h&&(m={...m}),f.useMemo(()=>{u.forEach((p,b)=>u.set(b,!1))},[r]),f.useEffect(()=>{!r&&!u.size&&n&&n()},[r]),a==="popLayout"&&(e=i.jsx(XF,{isPresent:r,anchorX:l,root:c,children:e})),i.jsx(Uf.Provider,{value:m,children:e})};function eV(){return new Map}function Ak(e=!0){const t=f.useContext(Uf);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:s}=t,o=f.useId();f.useEffect(()=>{if(e)return s(o)},[e]);const a=f.useCallback(()=>e&&n&&n(o),[o,n,e]);return!r&&n?[!1,a]:[!0]}const Mu=e=>e.key||"";function cw(e){const t=[];return f.Children.forEach(e,r=>{f.isValidElement(r)&&t.push(r)}),t}const Ir=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:s=!0,mode:o="sync",propagate:a=!1,anchorX:l="left",root:c})=>{const[u,d]=Ak(a),h=f.useMemo(()=>cw(e),[e]),m=a&&!u?[]:h.map(Mu),p=f.useRef(!0),b=f.useRef(h),g=Cv(()=>new Map),[y,v]=f.useState(h),[x,w]=f.useState(h);$2(()=>{p.current=!1,b.current=h;for(let N=0;N{const C=Mu(N),_=a&&!u?!1:h===x||m.includes(C),$=()=>{if(g.has(C))g.set(C,!0);else return;let D=!0;g.forEach(z=>{z||(D=!1)}),D&&(S==null||S(),w(b.current),a&&(d==null||d()),n&&n())};return i.jsx(JF,{isPresent:_,initial:!p.current||r?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:c,onExitComplete:_?void 0:$,anchorX:l,children:N},C)})})},Rk=f.createContext({strict:!1}),uw={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},za={};for(const e in uw)za[e]={isEnabled:t=>uw[e].some(r=>!!t[r])};function tV(e){for(const t in e)za[t]={...za[t],...e[t]}}const rV=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function qd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||rV.has(e)}let Mk=e=>!qd(e);function nV(e){typeof e=="function"&&(Mk=t=>t.startsWith("on")?!qd(t):e(t))}try{nV(require("@emotion/is-prop-valid").default)}catch{}function sV(e,t,r){const n={};for(const s in e)s==="values"&&typeof e.values=="object"||(Mk(s)||r===!0&&qd(s)||!t&&!qd(s)||e.draggable&&s.startsWith("onDrag"))&&(n[s]=e[s]);return n}const Hf=f.createContext({});function Wf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function kc(e){return typeof e=="string"||Array.isArray(e)}const Gv=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Qv=["initial",...Gv];function Kf(e){return Wf(e.animate)||Qv.some(t=>kc(e[t]))}function Ok(e){return!!(Kf(e)||e.variants)}function oV(e,t){if(Kf(e)){const{initial:r,animate:n}=e;return{initial:r===!1||kc(r)?r:void 0,animate:kc(n)?n:void 0}}return e.inherit!==!1?t:{}}function iV(e){const{initial:t,animate:r}=oV(e,f.useContext(Hf));return f.useMemo(()=>({initial:t,animate:r}),[dw(t),dw(r)])}function dw(e){return Array.isArray(e)?e.join(" "):e}const Ec={};function aV(e){for(const t in e)Ec[t]=e[t],Mv(t)&&(Ec[t].isCSSVariable=!0)}function Dk(e,{layout:t,layoutId:r}){return cl.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Ec[e]||e==="opacity")}const lV={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},cV=ll.length;function uV(e,t,r){let n="",s=!0;for(let o=0;o({style:{},transform:{},transformOrigin:{},vars:{}});function Ik(e,t,r){for(const n in t)!Xt(t[n])&&!Dk(n,r)&&(e[n]=t[n])}function dV({transformTemplate:e},t){return f.useMemo(()=>{const r=Yv();return Zv(r,t,e),Object.assign({},r.vars,r.style)},[t])}function fV(e,t){const r=e.style||{},n={};return Ik(n,r,e),Object.assign(n,dV(e,t)),n}function hV(e,t){const r={},n=fV(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}const mV={offset:"stroke-dashoffset",array:"stroke-dasharray"},pV={offset:"strokeDashoffset",array:"strokeDasharray"};function gV(e,t,r=1,n=0,s=!0){e.pathLength=1;const o=s?mV:pV;e[o.offset]=Me.transform(-n);const a=Me.transform(t),l=Me.transform(r);e[o.array]=`${a} ${l}`}function Lk(e,{attrX:t,attrY:r,attrScale:n,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...l},c,u,d){if(Zv(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m}=e;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox),t!==void 0&&(h.x=t),r!==void 0&&(h.y=r),n!==void 0&&(h.scale=n),s!==void 0&&gV(h,s,o,a,!1)}const Fk=()=>({...Yv(),attrs:{}}),Vk=e=>typeof e=="string"&&e.toLowerCase()==="svg";function xV(e,t,r,n){const s=f.useMemo(()=>{const o=Fk();return Lk(o,t,Vk(n),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Ik(o,e.style,e),s.style={...o,...s.style}}return s}const vV=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Xv(e){return typeof e!="string"||e.includes("-")?!1:!!(vV.indexOf(e)>-1||/[A-Z]/u.test(e))}function yV(e,t,r,{latestValues:n},s,o=!1){const l=(Xv(e)?xV:hV)(t,n,s,e),c=sV(t,typeof e=="string",o),u=e!==f.Fragment?{...c,...l,ref:r}:{},{children:d}=t,h=f.useMemo(()=>Xt(d)?d.get():d,[d]);return f.createElement(e,{...u,children:h})}function fw(e){const t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function Jv(e,t,r,n){if(typeof t=="function"){const[s,o]=fw(n);t=t(r!==void 0?r:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=fw(n);t=t(r!==void 0?r:e.custom,s,o)}return t}function sd(e){return Xt(e)?e.get():e}function bV({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,s){return{latestValues:wV(r,n,s,e),renderState:t()}}function wV(e,t,r,n){const s={},o=n(e,{});for(const m in o)s[m]=sd(o[m]);let{initial:a,animate:l}=e;const c=Kf(e),u=Ok(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=r?r.initial===!1:!1;d=d||a===!1;const h=d?l:a;if(h&&typeof h!="boolean"&&!Wf(h)){const m=Array.isArray(h)?h:[h];for(let p=0;p(t,r)=>{const n=f.useContext(Hf),s=f.useContext(Uf),o=()=>bV(e,t,n,s);return r?o():Cv(o)};function ey(e,t,r){var o;const{style:n}=e,s={};for(const a in n)(Xt(n[a])||t.style&&Xt(t.style[a])||Dk(a,e)||((o=r==null?void 0:r.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(s[a]=n[a]);return s}const jV=$k({scrapeMotionValuesFromProps:ey,createRenderState:Yv});function zk(e,t,r){const n=ey(e,t,r);for(const s in e)if(Xt(e[s])||Xt(t[s])){const o=ll.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;n[o]=e[s]}return n}const SV=$k({scrapeMotionValuesFromProps:zk,createRenderState:Fk}),NV=Symbol.for("motionComponentSymbol");function Xi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function CV(e,t,r){return f.useCallback(n=>{n&&e.onMount&&e.onMount(n),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):Xi(r)&&(r.current=n))},[t])}const ty=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),kV="framerAppearId",Bk="data-"+ty(kV),Uk=f.createContext({});function EV(e,t,r,n,s){var g,y;const{visualElement:o}=f.useContext(Hf),a=f.useContext(Rk),l=f.useContext(Uf),c=f.useContext(qv).reducedMotion,u=f.useRef(null);n=n||a.renderer,!u.current&&n&&(u.current=n(e,{visualState:t,parent:o,props:r,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,h=f.useContext(Uk);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&_V(u.current,r,s,h);const m=f.useRef(!1);f.useInsertionEffect(()=>{d&&m.current&&d.update(r,l)});const p=r[Bk],b=f.useRef(!!p&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,p))&&((y=window.MotionHasOptimisedAnimation)==null?void 0:y.call(window,p)));return $2(()=>{d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),b.current&&d.animationState&&d.animationState.animateChanges())}),f.useEffect(()=>{d&&(!b.current&&d.animationState&&d.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var v;(v=window.MotionHandoffMarkAsComplete)==null||v.call(window,p)}),b.current=!1),d.enteringChildren=void 0)}),d}function _V(e,t,r,n){const{layoutId:s,layout:o,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:Hk(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!a||l&&Xi(l),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:n,crossfade:d,layoutScroll:c,layoutRoot:u})}function Hk(e){if(e)return e.options.allowProjection!==!1?e.projection:Hk(e.parent)}function om(e,{forwardMotionProps:t=!1}={},r,n){r&&tV(r);const s=Xv(e)?SV:jV;function o(l,c){let u;const d={...f.useContext(qv),...l,layoutId:TV(l)},{isStatic:h}=d,m=iV(l),p=s(l,h);if(!h&&kv){PV();const b=AV(d);u=b.MeasureLayout,m.visualElement=EV(e,p,d,n,b.ProjectionNode)}return i.jsxs(Hf.Provider,{value:m,children:[u&&m.visualElement?i.jsx(u,{visualElement:m.visualElement,...d}):null,yV(e,l,CV(p,m.visualElement,c),p,h,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const a=f.forwardRef(o);return a[NV]=e,a}function TV({layoutId:e}){const t=f.useContext(Nv).id;return t&&e!==void 0?t+"-"+e:e}function PV(e,t){f.useContext(Rk).strict}function AV(e){const{drag:t,layout:r}=za;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:t!=null&&t.isEnabled(e)||r!=null&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function RV(e,t){if(typeof Proxy>"u")return om;const r=new Map,n=(o,a)=>om(o,a,e,t),s=(o,a)=>n(o,a);return new Proxy(s,{get:(o,a)=>a==="create"?n:(r.has(a)||r.set(a,om(a,void 0,e,t)),r.get(a))})}function Wk({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function MV({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function OV(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function im(e){return e===void 0||e===1}function mg({scale:e,scaleX:t,scaleY:r}){return!im(e)||!im(t)||!im(r)}function Ro(e){return mg(e)||Kk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Kk(e){return hw(e.x)||hw(e.y)}function hw(e){return e&&e!=="0%"}function Gd(e,t,r){const n=e-r,s=t*n;return r+s}function mw(e,t,r,n,s){return s!==void 0&&(e=Gd(e,s,n)),Gd(e,r,n)+t}function pg(e,t=0,r=1,n,s){e.min=mw(e.min,t,r,n,s),e.max=mw(e.max,t,r,n,s)}function qk(e,{x:t,y:r}){pg(e.x,t.translate,t.scale,t.originPoint),pg(e.y,r.translate,r.scale,r.originPoint)}const pw=.999999999999,gw=1.0000000000001;function DV(e,t,r,n=!1){const s=r.length;if(!s)return;t.x=t.y=1;let o,a;for(let l=0;lpw&&(t.x=1),t.ypw&&(t.y=1)}function Ji(e,t){e.min=e.min+t,e.max=e.max+t}function xw(e,t,r,n,s=.5){const o=bt(e.min,e.max,s);pg(e,t,r,o,n)}function ea(e,t){xw(e.x,t.x,t.scaleX,t.scale,t.originX),xw(e.y,t.y,t.scaleY,t.scale,t.originY)}function Gk(e,t){return Wk(OV(e.getBoundingClientRect(),t))}function IV(e,t,r){const n=Gk(e,r),{scroll:s}=t;return s&&(Ji(n.x,s.offset.x),Ji(n.y,s.offset.y)),n}const vw=()=>({translate:0,scale:1,origin:0,originPoint:0}),ta=()=>({x:vw(),y:vw()}),yw=()=>({min:0,max:0}),_t=()=>({x:yw(),y:yw()}),gg={current:null},Qk={current:!1};function LV(){if(Qk.current=!0,!!kv)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>gg.current=e.matches;e.addEventListener("change",t),t()}else gg.current=!1}const FV=new WeakMap;function VV(e,t,r){for(const n in t){const s=t[n],o=r[n];if(Xt(s))e.addValue(n,s);else if(Xt(o))e.addValue(n,$a(s,{owner:e}));else if(o!==s)if(e.hasValue(n)){const a=e.getValue(n);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(n);e.addValue(n,$a(a!==void 0?a:s,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const bw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class $V{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Bv,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=xr.now();this.renderScheduledAtthis.bindToMotionValue(s,n)),Qk.current||LV(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gg.current,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),mo(this.notifyUpdate),mo(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=cl.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=r.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&pt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in za){const r=za[t];if(!r)continue;const{isEnabled:n,Feature:s}=r;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):_t()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(t)}addValue(t,r){const n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=$a(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(z2(n)||U2(n))?n=parseFloat(n):!ZF(n)&&po.test(r)&&(n=Nk(t,r)),this.setBaseTarget(t,Xt(n)?n.get():n)),Xt(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var o;const{initial:r}=this.props;let n;if(typeof r=="string"||typeof r=="object"){const a=Jv(this.props,r,(o=this.presenceContext)==null?void 0:o.custom);a&&(n=a[t])}if(r&&n!==void 0)return n;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Xt(s)?s:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Pv),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){Wv.render(this.render)}}class Zk extends $V{constructor(){super(...arguments),this.KeyframeResolver=FF}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Xt(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function Yk(e,{style:t,vars:r},n,s){const o=e.style;let a;for(a in t)o[a]=t[a];s==null||s.applyProjectionStyles(o,n);for(a in r)o.setProperty(a,r[a])}function zV(e){return window.getComputedStyle(e)}class BV extends Zk{constructor(){super(...arguments),this.type="html",this.renderInstance=Yk}readValueFromInstance(t,r){var n;if(cl.has(r))return(n=this.projection)!=null&&n.isProjecting?ag(r):nF(t,r);{const s=zV(t),o=(Mv(r)?s.getPropertyValue(r):s[r])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:r}){return Gk(t,r)}build(t,r,n){Zv(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return ey(t,r,n)}}const Xk=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function UV(e,t,r,n){Yk(e,t,void 0,n);for(const s in t.attrs)e.setAttribute(Xk.has(s)?s:ty(s),t.attrs[s])}class HV extends Zk{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_t}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(cl.has(r)){const n=Sk(r);return n&&n.default||0}return r=Xk.has(r)?r:ty(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return zk(t,r,n)}build(t,r,n){Lk(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,s){UV(t,r,n,s)}mount(t){this.isSVGTag=Vk(t.tagName),super.mount(t)}}const WV=(e,t)=>Xv(e)?new HV(t):new BV(t,{allowProjection:e!==f.Fragment});function ha(e,t,r){const n=e.getProps();return Jv(n,t,r!==void 0?r:n.custom,e)}const xg=e=>Array.isArray(e);function KV(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,$a(r))}function qV(e){return xg(e)?e[e.length-1]||0:e}function GV(e,t){const r=ha(e,t);let{transitionEnd:n={},transition:s={},...o}=r||{};o={...o,...n};for(const a in o){const l=qV(o[a]);KV(e,a,l)}}function QV(e){return!!(Xt(e)&&e.add)}function vg(e,t){const r=e.getValue("willChange");if(QV(r))return r.add(t);if(!r&&gs.WillChange){const n=new gs.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function Jk(e){return e.props[Bk]}const ZV=e=>e!==null;function YV(e,{repeat:t,repeatType:r="loop"},n){const s=e.filter(ZV),o=t&&r!=="loop"&&t%2===1?0:s.length-1;return!o||n===void 0?s[o]:n}const XV={type:"spring",stiffness:500,damping:25,restSpeed:10},JV=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),e6={type:"keyframes",duration:.8},t6={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},r6=(e,{keyframes:t})=>t.length>2?e6:cl.has(e)?e.startsWith("scale")?JV(t[1]):XV:t6;function n6({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:s,repeat:o,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const ry=(e,t,r,n={},s,o)=>a=>{const l=Uv(n,e)||{},c=l.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Vn(c);const d={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:o?void 0:s};n6(l)||Object.assign(d,r6(e,d)),d.duration&&(d.duration=Vn(d.duration)),d.repeatDelay&&(d.repeatDelay=Vn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(fg(d),d.delay===0&&(h=!0)),(gs.instantAnimations||gs.skipAnimations)&&(h=!0,fg(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,h&&!o&&t.get()!==void 0){const m=YV(d.keyframes,l);if(m!==void 0){pt.update(()=>{d.onUpdate(m),d.onComplete()});return}}return l.isSync?new zv(d):new kF(d)};function s6({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function eE(e,t,{delay:r=0,transitionOverride:n,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;n&&(o=n);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const d in l){const h=e.getValue(d,e.latestValues[d]??null),m=l[d];if(m===void 0||u&&s6(u,d))continue;const p={delay:r,...Uv(o||{},d)},b=h.get();if(b!==void 0&&!h.isAnimating&&!Array.isArray(m)&&m===b&&!p.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const v=Jk(e);if(v){const x=window.MotionHandoffAnimation(v,d,pt);x!==null&&(p.startTime=x,g=!0)}}vg(e,d),h.start(ry(d,h,m,e.shouldReduceMotion&&bk.has(d)?{type:!1}:p,e,g));const y=h.animation;y&&c.push(y)}return a&&Promise.all(c).then(()=>{pt.update(()=>{a&&GV(e,a)})}),c}function tE(e,t,r,n=0,s=1){const o=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),a=e.size,l=(a-1)*n;return typeof r=="function"?r(o,a):s===1?o*n:l-o*n}function yg(e,t,r={}){var c;const n=ha(e,t,r.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(s=r.transitionOverride);const o=n?()=>Promise.all(eE(e,n,r)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=s;return o6(e,t,u,d,h,m,r)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>d())}else return Promise.all([o(),a(r.delay)])}function o6(e,t,r=0,n=0,s=0,o=1,a){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(yg(c,t,{...a,delay:r+(typeof n=="function"?0:n)+tE(e.variantChildren,c,n,s,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function i6(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const s=t.map(o=>yg(e,o,r));n=Promise.all(s)}else if(typeof t=="string")n=yg(e,t,r);else{const s=typeof t=="function"?ha(e,t,r.custom):t;n=Promise.all(eE(e,s,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}function rE(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;nPromise.all(t.map(({animation:r,options:n})=>i6(e,r,n)))}function d6(e){let t=u6(e),r=ww(),n=!0;const s=c=>(u,d)=>{var m;const h=ha(e,d,c==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(h){const{transition:p,transitionEnd:b,...g}=h;u={...u,...g,...b}}return u};function o(c){t=c(e)}function a(c){const{props:u}=e,d=nE(e.parent)||{},h=[],m=new Set;let p={},b=1/0;for(let y=0;yb&&j,$=!1;const D=Array.isArray(w)?w:[w];let z=D.reduce(s(v),{});S===!1&&(z={});const{prevResolvedValues:T={}}=x,L={...T,...z},M=H=>{_=!0,m.has(H)&&($=!0,m.delete(H)),x.needsAnimating[H]=!0;const A=e.getValue(H);A&&(A.liveStyle=!1)};for(const H in L){const A=z[H],E=T[H];if(p.hasOwnProperty(H))continue;let I=!1;xg(A)&&xg(E)?I=!rE(A,E):I=A!==E,I?A!=null?M(H):m.add(H):A!==void 0&&m.has(H)?M(H):x.protectedKeys[H]=!0}x.prevProp=w,x.prevResolvedValues=z,x.isActive&&(p={...p,...z}),n&&e.blockInitialAnimation&&(_=!1);const B=N&&C;_&&(!B||$)&&h.push(...D.map(H=>{const A={type:v};if(typeof H=="string"&&n&&!B&&e.manuallyAnimateOnMount&&e.parent){const{parent:E}=e,I=ha(E,H);if(E.enteringChildren&&I){const{delayChildren:q}=I.transition||{};A.delay=tE(E.enteringChildren,e,q)}}return{animation:H,options:A}}))}if(m.size){const y={};if(typeof u.initial!="boolean"){const v=ha(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(y.transition=v.transition)}m.forEach(v=>{const x=e.getBaseTarget(v),w=e.getValue(v);w&&(w.liveStyle=!0),y[v]=x??null}),h.push({animation:y})}let g=!!h.length;return n&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(g=!1),n=!1,g?t(h):Promise.resolve()}function l(c,u){var h;if(r[c].isActive===u)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(m=>{var p;return(p=m.animationState)==null?void 0:p.setActive(c,u)}),r[c].isActive=u;const d=a(c);for(const m in r)r[m].protectedKeys={};return d}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>r,reset:()=>{r=ww(),n=!0}}}function f6(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!rE(t,e):!1}function To(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ww(){return{animate:To(!0),whileInView:To(),whileHover:To(),whileTap:To(),whileDrag:To(),whileFocus:To(),exit:To()}}class No{constructor(t){this.isMounted=!1,this.node=t}update(){}}class h6 extends No{constructor(t){super(t),t.animationState||(t.animationState=d6(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Wf(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let m6=0;class p6 extends No{constructor(){super(...arguments),this.id=m6++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const s=this.node.animationState.setActive("exit",!t);r&&!t&&s.then(()=>{r(this.id)})}mount(){const{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const g6={animation:{Feature:h6},exit:{Feature:p6}};function _c(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function Yc(e){return{point:{x:e.pageX,y:e.pageY}}}const x6=e=>t=>Kv(t)&&e(t,Yc(t));function Ql(e,t,r,n){return _c(e,t,x6(r),n)}const sE=1e-4,v6=1-sE,y6=1+sE,oE=.01,b6=0-oE,w6=0+oE;function ir(e){return e.max-e.min}function j6(e,t,r){return Math.abs(e-t)<=r}function jw(e,t,r,n=.5){e.origin=n,e.originPoint=bt(t.min,t.max,e.origin),e.scale=ir(r)/ir(t),e.translate=bt(r.min,r.max,e.origin)-e.originPoint,(e.scale>=v6&&e.scale<=y6||isNaN(e.scale))&&(e.scale=1),(e.translate>=b6&&e.translate<=w6||isNaN(e.translate))&&(e.translate=0)}function Zl(e,t,r,n){jw(e.x,t.x,r.x,n?n.originX:void 0),jw(e.y,t.y,r.y,n?n.originY:void 0)}function Sw(e,t,r){e.min=r.min+t.min,e.max=e.min+ir(t)}function S6(e,t,r){Sw(e.x,t.x,r.x),Sw(e.y,t.y,r.y)}function Nw(e,t,r){e.min=t.min-r.min,e.max=e.min+ir(t)}function Yl(e,t,r){Nw(e.x,t.x,r.x),Nw(e.y,t.y,r.y)}function Br(e){return[e("x"),e("y")]}const iE=({current:e})=>e?e.ownerDocument.defaultView:null,Cw=(e,t)=>Math.abs(e-t);function N6(e,t){const r=Cw(e.x,t.x),n=Cw(e.y,t.y);return Math.sqrt(r**2+n**2)}class aE{constructor(t,r,{transformPagePoint:n,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=lm(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,b=N6(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!b)return;const{point:g}=m,{timestamp:y}=Ut;this.history.push({...g,timestamp:y});const{onStart:v,onMove:x}=this.handlers;p||(v&&v(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,m)},this.handlePointerMove=(m,p)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=am(p,this.transformPagePoint),pt.update(this.updatePoint,!0)},this.handlePointerUp=(m,p)=>{this.end();const{onEnd:b,onSessionEnd:g,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=lm(m.type==="pointercancel"?this.lastMoveEventInfo:am(p,this.transformPagePoint),this.history);this.startEvent&&b&&b(m,v),g&&g(m,v)},!Kv(t))return;this.dragSnapToOrigin=o,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=s||window;const l=Yc(t),c=am(l,this.transformPagePoint),{point:u}=c,{timestamp:d}=Ut;this.history=[{...u,timestamp:d}];const{onSessionStart:h}=r;h&&h(t,lm(c,this.history)),this.removeListeners=Gc(Ql(this.contextWindow,"pointermove",this.handlePointerMove),Ql(this.contextWindow,"pointerup",this.handlePointerUp),Ql(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),mo(this.updatePoint)}}function am(e,t){return t?{point:t(e.point)}:e}function kw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function lm({point:e},t){return{point:e,delta:kw(e,lE(t)),offset:kw(e,C6(t)),velocity:k6(t,.1)}}function C6(e){return e[0]}function lE(e){return e[e.length-1]}function k6(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const s=lE(e);for(;r>=0&&(n=e[r],!(s.timestamp-n.timestamp>Vn(t)));)r--;if(!n)return{x:0,y:0};const o=$n(s.timestamp-n.timestamp);if(o===0)return{x:0,y:0};const a={x:(s.x-n.x)/o,y:(s.y-n.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function E6(e,{min:t,max:r},n){return t!==void 0&&er&&(e=n?bt(r,e,n.max):Math.min(e,r)),e}function Ew(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function _6(e,{top:t,left:r,bottom:n,right:s}){return{x:Ew(e.x,r,s),y:Ew(e.y,t,n)}}function _w(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.minn?r=Sc(t.min,t.max-n,e.min):n>s&&(r=Sc(e.min,e.max-s,t.min)),ps(0,1,r)}function A6(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const bg=.35;function R6(e=bg){return e===!1?e=0:e===!0&&(e=bg),{x:Tw(e,"left","right"),y:Tw(e,"top","bottom")}}function Tw(e,t,r){return{min:Pw(e,t),max:Pw(e,r)}}function Pw(e,t){return typeof e=="number"?e:e[t]||0}const M6=new WeakMap;class O6{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_t(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=h=>{const{dragSnapToOrigin:m}=this.getProps();m?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Yc(h).point)},a=(h,m)=>{const{drag:p,dragPropagation:b,onDragStart:g}=this.getProps();if(p&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=BF(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Br(v=>{let x=this.getAxisMotionValue(v).get()||0;if(zn.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const j=w.layout.layoutBox[v];j&&(x=ir(j)*(parseFloat(x)/100))}}this.originPoint[v]=x}),g&&pt.postRender(()=>g(h,m)),vg(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},l=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:p,dragDirectionLock:b,onDirectionLock:g,onDrag:y}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:v}=m;if(b&&this.currentDirection===null){this.currentDirection=D6(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",m.point,v),this.updateAxis("y",m.point,v),this.visualElement.render(),y&&y(h,m)},c=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Br(h=>{var m;return this.getAnimationState(h)==="paused"&&((m=this.getAxisMotionValue(h).animation)==null?void 0:m.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new aE(t,{onSessionStart:o,onStart:a,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:n,contextWindow:iE(this.visualElement)})}stop(t,r){const n=t||this.latestPointerEvent,s=r||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!n)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:l}=this.getProps();l&&pt.postRender(()=>l(n,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){const{drag:s}=this.getProps();if(!n||!Ou(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(a=E6(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,s=this.constraints;t&&Xi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=_6(n.layoutBox,t):this.constraints=!1,this.elastic=R6(r),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Br(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=A6(n.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Xi(t))return!1;const n=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=IV(n,s.root,this.visualElement.getTransformPagePoint());let a=T6(s.layout.layoutBox,o);if(r){const l=r(MV(a));this.hasMutatedConstraints=!!l,l&&(a=Wk(l))}return a}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:s,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Br(d=>{if(!Ou(d,r,this.currentDirection))return;let h=c&&c[d]||{};a&&(h={min:0,max:0});const m=s?200:1e6,p=s?40:1e7,b={type:"inertia",velocity:n?t[d]:0,bounceStiffness:m,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(d,b)});return Promise.all(u).then(l)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return vg(this.visualElement,t),n.start(ry(t,n,0,r,this.visualElement,!1))}stopAnimation(){Br(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Br(t=>{var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.state}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),s=n[r];return s||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Br(r=>{const{drag:n}=this.getProps();if(!Ou(r,n,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(r);if(s&&s.layout){const{min:a,max:l}=s.layout.layoutBox[r];o.set(t[r]-bt(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Xi(r)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Br(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();s[a]=P6({min:c,max:c},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Br(a=>{if(!Ou(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(bt(c,u,s[a]))})}addListeners(){if(!this.visualElement.current)return;M6.set(this.visualElement,this);const t=this.visualElement.current,r=Ql(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),n=()=>{const{dragConstraints:c}=this.getProps();Xi(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),pt.read(n);const a=_c(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Br(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=c[d].translate,h.set(h.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),r(),o(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:a=bg,dragMomentum:l=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:s,dragConstraints:o,dragElastic:a,dragMomentum:l}}}function Ou(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function D6(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class I6 extends No{constructor(t){super(t),this.removeGroupControls=Zr,this.removeListeners=Zr,this.controls=new O6(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zr}unmount(){this.removeGroupControls(),this.removeListeners()}}const Aw=e=>(t,r)=>{e&&pt.postRender(()=>e(t,r))};class L6 extends No{constructor(){super(...arguments),this.removePointerDownListener=Zr}onPointerDown(t){this.session=new aE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:iE(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:Aw(t),onStart:Aw(r),onMove:n,onEnd:(o,a)=>{delete this.session,s&&pt.postRender(()=>s(o,a))}}}mount(){this.removePointerDownListener=Ql(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const od={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Rw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Sl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Me.test(e))e=parseFloat(e);else return e;const r=Rw(e,t.target.x),n=Rw(e,t.target.y);return`${r}% ${n}%`}},F6={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,s=po.parse(e);if(s.length>5)return n;const o=po.createTransformer(e),a=typeof s[0]!="number"?1:0,l=r.x.scale*t.x,c=r.y.scale*t.y;s[0+a]/=l,s[1+a]/=c;const u=bt(l,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),o(s)}};let cm=!1;class V6 extends f.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:s}=this.props,{projection:o}=t;aV($6),o&&(r.group&&r.group.add(o),n&&n.register&&s&&n.register(o),cm&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),od.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:s,isPresent:o}=this.props,{projection:a}=n;return a&&(a.isPresent=o,cm=!0,s||t.layoutDependency!==r||r===void 0||t.isPresent!==o?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||pt.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Wv.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:s}=t;cm=!0,s&&(s.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(s),n&&n.deregister&&n.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function cE(e){const[t,r]=Ak(),n=f.useContext(Nv);return i.jsx(V6,{...e,layoutGroup:n,switchLayoutGroup:f.useContext(Uk),isPresent:t,safeToRemove:r})}const $6={borderRadius:{...Sl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Sl,borderTopRightRadius:Sl,borderBottomLeftRadius:Sl,borderBottomRightRadius:Sl,boxShadow:F6};function z6(e,t,r){const n=Xt(e)?e:$a(e);return n.start(ry("",n,t,r)),n.animation}const B6=(e,t)=>e.depth-t.depth;class U6{constructor(){this.children=[],this.isDirty=!1}add(t){Ev(this.children,t),this.isDirty=!0}remove(t){_v(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(B6),this.isDirty=!1,this.children.forEach(t)}}function H6(e,t){const r=xr.now(),n=({timestamp:s})=>{const o=s-r;o>=t&&(mo(n),e(o-t))};return pt.setup(n,!0),()=>mo(n)}const uE=["TopLeft","TopRight","BottomLeft","BottomRight"],W6=uE.length,Mw=e=>typeof e=="string"?parseFloat(e):e,Ow=e=>typeof e=="number"||Me.test(e);function K6(e,t,r,n,s,o){s?(e.opacity=bt(0,r.opacity??1,q6(n)),e.opacityExit=bt(t.opacity??1,0,G6(n))):o&&(e.opacity=bt(t.opacity??1,r.opacity??1,n));for(let a=0;ant?1:r(Sc(e,t,n))}function Iw(e,t){e.min=t.min,e.max=t.max}function zr(e,t){Iw(e.x,t.x),Iw(e.y,t.y)}function Lw(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Fw(e,t,r,n,s){return e-=t,e=Gd(e,1/r,n),s!==void 0&&(e=Gd(e,1/s,n)),e}function Q6(e,t=0,r=1,n=.5,s,o=e,a=e){if(zn.test(t)&&(t=parseFloat(t),t=bt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=bt(o.min,o.max,n);e===o&&(l-=t),e.min=Fw(e.min,t,r,l,s),e.max=Fw(e.max,t,r,l,s)}function Vw(e,t,[r,n,s],o,a){Q6(e,t[r],t[n],t[s],t.scale,o,a)}const Z6=["x","scaleX","originX"],Y6=["y","scaleY","originY"];function $w(e,t,r,n){Vw(e.x,t,Z6,r?r.x:void 0,n?n.x:void 0),Vw(e.y,t,Y6,r?r.y:void 0,n?n.y:void 0)}function zw(e){return e.translate===0&&e.scale===1}function fE(e){return zw(e.x)&&zw(e.y)}function Bw(e,t){return e.min===t.min&&e.max===t.max}function X6(e,t){return Bw(e.x,t.x)&&Bw(e.y,t.y)}function Uw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function hE(e,t){return Uw(e.x,t.x)&&Uw(e.y,t.y)}function Hw(e){return ir(e.x)/ir(e.y)}function Ww(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class J6{constructor(){this.members=[]}add(t){Ev(this.members,t),t.scheduleRender()}remove(t){if(_v(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){const r=this.members.findIndex(s=>t===s);if(r===0)return!1;let n;for(let s=r;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){n=o;break}}return n?(this.promote(n),!0):!1}promote(t,r){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function e$(e,t,r){let n="";const s=e.x.translate/t.x,o=e.y.translate/t.y,a=(r==null?void 0:r.z)||0;if((s||o||a)&&(n=`translate3d(${s}px, ${o}px, ${a}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:u,rotate:d,rotateX:h,rotateY:m,skewX:p,skewY:b}=r;u&&(n=`perspective(${u}px) ${n}`),d&&(n+=`rotate(${d}deg) `),h&&(n+=`rotateX(${h}deg) `),m&&(n+=`rotateY(${m}deg) `),p&&(n+=`skewX(${p}deg) `),b&&(n+=`skewY(${b}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(n+=`scale(${l}, ${c})`),n||"none"}const um=["","X","Y","Z"],t$=1e3;let r$=0;function dm(e,t,r,n){const{latestValues:s}=t;s[e]&&(r[e]=s[e],t.setStaticValue(e,0),n&&(n[e]=0))}function mE(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=Jk(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",pt,!(s||o))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&mE(n)}function pE({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:s}){return class{constructor(a={},l=t==null?void 0:t()){this.id=r$++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(o$),this.nodes.forEach(c$),this.nodes.forEach(u$),this.nodes.forEach(i$)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;pt.read(()=>{h=window.innerWidth}),e(a,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,d&&d(),d=H6(m,250),od.hasAnimatedSinceResize&&(od.hasAnimatedSinceResize=!1,this.nodes.forEach(Gw)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||u.getDefaultTransition()||p$,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=u.getProps(),v=!this.targetLayout||!hE(this.targetLayout,p),x=!h&&m;if(this.options.layoutRoot||this.resumeFrom||x||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...Uv(b,"layout"),onPlay:g,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(d,x)}else h||Gw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),mo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(d$),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&mE(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ir(this.snapshot.measuredBox.x)&&!ir(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const S=j/1e3;Qw(h.x,a.x,S),Qw(h.y,a.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yl(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h$(this.relativeTarget,this.relativeTargetOrigin,m,S),w&&X6(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=_t()),zr(w,this.relativeTarget)),g&&(this.animationValues=d,K6(d,u,this.latestValues,S,x,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(mo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{od.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=$a(0)),this.currentAnimation=z6(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),a.onUpdate&&a.onUpdate(d)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(t$),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&gE(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||_t();const h=ir(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+h;const m=ir(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+m}zr(l,c),ea(l,d),Zl(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new J6),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var l;const{layoutId:a}=this.options;return a?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:a}=this.options;return a?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&dm("z",a,u,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(Kw),this.root.sharedNodes.clear()}}}function n$(e){e.updateLayout()}function s$(e){var r;const t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=e.layout,{animationType:o}=e.options,a=t.source!==e.layout.source;o==="size"?Br(h=>{const m=a?t.measuredBox[h]:t.layoutBox[h],p=ir(m);m.min=n[h].min,m.max=m.min+p}):gE(o,t.layoutBox,n)&&Br(h=>{const m=a?t.measuredBox[h]:t.layoutBox[h],p=ir(n[h]);m.max=m.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+p)});const l=ta();Zl(l,n,t.layoutBox);const c=ta();a?Zl(c,e.applyTransform(s,!0),t.measuredBox):Zl(c,n,t.layoutBox);const u=!fE(l);let d=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:p}=h;if(m&&p){const b=_t();Yl(b,t.layoutBox,m.layoutBox);const g=_t();Yl(g,n,p.layoutBox),hE(b,g)||(d=!0),h.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=b,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function o$(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function i$(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function a$(e){e.clearSnapshot()}function Kw(e){e.clearMeasurements()}function qw(e){e.isLayoutDirty=!1}function l$(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Gw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function c$(e){e.resolveTargetDelta()}function u$(e){e.calcProjection()}function d$(e){e.resetSkewAndRotation()}function f$(e){e.removeLeadSnapshot()}function Qw(e,t,r){e.translate=bt(t.translate,0,r),e.scale=bt(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function Zw(e,t,r,n){e.min=bt(t.min,r.min,n),e.max=bt(t.max,r.max,n)}function h$(e,t,r,n){Zw(e.x,t.x,r.x,n),Zw(e.y,t.y,r.y,n)}function m$(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const p$={duration:.45,ease:[.4,0,.1,1]},Yw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Xw=Yw("applewebkit/")&&!Yw("chrome/")?Math.round:Zr;function Jw(e){e.min=Xw(e.min),e.max=Xw(e.max)}function g$(e){Jw(e.x),Jw(e.y)}function gE(e,t,r){return e==="position"||e==="preserve-aspect"&&!j6(Hw(t),Hw(r),.2)}function x$(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const v$=pE({attachResizeListener:(e,t)=>_c(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fm={current:void 0},xE=pE({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fm.current){const e=new v$({});e.mount(window),e.setOptions({layoutScroll:!0}),fm.current=e}return fm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),y$={pan:{Feature:L6},drag:{Feature:I6,ProjectionNode:xE,MeasureLayout:cE}};function e1(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const s="onHover"+r,o=n[s];o&&pt.postRender(()=>o(t,Yc(t)))}class b$ extends No{mount(){const{current:t}=this.node;t&&(this.unmount=UF(t,(r,n)=>(e1(this.node,n,"Start"),s=>e1(this.node,s,"End"))))}unmount(){}}class w$ extends No{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Gc(_c(this.node.current,"focus",()=>this.onFocus()),_c(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function t1(e,t,r){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const s="onTap"+(r==="End"?"":r),o=n[s];o&&pt.postRender(()=>o(t,Yc(t)))}class j$ extends No{mount(){const{current:t}=this.node;t&&(this.unmount=qF(t,(r,n)=>(t1(this.node,n,"Start"),(s,{success:o})=>t1(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const wg=new WeakMap,hm=new WeakMap,S$=e=>{const t=wg.get(e.target);t&&t(e)},N$=e=>{e.forEach(S$)};function C$({root:e,...t}){const r=e||document;hm.has(r)||hm.set(r,{});const n=hm.get(r),s=JSON.stringify(t);return n[s]||(n[s]=new IntersectionObserver(N$,{root:e,...t})),n[s]}function k$(e,t,r){const n=C$(t);return wg.set(e,r),n.observe(e),()=>{wg.delete(e),n.unobserve(e)}}const E$={some:0,all:1};class _$ extends No{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:s="some",once:o}=t,a={root:r?r.current:void 0,rootMargin:n,threshold:typeof s=="number"?s:E$[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),m=u?d:h;m&&m(c)};return k$(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(T$(t,r))&&this.startObserver()}unmount(){}}function T$({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const P$={inView:{Feature:_$},tap:{Feature:j$},focus:{Feature:w$},hover:{Feature:b$}},A$={layout:{ProjectionNode:xE,MeasureLayout:cE}},R$={...g6,...P$,...y$,...A$},Ee=RV(R$,WV);function M$(){var v;const e=Si(),t=qn(),{toast:r}=Kt(),{user:n,fetchSession:s}=So(),[o,a]=f.useState(""),[l,c]=f.useState(""),[u,d]=f.useState(!1),[h,m]=f.useState(!1),[p,b]=f.useState(null),g=((v=t.state)==null?void 0:v.from)||"/";f.useEffect(()=>{s()},[s]),f.useEffect(()=>{n&&e(g,{replace:!0})},[n,g,e]);async function y(x){x.preventDefault(),m(!0),b(null);try{const w=await fetch("/api/login",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:o.trim(),password:l})}),j=await w.json();w.ok&&(j!=null&&j.ok)?(await s(),r({title:"Bem-vindo!",description:"Login realizado com sucesso."})):b((j==null?void 0:j.error)||"Credenciais inválidas.")}catch{b("Falha ao se conectar ao servidor.")}finally{m(!1)}}return i.jsx(kr,{children:i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[i.jsx("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-10",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-purple-600 to-violet-600 rounded-3xl flex items-center justify-center shadow-lg shadow-purple-500/25",children:i.jsx(K0,{className:"w-8 h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Login"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl",children:"Entre para acessar seu painel e gerenciar seus projetos."})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-purple-600 to-violet-600 rounded-full shadow-sm"})]})}),i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"max-w-md mx-auto",children:i.jsxs(ot,{className:"border-0 shadow-lg rounded-3xl bg-card/50 backdrop-blur-sm",children:[i.jsx(it,{className:"text-center",children:i.jsxs("div",{className:"flex flex-col items-center mb-4",children:[i.jsx("div",{className:"w-12 h-12 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:i.jsx(vM,{className:"h-6 w-6 text-gray-600"})}),i.jsx("h2",{className:"text-2xl font-bold",children:"Acesso ao Sistema"})]})}),i.jsxs(at,{children:[p&&i.jsx(en,{variant:"destructive",className:"mb-4",children:i.jsx(tn,{children:p})}),i.jsxs("form",{className:"space-y-4",onSubmit:y,children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"username",children:"Nome de Usuário"}),i.jsx(Oe,{id:"username",value:o,onChange:x=>a(x.target.value),required:!0,autoComplete:"username",className:"h-11"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"password",children:"Senha"}),i.jsxs("div",{className:"relative",children:[i.jsx(Oe,{id:"password",type:u?"text":"password",value:l,onChange:x=>c(x.target.value),required:!0,autoComplete:"current-password",className:"h-11 pr-10"}),i.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 rounded-md hover:bg-muted",onClick:()=>d(x=>!x),"aria-label":u?"Ocultar senha":"Mostrar senha",children:u?i.jsx(uM,{className:"h-4 w-4"}):i.jsx(ON,{className:"h-4 w-4"})})]})]}),i.jsx(de,{type:"submit",className:"w-full h-11 rounded-xl shadow-lg hover:shadow-xl transition-all duration-300",disabled:h||!o||!l,children:h?i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-transparent border-b-current"}),"Entrando..."]}):i.jsxs("span",{className:"inline-flex items-center gap-2",children:[i.jsx(K0,{className:"h-4 w-4"}),"Entrar"]})}),i.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:["Dica: usuário ",i.jsx("span",{className:"font-medium",children:"admin"})," / senha ",i.jsx("span",{className:"font-medium",children:"admin123"})," (alterar após primeiro login)"]})]})]})]})})]})})})}const vE=f.forwardRef(({className:e,...t},r)=>i.jsx("textarea",{className:he("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));vE.displayName="Textarea";function Tc(e,[t,r]){return Math.min(r,Math.max(t,e))}var O$=f.createContext(void 0);function ny(e){const t=f.useContext(O$);return e||t||"ltr"}function sy(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var D$=[" ","Enter","ArrowUp","ArrowDown"],I$=[" ","Enter"],fi="Select",[qf,Gf,L$]=Ix(fi),[ul,FB]=Wn(fi,[L$,nl]),Qf=nl(),[F$,Co]=ul(fi),[V$,$$]=ul(fi),yE=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:a,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:m,required:p,form:b}=e,g=Qf(t),[y,v]=f.useState(null),[x,w]=f.useState(null),[j,S]=f.useState(!1),N=ny(u),[C,_]=uo({prop:n,defaultProp:s??!1,onChange:o,caller:fi}),[$,D]=uo({prop:a,defaultProp:l,onChange:c,caller:fi}),z=f.useRef(null),T=y?b||!!y.closest("form"):!0,[L,M]=f.useState(new Set),B=Array.from(L).map(W=>W.props.value).join(";");return i.jsx(tv,{...g,children:i.jsxs(F$,{required:p,scope:t,trigger:y,onTriggerChange:v,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:Cr(),value:$,onValueChange:D,open:C,onOpenChange:_,dir:N,triggerPointerDownPosRef:z,disabled:m,children:[i.jsx(qf.Provider,{scope:t,children:i.jsx(V$,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(W=>{M(H=>new Set(H).add(W))},[]),onNativeOptionRemove:f.useCallback(W=>{M(H=>{const A=new Set(H);return A.delete(W),A})},[]),children:r})}),T?i.jsxs(UE,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:$,onChange:W=>D(W.target.value),disabled:m,form:b,children:[$===void 0?i.jsx("option",{value:""}):null,Array.from(L)]},B):null]})})};yE.displayName=fi;var bE="SelectTrigger",wE=f.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Qf(r),a=Co(bE,r),l=a.disabled||n,c=ze(t,a.onTriggerChange),u=Gf(r),d=f.useRef("touch"),[h,m,p]=WE(g=>{const y=u().filter(w=>!w.disabled),v=y.find(w=>w.value===a.value),x=KE(y,g,v);x!==void 0&&a.onValueChange(x.value)}),b=g=>{l||(a.onOpenChange(!0),p()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return i.jsx(Af,{asChild:!0,...o,children:i.jsx(Te.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":HE(a.value)?"":void 0,...s,ref:c,onClick:ke(s.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&b(g)}),onPointerDown:ke(s.onPointerDown,g=>{d.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(b(g),g.preventDefault())}),onKeyDown:ke(s.onKeyDown,g=>{const y=h.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&m(g.key),!(y&&g.key===" ")&&D$.includes(g.key)&&(b(),g.preventDefault())})})})});wE.displayName=bE;var jE="SelectValue",SE=f.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:a="",...l}=e,c=Co(jE,r),{onValueNodeHasChildrenChange:u}=c,d=o!==void 0,h=ze(t,c.onValueNodeChange);return zt(()=>{u(d)},[u,d]),i.jsx(Te.span,{...l,ref:h,style:{pointerEvents:"none"},children:HE(c.value)?i.jsx(i.Fragment,{children:a}):o})});SE.displayName=jE;var z$="SelectIcon",NE=f.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return i.jsx(Te.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});NE.displayName=z$;var B$="SelectPortal",CE=e=>i.jsx(zc,{asChild:!0,...e});CE.displayName=B$;var hi="SelectContent",kE=f.forwardRef((e,t)=>{const r=Co(hi,e.__scopeSelect),[n,s]=f.useState();if(zt(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?bi.createPortal(i.jsx(EE,{scope:e.__scopeSelect,children:i.jsx(qf.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),o):null}return i.jsx(_E,{...e,ref:t})});kE.displayName=hi;var hn=10,[EE,ko]=ul(hi),U$="SelectContentImpl",H$=ai("SelectContent.RemoveScroll"),_E=f.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:p,sticky:b,hideWhenDetached:g,avoidCollisions:y,...v}=e,x=Co(hi,r),[w,j]=f.useState(null),[S,N]=f.useState(null),C=ze(t,G=>j(G)),[_,$]=f.useState(null),[D,z]=f.useState(null),T=Gf(r),[L,M]=f.useState(!1),B=f.useRef(!1);f.useEffect(()=>{if(w)return xv(w)},[w]),gv();const W=f.useCallback(G=>{const[Se,...Ae]=T().map(we=>we.ref.current),[Re]=Ae.slice(-1),se=document.activeElement;for(const we of G)if(we===se||(we==null||we.scrollIntoView({block:"nearest"}),we===Se&&S&&(S.scrollTop=0),we===Re&&S&&(S.scrollTop=S.scrollHeight),we==null||we.focus(),document.activeElement!==se))return},[T,S]),H=f.useCallback(()=>W([_,w]),[W,_,w]);f.useEffect(()=>{L&&H()},[L,H]);const{onOpenChange:A,triggerPointerDownPosRef:E}=x;f.useEffect(()=>{if(w){let G={x:0,y:0};const Se=Re=>{var se,we;G={x:Math.abs(Math.round(Re.pageX)-(((se=E.current)==null?void 0:se.x)??0)),y:Math.abs(Math.round(Re.pageY)-(((we=E.current)==null?void 0:we.y)??0))}},Ae=Re=>{G.x<=10&&G.y<=10?Re.preventDefault():w.contains(Re.target)||A(!1),document.removeEventListener("pointermove",Se),E.current=null};return E.current!==null&&(document.addEventListener("pointermove",Se),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Se),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[w,A,E]),f.useEffect(()=>{const G=()=>A(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[A]);const[I,q]=WE(G=>{const Se=T().filter(se=>!se.disabled),Ae=Se.find(se=>se.ref.current===document.activeElement),Re=KE(Se,G,Ae);Re&&setTimeout(()=>Re.ref.current.focus())}),F=f.useCallback((G,Se,Ae)=>{const Re=!B.current&&!Ae;(x.value!==void 0&&x.value===Se||Re)&&($(G),Re&&(B.current=!0))},[x.value]),Z=f.useCallback(()=>w==null?void 0:w.focus(),[w]),X=f.useCallback((G,Se,Ae)=>{const Re=!B.current&&!Ae;(x.value!==void 0&&x.value===Se||Re)&&z(G)},[x.value]),ee=n==="popper"?jg:TE,xe=ee===jg?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:m,collisionPadding:p,sticky:b,hideWhenDetached:g,avoidCollisions:y}:{};return i.jsx(EE,{scope:r,content:w,viewport:S,onViewportChange:N,itemRefCallback:F,selectedItem:_,onItemLeave:Z,itemTextRefCallback:X,focusSelectedItem:H,selectedItemText:D,position:n,isPositioned:L,searchRef:I,children:i.jsx(Ff,{as:H$,allowPinchZoom:!0,children:i.jsx(If,{asChild:!0,trapped:x.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:ke(s,G=>{var Se;(Se=x.trigger)==null||Se.focus({preventScroll:!0}),G.preventDefault()}),children:i.jsx(Xa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:i.jsx(ee,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:G=>G.preventDefault(),...v,...xe,onPlaced:()=>M(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ke(v.onKeyDown,G=>{const Se=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!Se&&G.key.length===1&&q(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let Re=T().filter(se=>!se.disabled).map(se=>se.ref.current);if(["ArrowUp","End"].includes(G.key)&&(Re=Re.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const se=G.target,we=Re.indexOf(se);Re=Re.slice(we+1)}setTimeout(()=>W(Re)),G.preventDefault()}})})})})})})});_E.displayName=U$;var W$="SelectItemAlignedPosition",TE=f.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Co(hi,r),a=ko(hi,r),[l,c]=f.useState(null),[u,d]=f.useState(null),h=ze(t,C=>d(C)),m=Gf(r),p=f.useRef(!1),b=f.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:v,focusSelectedItem:x}=a,w=f.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&u&&g&&y&&v){const C=o.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),D=v.getBoundingClientRect();if(o.dir!=="rtl"){const se=D.left-_.left,we=$.left-se,ve=C.left-we,Xe=C.width+ve,Q=Math.max(Xe,_.width),ae=window.innerWidth-hn,O=Tc(we,[hn,Math.max(hn,ae-Q)]);l.style.minWidth=Xe+"px",l.style.left=O+"px"}else{const se=_.right-D.right,we=window.innerWidth-$.right-se,ve=window.innerWidth-C.right-we,Xe=C.width+ve,Q=Math.max(Xe,_.width),ae=window.innerWidth-hn,O=Tc(we,[hn,Math.max(hn,ae-Q)]);l.style.minWidth=Xe+"px",l.style.right=O+"px"}const z=m(),T=window.innerHeight-hn*2,L=g.scrollHeight,M=window.getComputedStyle(u),B=parseInt(M.borderTopWidth,10),W=parseInt(M.paddingTop,10),H=parseInt(M.borderBottomWidth,10),A=parseInt(M.paddingBottom,10),E=B+W+L+A+H,I=Math.min(y.offsetHeight*5,E),q=window.getComputedStyle(g),F=parseInt(q.paddingTop,10),Z=parseInt(q.paddingBottom,10),X=C.top+C.height/2-hn,ee=T-X,xe=y.offsetHeight/2,G=y.offsetTop+xe,Se=B+W+G,Ae=E-Se;if(Se<=X){const se=z.length>0&&y===z[z.length-1].ref.current;l.style.bottom="0px";const we=u.clientHeight-g.offsetTop-g.offsetHeight,ve=Math.max(ee,xe+(se?Z:0)+we+H),Xe=Se+ve;l.style.height=Xe+"px"}else{const se=z.length>0&&y===z[0].ref.current;l.style.top="0px";const ve=Math.max(X,B+g.offsetTop+(se?F:0)+xe)+Ae;l.style.height=ve+"px",g.scrollTop=Se-X+g.offsetTop}l.style.margin=`${hn}px 0`,l.style.minHeight=I+"px",l.style.maxHeight=T+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[m,o.trigger,o.valueNode,l,u,g,y,v,o.dir,n]);zt(()=>w(),[w]);const[j,S]=f.useState();zt(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const N=f.useCallback(C=>{C&&b.current===!0&&(w(),x==null||x(),b.current=!1)},[w,x]);return i.jsx(q$,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:N,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:i.jsx(Te.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});TE.displayName=W$;var K$="SelectPopperPosition",jg=f.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=hn,...o}=e,a=Qf(r);return i.jsx(rv,{...a,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});jg.displayName=K$;var[q$,oy]=ul(hi,{}),Sg="SelectViewport",PE=f.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=ko(Sg,r),a=oy(Sg,r),l=ze(t,o.onViewportChange),c=f.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),i.jsx(qf.Slot,{scope:r,children:i.jsx(Te.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ke(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&h){const p=Math.abs(c.current-d.scrollTop);if(p>0){const b=window.innerHeight-hn*2,g=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),v=Math.max(g,y);if(v0?j:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});PE.displayName=Sg;var AE="SelectGroup",[G$,Q$]=ul(AE),Z$=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Cr();return i.jsx(G$,{scope:r,id:s,children:i.jsx(Te.div,{role:"group","aria-labelledby":s,...n,ref:t})})});Z$.displayName=AE;var RE="SelectLabel",ME=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Q$(RE,r);return i.jsx(Te.div,{id:s.id,...n,ref:t})});ME.displayName=RE;var Qd="SelectItem",[Y$,OE]=ul(Qd),DE=f.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...a}=e,l=Co(Qd,r),c=ko(Qd,r),u=l.value===n,[d,h]=f.useState(o??""),[m,p]=f.useState(!1),b=ze(t,x=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,x,n,s)}),g=Cr(),y=f.useRef("touch"),v=()=>{s||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(Y$,{scope:r,value:n,disabled:s,textId:g,isSelected:u,onItemTextChange:f.useCallback(x=>{h(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:i.jsx(qf.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:i.jsx(Te.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:b,onFocus:ke(a.onFocus,()=>p(!0)),onBlur:ke(a.onBlur,()=>p(!1)),onClick:ke(a.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:ke(a.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:ke(a.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:ke(a.onPointerMove,x=>{var w;y.current=x.pointerType,s?(w=c.onItemLeave)==null||w.call(c):y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(a.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:ke(a.onKeyDown,x=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&x.key===" "||(I$.includes(x.key)&&v(),x.key===" "&&x.preventDefault())})})})})});DE.displayName=Qd;var Ol="SelectItemText",IE=f.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,a=Co(Ol,r),l=ko(Ol,r),c=OE(Ol,r),u=$$(Ol,r),[d,h]=f.useState(null),m=ze(t,v=>h(v),c.onItemTextChange,v=>{var x;return(x=l.itemTextRefCallback)==null?void 0:x.call(l,v,c.value,c.disabled)}),p=d==null?void 0:d.textContent,b=f.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return zt(()=>(g(b),()=>y(b)),[g,y,b]),i.jsxs(i.Fragment,{children:[i.jsx(Te.span,{id:c.textId,...o,ref:m}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?bi.createPortal(o.children,a.valueNode):null]})});IE.displayName=Ol;var LE="SelectItemIndicator",FE=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return OE(LE,r).isSelected?i.jsx(Te.span,{"aria-hidden":!0,...n,ref:t}):null});FE.displayName=LE;var Ng="SelectScrollUpButton",VE=f.forwardRef((e,t)=>{const r=ko(Ng,e.__scopeSelect),n=oy(Ng,e.__scopeSelect),[s,o]=f.useState(!1),a=ze(t,n.onScrollButtonChange);return zt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;o(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?i.jsx(zE,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});VE.displayName=Ng;var Cg="SelectScrollDownButton",$E=f.forwardRef((e,t)=>{const r=ko(Cg,e.__scopeSelect),n=oy(Cg,e.__scopeSelect),[s,o]=f.useState(!1),a=ze(t,n.onScrollButtonChange);return zt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?i.jsx(zE,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});$E.displayName=Cg;var zE=f.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=ko("SelectScrollButton",r),a=f.useRef(null),l=Gf(r),c=f.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return f.useEffect(()=>()=>c(),[c]),zt(()=>{var d;const u=l().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),i.jsx(Te.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ke(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:ke(s.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:ke(s.onPointerLeave,()=>{c()})})}),X$="SelectSeparator",BE=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return i.jsx(Te.div,{"aria-hidden":!0,...n,ref:t})});BE.displayName=X$;var kg="SelectArrow",J$=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Qf(r),o=Co(kg,r),a=ko(kg,r);return o.open&&a.position==="popper"?i.jsx(nv,{...s,...n,ref:t}):null});J$.displayName=kg;var e8="SelectBubbleInput",UE=f.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=f.useRef(null),o=ze(n,s),a=sy(t);return f.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&d){const h=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(h)}},[a,t]),i.jsx(Te.select,{...r,style:{...cN,...r.style},ref:o,defaultValue:t})});UE.displayName=e8;function HE(e){return e===""||e===void 0}function WE(e){const t=Vt(e),r=f.useRef(""),n=f.useRef(0),s=f.useCallback(a=>{const l=r.current+a;t(l),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),o=f.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function KE(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=t8(e,Math.max(o,0));s.length===1&&(a=a.filter(u=>u!==r));const c=a.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function t8(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var r8=yE,qE=wE,n8=SE,s8=NE,o8=CE,GE=kE,i8=PE,QE=ME,ZE=DE,a8=IE,l8=FE,YE=VE,XE=$E,JE=BE;const vr=r8,yr=n8,ar=f.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(qE,{ref:n,className:he("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,i.jsx(s8,{asChild:!0,children:i.jsx(RN,{className:"h-4 w-4 opacity-50"})})]}));ar.displayName=qE.displayName;const e_=f.forwardRef(({className:e,...t},r)=>i.jsx(YE,{ref:r,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(iM,{className:"h-4 w-4"})}));e_.displayName=YE.displayName;const t_=f.forwardRef(({className:e,...t},r)=>i.jsx(XE,{ref:r,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(RN,{className:"h-4 w-4"})}));t_.displayName=XE.displayName;const lr=f.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>i.jsx(o8,{children:i.jsxs(GE,{ref:s,className:he("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground 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",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[i.jsx(e_,{}),i.jsx(i8,{className:he("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(t_,{})]})}));lr.displayName=GE.displayName;const c8=f.forwardRef(({className:e,...t},r)=>i.jsx(QE,{ref:r,className:he("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));c8.displayName=QE.displayName;const ne=f.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(ZE,{ref:n,className:he("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(l8,{children:i.jsx(Ef,{className:"h-4 w-4"})})}),i.jsx(a8,{children:t})]}));ne.displayName=ZE.displayName;const u8=f.forwardRef(({className:e,...t},r)=>i.jsx(JE,{ref:r,className:he("-mx-1 my-1 h-px bg-muted",e),...t}));u8.displayName=JE.displayName;const d8={name:"",description:"",status:"active",controlador:"AQL-GV-M4"},f8=({onSubmit:e,onCancel:t})=>{const[r,n]=f.useState(d8),s=o=>{o.preventDefault(),!(!r.name.trim()||!r.controlador)&&e(r)};return i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-blue-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Uc,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Criar Novo Projeto"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Preencha as informações do seu projeto"})]})]}),i.jsx(de,{variant:"ghost",size:"icon",onClick:t,className:"rounded-full hover:bg-muted",type:"button",children:i.jsx(Nr,{className:"w-5 h-5"})})]})}),i.jsx(at,{children:i.jsxs("form",{onSubmit:s,className:"space-y-6",children:[i.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"name",className:"text-sm font-semibold text-slate-700",children:"Nome do Projeto *"}),i.jsx(Oe,{id:"name",placeholder:"Digite o nome do projeto...",value:r.name,onChange:o=>n({...r,name:o.target.value}),className:"h-12 px-4 rounded-xl border-border focus:border-blue-500 focus:ring-blue-500/20",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"controlador",className:"text-sm font-semibold text-slate-700",children:"Controlador Lógico *"}),i.jsxs(vr,{value:r.controlador,onValueChange:o=>n({...r,controlador:o}),children:[i.jsx(ar,{className:"h-12 rounded-xl border-border focus:border-blue-500 focus:ring-blue-500/20",children:i.jsx(yr,{placeholder:"Selecione o controlador"})}),i.jsxs(lr,{children:[i.jsx(ne,{value:"AQL-GV-M4",children:"AQL-GV-M4"}),i.jsx(ne,{value:"ADP-M8",children:"ADP-M8"}),i.jsx(ne,{value:"ADP-M16",children:"ADP-M16"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"status",className:"text-sm font-semibold text-slate-700",children:"Status"}),i.jsxs(vr,{value:r.status,onValueChange:o=>n({...r,status:o}),children:[i.jsx(ar,{className:"h-12 rounded-xl border-border focus:border-blue-500 focus:ring-blue-500/20",children:i.jsx(yr,{placeholder:"Selecione o status"})}),i.jsxs(lr,{children:[i.jsx(ne,{value:"active",children:"Ativo"}),i.jsx(ne,{value:"inactive",children:"Inativo"}),i.jsx(ne,{value:"completed",children:"Concluído"})]})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"description",className:"text-sm font-semibold text-slate-700",children:"Descrição"}),i.jsx(vE,{id:"description",placeholder:"Descreva o projeto (opcional)...",value:r.description,onChange:o=>n({...r,description:o.target.value}),className:"min-h-[100px] px-4 py-3 rounded-xl border-border focus:border-blue-500 focus:ring-blue-500/20 resize-none"})]}),i.jsxs("div",{className:"flex gap-3 pt-4",children:[i.jsx(de,{type:"button",variant:"outline",onClick:t,className:"flex-1 h-12 rounded-xl border-border hover:bg-muted",children:"Cancelar"}),i.jsxs(de,{type:"submit",className:"flex-1 h-12 bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center justify-center gap-2",children:[i.jsx(Ot,{className:"w-4 h-4"}),"Criar Projeto"]})]})]})})]})})},h8=ji("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function yt({className:e,variant:t,...r}){return i.jsx("div",{className:he(h8({variant:t}),e),...r})}const dl=wv,m8=jv,Xc=Sv,r_=f.forwardRef(({className:e,...t},r)=>i.jsx(Kc,{ref:r,className:he("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));r_.displayName=Kc.displayName;const Ni=f.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(m8,{children:[i.jsx(r_,{}),i.jsxs(qc,{ref:n,className:he("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,i.jsxs(Sv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[i.jsx(Nr,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ni.displayName=qc.displayName;const Ci=({className:e,...t})=>i.jsx("div",{className:he("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ci.displayName="DialogHeader";const ki=({className:e,...t})=>i.jsx("div",{className:he("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ki.displayName="DialogFooter";const Ei=f.forwardRef(({className:e,...t},r)=>i.jsx($f,{ref:r,className:he("text-lg font-semibold leading-none tracking-tight",e),...t}));Ei.displayName=$f.displayName;const p8=f.forwardRef(({className:e,...t},r)=>i.jsx(zf,{ref:r,className:he("text-sm text-muted-foreground",e),...t}));p8.displayName=zf.displayName;const g8=({project:e,isOpen:t,onClose:r,onUpdate:n})=>{const[s,o]=f.useState((e==null?void 0:e.nome)||""),[a,l]=f.useState((e==null?void 0:e.status)??"ATIVO");f.useEffect(()=>{o((e==null?void 0:e.nome)||""),l((e==null?void 0:e.status)??"ATIVO")},[e]);const c=u=>{u.preventDefault(),s.trim()&&(n({nome:s.trim(),status:a}),r())};return i.jsx(dl,{open:t,onOpenChange:r,children:i.jsxs(Ni,{className:"sm:max-w-md",children:[i.jsx(Ci,{children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(Ei,{className:"text-xl font-bold text-foreground",children:"Editar Projeto"}),i.jsx(de,{variant:"ghost",size:"icon",onClick:r,className:"rounded-full hover:bg-muted",type:"button",children:i.jsx(Nr,{className:"w-4 h-4"})})]})}),i.jsxs("form",{onSubmit:c,className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-name",className:"text-sm font-semibold text-slate-700",children:"Nome do Projeto"}),i.jsx(Oe,{id:"edit-name",value:s,onChange:u=>o(u.target.value),className:"h-11 rounded-xl border-border focus:border-blue-500 focus:ring-blue-500/20",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-status",className:"text-sm font-semibold text-slate-700",children:"Status"}),i.jsxs("select",{id:"edit-status",className:"h-11 w-full px-4 rounded-xl border border-border bg-background focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all",value:a,onChange:u=>l(u.target.value),children:[i.jsx("option",{value:"ATIVO",children:"Ativo"}),i.jsx("option",{value:"INATIVO",children:"Inativo"}),i.jsx("option",{value:"CONCLUIDO",children:"Concluído"})]})]}),i.jsx(ki,{children:i.jsxs("div",{className:"flex gap-3 w-full",children:[i.jsx(de,{type:"button",variant:"outline",onClick:r,className:"flex-1 h-11 rounded-xl border-border hover:bg-muted",children:"Cancelar"}),i.jsxs(de,{type:"submit",className:"flex-1 h-11 bg-blue-600 hover:bg-blue-700 text-white rounded-xl flex items-center justify-center gap-2",children:[i.jsx(NM,{className:"w-4 h-4"}),"Salvar"]})]})})]})]})})},x8={ATIVO:"border-emerald-500/60",INATIVO:"border-muted/60",CONCLUIDO:"border-amber-500/60"},v8={ATIVO:"bg-emerald-500/10 text-emerald-700 dark:text-emerald-200 dark:bg-emerald-500/20",INATIVO:"bg-muted text-muted-foreground dark:bg-muted/40 dark:text-muted-foreground",CONCLUIDO:"bg-amber-500/10 text-amber-700 dark:text-amber-200 dark:bg-amber-500/20"},y8={ATIVO:"border-t-emerald-500",INATIVO:"border-t-slate-400",CONCLUIDO:"border-t-amber-500"},b8=({project:e,isCurrentProject:t,onSelect:r,onDelete:n,onUpdate:s})=>{const[o,a]=f.useState(!1),l=()=>{window.confirm(`Tem certeza que deseja excluir o projeto "${e.nome}"?`)&&n()},c=x8[e.status??"INATIVO"],u=v8[e.status??"INATIVO"];return i.jsxs(i.Fragment,{children:[i.jsx(Ee.div,{whileHover:{y:-4,scale:1.02},transition:{duration:.2},children:i.jsxs(ot,{className:`relative overflow-hidden transition-all duration-300 border ${c} ${t?"bg-gradient-to-br from-primary/15 via-primary/10 to-primary/5 dark:from-primary/25 dark:via-primary/15 dark:to-primary/10 shadow-lg shadow-primary/15":"bg-card hover:shadow-lg shadow-primary/5"}`,children:[t&&i.jsx("div",{className:`absolute top-0 right-0 w-0 h-0 border-l-[40px] border-l-transparent border-t-[40px] ${y8[e.status??"INATIVO"]}`,children:i.jsx(Zu,{className:"absolute -top-8 -right-8 w-4 h-4 text-primary-foreground transform rotate-45"})}),i.jsxs(it,{className:"pb-4",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(DN,{className:"w-5 h-5 text-muted-foreground"}),i.jsx("h4",{className:"text-lg font-bold text-foreground truncate",children:e.nome})]}),i.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[t&&i.jsxs(yt,{className:"bg-primary text-primary-foreground text-xs font-medium",children:[i.jsx(Zu,{className:"w-3 h-3 mr-1"}),"Atual"]}),i.jsx(yt,{className:`${u} text-xs font-medium`,children:e.status??"INATIVO"})]})]}),i.jsxs(at,{className:"pt-4",children:[i.jsx("div",{className:"border-t border-border pt-4",children:i.jsxs("div",{className:"text-xs text-muted-foreground space-y-2",children:[e.data_criacao&&i.jsxs("p",{children:[i.jsx("b",{children:"Criação:"})," ",new Date(e.data_criacao).toLocaleDateString()]}),e.status==="ATIVO"&&e.data_ativo&&i.jsxs("p",{children:[i.jsx("b",{children:"Ativo desde:"})," ",new Date(e.data_ativo).toLocaleDateString()]}),e.status==="INATIVO"&&e.data_inativo&&i.jsxs("p",{children:[i.jsx("b",{children:"Inativo desde:"})," ",new Date(e.data_inativo).toLocaleDateString()]}),e.status==="CONCLUIDO"&&e.data_concluido&&i.jsxs("p",{children:[i.jsx("b",{children:"Concluído em:"})," ",new Date(e.data_concluido).toLocaleDateString()]})]})}),i.jsxs("div",{className:"flex gap-2 mt-4",children:[t?i.jsxs(de,{size:"sm",variant:"outline",className:"flex-1 border-primary/40 text-primary hover:bg-primary/10 rounded-xl h-9 text-xs font-medium",disabled:!0,children:[i.jsx(Zu,{className:"w-3 h-3 mr-1"}),"Selecionado"]}):i.jsxs(de,{onClick:r,size:"sm",className:"flex-1 bg-primary hover:bg-primary/90 text-primary-foreground rounded-xl h-9 text-xs font-medium",children:[i.jsx(lM,{className:"w-3 h-3 mr-1"}),"Selecionar"]}),i.jsx(de,{onClick:()=>a(!0),size:"sm",variant:"outline",className:"rounded-xl border-border text-foreground hover:bg-muted h-9 px-3",children:i.jsx(jM,{className:"w-3 h-3"})}),i.jsx(de,{onClick:l,size:"sm",variant:"outline",className:"rounded-xl border-red-300 text-red-600 hover:bg-red-500/10 h-9 px-3 dark:border-red-500/40 dark:text-red-300",children:i.jsx(Cn,{className:"w-3 h-3"})})]})]})]})}),i.jsx(g8,{project:e,isOpen:o,onClose:()=>a(!1),onUpdate:s})]})},w8=({projects:e,currentProject:t,isLoading:r,onSelectProject:n,onDeleteProject:s,onUpdateProject:o})=>r?i.jsxs("div",{className:"mb-12",children:[i.jsx("h3",{className:"text-2xl font-bold text-foreground mb-6",children:"Seus Projetos"}),i.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:Array(6).fill(0).map((a,l)=>i.jsxs("div",{className:"bg-card border border-border rounded-2xl p-6 shadow-sm",children:[i.jsx(Mo,{className:"h-6 w-3/4 mb-3"}),i.jsx(Mo,{className:"h-4 w-full mb-2"}),i.jsx(Mo,{className:"h-4 w-2/3 mb-4"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Mo,{className:"h-9 w-20"}),i.jsx(Mo,{className:"h-9 w-16"})]})]},l))})]}):i.jsxs("div",{className:"mb-12",children:[i.jsx("h3",{className:"text-2xl font-bold text-foreground mb-6",children:"Seus Projetos"}),e.length===0?i.jsxs(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center py-16",children:[i.jsx("div",{className:"w-24 h-24 bg-muted rounded-full flex items-center justify-center mx-auto mb-6",children:i.jsx("span",{className:"text-3xl text-muted-foreground",children:"📁"})}),i.jsx("h4",{className:"text-xl font-semibold text-foreground mb-2",children:"Nenhum projeto encontrado"}),i.jsx("p",{className:"text-muted-foreground max-w-md mx-auto",children:'Comece criando seu primeiro projeto. Clique no botão "Novo Projeto" para começar.'})]}):i.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:i.jsx(Ir,{children:e.map((a,l)=>i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{delay:l*.1},children:i.jsx(b8,{project:a,isCurrentProject:(t==null?void 0:t.id)===a.id,onSelect:()=>n(a),onDelete:()=>s(a.id),onUpdate:c=>o(a.id,c)})},a.id))})})]}),j8=({currentProject:e})=>e?i.jsx(Ee.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},className:"mb-8",children:i.jsx(en,{className:"bg-card border border-primary/40 text-card-foreground shadow-lg shadow-primary/10 dark:shadow-primary/20",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-primary to-primary/70 rounded-xl flex items-center justify-center shadow-lg shadow-primary/30",children:i.jsx(Zu,{className:"h-5 w-5 text-primary-foreground"})}),i.jsx("div",{className:"flex-1",children:i.jsx(tn,{className:"text-muted-foreground font-medium",children:i.jsxs("span",{className:"flex items-center gap-2",children:["Projeto atual:"," ",i.jsx("strong",{className:"text-foreground",children:e.nome}),i.jsx(Ot,{className:"w-4 h-4 text-primary"})]})})})]})})}):null,S8=({onProjectImported:e})=>{const[t,r]=f.useState(null),[n,s]=f.useState(!1),[o,a]=f.useState(!1),l=f.useRef(null),{toast:c}=Kt(),u=b=>{b&&b[0]&&(b[0].type==="application/json"?r(b[0]):c({variant:"destructive",title:"Arquivo inválido",description:"Por favor, selecione um arquivo .json."}))},d=f.useCallback(b=>{b.preventDefault(),a(!0)},[]),h=f.useCallback(()=>{a(!1)},[]),m=f.useCallback(b=>{b.preventDefault(),a(!1),u(b.dataTransfer.files)},[]),p=async()=>{if(t){s(!0);try{const b=new FormData;b.append("file",t);const g=await fetch("/api/importar-projeto",{method:"POST",credentials:"include",body:b}),y=await g.json();g.ok&&y.ok?(c({title:"Sucesso!",description:y.message||"Projeto importado com sucesso."}),e()):c({variant:"destructive",title:"Erro na importação",description:y.message||"Falha ao importar o projeto."})}catch(b){console.error("Erro ao importar projeto:",b),c({variant:"destructive",title:"Erro",description:"Erro ao conectar com o servidor."})}finally{s(!1),r(null)}}};return i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-12",children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-lg shadow-primary/5 dark:bg-card/90 dark:shadow-primary/20",children:[i.jsx(it,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-purple-500 to-purple-600 rounded-xl flex items-center justify-center shadow-lg shadow-purple-700/30",children:i.jsx(_p,{className:"w-5 h-5 text-purple-50"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-xl font-bold text-foreground",children:"Importar Projeto"}),i.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Restaure um projeto a partir de um arquivo exportado"})]})]})}),i.jsxs(at,{className:"space-y-4",children:[i.jsxs(en,{className:"bg-amber-500/10 border border-amber-400/40 text-amber-100 dark:text-amber-50",children:[i.jsx(xM,{className:"h-4 w-4 text-amber-400"}),i.jsxs(tn,{className:"text-amber-900 dark:text-amber-100",children:[i.jsx("strong",{children:"Importante:"})," Use apenas arquivos JSON exportados pelo sistema. Arquivos CSV são para documentação e não podem ser importados."]})]}),i.jsxs("div",{className:` + p-4 border-2 border-dashed rounded-xl text-center cursor-pointer transition-all duration-300 + ${o?"border-purple-500 bg-purple-500/10":"border-border hover:border-purple-400 dark:hover:border-purple-300"} + `,onClick:()=>{var b;return(b=l.current)==null?void 0:b.click()},onDragOver:d,onDragLeave:h,onDrop:m,children:[i.jsx("input",{ref:l,type:"file",accept:".json",onChange:b=>u(b.target.files),className:"hidden"}),t?i.jsxs("div",{className:"flex items-center justify-between text-left",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(dM,{className:"w-8 h-8 text-purple-600"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold text-foreground",children:t.name}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[(t.size/1024).toFixed(2)," KB"]})]})]}),i.jsx(de,{variant:"ghost",size:"sm",onClick:b=>{b.stopPropagation(),r(null)},className:"rounded-full h-8 w-8 p-0",children:i.jsx(Nr,{className:"h-4 w-4"})})]}):i.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[i.jsx(_p,{className:"w-8 h-8"}),i.jsx("p",{className:"font-semibold",children:"Clique para selecionar ou arraste o arquivo"}),i.jsx("p",{className:"text-sm text-muted-foreground/80",children:"Apenas arquivos .json são permitidos"})]})]}),i.jsx(de,{onClick:p,disabled:!t||n,className:"w-full bg-purple-600 hover:bg-purple-700 text-white rounded-xl px-6 h-12 flex items-center gap-2 whitespace-nowrap",children:n?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Importando..."]}):i.jsxs(i.Fragment,{children:[i.jsx(fM,{className:"w-5 h-5"}),"Importar e Restaurar Projeto"]})})]})]})})},N8=()=>{const{toast:e}=Kt(),t=qn(),{user:r,loading:n,fetchSession:s}=So(),{setProjeto:o,clearProjeto:a}=Jr(),[l,c]=f.useState([]),[u,d]=f.useState(),[h,m]=f.useState(!1),[p,b]=f.useState(!0),[g,y]=f.useState(!1),[v,x]=f.useState(!1),[w,j]=f.useState(""),[S,N]=f.useState("TODOS"),C=f.useMemo(()=>l.filter(B=>{const W=B.nome.toLowerCase().includes(w.toLowerCase()),H=S==="TODOS"||B.status===S;return W&&H}),[l,w,S]),_=async()=>{b(!0);try{const W=await(await fetch("/api/projetos",{credentials:"include"})).json();W.ok&&Array.isArray(W.projetos)&&c(W.projetos.map(E=>({id:E.id,nome:E.nome,status:E.status??"ATIVO",selected:!!E.selected,data_criacao:E.data_criacao,data_ativo:E.data_ativo,data_inativo:E.data_inativo,data_concluido:E.data_concluido})));const A=await(await fetch("/api/projeto_atual",{credentials:"include"})).json();if(A.ok&&A.projeto_atual){const E=A.projeto_atual,I={id:E.id,nome:E.nome,status:E.status??"ATIVO",selected:!0,data_criacao:E.data_criacao,data_ativo:E.data_ativo,data_inativo:E.data_inativo,data_concluido:E.data_concluido};d(I),o(I)}else d(void 0),a()}catch{}b(!1)};f.useEffect(()=>{s()},[s]),f.useEffect(()=>{r&&_()},[r,n]);const $=async()=>{if(u){y(!0);try{const B=await fetch(`/exportar-projeto/${u.id}`,{credentials:"include"});if(B.ok){const W=B.headers.get("Content-Disposition");let H=`projeto_${u.nome}_${new Date().toISOString().split("T")[0]}.json`;if(W){const q=W.match(/filename="(.+)"/);q&&(H=q[1])}const A=await B.blob(),E=window.URL.createObjectURL(A),I=document.createElement("a");I.style.display="none",I.href=E,I.download=H,document.body.appendChild(I),I.click(),window.URL.revokeObjectURL(E),document.body.removeChild(I)}else console.error("Falha ao exportar projeto"),alert("Erro ao exportar projeto. Verifique se o projeto existe e tente novamente.")}catch(B){console.error("Erro ao exportar projeto:",B),alert("Erro ao exportar projeto. Tente novamente.")}finally{y(!1)}}},D=async B=>{var A;const W=(A=B.target.files)==null?void 0:A[0];if(!W)return;x(!0);const H=new FormData;H.append("file",W);try{const E=await fetch("/api/importar-planner",{method:"POST",credentials:"include",body:H}),I=await E.json();E.ok&&I.ok?(alert(I.message||"Projeto importado com sucesso!"),await _()):alert(`Erro ao importar: ${I.error}`||"Ocorreu um erro desconhecido.")}catch(E){console.error("Erro ao importar do planner:",E),alert("Erro de conexão ao tentar importar o projeto do planner.")}finally{x(!1),B.target.value=""}},z=async B=>{b(!0);try{const H=await(await fetch("/api/projetos",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({nome:B.name,controlador:B.controlador})})).json();H.ok?(await _(),e({title:`Projeto '${B.name}' criado com sucesso!`,description:"Agora você pode começar a adicionar áreas e ambientes."})):e({variant:"destructive",title:"Erro ao criar projeto",description:H.error||"Ocorreu um erro desconhecido."})}catch(W){console.error("Erro ao criar projeto:",W),e({variant:"destructive",title:"Erro de Conexão",description:"Não foi possível conectar ao servidor para criar o projeto."})}finally{m(!1),b(!1)}},T=async B=>{b(!0);try{await fetch("/api/projeto_atual",{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({projeto_id:B.id})}),o(B),c(W=>W.map(H=>({...H,selected:H.id===B.id}))),d({...B,selected:!0})}catch{}b(!1)},L=async B=>{b(!0);try{await fetch(`/api/projetos/${B}`,{method:"DELETE",credentials:"include"}),(u==null?void 0:u.id)===B&&(a(),d(void 0)),c(W=>W.filter(H=>H.id!==B))}catch{}b(!1)},M=async(B,W)=>{const A=await(await fetch(`/api/projetos/${B}`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({nome:W.nome,status:W.status})})).json();if(A.ok&&A.projeto){const E={...A.projeto,selected:(u==null?void 0:u.id)===B};c(I=>I.map(q=>q.id===B?E:q)),(u==null?void 0:u.id)===B&&d(E)}};return n?i.jsx(kr,{children:i.jsx("div",{className:"min-h-[60vh] grid place-items-center",children:i.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[i.jsx("span",{className:"animate-spin inline-block h-5 w-5 rounded-full border-2 border-border border-t-slate-600"}),"Verificando sessão..."]})})}):r?i.jsx(kr,{children:i.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[i.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-10",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Gerenciador de Projetos"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl",children:"Gerencie seus projetos com automação ROEHN. Cadastre ambientes, areas, circuitos e módulos e gere um relatório completo."})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[u&&i.jsxs("button",{onClick:$,disabled:g,className:"bg-green-600 hover:bg-green-700 text-white px-6 py-3 rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center gap-3 disabled:opacity-50",children:[i.jsx(cM,{className:"w-5 h-5"}),g?"Exportando...":"Exportar JSON"]}),i.jsxs("label",{className:"bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center gap-3 cursor-pointer disabled:opacity-50",children:[i.jsx(_p,{className:"w-5 h-5"}),v?"Importando...":"Importar do Planner",i.jsx("input",{type:"file",className:"hidden",accept:".json",onChange:D,disabled:v})]}),i.jsxs("button",{onClick:()=>m(!0),className:"bg-primary hover:bg-primary/90 text-white px-8 py-3 rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center gap-3",children:[i.jsx(SM,{className:"w-5 h-5"}),"Novo Projeto"]})]})]}),i.jsx(j8,{currentProject:u}),h&&i.jsx(f8,{onSubmit:z,onCancel:()=>m(!1)}),i.jsxs("div",{className:"mb-8 bg-card rounded-2xl p-6 shadow-sm border border-border",children:[i.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[i.jsxs("div",{className:"flex-1 relative",children:[i.jsx(La,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-5 h-5"}),i.jsx("input",{type:"text",placeholder:"Buscar projetos por nome...",value:w,onChange:B=>j(B.target.value),className:"w-full pl-10 pr-4 py-3 border border-border bg-background/80 text-foreground rounded-xl focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-transparent"})]}),i.jsxs("div",{className:"flex gap-2 items-center",children:[i.jsx(mM,{className:"text-muted-foreground w-5 h-5"}),i.jsxs("select",{value:S,onChange:B=>N(B.target.value),className:"px-4 py-3 border border-border bg-background/80 text-foreground rounded-xl focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-transparent",children:[i.jsx("option",{value:"TODOS",children:"Todos os status"}),i.jsx("option",{value:"ATIVO",children:"Ativo"}),i.jsx("option",{value:"INATIVO",children:"Inativo"}),i.jsx("option",{value:"CONCLUIDO",children:"Concluído"})]})]})]}),i.jsxs("div",{className:"mt-4 text-sm text-muted-foreground",children:[C.length," de ",l.length," projetos encontrados",w&&i.jsxs("span",{children:[' para "',w,'"']}),S!=="TODOS"&&i.jsxs("span",{children:[" com status ",S.toLowerCase()]})]})]}),i.jsx("div",{className:"mb-12 max-h-[70vh] overflow-y-auto pr-2",children:i.jsx(w8,{projects:C,currentProject:u,isLoading:p,onSelectProject:T,onDeleteProject:L,onUpdateProject:(B,W)=>M(B,W)})}),i.jsx(S8,{onProjectImported:_})]})}):i.jsx(zd,{to:"/login",replace:!0,state:{from:t.pathname}})};function bs({previousPath:e,nextPath:t}){const r=Si();return i.jsxs("div",{className:"flex justify-between items-center mt-12",children:[i.jsx("div",{children:e&&i.jsxs(de,{variant:"outline",onClick:()=>r(e),className:"h-11 px-6 rounded-xl bg-card/90 backdrop-blur-sm border border-border shadow-lg shadow-primary/10 hover:bg-card",children:[i.jsx(sM,{className:"h-5 w-5 mr-2"}),"Anterior"]})}),i.jsx("div",{children:t&&i.jsxs(de,{onClick:()=>r(t),className:"h-11 px-6 rounded-xl bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white shadow-lg hover:shadow-xl transition-all duration-300 flex items-center justify-center gap-2",children:["Próximo",i.jsx(oM,{className:"h-5 w-5 ml-2"})]})})]})}function C8(){const{toast:e}=Kt(),{projeto:t}=Jr(),[r,n]=f.useState(t?!0:null),s=r!==!0;f.useEffect(()=>{try{t&&n(!0)}catch{}},[t]),f.useEffect(()=>{(async()=>{try{if(r!==null)return;const C=await(await fetch("/api/projeto_atual",{credentials:"same-origin"})).json();n(!!(C!=null&&C.ok&&(C!=null&&C.projeto_atual)))}catch{n(!1)}})()},[r]);const[o,a]=f.useState([]),[l,c]=f.useState(!0),[u,d]=f.useState(""),[h,m]=f.useState(null),[p,b]=f.useState(""),g=async()=>{c(!0);try{const S=await fetch("/api/areas",{credentials:"same-origin",headers:{Accept:"application/json"}});if(!S.ok)throw new Error("Falha ao carregar as áreas.");const N=await S.json();a((N==null?void 0:N.areas)||[])}catch(S){e({variant:"destructive",title:"Erro",description:"Não foi possível carregar a lista de áreas do projeto."}),console.error("Erro ao carregar áreas:",S)}finally{c(!1)}};f.useEffect(()=>{r===!0?g():c(!1)},[r]);const y=async S=>{if(S.preventDefault(),!u.trim()){e({variant:"destructive",title:"Erro",description:"O nome da área não pode estar vazio."});return}c(!0);try{const N=await fetch("/api/areas",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({nome:u.trim()})}),C=await N.json().catch(()=>null);N.ok&&(C!=null&&C.ok||C!=null&&C.success)?(d(""),await g(),e({title:"Sucesso!",description:"Área adicionada com sucesso."})):e({variant:"destructive",title:"Erro",description:(C==null?void 0:C.error)||(C==null?void 0:C.message)||"Erro ao adicionar área."})}catch{e({variant:"destructive",title:"Erro",description:"Erro de conexão com o servidor."})}finally{c(!1)}},v=S=>{m(S.id),b(S.nome)},x=()=>{m(null),b("")},w=async S=>{if(S.preventDefault(),!(h===null||!p.trim())){c(!0);try{const N=await fetch(`/api/areas/${h}`,{method:"PUT",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({nome:p.trim()})}),C=await N.json().catch(()=>null);N.ok&&(C!=null&&C.ok)?(x(),await g(),e({title:"Sucesso!",description:"Área atualizada com sucesso."})):e({variant:"destructive",title:"Erro",description:(C==null?void 0:C.error)||"Não foi possível atualizar a área."})}catch{e({variant:"destructive",title:"Erro de Conexão",description:"Não foi possível conectar ao servidor."})}finally{c(!1)}}},j=async S=>{if(o.find(C=>C.id===S)&&window.confirm("Tem certeza que deseja excluir esta área? Esta ação não pode ser desfeita.")){c(!0);try{const C=await fetch(`/api/areas/${S}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json"}}),_=await C.json().catch(()=>null);C.ok&&(_!=null&&_.ok||_!=null&&_.success)?(await g(),e({title:"Sucesso!",description:"Área excluída com sucesso."})):e({variant:"destructive",title:"Erro",description:(_==null?void 0:_.error)||(_==null?void 0:_.message)||"Erro ao excluir área."})}catch{e({variant:"destructive",title:"Erro",description:"Erro de conexão com o servidor."})}finally{c(!1)}}};return i.jsx(kr,{children:i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[i.jsx("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-10",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-blue-500 to-blue-600 rounded-3xl flex items-center justify-center shadow-lg shadow-purple-500/25",children:i.jsx(kp,{className:"w-8 h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Gerenciar Áreas"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl",children:"Adicione ou edite as áreas do seu projeto."})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-purple-600 to-violet-600 rounded-full shadow-sm"})]})}),r===!1&&i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:i.jsxs(en,{className:"bg-amber-50 border-amber-200 shadow-sm",children:[i.jsx(Ot,{className:"h-4 w-4 text-amber-600"}),i.jsx(tn,{className:"text-amber-800",children:"Selecione um projeto na página inicial para gerenciar áreas."})]})}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[i.jsx(Ee.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1},children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-green-500 to-emerald-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Uc,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Adicionar Nova Área"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Preencha as informações da área"})]})]})}),i.jsx(at,{children:i.jsxs("form",{onSubmit:y,className:"space-y-6",children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"area-name",className:"text-sm font-semibold text-slate-700",children:"Nome da Área *"}),i.jsx(Oe,{id:"area-name",type:"text",value:u,onChange:S=>d(S.target.value),placeholder:"Ex: Térreo, Cobertura...",required:!0,className:"mt-2 h-12 px-4 rounded-xl border-border focus:border-purple-500 focus:ring-purple-500/20",disabled:s})]}),i.jsxs(de,{type:"submit",className:"w-full h-12 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-purple-700 hover:to-violet-700 text-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center justify-center gap-2",disabled:s,children:[i.jsx(Un,{className:"h-5 w-5"}),"Adicionar Área"]})]})})]})}),i.jsx(Ee.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-blue-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(kp,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Áreas Cadastradas"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Lista de todas as áreas do projeto"})]})]}),i.jsxs(yt,{className:"bg-gradient-to-r from-purple-500 to-violet-500 text-white text-sm font-medium px-3 py-1",children:[o.length," ",o.length===1?"área":"áreas"]})]})}),i.jsx(at,{children:l&&o.length===0?i.jsxs("div",{className:"flex flex-col justify-center items-center py-12",children:[i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-4 border-purple-500 border-t-transparent mb-4"}),i.jsx("p",{className:"text-muted-foreground font-medium",children:"Carregando áreas..."})]}):o.length===0?i.jsxs(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center py-12",children:[i.jsx("div",{className:"w-20 h-20 bg-muted rounded-full flex items-center justify-center mx-auto mb-6",children:i.jsx($x,{className:"h-10 w-10 text-muted-foreground/80"})}),i.jsx("h4",{className:"text-xl font-semibold text-foreground mb-2",children:r?"Nenhuma área cadastrada":"Selecione um projeto"}),i.jsx("p",{className:"text-muted-foreground max-w-sm mx-auto",children:r?"Comece adicionando sua primeira área usando o formulário ao lado.":"Selecione um projeto para visualizar e gerenciar as áreas."})]}):i.jsx("div",{className:"space-y-3 max-h-96 overflow-y-auto pr-2",children:i.jsx(Ir,{children:o.map((S,N)=>i.jsx(Ee.li,{layout:!0,initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{delay:N*.05},className:"group relative overflow-hidden rounded-2xl border border-border bg-card/85 backdrop-blur-sm p-4 hover:bg-card/90 hover:shadow-lg hover:shadow-slate-900/5 transition-all duration-300 flex items-center justify-between",children:h===S.id?i.jsxs("form",{onSubmit:w,className:"flex-grow flex items-center gap-2",children:[i.jsx(Oe,{type:"text",value:p,onChange:C=>b(C.target.value),className:"h-9",autoFocus:!0}),i.jsx(de,{type:"submit",size:"icon",className:"h-9 w-9 bg-green-500 hover:bg-green-600",onClick:w,children:i.jsx(Ef,{className:"h-4 w-4"})}),i.jsx(de,{type:"button",size:"icon",variant:"ghost",onClick:x,className:"h-9 w-9",children:i.jsx(Nr,{className:"h-4 w-4"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"font-bold text-lg text-foreground",children:S.nome}),i.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[i.jsx(de,{variant:"ghost",size:"icon",onClick:()=>v(S),className:"h-8 w-8 hover:bg-blue-100",children:i.jsx(Ja,{className:"h-4 w-4 text-blue-600"})}),i.jsx(de,{variant:"ghost",size:"icon",onClick:()=>j(S.id),className:"h-8 w-8 hover:bg-red-100",children:i.jsx(Cn,{className:"h-4 w-4 text-red-600"})})]})]})},S.id))})})})]})})]}),i.jsx(bs,{nextPath:"/ambientes"})]})})})}function k8(){var D;const{toast:e}=Kt(),{projeto:t}=Jr(),[r,n]=f.useState(t?!0:null),s=r!==!0;f.useEffect(()=>{try{t&&n(!0)}catch{}},[t]),f.useEffect(()=>{(async()=>{try{if(r!==null)return;const L=await(await fetch("/api/projeto_atual",{credentials:"same-origin"})).json();n(!!(L!=null&&L.ok&&(L!=null&&L.projeto_atual)))}catch{n(!1)}})()},[r]);const[o,a]=f.useState([]),[l,c]=f.useState([]),[u,d]=f.useState(!0),[h,m]=f.useState(""),[p,b]=f.useState(""),[g,y]=f.useState(null),[v,x]=f.useState(!1),w=async()=>{try{const z=await fetch("/api/areas",{credentials:"same-origin",headers:{Accept:"application/json"}});if(!z.ok)throw new Error("Falha ao carregar as áreas.");const T=await z.json();a((T==null?void 0:T.areas)||[])}catch(z){console.error(z),e({variant:"destructive",title:"Erro",description:"Não foi possível carregar as áreas do projeto."})}},j=async()=>{try{const z=await fetch("/api/ambientes",{credentials:"same-origin",headers:{Accept:"application/json"}});if(!z.ok)throw new Error("Falha ao carregar os ambientes.");const T=await z.json();c((T==null?void 0:T.ambientes)||[])}catch(z){console.error(z),e({variant:"destructive",title:"Erro",description:"Não foi possível carregar os ambientes do projeto."})}},S=async()=>{if(r!==!0){d(!1);return}d(!0);try{await Promise.all([w(),j()])}catch(z){console.error(z)}finally{d(!1)}};f.useEffect(()=>{S()},[r]);const N=async z=>{if(z.preventDefault(),!h.trim()||!p){e({variant:"destructive",title:"Erro",description:"Preencha o nome do ambiente e selecione uma área."});return}d(!0);try{const T=await fetch("/api/ambientes",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({nome:h.trim(),area_id:p})}),L=await T.json().catch(()=>null);T.ok&&(L!=null&&L.ok||L!=null&&L.success)?(m(""),b(""),await j(),e({title:"Sucesso!",description:"Ambiente adicionado com sucesso."})):e({variant:"destructive",title:"Erro",description:(L==null?void 0:L.error)||(L==null?void 0:L.message)||"Erro ao adicionar ambiente."})}catch{e({variant:"destructive",title:"Erro",description:"Erro de conexão com o servidor."})}finally{d(!1)}},C=z=>{y(z),x(!0)},_=async z=>{var T;if(z.preventDefault(),!!g){d(!0);try{const L=await fetch(`/api/ambientes/${g.id}`,{method:"PUT",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({nome:g.nome.trim(),area_id:(T=g.area)==null?void 0:T.id})}),M=await L.json().catch(()=>null);L.ok&&(M!=null&&M.ok||M!=null&&M.success)?(x(!1),await j(),e({title:"Sucesso!",description:"Ambiente atualizado com sucesso."})):e({variant:"destructive",title:"Erro",description:(M==null?void 0:M.error)||(M==null?void 0:M.message)||"Erro ao atualizar ambiente."})}catch{e({variant:"destructive",title:"Erro",description:"Erro de conexão com o servidor."})}finally{d(!1)}}},$=async z=>{if(window.confirm("Tem certeza que deseja excluir este ambiente?")){d(!0);try{const T=await fetch(`/api/ambientes/${z}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json"}}),L=await T.json().catch(()=>null);T.ok&&(L!=null&&L.ok||L!=null&&L.success)?(c(M=>M.filter(B=>B.id!==z)),e({title:"Sucesso!",description:"Ambiente excluído com sucesso."})):e({variant:"destructive",title:"Erro",description:(L==null?void 0:L.error)||(L==null?void 0:L.message)||"Erro ao excluir ambiente."})}catch{e({variant:"destructive",title:"Erro",description:"Erro de conexão com o servidor."})}finally{d(!1)}}};return i.jsx(kr,{children:i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[i.jsx("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-10",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-green-500 to-green-600 rounded-3xl flex items-center justify-center shadow-lg shadow-blue-500/25",children:i.jsx(Np,{className:"w-8 h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Gerenciar Ambientes"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl",children:"Adicione ou edite ambientes dentro de áreas."})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-blue-600 to-indigo-600 rounded-full shadow-sm"})]})}),r===!1&&i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:i.jsxs(en,{className:"bg-amber-50 border-amber-200 shadow-sm",children:[i.jsx(Ot,{className:"h-4 w-4 text-amber-600"}),i.jsx(tn,{className:"text-amber-800",children:"Selecione um projeto na página inicial para gerenciar ambientes."})]})}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[i.jsx(Ee.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1},children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-green-500 to-emerald-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Uc,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Adicionar Novo Ambiente"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Preencha as informações do ambiente"})]})]})}),i.jsx(at,{children:i.jsxs("form",{className:"space-y-6",onSubmit:N,children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"nome",className:"text-sm font-semibold text-slate-700",children:"Nome do Ambiente *"}),i.jsx(Oe,{id:"nome",placeholder:"Ex: Sala de Estar, Cozinha...",value:h,onChange:z=>m(z.target.value),required:!0,disabled:s||u||o.length===0,className:"h-12 px-4 rounded-xl border-border focus:border-blue-500 focus:ring-blue-500/20"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"areaId",className:"text-sm font-semibold text-slate-700",children:"Área *"}),i.jsxs("select",{id:"areaId",className:"h-12 w-full px-4 rounded-xl border border-border bg-background focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all",value:p,onChange:z=>b(Number(z.target.value)),required:!0,disabled:!r||o.length===0,children:[i.jsx("option",{value:"",children:"Selecione uma área"}),o.map(z=>i.jsx("option",{value:z.id,children:z.nome},z.id))]}),!u&&r===!0&&o.length===0&&i.jsxs("p",{className:"text-sm text-amber-600 mt-1 flex items-center gap-1",children:[i.jsx(Ot,{className:"w-3 h-3"}),"Nenhuma área disponível. Crie áreas primeiro."]})]}),i.jsxs(de,{type:"submit",className:"w-full h-12 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center justify-center gap-2",disabled:!r||o.length===0,children:[i.jsx(Un,{className:"h-5 w-5"}),"Adicionar Ambiente"]})]})})]})}),i.jsx(Ee.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-green-500 to-green-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Np,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Ambientes Cadastrados"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Lista de todos os ambientes"})]})]}),i.jsxs(yt,{className:"bg-gradient-to-r from-blue-500 to-indigo-500 text-white text-sm font-medium px-3 py-1",children:[l.length," ",l.length===1?"ambiente":"ambientes"]})]})}),i.jsx(at,{children:u?i.jsxs("div",{className:"flex flex-col justify-center items-center py-12",children:[i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-4 border-blue-500 border-t-transparent mb-4"}),i.jsx("p",{className:"text-muted-foreground font-medium",children:"Carregando ambientes..."})]}):l.length===0?i.jsxs(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center py-12",children:[i.jsx("div",{className:"w-20 h-20 bg-muted rounded-full flex items-center justify-center mx-auto mb-6",children:i.jsx(zx,{className:"h-10 w-10 text-muted-foreground/80"})}),i.jsx("h4",{className:"text-xl font-semibold text-foreground mb-2",children:r?"Nenhum ambiente cadastrado":"Selecione um projeto"}),i.jsx("p",{className:"text-muted-foreground max-w-sm mx-auto",children:r?"Comece adicionando seu primeiro ambiente usando o formulário ao lado.":"Selecione um projeto para visualizar e gerenciar os ambientes."})]}):i.jsx("div",{className:"space-y-3 max-h-96 overflow-y-auto pr-2",children:i.jsx(Ir,{children:l.map((z,T)=>{var L,M;return i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{delay:T*.05},className:"group relative overflow-hidden rounded-2xl border border-border bg-card/85 backdrop-blur-sm p-4 hover:bg-card/90 hover:shadow-lg hover:shadow-slate-900/5 transition-all duration-300",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1 mr-4",children:[i.jsx("h4",{className:"font-bold text-foreground text-lg mb-1",children:z.nome}),i.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-2",children:[i.jsx($x,{className:"h-4 w-4 text-muted-foreground/80"}),i.jsxs("span",{className:"font-medium",children:["Área:"," ",((L=z.area)==null?void 0:L.nome)||((M=o.find(B=>B.id===z.area_id))==null?void 0:M.nome)||"—"]})]})]}),i.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[i.jsx(de,{variant:"ghost",size:"icon",onClick:()=>C(z),className:"h-8 w-8 hover:bg-blue-100",children:i.jsx(Ja,{className:"h-4 w-4 text-blue-600"})}),i.jsx(de,{variant:"ghost",size:"icon",onClick:()=>$(z.id),disabled:u,className:"h-8 w-8 hover:bg-red-100",children:i.jsx(Cn,{className:"h-4 w-4 text-red-600"})})]})]})},z.id)})})})})]})})]}),g&&i.jsx(dl,{open:v,onOpenChange:x,children:i.jsxs(Ni,{children:[i.jsx(Ci,{children:i.jsx(Ei,{children:"Editar Ambiente"})}),i.jsxs("form",{onSubmit:_,children:[i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-nome",children:"Nome do Ambiente"}),i.jsx(Oe,{id:"edit-nome",value:g.nome,onChange:z=>y({...g,nome:z.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-area",children:"Área"}),i.jsx("select",{id:"edit-area",value:((D=g.area)==null?void 0:D.id)||"",onChange:z=>{const T=Number(z.target.value),L=o.find(M=>M.id===T);L&&y({...g,area:L})},className:"w-full h-10 px-3 rounded-md border border-input bg-background",children:o.map(z=>i.jsx("option",{value:z.id,children:z.nome},z.id))})]})]}),i.jsxs(ki,{children:[i.jsx(Xc,{asChild:!0,children:i.jsx(de,{type:"button",variant:"secondary",children:"Cancelar"})}),i.jsx(de,{type:"submit",disabled:u,children:"Salvar Alterações"})]})]})]})}),i.jsx(bs,{previousPath:"/areas",nextPath:"/quadros_eletricos"})]})})})}function E8(){const{toast:e}=Kt(),{projeto:t}=Jr(),[r,n]=f.useState(t?!0:null),s=r!==!0;f.useEffect(()=>{try{t&&n(!0)}catch{}},[t]),f.useEffect(()=>{(async()=>{try{if(r!==null)return;const M=await(await fetch("/api/projeto_atual",{credentials:"same-origin"})).json();n(!!(M!=null&&M.ok&&(M!=null&&M.projeto_atual)))}catch{n(!1)}})()},[r]);const[o,a]=f.useState([]),[l,c]=f.useState([]),[u,d]=f.useState(!0),[h,m]=f.useState(""),[p,b]=f.useState(""),[g,y]=f.useState(""),[v,x]=f.useState(null),[w,j]=f.useState(!1),S=async()=>{try{const T=await fetch("/api/ambientes",{credentials:"same-origin",headers:{Accept:"application/json"}});if(!T.ok)throw new Error("Falha ao carregar os ambientes.");const L=await T.json();a((L==null?void 0:L.ambientes)||[])}catch(T){console.error(T),e({variant:"destructive",title:"Erro",description:"Não foi possível carregar os ambientes do projeto."})}},N=async()=>{try{const T=await fetch("/api/quadros_eletricos",{credentials:"same-origin",headers:{Accept:"application/json"}});if(!T.ok)throw new Error("Falha ao carregar os quadros elétricos.");const L=await T.json();c((L==null?void 0:L.quadros_eletricos)||[])}catch(T){console.error(T),e({variant:"destructive",title:"Erro",description:"Não foi possível carregar os quadros elétricos do projeto."})}},C=async()=>{if(r!==!0){d(!1);return}d(!0);try{await Promise.all([S(),N()])}catch(T){console.error(T)}finally{d(!1)}};f.useEffect(()=>{C()},[r]);const _=async T=>{if(T.preventDefault(),!h.trim()||!p){e({variant:"destructive",title:"Erro",description:"Preencha o nome do quadro elétrico e selecione um ambiente."});return}d(!0);try{const L=await fetch("/api/quadros_eletricos",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({nome:h.trim(),ambiente_id:p,notes:g.trim()||null})}),M=await L.json().catch(()=>null);L.ok&&(M!=null&&M.ok)?(m(""),b(""),y(""),await N(),e({title:"Sucesso!",description:"Quadro elétrico adicionado com sucesso."})):e({variant:"destructive",title:"Erro",description:(M==null?void 0:M.error)||"Erro ao adicionar quadro elétrico."})}catch{e({variant:"destructive",title:"Erro",description:"Erro de conexão com o servidor."})}finally{d(!1)}},$=T=>{x(T),j(!0)},D=async T=>{var L;if(T.preventDefault(),!!v){d(!0);try{const M=await fetch(`/api/quadros_eletricos/${v.id}`,{method:"PUT",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({nome:v.nome.trim(),ambiente_id:v.ambiente.id,notes:((L=v.notes)==null?void 0:L.trim())||null})}),B=await M.json().catch(()=>null);M.ok&&(B!=null&&B.ok)?(j(!1),await N(),e({title:"Sucesso!",description:"Quadro elétrico atualizado com sucesso."})):e({variant:"destructive",title:"Erro",description:(B==null?void 0:B.error)||"Erro ao atualizar quadro elétrico."})}catch{e({variant:"destructive",title:"Erro",description:"Erro de conexão com o servidor."})}finally{d(!1)}}},z=async T=>{if(window.confirm("Tem certeza que deseja excluir este quadro elétrico?")){d(!0);try{const L=await fetch(`/api/quadros_eletricos/${T}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json"}}),M=await L.json().catch(()=>null);L.ok&&(M!=null&&M.ok)?(c(B=>B.filter(W=>W.id!==T)),e({title:"Sucesso!",description:"Quadro elétrico excluído com sucesso."})):e({variant:"destructive",title:"Erro",description:(M==null?void 0:M.error)||"Erro ao excluir quadro elétrico."})}catch{e({variant:"destructive",title:"Erro",description:"Erro de conexão com o servidor."})}finally{d(!1)}}};return i.jsx(kr,{children:i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[i.jsx("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-10",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-blue-500 to-blue-600 rounded-3xl flex items-center justify-center shadow-lg shadow-blue-500/25",children:i.jsx(Ad,{className:"w-8 h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Gerenciar Quadros Elétricos"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl",children:"Adicione ou edite quadros elétricos para organizar seus módulos."})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-blue-600 to-indigo-600 rounded-full shadow-sm"})]})}),r===!1&&i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:i.jsxs(en,{className:"bg-amber-50 border-amber-200 shadow-sm",children:[i.jsx(Ot,{className:"h-4 w-4 text-amber-600"}),i.jsx(tn,{className:"text-amber-800",children:"Selecione um projeto na página inicial para gerenciar quadros elétricos."})]})}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[i.jsx(Ee.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1},children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-blue-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Uc,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Adicionar Novo Quadro"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Preencha as informações do quadro elétrico"})]})]})}),i.jsx(at,{children:i.jsxs("form",{className:"space-y-6",onSubmit:_,children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"nome",className:"text-sm font-semibold text-slate-700",children:"Nome do Quadro Elétrico *"}),i.jsx(Oe,{id:"nome",placeholder:"Ex: Quadro Principal, Quadro Técnico...",value:h,onChange:T=>m(T.target.value),required:!0,disabled:s||u||o.length===0,className:"h-12 px-4 rounded-xl border-border focus:border-blue-500 focus:ring-blue-500/20"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"ambienteId",className:"text-sm font-semibold text-slate-700",children:"Ambiente *"}),i.jsxs("select",{id:"ambienteId",className:"h-12 w-full px-4 rounded-xl border border-border bg-background focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all",value:p,onChange:T=>b(Number(T.target.value)),required:!0,disabled:!r||o.length===0,children:[i.jsx("option",{value:"",children:"Selecione um ambiente"}),o.map(T=>i.jsxs("option",{value:T.id,children:[T.nome," ",T.area&&`- ${T.area.nome}`]},T.id))]}),!u&&r===!0&&o.length===0&&i.jsxs("p",{className:"text-sm text-amber-600 mt-1 flex items-center gap-1",children:[i.jsx(Ot,{className:"w-3 h-3"}),"Nenhum ambiente disponível. Crie ambientes primeiro."]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"notes",className:"text-sm font-semibold text-slate-700",children:"Observações (Opcional)"}),i.jsx("textarea",{id:"notes",placeholder:"Observações adicionais sobre o quadro elétrico...",value:g,onChange:T=>y(T.target.value),disabled:s||u||o.length===0,className:"w-full px-4 py-3 rounded-xl border border-border bg-background focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all resize-none",rows:3})]}),i.jsxs(de,{type:"submit",className:"w-full h-12 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center justify-center gap-2",disabled:!r||o.length===0,children:[i.jsx(Un,{className:"h-5 w-5"}),"Adicionar Quadro Elétrico"]})]})})]})}),i.jsx(Ee.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-blue-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Ad,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Quadros Cadastrados"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Lista de todos os quadros elétricos"})]})]}),i.jsxs(yt,{className:"bg-gradient-to-r from-blue-500 to-indigo-500 text-white text-sm font-medium px-3 py-1",children:[l.length," ",l.length===1?"quadro":"quadros"]})]})}),i.jsx(at,{children:u?i.jsxs("div",{className:"flex flex-col justify-center items-center py-12",children:[i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-4 border-blue-500 border-t-transparent mb-4"}),i.jsx("p",{className:"text-muted-foreground font-medium",children:"Carregando quadros elétricos..."})]}):l.length===0?i.jsxs(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center py-12",children:[i.jsx("div",{className:"w-20 h-20 bg-muted rounded-full flex items-center justify-center mx-auto mb-6",children:i.jsx(MN,{className:"h-10 w-10 text-muted-foreground/80"})}),i.jsx("h4",{className:"text-xl font-semibold text-foreground mb-2",children:r?"Nenhum quadro elétrico cadastrado":"Selecione um projeto"}),i.jsx("p",{className:"text-muted-foreground max-w-sm mx-auto",children:r?"Comece adicionando seu primeiro quadro elétrico usando o formulário ao lado.":"Selecione um projeto para visualizar e gerenciar os quadros elétricos."})]}):i.jsx("div",{className:"space-y-3 max-h-96 overflow-y-auto pr-2",children:i.jsx(Ir,{children:l.map((T,L)=>{var M;return i.jsxs(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{delay:L*.05},className:"group relative overflow-hidden rounded-2xl border border-border bg-card/85 backdrop-blur-sm p-4 hover:bg-card/90 hover:shadow-lg hover:shadow-slate-900/5 transition-all duration-300",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1 mr-4",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("h4",{className:"font-bold text-foreground text-lg",children:T.nome}),i.jsxs(yt,{variant:"secondary",className:"bg-blue-100 text-blue-700",children:[T.quantidade_modulos," módulo",T.quantidade_modulos!==1?"s":""]})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[i.jsx($x,{className:"h-4 w-4 text-muted-foreground/80"}),i.jsxs("span",{className:"font-medium",children:["Ambiente: ",T.ambiente.nome]})]}),i.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[i.jsx(EM,{className:"h-4 w-4 text-muted-foreground/80"}),i.jsxs("span",{className:"font-medium",children:["Área:"," ",((M=T.ambiente.area)==null?void 0:M.nome)||"—"]})]})]}),T.notes&&i.jsx("div",{className:"mt-2",children:i.jsx("p",{className:"text-sm text-muted-foreground/90 italic",children:T.notes})})]}),i.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[i.jsx(de,{variant:"ghost",size:"icon",onClick:()=>$(T),className:"h-8 w-8 hover:bg-blue-100",children:i.jsx(Ja,{className:"h-4 w-4 text-blue-600"})}),i.jsx(de,{variant:"ghost",size:"icon",onClick:()=>z(T.id),disabled:u||T.quantidade_modulos>0,className:"h-8 w-8 hover:bg-red-100",title:T.quantidade_modulos>0?"Remova os módulos antes de excluir":"Excluir quadro",children:i.jsx(Cn,{className:"h-4 w-4 text-red-600"})})]})]}),T.quantidade_modulos>0&&i.jsx("div",{className:"mt-2",children:i.jsxs(yt,{variant:"outline",className:"text-xs bg-amber-50 text-amber-700 border-amber-200",children:["Contém ",T.quantidade_modulos," módulo",T.quantidade_modulos!==1?"s":""]})})]},T.id)})})})})]})})]}),v&&i.jsx(dl,{open:w,onOpenChange:j,children:i.jsxs(Ni,{children:[i.jsx(Ci,{children:i.jsx(Ei,{children:"Editar Quadro Elétrico"})}),i.jsxs("form",{onSubmit:D,children:[i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-nome",children:"Nome do Quadro"}),i.jsx(Oe,{id:"edit-nome",value:v.nome,onChange:T=>x({...v,nome:T.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-ambiente",children:"Ambiente"}),i.jsx("select",{id:"edit-ambiente",value:v.ambiente.id,onChange:T=>{const L=Number(T.target.value),M=o.find(B=>B.id===L);M&&x({...v,ambiente:M})},className:"w-full h-10 px-3 rounded-md border border-input bg-background",children:o.map(T=>{var L;return i.jsxs("option",{value:T.id,children:[T.nome," - ",(L=T.area)==null?void 0:L.nome]},T.id)})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-notes",children:"Observações"}),i.jsx("textarea",{id:"edit-notes",value:v.notes||"",onChange:T=>x({...v,notes:T.target.value}),className:"w-full px-3 py-2 rounded-md border border-input bg-background",rows:3})]})]}),i.jsxs(ki,{children:[i.jsx(Xc,{asChild:!0,children:i.jsx(de,{type:"button",variant:"secondary",children:"Cancelar"})}),i.jsx(de,{type:"submit",disabled:u,children:"Salvar Alterações"})]})]})]})}),i.jsx(bs,{previousPath:"/ambientes",nextPath:"/circuitos"})]})})})}const _8=({circuito:e,ambientes:t,isOpen:r,onClose:n,onSave:s})=>{const{toast:o}=Kt(),[a,l]=f.useState(""),[c,u]=f.useState(""),[d,h]=f.useState("luz"),[m,p]=f.useState(""),[b,g]=f.useState(!1),[y,v]=f.useState(""),x=j=>j.replace(/[^\d]/g,"");f.useEffect(()=>{var j;e&&(l(e.identificador),u(e.nome),h(e.tipo),p(e.ambiente.id),g(e.dimerizavel||!1),v(((j=e.potencia)==null?void 0:j.toString())||""))},[e]);const w=async()=>{if(!e)return;if(!a.trim()||!c.trim()||!d||!m){o({variant:"destructive",title:"Erro",description:"Preencha todos os campos."});return}const j={...e,identificador:a.trim(),nome:c.trim(),tipo:d,dimerizavel:d==="luz"?b:!1,potencia:y===""?void 0:parseInt(y,10),ambiente:{...e.ambiente,id:Number(m)}};try{const S=await fetch(`/api/circuitos/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({identificador:j.identificador,nome:j.nome,tipo:j.tipo,dimerizavel:j.dimerizavel,potencia:j.potencia,ambiente_id:j.ambiente.id})});if(!S.ok)throw new Error(`HTTP error! status: ${S.status}`);const N=await S.json();N.ok?(s(j),o({title:"Sucesso!",description:"Circuito atualizado."}),n()):o({variant:"destructive",title:"Erro",description:N.error||"Falha ao atualizar circuito."})}catch(S){console.error("Erro ao atualizar circuito:",S),o({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}};return i.jsx(dl,{open:r,onOpenChange:n,children:i.jsxs(Ni,{children:[i.jsx(Ci,{children:i.jsx(Ei,{children:"Editar Circuito"})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-identificador",children:"Identificador"}),i.jsx(Oe,{id:"edit-identificador",value:a,onChange:j=>l(j.target.value)})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-nome",children:"Nome"}),i.jsx(Oe,{id:"edit-nome",value:c,onChange:j=>u(j.target.value)})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-tipo",children:"Tipo"}),i.jsxs(vr,{value:d,onValueChange:j=>h(j),children:[i.jsx(ar,{id:"edit-tipo",children:i.jsx(yr,{})}),i.jsxs(lr,{children:[i.jsx(ne,{value:"luz",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ia,{className:"h-4 w-4"}),i.jsx("span",{children:"Luz"})]})}),i.jsx(ne,{value:"persiana",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Da,{className:"h-4 w-4"}),i.jsx("span",{children:"Persiana"})]})}),i.jsx(ne,{value:"hvac",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(gc,{className:"h-4 w-4"}),i.jsx("span",{children:"HVAC"})]})})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-ambiente",children:"Ambiente"}),i.jsxs(vr,{value:m.toString(),onValueChange:j=>p(Number(j)),children:[i.jsx(ar,{id:"edit-ambiente",children:i.jsx(yr,{})}),i.jsx(lr,{children:t.map(j=>{var S;return i.jsx(ne,{value:j.id.toString(),children:(S=j.area)!=null&&S.nome?`${j.nome} (${j.area.nome})`:j.nome},j.id)})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4 items-center",children:[d==="luz"&&i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{type:"checkbox",id:"edit-dimerizavel",checked:b,onChange:j=>g(j.target.checked)}),i.jsxs(le,{htmlFor:"edit-dimerizavel",className:"flex items-center gap-2",children:[i.jsx(Ot,{className:"w-4 h-4"}),"Dimerizável"]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-potencia",children:"Potência (W)"}),i.jsx(Oe,{id:"edit-potencia",value:y,onChange:j=>v(x(j.target.value))})]})]})]}),i.jsxs(ki,{children:[i.jsx(Xc,{asChild:!0,children:i.jsx(de,{variant:"outline",onClick:n,children:"Cancelar"})}),i.jsx(de,{onClick:w,children:"Salvar Alterações"})]})]})})};function T8(){const{toast:e}=Kt();Jr();const[t,r]=f.useState([]),[n,s]=f.useState([]),[o,a]=f.useState(!0),[l,c]=f.useState(!1),[u,d]=f.useState(!1),[h,m]=f.useState(""),p=E=>E.replace(/[^\d]/g,""),[b,g]=f.useState(null),[y,v]=f.useState(""),[x,w]=f.useState("todos"),[j,S]=f.useState("todos"),[N,C]=f.useState(""),[_,$]=f.useState(""),[D,z]=f.useState("luz"),[T,L]=f.useState("");f.useEffect(()=>{D!=="luz"&&d(!1)},[D]);const M=f.useMemo(()=>n.filter(E=>{const I=y===""||E.nome.toLowerCase().includes(y.toLowerCase())||E.identificador.toLowerCase().includes(y.toLowerCase()),q=x==="todos"||E.tipo===x,F=j==="todos"||E.ambiente.id===j;return I&&q&&F}),[n,y,x,j]),B=async()=>{a(!0);try{const I=await(await fetch("/api/projeto_atual",{credentials:"same-origin"})).json();if(I.ok&&I.projeto_atual){c(!0);const[q,F]=await Promise.all([fetch("/api/ambientes",{credentials:"same-origin"}),fetch("/api/circuitos",{credentials:"same-origin"})]);if(!q.ok||!F.ok)throw new Error("Falha ao carregar dados");const Z=await q.json(),X=await F.json();r((Z==null?void 0:Z.ambientes)||Z||[]),s((X==null?void 0:X.circuitos)||X||[])}else c(!1),r([]),s([])}catch(E){console.error("Erro ao verificar/carregar dados do projeto:",E),e({variant:"destructive",title:"Erro",description:"Falha ao carregar dados. Verifique se há um projeto selecionado."}),c(!1)}finally{a(!1)}};f.useEffect(()=>{const E=I=>{console.error("Unhandled promise rejection:",I.reason),I.preventDefault()};return window.addEventListener("unhandledrejection",E),B(),()=>{window.removeEventListener("unhandledrejection",E)}},[]);const W=f.useMemo(()=>t.map(E=>{var I;return{id:E.id,label:(I=E.area)!=null&&I.nome?`${E.nome} (${E.area.nome})`:E.nome}}),[t]);async function H(E){if(E.preventDefault(),!N.trim()||!_.trim()||!D||!T){e({variant:"destructive",title:"Erro",description:"Preencha todos os campos."});return}try{const I=await fetch("/api/circuitos",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({identificador:N.trim(),nome:_.trim(),tipo:D,dimerizavel:D==="luz"?u:!1,potencia:h===""?null:parseInt(h,10),ambiente_id:T})});if(!I.ok)throw new Error(`HTTP error! status: ${I.status}`);const q=await I.json();q!=null&&q.ok||q!=null&&q.success?(C(""),$(""),d(!1),m(""),B().catch(F=>{console.error("Erro ao recarregar dados:",F)}),e({title:"Sucesso!",description:"Circuito adicionado."})):e({variant:"destructive",title:"Erro",description:(q==null?void 0:q.error)||(q==null?void 0:q.message)||"Falha ao adicionar circuito."})}catch(I){console.error("Erro ao criar circuito:",I),e({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}}async function A(E){if(confirm("Tem certeza que deseja excluir este circuito?"))try{const I=await fetch(`/api/circuitos/${E}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json"}});if(!I.ok)throw new Error(`HTTP error! status: ${I.status}`);const q=await I.json();q!=null&&q.ok||q!=null&&q.success?(s(F=>F.filter(Z=>Z.id!==E)),e({title:"Sucesso!",description:"Circuito excluído."})):e({variant:"destructive",title:"Erro",description:(q==null?void 0:q.error)||(q==null?void 0:q.message)||"Falha ao excluir circuito."})}catch(I){console.error("Erro ao excluir circuito:",I),e({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}}return i.jsxs(kr,{children:[i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[i.jsx("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-10",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-yellow-500 to-orange-500 rounded-3xl flex items-center justify-center shadow-lg shadow-blue-500/25",children:i.jsx(os,{className:"w-8 h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Gerenciar Circuitos"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl",children:"Cadastre os circuitos elétricos do seu projeto."})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-blue-600 to-indigo-600 rounded-full shadow-sm"})]})}),!l&&!o&&i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:i.jsxs(en,{className:"bg-amber-50 border-amber-200 shadow-sm",children:[i.jsx(Ot,{className:"h-4 w-4 text-amber-600"}),i.jsx(tn,{className:"text-amber-800",children:"Selecione um projeto na página inicial para cadastrar circuitos."})]})}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[i.jsx(Ee.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1},children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-green-500 to-emerald-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Un,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Adicionar Novo Circuito"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Preencha as informações do circuito"})]})]})}),i.jsx(at,{children:i.jsxs("form",{className:"space-y-6",onSubmit:H,children:[i.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"identificador",className:"text-sm font-semibold text-slate-700",children:"Identificador *"}),i.jsx(Oe,{id:"identificador",placeholder:"Ex: C001, L01...",value:N,onChange:E=>C(E.target.value),required:!0,disabled:!l,className:"h-12 px-4 rounded-xl border-border focus:border-blue-500 focus:ring-blue-500/20"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"nome",className:"text-sm font-semibold text-slate-700",children:"Nome do Circuito *"}),i.jsx(Oe,{id:"nome",placeholder:"Digite o nome do circuito...",value:_,onChange:E=>$(E.target.value),required:!0,disabled:!l,className:"h-12 px-4 rounded-xl border-border focus:border-blue-500 focus:ring-blue-500/20"})]})]}),i.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"tipo",className:"text-sm font-semibold text-slate-700",children:"Tipo *"}),i.jsxs(vr,{value:D,onValueChange:E=>z(E),disabled:!l,children:[i.jsx(ar,{id:"tipo",className:"h-12 w-full rounded-xl border border-border bg-background focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all",children:i.jsx(yr,{placeholder:"Selecione o tipo"})}),i.jsxs(lr,{className:"rounded-xl",children:[i.jsx(ne,{value:"luz",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ia,{className:"h-4 w-4 text-yellow-500"}),i.jsx("span",{children:"Luz"})]})}),i.jsx(ne,{value:"persiana",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Da,{className:"h-4 w-4 text-blue-500"}),i.jsx("span",{children:"Persiana"})]})}),i.jsx(ne,{value:"hvac",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(gc,{className:"h-4 w-4 text-green-500"}),i.jsx("span",{children:"HVAC"})]})})]})]})]}),D==="luz"&&i.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-slate-50 dark:bg-slate-800/50 rounded-xl border border-border",children:[i.jsx("input",{type:"checkbox",id:"dimerizavel",checked:u,onChange:E=>d(E.target.checked),className:"h-4 w-4 text-blue-600 border-border rounded focus:ring-blue-500"}),i.jsxs("label",{htmlFor:"dimerizavel",className:"text-sm font-medium text-slate-700 dark:text-slate-300 flex items-center gap-2",children:[i.jsx(Ot,{className:"w-4 h-4 text-blue-500"}),"Circuito dimerizável"]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"potencia",className:"text-sm font-semibold text-slate-700",children:"Potência (W) *"}),i.jsx(Oe,{id:"potencia",type:"text",inputMode:"numeric",placeholder:"Ex: 60, 100, 150...",value:h,onChange:E=>m(p(E.target.value)),onBlur:()=>m(E=>E.replace(/^0+(?=\d)/,"")),onKeyDown:E=>{["e","E","+","-",".",",","="].includes(E.key)&&E.preventDefault()},minLength:1,pattern:"^\\d+$",title:"Digite apenas números inteiros",required:!0,disabled:!l,className:"h-12 px-4 rounded-xl border-border focus:border-blue-500 focus:ring-blue-500/20"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"ambiente_id",className:"text-sm font-semibold text-slate-700",children:"Ambiente *"}),i.jsxs("select",{id:"ambiente_id",className:"h-12 w-full px-4 rounded-xl border border-border bg-background focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all",value:T,onChange:E=>L(Number(E.target.value)),required:!0,disabled:!l||o||t.length===0,children:[i.jsx("option",{value:"",children:o?"Carregando ambientes...":"Selecione um ambiente"}),!o&&W.map(E=>i.jsx("option",{value:E.id,children:E.label},E.id))]}),!o&&l&&t.length===0&&i.jsxs("p",{className:"text-sm text-amber-600 mt-1 flex items-center gap-1",children:[i.jsx(Ot,{className:"w-3 h-3"}),"Nenhum ambiente disponível. Crie ambientes primeiro."]})]})]}),i.jsxs(de,{type:"submit",className:"w-full h-12 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center justify-center gap-2",disabled:!l||o||t.length===0,children:[i.jsx(Un,{className:"h-5 w-5"}),"Adicionar Circuito"]})]})})]})}),i.jsx(Ee.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsxs(it,{className:"pb-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-yellow-500 to-orange-500 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(os,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Circuitos Cadastrados"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Lista de todos os circuitos"})]})]}),i.jsxs(yt,{className:"bg-gradient-to-r from-blue-500 to-indigo-500 text-white text-sm font-medium px-3 py-1",children:[M.length," de ",n.length," ",n.length===1?"circuito":"circuitos"]})]}),i.jsxs("div",{className:"mt-6 space-y-4",children:[i.jsxs("div",{className:"relative",children:[i.jsx(La,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground/80 w-4 h-4"}),i.jsx(Oe,{placeholder:"Buscar por nome ou identificador...",value:y,onChange:E=>v(E.target.value),className:"pl-10 pr-10 h-10 rounded-xl border-border focus:border-blue-500"}),y&&i.jsx("button",{onClick:()=>v(""),className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-muted-foreground/80 hover:text-muted-foreground",children:i.jsx(Nr,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(le,{htmlFor:"filtro-tipo",className:"text-xs font-medium text-muted-foreground",children:"Tipo"}),i.jsxs(vr,{value:x,onValueChange:E=>w(E),children:[i.jsx(ar,{id:"filtro-tipo",className:"h-9 text-sm rounded-xl",children:i.jsx(yr,{placeholder:"Todos os tipos"})}),i.jsxs(lr,{className:"rounded-xl",children:[i.jsx(ne,{value:"todos",children:"Todos os tipos"}),i.jsx(ne,{value:"luz",children:"Luz"}),i.jsx(ne,{value:"persiana",children:"Persiana"}),i.jsx(ne,{value:"hvac",children:"HVAC"})]})]})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(le,{htmlFor:"filtro-ambiente",className:"text-xs font-medium text-muted-foreground",children:"Ambiente"}),i.jsxs(vr,{value:j==="todos"?"todos":j.toString(),onValueChange:E=>S(E==="todos"?"todos":parseInt(E)),children:[i.jsx(ar,{id:"filtro-ambiente",className:"h-9 text-sm rounded-xl",children:i.jsx(yr,{placeholder:"Todos os ambientes"})}),i.jsxs(lr,{className:"rounded-xl",children:[i.jsx(ne,{value:"todos",children:"Todos os ambientes"}),t.map(E=>i.jsxs(ne,{value:E.id.toString(),children:[E.nome,E.area&&` (${E.area.nome})`]},E.id))]})]})]})]}),(y||x!=="todos"||j!=="todos")&&i.jsx("div",{className:"flex justify-end",children:i.jsxs(de,{variant:"outline",size:"sm",onClick:()=>{v(""),w("todos"),S("todos")},className:"h-8 text-xs rounded-lg gap-1",children:[i.jsx(Nr,{className:"w-3 h-3"}),"Limpar filtros"]})})]})]}),i.jsx(at,{children:o?i.jsxs("div",{className:"flex flex-col justify-center items-center py-12",children:[i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-4 border-blue-500 border-t-transparent mb-4"}),i.jsx("p",{className:"text-muted-foreground font-medium",children:"Carregando circuitos..."})]}):n.length===0?i.jsxs(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center py-12",children:[i.jsx("div",{className:"w-20 h-20 bg-muted rounded-full flex items-center justify-center mx-auto mb-6",children:i.jsx(os,{className:"h-10 w-10 text-muted-foreground/80"})}),i.jsx("h4",{className:"text-xl font-semibold text-foreground mb-2",children:l?"Nenhum circuito cadastrado":"Selecione um projeto"}),i.jsx("p",{className:"text-muted-foreground max-w-sm mx-auto",children:l?"Comece adicionando seu primeiro circuito usando o formulário ao lado.":"Selecione um projeto para visualizar e gerenciar os circuitos."})]}):M.length===0?i.jsxs(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center py-12",children:[i.jsx("div",{className:"w-20 h-20 bg-muted rounded-full flex items-center justify-center mx-auto mb-6",children:i.jsx(La,{className:"h-10 w-10 text-muted-foreground/80"})}),i.jsx("h4",{className:"text-xl font-semibold text-foreground mb-2",children:"Nenhum circuito encontrado"}),i.jsx("p",{className:"text-muted-foreground max-w-sm mx-auto",children:"Tente ajustar os filtros de busca para encontrar o que procura."})]}):i.jsx("div",{className:"space-y-3 max-h-96 overflow-y-auto pr-2",children:i.jsx(Ir,{children:M.map((E,I)=>{var q,F,Z;return i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{delay:I*.05},className:"group relative overflow-hidden rounded-2xl border border-border bg-card/85 backdrop-blur-sm p-4 hover:bg-card/90 hover:shadow-lg hover:shadow-slate-900/5 transition-all duration-300",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1 mr-4",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[i.jsxs(yt,{className:`text-xs font-medium px-2 py-1 flex items-center gap-1 ${E.tipo==="luz"?u?"bg-purple-100 text-purple-800":"bg-yellow-100 text-yellow-800":E.tipo==="persiana"?"bg-blue-100 text-primary":"bg-green-100 text-green-800"}`,children:[E.tipo==="luz"?i.jsx(Ia,{className:"h-3 w-3"}):E.tipo==="persiana"?i.jsx(Da,{className:"h-3 w-3"}):i.jsx(gc,{className:"h-3 w-3"}),E.tipo.toUpperCase(),E.tipo==="luz"&&E.dimerizavel&&i.jsx(Ot,{className:"h-3 w-3 ml-1"})]}),i.jsx("span",{className:"text-sm font-mono text-muted-foreground/90 bg-muted px-2 py-1 rounded-lg",children:E.identificador})]}),i.jsx("h4",{className:"font-bold text-foreground text-lg mb-2",children:E.nome}),i.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-2",children:[i.jsx(zx,{className:"h-4 w-4 text-muted-foreground/80"}),i.jsx("span",{className:"font-medium",children:(q=E.ambiente)==null?void 0:q.nome}),((Z=(F=E.ambiente)==null?void 0:F.area)==null?void 0:Z.nome)&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground/80",children:"•"}),i.jsxs("span",{className:"text-muted-foreground/90",children:["Área: ",E.ambiente.area.nome]})]})]}),i.jsxs("div",{className:"text-xs text-muted-foreground/90",children:[i.jsx("span",{className:"font-medium",children:"SAK: "}),E.tipo!=="hvac"?E.sak??i.jsx("span",{className:"italic opacity-60",children:"Não definido"}):i.jsx("span",{className:"opacity-60",children:"Não aplicável"}),E.tipo==="luz"&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"mx-2",children:"•"}),i.jsx("span",{className:"font-medium",children:"Tipo: "}),E.dimerizavel?"Dimmer":"ON/OFF"]}),E.potencia>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"mx-2",children:"•"}),i.jsx("span",{className:"font-medium",children:"Potência: "}),E.potencia,"W"]})]})]}),i.jsxs("div",{className:"flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:[i.jsx(de,{variant:"outline",size:"sm",onClick:()=>g(E),disabled:!l,className:"rounded-xl shadow-sm hover:shadow-md",children:i.jsx(Ja,{className:"h-4 w-4"})}),i.jsx(de,{variant:"destructive",size:"sm",onClick:()=>A(E.id),disabled:!l,className:"rounded-xl shadow-lg hover:shadow-xl",children:i.jsx(Cn,{className:"h-4 w-4"})})]})]})},E.id)})})})})]})})]}),i.jsx(bs,{previousPath:"/quadros",nextPath:"/modulos"})]})}),i.jsx(_8,{isOpen:!!b,onClose:()=>g(null),circuito:b,ambientes:t,onSave:E=>{B(),g(null)}})]})}var Zf="Checkbox",[P8,VB]=Wn(Zf),[A8,iy]=P8(Zf);function R8(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:s,disabled:o,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:h}=e,[m,p]=uo({prop:r,defaultProp:s??!1,onChange:c,caller:Zf}),[b,g]=f.useState(null),[y,v]=f.useState(null),x=f.useRef(!1),w=b?!!a||!!b.closest("form"):!0,j={checked:m,disabled:o,setChecked:p,control:b,setControl:g,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:x,required:u,defaultChecked:oo(s)?!1:s,isFormControl:w,bubbleInput:y,setBubbleInput:v};return i.jsx(A8,{scope:t,...j,children:M8(h)?h(j):n})}var n_="CheckboxTrigger",s_=f.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},s)=>{const{control:o,value:a,disabled:l,checked:c,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:m,isFormControl:p,bubbleInput:b}=iy(n_,e),g=ze(s,d),y=f.useRef(c);return f.useEffect(()=>{const v=o==null?void 0:o.form;if(v){const x=()=>h(y.current);return v.addEventListener("reset",x),()=>v.removeEventListener("reset",x)}},[o,h]),i.jsx(Te.button,{type:"button",role:"checkbox","aria-checked":oo(c)?"mixed":c,"aria-required":u,"data-state":c_(c),"data-disabled":l?"":void 0,disabled:l,value:a,...n,ref:g,onKeyDown:ke(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:ke(r,v=>{h(x=>oo(x)?!0:!x),b&&p&&(m.current=v.isPropagationStopped(),m.current||v.stopPropagation())})})});s_.displayName=n_;var ay=f.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:s,defaultChecked:o,required:a,disabled:l,value:c,onCheckedChange:u,form:d,...h}=e;return i.jsx(R8,{__scopeCheckbox:r,checked:s,defaultChecked:o,disabled:l,required:a,onCheckedChange:u,name:n,form:d,value:c,internal_do_not_use_render:({isFormControl:m})=>i.jsxs(i.Fragment,{children:[i.jsx(s_,{...h,ref:t,__scopeCheckbox:r}),m&&i.jsx(l_,{__scopeCheckbox:r})]})})});ay.displayName=Zf;var o_="CheckboxIndicator",i_=f.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...s}=e,o=iy(o_,r);return i.jsx($r,{present:n||oo(o.checked)||o.checked===!0,children:i.jsx(Te.span,{"data-state":c_(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});i_.displayName=o_;var a_="CheckboxBubbleInput",l_=f.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:a,required:l,disabled:c,name:u,value:d,form:h,bubbleInput:m,setBubbleInput:p}=iy(a_,e),b=ze(r,p),g=sy(o),y=Xx(n);f.useEffect(()=>{const x=m;if(!x)return;const w=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(w,"checked").set,N=!s.current;if(g!==o&&S){const C=new Event("click",{bubbles:N});x.indeterminate=oo(o),S.call(x,oo(o)?!1:o),x.dispatchEvent(C)}},[m,g,o,s]);const v=f.useRef(oo(o)?!1:o);return i.jsx(Te.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??v.current,required:l,disabled:c,name:u,value:d,form:h,...t,tabIndex:-1,ref:b,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});l_.displayName=a_;function M8(e){return typeof e=="function"}function oo(e){return e==="indeterminate"}function c_(e){return oo(e)?"indeterminate":e?"checked":"unchecked"}const Pc=f.forwardRef(({className:e,...t},r)=>i.jsx(ay,{ref:r,className:he("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:i.jsx(i_,{className:he("flex items-center justify-center text-current"),children:i.jsx(Ef,{className:"h-4 w-4"})})}));Pc.displayName=ay.displayName;const Oi=["AQL-GV-M4","ADP-M8","ADP-M16"];function O8(){var Q,ae;const{projeto:e}=Jr(),[t,r]=f.useState(e?!0:null),n=t!==!0,{toast:s}=Kt(),[o,a]=f.useState([]),[l,c]=f.useState([]),[u,d]=f.useState({}),[h,m]=f.useState(!0),[p,b]=f.useState(!0),[g,y]=f.useState(!0),[v,x]=f.useState(""),[w,j]=f.useState(""),[S,N]=f.useState(""),[C,_]=f.useState(""),$=f.useRef(""),[D,z]=f.useState(""),[T,L]=f.useState(""),[M,B]=f.useState(""),[W,H]=f.useState(""),[A,E]=f.useState(!1),[I,q]=f.useState(null),[F,Z]=f.useState(!1),X=f.useMemo(()=>Object.keys(u).filter(O=>!Oi.includes(O)),[u]),ee=f.useMemo(()=>o.filter(O=>O.is_controller),[o]);f.useEffect(()=>{try{e&&r(!0)}catch{}},[e]),f.useEffect(()=>{(async()=>{try{if(t!==null)return;const J=await(await fetch("/api/projeto_atual",{credentials:"same-origin"})).json();r(!!(J!=null&&J.ok&&(J!=null&&J.projeto_atual)))}catch{r(!1)}})()},[t]);const xe=async()=>{b(!0);try{const ye=await(await fetch("/api/modulos/meta",{credentials:"same-origin"})).json();d((ye==null?void 0:ye.meta)||{})}catch{s({variant:"destructive",title:"Erro",description:"Falha ao carregar metadados de módulos."})}finally{b(!1)}},G=async()=>{if(t!==!0){y(!1);return}y(!0);try{const ye=await(await fetch("/api/quadros_eletricos",{credentials:"same-origin"})).json();c((ye==null?void 0:ye.quadros_eletricos)||[])}catch{s({variant:"destructive",title:"Erro",description:"Falha ao carregar quadros elétricos."})}finally{y(!1)}},Se=async()=>{if(t!==!0){m(!1);return}m(!0);try{const ye=await(await fetch("/api/modulos",{credentials:"same-origin"})).json();a((ye==null?void 0:ye.modulos)||[])}catch{s({variant:"destructive",title:"Erro",description:"Falha ao carregar módulos."})}finally{m(!1)}};f.useEffect(()=>{xe()},[]),f.useEffect(()=>{t===!0?(Se(),G()):t===!1&&(m(!1),y(!1))},[t]),f.useEffect(()=>{v&&u[v]?j(u[v].nome_completo):j("")},[v,u]),f.useEffect(()=>{const O=o.some(ye=>ye.is_controller);E(!O)},[o]),f.useEffect(()=>{$.current&&N($.current)},[v]);async function Ae(O){if(O.preventDefault(),!v||!w.trim()||!S||!C){s({variant:"destructive",title:"Erro",description:"Todos os campos para o módulo são obrigatórios."});return}$.current=S;try{const ye=await fetch("/api/modulos",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({tipo:v,nome:w.trim(),parent_controller_id:S,quadro_eletrico_id:C})}),J=await ye.json().catch(()=>null);ye.ok&&(J!=null&&J.ok||J!=null&&J.success)?(x(""),j(""),N(""),_(""),await Se(),s({title:"Sucesso!",description:"Módulo adicionado."})):s({variant:"destructive",title:"Erro",description:(J==null?void 0:J.error)||"Falha ao adicionar módulo."})}catch{s({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}}async function Re(O){if(O.preventDefault(),!D||!T.trim()||!M.trim()||!W){s({variant:"destructive",title:"Erro",description:"Todos os campos para o controlador são obrigatórios."});return}if(!/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(M.trim())){s({variant:"destructive",title:"Erro",description:"O formato do endereço IP é inválido."});return}try{const J=await fetch("/api/modulos",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({tipo:D,nome:T.trim(),ip_address:M.trim(),quadro_eletrico_id:W,is_controller:!0,is_logic_server:A})}),k=await J.json().catch(()=>null);J.ok&&(k!=null&&k.ok||k!=null&&k.success)?(z(""),L(""),B(""),H(""),await Se(),s({title:"Sucesso!",description:"Controlador adicionado."})):s({variant:"destructive",title:"Erro",description:(k==null?void 0:k.error)||"Falha ao adicionar controlador."})}catch{s({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}}const se=O=>{q({...O}),Z(!0)},we=async O=>{var ye;if(O.preventDefault(),!!I){m(!0);try{const J=await fetch(`/api/modulos/${I.id}`,{method:"PUT",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({nome:I.nome.trim(),quadro_eletrico_id:((ye=I.quadro_eletrico)==null?void 0:ye.id)||null,parent_controller_id:I.parent_controller_id,ip_address:Oi.includes(I.tipo)?I.ip_address:void 0,is_logic_server:Oi.includes(I.tipo)?I.is_logic_server:void 0})}),k=await J.json().catch(()=>null);J.ok&&(k!=null&&k.ok||k!=null&&k.success)?(Z(!1),await Se(),s({title:"Sucesso!",description:"Módulo atualizado."})):s({variant:"destructive",title:"Erro",description:(k==null?void 0:k.error)||"Erro ao atualizar módulo."})}catch{s({variant:"destructive",title:"Erro",description:"Erro de conexão com o servidor."})}finally{m(!1)}}};async function ve(O){if(confirm("Tem certeza que deseja excluir este módulo? Esta ação não pode ser desfeita."))try{const ye=await fetch(`/api/modulos/${O}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json"}}),J=await ye.json().catch(()=>null);ye.ok&&(J!=null&&J.ok||J!=null&&J.success)?(await Se(),s({title:"Sucesso!",description:"Módulo excluído."})):s({variant:"destructive",title:"Erro",description:(J==null?void 0:J.error)||"Não foi possível excluir."})}catch{s({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}}const Xe=f.useMemo(()=>[...o].sort((O,ye)=>O.is_controller&&!ye.is_controller?-1:!O.is_controller&&ye.is_controller?1:O.is_logic_server&&!ye.is_logic_server?-1:!O.is_logic_server&&ye.is_logic_server?1:O.nome.localeCompare(ye.nome)),[o]);return i.jsx(kr,{children:i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[i.jsx("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-10",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-purple-600 to-violet-600 rounded-3xl flex items-center justify-center shadow-lg shadow-purple-500/25",children:i.jsx(Kl,{className:"w-8 h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Gerenciar Módulos"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl",children:"Cadastre os módulos de automação e vincule-os aos seus controladores."})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-purple-600 to-violet-600 rounded-full shadow-sm"})]})}),t===!1&&i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:i.jsxs(en,{className:"bg-amber-50 border-amber-200 shadow-sm",children:[i.jsx(Ot,{className:"h-4 w-4 text-amber-600"}),i.jsx(tn,{className:"text-amber-800",children:"Selecione um projeto para gerenciar módulos."})]})}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[i.jsx(Ee.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1},children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-red-500 to-orange-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Ad,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Adicionar Controlador"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Controladores gerenciam outros módulos."})]})]})}),i.jsx(at,{children:i.jsxs("form",{className:"space-y-6",onSubmit:Re,children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"controller-type",children:"Tipo *"}),i.jsxs("select",{id:"controller-type",className:"mt-2 h-12 w-full px-4 rounded-xl border border-border bg-background",value:D,onChange:O=>{z(O.target.value),L(O.target.value)},required:!0,children:[i.jsx("option",{value:"",children:"Selecione o tipo"}),Oi.map(O=>i.jsx("option",{value:O,children:O},O))]})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"controller-name-new",children:"Nome do Controlador *"}),i.jsx(Oe,{id:"controller-name-new",value:T,onChange:O=>L(O.target.value),required:!0,className:"mt-2 h-12 px-4 rounded-xl border-border"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"controller-quadro",children:"Quadro Elétrico *"}),i.jsxs("select",{id:"controller-quadro",className:"mt-2 h-12 w-full px-4 rounded-xl border border-border bg-background",value:W,onChange:O=>H(Number(O.target.value)),required:!0,children:[i.jsx("option",{value:"",children:"Selecione um quadro"}),l.map(O=>i.jsxs("option",{value:O.id,children:[O.nome," (",O.ambiente.nome,")"]},O.id))]})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"controller-ip-new",children:"Endereço IP *"}),i.jsx(Oe,{id:"controller-ip-new",value:M,onChange:O=>B(O.target.value),required:!0,className:"mt-2 h-12 px-4 rounded-xl border-border",pattern:"((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",title:"Por favor, insira um endereço IP válido."})]}),i.jsxs("div",{className:"flex items-center space-x-2 pt-2",children:[i.jsx(Pc,{id:"is-logic-server",checked:A,onCheckedChange:O=>E(!!O),disabled:!o.some(O=>O.is_controller)}),i.jsx(le,{htmlFor:"is-logic-server",className:"font-medium",children:"Definir como Logic Server"})]}),i.jsx(de,{type:"submit",className:"w-full h-12",children:"Adicionar Controlador"})]})})]})}),i.jsx(Ee.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1},children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-green-500 to-emerald-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Un,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Adicionar Módulo"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Módulos de canais para circuitos."})]})]})}),i.jsx(at,{children:p?i.jsx("div",{className:"text-center p-8",children:"Carregando..."}):i.jsxs("form",{className:"space-y-6",onSubmit:Ae,children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"parentController",children:"Controlador Vinculado *"}),i.jsxs("select",{id:"parentController",className:"mt-2 h-12 w-full px-4 rounded-xl border border-border bg-background",value:S,onChange:O=>N(Number(O.target.value)),required:!0,disabled:n||ee.length===0,children:[i.jsx("option",{value:"",children:ee.length===0?"Adicione um controlador primeiro":"Selecione o controlador"}),ee.map(O=>i.jsx("option",{value:O.id,children:O.nome},O.id))]})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"module-quadro",children:"Quadro Elétrico *"}),i.jsxs("select",{id:"module-quadro",className:"mt-2 h-12 w-full px-4 rounded-xl border border-border bg-background",value:C,onChange:O=>_(Number(O.target.value)),required:!0,children:[i.jsx("option",{value:"",children:"Selecione um quadro"}),l.map(O=>i.jsxs("option",{value:O.id,children:[O.nome," (",O.ambiente.nome,")"]},O.id))]})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"tipo",children:"Tipo *"}),i.jsxs("select",{id:"tipo",className:"mt-2 h-12 w-full px-4 rounded-xl border border-border bg-background",value:v,onChange:O=>x(O.target.value),required:!0,disabled:n,children:[i.jsx("option",{value:"",children:"Selecione o tipo"}),X.map(O=>{var ye;return i.jsx("option",{value:O,children:((ye=u[O])==null?void 0:ye.nome_completo)||O},O)})]})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"nome",children:"Nome do Módulo *"}),i.jsx(Oe,{id:"nome",value:w,onChange:O=>j(O.target.value),placeholder:v&&((Q=u[v])!=null&&Q.nome_completo)?u[v].nome_completo:"",required:!0,disabled:n,className:"mt-2 h-12 px-4 rounded-xl border-border"})]}),i.jsx(de,{type:"submit",className:"w-full h-12",disabled:n||ee.length===0,children:"Adicionar Módulo"})]})})]})}),i.jsx("div",{className:"lg:col-span-2",children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-purple-600 to-violet-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Kl,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:"Módulos Cadastrados"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Lista de todos os módulos do projeto"})]})]}),i.jsxs(yt,{className:"bg-gradient-to-r from-purple-500 to-violet-500 text-white text-sm font-medium px-3 py-1",children:[o.length," ",o.length===1?"módulo":"módulos"]})]})}),i.jsx(at,{children:h?i.jsx("div",{className:"text-center p-8",children:"Carregando módulos..."}):o.length===0?i.jsxs(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center py-12",children:[i.jsx("div",{className:"w-20 h-20 bg-muted rounded-full flex items-center justify-center mx-auto mb-6",children:i.jsx(Kl,{className:"h-10 w-10 text-muted-foreground/80"})}),i.jsx("h4",{className:"text-xl font-semibold text-foreground mb-2",children:t===!0?"Nenhum módulo cadastrado":"Selecione um projeto"}),i.jsx("p",{className:"text-muted-foreground max-w-sm mx-auto",children:t===!0?"Comece adicionando seu primeiro controlador.":"Selecione um projeto para gerenciar os módulos."})]}):i.jsx("div",{className:"space-y-3 max-h-[500px] overflow-y-auto pr-2",children:i.jsx(Ir,{children:Xe.map((O,ye)=>i.jsxs(Ee.li,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{delay:ye*.05},className:`group relative overflow-hidden rounded-2xl border bg-card/85 backdrop-blur-sm p-4 hover:bg-card/90 hover:shadow-lg hover:shadow-slate-900/5 transition-all duration-300 flex items-center justify-between ${O.is_logic_server?"border-green-300 dark:border-green-700":O.is_controller?"border-purple-300 dark:border-purple-700":"border-border"}`,children:[i.jsxs("div",{className:"flex-1 mr-4",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[i.jsx("span",{className:"text-sm font-mono text-muted-foreground/90 bg-muted px-2 py-1 rounded-lg",children:O.tipo}),O.is_logic_server&&i.jsxs(yt,{className:"bg-green-100 text-green-800 border border-green-200 hover:bg-green-200",children:[i.jsx(Ep,{className:"h-3 w-3 mr-1.5"}),"Logic Server"]}),O.is_controller&&!O.is_logic_server&&i.jsx(yt,{variant:"outline",children:"Controlador"}),O.quadro_eletrico&&i.jsxs(yt,{variant:"secondary",className:"bg-blue-100 text-blue-700 flex items-center gap-1",children:[i.jsx(Ad,{className:"h-3 w-3"}),O.quadro_eletrico.nome]}),O.parent_controller&&i.jsxs(yt,{variant:"secondary",className:"bg-gray-100 text-gray-700 flex items-center gap-1",children:[i.jsx(ca,{className:"h-3 w-3"}),O.parent_controller.nome]})]}),i.jsx("h4",{className:"font-bold text-foreground text-lg mb-1",children:O.nome}),i.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-2",children:[i.jsx(Ep,{className:"h-4 w-4 text-muted-foreground/80"}),i.jsx("span",{className:"font-medium",children:O.is_controller?`IP: ${O.ip_address||"N/A"}`:`Canais: ${O.quantidade_canais}`})]}),O.vinc_count>0&&i.jsxs(yt,{className:"bg-yellow-100 text-yellow-800 text-xs font-medium px-2 py-1 mt-1 w-fit",children:["Em uso (",O.vinc_count," vinculações)"]})]}),i.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[i.jsx(de,{variant:"ghost",size:"icon",onClick:()=>se(O),className:"h-8 w-8 hover:bg-blue-100",children:i.jsx(Ja,{className:"h-4 w-4 text-blue-600"})}),i.jsx(de,{variant:"ghost",size:"icon",onClick:()=>ve(O.id),disabled:O.vinc_count>0,className:"h-8 w-8 hover:bg-red-100",title:O.vinc_count>0?"Exclua as vinculações antes de remover.":void 0,children:i.jsx(Cn,{className:"h-4 w-4 text-red-600"})})]})]},O.id))})})})]})})]}),i.jsx(bs,{previousPath:"/circuitos",nextPath:"/vinculacao"}),I&&i.jsx(dl,{open:F,onOpenChange:Z,children:i.jsxs(Ni,{children:[i.jsx(Ci,{children:i.jsx(Ei,{children:"Editar Módulo"})}),i.jsxs("form",{onSubmit:we,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"edit-nome",children:"Nome do Módulo"}),i.jsx(Oe,{id:"edit-nome",value:I.nome,onChange:O=>q({...I,nome:O.target.value})})]}),Oi.includes(I.tipo)&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"edit-quadro",children:"Quadro Elétrico"}),i.jsxs("select",{id:"edit-quadro",value:((ae=I.quadro_eletrico)==null?void 0:ae.id)||"",onChange:O=>{const ye=Number(O.target.value),J=l.find(k=>k.id===ye);q({...I,quadro_eletrico:J?{id:J.id,nome:J.nome}:void 0})},className:"w-full h-10 px-3 rounded-md border border-input bg-background",children:[i.jsx("option",{value:"",children:"Nenhum"}),l.map(O=>i.jsxs("option",{value:O.id,children:[O.nome," (",O.ambiente.nome,")"]},O.id))]})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"edit-ip_address",children:"Endereço IP"}),i.jsx(Oe,{id:"edit-ip_address",value:I.ip_address||"",onChange:O=>q({...I,ip_address:O.target.value})})]}),i.jsxs("div",{className:"flex items-center space-x-2 pt-2",children:[i.jsx(Pc,{id:"edit-is-logic-server",checked:I.is_logic_server,onCheckedChange:O=>q({...I,is_logic_server:!!O}),disabled:I.is_logic_server&&o.filter(O=>O.is_controller).length===1}),i.jsx(le,{htmlFor:"edit-is-logic-server",children:"Definir como Logic Server"})]})]}),!Oi.includes(I.tipo)&&i.jsxs("div",{children:[i.jsx(le,{htmlFor:"edit-parent-controller",children:"Controlador Vinculado"}),i.jsx("select",{id:"edit-parent-controller",value:I.parent_controller_id||"",onChange:O=>q({...I,parent_controller_id:Number(O.target.value)}),className:"w-full h-10 px-3 rounded-md border border-input bg-background",children:ee.map(O=>i.jsx("option",{value:O.id,children:O.nome},O.id))})]}),i.jsxs(ki,{children:[i.jsx(Xc,{asChild:!0,children:i.jsx(de,{type:"button",variant:"secondary",children:"Cancelar"})}),i.jsx(de,{type:"submit",disabled:h,children:"Salvar Alterações"})]})]})]})})]})})})}const Nl={RL12:{correntePorCanal:2.5,grupos:[{maxCorrente:8,canais:[1,2,3,4]},{maxCorrente:8,canais:[5,6,7,8]},{maxCorrente:8,canais:[9,10,11,12]}]},DIM8:{correntePorCanal:2.5,grupos:[{maxCorrente:8,canais:[1,2,3,4]},{maxCorrente:8,canais:[5,6,7,8]}]},LX4:{correntePorCanal:2.5,grupos:[{maxCorrente:5,canais:[1,2,3,4]},{maxCorrente:5,canais:[5,6,7,8]}]}},D8=({utilizacao:e,index:t,canalSelecionado:r})=>{const{grupo:n,correnteAtual:s,porcentagem:o,canaisUtilizados:a}=e,c=(d=>d<=60?"bg-green-500":d<=80?"bg-yellow-500":d<=95?"bg-orange-500":"bg-red-500")(o),u=r&&n.canais.includes(r);return i.jsxs(Ee.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:t*.1},className:`p-4 rounded-xl border-2 transition-all duration-300 ${u?"border-blue-300 bg-blue-50 dark:bg-blue-900/20 shadow-sm":"border-border bg-background"}`,children:[i.jsxs("div",{className:"flex justify-between items-center mb-3",children:[i.jsxs("span",{className:"text-sm font-semibold text-foreground",children:["Grupo ",t+1," • Canais ",n.canais.join(", ")]}),i.jsxs("span",{className:`text-xs font-bold px-2 py-1 rounded-full ${o>80?"bg-red-100 text-red-700":o>60?"bg-orange-100 text-orange-700":"bg-green-100 text-green-700"}`,children:[s.toFixed(2),"A / ",n.maxCorrente,"A"]})]}),i.jsx("div",{className:"w-full bg-slate-200 rounded-full h-3 mb-3 overflow-hidden",children:i.jsx(Ee.div,{initial:{width:0},animate:{width:`${Math.min(o,100)}%`},transition:{duration:.8,ease:"easeOut"},className:`h-3 rounded-full ${c}`})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"flex flex-wrap gap-1",children:n.canais.map(d=>{const h=a.includes(d),m=d===r;return i.jsx("div",{className:`w-7 h-7 rounded-lg text-xs flex items-center justify-center font-medium transition-all ${m?"bg-blue-500 text-white ring-2 ring-blue-300 shadow-sm":h?"bg-slate-600 text-white shadow-sm":"bg-slate-200 text-muted-foreground"}`,title:`Canal ${d} - ${h?"Utilizado":"Disponível"}${m?" - Selecionado":""}`,children:d},d)})}),u&&i.jsxs("div",{className:"text-xs text-blue-600 font-medium flex items-center gap-1",children:[i.jsx(os,{className:"w-3 h-3"}),"Afetado"]})]})]})},r1=({children:e,visivel:t})=>i.jsx(Ir,{children:t&&i.jsx(Ee.div,{initial:{opacity:0,height:0,y:-10},animate:{opacity:1,height:"auto",y:0},exit:{opacity:0,height:0,y:-10},transition:{duration:.3,ease:"easeOut"},className:"overflow-hidden",children:e})});function I8(){const{toast:e}=Kt(),{projeto:t}=Jr(),[r,n]=f.useState(t?!0:null),[s,o]=f.useState([]),[a,l]=f.useState([]),[c,u]=f.useState([]),[d,h]=f.useState({luz:[],persiana:[],hvac:[]}),[m,p]=f.useState(!0),[b,g]=f.useState(""),[y,v]=f.useState(""),[x,w]=f.useState(""),[j,S]=f.useState(120),[N,C]=f.useState({aberto:!1,restricao:null,dadosVinculacao:null}),[_,$]=f.useState([]),[D,z]=f.useState(!1),T=r!==!0,L=f.useRef(!1),M=f.useRef(!1),B=f.useCallback(Q=>{switch(Q){case"luz":return{label:"💡 Luz",color:"bg-yellow-100 text-yellow-800"};case"persiana":return{label:"🪟 Persiana",color:"bg-blue-100 text-primary"};case"hvac":return{label:"❄️ HVAC",color:"bg-green-100 text-green-800"};default:return{label:Q,color:"bg-muted text-foreground"}}},[]),W=f.useCallback(Q=>{const ae=Nl[Q];return ae?i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),i.jsxs("span",{children:[i.jsxs("strong",{children:[ae.correntePorCanal,"A"]})," por canal individual"]})]}),ae.grupos.map((O,ye)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),i.jsxs("span",{children:[i.jsxs("strong",{children:["Grupo ",ye+1]})," (canais ",O.canais.join(", "),"): máximo ",O.maxCorrente,"A"]})]},ye))]}):i.jsx(i.Fragment,{})},[]),H=f.useCallback(Q=>!Q||Q<=0?0:Q/(j||220),[j]),A=f.useMemo(()=>s.find(Q=>Q.id===b),[b,s]),E=f.useMemo(()=>{if(!A)return a;const Q=d[A.tipo]||[];return Q.length===0?a:a.filter(ae=>Q.includes(ae.tipo))},[A,a,d]),I=f.useMemo(()=>a.find(Q=>Q.id===y),[y,a]),q=f.useMemo(()=>(I==null?void 0:I.canais_disponiveis)||[],[I]),F=f.useMemo(()=>{const Q=new Set(c.map(ae=>ae.circuito_id));return s.filter(ae=>!Q.has(ae.id))},[s,c]),Z=f.useCallback((Q,ae,O)=>{if(!Q)return[];const ye=Nl[Q.tipo];return ye?ye.grupos.map(J=>{const k=c.filter(oe=>oe.modulo_id===Q.id&&J.canais.includes(oe.canal));let V=k.reduce((oe,re)=>{var Ve;const me=re.potencia||((Ve=s.find(Ge=>Ge.id===re.circuito_id))==null?void 0:Ve.potencia)||0;return oe+H(me)},0);ae&&O&&J.canais.includes(O)&&(V+=H(ae.potencia));const K=V/J.maxCorrente*100,ue=k.map(oe=>oe.canal);return{grupo:J,correnteAtual:V,porcentagem:K,canaisUtilizados:ue}}):[]},[H,c,s]),X=f.useCallback(()=>{if(!A||!I||!x)return null;const Q=Nl[I.tipo];if(!Q)return null;const ae=H(A.potencia);if(ae>Q.correntePorCanal)return{tipo:"canal",mensagem:`O circuito selecionado demanda ${ae.toFixed(2)}A, mas o canal suporta apenas ${Q.correntePorCanal}A.`,correnteAtual:ae,correnteMaxima:Q.correntePorCanal};const O=Q.grupos.find(ye=>ye.canais.includes(x));if(O){let J=c.filter(k=>k.modulo_id===I.id&&O.canais.includes(k.canal)).reduce((k,V)=>{var ue;const K=V.potencia||((ue=s.find(oe=>oe.id===V.circuito_id))==null?void 0:ue.potencia)||0;return k+H(K)},0);if(J+=ae,J>O.maxCorrente){const k=J-ae;return{tipo:"grupo",mensagem:`Ao vincular este circuito, a corrente total do grupo será ${J.toFixed(2)}A, excedendo o limite de ${O.maxCorrente}A (atualmente: ${k.toFixed(2)}A).`,correnteAtual:J,correnteMaxima:O.maxCorrente}}}return null},[A,I,x,H,c,s]),ee=f.useMemo(()=>X(),[X]),xe=f.useMemo(()=>Z(I,A,x),[Z,I,A,x]),G=f.useCallback(async(Q=!0)=>{if(r!==!0){p(!1);return}if(!L.current){L.current=!0,Q&&p(!0);try{const[ae,O,ye]=await Promise.all([fetch("/api/vinculacao/options",{credentials:"same-origin",cache:"no-cache"}),fetch("/api/vinculacoes",{credentials:"same-origin",cache:"no-cache"}),fetch("/api/quadros_eletricos",{credentials:"same-origin",cache:"no-cache"})]),[J,k,V]=await Promise.all([ae.json().catch(()=>({ok:!1})),O.json().catch(()=>({ok:!1})),ye.json().catch(()=>({ok:!1}))]);(J!=null&&J.ok||J!=null&&J.success)&&(o((J==null?void 0:J.circuitos)||[]),l((J==null?void 0:J.modulos)||[]),h((J==null?void 0:J.compat)||{luz:[],persiana:[],hvac:[]})),(k!=null&&k.ok||k!=null&&k.success)&&u((k==null?void 0:k.vinculacoes)||[]),V!=null&&V.ok&&$(V.quadros_eletricos||[])}catch(ae){console.error("Erro ao carregar dados:",ae),e({variant:"destructive",title:"Erro",description:"Falha ao carregar dados. Tente recarregar a página."})}finally{Q&&p(!1),L.current=!1}}},[r,e]);f.useEffect(()=>{try{t&&n(!0)}catch{}},[t]),f.useEffect(()=>{(async()=>{try{if(r!==null)return;const O=await(await fetch("/api/projeto_atual",{credentials:"same-origin"})).json();n(!!(O!=null&&O.ok&&(O!=null&&O.projeto_atual)))}catch{n(!1)}})()},[r]),f.useEffect(()=>{r===!0&&!M.current&&(M.current=!0,G())},[r,G]);const Se=async(Q,ae,O)=>{p(!0);try{const ye=await fetch("/api/vinculacoes",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({circuito_id:Q,modulo_id:ae,canal:O})}),J=await ye.json().catch(()=>null);ye.ok&&(J!=null&&J.ok||J!=null&&J.success)?(g(""),w(""),await G(!1),e({title:"Sucesso!",description:"Circuito vinculado.",duration:3500})):e({variant:"destructive",title:"Erro",description:(J==null?void 0:J.error)||(J==null?void 0:J.message)||"Falha ao vincular circuito."})}catch{e({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}finally{p(!1)}},Ae=async Q=>{if(Q.preventDefault(),!b||!y||!x){e({variant:"destructive",title:"Erro",description:"Preencha todos os campos para vincular."});return}ee?C({aberto:!0,restricao:ee,dadosVinculacao:{circuitoId:b,moduloId:y,canal:x}}):await Se(b,y,x)},Re=async()=>{if(!N.dadosVinculacao)return;const{circuitoId:Q,moduloId:ae,canal:O}=N.dadosVinculacao;C({aberto:!1,restricao:null,dadosVinculacao:null}),await Se(Q,ae,O)},se=async Q=>{if(confirm("Tem certeza que deseja excluir esta vinculação?")){p(!0);try{const ae=await fetch(`/api/vinculacoes/${Q}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json"}}),O=await ae.json().catch(()=>null);ae.ok&&(O!=null&&O.ok||O!=null&&O.success)?(await G(!1),e({title:"Sucesso!",description:"Vinculação excluída."})):e({variant:"destructive",title:"Erro",description:(O==null?void 0:O.error)||(O==null?void 0:O.message)||"Falha ao excluir vinculação."})}catch{e({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}finally{p(!1)}}},we=f.useMemo(()=>!I||!Nl[I.tipo]?null:i.jsx(r1,{visivel:!0,children:i.jsxs("div",{className:"mt-3 p-4 bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/10 dark:to-indigo-900/10 border border-blue-200 dark:border-blue-800/30 rounded-xl shadow-sm",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("div",{className:"w-10 h-10 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center",children:i.jsx(os,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-primary",children:"Limites Elétricos"}),i.jsx("p",{className:"text-sm text-blue-700",children:"Especificações do módulo"})]})]}),W(I.tipo)]})}),[I,W]),ve=f.useMemo(()=>!I||!Nl[I.tipo]||xe.length===0?null:i.jsx(r1,{visivel:!0,children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 bg-purple-100 rounded-lg flex items-center justify-center",children:i.jsx(Kl,{className:"w-5 h-5 text-purple-600"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-foreground",children:"Utilização dos Grupos"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Monitoramento em tempo real"})]})]}),i.jsx("div",{className:"space-y-3",children:xe.map((Q,ae)=>i.jsx(D8,{utilizacao:Q,index:ae,canalSelecionado:x},ae))}),i.jsx("div",{className:"pt-3 border-t border-border",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-xs text-muted-foreground",children:[i.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[i.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),i.jsx("span",{children:"Baixa (≤60%)"})]}),i.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[i.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded"}),i.jsx("span",{children:"Moderada (≤80%)"})]}),i.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[i.jsx("div",{className:"w-3 h-3 bg-red-500 rounded"}),i.jsx("span",{children:"Alta (>80%)"})]})]})})]})}),[I,xe,x]),Xe=async()=>{if(_.length!==1){e({variant:"destructive",title:"Erro",description:"A vinculação automática só está disponível quando há exatamente um quadro elétrico."});return}if(confirm("Deseja realizar a vinculação automática? Esta ação irá vincular circuitos não vinculados aos módulos compatíveis disponíveis.")){z(!0);try{const Q=await fetch("/api/vinculacoes/auto",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"}}),ae=await Q.json().catch(()=>null);Q.ok&&(ae!=null&&ae.ok||ae!=null&&ae.success)?(await G(!1),e({title:"Vinculação Automática Concluída",description:`Foram criadas ${ae.vinculacoes_criadas} vinculações automaticamente.`,duration:5e3})):e({variant:"destructive",title:"Erro",description:(ae==null?void 0:ae.error)||(ae==null?void 0:ae.message)||"Falha ao realizar vinculação automática."})}catch{e({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}finally{z(!1)}}};return i.jsxs(kr,{children:[i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-6 sm:py-8",children:[i.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-8",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-14 h-14 sm:w-16 sm:h-16 bg-gradient-to-br from-indigo-500 to-indigo-600 rounded-3xl flex items-center justify-center shadow-lg shadow-blue-500/25",children:i.jsx(ca,{className:"w-6 h-6 sm:w-8 sm:h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-foreground mb-2",children:"Gerenciar Vinculações"}),i.jsxs("p",{className:"text-base sm:text-lg text-muted-foreground max-w-2xl",children:["Conecte circuitos aos canais de seus módulos físicos.",_.length===1&&i.jsx("span",{className:"text-green-600 font-semibold ml-2",children:"• 1 quadro detectado"})]})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-blue-600 to-indigo-600 rounded-full shadow-sm"})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 w-full sm:w-auto",children:[_.length===1&&i.jsx(de,{onClick:Xe,disabled:D||m||T,className:"group flex items-center justify-center gap-2 h-12 px-4 sm:px-6 rounded-full bg-gradient-to-r from-green-600 to-emerald-600 hover:from-green-700 hover:to-emerald-700 text-white shadow-lg hover:shadow-xl transition-all duration-300 text-sm sm:text-base",children:D?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-white border-t-transparent"}),"Processando..."]}):i.jsxs(i.Fragment,{children:[i.jsx(os,{className:"h-4 w-4"}),"Vinculação Automática"]})}),i.jsxs(de,{onClick:()=>G(),variant:"outline",className:"group flex items-center justify-center gap-2 h-12 px-4 sm:px-6 rounded-full border-border text-muted-foreground hover:text-foreground transition-all duration-300 text-sm sm:text-base",disabled:m,children:[i.jsx(IN,{className:`h-4 w-4 ${m?"animate-spin":"group-hover:rotate-180 transition-transform duration-500"}`}),m?"Carregando...":"Recarregar"]})]})]}),r===!1&&i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-6 sm:mb-8",children:i.jsxs(en,{className:"bg-amber-50 border-amber-200 shadow-sm",children:[i.jsx(Ot,{className:"h-4 w-4 text-amber-600"}),i.jsx(tn,{className:"text-amber-800",children:"Selecione um projeto na página inicial para gerenciar as vinculações."})]})}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 sm:gap-8",children:[i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"order-1 lg:order-1",children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-4 sm:pb-6",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-gradient-to-br from-green-500 to-emerald-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(G0,{className:"w-4 h-4 sm:w-6 sm:h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-xl sm:text-2xl font-bold text-foreground",children:"Nova Vinculação"}),i.jsx("p",{className:"text-muted-foreground text-sm sm:text-base mt-1",children:"Conecte um circuito a um módulo"})]})]})}),i.jsx(at,{children:i.jsxs("form",{onSubmit:Ae,className:"space-y-4 sm:space-y-6",children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"circuito",className:"text-sm font-semibold text-slate-700",children:"Circuito *"}),i.jsxs("select",{id:"circuito",value:b,onChange:Q=>{g(Number(Q.target.value)),v(""),w("")},required:!0,className:"mt-2 w-full h-12 px-4 rounded-xl border border-border bg-background focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all",disabled:T||m||F.length===0,children:[i.jsx("option",{value:"",children:m?"Carregando circuitos...":"Selecione um circuito"}),!m&&F.map(Q=>{const ae=H(Q.potencia);return i.jsxs("option",{value:Q.id,children:[Q.identificador," — ",Q.nome," (",Q.ambiente_nome,") - ",Q.potencia,"W (",ae.toFixed(2),"A)"]},Q.id)})]}),!m&&r&&F.length===0&&i.jsxs("p",{className:"text-sm text-amber-600 mt-1 flex items-center gap-1",children:[i.jsx(Ot,{className:"w-3 h-3"}),"Nenhum circuito disponível para vincular."]})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"modulo",className:"text-sm font-semibold text-slate-700",children:"Módulo *"}),i.jsxs("select",{id:"modulo",value:y,onChange:Q=>{v(Number(Q.target.value)),w("")},required:!0,className:"mt-2 h-12 w-full px-4 rounded-xl border border-border bg-background focus:border-purple-500 focus:ring-2 focus:ring-purple-500/20 transition-all",disabled:T||m||E.length===0,children:[i.jsx("option",{value:"",children:m?"Carregando módulos...":"Selecione um módulo"}),!m&&E.map(Q=>i.jsxs("option",{value:Q.id,children:[Q.nome," (",Q.tipo," - ",Q.quantidade_canais," canais)"]},Q.id))]}),!m&&r&&E.length===0&&i.jsxs("p",{className:"text-sm text-amber-600 mt-1 flex items-center gap-1",children:[i.jsx(Ot,{className:"w-3 h-3"}),"Nenhum módulo disponível para vincular."]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"tensao",className:"text-sm font-semibold text-slate-700",children:"Tensão de Cálculo *"}),i.jsxs("select",{id:"tensao",value:j,onChange:Q=>S(Number(Q.target.value)),className:"mt-2 h-12 w-full px-4 rounded-xl border border-border bg-background focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 transition-all",disabled:T||m,children:[i.jsx("option",{value:220,children:"220 V"}),i.jsx("option",{value:120,children:"120 V"})]}),A&&i.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Potência: ",A.potencia??0,"W",i.jsx("br",{}),"Corrente: ",H(A.potencia).toFixed(2),"A"]})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"canal",className:"text-sm font-semibold text-slate-700",children:"Canal *"}),i.jsxs("select",{id:"canal",value:x,onChange:Q=>w(Number(Q.target.value)),required:!0,className:"mt-2 h-12 w-full px-4 rounded-xl border border-border bg-background focus:border-purple-500 focus:ring-2 focus:ring-purple-500/20 transition-all",disabled:!I||q.length===0,children:[i.jsx("option",{value:"",children:"Selecione um canal"}),!m&&I&&q.map(Q=>i.jsxs("option",{value:Q,children:["Canal ",Q]},Q))]}),!I&&i.jsx("p",{className:"text-sm text-muted-foreground/90 mt-1",children:"Selecione um módulo"})]})]}),we,ve,i.jsxs(de,{type:"submit",className:`w-full h-12 ${ee?"bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600":"bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700"} text-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center justify-center gap-2 text-sm sm:text-base`,disabled:T||m||!A||!I||q.length===0,children:[i.jsx(G0,{className:"h-4 w-4 sm:h-5 sm:w-5"}),ee?"Vincular (Com Restrição)":"Vincular Circuito"]})]})})]})}),i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"order-2 lg:order-2",children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-4 sm:pb-6",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-gradient-to-br from-indigo-500 to-indigo-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(ca,{className:"w-4 h-4 sm:w-6 sm:h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-xl sm:text-2xl font-bold text-foreground",children:"Vinculações Cadastradas"}),i.jsx("p",{className:"text-muted-foreground text-sm sm:text-base mt-1",children:"Lista de todas as vinculações do projeto"})]})]}),i.jsxs(yt,{className:"bg-gradient-to-r from-blue-500 to-indigo-500 text-white text-xs sm:text-sm font-medium px-2 sm:px-3 py-1",children:[c.length," ",c.length===1?"vinculação":"vinculações"]})]})}),i.jsx(at,{children:m?i.jsxs("div",{className:"flex flex-col justify-center items-center py-8 sm:py-12",children:[i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 sm:h-12 sm:w-12 border-4 border-blue-500 border-t-transparent mb-3 sm:mb-4"}),i.jsx("p",{className:"text-muted-foreground font-medium text-sm sm:text-base",children:"Carregando vinculações..."})]}):c.length===0?i.jsxs(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center py-8 sm:py-12",children:[i.jsx("div",{className:"w-16 h-16 sm:w-20 sm:h-20 bg-muted rounded-full flex items-center justify-center mx-auto mb-4 sm:mb-6",children:i.jsx(ca,{className:"h-6 w-6 sm:h-10 sm:w-10 text-muted-foreground/80"})}),i.jsx("h4",{className:"text-lg sm:text-xl font-semibold text-foreground mb-2",children:r===!0?"Nenhuma vinculação cadastrada":"Selecione um projeto"}),i.jsx("p",{className:"text-muted-foreground max-w-sm mx-auto text-sm sm:text-base",children:r?"Comece adicionando a primeira vinculação usando o formulário ao lado.":"Selecione um projeto para visualizar e gerenciar as vinculações."})]}):i.jsx("div",{className:"space-y-3 sm:space-y-4 max-h-[400px] sm:max-h-[500px] overflow-y-auto pr-2",children:i.jsx(Ir,{children:c.map((Q,ae)=>{const O=B(Q.modulo_tipo);return i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{delay:ae*.05},className:"group relative overflow-hidden rounded-2xl border border-border bg-card/85 backdrop-blur-sm p-3 sm:p-4 hover:bg-card/90 hover:shadow-lg hover:shadow-slate-900/5 transition-all duration-300",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1 mr-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(yt,{className:`text-xs font-medium px-2 py-1 ${O.color}`,children:O.label.toUpperCase()}),i.jsxs("span",{className:"text-xs font-mono text-muted-foreground/90 bg-muted px-2 py-1 rounded-lg",children:["Canal ",Q.canal]})]}),i.jsx("h4",{className:"font-bold text-foreground text-base sm:text-lg mb-1",children:Q.circuito_nome}),i.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground mb-1",children:[i.jsx("span",{className:"font-medium",children:"Identificador:"})," ",Q.identificador]}),i.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground mb-1",children:[i.jsx("span",{className:"font-medium",children:"Módulo:"})," ",Q.modulo_nome]}),i.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground/90",children:[Q.area_nome," > ",Q.ambiente_nome]})]}),i.jsx(de,{variant:"destructive",size:"sm",onClick:()=>se(Q.id),disabled:m,className:"opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all duration-300 rounded-xl shadow-lg hover:shadow-xl h-8 w-8 p-0 sm:h-9 sm:w-9",children:i.jsx(Cn,{className:"h-3 w-3 sm:h-4 sm:w-4"})})]})},Q.id)})})})})]})})]}),i.jsx(bs,{previousPath:"/modulos",nextPath:"/keypads"})]})}),N.aberto&&N.restricao&&i.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:i.jsxs(Ee.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"bg-card rounded-2xl p-6 max-w-md w-full shadow-xl border border-border",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx("div",{className:"w-12 h-12 bg-red-100 rounded-full flex items-center justify-center",children:i.jsx(os,{className:"w-6 h-6 text-red-600"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl font-bold text-foreground",children:"Atenção: Restrição de Carga"}),i.jsx("p",{className:"text-muted-foreground text-sm",children:"Você está prestes a exceder os limites elétricos"})]})]}),i.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mb-6",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"w-6 h-6 bg-red-500 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:i.jsx("span",{className:"text-white text-sm font-bold",children:"!"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-red-800 font-semibold mb-2",children:N.restricao.tipo==="canal"?"Limite do Canal Excedido":"Limite do Grupo Excedido"}),i.jsx("p",{className:"text-red-700 text-sm mb-2",children:N.restricao.mensagem}),i.jsxs("div",{className:"flex items-center gap-4 text-xs text-red-600",children:[i.jsxs("span",{children:["Corrente atual: ",i.jsxs("strong",{children:[N.restricao.correnteAtual.toFixed(2),"A"]})]}),i.jsxs("span",{children:["Máximo permitido: ",i.jsxs("strong",{children:[N.restricao.correnteMaxima,"A"]})]})]})]})]})}),i.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 mb-6",children:i.jsxs("p",{className:"text-amber-800 text-sm flex items-center gap-2",children:[i.jsx(Ot,{className:"w-4 h-4"}),i.jsx("strong",{children:"Atenção:"})," Exceder os limites pode causar superaquecimento, danos ao equipamento ou disparo de proteções."]})}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx(de,{variant:"outline",onClick:()=>C({aberto:!1,restricao:null,dadosVinculacao:null}),className:"flex-1 h-12 rounded-xl border-border text-slate-700 hover:bg-muted",children:"Cancelar"}),i.jsxs(de,{onClick:Re,className:"flex-1 h-12 bg-gradient-to-r from-red-600 to-orange-600 hover:from-red-700 hover:to-orange-700 text-white rounded-xl shadow-lg",children:[i.jsx(os,{className:"w-4 h-4 mr-2"}),"Vincular Mesmo Assim"]})]})]})})]})}function L8(){const{projeto:e}=Jr(),[t,r]=f.useState([]),[n,s]=f.useState(e?!0:null),o=n!==!0;f.useEffect(()=>{try{e&&s(!0)}catch{}},[e]),f.useEffect(()=>{(async()=>{try{if(n!==null)return;const ve=await(await fetch("/api/projeto_atual",{credentials:"same-origin"})).json();s(!!(ve!=null&&ve.ok&&(ve!=null&&ve.projeto_atual)))}catch{s(!1)}})()},[n]);const{toast:a}=Kt(),[l,c]=f.useState({projeto:null,areas:[],modulos:[]}),[u,d]=f.useState(!0),[h,m]=f.useState(!1),[p,b]=f.useState(""),[g,y]=f.useState(""),[v,x]=f.useState(""),[w,j]=f.useState(""),[S,N]=f.useState("America/Bahia"),[C,_]=f.useState("0.0"),[$,D]=f.useState("0.0"),[z,T]=f.useState("Área Técnica"),[L,M]=f.useState("Sala Técnica"),[B,W]=f.useState("Quadro Elétrico"),[H,A]=f.useState(""),E="245",I="1",q="1.0.8.67",F=f.useMemo(()=>{const se=[];return((l==null?void 0:l.areas)||[]).forEach(we=>{((we==null?void 0:we.ambientes)||[]).forEach(ve=>{((ve==null?void 0:ve.quadros_eletricos)||[]).forEach(Xe=>{se.push({id:Xe.id,label:`${we.nome} • ${ve.nome} • ${Xe.nome}`})})})}),se.sort((we,ve)=>we.label.localeCompare(ve.label,"pt-BR"))},[l]),X=(se=>se.length)(t),ee=async()=>{if(n===!0)try{const we=await(await fetch("/api/keypads",{credentials:"same-origin"})).json();r((we==null?void 0:we.keypads)||[])}catch{}};f.useEffect(()=>{xe(),ee()},[n]);const xe=async()=>{var se;if(n!==!0){d(!1);return}d(!0);try{const ve=await(await fetch("/api/projeto_tree",{credentials:"same-origin"})).json();c({projeto:(ve==null?void 0:ve.projeto)||null,areas:(ve==null?void 0:ve.areas)||[],modulos:(ve==null?void 0:ve.modulos)||[]}),(se=ve==null?void 0:ve.projeto)!=null&&se.nome&&b(ve.projeto.nome)}catch{a({variant:"destructive",title:"Erro",description:"Falha ao carregar dados do projeto. Verifique sua conexão ou se a API está no ar."})}finally{d(!1)}};f.useEffect(()=>{xe()},[n]),f.useEffect(()=>{if(!F.length){H!==""&&A("");return}F.some(we=>String(we.id)===H)||A(String(F[0].id))},[F,H]);const G=f.useMemo(()=>{var we;const se={luz:0,persiana:0,hvac:0,cenas:0,modulos:0};return!l||!l.areas||(l.areas.forEach(ve=>{ve.ambientes.forEach(Xe=>{var Q;se.cenas+=((Q=Xe.cenas)==null?void 0:Q.length)||0,Xe.circuitos.forEach(ae=>{(ae.tipo==="luz"||ae.tipo==="persiana"||ae.tipo==="hvac")&&(se[ae.tipo]+=1)})})}),se.modulos=((we=l.modulos)==null?void 0:we.length)||0),se},[l]),Se=se=>{if(F.length>0&&!H){se.preventDefault(),a({variant:"destructive",title:"Selecione um quadro",description:"Escolha em qual quadro elétrico o módulo M4 será colocado."});return}const we=w.replace(/\D/g,"");if(we.length<10){se.preventDefault(),a({variant:"destructive",title:"Telefone inválido",description:"Use DDD + número (mínimo 10 dígitos)."});return}const ve=document.createElement("input");ve.type="hidden",ve.name="client_phone_clean",ve.value=we,se.currentTarget.appendChild(ve)},Ae=()=>{var ae;const se=(ae=l.projeto)==null?void 0:ae.id;if(!se)return;const we=new Date,ve=we.toISOString(),Xe=we.getTimezoneOffset(),Q=`/exportar-pdf/${se}?client_timestamp=${encodeURIComponent(ve)}&tz_offset=${Xe}`;window.open(Q,"_blank")},Re={luz:{icon:Ia,label:"Luz",color:"text-yellow-500"},persiana:{icon:Da,label:"Persianas",color:"text-blue-500"},hvac:{icon:gc,label:"Climatização",color:"text-green-500"}};return i.jsx(kr,{children:i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-6 sm:py-8",children:[i.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-8",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-14 h-14 sm:w-16 sm:h-16 bg-gradient-to-br from-gray-500 to-gray-600 rounded-3xl flex items-center justify-center shadow-lg shadow-blue-500/25",children:i.jsx(Su,{className:"w-6 h-6 sm:w-8 sm:h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-foreground mb-2",children:"Visão Geral do Projeto"}),i.jsx("p",{className:"text-base sm:text-lg text-muted-foreground max-w-2xl",children:"Visualize todos os circuitos, módulos e vinculações do seu projeto."})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-blue-600 to-indigo-600 rounded-full shadow-sm"})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4 w-full sm:w-auto",children:[i.jsxs(de,{onClick:Ae,className:"group flex items-center justify-center gap-2 h-12 px-4 sm:px-6 rounded-full border border-blue-600 bg-blue-600 hover:bg-blue-700 text-white transition-all duration-300 shadow-lg hover:shadow-xl text-sm sm:text-base",disabled:o||u,children:[i.jsx(H0,{className:"h-4 w-4"}),"Gerar AS BUILT"]}),i.jsxs(de,{onClick:()=>m(!0),className:"group flex items-center justify-center gap-2 h-12 px-4 sm:px-6 rounded-full border border-blue-600 bg-blue-600 hover:bg-blue-700 text-white transition-all duration-300 shadow-lg hover:shadow-xl text-sm sm:text-base",disabled:o||u,children:[i.jsx(U0,{className:"h-4 w-4"}),"Gerar RWP"]}),i.jsxs(de,{onClick:()=>{xe(),ee()},variant:"outline",className:"group flex items-center justify-center gap-2 h-12 px-4 sm:px-6 rounded-full border-border text-muted-foreground hover:text-foreground transition-all duration-300 text-sm sm:text-base",children:[i.jsx(IN,{className:"h-4 w-4 group-hover:rotate-180 transition-transform duration-500"}),"Recarregar"]})]})]}),n===!1&&i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:i.jsxs(en,{className:"bg-amber-50 border-amber-200 shadow-sm",children:[i.jsx(Ot,{className:"h-4 w-4 text-amber-600"}),i.jsx(tn,{className:"text-amber-800",children:"Selecione um projeto na página inicial para visualizar os detalhes."})]})}),u?i.jsxs("div",{className:"flex flex-col justify-center items-center py-12",children:[i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-4 border-blue-500 border-t-transparent mb-4"}),i.jsx("p",{className:"text-muted-foreground font-medium",children:"Carregando dados do projeto..."})]}):i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 sm:gap-8",children:[i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"order-1 lg:order-1",children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-gradient-to-br from-purple-500 to-violet-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Su,{className:"w-5 h-5 sm:w-6 sm:h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-xl sm:text-2xl font-bold text-foreground",children:"Resumo de Circuitos"}),i.jsx("p",{className:"text-muted-foreground text-sm sm:text-base mt-1",children:"Visão geral dos circuitos cadastrados."})]})]})}),i.jsxs(at,{className:"grid grid-cols-2 md:grid-cols-3 gap-3 sm:gap-4",children:[i.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl p-3 sm:p-4 bg-slate-50/50",children:[i.jsx(Ia,{className:"h-6 w-6 sm:h-8 sm:w-8 text-yellow-500 mb-2"}),i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-foreground",children:G.luz}),i.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"Luz"})]}),i.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl p-3 sm:p-4 bg-slate-50/50",children:[i.jsx(Da,{className:"h-6 w-6 sm:h-8 sm:w-8 text-blue-500 mb-2"}),i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-foreground",children:G.persiana}),i.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"Persiana"})]}),i.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl p-3 sm:p-4 bg-slate-50/50",children:[i.jsx(gc,{className:"h-6 w-6 sm:h-8 sm:w-8 text-green-500 mb-2"}),i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-foreground",children:G.hvac}),i.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"HVAC"})]}),i.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl p-3 sm:p-4 bg-slate-50/50",children:[i.jsx(Cp,{className:"h-6 w-6 sm:h-8 sm:w-8 text-violet-600 mb-2"}),i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-foreground",children:X}),i.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"Keypads"})]}),i.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl p-3 sm:p-4 bg-slate-50/50",children:[i.jsx(MN,{className:"h-6 w-6 sm:h-8 sm:w-8 text-muted-foreground/90 mb-2"}),i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-foreground",children:G.modulos}),i.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"Módulos"})]}),i.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl p-3 sm:p-4 bg-slate-50/50",children:[i.jsx(hM,{className:"h-6 w-6 sm:h-8 sm:w-8 text-red-500 mb-2"}),i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-foreground",children:G.cenas}),i.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground",children:"Cenas"})]})]})]})}),i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"order-2 lg:order-2",children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-gradient-to-br from-green-500 to-emerald-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(H0,{className:"w-5 h-5 sm:w-6 sm:h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-xl sm:text-2xl font-bold text-foreground",children:"Árvore do Projeto"}),i.jsx("p",{className:"text-muted-foreground text-sm sm:text-base mt-1",children:"Estrutura completa do projeto."})]})]})}),i.jsx(at,{children:l.areas.length===0?i.jsxs("div",{className:"text-center py-8",children:[i.jsx(Su,{className:"h-10 w-10 sm:h-12 sm:w-12 text-muted-foreground/80 mx-auto mb-3"}),i.jsx("h4",{className:"text-lg font-semibold text-foreground mb-2",children:"Nenhuma área, ambiente ou circuito cadastrado."}),i.jsx("p",{className:"text-muted-foreground text-sm",children:'Use as páginas "Áreas", "Ambientes" e "Circuitos" para começar a estruturar seu projeto.'})]}):i.jsx("div",{className:"space-y-4 sm:space-y-6 max-h-80 sm:max-h-96 overflow-y-auto pr-2",children:l.areas.map((se,we)=>i.jsxs(Ee.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:we*.1},children:[i.jsx("h3",{className:"font-bold text-base sm:text-lg text-foreground flex items-center gap-2",children:se.nome}),i.jsx("div",{className:"ml-3 sm:ml-4 mt-2 space-y-3 sm:space-y-4",children:se.ambientes.map(ve=>{const Xe=ve.circuitos.reduce((Q,ae)=>{const O=ae.tipo||"outros";return Q[O]||(Q[O]=[]),Q[O].push(ae),Q},{});return i.jsxs("div",{className:"border-l-2 border-slate-200 dark:border-slate-600 pl-3 sm:pl-4 relative before:content-[''] before:absolute before:left-0 before:top-3 before:w-3 sm:before:w-4 before:h-px before:bg-slate-200 dark:before:bg-slate-600",children:[i.jsx("h4",{className:"font-semibold text-slate-700 dark:text-slate-300 flex items-center gap-2 text-sm sm:text-base",children:ve.nome}),i.jsxs("div",{className:"mt-2 sm:mt-3 space-y-3 sm:space-y-4",children:[ve.circuitos.length===0?i.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground/90 italic",children:"Nenhum circuito neste ambiente."}):Object.entries(Xe).map(([Q,ae])=>{const O=Re[Q]||{icon:Su,label:Q.charAt(0).toUpperCase()+Q.slice(1),color:"text-muted-foreground/90"},ye=O.icon;return i.jsxs("div",{children:[i.jsxs("h5",{className:"font-semibold text-foreground flex items-center gap-2 text-xs sm:text-sm",children:[i.jsx(ye,{className:`h-3 w-3 sm:h-4 sm:w-4 ${O.color}`}),O.label]}),i.jsx("ul",{className:"space-y-1 sm:space-y-2 mt-1 sm:mt-2 pl-4 sm:pl-6",children:ae.map(J=>i.jsxs("li",{className:"text-xs sm:text-sm text-muted-foreground flex items-center gap-2 flex-wrap",children:[i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-slate-400"}),i.jsx("span",{className:"font-medium",children:J.identificador}),i.jsx("span",{children:"-"}),i.jsx("span",{className:"flex-1 min-w-0 truncate",children:J.nome}),J.vinculacao?i.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-green-100 text-green-700 whitespace-nowrap",children:["Vinc. em ",J.vinculacao.modulo_nome," (Canal ",J.vinculacao.canal,")"]}):i.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-red-100 text-red-700 whitespace-nowrap",children:"Não Vinculado"})]},J.id))})]},Q)}),(()=>{const Q=t.filter(ae=>{var O;return((O=ae.ambiente)==null?void 0:O.id)===ve.id});return Q.length===0?null:i.jsxs("div",{className:"mt-3 sm:mt-4",children:[i.jsxs("h5",{className:"text-xs sm:text-sm font-semibold text-foreground mb-2 flex items-center gap-2",children:[i.jsx(Cp,{className:"h-3 w-3 sm:h-4 sm:w-4 text-violet-600"}),"Keypads"]}),i.jsx("ul",{className:"space-y-1 sm:space-y-2 pl-4 sm:pl-6",children:Q.map(ae=>{const O=ae.buttons.filter(V=>V.circuito_id!=null||V.cena_id!=null).length,ye=ae.button_count||ae.buttons.length||0;let J="Vazio",k="bg-red-100 text-red-700";return O>0&&O0&&O===ye&&(J="Completo",k="bg-green-100 text-green-700"),i.jsxs("li",{className:"text-xs sm:text-sm text-muted-foreground flex flex-col sm:flex-row sm:items-center justify-between gap-1 sm:gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx("span",{className:"h-2 w-2 rounded-full bg-violet-400"}),i.jsx("span",{className:"font-medium text-foreground",children:ae.nome}),i.jsxs("span",{className:"text-xs text-muted-foreground/90",children:["HSNET ",ae.hsnet]}),i.jsxs("span",{className:"text-xs text-muted-foreground/90",children:["• ",ye," tecla(s)"]}),i.jsxs("span",{className:"text-xs text-muted-foreground/90 flex items-center gap-1",children:[i.jsx(ca,{className:"h-3 w-3"})," ",O,"/",ye," vinculadas"]})]}),i.jsx(yt,{className:`text-xs px-2 py-0.5 ${k} self-start sm:self-auto`,children:J})]},ae.id)})})]})})()]})]},ve.id)})})]},se.id))})})]})})]}),i.jsx(bs,{previousPath:"/cenas"}),i.jsx(Ir,{children:h&&i.jsx(Ee.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",children:i.jsx(Ee.div,{initial:{y:-50,opacity:0},animate:{y:0,opacity:1},exit:{y:-50,opacity:0},className:"bg-card rounded-2xl sm:rounded-3xl shadow-2xl w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:i.jsxs("div",{className:"p-4 sm:p-6 md:p-8",children:[i.jsx("h3",{className:"text-xl sm:text-2xl font-bold mb-4",children:"Gerar Arquivo de Configuração (.rwp)"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Preencha os dados técnicos para gerar o arquivo de configuração do projeto."}),i.jsxs("form",{method:"POST",action:"/roehn/import",encType:"multipart/form-data",target:"_blank",onSubmit:Se,className:"space-y-6",children:[i.jsx("input",{type:"hidden",name:"m4_hsnet",value:E}),i.jsx("input",{type:"hidden",name:"m4_devid",value:I}),i.jsx("input",{type:"hidden",name:"software_version",value:q}),i.jsx("input",{type:"hidden",name:"m4_quadro_id",value:H}),i.jsxs("section",{children:[i.jsx("h4",{className:"text-primary text-sm font-semibold mb-2 border-b pb-1",children:"Informações do Projeto"}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"project_name",children:"Nome do Projeto"}),i.jsx(Oe,{id:"project_name",name:"project_name",value:p,onChange:se=>b(se.target.value),required:!0,className:"text-sm"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Será baseado no projeto atual selecionado."})]})]}),i.jsxs("section",{children:[i.jsx("h4",{className:"text-primary text-sm font-semibold mb-2 border-b pb-1",children:"Informações do Cliente"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"client_name",children:"Nome do Cliente"}),i.jsx(Oe,{id:"client_name",name:"client_name",value:g,onChange:se=>y(se.target.value),required:!0,className:"text-sm"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"client_email",children:"Email do Cliente"}),i.jsx(Oe,{id:"client_email",name:"client_email",value:v,onChange:se=>x(se.target.value),className:"text-sm"})]}),i.jsxs("div",{className:"md:col-span-2",children:[i.jsx(le,{htmlFor:"client_phone",children:"Telefone"}),i.jsx(Oe,{id:"client_phone",name:"client_phone",placeholder:"(00) 00000-0000",value:w,onChange:se=>j(se.target.value),className:"text-sm"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Digite com DDD; validaremos no envio."})]})]})]}),i.jsxs("section",{children:[i.jsx("h4",{className:"text-primary text-sm font-semibold mb-2 border-b pb-1",children:"Configurações Técnicas"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"timezone_id",children:"Timezone"}),i.jsx(Oe,{id:"timezone_id",name:"timezone_id",value:S,onChange:se=>N(se.target.value),required:!0,className:"text-sm"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"lat",children:"Latitude"}),i.jsx(Oe,{id:"lat",name:"lat",value:C,onChange:se=>_(se.target.value),className:"text-sm"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"lon",children:"Longitude"}),i.jsx(Oe,{id:"lon",name:"lon",value:$,onChange:se=>D(se.target.value),className:"text-sm"})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 mt-3",children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"tech_area",children:"Área Técnica"}),i.jsx(Oe,{id:"tech_area",name:"tech_area",value:z,onChange:se=>T(se.target.value),required:!0,className:"text-sm"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"tech_room",children:"Sala Técnica"}),i.jsx(Oe,{id:"tech_room",name:"tech_room",value:L,onChange:se=>M(se.target.value),required:!0,className:"text-sm"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"board_name",children:"Nome do Quadro"}),i.jsx(Oe,{id:"board_name",name:"board_name",value:B,onChange:se=>W(se.target.value),required:!0,className:"text-sm"})]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 mt-3",children:i.jsx("div",{className:"md:col-span-3"})})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row justify-end gap-2 mt-6",children:[i.jsx(de,{type:"button",variant:"ghost",onClick:()=>m(!1),className:"w-full sm:w-auto order-2 sm:order-1",children:"Fechar"}),i.jsxs(de,{type:"submit",className:"w-full sm:w-auto order-1 sm:order-2",children:[i.jsx(U0,{className:"h-4 w-4 mr-2"}),"Gerar e Baixar"]})]})]})]})})})})]})})})}const F8=["WHITE","BRASS","BRUSHED BLACK","BLACK","BRONZE","NICKEL","SILVER","TITANIUM"],V8=["WHITE","BLACK"],$8=({keypad:e,ambientes:t,isOpen:r,onClose:n,onSave:s})=>{const{toast:o}=Kt(),[a,l]=f.useState(""),[c,u]=f.useState(""),[d,h]=f.useState(""),[m,p]=f.useState(""),[b,g]=f.useState("");f.useEffect(()=>{var v;e&&(l(e.nome),u(e.hsnet),h(e.color),p(e.button_color),g(((v=e.ambiente)==null?void 0:v.id)||""))},[e]);const y=async()=>{if(!e)return;if(!a.trim()||!c||!d||!m||!b){o({variant:"destructive",title:"Erro",description:"Preencha todos os campos."});return}const v=t.find(w=>w.id===Number(b)),x={...e,nome:a.trim(),hsnet:Number(c),color:d,button_color:m,ambiente:v};try{const w=await fetch(`/api/keypads/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({nome:x.nome,color:x.color,button_color:x.button_color,ambiente_id:Number(b)})});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);const j=await w.json();j.ok?(s(x),o({title:"Sucesso!",description:"Keypad atualizado."}),n()):o({variant:"destructive",title:"Erro",description:j.error||"Falha ao atualizar keypad."})}catch(w){console.error("Erro ao atualizar keypad:",w),o({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}};return i.jsx(dl,{open:r,onOpenChange:n,children:i.jsxs(Ni,{children:[i.jsx(Ci,{children:i.jsx(Ei,{children:"Editar Keypad"})}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-nome",children:"Nome"}),i.jsx(Oe,{id:"edit-nome",value:a,onChange:v=>l(v.target.value)})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-hsnet",children:"HSNET"}),i.jsx(Oe,{id:"edit-hsnet",type:"number",value:c,disabled:!0})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-color",children:"Cor"}),i.jsxs("select",{id:"edit-color",value:d,onChange:v=>h(v.target.value),className:"w-full h-10 border rounded-md px-2",children:[i.jsx("option",{value:"",children:"Selecione"}),F8.map(v=>i.jsx("option",{value:v,children:v},v))]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-button-color",children:"Cor das Teclas"}),i.jsxs("select",{id:"edit-button-color",value:m,onChange:v=>p(v.target.value),className:"w-full h-10 border rounded-md px-2",children:[i.jsx("option",{value:"",children:"Selecione"}),V8.map(v=>i.jsx("option",{value:v,children:v},v))]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"edit-ambiente",children:"Ambiente"}),i.jsx("select",{id:"edit-ambiente",value:b.toString(),onChange:v=>g(Number(v.target.value)),className:"w-full h-10 border rounded-md px-2",children:t.map(v=>{var x;return i.jsx("option",{value:v.id.toString(),children:(x=v.area)!=null&&x.nome?`${v.nome} (${v.area.nome})`:v.nome},v.id)})})]})]}),i.jsxs(ki,{children:[i.jsx(Xc,{asChild:!0,children:i.jsx(de,{variant:"outline",onClick:n,children:"Cancelar"})}),i.jsx(de,{onClick:y,children:"Salvar Alterações"})]})]})})},z8=["WHITE","BRASS","BRUSHED BLACK","BLACK","BRONZE","NICKEL","SILVER","TITANIUM"],B8=["WHITE","BLACK"],n1=[{label:"1 tecla",value:"ONE",hint:"Layout 1"},{label:"2 teclas",value:"TWO",hint:"Layout 2"},{label:"4 teclas",value:"FOUR",hint:"Layout 4"}];function mm(e){if(e){if(e==="ONE")return 1;if(e==="TWO")return 2;if(e==="FOUR")return 4}}function U8(){var Ge;const{toast:e}=Kt(),{projeto:t}=Jr(),[r,n]=f.useState([]),[s,o]=f.useState([]),[a,l]=f.useState([]),[c,u]=f.useState([]),[d,h]=f.useState(!0),[m,p]=f.useState(!1),[b,g]=f.useState(!1),[y,v]=f.useState(""),[x,w]=f.useState(""),[j,S]=f.useState(!1),[N,C]=f.useState(""),[_,$]=f.useState(""),[D,z]=f.useState(""),[T,L]=f.useState(""),[M,B]=f.useState(!1),[W,H]=f.useState(!1),[A,E]=f.useState(null),[I,q]=f.useState([]),[F,Z]=f.useState(null),[X,ee]=f.useState(""),[xe,G]=f.useState("todos"),[Se,Ae]=f.useState("todos"),Re=f.useMemo(()=>s.filter(R=>{var Fe,Be;const Y=X===""||R.nome.toLowerCase().includes(X.toLowerCase())||String(R.hsnet).includes(X.toLowerCase())||R.ambiente&&R.ambiente.nome.toLowerCase().includes(X.toLowerCase())||((Fe=R.ambiente)==null?void 0:Fe.area)&&R.ambiente.area.nome.toLowerCase().includes(X.toLowerCase()),ie=xe==="todos"||((Be=R.ambiente)==null?void 0:Be.id)===xe,be=Se==="todos"||R.button_count===Se;return Y&&ie&&be}),[s,X,xe,Se]);f.useEffect(()=>{b&&(x===""||x===void 0||x===null)&&se()},[b,s.length]);async function se(){try{S(!0);const R=await fetch("/api/keypads/next-hsnet",{credentials:"same-origin"}),Y=await R.json();R.ok&&(Y!=null&&Y.ok)&&typeof Y.hsnet=="number"&&w(Y.hsnet)}catch{}finally{S(!1)}}async function we(){h(!0);try{const R=await fetch("/api/projeto_atual",{credentials:"same-origin"}).then(_i=>_i.json()).catch(()=>null),Y=!!(R!=null&&R.ok&&(R!=null&&R.projeto_atual));if(g(Y),!Y){n([]),o([]),l([]),u([]);return}const[ie,be,Fe,Be]=await Promise.all([fetch("/api/ambientes",{credentials:"same-origin"}),fetch("/api/keypads",{credentials:"same-origin"}),fetch("/api/circuitos",{credentials:"same-origin"}),fetch("/api/cenas",{credentials:"same-origin"})]),[Ke,nt,xt,_r]=await Promise.all([ie.json(),be.json(),Fe.json(),Be.json()]);n((Ke==null?void 0:Ke.ambientes)||Ke||[]),o((nt==null?void 0:nt.keypads)||nt||[]),l((xt==null?void 0:xt.circuitos)||xt||[]),u((_r==null?void 0:_r.cenas)||_r||[])}catch(R){console.error(R),e({variant:"destructive",title:"Erro",description:"Falha ao carregar dados."})}finally{h(!1)}}async function ve(){h(!0);try{const R=await fetch("/api/projeto_atual",{credentials:"same-origin"}).then(Y=>Y.json());if(R!=null&&R.ok&&(R!=null&&R.projeto_atual)){g(!0);const[Y,ie,be,Fe]=await Promise.all([fetch("/api/ambientes",{credentials:"same-origin"}),fetch("/api/keypads",{credentials:"same-origin"}),fetch("/api/circuitos",{credentials:"same-origin"}),fetch("/api/cenas",{credentials:"same-origin"})]);if(!Y.ok||!ie.ok||!be.ok||!Fe.ok)throw new Error("Falha ao carregar dados.");const Be=await Y.json(),Ke=await ie.json(),nt=await be.json(),xt=await Fe.json();n((Be==null?void 0:Be.ambientes)||Be||[]),o((Ke==null?void 0:Ke.keypads)||Ke||[]),l((nt==null?void 0:nt.circuitos)||nt||[]),u((xt==null?void 0:xt.cenas)||xt||[])}else g(!1),n([]),o([]),l([]),u([])}catch(R){console.error(R),g(!1),e({variant:"destructive",title:"Erro",description:"Falha ao carregar dados. Verifique se há um projeto selecionado."})}finally{h(!1)}}function Xe(R){const Y=R.button_count||0,ie=(R.buttons||[]).filter(be=>!!(be!=null&&be.circuito_id)||!!(be!=null&&be.cena_id)).length;return Y===0?{status:"vazio",linked:0,total:0}:ie===0?{status:"vazio",linked:ie,total:Y}:ie===Y?{status:"completo",linked:ie,total:Y}:{status:"parcial",linked:ie,total:Y}}function Q(R){switch(R){case"completo":return"bg-emerald-100 text-emerald-800 border border-emerald-200";case"parcial":return"bg-amber-100 text-amber-800 border border-amber-200";case"vazio":default:return"bg-muted text-slate-700 border border-border"}}function ae(R){return R==="completo"?"Completo":R==="parcial"?"Parcial":"Vazio"}f.useEffect(()=>{we()},[t==null?void 0:t.id]);function O(){v(""),w(""),C(""),$(""),z(""),L("")}async function ye(R){R.preventDefault();const ie=(Be=>{const Ke=String(Be||"").toUpperCase();return Ke==="ONE"?1:Ke==="TWO"?2:Ke==="FOUR"?4:0})(D),be=Number(x),Fe=Number(T);if(!y.trim()||!N||!_||!D||ie===0||Number.isNaN(be)||be<=0||Number.isNaN(Fe)||Fe<=0){e({variant:"destructive",title:"Erro",description:"Preencha todos os campos obrigatórios corretamente."});return}try{p(!0);const Be=await fetch("/api/keypads",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({nome:y.trim(),hsnet:be,color:N,button_color:_,button_count:ie,ambiente_id:Fe})}),Ke=await Be.json().catch(()=>({}));if(!Be.ok||!(Ke!=null&&Ke.ok||Ke!=null&&Ke.success))throw new Error((Ke==null?void 0:Ke.error)||(Ke==null?void 0:Ke.message)||`Falha na criação (HTTP ${Be.status})`);e({title:"Sucesso!",description:"Keypad adicionado."}),O==null||O(),w(""),await ve()}catch(Be){console.error(Be),e({variant:"destructive",title:"Erro",description:String((Be==null?void 0:Be.message)||Be)})}finally{p(!1)}}async function J(R){if(confirm("Tem certeza que deseja excluir este keypad?"))try{const Y=await fetch(`/api/keypads/${R}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json"}}),ie=await Y.json().catch(()=>({}));if(!Y.ok||!(ie!=null&&ie.ok||ie!=null&&ie.success))throw new Error((ie==null?void 0:ie.error)||(ie==null?void 0:ie.message)||`Falha ao excluir (HTTP ${Y.status})`);o(be=>be.filter(Fe=>Fe.id!==R)),e({title:"Sucesso!",description:"Keypad excluído."})}catch(Y){console.error(Y),e({variant:"destructive",title:"Erro",description:String((Y==null?void 0:Y.message)||Y)})}}function k(R){Z(R)}function V(){Z(null)}function K(R){o(Y=>Y.map(ie=>ie.id===R.id?{...ie,...R}:ie)),V()}function ue(R){E(R);const Y=(typeof R.button_count=="number"&&R.button_count>0?R.button_count:mm(R.layout))??0;if(Y<=0){e({variant:"destructive",title:"Não foi possível abrir o vínculo",description:"Layout/quantidade de teclas do keypad é inválido."});return}const ie=Array.from({length:Y},(be,Fe)=>({index:Fe,type:"none",circuito_id:null,cena_id:null,engraver_text:null,icon:null,is_rocker:!1,rocker_style:"up-down"}));q(ie),fetch(`/api/keypads/${R.id}`,{credentials:"same-origin"}).then(be=>be.ok?be.json():null).then(be=>{var Fe;if(be!=null&&be.ok&&Array.isArray((Fe=be.keypad)==null?void 0:Fe.buttons)){const Be=be.keypad.buttons,Ke=ie.map(nt=>{const xt=Be.find(lh=>lh.ordem===nt.index+1);if(!xt)return nt;const _r=xt.rocker_style,_i=_r==="left-right"||_r==="previous-next"?_r:"up-down",Ti={...nt,engraver_text:xt.engraver_text,icon:xt.icon,is_rocker:!!xt.is_rocker,rocker_style:_i};return xt.cena_id?{...Ti,type:"cena",cena_id:xt.cena_id,circuito_id:null}:xt.circuito_id?{...Ti,type:"circuito",circuito_id:xt.circuito_id,cena_id:null}:{...Ti,type:"none"}});q(Ke)}B(!0)}).catch(()=>B(!0))}function oe(){B(!1),E(null),q([]),H(!1)}function re(R,Y,ie){q(be=>be.map(Fe=>{if(Fe.index===R){const Be=ie?Y:"none";if(Y==="circuito")return{...Fe,type:Be,circuito_id:ie?Number(ie):null,cena_id:null};if(Y==="cena")return{...Fe,type:Be,cena_id:ie?Number(ie):null,circuito_id:null}}return Fe}))}function me(R,Y){q(ie=>ie.map(be=>be.index===R?{...be,type:Y,circuito_id:null,cena_id:null}:be))}async function Ve(){if(A)try{H(!0),await Promise.all(I.map(ie=>{const be={};return ie.type==="circuito"?be.circuito_id=ie.circuito_id:ie.type==="cena"?be.cena_id=ie.cena_id:(be.circuito_id=null,be.cena_id=null),be.engraver_text=ie.engraver_text,be.icon=ie.icon,be.is_rocker=ie.is_rocker,be.rocker_style=ie.rocker_style,fetch(`/api/keypads/${A.id}/buttons/${ie.index+1}`,{method:"PUT",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(be)})}));const R=await fetch(`/api/keypads/${A.id}`,{credentials:"same-origin"}),Y=await R.json().catch(()=>({}));R.ok&&(Y!=null&&Y.ok)&&Y.keypad?o(ie=>ie.map(be=>be.id===A.id?Y.keypad:be)):await ve(),e({title:"Vinculações salvas!",description:"As teclas foram atualizadas."}),oe()}catch(R){console.error(R),e({variant:"destructive",title:"Erro",description:String((R==null?void 0:R.message)||R)}),H(!1)}}return i.jsx(kr,{children:i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:[i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-6 sm:py-8",children:[i.jsx("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-8",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-14 h-14 sm:w-16 sm:h-16 bg-gradient-to-br from-blue-600 to-indigo-600 rounded-3xl flex items-center justify-center shadow-lg shadow-blue-500/25",children:i.jsx(W0,{className:"w-6 h-6 sm:w-8 sm:h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-foreground mb-2",children:"Gerenciar Keypads"}),i.jsx("p",{className:"text-base sm:text-lg text-muted-foreground max-w-2xl",children:"Cadastre e gerencie os keypads RQR-K do seu projeto."})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-blue-600 to-indigo-600 rounded-full shadow-sm"})]})}),!b&&!d&&i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:i.jsxs(en,{className:"bg-amber-50 border-amber-200 shadow-sm",children:[i.jsx(Ot,{className:"h-4 w-4 text-amber-600"}),i.jsx(tn,{className:"text-amber-800",children:"Selecione um projeto na página inicial para cadastrar keypads."})]})}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 sm:gap-8",children:[i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"order-1 lg:order-1",children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-gradient-to-br from-green-500 to-emerald-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Un,{className:"w-5 h-5 sm:w-6 sm:h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-xl sm:text-2xl font-bold text-foreground",children:"Adicionar Novo Keypad"}),i.jsx("p",{className:"text-muted-foreground text-sm sm:text-base mt-1",children:"Preencha as informações do dispositivo"})]})]})}),i.jsx(at,{children:i.jsxs("form",{className:"space-y-6",onSubmit:ye,children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"nome",className:"text-sm font-semibold text-slate-700",children:"Nome *"}),i.jsx(Oe,{id:"nome",value:y,onChange:R=>v(R.target.value),placeholder:"Ex.: Keypad Sala",required:!0,disabled:!b,className:"h-12 px-4 rounded-xl border-border focus:border-blue-500 focus:ring-blue-500/20"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"hsnet",children:"HSNET *"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Oe,{id:"hsnet",type:"number",value:x,onChange:R=>w(Number(R.target.value)||""),placeholder:"Ex.: 110",required:!0,className:"h-12 px-4 rounded-xl border-border focus:border-indigo-500 focus:ring-indigo-500/20"}),i.jsx(de,{type:"button",variant:"outline",onClick:se,disabled:j,className:"h-12",children:j?"...":"Sugerir"})]}),i.jsx("p",{className:"text-xs text-muted-foreground/90 mt-1",children:"Sugerimos o primeiro HSNET livre a partir de 110."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"cor",className:"text-sm font-semibold text-slate-700",children:"Cor *"}),i.jsxs("select",{id:"cor",className:"h-12 w-full px-4 rounded-xl border border-border bg-background focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all",value:N,onChange:R=>C(R.target.value),required:!0,disabled:!b,children:[i.jsx("option",{value:"",children:"Selecione"}),z8.map(R=>i.jsx("option",{value:R,children:R},R))]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"cor_teclas",className:"text-sm font-semibold text-slate-700",children:"Cor das Teclas *"}),i.jsxs("select",{id:"cor_teclas",className:"h-12 w-full px-4 rounded-xl border border-border bg-background focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all",value:_,onChange:R=>$(R.target.value),required:!0,disabled:!b,children:[i.jsx("option",{value:"",children:"Selecione"}),B8.map(R=>i.jsx("option",{value:R,children:R},R))]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(le,{htmlFor:"layout",className:"text-sm font-semibold text-slate-700",children:"Layout *"}),i.jsxs("select",{id:"layout",className:"h-12 w-full px-4 rounded-xl border border-border bg-background focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all",value:D,onChange:R=>z(R.target.value),required:!0,disabled:!b,children:[i.jsx("option",{value:"",children:"Selecione"}),n1.map(R=>i.jsx("option",{value:R.value,children:R.label},R.value))]}),D&&i.jsx("p",{className:"text-xs text-muted-foreground/90 mt-1",children:(Ge=n1.find(R=>R.value===D))==null?void 0:Ge.hint})]})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"ambiente_id",className:"text-sm font-semibold text-slate-700",children:"Ambiente *"}),i.jsxs("select",{id:"ambiente_id",className:"mt-2 h-12 w-full px-4 rounded-xl border border-border bg-background focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all",value:T===""?"":String(T),onChange:R=>{const Y=R.target.value;L(Y===""?"":Number(Y))},required:!0,disabled:!b||d||r.length===0,children:[i.jsx("option",{value:"",children:d?"Carregando ambientes...":"Selecione um ambiente"}),!d&&r.slice().sort((R,Y)=>R.nome.localeCompare(Y.nome)).map(R=>{var Y;return i.jsxs("option",{value:R.id,children:[R.nome,(Y=R.area)!=null&&Y.nome?` — ${R.area.nome}`:""]},R.id)})]}),!d&&b&&r.length===0&&i.jsxs("p",{className:"text-sm text-amber-600 mt-1 flex items-center gap-1",children:[i.jsx(Ot,{className:"w-3 h-3"}),"Nenhum ambiente disponível. Crie ambientes primeiro."]})]}),i.jsxs(de,{type:"submit",className:"w-full h-12 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center justify-center gap-2",disabled:!b||m,children:[i.jsx(Un,{className:"h-5 w-5"}),m?"Adicionando...":"Adicionar Keypad"]})]})})]})}),i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"order-2 lg:order-2",children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsxs(it,{className:"pb-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(wM,{className:"w-5 h-5 sm:w-6 sm:h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-xl sm:text-2xl font-bold text-foreground",children:"Keypads Cadastrados"}),i.jsx("p",{className:"text-muted-foreground text-sm sm:text-base mt-1",children:"Lista com todos os keypads do projeto"})]})]}),i.jsxs(yt,{className:"bg-gradient-to-r from-blue-500 to-indigo-500 text-white text-xs sm:text-sm font-medium px-2 sm:px-3 py-1",children:[s.length," ",s.length===1?"keypad":"keypads"]})]}),i.jsxs("div",{className:"mt-4 sm:mt-6 space-y-3 sm:space-y-4",children:[i.jsxs("div",{className:"relative",children:[i.jsx(La,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground/80 w-4 h-4"}),i.jsx(Oe,{placeholder:"Buscar por nome, HSNET, etc...",value:X,onChange:R=>ee(R.target.value),className:"pl-10 pr-10 h-10 rounded-xl border-border focus:border-blue-500"}),X&&i.jsx("button",{onClick:()=>ee(""),className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-muted-foreground/80 hover:text-muted-foreground",children:i.jsx(Nr,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(le,{htmlFor:"filtro-ambiente",className:"text-xs font-medium text-muted-foreground",children:"Ambiente"}),i.jsxs(vr,{value:xe==="todos"?"todos":String(xe),onValueChange:R=>G(R==="todos"?"todos":Number(R)),children:[i.jsx(ar,{id:"filtro-ambiente",className:"h-9 text-sm rounded-xl",children:i.jsx(yr,{placeholder:"Todos os ambientes"})}),i.jsxs(lr,{className:"rounded-xl",children:[i.jsx(ne,{value:"todos",children:"Todos os ambientes"}),r.sort((R,Y)=>R.nome.localeCompare(Y.nome)).map(R=>i.jsxs(ne,{value:String(R.id),children:[R.nome,R.area&&` (${R.area.nome})`]},R.id))]})]})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(le,{htmlFor:"filtro-teclas",className:"text-xs font-medium text-muted-foreground",children:"Nº de Teclas"}),i.jsxs(vr,{value:Se==="todos"?"todos":String(Se),onValueChange:R=>Ae(R==="todos"?"todos":Number(R)),children:[i.jsx(ar,{id:"filtro-teclas",className:"h-9 text-sm rounded-xl",children:i.jsx(yr,{placeholder:"Todas"})}),i.jsxs(lr,{className:"rounded-xl",children:[i.jsx(ne,{value:"todos",children:"Todas as teclas"}),i.jsx(ne,{value:"1",children:"1 Tecla"}),i.jsx(ne,{value:"2",children:"2 Teclas"}),i.jsx(ne,{value:"4",children:"4 Teclas"})]})]})]})]}),(X||xe!=="todos"||Se!=="todos")&&i.jsx("div",{className:"flex justify-end",children:i.jsxs(de,{variant:"outline",size:"sm",onClick:()=>{ee(""),G("todos"),Ae("todos")},className:"h-8 text-xs rounded-lg gap-1",children:[i.jsx(Nr,{className:"w-3 h-3"}),"Limpar filtros"]})})]})]}),i.jsx(at,{children:d?i.jsxs("div",{className:"flex flex-col justify-center items-center py-8",children:[i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent mb-3"}),i.jsx("p",{className:"text-muted-foreground font-medium",children:"Carregando keypads..."})]}):s.length===0?i.jsxs(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center py-8",children:[i.jsx("div",{className:"w-16 h-16 bg-muted rounded-full flex items-center justify-center mx-auto mb-4",children:i.jsx(W0,{className:"h-8 w-8 text-muted-foreground/80"})}),i.jsx("h4",{className:"text-lg font-semibold text-foreground mb-2",children:b?"Nenhum keypad cadastrado":"Selecione um projeto"}),i.jsx("p",{className:"text-muted-foreground max-w-sm mx-auto text-sm",children:b?"Comece adicionando seu primeiro keypad usando o formulário ao lado.":"Selecione um projeto para visualizar e gerenciar os keypads."})]}):i.jsx("div",{className:"space-y-3 max-h-80 sm:max-h-96 overflow-y-auto pr-2",children:i.jsx(Ir,{children:Re.map((R,Y)=>{var ie,be,Fe;return i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{delay:Y*.05},className:"group relative overflow-hidden rounded-2xl border border-border bg-card/85 backdrop-blur-sm p-3 sm:p-4 hover:bg-card/90 hover:shadow-lg hover:shadow-slate-900/5 transition-all duration-300",children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-3",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[i.jsx(yt,{className:"text-xs font-medium px-2 py-1 bg-blue-100 text-primary",children:R.button_count===4?"4 teclas":R.button_count===2?"2 teclas":"1 tecla"}),i.jsxs("span",{className:"text-xs font-mono text-muted-foreground/90 bg-muted px-2 py-1 rounded-lg",children:["HSNET: ",R.hsnet]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 mb-2",children:[i.jsx("h4",{className:"font-bold text-foreground text-base sm:text-lg",children:R.nome}),(()=>{const{status:Be,linked:Ke,total:nt}=Xe(R);return i.jsxs("span",{className:"inline-flex items-center gap-2 px-2.5 py-1 rounded-lg text-xs font-medium "+Q(Be),title:`${Ke}/${nt} teclas vinculadas`,children:[i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current opacity-70"}),ae(Be)," • ",Ke,"/",nt]})})()]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-1 text-xs sm:text-sm text-muted-foreground mb-2",children:[i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-muted text-slate-700",children:["Corpo: ",R.color]}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-muted text-slate-700",children:["Teclas: ",R.button_color]})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs sm:text-sm text-muted-foreground",children:[i.jsx(zx,{className:"h-3 w-3 sm:h-4 sm:w-4 text-muted-foreground/80"}),i.jsx("span",{className:"font-medium",children:((ie=R.ambiente)==null?void 0:ie.nome)||"Sem ambiente"}),((Fe=(be=R.ambiente)==null?void 0:be.area)==null?void 0:Fe.nome)&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground/80",children:"•"}),i.jsxs("span",{className:"text-muted-foreground/90",children:["Área: ",R.ambiente.area.nome]})]})]})]}),i.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 self-end sm:self-auto",children:[i.jsxs(de,{variant:"outline",size:"sm",onClick:()=>ue(R),disabled:!b,className:"rounded-xl shadow hover:shadow-md h-8 w-8 sm:h-9 sm:w-auto p-0 sm:px-3 sm:py-2",title:"Vincular teclas a circuitos",children:[i.jsx(ca,{className:"h-3 w-3 sm:h-4 sm:w-4 sm:mr-2"}),i.jsx("span",{className:"hidden sm:inline",children:"Vincular"})]}),i.jsx(de,{variant:"outline",size:"sm",onClick:()=>k(R),disabled:!b,className:"rounded-xl shadow hover:shadow-md h-8 w-8 p-0 sm:h-9 sm:w-9",title:"Editar keypad",children:i.jsx(Ja,{className:"h-3 w-3 sm:h-4 sm:w-4"})}),i.jsx(de,{variant:"destructive",size:"sm",onClick:()=>J(R.id),disabled:!b,className:"rounded-xl shadow-lg hover:shadow-xl h-8 w-8 p-0 sm:h-9 sm:w-9",children:i.jsx(Cn,{className:"h-3 w-3 sm:h-4 sm:w-4"})})]})]})},R.id)})})})})]})})]}),i.jsx(bs,{previousPath:"/vinculacao",nextPath:"/cenas"})]}),i.jsx($8,{isOpen:!!F,onClose:V,onSave:K,keypad:F,ambientes:r}),i.jsx(Ir,{children:M&&A&&i.jsx(Ee.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",children:i.jsxs(Ee.div,{initial:{y:-50,opacity:0},animate:{y:0,opacity:1},exit:{y:-50,opacity:0},className:"bg-card p-4 sm:p-6 md:p-8 rounded-2xl sm:rounded-3xl shadow-2xl w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[i.jsxs("div",{className:"flex items-start justify-between mb-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl sm:text-2xl font-bold",children:"Vincular Teclas"}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[A.nome," — ",(A.button_count??mm(A.layout))===4?"4 teclas":(A.button_count??mm(A.layout))===2?"2 teclas":"1 tecla"]})]}),i.jsx(de,{variant:"ghost",size:"icon",onClick:oe,className:"rounded-full",children:i.jsx(Nr,{className:"w-5 h-5"})})]}),i.jsx("div",{className:"flex flex-col gap-4 max-h-[50vh] overflow-y-auto pr-2",children:I.map(R=>i.jsxs("div",{className:"rounded-xl border border-border p-3 sm:p-4 bg-slate-50/50",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 mb-2",children:[i.jsxs("div",{className:"text-sm font-semibold text-slate-700",children:["Tecla ",R.index+1]}),i.jsx(de,{type:"button",size:"sm",variant:"ghost",onClick:()=>re(R.index,R.type==="cena"?"cena":"circuito",""),className:"h-8 text-xs",title:"Limpar vinculação",children:"Limpar"})]}),i.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[i.jsxs(le,{className:"flex items-center gap-2 cursor-pointer text-sm",children:[i.jsx("input",{type:"radio",name:`binding-type-${R.index}`,checked:R.type==="circuito"||R.type==="none",onChange:()=>me(R.index,"circuito")}),"Circuito"]}),i.jsxs(le,{className:"flex items-center gap-2 cursor-pointer text-sm",children:[i.jsx("input",{type:"radio",name:`binding-type-${R.index}`,checked:R.type==="cena",onChange:()=>me(R.index,"cena")}),"Cena"]})]}),R.type==="cena"?i.jsxs("select",{value:R.cena_id??"",onChange:Y=>re(R.index,"cena",Y.target.value?Number(Y.target.value):""),className:"mt-1 h-10 w-full rounded-xl border border-border bg-background px-3 text-sm",children:[i.jsx("option",{value:"",children:"— Selecione a Cena —"}),c.map(Y=>{var ie;return i.jsxs("option",{value:Y.id,children:[Y.nome,(ie=Y.ambiente)!=null&&ie.nome?` — ${Y.ambiente.nome}`:""]},Y.id)})]}):i.jsxs("select",{value:R.circuito_id??"",onChange:Y=>re(R.index,"circuito",Y.target.value?Number(Y.target.value):""),className:"mt-1 h-10 w-full rounded-xl border border-border bg-background px-3 text-sm",children:[i.jsx("option",{value:"",children:"— Não vinculado —"}),a.map(Y=>{var ie;return i.jsxs("option",{value:Y.id,children:[Y.nome||Y.identificador," (",Y.tipo,")",(ie=Y.ambiente)!=null&&ie.nome?` — ${Y.ambiente.nome}`:""]},Y.id)})]}),i.jsxs("div",{className:"mt-2",children:[i.jsx(le,{className:"text-sm font-medium text-muted-foreground",children:"Tipo de Rótulo"}),i.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[i.jsxs(le,{className:"flex items-center gap-2 cursor-pointer text-sm",children:[i.jsx("input",{type:"radio",name:`label-type-${R.index}`,checked:!R.icon,onChange:()=>{q(Y=>Y.map(ie=>ie.index===R.index?{...ie,icon:null}:ie))}}),"Texto"]}),i.jsxs(le,{className:"flex items-center gap-2 cursor-pointer text-sm",children:[i.jsx("input",{type:"radio",name:`label-type-${R.index}`,checked:!!R.icon,onChange:()=>{q(Y=>Y.map(ie=>ie.index===R.index?{...ie,engraver_text:null,icon:"hvac"}:ie))}}),"Ícone"]})]})]}),R.icon?i.jsxs("div",{className:"mt-2",children:[i.jsx(le,{htmlFor:`icon-select-${R.index}`,className:"text-sm font-medium text-muted-foreground",children:"Ícone"}),i.jsxs(vr,{value:R.icon,onValueChange:Y=>{q(ie=>ie.map(be=>be.index===R.index?{...be,icon:Y}:be))},children:[i.jsx(ar,{id:`icon-select-${R.index}`,className:"mt-1 h-10 w-full rounded-xl border border-border bg-background px-3 text-sm",children:i.jsx(yr,{})}),i.jsxs(lr,{children:[i.jsx(ne,{value:"abajour",children:"Abajour"}),i.jsx(ne,{value:"arandela",children:"Arandela"}),i.jsx(ne,{value:"bright",children:"Bright"}),i.jsx(ne,{value:"cascata",children:"Cascata"}),i.jsx(ne,{value:"churrasco",children:"Churrasco"}),i.jsx(ne,{value:"clean room",children:"Clean Room"}),i.jsx(ne,{value:"concierge",children:"Concierge"}),i.jsx(ne,{value:"curtains",children:"Curtains"}),i.jsx(ne,{value:"curtains preset 1",children:"Curtains Preset 1"}),i.jsx(ne,{value:"curtains preset 2",children:"Curtains Preset 2"}),i.jsx(ne,{value:"day",children:"Day"}),i.jsx(ne,{value:"dim penumbra",children:"Dim Penumbra"}),i.jsx(ne,{value:"dinner",children:"Dinner"}),i.jsx(ne,{value:"do not disturb",children:"Do Not Disturb"}),i.jsx(ne,{value:"door",children:"Door"}),i.jsx(ne,{value:"doorbell",children:"Doorbell"}),i.jsx(ne,{value:"fan",children:"Fan"}),i.jsx(ne,{value:"fireplace",children:"Fireplace"}),i.jsx(ne,{value:"garage",children:"Garage"}),i.jsx(ne,{value:"gate",children:"Gate"}),i.jsx(ne,{value:"good night",children:"Good Night"}),i.jsx(ne,{value:"gym1",children:"Gym 1"}),i.jsx(ne,{value:"gym2",children:"Gym 2"}),i.jsx(ne,{value:"gym3",children:"Gym 3"}),i.jsx(ne,{value:"hvac",children:"HVAC"}),i.jsx(ne,{value:"irrigação",children:"Irrigação"}),i.jsx(ne,{value:"jardim1",children:"Jardim 1"}),i.jsx(ne,{value:"jardim2",children:"Jardim 2"}),i.jsx(ne,{value:"lampada",children:"Lampada"}),i.jsx(ne,{value:"laundry",children:"Laundry"}),i.jsx(ne,{value:"leaving",children:"Leaving"}),i.jsx(ne,{value:"light preset 1",children:"Light Preset 1"}),i.jsx(ne,{value:"light preset 2",children:"Light Preset 2"}),i.jsx(ne,{value:"lower shades",children:"Lower Shades"}),i.jsx(ne,{value:"luminaria de piso",children:"Luminaria de Piso"}),i.jsx(ne,{value:"medium",children:"Medium"}),i.jsx(ne,{value:"meeting",children:"Meeting"}),i.jsx(ne,{value:"movie",children:"Movie"}),i.jsx(ne,{value:"music",children:"Music"}),i.jsx(ne,{value:"night",children:"Night"}),i.jsx(ne,{value:"onoff",children:"On/Off"}),i.jsx(ne,{value:"padlock",children:"Padlock"}),i.jsx(ne,{value:"party",children:"Party"}),i.jsx(ne,{value:"pendant",children:"Pendant"}),i.jsx(ne,{value:"piscina 1",children:"Piscina 1"}),i.jsx(ne,{value:"piscina 2",children:"Piscina 2"}),i.jsx(ne,{value:"pizza",children:"Pizza"}),i.jsx(ne,{value:"raise shades",children:"Raise Shades"}),i.jsx(ne,{value:"reading",children:"Reading"}),i.jsx(ne,{value:"shades",children:"Shades"}),i.jsx(ne,{value:"shades preset 1",children:"Shades Preset 1"}),i.jsx(ne,{value:"shades preset 2",children:"Shades Preset 2"}),i.jsx(ne,{value:"spot",children:"Spot"}),i.jsx(ne,{value:"steam room",children:"Steam Room"}),i.jsx(ne,{value:"turned off",children:"Turned Off"}),i.jsx(ne,{value:"tv",children:"TV"}),i.jsx(ne,{value:"volume",children:"Volume"}),i.jsx(ne,{value:"welcome",children:"Welcome"}),i.jsx(ne,{value:"wine",children:"Wine"})]})]})]}):i.jsxs("div",{className:"mt-2",children:[i.jsx(le,{htmlFor:`engraver-text-${R.index}`,className:"text-sm font-medium text-muted-foreground",children:"Texto do Botão"}),i.jsx(Oe,{id:`engraver-text-${R.index}`,value:R.engraver_text??"",onChange:Y=>{const ie=Y.target.value.slice(0,7);q(be=>be.map(Fe=>Fe.index===R.index?{...Fe,engraver_text:ie,icon:null}:Fe))},maxLength:7,placeholder:"Max 7 chars",className:"mt-1 h-10 w-full rounded-xl border border-border bg-background px-3 text-sm"})]}),i.jsxs("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"checkbox",id:`is-rocker-${R.index}`,checked:R.is_rocker,onChange:Y=>{const ie=Y.target.checked;q(be=>be.map(Fe=>Fe.index===R.index?{...Fe,is_rocker:ie}:Fe))}}),i.jsx(le,{htmlFor:`is-rocker-${R.index}`,className:"text-sm font-medium text-muted-foreground",children:"É Rocker?"})]}),R.is_rocker&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(le,{className:"text-sm font-medium text-muted-foreground",children:"Estilo:"}),i.jsxs(vr,{value:R.rocker_style,onValueChange:Y=>{q(ie=>ie.map(be=>be.index===R.index?{...be,rocker_style:Y}:be))},children:[i.jsx(ar,{className:"h-8 text-sm rounded-lg w-[120px]",children:i.jsx(yr,{})}),i.jsxs(lr,{children:[i.jsx(ne,{value:"up-down",children:"Sobe/Desce"}),i.jsx(ne,{value:"left-right",children:"Esq/Dir"}),i.jsx(ne,{value:"previous-next",children:"Ant/Prox"})]})]})]})]})]},R.index))}),i.jsxs("div",{className:"flex flex-col sm:flex-row justify-end gap-2 mt-6",children:[i.jsx(de,{type:"button",variant:"ghost",onClick:oe,className:"order-2 sm:order-1",children:"Cancelar"}),i.jsx(de,{onClick:Ve,disabled:W,className:"order-1 sm:order-2",children:W?"Salvando...":"Salvar"})]})]})})})]})})}function H8(e,t){return f.useReducer((r,n)=>t[r][n]??r,e)}var ly="ScrollArea",[u_,$B]=Wn(ly),[W8,rn]=u_(ly),d_=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...a}=e,[l,c]=f.useState(null),[u,d]=f.useState(null),[h,m]=f.useState(null),[p,b]=f.useState(null),[g,y]=f.useState(null),[v,x]=f.useState(0),[w,j]=f.useState(0),[S,N]=f.useState(!1),[C,_]=f.useState(!1),$=ze(t,z=>c(z)),D=ny(s);return i.jsx(W8,{scope:r,type:n,dir:D,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:h,onContentChange:m,scrollbarX:p,onScrollbarXChange:b,scrollbarXEnabled:S,onScrollbarXEnabledChange:N,scrollbarY:g,onScrollbarYChange:y,scrollbarYEnabled:C,onScrollbarYEnabledChange:_,onCornerWidthChange:x,onCornerHeightChange:j,children:i.jsx(Te.div,{dir:D,...a,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});d_.displayName=ly;var f_="ScrollAreaViewport",h_=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,a=rn(f_,r),l=f.useRef(null),c=ze(t,l,a.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),i.jsx(Te.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});h_.displayName=f_;var Gn="ScrollAreaScrollbar",cy=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=rn(Gn,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,l=e.orientation==="horizontal";return f.useEffect(()=>(l?o(!0):a(!0),()=>{l?o(!1):a(!1)}),[l,o,a]),s.type==="hover"?i.jsx(K8,{...n,ref:t,forceMount:r}):s.type==="scroll"?i.jsx(q8,{...n,ref:t,forceMount:r}):s.type==="auto"?i.jsx(m_,{...n,ref:t,forceMount:r}):s.type==="always"?i.jsx(uy,{...n,ref:t}):null});cy.displayName=Gn;var K8=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=rn(Gn,e.__scopeScrollArea),[o,a]=f.useState(!1);return f.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx($r,{present:r||o,children:i.jsx(m_,{"data-state":o?"visible":"hidden",...n,ref:t})})}),q8=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=rn(Gn,e.__scopeScrollArea),o=e.orientation==="horizontal",a=Xf(()=>c("SCROLL_END"),100),[l,c]=H8("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return f.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,s.scrollHideDelay,c]),f.useEffect(()=>{const u=s.viewport,d=o?"scrollLeft":"scrollTop";if(u){let h=u[d];const m=()=>{const p=u[d];h!==p&&(c("SCROLL"),a()),h=p};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[s.viewport,o,c,a]),i.jsx($r,{present:r||l!=="hidden",children:i.jsx(uy,{"data-state":l==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),m_=f.forwardRef((e,t)=>{const r=rn(Gn,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,a]=f.useState(!1),l=e.orientation==="horizontal",c=Xf(()=>{if(r.viewport){const u=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,s=rn(Gn,e.__scopeScrollArea),o=f.useRef(null),a=f.useRef(0),[l,c]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=y_(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:m=>a.current=m};function h(m,p){return J8(m,a.current,l,p)}return r==="horizontal"?i.jsx(G8,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollLeft,p=s1(m,l,s.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollLeft=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollLeft=h(m,s.dir))}}):r==="vertical"?i.jsx(Q8,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollTop,p=s1(m,l);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollTop=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollTop=h(m))}}):null}),G8=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=rn(Gn,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),u=ze(t,c,o.onScrollbarXChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(g_,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Yf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(o.viewport){const m=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),w_(m,h)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Yd(a.paddingLeft),paddingEnd:Yd(a.paddingRight)}})}})}),Q8=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=rn(Gn,e.__scopeScrollArea),[a,l]=f.useState(),c=f.useRef(null),u=ze(t,c,o.onScrollbarYChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(g_,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Yf(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(o.viewport){const m=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),w_(m,h)&&d.preventDefault()}},onResize:()=>{c.current&&o.viewport&&a&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Yd(a.paddingTop),paddingEnd:Yd(a.paddingBottom)}})}})}),[Z8,p_]=u_(Gn),g_=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:h,...m}=e,p=rn(Gn,r),[b,g]=f.useState(null),y=ze(t,$=>g($)),v=f.useRef(null),x=f.useRef(""),w=p.viewport,j=n.content-n.viewport,S=Vt(d),N=Vt(c),C=Xf(h,10);function _($){if(v.current){const D=$.clientX-v.current.left,z=$.clientY-v.current.top;u({x:D,y:z})}}return f.useEffect(()=>{const $=D=>{const z=D.target;(b==null?void 0:b.contains(z))&&S(D,j)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[w,b,j,S]),f.useEffect(N,[n,N]),Ba(b,C),Ba(p.content,C),i.jsx(Z8,{scope:r,scrollbar:b,hasThumb:s,onThumbChange:Vt(o),onThumbPointerUp:Vt(a),onThumbPositionChange:N,onThumbPointerDown:Vt(l),children:i.jsx(Te.div,{...m,ref:y,style:{position:"absolute",...m.style},onPointerDown:ke(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),v.current=b.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),_($))}),onPointerMove:ke(e.onPointerMove,_),onPointerUp:ke(e.onPointerUp,$=>{const D=$.target;D.hasPointerCapture($.pointerId)&&D.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})})}),Zd="ScrollAreaThumb",x_=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=p_(Zd,e.__scopeScrollArea);return i.jsx($r,{present:r||s.hasThumb,children:i.jsx(Y8,{ref:t,...n})})}),Y8=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=rn(Zd,r),a=p_(Zd,r),{onThumbPositionChange:l}=a,c=ze(t,h=>a.onThumbChange(h)),u=f.useRef(void 0),d=Xf(()=>{u.current&&(u.current(),u.current=void 0)},100);return f.useEffect(()=>{const h=o.viewport;if(h){const m=()=>{if(d(),!u.current){const p=ez(h,l);u.current=p,l()}};return l(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[o.viewport,d,l]),i.jsx(Te.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ke(e.onPointerDownCapture,h=>{const p=h.target.getBoundingClientRect(),b=h.clientX-p.left,g=h.clientY-p.top;a.onThumbPointerDown({x:b,y:g})}),onPointerUp:ke(e.onPointerUp,a.onThumbPointerUp)})});x_.displayName=Zd;var dy="ScrollAreaCorner",v_=f.forwardRef((e,t)=>{const r=rn(dy,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?i.jsx(X8,{...e,ref:t}):null});v_.displayName=dy;var X8=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=rn(dy,r),[o,a]=f.useState(0),[l,c]=f.useState(0),u=!!(o&&l);return Ba(s.scrollbarX,()=>{var h;const d=((h=s.scrollbarX)==null?void 0:h.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),Ba(s.scrollbarY,()=>{var h;const d=((h=s.scrollbarY)==null?void 0:h.offsetWidth)||0;s.onCornerWidthChange(d),a(d)}),u?i.jsx(Te.div,{...n,ref:t,style:{width:o,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Yd(e){return e?parseInt(e,10):0}function y_(e,t){const r=e/t;return isNaN(r)?0:r}function Yf(e){const t=y_(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function J8(e,t,r,n="ltr"){const s=Yf(r),o=s/2,a=t||o,l=s-a,c=r.scrollbar.paddingStart+a,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,h=n==="ltr"?[0,d]:[d*-1,0];return b_([c,u],h)(e)}function s1(e,t,r="ltr"){const n=Yf(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,a=t.content-t.viewport,l=o-n,c=r==="ltr"?[0,a]:[a*-1,0],u=Tc(e,c);return b_([0,a],[0,l])(u)}function b_(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function w_(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},a=r.left!==o.left,l=r.top!==o.top;(a||l)&&t(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function Xf(e,t){const r=Vt(e),n=f.useRef(0);return f.useEffect(()=>()=>window.clearTimeout(n.current),[]),f.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Ba(e,t){const r=Vt(t);zt(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var j_=d_,tz=h_,rz=v_;const fy=f.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(j_,{ref:n,className:he("relative overflow-hidden",e),...r,children:[i.jsx(tz,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(S_,{}),i.jsx(rz,{})]}));fy.displayName=j_.displayName;const S_=f.forwardRef(({className:e,orientation:t="vertical",...r},n)=>i.jsx(cy,{ref:n,orientation:t,className:he("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:i.jsx(x_,{className:"relative flex-1 rounded-full bg-border"})}));S_.displayName=cy.displayName;const Jf="cenas";async function nz(){const e=await fetch("/api/cenas");if(!e.ok)throw new Error("Falha ao buscar cenas");return(await e.json()).cenas}async function sz(e){const t=await fetch("/api/cenas",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Falha ao criar cena")}return(await t.json()).cena}async function oz({id:e,...t}){const r=await fetch(`/api/cenas/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){const s=await r.json();throw new Error(s.error||"Falha ao atualizar cena")}return(await r.json()).cena}async function iz(e){const t=await fetch(`/api/cenas/${e}`,{method:"DELETE"});if(!t.ok){const r=await t.json();throw new Error(r.error||"Falha ao excluir cena")}}const az=()=>lD({queryKey:[Jf],queryFn:nz,staleTime:1e3*60*5}),lz=()=>{const e=Wc();return uv({mutationFn:sz,onSuccess:()=>{e.invalidateQueries({queryKey:[Jf]}),co({title:"Sucesso!",description:"Cena criada com sucesso."})},onError:t=>{co({title:"Erro",description:t.message||"Não foi possível criar a cena.",variant:"destructive"})}})},cz=()=>{const e=Wc();return uv({mutationFn:oz,onSuccess:()=>{e.invalidateQueries({queryKey:[Jf]}),co({title:"Sucesso!",description:"Cena atualizada com sucesso."})},onError:t=>{co({title:"Erro",description:t.message||"Não foi possível atualizar a cena.",variant:"destructive"})}})},uz=()=>{const e=Wc();return uv({mutationFn:({id:t})=>iz(t),onSuccess:()=>{e.invalidateQueries({queryKey:[Jf]}),co({title:"Sucesso!",description:"Cena excluída com sucesso."})},onError:t=>{co({title:"Erro",description:t.message||"Não foi possível excluir a cena.",variant:"destructive"})}})};var Jc=e=>e.type==="checkbox",Vo=e=>e instanceof Date,or=e=>e==null;const N_=e=>typeof e=="object";var At=e=>!or(e)&&!Array.isArray(e)&&N_(e)&&!Vo(e),C_=e=>At(e)&&e.target?Jc(e.target)?e.target.checked:e.target.value:e,dz=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,k_=(e,t)=>e.has(dz(t)),fz=e=>{const t=e.constructor&&e.constructor.prototype;return At(t)&&t.hasOwnProperty("isPrototypeOf")},hy=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ut(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(hy&&(e instanceof Blob||n))&&(r||At(e)))if(t=r?[]:{},!r&&!fz(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=ut(e[s]));else return e;return t}var eh=e=>/^\w*$/.test(e),dt=e=>e===void 0,th=e=>Array.isArray(e)?e.filter(Boolean):[],my=e=>th(e.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(e,t,r)=>{if(!t||!At(e))return r;const n=(eh(t)?[t]:my(t)).reduce((s,o)=>or(s)?s:s[o],e);return dt(n)||n===e?dt(e[t])?r:e[t]:n},Pr=e=>typeof e=="boolean",Je=(e,t,r)=>{let n=-1;const s=eh(t)?[t]:my(t),o=s.length,a=o-1;for(;++nU.useContext(py),hz=e=>{const{children:t,...r}=e;return U.createElement(py.Provider,{value:r},t)};var E_=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==qr.all&&(t._proxyFormState[a]=!n||qr.all),r&&(r[a]=!0),e[a]}});return s};const rh=typeof window<"u"?U.useLayoutEffect:U.useEffect;function mz(e){const t=eu(),{control:r=t.control,disabled:n,name:s,exact:o}=e||{},[a,l]=U.useState(r._formState),c=U.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return rh(()=>r._subscribe({name:s,formState:c.current,exact:o,callback:u=>{!n&&l({...r._formState,...u})}}),[s,n,o]),U.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),U.useMemo(()=>E_(a,r,c.current,!1),[a,r])}var Dn=e=>typeof e=="string",__=(e,t,r,n,s)=>Dn(e)?(n&&t.watch.add(e),fe(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),fe(r,o))):(n&&(t.watchAll=!0),r),Eg=e=>or(e)||!N_(e);function rs(e,t,r=new WeakSet){if(Eg(e)||Eg(t))return e===t;if(Vo(e)&&Vo(t))return e.getTime()===t.getTime();const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const a=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const l=t[o];if(Vo(a)&&Vo(l)||At(a)&&At(l)||Array.isArray(a)&&Array.isArray(l)?!rs(a,l,r):a!==l)return!1}}return!0}function nh(e){const t=eu(),{control:r=t.control,name:n,defaultValue:s,disabled:o,exact:a,compute:l}=e||{},c=U.useRef(s),u=U.useRef(l),d=U.useRef(void 0);u.current=l;const h=U.useMemo(()=>r._getWatch(n,c.current),[r,n]),[m,p]=U.useState(u.current?u.current(h):h);return rh(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:b=>{if(!o){const g=__(n,r._names,b.values||r._formValues,!1,c.current);if(u.current){const y=u.current(g);rs(y,d.current)||(p(y),d.current=y)}else p(g)}}}),[r,o,n,a]),U.useEffect(()=>r._removeUnmounted()),m}function pz(e){const t=eu(),{name:r,disabled:n,control:s=t.control,shouldUnregister:o,defaultValue:a}=e,l=k_(s._names.array,r),c=U.useMemo(()=>fe(s._formValues,r,fe(s._defaultValues,r,a)),[s,r,a]),u=nh({control:s,name:r,defaultValue:c,exact:!0}),d=mz({control:s,name:r,exact:!0}),h=U.useRef(e),m=U.useRef(s.register(r,{...e.rules,value:u,...Pr(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const p=U.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!fe(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!fe(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!fe(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!fe(d.validatingFields,r)},error:{enumerable:!0,get:()=>fe(d.errors,r)}}),[d,r]),b=U.useCallback(x=>m.current.onChange({target:{value:C_(x),name:r},type:Xd.CHANGE}),[r]),g=U.useCallback(()=>m.current.onBlur({target:{value:fe(s._formValues,r),name:r},type:Xd.BLUR}),[r,s._formValues]),y=U.useCallback(x=>{const w=fe(s._fields,r);w&&x&&(w._f.ref={focus:()=>x.focus&&x.focus(),select:()=>x.select&&x.select(),setCustomValidity:j=>x.setCustomValidity(j),reportValidity:()=>x.reportValidity()})},[s._fields,r]),v=U.useMemo(()=>({name:r,value:u,...Pr(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:b,onBlur:g,ref:y}),[r,n,d.disabled,b,g,y,u]);return U.useEffect(()=>{const x=s._options.shouldUnregister||o;s.register(r,{...h.current.rules,...Pr(h.current.disabled)?{disabled:h.current.disabled}:{}});const w=(j,S)=>{const N=fe(s._fields,j);N&&N._f&&(N._f.mount=S)};if(w(r,!0),x){const j=ut(fe(s._options.defaultValues,r));Je(s._defaultValues,r,j),dt(fe(s._formValues,r))&&Je(s._formValues,r,j)}return!l&&s.register(r),()=>{(l?x&&!s._state.action:x)?s.unregister(r):w(r,!1)}},[r,s,l,o]),U.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),U.useMemo(()=>({field:v,formState:d,fieldState:p}),[v,d,p])}const gy=e=>e.render(pz(e));var T_=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},br=e=>Array.isArray(e)?e:[e],o1=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},rr=e=>At(e)&&!Object.keys(e).length,xy=e=>e.type==="file",yn=e=>typeof e=="function",Jd=e=>{if(!hy)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},P_=e=>e.type==="select-multiple",vy=e=>e.type==="radio",gz=e=>vy(e)||Jc(e),pm=e=>Jd(e)&&e.isConnected;function xz(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(yn(e[t]))return!0;return!1};function ef(e,t={}){const r=Array.isArray(e);if(At(e)||r)for(const n in e)Array.isArray(e[n])||At(e[n])&&!A_(e[n])?(t[n]=Array.isArray(e[n])?[]:{},ef(e[n],t[n])):or(e[n])||(t[n]=!0);return t}function R_(e,t,r){const n=Array.isArray(e);if(At(e)||n)for(const s in e)Array.isArray(e[s])||At(e[s])&&!A_(e[s])?dt(t)||Eg(r[s])?r[s]=Array.isArray(e[s])?ef(e[s],[]):{...ef(e[s])}:R_(e[s],or(t)?{}:t[s],r[s]):r[s]=!rs(e[s],t[s]);return r}var Cl=(e,t)=>R_(e,t,ef(t));const i1={value:!1,isValid:!1},a1={value:!0,isValid:!0};var M_=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!dt(e[0].attributes.value)?dt(e[0].value)||e[0].value===""?a1:{value:e[0].value,isValid:!0}:a1:i1}return i1},O_=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>dt(e)?e:t?e===""?NaN:e&&+e:r&&Dn(e)?new Date(e):n?n(e):e;const l1={isValid:!1,value:null};var D_=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,l1):l1;function c1(e){const t=e.ref;return xy(t)?t.files:vy(t)?D_(e.refs).value:P_(t)?[...t.selectedOptions].map(({value:r})=>r):Jc(t)?M_(e.refs).value:O_(dt(t.value)?e.ref.value:t.value,e)}var yz=(e,t,r,n)=>{const s={};for(const o of e){const a=fe(t,o);a&&Je(s,o,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},tf=e=>e instanceof RegExp,kl=e=>dt(e)?e:tf(e)?e.source:At(e)?tf(e.value)?e.value.source:e.value:e,ra=e=>({isOnSubmit:!e||e===qr.onSubmit,isOnBlur:e===qr.onBlur,isOnChange:e===qr.onChange,isOnAll:e===qr.all,isOnTouch:e===qr.onTouched});const u1="AsyncFunction";var bz=e=>!!e&&!!e.validate&&!!(yn(e.validate)&&e.validate.constructor.name===u1||At(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===u1)),wz=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),_g=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const ma=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=fe(e,s);if(o){const{_f:a,...l}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(ma(l,t))break}else if(At(l)&&ma(l,t))break}}};function d1(e,t,r){const n=fe(e,r);if(n||eh(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),a=fe(t,o),l=fe(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(l&&l.type)return{name:o,error:l};if(l&&l.root&&l.root.type)return{name:`${o}.root`,error:l.root};s.pop()}return{name:r}}var jz=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return rr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||qr.all))},Sz=(e,t,r)=>!e||!t||e===t||br(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),Nz=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,Cz=(e,t)=>!th(fe(e,t)).length&&Et(e,t),I_=(e,t,r)=>{const n=br(fe(e,r));return Je(n,"root",t[r]),Je(e,r,n),e},id=e=>Dn(e);function f1(e,t,r="validate"){if(id(e)||Array.isArray(e)&&e.every(id)||Pr(e)&&!e)return{type:r,message:id(e)?e:"",ref:t}}var Di=e=>At(e)&&!tf(e)?e:{value:e,message:""},Tg=async(e,t,r,n,s,o)=>{const{ref:a,refs:l,required:c,maxLength:u,minLength:d,min:h,max:m,pattern:p,validate:b,name:g,valueAsNumber:y,mount:v}=e._f,x=fe(r,g);if(!v||t.has(g))return{};const w=l?l[0]:a,j=T=>{s&&w.reportValidity&&(w.setCustomValidity(Pr(T)?"":T||""),w.reportValidity())},S={},N=vy(a),C=Jc(a),_=N||C,$=(y||xy(a))&&dt(a.value)&&dt(x)||Jd(a)&&a.value===""||x===""||Array.isArray(x)&&!x.length,D=T_.bind(null,g,n,S),z=(T,L,M,B=Zn.maxLength,W=Zn.minLength)=>{const H=T?L:M;S[g]={type:T?B:W,message:H,ref:a,...D(T?B:W,H)}};if(o?!Array.isArray(x)||!x.length:c&&(!_&&($||or(x))||Pr(x)&&!x||C&&!M_(l).isValid||N&&!D_(l).isValid)){const{value:T,message:L}=id(c)?{value:!!c,message:c}:Di(c);if(T&&(S[g]={type:Zn.required,message:L,ref:w,...D(Zn.required,L)},!n))return j(L),S}if(!$&&(!or(h)||!or(m))){let T,L;const M=Di(m),B=Di(h);if(!or(x)&&!isNaN(x)){const W=a.valueAsNumber||x&&+x;or(M.value)||(T=W>M.value),or(B.value)||(L=Wnew Date(new Date().toDateString()+" "+I),A=a.type=="time",E=a.type=="week";Dn(M.value)&&x&&(T=A?H(x)>H(M.value):E?x>M.value:W>new Date(M.value)),Dn(B.value)&&x&&(L=A?H(x)+T.value,B=!or(L.value)&&x.length<+L.value;if((M||B)&&(z(M,T.message,L.message),!n))return j(S[g].message),S}if(p&&!$&&Dn(x)){const{value:T,message:L}=Di(p);if(tf(T)&&!x.match(T)&&(S[g]={type:Zn.pattern,message:L,ref:a,...D(Zn.pattern,L)},!n))return j(L),S}if(b){if(yn(b)){const T=await b(x,r),L=f1(T,w);if(L&&(S[g]={...L,...D(Zn.validate,L.message)},!n))return j(L.message),S}else if(At(b)){let T={};for(const L in b){if(!rr(T)&&!n)break;const M=f1(await b[L](x,r),w,L);M&&(T={...M,...D(L,M.message)},j(M.message),n&&(S[g]=T))}if(!rr(T)&&(S[g]={ref:w,...T},!n))return S}}return j(!0),S};const kz={mode:qr.onSubmit,reValidateMode:qr.onChange,shouldFocusError:!0};function Ez(e={}){let t={...kz,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:yn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=At(t.defaultValues)||At(t.values)?ut(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:ut(s),a={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...d};const m={array:o1(),state:o1()},p=t.criteriaMode===qr.all,b=k=>V=>{clearTimeout(u),u=setTimeout(k,V)},g=async k=>{if(!t.disabled&&(d.isValid||h.isValid||k)){const V=t.resolver?rr((await C()).errors):await $(n,!0);V!==r.isValid&&m.state.next({isValid:V})}},y=(k,V)=>{!t.disabled&&(d.isValidating||d.validatingFields||h.isValidating||h.validatingFields)&&((k||Array.from(l.mount)).forEach(K=>{K&&(V?Je(r.validatingFields,K,V):Et(r.validatingFields,K))}),m.state.next({validatingFields:r.validatingFields,isValidating:!rr(r.validatingFields)}))},v=(k,V=[],K,ue,oe=!0,re=!0)=>{if(ue&&K&&!t.disabled){if(a.action=!0,re&&Array.isArray(fe(n,k))){const me=K(fe(n,k),ue.argA,ue.argB);oe&&Je(n,k,me)}if(re&&Array.isArray(fe(r.errors,k))){const me=K(fe(r.errors,k),ue.argA,ue.argB);oe&&Je(r.errors,k,me),Cz(r.errors,k)}if((d.touchedFields||h.touchedFields)&&re&&Array.isArray(fe(r.touchedFields,k))){const me=K(fe(r.touchedFields,k),ue.argA,ue.argB);oe&&Je(r.touchedFields,k,me)}(d.dirtyFields||h.dirtyFields)&&(r.dirtyFields=Cl(s,o)),m.state.next({name:k,isDirty:z(k,V),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Je(o,k,V)},x=(k,V)=>{Je(r.errors,k,V),m.state.next({errors:r.errors})},w=k=>{r.errors=k,m.state.next({errors:r.errors,isValid:!1})},j=(k,V,K,ue)=>{const oe=fe(n,k);if(oe){const re=fe(o,k,dt(K)?fe(s,k):K);dt(re)||ue&&ue.defaultChecked||V?Je(o,k,V?re:c1(oe._f)):M(k,re),a.mount&&g()}},S=(k,V,K,ue,oe)=>{let re=!1,me=!1;const Ve={name:k};if(!t.disabled){if(!K||ue){(d.isDirty||h.isDirty)&&(me=r.isDirty,r.isDirty=Ve.isDirty=z(),re=me!==Ve.isDirty);const Ge=rs(fe(s,k),V);me=!!fe(r.dirtyFields,k),Ge?Et(r.dirtyFields,k):Je(r.dirtyFields,k,!0),Ve.dirtyFields=r.dirtyFields,re=re||(d.dirtyFields||h.dirtyFields)&&me!==!Ge}if(K){const Ge=fe(r.touchedFields,k);Ge||(Je(r.touchedFields,k,K),Ve.touchedFields=r.touchedFields,re=re||(d.touchedFields||h.touchedFields)&&Ge!==K)}re&&oe&&m.state.next(Ve)}return re?Ve:{}},N=(k,V,K,ue)=>{const oe=fe(r.errors,k),re=(d.isValid||h.isValid)&&Pr(V)&&r.isValid!==V;if(t.delayError&&K?(c=b(()=>x(k,K)),c(t.delayError)):(clearTimeout(u),c=null,K?Je(r.errors,k,K):Et(r.errors,k)),(K?!rs(oe,K):oe)||!rr(ue)||re){const me={...ue,...re&&Pr(V)?{isValid:V}:{},errors:r.errors,name:k};r={...r,...me},m.state.next(me)}},C=async k=>{y(k,!0);const V=await t.resolver(o,t.context,yz(k||l.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return y(k),V},_=async k=>{const{errors:V}=await C(k);if(k)for(const K of k){const ue=fe(V,K);ue?Je(r.errors,K,ue):Et(r.errors,K)}else r.errors=V;return V},$=async(k,V,K={valid:!0})=>{for(const ue in k){const oe=k[ue];if(oe){const{_f:re,...me}=oe;if(re){const Ve=l.array.has(re.name),Ge=oe._f&&bz(oe._f);Ge&&d.validatingFields&&y([ue],!0);const R=await Tg(oe,l.disabled,o,p,t.shouldUseNativeValidation&&!V,Ve);if(Ge&&d.validatingFields&&y([ue]),R[re.name]&&(K.valid=!1,V))break;!V&&(fe(R,re.name)?Ve?I_(r.errors,R,re.name):Je(r.errors,re.name,R[re.name]):Et(r.errors,re.name))}!rr(me)&&await $(me,V,K)}}return K.valid},D=()=>{for(const k of l.unMount){const V=fe(n,k);V&&(V._f.refs?V._f.refs.every(K=>!pm(K)):!pm(V._f.ref))&&G(k)}l.unMount=new Set},z=(k,V)=>!t.disabled&&(k&&V&&Je(o,k,V),!rs(I(),s)),T=(k,V,K)=>__(k,l,{...a.mount?o:dt(V)?s:Dn(k)?{[k]:V}:V},K,V),L=k=>th(fe(a.mount?o:s,k,t.shouldUnregister?fe(s,k,[]):[])),M=(k,V,K={})=>{const ue=fe(n,k);let oe=V;if(ue){const re=ue._f;re&&(!re.disabled&&Je(o,k,O_(V,re)),oe=Jd(re.ref)&&or(V)?"":V,P_(re.ref)?[...re.ref.options].forEach(me=>me.selected=oe.includes(me.value)):re.refs?Jc(re.ref)?re.refs.forEach(me=>{(!me.defaultChecked||!me.disabled)&&(Array.isArray(oe)?me.checked=!!oe.find(Ve=>Ve===me.value):me.checked=oe===me.value||!!oe)}):re.refs.forEach(me=>me.checked=me.value===oe):xy(re.ref)?re.ref.value="":(re.ref.value=oe,re.ref.type||m.state.next({name:k,values:ut(o)})))}(K.shouldDirty||K.shouldTouch)&&S(k,oe,K.shouldTouch,K.shouldDirty,!0),K.shouldValidate&&E(k)},B=(k,V,K)=>{for(const ue in V){if(!V.hasOwnProperty(ue))return;const oe=V[ue],re=k+"."+ue,me=fe(n,re);(l.array.has(k)||At(oe)||me&&!me._f)&&!Vo(oe)?B(re,oe,K):M(re,oe,K)}},W=(k,V,K={})=>{const ue=fe(n,k),oe=l.array.has(k),re=ut(V);Je(o,k,re),oe?(m.array.next({name:k,values:ut(o)}),(d.isDirty||d.dirtyFields||h.isDirty||h.dirtyFields)&&K.shouldDirty&&m.state.next({name:k,dirtyFields:Cl(s,o),isDirty:z(k,re)})):ue&&!ue._f&&!or(re)?B(k,re,K):M(k,re,K),_g(k,l)&&m.state.next({...r,name:k}),m.state.next({name:a.mount?k:void 0,values:ut(o)})},H=async k=>{a.mount=!0;const V=k.target;let K=V.name,ue=!0;const oe=fe(n,K),re=Ge=>{ue=Number.isNaN(Ge)||Vo(Ge)&&isNaN(Ge.getTime())||rs(Ge,fe(o,K,Ge))},me=ra(t.mode),Ve=ra(t.reValidateMode);if(oe){let Ge,R;const Y=V.type?c1(oe._f):C_(k),ie=k.type===Xd.BLUR||k.type===Xd.FOCUS_OUT,be=!wz(oe._f)&&!t.resolver&&!fe(r.errors,K)&&!oe._f.deps||Nz(ie,fe(r.touchedFields,K),r.isSubmitted,Ve,me),Fe=_g(K,l,ie);Je(o,K,Y),ie?(oe._f.onBlur&&oe._f.onBlur(k),c&&c(0)):oe._f.onChange&&oe._f.onChange(k);const Be=S(K,Y,ie),Ke=!rr(Be)||Fe;if(!ie&&m.state.next({name:K,type:k.type,values:ut(o)}),be)return(d.isValid||h.isValid)&&(t.mode==="onBlur"?ie&&g():ie||g()),Ke&&m.state.next({name:K,...Fe?{}:Be});if(!ie&&Fe&&m.state.next({...r}),t.resolver){const{errors:nt}=await C([K]);if(re(Y),ue){const xt=d1(r.errors,n,K),_r=d1(nt,n,xt.name||K);Ge=_r.error,K=_r.name,R=rr(nt)}}else y([K],!0),Ge=(await Tg(oe,l.disabled,o,p,t.shouldUseNativeValidation))[K],y([K]),re(Y),ue&&(Ge?R=!1:(d.isValid||h.isValid)&&(R=await $(n,!0)));ue&&(oe._f.deps&&E(oe._f.deps),N(K,R,Ge,Be))}},A=(k,V)=>{if(fe(r.errors,V)&&k.focus)return k.focus(),1},E=async(k,V={})=>{let K,ue;const oe=br(k);if(t.resolver){const re=await _(dt(k)?k:oe);K=rr(re),ue=k?!oe.some(me=>fe(re,me)):K}else k?(ue=(await Promise.all(oe.map(async re=>{const me=fe(n,re);return await $(me&&me._f?{[re]:me}:me)}))).every(Boolean),!(!ue&&!r.isValid)&&g()):ue=K=await $(n);return m.state.next({...!Dn(k)||(d.isValid||h.isValid)&&K!==r.isValid?{}:{name:k},...t.resolver||!k?{isValid:K}:{},errors:r.errors}),V.shouldFocus&&!ue&&ma(n,A,k?oe:l.mount),ue},I=k=>{const V={...a.mount?o:s};return dt(k)?V:Dn(k)?fe(V,k):k.map(K=>fe(V,K))},q=(k,V)=>({invalid:!!fe((V||r).errors,k),isDirty:!!fe((V||r).dirtyFields,k),error:fe((V||r).errors,k),isValidating:!!fe(r.validatingFields,k),isTouched:!!fe((V||r).touchedFields,k)}),F=k=>{k&&br(k).forEach(V=>Et(r.errors,V)),m.state.next({errors:k?r.errors:{}})},Z=(k,V,K)=>{const ue=(fe(n,k,{_f:{}})._f||{}).ref,oe=fe(r.errors,k)||{},{ref:re,message:me,type:Ve,...Ge}=oe;Je(r.errors,k,{...Ge,...V,ref:ue}),m.state.next({name:k,errors:r.errors,isValid:!1}),K&&K.shouldFocus&&ue&&ue.focus&&ue.focus()},X=(k,V)=>yn(k)?m.state.subscribe({next:K=>"values"in K&&k(T(void 0,V),K)}):T(k,V,!0),ee=k=>m.state.subscribe({next:V=>{Sz(k.name,V.name,k.exact)&&jz(V,k.formState||d,O,k.reRenderRoot)&&k.callback({values:{...o},...r,...V,defaultValues:s})}}).unsubscribe,xe=k=>(a.mount=!0,h={...h,...k.formState},ee({...k,formState:h})),G=(k,V={})=>{for(const K of k?br(k):l.mount)l.mount.delete(K),l.array.delete(K),V.keepValue||(Et(n,K),Et(o,K)),!V.keepError&&Et(r.errors,K),!V.keepDirty&&Et(r.dirtyFields,K),!V.keepTouched&&Et(r.touchedFields,K),!V.keepIsValidating&&Et(r.validatingFields,K),!t.shouldUnregister&&!V.keepDefaultValue&&Et(s,K);m.state.next({values:ut(o)}),m.state.next({...r,...V.keepDirty?{isDirty:z()}:{}}),!V.keepIsValid&&g()},Se=({disabled:k,name:V})=>{(Pr(k)&&a.mount||k||l.disabled.has(V))&&(k?l.disabled.add(V):l.disabled.delete(V))},Ae=(k,V={})=>{let K=fe(n,k);const ue=Pr(V.disabled)||Pr(t.disabled);return Je(n,k,{...K||{},_f:{...K&&K._f?K._f:{ref:{name:k}},name:k,mount:!0,...V}}),l.mount.add(k),K?Se({disabled:Pr(V.disabled)?V.disabled:t.disabled,name:k}):j(k,!0,V.value),{...ue?{disabled:V.disabled||t.disabled}:{},...t.progressive?{required:!!V.required,min:kl(V.min),max:kl(V.max),minLength:kl(V.minLength),maxLength:kl(V.maxLength),pattern:kl(V.pattern)}:{},name:k,onChange:H,onBlur:H,ref:oe=>{if(oe){Ae(k,V),K=fe(n,k);const re=dt(oe.value)&&oe.querySelectorAll&&oe.querySelectorAll("input,select,textarea")[0]||oe,me=gz(re),Ve=K._f.refs||[];if(me?Ve.find(Ge=>Ge===re):re===K._f.ref)return;Je(n,k,{_f:{...K._f,...me?{refs:[...Ve.filter(pm),re,...Array.isArray(fe(s,k))?[{}]:[]],ref:{type:re.type,name:k}}:{ref:re}}}),j(k,!1,void 0,re)}else K=fe(n,k,{}),K._f&&(K._f.mount=!1),(t.shouldUnregister||V.shouldUnregister)&&!(k_(l.array,k)&&a.action)&&l.unMount.add(k)}}},Re=()=>t.shouldFocusError&&ma(n,A,l.mount),se=k=>{Pr(k)&&(m.state.next({disabled:k}),ma(n,(V,K)=>{const ue=fe(n,K);ue&&(V.disabled=ue._f.disabled||k,Array.isArray(ue._f.refs)&&ue._f.refs.forEach(oe=>{oe.disabled=ue._f.disabled||k}))},0,!1))},we=(k,V)=>async K=>{let ue;K&&(K.preventDefault&&K.preventDefault(),K.persist&&K.persist());let oe=ut(o);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:re,values:me}=await C();r.errors=re,oe=ut(me)}else await $(n);if(l.disabled.size)for(const re of l.disabled)Et(oe,re);if(Et(r.errors,"root"),rr(r.errors)){m.state.next({errors:{}});try{await k(oe,K)}catch(re){ue=re}}else V&&await V({...r.errors},K),Re(),setTimeout(Re);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:rr(r.errors)&&!ue,submitCount:r.submitCount+1,errors:r.errors}),ue)throw ue},ve=(k,V={})=>{fe(n,k)&&(dt(V.defaultValue)?W(k,ut(fe(s,k))):(W(k,V.defaultValue),Je(s,k,ut(V.defaultValue))),V.keepTouched||Et(r.touchedFields,k),V.keepDirty||(Et(r.dirtyFields,k),r.isDirty=V.defaultValue?z(k,ut(fe(s,k))):z()),V.keepError||(Et(r.errors,k),d.isValid&&g()),m.state.next({...r}))},Xe=(k,V={})=>{const K=k?ut(k):s,ue=ut(K),oe=rr(k),re=oe?s:ue;if(V.keepDefaultValues||(s=K),!V.keepValues){if(V.keepDirtyValues){const me=new Set([...l.mount,...Object.keys(Cl(s,o))]);for(const Ve of Array.from(me))fe(r.dirtyFields,Ve)?Je(re,Ve,fe(o,Ve)):W(Ve,fe(re,Ve))}else{if(hy&&dt(k))for(const me of l.mount){const Ve=fe(n,me);if(Ve&&Ve._f){const Ge=Array.isArray(Ve._f.refs)?Ve._f.refs[0]:Ve._f.ref;if(Jd(Ge)){const R=Ge.closest("form");if(R){R.reset();break}}}}if(V.keepFieldsRef)for(const me of l.mount)W(me,fe(re,me));else n={}}o=t.shouldUnregister?V.keepDefaultValues?ut(s):{}:ut(re),m.array.next({values:{...re}}),m.state.next({values:{...re}})}l={mount:V.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!V.keepIsValid||!!V.keepDirtyValues,a.watch=!!t.shouldUnregister,m.state.next({submitCount:V.keepSubmitCount?r.submitCount:0,isDirty:oe?!1:V.keepDirty?r.isDirty:!!(V.keepDefaultValues&&!rs(k,s)),isSubmitted:V.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:oe?{}:V.keepDirtyValues?V.keepDefaultValues&&o?Cl(s,o):r.dirtyFields:V.keepDefaultValues&&k?Cl(s,k):V.keepDirty?r.dirtyFields:{},touchedFields:V.keepTouched?r.touchedFields:{},errors:V.keepErrors?r.errors:{},isSubmitSuccessful:V.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Q=(k,V)=>Xe(yn(k)?k(o):k,V),ae=(k,V={})=>{const K=fe(n,k),ue=K&&K._f;if(ue){const oe=ue.refs?ue.refs[0]:ue.ref;oe.focus&&(oe.focus(),V.shouldSelect&&yn(oe.select)&&oe.select())}},O=k=>{r={...r,...k}},J={control:{register:Ae,unregister:G,getFieldState:q,handleSubmit:we,setError:Z,_subscribe:ee,_runSchema:C,_focusError:Re,_getWatch:T,_getDirty:z,_setValid:g,_setFieldArray:v,_setDisabledField:Se,_setErrors:w,_getFieldArray:L,_reset:Xe,_resetDefaultValues:()=>yn(t.defaultValues)&&t.defaultValues().then(k=>{Q(k,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:D,_disableForm:se,_subjects:m,_proxyFormState:d,get _fields(){return n},get _formValues(){return o},get _state(){return a},set _state(k){a=k},get _defaultValues(){return s},get _names(){return l},set _names(k){l=k},get _formState(){return r},get _options(){return t},set _options(k){t={...t,...k}}},subscribe:xe,trigger:E,register:Ae,handleSubmit:we,watch:X,setValue:W,getValues:I,reset:Q,resetField:ve,clearErrors:F,unregister:G,setError:Z,setFocus:ae,getFieldState:q};return{...J,formControl:J}}var Es=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},gm=(e,t,r={})=>r.shouldFocus||dt(r.shouldFocus)?r.focusName||`${e}.${dt(r.focusIndex)?t:r.focusIndex}.`:"",xm=(e,t)=>[...e,...br(t)],vm=e=>Array.isArray(e)?e.map(()=>{}):void 0;function ym(e,t,r){return[...e.slice(0,t),...br(r),...e.slice(t)]}var bm=(e,t,r)=>Array.isArray(e)?(dt(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],wm=(e,t)=>[...br(t),...br(e)];function _z(e,t){let r=0;const n=[...e];for(const s of t)n.splice(s-r,1),r++;return th(n).length?n:[]}var jm=(e,t)=>dt(t)?[]:_z(e,br(t).sort((r,n)=>r-n)),Sm=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},h1=(e,t,r)=>(e[t]=r,e);function L_(e){const t=eu(),{control:r=t.control,name:n,keyName:s="id",shouldUnregister:o,rules:a}=e,[l,c]=U.useState(r._getFieldArray(n)),u=U.useRef(r._getFieldArray(n).map(Es)),d=U.useRef(l),h=U.useRef(!1);d.current=l,r._names.array.add(n),U.useMemo(()=>a&&r.register(n,a),[r,a,n]),rh(()=>r._subjects.array.subscribe({next:({values:S,name:N})=>{if(N===n||!N){const C=fe(S,n);Array.isArray(C)&&(c(C),u.current=C.map(Es))}}}).unsubscribe,[r,n]);const m=U.useCallback(S=>{h.current=!0,r._setFieldArray(n,S)},[r,n]),p=(S,N)=>{const C=br(ut(S)),_=xm(r._getFieldArray(n),C);r._names.focus=gm(n,_.length-1,N),u.current=xm(u.current,C.map(Es)),m(_),c(_),r._setFieldArray(n,_,xm,{argA:vm(S)})},b=(S,N)=>{const C=br(ut(S)),_=wm(r._getFieldArray(n),C);r._names.focus=gm(n,0,N),u.current=wm(u.current,C.map(Es)),m(_),c(_),r._setFieldArray(n,_,wm,{argA:vm(S)})},g=S=>{const N=jm(r._getFieldArray(n),S);u.current=jm(u.current,S),m(N),c(N),!Array.isArray(fe(r._fields,n))&&Je(r._fields,n,void 0),r._setFieldArray(n,N,jm,{argA:S})},y=(S,N,C)=>{const _=br(ut(N)),$=ym(r._getFieldArray(n),S,_);r._names.focus=gm(n,S,C),u.current=ym(u.current,S,_.map(Es)),m($),c($),r._setFieldArray(n,$,ym,{argA:S,argB:vm(N)})},v=(S,N)=>{const C=r._getFieldArray(n);Sm(C,S,N),Sm(u.current,S,N),m(C),c(C),r._setFieldArray(n,C,Sm,{argA:S,argB:N},!1)},x=(S,N)=>{const C=r._getFieldArray(n);bm(C,S,N),bm(u.current,S,N),m(C),c(C),r._setFieldArray(n,C,bm,{argA:S,argB:N},!1)},w=(S,N)=>{const C=ut(N),_=h1(r._getFieldArray(n),S,C);u.current=[..._].map(($,D)=>!$||D===S?Es():u.current[D]),m(_),c([..._]),r._setFieldArray(n,_,h1,{argA:S,argB:C},!0,!1)},j=S=>{const N=br(ut(S));u.current=N.map(Es),m([...N]),c([...N]),r._setFieldArray(n,[...N],C=>C,{},!0,!1)};return U.useEffect(()=>{if(r._state.action=!1,_g(n,r._names)&&r._subjects.state.next({...r._formState}),h.current&&(!ra(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!ra(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(S=>{const N=fe(S.errors,n),C=fe(r._formState.errors,n);(C?!N&&C.type||N&&(C.type!==N.type||C.message!==N.message):N&&N.type)&&(N?Je(r._formState.errors,n,N):Et(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const S=fe(r._fields,n);S&&S._f&&!(ra(r._options.reValidateMode).isOnSubmit&&ra(r._options.mode).isOnSubmit)&&Tg(S,r._names.disabled,r._formValues,r._options.criteriaMode===qr.all,r._options.shouldUseNativeValidation,!0).then(N=>!rr(N)&&r._subjects.state.next({errors:I_(r._formState.errors,N,n)}))}r._subjects.state.next({name:n,values:ut(r._formValues)}),r._names.focus&&ma(r._fields,(S,N)=>{if(r._names.focus&&N.startsWith(r._names.focus)&&S.focus)return S.focus(),1}),r._names.focus="",r._setValid(),h.current=!1},[l,n,r]),U.useEffect(()=>(!fe(r._formValues,n)&&r._setFieldArray(n),()=>{const S=(N,C)=>{const _=fe(r._fields,N);_&&_._f&&(_._f.mount=C)};r._options.shouldUnregister||o?r.unregister(n):S(n,!1)}),[n,r,s,o]),{swap:U.useCallback(v,[m,n,r]),move:U.useCallback(x,[m,n,r]),prepend:U.useCallback(b,[m,n,r]),append:U.useCallback(p,[m,n,r]),remove:U.useCallback(g,[m,n,r]),insert:U.useCallback(y,[m,n,r]),update:U.useCallback(w,[m,n,r]),replace:U.useCallback(j,[m,n,r]),fields:U.useMemo(()=>l.map((S,N)=>({...S,[s]:u.current[N]||Es()})),[l,s])}}function Tz(e={}){const t=U.useRef(void 0),r=U.useRef(void 0),[n,s]=U.useState({isDirty:!1,isValidating:!1,isLoading:yn(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:yn(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!yn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...l}=Ez(e);t.current={...l,formState:n}}const o=t.current.control;return o._options=e,rh(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(l=>({...l,isReady:!0})),o._formState.isReady=!0,a},[o]),U.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),U.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),U.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),U.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),U.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==n.isDirty&&o._subjects.state.next({isDirty:a})}},[o,n.isDirty]),U.useEffect(()=>{e.values&&!rs(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),r.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),U.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=E_(n,o),t.current}const m1=(e,t,r)=>{if(e&&"reportValidity"in e){const n=fe(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},F_=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?m1(n.ref,r,e):n.refs&&n.refs.forEach(s=>m1(s,r,e))}},Pz=(e,t)=>{t.shouldUseNativeValidation&&F_(e,t);const r={};for(const n in e){const s=fe(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(Az(t.names||Object.keys(e),n)){const a=Object.assign({},fe(r,n));Je(a,"root",o),Je(r,n,a)}else Je(r,n,o)}return r},Az=(e,t)=>e.some(r=>r.startsWith(t+"."));var Rz=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,a=n.path.join(".");if(!r[a])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[a]={message:l.message,type:l.code}}else r[a]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(h){return e.push(h)})}),t){var c=r[a].types,u=c&&c[n.code];r[a]=T_(a,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r},Mz=function(e,t,r){return r===void 0&&(r={}),function(n,s,o){try{return Promise.resolve(function(a,l){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return o.shouldUseNativeValidation&&F_({},o),{errors:{},values:r.raw?n:u}})}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(a){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(a))return{values:{},errors:Pz(Rz(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},Ye;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),a={};for(const l of o)a[l]=s[l];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Ye||(Ye={}));var p1;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(p1||(p1={}));const Ce=Ye.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ms=e=>{switch(typeof e){case"undefined":return Ce.undefined;case"string":return Ce.string;case"number":return Number.isNaN(e)?Ce.nan:Ce.number;case"boolean":return Ce.boolean;case"function":return Ce.function;case"bigint":return Ce.bigint;case"symbol":return Ce.symbol;case"object":return Array.isArray(e)?Ce.array:e===null?Ce.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ce.promise:typeof Map<"u"&&e instanceof Map?Ce.map:typeof Set<"u"&&e instanceof Set?Ce.set:typeof Date<"u"&&e instanceof Date?Ce.date:Ce.object;default:return Ce.unknown}},ce=Ye.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class xs extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let l=n,c=0;for(;cr.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];r[o]=r[o]||[],r[o].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}xs.create=e=>new xs(e);const Pg=(e,t)=>{let r;switch(e.code){case ce.invalid_type:e.received===Ce.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ce.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ye.jsonStringifyReplacer)}`;break;case ce.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ye.joinValues(e.keys,", ")}`;break;case ce.invalid_union:r="Invalid input";break;case ce.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ye.joinValues(e.options)}`;break;case ce.invalid_enum_value:r=`Invalid enum value. Expected ${Ye.joinValues(e.options)}, received '${e.received}'`;break;case ce.invalid_arguments:r="Invalid function arguments";break;case ce.invalid_return_type:r="Invalid function return type";break;case ce.invalid_date:r="Invalid date";break;case ce.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ye.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ce.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ce.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ce.custom:r="Invalid input";break;case ce.invalid_intersection_types:r="Intersection results could not be merged";break;case ce.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ce.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ye.assertNever(e)}return{message:r}};let Oz=Pg;function Dz(){return Oz}const Iz=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let l="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)l=u(a,{data:t,defaultError:l}).message;return{...s,path:o,message:l}};function ge(e,t){const r=Dz(),n=Iz({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Pg?void 0:Pg].filter(s=>!!s)});e.common.issues.push(n)}class Lr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return De;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const o=await s.key,a=await s.value;n.push({key:o,value:a})}return Lr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return De;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[o.value]=a.value)}return{status:t.value,value:n}}}const De=Object.freeze({status:"aborted"}),Dl=e=>({status:"dirty",value:e}),nn=e=>({status:"valid",value:e}),g1=e=>e.status==="aborted",x1=e=>e.status==="dirty",Ua=e=>e.status==="valid",rf=e=>typeof Promise<"u"&&e instanceof Promise;var _e;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(_e||(_e={}));class go{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const v1=(e,t)=>{if(Ua(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new xs(e.common.issues);return this._error=r,this._error}}};function He(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(a,l)=>{const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??n??l.defaultError}:a.code!=="invalid_type"?{message:l.defaultError}:{message:c??r??l.defaultError}},description:s}}class Ze{get description(){return this._def.description}_getType(t){return Ms(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ms(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Lr,ctx:{common:t.parent.common,data:t.data,parsedType:Ms(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(rf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ms(t)},s=this._parseSync({data:t,path:n.path,parent:n});return v1(n,s)}"~validate"(t){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ms(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:r});return Ua(o)?{value:o.value}:{issues:r.common.issues}}catch(o){(s=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(o=>Ua(o)?{value:o.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ms(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(rf(s)?s:Promise.resolve(s));return v1(n,o)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{const a=t(s),l=()=>o.addIssue({code:ce.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(l(),!1)):a?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new Ka({schema:this,typeName:Ie.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return io.create(this,this._def)}nullable(){return qa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Bn.create(this)}promise(){return af.create(this,this._def)}or(t){return sf.create([this,t],this._def)}and(t){return of.create(this,t,this._def)}transform(t){return new Ka({...He(this._def),schema:this,typeName:Ie.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Rg({...He(this._def),innerType:this,defaultValue:r,typeName:Ie.ZodDefault})}brand(){return new o9({typeName:Ie.ZodBranded,type:this,...He(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Mg({...He(this._def),innerType:this,catchValue:r,typeName:Ie.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return yy.create(this,t)}readonly(){return Og.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Lz=/^c[^\s-]{8,}$/i,Fz=/^[0-9a-z]+$/,Vz=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$z=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,zz=/^[a-z0-9_-]{21}$/i,Bz=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Uz=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Hz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Wz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Nm;const Kz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Gz=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Qz=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Zz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Yz=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,V_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Xz=new RegExp(`^${V_}$`);function $_(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Jz(e){return new RegExp(`^${$_(e)}$`)}function e9(e){let t=`${V_}T${$_(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function t9(e,t){return!!((t==="v4"||!t)&&Kz.test(e)||(t==="v6"||!t)&&Gz.test(e))}function r9(e,t){if(!Bz.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function n9(e,t){return!!((t==="v4"||!t)&&qz.test(e)||(t==="v6"||!t)&&Qz.test(e))}class is extends Ze{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ce.string){const o=this._getOrReturnCtx(t);return ge(o,{code:ce.invalid_type,expected:Ce.string,received:o.parsedType}),De}const n=new Lr;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),ge(s,{code:ce.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,l=t.data.lengtht.test(s),{validation:r,code:ce.invalid_string,..._e.errToObj(n)})}_addCheck(t){return new is({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",..._e.errToObj(t)})}url(t){return this._addCheck({kind:"url",..._e.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",..._e.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",..._e.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",..._e.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",..._e.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",..._e.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",..._e.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",..._e.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",..._e.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",..._e.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",..._e.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",..._e.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,..._e.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,..._e.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",..._e.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,..._e.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,..._e.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,..._e.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,..._e.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,..._e.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,..._e.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,..._e.errToObj(r)})}nonempty(t){return this.min(1,_e.errToObj(t))}trim(){return new is({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new is({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new is({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew is({checks:[],typeName:Ie.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...He(e)});function s9(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}class mi extends Ze{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ce.number){const o=this._getOrReturnCtx(t);return ge(o,{code:ce.invalid_type,expected:Ce.number,received:o.parsedType}),De}let n;const s=new Lr;for(const o of this._def.checks)o.kind==="int"?Ye.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ge(n,{code:ce.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),ge(n,{code:ce.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?s9(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),ge(n,{code:ce.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ge(n,{code:ce.not_finite,message:o.message}),s.dirty()):Ye.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,_e.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_e.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_e.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_e.toString(r))}setLimit(t,r,n,s){return new mi({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_e.toString(s)}]})}_addCheck(t){return new mi({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:_e.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_e.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:_e.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_e.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_e.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&Ye.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew mi({checks:[],typeName:Ie.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class pi extends Ze{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ce.bigint)return this._getInvalidInput(t);let n;const s=new Lr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),ge(n,{code:ce.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ge(n,{code:ce.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Ye.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return ge(r,{code:ce.invalid_type,expected:Ce.bigint,received:r.parsedType}),De}gte(t,r){return this.setLimit("min",t,!0,_e.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_e.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_e.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_e.toString(r))}setLimit(t,r,n,s){return new pi({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_e.toString(s)}]})}_addCheck(t){return new pi({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew pi({checks:[],typeName:Ie.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...He(e)});class nf extends Ze{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ce.boolean){const n=this._getOrReturnCtx(t);return ge(n,{code:ce.invalid_type,expected:Ce.boolean,received:n.parsedType}),De}return nn(t.data)}}nf.create=e=>new nf({typeName:Ie.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...He(e)});class Ha extends Ze{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ce.date){const o=this._getOrReturnCtx(t);return ge(o,{code:ce.invalid_type,expected:Ce.date,received:o.parsedType}),De}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ge(o,{code:ce.invalid_date}),De}const n=new Lr;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),ge(s,{code:ce.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Ye.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ha({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:_e.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:_e.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Ha({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ie.ZodDate,...He(e)});class y1 extends Ze{_parse(t){if(this._getType(t)!==Ce.symbol){const n=this._getOrReturnCtx(t);return ge(n,{code:ce.invalid_type,expected:Ce.symbol,received:n.parsedType}),De}return nn(t.data)}}y1.create=e=>new y1({typeName:Ie.ZodSymbol,...He(e)});class b1 extends Ze{_parse(t){if(this._getType(t)!==Ce.undefined){const n=this._getOrReturnCtx(t);return ge(n,{code:ce.invalid_type,expected:Ce.undefined,received:n.parsedType}),De}return nn(t.data)}}b1.create=e=>new b1({typeName:Ie.ZodUndefined,...He(e)});class w1 extends Ze{_parse(t){if(this._getType(t)!==Ce.null){const n=this._getOrReturnCtx(t);return ge(n,{code:ce.invalid_type,expected:Ce.null,received:n.parsedType}),De}return nn(t.data)}}w1.create=e=>new w1({typeName:Ie.ZodNull,...He(e)});class j1 extends Ze{constructor(){super(...arguments),this._any=!0}_parse(t){return nn(t.data)}}j1.create=e=>new j1({typeName:Ie.ZodAny,...He(e)});class S1 extends Ze{constructor(){super(...arguments),this._unknown=!0}_parse(t){return nn(t.data)}}S1.create=e=>new S1({typeName:Ie.ZodUnknown,...He(e)});class xo extends Ze{_parse(t){const r=this._getOrReturnCtx(t);return ge(r,{code:ce.invalid_type,expected:Ce.never,received:r.parsedType}),De}}xo.create=e=>new xo({typeName:Ie.ZodNever,...He(e)});class N1 extends Ze{_parse(t){if(this._getType(t)!==Ce.undefined){const n=this._getOrReturnCtx(t);return ge(n,{code:ce.invalid_type,expected:Ce.void,received:n.parsedType}),De}return nn(t.data)}}N1.create=e=>new N1({typeName:Ie.ZodVoid,...He(e)});class Bn extends Ze{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==Ce.array)return ge(r,{code:ce.invalid_type,expected:Ce.array,received:r.parsedType}),De;if(s.exactLength!==null){const a=r.data.length>s.exactLength.value,l=r.data.lengths.maxLength.value&&(ge(r,{code:ce.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,l)=>s.type._parseAsync(new go(r,a,r.path,l)))).then(a=>Lr.mergeArray(n,a));const o=[...r.data].map((a,l)=>s.type._parseSync(new go(r,a,r.path,l)));return Lr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new Bn({...this._def,minLength:{value:t,message:_e.toString(r)}})}max(t,r){return new Bn({...this._def,maxLength:{value:t,message:_e.toString(r)}})}length(t,r){return new Bn({...this._def,exactLength:{value:t,message:_e.toString(r)}})}nonempty(t){return this.min(1,t)}}Bn.create=(e,t)=>new Bn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ie.ZodArray,...He(t)});function Ii(e){if(e instanceof Ct){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=io.create(Ii(n))}return new Ct({...e._def,shape:()=>t})}else return e instanceof Bn?new Bn({...e._def,type:Ii(e.element)}):e instanceof io?io.create(Ii(e.unwrap())):e instanceof qa?qa.create(Ii(e.unwrap())):e instanceof gi?gi.create(e.items.map(t=>Ii(t))):e}class Ct extends Ze{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=Ye.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Ce.object){const u=this._getOrReturnCtx(t);return ge(u,{code:ce.invalid_type,expected:Ce.object,received:u.parsedType}),De}const{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),l=[];if(!(this._def.catchall instanceof xo&&this._def.unknownKeys==="strip"))for(const u in s.data)a.includes(u)||l.push(u);const c=[];for(const u of a){const d=o[u],h=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new go(s,h,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof xo){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")l.length>0&&(ge(s,{code:ce.unrecognized_keys,keys:l}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const h=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new go(s,h,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const h=await d.key,m=await d.value;u.push({key:h,value:m,alwaysSet:d.alwaysSet})}return u}).then(u=>Lr.mergeObjectSync(n,u)):Lr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return _e.errToObj,new Ct({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var o,a;const s=((a=(o=this._def).errorMap)==null?void 0:a.call(o,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:_e.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Ct({...this._def,unknownKeys:"strip"})}passthrough(){return new Ct({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ct({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ct({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ie.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Ct({...this._def,catchall:t})}pick(t){const r={};for(const n of Ye.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Ct({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Ye.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Ct({...this._def,shape:()=>r})}deepPartial(){return Ii(this)}partial(t){const r={};for(const n of Ye.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new Ct({...this._def,shape:()=>r})}required(t){const r={};for(const n of Ye.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof io;)o=o._def.innerType;r[n]=o}return new Ct({...this._def,shape:()=>r})}keyof(){return z_(Ye.objectKeys(this.shape))}}Ct.create=(e,t)=>new Ct({shape:()=>e,unknownKeys:"strip",catchall:xo.create(),typeName:Ie.ZodObject,...He(t)});Ct.strictCreate=(e,t)=>new Ct({shape:()=>e,unknownKeys:"strict",catchall:xo.create(),typeName:Ie.ZodObject,...He(t)});Ct.lazycreate=(e,t)=>new Ct({shape:e,unknownKeys:"strip",catchall:xo.create(),typeName:Ie.ZodObject,...He(t)});class sf extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(const l of o)if(l.result.status==="valid")return l.result;for(const l of o)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;const a=o.map(l=>new xs(l.ctx.common.issues));return ge(r,{code:ce.invalid_union,unionErrors:a}),De}if(r.common.async)return Promise.all(n.map(async o=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const l=a.map(c=>new xs(c));return ge(r,{code:ce.invalid_union,unionErrors:l}),De}}get options(){return this._def.options}}sf.create=(e,t)=>new sf({options:e,typeName:Ie.ZodUnion,...He(t)});function Ag(e,t){const r=Ms(e),n=Ms(t);if(e===t)return{valid:!0,data:e};if(r===Ce.object&&n===Ce.object){const s=Ye.objectKeys(t),o=Ye.objectKeys(e).filter(l=>s.indexOf(l)!==-1),a={...e,...t};for(const l of o){const c=Ag(e[l],t[l]);if(!c.valid)return{valid:!1};a[l]=c.data}return{valid:!0,data:a}}else if(r===Ce.array&&n===Ce.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(g1(o)||g1(a))return De;const l=Ag(o.value,a.value);return l.valid?((x1(o)||x1(a))&&r.dirty(),{status:r.value,value:l.data}):(ge(n,{code:ce.invalid_intersection_types}),De)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}of.create=(e,t,r)=>new of({left:e,right:t,typeName:Ie.ZodIntersection,...He(r)});class gi extends Ze{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.array)return ge(n,{code:ce.invalid_type,expected:Ce.array,received:n.parsedType}),De;if(n.data.lengththis._def.items.length&&(ge(n,{code:ce.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((a,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new go(n,a,n.path,l)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>Lr.mergeArray(r,a)):Lr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new gi({...this._def,rest:t})}}gi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new gi({items:e,typeName:Ie.ZodTuple,rest:null,...He(t)})};class C1 extends Ze{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.map)return ge(n,{code:ce.invalid_type,expected:Ce.map,received:n.parsedType}),De;const s=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([l,c],u)=>({key:s._parse(new go(n,l,n.path,[u,"key"])),value:o._parse(new go(n,c,n.path,[u,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of a){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return De;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const c of a){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return De;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}}}}C1.create=(e,t,r)=>new C1({valueType:t,keyType:e,typeName:Ie.ZodMap,...He(r)});class Ac extends Ze{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.set)return ge(n,{code:ce.invalid_type,expected:Ce.set,received:n.parsedType}),De;const s=this._def;s.minSize!==null&&n.data.sizes.maxSize.value&&(ge(n,{code:ce.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const o=this._def.valueType;function a(c){const u=new Set;for(const d of c){if(d.status==="aborted")return De;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const l=[...n.data.values()].map((c,u)=>o._parse(new go(n,c,n.path,u)));return n.common.async?Promise.all(l).then(c=>a(c)):a(l)}min(t,r){return new Ac({...this._def,minSize:{value:t,message:_e.toString(r)}})}max(t,r){return new Ac({...this._def,maxSize:{value:t,message:_e.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Ac.create=(e,t)=>new Ac({valueType:e,minSize:null,maxSize:null,typeName:Ie.ZodSet,...He(t)});class k1 extends Ze{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}k1.create=(e,t)=>new k1({getter:e,typeName:Ie.ZodLazy,...He(t)});class E1 extends Ze{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ge(r,{received:r.data,code:ce.invalid_literal,expected:this._def.value}),De}return{status:"valid",value:t.data}}get value(){return this._def.value}}E1.create=(e,t)=>new E1({value:e,typeName:Ie.ZodLiteral,...He(t)});function z_(e,t){return new Wa({values:e,typeName:Ie.ZodEnum,...He(t)})}class Wa extends Ze{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ge(r,{expected:Ye.joinValues(n),received:r.parsedType,code:ce.invalid_type}),De}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ge(r,{received:r.data,code:ce.invalid_enum_value,options:n}),De}return nn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Wa.create(t,{...this._def,...r})}exclude(t,r=this._def){return Wa.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Wa.create=z_;class _1 extends Ze{_parse(t){const r=Ye.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Ce.string&&n.parsedType!==Ce.number){const s=Ye.objectValues(r);return ge(n,{expected:Ye.joinValues(s),received:n.parsedType,code:ce.invalid_type}),De}if(this._cache||(this._cache=new Set(Ye.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Ye.objectValues(r);return ge(n,{received:n.data,code:ce.invalid_enum_value,options:s}),De}return nn(t.data)}get enum(){return this._def.values}}_1.create=(e,t)=>new _1({values:e,typeName:Ie.ZodNativeEnum,...He(t)});class af extends Ze{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.promise&&r.common.async===!1)return ge(r,{code:ce.invalid_type,expected:Ce.promise,received:r.parsedType}),De;const n=r.parsedType===Ce.promise?r.data:Promise.resolve(r.data);return nn(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}af.create=(e,t)=>new af({type:e,typeName:Ie.ZodPromise,...He(t)});class Ka extends Ze{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:a=>{ge(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async l=>{if(r.value==="aborted")return De;const c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?De:c.status==="dirty"||r.value==="dirty"?Dl(c.value):c});{if(r.value==="aborted")return De;const l=this._def.schema._parseSync({data:a,path:n.path,parent:n});return l.status==="aborted"?De:l.status==="dirty"||r.value==="dirty"?Dl(l.value):l}}if(s.type==="refinement"){const a=l=>{const c=s.refinement(l,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?De:(l.status==="dirty"&&r.dirty(),a(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?De:(l.status==="dirty"&&r.dirty(),a(l.value).then(()=>({status:r.value,value:l.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ua(a))return De;const l=s.transform(a.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Ua(a)?Promise.resolve(s.transform(a.value,o)).then(l=>({status:r.value,value:l})):De);Ye.assertNever(s)}}Ka.create=(e,t,r)=>new Ka({schema:e,typeName:Ie.ZodEffects,effect:t,...He(r)});Ka.createWithPreprocess=(e,t,r)=>new Ka({schema:t,effect:{type:"preprocess",transform:e},typeName:Ie.ZodEffects,...He(r)});class io extends Ze{_parse(t){return this._getType(t)===Ce.undefined?nn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}io.create=(e,t)=>new io({innerType:e,typeName:Ie.ZodOptional,...He(t)});class qa extends Ze{_parse(t){return this._getType(t)===Ce.null?nn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}qa.create=(e,t)=>new qa({innerType:e,typeName:Ie.ZodNullable,...He(t)});class Rg extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===Ce.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Rg.create=(e,t)=>new Rg({innerType:e,typeName:Ie.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...He(t)});class Mg extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return rf(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new xs(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new xs(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Mg.create=(e,t)=>new Mg({innerType:e,typeName:Ie.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...He(t)});class T1 extends Ze{_parse(t){if(this._getType(t)!==Ce.nan){const n=this._getOrReturnCtx(t);return ge(n,{code:ce.invalid_type,expected:Ce.nan,received:n.parsedType}),De}return{status:"valid",value:t.data}}}T1.create=e=>new T1({typeName:Ie.ZodNaN,...He(e)});class o9 extends Ze{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class yy extends Ze{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?De:o.status==="dirty"?(r.dirty(),Dl(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?De:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new yy({in:t,out:r,typeName:Ie.ZodPipeline})}}class Og extends Ze{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Ua(s)&&(s.value=Object.freeze(s.value)),s);return rf(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}Og.create=(e,t)=>new Og({innerType:e,typeName:Ie.ZodReadonly,...He(t)});Ct.lazycreate;var Ie;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ie||(Ie={}));const by=is.create,Dg=mi.create;pi.create;const B_=nf.create;Ha.create;xo.create;const U_=Bn.create,wy=Ct.create;Ct.strictCreate;sf.create;of.create;gi.create;Wa.create;af.create;io.create;qa.create;const i9={string:e=>is.create({...e,coerce:!0}),number:e=>mi.create({...e,coerce:!0}),boolean:e=>nf.create({...e,coerce:!0}),bigint:e=>pi.create({...e,coerce:!0}),date:e=>Ha.create({...e,coerce:!0})},a9=hz,H_=f.createContext({}),Xl=({...e})=>i.jsx(H_.Provider,{value:{name:e.name},children:i.jsx(gy,{...e})}),sh=()=>{const e=f.useContext(H_),t=f.useContext(W_),{getFieldState:r,formState:n}=eu(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},W_=f.createContext({}),pa=f.forwardRef(({className:e,...t},r)=>{const n=f.useId();return i.jsx(W_.Provider,{value:{id:n},children:i.jsx("div",{ref:r,className:he("space-y-2",e),...t})})});pa.displayName="FormItem";const Jo=f.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=sh();return i.jsx(le,{ref:r,className:he(n&&"text-destructive",e),htmlFor:s,...t})});Jo.displayName="FormLabel";const ei=f.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:o}=sh();return i.jsx(wi,{ref:t,id:n,"aria-describedby":r?`${s} ${o}`:`${s}`,"aria-invalid":!!r,...e})});ei.displayName="FormControl";const l9=f.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=sh();return i.jsx("p",{ref:r,id:n,className:he("text-sm text-muted-foreground",e),...t})});l9.displayName="FormDescription";const lf=f.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:o}=sh(),a=s?String(s==null?void 0:s.message):t;return a?i.jsx("p",{ref:n,id:o,className:he("text-sm font-medium text-destructive",e),...r,children:a}):null});lf.displayName="FormMessage";var oh="Popover",[K_,zB]=Wn(oh,[nl]),tu=nl(),[c9,Eo]=K_(oh),q_=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:a=!1}=e,l=tu(t),c=f.useRef(null),[u,d]=f.useState(!1),[h,m]=uo({prop:n,defaultProp:s??!1,onChange:o,caller:oh});return i.jsx(tv,{...l,children:i.jsx(c9,{scope:t,contentId:Cr(),triggerRef:c,open:h,onOpenChange:m,onOpenToggle:f.useCallback(()=>m(p=>!p),[m]),hasCustomAnchor:u,onCustomAnchorAdd:f.useCallback(()=>d(!0),[]),onCustomAnchorRemove:f.useCallback(()=>d(!1),[]),modal:a,children:r})})};q_.displayName=oh;var G_="PopoverAnchor",u9=f.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Eo(G_,r),o=tu(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=s;return f.useEffect(()=>(a(),()=>l()),[a,l]),i.jsx(Af,{...o,...n,ref:t})});u9.displayName=G_;var Q_="PopoverTrigger",Z_=f.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Eo(Q_,r),o=tu(r),a=ze(t,s.triggerRef),l=i.jsx(Te.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":tT(s.open),...n,ref:a,onClick:ke(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:i.jsx(Af,{asChild:!0,...o,children:l})});Z_.displayName=Q_;var jy="PopoverPortal",[d9,f9]=K_(jy,{forceMount:void 0}),Y_=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,o=Eo(jy,t);return i.jsx(d9,{scope:t,forceMount:r,children:i.jsx($r,{present:r||o.open,children:i.jsx(zc,{asChild:!0,container:s,children:n})})})};Y_.displayName=jy;var Ga="PopoverContent",X_=f.forwardRef((e,t)=>{const r=f9(Ga,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,o=Eo(Ga,e.__scopePopover);return i.jsx($r,{present:n||o.open,children:o.modal?i.jsx(m9,{...s,ref:t}):i.jsx(p9,{...s,ref:t})})});X_.displayName=Ga;var h9=ai("PopoverContent.RemoveScroll"),m9=f.forwardRef((e,t)=>{const r=Eo(Ga,e.__scopePopover),n=f.useRef(null),s=ze(t,n),o=f.useRef(!1);return f.useEffect(()=>{const a=n.current;if(a)return xv(a)},[]),i.jsx(Ff,{as:h9,allowPinchZoom:!0,children:i.jsx(J_,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),o.current||(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;o.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ke(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),p9=f.forwardRef((e,t)=>{const r=Eo(Ga,e.__scopePopover),n=f.useRef(!1),s=f.useRef(!1);return i.jsx(J_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((u=r.triggerRef.current)==null?void 0:u.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),J_=f.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...h}=e,m=Eo(Ga,r),p=tu(r);return gv(),i.jsx(If,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx(Xa,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:i.jsx(rv,{"data-state":tT(m.open),role:"dialog",id:m.contentId,...p,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),eT="PopoverClose",g9=f.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Eo(eT,r);return i.jsx(Te.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,()=>s.onOpenChange(!1))})});g9.displayName=eT;var x9="PopoverArrow",v9=f.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=tu(r);return i.jsx(nv,{...s,...n,ref:t})});v9.displayName=x9;function tT(e){return e?"open":"closed"}var y9=q_,b9=Z_,w9=Y_,rT=X_;const j9=y9,S9=b9,nT=f.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>i.jsx(w9,{children:i.jsx(rT,{ref:s,align:t,sideOffset:r,className:he("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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),...n})}));nT.displayName=rT.displayName;var P1=1,N9=.9,C9=.8,k9=.17,Cm=.1,km=.999,E9=.9999,_9=.99,T9=/[\\\/_+.#"@\[\(\{&]/,P9=/[\\\/_+.#"@\[\(\{&]/g,A9=/[\s-]/,sT=/[\s-]/g;function Ig(e,t,r,n,s,o,a){if(o===t.length)return s===e.length?P1:_9;var l=`${s},${o}`;if(a[l]!==void 0)return a[l];for(var c=n.charAt(o),u=r.indexOf(c,s),d=0,h,m,p,b;u>=0;)h=Ig(e,t,r,n,u+1,o+1,a),h>d&&(u===s?h*=P1:T9.test(e.charAt(u-1))?(h*=C9,p=e.slice(s,u-1).match(P9),p&&s>0&&(h*=Math.pow(km,p.length))):A9.test(e.charAt(u-1))?(h*=N9,b=e.slice(s,u-1).match(sT),b&&s>0&&(h*=Math.pow(km,b.length))):(h*=k9,s>0&&(h*=Math.pow(km,u-s))),e.charAt(u)!==t.charAt(o)&&(h*=E9)),(hh&&(h=m*Cm)),h>d&&(d=h),u=r.indexOf(c,u+1);return a[l]=d,d}function A1(e){return e.toLowerCase().replace(sT," ")}function R9(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Ig(e,t,A1(e),A1(t),0,0,{})}var El='[cmdk-group=""]',Em='[cmdk-group-items=""]',M9='[cmdk-group-heading=""]',oT='[cmdk-item=""]',R1=`${oT}:not([aria-disabled="true"])`,Lg="cmdk-item-select",Li="data-value",O9=(e,t,r)=>R9(e,t,r),iT=f.createContext(void 0),ru=()=>f.useContext(iT),aT=f.createContext(void 0),Sy=()=>f.useContext(aT),lT=f.createContext(void 0),cT=f.forwardRef((e,t)=>{let r=Fi(()=>{var F,Z;return{search:"",value:(Z=(F=e.value)!=null?F:e.defaultValue)!=null?Z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=Fi(()=>new Set),s=Fi(()=>new Map),o=Fi(()=>new Map),a=Fi(()=>new Set),l=uT(e),{label:c,children:u,value:d,onValueChange:h,filter:m,shouldFilter:p,loop:b,disablePointerSelection:g=!1,vimBindings:y=!0,...v}=e,x=Cr(),w=Cr(),j=Cr(),S=f.useRef(null),N=W9();xi(()=>{if(d!==void 0){let F=d.trim();r.current.value=F,C.emit()}},[d]),xi(()=>{N(6,L)},[]);let C=f.useMemo(()=>({subscribe:F=>(a.current.add(F),()=>a.current.delete(F)),snapshot:()=>r.current,setState:(F,Z,X)=>{var ee,xe,G,Se;if(!Object.is(r.current[F],Z)){if(r.current[F]=Z,F==="search")T(),D(),N(1,z);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Ae=document.getElementById(j);Ae?Ae.focus():(ee=document.getElementById(x))==null||ee.focus()}if(N(7,()=>{var Ae;r.current.selectedItemId=(Ae=M())==null?void 0:Ae.id,C.emit()}),X||N(5,L),((xe=l.current)==null?void 0:xe.value)!==void 0){let Ae=Z??"";(Se=(G=l.current).onValueChange)==null||Se.call(G,Ae);return}}C.emit()}},emit:()=>{a.current.forEach(F=>F())}}),[]),_=f.useMemo(()=>({value:(F,Z,X)=>{var ee;Z!==((ee=o.current.get(F))==null?void 0:ee.value)&&(o.current.set(F,{value:Z,keywords:X}),r.current.filtered.items.set(F,$(Z,X)),N(2,()=>{D(),C.emit()}))},item:(F,Z)=>(n.current.add(F),Z&&(s.current.has(Z)?s.current.get(Z).add(F):s.current.set(Z,new Set([F]))),N(3,()=>{T(),D(),r.current.value||z(),C.emit()}),()=>{o.current.delete(F),n.current.delete(F),r.current.filtered.items.delete(F);let X=M();N(4,()=>{T(),(X==null?void 0:X.getAttribute("id"))===F&&z(),C.emit()})}),group:F=>(s.current.has(F)||s.current.set(F,new Set),()=>{o.current.delete(F),s.current.delete(F)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:x,inputId:j,labelId:w,listInnerRef:S}),[]);function $(F,Z){var X,ee;let xe=(ee=(X=l.current)==null?void 0:X.filter)!=null?ee:O9;return F?xe(F,r.current.search,Z):0}function D(){if(!r.current.search||l.current.shouldFilter===!1)return;let F=r.current.filtered.items,Z=[];r.current.filtered.groups.forEach(ee=>{let xe=s.current.get(ee),G=0;xe.forEach(Se=>{let Ae=F.get(Se);G=Math.max(Ae,G)}),Z.push([ee,G])});let X=S.current;B().sort((ee,xe)=>{var G,Se;let Ae=ee.getAttribute("id"),Re=xe.getAttribute("id");return((G=F.get(Re))!=null?G:0)-((Se=F.get(Ae))!=null?Se:0)}).forEach(ee=>{let xe=ee.closest(Em);xe?xe.appendChild(ee.parentElement===xe?ee:ee.closest(`${Em} > *`)):X.appendChild(ee.parentElement===X?ee:ee.closest(`${Em} > *`))}),Z.sort((ee,xe)=>xe[1]-ee[1]).forEach(ee=>{var xe;let G=(xe=S.current)==null?void 0:xe.querySelector(`${El}[${Li}="${encodeURIComponent(ee[0])}"]`);G==null||G.parentElement.appendChild(G)})}function z(){let F=B().find(X=>X.getAttribute("aria-disabled")!=="true"),Z=F==null?void 0:F.getAttribute(Li);C.setState("value",Z||void 0)}function T(){var F,Z,X,ee;if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let xe=0;for(let G of n.current){let Se=(Z=(F=o.current.get(G))==null?void 0:F.value)!=null?Z:"",Ae=(ee=(X=o.current.get(G))==null?void 0:X.keywords)!=null?ee:[],Re=$(Se,Ae);r.current.filtered.items.set(G,Re),Re>0&&xe++}for(let[G,Se]of s.current)for(let Ae of Se)if(r.current.filtered.items.get(Ae)>0){r.current.filtered.groups.add(G);break}r.current.filtered.count=xe}function L(){var F,Z,X;let ee=M();ee&&(((F=ee.parentElement)==null?void 0:F.firstChild)===ee&&((X=(Z=ee.closest(El))==null?void 0:Z.querySelector(M9))==null||X.scrollIntoView({block:"nearest"})),ee.scrollIntoView({block:"nearest"}))}function M(){var F;return(F=S.current)==null?void 0:F.querySelector(`${oT}[aria-selected="true"]`)}function B(){var F;return Array.from(((F=S.current)==null?void 0:F.querySelectorAll(R1))||[])}function W(F){let Z=B()[F];Z&&C.setState("value",Z.getAttribute(Li))}function H(F){var Z;let X=M(),ee=B(),xe=ee.findIndex(Se=>Se===X),G=ee[xe+F];(Z=l.current)!=null&&Z.loop&&(G=xe+F<0?ee[ee.length-1]:xe+F===ee.length?ee[0]:ee[xe+F]),G&&C.setState("value",G.getAttribute(Li))}function A(F){let Z=M(),X=Z==null?void 0:Z.closest(El),ee;for(;X&&!ee;)X=F>0?U9(X,El):H9(X,El),ee=X==null?void 0:X.querySelector(R1);ee?C.setState("value",ee.getAttribute(Li)):H(F)}let E=()=>W(B().length-1),I=F=>{F.preventDefault(),F.metaKey?E():F.altKey?A(1):H(1)},q=F=>{F.preventDefault(),F.metaKey?W(0):F.altKey?A(-1):H(-1)};return f.createElement(Te.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:F=>{var Z;(Z=v.onKeyDown)==null||Z.call(v,F);let X=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||X))switch(F.key){case"n":case"j":{y&&F.ctrlKey&&I(F);break}case"ArrowDown":{I(F);break}case"p":case"k":{y&&F.ctrlKey&&q(F);break}case"ArrowUp":{q(F);break}case"Home":{F.preventDefault(),W(0);break}case"End":{F.preventDefault(),E();break}case"Enter":{F.preventDefault();let ee=M();if(ee){let xe=new Event(Lg);ee.dispatchEvent(xe)}}}}},f.createElement("label",{"cmdk-label":"",htmlFor:_.inputId,id:_.labelId,style:q9},c),ih(e,F=>f.createElement(aT.Provider,{value:C},f.createElement(iT.Provider,{value:_},F))))}),D9=f.forwardRef((e,t)=>{var r,n;let s=Cr(),o=f.useRef(null),a=f.useContext(lT),l=ru(),c=uT(e),u=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:a==null?void 0:a.forceMount;xi(()=>{if(!u)return l.item(s,a==null?void 0:a.id)},[u]);let d=dT(s,o,[e.value,e.children,o],e.keywords),h=Sy(),m=vo(N=>N.value&&N.value===d.current),p=vo(N=>u||l.filter()===!1?!0:N.search?N.filtered.items.get(s)>0:!0);f.useEffect(()=>{let N=o.current;if(!(!N||e.disabled))return N.addEventListener(Lg,b),()=>N.removeEventListener(Lg,b)},[p,e.onSelect,e.disabled]);function b(){var N,C;g(),(C=(N=c.current).onSelect)==null||C.call(N,d.current)}function g(){h.setState("value",d.current,!0)}if(!p)return null;let{disabled:y,value:v,onSelect:x,forceMount:w,keywords:j,...S}=e;return f.createElement(Te.div,{ref:ii(o,t),...S,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!m,"data-disabled":!!y,"data-selected":!!m,onPointerMove:y||l.getDisablePointerSelection()?void 0:g,onClick:y?void 0:b},e.children)}),I9=f.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...o}=e,a=Cr(),l=f.useRef(null),c=f.useRef(null),u=Cr(),d=ru(),h=vo(p=>s||d.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);xi(()=>d.group(a),[]),dT(a,l,[e.value,e.heading,c]);let m=f.useMemo(()=>({id:a,forceMount:s}),[s]);return f.createElement(Te.div,{ref:ii(l,t),...o,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&f.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),ih(e,p=>f.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},f.createElement(lT.Provider,{value:m},p))))}),L9=f.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=f.useRef(null),o=vo(a=>!a.search);return!r&&!o?null:f.createElement(Te.div,{ref:ii(s,t),...n,"cmdk-separator":"",role:"separator"})}),F9=f.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,o=Sy(),a=vo(u=>u.search),l=vo(u=>u.selectedItemId),c=ru();return f.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),f.createElement(Te.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:a,onChange:u=>{s||o.setState("search",u.target.value),r==null||r(u.target.value)}})}),V9=f.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,o=f.useRef(null),a=f.useRef(null),l=vo(u=>u.selectedItemId),c=ru();return f.useEffect(()=>{if(a.current&&o.current){let u=a.current,d=o.current,h,m=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let p=u.offsetHeight;d.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return m.observe(u),()=>{cancelAnimationFrame(h),m.unobserve(u)}}},[]),f.createElement(Te.div,{ref:ii(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},ih(e,u=>f.createElement("div",{ref:ii(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),$9=f.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:a,...l}=e;return f.createElement(wv,{open:r,onOpenChange:n},f.createElement(jv,{container:a},f.createElement(Kc,{"cmdk-overlay":"",className:s}),f.createElement(qc,{"aria-label":e.label,"cmdk-dialog":"",className:o},f.createElement(cT,{ref:t,...l}))))}),z9=f.forwardRef((e,t)=>vo(r=>r.filtered.count===0)?f.createElement(Te.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),B9=f.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return f.createElement(Te.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},ih(e,a=>f.createElement("div",{"aria-hidden":!0},a)))}),Er=Object.assign(cT,{List:V9,Item:D9,Input:F9,Group:I9,Separator:L9,Dialog:$9,Empty:z9,Loading:B9});function U9(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function H9(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function uT(e){let t=f.useRef(e);return xi(()=>{t.current=e}),t}var xi=typeof window>"u"?f.useEffect:f.useLayoutEffect;function Fi(e){let t=f.useRef();return t.current===void 0&&(t.current=e()),t}function vo(e){let t=Sy(),r=()=>e(t.snapshot());return f.useSyncExternalStore(t.subscribe,r,r)}function dT(e,t,r,n=[]){let s=f.useRef(),o=ru();return xi(()=>{var a;let l=(()=>{var u;for(let d of r){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():s.current}})(),c=n.map(u=>u.trim());o.value(e,l,c),(a=t.current)==null||a.setAttribute(Li,l),s.current=l}),s}var W9=()=>{let[e,t]=f.useState(),r=Fi(()=>new Map);return xi(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function K9(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ih({asChild:e,children:t},r){return e&&f.isValidElement(t)?f.cloneElement(K9(t),{ref:t.ref},r(t.props.children)):r(t)}var q9={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const fT=f.forwardRef(({className:e,...t},r)=>i.jsx(Er,{ref:r,className:he("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));fT.displayName=Er.displayName;const hT=f.forwardRef(({className:e,...t},r)=>i.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[i.jsx(La,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),i.jsx(Er.Input,{ref:r,className:he("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));hT.displayName=Er.Input.displayName;const mT=f.forwardRef(({className:e,...t},r)=>i.jsx(Er.List,{ref:r,className:he("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));mT.displayName=Er.List.displayName;const pT=f.forwardRef((e,t)=>i.jsx(Er.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));pT.displayName=Er.Empty.displayName;const gT=f.forwardRef(({className:e,...t},r)=>i.jsx(Er.Group,{ref:r,className:he("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));gT.displayName=Er.Group.displayName;const G9=f.forwardRef(({className:e,...t},r)=>i.jsx(Er.Separator,{ref:r,className:he("-mx-1 h-px bg-border",e),...t}));G9.displayName=Er.Separator.displayName;const xT=f.forwardRef(({className:e,...t},r)=>i.jsx(Er.Item,{ref:r,className:he("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));xT.displayName=Er.Item.displayName;var vT=["PageUp","PageDown"],yT=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],bT={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},fl="Slider",[Fg,Q9,Z9]=Ix(fl),[wT,BB]=Wn(fl,[Z9]),[Y9,ah]=wT(fl),jT=f.forwardRef((e,t)=>{const{name:r,min:n=0,max:s=100,step:o=1,orientation:a="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[n],value:d,onValueChange:h=()=>{},onValueCommit:m=()=>{},inverted:p=!1,form:b,...g}=e,y=f.useRef(new Set),v=f.useRef(0),w=a==="horizontal"?X9:J9,[j=[],S]=uo({prop:d,defaultProp:u,onChange:z=>{var L;(L=[...y.current][v.current])==null||L.focus(),h(z)}}),N=f.useRef(j);function C(z){const T=sB(j,z);D(z,T)}function _(z){D(z,v.current)}function $(){const z=N.current[v.current];j[v.current]!==z&&m(j)}function D(z,T,{commit:L}={commit:!1}){const M=lB(o),B=cB(Math.round((z-n)/o)*o+n,M),W=Tc(B,[n,s]);S((H=[])=>{const A=rB(H,W,T);if(aB(A,c*o)){v.current=A.indexOf(W);const E=String(A)!==String(H);return E&&L&&m(A),E?A:H}else return H})}return i.jsx(Y9,{scope:e.__scopeSlider,name:r,disabled:l,min:n,max:s,valueIndexToChangeRef:v,thumbs:y.current,values:j,orientation:a,form:b,children:i.jsx(Fg.Provider,{scope:e.__scopeSlider,children:i.jsx(Fg.Slot,{scope:e.__scopeSlider,children:i.jsx(w,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:ke(g.onPointerDown,()=>{l||(N.current=j)}),min:n,max:s,inverted:p,onSlideStart:l?void 0:C,onSlideMove:l?void 0:_,onSlideEnd:l?void 0:$,onHomeKeyDown:()=>!l&&D(n,0,{commit:!0}),onEndKeyDown:()=>!l&&D(s,j.length-1,{commit:!0}),onStepKeyDown:({event:z,direction:T})=>{if(!l){const B=vT.includes(z.key)||z.shiftKey&&yT.includes(z.key)?10:1,W=v.current,H=j[W],A=o*B*T;D(H+A,W,{commit:!0})}}})})})})});jT.displayName=fl;var[ST,NT]=wT(fl,{startEdge:"left",endEdge:"right",size:"width",direction:1}),X9=f.forwardRef((e,t)=>{const{min:r,max:n,dir:s,inverted:o,onSlideStart:a,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...d}=e,[h,m]=f.useState(null),p=ze(t,w=>m(w)),b=f.useRef(void 0),g=ny(s),y=g==="ltr",v=y&&!o||!y&&o;function x(w){const j=b.current||h.getBoundingClientRect(),S=[0,j.width],C=Ny(S,v?[r,n]:[n,r]);return b.current=j,C(w-j.left)}return i.jsx(ST,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:i.jsx(CT,{dir:g,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const j=x(w.clientX);a==null||a(j)},onSlideMove:w=>{const j=x(w.clientX);l==null||l(j)},onSlideEnd:()=>{b.current=void 0,c==null||c()},onStepKeyDown:w=>{const S=bT[v?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:S?-1:1})}})})}),J9=f.forwardRef((e,t)=>{const{min:r,max:n,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...u}=e,d=f.useRef(null),h=ze(t,d),m=f.useRef(void 0),p=!s;function b(g){const y=m.current||d.current.getBoundingClientRect(),v=[0,y.height],w=Ny(v,p?[n,r]:[r,n]);return m.current=y,w(g-y.top)}return i.jsx(ST,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:i.jsx(CT,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const y=b(g.clientY);o==null||o(y)},onSlideMove:g=>{const y=b(g.clientY);a==null||a(y)},onSlideEnd:()=>{m.current=void 0,l==null||l()},onStepKeyDown:g=>{const v=bT[p?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:v?-1:1})}})})}),CT=f.forwardRef((e,t)=>{const{__scopeSlider:r,onSlideStart:n,onSlideMove:s,onSlideEnd:o,onHomeKeyDown:a,onEndKeyDown:l,onStepKeyDown:c,...u}=e,d=ah(fl,r);return i.jsx(Te.span,{...u,ref:t,onKeyDown:ke(e.onKeyDown,h=>{h.key==="Home"?(a(h),h.preventDefault()):h.key==="End"?(l(h),h.preventDefault()):vT.concat(yT).includes(h.key)&&(c(h),h.preventDefault())}),onPointerDown:ke(e.onPointerDown,h=>{const m=h.target;m.setPointerCapture(h.pointerId),h.preventDefault(),d.thumbs.has(m)?m.focus():n(h)}),onPointerMove:ke(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&s(h)}),onPointerUp:ke(e.onPointerUp,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&(m.releasePointerCapture(h.pointerId),o(h))})})}),kT="SliderTrack",ET=f.forwardRef((e,t)=>{const{__scopeSlider:r,...n}=e,s=ah(kT,r);return i.jsx(Te.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...n,ref:t})});ET.displayName=kT;var Vg="SliderRange",_T=f.forwardRef((e,t)=>{const{__scopeSlider:r,...n}=e,s=ah(Vg,r),o=NT(Vg,r),a=f.useRef(null),l=ze(t,a),c=s.values.length,u=s.values.map(m=>AT(m,s.min,s.max)),d=c>1?Math.min(...u):0,h=100-Math.max(...u);return i.jsx(Te.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...n,ref:l,style:{...e.style,[o.startEdge]:d+"%",[o.endEdge]:h+"%"}})});_T.displayName=Vg;var $g="SliderThumb",TT=f.forwardRef((e,t)=>{const r=Q9(e.__scopeSlider),[n,s]=f.useState(null),o=ze(t,l=>s(l)),a=f.useMemo(()=>n?r().findIndex(l=>l.ref.current===n):-1,[r,n]);return i.jsx(eB,{...e,ref:o,index:a})}),eB=f.forwardRef((e,t)=>{const{__scopeSlider:r,index:n,name:s,...o}=e,a=ah($g,r),l=NT($g,r),[c,u]=f.useState(null),d=ze(t,x=>u(x)),h=c?a.form||!!c.closest("form"):!0,m=Xx(c),p=a.values[n],b=p===void 0?0:AT(p,a.min,a.max),g=nB(n,a.values.length),y=m==null?void 0:m[l.size],v=y?oB(y,b,l.direction):0;return f.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),i.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${b}% + ${v}px)`},children:[i.jsx(Fg.ItemSlot,{scope:e.__scopeSlider,children:i.jsx(Te.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":a.min,"aria-valuenow":p,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...o,ref:d,style:p===void 0?{display:"none"}:e.style,onFocus:ke(e.onFocus,()=>{a.valueIndexToChangeRef.current=n})})}),h&&i.jsx(PT,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:p},n)]})});TT.displayName=$g;var tB="RadioBubbleInput",PT=f.forwardRef(({__scopeSlider:e,value:t,...r},n)=>{const s=f.useRef(null),o=ze(s,n),a=sy(t);return f.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&d){const h=new Event("input",{bubbles:!0});d.call(l,t),l.dispatchEvent(h)}},[a,t]),i.jsx(Te.input,{style:{display:"none"},...r,ref:o,defaultValue:t})});PT.displayName=tB;function rB(e=[],t,r){const n=[...e];return n[r]=t,n.sort((s,o)=>s-o)}function AT(e,t,r){const o=100/(r-t)*(e-t);return Tc(o,[0,100])}function nB(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function sB(e,t){if(e.length===1)return 0;const r=e.map(s=>Math.abs(s-t)),n=Math.min(...r);return r.indexOf(n)}function oB(e,t,r){const n=e/2,o=Ny([0,50],[0,n]);return(n-o(t)*r)*r}function iB(e){return e.slice(0,-1).map((t,r)=>e[r+1]-t)}function aB(e,t){if(t>0){const r=iB(e);return Math.min(...r)>=t}return!0}function Ny(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function lB(e){return(String(e).split(".")[1]||"").length}function cB(e,t){const r=Math.pow(10,t);return Math.round(e*r)/r}var RT=jT,uB=ET,dB=_T,fB=TT;const Cy=f.forwardRef(({className:e,...t},r)=>i.jsxs(RT,{ref:r,className:he("relative flex w-full touch-none select-none items-center",e),...t,children:[i.jsx(uB,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:i.jsx(dB,{className:"absolute h-full bg-primary"})}),i.jsx(fB,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Cy.displayName=RT.displayName;const hB=wy({target_guid:by(),enable:B_(),level:Dg().min(0).max(100)}),mB=wy({level:Dg().min(0).max(100),action_type:Dg(),target_guid:by().min(1,"O alvo é obrigatório"),custom_acoes:U_(hB)}),pB=wy({nome:by().min(2,{message:"O nome deve ter pelo menos 2 caracteres."}),ambiente_id:i9.number({required_error:"É obrigatório selecionar um ambiente."}).min(1,"É obrigatório selecionar um ambiente."),scene_movers:B_().optional(),acoes:U_(mB)}),gB=({actionIndex:e,customIndex:t,control:r,circuit:n})=>{const s=nh({control:r,name:`acoes.${e}.custom_acoes.${t}.enable`});return i.jsxs("div",{className:"flex items-center gap-4 p-2 border-b",children:[i.jsx(Xl,{control:r,name:`acoes.${e}.custom_acoes.${t}.enable`,render:({field:o})=>i.jsxs(pa,{className:"flex items-center space-x-2 space-y-0",children:[i.jsx(ei,{children:i.jsx(Pc,{checked:o.value,onCheckedChange:o.onChange})}),i.jsx(Jo,{className:"text-sm font-medium !mt-0",children:n.nome})]})}),i.jsx(gy,{name:`acoes.${e}.custom_acoes.${t}.level`,control:r,render:({field:{onChange:o,value:a}})=>i.jsxs("div",{className:"flex-1 flex items-center gap-3",children:[i.jsx(Cy,{value:[a],onValueChange:l=>o(l[0]),max:100,step:1,disabled:!s}),i.jsxs("span",{className:"text-xs font-mono w-10 text-right",children:[a,"%"]})]})})]})},xB=({actionIndex:e,control:t,getValues:r,projectCircuits:n,targetAmbienteId:s})=>{const{fields:o,replace:a}=L_({control:t,name:`acoes.${e}.custom_acoes`});return f.useEffect(()=>{if(!s){a([]);return}const l=n.filter(d=>d.ambiente.id===Number(s)&&d.tipo==="luz"),c=r(`acoes.${e}.custom_acoes`)||[],u=l.map(d=>c.find(m=>m.target_guid===String(d.id))||{target_guid:String(d.id),enable:!0,level:50});a(u)},[s,n,a,e,r]),s?i.jsxs("div",{className:"mt-4 space-y-3 p-3 bg-muted rounded-lg",children:[i.jsx("h4",{className:"text-sm font-semibold text-muted-foreground",children:"Configurações Individuais do Grupo"}),o.map((l,c)=>{const u=r(`acoes.${e}.custom_acoes.${c}`),d=n.find(h=>String(h.id)===u.target_guid);return d?i.jsx(gB,{actionIndex:e,customIndex:c,control:t,circuit:d},l.id):null})]}):null},vB=({index:e,control:t,getValues:r,setValue:n,remove:s,projectCircuits:o,projectAmbientes:a})=>{const l=nh({control:t,name:"acoes"}),c=l[e],[u,d]=f.useState(!1),h=f.useRef(!0);f.useEffect(()=>{if(h.current){h.current=!1;return}if(c.action_type===7){const b=r(`acoes.${e}.custom_acoes`);b&&b.forEach((g,y)=>{n(`acoes.${e}.custom_acoes.${y}.level`,c.level)})}},[c.level]);const m=b=>{if(!b.target_guid)return"Selecione...";if(b.action_type===0){const g=o.find(y=>String(y.id)===String(b.target_guid));return g?g.tipo==="hvac"?`Circuito Inválido (HVAC): ${g.nome}`:`${g.nome} (${g.identificador})`:"Circuito não encontrado"}if(b.action_type===7){const g=a.find(y=>String(y.id)===String(b.target_guid));return g?`Todas as luzes - ${g.nome}`:"Ambiente não encontrado"}return"Desconhecido"},p=f.useMemo(()=>{const b=l.filter((g,y)=>g.action_type===0&&y!==e&&g.target_guid).map(g=>g.target_guid);return o.filter(g=>g.tipo!=="hvac"&&!b.includes(String(g.id)))},[l,o,e]);return i.jsxs("div",{className:"p-4 mb-4 border rounded-lg space-y-4 bg-slate-50",children:[i.jsxs("div",{className:"flex justify-between items-start",children:[i.jsxs("div",{className:"flex-1 space-y-2",children:[i.jsx(Xl,{control:t,name:`acoes.${e}.target_guid`,render:({field:b})=>i.jsxs(pa,{className:"flex flex-col",children:[i.jsx(Jo,{children:"Alvo da Ação"}),c.action_type===7?i.jsxs(vr,{onValueChange:b.onChange,value:b.value,children:[i.jsx(ei,{children:i.jsx(ar,{children:i.jsx(yr,{placeholder:"Selecione o alvo...",children:m(c)})})}),i.jsx(lr,{children:a.map(g=>i.jsxs(ne,{value:String(g.id),children:["Todas as Luzes - ",g.nome," (",g.area.nome,")"]},g.id))})]}):i.jsxs(j9,{open:u,onOpenChange:d,children:[i.jsx(S9,{asChild:!0,children:i.jsx(ei,{children:i.jsxs(de,{variant:"outline",role:"combobox",className:he("w-full justify-between",!b.value&&"text-muted-foreground"),children:[m(c),i.jsx(aM,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})}),i.jsx(nT,{className:"w-[--radix-popover-trigger-width] max-h-[--radix-popover-content-available-height] p-0",children:i.jsxs(fT,{children:[i.jsx(hT,{placeholder:"Buscar circuito..."}),i.jsxs(mT,{children:[i.jsx(pT,{children:"Nenhum circuito encontrado."}),i.jsx(gT,{children:p.map(g=>i.jsxs(xT,{value:`${g.nome} ${g.identificador} ${g.ambiente.area.nome} ${g.ambiente.nome}`,onSelect:()=>{b.onChange(String(g.id)),d(!1)},children:[i.jsx(Ef,{className:he("mr-2 h-4 w-4",String(g.id)===b.value?"opacity-100":"opacity-0")}),i.jsxs("div",{className:"flex items-center gap-2",children:[g.tipo==="luz"&&i.jsx(Ia,{className:"h-4 w-4 text-amber-500"}),g.tipo==="persiana"&&i.jsx(Da,{className:"h-4 w-4 text-sky-600"}),i.jsxs("div",{children:[i.jsxs("p",{className:"font-medium",children:[g.nome," ",i.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",g.identificador,")"]})]}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.ambiente.area.nome," > ",g.ambiente.nome]})]})]})]},g.id))})]})]})})]}),i.jsx(lf,{})]})}),i.jsx(gy,{name:`acoes.${e}.level`,control:t,render:({field:{onChange:b,value:g}})=>i.jsxs("div",{className:"space-y-2",children:[i.jsxs(Jo,{children:["Intensidade Master: ",g,"%"]}),i.jsx(Cy,{value:[g],onValueChange:y=>b(y[0]),max:100,step:1})]})})]}),i.jsx(de,{type:"button",variant:"ghost",size:"icon",onClick:()=>s(e),className:"ml-4 flex-shrink-0",children:i.jsx(Cn,{className:"h-4 w-4"})})]}),c.action_type===7&&i.jsx(xB,{actionIndex:e,control:t,getValues:r,projectCircuits:o,targetAmbienteId:c.target_guid})]})},yB=({scene:e,projectCircuits:t,projectAmbientes:r,onSuccess:n})=>{const s=!!e,o=lz(),a=cz(),l=Tz({resolver:Mz(pB),defaultValues:{nome:"",ambiente_id:void 0,acoes:[],scene_movers:!1}}),c=nh({control:l.control,name:"acoes"}),u=f.useMemo(()=>{if(!c||c.length===0)return!1;for(const g of c)if(g.action_type===0){const y=t.find(v=>String(v.id)===g.target_guid);if(!y||y.tipo!=="persiana")return!1}else if(g.action_type===7){const y=t.filter(v=>v.ambiente.id===Number(g.target_guid)&&v.tipo!=="hvac");if(y.length===0||y.some(v=>v.tipo!=="persiana"))return!1}else return!1;return!0},[c,t]);f.useEffect(()=>{u||l.setValue("scene_movers",!1)},[u,l]),f.useEffect(()=>{e&&s?l.reset({nome:e.nome,ambiente_id:e.ambiente_id,scene_movers:e.scene_movers||!1,acoes:e.acoes.map(g=>({...g,target_guid:String(g.target_guid),custom_acoes:g.custom_acoes.map(y=>({...y,target_guid:String(y.target_guid)}))}))}):l.reset({nome:"",ambiente_id:void 0,acoes:[],scene_movers:!1})},[e,s,l]);const{fields:d,append:h,remove:m}=L_({control:l.control,name:"acoes"}),p=g=>{const y={...g,scene_movers:g.scene_movers||!1,acoes:g.acoes.map(w=>({...w,custom_acoes:w.action_type===7?w.custom_acoes:[]}))},v=s?a:o,x=s?{id:e.id,...y}:y;v.mutate(x,{onSuccess:()=>{n(),l.reset({nome:"",ambiente_id:void 0,acoes:[],scene_movers:!1})}})},b=g=>{h(g==="circuit"?{action_type:0,level:100,target_guid:"",custom_acoes:[]}:{action_type:7,level:100,target_guid:"",custom_acoes:[]})};return i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20 w-full",children:[i.jsx(it,{className:"pb-6",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Uc,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-2xl font-bold text-foreground",children:s?"Editar Cena":"Adicionar Nova Cena"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:s?`Editando "${e==null?void 0:e.nome}"`:"Preencha as informações da nova cena"})]})]})}),i.jsx(at,{children:i.jsx(a9,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(p),className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsx(Xl,{control:l.control,name:"nome",render:({field:g})=>i.jsxs(pa,{children:[i.jsx(Jo,{children:"Nome da Cena"}),i.jsx(ei,{children:i.jsx(Oe,{placeholder:"Ex: Jantar, Cinema...",...g})}),i.jsx(lf,{})]})}),i.jsx(Xl,{control:l.control,name:"ambiente_id",render:({field:g})=>i.jsxs(pa,{children:[i.jsx(Jo,{children:"Ambiente"}),i.jsxs(vr,{onValueChange:g.onChange,value:g.value?String(g.value):"",children:[i.jsx(ei,{children:i.jsx(ar,{children:i.jsx(yr,{placeholder:"Selecione um ambiente"})})}),i.jsx(lr,{children:r.map(y=>i.jsxs(ne,{value:String(y.id),children:[y.nome," (",y.area.nome,")"]},y.id))})]}),i.jsx(lf,{})]})})]}),u&&i.jsx("div",{className:"pt-2",children:i.jsx(Xl,{control:l.control,name:"scene_movers",render:({field:g})=>i.jsxs(pa,{className:"flex flex-row items-center justify-start rounded-lg border p-3 shadow-sm bg-slate-50",children:[i.jsx(ei,{children:i.jsx(Pc,{checked:g.value,onCheckedChange:g.onChange,disabled:!u})}),i.jsxs("div",{className:"space-y-0.5 ml-3",children:[i.jsx(Jo,{children:"Habilitar movimentadores"}),i.jsx("p",{className:"text-[0.8rem] text-muted-foreground",children:"Ative esta opção se a cena controla apenas persianas."})]})]})})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"Ações"}),i.jsx(fy,{className:"space-y-3 max-h-64 sm:max-h-96 overflow-y-auto pr-2",children:d.map((g,y)=>i.jsx(vB,{index:y,control:l.control,getValues:l.getValues,setValue:l.setValue,remove:m,projectCircuits:t,projectAmbientes:r},g.id))}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[i.jsxs(de,{type:"button",onClick:()=>b("circuit"),className:"flex-1 h-11 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center justify-center gap-2 text-sm sm:text-base",children:[i.jsx(Un,{className:"h-4 w-4 sm:h-5 sm:w-5"}),i.jsx("span",{className:"hidden xs:inline",children:"Adicionar Circuito"}),i.jsx("span",{className:"xs:hidden",children:"Circuito"})]}),i.jsxs(de,{type:"button",onClick:()=>b("room"),className:"flex-1 h-11 bg-gradient-to-r from-purple-600 to-violet-600 hover:from-purple-700 hover:to-violet-700 text-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 flex items-center justify-center gap-2 text-sm sm:text-base",children:[i.jsx(Un,{className:"h-4 w-4 sm:h-5 sm:w-5"}),i.jsx("span",{className:"hidden xs:inline",children:"Adicionar Grupo"}),i.jsx("span",{className:"xs:hidden",children:"Grupo"})]})]})]}),i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(de,{type:"button",variant:"ghost",onClick:()=>l.reset({nome:"",ambiente_id:void 0,acoes:[],scene_movers:!1}),children:"Cancelar"}),i.jsx(de,{type:"submit",disabled:o.isPending||a.isPending,children:s?"Salvar Alterações":"Criar Cena"})]})]})})})]})},bB=()=>{const[e,t]=f.useState([]),[r,n]=f.useState([]),[s,o]=f.useState(!0),[a,l]=f.useState(null),[c,u]=f.useState(""),[d,h]=f.useState("todos"),{data:m,isLoading:p,refetch:b}=az(),{mutate:g}=uz();f.useEffect(()=>{(async()=>{try{o(!0);const[S,N]=await Promise.all([fetch("/api/ambientes"),fetch("/api/circuitos")]);if(!S.ok||!N.ok)throw new Error("Falha ao carregar dados do projeto");const C=await S.json(),_=await N.json();t((C==null?void 0:C.ambientes)||[]),n((_==null?void 0:_.circuitos)||[])}catch{co({title:"Erro ao carregar dados",description:"Não foi possível buscar os dados do projeto.",variant:"destructive"})}finally{o(!1)}})()},[]);const y=f.useMemo(()=>m?m.filter(j=>{const S=c===""||j.nome.toLowerCase().includes(c.toLowerCase()),N=d==="todos"||j.ambiente.id===d;return S&&N}):[],[m,c,d]),v=j=>{l(j),window.scrollTo({top:0,behavior:"smooth"})},x=j=>{window.confirm("Tem certeza que deseja excluir esta cena?")&&g({id:j})},w=()=>{l(null),b()};return i.jsx(kr,{children:i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-6 sm:py-8",children:[i.jsx("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-8",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-14 h-14 sm:w-16 sm:h-16 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-3xl flex items-center justify-center shadow-lg",children:i.jsx(Qu,{className:"w-6 h-6 sm:w-8 sm:h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-foreground mb-2",children:"Gerenciar Cenas"}),i.jsx("p",{className:"text-base sm:text-lg text-muted-foreground",children:"Crie e configure cenas para automatizar seus ambientes."})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-indigo-600 to-purple-600 rounded-full shadow-sm"})]})}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 sm:gap-8",children:[i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"order-2 lg:order-1",children:i.jsx(yB,{scene:a,projectCircuits:r,projectAmbientes:e,onSuccess:w},a?a.id:"new")}),i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"order-1 lg:order-2",children:i.jsxs(ot,{className:"bg-card/95 backdrop-blur-sm border border-border shadow-xl shadow-primary/10 dark:bg-card/85 dark:shadow-primary/20",children:[i.jsxs(it,{className:"pb-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-2xl flex items-center justify-center shadow-lg",children:i.jsx(Qu,{className:"w-4 h-4 sm:w-6 sm:h-6 text-white"})}),i.jsxs("div",{children:[i.jsx(gt,{className:"text-xl sm:text-2xl font-bold text-foreground",children:"Cenas Cadastradas"}),i.jsx("p",{className:"text-muted-foreground text-sm sm:text-base mt-1",children:"Lista de todas as cenas"})]})]}),i.jsxs(yt,{className:"bg-gradient-to-r from-indigo-500 to-purple-500 text-white text-xs sm:text-sm font-medium px-2 sm:px-3 py-1",children:[y.length," de ",(m==null?void 0:m.length)||0," ",(m==null?void 0:m.length)===1?"cena":"cenas"]})]}),i.jsxs("div",{className:"mt-4 sm:mt-6 space-y-3 sm:space-y-4",children:[i.jsxs("div",{className:"relative",children:[i.jsx(La,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground/80 w-4 h-4"}),i.jsx(Oe,{placeholder:"Buscar por nome...",value:c,onChange:j=>u(j.target.value),className:"pl-10 pr-10 h-10 rounded-xl border-border focus:border-indigo-500"}),c&&i.jsx("button",{onClick:()=>u(""),className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-muted-foreground/80 hover:text-muted-foreground",children:i.jsx(Nr,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(le,{htmlFor:"filtro-ambiente",className:"text-xs font-medium text-muted-foreground",children:"Ambiente"}),i.jsxs(vr,{value:String(d),onValueChange:j=>h(j==="todos"?"todos":Number(j)),children:[i.jsx(ar,{id:"filtro-ambiente",className:"h-9 text-sm rounded-xl",children:i.jsx(yr,{placeholder:"Filtrar por ambiente..."})}),i.jsxs(lr,{className:"rounded-xl",children:[i.jsx(ne,{value:"todos",children:"Todos os Ambientes"}),e.map(j=>i.jsxs(ne,{value:String(j.id),children:[j.nome," (",j.area.nome,")"]},j.id))]})]})]}),(c||d!=="todos")&&i.jsx("div",{className:"flex justify-end",children:i.jsxs(de,{variant:"outline",size:"sm",onClick:()=>{u(""),h("todos")},className:"h-8 text-xs rounded-lg gap-1",children:[i.jsx(Nr,{className:"w-3 h-3"}),"Limpar filtros"]})})]})]}),i.jsx(at,{children:p?i.jsxs("div",{className:"flex flex-col justify-center items-center py-8",children:[i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-4 border-indigo-500 border-t-transparent mb-3"}),i.jsx("p",{className:"text-muted-foreground font-medium",children:"Carregando cenas..."})]}):y&&y.length>0?i.jsx(fy,{className:"h-[400px] sm:h-[500px] pr-2 sm:pr-4",children:i.jsx("div",{className:"space-y-3",children:i.jsx(Ir,{children:y.map((j,S)=>i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{delay:S*.05},className:"group relative overflow-hidden rounded-2xl border border-border bg-card/85 backdrop-blur-sm p-3 sm:p-4 hover:bg-card/90 hover:shadow-lg hover:shadow-slate-900/5 transition-all duration-300",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1 mr-3",children:[i.jsx("div",{className:"flex items-center gap-2 mb-2",children:i.jsxs(yt,{className:"text-xs font-medium px-2 py-1 bg-indigo-100 text-indigo-800",children:[j.acoes.length," ",j.acoes.length===1?"Ação":"Ações"]})}),i.jsx("h4",{className:"font-bold text-foreground text-base sm:text-lg",children:j.nome}),i.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:[j.ambiente.nome,j.ambiente.area&&` (${j.ambiente.area.nome})`]})]}),i.jsxs("div",{className:"flex items-center gap-1 sm:gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[i.jsxs(de,{variant:"outline",size:"sm",onClick:()=>v(j),className:"rounded-xl shadow hover:shadow-md h-8 w-8 sm:h-9 sm:w-auto p-0 sm:px-3 sm:py-2",children:[i.jsx(CM,{className:"h-3 w-3 sm:h-4 sm:w-4 sm:mr-2"}),i.jsx("span",{className:"hidden sm:inline",children:"Editar"})]}),i.jsx(de,{variant:"destructive",size:"sm",onClick:()=>x(j.id),className:"rounded-xl shadow-lg hover:shadow-xl h-8 w-8 p-0 sm:h-9 sm:w-9",children:i.jsx(Cn,{className:"h-3 w-3 sm:h-4 sm:w-4"})})]})]})},j.id))})})}):i.jsxs("div",{className:"text-center py-8",children:[i.jsx("div",{className:"w-16 h-16 bg-muted rounded-full flex items-center justify-center mx-auto mb-4",children:i.jsx(Qu,{className:"h-8 w-8 text-muted-foreground/80"})}),i.jsx("h4",{className:"text-lg font-semibold text-foreground mb-2",children:"Nenhuma cena encontrada"}),i.jsx("p",{className:"text-muted-foreground max-w-sm mx-auto text-sm",children:c||d!=="todos"?"Tente ajustar os filtros de busca para encontrar o que procura.":"Comece adicionando sua primeira cena usando o formulário ao lado."})]})})]})})]}),i.jsx(bs,{previousPath:"/keypads",nextPath:"/projeto"})]})})})},wB=()=>{const e=qn();return f.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:i.jsxs("div",{className:"text-center",children:[i.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),i.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),i.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})};function jB(){const{user:e}=So(),{toast:t}=Kt(),r=Si(),[n,s]=f.useState([]),[o,a]=f.useState(!0);f.useEffect(()=>{(async()=>{if((e==null?void 0:e.role)!=="admin"){t({variant:"destructive",title:"Acesso negado",description:"A página de usuários é restrita a administradores."}),r("/",{replace:!0});return}await l()})()},[e]);const l=async()=>{a(!0);try{const u=await fetch("/api/users",{credentials:"same-origin"});if(u.status===401){r("/login",{replace:!0});return}if(u.status===403){t({variant:"destructive",title:"Acesso negado",description:"A página de usuários é restrita a administradores."}),r("/",{replace:!0});return}const d=await u.json();s((d==null?void 0:d.users)||[])}catch{t({variant:"destructive",title:"Erro",description:"Falha ao carregar usuários."})}finally{a(!1)}};async function c(u){if(confirm("Tem certeza que deseja excluir este usuário? Esta ação não pode ser desfeita."))try{const d=await fetch(`/api/users/${u}`,{method:"DELETE",credentials:"same-origin",headers:{Accept:"application/json"}}),h=await d.json();d.ok&&(h!=null&&h.ok||h!=null&&h.success)?(s(m=>m.filter(p=>p.id!==u)),t({title:"Sucesso!",description:"Usuário excluído."})):t({variant:"destructive",title:"Erro",description:(h==null?void 0:h.error)||(h==null?void 0:h.message)||"Falha ao excluir usuário."})}catch{t({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}}return i.jsx(kr,{children:i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[i.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-10",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-purple-600 to-violet-600 rounded-3xl flex items-center justify-center shadow-lg shadow-purple-500/25",children:i.jsx(Yu,{className:"w-8 h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Gerenciar Usuários"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl",children:"Crie, gerencie e defina as permissões de acesso para os usuários do sistema."})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-purple-600 to-violet-600 rounded-full shadow-sm"})]}),i.jsx(de,{asChild:!0,className:"rounded-xl shadow-lg hover:shadow-xl transition-all duration-300",children:i.jsxs(pv,{to:"/usuarios/novo",children:[i.jsx(Tp,{className:"h-4 w-4 mr-2"}),"Novo Usuário"]})})]}),i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},children:i.jsxs(ot,{className:"border-0 shadow-sm rounded-3xl bg-card/50 backdrop-blur-sm",children:[i.jsx(it,{className:"border-0 pb-2",children:i.jsxs(gt,{className:"flex items-center justify-between text-xl",children:[i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Yu,{className:"h-5 w-5 text-primary"}),"Usuários do Sistema"]}),i.jsxs(yt,{variant:"secondary",className:"text-xs",children:[n.length," ",n.length===1?"usuário":"usuários"]})]})}),i.jsx(at,{children:o?i.jsx("p",{className:"text-sm text-muted-foreground",children:"Carregando…"}):n.length===0?i.jsxs("div",{className:"text-center py-8",children:[i.jsx(Yu,{className:"h-12 w-12 text-muted-foreground mx-auto mb-3"}),i.jsx("p",{className:"text-muted-foreground",children:"Nenhum usuário cadastrado ainda."}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Adicione seu primeiro usuário usando o botão acima."})]}):i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"text-left border-b bg-muted/40",children:[i.jsx("th",{className:"py-2 px-3",children:"ID"}),i.jsx("th",{className:"py-2 px-3",children:"Usuário"}),i.jsx("th",{className:"py-2 px-3",children:"Email"}),i.jsx("th",{className:"py-2 px-3",children:"Função"}),i.jsx("th",{className:"py-2 px-3 text-right",children:"Ações"})]})}),i.jsx(Ir,{children:i.jsx("tbody",{children:n.map((u,d)=>i.jsxs(Ee.tr,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{delay:d*.05},className:"border-b",children:[i.jsx("td",{className:"py-2 px-3",children:u.id}),i.jsx("td",{className:"py-2 px-3",children:u.username}),i.jsx("td",{className:"py-2 px-3",children:u.email}),i.jsx("td",{className:"py-2 px-3",children:i.jsx("span",{className:`px-2 py-1 text-xs rounded-full ${u.role==="admin"?"bg-red-100 text-red-700":"bg-primary/10 text-primary"}`,children:u.role})}),i.jsx("td",{className:"py-2 px-3 text-right",children:u.is_current?i.jsx("span",{className:"text-muted-foreground text-xs",children:"Usuário atual"}):i.jsxs(de,{variant:"destructive",size:"sm",onClick:()=>c(u.id),className:"rounded-xl shadow-lg hover:shadow-xl transition-all duration-300",children:[i.jsx(Cn,{className:"h-4 w-4 mr-1"})," Excluir"]})})]},u.id))})})]})})})]})})]})})})}function SB(){const{toast:e}=Kt(),t=Si(),{projeto:r}=Jr();r!=null&&r.id;const[n,s]=f.useState(""),[o,a]=f.useState(""),[l,c]=f.useState(""),[u,d]=f.useState("user"),[h,m]=f.useState(!1);f.useEffect(()=>{(async()=>{var b;try{const y=await(await fetch("/api/session",{credentials:"include"})).json();if(!(y!=null&&y.authenticated)){t("/login",{replace:!0});return}if(((b=y==null?void 0:y.user)==null?void 0:b.role)!=="admin"){e({variant:"destructive",title:"Acesso negado",description:"Somente administradores podem criar usuários."}),t("/usuarios",{replace:!0});return}}catch{t("/",{replace:!0})}})()},[t,e]);async function p(b){b.preventDefault(),m(!0);try{const g=await fetch("/api/users",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({username:n.trim(),email:o.trim(),password:l,role:u})}),y=await g.json();g.ok&&(y!=null&&y.ok||y!=null&&y.success)?(e({title:"Usuário criado!",description:"Cadastro realizado com sucesso."}),t("/usuarios")):e({variant:"destructive",title:"Erro",description:(y==null?void 0:y.error)||(y==null?void 0:y.message)||"Falha ao criar usuário."})}catch{e({variant:"destructive",title:"Erro",description:"Falha ao se conectar ao servidor."})}finally{m(!1)}}return i.jsx(kr,{children:i.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/30 to-indigo-50/20 dark:from-background dark:via-background/40 dark:to-primary/25",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-8",children:[i.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 mb-10",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-purple-600 to-violet-600 rounded-3xl flex items-center justify-center shadow-lg shadow-purple-500/25",children:i.jsx(Tp,{className:"w-8 h-8 text-white"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Novo Usuário"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl",children:"Crie uma nova conta de acesso para o sistema."})]})]}),i.jsx("div",{className:"h-1 w-32 bg-gradient-to-r from-purple-600 to-violet-600 rounded-full shadow-sm"})]}),i.jsx(de,{variant:"secondary",asChild:!0,className:"rounded-xl shadow-lg hover:shadow-xl transition-all duration-300",children:i.jsxs(pv,{to:"/usuarios",children:[i.jsx(nM,{className:"h-4 w-4 mr-1"}),"Voltar"]})})]}),i.jsx(Ee.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"max-w-lg mx-auto",children:i.jsxs(ot,{className:"border-0 shadow-lg rounded-3xl bg-card/50 backdrop-blur-sm",children:[i.jsx(it,{className:"border-0",children:i.jsxs(gt,{className:"flex items-center gap-2 text-xl",children:[i.jsx(Tp,{className:"h-5 w-5 text-primary"}),"Registrar Novo Usuário"]})}),i.jsx(at,{children:i.jsxs("form",{className:"space-y-4",onSubmit:p,children:[i.jsxs("div",{children:[i.jsx(le,{htmlFor:"username",children:"Nome de Usuário"}),i.jsx(Oe,{id:"username",value:n,onChange:b=>s(b.target.value),required:!0,autoComplete:"username"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"email",children:"Email"}),i.jsx(Oe,{id:"email",type:"email",value:o,onChange:b=>a(b.target.value),required:!0,autoComplete:"email"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"password",children:"Senha"}),i.jsx(Oe,{id:"password",type:"password",value:l,onChange:b=>c(b.target.value),required:!0,autoComplete:"new-password"})]}),i.jsxs("div",{children:[i.jsx(le,{htmlFor:"role",children:"Função"}),i.jsxs("select",{id:"role",className:"w-full h-10 px-3 rounded-md border bg-background",value:u,onChange:b=>d(b.target.value),children:[i.jsx("option",{value:"user",children:"Usuário"}),i.jsx("option",{value:"admin",children:"Administrador"})]})]}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsx(de,{type:"submit",disabled:h,className:"rounded-xl shadow-lg hover:shadow-xl transition-all duration-300",children:"Criar Usuário"})})]})})]})})]})})})}function NB(){const{loadSession:e}=So();return f.useEffect(()=>{e()},[e]),null}function CB(){const{fetchProjeto:e,clearProjeto:t}=Jr(),{user:r,loading:n}=So();return f.useEffect(()=>{n||(r?e():t())},[n,r,e,t]),null}const kB=new W5;function EB(){return i.jsxs(eI,{children:[i.jsx(Qt,{path:"/login",element:i.jsx(M$,{})}),i.jsx(Qt,{path:"/",element:i.jsx(un,{children:i.jsx(N8,{})})}),i.jsx(Qt,{path:"/areas",element:i.jsx(un,{children:i.jsx(C8,{})})}),i.jsx(Qt,{path:"/ambientes",element:i.jsx(un,{children:i.jsx(k8,{})})}),i.jsx(Qt,{path:"/quadros",element:i.jsx(un,{children:i.jsx(E8,{})})}),i.jsx(Qt,{path:"/circuitos",element:i.jsx(un,{children:i.jsx(T8,{})})}),i.jsx(Qt,{path:"/modulos",element:i.jsx(un,{children:i.jsx(O8,{})})}),i.jsx(Qt,{path:"/vinculacao",element:i.jsx(un,{children:i.jsx(I8,{})})}),i.jsx(Qt,{path:"/keypads",element:i.jsx(un,{children:i.jsx(U8,{})})}),i.jsx(Qt,{path:"/cenas",element:i.jsx(un,{children:i.jsx(bB,{})})}),i.jsx(Qt,{path:"/projeto",element:i.jsx(un,{children:i.jsx(L8,{})})}),i.jsxs(Qt,{element:i.jsx(vI,{}),children:[i.jsx(Qt,{path:"/usuarios",element:i.jsx(jB,{})}),i.jsx(Qt,{path:"/usuarios/novo",element:i.jsx(SB,{})})]}),i.jsx(Qt,{path:"*",element:i.jsx(wB,{})})]})}const _B=()=>i.jsx(yI,{storageKey:"roehn-theme",defaultTheme:"light",children:i.jsx(Z5,{client:kB,children:i.jsxs(SC,{children:[i.jsx(c4,{}),i.jsx(H4,{}),i.jsxs(aI,{children:[i.jsx(NB,{}),i.jsx(CB,{}),i.jsx(EB,{})]})]})})});nN(document.getElementById("root")).render(i.jsx(_B,{})); diff --git a/backend/static/favicon.ico b/backend/static/favicon.ico new file mode 100644 index 0000000..dd5a126 Binary files /dev/null and b/backend/static/favicon.ico differ diff --git a/backend/static/index.html b/backend/static/index.html new file mode 100644 index 0000000..e9c81c6 --- /dev/null +++ b/backend/static/index.html @@ -0,0 +1,28 @@ + + + + + + Gerenciamento de Áreas - Sistema Profissional + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/backend/static/placeholder.svg b/backend/static/placeholder.svg new file mode 100644 index 0000000..e763910 --- /dev/null +++ b/backend/static/placeholder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/backend/static/robots.txt b/backend/static/robots.txt new file mode 100644 index 0000000..6018e70 --- /dev/null +++ b/backend/static/robots.txt @@ -0,0 +1,14 @@ +User-agent: Googlebot +Allow: / + +User-agent: Bingbot +Allow: / + +User-agent: Twitterbot +Allow: / + +User-agent: facebookexternalhit +Allow: / + +User-agent: * +Allow: / diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..f06235c --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/frontend/node_modules/esbuild/bin/esbuild b/frontend/node_modules/esbuild/bin/esbuild old mode 100644 new mode 100755 index 971ac09..288f768 Binary files a/frontend/node_modules/esbuild/bin/esbuild and b/frontend/node_modules/esbuild/bin/esbuild differ diff --git a/server.log b/server.log new file mode 100644 index 0000000..8552e87 --- /dev/null +++ b/server.log @@ -0,0 +1,13 @@ +Tabela QuadroEletrico existe com 0 registros + * Serving Flask app 'app.py' + * Debug mode: off +WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. + * Running on all addresses (0.0.0.0) + * Running on http://127.0.0.1:5000 + * Running on http://192.168.0.2:5000 +Press CTRL+C to quit +127.0.0.1 - - [10/Dec/2025 16:21:11] "GET /login HTTP/1.1" 200 - +127.0.0.1 - - [10/Dec/2025 16:21:11] "GET /static/assets/index-B2z0OTMZ.js HTTP/1.1" 200 - +127.0.0.1 - - [10/Dec/2025 16:21:11] "GET /static/assets/index-1-wYBxU_.css HTTP/1.1" 200 - +127.0.0.1 - - [10/Dec/2025 16:21:12] "GET /api/session HTTP/1.1" 200 - +127.0.0.1 - - [10/Dec/2025 16:21:12] "GET /api/session HTTP/1.1" 200 -