From 42258626b07a469d0b8b5b56230c87e00a15553d Mon Sep 17 00:00:00 2001 From: xboard Date: Sat, 21 Jun 2025 13:20:57 +0800 Subject: [PATCH] feat: enhance plan user statistics with active user count display --- .../Controllers/V2/Admin/PlanController.php | 10 +- public/assets/admin/assets/index.css | 2 +- public/assets/admin/assets/index.js | 14 +- public/assets/admin/assets/vendor.js | 125 +++++++++--------- 4 files changed, 82 insertions(+), 69 deletions(-) diff --git a/app/Http/Controllers/V2/Admin/PlanController.php b/app/Http/Controllers/V2/Admin/PlanController.php index 63c817f..18cb845 100644 --- a/app/Http/Controllers/V2/Admin/PlanController.php +++ b/app/Http/Controllers/V2/Admin/PlanController.php @@ -18,7 +18,15 @@ class PlanController extends Controller ->with([ 'group:id,name' ]) - ->withCount('users') + ->withCount([ + 'users', + 'users as active_users_count' => function ($query) { + $query->where(function ($q) { + $q->where('expired_at', '>', time()) + ->orWhereNull('expired_at'); + }); + } + ]) ->get(); return $this->success($plans); diff --git a/public/assets/admin/assets/index.css b/public/assets/admin/assets/index.css index 2f45863..0b06771 100644 --- a/public/assets/admin/assets/index.css +++ b/public/assets/admin/assets/index.css @@ -1 +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{--header-height: 4rem;--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%}.collapsibleDropdown{overflow:hidden}.collapsibleDropdown[data-state=open]{animation:slideDown .2s ease-out}.collapsibleDropdown[data-state=closed]{animation:slideUp .2s ease-out}@keyframes slideDown{0%{height:0}to{height:var(--radix-collapsible-content-height)}}@keyframes slideUp{0%{height:var(--radix-collapsible-content-height)}to{height:0}}*{border-color:hsl(var(--border))}body{min-height:100svh;width:100%;background-color:hsl(var(--background));color:hsl(var(--foreground))}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.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}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-left-1{left:-.25rem}.-right-1{right:-.25rem}.-right-5{right:-1.25rem}.-top-1{top:-.25rem}.-top-1\/2{top:-50%}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.left-5{left:1.25rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-5{right:1.25rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.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-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[-1\]{z-index:-1}.z-\[1\]{z-index:1}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.-m-0\.5{margin:-.125rem}.m-1{margin:.25rem}.m-auto{margin:auto}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.-ml-3{margin-left:-.75rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-auto{margin-right:auto}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.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}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-\[16\/9\]{aspect-ratio:16/9}.aspect-square{aspect-ratio:1 / 1}.size-10{width:2.5rem;height:2.5rem}.size-2\.5{width:.625rem;height:.625rem}.size-3{width:.75rem;height:.75rem}.size-3\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.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-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[100vh\]{height:100vh}.h-\[180px\]{height:180px}.h-\[1px\]{height:1px}.h-\[200px\]{height:200px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[90vh\]{height:90vh}.h-\[calc\(100\%-var\(--header-height\)\)\]{height:calc(100% - var(--header-height))}.h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.h-\[var\(--header-height\)\]{height:var(--header-height)}.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-12{max-height:3rem}.max-h-96{max-height:24rem}.max-h-\[150px\]{max-height:150px}.max-h-\[200px\]{max-height:200px}.max-h-\[250px\]{max-height:250px}.max-h-\[300px\]{max-height:300px}.max-h-\[90vh\]{max-height:90vh}.max-h-\[95\%\]{max-height:95%}.min-h-10{min-height:2.5rem}.min-h-6{min-height:1.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[200px\]{min-height:200px}.min-h-\[60px\]{min-height:60px}.min-h-svh{min-height:100svh}.w-0{width:0px}.w-1\.5{width:.375rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.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-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-40{width:10rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[150px\]{width:150px}.w-\[180px\]{width:180px}.w-\[1px\]{width:1px}.w-\[200px\]{width:200px}.w-\[250px\]{width:250px}.w-\[300px\]{width:300px}.w-\[400px\]{width:400px}.w-\[50px\]{width:50px}.w-\[60px\]{width:60px}.w-\[70px\]{width:70px}.w-\[80px\]{width:80px}.w-\[9\.5rem\]{width:9.5rem}.w-auto{width:auto}.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-20{min-width:5rem}.min-w-\[10em\]{min-width:10em}.min-w-\[3rem\]{min-width:3rem}.min-w-\[40px\]{min-width:40px}.min-w-\[4rem\]{min-width:4rem}.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-32{max-width:8rem}.max-w-4xl{max-width:56rem}.max-w-52{max-width:13rem}.max-w-6xl{max-width:72rem}.max-w-80{max-width:20rem}.max-w-\[150px\]{max-width:150px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[500px\]{max-width:500px}.max-w-\[60\%\]{max-width:60%}.max-w-\[600px\]{max-width:600px}.max-w-\[90\%\]{max-width:90%}.max-w-\[90vw\]{max-width:90vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-\[1\.2\]{flex:1.2}.flex-\[1\]{flex:1}.flex-\[2\]{flex:2}.flex-\[4\]{flex:4}.flex-\[5\]{flex:5}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.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-full{--tw-translate-x: -100%;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-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))}.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-full{--tw-translate-x: 100%;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-0{--tw-translate-y: 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))}.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-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))}.-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-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))}.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))}.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))}.scale-125{--tw-scale-x: 1.25;--tw-scale-y: 1.25;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 bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@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-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-help{cursor:help}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[100px_1fr\]{grid-template-columns:100px 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-2{row-gap:.5rem}.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-2\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.625rem * var(--tw-space-x-reverse));margin-left:calc(.625rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * 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-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * 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-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * 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))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * 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-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-wrap{text-wrap:wrap}.text-nowrap{text-wrap:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.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-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-lg{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-lg{border-top-right-radius:var(--radius);border-bottom-right-radius:var(--radius)}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-bl-none{border-bottom-left-radius:0}.rounded-br-none{border-bottom-right-radius:0}.rounded-tl-lg{border-top-left-radius:var(--radius)}.rounded-tl-none{border-top-left-radius:0}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-tr-lg{border-top-right-radius:var(--radius)}.rounded-tr-none{border-top-right-radius:0}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.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\/50{border-color:#3b82f680}.border-border{border-color:hsl(var(--border))}.border-border\/30{border-color:hsl(var(--border) / .3)}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-foreground\/10{border-color:hsl(var(--foreground) / .1)}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-muted-foreground\/25{border-color:hsl(var(--muted-foreground) / .25)}.border-orange-500\/50{border-color:#f9731680}.border-primary{border-color:hsl(var(--primary))}.border-primary\/40{border-color:hsl(var(--primary) / .4)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-l-slate-500{--tw-border-opacity: 1;border-left-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.border-l-transparent{border-left-color:transparent}.border-r-muted{border-right-color:hsl(var(--muted))}.border-t-transparent{border-top-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/20{background-color:#0003}.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-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-destructive\/15{background-color:hsl(var(--destructive) / .15)}.bg-destructive\/80{background-color:hsl(var(--destructive) / .8)}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/80{background-color:#10b981cc}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / 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-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-inherit{background-color:inherit}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary-foreground{background-color:hsl(var(--primary-foreground))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.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-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/50{background-color:hsl(var(--secondary) / .5)}.bg-slate-100\/80{background-color:#f1f5f9cc}.bg-transparent{background-color:transparent}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/80{background-color:#eab308cc}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-background\/95{--tw-gradient-from: hsl(var(--background) / .95) 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)}.via-background\/80{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background) / .8) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-background\/60{--tw-gradient-to: hsl(var(--background) / .6) var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-primary{fill:hsl(var(--primary))}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.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-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.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-0\.5{padding-bottom:.125rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.pl-3{padding-left:.75rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-10{padding-right:2.5rem}.pr-12{padding-right:3rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pr-7{padding-right:1.75rem}.pr-8{padding-right:2rem}.pr-9{padding-right:2.25rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-1\.5{padding-top:.375rem}.pt-16{padding-top:4rem}.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\.625rem\]{font-size:.625rem}.text-\[0\.7rem\]{font-size:.7rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[7rem\]{font-size:7rem}.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}.capitalize{text-transform:capitalize}.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-10{line-height:2.5rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.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-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-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / 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-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/70{color:hsl(var(--foreground) / .7)}.text-foreground\/90{color:hsl(var(--foreground) / .9)}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / 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-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/30{color:hsl(var(--muted-foreground) / .3)}.text-muted-foreground\/40{color:hsl(var(--muted-foreground) / .4)}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/70{color:hsl(var(--muted-foreground) / .7)}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / 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-primary\/90{color:hsl(var(--primary) / .9)}.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-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / 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-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.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-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-destructive\/50{--tw-shadow-color: hsl(var(--destructive) / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-emerald-500\/50{--tw-shadow-color: rgb(16 185 129 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-yellow-500\/50{--tw-shadow-color: rgb(234 179 8 / .5);--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-1{--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)}.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-gray-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity, 1))}.ring-gray-300\/20{--tw-ring-color: rgb(209 213 219 / .2)}.ring-green-500\/20{--tw-ring-color: rgb(34 197 94 / .2)}.ring-primary\/20{--tw-ring-color: hsl(var(--primary) / .2)}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.ring-offset-white{--tw-ring-offset-color: #fff}.blur{--tw-blur: blur(8px);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)}.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-\[1px\]{--tw-backdrop-blur: blur(1px);-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-\[margin\]{transition-property:margin;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[max-height\,padding\]{transition-property:max-height,padding;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-\[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}.delay-100{transition-delay:.1s}.delay-150{transition-delay:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@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}.zoom-in-95{--tw-enter-scale: .95}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-700{animation-duration:.7s}.delay-100{animation-delay:.1s}.delay-150{animation-delay:.15s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.running{animation-play-state:running}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}html{overflow-y:scroll}.sticky{position:sticky!important;z-index:2;background-color:hsl(var(--card))}.sticky.before\:right-0:before,.sticky.before\:left-0:before{content:"";position:absolute;top:0;bottom:0;width:2px;background:linear-gradient(to right,rgba(0,0,0,.08),transparent);opacity:1;transition:opacity .3s ease}.sticky.before\:right-0:before{right:-1px;background:linear-gradient(to right,rgba(0,0,0,.08),transparent)}.sticky.before\:right-0:after{content:"";position:absolute;top:0;right:-8px;bottom:0;width:8px;pointer-events:none;background:linear-gradient(to right,rgba(0,0,0,.05),transparent)}.sticky.before\:left-0:before{left:-1px;background:linear-gradient(to left,rgba(0,0,0,.08),transparent)}.sticky.before\:left-0:after{content:"";position:absolute;top:0;left:-8px;bottom:0;width:8px;pointer-events:none;background:linear-gradient(to left,rgba(0,0,0,.05),transparent)}.sticky:hover:before{opacity:.8}.dark .sticky.before\:right-0:before,.dark .sticky.before\:left-0:before{background:linear-gradient(to right,rgba(255,255,255,.05),transparent)}.dark .sticky.before\:right-0:after,.dark .sticky.before\:left-0:after{background:linear-gradient(to right,rgba(255,255,255,.03),transparent)}.\*\:\!inline-block>*{display:inline-block!important}.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}.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\:bottom-0:before{content:var(--tw-content);bottom:0}.before\:left-0:before{content:var(--tw-content);left:0}.before\:right-0:before{content:var(--tw-content);right:0}.before\:top-0:before{content:var(--tw-content);top:0}.before\:w-\[1px\]:before{content:var(--tw-content);width:1px}.before\:bg-border:before{content:var(--tw-content);background-color:hsl(var(--border))}.after\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:bottom-0:after{content:var(--tw-content);bottom:0}.after\:left-0:after{content:var(--tw-content);left:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:hidden:after{content:var(--tw-content);display:none}.after\:h-32:after{content:var(--tw-content);height:8rem}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:w-full:after{content:var(--tw-content);width:100%}.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))}.after\:bg-\[linear-gradient\(180deg\,_transparent_10\%\,_hsl\(var\(--background\)\)_70\%\)\]:after{content:var(--tw-content);background-image:linear-gradient(180deg,transparent 10%,hsl(var(--background)) 70%)}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.focus-within\:ring-1:focus-within{--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-within\:ring-ring:focus-within{--tw-ring-color: hsl(var(--ring))}.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\:rotate-180:hover{--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))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.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))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-background:hover{background-color:hsl(var(--background))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-200:hover{--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity, 1))}.hover\:bg-card\/80:hover{background-color:hsl(var(--card) / .8)}.hover\:bg-destructive\/10:hover{background-color:hsl(var(--destructive) / .1)}.hover\:bg-destructive\/25:hover{background-color:hsl(var(--destructive) / .25)}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-100:hover{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.hover\:bg-inherit:hover{background-color:inherit}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/40:hover{background-color:hsl(var(--muted) / .4)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-muted\/60:hover{background-color:hsl(var(--muted) / .6)}.hover\:bg-muted\/70:hover{background-color:hsl(var(--muted) / .7)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-200:hover{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary-foreground\/10:hover{background-color:hsl(var(--secondary-foreground) / .1)}.hover\:bg-secondary\/70:hover{background-color:hsl(var(--secondary) / .7)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-slate-200\/80:hover{background-color:#e2e8f0cc}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-yellow-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.hover\:bg-opacity-80:hover{--tw-bg-opacity: .8}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-foreground\/70:hover{color:hsl(var(--foreground) / .7)}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.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-black\/30:hover{--tw-shadow-color: rgb(0 0 0 / .3);--tw-shadow: var(--tw-shadow-colored)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:z-10:focus{z-index:10}.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-destructive:focus{color:hsl(var(--destructive))}.focus\:text-primary-foreground:focus{color:hsl(var(--primary-foreground))}.focus\:text-red-600:focus{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1: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(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\: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-red-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}.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-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--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\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;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))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:via-background\/90{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background) / .9) var(--tw-gradient-via-position), var(--tw-gradient-to)}.group:hover .group-hover\:to-background\/70{--tw-gradient-to: hsl(var(--background) / .7) var(--tw-gradient-to-position)}.group\/id:hover .group-hover\/id\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group[data-collapsed=true] .group-\[\[data-collapsed\=true\]\]\:justify-center{justify-content:center}.group[data-collapsed=true] .group-\[\[data-collapsed\=true\]\]\:px-2{padding-left:.5rem;padding-right:.5rem}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\:focus-visible\]\:outline-none:has(:focus-visible){outline:2px solid transparent;outline-offset:2px}.has-\[\:focus-visible\]\:ring-1:has(: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)}.has-\[\:focus-visible\]\:ring-neutral-950:has(:focus-visible){--tw-ring-opacity: 1;--tw-ring-color: rgb(10 10 10 / var(--tw-ring-opacity, 1))}.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}.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-4[data-state=checked]{--tw-translate-x: 1rem;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]{--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))}@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-\[state\=dragging\]\:cursor-grabbing[data-state=dragging]{cursor:grabbing}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[active\]\:bg-accent\/50[data-active]{background-color:hsl(var(--accent) / .5)}.data-\[disabled\]\:bg-muted-foreground[data-disabled],.data-\[fixed\]\:bg-muted-foreground[data-fixed]{background-color:hsl(var(--muted-foreground))}.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\=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-\[collapsed\=true\]\:py-2[data-collapsed=true]{padding-top:.5rem;padding-bottom:.5rem}.data-\[disabled\]\:text-muted[data-disabled],.data-\[fixed\]\:text-muted[data-fixed]{color:hsl(var(--muted))}.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\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--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)}.data-\[state\=closed\]\:duration-300[data-state=closed],.data-\[state\=open\]\:duration-300[data-state=open]{transition-duration:.3s}.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]{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],.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]{--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\=closed\]\:duration-300[data-state=closed],.data-\[state\=open\]\:duration-300[data-state=open]{animation-duration:.3s}.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-\[disabled\]\:hover\:bg-muted-foreground:hover[data-disabled],.data-\[fixed\]\:hover\:bg-muted-foreground:hover[data-fixed]{background-color:hsl(var(--muted-foreground))}.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-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))}.dark\:border-amber-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(120 53 15 / var(--tw-border-opacity, 1))}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.dark\:border-blue-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 58 138 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-red-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(127 29 29 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-amber-950\/30:is(.dark *){background-color:#451a034d}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-green-500\/10:is(.dark *){background-color:#22c55e1a}.dark\:bg-red-500\/10:is(.dark *){background-color:#ef44441a}.dark\:bg-red-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity, 1))}.dark\:bg-red-950\/30:is(.dark *){background-color:#450a0a4d}.dark\:bg-yellow-500\/10:is(.dark *){background-color:#eab3081a}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-amber-200:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / 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-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:ring-gray-700:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity, 1))}.dark\:ring-gray-800:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity, 1))}.dark\:placeholder\:text-gray-500:is(.dark *)::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:placeholder\:text-gray-500:is(.dark *)::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-blue-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 64 175 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-blue-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(153 27 27 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-red-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:has-\[\:focus-visible\]\:ring-neutral-300:has(:focus-visible):is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(212 212 212 / var(--tw-ring-opacity, 1))}@media (min-width: 640px){.sm\:absolute{position:absolute}.sm\:inset-auto{inset:auto}.sm\:bottom-\[calc\(100\%\+10px\)\]{bottom:calc(100% + 10px)}.sm\:left-0{left:0}.sm\:right-0{right:0}.sm\:my-0{margin-top:0;margin-bottom:0}.sm\:my-4{margin-top:1rem;margin-bottom:1rem}.sm\:mt-0{margin-top:0}.sm\:hidden{display:none}.sm\:h-\[80vh\]{height:80vh}.sm\:h-full{height:100%}.sm\:max-h-\[500px\]{max-height:500px}.sm\:max-h-\[600px\]{max-height:600px}.sm\:max-h-\[700px\]{max-height:700px}.sm\:max-h-\[800px\]{max-height:800px}.sm\:w-48{width:12rem}.sm\:w-\[350px\]{width:350px}.sm\:w-\[540px\]{width:540px}.sm\:w-\[90vw\]{width:90vw}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-72{max-width:18rem}.sm\:max-w-\[1025px\]{max-width:1025px}.sm\:max-w-\[425px\]{max-width:425px}.sm\:max-w-\[500px\]{max-width:500px}.sm\:max-w-\[700px\]{max-width:700px}.sm\:max-w-lg{max-width:32rem}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-xl{max-width:36rem}.sm\:translate-y-5{--tw-translate-y: 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))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-6{gap:1.5rem}.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\:rounded-lg{border-radius:var(--radius)}.sm\:p-6{padding:1.5rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:relative{position:relative}.md\:bottom-0{bottom:0}.md\:right-8{right:2rem}.md\:right-auto{right:auto}.md\:top-8{top:2rem}.md\:col-span-1{grid-column:span 1 / span 1}.md\:ml-14{margin-left:3.5rem}.md\:ml-64{margin-left:16rem}.md\:block{display:block}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:hidden{display:none}.md\:h-full{height:100%}.md\:h-svh{height:100svh}.md\:w-14{width:3.5rem}.md\:w-32{width:8rem}.md\:w-64{width:16rem}.md\:w-80{width:20rem}.md\:w-\[420px\]{width:420px}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:max-w-\[31rem\]{max-width:31rem}.md\: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))}.md\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.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\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:overflow-y-hidden{overflow-y:hidden}.md\:border-none{border-style:none}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\:pt-0{padding-top:0}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:opacity-0{opacity:0}.after\:md\:block:after{content:var(--tw-content);display:block}}@media (min-width: 1024px){.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-1\/5{width:20%}.lg\:w-\[250px\]{width:250px}.lg\:max-w-none{max-width: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\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:flex-col{flex-direction:column}.lg\:gap-8{gap:2rem}.lg\:space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(0px * var(--tw-space-x-reverse));margin-left:calc(0px * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(3rem * var(--tw-space-x-reverse));margin-left:calc(3rem * calc(1 - var(--tw-space-x-reverse)))}.lg\: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))}.lg\: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))}.lg\:p-8{padding:2rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-3{padding-left:.75rem;padding-right:.75rem}}@media (min-width: 1280px){.xl\:mr-2{margin-right:.5rem}.xl\:flex{display:flex}.xl\:inline-flex{display:inline-flex}.xl\:h-10{height:2.5rem}.xl\:w-60{width:15rem}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:justify-start{justify-content:flex-start}.xl\:px-3{padding-left:.75rem;padding-right:.75rem}.xl\:py-2{padding-top:.5rem;padding-bottom:.5rem}}.\[\&\:\:-webkit-calendar-picker-indicator\]\:hidden::-webkit-calendar-picker-indicator{display:none}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-md:has(>.day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-md:has(>.day-range-start){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:calc(var(--radius) - 2px)}.\[\&\: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}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;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))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>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))}.\[\&_\[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}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_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} +*,: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{--header-height: 4rem;--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%}.collapsibleDropdown{overflow:hidden}.collapsibleDropdown[data-state=open]{animation:slideDown .2s ease-out}.collapsibleDropdown[data-state=closed]{animation:slideUp .2s ease-out}@keyframes slideDown{0%{height:0}to{height:var(--radix-collapsible-content-height)}}@keyframes slideUp{0%{height:var(--radix-collapsible-content-height)}to{height:0}}*{border-color:hsl(var(--border))}body{min-height:100svh;width:100%;background-color:hsl(var(--background));color:hsl(var(--foreground))}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.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}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-left-1{left:-.25rem}.-right-1{right:-.25rem}.-right-5{right:-1.25rem}.-top-1{top:-.25rem}.-top-1\/2{top:-50%}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.left-5{left:1.25rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-5{right:1.25rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.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-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[-1\]{z-index:-1}.z-\[1\]{z-index:1}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.-m-0\.5{margin:-.125rem}.m-1{margin:.25rem}.m-auto{margin:auto}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.-ml-3{margin-left:-.75rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-auto{margin-right:auto}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.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}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-\[16\/9\]{aspect-ratio:16/9}.aspect-square{aspect-ratio:1 / 1}.size-10{width:2.5rem;height:2.5rem}.size-2\.5{width:.625rem;height:.625rem}.size-3{width:.75rem;height:.75rem}.size-3\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.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-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[100vh\]{height:100vh}.h-\[180px\]{height:180px}.h-\[1px\]{height:1px}.h-\[200px\]{height:200px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[90vh\]{height:90vh}.h-\[calc\(100\%-var\(--header-height\)\)\]{height:calc(100% - var(--header-height))}.h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.h-\[var\(--header-height\)\]{height:var(--header-height)}.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-12{max-height:3rem}.max-h-96{max-height:24rem}.max-h-\[150px\]{max-height:150px}.max-h-\[200px\]{max-height:200px}.max-h-\[250px\]{max-height:250px}.max-h-\[300px\]{max-height:300px}.max-h-\[90vh\]{max-height:90vh}.max-h-\[95\%\]{max-height:95%}.min-h-10{min-height:2.5rem}.min-h-6{min-height:1.5rem}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[200px\]{min-height:200px}.min-h-\[60px\]{min-height:60px}.min-h-svh{min-height:100svh}.w-0{width:0px}.w-1\.5{width:.375rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.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-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-4\/5{width:80%}.w-40{width:10rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[150px\]{width:150px}.w-\[180px\]{width:180px}.w-\[1px\]{width:1px}.w-\[200px\]{width:200px}.w-\[250px\]{width:250px}.w-\[300px\]{width:300px}.w-\[400px\]{width:400px}.w-\[50px\]{width:50px}.w-\[60px\]{width:60px}.w-\[70px\]{width:70px}.w-\[80px\]{width:80px}.w-\[9\.5rem\]{width:9.5rem}.w-auto{width:auto}.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-20{min-width:5rem}.min-w-\[10em\]{min-width:10em}.min-w-\[3rem\]{min-width:3rem}.min-w-\[40px\]{min-width:40px}.min-w-\[4rem\]{min-width:4rem}.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-32{max-width:8rem}.max-w-4xl{max-width:56rem}.max-w-52{max-width:13rem}.max-w-6xl{max-width:72rem}.max-w-80{max-width:20rem}.max-w-\[150px\]{max-width:150px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[500px\]{max-width:500px}.max-w-\[60\%\]{max-width:60%}.max-w-\[600px\]{max-width:600px}.max-w-\[90\%\]{max-width:90%}.max-w-\[90vw\]{max-width:90vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-\[1\.2\]{flex:1.2}.flex-\[1\]{flex:1}.flex-\[2\]{flex:2}.flex-\[4\]{flex:4}.flex-\[5\]{flex:5}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.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-full{--tw-translate-x: -100%;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-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))}.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-full{--tw-translate-x: 100%;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-0{--tw-translate-y: 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))}.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-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))}.-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-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))}.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))}.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))}.scale-125{--tw-scale-x: 1.25;--tw-scale-y: 1.25;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 bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@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-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-help{cursor:help}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[100px_1fr\]{grid-template-columns:100px 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-2{row-gap:.5rem}.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-2\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.625rem * var(--tw-space-x-reverse));margin-left:calc(.625rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * 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-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * 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-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * 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))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * 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-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-wrap{text-wrap:wrap}.text-nowrap{text-wrap:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.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-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-lg{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-lg{border-top-right-radius:var(--radius);border-bottom-right-radius:var(--radius)}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-bl-none{border-bottom-left-radius:0}.rounded-br-none{border-bottom-right-radius:0}.rounded-tl-lg{border-top-left-radius:var(--radius)}.rounded-tl-none{border-top-left-radius:0}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-tr-lg{border-top-right-radius:var(--radius)}.rounded-tr-none{border-top-right-radius:0}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.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\/50{border-color:#3b82f680}.border-border{border-color:hsl(var(--border))}.border-border\/30{border-color:hsl(var(--border) / .3)}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-foreground\/10{border-color:hsl(var(--foreground) / .1)}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-muted-foreground\/25{border-color:hsl(var(--muted-foreground) / .25)}.border-orange-500\/50{border-color:#f9731680}.border-primary{border-color:hsl(var(--primary))}.border-primary\/40{border-color:hsl(var(--primary) / .4)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-l-slate-500{--tw-border-opacity: 1;border-left-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.border-l-transparent{border-left-color:transparent}.border-r-muted{border-right-color:hsl(var(--muted))}.border-t-transparent{border-top-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/20{background-color:#0003}.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-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-destructive\/15{background-color:hsl(var(--destructive) / .15)}.bg-destructive\/80{background-color:hsl(var(--destructive) / .8)}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/80{background-color:#10b981cc}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / 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-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-inherit{background-color:inherit}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary-foreground{background-color:hsl(var(--primary-foreground))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.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-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/50{background-color:hsl(var(--secondary) / .5)}.bg-slate-100\/80{background-color:#f1f5f9cc}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/80{background-color:#eab308cc}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-background\/95{--tw-gradient-from: hsl(var(--background) / .95) 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)}.via-background\/80{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background) / .8) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-background\/60{--tw-gradient-to: hsl(var(--background) / .6) var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-primary{fill:hsl(var(--primary))}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.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-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.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-0\.5{padding-bottom:.125rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.pl-3{padding-left:.75rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-10{padding-right:2.5rem}.pr-12{padding-right:3rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pr-7{padding-right:1.75rem}.pr-8{padding-right:2rem}.pr-9{padding-right:2.25rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-1\.5{padding-top:.375rem}.pt-16{padding-top:4rem}.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\.625rem\]{font-size:.625rem}.text-\[0\.7rem\]{font-size:.7rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[7rem\]{font-size:7rem}.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}.capitalize{text-transform:capitalize}.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-10{line-height:2.5rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.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-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-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / 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-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/70{color:hsl(var(--foreground) / .7)}.text-foreground\/90{color:hsl(var(--foreground) / .9)}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / 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-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/30{color:hsl(var(--muted-foreground) / .3)}.text-muted-foreground\/40{color:hsl(var(--muted-foreground) / .4)}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/70{color:hsl(var(--muted-foreground) / .7)}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / 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-primary\/90{color:hsl(var(--primary) / .9)}.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-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / 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-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.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-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-destructive\/50{--tw-shadow-color: hsl(var(--destructive) / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-emerald-500\/50{--tw-shadow-color: rgb(16 185 129 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-yellow-500\/50{--tw-shadow-color: rgb(234 179 8 / .5);--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-1{--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)}.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-gray-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity, 1))}.ring-gray-300\/20{--tw-ring-color: rgb(209 213 219 / .2)}.ring-green-500\/20{--tw-ring-color: rgb(34 197 94 / .2)}.ring-primary\/20{--tw-ring-color: hsl(var(--primary) / .2)}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.ring-offset-white{--tw-ring-offset-color: #fff}.blur{--tw-blur: blur(8px);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)}.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-\[1px\]{--tw-backdrop-blur: blur(1px);-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-\[margin\]{transition-property:margin;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[max-height\,padding\]{transition-property:max-height,padding;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-\[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}.delay-100{transition-delay:.1s}.delay-150{transition-delay:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@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}.zoom-in-95{--tw-enter-scale: .95}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-700{animation-duration:.7s}.delay-100{animation-delay:.1s}.delay-150{animation-delay:.15s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.running{animation-play-state:running}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}html{overflow-y:scroll}.sticky{position:sticky!important;z-index:2;background-color:hsl(var(--card))}.sticky.before\:right-0:before,.sticky.before\:left-0:before{content:"";position:absolute;top:0;bottom:0;width:2px;background:linear-gradient(to right,rgba(0,0,0,.08),transparent);opacity:1;transition:opacity .3s ease}.sticky.before\:right-0:before{right:-1px;background:linear-gradient(to right,rgba(0,0,0,.08),transparent)}.sticky.before\:right-0:after{content:"";position:absolute;top:0;right:-8px;bottom:0;width:8px;pointer-events:none;background:linear-gradient(to right,rgba(0,0,0,.05),transparent)}.sticky.before\:left-0:before{left:-1px;background:linear-gradient(to left,rgba(0,0,0,.08),transparent)}.sticky.before\:left-0:after{content:"";position:absolute;top:0;left:-8px;bottom:0;width:8px;pointer-events:none;background:linear-gradient(to left,rgba(0,0,0,.05),transparent)}.sticky:hover:before{opacity:.8}.dark .sticky.before\:right-0:before,.dark .sticky.before\:left-0:before{background:linear-gradient(to right,rgba(255,255,255,.05),transparent)}.dark .sticky.before\:right-0:after,.dark .sticky.before\:left-0:after{background:linear-gradient(to right,rgba(255,255,255,.03),transparent)}.\*\:\!inline-block>*{display:inline-block!important}.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}.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\:bottom-0:before{content:var(--tw-content);bottom:0}.before\:left-0:before{content:var(--tw-content);left:0}.before\:right-0:before{content:var(--tw-content);right:0}.before\:top-0:before{content:var(--tw-content);top:0}.before\:w-\[1px\]:before{content:var(--tw-content);width:1px}.before\:bg-border:before{content:var(--tw-content);background-color:hsl(var(--border))}.after\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:bottom-0:after{content:var(--tw-content);bottom:0}.after\:left-0:after{content:var(--tw-content);left:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:hidden:after{content:var(--tw-content);display:none}.after\:h-32:after{content:var(--tw-content);height:8rem}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:w-full:after{content:var(--tw-content);width:100%}.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))}.after\:bg-\[linear-gradient\(180deg\,_transparent_10\%\,_hsl\(var\(--background\)\)_70\%\)\]:after{content:var(--tw-content);background-image:linear-gradient(180deg,transparent 10%,hsl(var(--background)) 70%)}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.focus-within\:ring-1:focus-within{--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-within\:ring-ring:focus-within{--tw-ring-color: hsl(var(--ring))}.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\:rotate-180:hover{--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))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.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))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-accent\/50:hover{background-color:hsl(var(--accent) / .5)}.hover\:bg-background:hover{background-color:hsl(var(--background))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-200:hover{--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity, 1))}.hover\:bg-card\/80:hover{background-color:hsl(var(--card) / .8)}.hover\:bg-destructive\/10:hover{background-color:hsl(var(--destructive) / .1)}.hover\:bg-destructive\/25:hover{background-color:hsl(var(--destructive) / .25)}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-100:hover{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.hover\:bg-inherit:hover{background-color:inherit}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/40:hover{background-color:hsl(var(--muted) / .4)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-muted\/60:hover{background-color:hsl(var(--muted) / .6)}.hover\:bg-muted\/70:hover{background-color:hsl(var(--muted) / .7)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-200:hover{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary-foreground\/10:hover{background-color:hsl(var(--secondary-foreground) / .1)}.hover\:bg-secondary\/70:hover{background-color:hsl(var(--secondary) / .7)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-200\/80:hover{background-color:#e2e8f0cc}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-yellow-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.hover\:bg-opacity-80:hover{--tw-bg-opacity: .8}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-foreground\/70:hover{color:hsl(var(--foreground) / .7)}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.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-black\/30:hover{--tw-shadow-color: rgb(0 0 0 / .3);--tw-shadow: var(--tw-shadow-colored)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:z-10:focus{z-index:10}.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-destructive:focus{color:hsl(var(--destructive))}.focus\:text-primary-foreground:focus{color:hsl(var(--primary-foreground))}.focus\:text-red-600:focus{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1: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(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\: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-red-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}.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-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--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\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;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))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:via-background\/90{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background) / .9) var(--tw-gradient-via-position), var(--tw-gradient-to)}.group:hover .group-hover\:to-background\/70{--tw-gradient-to: hsl(var(--background) / .7) var(--tw-gradient-to-position)}.group\/id:hover .group-hover\/id\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group[data-collapsed=true] .group-\[\[data-collapsed\=true\]\]\:justify-center{justify-content:center}.group[data-collapsed=true] .group-\[\[data-collapsed\=true\]\]\:px-2{padding-left:.5rem;padding-right:.5rem}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\:focus-visible\]\:outline-none:has(:focus-visible){outline:2px solid transparent;outline-offset:2px}.has-\[\:focus-visible\]\:ring-1:has(: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)}.has-\[\:focus-visible\]\:ring-neutral-950:has(:focus-visible){--tw-ring-opacity: 1;--tw-ring-color: rgb(10 10 10 / var(--tw-ring-opacity, 1))}.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}.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-4[data-state=checked]{--tw-translate-x: 1rem;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]{--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))}@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-\[state\=dragging\]\:cursor-grabbing[data-state=dragging]{cursor:grabbing}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[active\]\:bg-accent\/50[data-active]{background-color:hsl(var(--accent) / .5)}.data-\[disabled\]\:bg-muted-foreground[data-disabled],.data-\[fixed\]\:bg-muted-foreground[data-fixed]{background-color:hsl(var(--muted-foreground))}.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\=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-\[collapsed\=true\]\:py-2[data-collapsed=true]{padding-top:.5rem;padding-bottom:.5rem}.data-\[disabled\]\:text-muted[data-disabled],.data-\[fixed\]\:text-muted[data-fixed]{color:hsl(var(--muted))}.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\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--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)}.data-\[state\=closed\]\:duration-300[data-state=closed],.data-\[state\=open\]\:duration-300[data-state=open]{transition-duration:.3s}.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]{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],.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]{--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\=closed\]\:duration-300[data-state=closed],.data-\[state\=open\]\:duration-300[data-state=open]{animation-duration:.3s}.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-\[disabled\]\:hover\:bg-muted-foreground:hover[data-disabled],.data-\[fixed\]\:hover\:bg-muted-foreground:hover[data-fixed]{background-color:hsl(var(--muted-foreground))}.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-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))}.dark\:border-amber-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(120 53 15 / var(--tw-border-opacity, 1))}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.dark\:border-blue-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 58 138 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-red-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(127 29 29 / var(--tw-border-opacity, 1))}.dark\:border-yellow-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(113 63 18 / var(--tw-border-opacity, 1))}.dark\:bg-amber-950\/30:is(.dark *){background-color:#451a034d}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/30:is(.dark *){background-color:#1725544d}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-green-500\/10:is(.dark *){background-color:#22c55e1a}.dark\:bg-red-500\/10:is(.dark *){background-color:#ef44441a}.dark\:bg-red-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity, 1))}.dark\:bg-red-950\/30:is(.dark *){background-color:#450a0a4d}.dark\:bg-yellow-500\/10:is(.dark *){background-color:#eab3081a}.dark\:bg-yellow-950\/30:is(.dark *){background-color:#4220064d}.dark\:text-amber-200:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / 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-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:ring-gray-700:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity, 1))}.dark\:ring-gray-800:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity, 1))}.dark\:placeholder\:text-gray-500:is(.dark *)::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:placeholder\:text-gray-500:is(.dark *)::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-blue-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 64 175 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-blue-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(153 27 27 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-red-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:has-\[\:focus-visible\]\:ring-neutral-300:has(:focus-visible):is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(212 212 212 / var(--tw-ring-opacity, 1))}@media (min-width: 640px){.sm\:absolute{position:absolute}.sm\:inset-auto{inset:auto}.sm\:bottom-\[calc\(100\%\+10px\)\]{bottom:calc(100% + 10px)}.sm\:left-0{left:0}.sm\:right-0{right:0}.sm\:my-0{margin-top:0;margin-bottom:0}.sm\:my-4{margin-top:1rem;margin-bottom:1rem}.sm\:mt-0{margin-top:0}.sm\:hidden{display:none}.sm\:h-\[80vh\]{height:80vh}.sm\:h-full{height:100%}.sm\:max-h-\[500px\]{max-height:500px}.sm\:max-h-\[600px\]{max-height:600px}.sm\:max-h-\[700px\]{max-height:700px}.sm\:max-h-\[800px\]{max-height:800px}.sm\:w-48{width:12rem}.sm\:w-\[350px\]{width:350px}.sm\:w-\[540px\]{width:540px}.sm\:w-\[90vw\]{width:90vw}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-72{max-width:18rem}.sm\:max-w-\[1025px\]{max-width:1025px}.sm\:max-w-\[425px\]{max-width:425px}.sm\:max-w-\[500px\]{max-width:500px}.sm\:max-w-\[700px\]{max-width:700px}.sm\:max-w-lg{max-width:32rem}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-xl{max-width:36rem}.sm\:translate-y-5{--tw-translate-y: 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))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-0{gap:0px}.sm\:gap-6{gap:1.5rem}.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\:rounded-lg{border-radius:var(--radius)}.sm\:p-6{padding:1.5rem}.sm\:text-left{text-align:left}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:relative{position:relative}.md\:bottom-0{bottom:0}.md\:right-8{right:2rem}.md\:right-auto{right:auto}.md\:top-8{top:2rem}.md\:col-span-1{grid-column:span 1 / span 1}.md\:ml-14{margin-left:3.5rem}.md\:ml-64{margin-left:16rem}.md\:block{display:block}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:hidden{display:none}.md\:h-full{height:100%}.md\:h-svh{height:100svh}.md\:w-14{width:3.5rem}.md\:w-32{width:8rem}.md\:w-64{width:16rem}.md\:w-80{width:20rem}.md\:w-\[420px\]{width:420px}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:max-w-\[31rem\]{max-width:31rem}.md\: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))}.md\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.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\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:overflow-y-hidden{overflow-y:hidden}.md\:border-none{border-style:none}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\:pt-0{padding-top:0}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:opacity-0{opacity:0}.after\:md\:block:after{content:var(--tw-content);display:block}}@media (min-width: 1024px){.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-1\/5{width:20%}.lg\:w-\[250px\]{width:250px}.lg\:max-w-none{max-width: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\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:flex-col{flex-direction:column}.lg\:gap-8{gap:2rem}.lg\:space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(0px * var(--tw-space-x-reverse));margin-left:calc(0px * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(3rem * var(--tw-space-x-reverse));margin-left:calc(3rem * calc(1 - var(--tw-space-x-reverse)))}.lg\: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))}.lg\: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))}.lg\:p-8{padding:2rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-3{padding-left:.75rem;padding-right:.75rem}}@media (min-width: 1280px){.xl\:mr-2{margin-right:.5rem}.xl\:flex{display:flex}.xl\:inline-flex{display:inline-flex}.xl\:h-10{height:2.5rem}.xl\:w-60{width:15rem}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:justify-start{justify-content:flex-start}.xl\:px-3{padding-left:.75rem;padding-right:.75rem}.xl\:py-2{padding-top:.5rem;padding-bottom:.5rem}}.\[\&\:\:-webkit-calendar-picker-indicator\]\:hidden::-webkit-calendar-picker-indicator{display:none}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-md:has(>.day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-md:has(>.day-range-start){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:calc(var(--radius) - 2px)}.\[\&\: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}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;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))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>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))}.\[\&_\[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}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_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} diff --git a/public/assets/admin/assets/index.js b/public/assets/admin/assets/index.js index aec7ec8..e08bd58 100644 --- a/public/assets/admin/assets/index.js +++ b/public/assets/admin/assets/index.js @@ -1,19 +1,19 @@ -import{r as m,j as e,t as ki,c as Ti,I as qn,a as tt,S as mn,u as Rs,b as Di,d as un,R as ml,e as ul,f as Pi,F as Li,C as Ei,L as xl,T as hl,g as pl,h as Ii,i as Ri,k as Vi,l as $,z as x,m as V,n as Ne,o as we,p as le,q as fs,s as ke,v as Fi,w as Mi,O as xn,x as Oi,y as zi,A as $i,B as Ai,D as qi,E as Hi,Q as Ui,G as Ki,H as Bi,J as Gi,P as Wi,K as Yi,M as Ji,N as Qi,U as Xi,V as gl,W as fl,X as wa,Y as Ca,Z as hn,_ as ds,$ as Sa,a0 as ka,a1 as jl,a2 as vl,a3 as bl,a4 as pn,a5 as yl,a6 as Zi,a7 as Nl,a8 as _l,a9 as wl,aa as Cl,ab as at,ac as Sl,ad as eo,ae as kl,af as Tl,ag as so,ah as to,ai as ao,aj as no,ak as lo,al as ro,am as io,an as oo,ao as co,ap as mo,aq as uo,ar as Dl,as as xo,at as ho,au as nt,av as Pl,aw as po,ax as go,ay as Ll,az as gn,aA as fo,aB as jo,aC as Hn,aD as vo,aE as El,aF as bo,aG as Il,aH as yo,aI as No,aJ as _o,aK as wo,aL as Co,aM as So,aN as Rl,aO as ko,aP as To,aQ as Do,aR as He,aS as Po,aT as fn,aU as Lo,aV as Eo,aW as Vl,aX as Fl,aY as Ml,aZ as Io,a_ as Ro,a$ as Vo,b0 as Ol,b1 as Fo,b2 as jn,b3 as zl,b4 as Mo,b5 as $l,b6 as Oo,b7 as Al,b8 as zo,b9 as ql,ba as Hl,bb as $o,bc as Ao,bd as Ul,be as qo,bf as Ho,bg as Kl,bh as Uo,bi as Bl,bj as Ko,bk as Bo,bl as ps,bm as hs,bn as Ct,bo as Go,bp as Wo,bq as Yo,br as Jo,bs as Qo,bt as Xo,bu as Un,bv as Kn,bw as Zo,bx as ec,by as Gl,bz as sc,bA as tc,bB as sn,bC as Kt,bD as ac,bE as nc,bF as Wl,bG as lc,bH as rc,bI as Yl,bJ as ic,bK as oc,bL as Bn,bM as tn,bN as an,bO as cc,bP as dc,bQ as Jl,bR as mc,bS as uc,bT as xc,bU as ga,bV as nn,bW as Je,bX as fa,bY as hc,bZ as Ha,b_ as pc,b$ as Gn,c0 as We,c1 as $t,c2 as ma,c3 as ln,c4 as Ql,c5 as Qe,c6 as rs,c7 as Xl,c8 as Zl,c9 as gc,ca as fc,cb as jc,cc as vc,cd as bc,ce as er,cf as yc,cg as Nc,ch as ze,ci as Wn,cj as _c,ck as sr,cl as tr,cm as ar,cn as nr,co as lr,cp as rr,cq as wc,cr as Cc,cs as Sc,ct as Ta,cu as lt,cv as js,cw as vs,cx as kc,cy as Tc,cz as Dc,cA as Pc,cB as Lc,cC as Ec,cD as Ic,cE as Rc,cF as Vc,cG as rn,cH as vn,cI as bn,cJ as Fc,cK as Vs,cL as Fs,cM as Da,cN as Mc,cO as ja,cP as Oc,cQ as Yn,cR as ir,cS as Jn,cT as va,cU as zc,cV as $c,cW as Ac,cX as qc,cY as or,cZ as Hc,c_ as Uc,c$ as cr,d0 as on,d1 as dr,d2 as Kc,d3 as mr,d4 as ur,d5 as Bc,d6 as Gc,d7 as Wc,d8 as Yc,d9 as Jc}from"./vendor.js";import"./index.js";var ap=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function np(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Qc(s){if(s.__esModule)return s;var a=s.default;if(typeof a=="function"){var t=function l(){return this instanceof l?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};t.prototype=a.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(l){var n=Object.getOwnPropertyDescriptor(s,l);Object.defineProperty(t,l,n.get?n:{enumerable:!0,get:function(){return s[l]}})}),t}const Xc={theme:"system",setTheme:()=>null},xr=m.createContext(Xc);function Zc({children:s,defaultTheme:a="system",storageKey:t="vite-ui-theme",...l}){const[n,r]=m.useState(()=>localStorage.getItem(t)||a);m.useEffect(()=>{const c=window.document.documentElement;if(c.classList.remove("light","dark"),n==="system"){const u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";c.classList.add(u);return}c.classList.add(n)},[n]);const o={theme:n,setTheme:c=>{localStorage.setItem(t,c),r(c)}};return e.jsx(xr.Provider,{...l,value:o,children:s})}const ed=()=>{const s=m.useContext(xr);if(s===void 0)throw new Error("useTheme must be used within a ThemeProvider");return s},sd=function(){const a=typeof document<"u"&&document.createElement("link").relList;return a&&a.supports&&a.supports("modulepreload")?"modulepreload":"preload"}(),td=function(s,a){return new URL(s,a).href},Qn={},ve=function(a,t,l){let n=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),u=c?.nonce||c?.getAttribute("nonce");n=Promise.allSettled(t.map(i=>{if(i=td(i,l),i in Qn)return;Qn[i]=!0;const d=i.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!l)for(let S=o.length-1;S>=0;S--){const w=o[S];if(w.href===i&&(!d||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${h}`))return;const C=document.createElement("link");if(C.rel=d?"stylesheet":sd,d||(C.as="script"),C.crossOrigin="",C.href=i,u&&C.setAttribute("nonce",u),document.head.appendChild(C),d)return new Promise((S,w)=>{C.addEventListener("load",S),C.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${i}`)))})}))}function r(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return n.then(o=>{for(const c of o||[])c.status==="rejected"&&r(c.reason);return a().catch(r)})};function y(...s){return ki(Ti(s))}const St=tt("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),L=m.forwardRef(({className:s,variant:a,size:t,asChild:l=!1,children:n,disabled:r,loading:o=!1,leftSection:c,rightSection:u,...i},d)=>{const h=l?mn:"button";return e.jsxs(h,{className:y(St({variant:a,size:t,className:s})),disabled:o||r,ref:d,...i,children:[(c&&o||!c&&!u&&o)&&e.jsx(qn,{className:"mr-2 h-4 w-4 animate-spin"}),!o&&c&&e.jsx("div",{className:"mr-2",children:c}),n,!o&&u&&e.jsx("div",{className:"ml-2",children:u}),u&&o&&e.jsx(qn,{className:"ml-2 h-4 w-4 animate-spin"})]})});L.displayName="Button";function dt({className:s,minimal:a=!1}){const t=Rs(),l=Di(),n=l?.message||l?.statusText||"Unknown error occurred";return e.jsx("div",{className:y("h-svh w-full",s),children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[!a&&e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"500"}),e.jsxs("span",{className:"font-medium",children:["Oops! Something went wrong ",":')"]}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["We apologize for the inconvenience. ",e.jsx("br",{}),n]}),!a&&e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(L,{variant:"outline",onClick:()=>t(-1),children:"Go Back"}),e.jsx(L,{onClick:()=>t("/"),children:"Back to Home"})]})]})})}function Xn(){const s=Rs();return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"404"}),e.jsx("span",{className:"font-medium",children:"Oops! Page Not Found!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["It seems like the page you're looking for ",e.jsx("br",{}),"does not exist or might have been removed."]}),e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(L,{variant:"outline",onClick:()=>s(-1),children:"Go Back"}),e.jsx(L,{onClick:()=>s("/"),children:"Back to Home"})]})]})})}function ad(){return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"503"}),e.jsx("span",{className:"font-medium",children:"Website is under maintenance!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["The site is not available at the moment. ",e.jsx("br",{}),"We'll be back online shortly."]}),e.jsx("div",{className:"mt-6 flex gap-4",children:e.jsx(L,{variant:"outline",children:"Learn more"})})]})})}function nd(s){return typeof s>"u"}function ld(s){return s===null}function rd(s){return ld(s)||nd(s)}class id{storage;prefixKey;constructor(a){this.storage=a.storage,this.prefixKey=a.prefixKey}getKey(a){return`${this.prefixKey}${a}`.toUpperCase()}set(a,t,l=null){const n=JSON.stringify({value:t,time:Date.now(),expire:l!==null?new Date().getTime()+l*1e3:null});this.storage.setItem(this.getKey(a),n)}get(a,t=null){const l=this.storage.getItem(this.getKey(a));if(!l)return{value:t,time:0};try{const n=JSON.parse(l),{value:r,time:o,expire:c}=n;return rd(c)||c>new Date().getTime()?{value:r,time:o}:(this.remove(a),{value:t,time:0})}catch{return this.remove(a),{value:t,time:0}}}remove(a){this.storage.removeItem(this.getKey(a))}clear(){this.storage.clear()}}function hr({prefixKey:s="",storage:a=sessionStorage}){return new id({prefixKey:s,storage:a})}const pr="Xboard_",od=function(s={}){return hr({prefixKey:s.prefixKey||"",storage:localStorage})},cd=function(s={}){return hr({prefixKey:s.prefixKey||"",storage:sessionStorage})},Pa=od({prefixKey:pr});cd({prefixKey:pr});const gr="access_token";function Bt(){return Pa.get(gr)}function fr(){Pa.remove(gr)}const Zn=["/sign-in","/sign-in-2","/sign-up","/forgot-password","/otp"];function dd({children:s}){const a=Rs(),t=un(),l=Bt();return m.useEffect(()=>{if(!l.value&&!Zn.includes(t.pathname)){const n=encodeURIComponent(t.pathname+t.search);a(`/sign-in?redirect=${n}`)}},[l.value,t.pathname,t.search,a]),Zn.includes(t.pathname)||l.value?e.jsx(e.Fragment,{children:s}):null}const De=m.forwardRef(({className:s,orientation:a="horizontal",decorative:t=!0,...l},n)=>e.jsx(ml,{ref:n,decorative:t,orientation:a,className:y("shrink-0 bg-border",a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...l}));De.displayName=ml.displayName;const md=tt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Xs=m.forwardRef(({className:s,...a},t)=>e.jsx(ul,{ref:t,className:y(md(),s),...a}));Xs.displayName=ul.displayName;const Ce=Li,jr=m.createContext({}),v=({...s})=>e.jsx(jr.Provider,{value:{name:s.name},children:e.jsx(Ei,{...s})}),La=()=>{const s=m.useContext(jr),a=m.useContext(vr),{getFieldState:t,formState:l}=Pi(),n=t(s.name,l);if(!s)throw new Error("useFormField should be used within ");const{id:r}=a;return{id:r,name:s.name,formItemId:`${r}-form-item`,formDescriptionId:`${r}-form-item-description`,formMessageId:`${r}-form-item-message`,...n}},vr=m.createContext({}),f=m.forwardRef(({className:s,...a},t)=>{const l=m.useId();return e.jsx(vr.Provider,{value:{id:l},children:e.jsx("div",{ref:t,className:y("space-y-2",s),...a})})});f.displayName="FormItem";const j=m.forwardRef(({className:s,...a},t)=>{const{error:l,formItemId:n}=La();return e.jsx(Xs,{ref:t,className:y(l&&"text-destructive",s),htmlFor:n,...a})});j.displayName="FormLabel";const b=m.forwardRef(({...s},a)=>{const{error:t,formItemId:l,formDescriptionId:n,formMessageId:r}=La();return e.jsx(mn,{ref:a,id:l,"aria-describedby":t?`${n} ${r}`:`${n}`,"aria-invalid":!!t,...s})});b.displayName="FormControl";const M=m.forwardRef(({className:s,...a},t)=>{const{formDescriptionId:l}=La();return e.jsx("p",{ref:t,id:l,className:y("text-[0.8rem] text-muted-foreground",s),...a})});M.displayName="FormDescription";const P=m.forwardRef(({className:s,children:a,...t},l)=>{const{error:n,formMessageId:r}=La(),o=n?String(n?.message):a;return o?e.jsx("p",{ref:l,id:r,className:y("text-[0.8rem] font-medium text-destructive",s),...t,children:o}):null});P.displayName="FormMessage";const Yt=Ii,kt=m.forwardRef(({className:s,...a},t)=>e.jsx(xl,{ref:t,className:y("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...a}));kt.displayName=xl.displayName;const es=m.forwardRef(({className:s,...a},t)=>e.jsx(hl,{ref:t,className:y("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s),...a}));es.displayName=hl.displayName;const Ls=m.forwardRef(({className:s,...a},t)=>e.jsx(pl,{ref:t,className:y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));Ls.displayName=pl.displayName;function Se(s=void 0,a="YYYY-MM-DD HH:mm:ss"){return s==null?"":(Math.floor(s).toString().length===10&&(s=s*1e3),Ri(s).format(a))}function ud(s=void 0,a="YYYY-MM-DD"){return Se(s,a)}function gt(s){const a=typeof s=="string"?parseFloat(s):s;return isNaN(a)?"0.00":a.toFixed(2)}function Js(s,a=!0){if(s==null)return a?"¥0.00":"0.00";const t=typeof s=="string"?parseFloat(s):s;if(isNaN(t))return a?"¥0.00":"0.00";const n=(t/100).toFixed(2).replace(/\.?0+$/,r=>r.includes(".")?".00":r);return a?`¥${n}`:n}function ba(s){return new Promise(a=>{(async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(s);else{const l=document.createElement("textarea");l.value=s,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select();const n=document.execCommand("copy");if(document.body.removeChild(l),!n)throw new Error("execCommand failed")}a(!0)}catch(l){console.error(l),a(!1)}})()})}function Oe(s){const a=s/1024,t=a/1024,l=t/1024,n=l/1024;return n>=1?gt(n)+" TB":l>=1?gt(l)+" GB":t>=1?gt(t)+" MB":gt(a)+" KB"}const xd="locale";function hd(){return Pa.get(xd)}function br(){fr();const s=window.location.pathname,a=s&&!["/404","/sign-in"].includes(s),t=new URL(window.location.href),n=`${t.pathname.split("/")[1]?`/${t.pathname.split("/")[1]}`:""}#/sign-in`;window.location.href=n+(a?`?redirect=${s}`:"")}const pd=["/passport/auth/login","/passport/auth/token2Login","/passport/auth/register","/guest/comm/config","/passport/comm/sendEmailVerify","/passport/auth/forget"];function gd(){const s=window.settings?.base_url||"/";return s.endsWith("/")?s+"api/v2":s+"/api/v2"}const ft=Vi.create({baseURL:gd(),timeout:12e3,headers:{"Content-Type":"application/json"}});ft.interceptors.request.use(s=>{s.method?.toLowerCase()==="get"&&(s.params={...s.params,t:Date.now()});const a=Bt();if(!pd.includes(s.url?.split("?")[0]||"")){if(!a.value)return br(),Promise.reject({code:-1,message:"未登录"});s.headers.Authorization=a.value}return s.headers["Content-Language"]=hd().value||"zh-CN",s},s=>Promise.reject(s));ft.interceptors.response.use(s=>s?.data||{code:-1,message:"未知错误"},s=>{const a=s.response?.status,t=s.response?.data?.message;return(a===401||a===403)&&br(),$.error(t||{401:"登录已过期",403:"没有权限",404:"资源或接口不存在"}[a]||"未知异常"),Promise.reject(s.response?.data||{data:null,code:-1,message:"未知错误"})});const F={get:(s,a)=>ft.get(s,a),post:(s,a,t)=>ft.post(s,a,t),put:(s,a,t)=>ft.put(s,a,t),delete:(s,a)=>ft.delete(s,a)},fd="access_token";function jd(s){Pa.set(fd,s)}const Ws=window?.settings?.secure_path,ya={getStats:()=>F.get(Ws+"/monitor/api/stats"),getOverride:()=>F.get(Ws+"/stat/getOverride"),getOrderStat:s=>F.get(Ws+"/stat/getOrder",{params:s}),getStatsData:()=>F.get(Ws+"/stat/getStats"),getNodeTrafficData:s=>F.get(Ws+"/stat/getTrafficRank",{params:s}),getServerLastRank:()=>F.get(Ws+"/stat/getServerLastRank"),getServerYesterdayRank:()=>F.get(Ws+"/stat/getServerYesterdayRank")},Lt=window?.settings?.secure_path,At={getList:()=>F.get(Lt+"/theme/getThemes"),getConfig:s=>F.post(Lt+"/theme/getThemeConfig",{name:s}),updateConfig:(s,a)=>F.post(Lt+"/theme/saveThemeConfig",{name:s,config:a}),upload:s=>{const a=new FormData;return a.append("file",s),F.post(Lt+"/theme/upload",a,{headers:{"Content-Type":"multipart/form-data"}})},drop:s=>F.post(Lt+"/theme/delete",{name:s})},mt=window?.settings?.secure_path,Zs={getList:()=>F.get(mt+"/server/manage/getNodes"),save:s=>F.post(mt+"/server/manage/save",s),drop:s=>F.post(mt+"/server/manage/drop",s),copy:s=>F.post(mt+"/server/manage/copy",s),update:s=>F.post(mt+"/server/manage/update",s),sort:s=>F.post(mt+"/server/manage/sort",s)},Ua=window?.settings?.secure_path,rt={getList:()=>F.get(Ua+"/server/group/fetch"),save:s=>F.post(Ua+"/server/group/save",s),drop:s=>F.post(Ua+"/server/group/drop",s)},Ka=window?.settings?.secure_path,Ea={getList:()=>F.get(Ka+"/server/route/fetch"),save:s=>F.post(Ka+"/server/route/save",s),drop:s=>F.post(Ka+"/server/route/drop",s)},Ys=window?.settings?.secure_path,et={getList:()=>F.get(Ys+"/payment/fetch"),getMethodList:()=>F.get(Ys+"/payment/getPaymentMethods"),getMethodForm:s=>F.post(Ys+"/payment/getPaymentForm",s),save:s=>F.post(Ys+"/payment/save",s),drop:s=>F.post(Ys+"/payment/drop",s),updateStatus:s=>F.post(Ys+"/payment/show",s),sort:s=>F.post(Ys+"/payment/sort",s)},Et=window?.settings?.secure_path,Gt={getList:()=>F.get(`${Et}/notice/fetch`),save:s=>F.post(`${Et}/notice/save`,s),drop:s=>F.post(`${Et}/notice/drop`,{id:s}),updateStatus:s=>F.post(`${Et}/notice/show`,{id:s}),sort:s=>F.post(`${Et}/notice/sort`,{ids:s})},ut=window?.settings?.secure_path,bt={getList:()=>F.get(ut+"/knowledge/fetch"),getInfo:s=>F.get(ut+"/knowledge/fetch?id="+s),save:s=>F.post(ut+"/knowledge/save",s),drop:s=>F.post(ut+"/knowledge/drop",s),updateStatus:s=>F.post(ut+"/knowledge/show",s),sort:s=>F.post(ut+"/knowledge/sort",s)},It=window?.settings?.secure_path,ss={getList:()=>F.get(It+"/plan/fetch"),save:s=>F.post(It+"/plan/save",s),update:s=>F.post(It+"/plan/update",s),drop:s=>F.post(It+"/plan/drop",s),sort:s=>F.post(It+"/plan/sort",{ids:s})},xt=window?.settings?.secure_path,Qs={getList:s=>F.post(xt+"/order/fetch",s),getInfo:s=>F.post(xt+"/order/detail",s),markPaid:s=>F.post(xt+"/order/paid",s),makeCancel:s=>F.post(xt+"/order/cancel",s),update:s=>F.post(xt+"/order/update",s),assign:s=>F.post(xt+"/order/assign",s)},ta=window?.settings?.secure_path,Na={getList:s=>F.post(ta+"/coupon/fetch",s),save:s=>F.post(ta+"/coupon/generate",s),drop:s=>F.post(ta+"/coupon/drop",s),update:s=>F.post(ta+"/coupon/update",s)},ys=window?.settings?.secure_path,_s={getList:s=>F.post(`${ys}/user/fetch`,s),update:s=>F.post(`${ys}/user/update`,s),resetSecret:s=>F.post(`${ys}/user/resetSecret`,{id:s}),generate:s=>s.download_csv?F.post(`${ys}/user/generate`,s,{responseType:"blob"}):F.post(`${ys}/user/generate`,s),getStats:s=>F.post(`${ys}/stat/getStatUser`,s),destroy:s=>F.post(`${ys}/user/destroy`,{id:s}),sendMail:s=>F.post(`${ys}/user/sendMail`,s),dumpCSV:s=>F.post(`${ys}/user/dumpCSV`,s,{responseType:"blob"}),batchBan:s=>F.post(`${ys}/user/ban`,s)},aa=window?.settings?.secure_path,jt={getList:s=>F.post(aa+"/ticket/fetch",s),getInfo:s=>F.get(aa+"/ticket/fetch?id= "+s),reply:s=>F.post(aa+"/ticket/reply",s),close:s=>F.post(aa+"/ticket/close",{id:s})},Me=window?.settings?.secure_path,oe={getSettings:(s="")=>F.get(Me+"/config/fetch?key="+s),saveSettings:s=>F.post(Me+"/config/save",s),getEmailTemplate:()=>F.get(Me+"/config/getEmailTemplate"),sendTestMail:()=>F.post(Me+"/config/testSendMail"),setTelegramWebhook:()=>F.post(Me+"/config/setTelegramWebhook"),updateSystemConfig:s=>F.post(Me+"/config/save",s),getSystemStatus:()=>F.get(`${Me}/system/getSystemStatus`),getQueueStats:()=>F.get(`${Me}/system/getQueueStats`),getQueueWorkload:()=>F.get(`${Me}/system/getQueueWorkload`),getQueueMasters:()=>F.get(`${Me}/system/getQueueMasters`),getHorizonFailedJobs:s=>F.get(`${Me}/system/getHorizonFailedJobs`,{params:s}),getSystemLog:s=>F.get(`${Me}/system/getSystemLog`,{params:s}),getLogFiles:()=>F.get(`${Me}/log/files`),getLogContent:s=>F.get(`${Me}/log/fetch`,{params:s}),getLogClearStats:s=>F.get(`${Me}/system/getLogClearStats`,{params:s}),clearSystemLog:s=>F.post(`${Me}/system/clearSystemLog`,s)},Ds=window?.settings?.secure_path,Ps={getPluginList:()=>F.get(`${Ds}/plugin/getPlugins`),uploadPlugin:s=>{const a=new FormData;return a.append("file",s),F.post(`${Ds}/plugin/upload`,a,{headers:{"Content-Type":"multipart/form-data"}})},deletePlugin:s=>F.post(`${Ds}/plugin/delete`,{code:s}),installPlugin:s=>F.post(`${Ds}/plugin/install`,{code:s}),uninstallPlugin:s=>F.post(`${Ds}/plugin/uninstall`,{code:s}),enablePlugin:s=>F.post(`${Ds}/plugin/enable`,{code:s}),disablePlugin:s=>F.post(`${Ds}/plugin/disable`,{code:s}),getPluginConfig:s=>F.get(`${Ds}/plugin/config`,{params:{code:s}}),updatePluginConfig:(s,a)=>F.post(`${Ds}/plugin/config`,{code:s,config:a})};window?.settings?.secure_path;const vd=x.object({subscribe_template_singbox:x.string().optional().default(""),subscribe_template_clash:x.string().optional().default(""),subscribe_template_clashmeta:x.string().optional().default(""),subscribe_template_stash:x.string().optional().default(""),subscribe_template_surge:x.string().optional().default(""),subscribe_template_surfboard:x.string().optional().default("")}),el=[{key:"singbox",label:"Sing-box",language:"json"},{key:"clash",label:"Clash",language:"yaml"},{key:"clashmeta",label:"Clash Meta",language:"yaml"},{key:"stash",label:"Stash",language:"yaml"},{key:"surge",label:"Surge",language:"ini"},{key:"surfboard",label:"Surfboard",language:"ini"}],sl={subscribe_template_singbox:"",subscribe_template_clash:"",subscribe_template_clashmeta:"",subscribe_template_stash:"",subscribe_template_surge:"",subscribe_template_surfboard:""};function bd(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),[n,r]=m.useState("singbox"),o=Ne({resolver:we(vd),defaultValues:sl,mode:"onChange"}),{data:c,isLoading:u}=le({queryKey:["settings","client"],queryFn:()=>oe.getSettings("subscribe_template")}),{mutateAsync:i}=fs({mutationFn:oe.saveSettings,onSuccess:()=>{$.success(s("common.autoSaved"))},onError:C=>{console.error("保存失败:",C),$.error(s("common.saveFailed"))}});m.useEffect(()=>{if(c?.data?.subscribe_template){const C=c.data.subscribe_template;Object.entries(C).forEach(([S,w])=>{if(S in sl){const N=typeof w=="string"?w:"";o.setValue(S,N)}}),l.current=o.getValues()}},[c,o]);const d=m.useCallback(ke.debounce(async C=>{if(!l.current||!ke.isEqual(C,l.current)){t(!0);try{await i(C),l.current=C}catch(S){console.error("保存设置失败:",S)}finally{t(!1)}}},1500),[i]),h=m.useCallback(()=>{const C=o.getValues();d(C)},[o,d]),k=m.useCallback((C,S)=>e.jsx(v,{control:o.control,name:C,render:({field:w})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s(`subscribe_template.${C.replace("subscribe_template_","")}.title`)}),e.jsx(b,{children:e.jsx(Fi,{height:"500px",defaultLanguage:S,value:w.value||"",onChange:N=>{w.onChange(N||""),h()},options:{minimap:{enabled:!1},fontSize:14,wordWrap:"on",scrollBeyondLastLine:!1,automaticLayout:!0}})}),e.jsx(M,{children:s(`subscribe_template.${C.replace("subscribe_template_","")}.description`)}),e.jsx(P,{})]})}),[o.control,s,h]);return u?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.loading")})}):e.jsx(Ce,{...o,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs(Yt,{value:n,onValueChange:r,className:"w-full",children:[e.jsx(kt,{className:"",children:el.map(({key:C,label:S})=>e.jsx(es,{value:C,className:"text-xs",children:S},C))}),el.map(({key:C,language:S})=>e.jsx(Ls,{value:C,className:"mt-4",children:k(`subscribe_template_${C}`,S)},C))]}),a&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-blue-500"}),s("common.saving")]})]})})}function yd(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("subscribe_template.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("subscribe_template.description")})]}),e.jsx(De,{}),e.jsx(bd,{})]})}const Nd=()=>e.jsx(dd,{children:e.jsx(xn,{})}),_d=Mi([{path:"/sign-in",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>$d);return{default:s}},void 0,import.meta.url)).default})},{element:e.jsx(Nd,{}),children:[{path:"/",lazy:async()=>({Component:(await ve(()=>Promise.resolve().then(()=>Yd),void 0,import.meta.url)).default}),errorElement:e.jsx(dt,{}),children:[{index:!0,lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>pm);return{default:s}},void 0,import.meta.url)).default})},{path:"config",errorElement:e.jsx(dt,{}),children:[{path:"system",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>vm);return{default:s}},void 0,import.meta.url)).default}),children:[{index:!0,lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>_m);return{default:s}},void 0,import.meta.url)).default})},{path:"safe",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Tm);return{default:s}},void 0,import.meta.url)).default})},{path:"subscribe",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Im);return{default:s}},void 0,import.meta.url)).default})},{path:"invite",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Om);return{default:s}},void 0,import.meta.url)).default})},{path:"frontend",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Hm);return{default:s}},void 0,import.meta.url)).default})},{path:"server",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Wm);return{default:s}},void 0,import.meta.url)).default})},{path:"email",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Zm);return{default:s}},void 0,import.meta.url)).default})},{path:"telegram",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>nu);return{default:s}},void 0,import.meta.url)).default})},{path:"APP",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>cu);return{default:s}},void 0,import.meta.url)).default})},{path:"subscribe-template",element:e.jsx(yd,{})}]},{path:"payment",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>gu);return{default:s}},void 0,import.meta.url)).default})},{path:"plugin",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>vu);return{default:s}},void 0,import.meta.url)).default})},{path:"theme",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>_u);return{default:s}},void 0,import.meta.url)).default})},{path:"notice",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Pu);return{default:s}},void 0,import.meta.url)).default})},{path:"knowledge",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Ou);return{default:s}},void 0,import.meta.url)).default})}]},{path:"server",errorElement:e.jsx(dt,{}),children:[{path:"manage",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>hx);return{default:s}},void 0,import.meta.url)).default})},{path:"group",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>vx);return{default:s}},void 0,import.meta.url)).default})},{path:"route",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Cx);return{default:s}},void 0,import.meta.url)).default})}]},{path:"finance",errorElement:e.jsx(dt,{}),children:[{path:"plan",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Rx);return{default:s}},void 0,import.meta.url)).default})},{path:"order",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Wx);return{default:s}},void 0,import.meta.url)).default})},{path:"coupon",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>ah);return{default:s}},void 0,import.meta.url)).default})}]},{path:"user",errorElement:e.jsx(dt,{}),children:[{path:"manage",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Ih);return{default:s}},void 0,import.meta.url)).default})},{path:"ticket",lazy:async()=>({Component:(await ve(async()=>{const{default:s}=await Promise.resolve().then(()=>Zh);return{default:s}},void 0,import.meta.url)).default})}]}]}]},{path:"/500",Component:dt},{path:"/404",Component:Xn},{path:"/503",Component:ad},{path:"*",Component:Xn}]);function wd(){return F.get("/user/info")}const Ba={token:Bt()?.value||"",userInfo:null,isLoggedIn:!!Bt()?.value,loading:!1,error:null},qt=Oi("user/fetchUserInfo",async()=>(await wd()).data,{condition:(s,{getState:a})=>{const{user:t}=a();return!!t.token&&!t.loading}}),yr=zi({name:"user",initialState:Ba,reducers:{setToken(s,a){s.token=a.payload,s.isLoggedIn=!!a.payload},resetUserState:()=>Ba},extraReducers:s=>{s.addCase(qt.pending,a=>{a.loading=!0,a.error=null}).addCase(qt.fulfilled,(a,t)=>{a.loading=!1,a.userInfo=t.payload,a.error=null}).addCase(qt.rejected,(a,t)=>{if(a.loading=!1,a.error=t.error.message||"Failed to fetch user info",!a.token)return Ba})}}),{setToken:Cd,resetUserState:Sd}=yr.actions,kd=s=>s.user.userInfo,Td=yr.reducer,Nr=$i({reducer:{user:Td}});Bt()?.value&&Nr.dispatch(qt());Ai.use(qi).use(Hi).init({resources:{"en-US":window.XBOARD_TRANSLATIONS?.["en-US"]||{},"zh-CN":window.XBOARD_TRANSLATIONS?.["zh-CN"]||{},"ko-KR":window.XBOARD_TRANSLATIONS?.["ko-KR"]||{}},fallbackLng:"zh-CN",supportedLngs:["en-US","zh-CN","ko-KR"],detection:{order:["querystring","localStorage","navigator"],lookupQuerystring:"lang",lookupLocalStorage:"i18nextLng",caches:["localStorage"]},interpolation:{escapeValue:!1}});const Dd=new Ui;Ki.createRoot(document.getElementById("root")).render(e.jsx(Bi.StrictMode,{children:e.jsx(Gi,{client:Dd,children:e.jsx(Wi,{store:Nr,children:e.jsxs(Zc,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[e.jsx(Yi,{router:_d}),e.jsx(Ji,{richColors:!0,position:"top-right"})]})})})}));const Ye=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:y("rounded-xl border bg-card text-card-foreground shadow",s),...a}));Ye.displayName="Card";const ts=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:y("flex flex-col space-y-1.5 p-6",s),...a}));ts.displayName="CardHeader";const Ns=m.forwardRef(({className:s,...a},t)=>e.jsx("h3",{ref:t,className:y("font-semibold leading-none tracking-tight",s),...a}));Ns.displayName="CardTitle";const st=m.forwardRef(({className:s,...a},t)=>e.jsx("p",{ref:t,className:y("text-sm text-muted-foreground",s),...a}));st.displayName="CardDescription";const as=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:y("p-6 pt-0",s),...a}));as.displayName="CardContent";const Pd=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:y("flex items-center p-6 pt-0",s),...a}));Pd.displayName="CardFooter";const D=m.forwardRef(({className:s,type:a,...t},l)=>e.jsx("input",{type:a,className:y("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:l,...t}));D.displayName="Input";const _r=m.forwardRef(({className:s,...a},t)=>{const[l,n]=m.useState(!1);return e.jsxs("div",{className:"relative rounded-md",children:[e.jsx("input",{type:l?"text":"password",className:y("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...a}),e.jsx(L,{type:"button",size:"icon",variant:"ghost",className:"absolute right-1 top-1/2 h-6 w-6 -translate-y-1/2 rounded-md text-muted-foreground",onClick:()=>n(r=>!r),children:l?e.jsx(Qi,{size:18}):e.jsx(Xi,{size:18})})]})});_r.displayName="PasswordInput";const Ld=s=>F.post("/passport/auth/login",s);function Ed({className:s,onForgotPassword:a,...t}){const l=Rs(),n=gl(),{t:r}=V("auth"),o=x.object({email:x.string().min(1,{message:r("signIn.validation.emailRequired")}),password:x.string().min(1,{message:r("signIn.validation.passwordRequired")}).min(7,{message:r("signIn.validation.passwordLength")})}),c=Ne({resolver:we(o),defaultValues:{email:"",password:""}});async function u(i){try{const{data:d}=await Ld(i);jd(d.auth_data),n(Cd(d.auth_data)),await n(qt()).unwrap(),l("/")}catch(d){console.error("Login failed:",d),d.response?.data?.message&&c.setError("root",{message:d.response.data.message})}}return e.jsx("div",{className:y("grid gap-6",s),...t,children:e.jsx(Ce,{...c,children:e.jsx("form",{onSubmit:c.handleSubmit(u),className:"space-y-4",children:e.jsxs("div",{className:"space-y-4",children:[c.formState.errors.root&&e.jsx("div",{className:"text-sm text-destructive",children:c.formState.errors.root.message}),e.jsx(v,{control:c.control,name:"email",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:r("signIn.email")}),e.jsx(b,{children:e.jsx(D,{placeholder:r("signIn.emailPlaceholder"),autoComplete:"email",...i})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"password",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:r("signIn.password")}),e.jsx(b,{children:e.jsx(_r,{placeholder:r("signIn.passwordPlaceholder"),autoComplete:"current-password",...i})}),e.jsx(P,{})]})}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(L,{variant:"link",type:"button",className:"px-0 text-sm font-normal text-muted-foreground hover:text-primary",onClick:a,children:r("signIn.forgotPassword")})}),e.jsx(L,{className:"w-full",size:"lg",loading:c.formState.isSubmitting,children:r("signIn.submit")})]})})})})}const he=fl,is=jl,Id=vl,qs=hn,wr=m.forwardRef(({className:s,...a},t)=>e.jsx(wa,{ref:t,className:y("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",s),...a}));wr.displayName=wa.displayName;const ue=m.forwardRef(({className:s,children:a,...t},l)=>e.jsxs(Id,{children:[e.jsx(wr,{}),e.jsxs(Ca,{ref:l,className:y("max-h-[95%] overflow-auto 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",s),...t,children:[a,e.jsxs(hn,{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:[e.jsx(ds,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ue.displayName=Ca.displayName;const je=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col space-y-1.5 text-center sm:text-left",s),...a});je.displayName="DialogHeader";const Le=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});Le.displayName="DialogFooter";const pe=m.forwardRef(({className:s,...a},t)=>e.jsx(Sa,{ref:t,className:y("text-lg font-semibold leading-none tracking-tight",s),...a}));pe.displayName=Sa.displayName;const Re=m.forwardRef(({className:s,...a},t)=>e.jsx(ka,{ref:t,className:y("text-sm text-muted-foreground",s),...a}));Re.displayName=ka.displayName;const yt=tt("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring 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 shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),K=m.forwardRef(({className:s,variant:a,size:t,asChild:l=!1,...n},r)=>{const o=l?mn:"button";return e.jsx(o,{className:y(yt({variant:a,size:t,className:s})),ref:r,...n})});K.displayName="Button";const Es=so,Is=to,Rd=ao,Vd=m.forwardRef(({className:s,inset:a,children:t,...l},n)=>e.jsxs(bl,{ref:n,className:y("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",a&&"pl-8",s),...l,children:[t,e.jsx(pn,{className:"ml-auto h-4 w-4"})]}));Vd.displayName=bl.displayName;const Fd=m.forwardRef(({className:s,...a},t)=>e.jsx(yl,{ref:t,className:y("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",s),...a}));Fd.displayName=yl.displayName;const ws=m.forwardRef(({className:s,sideOffset:a=4,...t},l)=>e.jsx(Zi,{children:e.jsx(Nl,{ref:l,sideOffset:a,className:y("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",s),...t})}));ws.displayName=Nl.displayName;const _e=m.forwardRef(({className:s,inset:a,...t},l)=>e.jsx(_l,{ref:l,className:y("relative flex cursor-default cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",s),...t}));_e.displayName=_l.displayName;const Md=m.forwardRef(({className:s,children:a,checked:t,...l},n)=>e.jsxs(wl,{ref:n,className:y("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:t,...l,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Cl,{children:e.jsx(at,{className:"h-4 w-4"})})}),a]}));Md.displayName=wl.displayName;const Od=m.forwardRef(({className:s,children:a,...t},l)=>e.jsxs(Sl,{ref:l,className:y("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...t,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Cl,{children:e.jsx(eo,{className:"h-4 w-4 fill-current"})})}),a]}));Od.displayName=Sl.displayName;const yn=m.forwardRef(({className:s,inset:a,...t},l)=>e.jsx(kl,{ref:l,className:y("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",s),...t}));yn.displayName=kl.displayName;const Nt=m.forwardRef(({className:s,...a},t)=>e.jsx(Tl,{ref:t,className:y("-mx-1 my-1 h-px bg-muted",s),...a}));Nt.displayName=Tl.displayName;const cn=({className:s,...a})=>e.jsx("span",{className:y("ml-auto text-xs tracking-widest opacity-60",s),...a});cn.displayName="DropdownMenuShortcut";const Ga=[{code:"en-US",name:"English",flag:no,shortName:"EN"},{code:"zh-CN",name:"中文",flag:lo,shortName:"CN"},{code:"ko-KR",name:"한국어",flag:ro,shortName:"KR"}];function Cr(){const{i18n:s}=V(),a=n=>{s.changeLanguage(n)},t=Ga.find(n=>n.code===s.language)||Ga[1],l=t.flag;return e.jsxs(Es,{children:[e.jsx(Is,{asChild:!0,children:e.jsxs(K,{variant:"ghost",size:"sm",className:"h-8 px-2 gap-1",children:[e.jsx(l,{className:"h-4 w-5 rounded-sm shadow-sm"}),e.jsx("span",{className:"text-sm font-medium",children:t.shortName})]})}),e.jsx(ws,{align:"end",className:"w-[120px]",children:Ga.map(n=>{const r=n.flag,o=n.code===s.language;return e.jsxs(_e,{onClick:()=>a(n.code),className:y("flex items-center gap-2 px-2 py-1.5 cursor-pointer",o&&"bg-accent"),children:[e.jsx(r,{className:"h-4 w-5 rounded-sm shadow-sm"}),e.jsx("span",{className:y("text-sm",o&&"font-medium"),children:n.name})]},n.code)})})]})}function zd(){const[s,a]=m.useState(!1),{t}=V("auth"),l=t("signIn.resetPassword.command");return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"container relative flex min-h-svh flex-col items-center justify-center bg-primary-foreground px-4 py-8 lg:max-w-none lg:px-0",children:[e.jsx("div",{className:"absolute right-4 top-4 md:right-8 md:top-8",children:e.jsx(Cr,{})}),e.jsxs("div",{className:"mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px] md:w-[420px] lg:p-8",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-center",children:[e.jsx("h1",{className:"text-2xl font-bold sm:text-3xl",children:window?.settings?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:window?.settings?.description})]}),e.jsxs(Ye,{className:"p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-left",children:[e.jsx("h1",{className:"text-xl font-semibold tracking-tight sm:text-2xl",children:t("signIn.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("signIn.description")})]}),e.jsx(Ed,{onForgotPassword:()=>a(!0)})]})]})]}),e.jsx(he,{open:s,onOpenChange:a,children:e.jsx(ue,{className:"max-w-[90vw] sm:max-w-lg",children:e.jsxs(je,{children:[e.jsx(pe,{children:t("signIn.resetPassword.title")}),e.jsx(Re,{children:t("signIn.resetPassword.description")}),e.jsx("div",{className:"mt-4",children:e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"max-w-full overflow-x-auto rounded-md bg-secondary p-4 pr-12 text-sm",children:l}),e.jsx(K,{variant:"ghost",size:"icon",className:"absolute right-2 top-2 h-8 w-8 hover:bg-secondary-foreground/10",onClick:()=>ba(l).then(()=>{$.success(t("common:copy.success"))}),children:e.jsx(io,{className:"h-4 w-4"})})]})})]})})})]})}const $d=Object.freeze(Object.defineProperty({__proto__:null,default:zd},Symbol.toStringTag,{value:"Module"})),Ve=m.forwardRef(({className:s,fadedBelow:a=!1,fixedHeight:t=!1,...l},n)=>e.jsx("div",{ref:n,className:y("relative flex h-full w-full flex-col",a&&"after:pointer-events-none after:absolute after:bottom-0 after:left-0 after:hidden after:h-32 after:w-full after:bg-[linear-gradient(180deg,_transparent_10%,_hsl(var(--background))_70%)] after:md:block",t&&"md:h-svh",s),...l}));Ve.displayName="Layout";const Fe=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:y("flex h-[var(--header-height)] flex-none items-center gap-4 bg-background p-4 md:px-8",s),...a}));Fe.displayName="LayoutHeader";const Ae=m.forwardRef(({className:s,fixedHeight:a,...t},l)=>e.jsx("div",{ref:l,className:y("flex-1 overflow-hidden px-4 py-6 md:px-8",a&&"h-[calc(100%-var(--header-height))]",s),...t}));Ae.displayName="LayoutBody";const Sr=oo,kr=co,Tr=mo,ye=uo,ge=xo,fe=ho,xe=m.forwardRef(({className:s,sideOffset:a=4,...t},l)=>e.jsx(Dl,{ref:l,sideOffset:a,className:y("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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",s),...t}));xe.displayName=Dl.displayName;function Ia(){const{pathname:s}=un();return{checkActiveNav:t=>{if(t==="/"&&s==="/")return!0;const l=t.replace(/^\//,""),n=s.replace(/^\//,"");return l?n.startsWith(l):!1}}}function Dr({key:s,defaultValue:a}){const[t,l]=m.useState(()=>{const n=localStorage.getItem(s);return n!==null?JSON.parse(n):a});return m.useEffect(()=>{localStorage.setItem(s,JSON.stringify(t))},[t,s]),[t,l]}function Ad(){const[s,a]=Dr({key:"collapsed-sidebar-items",defaultValue:[]}),t=n=>!s.includes(n);return{isExpanded:t,toggleItem:n=>{t(n)?a([...s,n]):a(s.filter(r=>r!==n))}}}function qd({links:s,isCollapsed:a,className:t,closeNav:l}){const{t:n}=V(),r=({sub:o,...c})=>{const u=`${n(c.title)}-${c.href}`;return a&&o?m.createElement(Kd,{...c,sub:o,key:u,closeNav:l}):a?m.createElement(Ud,{...c,key:u,closeNav:l}):o?m.createElement(Hd,{...c,sub:o,key:u,closeNav:l}):m.createElement(Pr,{...c,key:u,closeNav:l})};return e.jsx("div",{"data-collapsed":a,className:y("group border-b bg-background py-2 transition-[max-height,padding] duration-500 data-[collapsed=true]:py-2 md:border-none",t),children:e.jsx(ye,{delayDuration:0,children:e.jsx("nav",{className:"grid gap-1 group-[[data-collapsed=true]]:justify-center group-[[data-collapsed=true]]:px-2",children:s.map(r)})})})}function Pr({title:s,icon:a,label:t,href:l,closeNav:n,subLink:r=!1}){const{checkActiveNav:o}=Ia(),{t:c}=V();return e.jsxs(nt,{to:l,onClick:n,className:y(St({variant:o(l)?"secondary":"ghost",size:"sm"}),"h-12 justify-start text-wrap rounded-none px-6",r&&"h-10 w-full border-l border-l-slate-500 px-2"),"aria-current":o(l)?"page":void 0,children:[e.jsx("div",{className:"mr-2",children:a}),c(s),t&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:c(t)})]})}function Hd({title:s,icon:a,label:t,sub:l,closeNav:n}){const{checkActiveNav:r}=Ia(),{isExpanded:o,toggleItem:c}=Ad(),{t:u}=V(),i=!!l?.find(k=>r(k.href)),d=u(s),h=o(d)||i;return e.jsxs(Sr,{open:h,onOpenChange:()=>c(d),children:[e.jsxs(kr,{className:y(St({variant:i?"secondary":"ghost",size:"sm"}),"group h-12 w-full justify-start rounded-none px-6"),children:[e.jsx("div",{className:"mr-2",children:a}),u(s),t&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:u(t)}),e.jsx("span",{className:y('ml-auto transition-all group-data-[state="open"]:-rotate-180'),children:e.jsx(Pl,{stroke:1})})]}),e.jsx(Tr,{className:"collapsibleDropdown",asChild:!0,children:e.jsx("ul",{children:l.map(k=>e.jsx("li",{className:"my-1 ml-8",children:e.jsx(Pr,{...k,subLink:!0,closeNav:n})},u(k.title)))})})]})}function Ud({title:s,icon:a,label:t,href:l,closeNav:n}){const{checkActiveNav:r}=Ia(),{t:o}=V();return e.jsxs(ge,{delayDuration:0,children:[e.jsx(fe,{asChild:!0,children:e.jsxs(nt,{to:l,onClick:n,className:y(St({variant:r(l)?"secondary":"ghost",size:"icon"}),"h-12 w-12"),children:[a,e.jsx("span",{className:"sr-only",children:o(s)})]})}),e.jsxs(xe,{side:"right",className:"flex items-center gap-4",children:[o(s),t&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:o(t)})]})]})}function Kd({title:s,icon:a,label:t,sub:l,closeNav:n}){const{checkActiveNav:r}=Ia(),{t:o}=V(),c=!!l?.find(u=>r(u.href));return e.jsxs(Es,{children:[e.jsxs(ge,{delayDuration:0,children:[e.jsx(fe,{asChild:!0,children:e.jsx(Is,{asChild:!0,children:e.jsx(L,{variant:c?"secondary":"ghost",size:"icon",className:"h-12 w-12",children:a})})}),e.jsxs(xe,{side:"right",className:"flex items-center gap-4",children:[o(s)," ",t&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:o(t)}),e.jsx(Pl,{size:18,className:"-rotate-90 text-muted-foreground"})]})]}),e.jsxs(ws,{side:"right",align:"start",sideOffset:4,children:[e.jsxs(yn,{children:[o(s)," ",t?`(${o(t)})`:""]}),e.jsx(Nt,{}),l.map(({title:u,icon:i,label:d,href:h})=>e.jsx(_e,{asChild:!0,children:e.jsxs(nt,{to:h,onClick:n,className:`${r(h)?"bg-secondary":""}`,children:[i," ",e.jsx("span",{className:"ml-2 max-w-52 text-wrap",children:o(u)}),d&&e.jsx("span",{className:"ml-auto text-xs",children:o(d)})]})},`${o(u)}-${h}`))]})]})}const Lr=[{title:"nav:dashboard",label:"",href:"/",icon:e.jsx(po,{size:18})},{title:"nav:systemManagement",label:"",href:"",icon:e.jsx(go,{size:18}),sub:[{title:"nav:systemConfig",label:"",href:"/config/system",icon:e.jsx(Ll,{size:18})},{title:"nav:pluginManagement",label:"",href:"/config/plugin",icon:e.jsx(gn,{size:18})},{title:"nav:themeConfig",label:"",href:"/config/theme",icon:e.jsx(fo,{size:18})},{title:"nav:noticeManagement",label:"",href:"/config/notice",icon:e.jsx(jo,{size:18})},{title:"nav:paymentConfig",label:"",href:"/config/payment",icon:e.jsx(Hn,{size:18})},{title:"nav:knowledgeManagement",label:"",href:"/config/knowledge",icon:e.jsx(vo,{size:18})}]},{title:"nav:nodeManagement",label:"",href:"",icon:e.jsx(El,{size:18}),sub:[{title:"nav:nodeManagement",label:"",href:"/server/manage",icon:e.jsx(bo,{size:18})},{title:"nav:permissionGroupManagement",label:"",href:"/server/group",icon:e.jsx(Il,{size:18})},{title:"nav:routeManagement",label:"",href:"/server/route",icon:e.jsx(yo,{size:18})}]},{title:"nav:subscriptionManagement",label:"",href:"",icon:e.jsx(No,{size:18}),sub:[{title:"nav:planManagement",label:"",href:"/finance/plan",icon:e.jsx(_o,{size:18})},{title:"nav:orderManagement",label:"",href:"/finance/order",icon:e.jsx(Hn,{size:18})},{title:"nav:couponManagement",label:"",href:"/finance/coupon",icon:e.jsx(wo,{size:18})}]},{title:"nav:userManagement",label:"",href:"",icon:e.jsx(Co,{size:18}),sub:[{title:"nav:userManagement",label:"",href:"/user/manage",icon:e.jsx(So,{size:18})},{title:"nav:ticketManagement",label:"",href:"/user/ticket",icon:e.jsx(Rl,{size:18})}]}];function Bd({className:s,isCollapsed:a,setIsCollapsed:t}){const[l,n]=m.useState(!1),{t:r}=V();return m.useEffect(()=>{l?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")},[l]),e.jsxs("aside",{className:y(`fixed left-0 right-0 top-0 z-50 flex h-auto flex-col border-r-2 border-r-muted transition-[width] md:bottom-0 md:right-auto md:h-svh ${a?"md:w-14":"md:w-64"}`,s),children:[e.jsx("div",{onClick:()=>n(!1),className:`absolute inset-0 transition-[opacity] delay-100 duration-700 ${l?"h-svh opacity-50":"h-0 opacity-0"} w-full bg-black md:hidden`}),e.jsxs(Ve,{className:`flex h-full flex-col ${l?"h-[100vh] md:h-full":""}`,children:[e.jsxs(Fe,{className:"sticky top-0 justify-between px-4 py-3 shadow md:px-4",children:[e.jsxs("div",{className:`flex items-center ${a?"":"gap-2"}`,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",className:`transition-all ${a?"h-6 w-6":"h-8 w-8"}`,children:[e.jsx("rect",{width:"256",height:"256",fill:"none"}),e.jsx("line",{x1:"208",y1:"128",x2:"128",y2:"208",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("line",{x1:"192",y1:"40",x2:"40",y2:"192",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("span",{className:"sr-only",children:"Website Name"})]}),e.jsx("div",{className:`flex flex-col justify-end truncate ${a?"invisible w-0":"visible w-auto"}`,children:e.jsx("span",{className:"font-medium",children:window?.settings?.title})})]}),e.jsx(L,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":r("common:toggleNavigation"),"aria-controls":"sidebar-menu","aria-expanded":l,onClick:()=>n(o=>!o),children:l?e.jsx(ko,{}):e.jsx(To,{})})]}),e.jsx(qd,{id:"sidebar-menu",className:y("flex-1 overflow-auto overscroll-contain",l?"block":"hidden md:block","md:py-2"),closeNav:()=>n(!1),isCollapsed:a,links:Lr}),e.jsx("div",{className:y("border-t border-border/50 bg-background","px-4 py-2.5 text-xs text-muted-foreground",l?"block":"hidden md:block",a?"text-center":"text-left"),children:e.jsxs("div",{className:y("flex items-center gap-1.5",a?"justify-center":"justify-start"),children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),e.jsxs("span",{className:y("whitespace-nowrap tracking-wide","transition-opacity duration-200",a&&"md:opacity-0"),children:["v",window?.settings?.version]})]})}),e.jsx(L,{onClick:()=>t(o=>!o),size:"icon",variant:"outline",className:"absolute -right-5 top-1/2 hidden rounded-full md:inline-flex","aria-label":r("common:toggleSidebar"),children:e.jsx(Do,{stroke:1.5,className:`h-5 w-5 ${a?"rotate-180":""}`})})]})]})}function Gd(){const[s,a]=Dr({key:"collapsed-sidebar",defaultValue:!1});return m.useEffect(()=>{const t=()=>{a(window.innerWidth<768?!1:s)};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[s,a]),[s,a]}function Wd(){const[s,a]=Gd();return e.jsxs("div",{className:"relative h-full overflow-hidden bg-background",children:[e.jsx(Bd,{isCollapsed:s,setIsCollapsed:a}),e.jsx("main",{id:"content",className:`overflow-x-hidden pt-16 transition-[margin] md:overflow-y-hidden md:pt-0 ${s?"md:ml-14":"md:ml-64"} h-full`,children:e.jsx(xn,{})})]})}const Yd=Object.freeze(Object.defineProperty({__proto__:null,default:Wd},Symbol.toStringTag,{value:"Module"})),Us=m.forwardRef(({className:s,...a},t)=>e.jsx(He,{ref:t,className:y("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",s),...a}));Us.displayName=He.displayName;const Jd=({children:s,...a})=>e.jsx(he,{...a,children:e.jsx(ue,{className:"overflow-hidden p-0",children:e.jsx(Us,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:s})})}),it=m.forwardRef(({className:s,...a},t)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Po,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(He.Input,{ref:t,className:y("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",s),...a})]}));it.displayName=He.Input.displayName;const Ks=m.forwardRef(({className:s,...a},t)=>e.jsx(He.List,{ref:t,className:y("max-h-[300px] overflow-y-auto overflow-x-hidden",s),...a}));Ks.displayName=He.List.displayName;const ot=m.forwardRef((s,a)=>e.jsx(He.Empty,{ref:a,className:"py-6 text-center text-sm",...s}));ot.displayName=He.Empty.displayName;const ns=m.forwardRef(({className:s,...a},t)=>e.jsx(He.Group,{ref:t,className:y("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",s),...a}));ns.displayName=He.Group.displayName;const Tt=m.forwardRef(({className:s,...a},t)=>e.jsx(He.Separator,{ref:t,className:y("-mx-1 h-px bg-border",s),...a}));Tt.displayName=He.Separator.displayName;const $e=m.forwardRef(({className:s,...a},t)=>e.jsx(He.Item,{ref:t,className:y("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...a}));$e.displayName=He.Item.displayName;function Qd(){const s=[];for(const a of Lr)if(a.href&&s.push(a),a.sub)for(const t of a.sub)s.push({...t,parent:a.title});return s}function Xe(){const[s,a]=m.useState(!1),t=Rs(),l=Qd(),{t:n}=V("search"),{t:r}=V("nav");m.useEffect(()=>{const c=u=>{u.key==="k"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),a(i=>!i))};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]);const o=m.useCallback(c=>{a(!1),t(c)},[t]);return e.jsxs(e.Fragment,{children:[e.jsxs(K,{variant:"outline",className:"relative h-9 w-9 p-0 xl:h-10 xl:w-60 xl:justify-start xl:px-3 xl:py-2",onClick:()=>a(!0),children:[e.jsx(fn,{className:"h-4 w-4 xl:mr-2"}),e.jsx("span",{className:"hidden xl:inline-flex",children:n("placeholder")}),e.jsx("span",{className:"sr-only",children:n("shortcut.label")}),e.jsx("kbd",{className:"pointer-events-none absolute right-1.5 top-2 hidden h-6 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 xl:flex",children:n("shortcut.key")})]}),e.jsxs(Jd,{open:s,onOpenChange:a,children:[e.jsx(it,{placeholder:n("placeholder")}),e.jsxs(Ks,{children:[e.jsx(ot,{children:n("noResults")}),e.jsx(ns,{heading:n("title"),children:l.map(c=>e.jsxs($e,{value:`${c.parent?c.parent+" ":""}${c.title}`,onSelect:()=>o(c.href),children:[e.jsx("div",{className:"mr-2",children:c.icon}),e.jsx("span",{children:r(c.title)}),c.parent&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:r(c.parent)})]},c.href))})]})]})]})}function Ue(){const{theme:s,setTheme:a}=ed();return m.useEffect(()=>{const t=s==="dark"?"#020817":"#fff",l=document.querySelector("meta[name='theme-color']");l&&l.setAttribute("content",t)},[s]),e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"icon",variant:"ghost",className:"rounded-full",onClick:()=>a(s==="light"?"dark":"light"),children:s==="light"?e.jsx(Lo,{size:20}):e.jsx(Eo,{size:20})}),e.jsx(Cr,{})]})}const Er=m.forwardRef(({className:s,...a},t)=>e.jsx(Vl,{ref:t,className:y("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",s),...a}));Er.displayName=Vl.displayName;const Ir=m.forwardRef(({className:s,...a},t)=>e.jsx(Fl,{ref:t,className:y("aspect-square h-full w-full",s),...a}));Ir.displayName=Fl.displayName;const Rr=m.forwardRef(({className:s,...a},t)=>e.jsx(Ml,{ref:t,className:y("flex h-full w-full items-center justify-center rounded-full bg-muted",s),...a}));Rr.displayName=Ml.displayName;function Ke(){const s=Rs(),a=gl(),t=Io(kd),{t:l}=V(["common"]),n=()=>{fr(),a(Sd()),s("/sign-in")},r=t?.email?.split("@")[0]||l("common:user"),o=r.substring(0,2).toUpperCase();return e.jsxs(Es,{children:[e.jsx(Is,{asChild:!0,children:e.jsx(L,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:e.jsxs(Er,{className:"h-8 w-8",children:[e.jsx(Ir,{src:t?.avatar_url,alt:r}),e.jsx(Rr,{children:o})]})})}),e.jsxs(ws,{className:"w-56",align:"end",forceMount:!0,children:[e.jsx(yn,{className:"font-normal",children:e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("p",{className:"text-sm font-medium leading-none",children:r}),e.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:t?.email||l("common:defaultEmail")})]})}),e.jsx(Nt,{}),e.jsx(_e,{asChild:!0,children:e.jsxs(nt,{to:"/config/system",children:[l("common:settings"),e.jsx(cn,{children:"⌘S"})]})}),e.jsx(Nt,{}),e.jsxs(_e,{onClick:n,children:[l("common:logout"),e.jsx(cn,{children:"⇧⌘Q"})]})]})]})}const J=Ro,Be=qo,Q=Vo,W=m.forwardRef(({className:s,children:a,...t},l)=>e.jsxs(Ol,{ref:l,className:y("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...t,children:[a,e.jsx(Fo,{asChild:!0,children:e.jsx(jn,{className:"h-4 w-4 opacity-50"})})]}));W.displayName=Ol.displayName;const Vr=m.forwardRef(({className:s,...a},t)=>e.jsx(zl,{ref:t,className:y("flex cursor-default items-center justify-center py-1",s),...a,children:e.jsx(Mo,{className:"h-4 w-4"})}));Vr.displayName=zl.displayName;const Fr=m.forwardRef(({className:s,...a},t)=>e.jsx($l,{ref:t,className:y("flex cursor-default items-center justify-center py-1",s),...a,children:e.jsx(jn,{className:"h-4 w-4"})}));Fr.displayName=$l.displayName;const Y=m.forwardRef(({className:s,children:a,position:t="popper",...l},n)=>e.jsx(Oo,{children:e.jsxs(Al,{ref:n,className:y("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",t==="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",s),position:t,...l,children:[e.jsx(Vr,{}),e.jsx(zo,{className:y("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),e.jsx(Fr,{})]})}));Y.displayName=Al.displayName;const Xd=m.forwardRef(({className:s,...a},t)=>e.jsx(ql,{ref:t,className:y("px-2 py-1.5 text-sm font-semibold",s),...a}));Xd.displayName=ql.displayName;const A=m.forwardRef(({className:s,children:a,...t},l)=>e.jsxs(Hl,{ref:l,className:y("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...t,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx($o,{children:e.jsx(at,{className:"h-4 w-4"})})}),e.jsx(Ao,{children:a})]}));A.displayName=Hl.displayName;const Zd=m.forwardRef(({className:s,...a},t)=>e.jsx(Ul,{ref:t,className:y("-mx-1 my-1 h-px bg-muted",s),...a}));Zd.displayName=Ul.displayName;function ct({className:s,classNames:a,showOutsideDays:t=!0,...l}){return e.jsx(Ho,{showOutsideDays:t,className:y("p-3",s),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:y(yt({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:y("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",l.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:y(yt({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...a},components:{IconLeft:({className:n,...r})=>e.jsx(Kl,{className:y("h-4 w-4",n),...r}),IconRight:({className:n,...r})=>e.jsx(pn,{className:y("h-4 w-4",n),...r})},...l})}ct.displayName="Calendar";const Cs=Ko,Ss=Bo,bs=m.forwardRef(({className:s,align:a="center",sideOffset:t=4,...l},n)=>e.jsx(Uo,{children:e.jsx(Bl,{ref:n,align:a,sideOffset:t,className:y("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",s),...l})}));bs.displayName=Bl.displayName;const zs={income:{main:"hsl(var(--primary))",gradient:{start:"hsl(var(--primary))",end:"transparent"}},commission:{main:"hsl(var(--secondary))",gradient:{start:"hsl(var(--secondary))",end:"transparent"}}},Ot=s=>(s/100).toFixed(2),em=({active:s,payload:a,label:t})=>{const{t:l}=V();return s&&a&&a.length?e.jsxs("div",{className:"rounded-lg border bg-background p-3 shadow-sm",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:t}),a.map((n,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.color}}),e.jsxs("span",{className:"text-muted-foreground",children:[l(n.name),":"]}),e.jsx("span",{className:"font-medium",children:n.name.includes(l("dashboard:overview.amount"))?`¥${Ot(n.value)}`:l("dashboard:overview.transactions",{count:n.value})})]},r))]}):null},sm=[{value:"7d",label:"dashboard:overview.last7Days"},{value:"30d",label:"dashboard:overview.last30Days"},{value:"90d",label:"dashboard:overview.last90Days"},{value:"180d",label:"dashboard:overview.last180Days"},{value:"365d",label:"dashboard:overview.lastYear"},{value:"custom",label:"dashboard:overview.customRange"}],tm=(s,a)=>{const t=new Date;if(s==="custom"&&a)return{startDate:a.from,endDate:a.to};let l;switch(s){case"7d":l=ps(t,7);break;case"30d":l=ps(t,30);break;case"90d":l=ps(t,90);break;case"180d":l=ps(t,180);break;case"365d":l=ps(t,365);break;default:l=ps(t,30)}return{startDate:l,endDate:t}};function am(){const[s,a]=m.useState("amount"),[t,l]=m.useState("30d"),[n,r]=m.useState({from:ps(new Date,7),to:new Date}),{t:o}=V(),{startDate:c,endDate:u}=tm(t,n),{data:i}=le({queryKey:["orderStat",{start_date:hs(c,"yyyy-MM-dd"),end_date:hs(u,"yyyy-MM-dd")}],queryFn:async()=>{const{data:d}=await ya.getOrderStat({start_date:hs(c,"yyyy-MM-dd"),end_date:hs(u,"yyyy-MM-dd")});return d},refetchInterval:3e4});return e.jsxs(Ye,{children:[e.jsx(ts,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(Ns,{children:o("dashboard:overview.title")}),e.jsxs(st,{children:[i?.summary.start_date," ",o("dashboard:overview.to")," ",i?.summary.end_date]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsxs(J,{value:t,onValueChange:d=>l(d),children:[e.jsx(W,{className:"w-[120px]",children:e.jsx(Q,{placeholder:o("dashboard:overview.selectTimeRange")})}),e.jsx(Y,{children:sm.map(d=>e.jsx(A,{value:d.value,children:o(d.label)},d.value))})]}),t==="custom"&&e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(K,{variant:"outline",className:y("min-w-0 justify-start text-left font-normal",!n&&"text-muted-foreground"),children:[e.jsx(Ct,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:n?.from?n.to?e.jsxs(e.Fragment,{children:[hs(n.from,"yyyy-MM-dd")," -"," ",hs(n.to,"yyyy-MM-dd")]}):hs(n.from,"yyyy-MM-dd"):o("dashboard:overview.selectDate")})]})}),e.jsx(bs,{className:"w-auto p-0",align:"end",children:e.jsx(ct,{mode:"range",defaultMonth:n?.from,selected:{from:n?.from,to:n?.to},onSelect:d=>{d?.from&&d?.to&&r({from:d.from,to:d.to})},numberOfMonths:2})})]})]}),e.jsx(Yt,{value:s,onValueChange:d=>a(d),children:e.jsxs(kt,{children:[e.jsx(es,{value:"amount",children:o("dashboard:overview.amount")}),e.jsx(es,{value:"count",children:o("dashboard:overview.count")})]})})]})]})}),e.jsxs(as,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:o("dashboard:overview.totalIncome")}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",Ot(i?.summary?.paid_total||0)]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:o("dashboard:overview.totalTransactions",{count:i?.summary?.paid_count||0})}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[o("dashboard:overview.avgOrderAmount")," ¥",Ot(i?.summary?.avg_paid_amount||0)]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:o("dashboard:overview.totalCommission")}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",Ot(i?.summary?.commission_total||0)]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:o("dashboard:overview.totalTransactions",{count:i?.summary?.commission_count||0})}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[o("dashboard:overview.commissionRate")," ",i?.summary?.commission_rate.toFixed(2)||0,"%"]})]})]}),e.jsx("div",{className:"h-[400px] w-full",children:e.jsx(Go,{width:"100%",height:"100%",children:e.jsxs(Wo,{data:i?.list||[],margin:{top:20,right:20,left:0,bottom:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"incomeGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:zs.income.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:zs.income.gradient.end,stopOpacity:.1})]}),e.jsxs("linearGradient",{id:"commissionGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:zs.commission.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:zs.commission.gradient.end,stopOpacity:.1})]})]}),e.jsx(Yo,{dataKey:"date",axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:d=>hs(new Date(d),"MM-dd",{locale:Zo})}),e.jsx(Jo,{axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:d=>s==="amount"?`¥${Ot(d)}`:o("dashboard:overview.transactions",{count:d})}),e.jsx(Qo,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))",opacity:.3}),e.jsx(Xo,{content:e.jsx(em,{})}),s==="amount"?e.jsxs(e.Fragment,{children:[e.jsx(Un,{type:"monotone",dataKey:"paid_total",name:o("dashboard:overview.orderAmount"),stroke:zs.income.main,fill:"url(#incomeGradient)",strokeWidth:2}),e.jsx(Un,{type:"monotone",dataKey:"commission_total",name:o("dashboard:overview.commissionAmount"),stroke:zs.commission.main,fill:"url(#commissionGradient)",strokeWidth:2})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kn,{dataKey:"paid_count",name:o("dashboard:overview.orderCount"),fill:zs.income.main,radius:[4,4,0,0],maxBarSize:40}),e.jsx(Kn,{dataKey:"commission_count",name:o("dashboard:overview.commissionCount"),fill:zs.commission.main,radius:[4,4,0,0],maxBarSize:40})]})]})})})]})]})}function me({className:s,...a}){return e.jsx("div",{className:y("animate-pulse rounded-md bg-primary/10",s),...a})}function nm(){return e.jsxs(Ye,{children:[e.jsxs(ts,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(me,{className:"h-4 w-[120px]"}),e.jsx(me,{className:"h-4 w-4"})]}),e.jsxs(as,{children:[e.jsx(me,{className:"h-8 w-[140px] mb-2"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(me,{className:"h-4 w-4"}),e.jsx(me,{className:"h-4 w-[100px]"})]})]})]})}function lm(){return e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:Array.from({length:8}).map((s,a)=>e.jsx(nm,{},a))})}var ne=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.CANCELLED=2]="CANCELLED",s[s.COMPLETED=3]="COMPLETED",s[s.DISCOUNTED=4]="DISCOUNTED",s))(ne||{});const Rt={0:"待支付",1:"开通中",2:"已取消",3:"已完成",4:"已折抵"},Vt={0:"yellow-500",1:"blue-500",2:"red-500",3:"green-500",4:"green-500"};var gs=(s=>(s[s.NEW=1]="NEW",s[s.RENEWAL=2]="RENEWAL",s[s.UPGRADE=3]="UPGRADE",s[s.RESET_FLOW=4]="RESET_FLOW",s))(gs||{}),be=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.VALID=2]="VALID",s[s.INVALID=3]="INVALID",s))(be||{});const na={0:"待确认",1:"发放中",2:"有效",3:"无效"},la={0:"yellow-500",1:"blue-500",2:"green-500",3:"red-500"};var Ie=(s=>(s.MONTH_PRICE="month_price",s.QUARTER_PRICE="quarter_price",s.HALF_YEAR_PRICE="half_year_price",s.YEAR_PRICE="year_price",s.TWO_YEAR_PRICE="two_year_price",s.THREE_YEAR_PRICE="three_year_price",s.ONETIME_PRICE="onetime_price",s.RESET_PRICE="reset_price",s))(Ie||{});const rm={month_price:"月付",quarter_price:"季付",half_year_price:"半年付",year_price:"年付",two_year_price:"两年付",three_year_price:"三年付",onetime_price:"一次性",reset_price:"流量重置包"};var ie=(s=>(s.Shadowsocks="shadowsocks",s.Vmess="vmess",s.Trojan="trojan",s.Hysteria="hysteria",s.Vless="vless",s.Tuic="tuic",s.Socks="socks",s.Naive="naive",s.Http="http",s.Mieru="mieru",s.AnyTLS="anytls",s))(ie||{});const cs=[{type:"shadowsocks",label:"Shadowsocks"},{type:"vmess",label:"VMess"},{type:"trojan",label:"Trojan"},{type:"hysteria",label:"Hysteria"},{type:"vless",label:"VLess"},{type:"tuic",label:"TUIC"},{type:"socks",label:"SOCKS"},{type:"naive",label:"Naive"},{type:"http",label:"HTTP"},{type:"mieru",label:"Mieru"},{type:"anytls",label:"AnyTLS"}],Ge={shadowsocks:"#489851",vmess:"#CB3180",trojan:"#EBB749",hysteria:"#5684e6",vless:"#1a1a1a",tuic:"#00C853",socks:"#2196F3",naive:"#9C27B0",http:"#FF5722",mieru:"#4CAF50",anytls:"#7E57C2"};var Ze=(s=>(s[s.AMOUNT=1]="AMOUNT",s[s.PERCENTAGE=2]="PERCENTAGE",s))(Ze||{});const im={1:"按金额优惠",2:"按比例优惠"};var Hs=(s=>(s[s.OPENING=0]="OPENING",s[s.CLOSED=1]="CLOSED",s))(Hs||{}),qe=(s=>(s[s.LOW=0]="LOW",s[s.MIDDLE=1]="MIDDLE",s[s.HIGH=2]="HIGH",s))(qe||{}),Ht=(s=>(s.MONTH="monthly",s.QUARTER="quarterly",s.HALF_YEAR="half_yearly",s.YEAR="yearly",s.TWO_YEAR="two_yearly",s.THREE_YEAR="three_yearly",s.ONETIME="onetime",s.RESET="reset_traffic",s))(Ht||{});function $s({title:s,value:a,icon:t,trend:l,description:n,onClick:r,highlight:o,className:c}){return e.jsxs(Ye,{className:y("transition-colors",r&&"cursor-pointer hover:bg-muted/50",o&&"border-primary/50",c),onClick:r,children:[e.jsxs(ts,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ns,{className:"text-sm font-medium",children:s}),t]}),e.jsxs(as,{children:[e.jsx("div",{className:"text-2xl font-bold",children:a}),l?e.jsxs("div",{className:"flex items-center pt-1",children:[e.jsx(nc,{className:y("h-4 w-4",l.isPositive?"text-emerald-500":"text-red-500")}),e.jsxs("span",{className:y("ml-1 text-xs",l.isPositive?"text-emerald-500":"text-red-500"),children:[l.isPositive?"+":"-",Math.abs(l.value),"%"]}),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:l.label})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:n})]})]})}function om({className:s}){const a=Rs(),{t}=V(),{data:l,isLoading:n}=le({queryKey:["dashboardStats"],queryFn:async()=>(await ya.getStatsData()).data,refetchInterval:1e3*60*5});if(n||!l)return e.jsx(lm,{});const r=()=>{const o=new URLSearchParams;o.set("commission_status",be.PENDING.toString()),o.set("status",ne.COMPLETED.toString()),o.set("commission_balance","gt:0"),a(`/finance/order?${o.toString()}`)};return e.jsxs("div",{className:y("grid gap-4 md:grid-cols-2 lg:grid-cols-4",s),children:[e.jsx($s,{title:t("dashboard:stats.todayIncome"),value:Js(l.todayIncome),icon:e.jsx(ec,{className:"h-4 w-4 text-emerald-500"}),trend:{value:l.dayIncomeGrowth,label:t("dashboard:stats.vsYesterday"),isPositive:l.dayIncomeGrowth>0}}),e.jsx($s,{title:t("dashboard:stats.monthlyIncome"),value:Js(l.currentMonthIncome),icon:e.jsx(Gl,{className:"h-4 w-4 text-blue-500"}),trend:{value:l.monthIncomeGrowth,label:t("dashboard:stats.vsLastMonth"),isPositive:l.monthIncomeGrowth>0}}),e.jsx($s,{title:t("dashboard:stats.pendingTickets"),value:l.ticketPendingTotal,icon:e.jsx(sc,{className:y("h-4 w-4",l.ticketPendingTotal>0?"text-orange-500":"text-muted-foreground")}),description:l.ticketPendingTotal>0?t("dashboard:stats.hasPendingTickets"):t("dashboard:stats.noPendingTickets"),onClick:()=>a("/user/ticket"),highlight:l.ticketPendingTotal>0}),e.jsx($s,{title:t("dashboard:stats.pendingCommission"),value:l.commissionPendingTotal,icon:e.jsx(tc,{className:y("h-4 w-4",l.commissionPendingTotal>0?"text-blue-500":"text-muted-foreground")}),description:l.commissionPendingTotal>0?t("dashboard:stats.hasPendingCommission"):t("dashboard:stats.noPendingCommission"),onClick:r,highlight:l.commissionPendingTotal>0}),e.jsx($s,{title:t("dashboard:stats.monthlyNewUsers"),value:l.currentMonthNewUsers,icon:e.jsx(sn,{className:"h-4 w-4 text-blue-500"}),trend:{value:l.userGrowth,label:t("dashboard:stats.vsLastMonth"),isPositive:l.userGrowth>0}}),e.jsx($s,{title:t("dashboard:stats.totalUsers"),value:l.totalUsers,icon:e.jsx(sn,{className:"h-4 w-4 text-muted-foreground"}),description:t("dashboard:stats.activeUsers",{count:l.activeUsers})}),e.jsx($s,{title:t("dashboard:stats.monthlyUpload"),value:Oe(l.monthTraffic.upload),icon:e.jsx(Kt,{className:"h-4 w-4 text-emerald-500"}),description:t("dashboard:stats.todayTraffic",{value:Oe(l.todayTraffic.upload)})}),e.jsx($s,{title:t("dashboard:stats.monthlyDownload"),value:Oe(l.monthTraffic.download),icon:e.jsx(ac,{className:"h-4 w-4 text-blue-500"}),description:t("dashboard:stats.todayTraffic",{value:Oe(l.todayTraffic.download)})})]})}const _t=m.forwardRef(({className:s,children:a,...t},l)=>e.jsxs(Wl,{ref:l,className:y("relative overflow-hidden",s),...t,children:[e.jsx(lc,{className:"h-full w-full rounded-[inherit]",children:a}),e.jsx(_a,{}),e.jsx(rc,{})]}));_t.displayName=Wl.displayName;const _a=m.forwardRef(({className:s,orientation:a="vertical",...t},l)=>e.jsx(Yl,{ref:l,orientation:a,className:y("flex touch-none select-none transition-colors",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",s),...t,children:e.jsx(ic,{className:"relative flex-1 rounded-full bg-border"})}));_a.displayName=Yl.displayName;const dn={today:{getValue:()=>{const s=cc();return{start:s,end:dc(s,1)}}},last7days:{getValue:()=>{const s=new Date;return{start:ps(s,7),end:s}}},last30days:{getValue:()=>{const s=new Date;return{start:ps(s,30),end:s}}},custom:{getValue:()=>null}};function tl({selectedRange:s,customDateRange:a,onRangeChange:t,onCustomRangeChange:l}){const{t:n}=V(),r={today:n("dashboard:trafficRank.today"),last7days:n("dashboard:trafficRank.last7days"),last30days:n("dashboard:trafficRank.last30days"),custom:n("dashboard:trafficRank.customRange")};return e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[e.jsxs(J,{value:s,onValueChange:t,children:[e.jsx(W,{className:"w-[120px]",children:e.jsx(Q,{placeholder:n("dashboard:trafficRank.selectTimeRange")})}),e.jsx(Y,{position:"popper",className:"z-50",children:Object.entries(dn).map(([o])=>e.jsx(A,{value:o,children:r[o]},o))})]}),s==="custom"&&e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(K,{variant:"outline",className:y("min-w-0 justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(Ct,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:a?.from?a.to?e.jsxs(e.Fragment,{children:[hs(a.from,"yyyy-MM-dd")," -"," ",hs(a.to,"yyyy-MM-dd")]}):hs(a.from,"yyyy-MM-dd"):e.jsx("span",{children:n("dashboard:trafficRank.selectDateRange")})})]})}),e.jsx(bs,{className:"w-auto p-0",align:"end",children:e.jsx(ct,{mode:"range",defaultMonth:a?.from,selected:{from:a?.from,to:a?.to},onSelect:o=>{o?.from&&o?.to&&l({from:o.from,to:o.to})},numberOfMonths:2})})]})]})}const ht=s=>`${(s/1024/1024/1024).toFixed(2)} GB`;function cm({className:s}){const{t:a}=V(),[t,l]=m.useState("today"),[n,r]=m.useState({from:ps(new Date,7),to:new Date}),[o,c]=m.useState("today"),[u,i]=m.useState({from:ps(new Date,7),to:new Date}),d=m.useMemo(()=>t==="custom"?{start:n.from,end:n.to}:dn[t].getValue(),[t,n]),h=m.useMemo(()=>o==="custom"?{start:u.from,end:u.to}:dn[o].getValue(),[o,u]),{data:k}=le({queryKey:["nodeTrafficRank",d.start,d.end],queryFn:()=>ya.getNodeTrafficData({type:"node",start_time:ke.round(d.start.getTime()/1e3),end_time:ke.round(d.end.getTime()/1e3)}),refetchInterval:3e4}),{data:C}=le({queryKey:["userTrafficRank",h.start,h.end],queryFn:()=>ya.getNodeTrafficData({type:"user",start_time:ke.round(h.start.getTime()/1e3),end_time:ke.round(h.end.getTime()/1e3)}),refetchInterval:3e4});return e.jsxs("div",{className:y("grid gap-4 md:grid-cols-2",s),children:[e.jsxs(Ye,{children:[e.jsx(ts,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(Ns,{className:"flex items-center text-base font-medium",children:[e.jsx(oc,{className:"mr-2 h-4 w-4"}),a("dashboard:trafficRank.nodeTrafficRank")]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(tl,{selectedRange:t,customDateRange:n,onRangeChange:l,onCustomRangeChange:r}),e.jsx(Bn,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(as,{className:"flex-1",children:k?.data?e.jsxs(_t,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:k.data.map(S=>e.jsx(ye,{delayDuration:200,children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:S.name}),e.jsxs("span",{className:y("ml-2 flex items-center text-xs font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?e.jsx(tn,{className:"mr-1 h-3 w-3"}):e.jsx(an,{className:"mr-1 h-3 w-3"}),Math.abs(S.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${S.value/k.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:ht(S.value)})]})]})})}),e.jsx(xe,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.currentTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:ht(S.value)}),e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.previousTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:ht(S.previousValue)}),e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.changeRate"),":"]}),e.jsxs("span",{className:y("font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?"+":"",S.change,"%"]})]})})]})},S.id))}),e.jsx(_a,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:a("common:loading")})})})]}),e.jsxs(Ye,{children:[e.jsx(ts,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(Ns,{className:"flex items-center text-base font-medium",children:[e.jsx(sn,{className:"mr-2 h-4 w-4"}),a("dashboard:trafficRank.userTrafficRank")]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(tl,{selectedRange:o,customDateRange:u,onRangeChange:c,onCustomRangeChange:i}),e.jsx(Bn,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(as,{className:"flex-1",children:C?.data?e.jsxs(_t,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:C.data.map(S=>e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:S.name}),e.jsxs("span",{className:y("ml-2 flex items-center text-xs font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?e.jsx(tn,{className:"mr-1 h-3 w-3"}):e.jsx(an,{className:"mr-1 h-3 w-3"}),Math.abs(S.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${S.value/C.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:ht(S.value)})]})]})})}),e.jsx(xe,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.currentTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:ht(S.value)}),e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.previousTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:ht(S.previousValue)}),e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.changeRate"),":"]}),e.jsxs("span",{className:y("font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?"+":"",S.change,"%"]})]})})]})},S.id))}),e.jsx(_a,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:a("common:loading")})})})]})]})}const dm=tt("inline-flex items-center rounded-md 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 shadow hover:bg-primary/10",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function G({className:s,variant:a,...t}){return e.jsx("div",{className:y(dm({variant:a}),s),...t})}const ua=m.forwardRef(({className:s,value:a,...t},l)=>e.jsx(Jl,{ref:l,className:y("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",s),...t,children:e.jsx(mc,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})}));ua.displayName=Jl.displayName;const Nn=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:t,className:y("w-full caption-bottom text-sm",s),...a})}));Nn.displayName="Table";const _n=m.forwardRef(({className:s,...a},t)=>e.jsx("thead",{ref:t,className:y("[&_tr]:border-b",s),...a}));_n.displayName="TableHeader";const wn=m.forwardRef(({className:s,...a},t)=>e.jsx("tbody",{ref:t,className:y("[&_tr:last-child]:border-0",s),...a}));wn.displayName="TableBody";const mm=m.forwardRef(({className:s,...a},t)=>e.jsx("tfoot",{ref:t,className:y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));mm.displayName="TableFooter";const As=m.forwardRef(({className:s,...a},t)=>e.jsx("tr",{ref:t,className:y("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...a}));As.displayName="TableRow";const Cn=m.forwardRef(({className:s,...a},t)=>e.jsx("th",{ref:t,className:y("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a}));Cn.displayName="TableHead";const vt=m.forwardRef(({className:s,...a},t)=>e.jsx("td",{ref:t,className:y("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a}));vt.displayName="TableCell";const um=m.forwardRef(({className:s,...a},t)=>e.jsx("caption",{ref:t,className:y("mt-4 text-sm text-muted-foreground",s),...a}));um.displayName="TableCaption";function Sn({table:s}){const[a,t]=m.useState(""),{t:l}=V("common");m.useEffect(()=>{t((s.getState().pagination.pageIndex+1).toString())},[s.getState().pagination.pageIndex]);const n=r=>{const o=parseInt(r);!isNaN(o)&&o>=1&&o<=s.getPageCount()?s.setPageIndex(o-1):t((s.getState().pagination.pageIndex+1).toString())};return e.jsxs("div",{className:"flex flex-col-reverse gap-4 px-2 py-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{className:"flex-1 text-sm text-muted-foreground",children:l("table.pagination.selected",{selected:s.getFilteredSelectedRowModel().rows.length,total:s.getFilteredRowModel().rows.length})}),e.jsxs("div",{className:"flex flex-col-reverse items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:l("table.pagination.itemsPerPage")}),e.jsxs(J,{value:`${s.getState().pagination.pageSize}`,onValueChange:r=>{s.setPageSize(Number(r))},children:[e.jsx(W,{className:"h-8 w-[70px]",children:e.jsx(Q,{placeholder:s.getState().pagination.pageSize})}),e.jsx(Y,{side:"top",children:[10,20,30,40,50,100,500].map(r=>e.jsx(A,{value:`${r}`,children:r},r))})]})]}),e.jsxs("div",{className:"flex items-center justify-center space-x-2 text-sm font-medium",children:[e.jsx("span",{children:l("table.pagination.page")}),e.jsx(D,{type:"text",value:a,onChange:r=>t(r.target.value),onBlur:r=>n(r.target.value),onKeyDown:r=>{r.key==="Enter"&&n(r.currentTarget.value)},className:"h-8 w-[50px] text-center"}),e.jsx("span",{children:l("table.pagination.pageOf",{total:s.getPageCount()})})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(L,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(0),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:l("table.pagination.firstPage")}),e.jsx(uc,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.previousPage(),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:l("table.pagination.previousPage")}),e.jsx(Kl,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.nextPage(),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:l("table.pagination.nextPage")}),e.jsx(pn,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(s.getPageCount()-1),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:l("table.pagination.lastPage")}),e.jsx(xc,{className:"h-4 w-4"})]})]})]})]})}function os({table:s,toolbar:a,draggable:t=!1,onDragStart:l,onDragEnd:n,onDragOver:r,onDragLeave:o,onDrop:c,showPagination:u=!0,isLoading:i=!1}){const{t:d}=V("common"),h=m.useRef(null),k=s.getAllColumns().filter(N=>N.getIsPinned()==="left"),C=s.getAllColumns().filter(N=>N.getIsPinned()==="right"),S=N=>k.slice(0,N).reduce((g,T)=>g+(T.getSize()??0),0),w=N=>C.slice(N+1).reduce((g,T)=>g+(T.getSize()??0),0);return e.jsxs("div",{className:"space-y-4",children:[typeof a=="function"?a(s):a,e.jsx("div",{ref:h,className:"relative overflow-auto rounded-md border bg-card",children:e.jsx("div",{className:"overflow-auto",children:e.jsxs(Nn,{children:[e.jsx(_n,{children:s.getHeaderGroups().map(N=>e.jsx(As,{className:"hover:bg-transparent",children:N.headers.map((g,T)=>{const E=g.column.getIsPinned()==="left",p=g.column.getIsPinned()==="right",_=E?S(k.indexOf(g.column)):void 0,I=p?w(C.indexOf(g.column)):void 0;return e.jsx(Cn,{colSpan:g.colSpan,style:{width:g.getSize(),...E&&{left:_},...p&&{right:I}},className:y("h-11 bg-card px-4 text-muted-foreground",(E||p)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",E&&"before:right-0",p&&"before:left-0"]),children:g.isPlaceholder?null:ga(g.column.columnDef.header,g.getContext())},g.id)})},N.id))}),e.jsx(wn,{children:s.getRowModel().rows?.length?s.getRowModel().rows.map((N,g)=>e.jsx(As,{"data-state":N.getIsSelected()&&"selected",className:"hover:bg-muted/50",draggable:t,onDragStart:T=>l?.(T,g),onDragEnd:n,onDragOver:r,onDragLeave:o,onDrop:T=>c?.(T,g),children:N.getVisibleCells().map((T,E)=>{const p=T.column.getIsPinned()==="left",_=T.column.getIsPinned()==="right",I=p?S(k.indexOf(T.column)):void 0,H=_?w(C.indexOf(T.column)):void 0;return e.jsx(vt,{style:{width:T.column.getSize(),...p&&{left:I},..._&&{right:H}},className:y("bg-card",(p||_)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",p&&"before:right-0",_&&"before:left-0"]),children:ga(T.column.columnDef.cell,T.getContext())},T.id)})},N.id)):e.jsx(As,{children:e.jsx(vt,{colSpan:s.getAllColumns().length,className:"h-24 text-center",children:d("table.noData")})})})]})})}),u&&e.jsx(Sn,{table:s})]})}const xa=s=>{if(!s)return"";let a;if(typeof s=="string"){if(a=parseInt(s),isNaN(a))return s}else a=s;return(a.toString().length===10?new Date(a*1e3):new Date(a)).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})},Ft=Ql(),Mt=Ql();function ra({data:s,isLoading:a,searchKeyword:t,selectedLevel:l,total:n,currentPage:r,pageSize:o,onViewDetail:c,onPageChange:u}){const{t:i}=V(),d=C=>{switch(C.toLowerCase()){case"info":return e.jsx($t,{className:"h-4 w-4 text-blue-500"});case"warning":return e.jsx(ma,{className:"h-4 w-4 text-yellow-500"});case"error":return e.jsx(ln,{className:"h-4 w-4 text-red-500"});default:return e.jsx($t,{className:"h-4 w-4 text-slate-500"})}},h=m.useMemo(()=>[Ft.accessor("level",{id:"level",header:()=>i("dashboard:systemLog.level","级别"),size:80,cell:({getValue:C,row:S})=>{const w=C();return e.jsxs("div",{className:"flex items-center gap-1",children:[d(w),e.jsx("span",{className:y(w.toLowerCase()==="error"&&"text-red-600",w.toLowerCase()==="warning"&&"text-yellow-600",w.toLowerCase()==="info"&&"text-blue-600"),children:w})]})}}),Ft.accessor("created_at",{id:"created_at",header:()=>i("dashboard:systemLog.time","时间"),size:160,cell:({getValue:C})=>xa(C())}),Ft.accessor(C=>C.title||C.message||"",{id:"title",header:()=>i("dashboard:systemLog.logTitle","标题"),cell:({getValue:C})=>e.jsx("span",{className:"inline-block max-w-[300px] truncate",children:C()})}),Ft.accessor("method",{id:"method",header:()=>i("dashboard:systemLog.method","请求方法"),size:100,cell:({getValue:C})=>{const S=C();return S?e.jsx(G,{variant:"outline",className:y(S==="GET"&&"border-blue-200 bg-blue-50 text-blue-700",S==="POST"&&"border-green-200 bg-green-50 text-green-700",S==="PUT"&&"border-amber-200 bg-amber-50 text-amber-700",S==="DELETE"&&"border-red-200 bg-red-50 text-red-700"),children:S}):null}}),Ft.display({id:"actions",header:()=>i("dashboard:systemLog.action","操作"),size:80,cell:({row:C})=>e.jsx(K,{variant:"ghost",size:"sm",onClick:()=>c(C.original),"aria-label":i("dashboard:systemLog.viewDetail","查看详情"),children:e.jsx(nn,{className:"h-4 w-4"})})})],[i,c]),k=Je({data:s,columns:h,getCoreRowModel:Qe(),getPaginationRowModel:rs(),pageCount:Math.ceil(n/o),manualPagination:!0,state:{pagination:{pageIndex:r-1,pageSize:o}},onPaginationChange:C=>{if(typeof C=="function"){const S=C({pageIndex:r-1,pageSize:o});u(S.pageIndex+1)}else u(C.pageIndex+1)}});return e.jsxs("div",{className:"overflow-x-auto",children:[e.jsx(os,{table:k,showPagination:!1,isLoading:a}),e.jsx(Sn,{table:k}),(t||l&&l!=="all")&&e.jsx("div",{className:"text-center text-sm text-muted-foreground",children:t&&l&&l!=="all"?`筛选结果: 包含"${t}"且级别为"${l}"的日志共 ${n} 条`:t?`搜索结果: 包含"${t}"的日志共 ${n} 条`:`筛选结果: 级别为"${l}"的日志共 ${n} 条`})]})}function xm(){const{t:s}=V(),[a,t]=m.useState(0),[l,n]=m.useState(!1),[r,o]=m.useState(1),[c]=m.useState(10),[u,i]=m.useState(null),[d,h]=m.useState(!1),[k,C]=m.useState(!1),[S,w]=m.useState(1),[N]=m.useState(10),[g,T]=m.useState(null),[E,p]=m.useState(!1),[_,I]=m.useState(""),[H,O]=m.useState(""),[B,ce]=m.useState("all"),[ee,te]=m.useState(!1),[q,R]=m.useState(30),[X,ms]=m.useState("all"),[Te,re]=m.useState(1e3),[us,Ts]=m.useState(!1),[Bs,Dt]=m.useState(null),[Jt,Pt]=m.useState(!1);m.useEffect(()=>{const U=setTimeout(()=>{O(_),_!==H&&w(1)},500);return()=>clearTimeout(U)},[_]);const{data:Ms,isLoading:qa,refetch:se,isRefetching:de}=le({queryKey:["systemStatus",a],queryFn:async()=>(await oe.getSystemStatus()).data,refetchInterval:3e4}),{data:ae,isLoading:Gs,refetch:ep,isRefetching:Fn}=le({queryKey:["queueStats",a],queryFn:async()=>(await oe.getQueueStats()).data,refetchInterval:3e4}),{data:Mn,isLoading:ui,refetch:xi}=le({queryKey:["failedJobs",r,c],queryFn:async()=>{const U=await oe.getHorizonFailedJobs({current:r,page_size:c});return{data:U.data,total:U.total||0}},enabled:l}),{data:On,isLoading:Qt,refetch:hi}=le({queryKey:["systemLogs",S,N,B,H],queryFn:async()=>{const U={current:S,page_size:N};B&&B!=="all"&&(U.level=B),H.trim()&&(U.keyword=H.trim());const Os=await oe.getSystemLog(U);return{data:Os.data,total:Os.total||0}},enabled:k}),zn=Mn?.data||[],pi=Mn?.total||0,Xt=On?.data||[],Zt=On?.total||0,gi=m.useMemo(()=>[Mt.display({id:"failed_at",header:()=>s("dashboard:queue.details.time","时间"),cell:({row:U})=>xa(U.original.failed_at)}),Mt.display({id:"queue",header:()=>s("dashboard:queue.details.queue","队列"),cell:({row:U})=>U.original.queue}),Mt.display({id:"name",header:()=>s("dashboard:queue.details.name","任务名称"),cell:({row:U})=>e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx("span",{className:"inline-block max-w-[150px] truncate",children:U.original.name})}),e.jsx(xe,{children:e.jsx("span",{children:U.original.name})})]})})}),Mt.display({id:"exception",header:()=>s("dashboard:queue.details.exception","异常信息"),cell:({row:U})=>e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx("span",{className:"inline-block max-w-[200px] truncate",children:U.original.exception.split(` -`)[0]})}),e.jsx(xe,{className:"max-w-[300px] whitespace-pre-wrap",children:e.jsx("span",{children:U.original.exception})})]})})}),Mt.display({id:"actions",header:()=>s("dashboard:queue.details.action","操作"),size:80,cell:({row:U})=>e.jsx(K,{variant:"ghost",size:"sm",onClick:()=>bi(U.original),"aria-label":s("dashboard:queue.details.viewDetail","查看详情"),children:e.jsx(nn,{className:"h-4 w-4"})})})],[s]),$n=Je({data:zn,columns:gi,getCoreRowModel:Qe(),getPaginationRowModel:rs(),pageCount:Math.ceil(pi/c),manualPagination:!0,state:{pagination:{pageIndex:r-1,pageSize:c}},onPaginationChange:U=>{if(typeof U=="function"){const Os=U({pageIndex:r-1,pageSize:c});An(Os.pageIndex+1)}else An(U.pageIndex+1)}}),fi=()=>{t(U=>U+1)},An=U=>{o(U)},ea=U=>{w(U)},ji=U=>{ce(U),w(1)},vi=()=>{I(""),O(""),ce("all"),w(1)},sa=U=>{T(U),p(!0)},bi=U=>{i(U),h(!0)},yi=async()=>{try{const U=await oe.getLogClearStats({days:q,level:X==="all"?void 0:X});Dt(U.data),Pt(!0)}catch(U){console.error("获取清理统计失败:",U),$.error("获取清理统计失败")}},Ni=async()=>{Ts(!0);try{const U=await oe.clearSystemLog({days:q,level:X==="all"?void 0:X,limit:Te});U.data.status==="success"?($.success(`清理完成!已清理 ${U.data.cleared_count} 条日志`),te(!1),Pt(!1),Dt(null),se()):$.error(U.data.message||"清理失败")}catch(U){console.error("清理日志失败:",U),$.error("清理日志失败")}finally{Ts(!1)}};if(qa||Gs)return e.jsx("div",{className:"flex items-center justify-center p-6",children:e.jsx(fa,{className:"h-6 w-6 animate-spin"})});const _i=U=>U?e.jsx(Xl,{className:"h-5 w-5 text-green-500"}):e.jsx(Zl,{className:"h-5 w-5 text-red-500"});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(Ye,{children:[e.jsxs(ts,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ns,{className:"flex items-center gap-2",children:[e.jsx(hc,{className:"h-5 w-5"}),s("dashboard:queue.title")]}),e.jsx(st,{children:s("dashboard:queue.status.description")})]}),e.jsx(K,{variant:"outline",size:"icon",onClick:fi,disabled:de||Fn,children:e.jsx(Ha,{className:y("h-4 w-4",(de||Fn)&&"animate-spin")})})]}),e.jsx(as,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[_i(ae?.status||!1),e.jsx("span",{className:"font-medium",children:s("dashboard:queue.status.running")})]}),e.jsx(G,{variant:ae?.status?"secondary":"destructive",children:ae?.status?s("dashboard:queue.status.normal"):s("dashboard:queue.status.abnormal")})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.status.waitTime",{seconds:ae?.wait?.default||0})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.recentJobs")}),e.jsx("p",{className:"text-2xl font-bold",children:ae?.recentJobs||0}),e.jsx(ua,{value:(ae?.recentJobs||0)/(ae?.periods?.recentJobs||1)*100,className:"h-1"})]})}),e.jsx(xe,{children:e.jsx("p",{children:s("dashboard:queue.details.statisticsPeriod",{hours:ae?.periods?.recentJobs||0})})})]})}),e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.jobsPerMinute")}),e.jsx("p",{className:"text-2xl font-bold",children:ae?.jobsPerMinute||0}),e.jsx(ua,{value:(ae?.jobsPerMinute||0)/(ae?.queueWithMaxThroughput?.throughput||1)*100,className:"h-1"})]})}),e.jsx(xe,{children:e.jsx("p",{children:s("dashboard:queue.details.maxThroughput",{value:ae?.queueWithMaxThroughput?.throughput||0})})})]})})]})]})})]}),e.jsxs(Ye,{children:[e.jsxs(ts,{children:[e.jsxs(Ns,{className:"flex items-center gap-2",children:[e.jsx(pc,{className:"h-5 w-5"}),s("dashboard:queue.jobDetails")]}),e.jsx(st,{children:s("dashboard:queue.details.description")})]}),e.jsx(as,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.failedJobs7Days")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"cursor-pointer text-2xl font-bold text-destructive hover:underline",title:s("dashboard:queue.details.viewFailedJobs"),onClick:()=>n(!0),style:{userSelect:"none"},children:ae?.failedJobs||0}),e.jsx(nn,{className:"h-4 w-4 cursor-pointer text-muted-foreground hover:text-destructive",onClick:()=>n(!0),"aria-label":s("dashboard:queue.details.viewFailedJobs")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("dashboard:queue.details.retentionPeriod",{hours:ae?.periods?.failedJobs||0})})]}),e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.longestRunningQueue")}),e.jsxs("p",{className:"text-2xl font-bold",children:[ae?.queueWithMaxRuntime?.runtime||0,"s"]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:ae?.queueWithMaxRuntime?.name||"N/A"})]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.activeProcesses")}),e.jsxs("span",{className:"font-medium",children:[ae?.processes||0," /"," ",(ae?.processes||0)+(ae?.pausedMasters||0)]})]}),e.jsx(ua,{value:(ae?.processes||0)/((ae?.processes||0)+(ae?.pausedMasters||0))*100,className:"mt-2 h-1"})]})]})})]})]}),e.jsxs(Ye,{children:[e.jsxs(ts,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ns,{className:"flex items-center gap-2",children:[e.jsx(Gn,{className:"h-5 w-5"}),s("dashboard:systemLog.title","系统日志")]}),e.jsx(st,{children:s("dashboard:systemLog.description","查看系统运行日志记录")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(K,{variant:"outline",onClick:()=>C(!0),children:s("dashboard:systemLog.viewAll","查看全部")}),e.jsxs(K,{variant:"outline",onClick:()=>te(!0),className:"text-destructive hover:text-destructive",children:[e.jsx(We,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.clearLogs","清理日志")]})]})]}),e.jsx(as,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-900 dark:bg-blue-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($t,{className:"h-5 w-5 text-blue-500"}),e.jsx("p",{className:"font-medium text-blue-700 dark:text-blue-300",children:s("dashboard:systemLog.tabs.info","信息")})]}),e.jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:Ms?.logs?.info||0})]}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-yellow-200 bg-yellow-50 p-3 dark:border-yellow-900 dark:bg-yellow-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ma,{className:"h-5 w-5 text-yellow-500"}),e.jsx("p",{className:"font-medium text-yellow-700 dark:text-yellow-300",children:s("dashboard:systemLog.tabs.warning","警告")})]}),e.jsx("p",{className:"text-2xl font-bold text-yellow-700 dark:text-yellow-300",children:Ms?.logs?.warning||0})]}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-900 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ln,{className:"h-5 w-5 text-red-500"}),e.jsx("p",{className:"font-medium text-red-700 dark:text-red-300",children:s("dashboard:systemLog.tabs.error","错误")})]}),e.jsx("p",{className:"text-2xl font-bold text-red-700 dark:text-red-300",children:Ms?.logs?.error||0})]})]}),Ms?.logs&&Ms.logs.total>0&&e.jsxs("div",{className:"mt-3 text-center text-sm text-muted-foreground",children:[s("dashboard:systemLog.totalLogs","总日志数"),":"," ",Ms.logs.total]})]})})]}),e.jsx(he,{open:l,onOpenChange:n,children:e.jsxs(ue,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(je,{children:e.jsx(pe,{children:s("dashboard:queue.details.failedJobsDetailTitle","失败任务详情")})}),e.jsxs("div",{className:"overflow-x-auto",children:[e.jsx(os,{table:$n,showPagination:!1,isLoading:ui}),e.jsx(Sn,{table:$n}),zn.length===0&&e.jsx("div",{className:"py-8 text-center text-muted-foreground",children:s("dashboard:queue.details.noFailedJobs","暂无失败任务")})]}),e.jsxs(Le,{children:[e.jsxs(K,{variant:"outline",onClick:()=>xi(),children:[e.jsx(Ha,{className:"mr-2 h-4 w-4"}),s("dashboard:common.refresh","刷新")]}),e.jsx(qs,{asChild:!0,children:e.jsx(K,{variant:"outline",children:s("common.close","关闭")})})]})]})}),e.jsx(he,{open:d,onOpenChange:h,children:e.jsxs(ue,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(je,{children:e.jsx(pe,{children:s("dashboard:queue.details.jobDetailTitle","任务详情")})}),u&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.id","任务ID")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:u.id})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.time","时间")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.failed_at})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.queue","队列")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.queue})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.connection","连接")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.connection})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.name","任务名称")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:u.name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.exception","异常信息")}),e.jsx("div",{className:"max-h-[200px] overflow-y-auto rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:e.jsx("pre",{className:"whitespace-pre-wrap text-xs text-red-700 dark:text-red-300",children:u.exception})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.payload","任务数据")}),e.jsx("div",{className:"max-h-[200px] overflow-y-auto rounded-md bg-muted/50 p-3",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs",children:(()=>{try{return JSON.stringify(JSON.parse(u.payload),null,2)}catch{return u.payload}})()})})]})]}),e.jsx(Le,{children:e.jsx(K,{variant:"outline",onClick:()=>h(!1),children:s("common.close","关闭")})})]})}),e.jsx(he,{open:k,onOpenChange:C,children:e.jsxs(ue,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(je,{children:e.jsx(pe,{children:s("dashboard:systemLog.title","系统日志")})}),e.jsxs(Yt,{value:B,onValueChange:ji,className:"w-full overflow-x-auto",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-2 p-1 md:flex-row md:items-center md:justify-between",children:[e.jsxs(kt,{className:"grid w-auto grid-cols-4",children:[e.jsxs(es,{value:"all",className:"flex items-center gap-2",children:[e.jsx(Gn,{className:"h-4 w-4"}),s("dashboard:systemLog.tabs.all","全部")]}),e.jsxs(es,{value:"info",className:"flex items-center gap-2",children:[e.jsx($t,{className:"h-4 w-4 text-blue-500"}),s("dashboard:systemLog.tabs.info","信息")]}),e.jsxs(es,{value:"warning",className:"flex items-center gap-2",children:[e.jsx(ma,{className:"h-4 w-4 text-yellow-500"}),s("dashboard:systemLog.tabs.warning","警告")]}),e.jsxs(es,{value:"error",className:"flex items-center gap-2",children:[e.jsx(ln,{className:"h-4 w-4 text-red-500"}),s("dashboard:systemLog.tabs.error","错误")]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(fn,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(D,{placeholder:s("dashboard:systemLog.search","搜索日志内容..."),value:_,onChange:U=>I(U.target.value),className:"w-full md:w-64"})]})]}),e.jsx(Ls,{value:"all",className:"mt-0",children:e.jsx(ra,{data:Xt,isLoading:Qt,searchKeyword:H,selectedLevel:B,total:Zt,currentPage:S,pageSize:N,onViewDetail:sa,onPageChange:ea})}),e.jsx(Ls,{value:"info",className:"mt-0 overflow-x-auto",children:e.jsx(ra,{data:Xt,isLoading:Qt,searchKeyword:H,selectedLevel:B,total:Zt,currentPage:S,pageSize:N,onViewDetail:sa,onPageChange:ea})}),e.jsx(Ls,{value:"warning",className:"mt-0",children:e.jsx(ra,{data:Xt,isLoading:Qt,searchKeyword:H,selectedLevel:B,total:Zt,currentPage:S,pageSize:N,onViewDetail:sa,onPageChange:ea})}),e.jsx(Ls,{value:"error",className:"mt-0",children:e.jsx(ra,{data:Xt,isLoading:Qt,searchKeyword:H,selectedLevel:B,total:Zt,currentPage:S,pageSize:N,onViewDetail:sa,onPageChange:ea})})]}),e.jsxs(Le,{children:[e.jsxs(K,{variant:"outline",onClick:()=>hi(),children:[e.jsx(Ha,{className:"mr-2 h-4 w-4"}),s("dashboard:common.refresh","刷新")]}),e.jsx(K,{variant:"outline",onClick:vi,children:s("dashboard:systemLog.filter.reset","重置筛选")}),e.jsx(qs,{asChild:!0,children:e.jsx(K,{variant:"outline",children:s("common.close","关闭")})})]})]})}),e.jsx(he,{open:E,onOpenChange:p,children:e.jsxs(ue,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(je,{children:e.jsx(pe,{children:s("dashboard:systemLog.detailTitle","日志详情")})}),g&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.level","级别")}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx($t,{className:"h-4 w-4"}),e.jsx("p",{className:"font-medium",children:g.level})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.time","时间")}),e.jsx("p",{children:xa(g.created_at)||xa(g.updated_at)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.logTitle","标题")}),e.jsx("div",{className:"whitespace-pre-wrap rounded-md bg-muted/50 p-3",children:g.title||g.message||""})]}),(g.host||g.ip)&&e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.host&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.host","主机")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:g.host})]}),g.ip&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.ip","IP地址")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:g.ip})]})]}),g.uri&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.uri","URI")}),e.jsx("div",{className:"overflow-x-auto rounded-md bg-muted/50 p-3",children:e.jsx("code",{className:"text-sm",children:g.uri})})]}),g.method&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.method","请求方法")}),e.jsx("div",{children:e.jsx(G,{variant:"outline",className:"text-base font-medium",children:g.method})})]}),g.data&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.requestData","请求数据")}),e.jsx("div",{className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/50 p-3",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs",children:(()=>{try{return JSON.stringify(JSON.parse(g.data),null,2)}catch{return g.data}})()})})]}),g.context&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.exception","异常信息")}),e.jsx("div",{className:"max-h-[250px] overflow-y-auto rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs text-red-700 dark:text-red-300",children:(()=>{try{const U=JSON.parse(g.context);if(U.exception){const Os=U.exception,wi=Os["\0*\0message"]||"",Ci=Os["\0*\0file"]||"",Si=Os["\0*\0line"]||"";return`${wi} +import{r as m,j as e,t as ki,c as Ti,I as qn,a as tt,S as mn,u as Rs,b as Di,d as un,R as ml,e as ul,f as Pi,F as Li,C as Ei,L as xl,T as hl,g as pl,h as Ii,i as Ri,k as Vi,l as $,z as x,m as V,n as Ne,o as we,p as le,q as fs,s as ke,v as Fi,w as Mi,O as xn,x as Oi,y as zi,A as $i,B as Ai,D as qi,E as Hi,Q as Ui,G as Ki,H as Bi,J as Gi,P as Wi,K as Yi,M as Ji,N as Qi,U as Xi,V as gl,W as fl,X as Ca,Y as Sa,Z as hn,_ as ds,$ as ka,a0 as Ta,a1 as jl,a2 as vl,a3 as bl,a4 as pn,a5 as yl,a6 as Zi,a7 as Nl,a8 as _l,a9 as wl,aa as Cl,ab as at,ac as Sl,ad as eo,ae as kl,af as Tl,ag as so,ah as to,ai as ao,aj as no,ak as lo,al as ro,am as io,an as oo,ao as co,ap as mo,aq as uo,ar as Dl,as as xo,at as ho,au as nt,av as Pl,aw as po,ax as go,ay as Ll,az as gn,aA as fo,aB as jo,aC as Hn,aD as vo,aE as El,aF as bo,aG as Il,aH as yo,aI as No,aJ as _o,aK as wo,aL as Co,aM as So,aN as Rl,aO as ko,aP as To,aQ as Do,aR as He,aS as Po,aT as fn,aU as Lo,aV as Eo,aW as Vl,aX as Fl,aY as Ml,aZ as Io,a_ as Ro,a$ as Vo,b0 as Ol,b1 as Fo,b2 as jn,b3 as zl,b4 as Mo,b5 as $l,b6 as Oo,b7 as Al,b8 as zo,b9 as ql,ba as Hl,bb as $o,bc as Ao,bd as Ul,be as qo,bf as Ho,bg as Kl,bh as Uo,bi as Bl,bj as Ko,bk as Bo,bl as ps,bm as hs,bn as Ct,bo as Go,bp as Wo,bq as Yo,br as Jo,bs as Qo,bt as Xo,bu as Un,bv as Kn,bw as Zo,bx as ec,by as Gl,bz as sc,bA as tc,bB as pa,bC as Kt,bD as ac,bE as nc,bF as Wl,bG as lc,bH as rc,bI as Yl,bJ as ic,bK as oc,bL as Bn,bM as tn,bN as an,bO as cc,bP as dc,bQ as Jl,bR as mc,bS as uc,bT as xc,bU as ga,bV as nn,bW as Je,bX as fa,bY as hc,bZ as Ua,b_ as pc,b$ as Gn,c0 as We,c1 as $t,c2 as da,c3 as ln,c4 as Ql,c5 as Qe,c6 as rs,c7 as Xl,c8 as Zl,c9 as gc,ca as fc,cb as jc,cc as vc,cd as bc,ce as er,cf as yc,cg as Nc,ch as ze,ci as Wn,cj as _c,ck as sr,cl as tr,cm as ar,cn as nr,co as lr,cp as rr,cq as wc,cr as Cc,cs as Sc,ct as Da,cu as lt,cv as js,cw as vs,cx as kc,cy as Tc,cz as Dc,cA as Pc,cB as Lc,cC as Ec,cD as Ic,cE as Rc,cF as Vc,cG as rn,cH as vn,cI as bn,cJ as Fc,cK as Vs,cL as Fs,cM as Pa,cN as Mc,cO as ja,cP as Oc,cQ as Yn,cR as ir,cS as Jn,cT as va,cU as zc,cV as $c,cW as Ac,cX as qc,cY as Hc,cZ as or,c_ as Uc,c$ as Kc,d0 as cr,d1 as on,d2 as dr,d3 as Bc,d4 as mr,d5 as ur,d6 as Gc,d7 as Wc,d8 as Yc,d9 as Jc,da as Qc}from"./vendor.js";import"./index.js";var np=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lp(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Xc(s){if(s.__esModule)return s;var a=s.default;if(typeof a=="function"){var t=function l(){return this instanceof l?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};t.prototype=a.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(l){var n=Object.getOwnPropertyDescriptor(s,l);Object.defineProperty(t,l,n.get?n:{enumerable:!0,get:function(){return s[l]}})}),t}const Zc={theme:"system",setTheme:()=>null},xr=m.createContext(Zc);function ed({children:s,defaultTheme:a="system",storageKey:t="vite-ui-theme",...l}){const[n,r]=m.useState(()=>localStorage.getItem(t)||a);m.useEffect(()=>{const c=window.document.documentElement;if(c.classList.remove("light","dark"),n==="system"){const u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";c.classList.add(u);return}c.classList.add(n)},[n]);const o={theme:n,setTheme:c=>{localStorage.setItem(t,c),r(c)}};return e.jsx(xr.Provider,{...l,value:o,children:s})}const sd=()=>{const s=m.useContext(xr);if(s===void 0)throw new Error("useTheme must be used within a ThemeProvider");return s},td=function(){const a=typeof document<"u"&&document.createElement("link").relList;return a&&a.supports&&a.supports("modulepreload")?"modulepreload":"preload"}(),ad=function(s,a){return new URL(s,a).href},Qn={},be=function(a,t,l){let n=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),u=c?.nonce||c?.getAttribute("nonce");n=Promise.allSettled(t.map(i=>{if(i=ad(i,l),i in Qn)return;Qn[i]=!0;const d=i.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!l)for(let S=o.length-1;S>=0;S--){const w=o[S];if(w.href===i&&(!d||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${h}`))return;const C=document.createElement("link");if(C.rel=d?"stylesheet":td,d||(C.as="script"),C.crossOrigin="",C.href=i,u&&C.setAttribute("nonce",u),document.head.appendChild(C),d)return new Promise((S,w)=>{C.addEventListener("load",S),C.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${i}`)))})}))}function r(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return n.then(o=>{for(const c of o||[])c.status==="rejected"&&r(c.reason);return a().catch(r)})};function y(...s){return ki(Ti(s))}const St=tt("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),L=m.forwardRef(({className:s,variant:a,size:t,asChild:l=!1,children:n,disabled:r,loading:o=!1,leftSection:c,rightSection:u,...i},d)=>{const h=l?mn:"button";return e.jsxs(h,{className:y(St({variant:a,size:t,className:s})),disabled:o||r,ref:d,...i,children:[(c&&o||!c&&!u&&o)&&e.jsx(qn,{className:"mr-2 h-4 w-4 animate-spin"}),!o&&c&&e.jsx("div",{className:"mr-2",children:c}),n,!o&&u&&e.jsx("div",{className:"ml-2",children:u}),u&&o&&e.jsx(qn,{className:"ml-2 h-4 w-4 animate-spin"})]})});L.displayName="Button";function dt({className:s,minimal:a=!1}){const t=Rs(),l=Di(),n=l?.message||l?.statusText||"Unknown error occurred";return e.jsx("div",{className:y("h-svh w-full",s),children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[!a&&e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"500"}),e.jsxs("span",{className:"font-medium",children:["Oops! Something went wrong ",":')"]}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["We apologize for the inconvenience. ",e.jsx("br",{}),n]}),!a&&e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(L,{variant:"outline",onClick:()=>t(-1),children:"Go Back"}),e.jsx(L,{onClick:()=>t("/"),children:"Back to Home"})]})]})})}function Xn(){const s=Rs();return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"404"}),e.jsx("span",{className:"font-medium",children:"Oops! Page Not Found!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["It seems like the page you're looking for ",e.jsx("br",{}),"does not exist or might have been removed."]}),e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(L,{variant:"outline",onClick:()=>s(-1),children:"Go Back"}),e.jsx(L,{onClick:()=>s("/"),children:"Back to Home"})]})]})})}function nd(){return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"503"}),e.jsx("span",{className:"font-medium",children:"Website is under maintenance!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["The site is not available at the moment. ",e.jsx("br",{}),"We'll be back online shortly."]}),e.jsx("div",{className:"mt-6 flex gap-4",children:e.jsx(L,{variant:"outline",children:"Learn more"})})]})})}function ld(s){return typeof s>"u"}function rd(s){return s===null}function id(s){return rd(s)||ld(s)}class od{storage;prefixKey;constructor(a){this.storage=a.storage,this.prefixKey=a.prefixKey}getKey(a){return`${this.prefixKey}${a}`.toUpperCase()}set(a,t,l=null){const n=JSON.stringify({value:t,time:Date.now(),expire:l!==null?new Date().getTime()+l*1e3:null});this.storage.setItem(this.getKey(a),n)}get(a,t=null){const l=this.storage.getItem(this.getKey(a));if(!l)return{value:t,time:0};try{const n=JSON.parse(l),{value:r,time:o,expire:c}=n;return id(c)||c>new Date().getTime()?{value:r,time:o}:(this.remove(a),{value:t,time:0})}catch{return this.remove(a),{value:t,time:0}}}remove(a){this.storage.removeItem(this.getKey(a))}clear(){this.storage.clear()}}function hr({prefixKey:s="",storage:a=sessionStorage}){return new od({prefixKey:s,storage:a})}const pr="Xboard_",cd=function(s={}){return hr({prefixKey:s.prefixKey||"",storage:localStorage})},dd=function(s={}){return hr({prefixKey:s.prefixKey||"",storage:sessionStorage})},La=cd({prefixKey:pr});dd({prefixKey:pr});const gr="access_token";function Bt(){return La.get(gr)}function fr(){La.remove(gr)}const Zn=["/sign-in","/sign-in-2","/sign-up","/forgot-password","/otp"];function md({children:s}){const a=Rs(),t=un(),l=Bt();return m.useEffect(()=>{if(!l.value&&!Zn.includes(t.pathname)){const n=encodeURIComponent(t.pathname+t.search);a(`/sign-in?redirect=${n}`)}},[l.value,t.pathname,t.search,a]),Zn.includes(t.pathname)||l.value?e.jsx(e.Fragment,{children:s}):null}const De=m.forwardRef(({className:s,orientation:a="horizontal",decorative:t=!0,...l},n)=>e.jsx(ml,{ref:n,decorative:t,orientation:a,className:y("shrink-0 bg-border",a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...l}));De.displayName=ml.displayName;const ud=tt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Xs=m.forwardRef(({className:s,...a},t)=>e.jsx(ul,{ref:t,className:y(ud(),s),...a}));Xs.displayName=ul.displayName;const Ce=Li,jr=m.createContext({}),v=({...s})=>e.jsx(jr.Provider,{value:{name:s.name},children:e.jsx(Ei,{...s})}),Ea=()=>{const s=m.useContext(jr),a=m.useContext(vr),{getFieldState:t,formState:l}=Pi(),n=t(s.name,l);if(!s)throw new Error("useFormField should be used within ");const{id:r}=a;return{id:r,name:s.name,formItemId:`${r}-form-item`,formDescriptionId:`${r}-form-item-description`,formMessageId:`${r}-form-item-message`,...n}},vr=m.createContext({}),f=m.forwardRef(({className:s,...a},t)=>{const l=m.useId();return e.jsx(vr.Provider,{value:{id:l},children:e.jsx("div",{ref:t,className:y("space-y-2",s),...a})})});f.displayName="FormItem";const j=m.forwardRef(({className:s,...a},t)=>{const{error:l,formItemId:n}=Ea();return e.jsx(Xs,{ref:t,className:y(l&&"text-destructive",s),htmlFor:n,...a})});j.displayName="FormLabel";const b=m.forwardRef(({...s},a)=>{const{error:t,formItemId:l,formDescriptionId:n,formMessageId:r}=Ea();return e.jsx(mn,{ref:a,id:l,"aria-describedby":t?`${n} ${r}`:`${n}`,"aria-invalid":!!t,...s})});b.displayName="FormControl";const M=m.forwardRef(({className:s,...a},t)=>{const{formDescriptionId:l}=Ea();return e.jsx("p",{ref:t,id:l,className:y("text-[0.8rem] text-muted-foreground",s),...a})});M.displayName="FormDescription";const P=m.forwardRef(({className:s,children:a,...t},l)=>{const{error:n,formMessageId:r}=Ea(),o=n?String(n?.message):a;return o?e.jsx("p",{ref:l,id:r,className:y("text-[0.8rem] font-medium text-destructive",s),...t,children:o}):null});P.displayName="FormMessage";const Wt=Ii,kt=m.forwardRef(({className:s,...a},t)=>e.jsx(xl,{ref:t,className:y("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...a}));kt.displayName=xl.displayName;const es=m.forwardRef(({className:s,...a},t)=>e.jsx(hl,{ref:t,className:y("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s),...a}));es.displayName=hl.displayName;const Ls=m.forwardRef(({className:s,...a},t)=>e.jsx(pl,{ref:t,className:y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));Ls.displayName=pl.displayName;function Se(s=void 0,a="YYYY-MM-DD HH:mm:ss"){return s==null?"":(Math.floor(s).toString().length===10&&(s=s*1e3),Ri(s).format(a))}function xd(s=void 0,a="YYYY-MM-DD"){return Se(s,a)}function gt(s){const a=typeof s=="string"?parseFloat(s):s;return isNaN(a)?"0.00":a.toFixed(2)}function Js(s,a=!0){if(s==null)return a?"¥0.00":"0.00";const t=typeof s=="string"?parseFloat(s):s;if(isNaN(t))return a?"¥0.00":"0.00";const n=(t/100).toFixed(2).replace(/\.?0+$/,r=>r.includes(".")?".00":r);return a?`¥${n}`:n}function ba(s){return new Promise(a=>{(async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(s);else{const l=document.createElement("textarea");l.value=s,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.select();const n=document.execCommand("copy");if(document.body.removeChild(l),!n)throw new Error("execCommand failed")}a(!0)}catch(l){console.error(l),a(!1)}})()})}function Oe(s){const a=s/1024,t=a/1024,l=t/1024,n=l/1024;return n>=1?gt(n)+" TB":l>=1?gt(l)+" GB":t>=1?gt(t)+" MB":gt(a)+" KB"}const hd="locale";function pd(){return La.get(hd)}function br(){fr();const s=window.location.pathname,a=s&&!["/404","/sign-in"].includes(s),t=new URL(window.location.href),n=`${t.pathname.split("/")[1]?`/${t.pathname.split("/")[1]}`:""}#/sign-in`;window.location.href=n+(a?`?redirect=${s}`:"")}const gd=["/passport/auth/login","/passport/auth/token2Login","/passport/auth/register","/guest/comm/config","/passport/comm/sendEmailVerify","/passport/auth/forget"];function fd(){const s=window.settings?.base_url||"/";return s.endsWith("/")?s+"api/v2":s+"/api/v2"}const ft=Vi.create({baseURL:fd(),timeout:12e3,headers:{"Content-Type":"application/json"}});ft.interceptors.request.use(s=>{s.method?.toLowerCase()==="get"&&(s.params={...s.params,t:Date.now()});const a=Bt();if(!gd.includes(s.url?.split("?")[0]||"")){if(!a.value)return br(),Promise.reject({code:-1,message:"未登录"});s.headers.Authorization=a.value}return s.headers["Content-Language"]=pd().value||"zh-CN",s},s=>Promise.reject(s));ft.interceptors.response.use(s=>s?.data||{code:-1,message:"未知错误"},s=>{const a=s.response?.status,t=s.response?.data?.message;return(a===401||a===403)&&br(),$.error(t||{401:"登录已过期",403:"没有权限",404:"资源或接口不存在"}[a]||"未知异常"),Promise.reject(s.response?.data||{data:null,code:-1,message:"未知错误"})});const F={get:(s,a)=>ft.get(s,a),post:(s,a,t)=>ft.post(s,a,t),put:(s,a,t)=>ft.put(s,a,t),delete:(s,a)=>ft.delete(s,a)},jd="access_token";function vd(s){La.set(jd,s)}const Ws=window?.settings?.secure_path,ya={getStats:()=>F.get(Ws+"/monitor/api/stats"),getOverride:()=>F.get(Ws+"/stat/getOverride"),getOrderStat:s=>F.get(Ws+"/stat/getOrder",{params:s}),getStatsData:()=>F.get(Ws+"/stat/getStats"),getNodeTrafficData:s=>F.get(Ws+"/stat/getTrafficRank",{params:s}),getServerLastRank:()=>F.get(Ws+"/stat/getServerLastRank"),getServerYesterdayRank:()=>F.get(Ws+"/stat/getServerYesterdayRank")},Lt=window?.settings?.secure_path,At={getList:()=>F.get(Lt+"/theme/getThemes"),getConfig:s=>F.post(Lt+"/theme/getThemeConfig",{name:s}),updateConfig:(s,a)=>F.post(Lt+"/theme/saveThemeConfig",{name:s,config:a}),upload:s=>{const a=new FormData;return a.append("file",s),F.post(Lt+"/theme/upload",a,{headers:{"Content-Type":"multipart/form-data"}})},drop:s=>F.post(Lt+"/theme/delete",{name:s})},mt=window?.settings?.secure_path,Zs={getList:()=>F.get(mt+"/server/manage/getNodes"),save:s=>F.post(mt+"/server/manage/save",s),drop:s=>F.post(mt+"/server/manage/drop",s),copy:s=>F.post(mt+"/server/manage/copy",s),update:s=>F.post(mt+"/server/manage/update",s),sort:s=>F.post(mt+"/server/manage/sort",s)},Ka=window?.settings?.secure_path,rt={getList:()=>F.get(Ka+"/server/group/fetch"),save:s=>F.post(Ka+"/server/group/save",s),drop:s=>F.post(Ka+"/server/group/drop",s)},Ba=window?.settings?.secure_path,Ia={getList:()=>F.get(Ba+"/server/route/fetch"),save:s=>F.post(Ba+"/server/route/save",s),drop:s=>F.post(Ba+"/server/route/drop",s)},Ys=window?.settings?.secure_path,et={getList:()=>F.get(Ys+"/payment/fetch"),getMethodList:()=>F.get(Ys+"/payment/getPaymentMethods"),getMethodForm:s=>F.post(Ys+"/payment/getPaymentForm",s),save:s=>F.post(Ys+"/payment/save",s),drop:s=>F.post(Ys+"/payment/drop",s),updateStatus:s=>F.post(Ys+"/payment/show",s),sort:s=>F.post(Ys+"/payment/sort",s)},Et=window?.settings?.secure_path,Gt={getList:()=>F.get(`${Et}/notice/fetch`),save:s=>F.post(`${Et}/notice/save`,s),drop:s=>F.post(`${Et}/notice/drop`,{id:s}),updateStatus:s=>F.post(`${Et}/notice/show`,{id:s}),sort:s=>F.post(`${Et}/notice/sort`,{ids:s})},ut=window?.settings?.secure_path,bt={getList:()=>F.get(ut+"/knowledge/fetch"),getInfo:s=>F.get(ut+"/knowledge/fetch?id="+s),save:s=>F.post(ut+"/knowledge/save",s),drop:s=>F.post(ut+"/knowledge/drop",s),updateStatus:s=>F.post(ut+"/knowledge/show",s),sort:s=>F.post(ut+"/knowledge/sort",s)},It=window?.settings?.secure_path,ss={getList:()=>F.get(It+"/plan/fetch"),save:s=>F.post(It+"/plan/save",s),update:s=>F.post(It+"/plan/update",s),drop:s=>F.post(It+"/plan/drop",s),sort:s=>F.post(It+"/plan/sort",{ids:s})},xt=window?.settings?.secure_path,Qs={getList:s=>F.post(xt+"/order/fetch",s),getInfo:s=>F.post(xt+"/order/detail",s),markPaid:s=>F.post(xt+"/order/paid",s),makeCancel:s=>F.post(xt+"/order/cancel",s),update:s=>F.post(xt+"/order/update",s),assign:s=>F.post(xt+"/order/assign",s)},sa=window?.settings?.secure_path,Na={getList:s=>F.post(sa+"/coupon/fetch",s),save:s=>F.post(sa+"/coupon/generate",s),drop:s=>F.post(sa+"/coupon/drop",s),update:s=>F.post(sa+"/coupon/update",s)},ys=window?.settings?.secure_path,_s={getList:s=>F.post(`${ys}/user/fetch`,s),update:s=>F.post(`${ys}/user/update`,s),resetSecret:s=>F.post(`${ys}/user/resetSecret`,{id:s}),generate:s=>s.download_csv?F.post(`${ys}/user/generate`,s,{responseType:"blob"}):F.post(`${ys}/user/generate`,s),getStats:s=>F.post(`${ys}/stat/getStatUser`,s),destroy:s=>F.post(`${ys}/user/destroy`,{id:s}),sendMail:s=>F.post(`${ys}/user/sendMail`,s),dumpCSV:s=>F.post(`${ys}/user/dumpCSV`,s,{responseType:"blob"}),batchBan:s=>F.post(`${ys}/user/ban`,s)},ta=window?.settings?.secure_path,jt={getList:s=>F.post(ta+"/ticket/fetch",s),getInfo:s=>F.get(ta+"/ticket/fetch?id= "+s),reply:s=>F.post(ta+"/ticket/reply",s),close:s=>F.post(ta+"/ticket/close",{id:s})},Me=window?.settings?.secure_path,ce={getSettings:(s="")=>F.get(Me+"/config/fetch?key="+s),saveSettings:s=>F.post(Me+"/config/save",s),getEmailTemplate:()=>F.get(Me+"/config/getEmailTemplate"),sendTestMail:()=>F.post(Me+"/config/testSendMail"),setTelegramWebhook:()=>F.post(Me+"/config/setTelegramWebhook"),updateSystemConfig:s=>F.post(Me+"/config/save",s),getSystemStatus:()=>F.get(`${Me}/system/getSystemStatus`),getQueueStats:()=>F.get(`${Me}/system/getQueueStats`),getQueueWorkload:()=>F.get(`${Me}/system/getQueueWorkload`),getQueueMasters:()=>F.get(`${Me}/system/getQueueMasters`),getHorizonFailedJobs:s=>F.get(`${Me}/system/getHorizonFailedJobs`,{params:s}),getSystemLog:s=>F.get(`${Me}/system/getSystemLog`,{params:s}),getLogFiles:()=>F.get(`${Me}/log/files`),getLogContent:s=>F.get(`${Me}/log/fetch`,{params:s}),getLogClearStats:s=>F.get(`${Me}/system/getLogClearStats`,{params:s}),clearSystemLog:s=>F.post(`${Me}/system/clearSystemLog`,s)},Ds=window?.settings?.secure_path,Ps={getPluginList:()=>F.get(`${Ds}/plugin/getPlugins`),uploadPlugin:s=>{const a=new FormData;return a.append("file",s),F.post(`${Ds}/plugin/upload`,a,{headers:{"Content-Type":"multipart/form-data"}})},deletePlugin:s=>F.post(`${Ds}/plugin/delete`,{code:s}),installPlugin:s=>F.post(`${Ds}/plugin/install`,{code:s}),uninstallPlugin:s=>F.post(`${Ds}/plugin/uninstall`,{code:s}),enablePlugin:s=>F.post(`${Ds}/plugin/enable`,{code:s}),disablePlugin:s=>F.post(`${Ds}/plugin/disable`,{code:s}),getPluginConfig:s=>F.get(`${Ds}/plugin/config`,{params:{code:s}}),updatePluginConfig:(s,a)=>F.post(`${Ds}/plugin/config`,{code:s,config:a})};window?.settings?.secure_path;const bd=x.object({subscribe_template_singbox:x.string().optional().default(""),subscribe_template_clash:x.string().optional().default(""),subscribe_template_clashmeta:x.string().optional().default(""),subscribe_template_stash:x.string().optional().default(""),subscribe_template_surge:x.string().optional().default(""),subscribe_template_surfboard:x.string().optional().default("")}),el=[{key:"singbox",label:"Sing-box",language:"json"},{key:"clash",label:"Clash",language:"yaml"},{key:"clashmeta",label:"Clash Meta",language:"yaml"},{key:"stash",label:"Stash",language:"yaml"},{key:"surge",label:"Surge",language:"ini"},{key:"surfboard",label:"Surfboard",language:"ini"}],sl={subscribe_template_singbox:"",subscribe_template_clash:"",subscribe_template_clashmeta:"",subscribe_template_stash:"",subscribe_template_surge:"",subscribe_template_surfboard:""};function yd(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),[n,r]=m.useState("singbox"),o=Ne({resolver:we(bd),defaultValues:sl,mode:"onChange"}),{data:c,isLoading:u}=le({queryKey:["settings","client"],queryFn:()=>ce.getSettings("subscribe_template")}),{mutateAsync:i}=fs({mutationFn:ce.saveSettings,onSuccess:()=>{$.success(s("common.autoSaved"))},onError:C=>{console.error("保存失败:",C),$.error(s("common.saveFailed"))}});m.useEffect(()=>{if(c?.data?.subscribe_template){const C=c.data.subscribe_template;Object.entries(C).forEach(([S,w])=>{if(S in sl){const N=typeof w=="string"?w:"";o.setValue(S,N)}}),l.current=o.getValues()}},[c,o]);const d=m.useCallback(ke.debounce(async C=>{if(!l.current||!ke.isEqual(C,l.current)){t(!0);try{await i(C),l.current=C}catch(S){console.error("保存设置失败:",S)}finally{t(!1)}}},1500),[i]),h=m.useCallback(()=>{const C=o.getValues();d(C)},[o,d]),k=m.useCallback((C,S)=>e.jsx(v,{control:o.control,name:C,render:({field:w})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s(`subscribe_template.${C.replace("subscribe_template_","")}.title`)}),e.jsx(b,{children:e.jsx(Fi,{height:"500px",defaultLanguage:S,value:w.value||"",onChange:N=>{w.onChange(N||""),h()},options:{minimap:{enabled:!1},fontSize:14,wordWrap:"on",scrollBeyondLastLine:!1,automaticLayout:!0}})}),e.jsx(M,{children:s(`subscribe_template.${C.replace("subscribe_template_","")}.description`)}),e.jsx(P,{})]})}),[o.control,s,h]);return u?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.loading")})}):e.jsx(Ce,{...o,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs(Wt,{value:n,onValueChange:r,className:"w-full",children:[e.jsx(kt,{className:"",children:el.map(({key:C,label:S})=>e.jsx(es,{value:C,className:"text-xs",children:S},C))}),el.map(({key:C,language:S})=>e.jsx(Ls,{value:C,className:"mt-4",children:k(`subscribe_template_${C}`,S)},C))]}),a&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-blue-500"}),s("common.saving")]})]})})}function Nd(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("subscribe_template.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("subscribe_template.description")})]}),e.jsx(De,{}),e.jsx(yd,{})]})}const _d=()=>e.jsx(md,{children:e.jsx(xn,{})}),wd=Mi([{path:"/sign-in",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>Ad);return{default:s}},void 0,import.meta.url)).default})},{element:e.jsx(_d,{}),children:[{path:"/",lazy:async()=>({Component:(await be(()=>Promise.resolve().then(()=>Jd),void 0,import.meta.url)).default}),errorElement:e.jsx(dt,{}),children:[{index:!0,lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>gm);return{default:s}},void 0,import.meta.url)).default})},{path:"config",errorElement:e.jsx(dt,{}),children:[{path:"system",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>bm);return{default:s}},void 0,import.meta.url)).default}),children:[{index:!0,lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>wm);return{default:s}},void 0,import.meta.url)).default})},{path:"safe",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>Dm);return{default:s}},void 0,import.meta.url)).default})},{path:"subscribe",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>Rm);return{default:s}},void 0,import.meta.url)).default})},{path:"invite",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>zm);return{default:s}},void 0,import.meta.url)).default})},{path:"frontend",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>Um);return{default:s}},void 0,import.meta.url)).default})},{path:"server",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>Ym);return{default:s}},void 0,import.meta.url)).default})},{path:"email",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>eu);return{default:s}},void 0,import.meta.url)).default})},{path:"telegram",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>lu);return{default:s}},void 0,import.meta.url)).default})},{path:"APP",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>du);return{default:s}},void 0,import.meta.url)).default})},{path:"subscribe-template",element:e.jsx(Nd,{})}]},{path:"payment",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>fu);return{default:s}},void 0,import.meta.url)).default})},{path:"plugin",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>bu);return{default:s}},void 0,import.meta.url)).default})},{path:"theme",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>wu);return{default:s}},void 0,import.meta.url)).default})},{path:"notice",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>Lu);return{default:s}},void 0,import.meta.url)).default})},{path:"knowledge",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>zu);return{default:s}},void 0,import.meta.url)).default})}]},{path:"server",errorElement:e.jsx(dt,{}),children:[{path:"manage",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>px);return{default:s}},void 0,import.meta.url)).default})},{path:"group",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>bx);return{default:s}},void 0,import.meta.url)).default})},{path:"route",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>Sx);return{default:s}},void 0,import.meta.url)).default})}]},{path:"finance",errorElement:e.jsx(dt,{}),children:[{path:"plan",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>Vx);return{default:s}},void 0,import.meta.url)).default})},{path:"order",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>Yx);return{default:s}},void 0,import.meta.url)).default})},{path:"coupon",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>nh);return{default:s}},void 0,import.meta.url)).default})}]},{path:"user",errorElement:e.jsx(dt,{}),children:[{path:"manage",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>Rh);return{default:s}},void 0,import.meta.url)).default})},{path:"ticket",lazy:async()=>({Component:(await be(async()=>{const{default:s}=await Promise.resolve().then(()=>ep);return{default:s}},void 0,import.meta.url)).default})}]}]}]},{path:"/500",Component:dt},{path:"/404",Component:Xn},{path:"/503",Component:nd},{path:"*",Component:Xn}]);function Cd(){return F.get("/user/info")}const Ga={token:Bt()?.value||"",userInfo:null,isLoggedIn:!!Bt()?.value,loading:!1,error:null},qt=Oi("user/fetchUserInfo",async()=>(await Cd()).data,{condition:(s,{getState:a})=>{const{user:t}=a();return!!t.token&&!t.loading}}),yr=zi({name:"user",initialState:Ga,reducers:{setToken(s,a){s.token=a.payload,s.isLoggedIn=!!a.payload},resetUserState:()=>Ga},extraReducers:s=>{s.addCase(qt.pending,a=>{a.loading=!0,a.error=null}).addCase(qt.fulfilled,(a,t)=>{a.loading=!1,a.userInfo=t.payload,a.error=null}).addCase(qt.rejected,(a,t)=>{if(a.loading=!1,a.error=t.error.message||"Failed to fetch user info",!a.token)return Ga})}}),{setToken:Sd,resetUserState:kd}=yr.actions,Td=s=>s.user.userInfo,Dd=yr.reducer,Nr=$i({reducer:{user:Dd}});Bt()?.value&&Nr.dispatch(qt());Ai.use(qi).use(Hi).init({resources:{"en-US":window.XBOARD_TRANSLATIONS?.["en-US"]||{},"zh-CN":window.XBOARD_TRANSLATIONS?.["zh-CN"]||{},"ko-KR":window.XBOARD_TRANSLATIONS?.["ko-KR"]||{}},fallbackLng:"zh-CN",supportedLngs:["en-US","zh-CN","ko-KR"],detection:{order:["querystring","localStorage","navigator"],lookupQuerystring:"lang",lookupLocalStorage:"i18nextLng",caches:["localStorage"]},interpolation:{escapeValue:!1}});const Pd=new Ui;Ki.createRoot(document.getElementById("root")).render(e.jsx(Bi.StrictMode,{children:e.jsx(Gi,{client:Pd,children:e.jsx(Wi,{store:Nr,children:e.jsxs(ed,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[e.jsx(Yi,{router:wd}),e.jsx(Ji,{richColors:!0,position:"top-right"})]})})})}));const Ye=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:y("rounded-xl border bg-card text-card-foreground shadow",s),...a}));Ye.displayName="Card";const ts=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:y("flex flex-col space-y-1.5 p-6",s),...a}));ts.displayName="CardHeader";const Ns=m.forwardRef(({className:s,...a},t)=>e.jsx("h3",{ref:t,className:y("font-semibold leading-none tracking-tight",s),...a}));Ns.displayName="CardTitle";const st=m.forwardRef(({className:s,...a},t)=>e.jsx("p",{ref:t,className:y("text-sm text-muted-foreground",s),...a}));st.displayName="CardDescription";const as=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:y("p-6 pt-0",s),...a}));as.displayName="CardContent";const Ld=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:y("flex items-center p-6 pt-0",s),...a}));Ld.displayName="CardFooter";const D=m.forwardRef(({className:s,type:a,...t},l)=>e.jsx("input",{type:a,className:y("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:l,...t}));D.displayName="Input";const _r=m.forwardRef(({className:s,...a},t)=>{const[l,n]=m.useState(!1);return e.jsxs("div",{className:"relative rounded-md",children:[e.jsx("input",{type:l?"text":"password",className:y("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...a}),e.jsx(L,{type:"button",size:"icon",variant:"ghost",className:"absolute right-1 top-1/2 h-6 w-6 -translate-y-1/2 rounded-md text-muted-foreground",onClick:()=>n(r=>!r),children:l?e.jsx(Qi,{size:18}):e.jsx(Xi,{size:18})})]})});_r.displayName="PasswordInput";const Ed=s=>F.post("/passport/auth/login",s);function Id({className:s,onForgotPassword:a,...t}){const l=Rs(),n=gl(),{t:r}=V("auth"),o=x.object({email:x.string().min(1,{message:r("signIn.validation.emailRequired")}),password:x.string().min(1,{message:r("signIn.validation.passwordRequired")}).min(7,{message:r("signIn.validation.passwordLength")})}),c=Ne({resolver:we(o),defaultValues:{email:"",password:""}});async function u(i){try{const{data:d}=await Ed(i);vd(d.auth_data),n(Sd(d.auth_data)),await n(qt()).unwrap(),l("/")}catch(d){console.error("Login failed:",d),d.response?.data?.message&&c.setError("root",{message:d.response.data.message})}}return e.jsx("div",{className:y("grid gap-6",s),...t,children:e.jsx(Ce,{...c,children:e.jsx("form",{onSubmit:c.handleSubmit(u),className:"space-y-4",children:e.jsxs("div",{className:"space-y-4",children:[c.formState.errors.root&&e.jsx("div",{className:"text-sm text-destructive",children:c.formState.errors.root.message}),e.jsx(v,{control:c.control,name:"email",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:r("signIn.email")}),e.jsx(b,{children:e.jsx(D,{placeholder:r("signIn.emailPlaceholder"),autoComplete:"email",...i})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"password",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:r("signIn.password")}),e.jsx(b,{children:e.jsx(_r,{placeholder:r("signIn.passwordPlaceholder"),autoComplete:"current-password",...i})}),e.jsx(P,{})]})}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(L,{variant:"link",type:"button",className:"px-0 text-sm font-normal text-muted-foreground hover:text-primary",onClick:a,children:r("signIn.forgotPassword")})}),e.jsx(L,{className:"w-full",size:"lg",loading:c.formState.isSubmitting,children:r("signIn.submit")})]})})})})}const ge=fl,is=jl,Rd=vl,qs=hn,wr=m.forwardRef(({className:s,...a},t)=>e.jsx(Ca,{ref:t,className:y("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",s),...a}));wr.displayName=Ca.displayName;const pe=m.forwardRef(({className:s,children:a,...t},l)=>e.jsxs(Rd,{children:[e.jsx(wr,{}),e.jsxs(Sa,{ref:l,className:y("max-h-[95%] overflow-auto 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",s),...t,children:[a,e.jsxs(hn,{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:[e.jsx(ds,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));pe.displayName=Sa.displayName;const ve=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col space-y-1.5 text-center sm:text-left",s),...a});ve.displayName="DialogHeader";const Le=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});Le.displayName="DialogFooter";const fe=m.forwardRef(({className:s,...a},t)=>e.jsx(ka,{ref:t,className:y("text-lg font-semibold leading-none tracking-tight",s),...a}));fe.displayName=ka.displayName;const Re=m.forwardRef(({className:s,...a},t)=>e.jsx(Ta,{ref:t,className:y("text-sm text-muted-foreground",s),...a}));Re.displayName=Ta.displayName;const yt=tt("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring 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 shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),K=m.forwardRef(({className:s,variant:a,size:t,asChild:l=!1,...n},r)=>{const o=l?mn:"button";return e.jsx(o,{className:y(yt({variant:a,size:t,className:s})),ref:r,...n})});K.displayName="Button";const Es=so,Is=to,Vd=ao,Fd=m.forwardRef(({className:s,inset:a,children:t,...l},n)=>e.jsxs(bl,{ref:n,className:y("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",a&&"pl-8",s),...l,children:[t,e.jsx(pn,{className:"ml-auto h-4 w-4"})]}));Fd.displayName=bl.displayName;const Md=m.forwardRef(({className:s,...a},t)=>e.jsx(yl,{ref:t,className:y("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",s),...a}));Md.displayName=yl.displayName;const ws=m.forwardRef(({className:s,sideOffset:a=4,...t},l)=>e.jsx(Zi,{children:e.jsx(Nl,{ref:l,sideOffset:a,className:y("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",s),...t})}));ws.displayName=Nl.displayName;const _e=m.forwardRef(({className:s,inset:a,...t},l)=>e.jsx(_l,{ref:l,className:y("relative flex cursor-default cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",s),...t}));_e.displayName=_l.displayName;const Od=m.forwardRef(({className:s,children:a,checked:t,...l},n)=>e.jsxs(wl,{ref:n,className:y("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:t,...l,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Cl,{children:e.jsx(at,{className:"h-4 w-4"})})}),a]}));Od.displayName=wl.displayName;const zd=m.forwardRef(({className:s,children:a,...t},l)=>e.jsxs(Sl,{ref:l,className:y("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...t,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Cl,{children:e.jsx(eo,{className:"h-4 w-4 fill-current"})})}),a]}));zd.displayName=Sl.displayName;const yn=m.forwardRef(({className:s,inset:a,...t},l)=>e.jsx(kl,{ref:l,className:y("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",s),...t}));yn.displayName=kl.displayName;const Nt=m.forwardRef(({className:s,...a},t)=>e.jsx(Tl,{ref:t,className:y("-mx-1 my-1 h-px bg-muted",s),...a}));Nt.displayName=Tl.displayName;const cn=({className:s,...a})=>e.jsx("span",{className:y("ml-auto text-xs tracking-widest opacity-60",s),...a});cn.displayName="DropdownMenuShortcut";const Wa=[{code:"en-US",name:"English",flag:no,shortName:"EN"},{code:"zh-CN",name:"中文",flag:lo,shortName:"CN"},{code:"ko-KR",name:"한국어",flag:ro,shortName:"KR"}];function Cr(){const{i18n:s}=V(),a=n=>{s.changeLanguage(n)},t=Wa.find(n=>n.code===s.language)||Wa[1],l=t.flag;return e.jsxs(Es,{children:[e.jsx(Is,{asChild:!0,children:e.jsxs(K,{variant:"ghost",size:"sm",className:"h-8 px-2 gap-1",children:[e.jsx(l,{className:"h-4 w-5 rounded-sm shadow-sm"}),e.jsx("span",{className:"text-sm font-medium",children:t.shortName})]})}),e.jsx(ws,{align:"end",className:"w-[120px]",children:Wa.map(n=>{const r=n.flag,o=n.code===s.language;return e.jsxs(_e,{onClick:()=>a(n.code),className:y("flex items-center gap-2 px-2 py-1.5 cursor-pointer",o&&"bg-accent"),children:[e.jsx(r,{className:"h-4 w-5 rounded-sm shadow-sm"}),e.jsx("span",{className:y("text-sm",o&&"font-medium"),children:n.name})]},n.code)})})]})}function $d(){const[s,a]=m.useState(!1),{t}=V("auth"),l=t("signIn.resetPassword.command");return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"container relative flex min-h-svh flex-col items-center justify-center bg-primary-foreground px-4 py-8 lg:max-w-none lg:px-0",children:[e.jsx("div",{className:"absolute right-4 top-4 md:right-8 md:top-8",children:e.jsx(Cr,{})}),e.jsxs("div",{className:"mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px] md:w-[420px] lg:p-8",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-center",children:[e.jsx("h1",{className:"text-2xl font-bold sm:text-3xl",children:window?.settings?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:window?.settings?.description})]}),e.jsxs(Ye,{className:"p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-left",children:[e.jsx("h1",{className:"text-xl font-semibold tracking-tight sm:text-2xl",children:t("signIn.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("signIn.description")})]}),e.jsx(Id,{onForgotPassword:()=>a(!0)})]})]})]}),e.jsx(ge,{open:s,onOpenChange:a,children:e.jsx(pe,{className:"max-w-[90vw] sm:max-w-lg",children:e.jsxs(ve,{children:[e.jsx(fe,{children:t("signIn.resetPassword.title")}),e.jsx(Re,{children:t("signIn.resetPassword.description")}),e.jsx("div",{className:"mt-4",children:e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"max-w-full overflow-x-auto rounded-md bg-secondary p-4 pr-12 text-sm",children:l}),e.jsx(K,{variant:"ghost",size:"icon",className:"absolute right-2 top-2 h-8 w-8 hover:bg-secondary-foreground/10",onClick:()=>ba(l).then(()=>{$.success(t("common:copy.success"))}),children:e.jsx(io,{className:"h-4 w-4"})})]})})]})})})]})}const Ad=Object.freeze(Object.defineProperty({__proto__:null,default:$d},Symbol.toStringTag,{value:"Module"})),Ve=m.forwardRef(({className:s,fadedBelow:a=!1,fixedHeight:t=!1,...l},n)=>e.jsx("div",{ref:n,className:y("relative flex h-full w-full flex-col",a&&"after:pointer-events-none after:absolute after:bottom-0 after:left-0 after:hidden after:h-32 after:w-full after:bg-[linear-gradient(180deg,_transparent_10%,_hsl(var(--background))_70%)] after:md:block",t&&"md:h-svh",s),...l}));Ve.displayName="Layout";const Fe=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{ref:t,className:y("flex h-[var(--header-height)] flex-none items-center gap-4 bg-background p-4 md:px-8",s),...a}));Fe.displayName="LayoutHeader";const Ae=m.forwardRef(({className:s,fixedHeight:a,...t},l)=>e.jsx("div",{ref:l,className:y("flex-1 overflow-hidden px-4 py-6 md:px-8",a&&"h-[calc(100%-var(--header-height))]",s),...t}));Ae.displayName="LayoutBody";const Sr=oo,kr=co,Tr=mo,je=uo,de=xo,me=ho,oe=m.forwardRef(({className:s,sideOffset:a=4,...t},l)=>e.jsx(Dl,{ref:l,sideOffset:a,className:y("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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",s),...t}));oe.displayName=Dl.displayName;function Ra(){const{pathname:s}=un();return{checkActiveNav:t=>{if(t==="/"&&s==="/")return!0;const l=t.replace(/^\//,""),n=s.replace(/^\//,"");return l?n.startsWith(l):!1}}}function Dr({key:s,defaultValue:a}){const[t,l]=m.useState(()=>{const n=localStorage.getItem(s);return n!==null?JSON.parse(n):a});return m.useEffect(()=>{localStorage.setItem(s,JSON.stringify(t))},[t,s]),[t,l]}function qd(){const[s,a]=Dr({key:"collapsed-sidebar-items",defaultValue:[]}),t=n=>!s.includes(n);return{isExpanded:t,toggleItem:n=>{t(n)?a([...s,n]):a(s.filter(r=>r!==n))}}}function Hd({links:s,isCollapsed:a,className:t,closeNav:l}){const{t:n}=V(),r=({sub:o,...c})=>{const u=`${n(c.title)}-${c.href}`;return a&&o?m.createElement(Bd,{...c,sub:o,key:u,closeNav:l}):a?m.createElement(Kd,{...c,key:u,closeNav:l}):o?m.createElement(Ud,{...c,sub:o,key:u,closeNav:l}):m.createElement(Pr,{...c,key:u,closeNav:l})};return e.jsx("div",{"data-collapsed":a,className:y("group border-b bg-background py-2 transition-[max-height,padding] duration-500 data-[collapsed=true]:py-2 md:border-none",t),children:e.jsx(je,{delayDuration:0,children:e.jsx("nav",{className:"grid gap-1 group-[[data-collapsed=true]]:justify-center group-[[data-collapsed=true]]:px-2",children:s.map(r)})})})}function Pr({title:s,icon:a,label:t,href:l,closeNav:n,subLink:r=!1}){const{checkActiveNav:o}=Ra(),{t:c}=V();return e.jsxs(nt,{to:l,onClick:n,className:y(St({variant:o(l)?"secondary":"ghost",size:"sm"}),"h-12 justify-start text-wrap rounded-none px-6",r&&"h-10 w-full border-l border-l-slate-500 px-2"),"aria-current":o(l)?"page":void 0,children:[e.jsx("div",{className:"mr-2",children:a}),c(s),t&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:c(t)})]})}function Ud({title:s,icon:a,label:t,sub:l,closeNav:n}){const{checkActiveNav:r}=Ra(),{isExpanded:o,toggleItem:c}=qd(),{t:u}=V(),i=!!l?.find(k=>r(k.href)),d=u(s),h=o(d)||i;return e.jsxs(Sr,{open:h,onOpenChange:()=>c(d),children:[e.jsxs(kr,{className:y(St({variant:i?"secondary":"ghost",size:"sm"}),"group h-12 w-full justify-start rounded-none px-6"),children:[e.jsx("div",{className:"mr-2",children:a}),u(s),t&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:u(t)}),e.jsx("span",{className:y('ml-auto transition-all group-data-[state="open"]:-rotate-180'),children:e.jsx(Pl,{stroke:1})})]}),e.jsx(Tr,{className:"collapsibleDropdown",asChild:!0,children:e.jsx("ul",{children:l.map(k=>e.jsx("li",{className:"my-1 ml-8",children:e.jsx(Pr,{...k,subLink:!0,closeNav:n})},u(k.title)))})})]})}function Kd({title:s,icon:a,label:t,href:l,closeNav:n}){const{checkActiveNav:r}=Ra(),{t:o}=V();return e.jsxs(de,{delayDuration:0,children:[e.jsx(me,{asChild:!0,children:e.jsxs(nt,{to:l,onClick:n,className:y(St({variant:r(l)?"secondary":"ghost",size:"icon"}),"h-12 w-12"),children:[a,e.jsx("span",{className:"sr-only",children:o(s)})]})}),e.jsxs(oe,{side:"right",className:"flex items-center gap-4",children:[o(s),t&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:o(t)})]})]})}function Bd({title:s,icon:a,label:t,sub:l,closeNav:n}){const{checkActiveNav:r}=Ra(),{t:o}=V(),c=!!l?.find(u=>r(u.href));return e.jsxs(Es,{children:[e.jsxs(de,{delayDuration:0,children:[e.jsx(me,{asChild:!0,children:e.jsx(Is,{asChild:!0,children:e.jsx(L,{variant:c?"secondary":"ghost",size:"icon",className:"h-12 w-12",children:a})})}),e.jsxs(oe,{side:"right",className:"flex items-center gap-4",children:[o(s)," ",t&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:o(t)}),e.jsx(Pl,{size:18,className:"-rotate-90 text-muted-foreground"})]})]}),e.jsxs(ws,{side:"right",align:"start",sideOffset:4,children:[e.jsxs(yn,{children:[o(s)," ",t?`(${o(t)})`:""]}),e.jsx(Nt,{}),l.map(({title:u,icon:i,label:d,href:h})=>e.jsx(_e,{asChild:!0,children:e.jsxs(nt,{to:h,onClick:n,className:`${r(h)?"bg-secondary":""}`,children:[i," ",e.jsx("span",{className:"ml-2 max-w-52 text-wrap",children:o(u)}),d&&e.jsx("span",{className:"ml-auto text-xs",children:o(d)})]})},`${o(u)}-${h}`))]})]})}const Lr=[{title:"nav:dashboard",label:"",href:"/",icon:e.jsx(po,{size:18})},{title:"nav:systemManagement",label:"",href:"",icon:e.jsx(go,{size:18}),sub:[{title:"nav:systemConfig",label:"",href:"/config/system",icon:e.jsx(Ll,{size:18})},{title:"nav:pluginManagement",label:"",href:"/config/plugin",icon:e.jsx(gn,{size:18})},{title:"nav:themeConfig",label:"",href:"/config/theme",icon:e.jsx(fo,{size:18})},{title:"nav:noticeManagement",label:"",href:"/config/notice",icon:e.jsx(jo,{size:18})},{title:"nav:paymentConfig",label:"",href:"/config/payment",icon:e.jsx(Hn,{size:18})},{title:"nav:knowledgeManagement",label:"",href:"/config/knowledge",icon:e.jsx(vo,{size:18})}]},{title:"nav:nodeManagement",label:"",href:"",icon:e.jsx(El,{size:18}),sub:[{title:"nav:nodeManagement",label:"",href:"/server/manage",icon:e.jsx(bo,{size:18})},{title:"nav:permissionGroupManagement",label:"",href:"/server/group",icon:e.jsx(Il,{size:18})},{title:"nav:routeManagement",label:"",href:"/server/route",icon:e.jsx(yo,{size:18})}]},{title:"nav:subscriptionManagement",label:"",href:"",icon:e.jsx(No,{size:18}),sub:[{title:"nav:planManagement",label:"",href:"/finance/plan",icon:e.jsx(_o,{size:18})},{title:"nav:orderManagement",label:"",href:"/finance/order",icon:e.jsx(Hn,{size:18})},{title:"nav:couponManagement",label:"",href:"/finance/coupon",icon:e.jsx(wo,{size:18})}]},{title:"nav:userManagement",label:"",href:"",icon:e.jsx(Co,{size:18}),sub:[{title:"nav:userManagement",label:"",href:"/user/manage",icon:e.jsx(So,{size:18})},{title:"nav:ticketManagement",label:"",href:"/user/ticket",icon:e.jsx(Rl,{size:18})}]}];function Gd({className:s,isCollapsed:a,setIsCollapsed:t}){const[l,n]=m.useState(!1),{t:r}=V();return m.useEffect(()=>{l?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")},[l]),e.jsxs("aside",{className:y(`fixed left-0 right-0 top-0 z-50 flex h-auto flex-col border-r-2 border-r-muted transition-[width] md:bottom-0 md:right-auto md:h-svh ${a?"md:w-14":"md:w-64"}`,s),children:[e.jsx("div",{onClick:()=>n(!1),className:`absolute inset-0 transition-[opacity] delay-100 duration-700 ${l?"h-svh opacity-50":"h-0 opacity-0"} w-full bg-black md:hidden`}),e.jsxs(Ve,{className:`flex h-full flex-col ${l?"h-[100vh] md:h-full":""}`,children:[e.jsxs(Fe,{className:"sticky top-0 justify-between px-4 py-3 shadow md:px-4",children:[e.jsxs("div",{className:`flex items-center ${a?"":"gap-2"}`,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",className:`transition-all ${a?"h-6 w-6":"h-8 w-8"}`,children:[e.jsx("rect",{width:"256",height:"256",fill:"none"}),e.jsx("line",{x1:"208",y1:"128",x2:"128",y2:"208",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("line",{x1:"192",y1:"40",x2:"40",y2:"192",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("span",{className:"sr-only",children:"Website Name"})]}),e.jsx("div",{className:`flex flex-col justify-end truncate ${a?"invisible w-0":"visible w-auto"}`,children:e.jsx("span",{className:"font-medium",children:window?.settings?.title})})]}),e.jsx(L,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":r("common:toggleNavigation"),"aria-controls":"sidebar-menu","aria-expanded":l,onClick:()=>n(o=>!o),children:l?e.jsx(ko,{}):e.jsx(To,{})})]}),e.jsx(Hd,{id:"sidebar-menu",className:y("flex-1 overflow-auto overscroll-contain",l?"block":"hidden md:block","md:py-2"),closeNav:()=>n(!1),isCollapsed:a,links:Lr}),e.jsx("div",{className:y("border-t border-border/50 bg-background","px-4 py-2.5 text-xs text-muted-foreground",l?"block":"hidden md:block",a?"text-center":"text-left"),children:e.jsxs("div",{className:y("flex items-center gap-1.5",a?"justify-center":"justify-start"),children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500"}),e.jsxs("span",{className:y("whitespace-nowrap tracking-wide","transition-opacity duration-200",a&&"md:opacity-0"),children:["v",window?.settings?.version]})]})}),e.jsx(L,{onClick:()=>t(o=>!o),size:"icon",variant:"outline",className:"absolute -right-5 top-1/2 hidden rounded-full md:inline-flex","aria-label":r("common:toggleSidebar"),children:e.jsx(Do,{stroke:1.5,className:`h-5 w-5 ${a?"rotate-180":""}`})})]})]})}function Wd(){const[s,a]=Dr({key:"collapsed-sidebar",defaultValue:!1});return m.useEffect(()=>{const t=()=>{a(window.innerWidth<768?!1:s)};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[s,a]),[s,a]}function Yd(){const[s,a]=Wd();return e.jsxs("div",{className:"relative h-full overflow-hidden bg-background",children:[e.jsx(Gd,{isCollapsed:s,setIsCollapsed:a}),e.jsx("main",{id:"content",className:`overflow-x-hidden pt-16 transition-[margin] md:overflow-y-hidden md:pt-0 ${s?"md:ml-14":"md:ml-64"} h-full`,children:e.jsx(xn,{})})]})}const Jd=Object.freeze(Object.defineProperty({__proto__:null,default:Yd},Symbol.toStringTag,{value:"Module"})),Us=m.forwardRef(({className:s,...a},t)=>e.jsx(He,{ref:t,className:y("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",s),...a}));Us.displayName=He.displayName;const Qd=({children:s,...a})=>e.jsx(ge,{...a,children:e.jsx(pe,{className:"overflow-hidden p-0",children:e.jsx(Us,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:s})})}),it=m.forwardRef(({className:s,...a},t)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(Po,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(He.Input,{ref:t,className:y("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",s),...a})]}));it.displayName=He.Input.displayName;const Ks=m.forwardRef(({className:s,...a},t)=>e.jsx(He.List,{ref:t,className:y("max-h-[300px] overflow-y-auto overflow-x-hidden",s),...a}));Ks.displayName=He.List.displayName;const ot=m.forwardRef((s,a)=>e.jsx(He.Empty,{ref:a,className:"py-6 text-center text-sm",...s}));ot.displayName=He.Empty.displayName;const ns=m.forwardRef(({className:s,...a},t)=>e.jsx(He.Group,{ref:t,className:y("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",s),...a}));ns.displayName=He.Group.displayName;const Tt=m.forwardRef(({className:s,...a},t)=>e.jsx(He.Separator,{ref:t,className:y("-mx-1 h-px bg-border",s),...a}));Tt.displayName=He.Separator.displayName;const $e=m.forwardRef(({className:s,...a},t)=>e.jsx(He.Item,{ref:t,className:y("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...a}));$e.displayName=He.Item.displayName;function Xd(){const s=[];for(const a of Lr)if(a.href&&s.push(a),a.sub)for(const t of a.sub)s.push({...t,parent:a.title});return s}function Xe(){const[s,a]=m.useState(!1),t=Rs(),l=Xd(),{t:n}=V("search"),{t:r}=V("nav");m.useEffect(()=>{const c=u=>{u.key==="k"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),a(i=>!i))};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]);const o=m.useCallback(c=>{a(!1),t(c)},[t]);return e.jsxs(e.Fragment,{children:[e.jsxs(K,{variant:"outline",className:"relative h-9 w-9 p-0 xl:h-10 xl:w-60 xl:justify-start xl:px-3 xl:py-2",onClick:()=>a(!0),children:[e.jsx(fn,{className:"h-4 w-4 xl:mr-2"}),e.jsx("span",{className:"hidden xl:inline-flex",children:n("placeholder")}),e.jsx("span",{className:"sr-only",children:n("shortcut.label")}),e.jsx("kbd",{className:"pointer-events-none absolute right-1.5 top-2 hidden h-6 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 xl:flex",children:n("shortcut.key")})]}),e.jsxs(Qd,{open:s,onOpenChange:a,children:[e.jsx(it,{placeholder:n("placeholder")}),e.jsxs(Ks,{children:[e.jsx(ot,{children:n("noResults")}),e.jsx(ns,{heading:n("title"),children:l.map(c=>e.jsxs($e,{value:`${c.parent?c.parent+" ":""}${c.title}`,onSelect:()=>o(c.href),children:[e.jsx("div",{className:"mr-2",children:c.icon}),e.jsx("span",{children:r(c.title)}),c.parent&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:r(c.parent)})]},c.href))})]})]})]})}function Ue(){const{theme:s,setTheme:a}=sd();return m.useEffect(()=>{const t=s==="dark"?"#020817":"#fff",l=document.querySelector("meta[name='theme-color']");l&&l.setAttribute("content",t)},[s]),e.jsxs(e.Fragment,{children:[e.jsx(L,{size:"icon",variant:"ghost",className:"rounded-full",onClick:()=>a(s==="light"?"dark":"light"),children:s==="light"?e.jsx(Lo,{size:20}):e.jsx(Eo,{size:20})}),e.jsx(Cr,{})]})}const Er=m.forwardRef(({className:s,...a},t)=>e.jsx(Vl,{ref:t,className:y("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",s),...a}));Er.displayName=Vl.displayName;const Ir=m.forwardRef(({className:s,...a},t)=>e.jsx(Fl,{ref:t,className:y("aspect-square h-full w-full",s),...a}));Ir.displayName=Fl.displayName;const Rr=m.forwardRef(({className:s,...a},t)=>e.jsx(Ml,{ref:t,className:y("flex h-full w-full items-center justify-center rounded-full bg-muted",s),...a}));Rr.displayName=Ml.displayName;function Ke(){const s=Rs(),a=gl(),t=Io(Td),{t:l}=V(["common"]),n=()=>{fr(),a(kd()),s("/sign-in")},r=t?.email?.split("@")[0]||l("common:user"),o=r.substring(0,2).toUpperCase();return e.jsxs(Es,{children:[e.jsx(Is,{asChild:!0,children:e.jsx(L,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:e.jsxs(Er,{className:"h-8 w-8",children:[e.jsx(Ir,{src:t?.avatar_url,alt:r}),e.jsx(Rr,{children:o})]})})}),e.jsxs(ws,{className:"w-56",align:"end",forceMount:!0,children:[e.jsx(yn,{className:"font-normal",children:e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("p",{className:"text-sm font-medium leading-none",children:r}),e.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:t?.email||l("common:defaultEmail")})]})}),e.jsx(Nt,{}),e.jsx(_e,{asChild:!0,children:e.jsxs(nt,{to:"/config/system",children:[l("common:settings"),e.jsx(cn,{children:"⌘S"})]})}),e.jsx(Nt,{}),e.jsxs(_e,{onClick:n,children:[l("common:logout"),e.jsx(cn,{children:"⇧⌘Q"})]})]})]})}const J=Ro,Be=qo,Q=Vo,W=m.forwardRef(({className:s,children:a,...t},l)=>e.jsxs(Ol,{ref:l,className:y("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...t,children:[a,e.jsx(Fo,{asChild:!0,children:e.jsx(jn,{className:"h-4 w-4 opacity-50"})})]}));W.displayName=Ol.displayName;const Vr=m.forwardRef(({className:s,...a},t)=>e.jsx(zl,{ref:t,className:y("flex cursor-default items-center justify-center py-1",s),...a,children:e.jsx(Mo,{className:"h-4 w-4"})}));Vr.displayName=zl.displayName;const Fr=m.forwardRef(({className:s,...a},t)=>e.jsx($l,{ref:t,className:y("flex cursor-default items-center justify-center py-1",s),...a,children:e.jsx(jn,{className:"h-4 w-4"})}));Fr.displayName=$l.displayName;const Y=m.forwardRef(({className:s,children:a,position:t="popper",...l},n)=>e.jsx(Oo,{children:e.jsxs(Al,{ref:n,className:y("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",t==="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",s),position:t,...l,children:[e.jsx(Vr,{}),e.jsx(zo,{className:y("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),e.jsx(Fr,{})]})}));Y.displayName=Al.displayName;const Zd=m.forwardRef(({className:s,...a},t)=>e.jsx(ql,{ref:t,className:y("px-2 py-1.5 text-sm font-semibold",s),...a}));Zd.displayName=ql.displayName;const A=m.forwardRef(({className:s,children:a,...t},l)=>e.jsxs(Hl,{ref:l,className:y("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...t,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx($o,{children:e.jsx(at,{className:"h-4 w-4"})})}),e.jsx(Ao,{children:a})]}));A.displayName=Hl.displayName;const em=m.forwardRef(({className:s,...a},t)=>e.jsx(Ul,{ref:t,className:y("-mx-1 my-1 h-px bg-muted",s),...a}));em.displayName=Ul.displayName;function ct({className:s,classNames:a,showOutsideDays:t=!0,...l}){return e.jsx(Ho,{showOutsideDays:t,className:y("p-3",s),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:y(yt({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:y("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",l.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:y(yt({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...a},components:{IconLeft:({className:n,...r})=>e.jsx(Kl,{className:y("h-4 w-4",n),...r}),IconRight:({className:n,...r})=>e.jsx(pn,{className:y("h-4 w-4",n),...r})},...l})}ct.displayName="Calendar";const Cs=Ko,Ss=Bo,bs=m.forwardRef(({className:s,align:a="center",sideOffset:t=4,...l},n)=>e.jsx(Uo,{children:e.jsx(Bl,{ref:n,align:a,sideOffset:t,className:y("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",s),...l})}));bs.displayName=Bl.displayName;const zs={income:{main:"hsl(var(--primary))",gradient:{start:"hsl(var(--primary))",end:"transparent"}},commission:{main:"hsl(var(--secondary))",gradient:{start:"hsl(var(--secondary))",end:"transparent"}}},Ot=s=>(s/100).toFixed(2),sm=({active:s,payload:a,label:t})=>{const{t:l}=V();return s&&a&&a.length?e.jsxs("div",{className:"rounded-lg border bg-background p-3 shadow-sm",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:t}),a.map((n,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.color}}),e.jsxs("span",{className:"text-muted-foreground",children:[l(n.name),":"]}),e.jsx("span",{className:"font-medium",children:n.name.includes(l("dashboard:overview.amount"))?`¥${Ot(n.value)}`:l("dashboard:overview.transactions",{count:n.value})})]},r))]}):null},tm=[{value:"7d",label:"dashboard:overview.last7Days"},{value:"30d",label:"dashboard:overview.last30Days"},{value:"90d",label:"dashboard:overview.last90Days"},{value:"180d",label:"dashboard:overview.last180Days"},{value:"365d",label:"dashboard:overview.lastYear"},{value:"custom",label:"dashboard:overview.customRange"}],am=(s,a)=>{const t=new Date;if(s==="custom"&&a)return{startDate:a.from,endDate:a.to};let l;switch(s){case"7d":l=ps(t,7);break;case"30d":l=ps(t,30);break;case"90d":l=ps(t,90);break;case"180d":l=ps(t,180);break;case"365d":l=ps(t,365);break;default:l=ps(t,30)}return{startDate:l,endDate:t}};function nm(){const[s,a]=m.useState("amount"),[t,l]=m.useState("30d"),[n,r]=m.useState({from:ps(new Date,7),to:new Date}),{t:o}=V(),{startDate:c,endDate:u}=am(t,n),{data:i}=le({queryKey:["orderStat",{start_date:hs(c,"yyyy-MM-dd"),end_date:hs(u,"yyyy-MM-dd")}],queryFn:async()=>{const{data:d}=await ya.getOrderStat({start_date:hs(c,"yyyy-MM-dd"),end_date:hs(u,"yyyy-MM-dd")});return d},refetchInterval:3e4});return e.jsxs(Ye,{children:[e.jsx(ts,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(Ns,{children:o("dashboard:overview.title")}),e.jsxs(st,{children:[i?.summary.start_date," ",o("dashboard:overview.to")," ",i?.summary.end_date]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsxs(J,{value:t,onValueChange:d=>l(d),children:[e.jsx(W,{className:"w-[120px]",children:e.jsx(Q,{placeholder:o("dashboard:overview.selectTimeRange")})}),e.jsx(Y,{children:tm.map(d=>e.jsx(A,{value:d.value,children:o(d.label)},d.value))})]}),t==="custom"&&e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(K,{variant:"outline",className:y("min-w-0 justify-start text-left font-normal",!n&&"text-muted-foreground"),children:[e.jsx(Ct,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:n?.from?n.to?e.jsxs(e.Fragment,{children:[hs(n.from,"yyyy-MM-dd")," -"," ",hs(n.to,"yyyy-MM-dd")]}):hs(n.from,"yyyy-MM-dd"):o("dashboard:overview.selectDate")})]})}),e.jsx(bs,{className:"w-auto p-0",align:"end",children:e.jsx(ct,{mode:"range",defaultMonth:n?.from,selected:{from:n?.from,to:n?.to},onSelect:d=>{d?.from&&d?.to&&r({from:d.from,to:d.to})},numberOfMonths:2})})]})]}),e.jsx(Wt,{value:s,onValueChange:d=>a(d),children:e.jsxs(kt,{children:[e.jsx(es,{value:"amount",children:o("dashboard:overview.amount")}),e.jsx(es,{value:"count",children:o("dashboard:overview.count")})]})})]})]})}),e.jsxs(as,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:o("dashboard:overview.totalIncome")}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",Ot(i?.summary?.paid_total||0)]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:o("dashboard:overview.totalTransactions",{count:i?.summary?.paid_count||0})}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[o("dashboard:overview.avgOrderAmount")," ¥",Ot(i?.summary?.avg_paid_amount||0)]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:o("dashboard:overview.totalCommission")}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",Ot(i?.summary?.commission_total||0)]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:o("dashboard:overview.totalTransactions",{count:i?.summary?.commission_count||0})}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[o("dashboard:overview.commissionRate")," ",i?.summary?.commission_rate.toFixed(2)||0,"%"]})]})]}),e.jsx("div",{className:"h-[400px] w-full",children:e.jsx(Go,{width:"100%",height:"100%",children:e.jsxs(Wo,{data:i?.list||[],margin:{top:20,right:20,left:0,bottom:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"incomeGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:zs.income.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:zs.income.gradient.end,stopOpacity:.1})]}),e.jsxs("linearGradient",{id:"commissionGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:zs.commission.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:zs.commission.gradient.end,stopOpacity:.1})]})]}),e.jsx(Yo,{dataKey:"date",axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:d=>hs(new Date(d),"MM-dd",{locale:Zo})}),e.jsx(Jo,{axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:d=>s==="amount"?`¥${Ot(d)}`:o("dashboard:overview.transactions",{count:d})}),e.jsx(Qo,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))",opacity:.3}),e.jsx(Xo,{content:e.jsx(sm,{})}),s==="amount"?e.jsxs(e.Fragment,{children:[e.jsx(Un,{type:"monotone",dataKey:"paid_total",name:o("dashboard:overview.orderAmount"),stroke:zs.income.main,fill:"url(#incomeGradient)",strokeWidth:2}),e.jsx(Un,{type:"monotone",dataKey:"commission_total",name:o("dashboard:overview.commissionAmount"),stroke:zs.commission.main,fill:"url(#commissionGradient)",strokeWidth:2})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kn,{dataKey:"paid_count",name:o("dashboard:overview.orderCount"),fill:zs.income.main,radius:[4,4,0,0],maxBarSize:40}),e.jsx(Kn,{dataKey:"commission_count",name:o("dashboard:overview.commissionCount"),fill:zs.commission.main,radius:[4,4,0,0],maxBarSize:40})]})]})})})]})]})}function he({className:s,...a}){return e.jsx("div",{className:y("animate-pulse rounded-md bg-primary/10",s),...a})}function lm(){return e.jsxs(Ye,{children:[e.jsxs(ts,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(he,{className:"h-4 w-[120px]"}),e.jsx(he,{className:"h-4 w-4"})]}),e.jsxs(as,{children:[e.jsx(he,{className:"h-8 w-[140px] mb-2"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(he,{className:"h-4 w-4"}),e.jsx(he,{className:"h-4 w-[100px]"})]})]})]})}function rm(){return e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:Array.from({length:8}).map((s,a)=>e.jsx(lm,{},a))})}var ne=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.CANCELLED=2]="CANCELLED",s[s.COMPLETED=3]="COMPLETED",s[s.DISCOUNTED=4]="DISCOUNTED",s))(ne||{});const Rt={0:"待支付",1:"开通中",2:"已取消",3:"已完成",4:"已折抵"},Vt={0:"yellow-500",1:"blue-500",2:"red-500",3:"green-500",4:"green-500"};var gs=(s=>(s[s.NEW=1]="NEW",s[s.RENEWAL=2]="RENEWAL",s[s.UPGRADE=3]="UPGRADE",s[s.RESET_FLOW=4]="RESET_FLOW",s))(gs||{}),ye=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.VALID=2]="VALID",s[s.INVALID=3]="INVALID",s))(ye||{});const aa={0:"待确认",1:"发放中",2:"有效",3:"无效"},na={0:"yellow-500",1:"blue-500",2:"green-500",3:"red-500"};var Ie=(s=>(s.MONTH_PRICE="month_price",s.QUARTER_PRICE="quarter_price",s.HALF_YEAR_PRICE="half_year_price",s.YEAR_PRICE="year_price",s.TWO_YEAR_PRICE="two_year_price",s.THREE_YEAR_PRICE="three_year_price",s.ONETIME_PRICE="onetime_price",s.RESET_PRICE="reset_price",s))(Ie||{});const im={month_price:"月付",quarter_price:"季付",half_year_price:"半年付",year_price:"年付",two_year_price:"两年付",three_year_price:"三年付",onetime_price:"一次性",reset_price:"流量重置包"};var ie=(s=>(s.Shadowsocks="shadowsocks",s.Vmess="vmess",s.Trojan="trojan",s.Hysteria="hysteria",s.Vless="vless",s.Tuic="tuic",s.Socks="socks",s.Naive="naive",s.Http="http",s.Mieru="mieru",s.AnyTLS="anytls",s))(ie||{});const cs=[{type:"shadowsocks",label:"Shadowsocks"},{type:"vmess",label:"VMess"},{type:"trojan",label:"Trojan"},{type:"hysteria",label:"Hysteria"},{type:"vless",label:"VLess"},{type:"tuic",label:"TUIC"},{type:"socks",label:"SOCKS"},{type:"naive",label:"Naive"},{type:"http",label:"HTTP"},{type:"mieru",label:"Mieru"},{type:"anytls",label:"AnyTLS"}],Ge={shadowsocks:"#489851",vmess:"#CB3180",trojan:"#EBB749",hysteria:"#5684e6",vless:"#1a1a1a",tuic:"#00C853",socks:"#2196F3",naive:"#9C27B0",http:"#FF5722",mieru:"#4CAF50",anytls:"#7E57C2"};var Ze=(s=>(s[s.AMOUNT=1]="AMOUNT",s[s.PERCENTAGE=2]="PERCENTAGE",s))(Ze||{});const om={1:"按金额优惠",2:"按比例优惠"};var Hs=(s=>(s[s.OPENING=0]="OPENING",s[s.CLOSED=1]="CLOSED",s))(Hs||{}),qe=(s=>(s[s.LOW=0]="LOW",s[s.MIDDLE=1]="MIDDLE",s[s.HIGH=2]="HIGH",s))(qe||{}),Ht=(s=>(s.MONTH="monthly",s.QUARTER="quarterly",s.HALF_YEAR="half_yearly",s.YEAR="yearly",s.TWO_YEAR="two_yearly",s.THREE_YEAR="three_yearly",s.ONETIME="onetime",s.RESET="reset_traffic",s))(Ht||{});function $s({title:s,value:a,icon:t,trend:l,description:n,onClick:r,highlight:o,className:c}){return e.jsxs(Ye,{className:y("transition-colors",r&&"cursor-pointer hover:bg-muted/50",o&&"border-primary/50",c),onClick:r,children:[e.jsxs(ts,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ns,{className:"text-sm font-medium",children:s}),t]}),e.jsxs(as,{children:[e.jsx("div",{className:"text-2xl font-bold",children:a}),l?e.jsxs("div",{className:"flex items-center pt-1",children:[e.jsx(nc,{className:y("h-4 w-4",l.isPositive?"text-emerald-500":"text-red-500")}),e.jsxs("span",{className:y("ml-1 text-xs",l.isPositive?"text-emerald-500":"text-red-500"),children:[l.isPositive?"+":"-",Math.abs(l.value),"%"]}),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:l.label})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:n})]})]})}function cm({className:s}){const a=Rs(),{t}=V(),{data:l,isLoading:n}=le({queryKey:["dashboardStats"],queryFn:async()=>(await ya.getStatsData()).data,refetchInterval:1e3*60*5});if(n||!l)return e.jsx(rm,{});const r=()=>{const o=new URLSearchParams;o.set("commission_status",ye.PENDING.toString()),o.set("status",ne.COMPLETED.toString()),o.set("commission_balance","gt:0"),a(`/finance/order?${o.toString()}`)};return e.jsxs("div",{className:y("grid gap-4 md:grid-cols-2 lg:grid-cols-4",s),children:[e.jsx($s,{title:t("dashboard:stats.todayIncome"),value:Js(l.todayIncome),icon:e.jsx(ec,{className:"h-4 w-4 text-emerald-500"}),trend:{value:l.dayIncomeGrowth,label:t("dashboard:stats.vsYesterday"),isPositive:l.dayIncomeGrowth>0}}),e.jsx($s,{title:t("dashboard:stats.monthlyIncome"),value:Js(l.currentMonthIncome),icon:e.jsx(Gl,{className:"h-4 w-4 text-blue-500"}),trend:{value:l.monthIncomeGrowth,label:t("dashboard:stats.vsLastMonth"),isPositive:l.monthIncomeGrowth>0}}),e.jsx($s,{title:t("dashboard:stats.pendingTickets"),value:l.ticketPendingTotal,icon:e.jsx(sc,{className:y("h-4 w-4",l.ticketPendingTotal>0?"text-orange-500":"text-muted-foreground")}),description:l.ticketPendingTotal>0?t("dashboard:stats.hasPendingTickets"):t("dashboard:stats.noPendingTickets"),onClick:()=>a("/user/ticket"),highlight:l.ticketPendingTotal>0}),e.jsx($s,{title:t("dashboard:stats.pendingCommission"),value:l.commissionPendingTotal,icon:e.jsx(tc,{className:y("h-4 w-4",l.commissionPendingTotal>0?"text-blue-500":"text-muted-foreground")}),description:l.commissionPendingTotal>0?t("dashboard:stats.hasPendingCommission"):t("dashboard:stats.noPendingCommission"),onClick:r,highlight:l.commissionPendingTotal>0}),e.jsx($s,{title:t("dashboard:stats.monthlyNewUsers"),value:l.currentMonthNewUsers,icon:e.jsx(pa,{className:"h-4 w-4 text-blue-500"}),trend:{value:l.userGrowth,label:t("dashboard:stats.vsLastMonth"),isPositive:l.userGrowth>0}}),e.jsx($s,{title:t("dashboard:stats.totalUsers"),value:l.totalUsers,icon:e.jsx(pa,{className:"h-4 w-4 text-muted-foreground"}),description:t("dashboard:stats.activeUsers",{count:l.activeUsers})}),e.jsx($s,{title:t("dashboard:stats.monthlyUpload"),value:Oe(l.monthTraffic.upload),icon:e.jsx(Kt,{className:"h-4 w-4 text-emerald-500"}),description:t("dashboard:stats.todayTraffic",{value:Oe(l.todayTraffic.upload)})}),e.jsx($s,{title:t("dashboard:stats.monthlyDownload"),value:Oe(l.monthTraffic.download),icon:e.jsx(ac,{className:"h-4 w-4 text-blue-500"}),description:t("dashboard:stats.todayTraffic",{value:Oe(l.todayTraffic.download)})})]})}const _t=m.forwardRef(({className:s,children:a,...t},l)=>e.jsxs(Wl,{ref:l,className:y("relative overflow-hidden",s),...t,children:[e.jsx(lc,{className:"h-full w-full rounded-[inherit]",children:a}),e.jsx(_a,{}),e.jsx(rc,{})]}));_t.displayName=Wl.displayName;const _a=m.forwardRef(({className:s,orientation:a="vertical",...t},l)=>e.jsx(Yl,{ref:l,orientation:a,className:y("flex touch-none select-none transition-colors",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",s),...t,children:e.jsx(ic,{className:"relative flex-1 rounded-full bg-border"})}));_a.displayName=Yl.displayName;const dn={today:{getValue:()=>{const s=cc();return{start:s,end:dc(s,1)}}},last7days:{getValue:()=>{const s=new Date;return{start:ps(s,7),end:s}}},last30days:{getValue:()=>{const s=new Date;return{start:ps(s,30),end:s}}},custom:{getValue:()=>null}};function tl({selectedRange:s,customDateRange:a,onRangeChange:t,onCustomRangeChange:l}){const{t:n}=V(),r={today:n("dashboard:trafficRank.today"),last7days:n("dashboard:trafficRank.last7days"),last30days:n("dashboard:trafficRank.last30days"),custom:n("dashboard:trafficRank.customRange")};return e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[e.jsxs(J,{value:s,onValueChange:t,children:[e.jsx(W,{className:"w-[120px]",children:e.jsx(Q,{placeholder:n("dashboard:trafficRank.selectTimeRange")})}),e.jsx(Y,{position:"popper",className:"z-50",children:Object.entries(dn).map(([o])=>e.jsx(A,{value:o,children:r[o]},o))})]}),s==="custom"&&e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(K,{variant:"outline",className:y("min-w-0 justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(Ct,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:a?.from?a.to?e.jsxs(e.Fragment,{children:[hs(a.from,"yyyy-MM-dd")," -"," ",hs(a.to,"yyyy-MM-dd")]}):hs(a.from,"yyyy-MM-dd"):e.jsx("span",{children:n("dashboard:trafficRank.selectDateRange")})})]})}),e.jsx(bs,{className:"w-auto p-0",align:"end",children:e.jsx(ct,{mode:"range",defaultMonth:a?.from,selected:{from:a?.from,to:a?.to},onSelect:o=>{o?.from&&o?.to&&l({from:o.from,to:o.to})},numberOfMonths:2})})]})]})}const ht=s=>`${(s/1024/1024/1024).toFixed(2)} GB`;function dm({className:s}){const{t:a}=V(),[t,l]=m.useState("today"),[n,r]=m.useState({from:ps(new Date,7),to:new Date}),[o,c]=m.useState("today"),[u,i]=m.useState({from:ps(new Date,7),to:new Date}),d=m.useMemo(()=>t==="custom"?{start:n.from,end:n.to}:dn[t].getValue(),[t,n]),h=m.useMemo(()=>o==="custom"?{start:u.from,end:u.to}:dn[o].getValue(),[o,u]),{data:k}=le({queryKey:["nodeTrafficRank",d.start,d.end],queryFn:()=>ya.getNodeTrafficData({type:"node",start_time:ke.round(d.start.getTime()/1e3),end_time:ke.round(d.end.getTime()/1e3)}),refetchInterval:3e4}),{data:C}=le({queryKey:["userTrafficRank",h.start,h.end],queryFn:()=>ya.getNodeTrafficData({type:"user",start_time:ke.round(h.start.getTime()/1e3),end_time:ke.round(h.end.getTime()/1e3)}),refetchInterval:3e4});return e.jsxs("div",{className:y("grid gap-4 md:grid-cols-2",s),children:[e.jsxs(Ye,{children:[e.jsx(ts,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(Ns,{className:"flex items-center text-base font-medium",children:[e.jsx(oc,{className:"mr-2 h-4 w-4"}),a("dashboard:trafficRank.nodeTrafficRank")]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(tl,{selectedRange:t,customDateRange:n,onRangeChange:l,onCustomRangeChange:r}),e.jsx(Bn,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(as,{className:"flex-1",children:k?.data?e.jsxs(_t,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:k.data.map(S=>e.jsx(je,{delayDuration:200,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:S.name}),e.jsxs("span",{className:y("ml-2 flex items-center text-xs font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?e.jsx(tn,{className:"mr-1 h-3 w-3"}):e.jsx(an,{className:"mr-1 h-3 w-3"}),Math.abs(S.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${S.value/k.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:ht(S.value)})]})]})})}),e.jsx(oe,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.currentTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:ht(S.value)}),e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.previousTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:ht(S.previousValue)}),e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.changeRate"),":"]}),e.jsxs("span",{className:y("font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?"+":"",S.change,"%"]})]})})]})},S.id))}),e.jsx(_a,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:a("common:loading")})})})]}),e.jsxs(Ye,{children:[e.jsx(ts,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(Ns,{className:"flex items-center text-base font-medium",children:[e.jsx(pa,{className:"mr-2 h-4 w-4"}),a("dashboard:trafficRank.userTrafficRank")]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(tl,{selectedRange:o,customDateRange:u,onRangeChange:c,onCustomRangeChange:i}),e.jsx(Bn,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(as,{className:"flex-1",children:C?.data?e.jsxs(_t,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:C.data.map(S=>e.jsx(je,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:S.name}),e.jsxs("span",{className:y("ml-2 flex items-center text-xs font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?e.jsx(tn,{className:"mr-1 h-3 w-3"}):e.jsx(an,{className:"mr-1 h-3 w-3"}),Math.abs(S.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${S.value/C.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:ht(S.value)})]})]})})}),e.jsx(oe,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.currentTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:ht(S.value)}),e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.previousTraffic"),":"]}),e.jsx("span",{className:"font-medium",children:ht(S.previousValue)}),e.jsxs("span",{className:"text-muted-foreground",children:[a("dashboard:trafficRank.changeRate"),":"]}),e.jsxs("span",{className:y("font-medium",S.change>=0?"text-green-600":"text-red-600"),children:[S.change>=0?"+":"",S.change,"%"]})]})})]})},S.id))}),e.jsx(_a,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:a("common:loading")})})})]})]})}const mm=tt("inline-flex items-center rounded-md 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 shadow hover:bg-primary/10",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function G({className:s,variant:a,...t}){return e.jsx("div",{className:y(mm({variant:a}),s),...t})}const ma=m.forwardRef(({className:s,value:a,...t},l)=>e.jsx(Jl,{ref:l,className:y("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",s),...t,children:e.jsx(mc,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})}));ma.displayName=Jl.displayName;const Nn=m.forwardRef(({className:s,...a},t)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:t,className:y("w-full caption-bottom text-sm",s),...a})}));Nn.displayName="Table";const _n=m.forwardRef(({className:s,...a},t)=>e.jsx("thead",{ref:t,className:y("[&_tr]:border-b",s),...a}));_n.displayName="TableHeader";const wn=m.forwardRef(({className:s,...a},t)=>e.jsx("tbody",{ref:t,className:y("[&_tr:last-child]:border-0",s),...a}));wn.displayName="TableBody";const um=m.forwardRef(({className:s,...a},t)=>e.jsx("tfoot",{ref:t,className:y("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));um.displayName="TableFooter";const As=m.forwardRef(({className:s,...a},t)=>e.jsx("tr",{ref:t,className:y("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...a}));As.displayName="TableRow";const Cn=m.forwardRef(({className:s,...a},t)=>e.jsx("th",{ref:t,className:y("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a}));Cn.displayName="TableHead";const vt=m.forwardRef(({className:s,...a},t)=>e.jsx("td",{ref:t,className:y("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a}));vt.displayName="TableCell";const xm=m.forwardRef(({className:s,...a},t)=>e.jsx("caption",{ref:t,className:y("mt-4 text-sm text-muted-foreground",s),...a}));xm.displayName="TableCaption";function Sn({table:s}){const[a,t]=m.useState(""),{t:l}=V("common");m.useEffect(()=>{t((s.getState().pagination.pageIndex+1).toString())},[s.getState().pagination.pageIndex]);const n=r=>{const o=parseInt(r);!isNaN(o)&&o>=1&&o<=s.getPageCount()?s.setPageIndex(o-1):t((s.getState().pagination.pageIndex+1).toString())};return e.jsxs("div",{className:"flex flex-col-reverse gap-4 px-2 py-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{className:"flex-1 text-sm text-muted-foreground",children:l("table.pagination.selected",{selected:s.getFilteredSelectedRowModel().rows.length,total:s.getFilteredRowModel().rows.length})}),e.jsxs("div",{className:"flex flex-col-reverse items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:l("table.pagination.itemsPerPage")}),e.jsxs(J,{value:`${s.getState().pagination.pageSize}`,onValueChange:r=>{s.setPageSize(Number(r))},children:[e.jsx(W,{className:"h-8 w-[70px]",children:e.jsx(Q,{placeholder:s.getState().pagination.pageSize})}),e.jsx(Y,{side:"top",children:[10,20,30,40,50,100,500].map(r=>e.jsx(A,{value:`${r}`,children:r},r))})]})]}),e.jsxs("div",{className:"flex items-center justify-center space-x-2 text-sm font-medium",children:[e.jsx("span",{children:l("table.pagination.page")}),e.jsx(D,{type:"text",value:a,onChange:r=>t(r.target.value),onBlur:r=>n(r.target.value),onKeyDown:r=>{r.key==="Enter"&&n(r.currentTarget.value)},className:"h-8 w-[50px] text-center"}),e.jsx("span",{children:l("table.pagination.pageOf",{total:s.getPageCount()})})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(L,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(0),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:l("table.pagination.firstPage")}),e.jsx(uc,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.previousPage(),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:l("table.pagination.previousPage")}),e.jsx(Kl,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.nextPage(),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:l("table.pagination.nextPage")}),e.jsx(pn,{className:"h-4 w-4"})]}),e.jsxs(L,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(s.getPageCount()-1),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:l("table.pagination.lastPage")}),e.jsx(xc,{className:"h-4 w-4"})]})]})]})]})}function os({table:s,toolbar:a,draggable:t=!1,onDragStart:l,onDragEnd:n,onDragOver:r,onDragLeave:o,onDrop:c,showPagination:u=!0,isLoading:i=!1}){const{t:d}=V("common"),h=m.useRef(null),k=s.getAllColumns().filter(N=>N.getIsPinned()==="left"),C=s.getAllColumns().filter(N=>N.getIsPinned()==="right"),S=N=>k.slice(0,N).reduce((g,T)=>g+(T.getSize()??0),0),w=N=>C.slice(N+1).reduce((g,T)=>g+(T.getSize()??0),0);return e.jsxs("div",{className:"space-y-4",children:[typeof a=="function"?a(s):a,e.jsx("div",{ref:h,className:"relative overflow-auto rounded-md border bg-card",children:e.jsx("div",{className:"overflow-auto",children:e.jsxs(Nn,{children:[e.jsx(_n,{children:s.getHeaderGroups().map(N=>e.jsx(As,{className:"hover:bg-transparent",children:N.headers.map((g,T)=>{const E=g.column.getIsPinned()==="left",p=g.column.getIsPinned()==="right",_=E?S(k.indexOf(g.column)):void 0,I=p?w(C.indexOf(g.column)):void 0;return e.jsx(Cn,{colSpan:g.colSpan,style:{width:g.getSize(),...E&&{left:_},...p&&{right:I}},className:y("h-11 bg-card px-4 text-muted-foreground",(E||p)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",E&&"before:right-0",p&&"before:left-0"]),children:g.isPlaceholder?null:ga(g.column.columnDef.header,g.getContext())},g.id)})},N.id))}),e.jsx(wn,{children:s.getRowModel().rows?.length?s.getRowModel().rows.map((N,g)=>e.jsx(As,{"data-state":N.getIsSelected()&&"selected",className:"hover:bg-muted/50",draggable:t,onDragStart:T=>l?.(T,g),onDragEnd:n,onDragOver:r,onDragLeave:o,onDrop:T=>c?.(T,g),children:N.getVisibleCells().map((T,E)=>{const p=T.column.getIsPinned()==="left",_=T.column.getIsPinned()==="right",I=p?S(k.indexOf(T.column)):void 0,H=_?w(C.indexOf(T.column)):void 0;return e.jsx(vt,{style:{width:T.column.getSize(),...p&&{left:I},..._&&{right:H}},className:y("bg-card",(p||_)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",p&&"before:right-0",_&&"before:left-0"]),children:ga(T.column.columnDef.cell,T.getContext())},T.id)})},N.id)):e.jsx(As,{children:e.jsx(vt,{colSpan:s.getAllColumns().length,className:"h-24 text-center",children:d("table.noData")})})})]})})}),u&&e.jsx(Sn,{table:s})]})}const ua=s=>{if(!s)return"";let a;if(typeof s=="string"){if(a=parseInt(s),isNaN(a))return s}else a=s;return(a.toString().length===10?new Date(a*1e3):new Date(a)).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})},Ft=Ql(),Mt=Ql();function la({data:s,isLoading:a,searchKeyword:t,selectedLevel:l,total:n,currentPage:r,pageSize:o,onViewDetail:c,onPageChange:u}){const{t:i}=V(),d=C=>{switch(C.toLowerCase()){case"info":return e.jsx($t,{className:"h-4 w-4 text-blue-500"});case"warning":return e.jsx(da,{className:"h-4 w-4 text-yellow-500"});case"error":return e.jsx(ln,{className:"h-4 w-4 text-red-500"});default:return e.jsx($t,{className:"h-4 w-4 text-slate-500"})}},h=m.useMemo(()=>[Ft.accessor("level",{id:"level",header:()=>i("dashboard:systemLog.level","级别"),size:80,cell:({getValue:C,row:S})=>{const w=C();return e.jsxs("div",{className:"flex items-center gap-1",children:[d(w),e.jsx("span",{className:y(w.toLowerCase()==="error"&&"text-red-600",w.toLowerCase()==="warning"&&"text-yellow-600",w.toLowerCase()==="info"&&"text-blue-600"),children:w})]})}}),Ft.accessor("created_at",{id:"created_at",header:()=>i("dashboard:systemLog.time","时间"),size:160,cell:({getValue:C})=>ua(C())}),Ft.accessor(C=>C.title||C.message||"",{id:"title",header:()=>i("dashboard:systemLog.logTitle","标题"),cell:({getValue:C})=>e.jsx("span",{className:"inline-block max-w-[300px] truncate",children:C()})}),Ft.accessor("method",{id:"method",header:()=>i("dashboard:systemLog.method","请求方法"),size:100,cell:({getValue:C})=>{const S=C();return S?e.jsx(G,{variant:"outline",className:y(S==="GET"&&"border-blue-200 bg-blue-50 text-blue-700",S==="POST"&&"border-green-200 bg-green-50 text-green-700",S==="PUT"&&"border-amber-200 bg-amber-50 text-amber-700",S==="DELETE"&&"border-red-200 bg-red-50 text-red-700"),children:S}):null}}),Ft.display({id:"actions",header:()=>i("dashboard:systemLog.action","操作"),size:80,cell:({row:C})=>e.jsx(K,{variant:"ghost",size:"sm",onClick:()=>c(C.original),"aria-label":i("dashboard:systemLog.viewDetail","查看详情"),children:e.jsx(nn,{className:"h-4 w-4"})})})],[i,c]),k=Je({data:s,columns:h,getCoreRowModel:Qe(),getPaginationRowModel:rs(),pageCount:Math.ceil(n/o),manualPagination:!0,state:{pagination:{pageIndex:r-1,pageSize:o}},onPaginationChange:C=>{if(typeof C=="function"){const S=C({pageIndex:r-1,pageSize:o});u(S.pageIndex+1)}else u(C.pageIndex+1)}});return e.jsxs("div",{className:"overflow-x-auto",children:[e.jsx(os,{table:k,showPagination:!1,isLoading:a}),e.jsx(Sn,{table:k}),(t||l&&l!=="all")&&e.jsx("div",{className:"text-center text-sm text-muted-foreground",children:t&&l&&l!=="all"?`筛选结果: 包含"${t}"且级别为"${l}"的日志共 ${n} 条`:t?`搜索结果: 包含"${t}"的日志共 ${n} 条`:`筛选结果: 级别为"${l}"的日志共 ${n} 条`})]})}function hm(){const{t:s}=V(),[a,t]=m.useState(0),[l,n]=m.useState(!1),[r,o]=m.useState(1),[c]=m.useState(10),[u,i]=m.useState(null),[d,h]=m.useState(!1),[k,C]=m.useState(!1),[S,w]=m.useState(1),[N]=m.useState(10),[g,T]=m.useState(null),[E,p]=m.useState(!1),[_,I]=m.useState(""),[H,O]=m.useState(""),[B,ue]=m.useState("all"),[ee,te]=m.useState(!1),[q,R]=m.useState(30),[X,ms]=m.useState("all"),[Te,re]=m.useState(1e3),[us,Ts]=m.useState(!1),[Bs,Dt]=m.useState(null),[Yt,Pt]=m.useState(!1);m.useEffect(()=>{const U=setTimeout(()=>{O(_),_!==H&&w(1)},500);return()=>clearTimeout(U)},[_]);const{data:Ms,isLoading:Ha,refetch:se,isRefetching:xe}=le({queryKey:["systemStatus",a],queryFn:async()=>(await ce.getSystemStatus()).data,refetchInterval:3e4}),{data:ae,isLoading:Gs,refetch:sp,isRefetching:Fn}=le({queryKey:["queueStats",a],queryFn:async()=>(await ce.getQueueStats()).data,refetchInterval:3e4}),{data:Mn,isLoading:ui,refetch:xi}=le({queryKey:["failedJobs",r,c],queryFn:async()=>{const U=await ce.getHorizonFailedJobs({current:r,page_size:c});return{data:U.data,total:U.total||0}},enabled:l}),{data:On,isLoading:Jt,refetch:hi}=le({queryKey:["systemLogs",S,N,B,H],queryFn:async()=>{const U={current:S,page_size:N};B&&B!=="all"&&(U.level=B),H.trim()&&(U.keyword=H.trim());const Os=await ce.getSystemLog(U);return{data:Os.data,total:Os.total||0}},enabled:k}),zn=Mn?.data||[],pi=Mn?.total||0,Qt=On?.data||[],Xt=On?.total||0,gi=m.useMemo(()=>[Mt.display({id:"failed_at",header:()=>s("dashboard:queue.details.time","时间"),cell:({row:U})=>ua(U.original.failed_at)}),Mt.display({id:"queue",header:()=>s("dashboard:queue.details.queue","队列"),cell:({row:U})=>U.original.queue}),Mt.display({id:"name",header:()=>s("dashboard:queue.details.name","任务名称"),cell:({row:U})=>e.jsx(je,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx("span",{className:"inline-block max-w-[150px] truncate",children:U.original.name})}),e.jsx(oe,{children:e.jsx("span",{children:U.original.name})})]})})}),Mt.display({id:"exception",header:()=>s("dashboard:queue.details.exception","异常信息"),cell:({row:U})=>e.jsx(je,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx("span",{className:"inline-block max-w-[200px] truncate",children:U.original.exception.split(` +`)[0]})}),e.jsx(oe,{className:"max-w-[300px] whitespace-pre-wrap",children:e.jsx("span",{children:U.original.exception})})]})})}),Mt.display({id:"actions",header:()=>s("dashboard:queue.details.action","操作"),size:80,cell:({row:U})=>e.jsx(K,{variant:"ghost",size:"sm",onClick:()=>bi(U.original),"aria-label":s("dashboard:queue.details.viewDetail","查看详情"),children:e.jsx(nn,{className:"h-4 w-4"})})})],[s]),$n=Je({data:zn,columns:gi,getCoreRowModel:Qe(),getPaginationRowModel:rs(),pageCount:Math.ceil(pi/c),manualPagination:!0,state:{pagination:{pageIndex:r-1,pageSize:c}},onPaginationChange:U=>{if(typeof U=="function"){const Os=U({pageIndex:r-1,pageSize:c});An(Os.pageIndex+1)}else An(U.pageIndex+1)}}),fi=()=>{t(U=>U+1)},An=U=>{o(U)},Zt=U=>{w(U)},ji=U=>{ue(U),w(1)},vi=()=>{I(""),O(""),ue("all"),w(1)},ea=U=>{T(U),p(!0)},bi=U=>{i(U),h(!0)},yi=async()=>{try{const U=await ce.getLogClearStats({days:q,level:X==="all"?void 0:X});Dt(U.data),Pt(!0)}catch(U){console.error("获取清理统计失败:",U),$.error("获取清理统计失败")}},Ni=async()=>{Ts(!0);try{const U=await ce.clearSystemLog({days:q,level:X==="all"?void 0:X,limit:Te});U.data.status==="success"?($.success(`清理完成!已清理 ${U.data.cleared_count} 条日志`),te(!1),Pt(!1),Dt(null),se()):$.error(U.data.message||"清理失败")}catch(U){console.error("清理日志失败:",U),$.error("清理日志失败")}finally{Ts(!1)}};if(Ha||Gs)return e.jsx("div",{className:"flex items-center justify-center p-6",children:e.jsx(fa,{className:"h-6 w-6 animate-spin"})});const _i=U=>U?e.jsx(Xl,{className:"h-5 w-5 text-green-500"}):e.jsx(Zl,{className:"h-5 w-5 text-red-500"});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(Ye,{children:[e.jsxs(ts,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ns,{className:"flex items-center gap-2",children:[e.jsx(hc,{className:"h-5 w-5"}),s("dashboard:queue.title")]}),e.jsx(st,{children:s("dashboard:queue.status.description")})]}),e.jsx(K,{variant:"outline",size:"icon",onClick:fi,disabled:xe||Fn,children:e.jsx(Ua,{className:y("h-4 w-4",(xe||Fn)&&"animate-spin")})})]}),e.jsx(as,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[_i(ae?.status||!1),e.jsx("span",{className:"font-medium",children:s("dashboard:queue.status.running")})]}),e.jsx(G,{variant:ae?.status?"secondary":"destructive",children:ae?.status?s("dashboard:queue.status.normal"):s("dashboard:queue.status.abnormal")})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.status.waitTime",{seconds:ae?.wait?.default||0})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(je,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.recentJobs")}),e.jsx("p",{className:"text-2xl font-bold",children:ae?.recentJobs||0}),e.jsx(ma,{value:(ae?.recentJobs||0)/(ae?.periods?.recentJobs||1)*100,className:"h-1"})]})}),e.jsx(oe,{children:e.jsx("p",{children:s("dashboard:queue.details.statisticsPeriod",{hours:ae?.periods?.recentJobs||0})})})]})}),e.jsx(je,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.jobsPerMinute")}),e.jsx("p",{className:"text-2xl font-bold",children:ae?.jobsPerMinute||0}),e.jsx(ma,{value:(ae?.jobsPerMinute||0)/(ae?.queueWithMaxThroughput?.throughput||1)*100,className:"h-1"})]})}),e.jsx(oe,{children:e.jsx("p",{children:s("dashboard:queue.details.maxThroughput",{value:ae?.queueWithMaxThroughput?.throughput||0})})})]})})]})]})})]}),e.jsxs(Ye,{children:[e.jsxs(ts,{children:[e.jsxs(Ns,{className:"flex items-center gap-2",children:[e.jsx(pc,{className:"h-5 w-5"}),s("dashboard:queue.jobDetails")]}),e.jsx(st,{children:s("dashboard:queue.details.description")})]}),e.jsx(as,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.failedJobs7Days")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"cursor-pointer text-2xl font-bold text-destructive hover:underline",title:s("dashboard:queue.details.viewFailedJobs"),onClick:()=>n(!0),style:{userSelect:"none"},children:ae?.failedJobs||0}),e.jsx(nn,{className:"h-4 w-4 cursor-pointer text-muted-foreground hover:text-destructive",onClick:()=>n(!0),"aria-label":s("dashboard:queue.details.viewFailedJobs")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("dashboard:queue.details.retentionPeriod",{hours:ae?.periods?.failedJobs||0})})]}),e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.longestRunningQueue")}),e.jsxs("p",{className:"text-2xl font-bold",children:[ae?.queueWithMaxRuntime?.runtime||0,"s"]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:ae?.queueWithMaxRuntime?.name||"N/A"})]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.activeProcesses")}),e.jsxs("span",{className:"font-medium",children:[ae?.processes||0," /"," ",(ae?.processes||0)+(ae?.pausedMasters||0)]})]}),e.jsx(ma,{value:(ae?.processes||0)/((ae?.processes||0)+(ae?.pausedMasters||0))*100,className:"mt-2 h-1"})]})]})})]})]}),e.jsxs(Ye,{children:[e.jsxs(ts,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ns,{className:"flex items-center gap-2",children:[e.jsx(Gn,{className:"h-5 w-5"}),s("dashboard:systemLog.title","系统日志")]}),e.jsx(st,{children:s("dashboard:systemLog.description","查看系统运行日志记录")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(K,{variant:"outline",onClick:()=>C(!0),children:s("dashboard:systemLog.viewAll","查看全部")}),e.jsxs(K,{variant:"outline",onClick:()=>te(!0),className:"text-destructive hover:text-destructive",children:[e.jsx(We,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.clearLogs","清理日志")]})]})]}),e.jsx(as,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-900 dark:bg-blue-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($t,{className:"h-5 w-5 text-blue-500"}),e.jsx("p",{className:"font-medium text-blue-700 dark:text-blue-300",children:s("dashboard:systemLog.tabs.info","信息")})]}),e.jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:Ms?.logs?.info||0})]}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-yellow-200 bg-yellow-50 p-3 dark:border-yellow-900 dark:bg-yellow-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(da,{className:"h-5 w-5 text-yellow-500"}),e.jsx("p",{className:"font-medium text-yellow-700 dark:text-yellow-300",children:s("dashboard:systemLog.tabs.warning","警告")})]}),e.jsx("p",{className:"text-2xl font-bold text-yellow-700 dark:text-yellow-300",children:Ms?.logs?.warning||0})]}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-900 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ln,{className:"h-5 w-5 text-red-500"}),e.jsx("p",{className:"font-medium text-red-700 dark:text-red-300",children:s("dashboard:systemLog.tabs.error","错误")})]}),e.jsx("p",{className:"text-2xl font-bold text-red-700 dark:text-red-300",children:Ms?.logs?.error||0})]})]}),Ms?.logs&&Ms.logs.total>0&&e.jsxs("div",{className:"mt-3 text-center text-sm text-muted-foreground",children:[s("dashboard:systemLog.totalLogs","总日志数"),":"," ",Ms.logs.total]})]})})]}),e.jsx(ge,{open:l,onOpenChange:n,children:e.jsxs(pe,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(ve,{children:e.jsx(fe,{children:s("dashboard:queue.details.failedJobsDetailTitle","失败任务详情")})}),e.jsxs("div",{className:"overflow-x-auto",children:[e.jsx(os,{table:$n,showPagination:!1,isLoading:ui}),e.jsx(Sn,{table:$n}),zn.length===0&&e.jsx("div",{className:"py-8 text-center text-muted-foreground",children:s("dashboard:queue.details.noFailedJobs","暂无失败任务")})]}),e.jsxs(Le,{children:[e.jsxs(K,{variant:"outline",onClick:()=>xi(),children:[e.jsx(Ua,{className:"mr-2 h-4 w-4"}),s("dashboard:common.refresh","刷新")]}),e.jsx(qs,{asChild:!0,children:e.jsx(K,{variant:"outline",children:s("common.close","关闭")})})]})]})}),e.jsx(ge,{open:d,onOpenChange:h,children:e.jsxs(pe,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(ve,{children:e.jsx(fe,{children:s("dashboard:queue.details.jobDetailTitle","任务详情")})}),u&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.id","任务ID")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:u.id})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.time","时间")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.failed_at})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.queue","队列")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.queue})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.connection","连接")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:u.connection})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.name","任务名称")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:u.name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.exception","异常信息")}),e.jsx("div",{className:"max-h-[200px] overflow-y-auto rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:e.jsx("pre",{className:"whitespace-pre-wrap text-xs text-red-700 dark:text-red-300",children:u.exception})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:queue.details.payload","任务数据")}),e.jsx("div",{className:"max-h-[200px] overflow-y-auto rounded-md bg-muted/50 p-3",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs",children:(()=>{try{return JSON.stringify(JSON.parse(u.payload),null,2)}catch{return u.payload}})()})})]})]}),e.jsx(Le,{children:e.jsx(K,{variant:"outline",onClick:()=>h(!1),children:s("common.close","关闭")})})]})}),e.jsx(ge,{open:k,onOpenChange:C,children:e.jsxs(pe,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(ve,{children:e.jsx(fe,{children:s("dashboard:systemLog.title","系统日志")})}),e.jsxs(Wt,{value:B,onValueChange:ji,className:"w-full overflow-x-auto",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-2 p-1 md:flex-row md:items-center md:justify-between",children:[e.jsxs(kt,{className:"grid w-auto grid-cols-4",children:[e.jsxs(es,{value:"all",className:"flex items-center gap-2",children:[e.jsx(Gn,{className:"h-4 w-4"}),s("dashboard:systemLog.tabs.all","全部")]}),e.jsxs(es,{value:"info",className:"flex items-center gap-2",children:[e.jsx($t,{className:"h-4 w-4 text-blue-500"}),s("dashboard:systemLog.tabs.info","信息")]}),e.jsxs(es,{value:"warning",className:"flex items-center gap-2",children:[e.jsx(da,{className:"h-4 w-4 text-yellow-500"}),s("dashboard:systemLog.tabs.warning","警告")]}),e.jsxs(es,{value:"error",className:"flex items-center gap-2",children:[e.jsx(ln,{className:"h-4 w-4 text-red-500"}),s("dashboard:systemLog.tabs.error","错误")]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(fn,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(D,{placeholder:s("dashboard:systemLog.search","搜索日志内容..."),value:_,onChange:U=>I(U.target.value),className:"w-full md:w-64"})]})]}),e.jsx(Ls,{value:"all",className:"mt-0",children:e.jsx(la,{data:Qt,isLoading:Jt,searchKeyword:H,selectedLevel:B,total:Xt,currentPage:S,pageSize:N,onViewDetail:ea,onPageChange:Zt})}),e.jsx(Ls,{value:"info",className:"mt-0 overflow-x-auto",children:e.jsx(la,{data:Qt,isLoading:Jt,searchKeyword:H,selectedLevel:B,total:Xt,currentPage:S,pageSize:N,onViewDetail:ea,onPageChange:Zt})}),e.jsx(Ls,{value:"warning",className:"mt-0",children:e.jsx(la,{data:Qt,isLoading:Jt,searchKeyword:H,selectedLevel:B,total:Xt,currentPage:S,pageSize:N,onViewDetail:ea,onPageChange:Zt})}),e.jsx(Ls,{value:"error",className:"mt-0",children:e.jsx(la,{data:Qt,isLoading:Jt,searchKeyword:H,selectedLevel:B,total:Xt,currentPage:S,pageSize:N,onViewDetail:ea,onPageChange:Zt})})]}),e.jsxs(Le,{children:[e.jsxs(K,{variant:"outline",onClick:()=>hi(),children:[e.jsx(Ua,{className:"mr-2 h-4 w-4"}),s("dashboard:common.refresh","刷新")]}),e.jsx(K,{variant:"outline",onClick:vi,children:s("dashboard:systemLog.filter.reset","重置筛选")}),e.jsx(qs,{asChild:!0,children:e.jsx(K,{variant:"outline",children:s("common.close","关闭")})})]})]})}),e.jsx(ge,{open:E,onOpenChange:p,children:e.jsxs(pe,{className:"max-h-[90vh] max-w-4xl overflow-y-auto",children:[e.jsx(ve,{children:e.jsx(fe,{children:s("dashboard:systemLog.detailTitle","日志详情")})}),g&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.level","级别")}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx($t,{className:"h-4 w-4"}),e.jsx("p",{className:"font-medium",children:g.level})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.time","时间")}),e.jsx("p",{children:ua(g.created_at)||ua(g.updated_at)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.logTitle","标题")}),e.jsx("div",{className:"whitespace-pre-wrap rounded-md bg-muted/50 p-3",children:g.title||g.message||""})]}),(g.host||g.ip)&&e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.host&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.host","主机")}),e.jsx("p",{className:"break-all rounded-md bg-muted/50 p-2 text-sm",children:g.host})]}),g.ip&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.ip","IP地址")}),e.jsx("p",{className:"rounded-md bg-muted/50 p-2 text-sm",children:g.ip})]})]}),g.uri&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.uri","URI")}),e.jsx("div",{className:"overflow-x-auto rounded-md bg-muted/50 p-3",children:e.jsx("code",{className:"text-sm",children:g.uri})})]}),g.method&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.method","请求方法")}),e.jsx("div",{children:e.jsx(G,{variant:"outline",className:"text-base font-medium",children:g.method})})]}),g.data&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.requestData","请求数据")}),e.jsx("div",{className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/50 p-3",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs",children:(()=>{try{return JSON.stringify(JSON.parse(g.data),null,2)}catch{return g.data}})()})})]}),g.context&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:s("dashboard:systemLog.exception","异常信息")}),e.jsx("div",{className:"max-h-[250px] overflow-y-auto rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all text-xs text-red-700 dark:text-red-300",children:(()=>{try{const U=JSON.parse(g.context);if(U.exception){const Os=U.exception,wi=Os["\0*\0message"]||"",Ci=Os["\0*\0file"]||"",Si=Os["\0*\0line"]||"";return`${wi} File: ${Ci} -Line: ${Si}`}return JSON.stringify(U,null,2)}catch{return g.context}})()})})]})]}),e.jsx(Le,{children:e.jsx(qs,{asChild:!0,children:e.jsx(K,{variant:"outline",children:s("common.close","关闭")})})})]})}),e.jsx(he,{open:ee,onOpenChange:te,children:e.jsxs(ue,{className:"max-w-2xl",children:[e.jsx(je,{children:e.jsxs(pe,{className:"flex items-center gap-2",children:[e.jsx(We,{className:"h-5 w-5 text-destructive"}),s("dashboard:systemLog.clearLogs","清理日志")]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Xs,{htmlFor:"clearDays",children:s("dashboard:systemLog.clearDays","清理天数")}),e.jsx(D,{id:"clearDays",type:"number",min:"1",max:"365",value:q,onChange:U=>R(parseInt(U.target.value)||30),placeholder:"30"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearDaysDesc","清理多少天前的日志 (1-365天)")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Xs,{htmlFor:"clearLevel",children:s("dashboard:systemLog.clearLevel","日志级别")}),e.jsxs(J,{value:X,onValueChange:ms,children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx(A,{value:"all",children:s("dashboard:systemLog.tabs.all","全部")}),e.jsx(A,{value:"info",children:s("dashboard:systemLog.tabs.info","信息")}),e.jsx(A,{value:"warning",children:s("dashboard:systemLog.tabs.warning","警告")}),e.jsx(A,{value:"error",children:s("dashboard:systemLog.tabs.error","错误")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Xs,{htmlFor:"clearLimit",children:s("dashboard:systemLog.clearLimit","单次限制")}),e.jsx(D,{id:"clearLimit",type:"number",min:"100",max:"10000",value:Te,onChange:U=>re(parseInt(U.target.value)||1e3),placeholder:"1000"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearLimitDesc","单次清理数量限制 (100-10000条)")})]})]}),e.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-900 dark:bg-amber-950/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Gl,{className:"h-5 w-5 text-amber-600"}),e.jsx("span",{className:"font-medium text-amber-800 dark:text-amber-200",children:s("dashboard:systemLog.clearPreview","清理预览")})]}),e.jsxs(K,{variant:"outline",size:"sm",onClick:yi,disabled:us,children:[e.jsx(Ct,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.getStats","获取统计")]})]}),Jt&&Bs&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.cutoffDate","截止日期")}),e.jsx("p",{className:"font-mono text-sm",children:Bs.cutoff_date})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.totalLogs","总日志数")}),e.jsx("p",{className:"font-mono text-sm font-medium",children:Bs.total_logs.toLocaleString()})]})]}),e.jsxs("div",{className:"rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ma,{className:"h-4 w-4 text-red-600"}),e.jsxs("span",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:[s("dashboard:systemLog.willClear","将要清理"),":",e.jsx("span",{className:"ml-1 font-bold",children:Bs.logs_to_clear.toLocaleString()}),s("dashboard:systemLog.logsUnit"," 条日志")]})]}),e.jsx("p",{className:"mt-1 text-xs text-red-600 dark:text-red-300",children:s("dashboard:systemLog.clearWarning","此操作不可撤销,请谨慎操作!")})]})]})]})]}),e.jsxs(Le,{children:[e.jsx(K,{variant:"outline",onClick:()=>{te(!1),Pt(!1),Dt(null)},children:s("common.cancel","取消")}),e.jsx(K,{variant:"destructive",onClick:Ni,disabled:us||!Jt||!Bs,children:us?e.jsxs(e.Fragment,{children:[e.jsx(fa,{className:"mr-2 h-4 w-4 animate-spin"}),s("dashboard:systemLog.clearing","清理中...")]}):e.jsxs(e.Fragment,{children:[e.jsx(We,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.confirmClear","确认清理")]})})]})]})})]})}function hm(){const{t:s}=V();return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx("div",{className:"flex items-center",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:s("dashboard:title")})}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Xe,{}),e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsx(Ae,{children:e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid gap-6",children:[e.jsx(om,{}),e.jsx(am,{}),e.jsx(cm,{}),e.jsx(xm,{})]})})})]})}const pm=Object.freeze(Object.defineProperty({__proto__:null,default:hm},Symbol.toStringTag,{value:"Module"}));function gm({className:s,items:a,...t}){const{pathname:l}=un(),n=Rs(),[r,o]=m.useState(l??"/settings"),c=i=>{o(i),n(i)},{t:u}=V("settings");return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-1 md:hidden",children:e.jsxs(J,{value:r,onValueChange:c,children:[e.jsx(W,{className:"h-12 sm:w-48",children:e.jsx(Q,{placeholder:"Theme"})}),e.jsx(Y,{children:a.map(i=>e.jsx(A,{value:i.href,children:e.jsxs("div",{className:"flex gap-x-4 px-2 py-1",children:[e.jsx("span",{className:"scale-125",children:i.icon}),e.jsx("span",{className:"text-md",children:u(i.title)})]})},i.href))})]})}),e.jsx("div",{className:"hidden w-full overflow-x-auto bg-background px-1 py-2 md:block",children:e.jsx("nav",{className:y("flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1",s),...t,children:a.map(i=>e.jsxs(nt,{to:i.href,className:y(St({variant:"ghost"}),l===i.href?"bg-muted hover:bg-muted":"hover:bg-transparent hover:underline","justify-start"),children:[e.jsx("span",{className:"mr-2",children:i.icon}),u(i.title)]},i.href))})})]})}const fm=[{title:"site.title",key:"site",icon:e.jsx(gc,{size:18}),href:"/config/system",description:"site.description"},{title:"safe.title",key:"safe",icon:e.jsx(Il,{size:18}),href:"/config/system/safe",description:"safe.description"},{title:"subscribe.title",key:"subscribe",icon:e.jsx(Rl,{size:18}),href:"/config/system/subscribe",description:"subscribe.description"},{title:"invite.title",key:"invite",icon:e.jsx(fc,{size:18}),href:"/config/system/invite",description:"invite.description"},{title:"server.title",key:"server",icon:e.jsx(El,{size:18}),href:"/config/system/server",description:"server.description"},{title:"email.title",key:"email",icon:e.jsx(jc,{size:18}),href:"/config/system/email",description:"email.description"},{title:"telegram.title",key:"telegram",icon:e.jsx(vc,{size:18}),href:"/config/system/telegram",description:"telegram.description"},{title:"app.title",key:"app",icon:e.jsx(Ll,{size:18}),href:"/config/system/app",description:"app.description"},{title:"subscribe_template.title",key:"subscribe_template",icon:e.jsx(bc,{size:18}),href:"/config/system/subscribe-template",description:"subscribe_template.description"}];function jm(){const{t:s}=V("settings");return e.jsxs(Ve,{fadedBelow:!0,fixedHeight:!0,children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:s("title")}),e.jsx("div",{className:"text-muted-foreground",children:s("description")})]}),e.jsx(De,{className:"my-6"}),e.jsxs("div",{className:"flex flex-1 flex-col space-y-8 overflow-auto lg:flex-row lg:space-x-12 lg:space-y-0",children:[e.jsx("aside",{className:"sticky top-0 lg:w-1/5",children:e.jsx(gm,{items:fm})}),e.jsx("div",{className:"flex-1 w-full p-1 pr-4",children:e.jsx("div",{className:"pb-16",children:e.jsx(xn,{})})})]})]})]})}const vm=Object.freeze(Object.defineProperty({__proto__:null,default:jm},Symbol.toStringTag,{value:"Module"})),Z=m.forwardRef(({className:s,...a},t)=>e.jsx(er,{className:y("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",s),...a,ref:t,children:e.jsx(yc,{className:y("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Z.displayName=er.displayName;const ks=m.forwardRef(({className:s,...a},t)=>e.jsx("textarea",{className:y("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...a}));ks.displayName="Textarea";const bm=x.object({logo:x.string().nullable().default(""),force_https:x.number().nullable().default(0),stop_register:x.number().nullable().default(0),app_name:x.string().nullable().default(""),app_description:x.string().nullable().default(""),app_url:x.string().nullable().default(""),subscribe_url:x.string().nullable().default(""),try_out_plan_id:x.number().nullable().default(0),try_out_hour:x.coerce.number().nullable().default(0),tos_url:x.string().nullable().default(""),currency:x.string().nullable().default(""),currency_symbol:x.string().nullable().default("")});function ym(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),{data:n}=le({queryKey:["settings","site"],queryFn:()=>oe.getSettings("site")}),{data:r}=le({queryKey:["plans"],queryFn:()=>ss.getList()}),o=Ne({resolver:we(bm),defaultValues:{},mode:"onBlur"}),{mutateAsync:c}=fs({mutationFn:oe.saveSettings,onSuccess:d=>{d.data&&$.success(s("common.autoSaved"))}});m.useEffect(()=>{if(n?.data?.site){const d=n?.data?.site;Object.entries(d).forEach(([h,k])=>{o.setValue(h,k)}),l.current=d}},[n]);const u=m.useCallback(ke.debounce(async d=>{if(!ke.isEqual(d,l.current)){t(!0);try{const h=Object.entries(d).reduce((k,[C,S])=>(k[C]=S===null?"":S,k),{});await c(h),l.current=d}finally{t(!1)}}},1e3),[c]),i=m.useCallback(d=>{u(d)},[u]);return m.useEffect(()=>{const d=o.watch(h=>{i(h)});return()=>d.unsubscribe()},[o.watch,i]),e.jsx(Ce,{...o,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:o.control,name:"app_name",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteName.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.siteName.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.siteName.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"app_description",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteDescription.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.siteDescription.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.siteDescription.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"app_url",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteUrl.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.siteUrl.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.siteUrl.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"force_https",render:({field:d})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("site.form.forceHttps.label")}),e.jsx(M,{children:s("site.form.forceHttps.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:!!d.value,onCheckedChange:h=>{d.onChange(Number(h)),i(o.getValues())}})})]})}),e.jsx(v,{control:o.control,name:"logo",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.logo.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.logo.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.logo.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"subscribe_url",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.subscribeUrl.label")}),e.jsx(b,{children:e.jsx(ks,{placeholder:s("site.form.subscribeUrl.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.subscribeUrl.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"tos_url",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.tosUrl.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.tosUrl.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.tosUrl.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"stop_register",render:({field:d})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("site.form.stopRegister.label")}),e.jsx(M,{children:s("site.form.stopRegister.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:!!d.value,onCheckedChange:h=>{d.onChange(Number(h)),i(o.getValues())}})})]})}),e.jsx(v,{control:o.control,name:"try_out_plan_id",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.tryOut.label")}),e.jsx(b,{children:e.jsxs(J,{value:d.value?.toString(),onValueChange:h=>{d.onChange(Number(h)),i(o.getValues())},children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("site.form.tryOut.placeholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("site.form.tryOut.placeholder")}),r?.data?.map(h=>e.jsx(A,{value:h.id.toString(),children:h.name},h.id.toString()))]})]})}),e.jsx(M,{children:s("site.form.tryOut.description")}),e.jsx(P,{})]})}),!!o.watch("try_out_plan_id")&&e.jsx(v,{control:o.control,name:"try_out_hour",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"",children:s("site.form.tryOut.duration.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.tryOut.duration.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.tryOut.duration.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"currency",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.currency.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.currency.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.currency.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"currency_symbol",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.currencySymbol.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.currencySymbol.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.currencySymbol.description")}),e.jsx(P,{})]})}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("site.form.saving")})]})})}function Nm(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("site.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("site.description")})]}),e.jsx(De,{}),e.jsx(ym,{})]})}const _m=Object.freeze(Object.defineProperty({__proto__:null,default:Nm},Symbol.toStringTag,{value:"Module"})),wm=x.object({email_verify:x.boolean().nullable(),safe_mode_enable:x.boolean().nullable(),secure_path:x.string().nullable(),email_whitelist_enable:x.boolean().nullable(),email_whitelist_suffix:x.array(x.string().nullable()).nullable(),email_gmail_limit_enable:x.boolean().nullable(),recaptcha_enable:x.boolean().nullable(),recaptcha_key:x.string().nullable(),recaptcha_site_key:x.string().nullable(),register_limit_by_ip_enable:x.boolean().nullable(),register_limit_count:x.coerce.string().transform(s=>s===""?null:s).nullable(),register_limit_expire:x.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_enable:x.boolean().nullable(),password_limit_count:x.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_expire:x.coerce.string().transform(s=>s===""?null:s).nullable()}),Cm={email_verify:!1,safe_mode_enable:!1,secure_path:"",email_whitelist_enable:!1,email_whitelist_suffix:[],email_gmail_limit_enable:!1,recaptcha_enable:!1,recaptcha_key:"",recaptcha_site_key:"",register_limit_by_ip_enable:!1,register_limit_count:"",register_limit_expire:"",password_limit_enable:!1,password_limit_count:"",password_limit_expire:""};function Sm(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(wm),defaultValues:Cm,mode:"onBlur"}),{data:r}=le({queryKey:["settings","safe"],queryFn:()=>oe.getSettings("safe")}),{mutateAsync:o}=fs({mutationFn:oe.saveSettings,onSuccess:i=>{i.data&&$.success(s("common.autoSaved"))}});m.useEffect(()=>{if(r?.data.safe){const i=r.data.safe;Object.entries(i).forEach(([d,h])=>{typeof h=="number"?n.setValue(d,String(h)):n.setValue(d,h)}),l.current=i}},[r]);const c=m.useCallback(ke.debounce(async i=>{if(!ke.isEqual(i,l.current)){t(!0);try{await o(i),l.current=i}finally{t(!1)}}},1e3),[o]),u=m.useCallback(i=>{c(i)},[c]);return m.useEffect(()=>{const i=n.watch(d=>{u(d)});return()=>i.unsubscribe()},[n.watch,u]),e.jsx(Ce,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:n.control,name:"email_verify",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailVerify.label")}),e.jsx(M,{children:s("safe.form.emailVerify.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"email_gmail_limit_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.gmailLimit.label")}),e.jsx(M,{children:s("safe.form.gmailLimit.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"safe_mode_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.safeMode.label")}),e.jsx(M,{children:s("safe.form.safeMode.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"secure_path",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.securePath.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.securePath.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.securePath.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"email_whitelist_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailWhitelist.label")}),e.jsx(M,{children:s("safe.form.emailWhitelist.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),n.watch("email_whitelist_enable")&&e.jsx(v,{control:n.control,name:"email_whitelist_suffix",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailWhitelist.suffixes.label")}),e.jsx(b,{children:e.jsx(ks,{placeholder:s("safe.form.emailWhitelist.suffixes.placeholder"),...i,value:(i.value||[]).join(` +Line: ${Si}`}return JSON.stringify(U,null,2)}catch{return g.context}})()})})]})]}),e.jsx(Le,{children:e.jsx(qs,{asChild:!0,children:e.jsx(K,{variant:"outline",children:s("common.close","关闭")})})})]})}),e.jsx(ge,{open:ee,onOpenChange:te,children:e.jsxs(pe,{className:"max-w-2xl",children:[e.jsx(ve,{children:e.jsxs(fe,{className:"flex items-center gap-2",children:[e.jsx(We,{className:"h-5 w-5 text-destructive"}),s("dashboard:systemLog.clearLogs","清理日志")]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Xs,{htmlFor:"clearDays",children:s("dashboard:systemLog.clearDays","清理天数")}),e.jsx(D,{id:"clearDays",type:"number",min:"1",max:"365",value:q,onChange:U=>R(parseInt(U.target.value)||30),placeholder:"30"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearDaysDesc","清理多少天前的日志 (1-365天)")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Xs,{htmlFor:"clearLevel",children:s("dashboard:systemLog.clearLevel","日志级别")}),e.jsxs(J,{value:X,onValueChange:ms,children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx(A,{value:"all",children:s("dashboard:systemLog.tabs.all","全部")}),e.jsx(A,{value:"info",children:s("dashboard:systemLog.tabs.info","信息")}),e.jsx(A,{value:"warning",children:s("dashboard:systemLog.tabs.warning","警告")}),e.jsx(A,{value:"error",children:s("dashboard:systemLog.tabs.error","错误")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Xs,{htmlFor:"clearLimit",children:s("dashboard:systemLog.clearLimit","单次限制")}),e.jsx(D,{id:"clearLimit",type:"number",min:"100",max:"10000",value:Te,onChange:U=>re(parseInt(U.target.value)||1e3),placeholder:"1000"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearLimitDesc","单次清理数量限制 (100-10000条)")})]})]}),e.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-900 dark:bg-amber-950/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Gl,{className:"h-5 w-5 text-amber-600"}),e.jsx("span",{className:"font-medium text-amber-800 dark:text-amber-200",children:s("dashboard:systemLog.clearPreview","清理预览")})]}),e.jsxs(K,{variant:"outline",size:"sm",onClick:yi,disabled:us,children:[e.jsx(Ct,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.getStats","获取统计")]})]}),Yt&&Bs&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.cutoffDate","截止日期")}),e.jsx("p",{className:"font-mono text-sm",children:Bs.cutoff_date})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.totalLogs","总日志数")}),e.jsx("p",{className:"font-mono text-sm font-medium",children:Bs.total_logs.toLocaleString()})]})]}),e.jsxs("div",{className:"rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(da,{className:"h-4 w-4 text-red-600"}),e.jsxs("span",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:[s("dashboard:systemLog.willClear","将要清理"),":",e.jsx("span",{className:"ml-1 font-bold",children:Bs.logs_to_clear.toLocaleString()}),s("dashboard:systemLog.logsUnit"," 条日志")]})]}),e.jsx("p",{className:"mt-1 text-xs text-red-600 dark:text-red-300",children:s("dashboard:systemLog.clearWarning","此操作不可撤销,请谨慎操作!")})]})]})]})]}),e.jsxs(Le,{children:[e.jsx(K,{variant:"outline",onClick:()=>{te(!1),Pt(!1),Dt(null)},children:s("common.cancel","取消")}),e.jsx(K,{variant:"destructive",onClick:Ni,disabled:us||!Yt||!Bs,children:us?e.jsxs(e.Fragment,{children:[e.jsx(fa,{className:"mr-2 h-4 w-4 animate-spin"}),s("dashboard:systemLog.clearing","清理中...")]}):e.jsxs(e.Fragment,{children:[e.jsx(We,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.confirmClear","确认清理")]})})]})]})})]})}function pm(){const{t:s}=V();return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx("div",{className:"flex items-center",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:s("dashboard:title")})}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Xe,{}),e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsx(Ae,{children:e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid gap-6",children:[e.jsx(cm,{}),e.jsx(nm,{}),e.jsx(dm,{}),e.jsx(hm,{})]})})})]})}const gm=Object.freeze(Object.defineProperty({__proto__:null,default:pm},Symbol.toStringTag,{value:"Module"}));function fm({className:s,items:a,...t}){const{pathname:l}=un(),n=Rs(),[r,o]=m.useState(l??"/settings"),c=i=>{o(i),n(i)},{t:u}=V("settings");return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-1 md:hidden",children:e.jsxs(J,{value:r,onValueChange:c,children:[e.jsx(W,{className:"h-12 sm:w-48",children:e.jsx(Q,{placeholder:"Theme"})}),e.jsx(Y,{children:a.map(i=>e.jsx(A,{value:i.href,children:e.jsxs("div",{className:"flex gap-x-4 px-2 py-1",children:[e.jsx("span",{className:"scale-125",children:i.icon}),e.jsx("span",{className:"text-md",children:u(i.title)})]})},i.href))})]})}),e.jsx("div",{className:"hidden w-full overflow-x-auto bg-background px-1 py-2 md:block",children:e.jsx("nav",{className:y("flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1",s),...t,children:a.map(i=>e.jsxs(nt,{to:i.href,className:y(St({variant:"ghost"}),l===i.href?"bg-muted hover:bg-muted":"hover:bg-transparent hover:underline","justify-start"),children:[e.jsx("span",{className:"mr-2",children:i.icon}),u(i.title)]},i.href))})})]})}const jm=[{title:"site.title",key:"site",icon:e.jsx(gc,{size:18}),href:"/config/system",description:"site.description"},{title:"safe.title",key:"safe",icon:e.jsx(Il,{size:18}),href:"/config/system/safe",description:"safe.description"},{title:"subscribe.title",key:"subscribe",icon:e.jsx(Rl,{size:18}),href:"/config/system/subscribe",description:"subscribe.description"},{title:"invite.title",key:"invite",icon:e.jsx(fc,{size:18}),href:"/config/system/invite",description:"invite.description"},{title:"server.title",key:"server",icon:e.jsx(El,{size:18}),href:"/config/system/server",description:"server.description"},{title:"email.title",key:"email",icon:e.jsx(jc,{size:18}),href:"/config/system/email",description:"email.description"},{title:"telegram.title",key:"telegram",icon:e.jsx(vc,{size:18}),href:"/config/system/telegram",description:"telegram.description"},{title:"app.title",key:"app",icon:e.jsx(Ll,{size:18}),href:"/config/system/app",description:"app.description"},{title:"subscribe_template.title",key:"subscribe_template",icon:e.jsx(bc,{size:18}),href:"/config/system/subscribe-template",description:"subscribe_template.description"}];function vm(){const{t:s}=V("settings");return e.jsxs(Ve,{fadedBelow:!0,fixedHeight:!0,children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:s("title")}),e.jsx("div",{className:"text-muted-foreground",children:s("description")})]}),e.jsx(De,{className:"my-6"}),e.jsxs("div",{className:"flex flex-1 flex-col space-y-8 overflow-auto lg:flex-row lg:space-x-12 lg:space-y-0",children:[e.jsx("aside",{className:"sticky top-0 lg:w-1/5",children:e.jsx(fm,{items:jm})}),e.jsx("div",{className:"flex-1 w-full p-1 pr-4",children:e.jsx("div",{className:"pb-16",children:e.jsx(xn,{})})})]})]})]})}const bm=Object.freeze(Object.defineProperty({__proto__:null,default:vm},Symbol.toStringTag,{value:"Module"})),Z=m.forwardRef(({className:s,...a},t)=>e.jsx(er,{className:y("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",s),...a,ref:t,children:e.jsx(yc,{className:y("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Z.displayName=er.displayName;const ks=m.forwardRef(({className:s,...a},t)=>e.jsx("textarea",{className:y("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...a}));ks.displayName="Textarea";const ym=x.object({logo:x.string().nullable().default(""),force_https:x.number().nullable().default(0),stop_register:x.number().nullable().default(0),app_name:x.string().nullable().default(""),app_description:x.string().nullable().default(""),app_url:x.string().nullable().default(""),subscribe_url:x.string().nullable().default(""),try_out_plan_id:x.number().nullable().default(0),try_out_hour:x.coerce.number().nullable().default(0),tos_url:x.string().nullable().default(""),currency:x.string().nullable().default(""),currency_symbol:x.string().nullable().default("")});function Nm(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),{data:n}=le({queryKey:["settings","site"],queryFn:()=>ce.getSettings("site")}),{data:r}=le({queryKey:["plans"],queryFn:()=>ss.getList()}),o=Ne({resolver:we(ym),defaultValues:{},mode:"onBlur"}),{mutateAsync:c}=fs({mutationFn:ce.saveSettings,onSuccess:d=>{d.data&&$.success(s("common.autoSaved"))}});m.useEffect(()=>{if(n?.data?.site){const d=n?.data?.site;Object.entries(d).forEach(([h,k])=>{o.setValue(h,k)}),l.current=d}},[n]);const u=m.useCallback(ke.debounce(async d=>{if(!ke.isEqual(d,l.current)){t(!0);try{const h=Object.entries(d).reduce((k,[C,S])=>(k[C]=S===null?"":S,k),{});await c(h),l.current=d}finally{t(!1)}}},1e3),[c]),i=m.useCallback(d=>{u(d)},[u]);return m.useEffect(()=>{const d=o.watch(h=>{i(h)});return()=>d.unsubscribe()},[o.watch,i]),e.jsx(Ce,{...o,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:o.control,name:"app_name",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteName.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.siteName.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.siteName.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"app_description",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteDescription.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.siteDescription.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.siteDescription.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"app_url",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.siteUrl.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.siteUrl.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.siteUrl.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"force_https",render:({field:d})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("site.form.forceHttps.label")}),e.jsx(M,{children:s("site.form.forceHttps.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:!!d.value,onCheckedChange:h=>{d.onChange(Number(h)),i(o.getValues())}})})]})}),e.jsx(v,{control:o.control,name:"logo",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.logo.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.logo.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.logo.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"subscribe_url",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.subscribeUrl.label")}),e.jsx(b,{children:e.jsx(ks,{placeholder:s("site.form.subscribeUrl.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.subscribeUrl.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"tos_url",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.tosUrl.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.tosUrl.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.tosUrl.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"stop_register",render:({field:d})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("site.form.stopRegister.label")}),e.jsx(M,{children:s("site.form.stopRegister.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:!!d.value,onCheckedChange:h=>{d.onChange(Number(h)),i(o.getValues())}})})]})}),e.jsx(v,{control:o.control,name:"try_out_plan_id",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.tryOut.label")}),e.jsx(b,{children:e.jsxs(J,{value:d.value?.toString(),onValueChange:h=>{d.onChange(Number(h)),i(o.getValues())},children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("site.form.tryOut.placeholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("site.form.tryOut.placeholder")}),r?.data?.map(h=>e.jsx(A,{value:h.id.toString(),children:h.name},h.id.toString()))]})]})}),e.jsx(M,{children:s("site.form.tryOut.description")}),e.jsx(P,{})]})}),!!o.watch("try_out_plan_id")&&e.jsx(v,{control:o.control,name:"try_out_hour",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"",children:s("site.form.tryOut.duration.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.tryOut.duration.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.tryOut.duration.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"currency",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.currency.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.currency.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.currency.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:o.control,name:"currency_symbol",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("site.form.currencySymbol.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("site.form.currencySymbol.placeholder"),...d,value:d.value||"",onChange:h=>{d.onChange(h),i(o.getValues())}})}),e.jsx(M,{children:s("site.form.currencySymbol.description")}),e.jsx(P,{})]})}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("site.form.saving")})]})})}function _m(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("site.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("site.description")})]}),e.jsx(De,{}),e.jsx(Nm,{})]})}const wm=Object.freeze(Object.defineProperty({__proto__:null,default:_m},Symbol.toStringTag,{value:"Module"})),Cm=x.object({email_verify:x.boolean().nullable(),safe_mode_enable:x.boolean().nullable(),secure_path:x.string().nullable(),email_whitelist_enable:x.boolean().nullable(),email_whitelist_suffix:x.array(x.string().nullable()).nullable(),email_gmail_limit_enable:x.boolean().nullable(),recaptcha_enable:x.boolean().nullable(),recaptcha_key:x.string().nullable(),recaptcha_site_key:x.string().nullable(),register_limit_by_ip_enable:x.boolean().nullable(),register_limit_count:x.coerce.string().transform(s=>s===""?null:s).nullable(),register_limit_expire:x.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_enable:x.boolean().nullable(),password_limit_count:x.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_expire:x.coerce.string().transform(s=>s===""?null:s).nullable()}),Sm={email_verify:!1,safe_mode_enable:!1,secure_path:"",email_whitelist_enable:!1,email_whitelist_suffix:[],email_gmail_limit_enable:!1,recaptcha_enable:!1,recaptcha_key:"",recaptcha_site_key:"",register_limit_by_ip_enable:!1,register_limit_count:"",register_limit_expire:"",password_limit_enable:!1,password_limit_count:"",password_limit_expire:""};function km(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(Cm),defaultValues:Sm,mode:"onBlur"}),{data:r}=le({queryKey:["settings","safe"],queryFn:()=>ce.getSettings("safe")}),{mutateAsync:o}=fs({mutationFn:ce.saveSettings,onSuccess:i=>{i.data&&$.success(s("common.autoSaved"))}});m.useEffect(()=>{if(r?.data.safe){const i=r.data.safe;Object.entries(i).forEach(([d,h])=>{typeof h=="number"?n.setValue(d,String(h)):n.setValue(d,h)}),l.current=i}},[r]);const c=m.useCallback(ke.debounce(async i=>{if(!ke.isEqual(i,l.current)){t(!0);try{await o(i),l.current=i}finally{t(!1)}}},1e3),[o]),u=m.useCallback(i=>{c(i)},[c]);return m.useEffect(()=>{const i=n.watch(d=>{u(d)});return()=>i.unsubscribe()},[n.watch,u]),e.jsx(Ce,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:n.control,name:"email_verify",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailVerify.label")}),e.jsx(M,{children:s("safe.form.emailVerify.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"email_gmail_limit_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.gmailLimit.label")}),e.jsx(M,{children:s("safe.form.gmailLimit.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"safe_mode_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.safeMode.label")}),e.jsx(M,{children:s("safe.form.safeMode.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"secure_path",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.securePath.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.securePath.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.securePath.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"email_whitelist_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailWhitelist.label")}),e.jsx(M,{children:s("safe.form.emailWhitelist.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),n.watch("email_whitelist_enable")&&e.jsx(v,{control:n.control,name:"email_whitelist_suffix",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.emailWhitelist.suffixes.label")}),e.jsx(b,{children:e.jsx(ks,{placeholder:s("safe.form.emailWhitelist.suffixes.placeholder"),...i,value:(i.value||[]).join(` `),onChange:d=>{const h=d.target.value.split(` -`).filter(Boolean);i.onChange(h),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.emailWhitelist.suffixes.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"recaptcha_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.enable.label")}),e.jsx(M,{children:s("safe.form.recaptcha.enable.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),n.watch("recaptcha_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:n.control,name:"recaptcha_site_key",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.siteKey.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.recaptcha.siteKey.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.recaptcha.siteKey.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"recaptcha_key",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.key.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.recaptcha.key.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.recaptcha.key.description")}),e.jsx(P,{})]})})]}),e.jsx(v,{control:n.control,name:"register_limit_by_ip_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.enable.label")}),e.jsx(M,{children:s("safe.form.registerLimit.enable.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),n.watch("register_limit_by_ip_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:n.control,name:"register_limit_count",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.count.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.registerLimit.count.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.registerLimit.count.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"register_limit_expire",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.expire.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.registerLimit.expire.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.registerLimit.expire.description")}),e.jsx(P,{})]})})]}),e.jsx(v,{control:n.control,name:"password_limit_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.enable.label")}),e.jsx(M,{children:s("safe.form.passwordLimit.enable.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),n.watch("password_limit_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:n.control,name:"password_limit_count",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.count.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.passwordLimit.count.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.passwordLimit.count.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"password_limit_expire",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.expire.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.passwordLimit.expire.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.passwordLimit.expire.description")}),e.jsx(P,{})]})})]}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("safe.form.saving")})]})})}function km(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("safe.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("safe.description")})]}),e.jsx(De,{}),e.jsx(Sm,{})]})}const Tm=Object.freeze(Object.defineProperty({__proto__:null,default:km},Symbol.toStringTag,{value:"Module"})),Dm=x.object({plan_change_enable:x.boolean().nullable().default(!1),reset_traffic_method:x.coerce.number().nullable().default(0),surplus_enable:x.boolean().nullable().default(!1),new_order_event_id:x.coerce.number().nullable().default(0),renew_order_event_id:x.coerce.number().nullable().default(0),change_order_event_id:x.coerce.number().nullable().default(0),show_info_to_server_enable:x.boolean().nullable().default(!1),show_protocol_to_server_enable:x.boolean().nullable().default(!1),default_remind_expire:x.boolean().nullable().default(!1),default_remind_traffic:x.boolean().nullable().default(!1),subscribe_path:x.string().nullable().default("s")}),Pm={plan_change_enable:!1,reset_traffic_method:0,surplus_enable:!1,new_order_event_id:0,renew_order_event_id:0,change_order_event_id:0,show_info_to_server_enable:!1,show_protocol_to_server_enable:!1,default_remind_expire:!1,default_remind_traffic:!1,subscribe_path:"s"};function Lm(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(Dm),defaultValues:Pm,mode:"onBlur"}),{data:r}=le({queryKey:["settings","subscribe"],queryFn:()=>oe.getSettings("subscribe")}),{mutateAsync:o}=fs({mutationFn:oe.saveSettings,onSuccess:i=>{i.data&&$.success(s("common.autoSaved"))}});m.useEffect(()=>{if(r?.data?.subscribe){const i=r?.data?.subscribe;Object.entries(i).forEach(([d,h])=>{n.setValue(d,h)}),l.current=i}},[r]);const c=m.useCallback(ke.debounce(async i=>{if(!ke.isEqual(i,l.current)){t(!0);try{await o(i),l.current=i}finally{t(!1)}}},1e3),[o]),u=m.useCallback(i=>{c(i)},[c]);return m.useEffect(()=>{const i=n.watch(d=>{u(d)});return()=>i.unsubscribe()},[n.watch,u]),e.jsx(Ce,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:n.control,name:"plan_change_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.plan_change_enable.title")}),e.jsx(M,{children:s("subscribe.plan_change_enable.description")}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"reset_traffic_method",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.reset_traffic_method.title")}),e.jsxs(J,{onValueChange:i.onChange,value:i.value?.toString()||"0",children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择重置方式"})})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("subscribe.reset_traffic_method.options.monthly_first")}),e.jsx(A,{value:"1",children:s("subscribe.reset_traffic_method.options.monthly_reset")}),e.jsx(A,{value:"2",children:s("subscribe.reset_traffic_method.options.no_reset")}),e.jsx(A,{value:"3",children:s("subscribe.reset_traffic_method.options.yearly_first")}),e.jsx(A,{value:"4",children:s("subscribe.reset_traffic_method.options.yearly_reset")})]})]}),e.jsx(M,{children:s("subscribe.reset_traffic_method.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"surplus_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.surplus_enable.title")}),e.jsx(M,{children:s("subscribe.surplus_enable.description")}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"new_order_event_id",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.new_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(b,{children:e.jsxs(J,{onValueChange:i.onChange,value:i.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("subscribe.new_order_event.options.no_action")}),e.jsx(A,{value:"1",children:s("subscribe.new_order_event.options.reset_traffic")})]})]})})}),e.jsx(M,{children:s("subscribe.new_order_event.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"renew_order_event_id",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.renew_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(b,{children:e.jsxs(J,{onValueChange:i.onChange,value:i.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("subscribe.renew_order_event.options.no_action")}),e.jsx(A,{value:"1",children:s("subscribe.renew_order_event.options.reset_traffic")})]})]})})}),e.jsx(M,{children:s("subscribe.renew_order_event.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"change_order_event_id",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.change_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(b,{children:e.jsxs(J,{onValueChange:i.onChange,value:i.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("subscribe.change_order_event.options.no_action")}),e.jsx(A,{value:"1",children:s("subscribe.change_order_event.options.reset_traffic")})]})]})})}),e.jsx(M,{children:s("subscribe.change_order_event.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"subscribe_path",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.subscribe_path.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:"subscribe",...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[s("subscribe.subscribe_path.description"),e.jsx("br",{}),s("subscribe.subscribe_path.current_format",{path:i.value||"s"})]}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"show_info_to_server_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("subscribe.show_info_to_server.title")}),e.jsx(M,{children:s("subscribe.show_info_to_server.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"show_protocol_to_server_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("subscribe.show_protocol_to_server.title")}),e.jsx(M,{children:s("subscribe.show_protocol_to_server.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function Em(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("subscribe.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("subscribe.description")})]}),e.jsx(De,{}),e.jsx(Lm,{})]})}const Im=Object.freeze(Object.defineProperty({__proto__:null,default:Em},Symbol.toStringTag,{value:"Module"})),Rm=x.object({invite_force:x.boolean().default(!1),invite_commission:x.coerce.string().default("0"),invite_gen_limit:x.coerce.string().default("0"),invite_never_expire:x.boolean().default(!1),commission_first_time_enable:x.boolean().default(!1),commission_auto_check_enable:x.boolean().default(!1),commission_withdraw_limit:x.coerce.string().default("0"),commission_withdraw_method:x.array(x.string()).default(["支付宝","USDT","Paypal"]),withdraw_close_enable:x.boolean().default(!1),commission_distribution_enable:x.boolean().default(!1),commission_distribution_l1:x.coerce.number().default(0),commission_distribution_l2:x.coerce.number().default(0),commission_distribution_l3:x.coerce.number().default(0)}),Vm={invite_force:!1,invite_commission:"0",invite_gen_limit:"0",invite_never_expire:!1,commission_first_time_enable:!1,commission_auto_check_enable:!1,commission_withdraw_limit:"0",commission_withdraw_method:["支付宝","USDT","Paypal"],withdraw_close_enable:!1,commission_distribution_enable:!1,commission_distribution_l1:0,commission_distribution_l2:0,commission_distribution_l3:0};function Fm(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(Rm),defaultValues:Vm,mode:"onBlur"}),{data:r}=le({queryKey:["settings","invite"],queryFn:()=>oe.getSettings("invite")}),{mutateAsync:o}=fs({mutationFn:oe.saveSettings,onSuccess:i=>{i.data&&$.success(s("common.autoSaved"))}});m.useEffect(()=>{if(r?.data?.invite){const i=r?.data?.invite;Object.entries(i).forEach(([d,h])=>{typeof h=="number"?n.setValue(d,String(h)):n.setValue(d,h)}),l.current=i}},[r]);const c=m.useCallback(ke.debounce(async i=>{if(!ke.isEqual(i,l.current)){t(!0);try{await o(i),l.current=i}finally{t(!1)}}},1e3),[o]),u=m.useCallback(i=>{c(i)},[c]);return m.useEffect(()=>{const i=n.watch(d=>{u(d)});return()=>i.unsubscribe()},[n.watch,u]),e.jsx(Ce,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:n.control,name:"invite_force",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.invite_force.title")}),e.jsx(M,{children:s("invite.invite_force.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"invite_commission",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("invite.invite_commission.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("invite.invite_commission.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("invite.invite_commission.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"invite_gen_limit",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("invite.invite_gen_limit.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("invite.invite_gen_limit.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("invite.invite_gen_limit.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"invite_never_expire",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.invite_never_expire.title")}),e.jsx(M,{children:s("invite.invite_never_expire.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"commission_first_time_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_first_time.title")}),e.jsx(M,{children:s("invite.commission_first_time.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"commission_auto_check_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_auto_check.title")}),e.jsx(M,{children:s("invite.commission_auto_check.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"commission_withdraw_limit",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("invite.commission_withdraw_limit.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("invite.commission_withdraw_limit.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("invite.commission_withdraw_limit.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"commission_withdraw_method",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("invite.commission_withdraw_method.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("invite.commission_withdraw_method.placeholder"),...i,value:Array.isArray(i.value)?i.value.join(","):"",onChange:d=>{const h=d.target.value.split(",").filter(Boolean);i.onChange(h),u(n.getValues())}})}),e.jsx(M,{children:s("invite.commission_withdraw_method.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"withdraw_close_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.withdraw_close.title")}),e.jsx(M,{children:s("invite.withdraw_close.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"commission_distribution_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_distribution.title")}),e.jsx(M,{children:s("invite.commission_distribution.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),n.watch("commission_distribution_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:n.control,name:"commission_distribution_l1",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:s("invite.commission_distribution.l1")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...i,value:i.value||"",onChange:d=>{const h=d.target.value?Number(d.target.value):0;i.onChange(h),u(n.getValues())}})}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"commission_distribution_l2",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:s("invite.commission_distribution.l2")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...i,value:i.value||"",onChange:d=>{const h=d.target.value?Number(d.target.value):0;i.onChange(h),u(n.getValues())}})}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"commission_distribution_l3",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:s("invite.commission_distribution.l3")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...i,value:i.value||"",onChange:d=>{const h=d.target.value?Number(d.target.value):0;i.onChange(h),u(n.getValues())}})}),e.jsx(P,{})]})})]}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("invite.saving")})]})})}function Mm(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("invite.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("invite.description")})]}),e.jsx(De,{}),e.jsx(Fm,{})]})}const Om=Object.freeze(Object.defineProperty({__proto__:null,default:Mm},Symbol.toStringTag,{value:"Module"})),zm=x.object({frontend_theme:x.string().nullable(),frontend_theme_sidebar:x.string().nullable(),frontend_theme_header:x.string().nullable(),frontend_theme_color:x.string().nullable(),frontend_background_url:x.string().url().nullable()}),$m={frontend_theme:"",frontend_theme_sidebar:"",frontend_theme_header:"",frontend_theme_color:"",frontend_background_url:""};function Am(){const{data:s}=le({queryKey:["settings","frontend"],queryFn:()=>oe.getSettings("frontend")}),a=Ne({resolver:we(zm),defaultValues:$m,mode:"onChange"});m.useEffect(()=>{if(s?.data?.frontend){const l=s?.data?.frontend;Object.entries(l).forEach(([n,r])=>{a.setValue(n,r)})}},[s]);function t(l){oe.saveSettings(l).then(({data:n})=>{n&&$.success("更新成功")})}return e.jsx(Ce,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(t),className:"space-y-8",children:[e.jsx(v,{control:a.control,name:"frontend_theme_sidebar",render:({field:l})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:"边栏风格"}),e.jsx(M,{children:"边栏风格"})]}),e.jsx(b,{children:e.jsx(Z,{checked:l.value,onCheckedChange:l.onChange})})]})}),e.jsx(v,{control:a.control,name:"frontend_theme_header",render:({field:l})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:"头部风格"}),e.jsx(M,{children:"边栏风格"})]}),e.jsx(b,{children:e.jsx(Z,{checked:l.value,onCheckedChange:l.onChange})})]})}),e.jsx(v,{control:a.control,name:"frontend_theme_color",render:({field:l})=>e.jsxs(f,{children:[e.jsx(j,{children:"主题色"}),e.jsxs("div",{className:"relative w-max",children:[e.jsx(b,{children:e.jsxs("select",{className:y(St({variant:"outline"}),"w-[200px] appearance-none font-normal"),...l,children:[e.jsx("option",{value:"default",children:"默认"}),e.jsx("option",{value:"black",children:"黑色"}),e.jsx("option",{value:"blackblue",children:"暗蓝色"}),e.jsx("option",{value:"green",children:"奶绿色"})]})}),e.jsx(jn,{className:"absolute right-3 top-2.5 h-4 w-4 opacity-50"})]}),e.jsx(M,{children:"主题色"}),e.jsx(P,{})]})}),e.jsx(v,{control:a.control,name:"frontend_background_url",render:({field:l})=>e.jsxs(f,{children:[e.jsx(j,{children:"背景"}),e.jsx(b,{children:e.jsx(D,{placeholder:"请输入图片地址",...l})}),e.jsx(M,{children:"将会在后台登录页面进行展示。"}),e.jsx(P,{})]})}),e.jsx(L,{type:"submit",children:"保存设置"})]})})}function qm(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"个性化设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"自定义系统界面外观,包括主题风格、布局、颜色方案、背景图等个性化选项。"})]}),e.jsx(De,{}),e.jsx(Am,{})]})}const Hm=Object.freeze(Object.defineProperty({__proto__:null,default:qm},Symbol.toStringTag,{value:"Module"})),Um=x.object({server_pull_interval:x.coerce.number().nullable(),server_push_interval:x.coerce.number().nullable(),server_token:x.string().nullable(),device_limit_mode:x.coerce.number().nullable()}),Km={server_pull_interval:0,server_push_interval:0,server_token:"",device_limit_mode:0};function Bm(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(Um),defaultValues:Km,mode:"onBlur"}),{data:r}=le({queryKey:["settings","server"],queryFn:()=>oe.getSettings("server")}),{mutateAsync:o}=fs({mutationFn:oe.saveSettings,onSuccess:d=>{d.data&&$.success(s("common.AutoSaved"))}});m.useEffect(()=>{if(r?.data.server){const d=r.data.server;Object.entries(d).forEach(([h,k])=>{n.setValue(h,k)}),l.current=d}},[r]);const c=m.useCallback(ke.debounce(async d=>{if(!ke.isEqual(d,l.current)){t(!0);try{await o(d),l.current=d}finally{t(!1)}}},1e3),[o]),u=m.useCallback(d=>{c(d)},[c]);m.useEffect(()=>{const d=n.watch(h=>{u(h)});return()=>d.unsubscribe()},[n.watch,u]);const i=()=>{const d=Math.floor(Math.random()*17)+16,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let k="";for(let C=0;Ce.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("server.server_token.title")}),e.jsx(b,{children:e.jsxs("div",{className:"relative",children:[e.jsx(D,{placeholder:s("server.server_token.placeholder"),...d,value:d.value||"",className:"pr-10"}),e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx(K,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2",onClick:h=>{h.preventDefault(),i()},children:e.jsx(Nc,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"})})}),e.jsx(xe,{children:e.jsx("p",{children:s("server.server_token.generate_tooltip")})})]})})]})}),e.jsx(M,{children:s("server.server_token.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"server_pull_interval",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("server.server_pull_interval.title")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("server.server_pull_interval.placeholder"),...d,value:d.value||"",onChange:h=>{const k=h.target.value?Number(h.target.value):null;d.onChange(k)}})}),e.jsx(M,{children:s("server.server_pull_interval.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"server_push_interval",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("server.server_push_interval.title")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("server.server_push_interval.placeholder"),...d,value:d.value||"",onChange:h=>{const k=h.target.value?Number(h.target.value):null;d.onChange(k)}})}),e.jsx(M,{children:s("server.server_push_interval.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"device_limit_mode",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("server.device_limit_mode.title")}),e.jsxs(J,{onValueChange:d.onChange,value:d.value?.toString()||"0",children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:s("server.device_limit_mode.placeholder")})})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("server.device_limit_mode.strict")}),e.jsx(A,{value:"1",children:s("server.device_limit_mode.relaxed")})]})]}),e.jsx(M,{children:s("server.device_limit_mode.description")}),e.jsx(P,{})]})}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("server.saving")})]})})}function Gm(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("server.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("server.description")})]}),e.jsx(De,{}),e.jsx(Bm,{})]})}const Wm=Object.freeze(Object.defineProperty({__proto__:null,default:Gm},Symbol.toStringTag,{value:"Module"}));function Ym({open:s,onOpenChange:a,result:t}){const l=!t.error;return e.jsx(he,{open:s,onOpenChange:a,children:e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(je,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l?e.jsx(Xl,{className:"h-5 w-5 text-green-500"}):e.jsx(Zl,{className:"h-5 w-5 text-destructive"}),e.jsx(pe,{children:l?"邮件发送成功":"邮件发送失败"})]}),e.jsx(Re,{children:l?"测试邮件已成功发送,请检查收件箱":"发送测试邮件时遇到错误"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"发送详情"}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2 text-sm",children:[e.jsx("div",{className:"text-muted-foreground",children:"收件地址"}),e.jsx("div",{children:t.email}),e.jsx("div",{className:"text-muted-foreground",children:"邮件主题"}),e.jsx("div",{children:t.subject}),e.jsx("div",{className:"text-muted-foreground",children:"模板名称"}),e.jsx("div",{children:t.template_name})]})]}),t.error&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium text-destructive",children:"错误信息"}),e.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive break-all",children:t.error})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"配置信息"}),e.jsx(_t,{className:"h-[200px] rounded-md border p-4",children:e.jsx("div",{className:"grid gap-2 text-sm",children:e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2",children:[e.jsx("div",{className:"text-muted-foreground",children:"驱动"}),e.jsx("div",{children:t.config.driver}),e.jsx("div",{className:"text-muted-foreground",children:"服务器"}),e.jsx("div",{children:t.config.host}),e.jsx("div",{className:"text-muted-foreground",children:"端口"}),e.jsx("div",{children:t.config.port}),e.jsx("div",{className:"text-muted-foreground",children:"加密方式"}),e.jsx("div",{children:t.config.encryption||"无"}),e.jsx("div",{className:"text-muted-foreground",children:"发件人"}),e.jsx("div",{children:t.config.from.address?`${t.config.from.address}${t.config.from.name?` (${t.config.from.name})`:""}`:"未设置"}),e.jsx("div",{className:"text-muted-foreground",children:"用户名"}),e.jsx("div",{children:t.config.username||"未设置"})]})})})]})]})]})})}const Jm=x.object({email_template:x.string().nullable().default("classic"),email_host:x.string().nullable().default(""),email_port:x.coerce.number().nullable().default(465),email_username:x.string().nullable().default(""),email_password:x.string().nullable().default(""),email_encryption:x.string().nullable().default(""),email_from_address:x.string().email().nullable().default(""),remind_mail_enable:x.boolean().nullable().default(!1)});function Qm(){const{t:s}=V("settings"),[a,t]=m.useState(null),[l,n]=m.useState(!1),r=m.useRef(null),[o,c]=m.useState(!1),u=Ne({resolver:we(Jm),defaultValues:{},mode:"onBlur"}),{data:i}=le({queryKey:["settings","email"],queryFn:()=>oe.getSettings("email")}),{data:d}=le({queryKey:["emailTemplate"],queryFn:()=>oe.getEmailTemplate()}),{mutateAsync:h}=fs({mutationFn:oe.saveSettings,onSuccess:N=>{N.data&&$.success(s("common.autoSaved"))}}),{mutate:k,isPending:C}=fs({mutationFn:oe.sendTestMail,onMutate:()=>{t(null),n(!1)},onSuccess:N=>{t(N.data),n(!0),N.data.error?$.error(s("email.test.error")):$.success(s("email.test.success"))}});m.useEffect(()=>{if(i?.data.email){const N=i.data.email;Object.entries(N).forEach(([g,T])=>{u.setValue(g,T)}),r.current=N}},[i]);const S=m.useCallback(ke.debounce(async N=>{if(!ke.isEqual(N,r.current)){c(!0);try{await h(N),r.current=N}finally{c(!1)}}},1e3),[h]),w=m.useCallback(N=>{S(N)},[S]);return m.useEffect(()=>{const N=u.watch(g=>{w(g)});return()=>N.unsubscribe()},[u.watch,w]),e.jsxs(e.Fragment,{children:[e.jsx(Ce,{...u,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:u.control,name:"email_host",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_host.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(M,{children:s("email.email_host.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_port",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_port.title")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("common.placeholder"),...N,value:N.value||"",onChange:g=>{const T=g.target.value?Number(g.target.value):null;N.onChange(T)}})}),e.jsx(M,{children:s("email.email_port.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_encryption",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_encryption.title")}),e.jsxs(J,{onValueChange:g=>{const T=g==="none"?"":g;N.onChange(T)},value:N.value===""||N.value===null||N.value===void 0?"none":N.value,children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择加密方式"})})}),e.jsxs(Y,{children:[e.jsx(A,{value:"none",children:s("email.email_encryption.none")}),e.jsx(A,{value:"ssl",children:s("email.email_encryption.ssl")}),e.jsx(A,{value:"tls",children:s("email.email_encryption.tls")})]})]}),e.jsx(M,{children:s("email.email_encryption.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_username",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_username.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(M,{children:s("email.email_username.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_password",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_password.title")}),e.jsx(b,{children:e.jsx(D,{type:"password",placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(M,{children:s("email.email_password.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_from_address",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_from.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(M,{children:s("email.email_from.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_template",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_template.title")}),e.jsxs(J,{onValueChange:g=>{N.onChange(g),w(u.getValues())},value:N.value||void 0,children:[e.jsx(b,{children:e.jsx(W,{className:"w-[200px]",children:e.jsx(Q,{placeholder:s("email.email_template.placeholder")})})}),e.jsx(Y,{children:d?.data?.map(g=>e.jsx(A,{value:g,children:g},g))})]}),e.jsx(M,{children:s("email.email_template.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"remind_mail_enable",render:({field:N})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("email.remind_mail.title")}),e.jsx(M,{children:s("email.remind_mail.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:N.value||!1,onCheckedChange:g=>{N.onChange(g),w(u.getValues())}})})]})}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(L,{onClick:()=>k(),loading:C,disabled:C,children:s(C?"email.test.sending":"email.test.title")})})]})}),o&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("saving")}),a&&e.jsx(Ym,{open:l,onOpenChange:n,result:a})]})}function Xm(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("email.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("email.description")})]}),e.jsx(De,{}),e.jsx(Qm,{})]})}const Zm=Object.freeze(Object.defineProperty({__proto__:null,default:Xm},Symbol.toStringTag,{value:"Module"})),eu=x.object({telegram_bot_enable:x.boolean().nullable(),telegram_bot_token:x.string().nullable(),telegram_discuss_link:x.string().nullable()}),su={telegram_bot_enable:!1,telegram_bot_token:"",telegram_discuss_link:""};function tu(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(eu),defaultValues:su,mode:"onBlur"}),{data:r}=le({queryKey:["settings","telegram"],queryFn:()=>oe.getSettings("telegram")}),{mutateAsync:o}=fs({mutationFn:oe.saveSettings,onSuccess:h=>{h.data&&$.success(s("common.autoSaved"))}}),{mutate:c,isPending:u}=fs({mutationFn:oe.setTelegramWebhook,onSuccess:h=>{h.data&&$.success(s("telegram.webhook.success"))}});m.useEffect(()=>{if(r?.data.telegram){const h=r.data.telegram;Object.entries(h).forEach(([k,C])=>{n.setValue(k,C)}),l.current=h}},[r]);const i=m.useCallback(ke.debounce(async h=>{if(!ke.isEqual(h,l.current)){t(!0);try{await o(h),l.current=h}finally{t(!1)}}},1e3),[o]),d=m.useCallback(h=>{i(h)},[i]);return m.useEffect(()=>{const h=n.watch(k=>{d(k)});return()=>h.unsubscribe()},[n.watch,d]),e.jsx(Ce,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:n.control,name:"telegram_bot_token",render:({field:h})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("telegram.bot_token.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("telegram.bot_token.placeholder"),...h,value:h.value||""})}),e.jsx(M,{children:s("telegram.bot_token.description")}),e.jsx(P,{})]})}),n.watch("telegram_bot_token")&&e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("telegram.webhook.title")}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(L,{loading:u,disabled:u,onClick:()=>c(),children:s(u?"telegram.webhook.setting":"telegram.webhook.button")}),a&&e.jsx("span",{className:"text-sm text-muted-foreground",children:s("common.saving")})]}),e.jsx(M,{children:s("telegram.webhook.description")}),e.jsx(P,{})]}),e.jsx(v,{control:n.control,name:"telegram_bot_enable",render:({field:h})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("telegram.bot_enable.title")}),e.jsx(M,{children:s("telegram.bot_enable.description")}),e.jsx(b,{children:e.jsx(Z,{checked:h.value||!1,onCheckedChange:k=>{h.onChange(k),d(n.getValues())}})}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"telegram_discuss_link",render:({field:h})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("telegram.discuss_link.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("telegram.discuss_link.placeholder"),...h,value:h.value||""})}),e.jsx(M,{children:s("telegram.discuss_link.description")}),e.jsx(P,{})]})}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function au(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("telegram.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("telegram.description")})]}),e.jsx(De,{}),e.jsx(tu,{})]})}const nu=Object.freeze(Object.defineProperty({__proto__:null,default:au},Symbol.toStringTag,{value:"Module"})),lu=x.object({windows_version:x.string().nullable(),windows_download_url:x.string().nullable(),macos_version:x.string().nullable(),macos_download_url:x.string().nullable(),android_version:x.string().nullable(),android_download_url:x.string().nullable()}),ru={windows_version:"",windows_download_url:"",macos_version:"",macos_download_url:"",android_version:"",android_download_url:""};function iu(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(lu),defaultValues:ru,mode:"onBlur"}),{data:r}=le({queryKey:["settings","app"],queryFn:()=>oe.getSettings("app")}),{mutateAsync:o}=fs({mutationFn:oe.saveSettings,onSuccess:i=>{i.data&&$.success(s("app.save_success"))}});m.useEffect(()=>{if(r?.data.app){const i=r.data.app;Object.entries(i).forEach(([d,h])=>{n.setValue(d,h)}),l.current=i}},[r]);const c=m.useCallback(ke.debounce(async i=>{if(!ke.isEqual(i,l.current)){t(!0);try{await o(i),l.current=i}finally{t(!1)}}},1e3),[o]),u=m.useCallback(i=>{c(i)},[c]);return m.useEffect(()=>{const i=n.watch(d=>{u(d)});return()=>i.unsubscribe()},[n.watch,u]),e.jsx(Ce,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:n.control,name:"windows_version",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.windows.version.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.windows.version.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"windows_download_url",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.windows.download.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.windows.download.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"macos_version",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.macos.version.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.macos.version.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"macos_download_url",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.macos.download.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.macos.download.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"android_version",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.android.version.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.android.version.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"android_download_url",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.android.download.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.android.download.description")}),e.jsx(P,{})]})}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function ou(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("app.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("app.description")})]}),e.jsx(De,{}),e.jsx(iu,{})]})}const cu=Object.freeze(Object.defineProperty({__proto__:null,default:ou},Symbol.toStringTag,{value:"Module"})),du=s=>x.object({id:x.number().nullable(),name:x.string().min(2,s("form.validation.name.min")).max(30,s("form.validation.name.max")),icon:x.string().optional().nullable(),notify_domain:x.string().refine(t=>!t||/^https?:\/\/\S+/.test(t),s("form.validation.notify_domain.url")).optional().nullable(),handling_fee_fixed:x.coerce.number().min(0).optional().nullable(),handling_fee_percent:x.coerce.number().min(0).max(100).optional().nullable(),payment:x.string().min(1,s("form.validation.payment.required")),config:x.record(x.string(),x.string())}),al={id:null,name:"",icon:"",notify_domain:"",handling_fee_fixed:0,handling_fee_percent:0,payment:"",config:{}};function Mr({refetch:s,dialogTrigger:a,type:t="add",defaultFormValues:l=al}){const{t:n}=V("payment"),[r,o]=m.useState(!1),[c,u]=m.useState(!1),[i,d]=m.useState([]),[h,k]=m.useState([]),C=du(n),S=Ne({resolver:we(C),defaultValues:l,mode:"onChange"}),w=S.watch("payment");m.useEffect(()=>{r&&(async()=>{const{data:T}=await et.getMethodList();d(T)})()},[r]),m.useEffect(()=>{if(!w||!r)return;(async()=>{const T={payment:w,...t==="edit"&&{id:Number(S.getValues("id"))}};et.getMethodForm(T).then(({data:E})=>{k(E);const p=E.reduce((_,I)=>(I.field_name&&(_[I.field_name]=I.value??""),_),{});S.setValue("config",p)})})()},[w,r,S,t]);const N=async g=>{u(!0);try{(await et.save(g)).data&&($.success(n("form.messages.success")),S.reset(al),s(),o(!1))}finally{u(!1)}};return e.jsxs(he,{open:r,onOpenChange:o,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"})," ",e.jsx("div",{children:n("form.add.button")})]})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsx(je,{children:e.jsx(pe,{children:n(t==="add"?"form.add.title":"form.edit.title")})}),e.jsx(Ce,{...S,children:e.jsxs("form",{onSubmit:S.handleSubmit(N),className:"space-y-4",children:[e.jsx(v,{control:S.control,name:"name",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:n("form.fields.name.placeholder"),...g})}),e.jsx(M,{children:n("form.fields.name.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:S.control,name:"icon",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.icon.label")}),e.jsx(b,{children:e.jsx(D,{...g,value:g.value||"",placeholder:n("form.fields.icon.placeholder")})}),e.jsx(M,{children:n("form.fields.icon.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:S.control,name:"notify_domain",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.notify_domain.label")}),e.jsx(b,{children:e.jsx(D,{...g,value:g.value||"",placeholder:n("form.fields.notify_domain.placeholder")})}),e.jsx(M,{children:n("form.fields.notify_domain.description")}),e.jsx(P,{})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(v,{control:S.control,name:"handling_fee_percent",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.handling_fee_percent.label")}),e.jsx(b,{children:e.jsx(D,{type:"number",...g,value:g.value||"",placeholder:n("form.fields.handling_fee_percent.placeholder")})}),e.jsx(P,{})]})}),e.jsx(v,{control:S.control,name:"handling_fee_fixed",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.handling_fee_fixed.label")}),e.jsx(b,{children:e.jsx(D,{type:"number",...g,value:g.value||"",placeholder:n("form.fields.handling_fee_fixed.placeholder")})}),e.jsx(P,{})]})})]}),e.jsx(v,{control:S.control,name:"payment",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.payment.label")}),e.jsxs(J,{onValueChange:g.onChange,defaultValue:g.value,children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:n("form.fields.payment.placeholder")})})}),e.jsx(Y,{children:i.map(T=>e.jsx(A,{value:T,children:T},T))})]}),e.jsx(M,{children:n("form.fields.payment.description")}),e.jsx(P,{})]})}),h.length>0&&e.jsx("div",{className:"space-y-4",children:h.map(g=>e.jsx(v,{control:S.control,name:`config.${g.field_name}`,render:({field:T})=>e.jsxs(f,{children:[e.jsx(j,{children:g.label}),e.jsx(b,{children:e.jsx(D,{...T,value:T.value||""})}),e.jsx(P,{})]})},g.field_name))}),e.jsxs(Le,{children:[e.jsx(qs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:n("form.buttons.cancel")})}),e.jsx(L,{type:"submit",disabled:c,children:n("form.buttons.submit")})]})]})})]})]})}function z({column:s,title:a,tooltip:t,className:l}){return s.getCanSort()?e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(L,{variant:"ghost",size:"default",className:y("-ml-3 flex h-8 items-center gap-2 text-nowrap font-medium hover:bg-muted/60",l),onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:[e.jsx("span",{children:a}),t&&e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx(Wn,{className:"h-4 w-4 cursor-pointer text-muted-foreground"})}),e.jsx(xe,{children:t})]})}),s.getIsSorted()==="asc"?e.jsx(tn,{className:"h-4 w-4 text-foreground/70"}):s.getIsSorted()==="desc"?e.jsx(an,{className:"h-4 w-4 text-foreground/70"}):e.jsx(_c,{className:"h-4 w-4 text-muted-foreground/70 transition-colors hover:text-foreground/70"})]})})}):e.jsxs("div",{className:y("flex items-center space-x-1 text-nowrap py-2 font-medium text-muted-foreground",l),children:[e.jsx("span",{children:a}),t&&e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{children:e.jsx(Wn,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(xe,{children:t})]})})]})}const kn=wc,Or=Cc,mu=Sc,zr=m.forwardRef(({className:s,...a},t)=>e.jsx(sr,{className:y("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",s),...a,ref:t}));zr.displayName=sr.displayName;const Ra=m.forwardRef(({className:s,...a},t)=>e.jsxs(mu,{children:[e.jsx(zr,{}),e.jsx(tr,{ref:t,className:y("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",s),...a})]}));Ra.displayName=tr.displayName;const Va=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col space-y-2 text-center sm:text-left",s),...a});Va.displayName="AlertDialogHeader";const Fa=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});Fa.displayName="AlertDialogFooter";const Ma=m.forwardRef(({className:s,...a},t)=>e.jsx(ar,{ref:t,className:y("text-lg font-semibold",s),...a}));Ma.displayName=ar.displayName;const Oa=m.forwardRef(({className:s,...a},t)=>e.jsx(nr,{ref:t,className:y("text-sm text-muted-foreground",s),...a}));Oa.displayName=nr.displayName;const za=m.forwardRef(({className:s,...a},t)=>e.jsx(lr,{ref:t,className:y(yt(),s),...a}));za.displayName=lr.displayName;const $a=m.forwardRef(({className:s,...a},t)=>e.jsx(rr,{ref:t,className:y(yt({variant:"outline"}),"mt-2 sm:mt-0",s),...a}));$a.displayName=rr.displayName;function ls({onConfirm:s,children:a,title:t="确认操作",description:l="确定要执行此操作吗?",cancelText:n="取消",confirmText:r="确认",variant:o="default",className:c}){return e.jsxs(kn,{children:[e.jsx(Or,{asChild:!0,children:a}),e.jsxs(Ra,{className:y("sm:max-w-[425px]",c),children:[e.jsxs(Va,{children:[e.jsx(Ma,{children:t}),e.jsx(Oa,{children:l})]}),e.jsxs(Fa,{children:[e.jsx($a,{asChild:!0,children:e.jsx(L,{variant:"outline",children:n})}),e.jsx(za,{asChild:!0,children:e.jsx(L,{variant:o,onClick:s,children:r})})]})]})]})}const $r=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M11.29 15.29a2 2 0 0 0-.12.15a.8.8 0 0 0-.09.18a.6.6 0 0 0-.06.18a1.4 1.4 0 0 0 0 .2a.84.84 0 0 0 .08.38a.9.9 0 0 0 .54.54a.94.94 0 0 0 .76 0a.9.9 0 0 0 .54-.54A1 1 0 0 0 13 16a1 1 0 0 0-.29-.71a1 1 0 0 0-1.42 0M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8 8 0 0 1-8 8m0-13a3 3 0 0 0-2.6 1.5a1 1 0 1 0 1.73 1A1 1 0 0 1 12 9a1 1 0 0 1 0 2a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-.18A3 3 0 0 0 12 7"})}),uu=({refetch:s,isSortMode:a=!1})=>{const{t}=V("payment");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:a?"cursor-move":"opacity-0",children:e.jsx(Ta,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:l})=>e.jsx(z,{column:l,title:t("table.columns.id")}),cell:({row:l})=>e.jsx(G,{variant:"outline",children:l.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"enable",header:({column:l})=>e.jsx(z,{column:l,title:t("table.columns.enable")}),cell:({row:l})=>e.jsx(Z,{defaultChecked:l.getValue("enable"),onCheckedChange:async()=>{const{data:n}=await et.updateStatus({id:l.original.id});n||s()}}),enableSorting:!1,size:100},{accessorKey:"name",header:({column:l})=>e.jsx(z,{column:l,title:t("table.columns.name")}),cell:({row:l})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:l.getValue("name")})}),enableSorting:!1,size:200},{accessorKey:"payment",header:({column:l})=>e.jsx(z,{column:l,title:t("table.columns.payment")}),cell:({row:l})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:l.getValue("payment")})}),enableSorting:!1,size:200},{accessorKey:"notify_url",header:({column:l})=>e.jsxs("div",{className:"flex items-center",children:[e.jsx(z,{column:l,title:t("table.columns.notify_url")}),e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{className:"ml-1",children:e.jsx($r,{className:"h-4 w-4"})}),e.jsx(xe,{children:t("table.columns.notify_url_tooltip")})]})})]}),cell:({row:l})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[300px] truncate font-medium",children:l.getValue("notify_url")})}),enableSorting:!1,size:3e3},{id:"actions",header:({column:l})=>e.jsx(z,{className:"justify-end",column:l,title:t("table.columns.actions")}),cell:({row:l})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(Mr,{refetch:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:t("table.actions.edit")})]}),type:"edit",defaultFormValues:l.original}),e.jsx(ls,{title:t("table.actions.delete.title"),description:t("table.actions.delete.description"),onConfirm:async()=>{const{data:n}=await et.drop({id:l.original.id});n&&s()},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-destructive/10",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-destructive"}),e.jsx("span",{className:"sr-only",children:t("table.actions.delete.title")})]})})]}),size:100}]};function xu({table:s,refetch:a,saveOrder:t,isSortMode:l}){const{t:n}=V("payment"),r=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between",children:[l?e.jsx("p",{className:"text-sm text-muted-foreground",children:n("table.toolbar.sort.hint")}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Mr,{refetch:a}),e.jsx(D,{placeholder:n("table.toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:o=>s.getColumn("name")?.setFilterValue(o.target.value),className:"h-8 w-[250px]"}),r&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:[n("table.toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:l?"default":"outline",onClick:t,size:"sm",children:n(l?"table.toolbar.sort.save":"table.toolbar.sort.edit")})})]})}function hu(){const[s,a]=m.useState([]),[t,l]=m.useState([]),[n,r]=m.useState(!1),[o,c]=m.useState([]),[u,i]=m.useState({"drag-handle":!1}),[d,h]=m.useState({pageSize:20,pageIndex:0}),{refetch:k}=le({queryKey:["paymentList"],queryFn:async()=>{const{data:g}=await et.getList();return c(g?.map(T=>({...T,enable:!!T.enable}))||[]),g}});m.useEffect(()=>{i({"drag-handle":n,actions:!n}),h({pageSize:n?99999:10,pageIndex:0})},[n]);const C=(g,T)=>{n&&(g.dataTransfer.setData("text/plain",T.toString()),g.currentTarget.classList.add("opacity-50"))},S=(g,T)=>{if(!n)return;g.preventDefault(),g.currentTarget.classList.remove("bg-muted");const E=parseInt(g.dataTransfer.getData("text/plain"));if(E===T)return;const p=[...o],[_]=p.splice(E,1);p.splice(T,0,_),c(p)},w=async()=>{n?et.sort({ids:o.map(g=>g.id)}).then(()=>{k(),r(!1),$.success("排序保存成功")}):r(!0)},N=Je({data:o,columns:uu({refetch:k,isSortMode:n}),state:{sorting:t,columnFilters:s,columnVisibility:u,pagination:d},onSortingChange:l,onColumnFiltersChange:a,onColumnVisibilityChange:i,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),initialState:{columnPinning:{right:["actions"]}},pageCount:n?1:void 0});return e.jsx(os,{table:N,toolbar:g=>e.jsx(xu,{table:g,refetch:k,saveOrder:w,isSortMode:n}),draggable:n,onDragStart:C,onDragEnd:g=>g.currentTarget.classList.remove("opacity-50"),onDragOver:g=>{g.preventDefault(),g.currentTarget.classList.add("bg-muted")},onDragLeave:g=>g.currentTarget.classList.remove("bg-muted"),onDrop:S,showPagination:!n})}function pu(){const{t:s}=V("payment");return e.jsxs(Ve,{children:[e.jsxs(Fe,{className:"flex items-center justify-between",children:[e.jsx(Xe,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{children:[e.jsx("header",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("section",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(hu,{})})]})]})}const gu=Object.freeze(Object.defineProperty({__proto__:null,default:pu},Symbol.toStringTag,{value:"Module"}));function fu({pluginName:s,onClose:a,onSuccess:t}){const{t:l}=V("plugin"),[n,r]=m.useState(!0),[o,c]=m.useState(!1),[u,i]=m.useState(null),d=kc({config:Tc(Dc())}),h=Ne({resolver:we(d),defaultValues:{config:{}}});m.useEffect(()=>{(async()=>{try{const{data:w}=await Ps.getPluginConfig(s);i(w),h.reset({config:Object.fromEntries(Object.entries(w).map(([N,g])=>[N,g.value]))})}catch{$.error(l("messages.configLoadError"))}finally{r(!1)}})()},[s]);const k=async S=>{c(!0);try{await Ps.updatePluginConfig(s,S.config),$.success(l("messages.configSaveSuccess")),t()}catch{$.error(l("messages.configSaveError"))}finally{c(!1)}},C=(S,w)=>{switch(w.type){case"string":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{children:w.label||w.description}),e.jsx(b,{children:e.jsx(D,{placeholder:w.placeholder,...N})}),w.description&&w.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:w.description}),e.jsx(P,{})]})},S);case"number":case"percentage":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{children:w.label||w.description}),e.jsx(b,{children:e.jsxs("div",{className:"relative",children:[e.jsx(D,{type:"number",placeholder:w.placeholder,...N,onChange:g=>{const T=Number(g.target.value);w.type==="percentage"?N.onChange(Math.min(100,Math.max(0,T))):N.onChange(T)},className:w.type==="percentage"?"pr-8":"",min:w.type==="percentage"?0:void 0,max:w.type==="percentage"?100:void 0,step:w.type==="percentage"?1:void 0}),w.type==="percentage"&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:e.jsx(Pc,{className:"h-4 w-4 text-muted-foreground"})})]})}),w.description&&w.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:w.description}),e.jsx(P,{})]})},S);case"select":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{children:w.label||w.description}),e.jsxs(J,{onValueChange:N.onChange,defaultValue:N.value,children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:w.placeholder})})}),e.jsx(Y,{children:w.options?.map(g=>e.jsx(A,{value:g.value,children:g.label},g.value))})]}),w.description&&w.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:w.description}),e.jsx(P,{})]})},S);case"boolean":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(f,{className:"flex flex-row items-center justify-between rounded-lg border p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:w.label||w.description}),w.description&&w.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:w.description})]}),e.jsx(b,{children:e.jsx(Z,{checked:N.value,onCheckedChange:N.onChange})})]})},S);case"text":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{children:w.label||w.description}),e.jsx(b,{children:e.jsx(ks,{placeholder:w.placeholder,...N})}),w.description&&w.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:w.description}),e.jsx(P,{})]})},S);default:return null}};return n?e.jsxs("div",{className:"space-y-4",children:[e.jsx(me,{className:"h-4 w-[200px]"}),e.jsx(me,{className:"h-10 w-full"}),e.jsx(me,{className:"h-4 w-[200px]"}),e.jsx(me,{className:"h-10 w-full"})]}):e.jsx(Ce,{...h,children:e.jsxs("form",{onSubmit:h.handleSubmit(k),className:"space-y-4",children:[u&&Object.entries(u).map(([S,w])=>C(S,w)),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(L,{type:"button",variant:"outline",onClick:a,disabled:o,children:l("config.cancel")}),e.jsx(L,{type:"submit",loading:o,disabled:o,children:l("config.save")})]})]})})}function ju(){const{t:s}=V("plugin"),[a,t]=m.useState(null),[l,n]=m.useState(!1),[r,o]=m.useState(null),[c,u]=m.useState(""),[i,d]=m.useState("all"),[h,k]=m.useState(!1),[C,S]=m.useState(!1),[w,N]=m.useState(!1),g=m.useRef(null),{data:T,isLoading:E,refetch:p}=le({queryKey:["pluginList"],queryFn:async()=>{const{data:R}=await Ps.getPluginList();return R}});T&&[...new Set(T.map(R=>R.category||"other"))];const _=T?.filter(R=>{const X=R.name.toLowerCase().includes(c.toLowerCase())||R.description.toLowerCase().includes(c.toLowerCase())||R.code.toLowerCase().includes(c.toLowerCase()),ms=i==="all"||R.category===i;return X&&ms}),I=async R=>{t(R),Ps.installPlugin(R).then(()=>{$.success(s("messages.installSuccess")),p()}).catch(X=>{$.error(X.message||s("messages.installError"))}).finally(()=>{t(null)})},H=async R=>{t(R),Ps.uninstallPlugin(R).then(()=>{$.success(s("messages.uninstallSuccess")),p()}).catch(X=>{$.error(X.message||s("messages.uninstallError"))}).finally(()=>{t(null)})},O=async(R,X)=>{t(R),(X?Ps.disablePlugin:Ps.enablePlugin)(R).then(()=>{$.success(s(X?"messages.disableSuccess":"messages.enableSuccess")),p()}).catch(Te=>{$.error(Te.message||s(X?"messages.disableError":"messages.enableError"))}).finally(()=>{t(null)})},B=R=>{T?.find(X=>X.code===R),o(R),n(!0)},ce=async R=>{if(!R.name.endsWith(".zip")){$.error(s("upload.error.format"));return}k(!0),Ps.uploadPlugin(R).then(()=>{$.success(s("messages.uploadSuccess")),S(!1),p()}).catch(X=>{$.error(X.message||s("messages.uploadError"))}).finally(()=>{k(!1),g.current&&(g.current.value="")})},ee=R=>{R.preventDefault(),R.stopPropagation(),R.type==="dragenter"||R.type==="dragover"?N(!0):R.type==="dragleave"&&N(!1)},te=R=>{R.preventDefault(),R.stopPropagation(),N(!1),R.dataTransfer.files&&R.dataTransfer.files[0]&&ce(R.dataTransfer.files[0])},q=async R=>{t(R),Ps.deletePlugin(R).then(()=>{$.success(s("messages.deleteSuccess")),p()}).catch(X=>{$.error(X.message||s("messages.deleteError"))}).finally(()=>{t(null)})};return e.jsxs(Ve,{children:[e.jsxs(Fe,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(gn,{className:"h-6 w-6"}),e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s("title")})]}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{children:[e.jsxs("div",{className:"mb-8 space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"relative max-w-sm flex-1",children:[e.jsx(fn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(D,{placeholder:s("search.placeholder"),value:c,onChange:R=>u(R.target.value),className:"pl-9"})]}),e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs(L,{onClick:()=>S(!0),variant:"outline",className:"shrink-0",size:"sm",children:[e.jsx(Kt,{className:"mr-2 h-4 w-4"}),s("upload.button")]})})]}),e.jsxs(Yt,{defaultValue:"all",className:"w-full",children:[e.jsxs(kt,{children:[e.jsx(es,{value:"all",children:s("tabs.all")}),e.jsx(es,{value:"installed",children:s("tabs.installed")}),e.jsx(es,{value:"available",children:s("tabs.available")})]}),e.jsx(Ls,{value:"all",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:E?e.jsxs(e.Fragment,{children:[e.jsx(Ya,{}),e.jsx(Ya,{}),e.jsx(Ya,{})]}):_?.map(R=>e.jsx(Wa,{plugin:R,onInstall:I,onUninstall:H,onToggleEnable:O,onOpenConfig:B,onDelete:q,isLoading:a===R.name},R.name))})}),e.jsx(Ls,{value:"installed",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:_?.filter(R=>R.is_installed).map(R=>e.jsx(Wa,{plugin:R,onInstall:I,onUninstall:H,onToggleEnable:O,onOpenConfig:B,onDelete:q,isLoading:a===R.name},R.name))})}),e.jsx(Ls,{value:"available",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:_?.filter(R=>!R.is_installed).map(R=>e.jsx(Wa,{plugin:R,onInstall:I,onUninstall:H,onToggleEnable:O,onOpenConfig:B,onDelete:q,isLoading:a===R.name},R.code))})})]})]}),e.jsx(he,{open:l,onOpenChange:n,children:e.jsxs(ue,{className:"sm:max-w-lg",children:[e.jsxs(je,{children:[e.jsxs(pe,{children:[T?.find(R=>R.code===r)?.name," ",s("config.title")]}),e.jsx(Re,{children:s("config.description")})]}),r&&e.jsx(fu,{pluginName:r,onClose:()=>n(!1),onSuccess:()=>{n(!1),p()}})]})}),e.jsx(he,{open:C,onOpenChange:S,children:e.jsxs(ue,{className:"sm:max-w-md",children:[e.jsxs(je,{children:[e.jsx(pe,{children:s("upload.title")}),e.jsx(Re,{children:s("upload.description")})]}),e.jsxs("div",{className:y("relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",w&&"border-primary/50 bg-muted/50"),onDragEnter:ee,onDragLeave:ee,onDragOver:ee,onDrop:te,children:[e.jsx("input",{type:"file",ref:g,className:"hidden",accept:".zip",onChange:R=>{const X=R.target.files?.[0];X&&ce(X)}}),h?e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("upload.uploading")})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsx("div",{className:"rounded-full border-2 border-muted-foreground/25 p-3",children:e.jsx(Kt,{className:"h-6 w-6 text-muted-foreground/50"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium",children:[s("upload.dragText")," ",e.jsx("button",{type:"button",onClick:()=>g.current?.click(),className:"mx-1 text-primary hover:underline",children:s("upload.clickText")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("upload.supportText")})]})]})})]})]})})]})]})}function Wa({plugin:s,onInstall:a,onUninstall:t,onToggleEnable:l,onOpenConfig:n,onDelete:r,isLoading:o}){const{t:c}=V("plugin");return e.jsxs(Ye,{className:"group relative overflow-hidden transition-all hover:shadow-md",children:[e.jsxs(ts,{children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ns,{children:s.name}),s.is_installed&&e.jsx(G,{variant:s.is_enabled?"success":"secondary",children:s.is_enabled?c("status.enabled"):c("status.disabled")})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(gn,{className:"h-4 w-4"}),e.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:s.code})]}),e.jsxs("div",{children:["v",s.version]})]})]})}),e.jsx(st,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"mt-2",children:s.description}),e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:e.jsxs("div",{className:"flex items-center gap-1",children:[c("author"),": ",s.author]})})]})})]}),e.jsx(as,{children:e.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.is_installed?e.jsxs(e.Fragment,{children:[e.jsxs(L,{variant:"outline",size:"sm",onClick:()=>n(s.code),disabled:!s.is_enabled||o,children:[e.jsx(Lc,{className:"mr-2 h-4 w-4"}),c("button.config")]}),e.jsxs(L,{variant:s.is_enabled?"destructive":"default",size:"sm",onClick:()=>l(s.code,s.is_enabled),disabled:o,children:[e.jsx(Ec,{className:"mr-2 h-4 w-4"}),s.is_enabled?c("button.disable"):c("button.enable")]}),e.jsx(ls,{title:c("uninstall.title"),description:c("uninstall.description"),cancelText:c("common:cancel"),confirmText:c("uninstall.button"),variant:"destructive",onConfirm:()=>t(s.code),children:e.jsxs(L,{variant:"outline",size:"sm",className:"text-muted-foreground hover:text-destructive",disabled:o,children:[e.jsx(We,{className:"mr-2 h-4 w-4"}),c("button.uninstall")]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{onClick:()=>a(s.code),disabled:o,loading:o,children:c("button.install")}),e.jsx(ls,{title:c("delete.title"),description:c("delete.description"),cancelText:c("common:cancel"),confirmText:c("delete.button"),variant:"destructive",onConfirm:()=>r(s.code),children:e.jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",disabled:o,children:e.jsx(We,{className:"h-4 w-4"})})})]})})})]})}function Ya(){return e.jsxs(Ye,{children:[e.jsxs(ts,{children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(me,{className:"h-6 w-[200px]"}),e.jsx(me,{className:"h-6 w-[80px]"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(me,{className:"h-5 w-[120px]"}),e.jsx(me,{className:"h-5 w-[60px]"})]})]})}),e.jsxs("div",{className:"space-y-2 pt-2",children:[e.jsx(me,{className:"h-4 w-[300px]"}),e.jsx(me,{className:"h-4 w-[150px]"})]})]}),e.jsx(as,{children:e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(me,{className:"h-9 w-[100px]"}),e.jsx(me,{className:"h-9 w-[100px]"}),e.jsx(me,{className:"h-8 w-8"})]})})]})}const vu=Object.freeze(Object.defineProperty({__proto__:null,default:ju},Symbol.toStringTag,{value:"Module"})),bu=(s,a)=>{let t=null;switch(s.field_type){case"input":t=e.jsx(D,{placeholder:s.placeholder,...a});break;case"textarea":t=e.jsx(ks,{placeholder:s.placeholder,...a});break;case"select":t=e.jsx("select",{className:y(yt({variant:"outline"}),"w-full appearance-none font-normal"),...a,children:s.select_options&&Object.keys(s.select_options).map(l=>e.jsx("option",{value:l,children:s.select_options?.[l]},l))});break;default:t=null;break}return t};function yu({themeKey:s,themeInfo:a}){const{t}=V("theme"),[l,n]=m.useState(!1),[r,o]=m.useState(!1),[c,u]=m.useState(!1),i=Ne({defaultValues:a.configs.reduce((k,C)=>(k[C.field_name]="",k),{})}),d=async()=>{o(!0),At.getConfig(s).then(({data:k})=>{Object.entries(k).forEach(([C,S])=>{i.setValue(C,S)})}).finally(()=>{o(!1)})},h=async k=>{u(!0),At.updateConfig(s,k).then(()=>{$.success(t("config.success")),n(!1)}).finally(()=>{u(!1)})};return e.jsxs(he,{open:l,onOpenChange:k=>{n(k),k?d():i.reset()},children:[e.jsx(is,{asChild:!0,children:e.jsx(L,{variant:"outline",children:t("card.configureTheme")})}),e.jsxs(ue,{className:"max-h-[90vh] overflow-auto sm:max-w-[425px]",children:[e.jsxs(je,{children:[e.jsx(pe,{children:t("config.title",{name:a.name})}),e.jsx(Re,{children:t("config.description")})]}),r?e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(fa,{className:"h-6 w-6 animate-spin"})}):e.jsx(Ce,{...i,children:e.jsxs("form",{onSubmit:i.handleSubmit(h),className:"space-y-4",children:[a.configs.map(k=>e.jsx(v,{control:i.control,name:k.field_name,render:({field:C})=>e.jsxs(f,{children:[e.jsx(j,{children:k.label}),e.jsx(b,{children:bu(k,C)}),e.jsx(P,{})]})},k.field_name)),e.jsxs(Le,{className:"mt-6 gap-2",children:[e.jsx(L,{type:"button",variant:"secondary",onClick:()=>n(!1),children:t("config.cancel")}),e.jsx(L,{type:"submit",loading:c,children:t("config.save")})]})]})})]})]})}function Nu(){const{t:s}=V("theme"),[a,t]=m.useState(null),[l,n]=m.useState(!1),[r,o]=m.useState(!1),[c,u]=m.useState(!1),[i,d]=m.useState(null),h=m.useRef(null),[k,C]=m.useState(0),{data:S,isLoading:w,refetch:N}=le({queryKey:["themeList"],queryFn:async()=>{const{data:O}=await At.getList();return O}}),g=async O=>{t(O),oe.updateSystemConfig({frontend_theme:O}).then(()=>{$.success("主题切换成功"),N()}).finally(()=>{t(null)})},T=async O=>{if(!O.name.endsWith(".zip")){$.error(s("upload.error.format"));return}n(!0),At.upload(O).then(()=>{$.success("主题上传成功"),o(!1),N()}).finally(()=>{n(!1),h.current&&(h.current.value="")})},E=O=>{O.preventDefault(),O.stopPropagation(),O.type==="dragenter"||O.type==="dragover"?u(!0):O.type==="dragleave"&&u(!1)},p=O=>{O.preventDefault(),O.stopPropagation(),u(!1),O.dataTransfer.files&&O.dataTransfer.files[0]&&T(O.dataTransfer.files[0])},_=()=>{i&&C(O=>O===0?i.images.length-1:O-1)},I=()=>{i&&C(O=>O===i.images.length-1?0:O+1)},H=(O,B)=>{C(0),d({name:O,images:B})};return e.jsxs(Ve,{children:[e.jsxs(Fe,{className:"flex items-center justify-between",children:[e.jsx(Xe,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("div",{className:"mb-2",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-muted-foreground",children:s("description")}),e.jsxs(L,{onClick:()=>o(!0),variant:"outline",className:"ml-4 shrink-0",size:"sm",children:[e.jsx(Kt,{className:"mr-2 h-4 w-4"}),s("upload.button")]})]})]}),e.jsx("section",{className:"grid gap-6 md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3",children:w?e.jsxs(e.Fragment,{children:[e.jsx(nl,{}),e.jsx(nl,{})]}):S?.themes&&Object.entries(S.themes).map(([O,B])=>e.jsx(Ye,{className:"group relative overflow-hidden transition-all hover:shadow-md",style:{backgroundImage:B.background_url?`url(${B.background_url})`:"none",backgroundSize:"cover",backgroundPosition:"center"},children:e.jsxs("div",{className:y("relative z-10 h-full transition-colors",B.background_url?"group-hover:from-background/98 bg-gradient-to-t from-background/95 via-background/80 to-background/60 backdrop-blur-[1px] group-hover:via-background/90 group-hover:to-background/70":"bg-background"),children:[!!B.can_delete&&e.jsx("div",{className:"absolute right-2 top-2",children:e.jsx(ls,{title:s("card.delete.title"),description:s("card.delete.description"),confirmText:s("card.delete.button"),variant:"destructive",onConfirm:async()=>{if(O===S?.active){$.error(s("card.delete.error.active"));return}t(O),At.drop(O).then(()=>{$.success("主题删除成功"),N()}).finally(()=>{t(null)})},children:e.jsx(L,{disabled:a===O,loading:a===O,variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",children:e.jsx(We,{className:"h-4 w-4"})})})}),e.jsxs(ts,{children:[e.jsx(Ns,{children:B.name}),e.jsx(st,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{children:B.description}),B.version&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("card.version",{version:B.version})})]})})]}),e.jsxs(as,{className:"flex items-center justify-end space-x-3",children:[B.images&&Array.isArray(B.images)&&B.images.length>0&&e.jsx(L,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>H(B.name,B.images),children:e.jsx(Ic,{className:"h-4 w-4"})}),e.jsx(yu,{themeKey:O,themeInfo:B}),e.jsx(L,{onClick:()=>g(O),disabled:a===O||O===S.active,loading:a===O,variant:O===S.active?"secondary":"default",children:O===S.active?s("card.currentTheme"):s("card.activateTheme")})]})]})},O))}),e.jsx(he,{open:r,onOpenChange:o,children:e.jsxs(ue,{className:"sm:max-w-md",children:[e.jsxs(je,{children:[e.jsx(pe,{children:s("upload.title")}),e.jsx(Re,{children:s("upload.description")})]}),e.jsxs("div",{className:y("relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",c&&"border-primary/50 bg-muted/50"),onDragEnter:E,onDragLeave:E,onDragOver:E,onDrop:p,children:[e.jsx("input",{type:"file",ref:h,className:"hidden",accept:".zip",onChange:O=>{const B=O.target.files?.[0];B&&T(B)}}),l?e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("upload.uploading")})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsx("div",{className:"rounded-full border-2 border-muted-foreground/25 p-3",children:e.jsx(Kt,{className:"h-6 w-6 text-muted-foreground/50"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium",children:[s("upload.dragText")," ",e.jsx("button",{type:"button",onClick:()=>h.current?.click(),className:"mx-1 text-primary hover:underline",children:s("upload.clickText")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("upload.supportText")})]})]})})]})]})}),e.jsx(he,{open:!!i,onOpenChange:O=>{O||(d(null),C(0))},children:e.jsxs(ue,{className:"max-w-4xl",children:[e.jsxs(je,{children:[e.jsxs(pe,{children:[i?.name," ",s("preview.title")]}),e.jsx(Re,{className:"text-center",children:i&&s("preview.imageCount",{current:k+1,total:i.images.length})})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"aspect-[16/9] overflow-hidden rounded-lg border bg-muted",children:i?.images[k]&&e.jsx("img",{src:i.images[k],alt:`${i.name} 预览图 ${k+1}`,className:"h-full w-full object-contain"})}),i&&i.images.length>1&&e.jsxs(e.Fragment,{children:[e.jsx(L,{variant:"outline",size:"icon",className:"absolute left-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:_,children:e.jsx(Rc,{className:"h-4 w-4"})}),e.jsx(L,{variant:"outline",size:"icon",className:"absolute right-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:I,children:e.jsx(Vc,{className:"h-4 w-4"})})]})]}),i&&i.images.length>1&&e.jsx("div",{className:"mt-4 flex gap-2 overflow-x-auto pb-2",children:i.images.map((O,B)=>e.jsx("button",{onClick:()=>C(B),className:y("relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border-2",k===B?"border-primary":"border-transparent"),children:e.jsx("img",{src:O,alt:`缩略图 ${B+1}`,className:"h-full w-full object-cover"})},B))})]})})]})]})}function nl(){return e.jsxs(Ye,{children:[e.jsxs(ts,{children:[e.jsx(me,{className:"h-6 w-[200px]"}),e.jsx(me,{className:"h-4 w-[300px]"})]}),e.jsxs(as,{className:"flex items-center justify-end space-x-3",children:[e.jsx(me,{className:"h-10 w-[100px]"}),e.jsx(me,{className:"h-10 w-[100px]"})]})]})}const _u=Object.freeze(Object.defineProperty({__proto__:null,default:Nu},Symbol.toStringTag,{value:"Module"})),Tn=m.forwardRef(({className:s,value:a,onChange:t,...l},n)=>{const[r,o]=m.useState("");m.useEffect(()=>{if(r.includes(",")){const u=new Set([...a,...r.split(",").map(i=>i.trim())]);t(Array.from(u)),o("")}},[r,t,a]);const c=()=>{if(r){const u=new Set([...a,r]);t(Array.from(u)),o("")}};return e.jsxs("div",{className:y(" has-[:focus-visible]:outline-none has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-neutral-950 dark:has-[:focus-visible]:ring-neutral-300 flex w-full flex-wrap gap-2 rounded-md border border-input shadow-sm px-3 py-2 text-sm ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",s),children:[a.map(u=>e.jsxs(G,{variant:"secondary",children:[u,e.jsx(K,{variant:"ghost",size:"icon",className:"ml-2 h-3 w-3",onClick:()=>{t(a.filter(i=>i!==u))},children:e.jsx(rn,{className:"w-3"})})]},u)),e.jsx("input",{className:"flex-1 outline-none placeholder:text-muted-foreground bg-transparent",value:r,onChange:u=>o(u.target.value),onKeyDown:u=>{u.key==="Enter"||u.key===","?(u.preventDefault(),c()):u.key==="Backspace"&&r.length===0&&a.length>0&&(u.preventDefault(),t(a.slice(0,-1)))},...l,ref:n})]})});Tn.displayName="InputTags";const wu=x.object({id:x.number().nullable(),title:x.string().min(1).max(250),content:x.string().min(1),show:x.boolean(),tags:x.array(x.string()),img_url:x.string().nullable()}),Cu={id:null,show:!1,tags:[],img_url:"",title:"",content:""};function Ar({refetch:s,dialogTrigger:a,type:t="add",defaultFormValues:l=Cu}){const{t:n}=V("notice"),[r,o]=m.useState(!1),c=Ne({resolver:we(wu),defaultValues:l,mode:"onChange",shouldFocusError:!0}),u=new vn({html:!0});return e.jsx(Ce,{...c,children:e.jsxs(he,{onOpenChange:o,open:r,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"})," ",e.jsx("div",{children:n("form.add.button")})]})}),e.jsxs(ue,{className:"sm:max-w-[1025px]",children:[e.jsxs(je,{children:[e.jsx(pe,{children:n(t==="add"?"form.add.title":"form.edit.title")}),e.jsx(Re,{})]}),e.jsx(v,{control:c.control,name:"title",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.title.label")}),e.jsx("div",{className:"relative ",children:e.jsx(b,{children:e.jsx(D,{placeholder:n("form.fields.title.placeholder"),...i})})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"content",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.content.label")}),e.jsx(b,{children:e.jsx(bn,{style:{height:"500px"},value:i.value,renderHTML:d=>u.render(d),onChange:({text:d})=>{i.onChange(d)}})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"img_url",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.img_url.label")}),e.jsx("div",{className:"relative",children:e.jsx(b,{children:e.jsx(D,{type:"text",placeholder:n("form.fields.img_url.placeholder"),...i,value:i.value||""})})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"show",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.show.label")}),e.jsx("div",{className:"relative py-2",children:e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:i.onChange})})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"tags",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.tags.label")}),e.jsx(b,{children:e.jsx(Tn,{value:i.value,onChange:i.onChange,placeholder:n("form.fields.tags.placeholder"),className:"w-full"})}),e.jsx(P,{})]})}),e.jsxs(Le,{children:[e.jsx(qs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:n("form.buttons.cancel")})}),e.jsx(L,{type:"submit",onClick:i=>{i.preventDefault(),c.handleSubmit(async d=>{Gt.save(d).then(({data:h})=>{h&&($.success(n("form.buttons.success")),s(),o(!1))})})()},children:n("form.buttons.submit")})]})]})]})})}function Su({table:s,refetch:a,saveOrder:t,isSortMode:l}){const{t:n}=V("notice"),r=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between space-x-2 ",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[!l&&e.jsx(Ar,{refetch:a}),!l&&e.jsx(D,{placeholder:n("table.toolbar.search"),value:s.getColumn("title")?.getFilterValue()??"",onChange:o=>s.getColumn("title")?.setFilterValue(o.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),r&&!l&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-9 px-2 lg:px-3",children:[n("table.toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(L,{variant:l?"default":"outline",onClick:t,className:"h-8",size:"sm",children:n(l?"table.toolbar.sort.save":"table.toolbar.sort.edit")})})]})}const ku=s=>{const{t:a}=V("notice");return[{id:"drag-handle",header:"",cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(Fc,{className:"h-4 w-4 cursor-move text-muted-foreground"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.id")}),cell:({row:t})=>e.jsx(G,{variant:"outline",className:"font-mono",children:t.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.show")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(Z,{defaultChecked:t.getValue("show"),onCheckedChange:async()=>{const{data:l}=await Gt.updateStatus(t.original.id);l||s()}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.title")}),cell:({row:t})=>e.jsx("div",{className:"flex max-w-[500px] items-center",children:e.jsx("span",{className:"truncate font-medium",children:t.getValue("title")})}),enableSorting:!1,size:6e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:a("table.columns.actions")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(Ar,{refetch:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:a("table.actions.edit")})]}),type:"edit",defaultFormValues:t.original}),e.jsx(ls,{title:a("table.actions.delete.title"),description:a("table.actions.delete.description"),onConfirm:async()=>{Gt.drop(t.original.id).then(()=>{$.success(a("table.actions.delete.success")),s()})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:a("table.actions.delete.title")})]})})]}),size:100}]};function Tu(){const[s,a]=m.useState({}),[t,l]=m.useState({}),[n,r]=m.useState([]),[o,c]=m.useState([]),[u,i]=m.useState(!1),[d,h]=m.useState({}),[k,C]=m.useState({pageSize:50,pageIndex:0}),[S,w]=m.useState([]),{refetch:N}=le({queryKey:["notices"],queryFn:async()=>{const{data:_}=await Gt.getList();return w(_),_}});m.useEffect(()=>{l({"drag-handle":u,content:!u,created_at:!u,actions:!u}),C({pageSize:u?99999:50,pageIndex:0})},[u]);const g=(_,I)=>{u&&(_.dataTransfer.setData("text/plain",I.toString()),_.currentTarget.classList.add("opacity-50"))},T=(_,I)=>{if(!u)return;_.preventDefault(),_.currentTarget.classList.remove("bg-muted");const H=parseInt(_.dataTransfer.getData("text/plain"));if(H===I)return;const O=[...S],[B]=O.splice(H,1);O.splice(I,0,B),w(O)},E=async()=>{if(!u){i(!0);return}Gt.sort(S.map(_=>_.id)).then(()=>{$.success("排序保存成功"),i(!1),N()}).finally(()=>{i(!1)})},p=Je({data:S??[],columns:ku(N),state:{sorting:o,columnVisibility:t,rowSelection:s,columnFilters:n,columnSizing:d,pagination:k},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:r,onColumnVisibilityChange:l,onColumnSizingChange:h,onPaginationChange:C,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx("div",{className:"space-y-4",children:e.jsx(os,{table:p,toolbar:_=>e.jsx(Su,{table:_,refetch:N,saveOrder:E,isSortMode:u}),draggable:u,onDragStart:g,onDragEnd:_=>_.currentTarget.classList.remove("opacity-50"),onDragOver:_=>{_.preventDefault(),_.currentTarget.classList.add("bg-muted")},onDragLeave:_=>_.currentTarget.classList.remove("bg-muted"),onDrop:T,showPagination:!u})})}function Du(){const{t:s}=V("notice");return e.jsxs(Ve,{children:[e.jsxs(Fe,{className:"flex items-center justify-between",children:[e.jsx(Xe,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Tu,{})})]})]})}const Pu=Object.freeze(Object.defineProperty({__proto__:null,default:Du},Symbol.toStringTag,{value:"Module"})),Lu=x.object({id:x.number().nullable(),language:x.string().max(250),category:x.string().max(250),title:x.string().min(1).max(250),body:x.string().min(1),show:x.boolean()}),Eu={id:null,language:"zh-CN",category:"",title:"",body:"",show:!1};function qr({refreshData:s,dialogTrigger:a,type:t="add",defaultFormValues:l=Eu}){const{t:n}=V("knowledge"),[r,o]=m.useState(!1),c=Ne({resolver:we(Lu),defaultValues:l,mode:"onChange",shouldFocusError:!0}),u=new vn({html:!0});return m.useEffect(()=>{r&&l.id&&bt.getInfo(l.id).then(({data:i})=>{c.reset(i)})},[l.id,c,r]),e.jsxs(he,{onOpenChange:o,open:r,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"})," ",e.jsx("div",{children:n("form.add")})]})}),e.jsxs(ue,{className:"sm:max-w-[1025px]",children:[e.jsxs(je,{children:[e.jsx(pe,{children:n(t==="add"?"form.add":"form.edit")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...c,children:[e.jsx(v,{control:c.control,name:"title",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.title")}),e.jsx("div",{className:"relative ",children:e.jsx(b,{children:e.jsx(D,{placeholder:n("form.titlePlaceholder"),...i})})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"category",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.category")}),e.jsx("div",{className:"relative ",children:e.jsx(b,{children:e.jsx(D,{placeholder:n("form.categoryPlaceholder"),...i})})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"language",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.language")}),e.jsx(b,{children:e.jsxs(J,{value:i.value,onValueChange:i.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("form.languagePlaceholder")})}),e.jsx(Y,{children:[{value:"en-US"},{value:"ja-JP"},{value:"ko-KR"},{value:"vi-VN"},{value:"zh-CN"},{value:"zh-TW"}].map(d=>e.jsx(A,{value:d.value,className:"cursor-pointer",children:n(`languages.${d.value}`)},d.value))})]})})]})}),e.jsx(v,{control:c.control,name:"body",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.content")}),e.jsx(b,{children:e.jsx(bn,{style:{height:"500px"},value:i.value,renderHTML:d=>u.render(d),onChange:({text:d})=>{i.onChange(d)}})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"show",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.show")}),e.jsx("div",{className:"relative py-2",children:e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:i.onChange})})}),e.jsx(P,{})]})}),e.jsxs(Le,{children:[e.jsx(qs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:n("form.cancel")})}),e.jsx(L,{type:"submit",onClick:()=>{c.handleSubmit(i=>{bt.save(i).then(({data:d})=>{d&&(c.reset(),$.success(n("messages.operationSuccess")),o(!1),s())})})()},children:n("form.submit")})]})]})]})]})}function Iu({column:s,title:a,options:t}){const l=s?.getFacetedUniqueValues(),n=new Set(s?.getFilterValue());return e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Da,{className:"mr-2 h-4 w-4"}),a,n?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:n.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:n.size>2?e.jsxs(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[n.size," selected"]}):t.filter(r=>n.has(r.value)).map(r=>e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:r.label},r.value))})]})]})}),e.jsx(bs,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Us,{children:[e.jsx(it,{placeholder:a}),e.jsxs(Ks,{children:[e.jsx(ot,{children:"No results found."}),e.jsx(ns,{children:t.map(r=>{const o=n.has(r.value);return e.jsxs($e,{onSelect:()=>{o?n.delete(r.value):n.add(r.value);const c=Array.from(n);s?.setFilterValue(c.length?c:void 0)},children:[e.jsx("div",{className:y("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",o?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(at,{className:y("h-4 w-4")})}),r.icon&&e.jsx(r.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:r.label}),l?.get(r.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:l.get(r.value)})]},r.value)})}),n.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{}),e.jsx(ns,{children:e.jsx($e,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}function Ru({table:s,refetch:a,saveOrder:t,isSortMode:l}){const n=s.getState().columnFilters.length>0,{t:r}=V("knowledge");return e.jsxs("div",{className:"flex items-center justify-between",children:[l?e.jsx("p",{className:"text-sm text-muted-foreground",children:r("toolbar.sortModeHint")}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qr,{refreshData:a}),e.jsx(D,{placeholder:r("toolbar.searchPlaceholder"),value:s.getColumn("title")?.getFilterValue()??"",onChange:o=>s.getColumn("title")?.setFilterValue(o.target.value),className:"h-8 w-[250px]"}),s.getColumn("category")&&e.jsx(Iu,{column:s.getColumn("category"),title:r("columns.category"),options:Array.from(new Set(s.getCoreRowModel().rows.map(o=>o.getValue("category")))).map(o=>({label:o,value:o}))}),n&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:[r("toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:l?"default":"outline",onClick:t,size:"sm",children:r(l?"toolbar.saveSort":"toolbar.editSort")})})]})}const Vu=({refetch:s,isSortMode:a=!1})=>{const{t}=V("knowledge");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:a?"cursor-move":"opacity-0",children:e.jsx(Ta,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:l})=>e.jsx(z,{column:l,title:t("columns.id")}),cell:({row:l})=>e.jsx(G,{variant:"outline",className:"justify-center",children:l.getValue("id")}),enableSorting:!0,size:70},{accessorKey:"show",header:({column:l})=>e.jsx(z,{column:l,title:t("columns.status")}),cell:({row:l})=>e.jsx("div",{className:"flex items-center",children:e.jsx(Z,{defaultChecked:l.getValue("show"),onCheckedChange:async()=>{bt.updateStatus({id:l.original.id}).then(({data:n})=>{n||s()})}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:l})=>e.jsx(z,{column:l,title:t("columns.title")}),cell:({row:l})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"line-clamp-2 font-medium",children:l.getValue("title")})}),enableSorting:!0,size:600},{accessorKey:"category",header:({column:l})=>e.jsx(z,{column:l,title:t("columns.category")}),cell:({row:l})=>e.jsx(G,{variant:"secondary",className:"max-w-[180px] truncate",children:l.getValue("category")}),enableSorting:!0,size:1800},{id:"actions",header:({column:l})=>e.jsx(z,{className:"justify-end",column:l,title:t("columns.actions")}),cell:({row:l})=>e.jsxs("div",{className:"flex items-center justify-end space-x-1",children:[e.jsx(qr,{refreshData:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:t("form.edit")})]}),type:"edit",defaultFormValues:l.original}),e.jsx(ls,{title:t("messages.deleteConfirm"),description:t("messages.deleteDescription"),confirmText:t("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{bt.drop({id:l.original.id}).then(({data:n})=>{n&&($.success(t("messages.operationSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:t("messages.deleteButton")})]})})]}),size:100}]};function Fu(){const[s,a]=m.useState([]),[t,l]=m.useState([]),[n,r]=m.useState(!1),[o,c]=m.useState([]),[u,i]=m.useState({"drag-handle":!1}),[d,h]=m.useState({pageSize:20,pageIndex:0}),{refetch:k,isLoading:C,data:S}=le({queryKey:["knowledge"],queryFn:async()=>{const{data:E}=await bt.getList();return c(E||[]),E}});m.useEffect(()=>{i({"drag-handle":n,actions:!n}),h({pageSize:n?99999:10,pageIndex:0})},[n]);const w=(E,p)=>{n&&(E.dataTransfer.setData("text/plain",p.toString()),E.currentTarget.classList.add("opacity-50"))},N=(E,p)=>{if(!n)return;E.preventDefault(),E.currentTarget.classList.remove("bg-muted");const _=parseInt(E.dataTransfer.getData("text/plain"));if(_===p)return;const I=[...o],[H]=I.splice(_,1);I.splice(p,0,H),c(I)},g=async()=>{n?bt.sort({ids:o.map(E=>E.id)}).then(()=>{k(),r(!1),$.success("排序保存成功")}):r(!0)},T=Je({data:o,columns:Vu({refetch:k,isSortMode:n}),state:{sorting:t,columnFilters:s,columnVisibility:u,pagination:d},onSortingChange:l,onColumnFiltersChange:a,onColumnVisibilityChange:i,onPaginationChange:h,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(os,{table:T,toolbar:E=>e.jsx(Ru,{table:E,refetch:k,saveOrder:g,isSortMode:n}),draggable:n,onDragStart:w,onDragEnd:E=>E.currentTarget.classList.remove("opacity-50"),onDragOver:E=>{E.preventDefault(),E.currentTarget.classList.add("bg-muted")},onDragLeave:E=>E.currentTarget.classList.remove("bg-muted"),onDrop:N,showPagination:!n})}function Mu(){const{t:s}=V("knowledge");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight mb-2",children:s("title")}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Fu,{})})]})]})}const Ou=Object.freeze(Object.defineProperty({__proto__:null,default:Mu},Symbol.toStringTag,{value:"Module"}));function zu(s,a){const[t,l]=m.useState(s);return m.useEffect(()=>{const n=setTimeout(()=>l(s),a);return()=>{clearTimeout(n)}},[s,a]),t}function Ja(s,a){if(s.length===0)return{};if(!a)return{"":s};const t={};return s.forEach(l=>{const n=l[a]||"";t[n]||(t[n]=[]),t[n].push(l)}),t}function $u(s,a){const t=JSON.parse(JSON.stringify(s));for(const[l,n]of Object.entries(t))t[l]=n.filter(r=>!a.find(o=>o.value===r.value));return t}function Au(s,a){for(const[,t]of Object.entries(s))if(t.some(l=>a.find(n=>n.value===l.value)))return!0;return!1}const Hr=m.forwardRef(({className:s,...a},t)=>Mc(n=>n.filtered.count===0)?e.jsx("div",{ref:t,className:y("py-6 text-center text-sm",s),"cmdk-empty":"",role:"presentation",...a}):null);Hr.displayName="CommandEmpty";const wt=m.forwardRef(({value:s,onChange:a,placeholder:t,defaultOptions:l=[],options:n,delay:r,onSearch:o,loadingIndicator:c,emptyIndicator:u,maxSelected:i=Number.MAX_SAFE_INTEGER,onMaxSelected:d,hidePlaceholderWhenSelected:h,disabled:k,groupBy:C,className:S,badgeClassName:w,selectFirstItem:N=!0,creatable:g=!1,triggerSearchOnFocus:T=!1,commandProps:E,inputProps:p,hideClearAllButton:_=!1},I)=>{const H=m.useRef(null),[O,B]=m.useState(!1),ce=m.useRef(!1),[ee,te]=m.useState(!1),[q,R]=m.useState(s||[]),[X,ms]=m.useState(Ja(l,C)),[Te,re]=m.useState(""),us=zu(Te,r||500);m.useImperativeHandle(I,()=>({selectedValue:[...q],input:H.current,focus:()=>H.current?.focus()}),[q]);const Ts=m.useCallback(se=>{const de=q.filter(ae=>ae.value!==se.value);R(de),a?.(de)},[a,q]),Bs=m.useCallback(se=>{const de=H.current;de&&((se.key==="Delete"||se.key==="Backspace")&&de.value===""&&q.length>0&&(q[q.length-1].fixed||Ts(q[q.length-1])),se.key==="Escape"&&de.blur())},[Ts,q]);m.useEffect(()=>{s&&R(s)},[s]),m.useEffect(()=>{if(!n||o)return;const se=Ja(n||[],C);JSON.stringify(se)!==JSON.stringify(X)&&ms(se)},[l,n,C,o,X]),m.useEffect(()=>{const se=async()=>{te(!0);const ae=await o?.(us);ms(Ja(ae||[],C)),te(!1)};(async()=>{!o||!O||(T&&await se(),us&&await se())})()},[us,C,O,T]);const Dt=()=>{if(!g||Au(X,[{value:Te,label:Te}])||q.find(de=>de.value===Te))return;const se=e.jsx($e,{value:Te,className:"cursor-pointer",onMouseDown:de=>{de.preventDefault(),de.stopPropagation()},onSelect:de=>{if(q.length>=i){d?.(q.length);return}re("");const ae=[...q,{value:de,label:de}];R(ae),a?.(ae)},children:`Create "${Te}"`});if(!o&&Te.length>0||o&&us.length>0&&!ee)return se},Jt=m.useCallback(()=>{if(u)return o&&!g&&Object.keys(X).length===0?e.jsx($e,{value:"-",disabled:!0,children:u}):e.jsx(Hr,{children:u})},[g,u,o,X]),Pt=m.useMemo(()=>$u(X,q),[X,q]),Ms=m.useCallback(()=>{if(E?.filter)return E.filter;if(g)return(se,de)=>se.toLowerCase().includes(de.toLowerCase())?1:-1},[g,E?.filter]),qa=m.useCallback(()=>{const se=q.filter(de=>de.fixed);R(se),a?.(se)},[a,q]);return e.jsxs(Us,{...E,onKeyDown:se=>{Bs(se),E?.onKeyDown?.(se)},className:y("h-auto overflow-visible bg-transparent",E?.className),shouldFilter:E?.shouldFilter!==void 0?E.shouldFilter:!o,filter:Ms(),children:[e.jsx("div",{className:y("rounded-md border border-input text-sm ring-offset-background focus-within:ring-1 focus-within:ring-ring ",{"px-3 py-2":q.length!==0,"cursor-text":!k&&q.length!==0},S),onClick:()=>{k||H.current?.focus()},children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[q.map(se=>e.jsxs(G,{className:y("data-[disabled]:bg-muted-foreground data-[disabled]:text-muted data-[disabled]:hover:bg-muted-foreground","data-[fixed]:bg-muted-foreground data-[fixed]:text-muted data-[fixed]:hover:bg-muted-foreground",w),"data-fixed":se.fixed,"data-disabled":k||void 0,children:[se.label,e.jsx("button",{className:y("ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",(k||se.fixed)&&"hidden"),onKeyDown:de=>{de.key==="Enter"&&Ts(se)},onMouseDown:de=>{de.preventDefault(),de.stopPropagation()},onClick:()=>Ts(se),children:e.jsx(rn,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},se.value)),e.jsx(He.Input,{...p,ref:H,value:Te,disabled:k,onValueChange:se=>{re(se),p?.onValueChange?.(se)},onBlur:se=>{ce.current===!1&&B(!1),p?.onBlur?.(se)},onFocus:se=>{B(!0),T&&o?.(us),p?.onFocus?.(se)},placeholder:h&&q.length!==0?"":t,className:y("flex-1 bg-transparent outline-none placeholder:text-muted-foreground",{"w-full":h,"px-3 py-2":q.length===0,"ml-1":q.length!==0},p?.className)}),e.jsx("button",{type:"button",onClick:qa,className:y((_||k||q.length<1||q.filter(se=>se.fixed).length===q.length)&&"hidden"),children:e.jsx(rn,{})})]})}),e.jsx("div",{className:"relative",children:O&&e.jsx(Ks,{className:"absolute top-1 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",onMouseLeave:()=>{ce.current=!1},onMouseEnter:()=>{ce.current=!0},onMouseUp:()=>{H.current?.focus()},children:ee?e.jsx(e.Fragment,{children:c}):e.jsxs(e.Fragment,{children:[Jt(),Dt(),!N&&e.jsx($e,{value:"-",className:"hidden"}),Object.entries(Pt).map(([se,de])=>e.jsx(ns,{heading:se,className:"h-full overflow-auto",children:e.jsx(e.Fragment,{children:de.map(ae=>e.jsx($e,{value:ae.value,disabled:ae.disable,onMouseDown:Gs=>{Gs.preventDefault(),Gs.stopPropagation()},onSelect:()=>{if(q.length>=i){d?.(q.length);return}re("");const Gs=[...q,ae];R(Gs),a?.(Gs)},className:y("cursor-pointer",ae.disable&&"cursor-default text-muted-foreground"),children:ae.label},ae.value))})},se))]})})})]})});wt.displayName="MultipleSelector";const qu=s=>x.object({id:x.number().optional(),name:x.string().min(2,s("messages.nameValidation.min")).max(50,s("messages.nameValidation.max")).regex(/^[a-zA-Z0-9\u4e00-\u9fa5_-]+$/,s("messages.nameValidation.pattern"))});function Aa({refetch:s,dialogTrigger:a,defaultValues:t={name:""},type:l="add"}){const{t:n}=V("group"),r=Ne({resolver:we(qu(n)),defaultValues:t,mode:"onChange"}),[o,c]=m.useState(!1),[u,i]=m.useState(!1),d=async h=>{i(!0),rt.save(h).then(()=>{$.success(n(l==="edit"?"messages.updateSuccess":"messages.createSuccess")),s&&s(),r.reset(),c(!1)}).finally(()=>{i(!1)})};return e.jsxs(he,{open:o,onOpenChange:c,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("span",{children:n("form.add")})]})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(je,{children:[e.jsx(pe,{children:n(l==="edit"?"form.edit":"form.create")}),e.jsx(Re,{children:n(l==="edit"?"form.editDescription":"form.createDescription")})]}),e.jsx(Ce,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(d),className:"space-y-4",children:[e.jsx(v,{control:r.control,name:"name",render:({field:h})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.name")}),e.jsx(b,{children:e.jsx(D,{placeholder:n("form.namePlaceholder"),...h,className:"w-full"})}),e.jsx(M,{children:n("form.nameDescription")}),e.jsx(P,{})]})}),e.jsxs(Le,{className:"gap-2",children:[e.jsx(qs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:n("form.cancel")})}),e.jsxs(L,{type:"submit",disabled:u||!r.formState.isValid,children:[u&&e.jsx(fa,{className:"mr-2 h-4 w-4 animate-spin"}),n(l==="edit"?"form.update":"form.create")]})]})]})})]})]})}const Ur=m.createContext(void 0);function Hu({children:s,refetch:a}){const[t,l]=m.useState(!1),[n,r]=m.useState(null),[o,c]=m.useState(ie.Shadowsocks);return e.jsx(Ur.Provider,{value:{isOpen:t,setIsOpen:l,editingServer:n,setEditingServer:r,serverType:o,setServerType:c,refetch:a},children:s})}function Kr(){const s=m.useContext(Ur);if(s===void 0)throw new Error("useServerEdit must be used within a ServerEditProvider");return s}function Qa({dialogTrigger:s,value:a,setValue:t,templateType:l}){const{t:n}=V("server");m.useEffect(()=>{console.log(a)},[a]);const[r,o]=m.useState(!1),[c,u]=m.useState(()=>{if(!a||Object.keys(a).length===0)return"";try{return JSON.stringify(a,null,2)}catch{return""}}),[i,d]=m.useState(null),h=g=>{if(!g)return null;try{const T=JSON.parse(g);return typeof T!="object"||T===null?n("network_settings.validation.must_be_object"):null}catch{return n("network_settings.validation.invalid_json")}},k={tcp:{label:"TCP",content:{acceptProxyProtocol:!1,header:{type:"none"}}},"tcp-http":{label:"TCP + HTTP",content:{acceptProxyProtocol:!1,header:{type:"http",request:{version:"1.1",method:"GET",path:["/"],headers:{Host:["www.example.com"]}},response:{version:"1.1",status:"200",reason:"OK"}}}},grpc:{label:"gRPC",content:{serviceName:"GunService"}},ws:{label:"WebSocket",content:{path:"/",headers:{Host:"v2ray.com"}}},httpupgrade:{label:"HttpUpgrade",content:{acceptProxyProtocol:!1,path:"/",host:"xray.com",headers:{key:"value"}}},xhttp:{label:"XHTTP",content:{host:"example.com",path:"/yourpath",mode:"auto",extra:{headers:{},xPaddingBytes:"100-1000",noGRPCHeader:!1,noSSEHeader:!1,scMaxEachPostBytes:1e6,scMinPostsIntervalMs:30,scMaxBufferedPosts:30,xmux:{maxConcurrency:"16-32",maxConnections:0,cMaxReuseTimes:"64-128",cMaxLifetimeMs:0,hMaxRequestTimes:"800-900",hKeepAlivePeriod:0},downloadSettings:{address:"",port:443,network:"xhttp",security:"tls",tlsSettings:{},xhttpSettings:{path:"/yourpath"},sockopt:{}}}}}},C=()=>{switch(l){case"tcp":return["tcp","tcp-http"];case"grpc":return["grpc"];case"ws":return["ws"];case"httpupgrade":return["httpupgrade"];case"xhttp":return["xhttp"];default:return[]}},S=()=>{const g=h(c||"");if(g){$.error(g);return}try{if(!c){t(null),o(!1);return}t(JSON.parse(c)),o(!1)}catch{$.error(n("network_settings.errors.save_failed"))}},w=g=>{u(g),d(h(g))},N=g=>{const T=k[g];if(T){const E=JSON.stringify(T.content,null,2);u(E),d(null)}};return m.useEffect(()=>{r&&console.log(a)},[r,a]),m.useEffect(()=>{r&&a&&Object.keys(a).length>0&&u(JSON.stringify(a,null,2))},[r,a]),e.jsxs(he,{open:r,onOpenChange:g=>{!g&&r&&S(),o(g)},children:[e.jsx(is,{asChild:!0,children:s??e.jsx(K,{variant:"link",children:n("network_settings.edit_protocol")})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsx(je,{children:e.jsx(pe,{children:n("network_settings.edit_protocol_config")})}),e.jsxs("div",{className:"space-y-4",children:[C().length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:C().map(g=>e.jsx(K,{variant:"outline",size:"sm",onClick:()=>N(g),children:n("network_settings.use_template",{template:k[g].label})},g))}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ks,{className:`min-h-[200px] font-mono text-sm ${i?"border-red-500 focus-visible:ring-red-500":""}`,value:c,placeholder:C().length>0?n("network_settings.json_config_placeholder_with_template"):n("network_settings.json_config_placeholder"),onChange:g=>w(g.target.value)}),i&&e.jsx("p",{className:"text-sm text-red-500",children:i})]})]}),e.jsxs(Le,{className:"gap-2",children:[e.jsx(K,{variant:"outline",onClick:()=>o(!1),children:n("common.cancel")}),e.jsx(K,{onClick:S,disabled:!!i,children:n("common.confirm")})]})]})]})}function lp(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const Uu={},Ku=Object.freeze(Object.defineProperty({__proto__:null,default:Uu},Symbol.toStringTag,{value:"Module"})),rp=Qc(Ku),ll=s=>s.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),Bu=()=>{try{const s=Oc.box.keyPair(),a=ll(Yn.encodeBase64(s.secretKey)),t=ll(Yn.encodeBase64(s.publicKey));return{privateKey:a,publicKey:t}}catch(s){throw console.error("Error generating x25519 key pair:",s),s}},Gu=()=>{try{return Bu()}catch(s){throw console.error("Error generating key pair:",s),s}},Wu=s=>{const a=new Uint8Array(Math.ceil(s/2));return window.crypto.getRandomValues(a),Array.from(a).map(t=>t.toString(16).padStart(2,"0")).join("").substring(0,s)},Yu=()=>{const s=Math.floor(Math.random()*8)*2+2;return Wu(s)},Ju=x.object({cipher:x.string().default("aes-128-gcm"),plugin:x.string().optional().default(""),plugin_opts:x.string().optional().default(""),client_fingerprint:x.string().optional().default("chrome")}),Qu=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({})}),Xu=x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({})}),Zu=x.object({version:x.coerce.number().default(2),alpn:x.string().default("h2"),obfs:x.object({open:x.coerce.boolean().default(!1),type:x.string().default("salamander"),password:x.string().default("")}).default({}),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),bandwidth:x.object({up:x.string().default(""),down:x.string().default("")}).default({}),hop_interval:x.number().optional(),port_range:x.string().optional()}),ex=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),reality_settings:x.object({server_port:x.coerce.number().default(443),server_name:x.string().default(""),allow_insecure:x.boolean().default(!1),public_key:x.string().default(""),private_key:x.string().default(""),short_id:x.string().default("")}).default({}),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({}),flow:x.string().default("")}),sx=x.object({version:x.coerce.number().default(5),congestion_control:x.string().default("bbr"),alpn:x.array(x.string()).default(["h3"]),udp_relay_mode:x.string().default("native"),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),tx=x.object({}),ax=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),nx=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),lx=x.object({transport:x.string().default("tcp"),multiplexing:x.string().default("MULTIPLEXING_LOW")}),rx=x.object({padding_scheme:x.array(x.string()).optional().default([]),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),Pe={shadowsocks:{schema:Ju,ciphers:["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"],plugins:[{value:"none",label:"None"},{value:"obfs",label:"Simple Obfs"},{value:"v2ray-plugin",label:"V2Ray Plugin"}],clientFingerprints:[{value:"chrome",label:"Chrome"},{value:"firefox",label:"Firefox"},{value:"safari",label:"Safari"},{value:"ios",label:"iOS"}]},vmess:{schema:Qu,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},trojan:{schema:Xu,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},hysteria:{schema:Zu,versions:["1","2"],alpnOptions:["hysteria","http/1.1","h2","h3"]},vless:{schema:ex,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"},{value:"kcp",label:"mKCP"},{value:"httpupgrade",label:"HttpUpgrade"},{value:"xhttp",label:"XHTTP"}],flowOptions:["none","xtls-rprx-direct","xtls-rprx-splice","xtls-rprx-vision"]},tuic:{schema:sx,versions:["5","4"],congestionControls:["bbr","cubic","new_reno"],alpnOptions:[{value:"h3",label:"HTTP/3"},{value:"h2",label:"HTTP/2"},{value:"http/1.1",label:"HTTP/1.1"}],udpRelayModes:[{value:"native",label:"Native"},{value:"quic",label:"QUIC"}]},socks:{schema:tx},naive:{schema:nx},http:{schema:ax},mieru:{schema:lx,transportOptions:[{value:"tcp",label:"TCP"},{value:"udp",label:"UDP"}],multiplexingOptions:[{value:"MULTIPLEXING_OFF",label:"Off"},{value:"MULTIPLEXING_LOW",label:"Low"},{value:"MULTIPLEXING_MIDDLE",label:"Middle"},{value:"MULTIPLEXING_HIGH",label:"High"}]},anytls:{schema:rx,defaultPaddingScheme:["stop=8","0=30-30","1=100-400","2=400-500,c,500-1000,c,500-1000,c,500-1000,c,500-1000","3=9-9,500-1000","4=500-1000","5=500-1000","6=500-1000","7=500-1000"]}},ix=({serverType:s,value:a,onChange:t})=>{const{t:l}=V("server"),n=s?Pe[s]:null,r=n?.schema||x.record(x.any()),o=s?r.parse({}):{},c=Ne({resolver:we(r),defaultValues:o,mode:"onChange"});if(m.useEffect(()=>{if(!a||Object.keys(a).length===0){if(s){const p=r.parse({});c.reset(p)}}else c.reset(a)},[s,a,t,c,r]),m.useEffect(()=>{const p=c.watch(_=>{t(_)});return()=>p.unsubscribe()},[c,t]),!s||!n)return null;const E={shadowsocks:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"cipher",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.shadowsocks.cipher.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.shadowsocks.cipher.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.shadowsocks.ciphers.map(_=>e.jsx(A,{value:_,children:_},_))})})]})})]})}),e.jsx(v,{control:c.control,name:"plugin",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.shadowsocks.plugin.label","插件")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:_=>p.onChange(_==="none"?"":_),value:p.value===""?"none":p.value||"none",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.shadowsocks.plugin.placeholder","选择插件")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.shadowsocks.plugins.map(_=>e.jsx(A,{value:_.value,children:_.label},_.value))})})]})}),e.jsx(M,{children:p.value&&p.value!=="none"&&p.value!==""&&e.jsxs(e.Fragment,{children:[p.value==="obfs"&&l("dynamic_form.shadowsocks.plugin.obfs_hint","提示:配置格式如 obfs=http;obfs-host=www.bing.com;path=/"),p.value==="v2ray-plugin"&&l("dynamic_form.shadowsocks.plugin.v2ray_hint","提示:WebSocket模式格式为 mode=websocket;host=mydomain.me;path=/;tls=true,QUIC模式格式为 mode=quic;host=mydomain.me")]})})]})}),c.watch("plugin")&&c.watch("plugin")!=="none"&&c.watch("plugin")!==""&&e.jsx(v,{control:c.control,name:"plugin_opts",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.shadowsocks.plugin_opts.label","插件选项")}),e.jsx(M,{children:l("dynamic_form.shadowsocks.plugin_opts.description","按照 key=value;key2=value2 格式输入插件选项")}),e.jsx(b,{children:e.jsx(D,{type:"text",placeholder:l("dynamic_form.shadowsocks.plugin_opts.placeholder","例如: mode=tls;host=bing.com"),...p})})]})}),(c.watch("plugin")==="shadow-tls"||c.watch("plugin")==="restls")&&e.jsx(v,{control:c.control,name:"client_fingerprint",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.shadowsocks.client_fingerprint","客户端指纹")}),e.jsx(b,{children:e.jsxs(J,{value:p.value||"chrome",onValueChange:p.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.shadowsocks.client_fingerprint_placeholder","选择客户端指纹")})}),e.jsx(Y,{children:Pe.shadowsocks.clientFingerprints.map(_=>e.jsx(A,{value:_.value,children:_.label},_.value))})]})}),e.jsx(M,{children:l("dynamic_form.shadowsocks.client_fingerprint_description","客户端伪装指纹,用于降低被识别风险")})]})})]}),vmess:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"tls",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vmess.tls.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value?.toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.vmess.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:l("dynamic_form.vmess.tls.disabled")}),e.jsx(A,{value:"1",children:l("dynamic_form.vmess.tls.enabled")})]})]})})]})}),c.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls_settings.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.vmess.tls_settings.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.vmess.tls_settings.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls_settings.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vmess.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]}),e.jsx(v,{control:c.control,name:"network",render:({field:p})=>e.jsxs(f,{children:[e.jsxs(j,{children:[l("dynamic_form.vmess.network.label"),e.jsx(Qa,{value:c.watch("network_settings"),setValue:_=>c.setValue("network_settings",_),templateType:c.watch("network")})]}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.vmess.network.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.vmess.networkOptions.map(_=>e.jsx(A,{value:_.value,className:"cursor-pointer",children:_.label},_.value))})})]})})]})})]}),trojan:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.trojan.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.trojan.server_name.placeholder"),...p,value:p.value||""})})]})}),e.jsx(v,{control:c.control,name:"allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.trojan.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value||!1,onCheckedChange:p.onChange})})})]})})]}),e.jsx(v,{control:c.control,name:"network",render:({field:p})=>e.jsxs(f,{children:[e.jsxs(j,{children:[l("dynamic_form.trojan.network.label"),e.jsx(Qa,{value:c.watch("network_settings")||{},setValue:_=>c.setValue("network_settings",_),templateType:c.watch("network")||"tcp"})]}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value||"tcp",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.trojan.network.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.trojan.networkOptions.map(_=>e.jsx(A,{value:_.value,className:"cursor-pointer",children:_.label},_.value))})})]})})]})})]}),hysteria:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"version",render:({field:p})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:l("dynamic_form.hysteria.version.label")}),e.jsx(b,{children:e.jsxs(J,{value:(p.value||2).toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.hysteria.version.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.hysteria.versions.map(_=>e.jsxs(A,{value:_,className:"cursor-pointer",children:["V",_]},_))})})]})})]})}),c.watch("version")==1&&e.jsx(v,{control:c.control,name:"alpn",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.hysteria.alpn.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value||"h2",onValueChange:p.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.hysteria.alpn.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.hysteria.alpnOptions.map(_=>e.jsx(A,{value:_,children:_},_))})})]})})]})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"obfs.open",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.hysteria.obfs.label")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value||!1,onCheckedChange:p.onChange})})})]})}),!!c.watch("obfs.open")&&e.jsxs(e.Fragment,{children:[c.watch("version")=="2"&&e.jsx(v,{control:c.control,name:"obfs.type",render:({field:p})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:l("dynamic_form.hysteria.obfs.type.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value||"salamander",onValueChange:p.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.hysteria.obfs.type.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:e.jsx(A,{value:"salamander",children:l("dynamic_form.hysteria.obfs.type.salamander")})})})]})})]})}),e.jsx(v,{control:c.control,name:"obfs.password",render:({field:p})=>e.jsxs(f,{className:c.watch("version")==2?"w-full":"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.hysteria.obfs.password.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.hysteria.obfs.password.placeholder"),...p,value:p.value||"",className:"pr-9"})}),e.jsx(K,{type:"button",variant:"ghost",size:"icon",onClick:()=>{const _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",I=Array.from(crypto.getRandomValues(new Uint8Array(16))).map(H=>_[H%_.length]).join("");c.setValue("obfs.password",I),$.success(l("dynamic_form.hysteria.obfs.password.generate_success"))},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(ze,{icon:"ion:refresh-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})]})]})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.hysteria.tls.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.hysteria.tls.server_name.placeholder"),...p,value:p.value||""})})]})}),e.jsx(v,{control:c.control,name:"tls.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.hysteria.tls.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value||!1,onCheckedChange:p.onChange})})})]})})]}),e.jsx(v,{control:c.control,name:"bandwidth.up",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.hysteria.bandwidth.up.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:l("dynamic_form.hysteria.bandwidth.up.placeholder")+(c.watch("version")==2?l("dynamic_form.hysteria.bandwidth.up.bbr_tip"):""),className:"rounded-br-none rounded-tr-none",...p,value:p.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:l("dynamic_form.hysteria.bandwidth.up.suffix")})})]})]})}),e.jsx(v,{control:c.control,name:"bandwidth.down",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.hysteria.bandwidth.down.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:l("dynamic_form.hysteria.bandwidth.down.placeholder")+(c.watch("version")==2?l("dynamic_form.hysteria.bandwidth.down.bbr_tip"):""),className:"rounded-br-none rounded-tr-none",...p,value:p.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:l("dynamic_form.hysteria.bandwidth.down.suffix")})})]})]})}),e.jsx(e.Fragment,{children:e.jsx(v,{control:c.control,name:"hop_interval",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.hysteria.hop_interval.label","Hop 间隔 (秒)")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:l("dynamic_form.hysteria.hop_interval.placeholder","例如: 30"),...p,value:p.value||"",onChange:_=>{const I=_.target.value?parseInt(_.target.value):void 0;p.onChange(I)}})}),e.jsx(M,{children:l("dynamic_form.hysteria.hop_interval.description","Hop 间隔时间,单位为秒")})]})})})]}),vless:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"tls",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.tls.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value?.toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.vless.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:l("dynamic_form.vless.tls.none")}),e.jsx(A,{value:"1",children:l("dynamic_form.vless.tls.tls")}),e.jsx(A,{value:"2",children:l("dynamic_form.vless.tls.reality")})]})]})})]})}),c.watch("tls")=="1"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls_settings.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.vless.tls_settings.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.vless.tls_settings.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls_settings.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]}),c.watch("tls")==2&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"reality_settings.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.vless.reality_settings.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"reality_settings.server_port",render:({field:p})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.server_port.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.vless.reality_settings.server_port.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"reality_settings.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]}),e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(v,{control:c.control,name:"reality_settings.private_key",render:({field:p})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.private_key.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{children:e.jsx(D,{...p,className:"pr-9"})}),e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx(K,{type:"button",variant:"ghost",size:"icon",onClick:()=>{try{const _=Gu();c.setValue("reality_settings.private_key",_.privateKey),c.setValue("reality_settings.public_key",_.publicKey),$.success(l("dynamic_form.vless.reality_settings.key_pair.success"))}catch{$.error(l("dynamic_form.vless.reality_settings.key_pair.error"))}},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(ze,{icon:"ion:key-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})}),e.jsx(ja,{children:e.jsx(xe,{children:e.jsx("p",{children:l("dynamic_form.vless.reality_settings.key_pair.generate")})})})]})]})]})})}),e.jsx(v,{control:c.control,name:"reality_settings.public_key",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.public_key.label")}),e.jsx(b,{children:e.jsx(D,{...p})})]})}),e.jsx(v,{control:c.control,name:"reality_settings.short_id",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.short_id.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{children:e.jsx(D,{...p,className:"pr-9",placeholder:l("dynamic_form.vless.reality_settings.short_id.placeholder")})}),e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx(K,{type:"button",variant:"ghost",size:"icon",onClick:()=>{const _=Yu();c.setValue("reality_settings.short_id",_),$.success(l("dynamic_form.vless.reality_settings.short_id.success"))},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(ze,{icon:"ion:refresh-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})}),e.jsx(ja,{children:e.jsx(xe,{children:e.jsx("p",{children:l("dynamic_form.vless.reality_settings.short_id.generate")})})})]})]}),e.jsx(M,{className:"text-xs text-muted-foreground",children:l("dynamic_form.vless.reality_settings.short_id.description")})]})})]}),e.jsx(v,{control:c.control,name:"network",render:({field:p})=>e.jsxs(f,{children:[e.jsxs(j,{children:[l("dynamic_form.vless.network.label"),e.jsx(Qa,{value:c.watch("network_settings"),setValue:_=>c.setValue("network_settings",_),templateType:c.watch("network")})]}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.vless.network.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.vless.networkOptions.map(_=>e.jsx(A,{value:_.value,className:"cursor-pointer",children:_.label},_.value))})})]})})]})}),e.jsx(v,{control:c.control,name:"flow",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.flow.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:_=>p.onChange(_==="none"?null:_),value:p.value||"none",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.vless.flow.placeholder")})}),e.jsx(Y,{children:Pe.vless.flowOptions.map(_=>e.jsx(A,{value:_,children:_},_))})]})})]})})]}),tuic:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"version",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.tuic.version.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value?.toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.tuic.version.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.tuic.versions.map(_=>e.jsxs(A,{value:_,children:["V",_]},_))})})]})})]})}),e.jsx(v,{control:c.control,name:"congestion_control",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.tuic.congestion_control.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.tuic.congestion_control.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.tuic.congestionControls.map(_=>e.jsx(A,{value:_,children:_.toUpperCase()},_))})})]})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.tuic.tls.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.tuic.tls.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.tuic.tls.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]}),e.jsx(v,{control:c.control,name:"alpn",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.tuic.tls.alpn.label")}),e.jsx(b,{children:e.jsx(wt,{options:Pe.tuic.alpnOptions,onChange:_=>p.onChange(_.map(I=>I.value)),value:Pe.tuic.alpnOptions.filter(_=>p.value?.includes(_.value)),placeholder:l("dynamic_form.tuic.tls.alpn.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:l("dynamic_form.tuic.tls.alpn.empty")})})})]})}),e.jsx(v,{control:c.control,name:"udp_relay_mode",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.tuic.udp_relay_mode.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.tuic.udp_relay_mode.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.tuic.udpRelayModes.map(_=>e.jsx(A,{value:_.value,children:_.label},_.value))})})]})})]})})]}),socks:()=>e.jsx(e.Fragment,{}),naive:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"tls",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.naive.tls.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value?.toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.naive.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:l("dynamic_form.naive.tls.disabled")}),e.jsx(A,{value:"1",children:l("dynamic_form.naive.tls.enabled")})]})]})})]})}),c.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls_settings.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.naive.tls_settings.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.naive.tls_settings.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls_settings.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.naive.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]})]}),http:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"tls",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.http.tls.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value?.toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.http.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:l("dynamic_form.http.tls.disabled")}),e.jsx(A,{value:"1",children:l("dynamic_form.http.tls.enabled")})]})]})})]})}),c.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls_settings.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.http.tls_settings.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.http.tls_settings.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls_settings.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.http.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]})]}),mieru:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"transport",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.mieru.transport.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.mieru.transport.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.mieru.transportOptions.map(_=>e.jsx(A,{value:_.value,children:_.label},_.value))})})]})})]})}),e.jsx(v,{control:c.control,name:"multiplexing",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.mieru.multiplexing.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.mieru.multiplexing.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.mieru.multiplexingOptions.map(_=>e.jsx(A,{value:_.value,children:_.label},_.value))})})]})})]})})]}),anytls:()=>e.jsx(e.Fragment,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:c.control,name:"padding_scheme",render:({field:p})=>e.jsxs(f,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(j,{children:l("dynamic_form.anytls.padding_scheme.label","AnyTLS 填充方案")}),e.jsx(K,{type:"button",variant:"outline",size:"sm",onClick:()=>{c.setValue("padding_scheme",Pe.anytls.defaultPaddingScheme),$.success(l("dynamic_form.anytls.padding_scheme.default_success","已设置默认填充方案"))},className:"h-7 px-2",children:l("dynamic_form.anytls.padding_scheme.use_default","使用默认方案")})]}),e.jsx(M,{children:l("dynamic_form.anytls.padding_scheme.description","每行一个填充规则,格式如: stop=8, 0=30-30")}),e.jsx(b,{children:e.jsx("textarea",{className:"flex min-h-[100px] 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",placeholder:l("dynamic_form.anytls.padding_scheme.placeholder",`例如: +`).filter(Boolean);i.onChange(h),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.emailWhitelist.suffixes.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"recaptcha_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.enable.label")}),e.jsx(M,{children:s("safe.form.recaptcha.enable.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),n.watch("recaptcha_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:n.control,name:"recaptcha_site_key",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.siteKey.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.recaptcha.siteKey.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.recaptcha.siteKey.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"recaptcha_key",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.key.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.recaptcha.key.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.recaptcha.key.description")}),e.jsx(P,{})]})})]}),e.jsx(v,{control:n.control,name:"register_limit_by_ip_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.enable.label")}),e.jsx(M,{children:s("safe.form.registerLimit.enable.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),n.watch("register_limit_by_ip_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:n.control,name:"register_limit_count",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.count.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.registerLimit.count.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.registerLimit.count.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"register_limit_expire",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.expire.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.registerLimit.expire.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.registerLimit.expire.description")}),e.jsx(P,{})]})})]}),e.jsx(v,{control:n.control,name:"password_limit_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.enable.label")}),e.jsx(M,{children:s("safe.form.passwordLimit.enable.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),n.watch("password_limit_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:n.control,name:"password_limit_count",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.count.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.passwordLimit.count.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.passwordLimit.count.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"password_limit_expire",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.expire.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("safe.form.passwordLimit.expire.placeholder"),...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(M,{children:s("safe.form.passwordLimit.expire.description")}),e.jsx(P,{})]})})]}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("safe.form.saving")})]})})}function Tm(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("safe.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("safe.description")})]}),e.jsx(De,{}),e.jsx(km,{})]})}const Dm=Object.freeze(Object.defineProperty({__proto__:null,default:Tm},Symbol.toStringTag,{value:"Module"})),Pm=x.object({plan_change_enable:x.boolean().nullable().default(!1),reset_traffic_method:x.coerce.number().nullable().default(0),surplus_enable:x.boolean().nullable().default(!1),new_order_event_id:x.coerce.number().nullable().default(0),renew_order_event_id:x.coerce.number().nullable().default(0),change_order_event_id:x.coerce.number().nullable().default(0),show_info_to_server_enable:x.boolean().nullable().default(!1),show_protocol_to_server_enable:x.boolean().nullable().default(!1),default_remind_expire:x.boolean().nullable().default(!1),default_remind_traffic:x.boolean().nullable().default(!1),subscribe_path:x.string().nullable().default("s")}),Lm={plan_change_enable:!1,reset_traffic_method:0,surplus_enable:!1,new_order_event_id:0,renew_order_event_id:0,change_order_event_id:0,show_info_to_server_enable:!1,show_protocol_to_server_enable:!1,default_remind_expire:!1,default_remind_traffic:!1,subscribe_path:"s"};function Em(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(Pm),defaultValues:Lm,mode:"onBlur"}),{data:r}=le({queryKey:["settings","subscribe"],queryFn:()=>ce.getSettings("subscribe")}),{mutateAsync:o}=fs({mutationFn:ce.saveSettings,onSuccess:i=>{i.data&&$.success(s("common.autoSaved"))}});m.useEffect(()=>{if(r?.data?.subscribe){const i=r?.data?.subscribe;Object.entries(i).forEach(([d,h])=>{n.setValue(d,h)}),l.current=i}},[r]);const c=m.useCallback(ke.debounce(async i=>{if(!ke.isEqual(i,l.current)){t(!0);try{await o(i),l.current=i}finally{t(!1)}}},1e3),[o]),u=m.useCallback(i=>{c(i)},[c]);return m.useEffect(()=>{const i=n.watch(d=>{u(d)});return()=>i.unsubscribe()},[n.watch,u]),e.jsx(Ce,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:n.control,name:"plan_change_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.plan_change_enable.title")}),e.jsx(M,{children:s("subscribe.plan_change_enable.description")}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"reset_traffic_method",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.reset_traffic_method.title")}),e.jsxs(J,{onValueChange:i.onChange,value:i.value?.toString()||"0",children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择重置方式"})})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("subscribe.reset_traffic_method.options.monthly_first")}),e.jsx(A,{value:"1",children:s("subscribe.reset_traffic_method.options.monthly_reset")}),e.jsx(A,{value:"2",children:s("subscribe.reset_traffic_method.options.no_reset")}),e.jsx(A,{value:"3",children:s("subscribe.reset_traffic_method.options.yearly_first")}),e.jsx(A,{value:"4",children:s("subscribe.reset_traffic_method.options.yearly_reset")})]})]}),e.jsx(M,{children:s("subscribe.reset_traffic_method.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"surplus_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.surplus_enable.title")}),e.jsx(M,{children:s("subscribe.surplus_enable.description")}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"new_order_event_id",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.new_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(b,{children:e.jsxs(J,{onValueChange:i.onChange,value:i.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("subscribe.new_order_event.options.no_action")}),e.jsx(A,{value:"1",children:s("subscribe.new_order_event.options.reset_traffic")})]})]})})}),e.jsx(M,{children:s("subscribe.new_order_event.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"renew_order_event_id",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.renew_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(b,{children:e.jsxs(J,{onValueChange:i.onChange,value:i.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("subscribe.renew_order_event.options.no_action")}),e.jsx(A,{value:"1",children:s("subscribe.renew_order_event.options.reset_traffic")})]})]})})}),e.jsx(M,{children:s("subscribe.renew_order_event.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"change_order_event_id",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.change_order_event.title")}),e.jsx("div",{className:"relative w-max",children:e.jsx(b,{children:e.jsxs(J,{onValueChange:i.onChange,value:i.value?.toString(),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择"})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("subscribe.change_order_event.options.no_action")}),e.jsx(A,{value:"1",children:s("subscribe.change_order_event.options.reset_traffic")})]})]})})}),e.jsx(M,{children:s("subscribe.change_order_event.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"subscribe_path",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("subscribe.subscribe_path.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:"subscribe",...i,value:i.value||"",onChange:d=>{i.onChange(d),u(n.getValues())}})}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[s("subscribe.subscribe_path.description"),e.jsx("br",{}),s("subscribe.subscribe_path.current_format",{path:i.value||"s"})]}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"show_info_to_server_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("subscribe.show_info_to_server.title")}),e.jsx(M,{children:s("subscribe.show_info_to_server.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"show_protocol_to_server_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("subscribe.show_protocol_to_server.title")}),e.jsx(M,{children:s("subscribe.show_protocol_to_server.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value||!1,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function Im(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("subscribe.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("subscribe.description")})]}),e.jsx(De,{}),e.jsx(Em,{})]})}const Rm=Object.freeze(Object.defineProperty({__proto__:null,default:Im},Symbol.toStringTag,{value:"Module"})),Vm=x.object({invite_force:x.boolean().default(!1),invite_commission:x.coerce.string().default("0"),invite_gen_limit:x.coerce.string().default("0"),invite_never_expire:x.boolean().default(!1),commission_first_time_enable:x.boolean().default(!1),commission_auto_check_enable:x.boolean().default(!1),commission_withdraw_limit:x.coerce.string().default("0"),commission_withdraw_method:x.array(x.string()).default(["支付宝","USDT","Paypal"]),withdraw_close_enable:x.boolean().default(!1),commission_distribution_enable:x.boolean().default(!1),commission_distribution_l1:x.coerce.number().default(0),commission_distribution_l2:x.coerce.number().default(0),commission_distribution_l3:x.coerce.number().default(0)}),Fm={invite_force:!1,invite_commission:"0",invite_gen_limit:"0",invite_never_expire:!1,commission_first_time_enable:!1,commission_auto_check_enable:!1,commission_withdraw_limit:"0",commission_withdraw_method:["支付宝","USDT","Paypal"],withdraw_close_enable:!1,commission_distribution_enable:!1,commission_distribution_l1:0,commission_distribution_l2:0,commission_distribution_l3:0};function Mm(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(Vm),defaultValues:Fm,mode:"onBlur"}),{data:r}=le({queryKey:["settings","invite"],queryFn:()=>ce.getSettings("invite")}),{mutateAsync:o}=fs({mutationFn:ce.saveSettings,onSuccess:i=>{i.data&&$.success(s("common.autoSaved"))}});m.useEffect(()=>{if(r?.data?.invite){const i=r?.data?.invite;Object.entries(i).forEach(([d,h])=>{typeof h=="number"?n.setValue(d,String(h)):n.setValue(d,h)}),l.current=i}},[r]);const c=m.useCallback(ke.debounce(async i=>{if(!ke.isEqual(i,l.current)){t(!0);try{await o(i),l.current=i}finally{t(!1)}}},1e3),[o]),u=m.useCallback(i=>{c(i)},[c]);return m.useEffect(()=>{const i=n.watch(d=>{u(d)});return()=>i.unsubscribe()},[n.watch,u]),e.jsx(Ce,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:n.control,name:"invite_force",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.invite_force.title")}),e.jsx(M,{children:s("invite.invite_force.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"invite_commission",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("invite.invite_commission.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("invite.invite_commission.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("invite.invite_commission.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"invite_gen_limit",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("invite.invite_gen_limit.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("invite.invite_gen_limit.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("invite.invite_gen_limit.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"invite_never_expire",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.invite_never_expire.title")}),e.jsx(M,{children:s("invite.invite_never_expire.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"commission_first_time_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_first_time.title")}),e.jsx(M,{children:s("invite.commission_first_time.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"commission_auto_check_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_auto_check.title")}),e.jsx(M,{children:s("invite.commission_auto_check.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"commission_withdraw_limit",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("invite.commission_withdraw_limit.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("invite.commission_withdraw_limit.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("invite.commission_withdraw_limit.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"commission_withdraw_method",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("invite.commission_withdraw_method.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("invite.commission_withdraw_method.placeholder"),...i,value:Array.isArray(i.value)?i.value.join(","):"",onChange:d=>{const h=d.target.value.split(",").filter(Boolean);i.onChange(h),u(n.getValues())}})}),e.jsx(M,{children:s("invite.commission_withdraw_method.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"withdraw_close_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.withdraw_close.title")}),e.jsx(M,{children:s("invite.withdraw_close.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),e.jsx(v,{control:n.control,name:"commission_distribution_enable",render:({field:i})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("invite.commission_distribution.title")}),e.jsx(M,{children:s("invite.commission_distribution.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:d=>{i.onChange(d),u(n.getValues())}})})]})}),n.watch("commission_distribution_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:n.control,name:"commission_distribution_l1",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:s("invite.commission_distribution.l1")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...i,value:i.value||"",onChange:d=>{const h=d.target.value?Number(d.target.value):0;i.onChange(h),u(n.getValues())}})}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"commission_distribution_l2",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:s("invite.commission_distribution.l2")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...i,value:i.value||"",onChange:d=>{const h=d.target.value?Number(d.target.value):0;i.onChange(h),u(n.getValues())}})}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"commission_distribution_l3",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:s("invite.commission_distribution.l3")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("invite.commission_distribution.placeholder"),...i,value:i.value||"",onChange:d=>{const h=d.target.value?Number(d.target.value):0;i.onChange(h),u(n.getValues())}})}),e.jsx(P,{})]})})]}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("invite.saving")})]})})}function Om(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("invite.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("invite.description")})]}),e.jsx(De,{}),e.jsx(Mm,{})]})}const zm=Object.freeze(Object.defineProperty({__proto__:null,default:Om},Symbol.toStringTag,{value:"Module"})),$m=x.object({frontend_theme:x.string().nullable(),frontend_theme_sidebar:x.string().nullable(),frontend_theme_header:x.string().nullable(),frontend_theme_color:x.string().nullable(),frontend_background_url:x.string().url().nullable()}),Am={frontend_theme:"",frontend_theme_sidebar:"",frontend_theme_header:"",frontend_theme_color:"",frontend_background_url:""};function qm(){const{data:s}=le({queryKey:["settings","frontend"],queryFn:()=>ce.getSettings("frontend")}),a=Ne({resolver:we($m),defaultValues:Am,mode:"onChange"});m.useEffect(()=>{if(s?.data?.frontend){const l=s?.data?.frontend;Object.entries(l).forEach(([n,r])=>{a.setValue(n,r)})}},[s]);function t(l){ce.saveSettings(l).then(({data:n})=>{n&&$.success("更新成功")})}return e.jsx(Ce,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(t),className:"space-y-8",children:[e.jsx(v,{control:a.control,name:"frontend_theme_sidebar",render:({field:l})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:"边栏风格"}),e.jsx(M,{children:"边栏风格"})]}),e.jsx(b,{children:e.jsx(Z,{checked:l.value,onCheckedChange:l.onChange})})]})}),e.jsx(v,{control:a.control,name:"frontend_theme_header",render:({field:l})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:"头部风格"}),e.jsx(M,{children:"边栏风格"})]}),e.jsx(b,{children:e.jsx(Z,{checked:l.value,onCheckedChange:l.onChange})})]})}),e.jsx(v,{control:a.control,name:"frontend_theme_color",render:({field:l})=>e.jsxs(f,{children:[e.jsx(j,{children:"主题色"}),e.jsxs("div",{className:"relative w-max",children:[e.jsx(b,{children:e.jsxs("select",{className:y(St({variant:"outline"}),"w-[200px] appearance-none font-normal"),...l,children:[e.jsx("option",{value:"default",children:"默认"}),e.jsx("option",{value:"black",children:"黑色"}),e.jsx("option",{value:"blackblue",children:"暗蓝色"}),e.jsx("option",{value:"green",children:"奶绿色"})]})}),e.jsx(jn,{className:"absolute right-3 top-2.5 h-4 w-4 opacity-50"})]}),e.jsx(M,{children:"主题色"}),e.jsx(P,{})]})}),e.jsx(v,{control:a.control,name:"frontend_background_url",render:({field:l})=>e.jsxs(f,{children:[e.jsx(j,{children:"背景"}),e.jsx(b,{children:e.jsx(D,{placeholder:"请输入图片地址",...l})}),e.jsx(M,{children:"将会在后台登录页面进行展示。"}),e.jsx(P,{})]})}),e.jsx(L,{type:"submit",children:"保存设置"})]})})}function Hm(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"个性化设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"自定义系统界面外观,包括主题风格、布局、颜色方案、背景图等个性化选项。"})]}),e.jsx(De,{}),e.jsx(qm,{})]})}const Um=Object.freeze(Object.defineProperty({__proto__:null,default:Hm},Symbol.toStringTag,{value:"Module"})),Km=x.object({server_pull_interval:x.coerce.number().nullable(),server_push_interval:x.coerce.number().nullable(),server_token:x.string().nullable(),device_limit_mode:x.coerce.number().nullable()}),Bm={server_pull_interval:0,server_push_interval:0,server_token:"",device_limit_mode:0};function Gm(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(Km),defaultValues:Bm,mode:"onBlur"}),{data:r}=le({queryKey:["settings","server"],queryFn:()=>ce.getSettings("server")}),{mutateAsync:o}=fs({mutationFn:ce.saveSettings,onSuccess:d=>{d.data&&$.success(s("common.AutoSaved"))}});m.useEffect(()=>{if(r?.data.server){const d=r.data.server;Object.entries(d).forEach(([h,k])=>{n.setValue(h,k)}),l.current=d}},[r]);const c=m.useCallback(ke.debounce(async d=>{if(!ke.isEqual(d,l.current)){t(!0);try{await o(d),l.current=d}finally{t(!1)}}},1e3),[o]),u=m.useCallback(d=>{c(d)},[c]);m.useEffect(()=>{const d=n.watch(h=>{u(h)});return()=>d.unsubscribe()},[n.watch,u]);const i=()=>{const d=Math.floor(Math.random()*17)+16,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let k="";for(let C=0;Ce.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("server.server_token.title")}),e.jsx(b,{children:e.jsxs("div",{className:"relative",children:[e.jsx(D,{placeholder:s("server.server_token.placeholder"),...d,value:d.value||"",className:"pr-10"}),e.jsx(je,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(K,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2",onClick:h=>{h.preventDefault(),i()},children:e.jsx(Nc,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"})})}),e.jsx(oe,{children:e.jsx("p",{children:s("server.server_token.generate_tooltip")})})]})})]})}),e.jsx(M,{children:s("server.server_token.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"server_pull_interval",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("server.server_pull_interval.title")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("server.server_pull_interval.placeholder"),...d,value:d.value||"",onChange:h=>{const k=h.target.value?Number(h.target.value):null;d.onChange(k)}})}),e.jsx(M,{children:s("server.server_pull_interval.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"server_push_interval",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("server.server_push_interval.title")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("server.server_push_interval.placeholder"),...d,value:d.value||"",onChange:h=>{const k=h.target.value?Number(h.target.value):null;d.onChange(k)}})}),e.jsx(M,{children:s("server.server_push_interval.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"device_limit_mode",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("server.device_limit_mode.title")}),e.jsxs(J,{onValueChange:d.onChange,value:d.value?.toString()||"0",children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:s("server.device_limit_mode.placeholder")})})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("server.device_limit_mode.strict")}),e.jsx(A,{value:"1",children:s("server.device_limit_mode.relaxed")})]})]}),e.jsx(M,{children:s("server.device_limit_mode.description")}),e.jsx(P,{})]})}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("server.saving")})]})})}function Wm(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("server.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("server.description")})]}),e.jsx(De,{}),e.jsx(Gm,{})]})}const Ym=Object.freeze(Object.defineProperty({__proto__:null,default:Wm},Symbol.toStringTag,{value:"Module"}));function Jm({open:s,onOpenChange:a,result:t}){const l=!t.error;return e.jsx(ge,{open:s,onOpenChange:a,children:e.jsxs(pe,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l?e.jsx(Xl,{className:"h-5 w-5 text-green-500"}):e.jsx(Zl,{className:"h-5 w-5 text-destructive"}),e.jsx(fe,{children:l?"邮件发送成功":"邮件发送失败"})]}),e.jsx(Re,{children:l?"测试邮件已成功发送,请检查收件箱":"发送测试邮件时遇到错误"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"发送详情"}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2 text-sm",children:[e.jsx("div",{className:"text-muted-foreground",children:"收件地址"}),e.jsx("div",{children:t.email}),e.jsx("div",{className:"text-muted-foreground",children:"邮件主题"}),e.jsx("div",{children:t.subject}),e.jsx("div",{className:"text-muted-foreground",children:"模板名称"}),e.jsx("div",{children:t.template_name})]})]}),t.error&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium text-destructive",children:"错误信息"}),e.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive break-all",children:t.error})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"配置信息"}),e.jsx(_t,{className:"h-[200px] rounded-md border p-4",children:e.jsx("div",{className:"grid gap-2 text-sm",children:e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2",children:[e.jsx("div",{className:"text-muted-foreground",children:"驱动"}),e.jsx("div",{children:t.config.driver}),e.jsx("div",{className:"text-muted-foreground",children:"服务器"}),e.jsx("div",{children:t.config.host}),e.jsx("div",{className:"text-muted-foreground",children:"端口"}),e.jsx("div",{children:t.config.port}),e.jsx("div",{className:"text-muted-foreground",children:"加密方式"}),e.jsx("div",{children:t.config.encryption||"无"}),e.jsx("div",{className:"text-muted-foreground",children:"发件人"}),e.jsx("div",{children:t.config.from.address?`${t.config.from.address}${t.config.from.name?` (${t.config.from.name})`:""}`:"未设置"}),e.jsx("div",{className:"text-muted-foreground",children:"用户名"}),e.jsx("div",{children:t.config.username||"未设置"})]})})})]})]})]})})}const Qm=x.object({email_template:x.string().nullable().default("classic"),email_host:x.string().nullable().default(""),email_port:x.coerce.number().nullable().default(465),email_username:x.string().nullable().default(""),email_password:x.string().nullable().default(""),email_encryption:x.string().nullable().default(""),email_from_address:x.string().email().nullable().default(""),remind_mail_enable:x.boolean().nullable().default(!1)});function Xm(){const{t:s}=V("settings"),[a,t]=m.useState(null),[l,n]=m.useState(!1),r=m.useRef(null),[o,c]=m.useState(!1),u=Ne({resolver:we(Qm),defaultValues:{},mode:"onBlur"}),{data:i}=le({queryKey:["settings","email"],queryFn:()=>ce.getSettings("email")}),{data:d}=le({queryKey:["emailTemplate"],queryFn:()=>ce.getEmailTemplate()}),{mutateAsync:h}=fs({mutationFn:ce.saveSettings,onSuccess:N=>{N.data&&$.success(s("common.autoSaved"))}}),{mutate:k,isPending:C}=fs({mutationFn:ce.sendTestMail,onMutate:()=>{t(null),n(!1)},onSuccess:N=>{t(N.data),n(!0),N.data.error?$.error(s("email.test.error")):$.success(s("email.test.success"))}});m.useEffect(()=>{if(i?.data.email){const N=i.data.email;Object.entries(N).forEach(([g,T])=>{u.setValue(g,T)}),r.current=N}},[i]);const S=m.useCallback(ke.debounce(async N=>{if(!ke.isEqual(N,r.current)){c(!0);try{await h(N),r.current=N}finally{c(!1)}}},1e3),[h]),w=m.useCallback(N=>{S(N)},[S]);return m.useEffect(()=>{const N=u.watch(g=>{w(g)});return()=>N.unsubscribe()},[u.watch,w]),e.jsxs(e.Fragment,{children:[e.jsx(Ce,{...u,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:u.control,name:"email_host",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_host.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(M,{children:s("email.email_host.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_port",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_port.title")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:s("common.placeholder"),...N,value:N.value||"",onChange:g=>{const T=g.target.value?Number(g.target.value):null;N.onChange(T)}})}),e.jsx(M,{children:s("email.email_port.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_encryption",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_encryption.title")}),e.jsxs(J,{onValueChange:g=>{const T=g==="none"?"":g;N.onChange(T)},value:N.value===""||N.value===null||N.value===void 0?"none":N.value,children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:"请选择加密方式"})})}),e.jsxs(Y,{children:[e.jsx(A,{value:"none",children:s("email.email_encryption.none")}),e.jsx(A,{value:"ssl",children:s("email.email_encryption.ssl")}),e.jsx(A,{value:"tls",children:s("email.email_encryption.tls")})]})]}),e.jsx(M,{children:s("email.email_encryption.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_username",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_username.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(M,{children:s("email.email_username.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_password",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_password.title")}),e.jsx(b,{children:e.jsx(D,{type:"password",placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(M,{children:s("email.email_password.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_from_address",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_from.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...N,value:N.value||""})}),e.jsx(M,{children:s("email.email_from.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"email_template",render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("email.email_template.title")}),e.jsxs(J,{onValueChange:g=>{N.onChange(g),w(u.getValues())},value:N.value||void 0,children:[e.jsx(b,{children:e.jsx(W,{className:"w-[200px]",children:e.jsx(Q,{placeholder:s("email.email_template.placeholder")})})}),e.jsx(Y,{children:d?.data?.map(g=>e.jsx(A,{value:g,children:g},g))})]}),e.jsx(M,{children:s("email.email_template.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"remind_mail_enable",render:({field:N})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("email.remind_mail.title")}),e.jsx(M,{children:s("email.remind_mail.description")})]}),e.jsx(b,{children:e.jsx(Z,{checked:N.value||!1,onCheckedChange:g=>{N.onChange(g),w(u.getValues())}})})]})}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(L,{onClick:()=>k(),loading:C,disabled:C,children:s(C?"email.test.sending":"email.test.title")})})]})}),o&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("saving")}),a&&e.jsx(Jm,{open:l,onOpenChange:n,result:a})]})}function Zm(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("email.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("email.description")})]}),e.jsx(De,{}),e.jsx(Xm,{})]})}const eu=Object.freeze(Object.defineProperty({__proto__:null,default:Zm},Symbol.toStringTag,{value:"Module"})),su=x.object({telegram_bot_enable:x.boolean().nullable(),telegram_bot_token:x.string().nullable(),telegram_discuss_link:x.string().nullable()}),tu={telegram_bot_enable:!1,telegram_bot_token:"",telegram_discuss_link:""};function au(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(su),defaultValues:tu,mode:"onBlur"}),{data:r}=le({queryKey:["settings","telegram"],queryFn:()=>ce.getSettings("telegram")}),{mutateAsync:o}=fs({mutationFn:ce.saveSettings,onSuccess:h=>{h.data&&$.success(s("common.autoSaved"))}}),{mutate:c,isPending:u}=fs({mutationFn:ce.setTelegramWebhook,onSuccess:h=>{h.data&&$.success(s("telegram.webhook.success"))}});m.useEffect(()=>{if(r?.data.telegram){const h=r.data.telegram;Object.entries(h).forEach(([k,C])=>{n.setValue(k,C)}),l.current=h}},[r]);const i=m.useCallback(ke.debounce(async h=>{if(!ke.isEqual(h,l.current)){t(!0);try{await o(h),l.current=h}finally{t(!1)}}},1e3),[o]),d=m.useCallback(h=>{i(h)},[i]);return m.useEffect(()=>{const h=n.watch(k=>{d(k)});return()=>h.unsubscribe()},[n.watch,d]),e.jsx(Ce,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:n.control,name:"telegram_bot_token",render:({field:h})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("telegram.bot_token.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("telegram.bot_token.placeholder"),...h,value:h.value||""})}),e.jsx(M,{children:s("telegram.bot_token.description")}),e.jsx(P,{})]})}),n.watch("telegram_bot_token")&&e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("telegram.webhook.title")}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(L,{loading:u,disabled:u,onClick:()=>c(),children:s(u?"telegram.webhook.setting":"telegram.webhook.button")}),a&&e.jsx("span",{className:"text-sm text-muted-foreground",children:s("common.saving")})]}),e.jsx(M,{children:s("telegram.webhook.description")}),e.jsx(P,{})]}),e.jsx(v,{control:n.control,name:"telegram_bot_enable",render:({field:h})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("telegram.bot_enable.title")}),e.jsx(M,{children:s("telegram.bot_enable.description")}),e.jsx(b,{children:e.jsx(Z,{checked:h.value||!1,onCheckedChange:k=>{h.onChange(k),d(n.getValues())}})}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"telegram_discuss_link",render:({field:h})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("telegram.discuss_link.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("telegram.discuss_link.placeholder"),...h,value:h.value||""})}),e.jsx(M,{children:s("telegram.discuss_link.description")}),e.jsx(P,{})]})}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function nu(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("telegram.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("telegram.description")})]}),e.jsx(De,{}),e.jsx(au,{})]})}const lu=Object.freeze(Object.defineProperty({__proto__:null,default:nu},Symbol.toStringTag,{value:"Module"})),ru=x.object({windows_version:x.string().nullable(),windows_download_url:x.string().nullable(),macos_version:x.string().nullable(),macos_download_url:x.string().nullable(),android_version:x.string().nullable(),android_download_url:x.string().nullable()}),iu={windows_version:"",windows_download_url:"",macos_version:"",macos_download_url:"",android_version:"",android_download_url:""};function ou(){const{t:s}=V("settings"),[a,t]=m.useState(!1),l=m.useRef(null),n=Ne({resolver:we(ru),defaultValues:iu,mode:"onBlur"}),{data:r}=le({queryKey:["settings","app"],queryFn:()=>ce.getSettings("app")}),{mutateAsync:o}=fs({mutationFn:ce.saveSettings,onSuccess:i=>{i.data&&$.success(s("app.save_success"))}});m.useEffect(()=>{if(r?.data.app){const i=r.data.app;Object.entries(i).forEach(([d,h])=>{n.setValue(d,h)}),l.current=i}},[r]);const c=m.useCallback(ke.debounce(async i=>{if(!ke.isEqual(i,l.current)){t(!0);try{await o(i),l.current=i}finally{t(!1)}}},1e3),[o]),u=m.useCallback(i=>{c(i)},[c]);return m.useEffect(()=>{const i=n.watch(d=>{u(d)});return()=>i.unsubscribe()},[n.watch,u]),e.jsx(Ce,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:n.control,name:"windows_version",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.windows.version.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.windows.version.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"windows_download_url",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.windows.download.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.windows.download.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"macos_version",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.macos.version.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.macos.version.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"macos_download_url",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.macos.download.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.macos.download.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"android_version",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.android.version.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.android.version.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"android_download_url",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:s("app.android.download.title")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("common.placeholder"),...i,value:i.value||""})}),e.jsx(M,{children:s("app.android.download.description")}),e.jsx(P,{})]})}),a&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("common.saving")})]})})}function cu(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("app.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("app.description")})]}),e.jsx(De,{}),e.jsx(ou,{})]})}const du=Object.freeze(Object.defineProperty({__proto__:null,default:cu},Symbol.toStringTag,{value:"Module"})),mu=s=>x.object({id:x.number().nullable(),name:x.string().min(2,s("form.validation.name.min")).max(30,s("form.validation.name.max")),icon:x.string().optional().nullable(),notify_domain:x.string().refine(t=>!t||/^https?:\/\/\S+/.test(t),s("form.validation.notify_domain.url")).optional().nullable(),handling_fee_fixed:x.coerce.number().min(0).optional().nullable(),handling_fee_percent:x.coerce.number().min(0).max(100).optional().nullable(),payment:x.string().min(1,s("form.validation.payment.required")),config:x.record(x.string(),x.string())}),al={id:null,name:"",icon:"",notify_domain:"",handling_fee_fixed:0,handling_fee_percent:0,payment:"",config:{}};function Mr({refetch:s,dialogTrigger:a,type:t="add",defaultFormValues:l=al}){const{t:n}=V("payment"),[r,o]=m.useState(!1),[c,u]=m.useState(!1),[i,d]=m.useState([]),[h,k]=m.useState([]),C=mu(n),S=Ne({resolver:we(C),defaultValues:l,mode:"onChange"}),w=S.watch("payment");m.useEffect(()=>{r&&(async()=>{const{data:T}=await et.getMethodList();d(T)})()},[r]),m.useEffect(()=>{if(!w||!r)return;(async()=>{const T={payment:w,...t==="edit"&&{id:Number(S.getValues("id"))}};et.getMethodForm(T).then(({data:E})=>{k(E);const p=E.reduce((_,I)=>(I.field_name&&(_[I.field_name]=I.value??""),_),{});S.setValue("config",p)})})()},[w,r,S,t]);const N=async g=>{u(!0);try{(await et.save(g)).data&&($.success(n("form.messages.success")),S.reset(al),s(),o(!1))}finally{u(!1)}};return e.jsxs(ge,{open:r,onOpenChange:o,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"})," ",e.jsx("div",{children:n("form.add.button")})]})}),e.jsxs(pe,{className:"sm:max-w-[425px]",children:[e.jsx(ve,{children:e.jsx(fe,{children:n(t==="add"?"form.add.title":"form.edit.title")})}),e.jsx(Ce,{...S,children:e.jsxs("form",{onSubmit:S.handleSubmit(N),className:"space-y-4",children:[e.jsx(v,{control:S.control,name:"name",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:n("form.fields.name.placeholder"),...g})}),e.jsx(M,{children:n("form.fields.name.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:S.control,name:"icon",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.icon.label")}),e.jsx(b,{children:e.jsx(D,{...g,value:g.value||"",placeholder:n("form.fields.icon.placeholder")})}),e.jsx(M,{children:n("form.fields.icon.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:S.control,name:"notify_domain",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.notify_domain.label")}),e.jsx(b,{children:e.jsx(D,{...g,value:g.value||"",placeholder:n("form.fields.notify_domain.placeholder")})}),e.jsx(M,{children:n("form.fields.notify_domain.description")}),e.jsx(P,{})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(v,{control:S.control,name:"handling_fee_percent",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.handling_fee_percent.label")}),e.jsx(b,{children:e.jsx(D,{type:"number",...g,value:g.value||"",placeholder:n("form.fields.handling_fee_percent.placeholder")})}),e.jsx(P,{})]})}),e.jsx(v,{control:S.control,name:"handling_fee_fixed",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.handling_fee_fixed.label")}),e.jsx(b,{children:e.jsx(D,{type:"number",...g,value:g.value||"",placeholder:n("form.fields.handling_fee_fixed.placeholder")})}),e.jsx(P,{})]})})]}),e.jsx(v,{control:S.control,name:"payment",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.payment.label")}),e.jsxs(J,{onValueChange:g.onChange,defaultValue:g.value,children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:n("form.fields.payment.placeholder")})})}),e.jsx(Y,{children:i.map(T=>e.jsx(A,{value:T,children:T},T))})]}),e.jsx(M,{children:n("form.fields.payment.description")}),e.jsx(P,{})]})}),h.length>0&&e.jsx("div",{className:"space-y-4",children:h.map(g=>e.jsx(v,{control:S.control,name:`config.${g.field_name}`,render:({field:T})=>e.jsxs(f,{children:[e.jsx(j,{children:g.label}),e.jsx(b,{children:e.jsx(D,{...T,value:T.value||""})}),e.jsx(P,{})]})},g.field_name))}),e.jsxs(Le,{children:[e.jsx(qs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:n("form.buttons.cancel")})}),e.jsx(L,{type:"submit",disabled:c,children:n("form.buttons.submit")})]})]})})]})]})}function z({column:s,title:a,tooltip:t,className:l}){return s.getCanSort()?e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(L,{variant:"ghost",size:"default",className:y("-ml-3 flex h-8 items-center gap-2 text-nowrap font-medium hover:bg-muted/60",l),onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:[e.jsx("span",{children:a}),t&&e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(Wn,{className:"h-4 w-4 cursor-pointer text-muted-foreground"})}),e.jsx(oe,{children:t})]})}),s.getIsSorted()==="asc"?e.jsx(tn,{className:"h-4 w-4 text-foreground/70"}):s.getIsSorted()==="desc"?e.jsx(an,{className:"h-4 w-4 text-foreground/70"}):e.jsx(_c,{className:"h-4 w-4 text-muted-foreground/70 transition-colors hover:text-foreground/70"})]})})}):e.jsxs("div",{className:y("flex items-center space-x-1 text-nowrap py-2 font-medium text-muted-foreground",l),children:[e.jsx("span",{children:a}),t&&e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{children:e.jsx(Wn,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(oe,{children:t})]})})]})}const kn=wc,Or=Cc,uu=Sc,zr=m.forwardRef(({className:s,...a},t)=>e.jsx(sr,{className:y("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",s),...a,ref:t}));zr.displayName=sr.displayName;const Va=m.forwardRef(({className:s,...a},t)=>e.jsxs(uu,{children:[e.jsx(zr,{}),e.jsx(tr,{ref:t,className:y("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",s),...a})]}));Va.displayName=tr.displayName;const Fa=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col space-y-2 text-center sm:text-left",s),...a});Fa.displayName="AlertDialogHeader";const Ma=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});Ma.displayName="AlertDialogFooter";const Oa=m.forwardRef(({className:s,...a},t)=>e.jsx(ar,{ref:t,className:y("text-lg font-semibold",s),...a}));Oa.displayName=ar.displayName;const za=m.forwardRef(({className:s,...a},t)=>e.jsx(nr,{ref:t,className:y("text-sm text-muted-foreground",s),...a}));za.displayName=nr.displayName;const $a=m.forwardRef(({className:s,...a},t)=>e.jsx(lr,{ref:t,className:y(yt(),s),...a}));$a.displayName=lr.displayName;const Aa=m.forwardRef(({className:s,...a},t)=>e.jsx(rr,{ref:t,className:y(yt({variant:"outline"}),"mt-2 sm:mt-0",s),...a}));Aa.displayName=rr.displayName;function ls({onConfirm:s,children:a,title:t="确认操作",description:l="确定要执行此操作吗?",cancelText:n="取消",confirmText:r="确认",variant:o="default",className:c}){return e.jsxs(kn,{children:[e.jsx(Or,{asChild:!0,children:a}),e.jsxs(Va,{className:y("sm:max-w-[425px]",c),children:[e.jsxs(Fa,{children:[e.jsx(Oa,{children:t}),e.jsx(za,{children:l})]}),e.jsxs(Ma,{children:[e.jsx(Aa,{asChild:!0,children:e.jsx(L,{variant:"outline",children:n})}),e.jsx($a,{asChild:!0,children:e.jsx(L,{variant:o,onClick:s,children:r})})]})]})]})}const $r=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M11.29 15.29a2 2 0 0 0-.12.15a.8.8 0 0 0-.09.18a.6.6 0 0 0-.06.18a1.4 1.4 0 0 0 0 .2a.84.84 0 0 0 .08.38a.9.9 0 0 0 .54.54a.94.94 0 0 0 .76 0a.9.9 0 0 0 .54-.54A1 1 0 0 0 13 16a1 1 0 0 0-.29-.71a1 1 0 0 0-1.42 0M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8 8 0 0 1-8 8m0-13a3 3 0 0 0-2.6 1.5a1 1 0 1 0 1.73 1A1 1 0 0 1 12 9a1 1 0 0 1 0 2a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-.18A3 3 0 0 0 12 7"})}),xu=({refetch:s,isSortMode:a=!1})=>{const{t}=V("payment");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:a?"cursor-move":"opacity-0",children:e.jsx(Da,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:l})=>e.jsx(z,{column:l,title:t("table.columns.id")}),cell:({row:l})=>e.jsx(G,{variant:"outline",children:l.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"enable",header:({column:l})=>e.jsx(z,{column:l,title:t("table.columns.enable")}),cell:({row:l})=>e.jsx(Z,{defaultChecked:l.getValue("enable"),onCheckedChange:async()=>{const{data:n}=await et.updateStatus({id:l.original.id});n||s()}}),enableSorting:!1,size:100},{accessorKey:"name",header:({column:l})=>e.jsx(z,{column:l,title:t("table.columns.name")}),cell:({row:l})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:l.getValue("name")})}),enableSorting:!1,size:200},{accessorKey:"payment",header:({column:l})=>e.jsx(z,{column:l,title:t("table.columns.payment")}),cell:({row:l})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:l.getValue("payment")})}),enableSorting:!1,size:200},{accessorKey:"notify_url",header:({column:l})=>e.jsxs("div",{className:"flex items-center",children:[e.jsx(z,{column:l,title:t("table.columns.notify_url")}),e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{className:"ml-1",children:e.jsx($r,{className:"h-4 w-4"})}),e.jsx(oe,{children:t("table.columns.notify_url_tooltip")})]})})]}),cell:({row:l})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[300px] truncate font-medium",children:l.getValue("notify_url")})}),enableSorting:!1,size:3e3},{id:"actions",header:({column:l})=>e.jsx(z,{className:"justify-end",column:l,title:t("table.columns.actions")}),cell:({row:l})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(Mr,{refetch:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:t("table.actions.edit")})]}),type:"edit",defaultFormValues:l.original}),e.jsx(ls,{title:t("table.actions.delete.title"),description:t("table.actions.delete.description"),onConfirm:async()=>{const{data:n}=await et.drop({id:l.original.id});n&&s()},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-destructive/10",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-destructive"}),e.jsx("span",{className:"sr-only",children:t("table.actions.delete.title")})]})})]}),size:100}]};function hu({table:s,refetch:a,saveOrder:t,isSortMode:l}){const{t:n}=V("payment"),r=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between",children:[l?e.jsx("p",{className:"text-sm text-muted-foreground",children:n("table.toolbar.sort.hint")}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Mr,{refetch:a}),e.jsx(D,{placeholder:n("table.toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:o=>s.getColumn("name")?.setFilterValue(o.target.value),className:"h-8 w-[250px]"}),r&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:[n("table.toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:l?"default":"outline",onClick:t,size:"sm",children:n(l?"table.toolbar.sort.save":"table.toolbar.sort.edit")})})]})}function pu(){const[s,a]=m.useState([]),[t,l]=m.useState([]),[n,r]=m.useState(!1),[o,c]=m.useState([]),[u,i]=m.useState({"drag-handle":!1}),[d,h]=m.useState({pageSize:20,pageIndex:0}),{refetch:k}=le({queryKey:["paymentList"],queryFn:async()=>{const{data:g}=await et.getList();return c(g?.map(T=>({...T,enable:!!T.enable}))||[]),g}});m.useEffect(()=>{i({"drag-handle":n,actions:!n}),h({pageSize:n?99999:10,pageIndex:0})},[n]);const C=(g,T)=>{n&&(g.dataTransfer.setData("text/plain",T.toString()),g.currentTarget.classList.add("opacity-50"))},S=(g,T)=>{if(!n)return;g.preventDefault(),g.currentTarget.classList.remove("bg-muted");const E=parseInt(g.dataTransfer.getData("text/plain"));if(E===T)return;const p=[...o],[_]=p.splice(E,1);p.splice(T,0,_),c(p)},w=async()=>{n?et.sort({ids:o.map(g=>g.id)}).then(()=>{k(),r(!1),$.success("排序保存成功")}):r(!0)},N=Je({data:o,columns:xu({refetch:k,isSortMode:n}),state:{sorting:t,columnFilters:s,columnVisibility:u,pagination:d},onSortingChange:l,onColumnFiltersChange:a,onColumnVisibilityChange:i,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),initialState:{columnPinning:{right:["actions"]}},pageCount:n?1:void 0});return e.jsx(os,{table:N,toolbar:g=>e.jsx(hu,{table:g,refetch:k,saveOrder:w,isSortMode:n}),draggable:n,onDragStart:C,onDragEnd:g=>g.currentTarget.classList.remove("opacity-50"),onDragOver:g=>{g.preventDefault(),g.currentTarget.classList.add("bg-muted")},onDragLeave:g=>g.currentTarget.classList.remove("bg-muted"),onDrop:S,showPagination:!n})}function gu(){const{t:s}=V("payment");return e.jsxs(Ve,{children:[e.jsxs(Fe,{className:"flex items-center justify-between",children:[e.jsx(Xe,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{children:[e.jsx("header",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("section",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(pu,{})})]})]})}const fu=Object.freeze(Object.defineProperty({__proto__:null,default:gu},Symbol.toStringTag,{value:"Module"}));function ju({pluginName:s,onClose:a,onSuccess:t}){const{t:l}=V("plugin"),[n,r]=m.useState(!0),[o,c]=m.useState(!1),[u,i]=m.useState(null),d=kc({config:Tc(Dc())}),h=Ne({resolver:we(d),defaultValues:{config:{}}});m.useEffect(()=>{(async()=>{try{const{data:w}=await Ps.getPluginConfig(s);i(w),h.reset({config:Object.fromEntries(Object.entries(w).map(([N,g])=>[N,g.value]))})}catch{$.error(l("messages.configLoadError"))}finally{r(!1)}})()},[s]);const k=async S=>{c(!0);try{await Ps.updatePluginConfig(s,S.config),$.success(l("messages.configSaveSuccess")),t()}catch{$.error(l("messages.configSaveError"))}finally{c(!1)}},C=(S,w)=>{switch(w.type){case"string":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{children:w.label||w.description}),e.jsx(b,{children:e.jsx(D,{placeholder:w.placeholder,...N})}),w.description&&w.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:w.description}),e.jsx(P,{})]})},S);case"number":case"percentage":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{children:w.label||w.description}),e.jsx(b,{children:e.jsxs("div",{className:"relative",children:[e.jsx(D,{type:"number",placeholder:w.placeholder,...N,onChange:g=>{const T=Number(g.target.value);w.type==="percentage"?N.onChange(Math.min(100,Math.max(0,T))):N.onChange(T)},className:w.type==="percentage"?"pr-8":"",min:w.type==="percentage"?0:void 0,max:w.type==="percentage"?100:void 0,step:w.type==="percentage"?1:void 0}),w.type==="percentage"&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:e.jsx(Pc,{className:"h-4 w-4 text-muted-foreground"})})]})}),w.description&&w.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:w.description}),e.jsx(P,{})]})},S);case"select":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{children:w.label||w.description}),e.jsxs(J,{onValueChange:N.onChange,defaultValue:N.value,children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:w.placeholder})})}),e.jsx(Y,{children:w.options?.map(g=>e.jsx(A,{value:g.value,children:g.label},g.value))})]}),w.description&&w.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:w.description}),e.jsx(P,{})]})},S);case"boolean":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(f,{className:"flex flex-row items-center justify-between rounded-lg border p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:w.label||w.description}),w.description&&w.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:w.description})]}),e.jsx(b,{children:e.jsx(Z,{checked:N.value,onCheckedChange:N.onChange})})]})},S);case"text":return e.jsx(v,{control:h.control,name:`config.${S}`,render:({field:N})=>e.jsxs(f,{children:[e.jsx(j,{children:w.label||w.description}),e.jsx(b,{children:e.jsx(ks,{placeholder:w.placeholder,...N})}),w.description&&w.label&&e.jsx("p",{className:"text-sm text-muted-foreground",children:w.description}),e.jsx(P,{})]})},S);default:return null}};return n?e.jsxs("div",{className:"space-y-4",children:[e.jsx(he,{className:"h-4 w-[200px]"}),e.jsx(he,{className:"h-10 w-full"}),e.jsx(he,{className:"h-4 w-[200px]"}),e.jsx(he,{className:"h-10 w-full"})]}):e.jsx(Ce,{...h,children:e.jsxs("form",{onSubmit:h.handleSubmit(k),className:"space-y-4",children:[u&&Object.entries(u).map(([S,w])=>C(S,w)),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(L,{type:"button",variant:"outline",onClick:a,disabled:o,children:l("config.cancel")}),e.jsx(L,{type:"submit",loading:o,disabled:o,children:l("config.save")})]})]})})}function vu(){const{t:s}=V("plugin"),[a,t]=m.useState(null),[l,n]=m.useState(!1),[r,o]=m.useState(null),[c,u]=m.useState(""),[i,d]=m.useState("all"),[h,k]=m.useState(!1),[C,S]=m.useState(!1),[w,N]=m.useState(!1),g=m.useRef(null),{data:T,isLoading:E,refetch:p}=le({queryKey:["pluginList"],queryFn:async()=>{const{data:R}=await Ps.getPluginList();return R}});T&&[...new Set(T.map(R=>R.category||"other"))];const _=T?.filter(R=>{const X=R.name.toLowerCase().includes(c.toLowerCase())||R.description.toLowerCase().includes(c.toLowerCase())||R.code.toLowerCase().includes(c.toLowerCase()),ms=i==="all"||R.category===i;return X&&ms}),I=async R=>{t(R),Ps.installPlugin(R).then(()=>{$.success(s("messages.installSuccess")),p()}).catch(X=>{$.error(X.message||s("messages.installError"))}).finally(()=>{t(null)})},H=async R=>{t(R),Ps.uninstallPlugin(R).then(()=>{$.success(s("messages.uninstallSuccess")),p()}).catch(X=>{$.error(X.message||s("messages.uninstallError"))}).finally(()=>{t(null)})},O=async(R,X)=>{t(R),(X?Ps.disablePlugin:Ps.enablePlugin)(R).then(()=>{$.success(s(X?"messages.disableSuccess":"messages.enableSuccess")),p()}).catch(Te=>{$.error(Te.message||s(X?"messages.disableError":"messages.enableError"))}).finally(()=>{t(null)})},B=R=>{T?.find(X=>X.code===R),o(R),n(!0)},ue=async R=>{if(!R.name.endsWith(".zip")){$.error(s("upload.error.format"));return}k(!0),Ps.uploadPlugin(R).then(()=>{$.success(s("messages.uploadSuccess")),S(!1),p()}).catch(X=>{$.error(X.message||s("messages.uploadError"))}).finally(()=>{k(!1),g.current&&(g.current.value="")})},ee=R=>{R.preventDefault(),R.stopPropagation(),R.type==="dragenter"||R.type==="dragover"?N(!0):R.type==="dragleave"&&N(!1)},te=R=>{R.preventDefault(),R.stopPropagation(),N(!1),R.dataTransfer.files&&R.dataTransfer.files[0]&&ue(R.dataTransfer.files[0])},q=async R=>{t(R),Ps.deletePlugin(R).then(()=>{$.success(s("messages.deleteSuccess")),p()}).catch(X=>{$.error(X.message||s("messages.deleteError"))}).finally(()=>{t(null)})};return e.jsxs(Ve,{children:[e.jsxs(Fe,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(gn,{className:"h-6 w-6"}),e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s("title")})]}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{children:[e.jsxs("div",{className:"mb-8 space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"relative max-w-sm flex-1",children:[e.jsx(fn,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(D,{placeholder:s("search.placeholder"),value:c,onChange:R=>u(R.target.value),className:"pl-9"})]}),e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs(L,{onClick:()=>S(!0),variant:"outline",className:"shrink-0",size:"sm",children:[e.jsx(Kt,{className:"mr-2 h-4 w-4"}),s("upload.button")]})})]}),e.jsxs(Wt,{defaultValue:"all",className:"w-full",children:[e.jsxs(kt,{children:[e.jsx(es,{value:"all",children:s("tabs.all")}),e.jsx(es,{value:"installed",children:s("tabs.installed")}),e.jsx(es,{value:"available",children:s("tabs.available")})]}),e.jsx(Ls,{value:"all",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:E?e.jsxs(e.Fragment,{children:[e.jsx(Ja,{}),e.jsx(Ja,{}),e.jsx(Ja,{})]}):_?.map(R=>e.jsx(Ya,{plugin:R,onInstall:I,onUninstall:H,onToggleEnable:O,onOpenConfig:B,onDelete:q,isLoading:a===R.name},R.name))})}),e.jsx(Ls,{value:"installed",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:_?.filter(R=>R.is_installed).map(R=>e.jsx(Ya,{plugin:R,onInstall:I,onUninstall:H,onToggleEnable:O,onOpenConfig:B,onDelete:q,isLoading:a===R.name},R.name))})}),e.jsx(Ls,{value:"available",className:"mt-6",children:e.jsx("div",{className:"space-y-4",children:_?.filter(R=>!R.is_installed).map(R=>e.jsx(Ya,{plugin:R,onInstall:I,onUninstall:H,onToggleEnable:O,onOpenConfig:B,onDelete:q,isLoading:a===R.name},R.code))})})]})]}),e.jsx(ge,{open:l,onOpenChange:n,children:e.jsxs(pe,{className:"sm:max-w-lg",children:[e.jsxs(ve,{children:[e.jsxs(fe,{children:[T?.find(R=>R.code===r)?.name," ",s("config.title")]}),e.jsx(Re,{children:s("config.description")})]}),r&&e.jsx(ju,{pluginName:r,onClose:()=>n(!1),onSuccess:()=>{n(!1),p()}})]})}),e.jsx(ge,{open:C,onOpenChange:S,children:e.jsxs(pe,{className:"sm:max-w-md",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:s("upload.title")}),e.jsx(Re,{children:s("upload.description")})]}),e.jsxs("div",{className:y("relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",w&&"border-primary/50 bg-muted/50"),onDragEnter:ee,onDragLeave:ee,onDragOver:ee,onDrop:te,children:[e.jsx("input",{type:"file",ref:g,className:"hidden",accept:".zip",onChange:R=>{const X=R.target.files?.[0];X&&ue(X)}}),h?e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("upload.uploading")})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsx("div",{className:"rounded-full border-2 border-muted-foreground/25 p-3",children:e.jsx(Kt,{className:"h-6 w-6 text-muted-foreground/50"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium",children:[s("upload.dragText")," ",e.jsx("button",{type:"button",onClick:()=>g.current?.click(),className:"mx-1 text-primary hover:underline",children:s("upload.clickText")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("upload.supportText")})]})]})})]})]})})]})]})}function Ya({plugin:s,onInstall:a,onUninstall:t,onToggleEnable:l,onOpenConfig:n,onDelete:r,isLoading:o}){const{t:c}=V("plugin");return e.jsxs(Ye,{className:"group relative overflow-hidden transition-all hover:shadow-md",children:[e.jsxs(ts,{children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ns,{children:s.name}),s.is_installed&&e.jsx(G,{variant:s.is_enabled?"success":"secondary",children:s.is_enabled?c("status.enabled"):c("status.disabled")})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(gn,{className:"h-4 w-4"}),e.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:s.code})]}),e.jsxs("div",{children:["v",s.version]})]})]})}),e.jsx(st,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"mt-2",children:s.description}),e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:e.jsxs("div",{className:"flex items-center gap-1",children:[c("author"),": ",s.author]})})]})})]}),e.jsx(as,{children:e.jsx("div",{className:"flex items-center justify-end space-x-2",children:s.is_installed?e.jsxs(e.Fragment,{children:[e.jsxs(L,{variant:"outline",size:"sm",onClick:()=>n(s.code),disabled:!s.is_enabled||o,children:[e.jsx(Lc,{className:"mr-2 h-4 w-4"}),c("button.config")]}),e.jsxs(L,{variant:s.is_enabled?"destructive":"default",size:"sm",onClick:()=>l(s.code,s.is_enabled),disabled:o,children:[e.jsx(Ec,{className:"mr-2 h-4 w-4"}),s.is_enabled?c("button.disable"):c("button.enable")]}),e.jsx(ls,{title:c("uninstall.title"),description:c("uninstall.description"),cancelText:c("common:cancel"),confirmText:c("uninstall.button"),variant:"destructive",onConfirm:()=>t(s.code),children:e.jsxs(L,{variant:"outline",size:"sm",className:"text-muted-foreground hover:text-destructive",disabled:o,children:[e.jsx(We,{className:"mr-2 h-4 w-4"}),c("button.uninstall")]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{onClick:()=>a(s.code),disabled:o,loading:o,children:c("button.install")}),e.jsx(ls,{title:c("delete.title"),description:c("delete.description"),cancelText:c("common:cancel"),confirmText:c("delete.button"),variant:"destructive",onConfirm:()=>r(s.code),children:e.jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",disabled:o,children:e.jsx(We,{className:"h-4 w-4"})})})]})})})]})}function Ja(){return e.jsxs(Ye,{children:[e.jsxs(ts,{children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(he,{className:"h-6 w-[200px]"}),e.jsx(he,{className:"h-6 w-[80px]"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(he,{className:"h-5 w-[120px]"}),e.jsx(he,{className:"h-5 w-[60px]"})]})]})}),e.jsxs("div",{className:"space-y-2 pt-2",children:[e.jsx(he,{className:"h-4 w-[300px]"}),e.jsx(he,{className:"h-4 w-[150px]"})]})]}),e.jsx(as,{children:e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(he,{className:"h-9 w-[100px]"}),e.jsx(he,{className:"h-9 w-[100px]"}),e.jsx(he,{className:"h-8 w-8"})]})})]})}const bu=Object.freeze(Object.defineProperty({__proto__:null,default:vu},Symbol.toStringTag,{value:"Module"})),yu=(s,a)=>{let t=null;switch(s.field_type){case"input":t=e.jsx(D,{placeholder:s.placeholder,...a});break;case"textarea":t=e.jsx(ks,{placeholder:s.placeholder,...a});break;case"select":t=e.jsx("select",{className:y(yt({variant:"outline"}),"w-full appearance-none font-normal"),...a,children:s.select_options&&Object.keys(s.select_options).map(l=>e.jsx("option",{value:l,children:s.select_options?.[l]},l))});break;default:t=null;break}return t};function Nu({themeKey:s,themeInfo:a}){const{t}=V("theme"),[l,n]=m.useState(!1),[r,o]=m.useState(!1),[c,u]=m.useState(!1),i=Ne({defaultValues:a.configs.reduce((k,C)=>(k[C.field_name]="",k),{})}),d=async()=>{o(!0),At.getConfig(s).then(({data:k})=>{Object.entries(k).forEach(([C,S])=>{i.setValue(C,S)})}).finally(()=>{o(!1)})},h=async k=>{u(!0),At.updateConfig(s,k).then(()=>{$.success(t("config.success")),n(!1)}).finally(()=>{u(!1)})};return e.jsxs(ge,{open:l,onOpenChange:k=>{n(k),k?d():i.reset()},children:[e.jsx(is,{asChild:!0,children:e.jsx(L,{variant:"outline",children:t("card.configureTheme")})}),e.jsxs(pe,{className:"max-h-[90vh] overflow-auto sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:t("config.title",{name:a.name})}),e.jsx(Re,{children:t("config.description")})]}),r?e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(fa,{className:"h-6 w-6 animate-spin"})}):e.jsx(Ce,{...i,children:e.jsxs("form",{onSubmit:i.handleSubmit(h),className:"space-y-4",children:[a.configs.map(k=>e.jsx(v,{control:i.control,name:k.field_name,render:({field:C})=>e.jsxs(f,{children:[e.jsx(j,{children:k.label}),e.jsx(b,{children:yu(k,C)}),e.jsx(P,{})]})},k.field_name)),e.jsxs(Le,{className:"mt-6 gap-2",children:[e.jsx(L,{type:"button",variant:"secondary",onClick:()=>n(!1),children:t("config.cancel")}),e.jsx(L,{type:"submit",loading:c,children:t("config.save")})]})]})})]})]})}function _u(){const{t:s}=V("theme"),[a,t]=m.useState(null),[l,n]=m.useState(!1),[r,o]=m.useState(!1),[c,u]=m.useState(!1),[i,d]=m.useState(null),h=m.useRef(null),[k,C]=m.useState(0),{data:S,isLoading:w,refetch:N}=le({queryKey:["themeList"],queryFn:async()=>{const{data:O}=await At.getList();return O}}),g=async O=>{t(O),ce.updateSystemConfig({frontend_theme:O}).then(()=>{$.success("主题切换成功"),N()}).finally(()=>{t(null)})},T=async O=>{if(!O.name.endsWith(".zip")){$.error(s("upload.error.format"));return}n(!0),At.upload(O).then(()=>{$.success("主题上传成功"),o(!1),N()}).finally(()=>{n(!1),h.current&&(h.current.value="")})},E=O=>{O.preventDefault(),O.stopPropagation(),O.type==="dragenter"||O.type==="dragover"?u(!0):O.type==="dragleave"&&u(!1)},p=O=>{O.preventDefault(),O.stopPropagation(),u(!1),O.dataTransfer.files&&O.dataTransfer.files[0]&&T(O.dataTransfer.files[0])},_=()=>{i&&C(O=>O===0?i.images.length-1:O-1)},I=()=>{i&&C(O=>O===i.images.length-1?0:O+1)},H=(O,B)=>{C(0),d({name:O,images:B})};return e.jsxs(Ve,{children:[e.jsxs(Fe,{className:"flex items-center justify-between",children:[e.jsx(Xe,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("div",{className:"mb-2",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-muted-foreground",children:s("description")}),e.jsxs(L,{onClick:()=>o(!0),variant:"outline",className:"ml-4 shrink-0",size:"sm",children:[e.jsx(Kt,{className:"mr-2 h-4 w-4"}),s("upload.button")]})]})]}),e.jsx("section",{className:"grid gap-6 md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3",children:w?e.jsxs(e.Fragment,{children:[e.jsx(nl,{}),e.jsx(nl,{})]}):S?.themes&&Object.entries(S.themes).map(([O,B])=>e.jsx(Ye,{className:"group relative overflow-hidden transition-all hover:shadow-md",style:{backgroundImage:B.background_url?`url(${B.background_url})`:"none",backgroundSize:"cover",backgroundPosition:"center"},children:e.jsxs("div",{className:y("relative z-10 h-full transition-colors",B.background_url?"group-hover:from-background/98 bg-gradient-to-t from-background/95 via-background/80 to-background/60 backdrop-blur-[1px] group-hover:via-background/90 group-hover:to-background/70":"bg-background"),children:[!!B.can_delete&&e.jsx("div",{className:"absolute right-2 top-2",children:e.jsx(ls,{title:s("card.delete.title"),description:s("card.delete.description"),confirmText:s("card.delete.button"),variant:"destructive",onConfirm:async()=>{if(O===S?.active){$.error(s("card.delete.error.active"));return}t(O),At.drop(O).then(()=>{$.success("主题删除成功"),N()}).finally(()=>{t(null)})},children:e.jsx(L,{disabled:a===O,loading:a===O,variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",children:e.jsx(We,{className:"h-4 w-4"})})})}),e.jsxs(ts,{children:[e.jsx(Ns,{children:B.name}),e.jsx(st,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{children:B.description}),B.version&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("card.version",{version:B.version})})]})})]}),e.jsxs(as,{className:"flex items-center justify-end space-x-3",children:[B.images&&Array.isArray(B.images)&&B.images.length>0&&e.jsx(L,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>H(B.name,B.images),children:e.jsx(Ic,{className:"h-4 w-4"})}),e.jsx(Nu,{themeKey:O,themeInfo:B}),e.jsx(L,{onClick:()=>g(O),disabled:a===O||O===S.active,loading:a===O,variant:O===S.active?"secondary":"default",children:O===S.active?s("card.currentTheme"):s("card.activateTheme")})]})]})},O))}),e.jsx(ge,{open:r,onOpenChange:o,children:e.jsxs(pe,{className:"sm:max-w-md",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:s("upload.title")}),e.jsx(Re,{children:s("upload.description")})]}),e.jsxs("div",{className:y("relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",c&&"border-primary/50 bg-muted/50"),onDragEnter:E,onDragLeave:E,onDragOver:E,onDrop:p,children:[e.jsx("input",{type:"file",ref:h,className:"hidden",accept:".zip",onChange:O=>{const B=O.target.files?.[0];B&&T(B)}}),l?e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("upload.uploading")})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsx("div",{className:"rounded-full border-2 border-muted-foreground/25 p-3",children:e.jsx(Kt,{className:"h-6 w-6 text-muted-foreground/50"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium",children:[s("upload.dragText")," ",e.jsx("button",{type:"button",onClick:()=>h.current?.click(),className:"mx-1 text-primary hover:underline",children:s("upload.clickText")})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("upload.supportText")})]})]})})]})]})}),e.jsx(ge,{open:!!i,onOpenChange:O=>{O||(d(null),C(0))},children:e.jsxs(pe,{className:"max-w-4xl",children:[e.jsxs(ve,{children:[e.jsxs(fe,{children:[i?.name," ",s("preview.title")]}),e.jsx(Re,{className:"text-center",children:i&&s("preview.imageCount",{current:k+1,total:i.images.length})})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"aspect-[16/9] overflow-hidden rounded-lg border bg-muted",children:i?.images[k]&&e.jsx("img",{src:i.images[k],alt:`${i.name} 预览图 ${k+1}`,className:"h-full w-full object-contain"})}),i&&i.images.length>1&&e.jsxs(e.Fragment,{children:[e.jsx(L,{variant:"outline",size:"icon",className:"absolute left-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:_,children:e.jsx(Rc,{className:"h-4 w-4"})}),e.jsx(L,{variant:"outline",size:"icon",className:"absolute right-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:I,children:e.jsx(Vc,{className:"h-4 w-4"})})]})]}),i&&i.images.length>1&&e.jsx("div",{className:"mt-4 flex gap-2 overflow-x-auto pb-2",children:i.images.map((O,B)=>e.jsx("button",{onClick:()=>C(B),className:y("relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border-2",k===B?"border-primary":"border-transparent"),children:e.jsx("img",{src:O,alt:`缩略图 ${B+1}`,className:"h-full w-full object-cover"})},B))})]})})]})]})}function nl(){return e.jsxs(Ye,{children:[e.jsxs(ts,{children:[e.jsx(he,{className:"h-6 w-[200px]"}),e.jsx(he,{className:"h-4 w-[300px]"})]}),e.jsxs(as,{className:"flex items-center justify-end space-x-3",children:[e.jsx(he,{className:"h-10 w-[100px]"}),e.jsx(he,{className:"h-10 w-[100px]"})]})]})}const wu=Object.freeze(Object.defineProperty({__proto__:null,default:_u},Symbol.toStringTag,{value:"Module"})),Tn=m.forwardRef(({className:s,value:a,onChange:t,...l},n)=>{const[r,o]=m.useState("");m.useEffect(()=>{if(r.includes(",")){const u=new Set([...a,...r.split(",").map(i=>i.trim())]);t(Array.from(u)),o("")}},[r,t,a]);const c=()=>{if(r){const u=new Set([...a,r]);t(Array.from(u)),o("")}};return e.jsxs("div",{className:y(" has-[:focus-visible]:outline-none has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-neutral-950 dark:has-[:focus-visible]:ring-neutral-300 flex w-full flex-wrap gap-2 rounded-md border border-input shadow-sm px-3 py-2 text-sm ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",s),children:[a.map(u=>e.jsxs(G,{variant:"secondary",children:[u,e.jsx(K,{variant:"ghost",size:"icon",className:"ml-2 h-3 w-3",onClick:()=>{t(a.filter(i=>i!==u))},children:e.jsx(rn,{className:"w-3"})})]},u)),e.jsx("input",{className:"flex-1 outline-none placeholder:text-muted-foreground bg-transparent",value:r,onChange:u=>o(u.target.value),onKeyDown:u=>{u.key==="Enter"||u.key===","?(u.preventDefault(),c()):u.key==="Backspace"&&r.length===0&&a.length>0&&(u.preventDefault(),t(a.slice(0,-1)))},...l,ref:n})]})});Tn.displayName="InputTags";const Cu=x.object({id:x.number().nullable(),title:x.string().min(1).max(250),content:x.string().min(1),show:x.boolean(),tags:x.array(x.string()),img_url:x.string().nullable()}),Su={id:null,show:!1,tags:[],img_url:"",title:"",content:""};function Ar({refetch:s,dialogTrigger:a,type:t="add",defaultFormValues:l=Su}){const{t:n}=V("notice"),[r,o]=m.useState(!1),c=Ne({resolver:we(Cu),defaultValues:l,mode:"onChange",shouldFocusError:!0}),u=new vn({html:!0});return e.jsx(Ce,{...c,children:e.jsxs(ge,{onOpenChange:o,open:r,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"})," ",e.jsx("div",{children:n("form.add.button")})]})}),e.jsxs(pe,{className:"sm:max-w-[1025px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:n(t==="add"?"form.add.title":"form.edit.title")}),e.jsx(Re,{})]}),e.jsx(v,{control:c.control,name:"title",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.title.label")}),e.jsx("div",{className:"relative ",children:e.jsx(b,{children:e.jsx(D,{placeholder:n("form.fields.title.placeholder"),...i})})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"content",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.content.label")}),e.jsx(b,{children:e.jsx(bn,{style:{height:"500px"},value:i.value,renderHTML:d=>u.render(d),onChange:({text:d})=>{i.onChange(d)}})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"img_url",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.img_url.label")}),e.jsx("div",{className:"relative",children:e.jsx(b,{children:e.jsx(D,{type:"text",placeholder:n("form.fields.img_url.placeholder"),...i,value:i.value||""})})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"show",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.show.label")}),e.jsx("div",{className:"relative py-2",children:e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:i.onChange})})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"tags",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.fields.tags.label")}),e.jsx(b,{children:e.jsx(Tn,{value:i.value,onChange:i.onChange,placeholder:n("form.fields.tags.placeholder"),className:"w-full"})}),e.jsx(P,{})]})}),e.jsxs(Le,{children:[e.jsx(qs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:n("form.buttons.cancel")})}),e.jsx(L,{type:"submit",onClick:i=>{i.preventDefault(),c.handleSubmit(async d=>{Gt.save(d).then(({data:h})=>{h&&($.success(n("form.buttons.success")),s(),o(!1))})})()},children:n("form.buttons.submit")})]})]})]})})}function ku({table:s,refetch:a,saveOrder:t,isSortMode:l}){const{t:n}=V("notice"),r=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between space-x-2 ",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[!l&&e.jsx(Ar,{refetch:a}),!l&&e.jsx(D,{placeholder:n("table.toolbar.search"),value:s.getColumn("title")?.getFilterValue()??"",onChange:o=>s.getColumn("title")?.setFilterValue(o.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),r&&!l&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-9 px-2 lg:px-3",children:[n("table.toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(L,{variant:l?"default":"outline",onClick:t,className:"h-8",size:"sm",children:n(l?"table.toolbar.sort.save":"table.toolbar.sort.edit")})})]})}const Tu=s=>{const{t:a}=V("notice");return[{id:"drag-handle",header:"",cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(Fc,{className:"h-4 w-4 cursor-move text-muted-foreground"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.id")}),cell:({row:t})=>e.jsx(G,{variant:"outline",className:"font-mono",children:t.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.show")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(Z,{defaultChecked:t.getValue("show"),onCheckedChange:async()=>{const{data:l}=await Gt.updateStatus(t.original.id);l||s()}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.title")}),cell:({row:t})=>e.jsx("div",{className:"flex max-w-[500px] items-center",children:e.jsx("span",{className:"truncate font-medium",children:t.getValue("title")})}),enableSorting:!1,size:6e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:a("table.columns.actions")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(Ar,{refetch:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:a("table.actions.edit")})]}),type:"edit",defaultFormValues:t.original}),e.jsx(ls,{title:a("table.actions.delete.title"),description:a("table.actions.delete.description"),onConfirm:async()=>{Gt.drop(t.original.id).then(()=>{$.success(a("table.actions.delete.success")),s()})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:a("table.actions.delete.title")})]})})]}),size:100}]};function Du(){const[s,a]=m.useState({}),[t,l]=m.useState({}),[n,r]=m.useState([]),[o,c]=m.useState([]),[u,i]=m.useState(!1),[d,h]=m.useState({}),[k,C]=m.useState({pageSize:50,pageIndex:0}),[S,w]=m.useState([]),{refetch:N}=le({queryKey:["notices"],queryFn:async()=>{const{data:_}=await Gt.getList();return w(_),_}});m.useEffect(()=>{l({"drag-handle":u,content:!u,created_at:!u,actions:!u}),C({pageSize:u?99999:50,pageIndex:0})},[u]);const g=(_,I)=>{u&&(_.dataTransfer.setData("text/plain",I.toString()),_.currentTarget.classList.add("opacity-50"))},T=(_,I)=>{if(!u)return;_.preventDefault(),_.currentTarget.classList.remove("bg-muted");const H=parseInt(_.dataTransfer.getData("text/plain"));if(H===I)return;const O=[...S],[B]=O.splice(H,1);O.splice(I,0,B),w(O)},E=async()=>{if(!u){i(!0);return}Gt.sort(S.map(_=>_.id)).then(()=>{$.success("排序保存成功"),i(!1),N()}).finally(()=>{i(!1)})},p=Je({data:S??[],columns:Tu(N),state:{sorting:o,columnVisibility:t,rowSelection:s,columnFilters:n,columnSizing:d,pagination:k},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:r,onColumnVisibilityChange:l,onColumnSizingChange:h,onPaginationChange:C,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx("div",{className:"space-y-4",children:e.jsx(os,{table:p,toolbar:_=>e.jsx(ku,{table:_,refetch:N,saveOrder:E,isSortMode:u}),draggable:u,onDragStart:g,onDragEnd:_=>_.currentTarget.classList.remove("opacity-50"),onDragOver:_=>{_.preventDefault(),_.currentTarget.classList.add("bg-muted")},onDragLeave:_=>_.currentTarget.classList.remove("bg-muted"),onDrop:T,showPagination:!u})})}function Pu(){const{t:s}=V("notice");return e.jsxs(Ve,{children:[e.jsxs(Fe,{className:"flex items-center justify-between",children:[e.jsx(Xe,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")})}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Du,{})})]})]})}const Lu=Object.freeze(Object.defineProperty({__proto__:null,default:Pu},Symbol.toStringTag,{value:"Module"})),Eu=x.object({id:x.number().nullable(),language:x.string().max(250),category:x.string().max(250),title:x.string().min(1).max(250),body:x.string().min(1),show:x.boolean()}),Iu={id:null,language:"zh-CN",category:"",title:"",body:"",show:!1};function qr({refreshData:s,dialogTrigger:a,type:t="add",defaultFormValues:l=Iu}){const{t:n}=V("knowledge"),[r,o]=m.useState(!1),c=Ne({resolver:we(Eu),defaultValues:l,mode:"onChange",shouldFocusError:!0}),u=new vn({html:!0});return m.useEffect(()=>{r&&l.id&&bt.getInfo(l.id).then(({data:i})=>{c.reset(i)})},[l.id,c,r]),e.jsxs(ge,{onOpenChange:o,open:r,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"})," ",e.jsx("div",{children:n("form.add")})]})}),e.jsxs(pe,{className:"sm:max-w-[1025px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:n(t==="add"?"form.add":"form.edit")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...c,children:[e.jsx(v,{control:c.control,name:"title",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.title")}),e.jsx("div",{className:"relative ",children:e.jsx(b,{children:e.jsx(D,{placeholder:n("form.titlePlaceholder"),...i})})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"category",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.category")}),e.jsx("div",{className:"relative ",children:e.jsx(b,{children:e.jsx(D,{placeholder:n("form.categoryPlaceholder"),...i})})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"language",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.language")}),e.jsx(b,{children:e.jsxs(J,{value:i.value,onValueChange:i.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("form.languagePlaceholder")})}),e.jsx(Y,{children:[{value:"en-US"},{value:"ja-JP"},{value:"ko-KR"},{value:"vi-VN"},{value:"zh-CN"},{value:"zh-TW"}].map(d=>e.jsx(A,{value:d.value,className:"cursor-pointer",children:n(`languages.${d.value}`)},d.value))})]})})]})}),e.jsx(v,{control:c.control,name:"body",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.content")}),e.jsx(b,{children:e.jsx(bn,{style:{height:"500px"},value:i.value,renderHTML:d=>u.render(d),onChange:({text:d})=>{i.onChange(d)}})}),e.jsx(P,{})]})}),e.jsx(v,{control:c.control,name:"show",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.show")}),e.jsx("div",{className:"relative py-2",children:e.jsx(b,{children:e.jsx(Z,{checked:i.value,onCheckedChange:i.onChange})})}),e.jsx(P,{})]})}),e.jsxs(Le,{children:[e.jsx(qs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:n("form.cancel")})}),e.jsx(L,{type:"submit",onClick:()=>{c.handleSubmit(i=>{bt.save(i).then(({data:d})=>{d&&(c.reset(),$.success(n("messages.operationSuccess")),o(!1),s())})})()},children:n("form.submit")})]})]})]})]})}function Ru({column:s,title:a,options:t}){const l=s?.getFacetedUniqueValues(),n=new Set(s?.getFilterValue());return e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Pa,{className:"mr-2 h-4 w-4"}),a,n?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:n.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:n.size>2?e.jsxs(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[n.size," selected"]}):t.filter(r=>n.has(r.value)).map(r=>e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:r.label},r.value))})]})]})}),e.jsx(bs,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Us,{children:[e.jsx(it,{placeholder:a}),e.jsxs(Ks,{children:[e.jsx(ot,{children:"No results found."}),e.jsx(ns,{children:t.map(r=>{const o=n.has(r.value);return e.jsxs($e,{onSelect:()=>{o?n.delete(r.value):n.add(r.value);const c=Array.from(n);s?.setFilterValue(c.length?c:void 0)},children:[e.jsx("div",{className:y("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",o?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(at,{className:y("h-4 w-4")})}),r.icon&&e.jsx(r.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:r.label}),l?.get(r.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:l.get(r.value)})]},r.value)})}),n.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{}),e.jsx(ns,{children:e.jsx($e,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}function Vu({table:s,refetch:a,saveOrder:t,isSortMode:l}){const n=s.getState().columnFilters.length>0,{t:r}=V("knowledge");return e.jsxs("div",{className:"flex items-center justify-between",children:[l?e.jsx("p",{className:"text-sm text-muted-foreground",children:r("toolbar.sortModeHint")}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qr,{refreshData:a}),e.jsx(D,{placeholder:r("toolbar.searchPlaceholder"),value:s.getColumn("title")?.getFilterValue()??"",onChange:o=>s.getColumn("title")?.setFilterValue(o.target.value),className:"h-8 w-[250px]"}),s.getColumn("category")&&e.jsx(Ru,{column:s.getColumn("category"),title:r("columns.category"),options:Array.from(new Set(s.getCoreRowModel().rows.map(o=>o.getValue("category")))).map(o=>({label:o,value:o}))}),n&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:[r("toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:l?"default":"outline",onClick:t,size:"sm",children:r(l?"toolbar.saveSort":"toolbar.editSort")})})]})}const Fu=({refetch:s,isSortMode:a=!1})=>{const{t}=V("knowledge");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:a?"cursor-move":"opacity-0",children:e.jsx(Da,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:l})=>e.jsx(z,{column:l,title:t("columns.id")}),cell:({row:l})=>e.jsx(G,{variant:"outline",className:"justify-center",children:l.getValue("id")}),enableSorting:!0,size:70},{accessorKey:"show",header:({column:l})=>e.jsx(z,{column:l,title:t("columns.status")}),cell:({row:l})=>e.jsx("div",{className:"flex items-center",children:e.jsx(Z,{defaultChecked:l.getValue("show"),onCheckedChange:async()=>{bt.updateStatus({id:l.original.id}).then(({data:n})=>{n||s()})}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:l})=>e.jsx(z,{column:l,title:t("columns.title")}),cell:({row:l})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"line-clamp-2 font-medium",children:l.getValue("title")})}),enableSorting:!0,size:600},{accessorKey:"category",header:({column:l})=>e.jsx(z,{column:l,title:t("columns.category")}),cell:({row:l})=>e.jsx(G,{variant:"secondary",className:"max-w-[180px] truncate",children:l.getValue("category")}),enableSorting:!0,size:1800},{id:"actions",header:({column:l})=>e.jsx(z,{className:"justify-end",column:l,title:t("columns.actions")}),cell:({row:l})=>e.jsxs("div",{className:"flex items-center justify-end space-x-1",children:[e.jsx(qr,{refreshData:s,dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:t("form.edit")})]}),type:"edit",defaultFormValues:l.original}),e.jsx(ls,{title:t("messages.deleteConfirm"),description:t("messages.deleteDescription"),confirmText:t("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{bt.drop({id:l.original.id}).then(({data:n})=>{n&&($.success(t("messages.operationSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:t("messages.deleteButton")})]})})]}),size:100}]};function Mu(){const[s,a]=m.useState([]),[t,l]=m.useState([]),[n,r]=m.useState(!1),[o,c]=m.useState([]),[u,i]=m.useState({"drag-handle":!1}),[d,h]=m.useState({pageSize:20,pageIndex:0}),{refetch:k,isLoading:C,data:S}=le({queryKey:["knowledge"],queryFn:async()=>{const{data:E}=await bt.getList();return c(E||[]),E}});m.useEffect(()=>{i({"drag-handle":n,actions:!n}),h({pageSize:n?99999:10,pageIndex:0})},[n]);const w=(E,p)=>{n&&(E.dataTransfer.setData("text/plain",p.toString()),E.currentTarget.classList.add("opacity-50"))},N=(E,p)=>{if(!n)return;E.preventDefault(),E.currentTarget.classList.remove("bg-muted");const _=parseInt(E.dataTransfer.getData("text/plain"));if(_===p)return;const I=[...o],[H]=I.splice(_,1);I.splice(p,0,H),c(I)},g=async()=>{n?bt.sort({ids:o.map(E=>E.id)}).then(()=>{k(),r(!1),$.success("排序保存成功")}):r(!0)},T=Je({data:o,columns:Fu({refetch:k,isSortMode:n}),state:{sorting:t,columnFilters:s,columnVisibility:u,pagination:d},onSortingChange:l,onColumnFiltersChange:a,onColumnVisibilityChange:i,onPaginationChange:h,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(os,{table:T,toolbar:E=>e.jsx(Vu,{table:E,refetch:k,saveOrder:g,isSortMode:n}),draggable:n,onDragStart:w,onDragEnd:E=>E.currentTarget.classList.remove("opacity-50"),onDragOver:E=>{E.preventDefault(),E.currentTarget.classList.add("bg-muted")},onDragLeave:E=>E.currentTarget.classList.remove("bg-muted"),onDrop:N,showPagination:!n})}function Ou(){const{t:s}=V("knowledge");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight mb-2",children:s("title")}),e.jsx("p",{className:"text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Mu,{})})]})]})}const zu=Object.freeze(Object.defineProperty({__proto__:null,default:Ou},Symbol.toStringTag,{value:"Module"}));function $u(s,a){const[t,l]=m.useState(s);return m.useEffect(()=>{const n=setTimeout(()=>l(s),a);return()=>{clearTimeout(n)}},[s,a]),t}function Qa(s,a){if(s.length===0)return{};if(!a)return{"":s};const t={};return s.forEach(l=>{const n=l[a]||"";t[n]||(t[n]=[]),t[n].push(l)}),t}function Au(s,a){const t=JSON.parse(JSON.stringify(s));for(const[l,n]of Object.entries(t))t[l]=n.filter(r=>!a.find(o=>o.value===r.value));return t}function qu(s,a){for(const[,t]of Object.entries(s))if(t.some(l=>a.find(n=>n.value===l.value)))return!0;return!1}const Hr=m.forwardRef(({className:s,...a},t)=>Mc(n=>n.filtered.count===0)?e.jsx("div",{ref:t,className:y("py-6 text-center text-sm",s),"cmdk-empty":"",role:"presentation",...a}):null);Hr.displayName="CommandEmpty";const wt=m.forwardRef(({value:s,onChange:a,placeholder:t,defaultOptions:l=[],options:n,delay:r,onSearch:o,loadingIndicator:c,emptyIndicator:u,maxSelected:i=Number.MAX_SAFE_INTEGER,onMaxSelected:d,hidePlaceholderWhenSelected:h,disabled:k,groupBy:C,className:S,badgeClassName:w,selectFirstItem:N=!0,creatable:g=!1,triggerSearchOnFocus:T=!1,commandProps:E,inputProps:p,hideClearAllButton:_=!1},I)=>{const H=m.useRef(null),[O,B]=m.useState(!1),ue=m.useRef(!1),[ee,te]=m.useState(!1),[q,R]=m.useState(s||[]),[X,ms]=m.useState(Qa(l,C)),[Te,re]=m.useState(""),us=$u(Te,r||500);m.useImperativeHandle(I,()=>({selectedValue:[...q],input:H.current,focus:()=>H.current?.focus()}),[q]);const Ts=m.useCallback(se=>{const xe=q.filter(ae=>ae.value!==se.value);R(xe),a?.(xe)},[a,q]),Bs=m.useCallback(se=>{const xe=H.current;xe&&((se.key==="Delete"||se.key==="Backspace")&&xe.value===""&&q.length>0&&(q[q.length-1].fixed||Ts(q[q.length-1])),se.key==="Escape"&&xe.blur())},[Ts,q]);m.useEffect(()=>{s&&R(s)},[s]),m.useEffect(()=>{if(!n||o)return;const se=Qa(n||[],C);JSON.stringify(se)!==JSON.stringify(X)&&ms(se)},[l,n,C,o,X]),m.useEffect(()=>{const se=async()=>{te(!0);const ae=await o?.(us);ms(Qa(ae||[],C)),te(!1)};(async()=>{!o||!O||(T&&await se(),us&&await se())})()},[us,C,O,T]);const Dt=()=>{if(!g||qu(X,[{value:Te,label:Te}])||q.find(xe=>xe.value===Te))return;const se=e.jsx($e,{value:Te,className:"cursor-pointer",onMouseDown:xe=>{xe.preventDefault(),xe.stopPropagation()},onSelect:xe=>{if(q.length>=i){d?.(q.length);return}re("");const ae=[...q,{value:xe,label:xe}];R(ae),a?.(ae)},children:`Create "${Te}"`});if(!o&&Te.length>0||o&&us.length>0&&!ee)return se},Yt=m.useCallback(()=>{if(u)return o&&!g&&Object.keys(X).length===0?e.jsx($e,{value:"-",disabled:!0,children:u}):e.jsx(Hr,{children:u})},[g,u,o,X]),Pt=m.useMemo(()=>Au(X,q),[X,q]),Ms=m.useCallback(()=>{if(E?.filter)return E.filter;if(g)return(se,xe)=>se.toLowerCase().includes(xe.toLowerCase())?1:-1},[g,E?.filter]),Ha=m.useCallback(()=>{const se=q.filter(xe=>xe.fixed);R(se),a?.(se)},[a,q]);return e.jsxs(Us,{...E,onKeyDown:se=>{Bs(se),E?.onKeyDown?.(se)},className:y("h-auto overflow-visible bg-transparent",E?.className),shouldFilter:E?.shouldFilter!==void 0?E.shouldFilter:!o,filter:Ms(),children:[e.jsx("div",{className:y("rounded-md border border-input text-sm ring-offset-background focus-within:ring-1 focus-within:ring-ring ",{"px-3 py-2":q.length!==0,"cursor-text":!k&&q.length!==0},S),onClick:()=>{k||H.current?.focus()},children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[q.map(se=>e.jsxs(G,{className:y("data-[disabled]:bg-muted-foreground data-[disabled]:text-muted data-[disabled]:hover:bg-muted-foreground","data-[fixed]:bg-muted-foreground data-[fixed]:text-muted data-[fixed]:hover:bg-muted-foreground",w),"data-fixed":se.fixed,"data-disabled":k||void 0,children:[se.label,e.jsx("button",{className:y("ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",(k||se.fixed)&&"hidden"),onKeyDown:xe=>{xe.key==="Enter"&&Ts(se)},onMouseDown:xe=>{xe.preventDefault(),xe.stopPropagation()},onClick:()=>Ts(se),children:e.jsx(rn,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},se.value)),e.jsx(He.Input,{...p,ref:H,value:Te,disabled:k,onValueChange:se=>{re(se),p?.onValueChange?.(se)},onBlur:se=>{ue.current===!1&&B(!1),p?.onBlur?.(se)},onFocus:se=>{B(!0),T&&o?.(us),p?.onFocus?.(se)},placeholder:h&&q.length!==0?"":t,className:y("flex-1 bg-transparent outline-none placeholder:text-muted-foreground",{"w-full":h,"px-3 py-2":q.length===0,"ml-1":q.length!==0},p?.className)}),e.jsx("button",{type:"button",onClick:Ha,className:y((_||k||q.length<1||q.filter(se=>se.fixed).length===q.length)&&"hidden"),children:e.jsx(rn,{})})]})}),e.jsx("div",{className:"relative",children:O&&e.jsx(Ks,{className:"absolute top-1 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",onMouseLeave:()=>{ue.current=!1},onMouseEnter:()=>{ue.current=!0},onMouseUp:()=>{H.current?.focus()},children:ee?e.jsx(e.Fragment,{children:c}):e.jsxs(e.Fragment,{children:[Yt(),Dt(),!N&&e.jsx($e,{value:"-",className:"hidden"}),Object.entries(Pt).map(([se,xe])=>e.jsx(ns,{heading:se,className:"h-full overflow-auto",children:e.jsx(e.Fragment,{children:xe.map(ae=>e.jsx($e,{value:ae.value,disabled:ae.disable,onMouseDown:Gs=>{Gs.preventDefault(),Gs.stopPropagation()},onSelect:()=>{if(q.length>=i){d?.(q.length);return}re("");const Gs=[...q,ae];R(Gs),a?.(Gs)},className:y("cursor-pointer",ae.disable&&"cursor-default text-muted-foreground"),children:ae.label},ae.value))})},se))]})})})]})});wt.displayName="MultipleSelector";const Hu=s=>x.object({id:x.number().optional(),name:x.string().min(2,s("messages.nameValidation.min")).max(50,s("messages.nameValidation.max")).regex(/^[a-zA-Z0-9\u4e00-\u9fa5_-]+$/,s("messages.nameValidation.pattern"))});function qa({refetch:s,dialogTrigger:a,defaultValues:t={name:""},type:l="add"}){const{t:n}=V("group"),r=Ne({resolver:we(Hu(n)),defaultValues:t,mode:"onChange"}),[o,c]=m.useState(!1),[u,i]=m.useState(!1),d=async h=>{i(!0),rt.save(h).then(()=>{$.success(n(l==="edit"?"messages.updateSuccess":"messages.createSuccess")),s&&s(),r.reset(),c(!1)}).finally(()=>{i(!1)})};return e.jsxs(ge,{open:o,onOpenChange:c,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("span",{children:n("form.add")})]})}),e.jsxs(pe,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:n(l==="edit"?"form.edit":"form.create")}),e.jsx(Re,{children:n(l==="edit"?"form.editDescription":"form.createDescription")})]}),e.jsx(Ce,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(d),className:"space-y-4",children:[e.jsx(v,{control:r.control,name:"name",render:({field:h})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.name")}),e.jsx(b,{children:e.jsx(D,{placeholder:n("form.namePlaceholder"),...h,className:"w-full"})}),e.jsx(M,{children:n("form.nameDescription")}),e.jsx(P,{})]})}),e.jsxs(Le,{className:"gap-2",children:[e.jsx(qs,{asChild:!0,children:e.jsx(L,{type:"button",variant:"outline",children:n("form.cancel")})}),e.jsxs(L,{type:"submit",disabled:u||!r.formState.isValid,children:[u&&e.jsx(fa,{className:"mr-2 h-4 w-4 animate-spin"}),n(l==="edit"?"form.update":"form.create")]})]})]})})]})]})}const Ur=m.createContext(void 0);function Uu({children:s,refetch:a}){const[t,l]=m.useState(!1),[n,r]=m.useState(null),[o,c]=m.useState(ie.Shadowsocks);return e.jsx(Ur.Provider,{value:{isOpen:t,setIsOpen:l,editingServer:n,setEditingServer:r,serverType:o,setServerType:c,refetch:a},children:s})}function Kr(){const s=m.useContext(Ur);if(s===void 0)throw new Error("useServerEdit must be used within a ServerEditProvider");return s}function Xa({dialogTrigger:s,value:a,setValue:t,templateType:l}){const{t:n}=V("server");m.useEffect(()=>{console.log(a)},[a]);const[r,o]=m.useState(!1),[c,u]=m.useState(()=>{if(!a||Object.keys(a).length===0)return"";try{return JSON.stringify(a,null,2)}catch{return""}}),[i,d]=m.useState(null),h=g=>{if(!g)return null;try{const T=JSON.parse(g);return typeof T!="object"||T===null?n("network_settings.validation.must_be_object"):null}catch{return n("network_settings.validation.invalid_json")}},k={tcp:{label:"TCP",content:{acceptProxyProtocol:!1,header:{type:"none"}}},"tcp-http":{label:"TCP + HTTP",content:{acceptProxyProtocol:!1,header:{type:"http",request:{version:"1.1",method:"GET",path:["/"],headers:{Host:["www.example.com"]}},response:{version:"1.1",status:"200",reason:"OK"}}}},grpc:{label:"gRPC",content:{serviceName:"GunService"}},ws:{label:"WebSocket",content:{path:"/",headers:{Host:"v2ray.com"}}},httpupgrade:{label:"HttpUpgrade",content:{acceptProxyProtocol:!1,path:"/",host:"xray.com",headers:{key:"value"}}},xhttp:{label:"XHTTP",content:{host:"example.com",path:"/yourpath",mode:"auto",extra:{headers:{},xPaddingBytes:"100-1000",noGRPCHeader:!1,noSSEHeader:!1,scMaxEachPostBytes:1e6,scMinPostsIntervalMs:30,scMaxBufferedPosts:30,xmux:{maxConcurrency:"16-32",maxConnections:0,cMaxReuseTimes:"64-128",cMaxLifetimeMs:0,hMaxRequestTimes:"800-900",hKeepAlivePeriod:0},downloadSettings:{address:"",port:443,network:"xhttp",security:"tls",tlsSettings:{},xhttpSettings:{path:"/yourpath"},sockopt:{}}}}}},C=()=>{switch(l){case"tcp":return["tcp","tcp-http"];case"grpc":return["grpc"];case"ws":return["ws"];case"httpupgrade":return["httpupgrade"];case"xhttp":return["xhttp"];default:return[]}},S=()=>{const g=h(c||"");if(g){$.error(g);return}try{if(!c){t(null),o(!1);return}t(JSON.parse(c)),o(!1)}catch{$.error(n("network_settings.errors.save_failed"))}},w=g=>{u(g),d(h(g))},N=g=>{const T=k[g];if(T){const E=JSON.stringify(T.content,null,2);u(E),d(null)}};return m.useEffect(()=>{r&&console.log(a)},[r,a]),m.useEffect(()=>{r&&a&&Object.keys(a).length>0&&u(JSON.stringify(a,null,2))},[r,a]),e.jsxs(ge,{open:r,onOpenChange:g=>{!g&&r&&S(),o(g)},children:[e.jsx(is,{asChild:!0,children:s??e.jsx(K,{variant:"link",children:n("network_settings.edit_protocol")})}),e.jsxs(pe,{className:"sm:max-w-[425px]",children:[e.jsx(ve,{children:e.jsx(fe,{children:n("network_settings.edit_protocol_config")})}),e.jsxs("div",{className:"space-y-4",children:[C().length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:C().map(g=>e.jsx(K,{variant:"outline",size:"sm",onClick:()=>N(g),children:n("network_settings.use_template",{template:k[g].label})},g))}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ks,{className:`min-h-[200px] font-mono text-sm ${i?"border-red-500 focus-visible:ring-red-500":""}`,value:c,placeholder:C().length>0?n("network_settings.json_config_placeholder_with_template"):n("network_settings.json_config_placeholder"),onChange:g=>w(g.target.value)}),i&&e.jsx("p",{className:"text-sm text-red-500",children:i})]})]}),e.jsxs(Le,{className:"gap-2",children:[e.jsx(K,{variant:"outline",onClick:()=>o(!1),children:n("common.cancel")}),e.jsx(K,{onClick:S,disabled:!!i,children:n("common.confirm")})]})]})]})}function rp(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const Ku={},Bu=Object.freeze(Object.defineProperty({__proto__:null,default:Ku},Symbol.toStringTag,{value:"Module"})),ip=Xc(Bu),ll=s=>s.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),Gu=()=>{try{const s=Oc.box.keyPair(),a=ll(Yn.encodeBase64(s.secretKey)),t=ll(Yn.encodeBase64(s.publicKey));return{privateKey:a,publicKey:t}}catch(s){throw console.error("Error generating x25519 key pair:",s),s}},Wu=()=>{try{return Gu()}catch(s){throw console.error("Error generating key pair:",s),s}},Yu=s=>{const a=new Uint8Array(Math.ceil(s/2));return window.crypto.getRandomValues(a),Array.from(a).map(t=>t.toString(16).padStart(2,"0")).join("").substring(0,s)},Ju=()=>{const s=Math.floor(Math.random()*8)*2+2;return Yu(s)},Qu=x.object({cipher:x.string().default("aes-128-gcm"),plugin:x.string().optional().default(""),plugin_opts:x.string().optional().default(""),client_fingerprint:x.string().optional().default("chrome")}),Xu=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({})}),Zu=x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({})}),ex=x.object({version:x.coerce.number().default(2),alpn:x.string().default("h2"),obfs:x.object({open:x.coerce.boolean().default(!1),type:x.string().default("salamander"),password:x.string().default("")}).default({}),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),bandwidth:x.object({up:x.string().default(""),down:x.string().default("")}).default({}),hop_interval:x.number().optional(),port_range:x.string().optional()}),sx=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({}),reality_settings:x.object({server_port:x.coerce.number().default(443),server_name:x.string().default(""),allow_insecure:x.boolean().default(!1),public_key:x.string().default(""),private_key:x.string().default(""),short_id:x.string().default("")}).default({}),network:x.string().default("tcp"),network_settings:x.record(x.any()).default({}),flow:x.string().default("")}),tx=x.object({version:x.coerce.number().default(5),congestion_control:x.string().default("bbr"),alpn:x.array(x.string()).default(["h3"]),udp_relay_mode:x.string().default("native"),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),ax=x.object({}),nx=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),lx=x.object({tls:x.coerce.number().default(0),tls_settings:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),rx=x.object({transport:x.string().default("tcp"),multiplexing:x.string().default("MULTIPLEXING_LOW")}),ix=x.object({padding_scheme:x.array(x.string()).optional().default([]),tls:x.object({server_name:x.string().default(""),allow_insecure:x.boolean().default(!1)}).default({})}),Pe={shadowsocks:{schema:Qu,ciphers:["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"],plugins:[{value:"none",label:"None"},{value:"obfs",label:"Simple Obfs"},{value:"v2ray-plugin",label:"V2Ray Plugin"}],clientFingerprints:[{value:"chrome",label:"Chrome"},{value:"firefox",label:"Firefox"},{value:"safari",label:"Safari"},{value:"ios",label:"iOS"}]},vmess:{schema:Xu,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},trojan:{schema:Zu,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},hysteria:{schema:ex,versions:["1","2"],alpnOptions:["hysteria","http/1.1","h2","h3"]},vless:{schema:sx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"},{value:"kcp",label:"mKCP"},{value:"httpupgrade",label:"HttpUpgrade"},{value:"xhttp",label:"XHTTP"}],flowOptions:["none","xtls-rprx-direct","xtls-rprx-splice","xtls-rprx-vision"]},tuic:{schema:tx,versions:["5","4"],congestionControls:["bbr","cubic","new_reno"],alpnOptions:[{value:"h3",label:"HTTP/3"},{value:"h2",label:"HTTP/2"},{value:"http/1.1",label:"HTTP/1.1"}],udpRelayModes:[{value:"native",label:"Native"},{value:"quic",label:"QUIC"}]},socks:{schema:ax},naive:{schema:lx},http:{schema:nx},mieru:{schema:rx,transportOptions:[{value:"tcp",label:"TCP"},{value:"udp",label:"UDP"}],multiplexingOptions:[{value:"MULTIPLEXING_OFF",label:"Off"},{value:"MULTIPLEXING_LOW",label:"Low"},{value:"MULTIPLEXING_MIDDLE",label:"Middle"},{value:"MULTIPLEXING_HIGH",label:"High"}]},anytls:{schema:ix,defaultPaddingScheme:["stop=8","0=30-30","1=100-400","2=400-500,c,500-1000,c,500-1000,c,500-1000,c,500-1000","3=9-9,500-1000","4=500-1000","5=500-1000","6=500-1000","7=500-1000"]}},ox=({serverType:s,value:a,onChange:t})=>{const{t:l}=V("server"),n=s?Pe[s]:null,r=n?.schema||x.record(x.any()),o=s?r.parse({}):{},c=Ne({resolver:we(r),defaultValues:o,mode:"onChange"});if(m.useEffect(()=>{if(!a||Object.keys(a).length===0){if(s){const p=r.parse({});c.reset(p)}}else c.reset(a)},[s,a,t,c,r]),m.useEffect(()=>{const p=c.watch(_=>{t(_)});return()=>p.unsubscribe()},[c,t]),!s||!n)return null;const E={shadowsocks:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"cipher",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.shadowsocks.cipher.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.shadowsocks.cipher.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.shadowsocks.ciphers.map(_=>e.jsx(A,{value:_,children:_},_))})})]})})]})}),e.jsx(v,{control:c.control,name:"plugin",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.shadowsocks.plugin.label","插件")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:_=>p.onChange(_==="none"?"":_),value:p.value===""?"none":p.value||"none",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.shadowsocks.plugin.placeholder","选择插件")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.shadowsocks.plugins.map(_=>e.jsx(A,{value:_.value,children:_.label},_.value))})})]})}),e.jsx(M,{children:p.value&&p.value!=="none"&&p.value!==""&&e.jsxs(e.Fragment,{children:[p.value==="obfs"&&l("dynamic_form.shadowsocks.plugin.obfs_hint","提示:配置格式如 obfs=http;obfs-host=www.bing.com;path=/"),p.value==="v2ray-plugin"&&l("dynamic_form.shadowsocks.plugin.v2ray_hint","提示:WebSocket模式格式为 mode=websocket;host=mydomain.me;path=/;tls=true,QUIC模式格式为 mode=quic;host=mydomain.me")]})})]})}),c.watch("plugin")&&c.watch("plugin")!=="none"&&c.watch("plugin")!==""&&e.jsx(v,{control:c.control,name:"plugin_opts",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.shadowsocks.plugin_opts.label","插件选项")}),e.jsx(M,{children:l("dynamic_form.shadowsocks.plugin_opts.description","按照 key=value;key2=value2 格式输入插件选项")}),e.jsx(b,{children:e.jsx(D,{type:"text",placeholder:l("dynamic_form.shadowsocks.plugin_opts.placeholder","例如: mode=tls;host=bing.com"),...p})})]})}),(c.watch("plugin")==="shadow-tls"||c.watch("plugin")==="restls")&&e.jsx(v,{control:c.control,name:"client_fingerprint",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.shadowsocks.client_fingerprint","客户端指纹")}),e.jsx(b,{children:e.jsxs(J,{value:p.value||"chrome",onValueChange:p.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.shadowsocks.client_fingerprint_placeholder","选择客户端指纹")})}),e.jsx(Y,{children:Pe.shadowsocks.clientFingerprints.map(_=>e.jsx(A,{value:_.value,children:_.label},_.value))})]})}),e.jsx(M,{children:l("dynamic_form.shadowsocks.client_fingerprint_description","客户端伪装指纹,用于降低被识别风险")})]})})]}),vmess:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"tls",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vmess.tls.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value?.toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.vmess.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:l("dynamic_form.vmess.tls.disabled")}),e.jsx(A,{value:"1",children:l("dynamic_form.vmess.tls.enabled")})]})]})})]})}),c.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls_settings.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.vmess.tls_settings.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.vmess.tls_settings.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls_settings.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vmess.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]}),e.jsx(v,{control:c.control,name:"network",render:({field:p})=>e.jsxs(f,{children:[e.jsxs(j,{children:[l("dynamic_form.vmess.network.label"),e.jsx(Xa,{value:c.watch("network_settings"),setValue:_=>c.setValue("network_settings",_),templateType:c.watch("network")})]}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.vmess.network.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.vmess.networkOptions.map(_=>e.jsx(A,{value:_.value,className:"cursor-pointer",children:_.label},_.value))})})]})})]})})]}),trojan:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.trojan.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.trojan.server_name.placeholder"),...p,value:p.value||""})})]})}),e.jsx(v,{control:c.control,name:"allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.trojan.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value||!1,onCheckedChange:p.onChange})})})]})})]}),e.jsx(v,{control:c.control,name:"network",render:({field:p})=>e.jsxs(f,{children:[e.jsxs(j,{children:[l("dynamic_form.trojan.network.label"),e.jsx(Xa,{value:c.watch("network_settings")||{},setValue:_=>c.setValue("network_settings",_),templateType:c.watch("network")||"tcp"})]}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value||"tcp",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.trojan.network.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.trojan.networkOptions.map(_=>e.jsx(A,{value:_.value,className:"cursor-pointer",children:_.label},_.value))})})]})})]})})]}),hysteria:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"version",render:({field:p})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:l("dynamic_form.hysteria.version.label")}),e.jsx(b,{children:e.jsxs(J,{value:(p.value||2).toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.hysteria.version.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.hysteria.versions.map(_=>e.jsxs(A,{value:_,className:"cursor-pointer",children:["V",_]},_))})})]})})]})}),c.watch("version")==1&&e.jsx(v,{control:c.control,name:"alpn",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.hysteria.alpn.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value||"h2",onValueChange:p.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.hysteria.alpn.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.hysteria.alpnOptions.map(_=>e.jsx(A,{value:_,children:_},_))})})]})})]})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"obfs.open",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.hysteria.obfs.label")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value||!1,onCheckedChange:p.onChange})})})]})}),!!c.watch("obfs.open")&&e.jsxs(e.Fragment,{children:[c.watch("version")=="2"&&e.jsx(v,{control:c.control,name:"obfs.type",render:({field:p})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:l("dynamic_form.hysteria.obfs.type.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value||"salamander",onValueChange:p.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.hysteria.obfs.type.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:e.jsx(A,{value:"salamander",children:l("dynamic_form.hysteria.obfs.type.salamander")})})})]})})]})}),e.jsx(v,{control:c.control,name:"obfs.password",render:({field:p})=>e.jsxs(f,{className:c.watch("version")==2?"w-full":"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.hysteria.obfs.password.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.hysteria.obfs.password.placeholder"),...p,value:p.value||"",className:"pr-9"})}),e.jsx(K,{type:"button",variant:"ghost",size:"icon",onClick:()=>{const _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",I=Array.from(crypto.getRandomValues(new Uint8Array(16))).map(H=>_[H%_.length]).join("");c.setValue("obfs.password",I),$.success(l("dynamic_form.hysteria.obfs.password.generate_success"))},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(ze,{icon:"ion:refresh-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})]})]})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.hysteria.tls.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.hysteria.tls.server_name.placeholder"),...p,value:p.value||""})})]})}),e.jsx(v,{control:c.control,name:"tls.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.hysteria.tls.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value||!1,onCheckedChange:p.onChange})})})]})})]}),e.jsx(v,{control:c.control,name:"bandwidth.up",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.hysteria.bandwidth.up.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:l("dynamic_form.hysteria.bandwidth.up.placeholder")+(c.watch("version")==2?l("dynamic_form.hysteria.bandwidth.up.bbr_tip"):""),className:"rounded-br-none rounded-tr-none",...p,value:p.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:l("dynamic_form.hysteria.bandwidth.up.suffix")})})]})]})}),e.jsx(v,{control:c.control,name:"bandwidth.down",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.hysteria.bandwidth.down.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:l("dynamic_form.hysteria.bandwidth.down.placeholder")+(c.watch("version")==2?l("dynamic_form.hysteria.bandwidth.down.bbr_tip"):""),className:"rounded-br-none rounded-tr-none",...p,value:p.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:l("dynamic_form.hysteria.bandwidth.down.suffix")})})]})]})}),e.jsx(e.Fragment,{children:e.jsx(v,{control:c.control,name:"hop_interval",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.hysteria.hop_interval.label","Hop 间隔 (秒)")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:l("dynamic_form.hysteria.hop_interval.placeholder","例如: 30"),...p,value:p.value||"",onChange:_=>{const I=_.target.value?parseInt(_.target.value):void 0;p.onChange(I)}})}),e.jsx(M,{children:l("dynamic_form.hysteria.hop_interval.description","Hop 间隔时间,单位为秒")})]})})})]}),vless:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"tls",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.tls.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value?.toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.vless.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:l("dynamic_form.vless.tls.none")}),e.jsx(A,{value:"1",children:l("dynamic_form.vless.tls.tls")}),e.jsx(A,{value:"2",children:l("dynamic_form.vless.tls.reality")})]})]})})]})}),c.watch("tls")=="1"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls_settings.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.vless.tls_settings.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.vless.tls_settings.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls_settings.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]}),c.watch("tls")==2&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"reality_settings.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.vless.reality_settings.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"reality_settings.server_port",render:({field:p})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.server_port.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.vless.reality_settings.server_port.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"reality_settings.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]}),e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(v,{control:c.control,name:"reality_settings.private_key",render:({field:p})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.private_key.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{children:e.jsx(D,{...p,className:"pr-9"})}),e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(K,{type:"button",variant:"ghost",size:"icon",onClick:()=>{try{const _=Wu();c.setValue("reality_settings.private_key",_.privateKey),c.setValue("reality_settings.public_key",_.publicKey),$.success(l("dynamic_form.vless.reality_settings.key_pair.success"))}catch{$.error(l("dynamic_form.vless.reality_settings.key_pair.error"))}},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(ze,{icon:"ion:key-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})}),e.jsx(ja,{children:e.jsx(oe,{children:e.jsx("p",{children:l("dynamic_form.vless.reality_settings.key_pair.generate")})})})]})]})]})})}),e.jsx(v,{control:c.control,name:"reality_settings.public_key",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.public_key.label")}),e.jsx(b,{children:e.jsx(D,{...p})})]})}),e.jsx(v,{control:c.control,name:"reality_settings.short_id",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.reality_settings.short_id.label")}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{children:e.jsx(D,{...p,className:"pr-9",placeholder:l("dynamic_form.vless.reality_settings.short_id.placeholder")})}),e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(K,{type:"button",variant:"ghost",size:"icon",onClick:()=>{const _=Ju();c.setValue("reality_settings.short_id",_),$.success(l("dynamic_form.vless.reality_settings.short_id.success"))},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(ze,{icon:"ion:refresh-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})}),e.jsx(ja,{children:e.jsx(oe,{children:e.jsx("p",{children:l("dynamic_form.vless.reality_settings.short_id.generate")})})})]})]}),e.jsx(M,{className:"text-xs text-muted-foreground",children:l("dynamic_form.vless.reality_settings.short_id.description")})]})})]}),e.jsx(v,{control:c.control,name:"network",render:({field:p})=>e.jsxs(f,{children:[e.jsxs(j,{children:[l("dynamic_form.vless.network.label"),e.jsx(Xa,{value:c.watch("network_settings"),setValue:_=>c.setValue("network_settings",_),templateType:c.watch("network")})]}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.vless.network.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.vless.networkOptions.map(_=>e.jsx(A,{value:_.value,className:"cursor-pointer",children:_.label},_.value))})})]})})]})}),e.jsx(v,{control:c.control,name:"flow",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.vless.flow.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:_=>p.onChange(_==="none"?null:_),value:p.value||"none",children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.vless.flow.placeholder")})}),e.jsx(Y,{children:Pe.vless.flowOptions.map(_=>e.jsx(A,{value:_,children:_},_))})]})})]})})]}),tuic:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"version",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.tuic.version.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value?.toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.tuic.version.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.tuic.versions.map(_=>e.jsxs(A,{value:_,children:["V",_]},_))})})]})})]})}),e.jsx(v,{control:c.control,name:"congestion_control",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.tuic.congestion_control.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.tuic.congestion_control.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.tuic.congestionControls.map(_=>e.jsx(A,{value:_,children:_.toUpperCase()},_))})})]})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.tuic.tls.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.tuic.tls.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.tuic.tls.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]}),e.jsx(v,{control:c.control,name:"alpn",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.tuic.tls.alpn.label")}),e.jsx(b,{children:e.jsx(wt,{options:Pe.tuic.alpnOptions,onChange:_=>p.onChange(_.map(I=>I.value)),value:Pe.tuic.alpnOptions.filter(_=>p.value?.includes(_.value)),placeholder:l("dynamic_form.tuic.tls.alpn.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:l("dynamic_form.tuic.tls.alpn.empty")})})})]})}),e.jsx(v,{control:c.control,name:"udp_relay_mode",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.tuic.udp_relay_mode.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.tuic.udp_relay_mode.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.tuic.udpRelayModes.map(_=>e.jsx(A,{value:_.value,children:_.label},_.value))})})]})})]})})]}),socks:()=>e.jsx(e.Fragment,{}),naive:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"tls",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.naive.tls.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value?.toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.naive.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:l("dynamic_form.naive.tls.disabled")}),e.jsx(A,{value:"1",children:l("dynamic_form.naive.tls.enabled")})]})]})})]})}),c.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls_settings.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.naive.tls_settings.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.naive.tls_settings.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls_settings.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.naive.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]})]}),http:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"tls",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.http.tls.label")}),e.jsx(b,{children:e.jsxs(J,{value:p.value?.toString(),onValueChange:_=>p.onChange(Number(_)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.http.tls.placeholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:l("dynamic_form.http.tls.disabled")}),e.jsx(A,{value:"1",children:l("dynamic_form.http.tls.enabled")})]})]})})]})}),c.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls_settings.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.http.tls_settings.server_name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.http.tls_settings.server_name.placeholder"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls_settings.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.http.tls_settings.allow_insecure")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]})]}),mieru:()=>e.jsxs(e.Fragment,{children:[e.jsx(v,{control:c.control,name:"transport",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.mieru.transport.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.mieru.transport.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.mieru.transportOptions.map(_=>e.jsx(A,{value:_.value,children:_.label},_.value))})})]})})]})}),e.jsx(v,{control:c.control,name:"multiplexing",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.mieru.multiplexing.label")}),e.jsx(b,{children:e.jsxs(J,{onValueChange:p.onChange,value:p.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dynamic_form.mieru.multiplexing.placeholder")})}),e.jsx(Y,{children:e.jsx(Be,{children:Pe.mieru.multiplexingOptions.map(_=>e.jsx(A,{value:_.value,children:_.label},_.value))})})]})})]})})]}),anytls:()=>e.jsx(e.Fragment,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:c.control,name:"padding_scheme",render:({field:p})=>e.jsxs(f,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(j,{children:l("dynamic_form.anytls.padding_scheme.label","AnyTLS 填充方案")}),e.jsx(K,{type:"button",variant:"outline",size:"sm",onClick:()=>{c.setValue("padding_scheme",Pe.anytls.defaultPaddingScheme),$.success(l("dynamic_form.anytls.padding_scheme.default_success","已设置默认填充方案"))},className:"h-7 px-2",children:l("dynamic_form.anytls.padding_scheme.use_default","使用默认方案")})]}),e.jsx(M,{children:l("dynamic_form.anytls.padding_scheme.description","每行一个填充规则,格式如: stop=8, 0=30-30")}),e.jsx(b,{children:e.jsx("textarea",{className:"flex min-h-[100px] 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",placeholder:l("dynamic_form.anytls.padding_scheme.placeholder",`例如: stop=8 0=30-30 1=100-400 2=400-500,c,500-1000`),...p,value:Array.isArray(p.value)?p.value.join(` `):"",onChange:_=>{const H=_.target.value.split(` -`).filter(O=>O.trim()!=="");p.onChange(H)}})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.anytls.tls.server_name.label","SNI")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.anytls.tls.server_name.placeholder","服务器名称"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.anytls.tls.allow_insecure","允许不安全连接")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]})]})})};return e.jsx(ye,{children:E[s]?.()})};function ox(){const{t:s}=V("server"),a=x.object({id:x.number().optional().nullable(),specific_key:x.string().optional().nullable(),code:x.string().optional(),show:x.boolean().optional().nullable(),name:x.string().min(1,s("form.name.error")),rate:x.string().min(1,s("form.rate.error")).refine(I=>!isNaN(parseFloat(I))&&isFinite(Number(I)),{message:s("form.rate.error_numeric")}).refine(I=>parseFloat(I)>=0,{message:s("form.rate.error_gte_zero")}),tags:x.array(x.string()).default([]),excludes:x.array(x.string()).default([]),ips:x.array(x.string()).default([]),group_ids:x.array(x.string()).default([]),host:x.string().min(1,s("form.host.error")),port:x.string().min(1,s("form.port.error")),server_port:x.string().min(1,s("form.server_port.error")),parent_id:x.string().default("0").nullable(),route_ids:x.array(x.string()).default([]),protocol_settings:x.record(x.any()).default({}).nullable()}),t={id:null,specific_key:null,code:"",show:!1,name:"",rate:"1",tags:[],excludes:[],ips:[],group_ids:[],host:"",port:"",server_port:"",parent_id:"0",route_ids:[],protocol_settings:null},{isOpen:l,setIsOpen:n,editingServer:r,setEditingServer:o,serverType:c,setServerType:u,refetch:i}=Kr(),[d,h]=m.useState([]),[k,C]=m.useState([]),[S,w]=m.useState([]),N=Ne({resolver:we(a),defaultValues:t,mode:"onChange"});m.useEffect(()=>{g()},[l]),m.useEffect(()=>{r?.type&&r.type!==c&&u(r.type)},[r,c,u]),m.useEffect(()=>{r?r.type===c&&N.reset({...t,...r}):N.reset({...t,protocol_settings:Pe[c].schema.parse({})})},[r,N,c]);const g=async()=>{if(!l)return;const[I,H,O]=await Promise.all([rt.getList(),Ea.getList(),Zs.getList()]);h(I.data?.map(B=>({label:B.name,value:B.id.toString()}))||[]),C(H.data?.map(B=>({label:B.remarks,value:B.id.toString()}))||[]),w(O.data||[])},T=m.useMemo(()=>S?.filter(I=>(I.parent_id===0||I.parent_id===null)&&I.type===c&&I.id!==N.watch("id")),[c,S,N]),E=()=>e.jsxs(Es,{children:[e.jsx(Is,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("div",{children:s("form.add_node")})]})}),e.jsx(ws,{align:"start",children:e.jsx(Rd,{children:cs.map(({type:I,label:H})=>e.jsx(_e,{onClick:()=>{u(I),n(!0)},className:"cursor-pointer",children:e.jsx(G,{variant:"outline",className:"text-white",style:{background:Ge[I]},children:H})},I))})})]}),p=()=>{n(!1),o(null),N.reset(t)},_=async()=>{const I=N.getValues();(await Zs.save({...I,type:c})).data&&(p(),$.success(s("form.success")),i())};return e.jsxs(he,{open:l,onOpenChange:p,children:[E(),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(je,{children:[e.jsx(pe,{children:s(r?"form.edit_node":"form.new_node")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...N,children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:N.control,name:"name",render:({field:I})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:s("form.name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("form.name.placeholder"),...I})}),e.jsx(P,{})]})}),e.jsx(v,{control:N.control,name:"rate",render:({field:I})=>e.jsxs(f,{className:"flex-[1]",children:[e.jsx(j,{children:s("form.rate.label")}),e.jsx("div",{className:"relative flex",children:e.jsx(b,{children:e.jsx(D,{type:"number",min:"0",step:"0.1",...I})})}),e.jsx(P,{})]})})]}),e.jsx(v,{control:N.control,name:"code",render:({field:I})=>e.jsxs(f,{children:[e.jsxs(j,{children:[s("form.code.label"),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:s("form.code.optional")})]}),e.jsx(b,{children:e.jsx(D,{placeholder:s("form.code.placeholder"),...I,value:I.value||""})}),e.jsx(P,{})]})}),e.jsx(v,{control:N.control,name:"tags",render:({field:I})=>e.jsxs(f,{children:[e.jsx(j,{children:s("form.tags.label")}),e.jsx(b,{children:e.jsx(Tn,{value:I.value,onChange:I.onChange,placeholder:s("form.tags.placeholder"),className:"w-full"})}),e.jsx(P,{})]})}),e.jsx(v,{control:N.control,name:"group_ids",render:({field:I})=>e.jsxs(f,{children:[e.jsxs(j,{className:"flex items-center justify-between",children:[s("form.groups.label"),e.jsx(Aa,{dialogTrigger:e.jsx(L,{variant:"link",children:s("form.groups.add")}),refetch:g})]}),e.jsx(b,{children:e.jsx(wt,{options:d,onChange:H=>I.onChange(H.map(O=>O.value)),value:d?.filter(H=>I.value.includes(H.value)),placeholder:s("form.groups.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:s("form.groups.empty")})})}),e.jsx(P,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:N.control,name:"host",render:({field:I})=>e.jsxs(f,{children:[e.jsx(j,{children:s("form.host.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("form.host.placeholder"),...I})}),e.jsx(P,{})]})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(v,{control:N.control,name:"port",render:({field:I})=>e.jsxs(f,{className:"flex-1",children:[e.jsxs(j,{className:"flex items-center gap-1.5",children:[s("form.port.label"),e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx(ze,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(ja,{children:e.jsx(xe,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:s("form.port.tooltip")})})})]})})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(b,{children:e.jsx(D,{placeholder:s("form.port.placeholder"),...I})}),e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0 text-muted-foreground/50 hover:text-muted-foreground",onClick:()=>{const H=I.value;H&&N.setValue("server_port",H)},children:e.jsx(ze,{icon:"tabler:arrows-right",className:"size-3"})})}),e.jsx(xe,{side:"right",children:e.jsx("p",{children:s("form.port.sync")})})]})})]}),e.jsx(P,{})]})}),e.jsx(v,{control:N.control,name:"server_port",render:({field:I})=>e.jsxs(f,{className:"flex-1",children:[e.jsxs(j,{className:"flex items-center gap-1.5",children:[s("form.server_port.label"),e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx(ze,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(ja,{children:e.jsx(xe,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:s("form.server_port.tooltip")})})})]})})]}),e.jsx(b,{children:e.jsx(D,{placeholder:s("form.server_port.placeholder"),...I})}),e.jsx(P,{})]})})]})]}),l&&e.jsx(ix,{serverType:c,value:N.watch("protocol_settings"),onChange:I=>N.setValue("protocol_settings",I,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),e.jsx(v,{control:N.control,name:"parent_id",render:({field:I})=>e.jsxs(f,{children:[e.jsx(j,{children:s("form.parent.label")}),e.jsxs(J,{onValueChange:I.onChange,value:I.value?.toString()||"0",children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:s("form.parent.placeholder")})})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("form.parent.none")}),T?.map(H=>e.jsx(A,{value:H.id.toString(),className:"cursor-pointer",children:H.name},H.id))]})]}),e.jsx(P,{})]})}),e.jsx(v,{control:N.control,name:"route_ids",render:({field:I})=>e.jsxs(f,{children:[e.jsx(j,{children:s("form.route.label")}),e.jsx(b,{children:e.jsx(wt,{options:k,onChange:H=>I.onChange(H.map(O=>O.value)),value:k?.filter(H=>I.value.includes(H.value)),placeholder:s("form.route.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:s("form.route.empty")})})}),e.jsx(P,{})]})})]}),e.jsxs(Le,{className:"mt-6 flex flex-col sm:flex-row gap-2 sm:gap-0",children:[e.jsx(L,{type:"button",variant:"outline",onClick:p,className:"w-full sm:w-auto",children:s("form.cancel")}),e.jsx(L,{type:"submit",onClick:_,className:"w-full sm:w-auto",children:s("form.submit")})]})]})]})]})}function rl({column:s,title:a,options:t}){const l=s?.getFacetedUniqueValues(),n=new Set(s?.getFilterValue());return e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Da,{className:"mr-2 h-4 w-4"}),a,n?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:n.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:n.size>2?e.jsxs(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[n.size," selected"]}):t.filter(r=>n.has(r.value)).map(r=>e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:r.label},r.value))})]})]})}),e.jsx(bs,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Us,{children:[e.jsx(it,{placeholder:a}),e.jsxs(Ks,{children:[e.jsx(ot,{children:"No results found."}),e.jsx(ns,{children:t.map(r=>{const o=n.has(r.value);return e.jsxs($e,{onSelect:()=>{o?n.delete(r.value):n.add(r.value);const c=Array.from(n);s?.setFilterValue(c.length?c:void 0)},className:"cursor-pointer",children:[e.jsx("div",{className:y("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",o?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(at,{className:y("h-4 w-4")})}),r.icon&&e.jsx(r.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${r.color}`}),e.jsx("span",{children:r.label}),l?.get(r.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:l.get(r.value)})]},r.value)})}),n.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{}),e.jsx(ns,{children:e.jsx($e,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center cursor-pointer",children:"Clear filters"})})]})]})]})})]})}const cx=[{value:ie.Shadowsocks,label:cs.find(s=>s.type===ie.Shadowsocks)?.label,color:Ge[ie.Shadowsocks]},{value:ie.Vmess,label:cs.find(s=>s.type===ie.Vmess)?.label,color:Ge[ie.Vmess]},{value:ie.Trojan,label:cs.find(s=>s.type===ie.Trojan)?.label,color:Ge[ie.Trojan]},{value:ie.Hysteria,label:cs.find(s=>s.type===ie.Hysteria)?.label,color:Ge[ie.Hysteria]},{value:ie.Vless,label:cs.find(s=>s.type===ie.Vless)?.label,color:Ge[ie.Vless]},{value:ie.Tuic,label:cs.find(s=>s.type===ie.Tuic)?.label,color:Ge[ie.Tuic]},{value:ie.Socks,label:cs.find(s=>s.type===ie.Socks)?.label,color:Ge[ie.Socks]},{value:ie.Naive,label:cs.find(s=>s.type===ie.Naive)?.label,color:Ge[ie.Naive]},{value:ie.Http,label:cs.find(s=>s.type===ie.Http)?.label,color:Ge[ie.Http]},{value:ie.Mieru,label:cs.find(s=>s.type===ie.Mieru)?.label,color:Ge[ie.Mieru]}];function dx({table:s,saveOrder:a,isSortMode:t,groups:l}){const n=s.getState().columnFilters.length>0,{t:r}=V("server");return e.jsxs("div",{className:"flex items-center justify-between ",children:[e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[!t&&e.jsxs(e.Fragment,{children:[e.jsx(ox,{}),e.jsx(D,{placeholder:r("toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:o=>s.getColumn("name")?.setFilterValue(o.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs("div",{className:"flex gap-x-2",children:[s.getColumn("type")&&e.jsx(rl,{column:s.getColumn("type"),title:r("toolbar.type"),options:cx}),s.getColumn("group_ids")&&e.jsx(rl,{column:s.getColumn("group_ids"),title:r("columns.groups.title"),options:l.map(o=>({label:o.name,value:o.id.toString()}))})]}),n&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]}),t&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:r("toolbar.sort.tip")})})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:t?"default":"outline",onClick:a,size:"sm",children:r(t?"toolbar.sort.save":"toolbar.sort.edit")})})]})}const Wt=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M15.71 12.71a6 6 0 1 0-7.42 0a10 10 0 0 0-6.22 8.18a1 1 0 0 0 2 .22a8 8 0 0 1 15.9 0a1 1 0 0 0 1 .89h.11a1 1 0 0 0 .88-1.1a10 10 0 0 0-6.25-8.19M12 12a4 4 0 1 1 4-4a4 4 0 0 1-4 4"})}),ia={0:"bg-destructive/80 shadow-sm shadow-destructive/50",1:"bg-yellow-500/80 shadow-sm shadow-yellow-500/50",2:"bg-emerald-500/80 shadow-sm shadow-emerald-500/50"},Ee=(s,a)=>a>0?Math.round(s/a*100):0,mx=s=>{const{t:a}=V("server");return[{id:"drag-handle",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.sort")}),cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(Ta,{className:"size-4 cursor-move text-muted-foreground transition-colors hover:text-primary","aria-hidden":"true"})}),size:50},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.nodeId")}),cell:({row:t})=>{const l=t.getValue("id"),n=t.original.code;return e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsxs("div",{className:"group/id flex items-center space-x-2",children:[e.jsxs(G,{variant:"outline",className:y("border-2 font-medium transition-all duration-200 hover:opacity-80","flex items-center gap-1.5"),style:{borderColor:Ge[t.original.type]},children:[e.jsx(ir,{className:"size-3"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"flex items-center gap-0.5",children:n??l}),t.original.parent?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-muted-foreground/30",children:"→"}),e.jsx("span",{children:t.original.parent?.code||t.original.parent?.id})]}):""]})]}),e.jsx(L,{variant:"ghost",size:"icon",className:"size-5 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:text-muted-foreground group-hover/id:opacity-100",onClick:r=>{r.stopPropagation(),ba(n||l.toString()).then(()=>{$.success(a("common:copy.success"))})},children:e.jsx(Jn,{className:"size-3"})})]})}),e.jsxs(xe,{side:"top",className:"flex flex-col gap-1 p-3",children:[e.jsxs("p",{className:"font-medium",children:[cs.find(r=>r.type===t.original.type)?.label,t.original.parent?" (子节点)":""]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n?"点击括号内容或复制按钮可复制节点代码":"点击复制按钮可复制节点ID"})]})]})})},size:50,enableSorting:!0},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.show")}),cell:({row:t})=>{const[l,n]=m.useState(!!t.getValue("show"));return e.jsx(Z,{checked:l,onCheckedChange:async r=>{n(r),Zs.update({id:t.original.id,type:t.original.type,show:r?1:0}).catch(()=>{n(!r),s()})},style:{backgroundColor:l?Ge[t.original.type]:void 0}})},size:50,enableSorting:!1},{accessorKey:"name",header:({column:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(z,{column:t,title:a("columns.node"),tooltip:e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-2",children:[e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:y("h-2.5 w-2.5 rounded-full",ia[0])}),e.jsx("span",{className:"text-sm font-medium",children:a("columns.status.0")})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:y("h-2.5 w-2.5 rounded-full",ia[1])}),e.jsx("span",{className:"text-sm font-medium",children:a("columns.status.1")})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:y("h-2.5 w-2.5 rounded-full",ia[2])}),e.jsx("span",{className:"text-sm font-medium",children:a("columns.status.2")})]})]})})}),cell:({row:t})=>e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{children:e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:y("size-2.5 flex-shrink-0 rounded-full transition-all duration-200",ia[t.original.available_status])}),e.jsx("span",{className:"text-left font-medium transition-colors hover:text-primary",children:t.getValue("name")})]})}),e.jsx(xe,{children:e.jsxs("div",{className:" space-y-3",children:[e.jsx("p",{className:"font-medium",children:a(`columns.status.${t.original.available_status}`)}),t.original.load_status&&e.jsxs("div",{className:"border-t border-border/50 pt-3",children:[e.jsx("p",{className:"mb-3 text-sm font-medium",children:a("columns.loadStatus.details")}),e.jsxs("div",{className:"space-y-3 text-xs",children:[e.jsx("div",{children:e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[a("columns.loadStatus.cpu"),":"]}),e.jsxs("div",{className:"ml-2 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:y("h-full transition-all duration-300",t.original.load_status.cpu>=90?"bg-destructive":t.original.load_status.cpu>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Math.min(100,t.original.load_status.cpu)}%`}})}),e.jsxs("span",{className:y("min-w-[3rem] text-right font-semibold",t.original.load_status.cpu>=90?"text-destructive":t.original.load_status.cpu>=70?"text-yellow-600":"text-emerald-600"),children:[Math.round(t.original.load_status.cpu),"%"]})]})]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[a("columns.loadStatus.memory"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:y("h-full transition-all duration-300",Ee(t.original.load_status.mem.used,t.original.load_status.mem.total)>=90?"bg-destructive":Ee(t.original.load_status.mem.used,t.original.load_status.mem.total)>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Ee(t.original.load_status.mem.used,t.original.load_status.mem.total)}%`}})}),e.jsxs("span",{className:y("min-w-[3rem] text-right font-semibold",Ee(t.original.load_status.mem.used,t.original.load_status.mem.total)>=90?"text-destructive":Ee(t.original.load_status.mem.used,t.original.load_status.mem.total)>=70?"text-yellow-600":"text-emerald-600"),children:[Ee(t.original.load_status.mem.used,t.original.load_status.mem.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.mem.used)," ","/"," ",Oe(t.original.load_status.mem.total)]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[a("columns.loadStatus.swap"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:y("h-full transition-all duration-300",Ee(t.original.load_status.swap.used,t.original.load_status.swap.total)>=80?"bg-destructive":Ee(t.original.load_status.swap.used,t.original.load_status.swap.total)>=50?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Ee(t.original.load_status.swap.used,t.original.load_status.swap.total)}%`}})}),e.jsxs("span",{className:y("min-w-[3rem] text-right font-semibold",Ee(t.original.load_status.swap.used,t.original.load_status.swap.total)>=80?"text-destructive":Ee(t.original.load_status.swap.used,t.original.load_status.swap.total)>=50?"text-yellow-600":"text-emerald-600"),children:[Ee(t.original.load_status.swap.used,t.original.load_status.swap.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.swap.used)," ","/"," ",Oe(t.original.load_status.swap.total)]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[a("columns.loadStatus.disk"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:y("h-full transition-all duration-300",Ee(t.original.load_status.disk.used,t.original.load_status.disk.total)>=90?"bg-destructive":Ee(t.original.load_status.disk.used,t.original.load_status.disk.total)>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Ee(t.original.load_status.disk.used,t.original.load_status.disk.total)}%`}})}),e.jsxs("span",{className:y("min-w-[3rem] text-right font-semibold",Ee(t.original.load_status.disk.used,t.original.load_status.disk.total)>=90?"text-destructive":Ee(t.original.load_status.disk.used,t.original.load_status.disk.total)>=70?"text-yellow-600":"text-emerald-600"),children:[Ee(t.original.load_status.disk.used,t.original.load_status.disk.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.disk.used)," ","/"," ",Oe(t.original.load_status.disk.total)]})]})]})]})]})})]})}),enableSorting:!1,size:200},{accessorKey:"host",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.address")}),cell:({row:t})=>{const l=`${t.original.host}:${t.original.port}`,n=t.original.port!==t.original.server_port;return e.jsxs("div",{className:"group relative flex min-w-0 items-start",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1 gap-y-0.5 pr-7",children:[e.jsx("div",{className:"flex items-center ",children:e.jsxs("span",{className:"font-mono text-sm font-medium text-foreground/90",children:[t.original.host,":",t.original.port]})}),n&&e.jsxs("span",{className:"whitespace-nowrap text-[0.7rem] tracking-tight text-muted-foreground/40",children:["(",a("columns.internalPort")," ",t.original.server_port,")"]})]}),e.jsx("div",{className:"absolute right-0 top-0",children:e.jsx(ye,{delayDuration:0,children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx(L,{variant:"ghost",size:"icon",className:"size-6 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:bg-muted/50 hover:text-muted-foreground group-hover:opacity-100",onClick:r=>{r.stopPropagation(),ba(l).then(()=>{$.success(a("common:copy.success"))})},children:e.jsx(Jn,{className:"size-3"})})}),e.jsx(xe,{side:"top",sideOffset:10,children:a("columns.copyAddress")})]})})})]})},enableSorting:!1,enableHiding:!0},{accessorKey:"online",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.onlineUsers.title"),tooltip:a("columns.onlineUsers.tooltip")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(Wt,{className:"size-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("online")})]}),size:80,enableSorting:!0,enableHiding:!0},{accessorKey:"rate",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.rate.title"),tooltip:a("columns.rate.tooltip")}),cell:({row:t})=>e.jsxs(G,{variant:"secondary",className:"font-medium",children:[t.getValue("rate")," x"]}),size:80,enableSorting:!1,enableHiding:!0},{accessorKey:"group_ids",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.groups.title"),tooltip:a("columns.groups.tooltip")}),cell:({row:t})=>{const l=t.original.groups||[];return e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[l.map((n,r)=>e.jsx(G,{variant:"secondary",className:y("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5"),children:n.name},r)),l.length===0&&e.jsx("span",{className:"text-sm text-muted-foreground",children:a("columns.groups.empty")})]})},enableSorting:!1,filterFn:(t,l,n)=>{const r=t.getValue(l);return r?n.some(o=>r.includes(o)):!1}},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.type")}),cell:({row:t})=>{const l=t.getValue("type");return e.jsx(G,{variant:"outline",className:"border-2 font-medium transition-colors",style:{borderColor:Ge[l]},children:l})},enableSorting:!1,enableHiding:!0,enableColumnFilter:!1,size:8e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:a("columns.actions")}),cell:({row:t})=>{const{setIsOpen:l,setEditingServer:n,setServerType:r}=Kr();return e.jsx("div",{className:"flex justify-center",children:e.jsxs(Es,{modal:!1,children:[e.jsx(Is,{asChild:!0,children:e.jsx(L,{variant:"ghost",className:"h-8 w-8 p-0 hover:bg-muted","aria-label":a("columns.actions"),children:e.jsx(va,{className:"size-4"})})}),e.jsxs(ws,{align:"end",className:"w-40",children:[e.jsx(_e,{className:"cursor-pointer",onClick:()=>{r(t.original.type),n(t.original),l(!0)},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(zc,{className:"mr-2 size-4"}),a("columns.actions_dropdown.edit")]})}),e.jsxs(_e,{className:"cursor-pointer",onClick:async()=>{Zs.copy({id:t.original.id}).then(({data:o})=>{o&&($.success(a("columns.actions_dropdown.copy_success")),s())})},children:[e.jsx($c,{className:"mr-2 size-4"}),a("columns.actions_dropdown.copy")]}),e.jsx(Nt,{}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onSelect:o=>o.preventDefault(),children:e.jsx(ls,{title:a("columns.actions_dropdown.delete.title"),description:a("columns.actions_dropdown.delete.description"),confirmText:a("columns.actions_dropdown.delete.confirm"),variant:"destructive",onConfirm:async()=>{Zs.drop({id:t.original.id}).then(({data:o})=>{o&&($.success(a("columns.actions_dropdown.delete_success")),s())})},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(We,{className:"mr-2 size-4"}),a("columns.actions_dropdown.delete.confirm")]})})})]})]})})},size:50}]};function ux(){const[s,a]=m.useState({}),[t,l]=m.useState({"drag-handle":!1}),[n,r]=m.useState([]),[o,c]=m.useState({pageSize:500,pageIndex:0}),[u,i]=m.useState([]),[d,h]=m.useState(!1),[k,C]=m.useState({}),[S,w]=m.useState([]),{refetch:N}=le({queryKey:["nodeList"],queryFn:async()=>{const{data:I}=await Zs.getList();return w(I),I}}),{data:g}=le({queryKey:["groups"],queryFn:async()=>{const{data:I}=await rt.getList();return I}});m.useEffect(()=>{l({"drag-handle":d,show:!d,host:!d,online:!d,rate:!d,groups:!d,type:!1,actions:!d}),C({name:d?2e3:200}),c({pageSize:d?99999:500,pageIndex:0})},[d]);const T=(I,H)=>{d&&(I.dataTransfer.setData("text/plain",H.toString()),I.currentTarget.classList.add("opacity-50"))},E=(I,H)=>{if(!d)return;I.preventDefault(),I.currentTarget.classList.remove("bg-muted");const O=parseInt(I.dataTransfer.getData("text/plain"));if(O===H)return;const B=[...S],[ce]=B.splice(O,1);B.splice(H,0,ce),w(B)},p=async()=>{if(!d){h(!0);return}const I=S?.map((H,O)=>({id:H.id,order:O+1}));Zs.sort(I).then(()=>{$.success("排序保存成功"),h(!1),N()}).finally(()=>{h(!1)})},_=Je({data:S||[],columns:mx(N),state:{sorting:u,columnVisibility:t,rowSelection:s,columnFilters:n,columnSizing:k,pagination:o},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:i,onColumnFiltersChange:r,onColumnVisibilityChange:l,onColumnSizingChange:C,onPaginationChange:c,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(Hu,{refetch:N,children:e.jsx("div",{className:"space-y-4",children:e.jsx(os,{table:_,toolbar:I=>e.jsx(dx,{table:I,refetch:N,saveOrder:p,isSortMode:d,groups:g||[]}),draggable:d,onDragStart:T,onDragEnd:I=>I.currentTarget.classList.remove("opacity-50"),onDragOver:I=>{I.preventDefault(),I.currentTarget.classList.add("bg-muted")},onDragLeave:I=>I.currentTarget.classList.remove("bg-muted"),onDrop:E,showPagination:!d})})})}function xx(){const{t:s}=V("server");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("manage.title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("manage.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(ux,{})})]})]})}const hx=Object.freeze(Object.defineProperty({__proto__:null,default:xx},Symbol.toStringTag,{value:"Module"}));function px({table:s,refetch:a}){const t=s.getState().columnFilters.length>0,{t:l}=V("group");return e.jsx("div",{className:"flex items-center justify-between space-x-4",children:e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsx(Aa,{refetch:a}),e.jsx(D,{placeholder:l("toolbar.searchPlaceholder"),value:s.getColumn("name")?.getFilterValue()??"",onChange:n=>s.getColumn("name")?.setFilterValue(n.target.value),className:y("h-8 w-[150px] lg:w-[250px]",t&&"border-primary/50 ring-primary/20")}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[l("toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]})})}const gx=s=>{const{t:a}=V("group");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.id")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(G,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium",children:t.getValue("name")})})},{accessorKey:"users_count",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.usersCount")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(Wt,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("users_count")})]}),enableSorting:!0},{accessorKey:"server_count",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.serverCount")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(ir,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("server_count")})]}),enableSorting:!0,size:8e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:a("columns.actions")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(Aa,{defaultValues:t.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:a("form.edit")})]})}),e.jsx(ls,{title:a("messages.deleteConfirm"),description:a("messages.deleteDescription"),confirmText:a("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{rt.drop({id:t.original.id}).then(({data:l})=>{l&&($.success(a("messages.updateSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:a("messages.deleteButton")})]})})]})}]};function fx(){const[s,a]=m.useState({}),[t,l]=m.useState({}),[n,r]=m.useState([]),[o,c]=m.useState([]),{data:u,refetch:i,isLoading:d}=le({queryKey:["serverGroupList"],queryFn:async()=>{const{data:k}=await rt.getList();return k}}),h=Je({data:u||[],columns:gx(i),state:{sorting:o,columnVisibility:t,rowSelection:s,columnFilters:n},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:r,onColumnVisibilityChange:l,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(os,{table:h,toolbar:k=>e.jsx(px,{table:k,refetch:i}),isLoading:d})}function jx(){const{t:s}=V("group");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(fx,{})})]})]})}const vx=Object.freeze(Object.defineProperty({__proto__:null,default:jx},Symbol.toStringTag,{value:"Module"})),bx=s=>x.object({remarks:x.string().min(1,s("form.validation.remarks")),match:x.array(x.string()),action:x.enum(["block","dns"]),action_value:x.string().optional()});function Br({refetch:s,dialogTrigger:a,defaultValues:t={remarks:"",match:[],action:"block",action_value:""},type:l="add"}){const{t:n}=V("route"),r=Ne({resolver:we(bx(n)),defaultValues:t,mode:"onChange"}),[o,c]=m.useState(!1);return e.jsxs(he,{open:o,onOpenChange:c,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"})," ",e.jsx("div",{children:n("form.add")})]})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(je,{children:[e.jsx(pe,{children:n(l==="edit"?"form.edit":"form.create")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...r,children:[e.jsx(v,{control:r.control,name:"remarks",render:({field:u})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:n("form.remarks")}),e.jsx("div",{className:"relative",children:e.jsx(b,{children:e.jsx(D,{type:"text",placeholder:n("form.remarksPlaceholder"),...u})})}),e.jsx(P,{})]})}),e.jsx(v,{control:r.control,name:"match",render:({field:u})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:n("form.match")}),e.jsx("div",{className:"relative",children:e.jsx(b,{children:e.jsx(ks,{className:"min-h-[120px]",placeholder:n("form.matchPlaceholder"),value:u.value.join(` +`).filter(O=>O.trim()!=="");p.onChange(H)}})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:c.control,name:"tls.server_name",render:({field:p})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:l("dynamic_form.anytls.tls.server_name.label","SNI")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dynamic_form.anytls.tls.server_name.placeholder","服务器名称"),...p})})]})}),e.jsx(v,{control:c.control,name:"tls.allow_insecure",render:({field:p})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dynamic_form.anytls.tls.allow_insecure","允许不安全连接")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(b,{children:e.jsx(Z,{checked:p.value,onCheckedChange:p.onChange})})})]})})]})]})})};return e.jsx(je,{children:E[s]?.()})};function cx(){const{t:s}=V("server"),a=x.object({id:x.number().optional().nullable(),specific_key:x.string().optional().nullable(),code:x.string().optional(),show:x.boolean().optional().nullable(),name:x.string().min(1,s("form.name.error")),rate:x.string().min(1,s("form.rate.error")).refine(I=>!isNaN(parseFloat(I))&&isFinite(Number(I)),{message:s("form.rate.error_numeric")}).refine(I=>parseFloat(I)>=0,{message:s("form.rate.error_gte_zero")}),tags:x.array(x.string()).default([]),excludes:x.array(x.string()).default([]),ips:x.array(x.string()).default([]),group_ids:x.array(x.string()).default([]),host:x.string().min(1,s("form.host.error")),port:x.string().min(1,s("form.port.error")),server_port:x.string().min(1,s("form.server_port.error")),parent_id:x.string().default("0").nullable(),route_ids:x.array(x.string()).default([]),protocol_settings:x.record(x.any()).default({}).nullable()}),t={id:null,specific_key:null,code:"",show:!1,name:"",rate:"1",tags:[],excludes:[],ips:[],group_ids:[],host:"",port:"",server_port:"",parent_id:"0",route_ids:[],protocol_settings:null},{isOpen:l,setIsOpen:n,editingServer:r,setEditingServer:o,serverType:c,setServerType:u,refetch:i}=Kr(),[d,h]=m.useState([]),[k,C]=m.useState([]),[S,w]=m.useState([]),N=Ne({resolver:we(a),defaultValues:t,mode:"onChange"});m.useEffect(()=>{g()},[l]),m.useEffect(()=>{r?.type&&r.type!==c&&u(r.type)},[r,c,u]),m.useEffect(()=>{r?r.type===c&&N.reset({...t,...r}):N.reset({...t,protocol_settings:Pe[c].schema.parse({})})},[r,N,c]);const g=async()=>{if(!l)return;const[I,H,O]=await Promise.all([rt.getList(),Ia.getList(),Zs.getList()]);h(I.data?.map(B=>({label:B.name,value:B.id.toString()}))||[]),C(H.data?.map(B=>({label:B.remarks,value:B.id.toString()}))||[]),w(O.data||[])},T=m.useMemo(()=>S?.filter(I=>(I.parent_id===0||I.parent_id===null)&&I.type===c&&I.id!==N.watch("id")),[c,S,N]),E=()=>e.jsxs(Es,{children:[e.jsx(Is,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("div",{children:s("form.add_node")})]})}),e.jsx(ws,{align:"start",children:e.jsx(Vd,{children:cs.map(({type:I,label:H})=>e.jsx(_e,{onClick:()=>{u(I),n(!0)},className:"cursor-pointer",children:e.jsx(G,{variant:"outline",className:"text-white",style:{background:Ge[I]},children:H})},I))})})]}),p=()=>{n(!1),o(null),N.reset(t)},_=async()=>{const I=N.getValues();(await Zs.save({...I,type:c})).data&&(p(),$.success(s("form.success")),i())};return e.jsxs(ge,{open:l,onOpenChange:p,children:[E(),e.jsxs(pe,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:s(r?"form.edit_node":"form.new_node")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...N,children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:N.control,name:"name",render:({field:I})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:s("form.name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("form.name.placeholder"),...I})}),e.jsx(P,{})]})}),e.jsx(v,{control:N.control,name:"rate",render:({field:I})=>e.jsxs(f,{className:"flex-[1]",children:[e.jsx(j,{children:s("form.rate.label")}),e.jsx("div",{className:"relative flex",children:e.jsx(b,{children:e.jsx(D,{type:"number",min:"0",step:"0.1",...I})})}),e.jsx(P,{})]})})]}),e.jsx(v,{control:N.control,name:"code",render:({field:I})=>e.jsxs(f,{children:[e.jsxs(j,{children:[s("form.code.label"),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:s("form.code.optional")})]}),e.jsx(b,{children:e.jsx(D,{placeholder:s("form.code.placeholder"),...I,value:I.value||""})}),e.jsx(P,{})]})}),e.jsx(v,{control:N.control,name:"tags",render:({field:I})=>e.jsxs(f,{children:[e.jsx(j,{children:s("form.tags.label")}),e.jsx(b,{children:e.jsx(Tn,{value:I.value,onChange:I.onChange,placeholder:s("form.tags.placeholder"),className:"w-full"})}),e.jsx(P,{})]})}),e.jsx(v,{control:N.control,name:"group_ids",render:({field:I})=>e.jsxs(f,{children:[e.jsxs(j,{className:"flex items-center justify-between",children:[s("form.groups.label"),e.jsx(qa,{dialogTrigger:e.jsx(L,{variant:"link",children:s("form.groups.add")}),refetch:g})]}),e.jsx(b,{children:e.jsx(wt,{options:d,onChange:H=>I.onChange(H.map(O=>O.value)),value:d?.filter(H=>I.value.includes(H.value)),placeholder:s("form.groups.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:s("form.groups.empty")})})}),e.jsx(P,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:N.control,name:"host",render:({field:I})=>e.jsxs(f,{children:[e.jsx(j,{children:s("form.host.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:s("form.host.placeholder"),...I})}),e.jsx(P,{})]})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(v,{control:N.control,name:"port",render:({field:I})=>e.jsxs(f,{className:"flex-1",children:[e.jsxs(j,{className:"flex items-center gap-1.5",children:[s("form.port.label"),e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(ze,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(ja,{children:e.jsx(oe,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:s("form.port.tooltip")})})})]})})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(b,{children:e.jsx(D,{placeholder:s("form.port.placeholder"),...I})}),e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0 text-muted-foreground/50 hover:text-muted-foreground",onClick:()=>{const H=I.value;H&&N.setValue("server_port",H)},children:e.jsx(ze,{icon:"tabler:arrows-right",className:"size-3"})})}),e.jsx(oe,{side:"right",children:e.jsx("p",{children:s("form.port.sync")})})]})})]}),e.jsx(P,{})]})}),e.jsx(v,{control:N.control,name:"server_port",render:({field:I})=>e.jsxs(f,{className:"flex-1",children:[e.jsxs(j,{className:"flex items-center gap-1.5",children:[s("form.server_port.label"),e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(ze,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(ja,{children:e.jsx(oe,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:s("form.server_port.tooltip")})})})]})})]}),e.jsx(b,{children:e.jsx(D,{placeholder:s("form.server_port.placeholder"),...I})}),e.jsx(P,{})]})})]})]}),l&&e.jsx(ox,{serverType:c,value:N.watch("protocol_settings"),onChange:I=>N.setValue("protocol_settings",I,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),e.jsx(v,{control:N.control,name:"parent_id",render:({field:I})=>e.jsxs(f,{children:[e.jsx(j,{children:s("form.parent.label")}),e.jsxs(J,{onValueChange:I.onChange,value:I.value?.toString()||"0",children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:s("form.parent.placeholder")})})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("form.parent.none")}),T?.map(H=>e.jsx(A,{value:H.id.toString(),className:"cursor-pointer",children:H.name},H.id))]})]}),e.jsx(P,{})]})}),e.jsx(v,{control:N.control,name:"route_ids",render:({field:I})=>e.jsxs(f,{children:[e.jsx(j,{children:s("form.route.label")}),e.jsx(b,{children:e.jsx(wt,{options:k,onChange:H=>I.onChange(H.map(O=>O.value)),value:k?.filter(H=>I.value.includes(H.value)),placeholder:s("form.route.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:s("form.route.empty")})})}),e.jsx(P,{})]})})]}),e.jsxs(Le,{className:"mt-6 flex flex-col sm:flex-row gap-2 sm:gap-0",children:[e.jsx(L,{type:"button",variant:"outline",onClick:p,className:"w-full sm:w-auto",children:s("form.cancel")}),e.jsx(L,{type:"submit",onClick:_,className:"w-full sm:w-auto",children:s("form.submit")})]})]})]})]})}function rl({column:s,title:a,options:t}){const l=s?.getFacetedUniqueValues(),n=new Set(s?.getFilterValue());return e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Pa,{className:"mr-2 h-4 w-4"}),a,n?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:n.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:n.size>2?e.jsxs(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[n.size," selected"]}):t.filter(r=>n.has(r.value)).map(r=>e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:r.label},r.value))})]})]})}),e.jsx(bs,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Us,{children:[e.jsx(it,{placeholder:a}),e.jsxs(Ks,{children:[e.jsx(ot,{children:"No results found."}),e.jsx(ns,{children:t.map(r=>{const o=n.has(r.value);return e.jsxs($e,{onSelect:()=>{o?n.delete(r.value):n.add(r.value);const c=Array.from(n);s?.setFilterValue(c.length?c:void 0)},className:"cursor-pointer",children:[e.jsx("div",{className:y("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",o?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(at,{className:y("h-4 w-4")})}),r.icon&&e.jsx(r.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${r.color}`}),e.jsx("span",{children:r.label}),l?.get(r.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:l.get(r.value)})]},r.value)})}),n.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{}),e.jsx(ns,{children:e.jsx($e,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center cursor-pointer",children:"Clear filters"})})]})]})]})})]})}const dx=[{value:ie.Shadowsocks,label:cs.find(s=>s.type===ie.Shadowsocks)?.label,color:Ge[ie.Shadowsocks]},{value:ie.Vmess,label:cs.find(s=>s.type===ie.Vmess)?.label,color:Ge[ie.Vmess]},{value:ie.Trojan,label:cs.find(s=>s.type===ie.Trojan)?.label,color:Ge[ie.Trojan]},{value:ie.Hysteria,label:cs.find(s=>s.type===ie.Hysteria)?.label,color:Ge[ie.Hysteria]},{value:ie.Vless,label:cs.find(s=>s.type===ie.Vless)?.label,color:Ge[ie.Vless]},{value:ie.Tuic,label:cs.find(s=>s.type===ie.Tuic)?.label,color:Ge[ie.Tuic]},{value:ie.Socks,label:cs.find(s=>s.type===ie.Socks)?.label,color:Ge[ie.Socks]},{value:ie.Naive,label:cs.find(s=>s.type===ie.Naive)?.label,color:Ge[ie.Naive]},{value:ie.Http,label:cs.find(s=>s.type===ie.Http)?.label,color:Ge[ie.Http]},{value:ie.Mieru,label:cs.find(s=>s.type===ie.Mieru)?.label,color:Ge[ie.Mieru]}];function mx({table:s,saveOrder:a,isSortMode:t,groups:l}){const n=s.getState().columnFilters.length>0,{t:r}=V("server");return e.jsxs("div",{className:"flex items-center justify-between ",children:[e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[!t&&e.jsxs(e.Fragment,{children:[e.jsx(cx,{}),e.jsx(D,{placeholder:r("toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:o=>s.getColumn("name")?.setFilterValue(o.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs("div",{className:"flex gap-x-2",children:[s.getColumn("type")&&e.jsx(rl,{column:s.getColumn("type"),title:r("toolbar.type"),options:dx}),s.getColumn("group_ids")&&e.jsx(rl,{column:s.getColumn("group_ids"),title:r("columns.groups.title"),options:l.map(o=>({label:o.name,value:o.id.toString()}))})]}),n&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]}),t&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:r("toolbar.sort.tip")})})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:t?"default":"outline",onClick:a,size:"sm",children:r(t?"toolbar.sort.save":"toolbar.sort.edit")})})]})}const wa=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M15.71 12.71a6 6 0 1 0-7.42 0a10 10 0 0 0-6.22 8.18a1 1 0 0 0 2 .22a8 8 0 0 1 15.9 0a1 1 0 0 0 1 .89h.11a1 1 0 0 0 .88-1.1a10 10 0 0 0-6.25-8.19M12 12a4 4 0 1 1 4-4a4 4 0 0 1-4 4"})}),ra={0:"bg-destructive/80 shadow-sm shadow-destructive/50",1:"bg-yellow-500/80 shadow-sm shadow-yellow-500/50",2:"bg-emerald-500/80 shadow-sm shadow-emerald-500/50"},Ee=(s,a)=>a>0?Math.round(s/a*100):0,ux=s=>{const{t:a}=V("server");return[{id:"drag-handle",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.sort")}),cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(Da,{className:"size-4 cursor-move text-muted-foreground transition-colors hover:text-primary","aria-hidden":"true"})}),size:50},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.nodeId")}),cell:({row:t})=>{const l=t.getValue("id"),n=t.original.code;return e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("div",{className:"group/id flex items-center space-x-2",children:[e.jsxs(G,{variant:"outline",className:y("border-2 font-medium transition-all duration-200 hover:opacity-80","flex items-center gap-1.5"),style:{borderColor:Ge[t.original.type]},children:[e.jsx(ir,{className:"size-3"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"flex items-center gap-0.5",children:n??l}),t.original.parent?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-muted-foreground/30",children:"→"}),e.jsx("span",{children:t.original.parent?.code||t.original.parent?.id})]}):""]})]}),e.jsx(L,{variant:"ghost",size:"icon",className:"size-5 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:text-muted-foreground group-hover/id:opacity-100",onClick:r=>{r.stopPropagation(),ba(n||l.toString()).then(()=>{$.success(a("common:copy.success"))})},children:e.jsx(Jn,{className:"size-3"})})]})}),e.jsxs(oe,{side:"top",className:"flex flex-col gap-1 p-3",children:[e.jsxs("p",{className:"font-medium",children:[cs.find(r=>r.type===t.original.type)?.label,t.original.parent?" (子节点)":""]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n?"点击括号内容或复制按钮可复制节点代码":"点击复制按钮可复制节点ID"})]})]})})},size:50,enableSorting:!0},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.show")}),cell:({row:t})=>{const[l,n]=m.useState(!!t.getValue("show"));return e.jsx(Z,{checked:l,onCheckedChange:async r=>{n(r),Zs.update({id:t.original.id,type:t.original.type,show:r?1:0}).catch(()=>{n(!r),s()})},style:{backgroundColor:l?Ge[t.original.type]:void 0}})},size:50,enableSorting:!1},{accessorKey:"name",header:({column:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(z,{column:t,title:a("columns.node"),tooltip:e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-2",children:[e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:y("h-2.5 w-2.5 rounded-full",ra[0])}),e.jsx("span",{className:"text-sm font-medium",children:a("columns.status.0")})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:y("h-2.5 w-2.5 rounded-full",ra[1])}),e.jsx("span",{className:"text-sm font-medium",children:a("columns.status.1")})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:y("h-2.5 w-2.5 rounded-full",ra[2])}),e.jsx("span",{className:"text-sm font-medium",children:a("columns.status.2")})]})]})})}),cell:({row:t})=>e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{children:e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:y("size-2.5 flex-shrink-0 rounded-full transition-all duration-200",ra[t.original.available_status])}),e.jsx("span",{className:"text-left font-medium transition-colors hover:text-primary",children:t.getValue("name")})]})}),e.jsx(oe,{children:e.jsxs("div",{className:" space-y-3",children:[e.jsx("p",{className:"font-medium",children:a(`columns.status.${t.original.available_status}`)}),t.original.load_status&&e.jsxs("div",{className:"border-t border-border/50 pt-3",children:[e.jsx("p",{className:"mb-3 text-sm font-medium",children:a("columns.loadStatus.details")}),e.jsxs("div",{className:"space-y-3 text-xs",children:[e.jsx("div",{children:e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[a("columns.loadStatus.cpu"),":"]}),e.jsxs("div",{className:"ml-2 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:y("h-full transition-all duration-300",t.original.load_status.cpu>=90?"bg-destructive":t.original.load_status.cpu>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Math.min(100,t.original.load_status.cpu)}%`}})}),e.jsxs("span",{className:y("min-w-[3rem] text-right font-semibold",t.original.load_status.cpu>=90?"text-destructive":t.original.load_status.cpu>=70?"text-yellow-600":"text-emerald-600"),children:[Math.round(t.original.load_status.cpu),"%"]})]})]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[a("columns.loadStatus.memory"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:y("h-full transition-all duration-300",Ee(t.original.load_status.mem.used,t.original.load_status.mem.total)>=90?"bg-destructive":Ee(t.original.load_status.mem.used,t.original.load_status.mem.total)>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Ee(t.original.load_status.mem.used,t.original.load_status.mem.total)}%`}})}),e.jsxs("span",{className:y("min-w-[3rem] text-right font-semibold",Ee(t.original.load_status.mem.used,t.original.load_status.mem.total)>=90?"text-destructive":Ee(t.original.load_status.mem.used,t.original.load_status.mem.total)>=70?"text-yellow-600":"text-emerald-600"),children:[Ee(t.original.load_status.mem.used,t.original.load_status.mem.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.mem.used)," ","/"," ",Oe(t.original.load_status.mem.total)]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[a("columns.loadStatus.swap"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:y("h-full transition-all duration-300",Ee(t.original.load_status.swap.used,t.original.load_status.swap.total)>=80?"bg-destructive":Ee(t.original.load_status.swap.used,t.original.load_status.swap.total)>=50?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Ee(t.original.load_status.swap.used,t.original.load_status.swap.total)}%`}})}),e.jsxs("span",{className:y("min-w-[3rem] text-right font-semibold",Ee(t.original.load_status.swap.used,t.original.load_status.swap.total)>=80?"text-destructive":Ee(t.original.load_status.swap.used,t.original.load_status.swap.total)>=50?"text-yellow-600":"text-emerald-600"),children:[Ee(t.original.load_status.swap.used,t.original.load_status.swap.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.swap.used)," ","/"," ",Oe(t.original.load_status.swap.total)]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"font-medium",children:[a("columns.loadStatus.disk"),":"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-20 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:y("h-full transition-all duration-300",Ee(t.original.load_status.disk.used,t.original.load_status.disk.total)>=90?"bg-destructive":Ee(t.original.load_status.disk.used,t.original.load_status.disk.total)>=70?"bg-yellow-500":"bg-emerald-500"),style:{width:`${Ee(t.original.load_status.disk.used,t.original.load_status.disk.total)}%`}})}),e.jsxs("span",{className:y("min-w-[3rem] text-right font-semibold",Ee(t.original.load_status.disk.used,t.original.load_status.disk.total)>=90?"text-destructive":Ee(t.original.load_status.disk.used,t.original.load_status.disk.total)>=70?"text-yellow-600":"text-emerald-600"),children:[Ee(t.original.load_status.disk.used,t.original.load_status.disk.total),"%"]})]})]}),e.jsxs("div",{className:"ml-auto w-[9.5rem] text-right text-xs text-muted-foreground",children:[Oe(t.original.load_status.disk.used)," ","/"," ",Oe(t.original.load_status.disk.total)]})]})]})]})]})})]})}),enableSorting:!1,size:200},{accessorKey:"host",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.address")}),cell:({row:t})=>{const l=`${t.original.host}:${t.original.port}`,n=t.original.port!==t.original.server_port;return e.jsxs("div",{className:"group relative flex min-w-0 items-start",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1 gap-y-0.5 pr-7",children:[e.jsx("div",{className:"flex items-center ",children:e.jsxs("span",{className:"font-mono text-sm font-medium text-foreground/90",children:[t.original.host,":",t.original.port]})}),n&&e.jsxs("span",{className:"whitespace-nowrap text-[0.7rem] tracking-tight text-muted-foreground/40",children:["(",a("columns.internalPort")," ",t.original.server_port,")"]})]}),e.jsx("div",{className:"absolute right-0 top-0",children:e.jsx(je,{delayDuration:0,children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(L,{variant:"ghost",size:"icon",className:"size-6 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:bg-muted/50 hover:text-muted-foreground group-hover:opacity-100",onClick:r=>{r.stopPropagation(),ba(l).then(()=>{$.success(a("common:copy.success"))})},children:e.jsx(Jn,{className:"size-3"})})}),e.jsx(oe,{side:"top",sideOffset:10,children:a("columns.copyAddress")})]})})})]})},enableSorting:!1,enableHiding:!0},{accessorKey:"online",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.onlineUsers.title"),tooltip:a("columns.onlineUsers.tooltip")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(wa,{className:"size-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("online")})]}),size:80,enableSorting:!0,enableHiding:!0},{accessorKey:"rate",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.rate.title"),tooltip:a("columns.rate.tooltip")}),cell:({row:t})=>e.jsxs(G,{variant:"secondary",className:"font-medium",children:[t.getValue("rate")," x"]}),size:80,enableSorting:!1,enableHiding:!0},{accessorKey:"group_ids",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.groups.title"),tooltip:a("columns.groups.tooltip")}),cell:({row:t})=>{const l=t.original.groups||[];return e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[l.map((n,r)=>e.jsx(G,{variant:"secondary",className:y("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5"),children:n.name},r)),l.length===0&&e.jsx("span",{className:"text-sm text-muted-foreground",children:a("columns.groups.empty")})]})},enableSorting:!1,filterFn:(t,l,n)=>{const r=t.getValue(l);return r?n.some(o=>r.includes(o)):!1}},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.type")}),cell:({row:t})=>{const l=t.getValue("type");return e.jsx(G,{variant:"outline",className:"border-2 font-medium transition-colors",style:{borderColor:Ge[l]},children:l})},enableSorting:!1,enableHiding:!0,enableColumnFilter:!1,size:8e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:a("columns.actions")}),cell:({row:t})=>{const{setIsOpen:l,setEditingServer:n,setServerType:r}=Kr();return e.jsx("div",{className:"flex justify-center",children:e.jsxs(Es,{modal:!1,children:[e.jsx(Is,{asChild:!0,children:e.jsx(L,{variant:"ghost",className:"h-8 w-8 p-0 hover:bg-muted","aria-label":a("columns.actions"),children:e.jsx(va,{className:"size-4"})})}),e.jsxs(ws,{align:"end",className:"w-40",children:[e.jsx(_e,{className:"cursor-pointer",onClick:()=>{r(t.original.type),n(t.original),l(!0)},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(zc,{className:"mr-2 size-4"}),a("columns.actions_dropdown.edit")]})}),e.jsxs(_e,{className:"cursor-pointer",onClick:async()=>{Zs.copy({id:t.original.id}).then(({data:o})=>{o&&($.success(a("columns.actions_dropdown.copy_success")),s())})},children:[e.jsx($c,{className:"mr-2 size-4"}),a("columns.actions_dropdown.copy")]}),e.jsx(Nt,{}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onSelect:o=>o.preventDefault(),children:e.jsx(ls,{title:a("columns.actions_dropdown.delete.title"),description:a("columns.actions_dropdown.delete.description"),confirmText:a("columns.actions_dropdown.delete.confirm"),variant:"destructive",onConfirm:async()=>{Zs.drop({id:t.original.id}).then(({data:o})=>{o&&($.success(a("columns.actions_dropdown.delete_success")),s())})},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(We,{className:"mr-2 size-4"}),a("columns.actions_dropdown.delete.confirm")]})})})]})]})})},size:50}]};function xx(){const[s,a]=m.useState({}),[t,l]=m.useState({"drag-handle":!1}),[n,r]=m.useState([]),[o,c]=m.useState({pageSize:500,pageIndex:0}),[u,i]=m.useState([]),[d,h]=m.useState(!1),[k,C]=m.useState({}),[S,w]=m.useState([]),{refetch:N}=le({queryKey:["nodeList"],queryFn:async()=>{const{data:I}=await Zs.getList();return w(I),I}}),{data:g}=le({queryKey:["groups"],queryFn:async()=>{const{data:I}=await rt.getList();return I}});m.useEffect(()=>{l({"drag-handle":d,show:!d,host:!d,online:!d,rate:!d,groups:!d,type:!1,actions:!d}),C({name:d?2e3:200}),c({pageSize:d?99999:500,pageIndex:0})},[d]);const T=(I,H)=>{d&&(I.dataTransfer.setData("text/plain",H.toString()),I.currentTarget.classList.add("opacity-50"))},E=(I,H)=>{if(!d)return;I.preventDefault(),I.currentTarget.classList.remove("bg-muted");const O=parseInt(I.dataTransfer.getData("text/plain"));if(O===H)return;const B=[...S],[ue]=B.splice(O,1);B.splice(H,0,ue),w(B)},p=async()=>{if(!d){h(!0);return}const I=S?.map((H,O)=>({id:H.id,order:O+1}));Zs.sort(I).then(()=>{$.success("排序保存成功"),h(!1),N()}).finally(()=>{h(!1)})},_=Je({data:S||[],columns:ux(N),state:{sorting:u,columnVisibility:t,rowSelection:s,columnFilters:n,columnSizing:k,pagination:o},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:i,onColumnFiltersChange:r,onColumnVisibilityChange:l,onColumnSizingChange:C,onPaginationChange:c,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(Uu,{refetch:N,children:e.jsx("div",{className:"space-y-4",children:e.jsx(os,{table:_,toolbar:I=>e.jsx(mx,{table:I,refetch:N,saveOrder:p,isSortMode:d,groups:g||[]}),draggable:d,onDragStart:T,onDragEnd:I=>I.currentTarget.classList.remove("opacity-50"),onDragOver:I=>{I.preventDefault(),I.currentTarget.classList.add("bg-muted")},onDragLeave:I=>I.currentTarget.classList.remove("bg-muted"),onDrop:E,showPagination:!d})})})}function hx(){const{t:s}=V("server");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("manage.title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("manage.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(xx,{})})]})]})}const px=Object.freeze(Object.defineProperty({__proto__:null,default:hx},Symbol.toStringTag,{value:"Module"}));function gx({table:s,refetch:a}){const t=s.getState().columnFilters.length>0,{t:l}=V("group");return e.jsx("div",{className:"flex items-center justify-between space-x-4",children:e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsx(qa,{refetch:a}),e.jsx(D,{placeholder:l("toolbar.searchPlaceholder"),value:s.getColumn("name")?.getFilterValue()??"",onChange:n=>s.getColumn("name")?.setFilterValue(n.target.value),className:y("h-8 w-[150px] lg:w-[250px]",t&&"border-primary/50 ring-primary/20")}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[l("toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]})})}const fx=s=>{const{t:a}=V("group");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.id")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(G,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium",children:t.getValue("name")})})},{accessorKey:"users_count",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.usersCount")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(wa,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("users_count")})]}),enableSorting:!0},{accessorKey:"server_count",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.serverCount")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(ir,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("server_count")})]}),enableSorting:!0,size:8e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:a("columns.actions")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(qa,{defaultValues:t.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:a("form.edit")})]})}),e.jsx(ls,{title:a("messages.deleteConfirm"),description:a("messages.deleteDescription"),confirmText:a("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{rt.drop({id:t.original.id}).then(({data:l})=>{l&&($.success(a("messages.updateSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:a("messages.deleteButton")})]})})]})}]};function jx(){const[s,a]=m.useState({}),[t,l]=m.useState({}),[n,r]=m.useState([]),[o,c]=m.useState([]),{data:u,refetch:i,isLoading:d}=le({queryKey:["serverGroupList"],queryFn:async()=>{const{data:k}=await rt.getList();return k}}),h=Je({data:u||[],columns:fx(i),state:{sorting:o,columnVisibility:t,rowSelection:s,columnFilters:n},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:r,onColumnVisibilityChange:l,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(os,{table:h,toolbar:k=>e.jsx(gx,{table:k,refetch:i}),isLoading:d})}function vx(){const{t:s}=V("group");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(jx,{})})]})]})}const bx=Object.freeze(Object.defineProperty({__proto__:null,default:vx},Symbol.toStringTag,{value:"Module"})),yx=s=>x.object({remarks:x.string().min(1,s("form.validation.remarks")),match:x.array(x.string()),action:x.enum(["block","dns"]),action_value:x.string().optional()});function Br({refetch:s,dialogTrigger:a,defaultValues:t={remarks:"",match:[],action:"block",action_value:""},type:l="add"}){const{t:n}=V("route"),r=Ne({resolver:we(yx(n)),defaultValues:t,mode:"onChange"}),[o,c]=m.useState(!1);return e.jsxs(ge,{open:o,onOpenChange:c,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ze,{icon:"ion:add"})," ",e.jsx("div",{children:n("form.add")})]})}),e.jsxs(pe,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:n(l==="edit"?"form.edit":"form.create")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...r,children:[e.jsx(v,{control:r.control,name:"remarks",render:({field:u})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:n("form.remarks")}),e.jsx("div",{className:"relative",children:e.jsx(b,{children:e.jsx(D,{type:"text",placeholder:n("form.remarksPlaceholder"),...u})})}),e.jsx(P,{})]})}),e.jsx(v,{control:r.control,name:"match",render:({field:u})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(j,{children:n("form.match")}),e.jsx("div",{className:"relative",children:e.jsx(b,{children:e.jsx(ks,{className:"min-h-[120px]",placeholder:n("form.matchPlaceholder"),value:u.value.join(` `),onChange:i=>{u.onChange(i.target.value.split(` -`))}})})}),e.jsx(P,{})]})}),e.jsx(v,{control:r.control,name:"action",render:({field:u})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.action")}),e.jsx("div",{className:"relative",children:e.jsx(b,{children:e.jsxs(J,{onValueChange:u.onChange,defaultValue:u.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("form.actionPlaceholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"block",children:n("actions.block")}),e.jsx(A,{value:"dns",children:n("actions.dns")})]})]})})}),e.jsx(P,{})]})}),r.watch("action")==="dns"&&e.jsx(v,{control:r.control,name:"action_value",render:({field:u})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.dns")}),e.jsx("div",{className:"relative",children:e.jsx(b,{children:e.jsx(D,{type:"text",placeholder:n("form.dnsPlaceholder"),...u})})})]})}),e.jsxs(Le,{children:[e.jsx(qs,{asChild:!0,children:e.jsx(L,{variant:"outline",children:n("form.cancel")})}),e.jsx(L,{type:"submit",onClick:()=>{Ea.save(r.getValues()).then(({data:u})=>{u&&(c(!1),s&&s(),$.success(n(l==="edit"?"messages.updateSuccess":"messages.createSuccess")),r.reset())})},children:n("form.submit")})]})]})]})]})}function yx({table:s,refetch:a}){const t=s.getState().columnFilters.length>0,{t:l}=V("route");return e.jsx("div",{className:"flex items-center justify-between ",children:e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[e.jsx(Br,{refetch:a}),e.jsx(D,{placeholder:l("toolbar.searchPlaceholder"),value:s.getColumn("remarks")?.getFilterValue()??"",onChange:n=>s.getColumn("remarks")?.setFilterValue(n.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[l("toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]})})}function Nx({columns:s,data:a,refetch:t}){const[l,n]=m.useState({}),[r,o]=m.useState({}),[c,u]=m.useState([]),[i,d]=m.useState([]),h=Je({data:a,columns:s,state:{sorting:i,columnVisibility:r,rowSelection:l,columnFilters:c},enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:u,onColumnVisibilityChange:o,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(os,{table:h,toolbar:k=>e.jsx(yx,{table:k,refetch:t})})}const _x=s=>{const{t:a}=V("route"),t={block:{icon:Ac,variant:"destructive",className:"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-800"},dns:{icon:qc,variant:"secondary",className:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-400 hover:bg-blue-200 dark:hover:bg-blue-800"}};return[{accessorKey:"id",header:({column:l})=>e.jsx(z,{column:l,title:a("columns.id")}),cell:({row:l})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(G,{variant:"outline",children:l.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"remarks",header:({column:l})=>e.jsx(z,{column:l,title:a("columns.remarks")}),cell:({row:l})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:l.original.remarks})}),enableHiding:!1,enableSorting:!1},{accessorKey:"action_value",header:({column:l})=>e.jsx(z,{column:l,title:a("columns.action_value.title")}),cell:({row:l})=>{const n=l.original.action,r=l.original.action_value,o=l.original.match?.length||0;return e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("span",{className:"text-sm font-medium",children:n==="dns"&&r?a("columns.action_value.dns",{value:r}):n==="block"?e.jsx("span",{className:"text-destructive",children:a("columns.action_value.block")}):a("columns.action_value.direct")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:a("columns.matchRules",{count:o})})]})},enableHiding:!1,enableSorting:!1,size:300},{accessorKey:"action",header:({column:l})=>e.jsx(z,{column:l,title:a("columns.action")}),cell:({row:l})=>{const n=l.getValue("action"),r=t[n]?.icon;return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(G,{variant:t[n]?.variant||"default",className:y("flex items-center gap-1.5 px-3 py-1 capitalize",t[n]?.className),children:[r&&e.jsx(r,{className:"h-3.5 w-3.5"}),a(`actions.${n}`)]})})},enableSorting:!1,size:9e3},{id:"actions",header:()=>e.jsx("div",{className:"text-right",children:a("columns.actions")}),cell:({row:l})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(Br,{defaultValues:l.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:a("form.edit")})]})}),e.jsx(ls,{title:a("messages.deleteConfirm"),description:a("messages.deleteDescription"),confirmText:a("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{Ea.drop({id:l.original.id}).then(({data:n})=>{n&&($.success(a("messages.deleteSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:a("messages.deleteButton")})]})})]})}]};function wx(){const{t:s}=V("route"),[a,t]=m.useState([]);function l(){Ea.getList().then(({data:n})=>{t(n)})}return m.useEffect(()=>{l()},[]),e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Nx,{data:a,columns:_x(l),refetch:l})})]})]})}const Cx=Object.freeze(Object.defineProperty({__proto__:null,default:wx},Symbol.toStringTag,{value:"Module"})),Gr=m.createContext(void 0);function Sx({children:s,refreshData:a}){const[t,l]=m.useState(!1),[n,r]=m.useState(null);return e.jsx(Gr.Provider,{value:{isOpen:t,setIsOpen:l,editingPlan:n,setEditingPlan:r,refreshData:a},children:s})}function Dn(){const s=m.useContext(Gr);if(s===void 0)throw new Error("usePlanEdit must be used within a PlanEditProvider");return s}function kx({table:s,saveOrder:a,isSortMode:t}){const{setIsOpen:l}=Dn(),{t:n}=V("subscribe");return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsxs(L,{variant:"outline",className:"space-x-2",size:"sm",onClick:()=>l(!0),children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("div",{children:n("plan.add")})]}),e.jsx(D,{placeholder:n("plan.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:r=>s.getColumn("name")?.setFilterValue(r.target.value),className:"h-8 w-[150px] lg:w-[250px]"})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:t?"default":"outline",onClick:a,size:"sm",children:n(t?"plan.sort.save":"plan.sort.edit")})})]})}const il={monthly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},quarterly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},half_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},two_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},three_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},onetime:{color:"text-slate-700",bgColor:"bg-slate-100/80"},reset_traffic:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},Tx=s=>{const{t:a}=V("subscribe");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:"cursor-move",children:e.jsx(Ta,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.id")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(G,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.show")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("show"),onCheckedChange:l=>{ss.update({id:t.original.id,show:l}).then(({data:n})=>{!n&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"sell",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.sell")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("sell"),onCheckedChange:l=>{ss.update({id:t.original.id,sell:l}).then(({data:n})=>{!n&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"renew",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.renew"),tooltip:a("plan.columns.renew_tooltip")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("renew"),onCheckedChange:l=>{ss.update({id:t.original.id,renew:l}).then(({data:n})=>{!n&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:t.getValue("name")})}),enableSorting:!1,enableHiding:!1,size:900},{accessorKey:"users_count",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.stats")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-2",children:[e.jsx(Wt,{}),e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:t.getValue("users_count")})]}),enableSorting:!0},{accessorKey:"group",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.group")}),cell:({row:t})=>e.jsx("div",{className:"flex max-w-[600px] flex-wrap items-center gap-1.5 text-nowrap",children:e.jsx(G,{variant:"secondary",className:y("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5"),children:t.getValue("group")?.name})}),enableSorting:!1,enableHiding:!1},{accessorKey:"prices",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.price")}),cell:({row:t})=>{const l=t.getValue("prices"),n=[{period:a("plan.columns.price_period.monthly"),key:"monthly",unit:a("plan.columns.price_period.unit.month")},{period:a("plan.columns.price_period.quarterly"),key:"quarterly",unit:a("plan.columns.price_period.unit.quarter")},{period:a("plan.columns.price_period.half_yearly"),key:"half_yearly",unit:a("plan.columns.price_period.unit.half_year")},{period:a("plan.columns.price_period.yearly"),key:"yearly",unit:a("plan.columns.price_period.unit.year")},{period:a("plan.columns.price_period.two_yearly"),key:"two_yearly",unit:a("plan.columns.price_period.unit.two_year")},{period:a("plan.columns.price_period.three_yearly"),key:"three_yearly",unit:a("plan.columns.price_period.unit.three_year")},{period:a("plan.columns.price_period.onetime"),key:"onetime",unit:""},{period:a("plan.columns.price_period.reset_traffic"),key:"reset_traffic",unit:a("plan.columns.price_period.unit.times")}];return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:n.map(({period:r,key:o,unit:c})=>l[o]!=null&&e.jsxs(G,{variant:"secondary",className:y("px-2 py-0.5 font-medium transition-colors text-nowrap",il[o].color,il[o].bgColor,"border border-border/50","hover:bg-slate-200/80"),children:[r," ¥",l[o],c]},o))})},enableSorting:!1,size:9e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:a("plan.columns.actions")}),cell:({row:t})=>{const{setIsOpen:l,setEditingPlan:n}=Dn();return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",onClick:()=>{n(t.original),l(!0)},children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:a("plan.columns.edit")})]}),e.jsx(ls,{title:a("plan.columns.delete_confirm.title"),description:a("plan.columns.delete_confirm.description"),confirmText:a("plan.columns.delete"),variant:"destructive",onConfirm:async()=>{ss.drop({id:t.original.id}).then(({data:r})=>{r&&($.success(a("plan.columns.delete_confirm.success")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:a("plan.columns.delete")})]})})]})}}]},Dx=x.object({id:x.number().nullable(),group_id:x.union([x.number(),x.string()]).nullable().optional(),name:x.string().min(1).max(250),content:x.string().nullable().optional(),transfer_enable:x.union([x.number().min(0),x.string().min(1)]),prices:x.object({monthly:x.union([x.number(),x.string()]).nullable().optional(),quarterly:x.union([x.number(),x.string()]).nullable().optional(),half_yearly:x.union([x.number(),x.string()]).nullable().optional(),yearly:x.union([x.number(),x.string()]).nullable().optional(),two_yearly:x.union([x.number(),x.string()]).nullable().optional(),three_yearly:x.union([x.number(),x.string()]).nullable().optional(),onetime:x.union([x.number(),x.string()]).nullable().optional(),reset_traffic:x.union([x.number(),x.string()]).nullable().optional()}).default({}),speed_limit:x.union([x.number(),x.string()]).nullable().optional(),capacity_limit:x.union([x.number(),x.string()]).nullable().optional(),device_limit:x.union([x.number(),x.string()]).nullable().optional(),force_update:x.boolean().optional(),reset_traffic_method:x.number().nullable(),users_count:x.number().optional()}),Pn=m.forwardRef(({className:s,...a},t)=>e.jsx(or,{ref:t,className:y("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s),...a,children:e.jsx(Hc,{className:y("flex items-center justify-center text-current"),children:e.jsx(at,{className:"h-4 w-4"})})}));Pn.displayName=or.displayName;const oa={id:null,group_id:null,name:"",content:"",transfer_enable:"",prices:{monthly:"",quarterly:"",half_yearly:"",yearly:"",two_yearly:"",three_yearly:"",onetime:"",reset_traffic:""},speed_limit:"",capacity_limit:"",device_limit:"",force_update:!1,reset_traffic_method:null},ca={monthly:{label:"月付",months:1,discount:1},quarterly:{label:"季付",months:3,discount:.95},half_yearly:{label:"半年付",months:6,discount:.9},yearly:{label:"年付",months:12,discount:.85},two_yearly:{label:"两年付",months:24,discount:.8},three_yearly:{label:"三年付",months:36,discount:.75},onetime:{label:"流量包",months:1,discount:1},reset_traffic:{label:"重置包",months:1,discount:1}},Px=[{value:null,label:"follow_system"},{value:0,label:"monthly_first"},{value:1,label:"monthly_reset"},{value:2,label:"no_reset"},{value:3,label:"yearly_first"},{value:4,label:"yearly_reset"}];function Lx(){const{isOpen:s,setIsOpen:a,editingPlan:t,setEditingPlan:l,refreshData:n}=Dn(),[r,o]=m.useState(!1),{t:c}=V("subscribe"),u=Ne({resolver:we(Dx),defaultValues:{...oa,...t||{}},mode:"onChange"});m.useEffect(()=>{t?u.reset({...oa,...t}):u.reset(oa)},[t,u]);const i=new vn({html:!0}),[d,h]=m.useState();async function k(){rt.getList().then(({data:w})=>{h(w)})}m.useEffect(()=>{s&&k()},[s]);const C=w=>{if(isNaN(w))return;const N=Object.entries(ca).reduce((g,[T,E])=>{const p=w*E.months*E.discount;return{...g,[T]:p.toFixed(2)}},{});u.setValue("prices",N,{shouldDirty:!0})},S=()=>{a(!1),l(null),u.reset(oa)};return e.jsx(he,{open:s,onOpenChange:S,children:e.jsxs(ue,{children:[e.jsxs(je,{children:[e.jsx(pe,{children:c(t?"plan.form.edit_title":"plan.form.add_title")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...u,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:u.control,name:"name",render:({field:w})=>e.jsxs(f,{children:[e.jsx(j,{children:c("plan.form.name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:c("plan.form.name.placeholder"),...w})}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"group_id",render:({field:w})=>e.jsxs(f,{children:[e.jsxs(j,{className:"flex items-center justify-between",children:[c("plan.form.group.label"),e.jsx(Aa,{dialogTrigger:e.jsx(L,{variant:"link",children:c("plan.form.group.add")}),refetch:k})]}),e.jsxs(J,{value:w.value?.toString()??"",onValueChange:N=>w.onChange(N?Number(N):null),children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:c("plan.form.group.placeholder")})})}),e.jsx(Y,{children:d?.map(N=>e.jsx(A,{value:N.id.toString(),children:N.name},N.id))})]}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"transfer_enable",render:({field:w})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:c("plan.form.transfer.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",min:0,placeholder:c("plan.form.transfer.placeholder"),className:"rounded-r-none",...w})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:c("plan.form.transfer.unit")})]}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"speed_limit",render:({field:w})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:c("plan.form.speed.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",min:0,placeholder:c("plan.form.speed.placeholder"),className:"rounded-r-none",...w,value:w.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:c("plan.form.speed.unit")})]}),e.jsx(P,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center",children:[e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"}),e.jsx("h3",{className:"mx-4 text-sm font-medium text-gray-500 dark:text-gray-400",children:c("plan.form.price.title")}),e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(D,{type:"number",placeholder:c("plan.form.price.base_price"),className:"h-7 w-32 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500",onChange:w=>{const N=parseFloat(w.target.value);C(N)}})]}),e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>{const w=Object.keys(ca).reduce((N,g)=>({...N,[g]:""}),{});u.setValue("prices",w,{shouldDirty:!0})},children:c("plan.form.price.clear.button")})}),e.jsx(xe,{side:"top",align:"end",children:e.jsx("p",{className:"text-xs",children:c("plan.form.price.clear.tooltip")})})]})})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-3",children:Object.entries(ca).filter(([w])=>!["onetime","reset_traffic"].includes(w)).map(([w,N])=>e.jsx("div",{className:"group relative rounded-md bg-card p-2 ring-1 ring-gray-200 transition-all hover:ring-primary dark:ring-gray-800",children:e.jsx(v,{control:u.control,name:`prices.${w}`,render:({field:g})=>e.jsxs(f,{children:[e.jsxs(j,{className:"text-xs font-medium text-muted-foreground",children:[c(`plan.columns.price_period.${w}`),e.jsxs("span",{className:"ml-1 text-[10px] text-gray-400",children:["(",N.months===1?c("plan.form.price.period.monthly"):c("plan.form.price.period.months",{count:N.months}),")"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:"0.00",min:0,...g,value:g.value??"",onChange:T=>g.onChange(T.target.value),className:"h-7 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500"})})]})]})})},w))}),e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:Object.entries(ca).filter(([w])=>["onetime","reset_traffic"].includes(w)).map(([w,N])=>e.jsx("div",{className:"rounded-md border border-dashed border-gray-200 bg-muted/30 p-3 dark:border-gray-700",children:e.jsx(v,{control:u.control,name:`prices.${w}`,render:({field:g})=>e.jsx(f,{children:e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"space-y-0",children:[e.jsx(j,{className:"text-xs font-medium",children:c(`plan.columns.price_period.${w}`)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:c(w==="onetime"?"plan.form.price.onetime_desc":"plan.form.price.reset_desc")})]}),e.jsxs("div",{className:"relative w-full md:w-32",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:"0.00",min:0,...g,className:"h-7 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500"})})]})]})})})},w))})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(v,{control:u.control,name:"device_limit",render:({field:w})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:c("plan.form.device.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",min:0,placeholder:c("plan.form.device.placeholder"),className:"rounded-r-none",...w,value:w.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:c("plan.form.device.unit")})]}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"capacity_limit",render:({field:w})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:c("plan.form.capacity.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",min:0,placeholder:c("plan.form.capacity.placeholder"),className:"rounded-r-none",...w,value:w.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:c("plan.form.capacity.unit")})]}),e.jsx(P,{})]})})]}),e.jsx(v,{control:u.control,name:"reset_traffic_method",render:({field:w})=>e.jsxs(f,{children:[e.jsx(j,{children:c("plan.form.reset_method.label")}),e.jsxs(J,{value:w.value?.toString()??"null",onValueChange:N=>w.onChange(N=="null"?null:Number(N)),children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:c("plan.form.reset_method.placeholder")})})}),e.jsx(Y,{children:Px.map(N=>e.jsx(A,{value:N.value?.toString()??"null",children:c(`plan.form.reset_method.options.${N.label}`)},N.value))})]}),e.jsx(M,{className:"text-xs",children:c("plan.form.reset_method.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"content",render:({field:w})=>{const[N,g]=m.useState(!1);return e.jsxs(f,{className:"space-y-2",children:[e.jsxs(j,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[c("plan.form.content.label"),e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx(L,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>g(!N),children:N?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-4 w-4",children:[e.jsx("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z"}),e.jsx("path",{fillRule:"evenodd",d:"M.664 10.59a1.651 1.651 0 010-1.186A10.004 10.004 0 0110 3c4.257 0 7.893 2.66 9.336 6.41.147.381.146.804 0 1.186A10.004 10.004 0 0110 17c-4.257 0-7.893-2.66-9.336-6.41zM14 10a4 4 0 11-8 0 4 4 0 018 0z",clipRule:"evenodd"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-4 w-4",children:[e.jsx("path",{fillRule:"evenodd",d:"M3.28 2.22a.75.75 0 00-1.06 1.06l14.5 14.5a.75.75 0 101.06-1.06l-1.745-1.745a10.029 10.029 0 003.3-4.38 1.651 1.651 0 000-1.185A10.004 10.004 0 009.999 3a9.956 9.956 0 00-4.744 1.194L3.28 2.22zM7.752 6.69l1.092 1.092a2.5 2.5 0 013.374 3.373l1.091 1.092a4 4 0 00-5.557-5.557z",clipRule:"evenodd"}),e.jsx("path",{d:"M10.748 13.93l2.523 2.523a9.987 9.987 0 01-3.27.547c-4.258 0-7.894-2.66-9.337-6.41a1.651 1.651 0 010-1.186A10.007 10.007 0 012.839 6.02L6.07 9.252a4 4 0 004.678 4.678z"})]})})}),e.jsx(xe,{side:"top",children:e.jsx("p",{className:"text-xs",children:c(N?"plan.form.content.preview_button.hide":"plan.form.content.preview_button.show")})})]})})]}),e.jsx(ye,{children:e.jsxs(ge,{children:[e.jsx(fe,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",onClick:()=>{w.onChange(c("plan.form.content.template.content"))},children:c("plan.form.content.template.button")})}),e.jsx(xe,{side:"left",align:"center",children:e.jsx("p",{className:"text-xs",children:c("plan.form.content.template.tooltip")})})]})})]}),e.jsxs("div",{className:`grid gap-4 ${N?"grid-cols-1 lg:grid-cols-2":"grid-cols-1"}`,children:[e.jsx("div",{className:"space-y-2",children:e.jsx(b,{children:e.jsx(bn,{style:{height:"400px"},value:w.value||"",renderHTML:T=>i.render(T),onChange:({text:T})=>w.onChange(T),config:{view:{menu:!0,md:!0,html:!1},canView:{menu:!0,md:!0,html:!1,fullScreen:!1,hideMenu:!1}},placeholder:c("plan.form.content.placeholder"),className:"rounded-md border"})})}),N&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:c("plan.form.content.preview")}),e.jsx("div",{className:"prose prose-sm dark:prose-invert h-[400px] max-w-none overflow-y-auto rounded-md border p-4",children:e.jsx("div",{dangerouslySetInnerHTML:{__html:i.render(w.value||"")}})})]})]}),e.jsx(M,{className:"text-xs",children:c("plan.form.content.description")}),e.jsx(P,{})]})}})]}),e.jsx(Le,{className:"mt-6",children:e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsx("div",{className:"flex-shrink-0",children:t&&e.jsx(v,{control:u.control,name:"force_update",render:({field:w})=>e.jsxs(f,{className:"flex flex-row items-center space-x-2 space-y-0",children:[e.jsx(b,{children:e.jsx(Pn,{checked:w.value,onCheckedChange:w.onChange})}),e.jsx("div",{className:"",children:e.jsx(j,{className:"text-sm",children:c("plan.form.force_update.label")})})]})})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(L,{type:"button",variant:"outline",onClick:S,children:c("plan.form.submit.cancel")}),e.jsx(L,{type:"submit",disabled:r,onClick:()=>{u.handleSubmit(async w=>{o(!0),(await ss.save(w)).data&&($.success(c(t?"plan.form.submit.success.update":"plan.form.submit.success.add")),S(),n()),o(!1)})()},children:c(r?"plan.form.submit.submitting":"plan.form.submit.submit")})]})]})})]})]})})}function Ex(){const[s,a]=m.useState({}),[t,l]=m.useState({"drag-handle":!1}),[n,r]=m.useState([]),[o,c]=m.useState([]),[u,i]=m.useState(!1),[d,h]=m.useState({pageSize:20,pageIndex:0}),[k,C]=m.useState([]),{refetch:S}=le({queryKey:["planList"],queryFn:async()=>{const{data:E}=await ss.getList();return C(E),E}});m.useEffect(()=>{l({"drag-handle":u}),h({pageSize:u?99999:10,pageIndex:0})},[u]);const w=(E,p)=>{u&&(E.dataTransfer.setData("text/plain",p.toString()),E.currentTarget.classList.add("opacity-50"))},N=(E,p)=>{if(!u)return;E.preventDefault(),E.currentTarget.classList.remove("bg-muted");const _=parseInt(E.dataTransfer.getData("text/plain"));if(_===p)return;const I=[...k],[H]=I.splice(_,1);I.splice(p,0,H),C(I)},g=async()=>{if(!u){i(!0);return}const E=k?.map(p=>p.id);ss.sort(E).then(()=>{$.success("排序保存成功"),i(!1),S()}).finally(()=>{i(!1)})},T=Je({data:k||[],columns:Tx(S),state:{sorting:o,columnVisibility:t,rowSelection:s,columnFilters:n,pagination:d},enableRowSelection:!0,onPaginationChange:h,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:r,onColumnVisibilityChange:l,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}},pageCount:u?1:void 0});return e.jsx(Sx,{refreshData:S,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(os,{table:T,toolbar:E=>e.jsx(kx,{table:E,refetch:S,saveOrder:g,isSortMode:u}),draggable:u,onDragStart:w,onDragEnd:E=>E.currentTarget.classList.remove("opacity-50"),onDragOver:E=>{E.preventDefault(),E.currentTarget.classList.add("bg-muted")},onDragLeave:E=>E.currentTarget.classList.remove("bg-muted"),onDrop:N,showPagination:!u}),e.jsx(Lx,{})]})})}function Ix(){const{t:s}=V("subscribe");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("plan.title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("plan.page.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Ex,{})})]})]})}const Rx=Object.freeze(Object.defineProperty({__proto__:null,default:Ix},Symbol.toStringTag,{value:"Module"})),pt=[{value:ne.PENDING,label:Rt[ne.PENDING],icon:Uc,color:Vt[ne.PENDING]},{value:ne.PROCESSING,label:Rt[ne.PROCESSING],icon:cr,color:Vt[ne.PROCESSING]},{value:ne.COMPLETED,label:Rt[ne.COMPLETED],icon:on,color:Vt[ne.COMPLETED]},{value:ne.CANCELLED,label:Rt[ne.CANCELLED],icon:dr,color:Vt[ne.CANCELLED]},{value:ne.DISCOUNTED,label:Rt[ne.DISCOUNTED],icon:on,color:Vt[ne.DISCOUNTED]}],zt=[{value:be.PENDING,label:na[be.PENDING],icon:Kc,color:la[be.PENDING]},{value:be.PROCESSING,label:na[be.PROCESSING],icon:cr,color:la[be.PROCESSING]},{value:be.VALID,label:na[be.VALID],icon:on,color:la[be.VALID]},{value:be.INVALID,label:na[be.INVALID],icon:dr,color:la[be.INVALID]}];function da({column:s,title:a,options:t}){const l=s?.getFacetedUniqueValues(),n=s?.getFilterValue(),r=Array.isArray(n)?new Set(n):n!==void 0?new Set([n]):new Set;return e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Da,{className:"mr-2 h-4 w-4"}),a,r?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:r.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:r.size>2?e.jsxs(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[r.size," selected"]}):t.filter(o=>r.has(o.value)).map(o=>e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:o.label},o.value))})]})]})}),e.jsx(bs,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Us,{children:[e.jsx(it,{placeholder:a}),e.jsxs(Ks,{children:[e.jsx(ot,{children:"No results found."}),e.jsx(ns,{children:t.map(o=>{const c=r.has(o.value);return e.jsxs($e,{onSelect:()=>{const u=new Set(r);c?u.delete(o.value):u.add(o.value);const i=Array.from(u);s?.setFilterValue(i.length?i:void 0)},children:[e.jsx("div",{className:y("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",c?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(at,{className:y("h-4 w-4")})}),o.icon&&e.jsx(o.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${o.color}`}),e.jsx("span",{children:o.label}),l?.get(o.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:l.get(o.value)})]},o.value)})}),r.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{}),e.jsx(ns,{children:e.jsx($e,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const Vx=x.object({email:x.string().min(1),plan_id:x.number(),period:x.string(),total_amount:x.number()}),Fx={email:"",plan_id:0,total_amount:0,period:""};function Wr({refetch:s,trigger:a,defaultValues:t}){const{t:l}=V("order"),[n,r]=m.useState(!1),o=Ne({resolver:we(Vx),defaultValues:{...Fx,...t},mode:"onChange"}),[c,u]=m.useState([]);return m.useEffect(()=>{n&&ss.getList().then(({data:i})=>{u(i)})},[n]),e.jsxs(he,{open:n,onOpenChange:r,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 space-x-2",children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("div",{children:l("dialog.addOrder")})]})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(je,{children:[e.jsx(pe,{children:l("dialog.assignOrder")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...o,children:[e.jsx(v,{control:o.control,name:"email",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dialog.fields.userEmail")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dialog.placeholders.email"),...i})})]})}),e.jsx(v,{control:o.control,name:"plan_id",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dialog.fields.subscriptionPlan")}),e.jsx(b,{children:e.jsxs(J,{value:i.value?i.value?.toString():void 0,onValueChange:d=>i.onChange(parseInt(d)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dialog.placeholders.plan")})}),e.jsx(Y,{children:c.map(d=>e.jsx(A,{value:d.id.toString(),children:d.name},d.id))})]})})]})}),e.jsx(v,{control:o.control,name:"period",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dialog.fields.orderPeriod")}),e.jsx(b,{children:e.jsxs(J,{value:i.value,onValueChange:i.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dialog.placeholders.period")})}),e.jsx(Y,{children:Object.keys(rm).map(d=>e.jsx(A,{value:d,children:l(`period.${d}`)},d))})]})})]})}),e.jsx(v,{control:o.control,name:"total_amount",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dialog.fields.paymentAmount")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:l("dialog.placeholders.amount"),value:i.value/100,onChange:d=>i.onChange(parseFloat(d.currentTarget.value)*100)})}),e.jsx(P,{})]})}),e.jsxs(Le,{children:[e.jsx(L,{variant:"outline",onClick:()=>r(!1),children:l("dialog.actions.cancel")}),e.jsx(L,{type:"submit",onClick:()=>{o.handleSubmit(i=>{Qs.assign(i).then(({data:d})=>{d&&(s&&s(),o.reset(),r(!1),$.success(l("dialog.messages.addSuccess")))})})()},children:l("dialog.actions.confirm")})]})]})]})]})}function Mx({table:s,refetch:a}){const{t}=V("order"),l=s.getState().columnFilters.length>0,n=Object.values(gs).filter(u=>typeof u=="number").map(u=>({label:t(`type.${gs[u]}`),value:u,color:u===gs.NEW?"green-500":u===gs.RENEWAL?"blue-500":u===gs.UPGRADE?"purple-500":"orange-500"})),r=Object.values(Ie).map(u=>({label:t(`period.${u}`),value:u,color:u===Ie.MONTH_PRICE?"slate-500":u===Ie.QUARTER_PRICE?"cyan-500":u===Ie.HALF_YEAR_PRICE?"indigo-500":u===Ie.YEAR_PRICE?"violet-500":u===Ie.TWO_YEAR_PRICE?"fuchsia-500":u===Ie.THREE_YEAR_PRICE?"pink-500":u===Ie.ONETIME_PRICE?"rose-500":"orange-500"})),o=Object.values(ne).filter(u=>typeof u=="number").map(u=>({label:t(`status.${ne[u]}`),value:u,icon:u===ne.PENDING?pt[0].icon:u===ne.PROCESSING?pt[1].icon:u===ne.COMPLETED?pt[2].icon:u===ne.CANCELLED?pt[3].icon:pt[4].icon,color:u===ne.PENDING?"yellow-500":u===ne.PROCESSING?"blue-500":u===ne.COMPLETED?"green-500":u===ne.CANCELLED?"red-500":"green-500"})),c=Object.values(be).filter(u=>typeof u=="number").map(u=>({label:t(`commission.${be[u]}`),value:u,icon:u===be.PENDING?zt[0].icon:u===be.PROCESSING?zt[1].icon:u===be.VALID?zt[2].icon:zt[3].icon,color:u===be.PENDING?"yellow-500":u===be.PROCESSING?"blue-500":u===be.VALID?"green-500":"red-500"}));return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Wr,{refetch:a}),e.jsx(D,{placeholder:t("search.placeholder"),value:s.getColumn("trade_no")?.getFilterValue()??"",onChange:u=>s.getColumn("trade_no")?.setFilterValue(u.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2",children:[s.getColumn("type")&&e.jsx(da,{column:s.getColumn("type"),title:t("table.columns.type"),options:n}),s.getColumn("period")&&e.jsx(da,{column:s.getColumn("period"),title:t("table.columns.period"),options:r}),s.getColumn("status")&&e.jsx(da,{column:s.getColumn("status"),title:t("table.columns.status"),options:o}),s.getColumn("commission_status")&&e.jsx(da,{column:s.getColumn("commission_status"),title:t("table.columns.commissionStatus"),options:c})]}),l&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[t("actions.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]})}function xs({label:s,value:a,className:t,valueClassName:l}){return e.jsxs("div",{className:y("flex items-center py-1.5",t),children:[e.jsx("div",{className:"w-28 shrink-0 text-sm text-muted-foreground",children:s}),e.jsx("div",{className:y("text-sm",l),children:a||"-"})]})}function Ox({status:s}){const{t:a}=V("order"),t={[ne.PENDING]:"bg-yellow-100 text-yellow-800 hover:bg-yellow-100",[ne.PROCESSING]:"bg-blue-100 text-blue-800 hover:bg-blue-100",[ne.CANCELLED]:"bg-red-100 text-red-800 hover:bg-red-100",[ne.COMPLETED]:"bg-green-100 text-green-800 hover:bg-green-100",[ne.DISCOUNTED]:"bg-gray-100 text-gray-800 hover:bg-gray-100"};return e.jsx(G,{variant:"secondary",className:y("font-medium",t[s]),children:a(`status.${ne[s]}`)})}function zx({id:s,trigger:a}){const[t,l]=m.useState(!1),[n,r]=m.useState(),{t:o}=V("order");return m.useEffect(()=>{(async()=>{if(t){const{data:u}=await Qs.getInfo({id:s});r(u)}})()},[t,s]),e.jsxs(he,{onOpenChange:l,open:t,children:[e.jsx(is,{asChild:!0,children:a}),e.jsxs(ue,{className:"max-w-xl",children:[e.jsxs(je,{className:"space-y-2",children:[e.jsx(pe,{className:"text-lg font-medium",children:o("dialog.title")}),e.jsx("div",{className:"flex items-center justify-between text-sm",children:e.jsxs("div",{className:"flex items-center space-x-6",children:[e.jsxs("div",{className:"text-muted-foreground",children:[o("table.columns.tradeNo"),":",n?.trade_no]}),!!n?.status&&e.jsx(Ox,{status:n.status})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:o("dialog.basicInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(xs,{label:o("dialog.fields.userEmail"),value:n?.user?.email?e.jsxs(nt,{to:`/user/manage?email=${n.user.email}`,className:"group inline-flex items-center gap-1 text-primary hover:underline",children:[n.user.email,e.jsx(mr,{className:"h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100"})]}):"-"}),e.jsx(xs,{label:o("dialog.fields.orderPeriod"),value:n&&o(`period.${n.period}`)}),e.jsx(xs,{label:o("dialog.fields.subscriptionPlan"),value:n?.plan?.name,valueClassName:"font-medium"}),e.jsx(xs,{label:o("dialog.fields.callbackNo"),value:n?.callback_no,valueClassName:"font-mono text-xs"})]})]}),e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:o("dialog.amountInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(xs,{label:o("dialog.fields.paymentAmount"),value:Js(n?.total_amount||0),valueClassName:"font-medium text-primary"}),e.jsx(De,{className:"my-2"}),e.jsx(xs,{label:o("dialog.fields.balancePayment"),value:Js(n?.balance_amount||0)}),e.jsx(xs,{label:o("dialog.fields.discountAmount"),value:Js(n?.discount_amount||0),valueClassName:"text-green-600"}),e.jsx(xs,{label:o("dialog.fields.refundAmount"),value:Js(n?.refund_amount||0),valueClassName:"text-red-600"}),e.jsx(xs,{label:o("dialog.fields.deductionAmount"),value:Js(n?.surplus_amount||0)})]})]}),e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:o("dialog.timeInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(xs,{label:o("dialog.fields.createdAt"),value:Se(n?.created_at),valueClassName:"font-mono text-xs"}),e.jsx(xs,{label:o("dialog.fields.updatedAt"),value:Se(n?.updated_at),valueClassName:"font-mono text-xs"})]})]})]})]})]})}const $x={[gs.NEW]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[gs.RENEWAL]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[gs.UPGRADE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[gs.RESET_FLOW]:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},Ax={[Ie.MONTH_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.QUARTER_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.HALF_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.TWO_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.THREE_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.ONETIME_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.RESET_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},qx=s=>ne[s],Hx=s=>be[s],Ux=s=>gs[s],Kx=s=>{const{t:a}=V("order");return[{accessorKey:"trade_no",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.tradeNo")}),cell:({row:t})=>{const l=t.original.trade_no,n=l.length>6?`${l.slice(0,3)}...${l.slice(-3)}`:l;return e.jsx("div",{className:"flex items-center",children:e.jsx(zx,{trigger:e.jsxs(K,{variant:"ghost",size:"sm",className:"flex h-8 items-center gap-1.5 px-2 font-medium text-primary transition-colors hover:bg-primary/10 hover:text-primary/80",children:[e.jsx("span",{className:"font-mono",children:n}),e.jsx(mr,{className:"h-3.5 w-3.5 opacity-70"})]}),id:t.original.id})})},enableSorting:!1,enableHiding:!1},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.type")}),cell:({row:t})=>{const l=t.getValue("type"),n=$x[l];return e.jsx(G,{variant:"secondary",className:y("font-medium transition-colors text-nowrap",n.color,n.bgColor,"border border-border/50","hover:bg-slate-200/80"),children:a(`type.${Ux(l)}`)})},enableSorting:!1,enableHiding:!1},{accessorKey:"plan.name",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.plan")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium text-foreground/90 sm:max-w-72 md:max-w-[31rem]",children:t.original.plan?.name||"-"})}),enableSorting:!1,enableHiding:!1},{accessorKey:"period",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.period")}),cell:({row:t})=>{const l=t.getValue("period"),n=Ax[l];return e.jsx(G,{variant:"secondary",className:y("font-medium transition-colors text-nowrap",n?.color,n?.bgColor,"hover:bg-opacity-80"),children:a(`period.${l}`)})},enableSorting:!1,enableHiding:!1},{accessorKey:"total_amount",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.amount")}),cell:({row:t})=>{const l=t.getValue("total_amount"),n=typeof l=="number"?(l/100).toFixed(2):"N/A";return e.jsxs("div",{className:"flex items-center font-mono text-foreground/90",children:["¥",n]})},enableSorting:!0,enableHiding:!1},{accessorKey:"status",header:({column:t})=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(z,{column:t,title:a("table.columns.status")}),e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{children:e.jsx($r,{className:"h-4 w-4 text-muted-foreground/70 transition-colors hover:text-muted-foreground"})}),e.jsx(xe,{side:"top",className:"max-w-[200px] text-sm",children:a("status.tooltip")})]})})]}),cell:({row:t})=>{const l=pt.find(n=>n.value===t.getValue("status"));return l?e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l.icon&&e.jsx(l.icon,{className:`h-4 w-4 text-${l.color}`}),e.jsx("span",{className:"text-sm font-medium",children:a(`status.${qx(l.value)}`)})]}),l.value===ne.PENDING&&e.jsxs(Es,{modal:!0,children:[e.jsx(Is,{asChild:!0,children:e.jsxs(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-muted/60",children:[e.jsx(va,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:a("actions.openMenu")})]})}),e.jsxs(ws,{align:"end",className:"w-[140px]",children:[e.jsx(_e,{className:"cursor-pointer",onClick:async()=>{await Qs.markPaid({trade_no:t.original.trade_no}),s()},children:a("actions.markAsPaid")}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onClick:async()=>{await Qs.makeCancel({trade_no:t.original.trade_no}),s()},children:a("actions.cancel")})]})]})]}):null},enableSorting:!0,enableHiding:!1},{accessorKey:"commission_balance",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.commission")}),cell:({row:t})=>{const l=t.getValue("commission_balance"),n=l?(l/100).toFixed(2):"-";return e.jsx("div",{className:"flex items-center font-mono text-foreground/90",children:l?`¥${n}`:"-"})},enableSorting:!0,enableHiding:!1},{accessorKey:"commission_status",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.commissionStatus")}),cell:({row:t})=>{const l=t.original.status,n=t.original.commission_balance,r=zt.find(o=>o.value===t.getValue("commission_status"));return n==0||!r?e.jsx("span",{className:"text-muted-foreground",children:"-"}):e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[r.icon&&e.jsx(r.icon,{className:`h-4 w-4 text-${r.color}`}),e.jsx("span",{className:"text-sm font-medium",children:a(`commission.${Hx(r.value)}`)})]}),r.value===be.PENDING&&l===ne.COMPLETED&&e.jsxs(Es,{modal:!0,children:[e.jsx(Is,{asChild:!0,children:e.jsxs(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-muted/60",children:[e.jsx(va,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:a("actions.openMenu")})]})}),e.jsxs(ws,{align:"end",className:"w-[120px]",children:[e.jsx(_e,{className:"cursor-pointer",onClick:async()=>{await Qs.update({trade_no:t.original.trade_no,commission_status:be.PROCESSING}),s()},children:a("commission.PROCESSING")}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onClick:async()=>{await Qs.update({trade_no:t.original.trade_no,commission_status:be.INVALID}),s()},children:a("commission.INVALID")})]})]})]})},enableSorting:!0,enableHiding:!1},{accessorKey:"created_at",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.createdAt")}),cell:({row:t})=>e.jsx("div",{className:"text-nowrap font-mono text-sm text-muted-foreground",children:Se(t.getValue("created_at"),"YYYY/MM/DD HH:mm:ss")}),enableSorting:!0,enableHiding:!1}]};function Bx(){const[s]=ur(),[a,t]=m.useState({}),[l,n]=m.useState({}),[r,o]=m.useState([]),[c,u]=m.useState([]),[i,d]=m.useState({pageIndex:0,pageSize:20});m.useEffect(()=>{const N=Object.entries({user_id:"string",order_id:"string",commission_status:"number",status:"number",commission_balance:"string"}).map(([g,T])=>{const E=s.get(g);return E?{id:g,value:T==="number"?parseInt(E):E}:null}).filter(Boolean);N.length>0&&o(N)},[s]);const{refetch:h,data:k,isLoading:C}=le({queryKey:["orderList",i,r,c],queryFn:()=>Qs.getList({pageSize:i.pageSize,current:i.pageIndex+1,filter:r,sort:c})}),S=Je({data:k?.data??[],columns:Kx(h),state:{sorting:c,columnVisibility:l,rowSelection:a,columnFilters:r,pagination:i},rowCount:k?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:t,onSortingChange:u,onColumnFiltersChange:o,onColumnVisibilityChange:n,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),onPaginationChange:d,getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(os,{table:S,toolbar:e.jsx(Mx,{table:S,refetch:h}),showPagination:!0})}function Gx(){const{t:s}=V("order");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Bx,{})})]})]})}const Wx=Object.freeze(Object.defineProperty({__proto__:null,default:Gx},Symbol.toStringTag,{value:"Module"}));function Yx({column:s,title:a,options:t}){const l=s?.getFacetedUniqueValues(),n=new Set(s?.getFilterValue());return e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Da,{className:"mr-2 h-4 w-4"}),a,n?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:n.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:n.size>2?e.jsxs(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[n.size," selected"]}):t.filter(r=>n.has(r.value)).map(r=>e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:r.label},r.value))})]})]})}),e.jsx(bs,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Us,{children:[e.jsx(it,{placeholder:a}),e.jsxs(Ks,{children:[e.jsx(ot,{children:"No results found."}),e.jsx(ns,{children:t.map(r=>{const o=n.has(r.value);return e.jsxs($e,{onSelect:()=>{o?n.delete(r.value):n.add(r.value);const c=Array.from(n);s?.setFilterValue(c.length?c:void 0)},children:[e.jsx("div",{className:y("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",o?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(at,{className:y("h-4 w-4")})}),r.icon&&e.jsx(r.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${r.color}`}),e.jsx("span",{children:r.label}),l?.get(r.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:l.get(r.value)})]},r.value)})}),n.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{}),e.jsx(ns,{children:e.jsx($e,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const Jx=x.object({id:x.coerce.number().nullable().optional(),name:x.string().min(1,"请输入优惠券名称"),code:x.string().nullable(),type:x.coerce.number(),value:x.coerce.number(),started_at:x.coerce.number(),ended_at:x.coerce.number(),limit_use:x.union([x.string(),x.number()]).nullable(),limit_use_with_user:x.union([x.string(),x.number()]).nullable(),generate_count:x.coerce.number().nullable().optional(),limit_plan_ids:x.array(x.coerce.number()).default([]).nullable(),limit_period:x.array(x.nativeEnum(Ht)).default([]).nullable()}).refine(s=>s.ended_at>s.started_at,{message:"结束时间必须晚于开始时间",path:["ended_at"]}),ol={name:"",code:null,type:Ze.AMOUNT,value:0,started_at:Math.floor(Date.now()/1e3),ended_at:Math.floor(Date.now()/1e3)+7*24*60*60,limit_use:null,limit_use_with_user:null,limit_plan_ids:[],limit_period:[],generate_count:null};function Yr({defaultValues:s,refetch:a,type:t="create",dialogTrigger:l=null,open:n,onOpenChange:r}){const{t:o}=V("coupon"),[c,u]=m.useState(!1),i=n??c,d=r??u,[h,k]=m.useState([]),C=Ne({resolver:we(Jx),defaultValues:s||ol});m.useEffect(()=>{s&&C.reset(s)},[s,C]),m.useEffect(()=>{ss.getList().then(({data:g})=>k(g))},[]);const S=g=>{if(!g)return;const T=(E,p)=>{const _=new Date(p*1e3);return E.setHours(_.getHours(),_.getMinutes(),_.getSeconds()),Math.floor(E.getTime()/1e3)};g.from&&C.setValue("started_at",T(g.from,C.watch("started_at"))),g.to&&C.setValue("ended_at",T(g.to,C.watch("ended_at")))},w=async g=>{const T=await Na.save(g);if(g.generate_count&&T){const E=new Blob([T],{type:"text/csv;charset=utf-8;"}),p=document.createElement("a");p.href=window.URL.createObjectURL(E),p.download=`coupons_${new Date().getTime()}.csv`,p.click(),window.URL.revokeObjectURL(p.href)}d(!1),t==="create"&&C.reset(ol),a()},N=(g,T)=>e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:T}),e.jsx(D,{type:"datetime-local",step:"1",value:Se(C.watch(g),"YYYY-MM-DDTHH:mm:ss"),onChange:E=>{const p=new Date(E.target.value);C.setValue(g,Math.floor(p.getTime()/1e3))},className:"h-8 [&::-webkit-calendar-picker-indicator]:hidden"})]});return e.jsxs(he,{open:i,onOpenChange:d,children:[l&&e.jsx(is,{asChild:!0,children:l}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsx(je,{children:e.jsx(pe,{children:o(t==="create"?"form.add":"form.edit")})}),e.jsx(Ce,{...C,children:e.jsxs("form",{onSubmit:C.handleSubmit(w),className:"space-y-4",children:[e.jsx(v,{control:C.control,name:"name",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.name.label")}),e.jsx(D,{placeholder:o("form.name.placeholder"),...g}),e.jsx(P,{})]})}),t==="create"&&e.jsx(v,{control:C.control,name:"generate_count",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.generateCount.label")}),e.jsx(D,{type:"number",min:0,placeholder:o("form.generateCount.placeholder"),...g,value:g.value===void 0?"":g.value,onChange:T=>g.onChange(T.target.value===""?"":parseInt(T.target.value)),className:"h-9"}),e.jsx(M,{className:"text-xs",children:o("form.generateCount.description")}),e.jsx(P,{})]})}),(!C.watch("generate_count")||C.watch("generate_count")==null)&&e.jsx(v,{control:C.control,name:"code",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.code.label")}),e.jsx(D,{placeholder:o("form.code.placeholder"),...g,className:"h-9"}),e.jsx(M,{className:"text-xs",children:o("form.code.description")}),e.jsx(P,{})]})}),e.jsxs(f,{children:[e.jsx(j,{children:o("form.type.label")}),e.jsxs("div",{className:"flex",children:[e.jsx(v,{control:C.control,name:"type",render:({field:g})=>e.jsxs(J,{value:g.value.toString(),onValueChange:T=>{const E=g.value,p=parseInt(T);g.onChange(p);const _=C.getValues("value");_&&(E===Ze.AMOUNT&&p===Ze.PERCENTAGE?C.setValue("value",_/100):E===Ze.PERCENTAGE&&p===Ze.AMOUNT&&C.setValue("value",_*100))},children:[e.jsx(W,{className:"flex-[1.2] rounded-r-none border-r-0 focus:z-10",children:e.jsx(Q,{placeholder:o("form.type.placeholder")})}),e.jsx(Y,{children:Object.entries(im).map(([T,E])=>e.jsx(A,{value:T,children:o(`table.toolbar.types.${T}`)},T))})]})}),e.jsx(v,{control:C.control,name:"value",render:({field:g})=>{const T=g.value==null?"":C.watch("type")===Ze.AMOUNT&&typeof g.value=="number"?(g.value/100).toString():g.value.toString();return e.jsx(D,{type:"number",placeholder:o("form.value.placeholder"),...g,value:T,onChange:E=>{const p=E.target.value;if(p===""){g.onChange("");return}const _=parseFloat(p);isNaN(_)||g.onChange(C.watch("type")===Ze.AMOUNT?Math.round(_*100):_)},step:"any",min:0,className:"flex-[2] rounded-none border-x-0 text-left"})}}),e.jsx("div",{className:"flex min-w-[40px] items-center justify-center rounded-md rounded-l-none border border-l-0 border-input bg-muted/50 px-3 font-medium text-muted-foreground",children:e.jsx("span",{children:C.watch("type")==Ze.AMOUNT?"¥":"%"})})]})]}),e.jsxs(f,{children:[e.jsx(j,{children:o("form.validity.label")}),e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:y("w-full justify-start text-left font-normal",!C.watch("started_at")&&"text-muted-foreground"),children:[e.jsx(Ct,{className:"mr-2 h-4 w-4"}),Se(C.watch("started_at"),"YYYY-MM-DD HH:mm:ss")," ",o("form.validity.to")," ",Se(C.watch("ended_at"),"YYYY-MM-DD HH:mm:ss")]})}),e.jsxs(bs,{className:"w-auto p-0",align:"start",children:[e.jsx("div",{className:"border-b border-border",children:e.jsx(ct,{mode:"range",selected:{from:new Date(C.watch("started_at")*1e3),to:new Date(C.watch("ended_at")*1e3)},onSelect:S,numberOfMonths:2})}),e.jsx("div",{className:"p-3",children:e.jsxs("div",{className:"flex items-center gap-4",children:[N("started_at",o("table.validity.startTime")),e.jsx("div",{className:"mt-6 text-sm text-muted-foreground",children:o("form.validity.to")}),N("ended_at",o("table.validity.endTime"))]})})]})]}),e.jsx(P,{})]}),e.jsx(v,{control:C.control,name:"limit_use",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.limitUse.label")}),e.jsx(D,{type:"number",min:0,placeholder:o("form.limitUse.placeholder"),...g,value:g.value===null?"":g.value,onChange:T=>g.onChange(T.target.value===""?null:parseInt(T.target.value)),className:"h-9"}),e.jsx(M,{className:"text-xs",children:o("form.limitUse.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:C.control,name:"limit_use_with_user",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.limitUseWithUser.label")}),e.jsx(D,{type:"number",min:0,placeholder:o("form.limitUseWithUser.placeholder"),...g,value:g.value===null?"":g.value,onChange:T=>g.onChange(T.target.value===""?null:parseInt(T.target.value)),className:"h-9"}),e.jsx(M,{className:"text-xs",children:o("form.limitUseWithUser.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:C.control,name:"limit_period",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.limitPeriod.label")}),e.jsx(wt,{options:Object.entries(Ht).filter(([T])=>isNaN(Number(T))).map(([T,E])=>({label:o(`coupon:period.${E}`),value:T})),onChange:T=>{if(T.length===0){g.onChange([]);return}const E=T.map(p=>Ht[p.value]);g.onChange(E)},value:(g.value||[]).map(T=>({label:o(`coupon:period.${T}`),value:Object.entries(Ht).find(([E,p])=>p===T)?.[0]||""})),placeholder:o("form.limitPeriod.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:o("form.limitPeriod.empty")})}),e.jsx(M,{className:"text-xs",children:o("form.limitPeriod.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:C.control,name:"limit_plan_ids",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.limitPlan.label")}),e.jsx(wt,{options:h?.map(T=>({label:T.name,value:T.id.toString()}))||[],onChange:T=>g.onChange(T.map(E=>Number(E.value))),value:(h||[]).filter(T=>(g.value||[]).includes(T.id)).map(T=>({label:T.name,value:T.id.toString()})),placeholder:o("form.limitPlan.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:o("form.limitPlan.empty")})}),e.jsx(P,{})]})}),e.jsx(Le,{children:e.jsx(L,{type:"submit",disabled:C.formState.isSubmitting,children:C.formState.isSubmitting?o("form.submit.saving"):o("form.submit.save")})})]})})]})]})}function Qx({table:s,refetch:a}){const t=s.getState().columnFilters.length>0,{t:l}=V("coupon");return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Yr,{refetch:a,dialogTrigger:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 space-x-2",children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("div",{children:l("form.add")})]})}),e.jsx(D,{placeholder:l("table.toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:n=>s.getColumn("name")?.setFilterValue(n.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),s.getColumn("type")&&e.jsx(Yx,{column:s.getColumn("type"),title:l("table.toolbar.type"),options:[{value:Ze.AMOUNT,label:l(`table.toolbar.types.${Ze.AMOUNT}`)},{value:Ze.PERCENTAGE,label:l(`table.toolbar.types.${Ze.PERCENTAGE}`)}]}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[l("table.toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]})}const Jr=m.createContext(void 0);function Xx({children:s,refetch:a}){const[t,l]=m.useState(!1),[n,r]=m.useState(null),o=u=>{r(u),l(!0)},c=()=>{l(!1),r(null)};return e.jsxs(Jr.Provider,{value:{isOpen:t,currentCoupon:n,openEdit:o,closeEdit:c},children:[s,n&&e.jsx(Yr,{defaultValues:n,refetch:a,type:"edit",open:t,onOpenChange:l})]})}function Zx(){const s=m.useContext(Jr);if(s===void 0)throw new Error("useCouponEdit must be used within a CouponEditProvider");return s}const eh=s=>{const{t:a}=V("coupon");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.id")}),cell:({row:t})=>e.jsx(G,{children:t.original.id}),enableSorting:!0},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.show")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.original.show,onCheckedChange:l=>{Na.update({id:t.original.id,show:l}).then(({data:n})=>!n&&s())}}),enableSorting:!1},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{children:t.original.name})}),enableSorting:!1,size:800},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.type")}),cell:({row:t})=>e.jsx(G,{variant:"outline",children:a(`table.toolbar.types.${t.original.type}`)}),enableSorting:!0},{accessorKey:"code",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.code")}),cell:({row:t})=>e.jsx(G,{variant:"secondary",children:t.original.code}),enableSorting:!0},{accessorKey:"limit_use",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.limitUse")}),cell:({row:t})=>e.jsx(G,{variant:"outline",children:t.original.limit_use===null?a("table.validity.unlimited"):t.original.limit_use}),enableSorting:!0},{accessorKey:"limit_use_with_user",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.limitUseWithUser")}),cell:({row:t})=>e.jsx(G,{variant:"outline",children:t.original.limit_use_with_user===null?a("table.validity.noLimit"):t.original.limit_use_with_user}),enableSorting:!0},{accessorKey:"#",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.validity")}),cell:({row:t})=>{const[l,n]=m.useState(!1),r=Date.now(),o=t.original.started_at*1e3,c=t.original.ended_at*1e3,u=r>c,i=re.jsx(z,{className:"justify-end",column:t,title:a("table.columns.actions")}),cell:({row:t})=>{const{openEdit:l}=Zx();return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",onClick:()=>l(t.original),children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:a("table.actions.edit")})]}),e.jsx(ls,{title:a("table.actions.deleteConfirm.title"),description:a("table.actions.deleteConfirm.description"),confirmText:a("table.actions.deleteConfirm.confirmText"),variant:"destructive",onConfirm:async()=>{Na.drop({id:t.original.id}).then(({data:n})=>{n&&($.success("删除成功"),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:a("table.actions.delete")})]})})]})}}]};function sh(){const[s,a]=m.useState({}),[t,l]=m.useState({}),[n,r]=m.useState([]),[o,c]=m.useState([]),[u,i]=m.useState({pageIndex:0,pageSize:20}),{refetch:d,data:h}=le({queryKey:["couponList",u,n,o],queryFn:()=>Na.getList({pageSize:u.pageSize,current:u.pageIndex+1,filter:n,sort:o})}),k=Je({data:h?.data??[],columns:eh(d),state:{sorting:o,columnVisibility:t,rowSelection:s,columnFilters:n,pagination:u},pageCount:Math.ceil((h?.total??0)/u.pageSize),rowCount:h?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:r,onColumnVisibilityChange:l,onPaginationChange:i,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(Xx,{refetch:d,children:e.jsx("div",{className:"space-y-4",children:e.jsx(os,{table:k,toolbar:e.jsx(Qx,{table:k,refetch:d})})})})}function th(){const{t:s}=V("coupon");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(sh,{})})]})]})}const ah=Object.freeze(Object.defineProperty({__proto__:null,default:th},Symbol.toStringTag,{value:"Module"})),nh=1,lh=1e6;let Xa=0;function rh(){return Xa=(Xa+1)%Number.MAX_SAFE_INTEGER,Xa.toString()}const Za=new Map,cl=s=>{if(Za.has(s))return;const a=setTimeout(()=>{Za.delete(s),Ut({type:"REMOVE_TOAST",toastId:s})},lh);Za.set(s,a)},ih=(s,a)=>{switch(a.type){case"ADD_TOAST":return{...s,toasts:[a.toast,...s.toasts].slice(0,nh)};case"UPDATE_TOAST":return{...s,toasts:s.toasts.map(t=>t.id===a.toast.id?{...t,...a.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=a;return t?cl(t):s.toasts.forEach(l=>{cl(l.id)}),{...s,toasts:s.toasts.map(l=>l.id===t||t===void 0?{...l,open:!1}:l)}}case"REMOVE_TOAST":return a.toastId===void 0?{...s,toasts:[]}:{...s,toasts:s.toasts.filter(t=>t.id!==a.toastId)}}},ha=[];let pa={toasts:[]};function Ut(s){pa=ih(pa,s),ha.forEach(a=>{a(pa)})}function oh({...s}){const a=rh(),t=n=>Ut({type:"UPDATE_TOAST",toast:{...n,id:a}}),l=()=>Ut({type:"DISMISS_TOAST",toastId:a});return Ut({type:"ADD_TOAST",toast:{...s,id:a,open:!0,onOpenChange:n=>{n||l()}}}),{id:a,dismiss:l,update:t}}function Qr(){const[s,a]=m.useState(pa);return m.useEffect(()=>(ha.push(a),()=>{const t=ha.indexOf(a);t>-1&&ha.splice(t,1)}),[s]),{...s,toast:oh,dismiss:t=>Ut({type:"DISMISS_TOAST",toastId:t})}}function ch({open:s,onOpenChange:a,table:t}){const{t:l}=V("user"),{toast:n}=Qr(),[r,o]=m.useState(!1),[c,u]=m.useState(""),[i,d]=m.useState(""),h=async()=>{if(!c||!i){n({title:l("messages.error"),description:l("messages.send_mail.required_fields"),variant:"destructive"});return}try{o(!0),await _s.sendMail({subject:c,content:i,filter:t.getState().columnFilters,sort:t.getState().sorting[0]?.id,sort_type:t.getState().sorting[0]?.desc?"DESC":"ASC"}),n({title:l("messages.success"),description:l("messages.send_mail.success")}),a(!1),u(""),d("")}catch{n({title:l("messages.error"),description:l("messages.send_mail.failed"),variant:"destructive"})}finally{o(!1)}};return e.jsx(he,{open:s,onOpenChange:a,children:e.jsxs(ue,{className:"sm:max-w-[500px]",children:[e.jsxs(je,{children:[e.jsx(pe,{children:l("send_mail.title")}),e.jsx(Re,{children:l("send_mail.description")})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"subject",className:"text-right",children:l("send_mail.subject")}),e.jsx(D,{id:"subject",value:c,onChange:k=>u(k.target.value),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"content",className:"text-right",children:l("send_mail.content")}),e.jsx(ks,{id:"content",value:i,onChange:k=>d(k.target.value),className:"col-span-3",rows:6})]})]}),e.jsx(Le,{children:e.jsx(K,{type:"submit",onClick:h,disabled:r,children:l(r?"send_mail.sending":"send_mail.send")})})]})})}const dh=x.object({email_prefix:x.string().optional(),email_suffix:x.string().min(1),password:x.string().optional(),expired_at:x.number().optional().nullable(),plan_id:x.number().nullable(),generate_count:x.number().optional().nullable(),download_csv:x.boolean().optional()}).refine(s=>s.generate_count===null?s.email_prefix!==void 0&&s.email_prefix!=="":!0,{message:"Email prefix is required when generate_count is null",path:["email_prefix"]}),mh={email_prefix:"",email_suffix:"",password:"",expired_at:null,plan_id:null,generate_count:void 0,download_csv:!1};function uh({refetch:s}){const{t:a}=V("user"),[t,l]=m.useState(!1),n=Ne({resolver:we(dh),defaultValues:mh,mode:"onChange"}),[r,o]=m.useState([]);return m.useEffect(()=>{t&&ss.getList().then(({data:c})=>{c&&o(c)})},[t]),e.jsxs(he,{open:t,onOpenChange:l,children:[e.jsx(is,{asChild:!0,children:e.jsxs(K,{size:"sm",variant:"outline",className:"gap-0 space-x-2",children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("div",{children:a("generate.button")})]})}),e.jsxs(ue,{className:"sm:max-w-[425px]",children:[e.jsxs(je,{children:[e.jsx(pe,{children:a("generate.title")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...n,children:[e.jsxs(f,{children:[e.jsx(j,{children:a("generate.form.email")}),e.jsxs("div",{className:"flex",children:[!n.watch("generate_count")&&e.jsx(v,{control:n.control,name:"email_prefix",render:({field:c})=>e.jsx(D,{className:"flex-[5] rounded-r-none",placeholder:a("generate.form.email_prefix"),...c})}),e.jsx("div",{className:`z-[-1] border border-r-0 border-input px-3 py-1 shadow-sm ${n.watch("generate_count")?"rounded-l-md":"border-l-0"}`,children:"@"}),e.jsx(v,{control:n.control,name:"email_suffix",render:({field:c})=>e.jsx(D,{className:"flex-[4] rounded-l-none",placeholder:a("generate.form.email_domain"),...c})})]})]}),e.jsx(v,{control:n.control,name:"password",render:({field:c})=>e.jsxs(f,{children:[e.jsx(j,{children:a("generate.form.password")}),e.jsx(D,{placeholder:a("generate.form.password_placeholder"),...c}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"expired_at",render:({field:c})=>e.jsxs(f,{className:"flex flex-col",children:[e.jsx(j,{children:a("generate.form.expire_time")}),e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsx(b,{children:e.jsxs(K,{variant:"outline",className:y("w-full pl-3 text-left font-normal",!c.value&&"text-muted-foreground"),children:[c.value?Se(c.value):e.jsx("span",{children:a("generate.form.expire_time_placeholder")}),e.jsx(Ct,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsxs(bs,{className:"flex w-auto flex-col space-y-2 p-2",children:[e.jsx(Gc,{asChild:!0,children:e.jsx(K,{variant:"outline",className:"w-full",onClick:()=>{c.onChange(null)},children:a("generate.form.permanent")})}),e.jsx("div",{className:"rounded-md border",children:e.jsx(ct,{mode:"single",selected:c.value?new Date(c.value*1e3):void 0,onSelect:u=>{u&&c.onChange(u?.getTime()/1e3)}})})]})]})]})}),e.jsx(v,{control:n.control,name:"plan_id",render:({field:c})=>e.jsxs(f,{children:[e.jsx(j,{children:a("generate.form.subscription")}),e.jsx(b,{children:e.jsxs(J,{value:c.value?c.value.toString():"null",onValueChange:u=>c.onChange(u==="null"?null:parseInt(u)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("generate.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"null",children:a("generate.form.subscription_none")}),r.map(u=>e.jsx(A,{value:u.id.toString(),children:u.name},u.id))]})]})})]})}),!n.watch("email_prefix")&&e.jsx(v,{control:n.control,name:"generate_count",render:({field:c})=>e.jsxs(f,{children:[e.jsx(j,{children:a("generate.form.generate_count")}),e.jsx(D,{type:"number",placeholder:a("generate.form.generate_count_placeholder"),value:c.value||"",onChange:u=>c.onChange(u.target.value?parseInt(u.target.value):null)})]})}),n.watch("generate_count")&&e.jsx(v,{control:n.control,name:"download_csv",render:({field:c})=>e.jsxs(f,{className:"flex cursor-pointer flex-row items-center space-x-2 space-y-0",children:[e.jsx(b,{children:e.jsx(Pn,{checked:c.value,onCheckedChange:c.onChange})}),e.jsx(j,{children:a("generate.form.download_csv")})]})})]}),e.jsxs(Le,{children:[e.jsx(K,{variant:"outline",onClick:()=>l(!1),children:a("generate.form.cancel")}),e.jsx(K,{onClick:()=>n.handleSubmit(async c=>{if(c.download_csv){const u=await _s.generate(c);if(u&&u instanceof Blob){const i=window.URL.createObjectURL(u),d=document.createElement("a");d.href=i,d.download=`users_${new Date().getTime()}.csv`,document.body.appendChild(d),d.click(),d.remove(),window.URL.revokeObjectURL(i),$.success(a("generate.form.success")),n.reset(),s(),l(!1)}}else{const{data:u}=await _s.generate(c);u&&($.success(a("generate.form.success")),n.reset(),s(),l(!1))}})(),children:a("generate.form.submit")})]})]})]})}const Xr=fl,xh=jl,hh=vl,Zr=m.forwardRef(({className:s,...a},t)=>e.jsx(wa,{className:y("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",s),...a,ref:t}));Zr.displayName=wa.displayName;const ph=tt("fixed overflow-y-scroll z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out",{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-md",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-md"}},defaultVariants:{side:"right"}}),Ln=m.forwardRef(({side:s="right",className:a,children:t,...l},n)=>e.jsxs(hh,{children:[e.jsx(Zr,{}),e.jsxs(Ca,{ref:n,className:y(ph({side:s}),a),...l,children:[e.jsxs(hn,{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:[e.jsx(ds,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]}),t]})]}));Ln.displayName=Ca.displayName;const En=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col space-y-2 text-center sm:text-left",s),...a});En.displayName="SheetHeader";const ei=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});ei.displayName="SheetFooter";const In=m.forwardRef(({className:s,...a},t)=>e.jsx(Sa,{ref:t,className:y("text-lg font-semibold text-foreground",s),...a}));In.displayName=Sa.displayName;const Rn=m.forwardRef(({className:s,...a},t)=>e.jsx(ka,{ref:t,className:y("text-sm text-muted-foreground",s),...a}));Rn.displayName=ka.displayName;function gh({table:s,refetch:a,permissionGroups:t=[],subscriptionPlans:l=[]}){const{t:n}=V("user"),{toast:r}=Qr(),o=s.getState().columnFilters.length>0,[c,u]=m.useState([]),[i,d]=m.useState(!1),[h,k]=m.useState(!1),[C,S]=m.useState(!1),[w,N]=m.useState(!1),g=async()=>{try{const ee=await _s.dumpCSV({filter:s.getState().columnFilters,sort:s.getState().sorting[0]?.id,sort_type:s.getState().sorting[0]?.desc?"DESC":"ASC"}),te=ee;console.log(ee);const q=new Blob([te],{type:"text/csv;charset=utf-8;"}),R=window.URL.createObjectURL(q),X=document.createElement("a");X.href=R,X.setAttribute("download",`users_${new Date().toISOString()}.csv`),document.body.appendChild(X),X.click(),X.remove(),window.URL.revokeObjectURL(R),r({title:n("messages.success"),description:n("messages.export.success")})}catch{r({title:n("messages.error"),description:n("messages.export.failed"),variant:"destructive"})}},T=async()=>{try{N(!0),await _s.batchBan({filter:s.getState().columnFilters,sort:s.getState().sorting[0]?.id,sort_type:s.getState().sorting[0]?.desc?"DESC":"ASC"}),r({title:n("messages.success"),description:n("messages.batch_ban.success")}),a()}catch{r({title:n("messages.error"),description:n("messages.batch_ban.failed"),variant:"destructive"})}finally{N(!1),S(!1)}},E=[{label:n("filter.fields.email"),value:"email",type:"text",operators:[{label:n("filter.operators.contains"),value:"contains"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.id"),value:"id",type:"number",operators:[{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.plan_id"),value:"plan_id",type:"select",operators:[{label:n("filter.operators.eq"),value:"eq"}],useOptions:!0},{label:n("filter.fields.transfer_enable"),value:"transfer_enable",type:"number",unit:"GB",operators:[{label:n("filter.operators.gt"),value:"gt"},{label:n("filter.operators.lt"),value:"lt"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.total_used"),value:"total_used",type:"number",unit:"GB",operators:[{label:n("filter.operators.gt"),value:"gt"},{label:n("filter.operators.lt"),value:"lt"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.online_count"),value:"online_count",type:"number",operators:[{label:n("filter.operators.eq"),value:"eq"},{label:n("filter.operators.gt"),value:"gt"},{label:n("filter.operators.lt"),value:"lt"}]},{label:n("filter.fields.expired_at"),value:"expired_at",type:"date",operators:[{label:n("filter.operators.lt"),value:"lt"},{label:n("filter.operators.gt"),value:"gt"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.uuid"),value:"uuid",type:"text",operators:[{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.token"),value:"token",type:"text",operators:[{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.banned"),value:"banned",type:"select",operators:[{label:n("filter.operators.eq"),value:"eq"}],options:[{label:n("filter.status.normal"),value:"0"},{label:n("filter.status.banned"),value:"1"}]},{label:n("filter.fields.remark"),value:"remarks",type:"text",operators:[{label:n("filter.operators.contains"),value:"contains"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.inviter_email"),value:"invite_user.email",type:"text",operators:[{label:n("filter.operators.contains"),value:"contains"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.invite_user_id"),value:"invite_user_id",type:"number",operators:[{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.is_admin"),value:"is_admin",type:"boolean",operators:[{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.is_staff"),value:"is_staff",type:"boolean",operators:[{label:n("filter.operators.eq"),value:"eq"}]}],p=ee=>ee*1024*1024*1024,_=ee=>ee/(1024*1024*1024),I=()=>{u([...c,{field:"",operator:"",value:""}])},H=ee=>{u(c.filter((te,q)=>q!==ee))},O=(ee,te,q)=>{const R=[...c];if(R[ee]={...R[ee],[te]:q},te==="field"){const X=E.find(ms=>ms.value===q);X&&(R[ee].operator=X.operators[0].value,R[ee].value=X.type==="boolean"?!1:"")}u(R)},B=(ee,te)=>{const q=E.find(R=>R.value===ee.field);if(!q)return null;switch(q.type){case"text":return e.jsx(D,{placeholder:n("filter.sheet.value"),value:ee.value,onChange:R=>O(te,"value",R.target.value)});case"number":return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(D,{type:"number",placeholder:n("filter.sheet.value_number",{unit:q.unit}),value:q.unit==="GB"?_(ee.value||0):ee.value,onChange:R=>{const X=Number(R.target.value);O(te,"value",q.unit==="GB"?p(X):X)}}),q.unit&&e.jsx("span",{className:"text-sm text-muted-foreground",children:q.unit})]});case"date":return e.jsx(ct,{mode:"single",selected:ee.value,onSelect:R=>O(te,"value",R),className:"flex flex-1 justify-center rounded-md border"});case"select":return e.jsxs(J,{value:ee.value,onValueChange:R=>O(te,"value",R),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("filter.sheet.value")})}),e.jsx(Y,{children:q.useOptions?l.map(R=>e.jsx(A,{value:R.value.toString(),children:R.label},R.value)):q.options?.map(R=>e.jsx(A,{value:R.value.toString(),children:R.label},R.value))})]});case"boolean":return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Z,{checked:ee.value,onCheckedChange:R=>O(te,"value",R)}),e.jsx(Xs,{children:ee.value?n("filter.boolean.true"):n("filter.boolean.false")})]});default:return null}},ce=()=>{const ee=c.filter(te=>te.field&&te.operator&&te.value!=="").map(te=>{const q=E.find(X=>X.value===te.field);let R=te.value;return te.operator==="contains"?{id:te.field,value:R}:(q?.type==="date"&&R instanceof Date&&(R=Math.floor(R.getTime()/1e3)),q?.type==="boolean"&&(R=R?1:0),{id:te.field,value:`${te.operator}:${R}`})});s.setColumnFilters(ee),d(!1)};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[e.jsx(uh,{refetch:a}),e.jsx(D,{placeholder:n("filter.email_search"),value:s.getColumn("email")?.getFilterValue()??"",onChange:ee=>s.getColumn("email")?.setFilterValue(ee.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs(Xr,{open:i,onOpenChange:d,children:[e.jsx(xh,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Wc,{className:"mr-2 h-4 w-4"}),n("filter.advanced"),c.length>0&&e.jsx(G,{variant:"secondary",className:"ml-2 rounded-sm px-1",children:c.length})]})}),e.jsxs(Ln,{className:"w-[400px] sm:w-[540px]",children:[e.jsxs(En,{children:[e.jsx(In,{children:n("filter.sheet.title")}),e.jsx(Rn,{children:n("filter.sheet.description")})]}),e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-medium",children:n("filter.sheet.conditions")}),e.jsx(L,{variant:"outline",size:"sm",onClick:I,children:n("filter.sheet.add")})]}),e.jsx(_t,{className:"h-[calc(100vh-280px)] ",children:e.jsx("div",{className:"space-y-4",children:c.map((ee,te)=>e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Xs,{children:n("filter.sheet.condition",{number:te+1})}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>H(te),children:e.jsx(ds,{className:"h-4 w-4"})})]}),e.jsxs(J,{value:ee.field,onValueChange:q=>O(te,"field",q),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("filter.sheet.field")})}),e.jsx(Y,{children:e.jsx(Be,{children:E.map(q=>e.jsx(A,{value:q.value,className:"cursor-pointer",children:q.label},q.value))})})]}),ee.field&&e.jsxs(J,{value:ee.operator,onValueChange:q=>O(te,"operator",q),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("filter.sheet.operator")})}),e.jsx(Y,{children:E.find(q=>q.value===ee.field)?.operators.map(q=>e.jsx(A,{value:q.value,children:q.label},q.value))})]}),ee.field&&ee.operator&&B(ee,te)]},te))})}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(L,{variant:"outline",onClick:()=>{u([]),d(!1)},children:n("filter.sheet.reset")}),e.jsx(L,{onClick:ce,children:n("filter.sheet.apply")})]})]})]})]}),o&&e.jsxs(L,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),u([])},className:"h-8 px-2 lg:px-3",children:[n("filter.sheet.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]}),e.jsxs(Es,{modal:!1,children:[e.jsx(Is,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:n("actions.title")})}),e.jsxs(ws,{children:[e.jsx(_e,{onClick:()=>k(!0),children:n("actions.send_email")}),e.jsx(_e,{onClick:g,children:n("actions.export_csv")}),e.jsx(Nt,{}),e.jsx(_e,{onClick:()=>S(!0),className:"text-red-600 focus:text-red-600",children:n("actions.batch_ban")})]})]})]}),e.jsx(ch,{open:h,onOpenChange:k,table:s}),e.jsx(kn,{open:C,onOpenChange:S,children:e.jsxs(Ra,{children:[e.jsxs(Va,{children:[e.jsx(Ma,{children:n("actions.confirm_ban.title")}),e.jsx(Oa,{children:n(o?"actions.confirm_ban.filtered_description":"actions.confirm_ban.all_description")})]}),e.jsxs(Fa,{children:[e.jsx($a,{disabled:w,children:n("actions.confirm_ban.cancel")}),e.jsx(za,{onClick:T,disabled:w,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:n(w?"actions.confirm_ban.banning":"actions.confirm_ban.confirm")})]})]})})]})}const si=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m17.71 11.29l-5-5a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21l-5 5a1 1 0 0 0 1.42 1.42L11 9.41V17a1 1 0 0 0 2 0V9.41l3.29 3.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42"})}),ti=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17.71 11.29a1 1 0 0 0-1.42 0L13 14.59V7a1 1 0 0 0-2 0v7.59l-3.29-3.3a1 1 0 0 0-1.42 1.42l5 5a1 1 0 0 0 .33.21a.94.94 0 0 0 .76 0a1 1 0 0 0 .33-.21l5-5a1 1 0 0 0 0-1.42"})}),fh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17 11H9.41l3.3-3.29a1 1 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33a1 1 0 0 0 0 .76a1 1 0 0 0 .21.33l5 5a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42L9.41 13H17a1 1 0 0 0 0-2"})}),jh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17.92 11.62a1 1 0 0 0-.21-.33l-5-5a1 1 0 0 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l5-5a1 1 0 0 0 .21-.33a1 1 0 0 0 0-.76"})}),en=[{accessorKey:"record_at",header:"时间",cell:({row:s})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("time",{className:"text-sm text-muted-foreground",children:ud(s.original.record_at)})})},{accessorKey:"u",header:"上行流量",cell:({row:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(si,{className:"h-4 w-4 text-emerald-500"}),e.jsx("span",{className:"font-mono text-sm",children:Oe(s.original.u/parseFloat(s.original.server_rate))})]})},{accessorKey:"d",header:"下行流量",cell:({row:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ti,{className:"h-4 w-4 text-blue-500"}),e.jsx("span",{className:"font-mono text-sm",children:Oe(s.original.d/parseFloat(s.original.server_rate))})]})},{accessorKey:"server_rate",header:"倍率",cell:({row:s})=>{const a=s.original.server_rate;return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(G,{variant:"outline",className:"font-mono",children:[a,"x"]})})}},{id:"total",header:"总计",cell:({row:s})=>{const a=s.original.u+s.original.d;return e.jsx("div",{className:"flex items-center justify-end font-mono text-sm",children:Oe(a)})}}];function ai({user_id:s,dialogTrigger:a}){const{t}=V(["traffic"]),[l,n]=m.useState(!1),[r,o]=m.useState({pageIndex:0,pageSize:20}),{data:c,isLoading:u}=le({queryKey:["userStats",s,r,l],queryFn:()=>l?_s.getStats({user_id:s,pageSize:r.pageSize,page:r.pageIndex+1}):null}),i=Je({data:c?.data??[],columns:en,pageCount:Math.ceil((c?.total??0)/r.pageSize),state:{pagination:r},manualPagination:!0,getCoreRowModel:Qe(),onPaginationChange:o});return e.jsxs(he,{open:l,onOpenChange:n,children:[e.jsx(is,{asChild:!0,children:a}),e.jsxs(ue,{className:"sm:max-w-[700px]",children:[e.jsx(je,{children:e.jsx(pe,{children:t("trafficRecord.title")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-md border",children:e.jsxs(Nn,{children:[e.jsx(_n,{children:i.getHeaderGroups().map(d=>e.jsx(As,{children:d.headers.map(h=>e.jsx(Cn,{className:y("h-10 px-2 text-xs",h.id==="total"&&"text-right"),children:h.isPlaceholder?null:ga(h.column.columnDef.header,h.getContext())},h.id))},d.id))}),e.jsx(wn,{children:u?Array.from({length:r.pageSize}).map((d,h)=>e.jsx(As,{children:Array.from({length:en.length}).map((k,C)=>e.jsx(vt,{className:"p-2",children:e.jsx(me,{className:"h-6 w-full"})},C))},h)):i.getRowModel().rows?.length?i.getRowModel().rows.map(d=>e.jsx(As,{"data-state":d.getIsSelected()&&"selected",className:"h-10",children:d.getVisibleCells().map(h=>e.jsx(vt,{className:"px-2",children:ga(h.column.columnDef.cell,h.getContext())},h.id))},d.id)):e.jsx(As,{children:e.jsx(vt,{colSpan:en.length,className:"h-24 text-center",children:t("trafficRecord.noRecords")})})})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:t("trafficRecord.perPage")}),e.jsxs(J,{value:`${i.getState().pagination.pageSize}`,onValueChange:d=>{i.setPageSize(Number(d))},children:[e.jsx(W,{className:"h-8 w-[70px]",children:e.jsx(Q,{placeholder:i.getState().pagination.pageSize})}),e.jsx(Y,{side:"top",children:[10,20,30,40,50].map(d=>e.jsx(A,{value:`${d}`,children:d},d))})]}),e.jsx("p",{className:"text-sm font-medium",children:t("trafficRecord.records")})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"flex w-[100px] items-center justify-center text-sm",children:t("trafficRecord.page",{current:i.getState().pagination.pageIndex+1,total:i.getPageCount()})}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(K,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>i.previousPage(),disabled:!i.getCanPreviousPage()||u,children:e.jsx(fh,{className:"h-4 w-4"})}),e.jsx(K,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>i.nextPage(),disabled:!i.getCanNextPage()||u,children:e.jsx(jh,{className:"h-4 w-4"})})]})]})]})]})]})]})}function vh({onConfirm:s,children:a,title:t="确认操作",description:l="确定要执行此操作吗?",cancelText:n="取消",confirmText:r="确认",variant:o="default",className:c}){return e.jsxs(kn,{children:[e.jsx(Or,{asChild:!0,children:a}),e.jsxs(Ra,{className:y("sm:max-w-[425px]",c),children:[e.jsxs(Va,{children:[e.jsx(Ma,{children:t}),e.jsx(Oa,{children:l})]}),e.jsxs(Fa,{children:[e.jsx($a,{asChild:!0,children:e.jsx(L,{variant:"outline",children:n})}),e.jsx(za,{asChild:!0,children:e.jsx(L,{variant:o,onClick:s,children:r})})]})]})]})}const bh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M5 18h4.24a1 1 0 0 0 .71-.29l6.92-6.93L19.71 8a1 1 0 0 0 0-1.42l-4.24-4.29a1 1 0 0 0-1.42 0l-2.82 2.83l-6.94 6.93a1 1 0 0 0-.29.71V17a1 1 0 0 0 1 1m9.76-13.59l2.83 2.83l-1.42 1.42l-2.83-2.83ZM6 13.17l5.93-5.93l2.83 2.83L8.83 16H6ZM21 20H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2"})}),yh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 11h-6V5a1 1 0 0 0-2 0v6H5a1 1 0 0 0 0 2h6v6a1 1 0 0 0 2 0v-6h6a1 1 0 0 0 0-2"})}),Nh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21 8.94a1.3 1.3 0 0 0-.06-.27v-.09a1 1 0 0 0-.19-.28l-6-6a1 1 0 0 0-.28-.19a.3.3 0 0 0-.09 0a.9.9 0 0 0-.33-.11H10a3 3 0 0 0-3 3v1H6a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3zm-6-3.53L17.59 8H16a1 1 0 0 1-1-1ZM15 19a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h1v7a3 3 0 0 0 3 3h5Zm4-4a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3v3a3 3 0 0 0 3 3h3Z"})}),_h=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21 11a1 1 0 0 0-1 1a8.05 8.05 0 1 1-2.22-5.5h-2.4a1 1 0 0 0 0 2h4.53a1 1 0 0 0 1-1V3a1 1 0 0 0-2 0v1.77A10 10 0 1 0 22 12a1 1 0 0 0-1-1"})}),wh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M9.5 10.5H12a1 1 0 0 0 0-2h-1V8a1 1 0 0 0-2 0v.55a2.5 2.5 0 0 0 .5 4.95h1a.5.5 0 0 1 0 1H8a1 1 0 0 0 0 2h1v.5a1 1 0 0 0 2 0v-.55a2.5 2.5 0 0 0-.5-4.95h-1a.5.5 0 0 1 0-1M21 12h-3V3a1 1 0 0 0-.5-.87a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0A1 1 0 0 0 2 3v16a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1M5 20a1 1 0 0 1-1-1V4.73l2 1.14a1.08 1.08 0 0 0 1 0l3-1.72l3 1.72a1.08 1.08 0 0 0 1 0l2-1.14V19a3 3 0 0 0 .18 1Zm15-1a1 1 0 0 1-2 0v-5h2Z"})}),Ch=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M12.3 12.22A4.92 4.92 0 0 0 14 8.5a5 5 0 0 0-10 0a4.92 4.92 0 0 0 1.7 3.72A8 8 0 0 0 1 19.5a1 1 0 0 0 2 0a6 6 0 0 1 12 0a1 1 0 0 0 2 0a8 8 0 0 0-4.7-7.28M9 11.5a3 3 0 1 1 3-3a3 3 0 0 1-3 3m9.74.32A5 5 0 0 0 15 3.5a1 1 0 0 0 0 2a3 3 0 0 1 3 3a3 3 0 0 1-1.5 2.59a1 1 0 0 0-.5.84a1 1 0 0 0 .45.86l.39.26l.13.07a7 7 0 0 1 4 6.38a1 1 0 0 0 2 0a9 9 0 0 0-4.23-7.68"})}),Sh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 0 0-6.88 2.77V3a1 1 0 0 0-2 0v4.5a1 1 0 0 0 1 1h4.5a1 1 0 0 0 0-2h-2.4A8 8 0 1 1 4 12a1 1 0 0 0-2 0A10 10 0 1 0 12 2m0 6a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h2a1 1 0 0 0 0-2h-1V9a1 1 0 0 0-1-1"})}),kh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M20 6h-4V5a3 3 0 0 0-3-3h-2a3 3 0 0 0-3 3v1H4a1 1 0 0 0 0 2h1v11a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V8h1a1 1 0 0 0 0-2M10 5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1h-4Zm7 14a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V8h10Z"})}),Th=(s,a,t,l)=>{const{t:n}=V("user");return[{accessorKey:"is_admin",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.is_admin")}),enableSorting:!1,enableHiding:!0,filterFn:(r,o,c)=>c.includes(r.getValue(o)),size:0},{accessorKey:"is_staff",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.is_staff")}),enableSorting:!1,enableHiding:!0,filterFn:(r,o,c)=>c.includes(r.getValue(o)),size:0},{accessorKey:"id",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.id")}),cell:({row:r})=>e.jsx(G,{variant:"outline",children:r.original.id}),enableSorting:!0,enableHiding:!1},{accessorKey:"email",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.email")}),cell:({row:r})=>{const o=r.original.t||0,c=Date.now()/1e3-o<120,u=Math.floor(Date.now()/1e3-o);let i=c?n("columns.online_status.online"):o===0?n("columns.online_status.never"):n("columns.online_status.last_online",{time:Se(o)});if(!c&&o!==0){const d=Math.floor(u/60),h=Math.floor(d/60),k=Math.floor(h/24);k>0?i+=` +`))}})})}),e.jsx(P,{})]})}),e.jsx(v,{control:r.control,name:"action",render:({field:u})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.action")}),e.jsx("div",{className:"relative",children:e.jsx(b,{children:e.jsxs(J,{onValueChange:u.onChange,defaultValue:u.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("form.actionPlaceholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"block",children:n("actions.block")}),e.jsx(A,{value:"dns",children:n("actions.dns")})]})]})})}),e.jsx(P,{})]})}),r.watch("action")==="dns"&&e.jsx(v,{control:r.control,name:"action_value",render:({field:u})=>e.jsxs(f,{children:[e.jsx(j,{children:n("form.dns")}),e.jsx("div",{className:"relative",children:e.jsx(b,{children:e.jsx(D,{type:"text",placeholder:n("form.dnsPlaceholder"),...u})})})]})}),e.jsxs(Le,{children:[e.jsx(qs,{asChild:!0,children:e.jsx(L,{variant:"outline",children:n("form.cancel")})}),e.jsx(L,{type:"submit",onClick:()=>{Ia.save(r.getValues()).then(({data:u})=>{u&&(c(!1),s&&s(),$.success(n(l==="edit"?"messages.updateSuccess":"messages.createSuccess")),r.reset())})},children:n("form.submit")})]})]})]})]})}function Nx({table:s,refetch:a}){const t=s.getState().columnFilters.length>0,{t:l}=V("route");return e.jsx("div",{className:"flex items-center justify-between ",children:e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[e.jsx(Br,{refetch:a}),e.jsx(D,{placeholder:l("toolbar.searchPlaceholder"),value:s.getColumn("remarks")?.getFilterValue()??"",onChange:n=>s.getColumn("remarks")?.setFilterValue(n.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[l("toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]})})}function _x({columns:s,data:a,refetch:t}){const[l,n]=m.useState({}),[r,o]=m.useState({}),[c,u]=m.useState([]),[i,d]=m.useState([]),h=Je({data:a,columns:s,state:{sorting:i,columnVisibility:r,rowSelection:l,columnFilters:c},enableRowSelection:!0,onRowSelectionChange:n,onSortingChange:d,onColumnFiltersChange:u,onColumnVisibilityChange:o,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(os,{table:h,toolbar:k=>e.jsx(Nx,{table:k,refetch:t})})}const wx=s=>{const{t:a}=V("route"),t={block:{icon:Ac,variant:"destructive",className:"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-800"},dns:{icon:qc,variant:"secondary",className:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-400 hover:bg-blue-200 dark:hover:bg-blue-800"}};return[{accessorKey:"id",header:({column:l})=>e.jsx(z,{column:l,title:a("columns.id")}),cell:({row:l})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(G,{variant:"outline",children:l.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"remarks",header:({column:l})=>e.jsx(z,{column:l,title:a("columns.remarks")}),cell:({row:l})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:l.original.remarks})}),enableHiding:!1,enableSorting:!1},{accessorKey:"action_value",header:({column:l})=>e.jsx(z,{column:l,title:a("columns.action_value.title")}),cell:({row:l})=>{const n=l.original.action,r=l.original.action_value,o=l.original.match?.length||0;return e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("span",{className:"text-sm font-medium",children:n==="dns"&&r?a("columns.action_value.dns",{value:r}):n==="block"?e.jsx("span",{className:"text-destructive",children:a("columns.action_value.block")}):a("columns.action_value.direct")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:a("columns.matchRules",{count:o})})]})},enableHiding:!1,enableSorting:!1,size:300},{accessorKey:"action",header:({column:l})=>e.jsx(z,{column:l,title:a("columns.action")}),cell:({row:l})=>{const n=l.getValue("action"),r=t[n]?.icon;return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(G,{variant:t[n]?.variant||"default",className:y("flex items-center gap-1.5 px-3 py-1 capitalize",t[n]?.className),children:[r&&e.jsx(r,{className:"h-3.5 w-3.5"}),a(`actions.${n}`)]})})},enableSorting:!1,size:9e3},{id:"actions",header:()=>e.jsx("div",{className:"text-right",children:a("columns.actions")}),cell:({row:l})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(Br,{defaultValues:l.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:a("form.edit")})]})}),e.jsx(ls,{title:a("messages.deleteConfirm"),description:a("messages.deleteDescription"),confirmText:a("messages.deleteButton"),variant:"destructive",onConfirm:async()=>{Ia.drop({id:l.original.id}).then(({data:n})=>{n&&($.success(a("messages.deleteSuccess")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:a("messages.deleteButton")})]})})]})}]};function Cx(){const{t:s}=V("route"),[a,t]=m.useState([]);function l(){Ia.getList().then(({data:n})=>{t(n)})}return m.useEffect(()=>{l()},[]),e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(_x,{data:a,columns:wx(l),refetch:l})})]})]})}const Sx=Object.freeze(Object.defineProperty({__proto__:null,default:Cx},Symbol.toStringTag,{value:"Module"})),Gr=m.createContext(void 0);function kx({children:s,refreshData:a}){const[t,l]=m.useState(!1),[n,r]=m.useState(null);return e.jsx(Gr.Provider,{value:{isOpen:t,setIsOpen:l,editingPlan:n,setEditingPlan:r,refreshData:a},children:s})}function Dn(){const s=m.useContext(Gr);if(s===void 0)throw new Error("usePlanEdit must be used within a PlanEditProvider");return s}function Tx({table:s,saveOrder:a,isSortMode:t}){const{setIsOpen:l}=Dn(),{t:n}=V("subscribe");return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsxs(L,{variant:"outline",className:"space-x-2",size:"sm",onClick:()=>l(!0),children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("div",{children:n("plan.add")})]}),e.jsx(D,{placeholder:n("plan.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:r=>s.getColumn("name")?.setFilterValue(r.target.value),className:"h-8 w-[150px] lg:w-[250px]"})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(L,{variant:t?"default":"outline",onClick:a,size:"sm",children:n(t?"plan.sort.save":"plan.sort.edit")})})]})}const il={monthly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},quarterly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},half_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},two_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},three_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},onetime:{color:"text-slate-700",bgColor:"bg-slate-100/80"},reset_traffic:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},Dx=s=>{const{t:a}=V("subscribe");return[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:"cursor-move",children:e.jsx(Da,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.id")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(G,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.show")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("show"),onCheckedChange:l=>{ss.update({id:t.original.id,show:l}).then(({data:n})=>{!n&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"sell",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.sell")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("sell"),onCheckedChange:l=>{ss.update({id:t.original.id,sell:l}).then(({data:n})=>{!n&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"renew",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.renew"),tooltip:a("plan.columns.renew_tooltip")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.getValue("renew"),onCheckedChange:l=>{ss.update({id:t.original.id,renew:l}).then(({data:n})=>{!n&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:t.getValue("name")})}),enableSorting:!1,enableHiding:!1,size:900},{accessorKey:"users_count",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.stats")}),cell:({row:t})=>{const l=t.getValue("users_count")||0,n=t.original.active_users_count||0,r=l>0?Math.round(n/l*100):0;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(je,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1 rounded-md bg-slate-50 px-2 py-1 hover:bg-slate-100 transition-colors cursor-help",children:[e.jsx(pa,{className:"h-3.5 w-3.5 text-slate-500"}),e.jsx("span",{className:"text-sm font-medium text-slate-700",children:l})]})}),e.jsx(oe,{side:"top",className:"max-w-xs",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"总用户数"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"所有使用该套餐的用户(包括已过期)"})]})})]})}),e.jsx(je,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1 rounded-md bg-green-50 px-2 py-1 hover:bg-green-100 transition-colors cursor-help",children:[e.jsx(Hc,{className:"h-3.5 w-3.5 text-green-600"}),e.jsx("span",{className:"text-sm font-medium text-green-700",children:n})]})}),e.jsx(oe,{side:"top",className:"max-w-xs",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"有效期内用户"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"当前仍在有效期内的活跃用户"}),l>0&&e.jsxs("p",{className:"text-xs font-medium text-green-600",children:["活跃率:",r,"%"]})]})})]})})]})},enableSorting:!0,size:120},{accessorKey:"group",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.group")}),cell:({row:t})=>e.jsx("div",{className:"flex max-w-[600px] flex-wrap items-center gap-1.5 text-nowrap",children:e.jsx(G,{variant:"secondary",className:y("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5"),children:t.getValue("group")?.name})}),enableSorting:!1,enableHiding:!1},{accessorKey:"prices",header:({column:t})=>e.jsx(z,{column:t,title:a("plan.columns.price")}),cell:({row:t})=>{const l=t.getValue("prices"),n=[{period:a("plan.columns.price_period.monthly"),key:"monthly",unit:a("plan.columns.price_period.unit.month")},{period:a("plan.columns.price_period.quarterly"),key:"quarterly",unit:a("plan.columns.price_period.unit.quarter")},{period:a("plan.columns.price_period.half_yearly"),key:"half_yearly",unit:a("plan.columns.price_period.unit.half_year")},{period:a("plan.columns.price_period.yearly"),key:"yearly",unit:a("plan.columns.price_period.unit.year")},{period:a("plan.columns.price_period.two_yearly"),key:"two_yearly",unit:a("plan.columns.price_period.unit.two_year")},{period:a("plan.columns.price_period.three_yearly"),key:"three_yearly",unit:a("plan.columns.price_period.unit.three_year")},{period:a("plan.columns.price_period.onetime"),key:"onetime",unit:""},{period:a("plan.columns.price_period.reset_traffic"),key:"reset_traffic",unit:a("plan.columns.price_period.unit.times")}];return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:n.map(({period:r,key:o,unit:c})=>l[o]!=null&&e.jsxs(G,{variant:"secondary",className:y("px-2 py-0.5 font-medium transition-colors text-nowrap",il[o].color,il[o].bgColor,"border border-border/50","hover:bg-slate-200/80"),children:[r," ¥",l[o],c]},o))})},enableSorting:!1,size:9e3},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:a("plan.columns.actions")}),cell:({row:t})=>{const{setIsOpen:l,setEditingPlan:n}=Dn();return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",onClick:()=>{n(t.original),l(!0)},children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:a("plan.columns.edit")})]}),e.jsx(ls,{title:a("plan.columns.delete_confirm.title"),description:a("plan.columns.delete_confirm.description"),confirmText:a("plan.columns.delete"),variant:"destructive",onConfirm:async()=>{ss.drop({id:t.original.id}).then(({data:r})=>{r&&($.success(a("plan.columns.delete_confirm.success")),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:a("plan.columns.delete")})]})})]})}}]},Px=x.object({id:x.number().nullable(),group_id:x.union([x.number(),x.string()]).nullable().optional(),name:x.string().min(1).max(250),content:x.string().nullable().optional(),transfer_enable:x.union([x.number().min(0),x.string().min(1)]),prices:x.object({monthly:x.union([x.number(),x.string()]).nullable().optional(),quarterly:x.union([x.number(),x.string()]).nullable().optional(),half_yearly:x.union([x.number(),x.string()]).nullable().optional(),yearly:x.union([x.number(),x.string()]).nullable().optional(),two_yearly:x.union([x.number(),x.string()]).nullable().optional(),three_yearly:x.union([x.number(),x.string()]).nullable().optional(),onetime:x.union([x.number(),x.string()]).nullable().optional(),reset_traffic:x.union([x.number(),x.string()]).nullable().optional()}).default({}),speed_limit:x.union([x.number(),x.string()]).nullable().optional(),capacity_limit:x.union([x.number(),x.string()]).nullable().optional(),device_limit:x.union([x.number(),x.string()]).nullable().optional(),force_update:x.boolean().optional(),reset_traffic_method:x.number().nullable(),users_count:x.number().optional(),active_users_count:x.number().optional(),group:x.object({id:x.number(),name:x.string()}).optional()}),Pn=m.forwardRef(({className:s,...a},t)=>e.jsx(or,{ref:t,className:y("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s),...a,children:e.jsx(Uc,{className:y("flex items-center justify-center text-current"),children:e.jsx(at,{className:"h-4 w-4"})})}));Pn.displayName=or.displayName;const ia={id:null,group_id:null,name:"",content:"",transfer_enable:"",prices:{monthly:"",quarterly:"",half_yearly:"",yearly:"",two_yearly:"",three_yearly:"",onetime:"",reset_traffic:""},speed_limit:"",capacity_limit:"",device_limit:"",force_update:!1,reset_traffic_method:null},oa={monthly:{label:"月付",months:1,discount:1},quarterly:{label:"季付",months:3,discount:.95},half_yearly:{label:"半年付",months:6,discount:.9},yearly:{label:"年付",months:12,discount:.85},two_yearly:{label:"两年付",months:24,discount:.8},three_yearly:{label:"三年付",months:36,discount:.75},onetime:{label:"流量包",months:1,discount:1},reset_traffic:{label:"重置包",months:1,discount:1}},Lx=[{value:null,label:"follow_system"},{value:0,label:"monthly_first"},{value:1,label:"monthly_reset"},{value:2,label:"no_reset"},{value:3,label:"yearly_first"},{value:4,label:"yearly_reset"}];function Ex(){const{isOpen:s,setIsOpen:a,editingPlan:t,setEditingPlan:l,refreshData:n}=Dn(),[r,o]=m.useState(!1),{t:c}=V("subscribe"),u=Ne({resolver:we(Px),defaultValues:{...ia,...t||{}},mode:"onChange"});m.useEffect(()=>{t?u.reset({...ia,...t}):u.reset(ia)},[t,u]);const i=new vn({html:!0}),[d,h]=m.useState();async function k(){rt.getList().then(({data:w})=>{h(w)})}m.useEffect(()=>{s&&k()},[s]);const C=w=>{if(isNaN(w))return;const N=Object.entries(oa).reduce((g,[T,E])=>{const p=w*E.months*E.discount;return{...g,[T]:p.toFixed(2)}},{});u.setValue("prices",N,{shouldDirty:!0})},S=()=>{a(!1),l(null),u.reset(ia)};return e.jsx(ge,{open:s,onOpenChange:S,children:e.jsxs(pe,{children:[e.jsxs(ve,{children:[e.jsx(fe,{children:c(t?"plan.form.edit_title":"plan.form.add_title")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...u,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:u.control,name:"name",render:({field:w})=>e.jsxs(f,{children:[e.jsx(j,{children:c("plan.form.name.label")}),e.jsx(b,{children:e.jsx(D,{placeholder:c("plan.form.name.placeholder"),...w})}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"group_id",render:({field:w})=>e.jsxs(f,{children:[e.jsxs(j,{className:"flex items-center justify-between",children:[c("plan.form.group.label"),e.jsx(qa,{dialogTrigger:e.jsx(L,{variant:"link",children:c("plan.form.group.add")}),refetch:k})]}),e.jsxs(J,{value:w.value?.toString()??"",onValueChange:N=>w.onChange(N?Number(N):null),children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:c("plan.form.group.placeholder")})})}),e.jsx(Y,{children:d?.map(N=>e.jsx(A,{value:N.id.toString(),children:N.name},N.id))})]}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"transfer_enable",render:({field:w})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:c("plan.form.transfer.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",min:0,placeholder:c("plan.form.transfer.placeholder"),className:"rounded-r-none",...w})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:c("plan.form.transfer.unit")})]}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"speed_limit",render:({field:w})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:c("plan.form.speed.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",min:0,placeholder:c("plan.form.speed.placeholder"),className:"rounded-r-none",...w,value:w.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:c("plan.form.speed.unit")})]}),e.jsx(P,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center",children:[e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"}),e.jsx("h3",{className:"mx-4 text-sm font-medium text-gray-500 dark:text-gray-400",children:c("plan.form.price.title")}),e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(D,{type:"number",placeholder:c("plan.form.price.base_price"),className:"h-7 w-32 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500",onChange:w=>{const N=parseFloat(w.target.value);C(N)}})]}),e.jsx(je,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>{const w=Object.keys(oa).reduce((N,g)=>({...N,[g]:""}),{});u.setValue("prices",w,{shouldDirty:!0})},children:c("plan.form.price.clear.button")})}),e.jsx(oe,{side:"top",align:"end",children:e.jsx("p",{className:"text-xs",children:c("plan.form.price.clear.tooltip")})})]})})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-3",children:Object.entries(oa).filter(([w])=>!["onetime","reset_traffic"].includes(w)).map(([w,N])=>e.jsx("div",{className:"group relative rounded-md bg-card p-2 ring-1 ring-gray-200 transition-all hover:ring-primary dark:ring-gray-800",children:e.jsx(v,{control:u.control,name:`prices.${w}`,render:({field:g})=>e.jsxs(f,{children:[e.jsxs(j,{className:"text-xs font-medium text-muted-foreground",children:[c(`plan.columns.price_period.${w}`),e.jsxs("span",{className:"ml-1 text-[10px] text-gray-400",children:["(",N.months===1?c("plan.form.price.period.monthly"):c("plan.form.price.period.months",{count:N.months}),")"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:"0.00",min:0,...g,value:g.value??"",onChange:T=>g.onChange(T.target.value),className:"h-7 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500"})})]})]})})},w))}),e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:Object.entries(oa).filter(([w])=>["onetime","reset_traffic"].includes(w)).map(([w,N])=>e.jsx("div",{className:"rounded-md border border-dashed border-gray-200 bg-muted/30 p-3 dark:border-gray-700",children:e.jsx(v,{control:u.control,name:`prices.${w}`,render:({field:g})=>e.jsx(f,{children:e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"space-y-0",children:[e.jsx(j,{className:"text-xs font-medium",children:c(`plan.columns.price_period.${w}`)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:c(w==="onetime"?"plan.form.price.onetime_desc":"plan.form.price.reset_desc")})]}),e.jsxs("div",{className:"relative w-full md:w-32",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:"0.00",min:0,...g,className:"h-7 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500"})})]})]})})})},w))})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(v,{control:u.control,name:"device_limit",render:({field:w})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:c("plan.form.device.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",min:0,placeholder:c("plan.form.device.placeholder"),className:"rounded-r-none",...w,value:w.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:c("plan.form.device.unit")})]}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"capacity_limit",render:({field:w})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(j,{children:c("plan.form.capacity.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(b,{children:e.jsx(D,{type:"number",min:0,placeholder:c("plan.form.capacity.placeholder"),className:"rounded-r-none",...w,value:w.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:c("plan.form.capacity.unit")})]}),e.jsx(P,{})]})})]}),e.jsx(v,{control:u.control,name:"reset_traffic_method",render:({field:w})=>e.jsxs(f,{children:[e.jsx(j,{children:c("plan.form.reset_method.label")}),e.jsxs(J,{value:w.value?.toString()??"null",onValueChange:N=>w.onChange(N=="null"?null:Number(N)),children:[e.jsx(b,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:c("plan.form.reset_method.placeholder")})})}),e.jsx(Y,{children:Lx.map(N=>e.jsx(A,{value:N.value?.toString()??"null",children:c(`plan.form.reset_method.options.${N.label}`)},N.value))})]}),e.jsx(M,{className:"text-xs",children:c("plan.form.reset_method.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:u.control,name:"content",render:({field:w})=>{const[N,g]=m.useState(!1);return e.jsxs(f,{className:"space-y-2",children:[e.jsxs(j,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[c("plan.form.content.label"),e.jsx(je,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(L,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>g(!N),children:N?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-4 w-4",children:[e.jsx("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z"}),e.jsx("path",{fillRule:"evenodd",d:"M.664 10.59a1.651 1.651 0 010-1.186A10.004 10.004 0 0110 3c4.257 0 7.893 2.66 9.336 6.41.147.381.146.804 0 1.186A10.004 10.004 0 0110 17c-4.257 0-7.893-2.66-9.336-6.41zM14 10a4 4 0 11-8 0 4 4 0 018 0z",clipRule:"evenodd"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-4 w-4",children:[e.jsx("path",{fillRule:"evenodd",d:"M3.28 2.22a.75.75 0 00-1.06 1.06l14.5 14.5a.75.75 0 101.06-1.06l-1.745-1.745a10.029 10.029 0 003.3-4.38 1.651 1.651 0 000-1.185A10.004 10.004 0 009.999 3a9.956 9.956 0 00-4.744 1.194L3.28 2.22zM7.752 6.69l1.092 1.092a2.5 2.5 0 013.374 3.373l1.091 1.092a4 4 0 00-5.557-5.557z",clipRule:"evenodd"}),e.jsx("path",{d:"M10.748 13.93l2.523 2.523a9.987 9.987 0 01-3.27.547c-4.258 0-7.894-2.66-9.337-6.41a1.651 1.651 0 010-1.186A10.007 10.007 0 012.839 6.02L6.07 9.252a4 4 0 004.678 4.678z"})]})})}),e.jsx(oe,{side:"top",children:e.jsx("p",{className:"text-xs",children:c(N?"plan.form.content.preview_button.hide":"plan.form.content.preview_button.show")})})]})})]}),e.jsx(je,{children:e.jsxs(de,{children:[e.jsx(me,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",onClick:()=>{w.onChange(c("plan.form.content.template.content"))},children:c("plan.form.content.template.button")})}),e.jsx(oe,{side:"left",align:"center",children:e.jsx("p",{className:"text-xs",children:c("plan.form.content.template.tooltip")})})]})})]}),e.jsxs("div",{className:`grid gap-4 ${N?"grid-cols-1 lg:grid-cols-2":"grid-cols-1"}`,children:[e.jsx("div",{className:"space-y-2",children:e.jsx(b,{children:e.jsx(bn,{style:{height:"400px"},value:w.value||"",renderHTML:T=>i.render(T),onChange:({text:T})=>w.onChange(T),config:{view:{menu:!0,md:!0,html:!1},canView:{menu:!0,md:!0,html:!1,fullScreen:!1,hideMenu:!1}},placeholder:c("plan.form.content.placeholder"),className:"rounded-md border"})})}),N&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:c("plan.form.content.preview")}),e.jsx("div",{className:"prose prose-sm dark:prose-invert h-[400px] max-w-none overflow-y-auto rounded-md border p-4",children:e.jsx("div",{dangerouslySetInnerHTML:{__html:i.render(w.value||"")}})})]})]}),e.jsx(M,{className:"text-xs",children:c("plan.form.content.description")}),e.jsx(P,{})]})}})]}),e.jsx(Le,{className:"mt-6",children:e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsx("div",{className:"flex-shrink-0",children:t&&e.jsx(v,{control:u.control,name:"force_update",render:({field:w})=>e.jsxs(f,{className:"flex flex-row items-center space-x-2 space-y-0",children:[e.jsx(b,{children:e.jsx(Pn,{checked:w.value,onCheckedChange:w.onChange})}),e.jsx("div",{className:"",children:e.jsx(j,{className:"text-sm",children:c("plan.form.force_update.label")})})]})})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(L,{type:"button",variant:"outline",onClick:S,children:c("plan.form.submit.cancel")}),e.jsx(L,{type:"submit",disabled:r,onClick:()=>{u.handleSubmit(async w=>{o(!0),(await ss.save(w)).data&&($.success(c(t?"plan.form.submit.success.update":"plan.form.submit.success.add")),S(),n()),o(!1)})()},children:c(r?"plan.form.submit.submitting":"plan.form.submit.submit")})]})]})})]})]})})}function Ix(){const[s,a]=m.useState({}),[t,l]=m.useState({"drag-handle":!1}),[n,r]=m.useState([]),[o,c]=m.useState([]),[u,i]=m.useState(!1),[d,h]=m.useState({pageSize:20,pageIndex:0}),[k,C]=m.useState([]),{refetch:S}=le({queryKey:["planList"],queryFn:async()=>{const{data:E}=await ss.getList();return C(E),E}});m.useEffect(()=>{l({"drag-handle":u}),h({pageSize:u?99999:10,pageIndex:0})},[u]);const w=(E,p)=>{u&&(E.dataTransfer.setData("text/plain",p.toString()),E.currentTarget.classList.add("opacity-50"))},N=(E,p)=>{if(!u)return;E.preventDefault(),E.currentTarget.classList.remove("bg-muted");const _=parseInt(E.dataTransfer.getData("text/plain"));if(_===p)return;const I=[...k],[H]=I.splice(_,1);I.splice(p,0,H),C(I)},g=async()=>{if(!u){i(!0);return}const E=k?.map(p=>p.id);ss.sort(E).then(()=>{$.success("排序保存成功"),i(!1),S()}).finally(()=>{i(!1)})},T=Je({data:k||[],columns:Dx(S),state:{sorting:o,columnVisibility:t,rowSelection:s,columnFilters:n,pagination:d},enableRowSelection:!0,onPaginationChange:h,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:r,onColumnVisibilityChange:l,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}},pageCount:u?1:void 0});return e.jsx(kx,{refreshData:S,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(os,{table:T,toolbar:E=>e.jsx(Tx,{table:E,refetch:S,saveOrder:g,isSortMode:u}),draggable:u,onDragStart:w,onDragEnd:E=>E.currentTarget.classList.remove("opacity-50"),onDragOver:E=>{E.preventDefault(),E.currentTarget.classList.add("bg-muted")},onDragLeave:E=>E.currentTarget.classList.remove("bg-muted"),onDrop:N,showPagination:!u}),e.jsx(Ex,{})]})})}function Rx(){const{t:s}=V("subscribe");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("plan.title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("plan.page.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Ix,{})})]})]})}const Vx=Object.freeze(Object.defineProperty({__proto__:null,default:Rx},Symbol.toStringTag,{value:"Module"})),pt=[{value:ne.PENDING,label:Rt[ne.PENDING],icon:Kc,color:Vt[ne.PENDING]},{value:ne.PROCESSING,label:Rt[ne.PROCESSING],icon:cr,color:Vt[ne.PROCESSING]},{value:ne.COMPLETED,label:Rt[ne.COMPLETED],icon:on,color:Vt[ne.COMPLETED]},{value:ne.CANCELLED,label:Rt[ne.CANCELLED],icon:dr,color:Vt[ne.CANCELLED]},{value:ne.DISCOUNTED,label:Rt[ne.DISCOUNTED],icon:on,color:Vt[ne.DISCOUNTED]}],zt=[{value:ye.PENDING,label:aa[ye.PENDING],icon:Bc,color:na[ye.PENDING]},{value:ye.PROCESSING,label:aa[ye.PROCESSING],icon:cr,color:na[ye.PROCESSING]},{value:ye.VALID,label:aa[ye.VALID],icon:on,color:na[ye.VALID]},{value:ye.INVALID,label:aa[ye.INVALID],icon:dr,color:na[ye.INVALID]}];function ca({column:s,title:a,options:t}){const l=s?.getFacetedUniqueValues(),n=s?.getFilterValue(),r=Array.isArray(n)?new Set(n):n!==void 0?new Set([n]):new Set;return e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Pa,{className:"mr-2 h-4 w-4"}),a,r?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:r.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:r.size>2?e.jsxs(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[r.size," selected"]}):t.filter(o=>r.has(o.value)).map(o=>e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:o.label},o.value))})]})]})}),e.jsx(bs,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Us,{children:[e.jsx(it,{placeholder:a}),e.jsxs(Ks,{children:[e.jsx(ot,{children:"No results found."}),e.jsx(ns,{children:t.map(o=>{const c=r.has(o.value);return e.jsxs($e,{onSelect:()=>{const u=new Set(r);c?u.delete(o.value):u.add(o.value);const i=Array.from(u);s?.setFilterValue(i.length?i:void 0)},children:[e.jsx("div",{className:y("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",c?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(at,{className:y("h-4 w-4")})}),o.icon&&e.jsx(o.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${o.color}`}),e.jsx("span",{children:o.label}),l?.get(o.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:l.get(o.value)})]},o.value)})}),r.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{}),e.jsx(ns,{children:e.jsx($e,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const Fx=x.object({email:x.string().min(1),plan_id:x.number(),period:x.string(),total_amount:x.number()}),Mx={email:"",plan_id:0,total_amount:0,period:""};function Wr({refetch:s,trigger:a,defaultValues:t}){const{t:l}=V("order"),[n,r]=m.useState(!1),o=Ne({resolver:we(Fx),defaultValues:{...Mx,...t},mode:"onChange"}),[c,u]=m.useState([]);return m.useEffect(()=>{n&&ss.getList().then(({data:i})=>{u(i)})},[n]),e.jsxs(ge,{open:n,onOpenChange:r,children:[e.jsx(is,{asChild:!0,children:a||e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 space-x-2",children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("div",{children:l("dialog.addOrder")})]})}),e.jsxs(pe,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:l("dialog.assignOrder")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...o,children:[e.jsx(v,{control:o.control,name:"email",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dialog.fields.userEmail")}),e.jsx(b,{children:e.jsx(D,{placeholder:l("dialog.placeholders.email"),...i})})]})}),e.jsx(v,{control:o.control,name:"plan_id",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dialog.fields.subscriptionPlan")}),e.jsx(b,{children:e.jsxs(J,{value:i.value?i.value?.toString():void 0,onValueChange:d=>i.onChange(parseInt(d)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dialog.placeholders.plan")})}),e.jsx(Y,{children:c.map(d=>e.jsx(A,{value:d.id.toString(),children:d.name},d.id))})]})})]})}),e.jsx(v,{control:o.control,name:"period",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dialog.fields.orderPeriod")}),e.jsx(b,{children:e.jsxs(J,{value:i.value,onValueChange:i.onChange,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:l("dialog.placeholders.period")})}),e.jsx(Y,{children:Object.keys(im).map(d=>e.jsx(A,{value:d,children:l(`period.${d}`)},d))})]})})]})}),e.jsx(v,{control:o.control,name:"total_amount",render:({field:i})=>e.jsxs(f,{children:[e.jsx(j,{children:l("dialog.fields.paymentAmount")}),e.jsx(b,{children:e.jsx(D,{type:"number",placeholder:l("dialog.placeholders.amount"),value:i.value/100,onChange:d=>i.onChange(parseFloat(d.currentTarget.value)*100)})}),e.jsx(P,{})]})}),e.jsxs(Le,{children:[e.jsx(L,{variant:"outline",onClick:()=>r(!1),children:l("dialog.actions.cancel")}),e.jsx(L,{type:"submit",onClick:()=>{o.handleSubmit(i=>{Qs.assign(i).then(({data:d})=>{d&&(s&&s(),o.reset(),r(!1),$.success(l("dialog.messages.addSuccess")))})})()},children:l("dialog.actions.confirm")})]})]})]})]})}function Ox({table:s,refetch:a}){const{t}=V("order"),l=s.getState().columnFilters.length>0,n=Object.values(gs).filter(u=>typeof u=="number").map(u=>({label:t(`type.${gs[u]}`),value:u,color:u===gs.NEW?"green-500":u===gs.RENEWAL?"blue-500":u===gs.UPGRADE?"purple-500":"orange-500"})),r=Object.values(Ie).map(u=>({label:t(`period.${u}`),value:u,color:u===Ie.MONTH_PRICE?"slate-500":u===Ie.QUARTER_PRICE?"cyan-500":u===Ie.HALF_YEAR_PRICE?"indigo-500":u===Ie.YEAR_PRICE?"violet-500":u===Ie.TWO_YEAR_PRICE?"fuchsia-500":u===Ie.THREE_YEAR_PRICE?"pink-500":u===Ie.ONETIME_PRICE?"rose-500":"orange-500"})),o=Object.values(ne).filter(u=>typeof u=="number").map(u=>({label:t(`status.${ne[u]}`),value:u,icon:u===ne.PENDING?pt[0].icon:u===ne.PROCESSING?pt[1].icon:u===ne.COMPLETED?pt[2].icon:u===ne.CANCELLED?pt[3].icon:pt[4].icon,color:u===ne.PENDING?"yellow-500":u===ne.PROCESSING?"blue-500":u===ne.COMPLETED?"green-500":u===ne.CANCELLED?"red-500":"green-500"})),c=Object.values(ye).filter(u=>typeof u=="number").map(u=>({label:t(`commission.${ye[u]}`),value:u,icon:u===ye.PENDING?zt[0].icon:u===ye.PROCESSING?zt[1].icon:u===ye.VALID?zt[2].icon:zt[3].icon,color:u===ye.PENDING?"yellow-500":u===ye.PROCESSING?"blue-500":u===ye.VALID?"green-500":"red-500"}));return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Wr,{refetch:a}),e.jsx(D,{placeholder:t("search.placeholder"),value:s.getColumn("trade_no")?.getFilterValue()??"",onChange:u=>s.getColumn("trade_no")?.setFilterValue(u.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2",children:[s.getColumn("type")&&e.jsx(ca,{column:s.getColumn("type"),title:t("table.columns.type"),options:n}),s.getColumn("period")&&e.jsx(ca,{column:s.getColumn("period"),title:t("table.columns.period"),options:r}),s.getColumn("status")&&e.jsx(ca,{column:s.getColumn("status"),title:t("table.columns.status"),options:o}),s.getColumn("commission_status")&&e.jsx(ca,{column:s.getColumn("commission_status"),title:t("table.columns.commissionStatus"),options:c})]}),l&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[t("actions.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]})}function xs({label:s,value:a,className:t,valueClassName:l}){return e.jsxs("div",{className:y("flex items-center py-1.5",t),children:[e.jsx("div",{className:"w-28 shrink-0 text-sm text-muted-foreground",children:s}),e.jsx("div",{className:y("text-sm",l),children:a||"-"})]})}function zx({status:s}){const{t:a}=V("order"),t={[ne.PENDING]:"bg-yellow-100 text-yellow-800 hover:bg-yellow-100",[ne.PROCESSING]:"bg-blue-100 text-blue-800 hover:bg-blue-100",[ne.CANCELLED]:"bg-red-100 text-red-800 hover:bg-red-100",[ne.COMPLETED]:"bg-green-100 text-green-800 hover:bg-green-100",[ne.DISCOUNTED]:"bg-gray-100 text-gray-800 hover:bg-gray-100"};return e.jsx(G,{variant:"secondary",className:y("font-medium",t[s]),children:a(`status.${ne[s]}`)})}function $x({id:s,trigger:a}){const[t,l]=m.useState(!1),[n,r]=m.useState(),{t:o}=V("order");return m.useEffect(()=>{(async()=>{if(t){const{data:u}=await Qs.getInfo({id:s});r(u)}})()},[t,s]),e.jsxs(ge,{onOpenChange:l,open:t,children:[e.jsx(is,{asChild:!0,children:a}),e.jsxs(pe,{className:"max-w-xl",children:[e.jsxs(ve,{className:"space-y-2",children:[e.jsx(fe,{className:"text-lg font-medium",children:o("dialog.title")}),e.jsx("div",{className:"flex items-center justify-between text-sm",children:e.jsxs("div",{className:"flex items-center space-x-6",children:[e.jsxs("div",{className:"text-muted-foreground",children:[o("table.columns.tradeNo"),":",n?.trade_no]}),!!n?.status&&e.jsx(zx,{status:n.status})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:o("dialog.basicInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(xs,{label:o("dialog.fields.userEmail"),value:n?.user?.email?e.jsxs(nt,{to:`/user/manage?email=${n.user.email}`,className:"group inline-flex items-center gap-1 text-primary hover:underline",children:[n.user.email,e.jsx(mr,{className:"h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100"})]}):"-"}),e.jsx(xs,{label:o("dialog.fields.orderPeriod"),value:n&&o(`period.${n.period}`)}),e.jsx(xs,{label:o("dialog.fields.subscriptionPlan"),value:n?.plan?.name,valueClassName:"font-medium"}),e.jsx(xs,{label:o("dialog.fields.callbackNo"),value:n?.callback_no,valueClassName:"font-mono text-xs"})]})]}),e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:o("dialog.amountInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(xs,{label:o("dialog.fields.paymentAmount"),value:Js(n?.total_amount||0),valueClassName:"font-medium text-primary"}),e.jsx(De,{className:"my-2"}),e.jsx(xs,{label:o("dialog.fields.balancePayment"),value:Js(n?.balance_amount||0)}),e.jsx(xs,{label:o("dialog.fields.discountAmount"),value:Js(n?.discount_amount||0),valueClassName:"text-green-600"}),e.jsx(xs,{label:o("dialog.fields.refundAmount"),value:Js(n?.refund_amount||0),valueClassName:"text-red-600"}),e.jsx(xs,{label:o("dialog.fields.deductionAmount"),value:Js(n?.surplus_amount||0)})]})]}),e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:o("dialog.timeInfo")}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(xs,{label:o("dialog.fields.createdAt"),value:Se(n?.created_at),valueClassName:"font-mono text-xs"}),e.jsx(xs,{label:o("dialog.fields.updatedAt"),value:Se(n?.updated_at),valueClassName:"font-mono text-xs"})]})]})]})]})]})}const Ax={[gs.NEW]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[gs.RENEWAL]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[gs.UPGRADE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[gs.RESET_FLOW]:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},qx={[Ie.MONTH_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.QUARTER_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.HALF_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.TWO_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.THREE_YEAR_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.ONETIME_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"},[Ie.RESET_PRICE]:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},Hx=s=>ne[s],Ux=s=>ye[s],Kx=s=>gs[s],Bx=s=>{const{t:a}=V("order");return[{accessorKey:"trade_no",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.tradeNo")}),cell:({row:t})=>{const l=t.original.trade_no,n=l.length>6?`${l.slice(0,3)}...${l.slice(-3)}`:l;return e.jsx("div",{className:"flex items-center",children:e.jsx($x,{trigger:e.jsxs(K,{variant:"ghost",size:"sm",className:"flex h-8 items-center gap-1.5 px-2 font-medium text-primary transition-colors hover:bg-primary/10 hover:text-primary/80",children:[e.jsx("span",{className:"font-mono",children:n}),e.jsx(mr,{className:"h-3.5 w-3.5 opacity-70"})]}),id:t.original.id})})},enableSorting:!1,enableHiding:!1},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.type")}),cell:({row:t})=>{const l=t.getValue("type"),n=Ax[l];return e.jsx(G,{variant:"secondary",className:y("font-medium transition-colors text-nowrap",n.color,n.bgColor,"border border-border/50","hover:bg-slate-200/80"),children:a(`type.${Kx(l)}`)})},enableSorting:!1,enableHiding:!1},{accessorKey:"plan.name",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.plan")}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium text-foreground/90 sm:max-w-72 md:max-w-[31rem]",children:t.original.plan?.name||"-"})}),enableSorting:!1,enableHiding:!1},{accessorKey:"period",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.period")}),cell:({row:t})=>{const l=t.getValue("period"),n=qx[l];return e.jsx(G,{variant:"secondary",className:y("font-medium transition-colors text-nowrap",n?.color,n?.bgColor,"hover:bg-opacity-80"),children:a(`period.${l}`)})},enableSorting:!1,enableHiding:!1},{accessorKey:"total_amount",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.amount")}),cell:({row:t})=>{const l=t.getValue("total_amount"),n=typeof l=="number"?(l/100).toFixed(2):"N/A";return e.jsxs("div",{className:"flex items-center font-mono text-foreground/90",children:["¥",n]})},enableSorting:!0,enableHiding:!1},{accessorKey:"status",header:({column:t})=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(z,{column:t,title:a("table.columns.status")}),e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{children:e.jsx($r,{className:"h-4 w-4 text-muted-foreground/70 transition-colors hover:text-muted-foreground"})}),e.jsx(oe,{side:"top",className:"max-w-[200px] text-sm",children:a("status.tooltip")})]})})]}),cell:({row:t})=>{const l=pt.find(n=>n.value===t.getValue("status"));return l?e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l.icon&&e.jsx(l.icon,{className:`h-4 w-4 text-${l.color}`}),e.jsx("span",{className:"text-sm font-medium",children:a(`status.${Hx(l.value)}`)})]}),l.value===ne.PENDING&&e.jsxs(Es,{modal:!0,children:[e.jsx(Is,{asChild:!0,children:e.jsxs(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-muted/60",children:[e.jsx(va,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:a("actions.openMenu")})]})}),e.jsxs(ws,{align:"end",className:"w-[140px]",children:[e.jsx(_e,{className:"cursor-pointer",onClick:async()=>{await Qs.markPaid({trade_no:t.original.trade_no}),s()},children:a("actions.markAsPaid")}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onClick:async()=>{await Qs.makeCancel({trade_no:t.original.trade_no}),s()},children:a("actions.cancel")})]})]})]}):null},enableSorting:!0,enableHiding:!1},{accessorKey:"commission_balance",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.commission")}),cell:({row:t})=>{const l=t.getValue("commission_balance"),n=l?(l/100).toFixed(2):"-";return e.jsx("div",{className:"flex items-center font-mono text-foreground/90",children:l?`¥${n}`:"-"})},enableSorting:!0,enableHiding:!1},{accessorKey:"commission_status",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.commissionStatus")}),cell:({row:t})=>{const l=t.original.status,n=t.original.commission_balance,r=zt.find(o=>o.value===t.getValue("commission_status"));return n==0||!r?e.jsx("span",{className:"text-muted-foreground",children:"-"}):e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[r.icon&&e.jsx(r.icon,{className:`h-4 w-4 text-${r.color}`}),e.jsx("span",{className:"text-sm font-medium",children:a(`commission.${Ux(r.value)}`)})]}),r.value===ye.PENDING&&l===ne.COMPLETED&&e.jsxs(Es,{modal:!0,children:[e.jsx(Is,{asChild:!0,children:e.jsxs(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-muted/60",children:[e.jsx(va,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:a("actions.openMenu")})]})}),e.jsxs(ws,{align:"end",className:"w-[120px]",children:[e.jsx(_e,{className:"cursor-pointer",onClick:async()=>{await Qs.update({trade_no:t.original.trade_no,commission_status:ye.PROCESSING}),s()},children:a("commission.PROCESSING")}),e.jsx(_e,{className:"cursor-pointer text-destructive focus:text-destructive",onClick:async()=>{await Qs.update({trade_no:t.original.trade_no,commission_status:ye.INVALID}),s()},children:a("commission.INVALID")})]})]})]})},enableSorting:!0,enableHiding:!1},{accessorKey:"created_at",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.createdAt")}),cell:({row:t})=>e.jsx("div",{className:"text-nowrap font-mono text-sm text-muted-foreground",children:Se(t.getValue("created_at"),"YYYY/MM/DD HH:mm:ss")}),enableSorting:!0,enableHiding:!1}]};function Gx(){const[s]=ur(),[a,t]=m.useState({}),[l,n]=m.useState({}),[r,o]=m.useState([]),[c,u]=m.useState([]),[i,d]=m.useState({pageIndex:0,pageSize:20});m.useEffect(()=>{const N=Object.entries({user_id:"string",order_id:"string",commission_status:"number",status:"number",commission_balance:"string"}).map(([g,T])=>{const E=s.get(g);return E?{id:g,value:T==="number"?parseInt(E):E}:null}).filter(Boolean);N.length>0&&o(N)},[s]);const{refetch:h,data:k,isLoading:C}=le({queryKey:["orderList",i,r,c],queryFn:()=>Qs.getList({pageSize:i.pageSize,current:i.pageIndex+1,filter:r,sort:c})}),S=Je({data:k?.data??[],columns:Bx(h),state:{sorting:c,columnVisibility:l,rowSelection:a,columnFilters:r,pagination:i},rowCount:k?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:t,onSortingChange:u,onColumnFiltersChange:o,onColumnVisibilityChange:n,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),onPaginationChange:d,getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(os,{table:S,toolbar:e.jsx(Ox,{table:S,refetch:h}),showPagination:!0})}function Wx(){const{t:s}=V("order");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Gx,{})})]})]})}const Yx=Object.freeze(Object.defineProperty({__proto__:null,default:Wx},Symbol.toStringTag,{value:"Module"}));function Jx({column:s,title:a,options:t}){const l=s?.getFacetedUniqueValues(),n=new Set(s?.getFilterValue());return e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Pa,{className:"mr-2 h-4 w-4"}),a,n?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:n.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:n.size>2?e.jsxs(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[n.size," selected"]}):t.filter(r=>n.has(r.value)).map(r=>e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:r.label},r.value))})]})]})}),e.jsx(bs,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Us,{children:[e.jsx(it,{placeholder:a}),e.jsxs(Ks,{children:[e.jsx(ot,{children:"No results found."}),e.jsx(ns,{children:t.map(r=>{const o=n.has(r.value);return e.jsxs($e,{onSelect:()=>{o?n.delete(r.value):n.add(r.value);const c=Array.from(n);s?.setFilterValue(c.length?c:void 0)},children:[e.jsx("div",{className:y("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",o?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(at,{className:y("h-4 w-4")})}),r.icon&&e.jsx(r.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${r.color}`}),e.jsx("span",{children:r.label}),l?.get(r.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:l.get(r.value)})]},r.value)})}),n.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{}),e.jsx(ns,{children:e.jsx($e,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const Qx=x.object({id:x.coerce.number().nullable().optional(),name:x.string().min(1,"请输入优惠券名称"),code:x.string().nullable(),type:x.coerce.number(),value:x.coerce.number(),started_at:x.coerce.number(),ended_at:x.coerce.number(),limit_use:x.union([x.string(),x.number()]).nullable(),limit_use_with_user:x.union([x.string(),x.number()]).nullable(),generate_count:x.coerce.number().nullable().optional(),limit_plan_ids:x.array(x.coerce.number()).default([]).nullable(),limit_period:x.array(x.nativeEnum(Ht)).default([]).nullable()}).refine(s=>s.ended_at>s.started_at,{message:"结束时间必须晚于开始时间",path:["ended_at"]}),ol={name:"",code:null,type:Ze.AMOUNT,value:0,started_at:Math.floor(Date.now()/1e3),ended_at:Math.floor(Date.now()/1e3)+7*24*60*60,limit_use:null,limit_use_with_user:null,limit_plan_ids:[],limit_period:[],generate_count:null};function Yr({defaultValues:s,refetch:a,type:t="create",dialogTrigger:l=null,open:n,onOpenChange:r}){const{t:o}=V("coupon"),[c,u]=m.useState(!1),i=n??c,d=r??u,[h,k]=m.useState([]),C=Ne({resolver:we(Qx),defaultValues:s||ol});m.useEffect(()=>{s&&C.reset(s)},[s,C]),m.useEffect(()=>{ss.getList().then(({data:g})=>k(g))},[]);const S=g=>{if(!g)return;const T=(E,p)=>{const _=new Date(p*1e3);return E.setHours(_.getHours(),_.getMinutes(),_.getSeconds()),Math.floor(E.getTime()/1e3)};g.from&&C.setValue("started_at",T(g.from,C.watch("started_at"))),g.to&&C.setValue("ended_at",T(g.to,C.watch("ended_at")))},w=async g=>{const T=await Na.save(g);if(g.generate_count&&T){const E=new Blob([T],{type:"text/csv;charset=utf-8;"}),p=document.createElement("a");p.href=window.URL.createObjectURL(E),p.download=`coupons_${new Date().getTime()}.csv`,p.click(),window.URL.revokeObjectURL(p.href)}d(!1),t==="create"&&C.reset(ol),a()},N=(g,T)=>e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:T}),e.jsx(D,{type:"datetime-local",step:"1",value:Se(C.watch(g),"YYYY-MM-DDTHH:mm:ss"),onChange:E=>{const p=new Date(E.target.value);C.setValue(g,Math.floor(p.getTime()/1e3))},className:"h-8 [&::-webkit-calendar-picker-indicator]:hidden"})]});return e.jsxs(ge,{open:i,onOpenChange:d,children:[l&&e.jsx(is,{asChild:!0,children:l}),e.jsxs(pe,{className:"sm:max-w-[425px]",children:[e.jsx(ve,{children:e.jsx(fe,{children:o(t==="create"?"form.add":"form.edit")})}),e.jsx(Ce,{...C,children:e.jsxs("form",{onSubmit:C.handleSubmit(w),className:"space-y-4",children:[e.jsx(v,{control:C.control,name:"name",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.name.label")}),e.jsx(D,{placeholder:o("form.name.placeholder"),...g}),e.jsx(P,{})]})}),t==="create"&&e.jsx(v,{control:C.control,name:"generate_count",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.generateCount.label")}),e.jsx(D,{type:"number",min:0,placeholder:o("form.generateCount.placeholder"),...g,value:g.value===void 0?"":g.value,onChange:T=>g.onChange(T.target.value===""?"":parseInt(T.target.value)),className:"h-9"}),e.jsx(M,{className:"text-xs",children:o("form.generateCount.description")}),e.jsx(P,{})]})}),(!C.watch("generate_count")||C.watch("generate_count")==null)&&e.jsx(v,{control:C.control,name:"code",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.code.label")}),e.jsx(D,{placeholder:o("form.code.placeholder"),...g,className:"h-9"}),e.jsx(M,{className:"text-xs",children:o("form.code.description")}),e.jsx(P,{})]})}),e.jsxs(f,{children:[e.jsx(j,{children:o("form.type.label")}),e.jsxs("div",{className:"flex",children:[e.jsx(v,{control:C.control,name:"type",render:({field:g})=>e.jsxs(J,{value:g.value.toString(),onValueChange:T=>{const E=g.value,p=parseInt(T);g.onChange(p);const _=C.getValues("value");_&&(E===Ze.AMOUNT&&p===Ze.PERCENTAGE?C.setValue("value",_/100):E===Ze.PERCENTAGE&&p===Ze.AMOUNT&&C.setValue("value",_*100))},children:[e.jsx(W,{className:"flex-[1.2] rounded-r-none border-r-0 focus:z-10",children:e.jsx(Q,{placeholder:o("form.type.placeholder")})}),e.jsx(Y,{children:Object.entries(om).map(([T,E])=>e.jsx(A,{value:T,children:o(`table.toolbar.types.${T}`)},T))})]})}),e.jsx(v,{control:C.control,name:"value",render:({field:g})=>{const T=g.value==null?"":C.watch("type")===Ze.AMOUNT&&typeof g.value=="number"?(g.value/100).toString():g.value.toString();return e.jsx(D,{type:"number",placeholder:o("form.value.placeholder"),...g,value:T,onChange:E=>{const p=E.target.value;if(p===""){g.onChange("");return}const _=parseFloat(p);isNaN(_)||g.onChange(C.watch("type")===Ze.AMOUNT?Math.round(_*100):_)},step:"any",min:0,className:"flex-[2] rounded-none border-x-0 text-left"})}}),e.jsx("div",{className:"flex min-w-[40px] items-center justify-center rounded-md rounded-l-none border border-l-0 border-input bg-muted/50 px-3 font-medium text-muted-foreground",children:e.jsx("span",{children:C.watch("type")==Ze.AMOUNT?"¥":"%"})})]})]}),e.jsxs(f,{children:[e.jsx(j,{children:o("form.validity.label")}),e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:y("w-full justify-start text-left font-normal",!C.watch("started_at")&&"text-muted-foreground"),children:[e.jsx(Ct,{className:"mr-2 h-4 w-4"}),Se(C.watch("started_at"),"YYYY-MM-DD HH:mm:ss")," ",o("form.validity.to")," ",Se(C.watch("ended_at"),"YYYY-MM-DD HH:mm:ss")]})}),e.jsxs(bs,{className:"w-auto p-0",align:"start",children:[e.jsx("div",{className:"border-b border-border",children:e.jsx(ct,{mode:"range",selected:{from:new Date(C.watch("started_at")*1e3),to:new Date(C.watch("ended_at")*1e3)},onSelect:S,numberOfMonths:2})}),e.jsx("div",{className:"p-3",children:e.jsxs("div",{className:"flex items-center gap-4",children:[N("started_at",o("table.validity.startTime")),e.jsx("div",{className:"mt-6 text-sm text-muted-foreground",children:o("form.validity.to")}),N("ended_at",o("table.validity.endTime"))]})})]})]}),e.jsx(P,{})]}),e.jsx(v,{control:C.control,name:"limit_use",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.limitUse.label")}),e.jsx(D,{type:"number",min:0,placeholder:o("form.limitUse.placeholder"),...g,value:g.value===null?"":g.value,onChange:T=>g.onChange(T.target.value===""?null:parseInt(T.target.value)),className:"h-9"}),e.jsx(M,{className:"text-xs",children:o("form.limitUse.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:C.control,name:"limit_use_with_user",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.limitUseWithUser.label")}),e.jsx(D,{type:"number",min:0,placeholder:o("form.limitUseWithUser.placeholder"),...g,value:g.value===null?"":g.value,onChange:T=>g.onChange(T.target.value===""?null:parseInt(T.target.value)),className:"h-9"}),e.jsx(M,{className:"text-xs",children:o("form.limitUseWithUser.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:C.control,name:"limit_period",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.limitPeriod.label")}),e.jsx(wt,{options:Object.entries(Ht).filter(([T])=>isNaN(Number(T))).map(([T,E])=>({label:o(`coupon:period.${E}`),value:T})),onChange:T=>{if(T.length===0){g.onChange([]);return}const E=T.map(p=>Ht[p.value]);g.onChange(E)},value:(g.value||[]).map(T=>({label:o(`coupon:period.${T}`),value:Object.entries(Ht).find(([E,p])=>p===T)?.[0]||""})),placeholder:o("form.limitPeriod.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:o("form.limitPeriod.empty")})}),e.jsx(M,{className:"text-xs",children:o("form.limitPeriod.description")}),e.jsx(P,{})]})}),e.jsx(v,{control:C.control,name:"limit_plan_ids",render:({field:g})=>e.jsxs(f,{children:[e.jsx(j,{children:o("form.limitPlan.label")}),e.jsx(wt,{options:h?.map(T=>({label:T.name,value:T.id.toString()}))||[],onChange:T=>g.onChange(T.map(E=>Number(E.value))),value:(h||[]).filter(T=>(g.value||[]).includes(T.id)).map(T=>({label:T.name,value:T.id.toString()})),placeholder:o("form.limitPlan.placeholder"),emptyIndicator:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:o("form.limitPlan.empty")})}),e.jsx(P,{})]})}),e.jsx(Le,{children:e.jsx(L,{type:"submit",disabled:C.formState.isSubmitting,children:C.formState.isSubmitting?o("form.submit.saving"):o("form.submit.save")})})]})})]})]})}function Xx({table:s,refetch:a}){const t=s.getState().columnFilters.length>0,{t:l}=V("coupon");return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Yr,{refetch:a,dialogTrigger:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 space-x-2",children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("div",{children:l("form.add")})]})}),e.jsx(D,{placeholder:l("table.toolbar.search"),value:s.getColumn("name")?.getFilterValue()??"",onChange:n=>s.getColumn("name")?.setFilterValue(n.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),s.getColumn("type")&&e.jsx(Jx,{column:s.getColumn("type"),title:l("table.toolbar.type"),options:[{value:Ze.AMOUNT,label:l(`table.toolbar.types.${Ze.AMOUNT}`)},{value:Ze.PERCENTAGE,label:l(`table.toolbar.types.${Ze.PERCENTAGE}`)}]}),t&&e.jsxs(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[l("table.toolbar.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]})]})}const Jr=m.createContext(void 0);function Zx({children:s,refetch:a}){const[t,l]=m.useState(!1),[n,r]=m.useState(null),o=u=>{r(u),l(!0)},c=()=>{l(!1),r(null)};return e.jsxs(Jr.Provider,{value:{isOpen:t,currentCoupon:n,openEdit:o,closeEdit:c},children:[s,n&&e.jsx(Yr,{defaultValues:n,refetch:a,type:"edit",open:t,onOpenChange:l})]})}function eh(){const s=m.useContext(Jr);if(s===void 0)throw new Error("useCouponEdit must be used within a CouponEditProvider");return s}const sh=s=>{const{t:a}=V("coupon");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.id")}),cell:({row:t})=>e.jsx(G,{children:t.original.id}),enableSorting:!0},{accessorKey:"show",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.show")}),cell:({row:t})=>e.jsx(Z,{defaultChecked:t.original.show,onCheckedChange:l=>{Na.update({id:t.original.id,show:l}).then(({data:n})=>!n&&s())}}),enableSorting:!1},{accessorKey:"name",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.name")}),cell:({row:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{children:t.original.name})}),enableSorting:!1,size:800},{accessorKey:"type",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.type")}),cell:({row:t})=>e.jsx(G,{variant:"outline",children:a(`table.toolbar.types.${t.original.type}`)}),enableSorting:!0},{accessorKey:"code",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.code")}),cell:({row:t})=>e.jsx(G,{variant:"secondary",children:t.original.code}),enableSorting:!0},{accessorKey:"limit_use",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.limitUse")}),cell:({row:t})=>e.jsx(G,{variant:"outline",children:t.original.limit_use===null?a("table.validity.unlimited"):t.original.limit_use}),enableSorting:!0},{accessorKey:"limit_use_with_user",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.limitUseWithUser")}),cell:({row:t})=>e.jsx(G,{variant:"outline",children:t.original.limit_use_with_user===null?a("table.validity.noLimit"):t.original.limit_use_with_user}),enableSorting:!0},{accessorKey:"#",header:({column:t})=>e.jsx(z,{column:t,title:a("table.columns.validity")}),cell:({row:t})=>{const[l,n]=m.useState(!1),r=Date.now(),o=t.original.started_at*1e3,c=t.original.ended_at*1e3,u=r>c,i=re.jsx(z,{className:"justify-end",column:t,title:a("table.columns.actions")}),cell:({row:t})=>{const{openEdit:l}=eh();return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",onClick:()=>l(t.original),children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:a("table.actions.edit")})]}),e.jsx(ls,{title:a("table.actions.deleteConfirm.title"),description:a("table.actions.deleteConfirm.description"),confirmText:a("table.actions.deleteConfirm.confirmText"),variant:"destructive",onConfirm:async()=>{Na.drop({id:t.original.id}).then(({data:n})=>{n&&($.success("删除成功"),s())})},children:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(We,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:a("table.actions.delete")})]})})]})}}]};function th(){const[s,a]=m.useState({}),[t,l]=m.useState({}),[n,r]=m.useState([]),[o,c]=m.useState([]),[u,i]=m.useState({pageIndex:0,pageSize:20}),{refetch:d,data:h}=le({queryKey:["couponList",u,n,o],queryFn:()=>Na.getList({pageSize:u.pageSize,current:u.pageIndex+1,filter:n,sort:o})}),k=Je({data:h?.data??[],columns:sh(d),state:{sorting:o,columnVisibility:t,rowSelection:s,columnFilters:n,pagination:u},pageCount:Math.ceil((h?.total??0)/u.pageSize),rowCount:h?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:r,onColumnVisibilityChange:l,onPaginationChange:i,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(Zx,{refetch:d,children:e.jsx("div",{className:"space-y-4",children:e.jsx(os,{table:k,toolbar:e.jsx(Xx,{table:k,refetch:d})})})})}function ah(){const{t:s}=V("coupon");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"text-muted-foreground mt-2",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(th,{})})]})]})}const nh=Object.freeze(Object.defineProperty({__proto__:null,default:ah},Symbol.toStringTag,{value:"Module"})),lh=1,rh=1e6;let Za=0;function ih(){return Za=(Za+1)%Number.MAX_SAFE_INTEGER,Za.toString()}const en=new Map,cl=s=>{if(en.has(s))return;const a=setTimeout(()=>{en.delete(s),Ut({type:"REMOVE_TOAST",toastId:s})},rh);en.set(s,a)},oh=(s,a)=>{switch(a.type){case"ADD_TOAST":return{...s,toasts:[a.toast,...s.toasts].slice(0,lh)};case"UPDATE_TOAST":return{...s,toasts:s.toasts.map(t=>t.id===a.toast.id?{...t,...a.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=a;return t?cl(t):s.toasts.forEach(l=>{cl(l.id)}),{...s,toasts:s.toasts.map(l=>l.id===t||t===void 0?{...l,open:!1}:l)}}case"REMOVE_TOAST":return a.toastId===void 0?{...s,toasts:[]}:{...s,toasts:s.toasts.filter(t=>t.id!==a.toastId)}}},xa=[];let ha={toasts:[]};function Ut(s){ha=oh(ha,s),xa.forEach(a=>{a(ha)})}function ch({...s}){const a=ih(),t=n=>Ut({type:"UPDATE_TOAST",toast:{...n,id:a}}),l=()=>Ut({type:"DISMISS_TOAST",toastId:a});return Ut({type:"ADD_TOAST",toast:{...s,id:a,open:!0,onOpenChange:n=>{n||l()}}}),{id:a,dismiss:l,update:t}}function Qr(){const[s,a]=m.useState(ha);return m.useEffect(()=>(xa.push(a),()=>{const t=xa.indexOf(a);t>-1&&xa.splice(t,1)}),[s]),{...s,toast:ch,dismiss:t=>Ut({type:"DISMISS_TOAST",toastId:t})}}function dh({open:s,onOpenChange:a,table:t}){const{t:l}=V("user"),{toast:n}=Qr(),[r,o]=m.useState(!1),[c,u]=m.useState(""),[i,d]=m.useState(""),h=async()=>{if(!c||!i){n({title:l("messages.error"),description:l("messages.send_mail.required_fields"),variant:"destructive"});return}try{o(!0),await _s.sendMail({subject:c,content:i,filter:t.getState().columnFilters,sort:t.getState().sorting[0]?.id,sort_type:t.getState().sorting[0]?.desc?"DESC":"ASC"}),n({title:l("messages.success"),description:l("messages.send_mail.success")}),a(!1),u(""),d("")}catch{n({title:l("messages.error"),description:l("messages.send_mail.failed"),variant:"destructive"})}finally{o(!1)}};return e.jsx(ge,{open:s,onOpenChange:a,children:e.jsxs(pe,{className:"sm:max-w-[500px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:l("send_mail.title")}),e.jsx(Re,{children:l("send_mail.description")})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"subject",className:"text-right",children:l("send_mail.subject")}),e.jsx(D,{id:"subject",value:c,onChange:k=>u(k.target.value),className:"col-span-3"})]}),e.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[e.jsx("label",{htmlFor:"content",className:"text-right",children:l("send_mail.content")}),e.jsx(ks,{id:"content",value:i,onChange:k=>d(k.target.value),className:"col-span-3",rows:6})]})]}),e.jsx(Le,{children:e.jsx(K,{type:"submit",onClick:h,disabled:r,children:l(r?"send_mail.sending":"send_mail.send")})})]})})}const mh=x.object({email_prefix:x.string().optional(),email_suffix:x.string().min(1),password:x.string().optional(),expired_at:x.number().optional().nullable(),plan_id:x.number().nullable(),generate_count:x.number().optional().nullable(),download_csv:x.boolean().optional()}).refine(s=>s.generate_count===null?s.email_prefix!==void 0&&s.email_prefix!=="":!0,{message:"Email prefix is required when generate_count is null",path:["email_prefix"]}),uh={email_prefix:"",email_suffix:"",password:"",expired_at:null,plan_id:null,generate_count:void 0,download_csv:!1};function xh({refetch:s}){const{t:a}=V("user"),[t,l]=m.useState(!1),n=Ne({resolver:we(mh),defaultValues:uh,mode:"onChange"}),[r,o]=m.useState([]);return m.useEffect(()=>{t&&ss.getList().then(({data:c})=>{c&&o(c)})},[t]),e.jsxs(ge,{open:t,onOpenChange:l,children:[e.jsx(is,{asChild:!0,children:e.jsxs(K,{size:"sm",variant:"outline",className:"gap-0 space-x-2",children:[e.jsx(ze,{icon:"ion:add"}),e.jsx("div",{children:a("generate.button")})]})}),e.jsxs(pe,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:a("generate.title")}),e.jsx(Re,{})]}),e.jsxs(Ce,{...n,children:[e.jsxs(f,{children:[e.jsx(j,{children:a("generate.form.email")}),e.jsxs("div",{className:"flex",children:[!n.watch("generate_count")&&e.jsx(v,{control:n.control,name:"email_prefix",render:({field:c})=>e.jsx(D,{className:"flex-[5] rounded-r-none",placeholder:a("generate.form.email_prefix"),...c})}),e.jsx("div",{className:`z-[-1] border border-r-0 border-input px-3 py-1 shadow-sm ${n.watch("generate_count")?"rounded-l-md":"border-l-0"}`,children:"@"}),e.jsx(v,{control:n.control,name:"email_suffix",render:({field:c})=>e.jsx(D,{className:"flex-[4] rounded-l-none",placeholder:a("generate.form.email_domain"),...c})})]})]}),e.jsx(v,{control:n.control,name:"password",render:({field:c})=>e.jsxs(f,{children:[e.jsx(j,{children:a("generate.form.password")}),e.jsx(D,{placeholder:a("generate.form.password_placeholder"),...c}),e.jsx(P,{})]})}),e.jsx(v,{control:n.control,name:"expired_at",render:({field:c})=>e.jsxs(f,{className:"flex flex-col",children:[e.jsx(j,{children:a("generate.form.expire_time")}),e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsx(b,{children:e.jsxs(K,{variant:"outline",className:y("w-full pl-3 text-left font-normal",!c.value&&"text-muted-foreground"),children:[c.value?Se(c.value):e.jsx("span",{children:a("generate.form.expire_time_placeholder")}),e.jsx(Ct,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsxs(bs,{className:"flex w-auto flex-col space-y-2 p-2",children:[e.jsx(Wc,{asChild:!0,children:e.jsx(K,{variant:"outline",className:"w-full",onClick:()=>{c.onChange(null)},children:a("generate.form.permanent")})}),e.jsx("div",{className:"rounded-md border",children:e.jsx(ct,{mode:"single",selected:c.value?new Date(c.value*1e3):void 0,onSelect:u=>{u&&c.onChange(u?.getTime()/1e3)}})})]})]})]})}),e.jsx(v,{control:n.control,name:"plan_id",render:({field:c})=>e.jsxs(f,{children:[e.jsx(j,{children:a("generate.form.subscription")}),e.jsx(b,{children:e.jsxs(J,{value:c.value?c.value.toString():"null",onValueChange:u=>c.onChange(u==="null"?null:parseInt(u)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("generate.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"null",children:a("generate.form.subscription_none")}),r.map(u=>e.jsx(A,{value:u.id.toString(),children:u.name},u.id))]})]})})]})}),!n.watch("email_prefix")&&e.jsx(v,{control:n.control,name:"generate_count",render:({field:c})=>e.jsxs(f,{children:[e.jsx(j,{children:a("generate.form.generate_count")}),e.jsx(D,{type:"number",placeholder:a("generate.form.generate_count_placeholder"),value:c.value||"",onChange:u=>c.onChange(u.target.value?parseInt(u.target.value):null)})]})}),n.watch("generate_count")&&e.jsx(v,{control:n.control,name:"download_csv",render:({field:c})=>e.jsxs(f,{className:"flex cursor-pointer flex-row items-center space-x-2 space-y-0",children:[e.jsx(b,{children:e.jsx(Pn,{checked:c.value,onCheckedChange:c.onChange})}),e.jsx(j,{children:a("generate.form.download_csv")})]})})]}),e.jsxs(Le,{children:[e.jsx(K,{variant:"outline",onClick:()=>l(!1),children:a("generate.form.cancel")}),e.jsx(K,{onClick:()=>n.handleSubmit(async c=>{if(c.download_csv){const u=await _s.generate(c);if(u&&u instanceof Blob){const i=window.URL.createObjectURL(u),d=document.createElement("a");d.href=i,d.download=`users_${new Date().getTime()}.csv`,document.body.appendChild(d),d.click(),d.remove(),window.URL.revokeObjectURL(i),$.success(a("generate.form.success")),n.reset(),s(),l(!1)}}else{const{data:u}=await _s.generate(c);u&&($.success(a("generate.form.success")),n.reset(),s(),l(!1))}})(),children:a("generate.form.submit")})]})]})]})}const Xr=fl,hh=jl,ph=vl,Zr=m.forwardRef(({className:s,...a},t)=>e.jsx(Ca,{className:y("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",s),...a,ref:t}));Zr.displayName=Ca.displayName;const gh=tt("fixed overflow-y-scroll z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out",{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-md",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-md"}},defaultVariants:{side:"right"}}),Ln=m.forwardRef(({side:s="right",className:a,children:t,...l},n)=>e.jsxs(ph,{children:[e.jsx(Zr,{}),e.jsxs(Sa,{ref:n,className:y(gh({side:s}),a),...l,children:[e.jsxs(hn,{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:[e.jsx(ds,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]}),t]})]}));Ln.displayName=Sa.displayName;const En=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col space-y-2 text-center sm:text-left",s),...a});En.displayName="SheetHeader";const ei=({className:s,...a})=>e.jsx("div",{className:y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a});ei.displayName="SheetFooter";const In=m.forwardRef(({className:s,...a},t)=>e.jsx(ka,{ref:t,className:y("text-lg font-semibold text-foreground",s),...a}));In.displayName=ka.displayName;const Rn=m.forwardRef(({className:s,...a},t)=>e.jsx(Ta,{ref:t,className:y("text-sm text-muted-foreground",s),...a}));Rn.displayName=Ta.displayName;function fh({table:s,refetch:a,permissionGroups:t=[],subscriptionPlans:l=[]}){const{t:n}=V("user"),{toast:r}=Qr(),o=s.getState().columnFilters.length>0,[c,u]=m.useState([]),[i,d]=m.useState(!1),[h,k]=m.useState(!1),[C,S]=m.useState(!1),[w,N]=m.useState(!1),g=async()=>{try{const ee=await _s.dumpCSV({filter:s.getState().columnFilters,sort:s.getState().sorting[0]?.id,sort_type:s.getState().sorting[0]?.desc?"DESC":"ASC"}),te=ee;console.log(ee);const q=new Blob([te],{type:"text/csv;charset=utf-8;"}),R=window.URL.createObjectURL(q),X=document.createElement("a");X.href=R,X.setAttribute("download",`users_${new Date().toISOString()}.csv`),document.body.appendChild(X),X.click(),X.remove(),window.URL.revokeObjectURL(R),r({title:n("messages.success"),description:n("messages.export.success")})}catch{r({title:n("messages.error"),description:n("messages.export.failed"),variant:"destructive"})}},T=async()=>{try{N(!0),await _s.batchBan({filter:s.getState().columnFilters,sort:s.getState().sorting[0]?.id,sort_type:s.getState().sorting[0]?.desc?"DESC":"ASC"}),r({title:n("messages.success"),description:n("messages.batch_ban.success")}),a()}catch{r({title:n("messages.error"),description:n("messages.batch_ban.failed"),variant:"destructive"})}finally{N(!1),S(!1)}},E=[{label:n("filter.fields.email"),value:"email",type:"text",operators:[{label:n("filter.operators.contains"),value:"contains"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.id"),value:"id",type:"number",operators:[{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.plan_id"),value:"plan_id",type:"select",operators:[{label:n("filter.operators.eq"),value:"eq"}],useOptions:!0},{label:n("filter.fields.transfer_enable"),value:"transfer_enable",type:"number",unit:"GB",operators:[{label:n("filter.operators.gt"),value:"gt"},{label:n("filter.operators.lt"),value:"lt"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.total_used"),value:"total_used",type:"number",unit:"GB",operators:[{label:n("filter.operators.gt"),value:"gt"},{label:n("filter.operators.lt"),value:"lt"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.online_count"),value:"online_count",type:"number",operators:[{label:n("filter.operators.eq"),value:"eq"},{label:n("filter.operators.gt"),value:"gt"},{label:n("filter.operators.lt"),value:"lt"}]},{label:n("filter.fields.expired_at"),value:"expired_at",type:"date",operators:[{label:n("filter.operators.lt"),value:"lt"},{label:n("filter.operators.gt"),value:"gt"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.uuid"),value:"uuid",type:"text",operators:[{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.token"),value:"token",type:"text",operators:[{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.banned"),value:"banned",type:"select",operators:[{label:n("filter.operators.eq"),value:"eq"}],options:[{label:n("filter.status.normal"),value:"0"},{label:n("filter.status.banned"),value:"1"}]},{label:n("filter.fields.remark"),value:"remarks",type:"text",operators:[{label:n("filter.operators.contains"),value:"contains"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.inviter_email"),value:"invite_user.email",type:"text",operators:[{label:n("filter.operators.contains"),value:"contains"},{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.invite_user_id"),value:"invite_user_id",type:"number",operators:[{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.is_admin"),value:"is_admin",type:"boolean",operators:[{label:n("filter.operators.eq"),value:"eq"}]},{label:n("filter.fields.is_staff"),value:"is_staff",type:"boolean",operators:[{label:n("filter.operators.eq"),value:"eq"}]}],p=ee=>ee*1024*1024*1024,_=ee=>ee/(1024*1024*1024),I=()=>{u([...c,{field:"",operator:"",value:""}])},H=ee=>{u(c.filter((te,q)=>q!==ee))},O=(ee,te,q)=>{const R=[...c];if(R[ee]={...R[ee],[te]:q},te==="field"){const X=E.find(ms=>ms.value===q);X&&(R[ee].operator=X.operators[0].value,R[ee].value=X.type==="boolean"?!1:"")}u(R)},B=(ee,te)=>{const q=E.find(R=>R.value===ee.field);if(!q)return null;switch(q.type){case"text":return e.jsx(D,{placeholder:n("filter.sheet.value"),value:ee.value,onChange:R=>O(te,"value",R.target.value)});case"number":return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(D,{type:"number",placeholder:n("filter.sheet.value_number",{unit:q.unit}),value:q.unit==="GB"?_(ee.value||0):ee.value,onChange:R=>{const X=Number(R.target.value);O(te,"value",q.unit==="GB"?p(X):X)}}),q.unit&&e.jsx("span",{className:"text-sm text-muted-foreground",children:q.unit})]});case"date":return e.jsx(ct,{mode:"single",selected:ee.value,onSelect:R=>O(te,"value",R),className:"flex flex-1 justify-center rounded-md border"});case"select":return e.jsxs(J,{value:ee.value,onValueChange:R=>O(te,"value",R),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("filter.sheet.value")})}),e.jsx(Y,{children:q.useOptions?l.map(R=>e.jsx(A,{value:R.value.toString(),children:R.label},R.value)):q.options?.map(R=>e.jsx(A,{value:R.value.toString(),children:R.label},R.value))})]});case"boolean":return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Z,{checked:ee.value,onCheckedChange:R=>O(te,"value",R)}),e.jsx(Xs,{children:ee.value?n("filter.boolean.true"):n("filter.boolean.false")})]});default:return null}},ue=()=>{const ee=c.filter(te=>te.field&&te.operator&&te.value!=="").map(te=>{const q=E.find(X=>X.value===te.field);let R=te.value;return te.operator==="contains"?{id:te.field,value:R}:(q?.type==="date"&&R instanceof Date&&(R=Math.floor(R.getTime()/1e3)),q?.type==="boolean"&&(R=R?1:0),{id:te.field,value:`${te.operator}:${R}`})});s.setColumnFilters(ee),d(!1)};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[e.jsx(xh,{refetch:a}),e.jsx(D,{placeholder:n("filter.email_search"),value:s.getColumn("email")?.getFilterValue()??"",onChange:ee=>s.getColumn("email")?.setFilterValue(ee.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs(Xr,{open:i,onOpenChange:d,children:[e.jsx(hh,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Yc,{className:"mr-2 h-4 w-4"}),n("filter.advanced"),c.length>0&&e.jsx(G,{variant:"secondary",className:"ml-2 rounded-sm px-1",children:c.length})]})}),e.jsxs(Ln,{className:"w-[400px] sm:w-[540px]",children:[e.jsxs(En,{children:[e.jsx(In,{children:n("filter.sheet.title")}),e.jsx(Rn,{children:n("filter.sheet.description")})]}),e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-medium",children:n("filter.sheet.conditions")}),e.jsx(L,{variant:"outline",size:"sm",onClick:I,children:n("filter.sheet.add")})]}),e.jsx(_t,{className:"h-[calc(100vh-280px)] ",children:e.jsx("div",{className:"space-y-4",children:c.map((ee,te)=>e.jsxs("div",{className:"space-y-3 rounded-lg border p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Xs,{children:n("filter.sheet.condition",{number:te+1})}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>H(te),children:e.jsx(ds,{className:"h-4 w-4"})})]}),e.jsxs(J,{value:ee.field,onValueChange:q=>O(te,"field",q),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("filter.sheet.field")})}),e.jsx(Y,{children:e.jsx(Be,{children:E.map(q=>e.jsx(A,{value:q.value,className:"cursor-pointer",children:q.label},q.value))})})]}),ee.field&&e.jsxs(J,{value:ee.operator,onValueChange:q=>O(te,"operator",q),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:n("filter.sheet.operator")})}),e.jsx(Y,{children:E.find(q=>q.value===ee.field)?.operators.map(q=>e.jsx(A,{value:q.value,children:q.label},q.value))})]}),ee.field&&ee.operator&&B(ee,te)]},te))})}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(L,{variant:"outline",onClick:()=>{u([]),d(!1)},children:n("filter.sheet.reset")}),e.jsx(L,{onClick:ue,children:n("filter.sheet.apply")})]})]})]})]}),o&&e.jsxs(L,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),u([])},className:"h-8 px-2 lg:px-3",children:[n("filter.sheet.reset"),e.jsx(ds,{className:"ml-2 h-4 w-4"})]}),e.jsxs(Es,{modal:!1,children:[e.jsx(Is,{asChild:!0,children:e.jsx(L,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:n("actions.title")})}),e.jsxs(ws,{children:[e.jsx(_e,{onClick:()=>k(!0),children:n("actions.send_email")}),e.jsx(_e,{onClick:g,children:n("actions.export_csv")}),e.jsx(Nt,{}),e.jsx(_e,{onClick:()=>S(!0),className:"text-red-600 focus:text-red-600",children:n("actions.batch_ban")})]})]})]}),e.jsx(dh,{open:h,onOpenChange:k,table:s}),e.jsx(kn,{open:C,onOpenChange:S,children:e.jsxs(Va,{children:[e.jsxs(Fa,{children:[e.jsx(Oa,{children:n("actions.confirm_ban.title")}),e.jsx(za,{children:n(o?"actions.confirm_ban.filtered_description":"actions.confirm_ban.all_description")})]}),e.jsxs(Ma,{children:[e.jsx(Aa,{disabled:w,children:n("actions.confirm_ban.cancel")}),e.jsx($a,{onClick:T,disabled:w,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:n(w?"actions.confirm_ban.banning":"actions.confirm_ban.confirm")})]})]})})]})}const si=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m17.71 11.29l-5-5a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21l-5 5a1 1 0 0 0 1.42 1.42L11 9.41V17a1 1 0 0 0 2 0V9.41l3.29 3.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42"})}),ti=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17.71 11.29a1 1 0 0 0-1.42 0L13 14.59V7a1 1 0 0 0-2 0v7.59l-3.29-3.3a1 1 0 0 0-1.42 1.42l5 5a1 1 0 0 0 .33.21a.94.94 0 0 0 .76 0a1 1 0 0 0 .33-.21l5-5a1 1 0 0 0 0-1.42"})}),jh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17 11H9.41l3.3-3.29a1 1 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33a1 1 0 0 0 0 .76a1 1 0 0 0 .21.33l5 5a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42L9.41 13H17a1 1 0 0 0 0-2"})}),vh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M17.92 11.62a1 1 0 0 0-.21-.33l-5-5a1 1 0 0 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l5-5a1 1 0 0 0 .21-.33a1 1 0 0 0 0-.76"})}),sn=[{accessorKey:"record_at",header:"时间",cell:({row:s})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("time",{className:"text-sm text-muted-foreground",children:xd(s.original.record_at)})})},{accessorKey:"u",header:"上行流量",cell:({row:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(si,{className:"h-4 w-4 text-emerald-500"}),e.jsx("span",{className:"font-mono text-sm",children:Oe(s.original.u/parseFloat(s.original.server_rate))})]})},{accessorKey:"d",header:"下行流量",cell:({row:s})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ti,{className:"h-4 w-4 text-blue-500"}),e.jsx("span",{className:"font-mono text-sm",children:Oe(s.original.d/parseFloat(s.original.server_rate))})]})},{accessorKey:"server_rate",header:"倍率",cell:({row:s})=>{const a=s.original.server_rate;return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(G,{variant:"outline",className:"font-mono",children:[a,"x"]})})}},{id:"total",header:"总计",cell:({row:s})=>{const a=s.original.u+s.original.d;return e.jsx("div",{className:"flex items-center justify-end font-mono text-sm",children:Oe(a)})}}];function ai({user_id:s,dialogTrigger:a}){const{t}=V(["traffic"]),[l,n]=m.useState(!1),[r,o]=m.useState({pageIndex:0,pageSize:20}),{data:c,isLoading:u}=le({queryKey:["userStats",s,r,l],queryFn:()=>l?_s.getStats({user_id:s,pageSize:r.pageSize,page:r.pageIndex+1}):null}),i=Je({data:c?.data??[],columns:sn,pageCount:Math.ceil((c?.total??0)/r.pageSize),state:{pagination:r},manualPagination:!0,getCoreRowModel:Qe(),onPaginationChange:o});return e.jsxs(ge,{open:l,onOpenChange:n,children:[e.jsx(is,{asChild:!0,children:a}),e.jsxs(pe,{className:"sm:max-w-[700px]",children:[e.jsx(ve,{children:e.jsx(fe,{children:t("trafficRecord.title")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-md border",children:e.jsxs(Nn,{children:[e.jsx(_n,{children:i.getHeaderGroups().map(d=>e.jsx(As,{children:d.headers.map(h=>e.jsx(Cn,{className:y("h-10 px-2 text-xs",h.id==="total"&&"text-right"),children:h.isPlaceholder?null:ga(h.column.columnDef.header,h.getContext())},h.id))},d.id))}),e.jsx(wn,{children:u?Array.from({length:r.pageSize}).map((d,h)=>e.jsx(As,{children:Array.from({length:sn.length}).map((k,C)=>e.jsx(vt,{className:"p-2",children:e.jsx(he,{className:"h-6 w-full"})},C))},h)):i.getRowModel().rows?.length?i.getRowModel().rows.map(d=>e.jsx(As,{"data-state":d.getIsSelected()&&"selected",className:"h-10",children:d.getVisibleCells().map(h=>e.jsx(vt,{className:"px-2",children:ga(h.column.columnDef.cell,h.getContext())},h.id))},d.id)):e.jsx(As,{children:e.jsx(vt,{colSpan:sn.length,className:"h-24 text-center",children:t("trafficRecord.noRecords")})})})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:t("trafficRecord.perPage")}),e.jsxs(J,{value:`${i.getState().pagination.pageSize}`,onValueChange:d=>{i.setPageSize(Number(d))},children:[e.jsx(W,{className:"h-8 w-[70px]",children:e.jsx(Q,{placeholder:i.getState().pagination.pageSize})}),e.jsx(Y,{side:"top",children:[10,20,30,40,50].map(d=>e.jsx(A,{value:`${d}`,children:d},d))})]}),e.jsx("p",{className:"text-sm font-medium",children:t("trafficRecord.records")})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"flex w-[100px] items-center justify-center text-sm",children:t("trafficRecord.page",{current:i.getState().pagination.pageIndex+1,total:i.getPageCount()})}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(K,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>i.previousPage(),disabled:!i.getCanPreviousPage()||u,children:e.jsx(jh,{className:"h-4 w-4"})}),e.jsx(K,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>i.nextPage(),disabled:!i.getCanNextPage()||u,children:e.jsx(vh,{className:"h-4 w-4"})})]})]})]})]})]})]})}function bh({onConfirm:s,children:a,title:t="确认操作",description:l="确定要执行此操作吗?",cancelText:n="取消",confirmText:r="确认",variant:o="default",className:c}){return e.jsxs(kn,{children:[e.jsx(Or,{asChild:!0,children:a}),e.jsxs(Va,{className:y("sm:max-w-[425px]",c),children:[e.jsxs(Fa,{children:[e.jsx(Oa,{children:t}),e.jsx(za,{children:l})]}),e.jsxs(Ma,{children:[e.jsx(Aa,{asChild:!0,children:e.jsx(L,{variant:"outline",children:n})}),e.jsx($a,{asChild:!0,children:e.jsx(L,{variant:o,onClick:s,children:r})})]})]})]})}const yh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M5 18h4.24a1 1 0 0 0 .71-.29l6.92-6.93L19.71 8a1 1 0 0 0 0-1.42l-4.24-4.29a1 1 0 0 0-1.42 0l-2.82 2.83l-6.94 6.93a1 1 0 0 0-.29.71V17a1 1 0 0 0 1 1m9.76-13.59l2.83 2.83l-1.42 1.42l-2.83-2.83ZM6 13.17l5.93-5.93l2.83 2.83L8.83 16H6ZM21 20H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2"})}),Nh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 11h-6V5a1 1 0 0 0-2 0v6H5a1 1 0 0 0 0 2h6v6a1 1 0 0 0 2 0v-6h6a1 1 0 0 0 0-2"})}),_h=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21 8.94a1.3 1.3 0 0 0-.06-.27v-.09a1 1 0 0 0-.19-.28l-6-6a1 1 0 0 0-.28-.19a.3.3 0 0 0-.09 0a.9.9 0 0 0-.33-.11H10a3 3 0 0 0-3 3v1H6a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3zm-6-3.53L17.59 8H16a1 1 0 0 1-1-1ZM15 19a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h1v7a3 3 0 0 0 3 3h5Zm4-4a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3v3a3 3 0 0 0 3 3h3Z"})}),wh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21 11a1 1 0 0 0-1 1a8.05 8.05 0 1 1-2.22-5.5h-2.4a1 1 0 0 0 0 2h4.53a1 1 0 0 0 1-1V3a1 1 0 0 0-2 0v1.77A10 10 0 1 0 22 12a1 1 0 0 0-1-1"})}),Ch=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M9.5 10.5H12a1 1 0 0 0 0-2h-1V8a1 1 0 0 0-2 0v.55a2.5 2.5 0 0 0 .5 4.95h1a.5.5 0 0 1 0 1H8a1 1 0 0 0 0 2h1v.5a1 1 0 0 0 2 0v-.55a2.5 2.5 0 0 0-.5-4.95h-1a.5.5 0 0 1 0-1M21 12h-3V3a1 1 0 0 0-.5-.87a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0A1 1 0 0 0 2 3v16a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1M5 20a1 1 0 0 1-1-1V4.73l2 1.14a1.08 1.08 0 0 0 1 0l3-1.72l3 1.72a1.08 1.08 0 0 0 1 0l2-1.14V19a3 3 0 0 0 .18 1Zm15-1a1 1 0 0 1-2 0v-5h2Z"})}),Sh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M12.3 12.22A4.92 4.92 0 0 0 14 8.5a5 5 0 0 0-10 0a4.92 4.92 0 0 0 1.7 3.72A8 8 0 0 0 1 19.5a1 1 0 0 0 2 0a6 6 0 0 1 12 0a1 1 0 0 0 2 0a8 8 0 0 0-4.7-7.28M9 11.5a3 3 0 1 1 3-3a3 3 0 0 1-3 3m9.74.32A5 5 0 0 0 15 3.5a1 1 0 0 0 0 2a3 3 0 0 1 3 3a3 3 0 0 1-1.5 2.59a1 1 0 0 0-.5.84a1 1 0 0 0 .45.86l.39.26l.13.07a7 7 0 0 1 4 6.38a1 1 0 0 0 2 0a9 9 0 0 0-4.23-7.68"})}),kh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 0 0-6.88 2.77V3a1 1 0 0 0-2 0v4.5a1 1 0 0 0 1 1h4.5a1 1 0 0 0 0-2h-2.4A8 8 0 1 1 4 12a1 1 0 0 0-2 0A10 10 0 1 0 12 2m0 6a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h2a1 1 0 0 0 0-2h-1V9a1 1 0 0 0-1-1"})}),Th=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M20 6h-4V5a3 3 0 0 0-3-3h-2a3 3 0 0 0-3 3v1H4a1 1 0 0 0 0 2h1v11a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V8h1a1 1 0 0 0 0-2M10 5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1h-4Zm7 14a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V8h10Z"})}),Dh=(s,a,t,l)=>{const{t:n}=V("user");return[{accessorKey:"is_admin",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.is_admin")}),enableSorting:!1,enableHiding:!0,filterFn:(r,o,c)=>c.includes(r.getValue(o)),size:0},{accessorKey:"is_staff",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.is_staff")}),enableSorting:!1,enableHiding:!0,filterFn:(r,o,c)=>c.includes(r.getValue(o)),size:0},{accessorKey:"id",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.id")}),cell:({row:r})=>e.jsx(G,{variant:"outline",children:r.original.id}),enableSorting:!0,enableHiding:!1},{accessorKey:"email",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.email")}),cell:({row:r})=>{const o=r.original.t||0,c=Date.now()/1e3-o<120,u=Math.floor(Date.now()/1e3-o);let i=c?n("columns.online_status.online"):o===0?n("columns.online_status.never"):n("columns.online_status.last_online",{time:Se(o)});if(!c&&o!==0){const d=Math.floor(u/60),h=Math.floor(d/60),k=Math.floor(h/24);k>0?i+=` `+n("columns.online_status.offline_duration.days",{count:k}):h>0?i+=` `+n("columns.online_status.offline_duration.hours",{count:h}):d>0?i+=` `+n("columns.online_status.offline_duration.minutes",{count:d}):i+=` -`+n("columns.online_status.offline_duration.seconds",{count:u})}return e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:y("size-2.5 rounded-full ring-2 ring-offset-2",c?"bg-green-500 ring-green-500/20":"bg-gray-300 ring-gray-300/20","transition-all duration-300")}),e.jsx("span",{className:"font-medium text-foreground/90",children:r.original.email})]})}),e.jsx(xe,{side:"bottom",className:"max-w-[280px]",children:e.jsx("p",{className:"whitespace-pre-line text-sm",children:i})})]})})},enableSorting:!1,enableHiding:!1},{accessorKey:"online_count",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.online_count")}),cell:({row:r})=>{const o=r.original.device_limit,c=r.original.online_count||0;return e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{children:e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs(G,{variant:"outline",className:y("min-w-[4rem] justify-center",o!==null&&c>=o?"border-destructive/50 bg-destructive/10 text-destructive":"border-primary/40 bg-primary/5 text-primary/90"),children:[c," / ",o===null?"∞":o]})})}),e.jsx(xe,{side:"bottom",children:e.jsx("p",{className:"text-sm",children:o===null?n("columns.device_limit.unlimited"):n("columns.device_limit.limited",{count:o})})})]})})},enableSorting:!0,enableHiding:!1},{accessorKey:"banned",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.status")}),cell:({row:r})=>{const o=r.original.banned;return e.jsx("div",{className:"flex justify-center",children:e.jsx(G,{className:y("min-w-20 justify-center transition-colors",o?"bg-destructive/15 text-destructive hover:bg-destructive/25":"bg-success/15 text-success hover:bg-success/25"),children:n(o?"columns.status_text.banned":"columns.status_text.normal")})})},enableSorting:!0,filterFn:(r,o,c)=>c.includes(r.getValue(o))},{accessorKey:"plan_id",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.subscription")}),cell:({row:r})=>e.jsx("div",{className:"min-w-[10em] break-all",children:r.original?.plan?.name||"-"}),enableSorting:!1,enableHiding:!1},{accessorKey:"group_id",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.group")}),cell:({row:r})=>e.jsx("div",{className:"flex flex-wrap gap-1",children:e.jsx(G,{variant:"outline",className:y("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5 whitespace-nowrap"),children:r.original?.group?.name||"-"})}),enableSorting:!1},{accessorKey:"total_used",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.used_traffic")}),cell:({row:r})=>{const o=Oe(r.original?.total_used),c=Oe(r.original?.transfer_enable),u=r.original?.total_used/r.original?.transfer_enable*100||0;return e.jsx(ye,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(fe,{className:"w-full",children:e.jsxs("div",{className:"w-full space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:o}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.toFixed(1),"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-secondary",children:e.jsx("div",{className:y("h-full rounded-full transition-all",u>90?"bg-destructive":"bg-primary"),style:{width:`${Math.min(u,100)}%`}})})]})}),e.jsx(xe,{side:"bottom",children:e.jsxs("p",{className:"text-sm",children:[n("columns.total_traffic"),": ",c]})})]})})}},{accessorKey:"transfer_enable",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.total_traffic")}),cell:({row:r})=>e.jsx("div",{className:"font-medium text-muted-foreground",children:Oe(r.original?.transfer_enable)})},{accessorKey:"expired_at",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.expire_time")}),cell:({row:r})=>{const o=r.original.expired_at,c=Date.now()/1e3,u=o!=null&&oe.jsx(z,{column:r,title:n("columns.balance")}),cell:({row:r})=>{const o=gt(r.original?.balance);return e.jsxs("div",{className:"flex items-center gap-1 font-medium",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"¥"}),e.jsx("span",{className:"tabular-nums text-foreground",children:o})]})}},{accessorKey:"commission_balance",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.commission")}),cell:({row:r})=>{const o=gt(r.original?.commission_balance);return e.jsxs("div",{className:"flex items-center gap-1 font-medium",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"¥"}),e.jsx("span",{className:"tabular-nums text-foreground",children:o})]})}},{accessorKey:"created_at",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.register_time")}),cell:({row:r})=>e.jsx("div",{className:"truncate",children:Se(r.original?.created_at)}),size:1e3},{id:"actions",header:({column:r})=>e.jsx(z,{column:r,className:"justify-end",title:n("columns.actions")}),cell:({row:r,table:o})=>e.jsxs(Es,{modal:!0,children:[e.jsx(Is,{asChild:!0,children:e.jsx("div",{className:"text-center",children:e.jsx(K,{variant:"ghost",className:"h-8 w-8 p-0 hover:bg-muted","aria-label":n("columns.actions"),children:e.jsx(va,{className:"size-4"})})})}),e.jsxs(ws,{align:"end",className:"min-w-[40px]",children:[e.jsx(_e,{onSelect:c=>{c.preventDefault(),t(r.original),l(!0)},className:"p-0",children:e.jsxs(K,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(bh,{className:"mr-2"}),n("columns.actions_menu.edit")]})}),e.jsx(_e,{onSelect:c=>c.preventDefault(),className:"p-0",children:e.jsx(Wr,{defaultValues:{email:r.original.email},trigger:e.jsxs(K,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(yh,{className:"mr-2 "}),n("columns.actions_menu.assign_order")]})})}),e.jsx(_e,{onSelect:()=>{ba(r.original.subscribe_url).then(()=>{$.success(n("common:copy.success"))})},className:"p-0",children:e.jsxs(K,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(Nh,{className:"mr-2"}),n("columns.actions_menu.copy_url")]})}),e.jsx(_e,{onSelect:()=>{_s.resetSecret(r.original.id).then(({data:c})=>{c&&$.success("重置成功")})},children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(_h,{className:"mr-2 "}),n("columns.actions_menu.reset_secret")]})}),e.jsx(_e,{onSelect:()=>{},className:"p-0",children:e.jsxs(nt,{className:"flex items-center px-2 py-1.5",to:`/finance/order?user_id=eq:${r.original?.id}`,children:[e.jsx(wh,{className:"mr-2"}),n("columns.actions_menu.orders")]})}),e.jsx(_e,{onSelect:()=>{o.setColumnFilters([{id:"invite_user_id",value:"eq:"+r.original?.id}])},children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(Ch,{className:"mr-2 "}),n("columns.actions_menu.invites")]})}),e.jsx(_e,{onSelect:c=>c.preventDefault(),className:"p-0",children:e.jsx(ai,{user_id:r.original?.id,dialogTrigger:e.jsxs(K,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(Sh,{className:"mr-2 "}),n("columns.actions_menu.traffic_records")]})})}),e.jsx(_e,{onSelect:c=>c.preventDefault(),className:"p-0",children:e.jsx(vh,{title:n("columns.actions_menu.delete_confirm_title"),description:n("columns.actions_menu.delete_confirm_description",{email:r.original.email}),cancelText:n("common:cancel"),confirmText:n("common:confirm"),variant:"destructive",onConfirm:async()=>{try{const{data:c}=await _s.destroy(r.original.id);c&&($.success(n("common:delete.success")),s())}catch{$.error(n("common:delete.failed"))}},children:e.jsxs(K,{variant:"ghost",className:"w-full justify-start px-2 py-1.5 text-destructive hover:text-destructive",children:[e.jsx(kh,{className:"mr-2"}),n("columns.actions_menu.delete")]})})})]})]})}]},ni=m.createContext(void 0),Vn=()=>{const s=m.useContext(ni);if(!s)throw new Error("useUserEdit must be used within an UserEditProvider");return s},li=({children:s,refreshData:a})=>{const[t,l]=m.useState(!1),[n,r]=m.useState(null),o={isOpen:t,setIsOpen:l,editingUser:n,setEditingUser:r,refreshData:a};return e.jsx(ni.Provider,{value:o,children:s})},Dh=x.object({id:x.number(),email:x.string().email(),invite_user_email:x.string().email().nullable().optional(),password:x.string().optional().nullable(),balance:x.coerce.number(),commission_balance:x.coerce.number(),u:x.number(),d:x.number(),transfer_enable:x.number(),expired_at:x.number().nullable(),plan_id:x.number().nullable(),banned:x.number(),commission_type:x.number(),commission_rate:x.number().nullable(),discount:x.number().nullable(),speed_limit:x.number().nullable(),device_limit:x.number().nullable(),is_admin:x.number(),is_staff:x.number(),remarks:x.string().nullable()});function ri(){const{t:s}=V("user"),{isOpen:a,setIsOpen:t,editingUser:l,refreshData:n}=Vn(),[r,o]=m.useState(!1),[c,u]=m.useState([]),i=Ne({resolver:we(Dh),defaultValues:{id:0,email:"",invite_user_email:null,password:null,balance:0,commission_balance:0,u:0,d:0,transfer_enable:0,expired_at:null,plan_id:null,banned:0,commission_type:0,commission_rate:null,discount:null,speed_limit:null,device_limit:null,is_admin:0,is_staff:0,remarks:null}});return m.useEffect(()=>{a&&ss.getList().then(({data:d})=>{u(d)})},[a]),m.useEffect(()=>{if(l){const d=l.invite_user?.email,{invite_user:h,...k}=l;i.reset({...k,invite_user_email:d||null,password:null})}},[l,i]),e.jsx(Xr,{open:a,onOpenChange:t,children:e.jsxs(Ln,{className:"max-w-[90%] space-y-4",children:[e.jsxs(En,{children:[e.jsx(In,{children:s("edit.title")}),e.jsx(Rn,{})]}),e.jsxs(Ce,{...i,children:[e.jsx(v,{control:i.control,name:"email",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.email")}),e.jsx(b,{children:e.jsx(D,{...d,placeholder:s("edit.form.email_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(P,{...d})]})}),e.jsx(v,{control:i.control,name:"invite_user_email",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.inviter_email")}),e.jsx(b,{children:e.jsx(D,{value:d.value||"",onChange:h=>d.onChange(h.target.value?h.target.value:null),placeholder:s("edit.form.inviter_email_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(P,{...d})]})}),e.jsx(v,{control:i.control,name:"password",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.password")}),e.jsx(b,{children:e.jsx(D,{type:"password",value:d.value||"",onChange:d.onChange,placeholder:s("edit.form.password_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(P,{...d})]})}),e.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[e.jsx(v,{control:i.control,name:"balance",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.balance")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:d.onChange,placeholder:s("edit.form.balance_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"¥"})]})}),e.jsx(P,{...d})]})}),e.jsx(v,{control:i.control,name:"commission_balance",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.commission_balance")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:d.onChange,placeholder:s("edit.form.commission_balance_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"¥"})]})}),e.jsx(P,{...d})]})}),e.jsx(v,{control:i.control,name:"u",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.upload")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{value:d.value/1024/1024/1024||"",onChange:h=>d.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.upload_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(P,{...d})]})}),e.jsx(v,{control:i.control,name:"d",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.download")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value/1024/1024/1024||"",onChange:h=>d.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.download_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(P,{...d})]})})]}),e.jsx(v,{control:i.control,name:"transfer_enable",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.total_traffic")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value/1024/1024/1024||"",onChange:h=>d.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.total_traffic_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(P,{})]})}),e.jsx(v,{control:i.control,name:"expired_at",render:({field:d})=>e.jsxs(f,{className:"flex flex-col",children:[e.jsx(j,{children:s("edit.form.expire_time")}),e.jsxs(Cs,{open:r,onOpenChange:o,children:[e.jsx(Ss,{asChild:!0,children:e.jsx(b,{children:e.jsxs(L,{type:"button",variant:"outline",className:y("w-full pl-3 text-left font-normal",!d.value&&"text-muted-foreground"),onClick:()=>o(!0),children:[d.value?Se(d.value):e.jsx("span",{children:s("edit.form.expire_time_placeholder")}),e.jsx(Ct,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsx(bs,{className:"w-auto p-0",align:"start",side:"top",sideOffset:4,onInteractOutside:h=>{h.preventDefault()},onEscapeKeyDown:h=>{h.preventDefault()},children:e.jsxs("div",{className:"flex flex-col space-y-3 p-3",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{d.onChange(null),o(!1)},children:s("edit.form.expire_time_permanent")}),e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{const h=new Date;h.setMonth(h.getMonth()+1),h.setHours(23,59,59,999),d.onChange(Math.floor(h.getTime()/1e3)),o(!1)},children:s("edit.form.expire_time_1month")}),e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{const h=new Date;h.setMonth(h.getMonth()+3),h.setHours(23,59,59,999),d.onChange(Math.floor(h.getTime()/1e3)),o(!1)},children:s("edit.form.expire_time_3months")})]}),e.jsx("div",{className:"rounded-md border",children:e.jsx(ct,{mode:"single",selected:d.value?new Date(d.value*1e3):void 0,onSelect:h=>{if(h){const k=new Date(d.value?d.value*1e3:Date.now());h.setHours(k.getHours(),k.getMinutes(),k.getSeconds()),d.onChange(Math.floor(h.getTime()/1e3))}},disabled:h=>h{const h=new Date;h.setHours(23,59,59,999),d.onChange(Math.floor(h.getTime()/1e3))},className:"h-6 px-2 text-xs",children:s("edit.form.expire_time_today")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(D,{type:"datetime-local",step:"1",value:Se(d.value,"YYYY-MM-DDTHH:mm:ss"),onChange:h=>{const k=new Date(h.target.value);isNaN(k.getTime())||d.onChange(Math.floor(k.getTime()/1e3))},className:"flex-1"}),e.jsx(L,{type:"button",variant:"outline",onClick:()=>o(!1),children:s("edit.form.expire_time_confirm")})]})]})]})})]}),e.jsx(P,{})]})}),e.jsx(v,{control:i.control,name:"plan_id",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.subscription")}),e.jsx(b,{children:e.jsxs(J,{value:d.value!==null?String(d.value):"null",onValueChange:h=>d.onChange(h==="null"?null:parseInt(h)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("edit.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"null",children:s("edit.form.subscription_none")}),c.map(h=>e.jsx(A,{value:String(h.id),children:h.name},h.id))]})]})})]})}),e.jsx(v,{control:i.control,name:"banned",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.account_status")}),e.jsx(b,{children:e.jsxs(J,{value:d.value.toString(),onValueChange:h=>d.onChange(parseInt(h)),children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx(A,{value:"1",children:s("columns.status_text.banned")}),e.jsx(A,{value:"0",children:s("columns.status_text.normal")})]})]})})]})}),e.jsx(v,{control:i.control,name:"commission_type",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.commission_type")}),e.jsx(b,{children:e.jsxs(J,{value:d.value.toString(),onValueChange:h=>d.onChange(parseInt(h)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("edit.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("edit.form.commission_type_system")}),e.jsx(A,{value:"1",children:s("edit.form.commission_type_cycle")}),e.jsx(A,{value:"2",children:s("edit.form.commission_type_onetime")})]})]})})]})}),e.jsx(v,{control:i.control,name:"commission_rate",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.commission_rate")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:h=>d.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.commission_rate_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"%"})]})})]})}),e.jsx(v,{control:i.control,name:"discount",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.discount")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:h=>d.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.discount_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"%"})]})}),e.jsx(P,{})]})}),e.jsx(v,{control:i.control,name:"speed_limit",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.speed_limit")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:h=>d.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.speed_limit_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"Mbps"})]})}),e.jsx(P,{})]})}),e.jsx(v,{control:i.control,name:"device_limit",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.device_limit")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:h=>d.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.device_limit_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"台"})]})}),e.jsx(P,{})]})}),e.jsx(v,{control:i.control,name:"is_admin",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.is_admin")}),e.jsx("div",{className:"py-2",children:e.jsx(b,{children:e.jsx(Z,{checked:d.value===1,onCheckedChange:h=>d.onChange(h?1:0)})})})]})}),e.jsx(v,{control:i.control,name:"is_staff",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.is_staff")}),e.jsx("div",{className:"py-2",children:e.jsx(b,{children:e.jsx(Z,{checked:d.value===1,onCheckedChange:h=>d.onChange(h?1:0)})})})]})}),e.jsx(v,{control:i.control,name:"remarks",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.remarks")}),e.jsx(b,{children:e.jsx(ks,{className:"h-24",value:d.value||"",onChange:h=>d.onChange(h.currentTarget.value??null),placeholder:s("edit.form.remarks_placeholder")})}),e.jsx(P,{})]})}),e.jsxs(ei,{children:[e.jsx(L,{variant:"outline",onClick:()=>t(!1),children:s("edit.form.cancel")}),e.jsx(L,{type:"submit",onClick:()=>{i.handleSubmit(d=>{_s.update(d).then(({data:h})=>{h&&($.success(s("edit.form.success")),t(!1),n())})})()},children:s("edit.form.submit")})]})]})]})})}function Ph(){const[s]=ur(),[a,t]=m.useState({}),[l,n]=m.useState({is_admin:!1,is_staff:!1}),[r,o]=m.useState([]),[c,u]=m.useState([]),[i,d]=m.useState({pageIndex:0,pageSize:20});m.useEffect(()=>{const p=s.get("email");p&&o(_=>_.some(H=>H.id==="email")?_:[..._,{id:"email",value:p}])},[s]);const{refetch:h,data:k,isLoading:C}=le({queryKey:["userList",i,r,c],queryFn:()=>_s.getList({pageSize:i.pageSize,current:i.pageIndex+1,filter:r,sort:c})}),[S,w]=m.useState([]),[N,g]=m.useState([]);m.useEffect(()=>{rt.getList().then(({data:p})=>{w(p)}),ss.getList().then(({data:p})=>{g(p)})},[]);const T=S.map(p=>({label:p.name,value:p.id})),E=N.map(p=>({label:p.name,value:p.id}));return e.jsxs(li,{refreshData:h,children:[e.jsx(Lh,{data:k?.data??[],rowCount:k?.total??0,sorting:c,setSorting:u,columnVisibility:l,setColumnVisibility:n,rowSelection:a,setRowSelection:t,columnFilters:r,setColumnFilters:o,pagination:i,setPagination:d,refetch:h,serverGroupList:S,permissionGroups:T,subscriptionPlans:E}),e.jsx(ri,{})]})}function Lh({data:s,rowCount:a,sorting:t,setSorting:l,columnVisibility:n,setColumnVisibility:r,rowSelection:o,setRowSelection:c,columnFilters:u,setColumnFilters:i,pagination:d,setPagination:h,refetch:k,serverGroupList:C,permissionGroups:S,subscriptionPlans:w}){const{setIsOpen:N,setEditingUser:g}=Vn(),T=Je({data:s,columns:Th(k,C,g,N),state:{sorting:t,columnVisibility:n,rowSelection:o,columnFilters:u,pagination:d},rowCount:a,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:c,onSortingChange:l,onColumnFiltersChange:i,onColumnVisibilityChange:r,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),onPaginationChange:h,getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnVisibility:{commission_balance:!1,created_at:!1,is_admin:!1,is_staff:!1,permission_group:!1,plan_id:!1},columnPinning:{right:["actions"]}}});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(gh,{table:T,refetch:k,serverGroupList:C,permissionGroups:S,subscriptionPlans:w}),e.jsx(os,{table:T})]})}function Eh(){const{t:s}=V("user");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("manage.title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("manage.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx("div",{className:"w-full",children:e.jsx(Ph,{})})})]})]})}const Ih=Object.freeze(Object.defineProperty({__proto__:null,default:Eh},Symbol.toStringTag,{value:"Module"}));function Rh({column:s,title:a,options:t}){const l=new Set(s?.getFilterValue());return e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(K,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Yc,{className:"mr-2 h-4 w-4"}),a,l?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:l.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:l.size>2?e.jsxs(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[l.size," selected"]}):t.filter(n=>l.has(n.value)).map(n=>e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:n.label},`selected-${n.value}`))})]})]})}),e.jsx(bs,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Us,{children:[e.jsx(it,{placeholder:a}),e.jsxs(Ks,{children:[e.jsx(ot,{children:"No results found."}),e.jsx(ns,{children:t.map(n=>{const r=l.has(n.value);return e.jsxs($e,{onSelect:()=>{r?l.delete(n.value):l.add(n.value);const o=Array.from(l);s?.setFilterValue(o.length?o:void 0)},children:[e.jsx("div",{className:y("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",r?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(Jc,{className:y("h-4 w-4")})}),n.icon&&e.jsx(n.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:n.label})]},`option-${n.value}`)})}),l.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{}),e.jsx(ns,{children:e.jsx($e,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const Vh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 11H5a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2"})});function Fh({table:s}){const{t:a}=V("ticket");return e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-4",children:[e.jsx(Yt,{defaultValue:s.getColumn("status")?.getFilterValue(),onValueChange:t=>s.getColumn("status")?.setFilterValue(t),children:e.jsxs(kt,{className:"grid w-full grid-cols-2",children:[e.jsx(es,{value:"0",children:a("status.pending")}),e.jsx(es,{value:"1",children:a("status.closed")})]})}),s.getColumn("level")&&e.jsx(Rh,{column:s.getColumn("level"),title:a("columns.level"),options:[{label:a("level.low"),value:qe.LOW,icon:Vh,color:"gray"},{label:a("level.medium"),value:qe.MIDDLE,icon:si,color:"yellow"},{label:a("level.high"),value:qe.HIGH,icon:ti,color:"red"}]})]})})}function Mh(){return e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"text-foreground",children:[e.jsx("circle",{cx:"4",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{id:"spinner_qFRN",begin:"0;spinner_OcgL.end+0.25s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})}),e.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{begin:"spinner_qFRN.begin+0.1s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})}),e.jsx("circle",{cx:"20",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{id:"spinner_OcgL",begin:"spinner_qFRN.begin+0.2s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})})]})}const Oh=tt("flex gap-2 max-w-[60%] items-end relative group",{variants:{variant:{received:"self-start",sent:"self-end flex-row-reverse"},layout:{default:"",ai:"max-w-full w-full items-center"}},defaultVariants:{variant:"received",layout:"default"}}),ii=m.forwardRef(({className:s,variant:a,layout:t,children:l,...n},r)=>e.jsx("div",{className:y(Oh({variant:a,layout:t,className:s}),"relative group"),ref:r,...n,children:m.Children.map(l,o=>m.isValidElement(o)&&typeof o.type!="string"?m.cloneElement(o,{variant:a,layout:t}):o)}));ii.displayName="ChatBubble";const zh=tt("p-4",{variants:{variant:{received:"bg-secondary text-secondary-foreground rounded-r-lg rounded-tl-lg",sent:"bg-primary text-primary-foreground rounded-l-lg rounded-tr-lg"},layout:{default:"",ai:"border-t w-full rounded-none bg-transparent"}},defaultVariants:{variant:"received",layout:"default"}}),oi=m.forwardRef(({className:s,variant:a,layout:t,isLoading:l=!1,children:n,...r},o)=>e.jsx("div",{className:y(zh({variant:a,layout:t,className:s}),"break-words max-w-full whitespace-pre-wrap"),ref:o,...r,children:l?e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(Mh,{})}):n}));oi.displayName="ChatBubbleMessage";const $h=m.forwardRef(({variant:s,className:a,children:t,...l},n)=>e.jsx("div",{ref:n,className:y("absolute top-1/2 -translate-y-1/2 flex opacity-0 group-hover:opacity-100 transition-opacity duration-200",s==="sent"?"-left-1 -translate-x-full flex-row-reverse":"-right-1 translate-x-full",a),...l,children:t}));$h.displayName="ChatBubbleActionWrapper";const ci=m.forwardRef(({className:s,...a},t)=>e.jsx(ks,{autoComplete:"off",ref:t,name:"message",className:y("max-h-12 px-4 py-3 bg-background text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 w-full rounded-md flex items-center h-16 resize-none",s),...a}));ci.displayName="ChatInput";const di=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29l-4.3 4.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l4.29-4.3l4.29 4.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42Z"})}),mi=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M15.098 12.634L13 11.423V7a1 1 0 0 0-2 0v5a1 1 0 0 0 .5.866l2.598 1.5a1 1 0 1 0 1-1.732M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8.01 8.01 0 0 1-8 8"})}),dl=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m11.29 12l3.54-3.54a1 1 0 0 0 0-1.41a1 1 0 0 0-1.42 0l-4.24 4.24a1 1 0 0 0 0 1.42L13.41 17a1 1 0 0 0 .71.29a1 1 0 0 0 .71-.29a1 1 0 0 0 0-1.41Z"})}),Ah=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})}),qh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M3.71 16.29a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21a1 1 0 0 0-.21.33a1 1 0 0 0 .21 1.09a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21a1 1 0 0 0 .21-1.09a1 1 0 0 0-.21-.33M7 8h14a1 1 0 0 0 0-2H7a1 1 0 0 0 0 2m-3.29 3.29a1 1 0 0 0-1.09-.21a1.2 1.2 0 0 0-.33.21a1 1 0 0 0-.21.33a.94.94 0 0 0 0 .76a1.2 1.2 0 0 0 .21.33a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21a1.2 1.2 0 0 0 .21-.33a.94.94 0 0 0 0-.76a1 1 0 0 0-.21-.33M21 11H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2M3.71 6.29a1 1 0 0 0-.33-.21a1 1 0 0 0-1.09.21a1.2 1.2 0 0 0-.21.33a.94.94 0 0 0 0 .76a1.2 1.2 0 0 0 .21.33a1.2 1.2 0 0 0 .33.21a1 1 0 0 0 1.09-.21a1.2 1.2 0 0 0 .21-.33a.94.94 0 0 0 0-.76a1.2 1.2 0 0 0-.21-.33M21 16H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2"})}),Hh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M9 12H7a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2m-1-2h4a1 1 0 0 0 0-2H8a1 1 0 0 0 0 2m1 6H7a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2m12-4h-3V3a1 1 0 0 0-.5-.87a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0A1 1 0 0 0 2 3v16a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1M5 20a1 1 0 0 1-1-1V4.73l2 1.14a1.08 1.08 0 0 0 1 0l3-1.72l3 1.72a1.08 1.08 0 0 0 1 0l2-1.14V19a3 3 0 0 0 .18 1Zm15-1a1 1 0 0 1-2 0v-5h2Zm-6.44-2.83a.8.8 0 0 0-.18-.09a.6.6 0 0 0-.19-.06a1 1 0 0 0-.9.27A1.05 1.05 0 0 0 12 17a1 1 0 0 0 .07.38a1.2 1.2 0 0 0 .22.33a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21A1 1 0 0 0 14 17a1.05 1.05 0 0 0-.29-.71a2 2 0 0 0-.15-.12m.14-3.88a1 1 0 0 0-1.62.33A1 1 0 0 0 13 14a1 1 0 0 0 1-1a1 1 0 0 0-.08-.38a.9.9 0 0 0-.22-.33"})});function Uh(){return e.jsxs("div",{className:"flex h-full flex-col space-y-4 p-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(me,{className:"h-8 w-3/4"}),e.jsx(me,{className:"h-4 w-1/2"})]}),e.jsx("div",{className:"flex-1 space-y-4",children:[1,2,3].map(s=>e.jsx(me,{className:"h-20 w-2/3"},s))})]})}function Kh(){return e.jsx("div",{className:"space-y-4 p-4",children:[1,2,3,4].map(s=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(me,{className:"h-5 w-4/5"}),e.jsx(me,{className:"h-4 w-2/3"}),e.jsx(me,{className:"h-3 w-1/2"})]},s))})}function Bh({ticket:s,isActive:a,onClick:t}){const{t:l}=V("ticket"),n=r=>{switch(r){case qe.HIGH:return"bg-red-50 text-red-600 border-red-200";case qe.MIDDLE:return"bg-yellow-50 text-yellow-600 border-yellow-200";case qe.LOW:return"bg-green-50 text-green-600 border-green-200";default:return"bg-gray-50 text-gray-600 border-gray-200"}};return e.jsxs("div",{className:y("flex cursor-pointer flex-col border-b p-4 hover:bg-accent/50",a&&"bg-accent"),onClick:t,children:[e.jsxs("div",{className:"flex max-w-[280px] items-center justify-between gap-2",children:[e.jsx("h4",{className:"flex-1 truncate font-medium",children:s.subject}),e.jsx(G,{variant:s.status===Hs.CLOSED?"secondary":"default",className:"shrink-0",children:s.status===Hs.CLOSED?l("status.closed"):l("status.processing")})]}),e.jsx("div",{className:"mt-1 max-w-[280px] truncate text-sm text-muted-foreground",children:s.user?.email}),e.jsxs("div",{className:"mt-2 flex items-center justify-between text-xs",children:[e.jsx("time",{className:"text-muted-foreground",children:Se(s.updated_at)}),e.jsx("div",{className:y("rounded-full border px-2 py-0.5 text-xs font-medium",n(s.level)),children:l(`level.${s.level===qe.LOW?"low":s.level===qe.MIDDLE?"medium":"high"}`)})]})]})}function Gh({ticketId:s,dialogTrigger:a}){const{t}=V("ticket"),l=Rs(),n=m.useRef(null),r=m.useRef(null),[o,c]=m.useState(!1),[u,i]=m.useState(""),[d,h]=m.useState(!1),[k,C]=m.useState(s),[S,w]=m.useState(""),[N,g]=m.useState(!1),{setIsOpen:T,setEditingUser:E}=Vn(),{data:p,isLoading:_,refetch:I}=le({queryKey:["tickets",o],queryFn:()=>o?jt.getList({filter:[{id:"status",value:[Hs.OPENING]}]}):Promise.resolve(null),enabled:o}),{data:H,refetch:O,isLoading:B}=le({queryKey:["ticket",k,o],queryFn:()=>o?jt.getInfo(k):Promise.resolve(null),refetchInterval:o?5e3:!1,retry:3}),ce=H?.data,te=(p?.data||[]).filter(re=>re.subject.toLowerCase().includes(S.toLowerCase())||re.user?.email.toLowerCase().includes(S.toLowerCase())),q=(re="smooth")=>{if(n.current){const{scrollHeight:us,clientHeight:Ts}=n.current;n.current.scrollTo({top:us-Ts,behavior:re})}};m.useEffect(()=>{if(!o)return;const re=requestAnimationFrame(()=>{q("instant"),setTimeout(()=>q(),1e3)});return()=>{cancelAnimationFrame(re)}},[o,ce?.messages]);const R=async()=>{const re=u.trim();!re||d||(h(!0),jt.reply({id:k,message:re}).then(()=>{i(""),O(),q(),setTimeout(()=>{r.current?.focus()},0)}).finally(()=>{h(!1)}))},X=async()=>{jt.close(k).then(()=>{$.success(t("actions.close_success")),O(),I()})},ms=()=>{ce?.user&&l("/finance/order?user_id="+ce.user.id)},Te=ce?.status===Hs.CLOSED;return e.jsxs(he,{open:o,onOpenChange:c,children:[e.jsx(is,{asChild:!0,children:a??e.jsx(K,{variant:"outline",children:t("actions.view_ticket")})}),e.jsxs(ue,{className:"flex h-[90vh] max-w-6xl flex-col gap-0 p-0",children:[e.jsx(pe,{}),e.jsxs("div",{className:"flex h-full",children:[e.jsx(K,{variant:"ghost",size:"icon",className:"absolute left-2 top-2 z-50 md:hidden",onClick:()=>g(!N),children:e.jsx(dl,{className:y("h-4 w-4 transition-transform",!N&&"rotate-180")})}),e.jsxs("div",{className:y("absolute inset-y-0 left-0 z-40 flex flex-col border-r bg-background transition-transform duration-200 ease-in-out md:relative",N?"-translate-x-full":"translate-x-0","w-80 md:w-80 md:translate-x-0"),children:[e.jsxs("div",{className:"space-y-4 border-b p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-semibold",children:t("list.title")}),e.jsx(K,{variant:"ghost",size:"icon",className:"hidden h-8 w-8 md:flex",onClick:()=>g(!N),children:e.jsx(dl,{className:y("h-4 w-4 transition-transform",!N&&"rotate-180")})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ah,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 transform text-muted-foreground"}),e.jsx(D,{placeholder:t("list.search_placeholder"),value:S,onChange:re=>w(re.target.value),className:"pl-8"})]})]}),e.jsx(_t,{className:"flex-1",children:e.jsx("div",{className:"w-full",children:_?e.jsx(Kh,{}):te.length===0?e.jsx("div",{className:"flex h-full items-center justify-center p-4 text-muted-foreground",children:t(S?"list.no_search_results":"list.no_tickets")}):te.map(re=>e.jsx(Bh,{ticket:re,isActive:re.id===k,onClick:()=>{C(re.id),window.innerWidth<768&&g(!0)}},re.id))})})]}),e.jsxs("div",{className:"relative flex flex-1 flex-col",children:[!N&&e.jsx("div",{className:"absolute inset-0 z-30 bg-black/20 md:hidden",onClick:()=>g(!0)}),B?e.jsx(Uh,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col space-y-4 border-b p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("h2",{className:"text-2xl font-semibold",children:ce?.subject}),e.jsx(G,{variant:Te?"secondary":"default",children:t(Te?"status.closed":"status.processing")}),!Te&&e.jsx(ls,{title:t("actions.close_confirm_title"),description:t("actions.close_confirm_description"),confirmText:t("actions.close_confirm_button"),variant:"destructive",onConfirm:X,children:e.jsxs(K,{variant:"ghost",size:"sm",className:"gap-1 text-muted-foreground hover:text-destructive",children:[e.jsx(di,{className:"h-4 w-4"}),t("actions.close_ticket")]})})]}),e.jsxs("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(Wt,{className:"h-4 w-4"}),e.jsx("span",{children:ce?.user?.email})]}),e.jsx(De,{orientation:"vertical",className:"h-4"}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(mi,{className:"h-4 w-4"}),e.jsxs("span",{children:[t("detail.created_at")," ",Se(ce?.created_at)]})]}),e.jsx(De,{orientation:"vertical",className:"h-4"}),e.jsx(G,{variant:"outline",children:ce?.level!=null&&t(`level.${ce.level===qe.LOW?"low":ce.level===qe.MIDDLE?"medium":"high"}`)})]})]}),ce?.user&&e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(K,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.user_info"),onClick:()=>{E(ce.user),T(!0)},children:e.jsx(Wt,{className:"h-4 w-4"})}),e.jsx(ai,{user_id:ce.user.id,dialogTrigger:e.jsx(K,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.traffic_records"),children:e.jsx(qh,{className:"h-4 w-4"})})}),e.jsx(K,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.order_records"),onClick:ms,children:e.jsx(Hh,{className:"h-4 w-4"})})]})]})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx("div",{ref:n,className:"h-full space-y-4 overflow-y-auto p-6",children:ce?.messages?.length===0?e.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:t("detail.no_messages")}):ce?.messages?.map(re=>e.jsx(ii,{variant:re.is_from_admin?"sent":"received",className:re.is_from_admin?"ml-auto":"mr-auto",children:e.jsx(oi,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"whitespace-pre-wrap break-words",children:re.message}),e.jsx("div",{className:"text-right",children:e.jsx("time",{className:"text-[10px] text-muted-foreground",children:Se(re.created_at)})})]})})},re.id))})}),e.jsx("div",{className:"border-t p-4",children:e.jsxs("div",{className:"relative flex items-center space-x-2",children:[e.jsx(ci,{ref:r,disabled:Te||d,placeholder:t(Te?"detail.input.closed_placeholder":"detail.input.reply_placeholder"),className:"flex-1 resize-none rounded-lg border bg-background p-3 focus-visible:ring-1",value:u,onChange:re=>i(re.target.value),onKeyDown:re=>{re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),R())}}),e.jsx(K,{disabled:Te||d||!u.trim(),onClick:R,children:t(d?"detail.input.sending":"detail.input.send")})]})})]})]})]})]})]})}const Wh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 4H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3m-.41 2l-5.88 5.88a1 1 0 0 1-1.42 0L5.41 6ZM20 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7.41l5.88 5.88a3 3 0 0 0 4.24 0L20 7.41Z"})}),Yh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21.92 11.6C19.9 6.91 16.1 4 12 4s-7.9 2.91-9.92 7.6a1 1 0 0 0 0 .8C4.1 17.09 7.9 20 12 20s7.9-2.91 9.92-7.6a1 1 0 0 0 0-.8M12 18c-3.17 0-6.17-2.29-7.9-6C5.83 8.29 8.83 6 12 6s6.17 2.29 7.9 6c-1.73 3.71-4.73 6-7.9 6m0-10a4 4 0 1 0 4 4a4 4 0 0 0-4-4m0 6a2 2 0 1 1 2-2a2 2 0 0 1-2 2"})}),Jh=s=>{const{t:a}=V("ticket");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.id")}),cell:({row:t})=>e.jsx(G,{variant:"outline",children:t.getValue("id")}),enableSorting:!1,enableHiding:!1},{accessorKey:"subject",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.subject")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Wh,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"max-w-[500px] truncate font-medium",children:t.getValue("subject")})]}),enableSorting:!1,enableHiding:!1,size:4e3},{accessorKey:"level",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.level")}),cell:({row:t})=>{const l=t.getValue("level"),n=l===qe.LOW?"default":l===qe.MIDDLE?"secondary":"destructive";return e.jsx(G,{variant:n,className:"whitespace-nowrap",children:a(`level.${l===qe.LOW?"low":l===qe.MIDDLE?"medium":"high"}`)})},filterFn:(t,l,n)=>n.includes(t.getValue(l))},{accessorKey:"status",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.status")}),cell:({row:t})=>{const l=t.getValue("status"),n=t.original.reply_status,r=l===Hs.CLOSED?a("status.closed"):a(n===0?"status.replied":"status.pending"),o=l===Hs.CLOSED?"default":n===0?"secondary":"destructive";return e.jsx(G,{variant:o,className:"whitespace-nowrap",children:r})}},{accessorKey:"updated_at",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.updated_at")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[e.jsx(mi,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:Se(t.getValue("updated_at"))})]}),enableSorting:!0},{accessorKey:"created_at",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.created_at")}),cell:({row:t})=>e.jsx("div",{className:"text-sm text-muted-foreground",children:Se(t.getValue("created_at"))}),enableSorting:!0,meta:{isFlexGrow:!0}},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:a("columns.actions")}),cell:({row:t})=>{const l=t.original.status!==Hs.CLOSED;return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(Gh,{ticketId:t.original.id,dialogTrigger:e.jsx(K,{variant:"ghost",size:"icon",className:"h-8 w-8",title:a("actions.view_details"),children:e.jsx(Yh,{className:"h-4 w-4"})})}),l&&e.jsx(ls,{title:a("actions.close_confirm_title"),description:a("actions.close_confirm_description"),confirmText:a("actions.close_confirm_button"),variant:"destructive",onConfirm:async()=>{jt.close(t.original.id).then(()=>{$.success(a("actions.close_success")),s()})},children:e.jsx(K,{variant:"ghost",size:"icon",className:"h-8 w-8",title:a("actions.close_ticket"),children:e.jsx(di,{className:"h-4 w-4"})})})]})}}]};function Qh(){const[s,a]=m.useState({}),[t,l]=m.useState({}),[n,r]=m.useState([{id:"status",value:"0"}]),[o,c]=m.useState([]),[u,i]=m.useState({pageIndex:0,pageSize:20}),{refetch:d,data:h}=le({queryKey:["orderList",u,n,o],queryFn:()=>jt.getList({pageSize:u.pageSize,current:u.pageIndex+1,filter:n,sort:o})}),k=Je({data:h?.data??[],columns:Jh(d),state:{sorting:o,columnVisibility:t,rowSelection:s,columnFilters:n,pagination:u},rowCount:h?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:r,onColumnVisibilityChange:l,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),onPaginationChange:i,getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Fh,{table:k,refetch:d}),e.jsx(os,{table:k,showPagination:!0})]})}function Xh(){const{t:s}=V("ticket");return e.jsxs(li,{refreshData:()=>{},children:[e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Qh,{})})]})]}),e.jsx(ri,{})]})}const Zh=Object.freeze(Object.defineProperty({__proto__:null,default:Xh},Symbol.toStringTag,{value:"Module"}));export{lp as a,ap as c,np as g,rp as r}; +`+n("columns.online_status.offline_duration.seconds",{count:u})}return e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:y("size-2.5 rounded-full ring-2 ring-offset-2",c?"bg-green-500 ring-green-500/20":"bg-gray-300 ring-gray-300/20","transition-all duration-300")}),e.jsx("span",{className:"font-medium text-foreground/90",children:r.original.email})]})}),e.jsx(oe,{side:"bottom",className:"max-w-[280px]",children:e.jsx("p",{className:"whitespace-pre-line text-sm",children:i})})]})})},enableSorting:!1,enableHiding:!1},{accessorKey:"online_count",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.online_count")}),cell:({row:r})=>{const o=r.original.device_limit,c=r.original.online_count||0;return e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{children:e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs(G,{variant:"outline",className:y("min-w-[4rem] justify-center",o!==null&&c>=o?"border-destructive/50 bg-destructive/10 text-destructive":"border-primary/40 bg-primary/5 text-primary/90"),children:[c," / ",o===null?"∞":o]})})}),e.jsx(oe,{side:"bottom",children:e.jsx("p",{className:"text-sm",children:o===null?n("columns.device_limit.unlimited"):n("columns.device_limit.limited",{count:o})})})]})})},enableSorting:!0,enableHiding:!1},{accessorKey:"banned",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.status")}),cell:({row:r})=>{const o=r.original.banned;return e.jsx("div",{className:"flex justify-center",children:e.jsx(G,{className:y("min-w-20 justify-center transition-colors",o?"bg-destructive/15 text-destructive hover:bg-destructive/25":"bg-success/15 text-success hover:bg-success/25"),children:n(o?"columns.status_text.banned":"columns.status_text.normal")})})},enableSorting:!0,filterFn:(r,o,c)=>c.includes(r.getValue(o))},{accessorKey:"plan_id",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.subscription")}),cell:({row:r})=>e.jsx("div",{className:"min-w-[10em] break-all",children:r.original?.plan?.name||"-"}),enableSorting:!1,enableHiding:!1},{accessorKey:"group_id",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.group")}),cell:({row:r})=>e.jsx("div",{className:"flex flex-wrap gap-1",children:e.jsx(G,{variant:"outline",className:y("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5 whitespace-nowrap"),children:r.original?.group?.name||"-"})}),enableSorting:!1},{accessorKey:"total_used",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.used_traffic")}),cell:({row:r})=>{const o=Oe(r.original?.total_used),c=Oe(r.original?.transfer_enable),u=r.original?.total_used/r.original?.transfer_enable*100||0;return e.jsx(je,{delayDuration:100,children:e.jsxs(de,{children:[e.jsx(me,{className:"w-full",children:e.jsxs("div",{className:"w-full space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:o}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.toFixed(1),"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-secondary",children:e.jsx("div",{className:y("h-full rounded-full transition-all",u>90?"bg-destructive":"bg-primary"),style:{width:`${Math.min(u,100)}%`}})})]})}),e.jsx(oe,{side:"bottom",children:e.jsxs("p",{className:"text-sm",children:[n("columns.total_traffic"),": ",c]})})]})})}},{accessorKey:"transfer_enable",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.total_traffic")}),cell:({row:r})=>e.jsx("div",{className:"font-medium text-muted-foreground",children:Oe(r.original?.transfer_enable)})},{accessorKey:"expired_at",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.expire_time")}),cell:({row:r})=>{const o=r.original.expired_at,c=Date.now()/1e3,u=o!=null&&oe.jsx(z,{column:r,title:n("columns.balance")}),cell:({row:r})=>{const o=gt(r.original?.balance);return e.jsxs("div",{className:"flex items-center gap-1 font-medium",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"¥"}),e.jsx("span",{className:"tabular-nums text-foreground",children:o})]})}},{accessorKey:"commission_balance",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.commission")}),cell:({row:r})=>{const o=gt(r.original?.commission_balance);return e.jsxs("div",{className:"flex items-center gap-1 font-medium",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"¥"}),e.jsx("span",{className:"tabular-nums text-foreground",children:o})]})}},{accessorKey:"created_at",header:({column:r})=>e.jsx(z,{column:r,title:n("columns.register_time")}),cell:({row:r})=>e.jsx("div",{className:"truncate",children:Se(r.original?.created_at)}),size:1e3},{id:"actions",header:({column:r})=>e.jsx(z,{column:r,className:"justify-end",title:n("columns.actions")}),cell:({row:r,table:o})=>e.jsxs(Es,{modal:!0,children:[e.jsx(Is,{asChild:!0,children:e.jsx("div",{className:"text-center",children:e.jsx(K,{variant:"ghost",className:"h-8 w-8 p-0 hover:bg-muted","aria-label":n("columns.actions"),children:e.jsx(va,{className:"size-4"})})})}),e.jsxs(ws,{align:"end",className:"min-w-[40px]",children:[e.jsx(_e,{onSelect:c=>{c.preventDefault(),t(r.original),l(!0)},className:"p-0",children:e.jsxs(K,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(yh,{className:"mr-2"}),n("columns.actions_menu.edit")]})}),e.jsx(_e,{onSelect:c=>c.preventDefault(),className:"p-0",children:e.jsx(Wr,{defaultValues:{email:r.original.email},trigger:e.jsxs(K,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(Nh,{className:"mr-2 "}),n("columns.actions_menu.assign_order")]})})}),e.jsx(_e,{onSelect:()=>{ba(r.original.subscribe_url).then(()=>{$.success(n("common:copy.success"))})},className:"p-0",children:e.jsxs(K,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(_h,{className:"mr-2"}),n("columns.actions_menu.copy_url")]})}),e.jsx(_e,{onSelect:()=>{_s.resetSecret(r.original.id).then(({data:c})=>{c&&$.success("重置成功")})},children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(wh,{className:"mr-2 "}),n("columns.actions_menu.reset_secret")]})}),e.jsx(_e,{onSelect:()=>{},className:"p-0",children:e.jsxs(nt,{className:"flex items-center px-2 py-1.5",to:`/finance/order?user_id=eq:${r.original?.id}`,children:[e.jsx(Ch,{className:"mr-2"}),n("columns.actions_menu.orders")]})}),e.jsx(_e,{onSelect:()=>{o.setColumnFilters([{id:"invite_user_id",value:"eq:"+r.original?.id}])},children:e.jsxs("div",{className:"flex items-center",children:[e.jsx(Sh,{className:"mr-2 "}),n("columns.actions_menu.invites")]})}),e.jsx(_e,{onSelect:c=>c.preventDefault(),className:"p-0",children:e.jsx(ai,{user_id:r.original?.id,dialogTrigger:e.jsxs(K,{variant:"ghost",className:"w-full justify-start px-2 py-1.5",children:[e.jsx(kh,{className:"mr-2 "}),n("columns.actions_menu.traffic_records")]})})}),e.jsx(_e,{onSelect:c=>c.preventDefault(),className:"p-0",children:e.jsx(bh,{title:n("columns.actions_menu.delete_confirm_title"),description:n("columns.actions_menu.delete_confirm_description",{email:r.original.email}),cancelText:n("common:cancel"),confirmText:n("common:confirm"),variant:"destructive",onConfirm:async()=>{try{const{data:c}=await _s.destroy(r.original.id);c&&($.success(n("common:delete.success")),s())}catch{$.error(n("common:delete.failed"))}},children:e.jsxs(K,{variant:"ghost",className:"w-full justify-start px-2 py-1.5 text-destructive hover:text-destructive",children:[e.jsx(Th,{className:"mr-2"}),n("columns.actions_menu.delete")]})})})]})]})}]},ni=m.createContext(void 0),Vn=()=>{const s=m.useContext(ni);if(!s)throw new Error("useUserEdit must be used within an UserEditProvider");return s},li=({children:s,refreshData:a})=>{const[t,l]=m.useState(!1),[n,r]=m.useState(null),o={isOpen:t,setIsOpen:l,editingUser:n,setEditingUser:r,refreshData:a};return e.jsx(ni.Provider,{value:o,children:s})},Ph=x.object({id:x.number(),email:x.string().email(),invite_user_email:x.string().email().nullable().optional(),password:x.string().optional().nullable(),balance:x.coerce.number(),commission_balance:x.coerce.number(),u:x.number(),d:x.number(),transfer_enable:x.number(),expired_at:x.number().nullable(),plan_id:x.number().nullable(),banned:x.number(),commission_type:x.number(),commission_rate:x.number().nullable(),discount:x.number().nullable(),speed_limit:x.number().nullable(),device_limit:x.number().nullable(),is_admin:x.number(),is_staff:x.number(),remarks:x.string().nullable()});function ri(){const{t:s}=V("user"),{isOpen:a,setIsOpen:t,editingUser:l,refreshData:n}=Vn(),[r,o]=m.useState(!1),[c,u]=m.useState([]),i=Ne({resolver:we(Ph),defaultValues:{id:0,email:"",invite_user_email:null,password:null,balance:0,commission_balance:0,u:0,d:0,transfer_enable:0,expired_at:null,plan_id:null,banned:0,commission_type:0,commission_rate:null,discount:null,speed_limit:null,device_limit:null,is_admin:0,is_staff:0,remarks:null}});return m.useEffect(()=>{a&&ss.getList().then(({data:d})=>{u(d)})},[a]),m.useEffect(()=>{if(l){const d=l.invite_user?.email,{invite_user:h,...k}=l;i.reset({...k,invite_user_email:d||null,password:null})}},[l,i]),e.jsx(Xr,{open:a,onOpenChange:t,children:e.jsxs(Ln,{className:"max-w-[90%] space-y-4",children:[e.jsxs(En,{children:[e.jsx(In,{children:s("edit.title")}),e.jsx(Rn,{})]}),e.jsxs(Ce,{...i,children:[e.jsx(v,{control:i.control,name:"email",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.email")}),e.jsx(b,{children:e.jsx(D,{...d,placeholder:s("edit.form.email_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(P,{...d})]})}),e.jsx(v,{control:i.control,name:"invite_user_email",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.inviter_email")}),e.jsx(b,{children:e.jsx(D,{value:d.value||"",onChange:h=>d.onChange(h.target.value?h.target.value:null),placeholder:s("edit.form.inviter_email_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(P,{...d})]})}),e.jsx(v,{control:i.control,name:"password",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.password")}),e.jsx(b,{children:e.jsx(D,{type:"password",value:d.value||"",onChange:d.onChange,placeholder:s("edit.form.password_placeholder"),autoComplete:"off","data-form-type":"other"})}),e.jsx(P,{...d})]})}),e.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[e.jsx(v,{control:i.control,name:"balance",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.balance")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:d.onChange,placeholder:s("edit.form.balance_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"¥"})]})}),e.jsx(P,{...d})]})}),e.jsx(v,{control:i.control,name:"commission_balance",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.commission_balance")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:d.onChange,placeholder:s("edit.form.commission_balance_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"¥"})]})}),e.jsx(P,{...d})]})}),e.jsx(v,{control:i.control,name:"u",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.upload")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{value:d.value/1024/1024/1024||"",onChange:h=>d.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.upload_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(P,{...d})]})}),e.jsx(v,{control:i.control,name:"d",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.download")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value/1024/1024/1024||"",onChange:h=>d.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.download_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(P,{...d})]})})]}),e.jsx(v,{control:i.control,name:"transfer_enable",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.total_traffic")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value/1024/1024/1024||"",onChange:h=>d.onChange(parseInt(h.target.value)*1024*1024*1024),placeholder:s("edit.form.total_traffic_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"GB"})]})}),e.jsx(P,{})]})}),e.jsx(v,{control:i.control,name:"expired_at",render:({field:d})=>e.jsxs(f,{className:"flex flex-col",children:[e.jsx(j,{children:s("edit.form.expire_time")}),e.jsxs(Cs,{open:r,onOpenChange:o,children:[e.jsx(Ss,{asChild:!0,children:e.jsx(b,{children:e.jsxs(L,{type:"button",variant:"outline",className:y("w-full pl-3 text-left font-normal",!d.value&&"text-muted-foreground"),onClick:()=>o(!0),children:[d.value?Se(d.value):e.jsx("span",{children:s("edit.form.expire_time_placeholder")}),e.jsx(Ct,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsx(bs,{className:"w-auto p-0",align:"start",side:"top",sideOffset:4,onInteractOutside:h=>{h.preventDefault()},onEscapeKeyDown:h=>{h.preventDefault()},children:e.jsxs("div",{className:"flex flex-col space-y-3 p-3",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{d.onChange(null),o(!1)},children:s("edit.form.expire_time_permanent")}),e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{const h=new Date;h.setMonth(h.getMonth()+1),h.setHours(23,59,59,999),d.onChange(Math.floor(h.getTime()/1e3)),o(!1)},children:s("edit.form.expire_time_1month")}),e.jsx(L,{type:"button",variant:"outline",className:"flex-1",onClick:()=>{const h=new Date;h.setMonth(h.getMonth()+3),h.setHours(23,59,59,999),d.onChange(Math.floor(h.getTime()/1e3)),o(!1)},children:s("edit.form.expire_time_3months")})]}),e.jsx("div",{className:"rounded-md border",children:e.jsx(ct,{mode:"single",selected:d.value?new Date(d.value*1e3):void 0,onSelect:h=>{if(h){const k=new Date(d.value?d.value*1e3:Date.now());h.setHours(k.getHours(),k.getMinutes(),k.getSeconds()),d.onChange(Math.floor(h.getTime()/1e3))}},disabled:h=>h{const h=new Date;h.setHours(23,59,59,999),d.onChange(Math.floor(h.getTime()/1e3))},className:"h-6 px-2 text-xs",children:s("edit.form.expire_time_today")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(D,{type:"datetime-local",step:"1",value:Se(d.value,"YYYY-MM-DDTHH:mm:ss"),onChange:h=>{const k=new Date(h.target.value);isNaN(k.getTime())||d.onChange(Math.floor(k.getTime()/1e3))},className:"flex-1"}),e.jsx(L,{type:"button",variant:"outline",onClick:()=>o(!1),children:s("edit.form.expire_time_confirm")})]})]})]})})]}),e.jsx(P,{})]})}),e.jsx(v,{control:i.control,name:"plan_id",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.subscription")}),e.jsx(b,{children:e.jsxs(J,{value:d.value!==null?String(d.value):"null",onValueChange:h=>d.onChange(h==="null"?null:parseInt(h)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("edit.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"null",children:s("edit.form.subscription_none")}),c.map(h=>e.jsx(A,{value:String(h.id),children:h.name},h.id))]})]})})]})}),e.jsx(v,{control:i.control,name:"banned",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.account_status")}),e.jsx(b,{children:e.jsxs(J,{value:d.value.toString(),onValueChange:h=>d.onChange(parseInt(h)),children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx(A,{value:"1",children:s("columns.status_text.banned")}),e.jsx(A,{value:"0",children:s("columns.status_text.normal")})]})]})})]})}),e.jsx(v,{control:i.control,name:"commission_type",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.commission_type")}),e.jsx(b,{children:e.jsxs(J,{value:d.value.toString(),onValueChange:h=>d.onChange(parseInt(h)),children:[e.jsx(W,{children:e.jsx(Q,{placeholder:s("edit.form.subscription_none")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"0",children:s("edit.form.commission_type_system")}),e.jsx(A,{value:"1",children:s("edit.form.commission_type_cycle")}),e.jsx(A,{value:"2",children:s("edit.form.commission_type_onetime")})]})]})})]})}),e.jsx(v,{control:i.control,name:"commission_rate",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.commission_rate")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:h=>d.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.commission_rate_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"%"})]})})]})}),e.jsx(v,{control:i.control,name:"discount",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.discount")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:h=>d.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.discount_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"%"})]})}),e.jsx(P,{})]})}),e.jsx(v,{control:i.control,name:"speed_limit",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.speed_limit")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:h=>d.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.speed_limit_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"Mbps"})]})}),e.jsx(P,{})]})}),e.jsx(v,{control:i.control,name:"device_limit",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.device_limit")}),e.jsx(b,{children:e.jsxs("div",{className:"flex",children:[e.jsx(D,{type:"number",value:d.value||"",onChange:h=>d.onChange(parseInt(h.currentTarget.value)||null),placeholder:s("edit.form.device_limit_placeholder"),className:"rounded-r-none"}),e.jsx("div",{className:"z-[-1] rounded-md rounded-l-none border border-l-0 border-input px-3 py-1 shadow-sm",children:"台"})]})}),e.jsx(P,{})]})}),e.jsx(v,{control:i.control,name:"is_admin",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.is_admin")}),e.jsx("div",{className:"py-2",children:e.jsx(b,{children:e.jsx(Z,{checked:d.value===1,onCheckedChange:h=>d.onChange(h?1:0)})})})]})}),e.jsx(v,{control:i.control,name:"is_staff",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.is_staff")}),e.jsx("div",{className:"py-2",children:e.jsx(b,{children:e.jsx(Z,{checked:d.value===1,onCheckedChange:h=>d.onChange(h?1:0)})})})]})}),e.jsx(v,{control:i.control,name:"remarks",render:({field:d})=>e.jsxs(f,{children:[e.jsx(j,{children:s("edit.form.remarks")}),e.jsx(b,{children:e.jsx(ks,{className:"h-24",value:d.value||"",onChange:h=>d.onChange(h.currentTarget.value??null),placeholder:s("edit.form.remarks_placeholder")})}),e.jsx(P,{})]})}),e.jsxs(ei,{children:[e.jsx(L,{variant:"outline",onClick:()=>t(!1),children:s("edit.form.cancel")}),e.jsx(L,{type:"submit",onClick:()=>{i.handleSubmit(d=>{_s.update(d).then(({data:h})=>{h&&($.success(s("edit.form.success")),t(!1),n())})})()},children:s("edit.form.submit")})]})]})]})})}function Lh(){const[s]=ur(),[a,t]=m.useState({}),[l,n]=m.useState({is_admin:!1,is_staff:!1}),[r,o]=m.useState([]),[c,u]=m.useState([]),[i,d]=m.useState({pageIndex:0,pageSize:20});m.useEffect(()=>{const p=s.get("email");p&&o(_=>_.some(H=>H.id==="email")?_:[..._,{id:"email",value:p}])},[s]);const{refetch:h,data:k,isLoading:C}=le({queryKey:["userList",i,r,c],queryFn:()=>_s.getList({pageSize:i.pageSize,current:i.pageIndex+1,filter:r,sort:c})}),[S,w]=m.useState([]),[N,g]=m.useState([]);m.useEffect(()=>{rt.getList().then(({data:p})=>{w(p)}),ss.getList().then(({data:p})=>{g(p)})},[]);const T=S.map(p=>({label:p.name,value:p.id})),E=N.map(p=>({label:p.name,value:p.id}));return e.jsxs(li,{refreshData:h,children:[e.jsx(Eh,{data:k?.data??[],rowCount:k?.total??0,sorting:c,setSorting:u,columnVisibility:l,setColumnVisibility:n,rowSelection:a,setRowSelection:t,columnFilters:r,setColumnFilters:o,pagination:i,setPagination:d,refetch:h,serverGroupList:S,permissionGroups:T,subscriptionPlans:E}),e.jsx(ri,{})]})}function Eh({data:s,rowCount:a,sorting:t,setSorting:l,columnVisibility:n,setColumnVisibility:r,rowSelection:o,setRowSelection:c,columnFilters:u,setColumnFilters:i,pagination:d,setPagination:h,refetch:k,serverGroupList:C,permissionGroups:S,subscriptionPlans:w}){const{setIsOpen:N,setEditingUser:g}=Vn(),T=Je({data:s,columns:Dh(k,C,g,N),state:{sorting:t,columnVisibility:n,rowSelection:o,columnFilters:u,pagination:d},rowCount:a,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:c,onSortingChange:l,onColumnFiltersChange:i,onColumnVisibilityChange:r,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),onPaginationChange:h,getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnVisibility:{commission_balance:!1,created_at:!1,is_admin:!1,is_staff:!1,permission_group:!1,plan_id:!1},columnPinning:{right:["actions"]}}});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(fh,{table:T,refetch:k,serverGroupList:C,permissionGroups:S,subscriptionPlans:w}),e.jsx(os,{table:T})]})}function Ih(){const{t:s}=V("user");return e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("manage.title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("manage.description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx("div",{className:"w-full",children:e.jsx(Lh,{})})})]})]})}const Rh=Object.freeze(Object.defineProperty({__proto__:null,default:Ih},Symbol.toStringTag,{value:"Module"}));function Vh({column:s,title:a,options:t}){const l=new Set(s?.getFilterValue());return e.jsxs(Cs,{children:[e.jsx(Ss,{asChild:!0,children:e.jsxs(K,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(Jc,{className:"mr-2 h-4 w-4"}),a,l?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:l.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:l.size>2?e.jsxs(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[l.size," selected"]}):t.filter(n=>l.has(n.value)).map(n=>e.jsx(G,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:n.label},`selected-${n.value}`))})]})]})}),e.jsx(bs,{className:"w-[200px] p-0",align:"start",children:e.jsxs(Us,{children:[e.jsx(it,{placeholder:a}),e.jsxs(Ks,{children:[e.jsx(ot,{children:"No results found."}),e.jsx(ns,{children:t.map(n=>{const r=l.has(n.value);return e.jsxs($e,{onSelect:()=>{r?l.delete(n.value):l.add(n.value);const o=Array.from(l);s?.setFilterValue(o.length?o:void 0)},children:[e.jsx("div",{className:y("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",r?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(Qc,{className:y("h-4 w-4")})}),n.icon&&e.jsx(n.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:n.label})]},`option-${n.value}`)})}),l.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{}),e.jsx(ns,{children:e.jsx($e,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}const Fh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 11H5a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2"})});function Mh({table:s}){const{t:a}=V("ticket");return e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-4",children:[e.jsx(Wt,{defaultValue:s.getColumn("status")?.getFilterValue(),onValueChange:t=>s.getColumn("status")?.setFilterValue(t),children:e.jsxs(kt,{className:"grid w-full grid-cols-2",children:[e.jsx(es,{value:"0",children:a("status.pending")}),e.jsx(es,{value:"1",children:a("status.closed")})]})}),s.getColumn("level")&&e.jsx(Vh,{column:s.getColumn("level"),title:a("columns.level"),options:[{label:a("level.low"),value:qe.LOW,icon:Fh,color:"gray"},{label:a("level.medium"),value:qe.MIDDLE,icon:si,color:"yellow"},{label:a("level.high"),value:qe.HIGH,icon:ti,color:"red"}]})]})})}function Oh(){return e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"text-foreground",children:[e.jsx("circle",{cx:"4",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{id:"spinner_qFRN",begin:"0;spinner_OcgL.end+0.25s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})}),e.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{begin:"spinner_qFRN.begin+0.1s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})}),e.jsx("circle",{cx:"20",cy:"12",r:"2",fill:"currentColor",children:e.jsx("animate",{id:"spinner_OcgL",begin:"spinner_qFRN.begin+0.2s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})})]})}const zh=tt("flex gap-2 max-w-[60%] items-end relative group",{variants:{variant:{received:"self-start",sent:"self-end flex-row-reverse"},layout:{default:"",ai:"max-w-full w-full items-center"}},defaultVariants:{variant:"received",layout:"default"}}),ii=m.forwardRef(({className:s,variant:a,layout:t,children:l,...n},r)=>e.jsx("div",{className:y(zh({variant:a,layout:t,className:s}),"relative group"),ref:r,...n,children:m.Children.map(l,o=>m.isValidElement(o)&&typeof o.type!="string"?m.cloneElement(o,{variant:a,layout:t}):o)}));ii.displayName="ChatBubble";const $h=tt("p-4",{variants:{variant:{received:"bg-secondary text-secondary-foreground rounded-r-lg rounded-tl-lg",sent:"bg-primary text-primary-foreground rounded-l-lg rounded-tr-lg"},layout:{default:"",ai:"border-t w-full rounded-none bg-transparent"}},defaultVariants:{variant:"received",layout:"default"}}),oi=m.forwardRef(({className:s,variant:a,layout:t,isLoading:l=!1,children:n,...r},o)=>e.jsx("div",{className:y($h({variant:a,layout:t,className:s}),"break-words max-w-full whitespace-pre-wrap"),ref:o,...r,children:l?e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(Oh,{})}):n}));oi.displayName="ChatBubbleMessage";const Ah=m.forwardRef(({variant:s,className:a,children:t,...l},n)=>e.jsx("div",{ref:n,className:y("absolute top-1/2 -translate-y-1/2 flex opacity-0 group-hover:opacity-100 transition-opacity duration-200",s==="sent"?"-left-1 -translate-x-full flex-row-reverse":"-right-1 translate-x-full",a),...l,children:t}));Ah.displayName="ChatBubbleActionWrapper";const ci=m.forwardRef(({className:s,...a},t)=>e.jsx(ks,{autoComplete:"off",ref:t,name:"message",className:y("max-h-12 px-4 py-3 bg-background text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 w-full rounded-md flex items-center h-16 resize-none",s),...a}));ci.displayName="ChatInput";const di=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29l-4.3 4.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l4.29-4.3l4.29 4.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42Z"})}),mi=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M15.098 12.634L13 11.423V7a1 1 0 0 0-2 0v5a1 1 0 0 0 .5.866l2.598 1.5a1 1 0 1 0 1-1.732M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8.01 8.01 0 0 1-8 8"})}),dl=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"m11.29 12l3.54-3.54a1 1 0 0 0 0-1.41a1 1 0 0 0-1.42 0l-4.24 4.24a1 1 0 0 0 0 1.42L13.41 17a1 1 0 0 0 .71.29a1 1 0 0 0 .71-.29a1 1 0 0 0 0-1.41Z"})}),qh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})}),Hh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M3.71 16.29a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21a1 1 0 0 0-.21.33a1 1 0 0 0 .21 1.09a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21a1 1 0 0 0 .21-1.09a1 1 0 0 0-.21-.33M7 8h14a1 1 0 0 0 0-2H7a1 1 0 0 0 0 2m-3.29 3.29a1 1 0 0 0-1.09-.21a1.2 1.2 0 0 0-.33.21a1 1 0 0 0-.21.33a.94.94 0 0 0 0 .76a1.2 1.2 0 0 0 .21.33a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21a1.2 1.2 0 0 0 .21-.33a.94.94 0 0 0 0-.76a1 1 0 0 0-.21-.33M21 11H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2M3.71 6.29a1 1 0 0 0-.33-.21a1 1 0 0 0-1.09.21a1.2 1.2 0 0 0-.21.33a.94.94 0 0 0 0 .76a1.2 1.2 0 0 0 .21.33a1.2 1.2 0 0 0 .33.21a1 1 0 0 0 1.09-.21a1.2 1.2 0 0 0 .21-.33a.94.94 0 0 0 0-.76a1.2 1.2 0 0 0-.21-.33M21 16H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2"})}),Uh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M9 12H7a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2m-1-2h4a1 1 0 0 0 0-2H8a1 1 0 0 0 0 2m1 6H7a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2m12-4h-3V3a1 1 0 0 0-.5-.87a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0l-3 1.72l-3-1.72a1 1 0 0 0-1 0A1 1 0 0 0 2 3v16a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1M5 20a1 1 0 0 1-1-1V4.73l2 1.14a1.08 1.08 0 0 0 1 0l3-1.72l3 1.72a1.08 1.08 0 0 0 1 0l2-1.14V19a3 3 0 0 0 .18 1Zm15-1a1 1 0 0 1-2 0v-5h2Zm-6.44-2.83a.8.8 0 0 0-.18-.09a.6.6 0 0 0-.19-.06a1 1 0 0 0-.9.27A1.05 1.05 0 0 0 12 17a1 1 0 0 0 .07.38a1.2 1.2 0 0 0 .22.33a1.2 1.2 0 0 0 .33.21a.94.94 0 0 0 .76 0a1.2 1.2 0 0 0 .33-.21A1 1 0 0 0 14 17a1.05 1.05 0 0 0-.29-.71a2 2 0 0 0-.15-.12m.14-3.88a1 1 0 0 0-1.62.33A1 1 0 0 0 13 14a1 1 0 0 0 1-1a1 1 0 0 0-.08-.38a.9.9 0 0 0-.22-.33"})});function Kh(){return e.jsxs("div",{className:"flex h-full flex-col space-y-4 p-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{className:"h-8 w-3/4"}),e.jsx(he,{className:"h-4 w-1/2"})]}),e.jsx("div",{className:"flex-1 space-y-4",children:[1,2,3].map(s=>e.jsx(he,{className:"h-20 w-2/3"},s))})]})}function Bh(){return e.jsx("div",{className:"space-y-4 p-4",children:[1,2,3,4].map(s=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{className:"h-5 w-4/5"}),e.jsx(he,{className:"h-4 w-2/3"}),e.jsx(he,{className:"h-3 w-1/2"})]},s))})}function Gh({ticket:s,isActive:a,onClick:t}){const{t:l}=V("ticket"),n=r=>{switch(r){case qe.HIGH:return"bg-red-50 text-red-600 border-red-200";case qe.MIDDLE:return"bg-yellow-50 text-yellow-600 border-yellow-200";case qe.LOW:return"bg-green-50 text-green-600 border-green-200";default:return"bg-gray-50 text-gray-600 border-gray-200"}};return e.jsxs("div",{className:y("flex cursor-pointer flex-col border-b p-4 hover:bg-accent/50",a&&"bg-accent"),onClick:t,children:[e.jsxs("div",{className:"flex max-w-[280px] items-center justify-between gap-2",children:[e.jsx("h4",{className:"flex-1 truncate font-medium",children:s.subject}),e.jsx(G,{variant:s.status===Hs.CLOSED?"secondary":"default",className:"shrink-0",children:s.status===Hs.CLOSED?l("status.closed"):l("status.processing")})]}),e.jsx("div",{className:"mt-1 max-w-[280px] truncate text-sm text-muted-foreground",children:s.user?.email}),e.jsxs("div",{className:"mt-2 flex items-center justify-between text-xs",children:[e.jsx("time",{className:"text-muted-foreground",children:Se(s.updated_at)}),e.jsx("div",{className:y("rounded-full border px-2 py-0.5 text-xs font-medium",n(s.level)),children:l(`level.${s.level===qe.LOW?"low":s.level===qe.MIDDLE?"medium":"high"}`)})]})]})}function Wh({ticketId:s,dialogTrigger:a}){const{t}=V("ticket"),l=Rs(),n=m.useRef(null),r=m.useRef(null),[o,c]=m.useState(!1),[u,i]=m.useState(""),[d,h]=m.useState(!1),[k,C]=m.useState(s),[S,w]=m.useState(""),[N,g]=m.useState(!1),{setIsOpen:T,setEditingUser:E}=Vn(),{data:p,isLoading:_,refetch:I}=le({queryKey:["tickets",o],queryFn:()=>o?jt.getList({filter:[{id:"status",value:[Hs.OPENING]}]}):Promise.resolve(null),enabled:o}),{data:H,refetch:O,isLoading:B}=le({queryKey:["ticket",k,o],queryFn:()=>o?jt.getInfo(k):Promise.resolve(null),refetchInterval:o?5e3:!1,retry:3}),ue=H?.data,te=(p?.data||[]).filter(re=>re.subject.toLowerCase().includes(S.toLowerCase())||re.user?.email.toLowerCase().includes(S.toLowerCase())),q=(re="smooth")=>{if(n.current){const{scrollHeight:us,clientHeight:Ts}=n.current;n.current.scrollTo({top:us-Ts,behavior:re})}};m.useEffect(()=>{if(!o)return;const re=requestAnimationFrame(()=>{q("instant"),setTimeout(()=>q(),1e3)});return()=>{cancelAnimationFrame(re)}},[o,ue?.messages]);const R=async()=>{const re=u.trim();!re||d||(h(!0),jt.reply({id:k,message:re}).then(()=>{i(""),O(),q(),setTimeout(()=>{r.current?.focus()},0)}).finally(()=>{h(!1)}))},X=async()=>{jt.close(k).then(()=>{$.success(t("actions.close_success")),O(),I()})},ms=()=>{ue?.user&&l("/finance/order?user_id="+ue.user.id)},Te=ue?.status===Hs.CLOSED;return e.jsxs(ge,{open:o,onOpenChange:c,children:[e.jsx(is,{asChild:!0,children:a??e.jsx(K,{variant:"outline",children:t("actions.view_ticket")})}),e.jsxs(pe,{className:"flex h-[90vh] max-w-6xl flex-col gap-0 p-0",children:[e.jsx(fe,{}),e.jsxs("div",{className:"flex h-full",children:[e.jsx(K,{variant:"ghost",size:"icon",className:"absolute left-2 top-2 z-50 md:hidden",onClick:()=>g(!N),children:e.jsx(dl,{className:y("h-4 w-4 transition-transform",!N&&"rotate-180")})}),e.jsxs("div",{className:y("absolute inset-y-0 left-0 z-40 flex flex-col border-r bg-background transition-transform duration-200 ease-in-out md:relative",N?"-translate-x-full":"translate-x-0","w-80 md:w-80 md:translate-x-0"),children:[e.jsxs("div",{className:"space-y-4 border-b p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-semibold",children:t("list.title")}),e.jsx(K,{variant:"ghost",size:"icon",className:"hidden h-8 w-8 md:flex",onClick:()=>g(!N),children:e.jsx(dl,{className:y("h-4 w-4 transition-transform",!N&&"rotate-180")})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(qh,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 transform text-muted-foreground"}),e.jsx(D,{placeholder:t("list.search_placeholder"),value:S,onChange:re=>w(re.target.value),className:"pl-8"})]})]}),e.jsx(_t,{className:"flex-1",children:e.jsx("div",{className:"w-full",children:_?e.jsx(Bh,{}):te.length===0?e.jsx("div",{className:"flex h-full items-center justify-center p-4 text-muted-foreground",children:t(S?"list.no_search_results":"list.no_tickets")}):te.map(re=>e.jsx(Gh,{ticket:re,isActive:re.id===k,onClick:()=>{C(re.id),window.innerWidth<768&&g(!0)}},re.id))})})]}),e.jsxs("div",{className:"relative flex flex-1 flex-col",children:[!N&&e.jsx("div",{className:"absolute inset-0 z-30 bg-black/20 md:hidden",onClick:()=>g(!0)}),B?e.jsx(Kh,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col space-y-4 border-b p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("h2",{className:"text-2xl font-semibold",children:ue?.subject}),e.jsx(G,{variant:Te?"secondary":"default",children:t(Te?"status.closed":"status.processing")}),!Te&&e.jsx(ls,{title:t("actions.close_confirm_title"),description:t("actions.close_confirm_description"),confirmText:t("actions.close_confirm_button"),variant:"destructive",onConfirm:X,children:e.jsxs(K,{variant:"ghost",size:"sm",className:"gap-1 text-muted-foreground hover:text-destructive",children:[e.jsx(di,{className:"h-4 w-4"}),t("actions.close_ticket")]})})]}),e.jsxs("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(wa,{className:"h-4 w-4"}),e.jsx("span",{children:ue?.user?.email})]}),e.jsx(De,{orientation:"vertical",className:"h-4"}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(mi,{className:"h-4 w-4"}),e.jsxs("span",{children:[t("detail.created_at")," ",Se(ue?.created_at)]})]}),e.jsx(De,{orientation:"vertical",className:"h-4"}),e.jsx(G,{variant:"outline",children:ue?.level!=null&&t(`level.${ue.level===qe.LOW?"low":ue.level===qe.MIDDLE?"medium":"high"}`)})]})]}),ue?.user&&e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(K,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.user_info"),onClick:()=>{E(ue.user),T(!0)},children:e.jsx(wa,{className:"h-4 w-4"})}),e.jsx(ai,{user_id:ue.user.id,dialogTrigger:e.jsx(K,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.traffic_records"),children:e.jsx(Hh,{className:"h-4 w-4"})})}),e.jsx(K,{variant:"outline",size:"icon",className:"h-8 w-8",title:t("detail.order_records"),onClick:ms,children:e.jsx(Uh,{className:"h-4 w-4"})})]})]})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx("div",{ref:n,className:"h-full space-y-4 overflow-y-auto p-6",children:ue?.messages?.length===0?e.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:t("detail.no_messages")}):ue?.messages?.map(re=>e.jsx(ii,{variant:re.is_from_admin?"sent":"received",className:re.is_from_admin?"ml-auto":"mr-auto",children:e.jsx(oi,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"whitespace-pre-wrap break-words",children:re.message}),e.jsx("div",{className:"text-right",children:e.jsx("time",{className:"text-[10px] text-muted-foreground",children:Se(re.created_at)})})]})})},re.id))})}),e.jsx("div",{className:"border-t p-4",children:e.jsxs("div",{className:"relative flex items-center space-x-2",children:[e.jsx(ci,{ref:r,disabled:Te||d,placeholder:t(Te?"detail.input.closed_placeholder":"detail.input.reply_placeholder"),className:"flex-1 resize-none rounded-lg border bg-background p-3 focus-visible:ring-1",value:u,onChange:re=>i(re.target.value),onKeyDown:re=>{re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),R())}}),e.jsx(K,{disabled:Te||d||!u.trim(),onClick:R,children:t(d?"detail.input.sending":"detail.input.send")})]})})]})]})]})]})]})}const Yh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M19 4H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3m-.41 2l-5.88 5.88a1 1 0 0 1-1.42 0L5.41 6ZM20 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7.41l5.88 5.88a3 3 0 0 0 4.24 0L20 7.41Z"})}),Jh=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M21.92 11.6C19.9 6.91 16.1 4 12 4s-7.9 2.91-9.92 7.6a1 1 0 0 0 0 .8C4.1 17.09 7.9 20 12 20s7.9-2.91 9.92-7.6a1 1 0 0 0 0-.8M12 18c-3.17 0-6.17-2.29-7.9-6C5.83 8.29 8.83 6 12 6s6.17 2.29 7.9 6c-1.73 3.71-4.73 6-7.9 6m0-10a4 4 0 1 0 4 4a4 4 0 0 0-4-4m0 6a2 2 0 1 1 2-2a2 2 0 0 1-2 2"})}),Qh=s=>{const{t:a}=V("ticket");return[{accessorKey:"id",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.id")}),cell:({row:t})=>e.jsx(G,{variant:"outline",children:t.getValue("id")}),enableSorting:!1,enableHiding:!1},{accessorKey:"subject",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.subject")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Yh,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"max-w-[500px] truncate font-medium",children:t.getValue("subject")})]}),enableSorting:!1,enableHiding:!1,size:4e3},{accessorKey:"level",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.level")}),cell:({row:t})=>{const l=t.getValue("level"),n=l===qe.LOW?"default":l===qe.MIDDLE?"secondary":"destructive";return e.jsx(G,{variant:n,className:"whitespace-nowrap",children:a(`level.${l===qe.LOW?"low":l===qe.MIDDLE?"medium":"high"}`)})},filterFn:(t,l,n)=>n.includes(t.getValue(l))},{accessorKey:"status",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.status")}),cell:({row:t})=>{const l=t.getValue("status"),n=t.original.reply_status,r=l===Hs.CLOSED?a("status.closed"):a(n===0?"status.replied":"status.pending"),o=l===Hs.CLOSED?"default":n===0?"secondary":"destructive";return e.jsx(G,{variant:o,className:"whitespace-nowrap",children:r})}},{accessorKey:"updated_at",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.updated_at")}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[e.jsx(mi,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:Se(t.getValue("updated_at"))})]}),enableSorting:!0},{accessorKey:"created_at",header:({column:t})=>e.jsx(z,{column:t,title:a("columns.created_at")}),cell:({row:t})=>e.jsx("div",{className:"text-sm text-muted-foreground",children:Se(t.getValue("created_at"))}),enableSorting:!0,meta:{isFlexGrow:!0}},{id:"actions",header:({column:t})=>e.jsx(z,{className:"justify-end",column:t,title:a("columns.actions")}),cell:({row:t})=>{const l=t.original.status!==Hs.CLOSED;return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(Wh,{ticketId:t.original.id,dialogTrigger:e.jsx(K,{variant:"ghost",size:"icon",className:"h-8 w-8",title:a("actions.view_details"),children:e.jsx(Jh,{className:"h-4 w-4"})})}),l&&e.jsx(ls,{title:a("actions.close_confirm_title"),description:a("actions.close_confirm_description"),confirmText:a("actions.close_confirm_button"),variant:"destructive",onConfirm:async()=>{jt.close(t.original.id).then(()=>{$.success(a("actions.close_success")),s()})},children:e.jsx(K,{variant:"ghost",size:"icon",className:"h-8 w-8",title:a("actions.close_ticket"),children:e.jsx(di,{className:"h-4 w-4"})})})]})}}]};function Xh(){const[s,a]=m.useState({}),[t,l]=m.useState({}),[n,r]=m.useState([{id:"status",value:"0"}]),[o,c]=m.useState([]),[u,i]=m.useState({pageIndex:0,pageSize:20}),{refetch:d,data:h}=le({queryKey:["orderList",u,n,o],queryFn:()=>jt.getList({pageSize:u.pageSize,current:u.pageIndex+1,filter:n,sort:o})}),k=Je({data:h?.data??[],columns:Qh(d),state:{sorting:o,columnVisibility:t,rowSelection:s,columnFilters:n,pagination:u},rowCount:h?.total??0,manualPagination:!0,manualFiltering:!0,manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:r,onColumnVisibilityChange:l,getCoreRowModel:Qe(),getFilteredRowModel:js(),getPaginationRowModel:rs(),onPaginationChange:i,getSortedRowModel:vs(),getFacetedRowModel:Vs(),getFacetedUniqueValues:Fs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Mh,{table:k,refetch:d}),e.jsx(os,{table:k,showPagination:!0})]})}function Zh(){const{t:s}=V("ticket");return e.jsxs(li,{refreshData:()=>{},children:[e.jsxs(Ve,{children:[e.jsxs(Fe,{children:[e.jsx(Xe,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Ue,{}),e.jsx(Ke,{})]})]}),e.jsxs(Ae,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:s("title")}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:s("description")})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Xh,{})})]})]}),e.jsx(ri,{})]})}const ep=Object.freeze(Object.defineProperty({__proto__:null,default:Zh},Symbol.toStringTag,{value:"Module"}));export{rp as a,np as c,lp as g,ip as r}; diff --git a/public/assets/admin/assets/vendor.js b/public/assets/admin/assets/vendor.js index 4fb7364..31214e1 100644 --- a/public/assets/admin/assets/vendor.js +++ b/public/assets/admin/assets/vendor.js @@ -73,7 +73,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var _m=v;function hue(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pue=typeof Object.is=="function"?Object.is:hue,gue=_m.useSyncExternalStore,mue=_m.useRef,vue=_m.useEffect,yue=_m.useMemo,bue=_m.useDebugValue;Pj.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=mue(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=yue(function(){function u(p){if(!l){if(l=!0,c=p,p=r(p),i!==void 0&&a.hasValue){var m=a.value;if(i(m,p))return f=m}return f=p}if(m=f,pue(c,p))return m;var y=r(p);return i!==void 0&&i(m,y)?(c=p,m):(c=p,f=y)}var l=!1,c,f,h=n===void 0?null:n;return[function(){return u(t())},h===null?void 0:function(){return u(h())}]},[t,n,r,i]);var s=gue(e,o[0],o[1]);return vue(function(){a.hasValue=!0,a.value=s},[s]),bue(s),s};Aj.exports=Pj;var xue=Aj.exports;function wue(e){e()}function _ue(){let e=null,t=null;return{clear(){e=null,t=null},notify(){wue(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var VM={notify(){},get:()=>[]};function Sue(e,t){let n,r=VM,i=0,o=!1;function a(y){c();const b=r.subscribe(y);let w=!1;return()=>{w||(w=!0,b(),f())}}function s(){r.notify()}function u(){m.onStateChange&&m.onStateChange()}function l(){return o}function c(){i++,n||(n=e.subscribe(u),r=_ue())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=VM)}function h(){o||(o=!0,c())}function p(){o&&(o=!1,f())}const m={addNestedSub:a,notifyNestedSubs:s,handleChangeWrapper:u,isSubscribed:l,trySubscribe:h,tryUnsubscribe:p,getListeners:()=>r};return m}var Cue=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Eue=Cue(),Oue=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Aue=Oue(),Pue=()=>Eue||Aue?v.useLayoutEffect:v.useEffect,kue=Pue(),Tue=Symbol.for("react-redux-context"),Mue=typeof globalThis<"u"?globalThis:{};function Rue(){if(!v.createContext)return{};const e=Mue[Tue]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var Al=Rue();function Due(e){const{children:t,context:n,serverState:r,store:i}=e,o=v.useMemo(()=>{const u=Sue(i);return{store:i,subscription:u,getServerState:r?()=>r:void 0}},[i,r]),a=v.useMemo(()=>i.getState(),[i]);kue(()=>{const{subscription:u}=o;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),a!==i.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[o,a]);const s=n||Al;return v.createElement(s.Provider,{value:o},t)}var $Xe=Due;function YO(e=Al){return function(){return v.useContext(e)}}var kj=YO();function Tj(e=Al){const t=e===Al?kj:YO(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var $ue=Tj();function Iue(e=Al){const t=e===Al?$ue:Tj(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var IXe=Iue(),Nue=(e,t)=>e===t;function Lue(e=Al){const t=e===Al?kj:YO(e),n=(r,i={})=>{const{equalityFn:o=Nue}=typeof i=="function"?{equalityFn:i}:i,a=t(),{store:s,subscription:u,getServerState:l}=a;v.useRef(!0);const c=v.useCallback({[r.name](h){return r(h)}}[r.name],[r]),f=xue.useSyncExternalStoreWithSelector(u.addNestedSub,s.getState,l||s.getState,c,o);return v.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var NXe=Lue();function HM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sw(...e){return t=>{let n=!1;const r=e.map(i=>{const o=HM(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:n,...r}=e,i=v.Children.toArray(n),o=i.find(Fue);if(o){const a=o.props.children,s=i.map(u=>u===o?v.Children.count(a)>1?v.Children.only(null):v.isValidElement(a)?a.props.children:null:u);return I.jsx(rE,{...r,ref:t,children:v.isValidElement(a)?v.cloneElement(a,void 0,s):null})}return I.jsx(rE,{...r,ref:t,children:n})});Pl.displayName="Slot";var rE=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const i=Bue(n);return v.cloneElement(n,{...jue(r,n.props),ref:t?sw(t,i):i})}return v.Children.count(n)>1?v.Children.only(null):null});rE.displayName="SlotClone";var ZO=({children:e})=>I.jsx(I.Fragment,{children:e});function Fue(e){return v.isValidElement(e)&&e.type===ZO}function jue(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Bue(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mj(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,KM=dn,LXe=(e,t)=>n=>{var r;if(t?.variants==null)return KM(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(l=>{const c=n?.[l],f=o?.[l];if(c===null)return null;const h=qM(c)||qM(f);return i[l][h]}),s=n&&Object.entries(n).reduce((l,c)=>{let[f,h]=c;return h===void 0||(l[f]=h),l},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,c)=>{let{class:f,className:h,...p}=c;return Object.entries(p).every(m=>{let[y,b]=m;return Array.isArray(b)?b.includes({...o,...s}[y]):{...o,...s}[y]===b})?[...l,f,h]:l},[]);return KM(e,a,u,n?.class,n?.className)},XO="-",Uue=e=>{const t=Wue(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(XO);return s[0]===""&&s.length!==1&&s.shift(),Rj(s,t)||zue(a)},getConflictingClassGroupIds:(a,s)=>{const u=n[a]||[];return s&&r[a]?[...u,...r[a]]:u}}},Rj=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Rj(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(XO);return t.validators.find(({validator:a})=>a(o))?.classGroupId},GM=/^\[(.+)\]$/,zue=e=>{if(GM.test(e)){const t=GM.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Wue=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Hue(Object.entries(e.classGroups),n).forEach(([o,a])=>{iE(a,r,o,t)}),r},iE=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:YM(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Vue(i)){iE(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{iE(a,YM(t,o),n,r)})})},YM=(e,t)=>{let n=e;return t.split(XO).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Vue=e=>e.isThemeGetter,Hue=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e,que=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},Dj="!",Kue=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=s=>{const u=[];let l=0,c=0,f;for(let b=0;bc?f-c:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}};return n?s=>n({className:s,parseClassName:a}):a},Gue=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Yue=e=>({cache:que(e.cacheSize),parseClassName:Kue(e),...Uue(e)}),Zue=/\s+/,Xue=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(Zue);let s="";for(let u=a.length-1;u>=0;u-=1){const l=a[u],{modifiers:c,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(l);let m=!!p,y=r(m?h.substring(0,p):h);if(!y){if(!m){s=l+(s.length>0?" "+s:s);continue}if(y=r(h),!y){s=l+(s.length>0?" "+s:s);continue}m=!1}const b=Gue(c).join(":"),w=f?b+Dj:b,x=w+y;if(o.includes(x))continue;o.push(x);const S=i(y,m);for(let O=0;O0?" "+s:s)}return s};function Que(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rf(c),e());return n=Yue(l),r=n.cache.get,i=n.cache.set,o=s,s(u)}function s(u){const l=r(u);if(l)return l;const c=Xue(u,n);return i(u,c),c}return function(){return o(Que.apply(null,arguments))}}const Jn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ij=/^\[(?:([a-z-]+):)?(.+)\]$/i,ele=/^\d+\/\d+$/,tle=new Set(["px","full","screen"]),nle=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rle=/\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$/,ile=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ole=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ale=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>Ad(e)||tle.has(e)||ele.test(e),Vu=e=>$h(e,"length",ple),Ad=e=>!!e&&!Number.isNaN(Number(e)),ES=e=>$h(e,"number",Ad),Dp=e=>!!e&&Number.isInteger(Number(e)),sle=e=>e.endsWith("%")&&Ad(e.slice(0,-1)),Qt=e=>Ij.test(e),Hu=e=>nle.test(e),ule=new Set(["length","size","percentage"]),lle=e=>$h(e,ule,Nj),cle=e=>$h(e,"position",Nj),fle=new Set(["image","url"]),dle=e=>$h(e,fle,mle),hle=e=>$h(e,"",gle),$p=()=>!0,$h=(e,t,n)=>{const r=Ij.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},ple=e=>rle.test(e)&&!ile.test(e),Nj=()=>!1,gle=e=>ole.test(e),mle=e=>ale.test(e),vle=()=>{const e=Jn("colors"),t=Jn("spacing"),n=Jn("blur"),r=Jn("brightness"),i=Jn("borderColor"),o=Jn("borderRadius"),a=Jn("borderSpacing"),s=Jn("borderWidth"),u=Jn("contrast"),l=Jn("grayscale"),c=Jn("hueRotate"),f=Jn("invert"),h=Jn("gap"),p=Jn("gradientColorStops"),m=Jn("gradientColorStopPositions"),y=Jn("inset"),b=Jn("margin"),w=Jn("opacity"),x=Jn("padding"),S=Jn("saturate"),O=Jn("scale"),E=Jn("sepia"),C=Jn("skew"),P=Jn("space"),M=Jn("translate"),N=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",Qt,t],W=()=>[Qt,t],ee=()=>["",qs,Vu],Z=()=>["auto",Ad,Qt],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["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"],j=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",Qt],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],re=()=>[Ad,Qt];return{cacheSize:500,separator:":",theme:{colors:[$p],spacing:[qs,Vu],blur:["none","",Hu,Qt],brightness:re(),borderColor:[e],borderRadius:["none","","full",Hu,Qt],borderSpacing:W(),borderWidth:ee(),contrast:re(),grayscale:K(),hueRotate:re(),invert:K(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[sle,Vu],inset:V(),margin:V(),opacity:re(),padding:W(),saturate:re(),scale:re(),sepia:K(),skew:re(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",Qt]}],container:["container"],columns:[{columns:[Hu]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"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:[...q(),Qt]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dp,Qt]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Qt]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",Dp,Qt]}],"grid-cols":[{"grid-cols":[$p]}],"col-start-end":[{col:["auto",{span:["full",Dp,Qt]},Qt]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[$p]}],"row-start-end":[{row:["auto",{span:[Dp,Qt]},Qt]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Qt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Qt]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"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:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Qt,t]}],"min-w":[{"min-w":[Qt,t,"min","max","fit"]}],"max-w":[{"max-w":[Qt,t,"none","full","min","max","fit","prose",{screen:[Hu]},Hu]}],h:[{h:[Qt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Qt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Qt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Qt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Hu,Vu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ES]}],"font-family":[{font:[$p]}],"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",Qt]}],"line-clamp":[{"line-clamp":["none",Ad,ES]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qs,Qt]}],"list-image":[{"list-image":["none",Qt]}],"list-style-type":[{list:["none","disc","decimal",Qt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qs,Vu]}],"underline-offset":[{"underline-offset":["auto",qs,Qt]}],"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:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qt]}],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",Qt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),cle]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lle]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dle]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"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:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:G()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[qs,Qt]}],"outline-w":[{outline:[qs,Vu]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[qs,Vu]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Hu,hle]}],"shadow-color":[{shadow:[$p]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Hu,Qt]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"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",Qt]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",Qt]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",Qt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[Dp,Qt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Qt]}],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",Qt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"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",Qt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[qs,Vu,ES]}],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"]}}},FXe=Jue(vle);var Lj={exports:{}},yle="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ble=yle,xle=ble;function Fj(){}function jj(){}jj.resetWarningCache=Fj;var wle=function(){function e(r,i,o,a,s,u){if(u!==xle){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:jj,resetWarningCache:Fj};return n.PropTypes=n,n};Lj.exports=wle();var _le=Lj.exports;const Rt=$n(_le);var Sle={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"},Cle=Object.defineProperty,Ele=Object.defineProperties,Ole=Object.getOwnPropertyDescriptors,X1=Object.getOwnPropertySymbols,Bj=Object.prototype.hasOwnProperty,Uj=Object.prototype.propertyIsEnumerable,ZM=(e,t,n)=>t in e?Cle(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XM=(e,t)=>{for(var n in t||(t={}))Bj.call(t,n)&&ZM(e,n,t[n]);if(X1)for(var n of X1(t))Uj.call(t,n)&&ZM(e,n,t[n]);return e},Ale=(e,t)=>Ele(e,Ole(t)),Ple=(e,t)=>{var n={};for(var r in e)Bj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&X1)for(var r of X1(e))t.indexOf(r)<0&&Uj.call(e,r)&&(n[r]=e[r]);return n},xn=(e,t,n)=>{const r=v.forwardRef((i,o)=>{var a=i,{color:s="currentColor",size:u=24,stroke:l=2,children:c}=a,f=Ple(a,["color","size","stroke","children"]);return v.createElement("svg",XM(Ale(XM({ref:o},Sle),{width:u,height:u,stroke:s,strokeWidth:l,className:`tabler-icon tabler-icon-${e}`}),f),[...n.map(([h,p])=>v.createElement(h,p)),...c||[]])});return r.propTypes={color:Rt.string,size:Rt.oneOfType([Rt.string,Rt.number]),stroke:Rt.oneOfType([Rt.string,Rt.number])},r.displayName=`${t}`,r},jXe=xn("adjustments","IconAdjustments",[["path",{d:"M4 10a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M6 4v4",key:"svg-1"}],["path",{d:"M6 12v8",key:"svg-2"}],["path",{d:"M10 16a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-3"}],["path",{d:"M12 4v10",key:"svg-4"}],["path",{d:"M12 18v2",key:"svg-5"}],["path",{d:"M16 7a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-6"}],["path",{d:"M18 4v1",key:"svg-7"}],["path",{d:"M18 9v11",key:"svg-8"}]]),BXe=xn("brand-telegram","IconBrandTelegram",[["path",{d:"M15 10l-4 4l6 6l4 -16l-18 7l4 2l2 6l3 -4",key:"svg-0"}]]),UXe=xn("building-store","IconBuildingStore",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M3 7v1a3 3 0 0 0 6 0v-1m0 1a3 3 0 0 0 6 0v-1m0 1a3 3 0 0 0 6 0v-1h-18l2 -4h14l2 4",key:"svg-1"}],["path",{d:"M5 21l0 -10.15",key:"svg-2"}],["path",{d:"M19 21l0 -10.15",key:"svg-3"}],["path",{d:"M9 21v-4a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v4",key:"svg-4"}]]),zXe=xn("building","IconBuilding",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]]),WXe=xn("cash","IconCash",[["path",{d:"M7 9m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M14 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M17 9v-2a2 2 0 0 0 -2 -2h-10a2 2 0 0 0 -2 2v6a2 2 0 0 0 2 2h2",key:"svg-2"}]]),VXe=xn("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),HXe=xn("chevrons-left","IconChevronsLeft",[["path",{d:"M11 7l-5 5l5 5",key:"svg-0"}],["path",{d:"M17 7l-5 5l5 5",key:"svg-1"}]]),qXe=xn("copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]),KXe=xn("credit-card","IconCreditCard",[["path",{d:"M3 5m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M3 10l18 0",key:"svg-1"}],["path",{d:"M7 15l.01 0",key:"svg-2"}],["path",{d:"M11 15l2 0",key:"svg-3"}]]),GXe=xn("dashboard","IconDashboard",[["path",{d:"M12 13m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M13.45 11.55l2.05 -2.05",key:"svg-1"}],["path",{d:"M6.4 20a9 9 0 1 1 11.2 0z",key:"svg-2"}]]),YXe=xn("device-desktop","IconDeviceDesktop",[["path",{d:"M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10z",key:"svg-0"}],["path",{d:"M7 20h10",key:"svg-1"}],["path",{d:"M9 16v4",key:"svg-2"}],["path",{d:"M15 16v4",key:"svg-3"}]]),ZXe=xn("discount-check","IconDiscountCheck",[["path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]]),XXe=xn("eye-off","IconEyeOff",[["path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828",key:"svg-0"}],["path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]),QXe=xn("eye","IconEye",[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]]),JXe=xn("file-text","IconFileText",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M9 9l1 0",key:"svg-2"}],["path",{d:"M9 13l6 0",key:"svg-3"}],["path",{d:"M9 17l6 0",key:"svg-4"}]]),eQe=xn("loader-2","IconLoader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]),tQe=xn("lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]),nQe=xn("mail","IconMail",[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}]]),rQe=xn("menu-2","IconMenu2",[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]]),iQe=xn("moon","IconMoon",[["path",{d:"M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z",key:"svg-0"}]]),oQe=xn("news","IconNews",[["path",{d:"M16 6h3a1 1 0 0 1 1 1v11a2 2 0 0 1 -4 0v-13a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1v12a3 3 0 0 0 3 3h11",key:"svg-0"}],["path",{d:"M8 8l4 0",key:"svg-1"}],["path",{d:"M8 12l4 0",key:"svg-2"}],["path",{d:"M8 16l4 0",key:"svg-3"}]]),aQe=xn("route","IconRoute",[["path",{d:"M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4z",key:"svg-1"}],["path",{d:"M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5",key:"svg-2"}]]),sQe=xn("server-bolt","IconServerBolt",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M15 20h-9a3 3 0 0 1 -3 -3v-2a3 3 0 0 1 3 -3h12",key:"svg-1"}],["path",{d:"M7 8v.01",key:"svg-2"}],["path",{d:"M7 16v.01",key:"svg-3"}],["path",{d:"M20 15l-2 3h3l-2 3",key:"svg-4"}]]),uQe=xn("server","IconServer",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M3 12m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-1"}],["path",{d:"M7 8l0 .01",key:"svg-2"}],["path",{d:"M7 16l0 .01",key:"svg-3"}]]),lQe=xn("settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]),cQe=xn("sun","IconSun",[["path",{d:"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7",key:"svg-1"}]]),fQe=xn("template","IconTemplate",[["path",{d:"M4 4m0 1a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M4 12m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M14 12l6 0",key:"svg-2"}],["path",{d:"M14 16l6 0",key:"svg-3"}],["path",{d:"M14 20l6 0",key:"svg-4"}]]),dQe=xn("ticket","IconTicket",[["path",{d:"M15 5l0 2",key:"svg-0"}],["path",{d:"M15 11l0 2",key:"svg-1"}],["path",{d:"M15 17l0 2",key:"svg-2"}],["path",{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2",key:"svg-3"}]]),hQe=xn("user-circle","IconUserCircle",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 10m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855",key:"svg-2"}]]),pQe=xn("user","IconUser",[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]]),gQe=xn("users","IconUsers",[["path",{d:"M9 7m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"svg-2"}],["path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85",key:"svg-3"}]]),mQe=xn("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]),kle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],gt=kle.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Pl:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(s,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function zj(e,t){e&&Au.flushSync(()=>e.dispatchEvent(t))}var Tle="Separator",QM="horizontal",Mle=["horizontal","vertical"],Wj=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=QM,...i}=e,o=Rle(r)?r:QM,s=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return I.jsx(gt.div,{"data-orientation":o,...s,...i,ref:t})});Wj.displayName=Tle;function Rle(e){return Mle.includes(e)}var vQe=Wj,Sm=e=>e.type==="checkbox",_c=e=>e instanceof Date,Bi=e=>e==null;const Vj=e=>typeof e=="object";var Ar=e=>!Bi(e)&&!Array.isArray(e)&&Vj(e)&&!_c(e),Hj=e=>Ar(e)&&e.target?Sm(e.target)?e.target.checked:e.target.value:e,Dle=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qj=(e,t)=>e.has(Dle(t)),$le=e=>{const t=e.constructor&&e.constructor.prototype;return Ar(t)&&t.hasOwnProperty("isPrototypeOf")},QO=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function to(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(QO&&(e instanceof Blob||r))&&(n||Ar(e)))if(t=n?[]:{},!n&&!$le(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=to(e[i]));else return e;return t}var uw=e=>Array.isArray(e)?e.filter(Boolean):[],Cr=e=>e===void 0,Ze=(e,t,n)=>{if(!t||!Ar(e))return n;const r=uw(t.split(/[,[\].]+?/)).reduce((i,o)=>Bi(i)?i:i[o],e);return Cr(r)||r===e?Cr(e[t])?n:e[t]:r},aa=e=>typeof e=="boolean",JO=e=>/^\w*$/.test(e),Kj=e=>uw(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pn=(e,t,n)=>{let r=-1;const i=JO(t)?[t]:Kj(t),o=i.length,a=o-1;for(;++rF.useContext(Gj),yQe=e=>{const{children:t,...n}=e;return F.createElement(Gj.Provider,{value:n},t)};var Yj=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Fa.all&&(t._proxyFormState[a]=!r||Fa.all),n&&(n[a]=!0),e[a]}});return i},ro=e=>Ar(e)&&!Object.keys(e).length,Zj=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return ro(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||Fa.all))},_0=e=>Array.isArray(e)?e:[e],Xj=(e,t,n)=>!e||!t||e===t||_0(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function tA(e){const t=F.useRef(e);t.current=e,F.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function Ile(e){const t=eA(),{control:n=t.control,disabled:r,name:i,exact:o}=e,[a,s]=F.useState(n._formState),u=F.useRef(!0),l=F.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=F.useRef(i);return c.current=i,tA({disabled:r,next:f=>u.current&&Xj(c.current,f.name,o)&&Zj(f,l.current,n._updateFormState)&&s({...n._formState,...f}),subject:n._subjects.state}),F.useEffect(()=>(u.current=!0,l.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),F.useMemo(()=>Yj(a,n,l.current,!1),[a,n])}var gs=e=>typeof e=="string",Qj=(e,t,n,r,i)=>gs(e)?(r&&t.watch.add(e),Ze(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Ze(n,o))):(r&&(t.watchAll=!0),n);function Nle(e){const t=eA(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a}=e,s=F.useRef(r);s.current=r,tA({disabled:o,subject:n._subjects.values,next:c=>{Xj(s.current,c.name,a)&&l(to(Qj(s.current,n._names,c.values||n._formValues,!1,i)))}});const[u,l]=F.useState(n._getWatch(r,i));return F.useEffect(()=>n._removeUnmounted()),u}function Lle(e){const t=eA(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o}=e,a=qj(i._names.array,n),s=Nle({control:i,name:n,defaultValue:Ze(i._formValues,n,Ze(i._defaultValues,n,e.defaultValue)),exact:!0}),u=Ile({control:i,name:n,exact:!0}),l=F.useRef(i.register(n,{...e.rules,value:s,...aa(e.disabled)?{disabled:e.disabled}:{}})),c=F.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ze(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ze(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ze(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ze(u.validatingFields,n)},error:{enumerable:!0,get:()=>Ze(u.errors,n)}}),[u,n]),f=F.useMemo(()=>({name:n,value:s,...aa(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:h=>l.current.onChange({target:{value:Hj(h),name:n},type:Q1.CHANGE}),onBlur:()=>l.current.onBlur({target:{value:Ze(i._formValues,n),name:n},type:Q1.BLUR}),ref:h=>{const p=Ze(i._fields,n);p&&h&&(p._f.ref={focus:()=>h.focus(),select:()=>h.select(),setCustomValidity:m=>h.setCustomValidity(m),reportValidity:()=>h.reportValidity()})}}),[n,i._formValues,r,u.disabled,s,i._fields]);return F.useEffect(()=>{const h=i._options.shouldUnregister||o,p=(m,y)=>{const b=Ze(i._fields,m);b&&b._f&&(b._f.mount=y)};if(p(n,!0),h){const m=to(Ze(i._options.defaultValues,n));Pn(i._defaultValues,n,m),Cr(Ze(i._formValues,n))&&Pn(i._formValues,n,m)}return!a&&i.register(n),()=>{(a?h&&!i._state.action:h)?i.unregister(n):p(n,!1)}},[n,i,a,o]),F.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),F.useMemo(()=>({field:f,formState:u,fieldState:c}),[f,u,c])}const bQe=e=>e.render(Lle(e));var Jj=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},JM=e=>({isOnSubmit:!e||e===Fa.onSubmit,isOnBlur:e===Fa.onBlur,isOnChange:e===Fa.onChange,isOnAll:e===Fa.all,isOnTouch:e===Fa.onTouched}),eR=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const S0=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Ze(e,i);if(o){const{_f:a,...s}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(S0(s,t))break}else if(Ar(s)&&S0(s,t))break}}};var Fle=(e,t,n)=>{const r=_0(Ze(e,n));return Pn(r,"root",t[n]),Pn(e,n,r),e},nA=e=>e.type==="file",ds=e=>typeof e=="function",J1=e=>{if(!QO)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},f1=e=>gs(e),rA=e=>e.type==="radio",eb=e=>e instanceof RegExp;const tR={value:!1,isValid:!1},nR={value:!0,isValid:!0};var eB=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Cr(e[0].attributes.value)?Cr(e[0].value)||e[0].value===""?nR:{value:e[0].value,isValid:!0}:nR:tR}return tR};const rR={isValid:!1,value:null};var tB=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,rR):rR;function iR(e,t,n="validate"){if(f1(e)||Array.isArray(e)&&e.every(f1)||aa(e)&&!e)return{type:n,message:f1(e)?e:"",ref:t}}var Uf=e=>Ar(e)&&!eb(e)?e:{value:e,message:""},oR=async(e,t,n,r,i,o)=>{const{ref:a,refs:s,required:u,maxLength:l,minLength:c,min:f,max:h,pattern:p,validate:m,name:y,valueAsNumber:b,mount:w}=e._f,x=Ze(n,y);if(!w||t.has(y))return{};const S=s?s[0]:a,O=W=>{i&&S.reportValidity&&(S.setCustomValidity(aa(W)?"":W||""),S.reportValidity())},E={},C=rA(a),P=Sm(a),M=C||P,N=(b||nA(a))&&Cr(a.value)&&Cr(x)||J1(a)&&a.value===""||x===""||Array.isArray(x)&&!x.length,B=Jj.bind(null,y,r,E),V=(W,ee,Z,q=Ks.maxLength,G=Ks.minLength)=>{const H=W?ee:Z;E[y]={type:W?q:G,message:H,ref:a,...B(W?q:G,H)}};if(o?!Array.isArray(x)||!x.length:u&&(!M&&(N||Bi(x))||aa(x)&&!x||P&&!eB(s).isValid||C&&!tB(s).isValid)){const{value:W,message:ee}=f1(u)?{value:!!u,message:u}:Uf(u);if(W&&(E[y]={type:Ks.required,message:ee,ref:S,...B(Ks.required,ee)},!r))return O(ee),E}if(!N&&(!Bi(f)||!Bi(h))){let W,ee;const Z=Uf(h),q=Uf(f);if(!Bi(x)&&!isNaN(x)){const G=a.valueAsNumber||x&&+x;Bi(Z.value)||(W=G>Z.value),Bi(q.value)||(ee=Gnew Date(new Date().toDateString()+" "+Y),j=a.type=="time",K=a.type=="week";gs(Z.value)&&x&&(W=j?H(x)>H(Z.value):K?x>Z.value:G>new Date(Z.value)),gs(q.value)&&x&&(ee=j?H(x)+W.value,q=!Bi(ee.value)&&x.length<+ee.value;if((Z||q)&&(V(Z,W.message,ee.message),!r))return O(E[y].message),E}if(p&&!N&&gs(x)){const{value:W,message:ee}=Uf(p);if(eb(W)&&!x.match(W)&&(E[y]={type:Ks.pattern,message:ee,ref:a,...B(Ks.pattern,ee)},!r))return O(ee),E}if(m){if(ds(m)){const W=await m(x,n),ee=iR(W,S);if(ee&&(E[y]={...ee,...B(Ks.validate,ee.message)},!r))return O(ee.message),E}else if(Ar(m)){let W={};for(const ee in m){if(!ro(W)&&!r)break;const Z=iR(await m[ee](x,n),S,ee);Z&&(W={...Z,...B(ee,Z.message)},O(Z.message),r&&(E[y]=W))}if(!ro(W)&&(E[y]={ref:S,...W},!r))return E}}return O(!0),E};function jle(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},oE=e=>Bi(e)||!Vj(e);function nl(e,t){if(oE(e)||oE(t))return e===t;if(_c(e)&&_c(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const a=t[i];if(_c(o)&&_c(a)||Ar(o)&&Ar(a)||Array.isArray(o)&&Array.isArray(a)?!nl(o,a):o!==a)return!1}}return!0}var nB=e=>e.type==="select-multiple",Ule=e=>rA(e)||Sm(e),AS=e=>J1(e)&&e.isConnected,rB=e=>{for(const t in e)if(ds(e[t]))return!0;return!1};function tb(e,t={}){const n=Array.isArray(e);if(Ar(e)||n)for(const r in e)Array.isArray(e[r])||Ar(e[r])&&!rB(e[r])?(t[r]=Array.isArray(e[r])?[]:{},tb(e[r],t[r])):Bi(e[r])||(t[r]=!0);return t}function iB(e,t,n){const r=Array.isArray(e);if(Ar(e)||r)for(const i in e)Array.isArray(e[i])||Ar(e[i])&&!rB(e[i])?Cr(t)||oE(n[i])?n[i]=Array.isArray(e[i])?tb(e[i],[]):{...tb(e[i])}:iB(e[i],Bi(t)?{}:t[i],n[i]):n[i]=!nl(e[i],t[i]);return n}var Ip=(e,t)=>iB(e,t,tb(t)),oB=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Cr(e)?e:t?e===""?NaN:e&&+e:n&&gs(e)?new Date(e):r?r(e):e;function PS(e){const t=e.ref;return nA(t)?t.files:rA(t)?tB(e.refs).value:nB(t)?[...t.selectedOptions].map(({value:n})=>n):Sm(t)?eB(e.refs).value:oB(Cr(t.value)?e.ref.value:t.value,e)}var zle=(e,t,n,r)=>{const i={};for(const o of e){const a=Ze(t,o);a&&Pn(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Np=e=>Cr(e)?e:eb(e)?e.source:Ar(e)?eb(e.value)?e.value.source:e.value:e;const aR="AsyncFunction";var Wle=e=>!!e&&!!e.validate&&!!(ds(e.validate)&&e.validate.constructor.name===aR||Ar(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===aR)),Vle=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function sR(e,t,n){const r=Ze(e,n);if(r||JO(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Ze(t,o),s=Ze(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(s&&s.type)return{name:o,error:s};i.pop()}return{name:n}}var Hle=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,qle=(e,t)=>!uw(Ze(e,t)).length&&Ur(e,t);const Kle={mode:Fa.onSubmit,reValidateMode:Fa.onChange,shouldFocusError:!0};function Gle(e={}){let t={...Kle,...e},n={submitCount:0,isDirty:!1,isLoading:ds(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=Ar(t.defaultValues)||Ar(t.values)?to(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:to(i),a={action:!1,mount:!1,watch:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,l=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:OS(),array:OS(),state:OS()},h=JM(t.mode),p=JM(t.reValidateMode),m=t.criteriaMode===Fa.all,y=ne=>de=>{clearTimeout(l),l=setTimeout(ne,de)},b=async ne=>{if(!t.disabled&&(c.isValid||ne)){const de=t.resolver?ro((await M()).errors):await B(r,!0);de!==n.isValid&&f.state.next({isValid:de})}},w=(ne,de)=>{!t.disabled&&(c.isValidating||c.validatingFields)&&((ne||Array.from(s.mount)).forEach(ge=>{ge&&(de?Pn(n.validatingFields,ge,de):Ur(n.validatingFields,ge))}),f.state.next({validatingFields:n.validatingFields,isValidating:!ro(n.validatingFields)}))},x=(ne,de=[],ge,Ue,Fe=!0,Ae=!0)=>{if(Ue&&ge&&!t.disabled){if(a.action=!0,Ae&&Array.isArray(Ze(r,ne))){const tt=ge(Ze(r,ne),Ue.argA,Ue.argB);Fe&&Pn(r,ne,tt)}if(Ae&&Array.isArray(Ze(n.errors,ne))){const tt=ge(Ze(n.errors,ne),Ue.argA,Ue.argB);Fe&&Pn(n.errors,ne,tt),qle(n.errors,ne)}if(c.touchedFields&&Ae&&Array.isArray(Ze(n.touchedFields,ne))){const tt=ge(Ze(n.touchedFields,ne),Ue.argA,Ue.argB);Fe&&Pn(n.touchedFields,ne,tt)}c.dirtyFields&&(n.dirtyFields=Ip(i,o)),f.state.next({name:ne,isDirty:W(ne,de),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Pn(o,ne,de)},S=(ne,de)=>{Pn(n.errors,ne,de),f.state.next({errors:n.errors})},O=ne=>{n.errors=ne,f.state.next({errors:n.errors,isValid:!1})},E=(ne,de,ge,Ue)=>{const Fe=Ze(r,ne);if(Fe){const Ae=Ze(o,ne,Cr(ge)?Ze(i,ne):ge);Cr(Ae)||Ue&&Ue.defaultChecked||de?Pn(o,ne,de?Ae:PS(Fe._f)):q(ne,Ae),a.mount&&b()}},C=(ne,de,ge,Ue,Fe)=>{let Ae=!1,tt=!1;const mt={name:ne};if(!t.disabled){const wn=!!(Ze(r,ne)&&Ze(r,ne)._f&&Ze(r,ne)._f.disabled);if(!ge||Ue){c.isDirty&&(tt=n.isDirty,n.isDirty=mt.isDirty=W(),Ae=tt!==mt.isDirty);const Kt=wn||nl(Ze(i,ne),de);tt=!!(!wn&&Ze(n.dirtyFields,ne)),Kt||wn?Ur(n.dirtyFields,ne):Pn(n.dirtyFields,ne,!0),mt.dirtyFields=n.dirtyFields,Ae=Ae||c.dirtyFields&&tt!==!Kt}if(ge){const Kt=Ze(n.touchedFields,ne);Kt||(Pn(n.touchedFields,ne,ge),mt.touchedFields=n.touchedFields,Ae=Ae||c.touchedFields&&Kt!==ge)}Ae&&Fe&&f.state.next(mt)}return Ae?mt:{}},P=(ne,de,ge,Ue)=>{const Fe=Ze(n.errors,ne),Ae=c.isValid&&aa(de)&&n.isValid!==de;if(t.delayError&&ge?(u=y(()=>S(ne,ge)),u(t.delayError)):(clearTimeout(l),u=null,ge?Pn(n.errors,ne,ge):Ur(n.errors,ne)),(ge?!nl(Fe,ge):Fe)||!ro(Ue)||Ae){const tt={...Ue,...Ae&&aa(de)?{isValid:de}:{},errors:n.errors,name:ne};n={...n,...tt},f.state.next(tt)}},M=async ne=>{w(ne,!0);const de=await t.resolver(o,t.context,zle(ne||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(ne),de},N=async ne=>{const{errors:de}=await M(ne);if(ne)for(const ge of ne){const Ue=Ze(de,ge);Ue?Pn(n.errors,ge,Ue):Ur(n.errors,ge)}else n.errors=de;return de},B=async(ne,de,ge={valid:!0})=>{for(const Ue in ne){const Fe=ne[Ue];if(Fe){const{_f:Ae,...tt}=Fe;if(Ae){const mt=s.array.has(Ae.name),wn=Fe._f&&Wle(Fe._f);wn&&c.validatingFields&&w([Ue],!0);const Kt=await oR(Fe,s.disabled,o,m,t.shouldUseNativeValidation&&!de,mt);if(wn&&c.validatingFields&&w([Ue]),Kt[Ae.name]&&(ge.valid=!1,de))break;!de&&(Ze(Kt,Ae.name)?mt?Fle(n.errors,Kt,Ae.name):Pn(n.errors,Ae.name,Kt[Ae.name]):Ur(n.errors,Ae.name))}!ro(tt)&&await B(tt,de,ge)}}return ge.valid},V=()=>{for(const ne of s.unMount){const de=Ze(r,ne);de&&(de._f.refs?de._f.refs.every(ge=>!AS(ge)):!AS(de._f.ref))&&He(ne)}s.unMount=new Set},W=(ne,de)=>!t.disabled&&(ne&&de&&Pn(o,ne,de),!nl(re(),i)),ee=(ne,de,ge)=>Qj(ne,s,{...a.mount?o:Cr(de)?i:gs(ne)?{[ne]:de}:de},ge,de),Z=ne=>uw(Ze(a.mount?o:i,ne,t.shouldUnregister?Ze(i,ne,[]):[])),q=(ne,de,ge={})=>{const Ue=Ze(r,ne);let Fe=de;if(Ue){const Ae=Ue._f;Ae&&(!Ae.disabled&&Pn(o,ne,oB(de,Ae)),Fe=J1(Ae.ref)&&Bi(de)?"":de,nB(Ae.ref)?[...Ae.ref.options].forEach(tt=>tt.selected=Fe.includes(tt.value)):Ae.refs?Sm(Ae.ref)?Ae.refs.length>1?Ae.refs.forEach(tt=>(!tt.defaultChecked||!tt.disabled)&&(tt.checked=Array.isArray(Fe)?!!Fe.find(mt=>mt===tt.value):Fe===tt.value)):Ae.refs[0]&&(Ae.refs[0].checked=!!Fe):Ae.refs.forEach(tt=>tt.checked=tt.value===Fe):nA(Ae.ref)?Ae.ref.value="":(Ae.ref.value=Fe,Ae.ref.type||f.values.next({name:ne,values:{...o}})))}(ge.shouldDirty||ge.shouldTouch)&&C(ne,Fe,ge.shouldTouch,ge.shouldDirty,!0),ge.shouldValidate&&Y(ne)},G=(ne,de,ge)=>{for(const Ue in de){const Fe=de[Ue],Ae=`${ne}.${Ue}`,tt=Ze(r,Ae);(s.array.has(ne)||Ar(Fe)||tt&&!tt._f)&&!_c(Fe)?G(Ae,Fe,ge):q(Ae,Fe,ge)}},H=(ne,de,ge={})=>{const Ue=Ze(r,ne),Fe=s.array.has(ne),Ae=to(de);Pn(o,ne,Ae),Fe?(f.array.next({name:ne,values:{...o}}),(c.isDirty||c.dirtyFields)&&ge.shouldDirty&&f.state.next({name:ne,dirtyFields:Ip(i,o),isDirty:W(ne,Ae)})):Ue&&!Ue._f&&!Bi(Ae)?G(ne,Ae,ge):q(ne,Ae,ge),eR(ne,s)&&f.state.next({...n}),f.values.next({name:a.mount?ne:void 0,values:{...o}})},j=async ne=>{a.mount=!0;const de=ne.target;let ge=de.name,Ue=!0;const Fe=Ze(r,ge),Ae=()=>de.type?PS(Fe._f):Hj(ne),tt=mt=>{Ue=Number.isNaN(mt)||_c(mt)&&isNaN(mt.getTime())||nl(mt,Ze(o,ge,mt))};if(Fe){let mt,wn;const Kt=Ae(),_n=ne.type===Q1.BLUR||ne.type===Q1.FOCUS_OUT,$i=!Vle(Fe._f)&&!t.resolver&&!Ze(n.errors,ge)&&!Fe._f.deps||Hle(_n,Ze(n.touchedFields,ge),n.isSubmitted,p,h),xr=eR(ge,s,_n);Pn(o,ge,Kt),_n?(Fe._f.onBlur&&Fe._f.onBlur(ne),u&&u(0)):Fe._f.onChange&&Fe._f.onChange(ne);const mi=C(ge,Kt,_n,!1),ur=!ro(mi)||xr;if(!_n&&f.values.next({name:ge,type:ne.type,values:{...o}}),$i)return c.isValid&&(t.mode==="onBlur"&&_n?b():_n||b()),ur&&f.state.next({name:ge,...xr?{}:mi});if(!_n&&xr&&f.state.next({...n}),t.resolver){const{errors:ai}=await M([ge]);if(tt(Kt),Ue){const vi=sR(n.errors,r,ge),Dr=sR(ai,r,vi.name||ge);mt=Dr.error,ge=Dr.name,wn=ro(ai)}}else w([ge],!0),mt=(await oR(Fe,s.disabled,o,m,t.shouldUseNativeValidation))[ge],w([ge]),tt(Kt),Ue&&(mt?wn=!1:c.isValid&&(wn=await B(r,!0)));Ue&&(Fe._f.deps&&Y(Fe._f.deps),P(ge,wn,mt,mi))}},K=(ne,de)=>{if(Ze(n.errors,de)&&ne.focus)return ne.focus(),1},Y=async(ne,de={})=>{let ge,Ue;const Fe=_0(ne);if(t.resolver){const Ae=await N(Cr(ne)?ne:Fe);ge=ro(Ae),Ue=ne?!Fe.some(tt=>Ze(Ae,tt)):ge}else ne?(Ue=(await Promise.all(Fe.map(async Ae=>{const tt=Ze(r,Ae);return await B(tt&&tt._f?{[Ae]:tt}:tt)}))).every(Boolean),!(!Ue&&!n.isValid)&&b()):Ue=ge=await B(r);return f.state.next({...!gs(ne)||c.isValid&&ge!==n.isValid?{}:{name:ne},...t.resolver||!ne?{isValid:ge}:{},errors:n.errors}),de.shouldFocus&&!Ue&&S0(r,K,ne?Fe:s.mount),Ue},re=ne=>{const de={...a.mount?o:i};return Cr(ne)?de:gs(ne)?Ze(de,ne):ne.map(ge=>Ze(de,ge))},ie=(ne,de)=>({invalid:!!Ze((de||n).errors,ne),isDirty:!!Ze((de||n).dirtyFields,ne),error:Ze((de||n).errors,ne),isValidating:!!Ze(n.validatingFields,ne),isTouched:!!Ze((de||n).touchedFields,ne)}),se=ne=>{ne&&_0(ne).forEach(de=>Ur(n.errors,de)),f.state.next({errors:ne?n.errors:{}})},ye=(ne,de,ge)=>{const Ue=(Ze(r,ne,{_f:{}})._f||{}).ref,Fe=Ze(n.errors,ne)||{},{ref:Ae,message:tt,type:mt,...wn}=Fe;Pn(n.errors,ne,{...wn,...de,ref:Ue}),f.state.next({name:ne,errors:n.errors,isValid:!1}),ge&&ge.shouldFocus&&Ue&&Ue.focus&&Ue.focus()},we=(ne,de)=>ds(ne)?f.values.subscribe({next:ge=>ne(ee(void 0,de),ge)}):ee(ne,de,!0),He=(ne,de={})=>{for(const ge of ne?_0(ne):s.mount)s.mount.delete(ge),s.array.delete(ge),de.keepValue||(Ur(r,ge),Ur(o,ge)),!de.keepError&&Ur(n.errors,ge),!de.keepDirty&&Ur(n.dirtyFields,ge),!de.keepTouched&&Ur(n.touchedFields,ge),!de.keepIsValidating&&Ur(n.validatingFields,ge),!t.shouldUnregister&&!de.keepDefaultValue&&Ur(i,ge);f.values.next({values:{...o}}),f.state.next({...n,...de.keepDirty?{isDirty:W()}:{}}),!de.keepIsValid&&b()},Ee=({disabled:ne,name:de,field:ge,fields:Ue})=>{(aa(ne)&&a.mount||ne||s.disabled.has(de))&&(ne?s.disabled.add(de):s.disabled.delete(de),C(de,PS(ge?ge._f:Ze(Ue,de)._f),!1,!1,!0))},it=(ne,de={})=>{let ge=Ze(r,ne);const Ue=aa(de.disabled)||aa(t.disabled);return Pn(r,ne,{...ge||{},_f:{...ge&&ge._f?ge._f:{ref:{name:ne}},name:ne,mount:!0,...de}}),s.mount.add(ne),ge?Ee({field:ge,disabled:aa(de.disabled)?de.disabled:t.disabled,name:ne}):E(ne,!0,de.value),{...Ue?{disabled:de.disabled||t.disabled}:{},...t.progressive?{required:!!de.required,min:Np(de.min),max:Np(de.max),minLength:Np(de.minLength),maxLength:Np(de.maxLength),pattern:Np(de.pattern)}:{},name:ne,onChange:j,onBlur:j,ref:Fe=>{if(Fe){it(ne,de),ge=Ze(r,ne);const Ae=Cr(Fe.value)&&Fe.querySelectorAll&&Fe.querySelectorAll("input,select,textarea")[0]||Fe,tt=Ule(Ae),mt=ge._f.refs||[];if(tt?mt.find(wn=>wn===Ae):Ae===ge._f.ref)return;Pn(r,ne,{_f:{...ge._f,...tt?{refs:[...mt.filter(AS),Ae,...Array.isArray(Ze(i,ne))?[{}]:[]],ref:{type:Ae.type,name:ne}}:{ref:Ae}}}),E(ne,!1,void 0,Ae)}else ge=Ze(r,ne,{}),ge._f&&(ge._f.mount=!1),(t.shouldUnregister||de.shouldUnregister)&&!(qj(s.array,ne)&&a.action)&&s.unMount.add(ne)}}},ke=()=>t.shouldFocusError&&S0(r,K,s.mount),Le=ne=>{aa(ne)&&(f.state.next({disabled:ne}),S0(r,(de,ge)=>{const Ue=Ze(r,ge);Ue&&(de.disabled=Ue._f.disabled||ne,Array.isArray(Ue._f.refs)&&Ue._f.refs.forEach(Fe=>{Fe.disabled=Ue._f.disabled||ne}))},0,!1))},De=(ne,de)=>async ge=>{let Ue;ge&&(ge.preventDefault&&ge.preventDefault(),ge.persist&&ge.persist());let Fe=to(o);if(s.disabled.size)for(const Ae of s.disabled)Pn(Fe,Ae,void 0);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:Ae,values:tt}=await M();n.errors=Ae,Fe=tt}else await B(r);if(Ur(n.errors,"root"),ro(n.errors)){f.state.next({errors:{}});try{await ne(Fe,ge)}catch(Ae){Ue=Ae}}else de&&await de({...n.errors},ge),ke(),setTimeout(ke);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ro(n.errors)&&!Ue,submitCount:n.submitCount+1,errors:n.errors}),Ue)throw Ue},me=(ne,de={})=>{Ze(r,ne)&&(Cr(de.defaultValue)?H(ne,to(Ze(i,ne))):(H(ne,de.defaultValue),Pn(i,ne,to(de.defaultValue))),de.keepTouched||Ur(n.touchedFields,ne),de.keepDirty||(Ur(n.dirtyFields,ne),n.isDirty=de.defaultValue?W(ne,to(Ze(i,ne))):W()),de.keepError||(Ur(n.errors,ne),c.isValid&&b()),f.state.next({...n}))},yt=(ne,de={})=>{const ge=ne?to(ne):i,Ue=to(ge),Fe=ro(ne),Ae=Fe?i:Ue;if(de.keepDefaultValues||(i=ge),!de.keepValues){if(de.keepDirtyValues){const tt=new Set([...s.mount,...Object.keys(Ip(i,o))]);for(const mt of Array.from(tt))Ze(n.dirtyFields,mt)?Pn(Ae,mt,Ze(o,mt)):H(mt,Ze(Ae,mt))}else{if(QO&&Cr(ne))for(const tt of s.mount){const mt=Ze(r,tt);if(mt&&mt._f){const wn=Array.isArray(mt._f.refs)?mt._f.refs[0]:mt._f.ref;if(J1(wn)){const Kt=wn.closest("form");if(Kt){Kt.reset();break}}}}r={}}o=t.shouldUnregister?de.keepDefaultValues?to(i):{}:to(Ae),f.array.next({values:{...Ae}}),f.values.next({values:{...Ae}})}s={mount:de.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!c.isValid||!!de.keepIsValid||!!de.keepDirtyValues,a.watch=!!t.shouldUnregister,f.state.next({submitCount:de.keepSubmitCount?n.submitCount:0,isDirty:Fe?!1:de.keepDirty?n.isDirty:!!(de.keepDefaultValues&&!nl(ne,i)),isSubmitted:de.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Fe?{}:de.keepDirtyValues?de.keepDefaultValues&&o?Ip(i,o):n.dirtyFields:de.keepDefaultValues&&ne?Ip(i,ne):de.keepDirty?n.dirtyFields:{},touchedFields:de.keepTouched?n.touchedFields:{},errors:de.keepErrors?n.errors:{},isSubmitSuccessful:de.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},lt=(ne,de)=>yt(ds(ne)?ne(o):ne,de);return{control:{register:it,unregister:He,getFieldState:ie,handleSubmit:De,setError:ye,_executeSchema:M,_getWatch:ee,_getDirty:W,_updateValid:b,_removeUnmounted:V,_updateFieldArray:x,_updateDisabledField:Ee,_getFieldArray:Z,_reset:yt,_resetDefaultValues:()=>ds(t.defaultValues)&&t.defaultValues().then(ne=>{lt(ne,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:ne=>{n={...n,...ne}},_disableForm:Le,_subjects:f,_proxyFormState:c,_setErrors:O,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(ne){a=ne},get _defaultValues(){return i},get _names(){return s},set _names(ne){s=ne},get _formState(){return n},set _formState(ne){n=ne},get _options(){return t},set _options(ne){t={...t,...ne}}},trigger:Y,register:it,handleSubmit:De,watch:we,setValue:H,getValues:re,reset:lt,resetField:me,clearErrors:se,unregister:He,setError:ye,setFocus:(ne,de={})=>{const ge=Ze(r,ne),Ue=ge&&ge._f;if(Ue){const Fe=Ue.refs?Ue.refs[0]:Ue.ref;Fe.focus&&(Fe.focus(),de.shouldSelect&&ds(Fe.select)&&Fe.select())}},getFieldState:ie}}function xQe(e={}){const t=F.useRef(void 0),n=F.useRef(void 0),[r,i]=F.useState({isDirty:!1,isValidating:!1,isLoading:ds(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ds(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Gle(e),formState:r});const o=t.current.control;return o._options=e,tA({subject:o._subjects.state,next:a=>{Zj(a,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),F.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),F.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),F.useEffect(()=>{e.values&&!nl(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i(a=>({...a}))):o._resetDefaultValues()},[e.values,o]),F.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),F.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),F.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=Yj(r,o),t.current}const uR=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ze(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},aB=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?uR(r.ref,n,e):r.refs&&r.refs.forEach(i=>uR(i,n,e))}},Yle=(e,t)=>{t.shouldUseNativeValidation&&aB(e,t);const n={};for(const r in e){const i=Ze(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(Zle(t.names||Object.keys(e),r)){const a=Object.assign({},Ze(n,r));Pn(a,"root",o),Pn(n,r,a)}else Pn(n,r,o)}return n},Zle=(e,t)=>e.some(n=>n.startsWith(t+"."));var Xle=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[a]={message:s.message,type:s.code}}else n[a]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(c){return c.errors.forEach(function(f){return e.push(f)})}),t){var u=n[a].types,l=u&&u[r.code];n[a]=Jj(a,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n},wQe=function(e,t,n){return n===void 0&&(n={}),function(r,i,o){try{return Promise.resolve(function(a,s){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return o.shouldUseNativeValidation&&aB({},o),{errors:{},values:n.raw?r:l}})}catch(l){return s(l)}return u&&u.then?u.then(void 0,s):u}(0,function(a){if(function(s){return Array.isArray(s?.errors)}(a))return{values:{},errors:Yle(Xle(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},gn;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(gn||(gn={}));var aE;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(aE||(aE={}));const rt=gn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nu=e=>{switch(typeof e){case"undefined":return rt.undefined;case"string":return rt.string;case"number":return isNaN(e)?rt.nan:rt.number;case"boolean":return rt.boolean;case"function":return rt.function;case"bigint":return rt.bigint;case"symbol":return rt.symbol;case"object":return Array.isArray(e)?rt.array:e===null?rt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?rt.promise:typeof Map<"u"&&e instanceof Map?rt.map:typeof Set<"u"&&e instanceof Set?rt.set:typeof Date<"u"&&e instanceof Date?rt.date:rt.object;default:return rt.unknown}},ze=gn.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"]),Qle=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class No extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;un.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}No.create=e=>new No(e);const Gd=(e,t)=>{let n;switch(e.code){case ze.invalid_type:e.received===rt.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ze.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,gn.jsonStringifyReplacer)}`;break;case ze.unrecognized_keys:n=`Unrecognized key(s) in object: ${gn.joinValues(e.keys,", ")}`;break;case ze.invalid_union:n="Invalid input";break;case ze.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${gn.joinValues(e.options)}`;break;case ze.invalid_enum_value:n=`Invalid enum value. Expected ${gn.joinValues(e.options)}, received '${e.received}'`;break;case ze.invalid_arguments:n="Invalid function arguments";break;case ze.invalid_return_type:n="Invalid function return type";break;case ze.invalid_date:n="Invalid date";break;case ze.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:gn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ze.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ze.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ze.custom:n="Invalid input";break;case ze.invalid_intersection_types:n="Intersection results could not be merged";break;case ze.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ze.not_finite:n="Number must be finite";break;default:n=t.defaultError,gn.assertNever(e)}return{message:n}};let sB=Gd;function Jle(e){sB=e}function nb(){return sB}const rb=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="";const u=r.filter(l=>!!l).slice().reverse();for(const l of u)s=l(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},ece=[];function et(e,t){const n=nb(),r=rb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Gd?void 0:Gd].filter(i=>!!i)});e.common.issues.push(r)}class Ri{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return $t;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,a=await i.value;r.push({key:o,value:a})}return Ri.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return $t;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const $t=Object.freeze({status:"aborted"}),md=e=>({status:"dirty",value:e}),Vi=e=>({status:"valid",value:e}),sE=e=>e.status==="aborted",uE=e=>e.status==="dirty",Vc=e=>e.status==="valid",tg=e=>typeof Promise<"u"&&e instanceof Promise;function ib(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function uB(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var dt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(dt||(dt={}));var a0,s0;class Ps{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const lR=(e,t)=>{if(Vc(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 n=new No(e.common.issues);return this._error=n,this._error}}};function Yt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{var u,l;const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(u=c??r)!==null&&u!==void 0?u:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(l=c??n)!==null&&l!==void 0?l:s.defaultError}},description:i}}class en{get description(){return this._def.description}_getType(t){return nu(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:nu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ri,ctx:{common:t.parent.common,data:t.data,parsedType:nu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(tg(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)},o=this._parseSync({data:t,path:i.path,parent:i});return lR(i,o)}"~validate"(t){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:i});return Vc(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((r=(n=o?.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(o=>Vc(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(tg(i)?i:Promise.resolve(i));return lR(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:ze.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Ya({schema:this,typeName:Tt.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:n=>this["~validate"](n)}}optional(){return Cs.create(this,this._def)}nullable(){return Rl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ha.create(this)}promise(){return Zd.create(this,this._def)}or(t){return og.create([this,t],this._def)}and(t){return ag.create(this,t,this._def)}transform(t){return new Ya({...Yt(this._def),schema:this,typeName:Tt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new fg({...Yt(this._def),innerType:this,defaultValue:n,typeName:Tt.ZodDefault})}brand(){return new iA({typeName:Tt.ZodBranded,type:this,...Yt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new dg({...Yt(this._def),innerType:this,catchValue:n,typeName:Tt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Cm.create(this,t)}readonly(){return hg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tce=/^c[^\s-]{8,}$/i,nce=/^[0-9a-z]+$/,rce=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ice=/^[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,oce=/^[a-z0-9_-]{21}$/i,ace=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sce=/^[-+]?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)?)??$/,uce=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lce="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kS;const cce=/^(?:(?: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])$/,fce=/^(?:(?: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])$/,dce=/^(([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]))$/,hce=/^(([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])$/,pce=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,gce=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lB="((\\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])))",mce=new RegExp(`^${lB}$`);function cB(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function vce(e){return new RegExp(`^${cB(e)}$`)}function fB(e){let t=`${lB}T${cB(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function yce(e,t){return!!((t==="v4"||!t)&&cce.test(e)||(t==="v6"||!t)&&dce.test(e))}function bce(e,t){if(!ace.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function xce(e,t){return!!((t==="v4"||!t)&&fce.test(e)||(t==="v6"||!t)&&hce.test(e))}class Ua extends en{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==rt.string){const o=this._getOrReturnCtx(t);return et(o,{code:ze.invalid_type,expected:rt.string,received:o.parsedType}),$t}const r=new Ri;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(i=this._getOrReturnCtx(t,i),et(i,{code:ze.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.lengtht.test(i),{validation:n,code:ze.invalid_string,...dt.errToObj(r)})}_addCheck(t){return new Ua({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...dt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...dt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...dt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...dt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...dt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...dt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...dt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...dt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...dt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...dt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...dt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...dt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...dt.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,local:(r=t?.local)!==null&&r!==void 0?r:!1,...dt.errToObj(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?.precision>"u"?null:t?.precision,...dt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...dt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...dt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...dt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...dt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...dt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...dt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...dt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...dt.errToObj(n)})}nonempty(t){return this.min(1,dt.errToObj(t))}trim(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ua({...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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ua({checks:[],typeName:Tt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Yt(e)})};function wce(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class kl extends en{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)!==rt.number){const o=this._getOrReturnCtx(t);return et(o,{code:ze.invalid_type,expected:rt.number,received:o.parsedType}),$t}let r;const i=new Ri;for(const o of this._def.checks)o.kind==="int"?gn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),et(r,{code:ze.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),et(r,{code:ze.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?wce(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),et(r,{code:ze.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),et(r,{code:ze.not_finite,message:o.message}),i.dirty()):gn.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,dt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,dt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,dt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,dt.toString(n))}setLimit(t,n,r,i){return new kl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:dt.toString(i)}]})}_addCheck(t){return new kl({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:dt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:dt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:dt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:dt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:dt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:dt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:dt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:dt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:dt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&gn.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew kl({checks:[],typeName:Tt.ZodNumber,coerce:e?.coerce||!1,...Yt(e)});class Tl extends en{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)!==rt.bigint)return this._getInvalidInput(t);let r;const i=new Ri;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),et(r,{code:ze.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),et(r,{code:ze.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):gn.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return et(n,{code:ze.invalid_type,expected:rt.bigint,received:n.parsedType}),$t}gte(t,n){return this.setLimit("min",t,!0,dt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,dt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,dt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,dt.toString(n))}setLimit(t,n,r,i){return new Tl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:dt.toString(i)}]})}_addCheck(t){return new Tl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:dt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:dt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:dt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:dt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:dt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Tl({checks:[],typeName:Tt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Yt(e)})};class ng extends en{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==rt.boolean){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.boolean,received:r.parsedType}),$t}return Vi(t.data)}}ng.create=e=>new ng({typeName:Tt.ZodBoolean,coerce:e?.coerce||!1,...Yt(e)});class Hc extends en{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==rt.date){const o=this._getOrReturnCtx(t);return et(o,{code:ze.invalid_type,expected:rt.date,received:o.parsedType}),$t}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return et(o,{code:ze.invalid_date}),$t}const r=new Ri;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(i=this._getOrReturnCtx(t,i),et(i,{code:ze.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):gn.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Hc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:dt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:dt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Hc({checks:[],coerce:e?.coerce||!1,typeName:Tt.ZodDate,...Yt(e)});class ob extends en{_parse(t){if(this._getType(t)!==rt.symbol){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.symbol,received:r.parsedType}),$t}return Vi(t.data)}}ob.create=e=>new ob({typeName:Tt.ZodSymbol,...Yt(e)});class rg extends en{_parse(t){if(this._getType(t)!==rt.undefined){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.undefined,received:r.parsedType}),$t}return Vi(t.data)}}rg.create=e=>new rg({typeName:Tt.ZodUndefined,...Yt(e)});class ig extends en{_parse(t){if(this._getType(t)!==rt.null){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.null,received:r.parsedType}),$t}return Vi(t.data)}}ig.create=e=>new ig({typeName:Tt.ZodNull,...Yt(e)});class Yd extends en{constructor(){super(...arguments),this._any=!0}_parse(t){return Vi(t.data)}}Yd.create=e=>new Yd({typeName:Tt.ZodAny,...Yt(e)});class Mc extends en{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vi(t.data)}}Mc.create=e=>new Mc({typeName:Tt.ZodUnknown,...Yt(e)});class yu extends en{_parse(t){const n=this._getOrReturnCtx(t);return et(n,{code:ze.invalid_type,expected:rt.never,received:n.parsedType}),$t}}yu.create=e=>new yu({typeName:Tt.ZodNever,...Yt(e)});class ab extends en{_parse(t){if(this._getType(t)!==rt.undefined){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.void,received:r.parsedType}),$t}return Vi(t.data)}}ab.create=e=>new ab({typeName:Tt.ZodVoid,...Yt(e)});class Ha extends en{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==rt.array)return et(n,{code:ze.invalid_type,expected:rt.array,received:n.parsedType}),$t;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.lengthi.maxLength.value&&(et(n,{code:ze.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new Ps(n,a,n.path,s)))).then(a=>Ri.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new Ps(n,a,n.path,s)));return Ri.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Ha({...this._def,minLength:{value:t,message:dt.toString(n)}})}max(t,n){return new Ha({...this._def,maxLength:{value:t,message:dt.toString(n)}})}length(t,n){return new Ha({...this._def,exactLength:{value:t,message:dt.toString(n)}})}nonempty(t){return this.min(1,t)}}Ha.create=(e,t)=>new Ha({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Tt.ZodArray,...Yt(t)});function td(e){if(e instanceof fr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Cs.create(td(r))}return new fr({...e._def,shape:()=>t})}else return e instanceof Ha?new Ha({...e._def,type:td(e.element)}):e instanceof Cs?Cs.create(td(e.unwrap())):e instanceof Rl?Rl.create(td(e.unwrap())):e instanceof ks?ks.create(e.items.map(t=>td(t))):e}class fr extends en{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(),n=gn.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==rt.object){const l=this._getOrReturnCtx(t);return et(l,{code:ze.invalid_type,expected:rt.object,received:l.parsedType}),$t}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof yu&&this._def.unknownKeys==="strip"))for(const l in i.data)a.includes(l)||s.push(l);const u=[];for(const l of a){const c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Ps(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof yu){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of s)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")s.length>0&&(et(i,{code:ze.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of s){const f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Ps(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of u){const f=await c.key,h=await c.value;l.push({key:f,value:h,alwaysSet:c.alwaysSet})}return l}).then(l=>Ri.mergeObjectSync(r,l)):Ri.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return dt.errToObj,new fr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const u=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=dt.errToObj(t).message)!==null&&s!==void 0?s:u}:{message:u}}}:{}})}strip(){return new fr({...this._def,unknownKeys:"strip"})}passthrough(){return new fr({...this._def,unknownKeys:"passthrough"})}extend(t){return new fr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new fr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Tt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new fr({...this._def,catchall:t})}pick(t){const n={};return gn.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new fr({...this._def,shape:()=>n})}omit(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new fr({...this._def,shape:()=>n})}deepPartial(){return td(this)}partial(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new fr({...this._def,shape:()=>n})}required(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Cs;)o=o._def.innerType;n[r]=o}}),new fr({...this._def,shape:()=>n})}keyof(){return dB(gn.objectKeys(this.shape))}}fr.create=(e,t)=>new fr({shape:()=>e,unknownKeys:"strip",catchall:yu.create(),typeName:Tt.ZodObject,...Yt(t)});fr.strictCreate=(e,t)=>new fr({shape:()=>e,unknownKeys:"strict",catchall:yu.create(),typeName:Tt.ZodObject,...Yt(t)});fr.lazycreate=(e,t)=>new fr({shape:e,unknownKeys:"strip",catchall:yu.create(),typeName:Tt.ZodObject,...Yt(t)});class og extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new No(s.ctx.common.issues));return et(n,{code:ze.invalid_union,unionErrors:a}),$t}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const u of r){const l={...n,common:{...n.common,issues:[]},parent:null},c=u._parseSync({data:n.data,path:n.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(u=>new No(u));return et(n,{code:ze.invalid_union,unionErrors:s}),$t}}get options(){return this._def.options}}og.create=(e,t)=>new og({options:e,typeName:Tt.ZodUnion,...Yt(t)});const Zs=e=>e instanceof ug?Zs(e.schema):e instanceof Ya?Zs(e.innerType()):e instanceof lg?[e.value]:e instanceof Ml?e.options:e instanceof cg?gn.objectValues(e.enum):e instanceof fg?Zs(e._def.innerType):e instanceof rg?[void 0]:e instanceof ig?[null]:e instanceof Cs?[void 0,...Zs(e.unwrap())]:e instanceof Rl?[null,...Zs(e.unwrap())]:e instanceof iA||e instanceof hg?Zs(e.unwrap()):e instanceof dg?Zs(e._def.innerType):[];class lw extends en{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==rt.object)return et(n,{code:ze.invalid_type,expected:rt.object,received:n.parsedType}),$t;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(et(n,{code:ze.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),$t)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=Zs(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new lw({typeName:Tt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Yt(r)})}}function lE(e,t){const n=nu(e),r=nu(t);if(e===t)return{valid:!0,data:e};if(n===rt.object&&r===rt.object){const i=gn.objectKeys(t),o=gn.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const u=lE(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(n===rt.array&&r===rt.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o{if(sE(o)||sE(a))return $t;const s=lE(o.value,a.value);return s.valid?((uE(o)||uE(a))&&n.dirty(),{status:n.value,value:s.data}):(et(r,{code:ze.invalid_intersection_types}),$t)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ag.create=(e,t,n)=>new ag({left:e,right:t,typeName:Tt.ZodIntersection,...Yt(n)});class ks extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==rt.array)return et(r,{code:ze.invalid_type,expected:rt.array,received:r.parsedType}),$t;if(r.data.lengththis._def.items.length&&(et(r,{code:ze.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const u=this._def.items[s]||this._def.rest;return u?u._parse(new Ps(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Ri.mergeArray(n,a)):Ri.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ks({...this._def,rest:t})}}ks.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ks({items:e,typeName:Tt.ZodTuple,rest:null,...Yt(t)})};class sg extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==rt.object)return et(r,{code:ze.invalid_type,expected:rt.object,received:r.parsedType}),$t;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new Ps(r,s,r.path,s)),value:a._parse(new Ps(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?Ri.mergeObjectAsync(n,i):Ri.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof en?new sg({keyType:t,valueType:n,typeName:Tt.ZodRecord,...Yt(r)}):new sg({keyType:Ua.create(),valueType:t,typeName:Tt.ZodRecord,...Yt(n)})}}class sb extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==rt.map)return et(r,{code:ze.invalid_type,expected:rt.map,received:r.parsedType}),$t;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,u],l)=>({key:i._parse(new Ps(r,s,r.path,[l,"key"])),value:o._parse(new Ps(r,u,r.path,[l,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const u of a){const l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return $t;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const u of a){const l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return $t;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}}}}sb.create=(e,t,n)=>new sb({valueType:t,keyType:e,typeName:Tt.ZodMap,...Yt(n)});class qc extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==rt.set)return et(r,{code:ze.invalid_type,expected:rt.set,received:r.parsedType}),$t;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(et(r,{code:ze.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(u){const l=new Set;for(const c of u){if(c.status==="aborted")return $t;c.status==="dirty"&&n.dirty(),l.add(c.value)}return{status:n.value,value:l}}const s=[...r.data.values()].map((u,l)=>o._parse(new Ps(r,u,r.path,l)));return r.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,n){return new qc({...this._def,minSize:{value:t,message:dt.toString(n)}})}max(t,n){return new qc({...this._def,maxSize:{value:t,message:dt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}qc.create=(e,t)=>new qc({valueType:e,minSize:null,maxSize:null,typeName:Tt.ZodSet,...Yt(t)});class Pd extends en{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==rt.function)return et(n,{code:ze.invalid_type,expected:rt.function,received:n.parsedType}),$t;function r(s,u){return rb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,nb(),Gd].filter(l=>!!l),issueData:{code:ze.invalid_arguments,argumentsError:u}})}function i(s,u){return rb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,nb(),Gd].filter(l=>!!l),issueData:{code:ze.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Zd){const s=this;return Vi(async function(...u){const l=new No([]),c=await s._def.args.parseAsync(u,o).catch(p=>{throw l.addIssue(r(u,p)),l}),f=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(f,o).catch(p=>{throw l.addIssue(i(f,p)),l})})}else{const s=this;return Vi(function(...u){const l=s._def.args.safeParse(u,o);if(!l.success)throw new No([r(u,l.error)]);const c=Reflect.apply(a,this,l.data),f=s._def.returns.safeParse(c,o);if(!f.success)throw new No([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Pd({...this._def,args:ks.create(t).rest(Mc.create())})}returns(t){return new Pd({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Pd({args:t||ks.create([]).rest(Mc.create()),returns:n||Mc.create(),typeName:Tt.ZodFunction,...Yt(r)})}}class ug extends en{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ug.create=(e,t)=>new ug({getter:e,typeName:Tt.ZodLazy,...Yt(t)});class lg extends en{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return et(n,{received:n.data,code:ze.invalid_literal,expected:this._def.value}),$t}return{status:"valid",value:t.data}}get value(){return this._def.value}}lg.create=(e,t)=>new lg({value:e,typeName:Tt.ZodLiteral,...Yt(t)});function dB(e,t){return new Ml({values:e,typeName:Tt.ZodEnum,...Yt(t)})}class Ml extends en{constructor(){super(...arguments),a0.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return et(n,{expected:gn.joinValues(r),received:n.parsedType,code:ze.invalid_type}),$t}if(ib(this,a0)||uB(this,a0,new Set(this._def.values)),!ib(this,a0).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return et(n,{received:n.data,code:ze.invalid_enum_value,options:r}),$t}return Vi(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Ml.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ml.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}a0=new WeakMap;Ml.create=dB;class cg extends en{constructor(){super(...arguments),s0.set(this,void 0)}_parse(t){const n=gn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==rt.string&&r.parsedType!==rt.number){const i=gn.objectValues(n);return et(r,{expected:gn.joinValues(i),received:r.parsedType,code:ze.invalid_type}),$t}if(ib(this,s0)||uB(this,s0,new Set(gn.getValidEnumValues(this._def.values))),!ib(this,s0).has(t.data)){const i=gn.objectValues(n);return et(r,{received:r.data,code:ze.invalid_enum_value,options:i}),$t}return Vi(t.data)}get enum(){return this._def.values}}s0=new WeakMap;cg.create=(e,t)=>new cg({values:e,typeName:Tt.ZodNativeEnum,...Yt(t)});class Zd extends en{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==rt.promise&&n.common.async===!1)return et(n,{code:ze.invalid_type,expected:rt.promise,received:n.parsedType}),$t;const r=n.parsedType===rt.promise?n.data:Promise.resolve(n.data);return Vi(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Zd.create=(e,t)=>new Zd({type:e,typeName:Tt.ZodPromise,...Yt(t)});class Ya extends en{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Tt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{et(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return $t;const u=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return u.status==="aborted"?$t:u.status==="dirty"||n.value==="dirty"?md(u.value):u});{if(n.value==="aborted")return $t;const s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?$t:s.status==="dirty"||n.value==="dirty"?md(s.value):s}}if(i.type==="refinement"){const a=s=>{const u=i.refinement(s,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?$t:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?$t:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Vc(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Vc(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);gn.assertNever(i)}}Ya.create=(e,t,n)=>new Ya({schema:e,typeName:Tt.ZodEffects,effect:t,...Yt(n)});Ya.createWithPreprocess=(e,t,n)=>new Ya({schema:t,effect:{type:"preprocess",transform:e},typeName:Tt.ZodEffects,...Yt(n)});class Cs extends en{_parse(t){return this._getType(t)===rt.undefined?Vi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Cs.create=(e,t)=>new Cs({innerType:e,typeName:Tt.ZodOptional,...Yt(t)});class Rl extends en{_parse(t){return this._getType(t)===rt.null?Vi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Rl.create=(e,t)=>new Rl({innerType:e,typeName:Tt.ZodNullable,...Yt(t)});class fg extends en{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===rt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}fg.create=(e,t)=>new fg({innerType:e,typeName:Tt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Yt(t)});class dg extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return tg(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new No(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new No(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}dg.create=(e,t)=>new dg({innerType:e,typeName:Tt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Yt(t)});class ub extends en{_parse(t){if(this._getType(t)!==rt.nan){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.nan,received:r.parsedType}),$t}return{status:"valid",value:t.data}}}ub.create=e=>new ub({typeName:Tt.ZodNaN,...Yt(e)});const _ce=Symbol("zod_brand");class iA extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Cm extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?$t:o.status==="dirty"?(n.dirty(),md(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?$t:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Cm({in:t,out:n,typeName:Tt.ZodPipeline})}}class hg extends en{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Vc(i)&&(i.value=Object.freeze(i.value)),i);return tg(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}hg.create=(e,t)=>new hg({innerType:e,typeName:Tt.ZodReadonly,...Yt(t)});function hB(e,t={},n){return e?Yd.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,l=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...l,fatal:u})}}):Yd.create()}const Sce={object:fr.lazycreate};var Tt;(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"})(Tt||(Tt={}));const Cce=(e,t={message:`Input not instance of ${e.name}`})=>hB(n=>n instanceof e,t),pB=Ua.create,gB=kl.create,Ece=ub.create,Oce=Tl.create,mB=ng.create,Ace=Hc.create,Pce=ob.create,kce=rg.create,Tce=ig.create,Mce=Yd.create,Rce=Mc.create,Dce=yu.create,$ce=ab.create,Ice=Ha.create,Nce=fr.create,Lce=fr.strictCreate,Fce=og.create,jce=lw.create,Bce=ag.create,Uce=ks.create,zce=sg.create,Wce=sb.create,Vce=qc.create,Hce=Pd.create,qce=ug.create,Kce=lg.create,Gce=Ml.create,Yce=cg.create,Zce=Zd.create,cR=Ya.create,Xce=Cs.create,Qce=Rl.create,Jce=Ya.createWithPreprocess,efe=Cm.create,tfe=()=>pB().optional(),nfe=()=>gB().optional(),rfe=()=>mB().optional(),ife={string:e=>Ua.create({...e,coerce:!0}),number:e=>kl.create({...e,coerce:!0}),boolean:e=>ng.create({...e,coerce:!0}),bigint:e=>Tl.create({...e,coerce:!0}),date:e=>Hc.create({...e,coerce:!0})},ofe=$t;var _Qe=Object.freeze({__proto__:null,defaultErrorMap:Gd,setErrorMap:Jle,getErrorMap:nb,makeIssue:rb,EMPTY_PATH:ece,addIssueToContext:et,ParseStatus:Ri,INVALID:$t,DIRTY:md,OK:Vi,isAborted:sE,isDirty:uE,isValid:Vc,isAsync:tg,get util(){return gn},get objectUtil(){return aE},ZodParsedType:rt,getParsedType:nu,ZodType:en,datetimeRegex:fB,ZodString:Ua,ZodNumber:kl,ZodBigInt:Tl,ZodBoolean:ng,ZodDate:Hc,ZodSymbol:ob,ZodUndefined:rg,ZodNull:ig,ZodAny:Yd,ZodUnknown:Mc,ZodNever:yu,ZodVoid:ab,ZodArray:Ha,ZodObject:fr,ZodUnion:og,ZodDiscriminatedUnion:lw,ZodIntersection:ag,ZodTuple:ks,ZodRecord:sg,ZodMap:sb,ZodSet:qc,ZodFunction:Pd,ZodLazy:ug,ZodLiteral:lg,ZodEnum:Ml,ZodNativeEnum:cg,ZodPromise:Zd,ZodEffects:Ya,ZodTransformer:Ya,ZodOptional:Cs,ZodNullable:Rl,ZodDefault:fg,ZodCatch:dg,ZodNaN:ub,BRAND:_ce,ZodBranded:iA,ZodPipeline:Cm,ZodReadonly:hg,custom:hB,Schema:en,ZodSchema:en,late:Sce,get ZodFirstPartyTypeKind(){return Tt},coerce:ife,any:Mce,array:Ice,bigint:Oce,boolean:mB,date:Ace,discriminatedUnion:jce,effect:cR,enum:Gce,function:Hce,instanceof:Cce,intersection:Bce,lazy:qce,literal:Kce,map:Wce,nan:Ece,nativeEnum:Yce,never:Dce,null:Tce,nullable:Qce,number:gB,object:Nce,oboolean:rfe,onumber:nfe,optional:Xce,ostring:tfe,pipeline:efe,preprocess:Jce,promise:Zce,record:zce,set:Vce,strictObject:Lce,string:pB,symbol:Pce,transformer:cR,tuple:Uce,undefined:kce,union:Fce,unknown:Rce,void:$ce,NEVER:ofe,ZodIssueCode:ze,quotelessJson:Qle,ZodError:No});const afe=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);Rc(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},fR={},cE=(e,t,n,r)=>{Rc(n)&&fR[n]||(Rc(n)&&(fR[n]=new Date),afe(e,t,n,r))},vB=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},fE=(e,t,n)=>{e.loadNamespaces(t,vB(e,n))},dR=(e,t,n,r)=>{if(Rc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return fE(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,vB(e,r))},sfe=(e,t,n={})=>!t.languages||!t.languages.length?(cE(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n?.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Rc=e=>typeof e=="string",ufe=e=>typeof e=="object"&&e!==null,lfe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,cfe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},ffe=e=>cfe[e],dfe=e=>e.replace(lfe,ffe);let dE={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:dfe};const hfe=(e={})=>{dE={...dE,...e}},pfe=()=>dE;let yB;const gfe=e=>{yB=e},mfe=()=>yB,SQe={type:"3rdParty",init(e){hfe(e.options.react),gfe(e)}},vfe=v.createContext();class yfe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const bfe=(e,t)=>{const n=v.useRef();return v.useEffect(()=>{n.current=e},[e,t]),n.current},bB=(e,t,n,r)=>e.getFixedT(t,n,r),xfe=(e,t,n,r)=>v.useCallback(bB(e,t,n,r),[e,t,n,r]),CQe=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=v.useContext(vfe)||{},o=n||r||mfe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new yfe),!o){cE(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const O=(C,P)=>Rc(P)?P:ufe(P)&&Rc(P.defaultValue)?P.defaultValue:Array.isArray(C)?C[C.length-1]:C,E=[O,{},!1];return E.t=O,E.i18n={},E.ready=!1,E}o.options.react?.wait&&cE(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...pfe(),...o.options.react,...t},{useSuspense:s,keyPrefix:u}=a;let l=e||i||o.options?.defaultNS;l=Rc(l)?[l]:l||["translation"],o.reportNamespaces.addUsedNamespaces?.(l);const c=(o.isInitialized||o.initializedStoreOnce)&&l.every(O=>sfe(O,o,a)),f=xfe(o,t.lng||null,a.nsMode==="fallback"?l:l[0],u),h=()=>f,p=()=>bB(o,t.lng||null,a.nsMode==="fallback"?l:l[0],u),[m,y]=v.useState(h);let b=l.join();t.lng&&(b=`${t.lng}${b}`);const w=bfe(b),x=v.useRef(!0);v.useEffect(()=>{const{bindI18n:O,bindI18nStore:E}=a;x.current=!0,!c&&!s&&(t.lng?dR(o,t.lng,l,()=>{x.current&&y(p)}):fE(o,l,()=>{x.current&&y(p)})),c&&w&&w!==b&&x.current&&y(p);const C=()=>{x.current&&y(p)};return O&&o?.on(O,C),E&&o?.store.on(E,C),()=>{x.current=!1,o&&O?.split(" ").forEach(P=>o.off(P,C)),E&&o&&E.split(" ").forEach(P=>o.store.off(P,C))}},[o,b]),v.useEffect(()=>{x.current&&c&&y(h)},[o,u,c]);const S=[m,o,c];if(S.t=m,S.i18n=o,S.ready=c,c||!c&&!s)return S;throw new Promise(O=>{t.lng?dR(o,t.lng,l,()=>O()):fE(o,l,()=>O())})};var wfe="Label",xB=v.forwardRef((e,t)=>I.jsx(gt.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));xB.displayName=wfe;var EQe=xB;function Ye(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function _fe(e,t){const n=v.createContext(t),r=o=>{const{children:a,...s}=o,u=v.useMemo(()=>s,Object.values(s));return I.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function i(o){const a=v.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Di(e,t=[]){let n=[];function r(o,a){const s=v.createContext(a),u=n.length;n=[...n,a];const l=f=>{const{scope:h,children:p,...m}=f,y=h?.[e]?.[u]||s,b=v.useMemo(()=>m,Object.values(m));return I.jsx(y.Provider,{value:b,children:p})};l.displayName=o+"Provider";function c(f,h){const p=h?.[e]?.[u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,Sfe(i,...t)]}function Sfe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function oA(e){const t=e+"CollectionProvider",[n,r]=Di(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:m,children:y}=p,b=F.useRef(null),w=F.useRef(new Map).current;return I.jsx(i,{scope:m,itemMap:w,collectionRef:b,children:y})};a.displayName=t;const s=e+"CollectionSlot",u=F.forwardRef((p,m)=>{const{scope:y,children:b}=p,w=o(s,y),x=Nt(m,w.collectionRef);return I.jsx(Pl,{ref:x,children:b})});u.displayName=s;const l=e+"CollectionItemSlot",c="data-radix-collection-item",f=F.forwardRef((p,m)=>{const{scope:y,children:b,...w}=p,x=F.useRef(null),S=Nt(m,x),O=o(l,y);return F.useEffect(()=>(O.itemMap.set(x,{ref:x,...w}),()=>void O.itemMap.delete(x))),I.jsx(Pl,{[c]:"",ref:S,children:b})});f.displayName=l;function h(p){const m=o(e+"CollectionConsumer",p);return F.useCallback(()=>{const b=m.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((O,E)=>w.indexOf(O.ref.current)-w.indexOf(E.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:u,ItemSlot:f},h,r]}var Cfe=globalThis?.document?v.useLayoutEffect:()=>{},Efe=zx.useId||(()=>{}),Ofe=0;function Lo(e){const[t,n]=v.useState(Efe());return Cfe(()=>{e||n(r=>r??String(Ofe++))},[e]),e||(t?`radix-${t}`:"")}function Vr(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function Ts({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Afe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Vr(n),u=v.useCallback(l=>{if(o){const f=typeof l=="function"?l(e):l;f!==e&&s(f)}else i(l)},[o,e,i,s]);return[a,u]}function Afe({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,i=v.useRef(r),o=Vr(t);return v.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var Pfe=v.createContext(void 0);function Em(e){const t=v.useContext(Pfe);return e||t||"ltr"}var TS="rovingFocusGroup.onEntryFocus",kfe={bubbles:!1,cancelable:!0},cw="RovingFocusGroup",[hE,wB,Tfe]=oA(cw),[Mfe,fw]=Di(cw,[Tfe]),[Rfe,Dfe]=Mfe(cw),_B=v.forwardRef((e,t)=>I.jsx(hE.Provider,{scope:e.__scopeRovingFocusGroup,children:I.jsx(hE.Slot,{scope:e.__scopeRovingFocusGroup,children:I.jsx($fe,{...e,ref:t})})}));_B.displayName=cw;var $fe=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:c=!1,...f}=e,h=v.useRef(null),p=Nt(t,h),m=Em(o),[y=null,b]=Ts({prop:a,defaultProp:s,onChange:u}),[w,x]=v.useState(!1),S=Vr(l),O=wB(n),E=v.useRef(!1),[C,P]=v.useState(0);return v.useEffect(()=>{const M=h.current;if(M)return M.addEventListener(TS,S),()=>M.removeEventListener(TS,S)},[S]),I.jsx(Rfe,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:y,onItemFocus:v.useCallback(M=>b(M),[b]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>P(M=>M+1),[]),onFocusableItemRemove:v.useCallback(()=>P(M=>M-1),[]),children:I.jsx(gt.div,{tabIndex:w||C===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:Ye(e.onMouseDown,()=>{E.current=!0}),onFocus:Ye(e.onFocus,M=>{const N=!E.current;if(M.target===M.currentTarget&&N&&!w){const B=new CustomEvent(TS,kfe);if(M.currentTarget.dispatchEvent(B),!B.defaultPrevented){const V=O().filter(G=>G.focusable),W=V.find(G=>G.active),ee=V.find(G=>G.id===y),q=[W,ee,...V].filter(Boolean).map(G=>G.ref.current);EB(q,c)}}E.current=!1}),onBlur:Ye(e.onBlur,()=>x(!1))})})}),SB="RovingFocusGroupItem",CB=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...a}=e,s=Lo(),u=o||s,l=Dfe(SB,n),c=l.currentTabStopId===u,f=wB(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=l;return v.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),I.jsx(hE.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:I.jsx(gt.span,{tabIndex:c?0:-1,"data-orientation":l.orientation,...a,ref:t,onMouseDown:Ye(e.onMouseDown,m=>{r?l.onItemFocus(u):m.preventDefault()}),onFocus:Ye(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:Ye(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){l.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=Lfe(m,l.orientation,l.dir);if(y!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let w=f().filter(x=>x.focusable).map(x=>x.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const x=w.indexOf(m.currentTarget);w=l.loop?Ffe(w,x+1):w.slice(x+1)}setTimeout(()=>EB(w))}})})})});CB.displayName=SB;var Ife={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Lfe(e,t,n){const r=Nfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ife[r]}function EB(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ffe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OB=_B,AB=CB,On=globalThis?.document?v.useLayoutEffect:()=>{};function jfe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var PB=e=>{const{present:t,children:n}=e,r=Bfe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,Ufe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};PB.displayName="Presence";function Bfe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=jfe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=sy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=sy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=sy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=sy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function sy(e){return e?.animationName||"none"}function Ufe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aA="Tabs",[zfe,OQe]=Di(aA,[fw]),kB=fw(),[Wfe,sA]=zfe(aA),TB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:s,activationMode:u="automatic",...l}=e,c=Em(s),[f,h]=Ts({prop:r,onChange:i,defaultProp:o});return I.jsx(Wfe,{scope:n,baseId:Lo(),value:f,onValueChange:h,orientation:a,dir:c,activationMode:u,children:I.jsx(gt.div,{dir:c,"data-orientation":a,...l,ref:t})})});TB.displayName=aA;var MB="TabsList",RB=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=sA(MB,n),a=kB(n);return I.jsx(OB,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:I.jsx(gt.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});RB.displayName=MB;var DB="TabsTrigger",$B=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=sA(DB,n),s=kB(n),u=LB(a.baseId,r),l=FB(a.baseId,r),c=r===a.value;return I.jsx(AB,{asChild:!0,...s,focusable:!i,active:c,children:I.jsx(gt.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":l,"data-state":c?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Ye(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?a.onValueChange(r):f.preventDefault()}),onKeyDown:Ye(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(r)}),onFocus:Ye(e.onFocus,()=>{const f=a.activationMode!=="manual";!c&&!i&&f&&a.onValueChange(r)})})})});$B.displayName=DB;var IB="TabsContent",NB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,s=sA(IB,n),u=LB(s.baseId,r),l=FB(s.baseId,r),c=r===s.value,f=v.useRef(c);return v.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),I.jsx(PB,{present:i||c,children:({present:h})=>I.jsx(gt.div,{"data-state":c?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":u,hidden:!h,id:l,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&o})})});NB.displayName=IB;function LB(e,t){return`${e}-trigger-${t}`}function FB(e,t){return`${e}-content-${t}`}var AQe=TB,PQe=RB,kQe=$B,TQe=NB,Ih=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(){}},Kc=typeof window>"u"||"Deno"in globalThis;function oa(){}function Vfe(e,t){return typeof e=="function"?e(t):e}function pE(e){return typeof e=="number"&&e>=0&&e!==1/0}function jB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function kd(e,t){return typeof e=="function"?e(t):e}function Na(e,t){return typeof e=="function"?e(t):e}function hR(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==uA(a,t.options))return!1}else if(!pg(t.queryKey,a))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function pR(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Gc(t.options.mutationKey)!==Gc(o))return!1}else if(!pg(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function uA(e,t){return(t?.queryKeyHashFn||Gc)(e)}function Gc(e){return JSON.stringify(e,(t,n)=>gE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function pg(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!pg(e[n],t[n])):!1}function BB(e,t){if(e===t)return e;const n=gR(e)&&gR(t);if(n||gE(e)&&gE(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),a=o.length,s=n?[]:{};let u=0;for(let l=0;l{setTimeout(t,e)})}function mE(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?BB(e,t):t}function qfe(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Kfe(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var lA=Symbol();function UB(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===lA?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Gfe=class extends Ih{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!Kc&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},cA=new Gfe,Yfe=class extends Ih{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!Kc&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},cb=new Yfe;function vE(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function Zfe(e){return Math.min(1e3*2**e,3e4)}function zB(e){return(e??"online")==="online"?cb.isOnline():!0}var WB=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function MS(e){return e instanceof WB}function VB(e){let t=!1,n=0,r=!1,i;const o=vE(),a=y=>{r||(h(new WB(y)),e.abort?.())},s=()=>{t=!0},u=()=>{t=!1},l=()=>cA.isFocused()&&(e.networkMode==="always"||cb.isOnline())&&e.canRun(),c=()=>zB(e.networkMode)&&e.canRun(),f=y=>{r||(r=!0,e.onSuccess?.(y),i?.(),o.resolve(y))},h=y=>{r||(r=!0,e.onError?.(y),i?.(),o.reject(y))},p=()=>new Promise(y=>{i=b=>{(r||l())&&y(b)},e.onPause?.()}).then(()=>{i=void 0,r||e.onContinue?.()}),m=()=>{if(r)return;let y;const b=n===0?e.initialPromise:void 0;try{y=b??e.fn()}catch(w){y=Promise.reject(w)}Promise.resolve(y).then(f).catch(w=>{if(r)return;const x=e.retry??(Kc?0:3),S=e.retryDelay??Zfe,O=typeof S=="function"?S(n,w):S,E=x===!0||typeof x=="number"&&nl()?void 0:p()).then(()=>{t?h(w):m()})})};return{promise:o,cancel:a,continue:()=>(i?.(),o),cancelRetry:s,continueRetry:u,canStart:c,start:()=>(c()?m():p().then(m),o)}}function Xfe(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=s=>setTimeout(s,0);const o=s=>{t?e.push(s):i(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(u=>{n(u)})})})};return{batch:s=>{let u;t++;try{u=s()}finally{t--,t||a()}return u},batchCalls:s=>(...u)=>{o(()=>{s(...u)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Wr=Xfe(),HB=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pE(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kc?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Qfe=class extends HB{#e;#t;#r;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Jfe(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=mE(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(oa).catch(oa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Na(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lA||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!jB(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(u=>u.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,r=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const s=UB(this.options,t),u={queryKey:this.queryKey,meta:this.meta};return r(u),this.#o=!1,this.options.persister?this.options.persister(s,u,this):s(u)},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};r(o),this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#i({type:"fetch",meta:o.fetchOptions?.meta});const a=s=>{MS(s)&&s.silent||this.#i({type:"error",error:s}),MS(s)||(this.#r.config.onError?.(s,this),this.#r.config.onSettled?.(this.state.data,s,this)),this.scheduleGc()};return this.#n=VB({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:s=>{if(s===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(s)}catch(u){a(u);return}this.#r.config.onSuccess?.(s,this),this.#r.config.onSettled?.(s,this.state.error,this),this.scheduleGc()},onError:a,onFail:(s,u)=>{this.#i({type:"failed",failureCount:s,error:u})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#n.start()}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...qB(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return MS(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Wr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function qB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Jfe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ede=class extends Ih{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??uA(r,t);let o=this.get(i);return o||(o=new Qfe({cache:this,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Wr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>hR(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>hR(e,n)):t}notify(e){Wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Wr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},tde=class extends HB{#e;#t;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||KB(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){this.#r=VB({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,i)=>{this.#n({type:"failed",failureCount:r,error:i})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const t=this.state.status==="pending",n=!this.#r.canStart();try{if(!t){this.#n({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);const i=await this.options.onMutate?.(e);i!==this.state.context&&this.#n({type:"pending",context:i,variables:e,isPaused:n})}const r=await this.#r.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#n({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#n({type:"error",error:r})}}finally{this.#t.runNext(this)}}#n(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Wr.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function KB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var nde=class extends Ih{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){const r=new tde({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=uy(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=uy(e);if(this.#e.has(t)){const n=this.#e.get(t)?.filter(r=>r!==e);n&&(n.length===0?this.#e.delete(t):this.#e.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#e.get(uy(e))?.find(n=>n.state.status==="pending");return!t||t===e}runNext(e){return this.#e.get(uy(e))?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){Wr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#e.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(n=>pR(t,n))}findAll(e={}){return this.getAll().filter(t=>pR(e,t))}notify(e){Wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Wr.batch(()=>Promise.all(e.map(t=>t.continue().catch(oa))))}};function uy(e){return e.options.scope?.id??String(e.mutationId)}function vR(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},u=0;const l=async()=>{let c=!1;const f=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},h=UB(t.options,t.fetchOptions),p=async(m,y,b)=>{if(c)return Promise.reject();if(y==null&&m.pages.length)return Promise.resolve(m);const w={queryKey:t.queryKey,pageParam:y,direction:b?"backward":"forward",meta:t.options.meta};f(w);const x=await h(w),{maxPages:S}=t.options,O=b?Kfe:qfe;return{pages:O(m.pages,x,S),pageParams:O(m.pageParams,y,S)}};if(i&&o.length){const m=i==="backward",y=m?rde:yR,b={pages:o,pageParams:a},w=y(r,b);s=await p(b,w,m)}else{const m=e??o.length;do{const y=u===0?a[0]??r.initialPageParam:yR(r,s);if(u>0&&y==null)break;s=await p(s,y),u++}while(ut.options.persister?.(l,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function yR(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function rde(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var MQe=class{#e;#t;#r;#n;#a;#o;#i;#s;constructor(e={}){this.#e=e.queryCache||new ede,this.#t=e.mutationCache||new nde,this.#r=e.defaultOptions||{},this.#n=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#i=cA.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=cb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(kd(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=Vfe(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Wr.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Wr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e,r={type:"active",...e};return Wr.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Wr.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(oa).catch(oa)}invalidateQueries(e,t={}){return Wr.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none")return Promise.resolve();const n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Wr.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(oa)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(oa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(kd(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(oa).catch(oa)}fetchInfiniteQuery(e){return e.behavior=vR(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(oa).catch(oa)}ensureInfiniteQueryData(e){return e.behavior=vR(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return cb.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(Gc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()],n={};return t.forEach(r=>{pg(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(Gc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()];let n={};return t.forEach(r=>{pg(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uA(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===lA&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},ide=class extends Ih{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#i=vE(),this.options.experimental_prefetchInRender||this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#n=void 0;#a;#o;#i;#s;#g;#d;#h;#l;#c;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),bR(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yE(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yE(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e,t){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Na(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),n._defaulted&&!lb(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&xR(this.#t,r,this.options,n)&&this.#f(),this.updateResult(t),i&&(this.#t!==r||Na(this.options.enabled,this.#t)!==Na(n.enabled,this.#t)||kd(this.options.staleTime,this.#t)!==kd(n.staleTime,this.#t))&&this.#m();const o=this.#v();i&&(this.#t!==r||Na(this.options.enabled,this.#t)!==Na(n.enabled,this.#t)||o!==this.#u)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ade(this,n)&&(this.#n=n,this.#o=this.options,this.#a=this.#t.state),n}getCurrentResult(){return this.#n}trackResult(e,t){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#f(e){this.#_();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(oa)),t}#m(){this.#x();const e=kd(this.options.staleTime,this.#t);if(Kc||this.#n.isStale||!pE(e))return;const n=jB(this.#n.dataUpdatedAt,e)+1;this.#l=setTimeout(()=>{this.#n.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#u=e,!(Kc||Na(this.options.enabled,this.#t)===!1||!pE(this.#u)||this.#u===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||cA.isFocused())&&this.#f()},this.#u))}#b(){this.#m(),this.#y(this.#v())}#x(){this.#l&&(clearTimeout(this.#l),this.#l=void 0)}#w(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#n,o=this.#a,a=this.#o,u=e!==n?e.state:this.#r,{state:l}=e;let c={...l},f=!1,h;if(t._optimisticResults){const P=this.hasListeners(),M=!P&&bR(e,t),N=P&&xR(e,n,t,r);(M||N)&&(c={...c,...qB(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:y}=c;if(t.select&&c.data!==void 0)if(i&&c.data===o?.data&&t.select===this.#g)h=this.#d;else try{this.#g=t.select,h=t.select(c.data),h=mE(i?.data,h,t),this.#d=h,this.#s=null}catch(P){this.#s=P}else h=c.data;if(t.placeholderData!==void 0&&h===void 0&&y==="pending"){let P;if(i?.isPlaceholderData&&t.placeholderData===a?.placeholderData)P=i.data;else if(P=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,t.select&&P!==void 0)try{P=t.select(P),this.#s=null}catch(M){this.#s=M}P!==void 0&&(y="success",h=mE(i?.data,P,t),f=!0)}this.#s&&(p=this.#s,h=this.#d,m=Date.now(),y="error");const b=c.fetchStatus==="fetching",w=y==="pending",x=y==="error",S=w&&b,O=h!==void 0,C={status:y,fetchStatus:c.fetchStatus,isPending:w,isSuccess:y==="success",isError:x,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:c.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:x&&!O,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&O,isStale:fA(e,t),refetch:this.refetch,promise:this.#i};if(this.options.experimental_prefetchInRender){const P=B=>{C.status==="error"?B.reject(C.error):C.data!==void 0&&B.resolve(C.data)},M=()=>{const B=this.#i=C.promise=vE();P(B)},N=this.#i;switch(N.status){case"pending":e.queryHash===n.queryHash&&P(N);break;case"fulfilled":(C.status==="error"||C.data!==N.value)&&M();break;case"rejected":(C.status!=="error"||C.error!==N.reason)&&M();break}}return C}updateResult(e){const t=this.#n,n=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#t),lb(n,t))return;this.#n=n;const r={},i=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!this.#p.size)return!0;const s=new Set(a??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#n).some(u=>{const l=u;return this.#n[l]!==t[l]&&s.has(l)})};e?.listeners!==!1&&i()&&(r.listeners=!0),this.#S({...r,...e})}#_(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){Wr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function ode(e,t){return Na(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function bR(e,t){return ode(e,t)||e.state.data!==void 0&&yE(e,t,t.refetchOnMount)}function yE(e,t,n){if(Na(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fA(e,t)}return!1}function xR(e,t,n,r){return(e!==t||Na(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&fA(e,n)}function fA(e,t){return Na(t.enabled,e)!==!1&&e.isStaleByTime(kd(t.staleTime,e))}function ade(e,t){return!lb(e.getCurrentResult(),t)}var sde=class extends Ih{#e;#t=void 0;#r;#n;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),lb(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),n?.mutationKey&&this.options.mutationKey&&Gc(n.mutationKey)!==Gc(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#a(),this.#o()}mutate(t,n){return this.#n=n,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#a(){const t=this.#r?.state??KB();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Wr.batch(()=>{if(this.#n&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context;t?.type==="success"?(this.#n.onSuccess?.(t.data,n,r),this.#n.onSettled?.(t.data,null,n,r)):t?.type==="error"&&(this.#n.onError?.(t.error,n,r),this.#n.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#t)})})}},GB=v.createContext(void 0),YB=e=>{const t=v.useContext(GB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},DQe=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),I.jsx(GB.Provider,{value:e,children:t})),ZB=v.createContext(!1),ude=()=>v.useContext(ZB);ZB.Provider;function lde(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var cde=v.createContext(lde()),fde=()=>v.useContext(cde);function XB(e,t){return typeof e=="function"?e(...t):!!e}function bE(){}var dde=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},hde=e=>{v.useEffect(()=>{e.clearReset()},[e])},pde=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&XB(n,[e.error,r]),gde=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},mde=(e,t)=>e.isLoading&&e.isFetching&&!t,vde=(e,t)=>e?.suspense&&t.isPending,wR=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function yde(e,t,n){const r=YB(),i=ude(),o=fde(),a=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=i?"isRestoring":"optimistic",gde(a),dde(a,o),hde(o);const s=!r.getQueryCache().get(a.queryHash),[u]=v.useState(()=>new t(r,a)),l=u.getOptimisticResult(a);if(v.useSyncExternalStore(v.useCallback(c=>{const f=i?bE:u.subscribe(Wr.batchCalls(c));return u.updateResult(),f},[u,i]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),v.useEffect(()=>{u.setOptions(a,{listeners:!1})},[a,u]),vde(a,l))throw wR(a,u,o);if(pde({result:l,errorResetBoundary:o,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw l.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!Kc&&mde(l,i)&&(s?wR(a,u,o):r.getQueryCache().get(a.queryHash)?.promise)?.catch(bE).finally(()=>{u.updateResult()}),a.notifyOnChangeProps?l:u.trackResult(l)}function $Qe(e,t){return yde(e,ide)}function IQe(e,t){const n=YB(),[r]=v.useState(()=>new sde(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(a=>r.subscribe(Wr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((a,s)=>{r.mutate(a,s).catch(bE)},[r]);if(i.error&&XB(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var QB={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(La,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",u="hour",l="day",c="week",f="month",h="quarter",p="year",m="date",y="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var q=["th","st","nd","rd"],G=Z%100;return"["+Z+(q[(G-20)%10]||q[G]||q[0])+"]"}},S=function(Z,q,G){var H=String(Z);return!H||H.length>=q?Z:""+Array(q+1-H.length).join(G)+Z},O={s:S,z:function(Z){var q=-Z.utcOffset(),G=Math.abs(q),H=Math.floor(G/60),j=G%60;return(q<=0?"+":"-")+S(H,2,"0")+":"+S(j,2,"0")},m:function Z(q,G){if(q.date()1)return Z(Y[0])}else{var re=q.name;C[re]=q,j=re}return!H&&j&&(E=j),j||!H&&E},B=function(Z,q){if(M(Z))return Z.clone();var G=typeof q=="object"?q:{};return G.date=Z,G.args=arguments,new W(G)},V=O;V.l=N,V.i=M,V.w=function(Z,q){return B(Z,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var W=function(){function Z(G){this.$L=N(G.locale,null,!0),this.parse(G),this.$x=this.$x||G.x||{},this[P]=!0}var q=Z.prototype;return q.parse=function(G){this.$d=function(H){var j=H.date,K=H.utc;if(j===null)return new Date(NaN);if(V.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var Y=j.match(b);if(Y){var re=Y[2]-1||0,ie=(Y[7]||"0").substring(0,3);return K?new Date(Date.UTC(Y[1],re,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,ie)):new Date(Y[1],re,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,ie)}}return new Date(j)}(G),this.init()},q.init=function(){var G=this.$d;this.$y=G.getFullYear(),this.$M=G.getMonth(),this.$D=G.getDate(),this.$W=G.getDay(),this.$H=G.getHours(),this.$m=G.getMinutes(),this.$s=G.getSeconds(),this.$ms=G.getMilliseconds()},q.$utils=function(){return V},q.isValid=function(){return this.$d.toString()!==y},q.isSame=function(G,H){var j=B(G);return this.startOf(H)<=j&&j<=this.endOf(H)},q.isAfter=function(G,H){return B(G)t=>{const n=xde.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),es=e=>(e=e.toLowerCase(),t=>dw(t)===e),hw=e=>t=>typeof t===e,{isArray:Nh}=Array,gg=hw("undefined");function wde(e){return e!==null&&!gg(e)&&e.constructor!==null&&!gg(e.constructor)&&Fo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const eU=es("ArrayBuffer");function _de(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&eU(e.buffer),t}const Sde=hw("string"),Fo=hw("function"),tU=hw("number"),pw=e=>e!==null&&typeof e=="object",Cde=e=>e===!0||e===!1,d1=e=>{if(dw(e)!=="object")return!1;const t=dA(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ede=es("Date"),Ode=es("File"),Ade=es("Blob"),Pde=es("FileList"),kde=e=>pw(e)&&Fo(e.pipe),Tde=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Fo(e.append)&&((t=dw(e))==="formdata"||t==="object"&&Fo(e.toString)&&e.toString()==="[object FormData]"))},Mde=es("URLSearchParams"),[Rde,Dde,$de,Ide]=["ReadableStream","Request","Response","Headers"].map(es),Nde=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Om(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Nh(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Sc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,rU=e=>!gg(e)&&e!==Sc;function xE(){const{caseless:e}=rU(this)&&this||{},t={},n=(r,i)=>{const o=e&&nU(t,i)||i;d1(t[o])&&d1(r)?t[o]=xE(t[o],r):d1(r)?t[o]=xE({},r):Nh(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r(Om(t,(i,o)=>{n&&Fo(i)?e[o]=JB(i,n):e[o]=i},{allOwnKeys:r}),e),Fde=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jde=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Bde=(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!r||r(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=n!==!1&&dA(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ude=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},zde=e=>{if(!e)return null;if(Nh(e))return e;let t=e.length;if(!tU(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Wde=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&dA(Uint8Array)),Vde=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},Hde=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},qde=es("HTMLFormElement"),Kde=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),_R=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Gde=es("RegExp"),iU=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Om(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},Yde=e=>{iU(e,(t,n)=>{if(Fo(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Fo(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Zde=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Nh(e)?r(e):r(String(e).split(t)),n},Xde=()=>{},Qde=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,RS="abcdefghijklmnopqrstuvwxyz",SR="0123456789",oU={DIGIT:SR,ALPHA:RS,ALPHA_DIGIT:RS+RS.toUpperCase()+SR},Jde=(e=16,t=oU.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function ehe(e){return!!(e&&Fo(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const the=e=>{const t=new Array(10),n=(r,i)=>{if(pw(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=Nh(r)?[]:{};return Om(r,(a,s)=>{const u=n(a,i+1);!gg(u)&&(o[s]=u)}),t[i]=void 0,o}}return r};return n(e,0)},nhe=es("AsyncFunction"),rhe=e=>e&&(pw(e)||Fo(e))&&Fo(e.then)&&Fo(e.catch),aU=((e,t)=>e?setImmediate:t?((n,r)=>(Sc.addEventListener("message",({source:i,data:o})=>{i===Sc&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Sc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Fo(Sc.postMessage)),ihe=typeof queueMicrotask<"u"?queueMicrotask.bind(Sc):typeof process<"u"&&process.nextTick||aU,xe={isArray:Nh,isArrayBuffer:eU,isBuffer:wde,isFormData:Tde,isArrayBufferView:_de,isString:Sde,isNumber:tU,isBoolean:Cde,isObject:pw,isPlainObject:d1,isReadableStream:Rde,isRequest:Dde,isResponse:$de,isHeaders:Ide,isUndefined:gg,isDate:Ede,isFile:Ode,isBlob:Ade,isRegExp:Gde,isFunction:Fo,isStream:kde,isURLSearchParams:Mde,isTypedArray:Wde,isFileList:Pde,forEach:Om,merge:xE,extend:Lde,trim:Nde,stripBOM:Fde,inherits:jde,toFlatObject:Bde,kindOf:dw,kindOfTest:es,endsWith:Ude,toArray:zde,forEachEntry:Vde,matchAll:Hde,isHTMLForm:qde,hasOwnProperty:_R,hasOwnProp:_R,reduceDescriptors:iU,freezeMethods:Yde,toObjectSet:Zde,toCamelCase:Kde,noop:Xde,toFiniteNumber:Qde,findKey:nU,global:Sc,isContextDefined:rU,ALPHABET:oU,generateString:Jde,isSpecCompliantForm:ehe,toJSONObject:the,isAsyncFn:nhe,isThenable:rhe,setImmediate:aU,asap:ihe};function Gt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}xe.inherits(Gt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:xe.toJSONObject(this.config),code:this.code,status:this.status}}});const sU=Gt.prototype,uU={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{uU[e]={value:e}});Object.defineProperties(Gt,uU);Object.defineProperty(sU,"isAxiosError",{value:!0});Gt.from=(e,t,n,r,i,o)=>{const a=Object.create(sU);return xe.toFlatObject(e,a,function(u){return u!==Error.prototype},s=>s!=="isAxiosError"),Gt.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const ohe=null;function wE(e){return xe.isPlainObject(e)||xe.isArray(e)}function lU(e){return xe.endsWith(e,"[]")?e.slice(0,-2):e}function CR(e,t,n){return e?e.concat(t).map(function(i,o){return i=lU(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function ahe(e){return xe.isArray(e)&&!e.some(wE)}const she=xe.toFlatObject(xe,{},null,function(t){return/^is[A-Z]/.test(t)});function gw(e,t,n){if(!xe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=xe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!xe.isUndefined(b[y])});const r=n.metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&xe.isSpecCompliantForm(t);if(!xe.isFunction(i))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(xe.isDate(m))return m.toISOString();if(!u&&xe.isBlob(m))throw new Gt("Blob is not supported. Use a Buffer instead.");return xe.isArrayBuffer(m)||xe.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,y,b){let w=m;if(m&&!b&&typeof m=="object"){if(xe.endsWith(y,"{}"))y=r?y:y.slice(0,-2),m=JSON.stringify(m);else if(xe.isArray(m)&&ahe(m)||(xe.isFileList(m)||xe.endsWith(y,"[]"))&&(w=xe.toArray(m)))return y=lU(y),w.forEach(function(S,O){!(xe.isUndefined(S)||S===null)&&t.append(a===!0?CR([y],O,o):a===null?y:y+"[]",l(S))}),!1}return wE(m)?!0:(t.append(CR(b,y,o),l(m)),!1)}const f=[],h=Object.assign(she,{defaultVisitor:c,convertValue:l,isVisitable:wE});function p(m,y){if(!xe.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(m),xe.forEach(m,function(w,x){(!(xe.isUndefined(w)||w===null)&&i.call(t,w,xe.isString(x)?x.trim():x,y,h))===!0&&p(w,y?y.concat(x):[x])}),f.pop()}}if(!xe.isObject(e))throw new TypeError("data must be an object");return p(e),t}function ER(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function hA(e,t){this._pairs=[],e&&gw(e,this,t)}const cU=hA.prototype;cU.append=function(t,n){this._pairs.push([t,n])};cU.toString=function(t){const n=t?function(r){return t.call(this,r,ER)}:ER;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function uhe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fU(e,t,n){if(!t)return e;const r=n&&n.encode||uhe;xe.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=xe.isURLSearchParams(t)?t.toString():new hA(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class OR{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){xe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const dU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},lhe=typeof URLSearchParams<"u"?URLSearchParams:hA,che=typeof FormData<"u"?FormData:null,fhe=typeof Blob<"u"?Blob:null,dhe={isBrowser:!0,classes:{URLSearchParams:lhe,FormData:che,Blob:fhe},protocols:["http","https","file","blob","url","data"]},pA=typeof window<"u"&&typeof document<"u",_E=typeof navigator=="object"&&navigator||void 0,hhe=pA&&(!_E||["ReactNative","NativeScript","NS"].indexOf(_E.product)<0),phe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ghe=pA&&window.location.href||"http://localhost",mhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pA,hasStandardBrowserEnv:hhe,hasStandardBrowserWebWorkerEnv:phe,navigator:_E,origin:ghe},Symbol.toStringTag,{value:"Module"})),ki={...mhe,...dhe};function vhe(e,t){return gw(e,new ki.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return ki.isNode&&xe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function yhe(e){return xe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function bhe(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return a=!a&&xe.isArray(i)?i.length:a,u?(xe.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!s):((!i[a]||!xe.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&xe.isArray(i[a])&&(i[a]=bhe(i[a])),!s)}if(xe.isFormData(e)&&xe.isFunction(e.entries)){const n={};return xe.forEachEntry(e,(r,i)=>{t(yhe(r),i,n,0)}),n}return null}function xhe(e,t,n){if(xe.isString(e))try{return(t||JSON.parse)(e),xe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Am={transitional:dU,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=xe.isObject(t);if(o&&xe.isHTMLForm(t)&&(t=new FormData(t)),xe.isFormData(t))return i?JSON.stringify(hU(t)):t;if(xe.isArrayBuffer(t)||xe.isBuffer(t)||xe.isStream(t)||xe.isFile(t)||xe.isBlob(t)||xe.isReadableStream(t))return t;if(xe.isArrayBufferView(t))return t.buffer;if(xe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return vhe(t,this.formSerializer).toString();if((s=xe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return gw(s?{"files[]":t}:t,u&&new u,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),xhe(t)):t}],transformResponse:[function(t){const n=this.transitional||Am.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(xe.isResponse(t)||xe.isReadableStream(t))return t;if(t&&xe.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(s){if(a)throw s.name==="SyntaxError"?Gt.from(s,Gt.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ki.classes.FormData,Blob:ki.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};xe.forEach(["delete","get","head","post","put","patch"],e=>{Am.headers[e]={}});const whe=xe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_he=e=>{const t={};let n,r,i;return e&&e.split(` + */var _m=v;function hue(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pue=typeof Object.is=="function"?Object.is:hue,gue=_m.useSyncExternalStore,mue=_m.useRef,vue=_m.useEffect,yue=_m.useMemo,bue=_m.useDebugValue;Pj.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=mue(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=yue(function(){function u(p){if(!l){if(l=!0,c=p,p=r(p),i!==void 0&&a.hasValue){var m=a.value;if(i(m,p))return f=m}return f=p}if(m=f,pue(c,p))return m;var y=r(p);return i!==void 0&&i(m,y)?(c=p,m):(c=p,f=y)}var l=!1,c,f,h=n===void 0?null:n;return[function(){return u(t())},h===null?void 0:function(){return u(h())}]},[t,n,r,i]);var s=gue(e,o[0],o[1]);return vue(function(){a.hasValue=!0,a.value=s},[s]),bue(s),s};Aj.exports=Pj;var xue=Aj.exports;function wue(e){e()}function _ue(){let e=null,t=null;return{clear(){e=null,t=null},notify(){wue(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var VM={notify(){},get:()=>[]};function Sue(e,t){let n,r=VM,i=0,o=!1;function a(y){c();const b=r.subscribe(y);let w=!1;return()=>{w||(w=!0,b(),f())}}function s(){r.notify()}function u(){m.onStateChange&&m.onStateChange()}function l(){return o}function c(){i++,n||(n=e.subscribe(u),r=_ue())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=VM)}function h(){o||(o=!0,c())}function p(){o&&(o=!1,f())}const m={addNestedSub:a,notifyNestedSubs:s,handleChangeWrapper:u,isSubscribed:l,trySubscribe:h,tryUnsubscribe:p,getListeners:()=>r};return m}var Cue=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Eue=Cue(),Oue=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Aue=Oue(),Pue=()=>Eue||Aue?v.useLayoutEffect:v.useEffect,kue=Pue(),Tue=Symbol.for("react-redux-context"),Mue=typeof globalThis<"u"?globalThis:{};function Rue(){if(!v.createContext)return{};const e=Mue[Tue]??=new Map;let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var Al=Rue();function Due(e){const{children:t,context:n,serverState:r,store:i}=e,o=v.useMemo(()=>{const u=Sue(i);return{store:i,subscription:u,getServerState:r?()=>r:void 0}},[i,r]),a=v.useMemo(()=>i.getState(),[i]);kue(()=>{const{subscription:u}=o;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),a!==i.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[o,a]);const s=n||Al;return v.createElement(s.Provider,{value:o},t)}var $Xe=Due;function YO(e=Al){return function(){return v.useContext(e)}}var kj=YO();function Tj(e=Al){const t=e===Al?kj:YO(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var $ue=Tj();function Iue(e=Al){const t=e===Al?$ue:Tj(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var IXe=Iue(),Nue=(e,t)=>e===t;function Lue(e=Al){const t=e===Al?kj:YO(e),n=(r,i={})=>{const{equalityFn:o=Nue}=typeof i=="function"?{equalityFn:i}:i,a=t(),{store:s,subscription:u,getServerState:l}=a;v.useRef(!0);const c=v.useCallback({[r.name](h){return r(h)}}[r.name],[r]),f=xue.useSyncExternalStoreWithSelector(u.addNestedSub,s.getState,l||s.getState,c,o);return v.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var NXe=Lue();function HM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sw(...e){return t=>{let n=!1;const r=e.map(i=>{const o=HM(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:n,...r}=e,i=v.Children.toArray(n),o=i.find(Fue);if(o){const a=o.props.children,s=i.map(u=>u===o?v.Children.count(a)>1?v.Children.only(null):v.isValidElement(a)?a.props.children:null:u);return I.jsx(rE,{...r,ref:t,children:v.isValidElement(a)?v.cloneElement(a,void 0,s):null})}return I.jsx(rE,{...r,ref:t,children:n})});Pl.displayName="Slot";var rE=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const i=Bue(n);return v.cloneElement(n,{...jue(r,n.props),ref:t?sw(t,i):i})}return v.Children.count(n)>1?v.Children.only(null):null});rE.displayName="SlotClone";var ZO=({children:e})=>I.jsx(I.Fragment,{children:e});function Fue(e){return v.isValidElement(e)&&e.type===ZO}function jue(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Bue(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Mj(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,KM=dn,LXe=(e,t)=>n=>{var r;if(t?.variants==null)return KM(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(l=>{const c=n?.[l],f=o?.[l];if(c===null)return null;const h=qM(c)||qM(f);return i[l][h]}),s=n&&Object.entries(n).reduce((l,c)=>{let[f,h]=c;return h===void 0||(l[f]=h),l},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,c)=>{let{class:f,className:h,...p}=c;return Object.entries(p).every(m=>{let[y,b]=m;return Array.isArray(b)?b.includes({...o,...s}[y]):{...o,...s}[y]===b})?[...l,f,h]:l},[]);return KM(e,a,u,n?.class,n?.className)},XO="-",Uue=e=>{const t=Wue(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(XO);return s[0]===""&&s.length!==1&&s.shift(),Rj(s,t)||zue(a)},getConflictingClassGroupIds:(a,s)=>{const u=n[a]||[];return s&&r[a]?[...u,...r[a]]:u}}},Rj=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Rj(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(XO);return t.validators.find(({validator:a})=>a(o))?.classGroupId},GM=/^\[(.+)\]$/,zue=e=>{if(GM.test(e)){const t=GM.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Wue=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Hue(Object.entries(e.classGroups),n).forEach(([o,a])=>{iE(a,r,o,t)}),r},iE=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:YM(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Vue(i)){iE(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{iE(a,YM(t,o),n,r)})})},YM=(e,t)=>{let n=e;return t.split(XO).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Vue=e=>e.isThemeGetter,Hue=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e,que=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},Dj="!",Kue=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=s=>{const u=[];let l=0,c=0,f;for(let b=0;bc?f-c:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:y}};return n?s=>n({className:s,parseClassName:a}):a},Gue=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Yue=e=>({cache:que(e.cacheSize),parseClassName:Kue(e),...Uue(e)}),Zue=/\s+/,Xue=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(Zue);let s="";for(let u=a.length-1;u>=0;u-=1){const l=a[u],{modifiers:c,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(l);let m=!!p,y=r(m?h.substring(0,p):h);if(!y){if(!m){s=l+(s.length>0?" "+s:s);continue}if(y=r(h),!y){s=l+(s.length>0?" "+s:s);continue}m=!1}const b=Gue(c).join(":"),w=f?b+Dj:b,x=w+y;if(o.includes(x))continue;o.push(x);const S=i(y,m);for(let O=0;O0?" "+s:s)}return s};function Que(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rf(c),e());return n=Yue(l),r=n.cache.get,i=n.cache.set,o=s,s(u)}function s(u){const l=r(u);if(l)return l;const c=Xue(u,n);return i(u,c),c}return function(){return o(Que.apply(null,arguments))}}const Jn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ij=/^\[(?:([a-z-]+):)?(.+)\]$/i,ele=/^\d+\/\d+$/,tle=new Set(["px","full","screen"]),nle=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rle=/\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$/,ile=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ole=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ale=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>Ad(e)||tle.has(e)||ele.test(e),Vu=e=>$h(e,"length",ple),Ad=e=>!!e&&!Number.isNaN(Number(e)),ES=e=>$h(e,"number",Ad),Dp=e=>!!e&&Number.isInteger(Number(e)),sle=e=>e.endsWith("%")&&Ad(e.slice(0,-1)),Qt=e=>Ij.test(e),Hu=e=>nle.test(e),ule=new Set(["length","size","percentage"]),lle=e=>$h(e,ule,Nj),cle=e=>$h(e,"position",Nj),fle=new Set(["image","url"]),dle=e=>$h(e,fle,mle),hle=e=>$h(e,"",gle),$p=()=>!0,$h=(e,t,n)=>{const r=Ij.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},ple=e=>rle.test(e)&&!ile.test(e),Nj=()=>!1,gle=e=>ole.test(e),mle=e=>ale.test(e),vle=()=>{const e=Jn("colors"),t=Jn("spacing"),n=Jn("blur"),r=Jn("brightness"),i=Jn("borderColor"),o=Jn("borderRadius"),a=Jn("borderSpacing"),s=Jn("borderWidth"),u=Jn("contrast"),l=Jn("grayscale"),c=Jn("hueRotate"),f=Jn("invert"),h=Jn("gap"),p=Jn("gradientColorStops"),m=Jn("gradientColorStopPositions"),y=Jn("inset"),b=Jn("margin"),w=Jn("opacity"),x=Jn("padding"),S=Jn("saturate"),O=Jn("scale"),E=Jn("sepia"),C=Jn("skew"),P=Jn("space"),M=Jn("translate"),N=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",Qt,t],W=()=>[Qt,t],ee=()=>["",qs,Vu],Z=()=>["auto",Ad,Qt],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["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"],j=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",Qt],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],re=()=>[Ad,Qt];return{cacheSize:500,separator:":",theme:{colors:[$p],spacing:[qs,Vu],blur:["none","",Hu,Qt],brightness:re(),borderColor:[e],borderRadius:["none","","full",Hu,Qt],borderSpacing:W(),borderWidth:ee(),contrast:re(),grayscale:K(),hueRotate:re(),invert:K(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[sle,Vu],inset:V(),margin:V(),opacity:re(),padding:W(),saturate:re(),scale:re(),sepia:K(),skew:re(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",Qt]}],container:["container"],columns:[{columns:[Hu]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"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:[...q(),Qt]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dp,Qt]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Qt]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",Dp,Qt]}],"grid-cols":[{"grid-cols":[$p]}],"col-start-end":[{col:["auto",{span:["full",Dp,Qt]},Qt]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[$p]}],"row-start-end":[{row:["auto",{span:[Dp,Qt]},Qt]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Qt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Qt]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"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:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Qt,t]}],"min-w":[{"min-w":[Qt,t,"min","max","fit"]}],"max-w":[{"max-w":[Qt,t,"none","full","min","max","fit","prose",{screen:[Hu]},Hu]}],h:[{h:[Qt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Qt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Qt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Qt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Hu,Vu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ES]}],"font-family":[{font:[$p]}],"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",Qt]}],"line-clamp":[{"line-clamp":["none",Ad,ES]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qs,Qt]}],"list-image":[{"list-image":["none",Qt]}],"list-style-type":[{list:["none","disc","decimal",Qt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qs,Vu]}],"underline-offset":[{"underline-offset":["auto",qs,Qt]}],"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:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qt]}],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",Qt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),cle]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lle]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dle]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"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:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:G()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[qs,Qt]}],"outline-w":[{outline:[qs,Vu]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[qs,Vu]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Hu,hle]}],"shadow-color":[{shadow:[$p]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Hu,Qt]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"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",Qt]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",Qt]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",Qt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[Dp,Qt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Qt]}],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",Qt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"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",Qt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[qs,Vu,ES]}],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"]}}},FXe=Jue(vle);var Lj={exports:{}},yle="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ble=yle,xle=ble;function Fj(){}function jj(){}jj.resetWarningCache=Fj;var wle=function(){function e(r,i,o,a,s,u){if(u!==xle){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:jj,resetWarningCache:Fj};return n.PropTypes=n,n};Lj.exports=wle();var _le=Lj.exports;const Rt=$n(_le);var Sle={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"},Cle=Object.defineProperty,Ele=Object.defineProperties,Ole=Object.getOwnPropertyDescriptors,X1=Object.getOwnPropertySymbols,Bj=Object.prototype.hasOwnProperty,Uj=Object.prototype.propertyIsEnumerable,ZM=(e,t,n)=>t in e?Cle(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XM=(e,t)=>{for(var n in t||(t={}))Bj.call(t,n)&&ZM(e,n,t[n]);if(X1)for(var n of X1(t))Uj.call(t,n)&&ZM(e,n,t[n]);return e},Ale=(e,t)=>Ele(e,Ole(t)),Ple=(e,t)=>{var n={};for(var r in e)Bj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&X1)for(var r of X1(e))t.indexOf(r)<0&&Uj.call(e,r)&&(n[r]=e[r]);return n},xn=(e,t,n)=>{const r=v.forwardRef((i,o)=>{var a=i,{color:s="currentColor",size:u=24,stroke:l=2,children:c}=a,f=Ple(a,["color","size","stroke","children"]);return v.createElement("svg",XM(Ale(XM({ref:o},Sle),{width:u,height:u,stroke:s,strokeWidth:l,className:`tabler-icon tabler-icon-${e}`}),f),[...n.map(([h,p])=>v.createElement(h,p)),...c||[]])});return r.propTypes={color:Rt.string,size:Rt.oneOfType([Rt.string,Rt.number]),stroke:Rt.oneOfType([Rt.string,Rt.number])},r.displayName=`${t}`,r},jXe=xn("adjustments","IconAdjustments",[["path",{d:"M4 10a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M6 4v4",key:"svg-1"}],["path",{d:"M6 12v8",key:"svg-2"}],["path",{d:"M10 16a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-3"}],["path",{d:"M12 4v10",key:"svg-4"}],["path",{d:"M12 18v2",key:"svg-5"}],["path",{d:"M16 7a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-6"}],["path",{d:"M18 4v1",key:"svg-7"}],["path",{d:"M18 9v11",key:"svg-8"}]]),BXe=xn("brand-telegram","IconBrandTelegram",[["path",{d:"M15 10l-4 4l6 6l4 -16l-18 7l4 2l2 6l3 -4",key:"svg-0"}]]),UXe=xn("building-store","IconBuildingStore",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M3 7v1a3 3 0 0 0 6 0v-1m0 1a3 3 0 0 0 6 0v-1m0 1a3 3 0 0 0 6 0v-1h-18l2 -4h14l2 4",key:"svg-1"}],["path",{d:"M5 21l0 -10.15",key:"svg-2"}],["path",{d:"M19 21l0 -10.15",key:"svg-3"}],["path",{d:"M9 21v-4a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v4",key:"svg-4"}]]),zXe=xn("building","IconBuilding",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]]),WXe=xn("cash","IconCash",[["path",{d:"M7 9m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M14 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M17 9v-2a2 2 0 0 0 -2 -2h-10a2 2 0 0 0 -2 2v6a2 2 0 0 0 2 2h2",key:"svg-2"}]]),VXe=xn("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),HXe=xn("chevrons-left","IconChevronsLeft",[["path",{d:"M11 7l-5 5l5 5",key:"svg-0"}],["path",{d:"M17 7l-5 5l5 5",key:"svg-1"}]]),qXe=xn("copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]),KXe=xn("credit-card","IconCreditCard",[["path",{d:"M3 5m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M3 10l18 0",key:"svg-1"}],["path",{d:"M7 15l.01 0",key:"svg-2"}],["path",{d:"M11 15l2 0",key:"svg-3"}]]),GXe=xn("dashboard","IconDashboard",[["path",{d:"M12 13m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M13.45 11.55l2.05 -2.05",key:"svg-1"}],["path",{d:"M6.4 20a9 9 0 1 1 11.2 0z",key:"svg-2"}]]),YXe=xn("device-desktop","IconDeviceDesktop",[["path",{d:"M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10z",key:"svg-0"}],["path",{d:"M7 20h10",key:"svg-1"}],["path",{d:"M9 16v4",key:"svg-2"}],["path",{d:"M15 16v4",key:"svg-3"}]]),ZXe=xn("discount-check","IconDiscountCheck",[["path",{d:"M5 7.2a2.2 2.2 0 0 1 2.2 -2.2h1a2.2 2.2 0 0 0 1.55 -.64l.7 -.7a2.2 2.2 0 0 1 3.12 0l.7 .7c.412 .41 .97 .64 1.55 .64h1a2.2 2.2 0 0 1 2.2 2.2v1c0 .58 .23 1.138 .64 1.55l.7 .7a2.2 2.2 0 0 1 0 3.12l-.7 .7a2.2 2.2 0 0 0 -.64 1.55v1a2.2 2.2 0 0 1 -2.2 2.2h-1a2.2 2.2 0 0 0 -1.55 .64l-.7 .7a2.2 2.2 0 0 1 -3.12 0l-.7 -.7a2.2 2.2 0 0 0 -1.55 -.64h-1a2.2 2.2 0 0 1 -2.2 -2.2v-1a2.2 2.2 0 0 0 -.64 -1.55l-.7 -.7a2.2 2.2 0 0 1 0 -3.12l.7 -.7a2.2 2.2 0 0 0 .64 -1.55v-1",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]]),XXe=xn("eye-off","IconEyeOff",[["path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828",key:"svg-0"}],["path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]),QXe=xn("eye","IconEye",[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]]),JXe=xn("file-text","IconFileText",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M9 9l1 0",key:"svg-2"}],["path",{d:"M9 13l6 0",key:"svg-3"}],["path",{d:"M9 17l6 0",key:"svg-4"}]]),eQe=xn("loader-2","IconLoader2",[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]]),tQe=xn("lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]),nQe=xn("mail","IconMail",[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}]]),rQe=xn("menu-2","IconMenu2",[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]]),iQe=xn("moon","IconMoon",[["path",{d:"M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z",key:"svg-0"}]]),oQe=xn("news","IconNews",[["path",{d:"M16 6h3a1 1 0 0 1 1 1v11a2 2 0 0 1 -4 0v-13a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1v12a3 3 0 0 0 3 3h11",key:"svg-0"}],["path",{d:"M8 8l4 0",key:"svg-1"}],["path",{d:"M8 12l4 0",key:"svg-2"}],["path",{d:"M8 16l4 0",key:"svg-3"}]]),aQe=xn("route","IconRoute",[["path",{d:"M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4z",key:"svg-1"}],["path",{d:"M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5",key:"svg-2"}]]),sQe=xn("server-bolt","IconServerBolt",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M15 20h-9a3 3 0 0 1 -3 -3v-2a3 3 0 0 1 3 -3h12",key:"svg-1"}],["path",{d:"M7 8v.01",key:"svg-2"}],["path",{d:"M7 16v.01",key:"svg-3"}],["path",{d:"M20 15l-2 3h3l-2 3",key:"svg-4"}]]),uQe=xn("server","IconServer",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M3 12m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-1"}],["path",{d:"M7 8l0 .01",key:"svg-2"}],["path",{d:"M7 16l0 .01",key:"svg-3"}]]),lQe=xn("settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]),cQe=xn("sun","IconSun",[["path",{d:"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7",key:"svg-1"}]]),fQe=xn("template","IconTemplate",[["path",{d:"M4 4m0 1a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M4 12m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M14 12l6 0",key:"svg-2"}],["path",{d:"M14 16l6 0",key:"svg-3"}],["path",{d:"M14 20l6 0",key:"svg-4"}]]),dQe=xn("ticket","IconTicket",[["path",{d:"M15 5l0 2",key:"svg-0"}],["path",{d:"M15 11l0 2",key:"svg-1"}],["path",{d:"M15 17l0 2",key:"svg-2"}],["path",{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2",key:"svg-3"}]]),hQe=xn("user-circle","IconUserCircle",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 10m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855",key:"svg-2"}]]),pQe=xn("user","IconUser",[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]]),gQe=xn("users","IconUsers",[["path",{d:"M9 7m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"svg-2"}],["path",{d:"M21 21v-2a4 4 0 0 0 -3 -3.85",key:"svg-3"}]]),mQe=xn("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]),kle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],gt=kle.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Pl:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(s,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function zj(e,t){e&&Au.flushSync(()=>e.dispatchEvent(t))}var Tle="Separator",QM="horizontal",Mle=["horizontal","vertical"],Wj=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=QM,...i}=e,o=Rle(r)?r:QM,s=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return I.jsx(gt.div,{"data-orientation":o,...s,...i,ref:t})});Wj.displayName=Tle;function Rle(e){return Mle.includes(e)}var vQe=Wj,Sm=e=>e.type==="checkbox",_c=e=>e instanceof Date,Bi=e=>e==null;const Vj=e=>typeof e=="object";var Ar=e=>!Bi(e)&&!Array.isArray(e)&&Vj(e)&&!_c(e),Hj=e=>Ar(e)&&e.target?Sm(e.target)?e.target.checked:e.target.value:e,Dle=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qj=(e,t)=>e.has(Dle(t)),$le=e=>{const t=e.constructor&&e.constructor.prototype;return Ar(t)&&t.hasOwnProperty("isPrototypeOf")},QO=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function to(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(QO&&(e instanceof Blob||r))&&(n||Ar(e)))if(t=n?[]:{},!n&&!$le(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=to(e[i]));else return e;return t}var uw=e=>Array.isArray(e)?e.filter(Boolean):[],Cr=e=>e===void 0,Ze=(e,t,n)=>{if(!t||!Ar(e))return n;const r=uw(t.split(/[,[\].]+?/)).reduce((i,o)=>Bi(i)?i:i[o],e);return Cr(r)||r===e?Cr(e[t])?n:e[t]:r},aa=e=>typeof e=="boolean",JO=e=>/^\w*$/.test(e),Kj=e=>uw(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pn=(e,t,n)=>{let r=-1;const i=JO(t)?[t]:Kj(t),o=i.length,a=o-1;for(;++rF.useContext(Gj),yQe=e=>{const{children:t,...n}=e;return F.createElement(Gj.Provider,{value:n},t)};var Yj=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Fa.all&&(t._proxyFormState[a]=!r||Fa.all),n&&(n[a]=!0),e[a]}});return i},ro=e=>Ar(e)&&!Object.keys(e).length,Zj=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return ro(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||Fa.all))},_0=e=>Array.isArray(e)?e:[e],Xj=(e,t,n)=>!e||!t||e===t||_0(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function tA(e){const t=F.useRef(e);t.current=e,F.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function Ile(e){const t=eA(),{control:n=t.control,disabled:r,name:i,exact:o}=e,[a,s]=F.useState(n._formState),u=F.useRef(!0),l=F.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=F.useRef(i);return c.current=i,tA({disabled:r,next:f=>u.current&&Xj(c.current,f.name,o)&&Zj(f,l.current,n._updateFormState)&&s({...n._formState,...f}),subject:n._subjects.state}),F.useEffect(()=>(u.current=!0,l.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),F.useMemo(()=>Yj(a,n,l.current,!1),[a,n])}var gs=e=>typeof e=="string",Qj=(e,t,n,r,i)=>gs(e)?(r&&t.watch.add(e),Ze(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Ze(n,o))):(r&&(t.watchAll=!0),n);function Nle(e){const t=eA(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a}=e,s=F.useRef(r);s.current=r,tA({disabled:o,subject:n._subjects.values,next:c=>{Xj(s.current,c.name,a)&&l(to(Qj(s.current,n._names,c.values||n._formValues,!1,i)))}});const[u,l]=F.useState(n._getWatch(r,i));return F.useEffect(()=>n._removeUnmounted()),u}function Lle(e){const t=eA(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o}=e,a=qj(i._names.array,n),s=Nle({control:i,name:n,defaultValue:Ze(i._formValues,n,Ze(i._defaultValues,n,e.defaultValue)),exact:!0}),u=Ile({control:i,name:n,exact:!0}),l=F.useRef(i.register(n,{...e.rules,value:s,...aa(e.disabled)?{disabled:e.disabled}:{}})),c=F.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ze(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ze(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ze(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ze(u.validatingFields,n)},error:{enumerable:!0,get:()=>Ze(u.errors,n)}}),[u,n]),f=F.useMemo(()=>({name:n,value:s,...aa(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:h=>l.current.onChange({target:{value:Hj(h),name:n},type:Q1.CHANGE}),onBlur:()=>l.current.onBlur({target:{value:Ze(i._formValues,n),name:n},type:Q1.BLUR}),ref:h=>{const p=Ze(i._fields,n);p&&h&&(p._f.ref={focus:()=>h.focus(),select:()=>h.select(),setCustomValidity:m=>h.setCustomValidity(m),reportValidity:()=>h.reportValidity()})}}),[n,i._formValues,r,u.disabled,s,i._fields]);return F.useEffect(()=>{const h=i._options.shouldUnregister||o,p=(m,y)=>{const b=Ze(i._fields,m);b&&b._f&&(b._f.mount=y)};if(p(n,!0),h){const m=to(Ze(i._options.defaultValues,n));Pn(i._defaultValues,n,m),Cr(Ze(i._formValues,n))&&Pn(i._formValues,n,m)}return!a&&i.register(n),()=>{(a?h&&!i._state.action:h)?i.unregister(n):p(n,!1)}},[n,i,a,o]),F.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),F.useMemo(()=>({field:f,formState:u,fieldState:c}),[f,u,c])}const bQe=e=>e.render(Lle(e));var Jj=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},JM=e=>({isOnSubmit:!e||e===Fa.onSubmit,isOnBlur:e===Fa.onBlur,isOnChange:e===Fa.onChange,isOnAll:e===Fa.all,isOnTouch:e===Fa.onTouched}),eR=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const S0=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Ze(e,i);if(o){const{_f:a,...s}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(S0(s,t))break}else if(Ar(s)&&S0(s,t))break}}};var Fle=(e,t,n)=>{const r=_0(Ze(e,n));return Pn(r,"root",t[n]),Pn(e,n,r),e},nA=e=>e.type==="file",ds=e=>typeof e=="function",J1=e=>{if(!QO)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},f1=e=>gs(e),rA=e=>e.type==="radio",eb=e=>e instanceof RegExp;const tR={value:!1,isValid:!1},nR={value:!0,isValid:!0};var eB=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Cr(e[0].attributes.value)?Cr(e[0].value)||e[0].value===""?nR:{value:e[0].value,isValid:!0}:nR:tR}return tR};const rR={isValid:!1,value:null};var tB=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,rR):rR;function iR(e,t,n="validate"){if(f1(e)||Array.isArray(e)&&e.every(f1)||aa(e)&&!e)return{type:n,message:f1(e)?e:"",ref:t}}var Uf=e=>Ar(e)&&!eb(e)?e:{value:e,message:""},oR=async(e,t,n,r,i,o)=>{const{ref:a,refs:s,required:u,maxLength:l,minLength:c,min:f,max:h,pattern:p,validate:m,name:y,valueAsNumber:b,mount:w}=e._f,x=Ze(n,y);if(!w||t.has(y))return{};const S=s?s[0]:a,O=W=>{i&&S.reportValidity&&(S.setCustomValidity(aa(W)?"":W||""),S.reportValidity())},E={},C=rA(a),P=Sm(a),M=C||P,N=(b||nA(a))&&Cr(a.value)&&Cr(x)||J1(a)&&a.value===""||x===""||Array.isArray(x)&&!x.length,B=Jj.bind(null,y,r,E),V=(W,ee,Z,q=Ks.maxLength,G=Ks.minLength)=>{const H=W?ee:Z;E[y]={type:W?q:G,message:H,ref:a,...B(W?q:G,H)}};if(o?!Array.isArray(x)||!x.length:u&&(!M&&(N||Bi(x))||aa(x)&&!x||P&&!eB(s).isValid||C&&!tB(s).isValid)){const{value:W,message:ee}=f1(u)?{value:!!u,message:u}:Uf(u);if(W&&(E[y]={type:Ks.required,message:ee,ref:S,...B(Ks.required,ee)},!r))return O(ee),E}if(!N&&(!Bi(f)||!Bi(h))){let W,ee;const Z=Uf(h),q=Uf(f);if(!Bi(x)&&!isNaN(x)){const G=a.valueAsNumber||x&&+x;Bi(Z.value)||(W=G>Z.value),Bi(q.value)||(ee=Gnew Date(new Date().toDateString()+" "+Y),j=a.type=="time",K=a.type=="week";gs(Z.value)&&x&&(W=j?H(x)>H(Z.value):K?x>Z.value:G>new Date(Z.value)),gs(q.value)&&x&&(ee=j?H(x)+W.value,q=!Bi(ee.value)&&x.length<+ee.value;if((Z||q)&&(V(Z,W.message,ee.message),!r))return O(E[y].message),E}if(p&&!N&&gs(x)){const{value:W,message:ee}=Uf(p);if(eb(W)&&!x.match(W)&&(E[y]={type:Ks.pattern,message:ee,ref:a,...B(Ks.pattern,ee)},!r))return O(ee),E}if(m){if(ds(m)){const W=await m(x,n),ee=iR(W,S);if(ee&&(E[y]={...ee,...B(Ks.validate,ee.message)},!r))return O(ee.message),E}else if(Ar(m)){let W={};for(const ee in m){if(!ro(W)&&!r)break;const Z=iR(await m[ee](x,n),S,ee);Z&&(W={...Z,...B(ee,Z.message)},O(Z.message),r&&(E[y]=W))}if(!ro(W)&&(E[y]={ref:S,...W},!r))return E}}return O(!0),E};function jle(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},oE=e=>Bi(e)||!Vj(e);function nl(e,t){if(oE(e)||oE(t))return e===t;if(_c(e)&&_c(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const a=t[i];if(_c(o)&&_c(a)||Ar(o)&&Ar(a)||Array.isArray(o)&&Array.isArray(a)?!nl(o,a):o!==a)return!1}}return!0}var nB=e=>e.type==="select-multiple",Ule=e=>rA(e)||Sm(e),AS=e=>J1(e)&&e.isConnected,rB=e=>{for(const t in e)if(ds(e[t]))return!0;return!1};function tb(e,t={}){const n=Array.isArray(e);if(Ar(e)||n)for(const r in e)Array.isArray(e[r])||Ar(e[r])&&!rB(e[r])?(t[r]=Array.isArray(e[r])?[]:{},tb(e[r],t[r])):Bi(e[r])||(t[r]=!0);return t}function iB(e,t,n){const r=Array.isArray(e);if(Ar(e)||r)for(const i in e)Array.isArray(e[i])||Ar(e[i])&&!rB(e[i])?Cr(t)||oE(n[i])?n[i]=Array.isArray(e[i])?tb(e[i],[]):{...tb(e[i])}:iB(e[i],Bi(t)?{}:t[i],n[i]):n[i]=!nl(e[i],t[i]);return n}var Ip=(e,t)=>iB(e,t,tb(t)),oB=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Cr(e)?e:t?e===""?NaN:e&&+e:n&&gs(e)?new Date(e):r?r(e):e;function PS(e){const t=e.ref;return nA(t)?t.files:rA(t)?tB(e.refs).value:nB(t)?[...t.selectedOptions].map(({value:n})=>n):Sm(t)?eB(e.refs).value:oB(Cr(t.value)?e.ref.value:t.value,e)}var zle=(e,t,n,r)=>{const i={};for(const o of e){const a=Ze(t,o);a&&Pn(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Np=e=>Cr(e)?e:eb(e)?e.source:Ar(e)?eb(e.value)?e.value.source:e.value:e;const aR="AsyncFunction";var Wle=e=>!!e&&!!e.validate&&!!(ds(e.validate)&&e.validate.constructor.name===aR||Ar(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===aR)),Vle=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function sR(e,t,n){const r=Ze(e,n);if(r||JO(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Ze(t,o),s=Ze(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(s&&s.type)return{name:o,error:s};i.pop()}return{name:n}}var Hle=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,qle=(e,t)=>!uw(Ze(e,t)).length&&Ur(e,t);const Kle={mode:Fa.onSubmit,reValidateMode:Fa.onChange,shouldFocusError:!0};function Gle(e={}){let t={...Kle,...e},n={submitCount:0,isDirty:!1,isLoading:ds(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=Ar(t.defaultValues)||Ar(t.values)?to(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:to(i),a={action:!1,mount:!1,watch:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,l=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:OS(),array:OS(),state:OS()},h=JM(t.mode),p=JM(t.reValidateMode),m=t.criteriaMode===Fa.all,y=ne=>de=>{clearTimeout(l),l=setTimeout(ne,de)},b=async ne=>{if(!t.disabled&&(c.isValid||ne)){const de=t.resolver?ro((await M()).errors):await B(r,!0);de!==n.isValid&&f.state.next({isValid:de})}},w=(ne,de)=>{!t.disabled&&(c.isValidating||c.validatingFields)&&((ne||Array.from(s.mount)).forEach(ge=>{ge&&(de?Pn(n.validatingFields,ge,de):Ur(n.validatingFields,ge))}),f.state.next({validatingFields:n.validatingFields,isValidating:!ro(n.validatingFields)}))},x=(ne,de=[],ge,Ue,Fe=!0,Ae=!0)=>{if(Ue&&ge&&!t.disabled){if(a.action=!0,Ae&&Array.isArray(Ze(r,ne))){const tt=ge(Ze(r,ne),Ue.argA,Ue.argB);Fe&&Pn(r,ne,tt)}if(Ae&&Array.isArray(Ze(n.errors,ne))){const tt=ge(Ze(n.errors,ne),Ue.argA,Ue.argB);Fe&&Pn(n.errors,ne,tt),qle(n.errors,ne)}if(c.touchedFields&&Ae&&Array.isArray(Ze(n.touchedFields,ne))){const tt=ge(Ze(n.touchedFields,ne),Ue.argA,Ue.argB);Fe&&Pn(n.touchedFields,ne,tt)}c.dirtyFields&&(n.dirtyFields=Ip(i,o)),f.state.next({name:ne,isDirty:W(ne,de),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Pn(o,ne,de)},S=(ne,de)=>{Pn(n.errors,ne,de),f.state.next({errors:n.errors})},O=ne=>{n.errors=ne,f.state.next({errors:n.errors,isValid:!1})},E=(ne,de,ge,Ue)=>{const Fe=Ze(r,ne);if(Fe){const Ae=Ze(o,ne,Cr(ge)?Ze(i,ne):ge);Cr(Ae)||Ue&&Ue.defaultChecked||de?Pn(o,ne,de?Ae:PS(Fe._f)):q(ne,Ae),a.mount&&b()}},C=(ne,de,ge,Ue,Fe)=>{let Ae=!1,tt=!1;const mt={name:ne};if(!t.disabled){const wn=!!(Ze(r,ne)&&Ze(r,ne)._f&&Ze(r,ne)._f.disabled);if(!ge||Ue){c.isDirty&&(tt=n.isDirty,n.isDirty=mt.isDirty=W(),Ae=tt!==mt.isDirty);const Kt=wn||nl(Ze(i,ne),de);tt=!!(!wn&&Ze(n.dirtyFields,ne)),Kt||wn?Ur(n.dirtyFields,ne):Pn(n.dirtyFields,ne,!0),mt.dirtyFields=n.dirtyFields,Ae=Ae||c.dirtyFields&&tt!==!Kt}if(ge){const Kt=Ze(n.touchedFields,ne);Kt||(Pn(n.touchedFields,ne,ge),mt.touchedFields=n.touchedFields,Ae=Ae||c.touchedFields&&Kt!==ge)}Ae&&Fe&&f.state.next(mt)}return Ae?mt:{}},P=(ne,de,ge,Ue)=>{const Fe=Ze(n.errors,ne),Ae=c.isValid&&aa(de)&&n.isValid!==de;if(t.delayError&&ge?(u=y(()=>S(ne,ge)),u(t.delayError)):(clearTimeout(l),u=null,ge?Pn(n.errors,ne,ge):Ur(n.errors,ne)),(ge?!nl(Fe,ge):Fe)||!ro(Ue)||Ae){const tt={...Ue,...Ae&&aa(de)?{isValid:de}:{},errors:n.errors,name:ne};n={...n,...tt},f.state.next(tt)}},M=async ne=>{w(ne,!0);const de=await t.resolver(o,t.context,zle(ne||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(ne),de},N=async ne=>{const{errors:de}=await M(ne);if(ne)for(const ge of ne){const Ue=Ze(de,ge);Ue?Pn(n.errors,ge,Ue):Ur(n.errors,ge)}else n.errors=de;return de},B=async(ne,de,ge={valid:!0})=>{for(const Ue in ne){const Fe=ne[Ue];if(Fe){const{_f:Ae,...tt}=Fe;if(Ae){const mt=s.array.has(Ae.name),wn=Fe._f&&Wle(Fe._f);wn&&c.validatingFields&&w([Ue],!0);const Kt=await oR(Fe,s.disabled,o,m,t.shouldUseNativeValidation&&!de,mt);if(wn&&c.validatingFields&&w([Ue]),Kt[Ae.name]&&(ge.valid=!1,de))break;!de&&(Ze(Kt,Ae.name)?mt?Fle(n.errors,Kt,Ae.name):Pn(n.errors,Ae.name,Kt[Ae.name]):Ur(n.errors,Ae.name))}!ro(tt)&&await B(tt,de,ge)}}return ge.valid},V=()=>{for(const ne of s.unMount){const de=Ze(r,ne);de&&(de._f.refs?de._f.refs.every(ge=>!AS(ge)):!AS(de._f.ref))&&He(ne)}s.unMount=new Set},W=(ne,de)=>!t.disabled&&(ne&&de&&Pn(o,ne,de),!nl(re(),i)),ee=(ne,de,ge)=>Qj(ne,s,{...a.mount?o:Cr(de)?i:gs(ne)?{[ne]:de}:de},ge,de),Z=ne=>uw(Ze(a.mount?o:i,ne,t.shouldUnregister?Ze(i,ne,[]):[])),q=(ne,de,ge={})=>{const Ue=Ze(r,ne);let Fe=de;if(Ue){const Ae=Ue._f;Ae&&(!Ae.disabled&&Pn(o,ne,oB(de,Ae)),Fe=J1(Ae.ref)&&Bi(de)?"":de,nB(Ae.ref)?[...Ae.ref.options].forEach(tt=>tt.selected=Fe.includes(tt.value)):Ae.refs?Sm(Ae.ref)?Ae.refs.length>1?Ae.refs.forEach(tt=>(!tt.defaultChecked||!tt.disabled)&&(tt.checked=Array.isArray(Fe)?!!Fe.find(mt=>mt===tt.value):Fe===tt.value)):Ae.refs[0]&&(Ae.refs[0].checked=!!Fe):Ae.refs.forEach(tt=>tt.checked=tt.value===Fe):nA(Ae.ref)?Ae.ref.value="":(Ae.ref.value=Fe,Ae.ref.type||f.values.next({name:ne,values:{...o}})))}(ge.shouldDirty||ge.shouldTouch)&&C(ne,Fe,ge.shouldTouch,ge.shouldDirty,!0),ge.shouldValidate&&Y(ne)},G=(ne,de,ge)=>{for(const Ue in de){const Fe=de[Ue],Ae=`${ne}.${Ue}`,tt=Ze(r,Ae);(s.array.has(ne)||Ar(Fe)||tt&&!tt._f)&&!_c(Fe)?G(Ae,Fe,ge):q(Ae,Fe,ge)}},H=(ne,de,ge={})=>{const Ue=Ze(r,ne),Fe=s.array.has(ne),Ae=to(de);Pn(o,ne,Ae),Fe?(f.array.next({name:ne,values:{...o}}),(c.isDirty||c.dirtyFields)&&ge.shouldDirty&&f.state.next({name:ne,dirtyFields:Ip(i,o),isDirty:W(ne,Ae)})):Ue&&!Ue._f&&!Bi(Ae)?G(ne,Ae,ge):q(ne,Ae,ge),eR(ne,s)&&f.state.next({...n}),f.values.next({name:a.mount?ne:void 0,values:{...o}})},j=async ne=>{a.mount=!0;const de=ne.target;let ge=de.name,Ue=!0;const Fe=Ze(r,ge),Ae=()=>de.type?PS(Fe._f):Hj(ne),tt=mt=>{Ue=Number.isNaN(mt)||_c(mt)&&isNaN(mt.getTime())||nl(mt,Ze(o,ge,mt))};if(Fe){let mt,wn;const Kt=Ae(),_n=ne.type===Q1.BLUR||ne.type===Q1.FOCUS_OUT,$i=!Vle(Fe._f)&&!t.resolver&&!Ze(n.errors,ge)&&!Fe._f.deps||Hle(_n,Ze(n.touchedFields,ge),n.isSubmitted,p,h),xr=eR(ge,s,_n);Pn(o,ge,Kt),_n?(Fe._f.onBlur&&Fe._f.onBlur(ne),u&&u(0)):Fe._f.onChange&&Fe._f.onChange(ne);const mi=C(ge,Kt,_n,!1),ur=!ro(mi)||xr;if(!_n&&f.values.next({name:ge,type:ne.type,values:{...o}}),$i)return c.isValid&&(t.mode==="onBlur"&&_n?b():_n||b()),ur&&f.state.next({name:ge,...xr?{}:mi});if(!_n&&xr&&f.state.next({...n}),t.resolver){const{errors:ai}=await M([ge]);if(tt(Kt),Ue){const vi=sR(n.errors,r,ge),Dr=sR(ai,r,vi.name||ge);mt=Dr.error,ge=Dr.name,wn=ro(ai)}}else w([ge],!0),mt=(await oR(Fe,s.disabled,o,m,t.shouldUseNativeValidation))[ge],w([ge]),tt(Kt),Ue&&(mt?wn=!1:c.isValid&&(wn=await B(r,!0)));Ue&&(Fe._f.deps&&Y(Fe._f.deps),P(ge,wn,mt,mi))}},K=(ne,de)=>{if(Ze(n.errors,de)&&ne.focus)return ne.focus(),1},Y=async(ne,de={})=>{let ge,Ue;const Fe=_0(ne);if(t.resolver){const Ae=await N(Cr(ne)?ne:Fe);ge=ro(Ae),Ue=ne?!Fe.some(tt=>Ze(Ae,tt)):ge}else ne?(Ue=(await Promise.all(Fe.map(async Ae=>{const tt=Ze(r,Ae);return await B(tt&&tt._f?{[Ae]:tt}:tt)}))).every(Boolean),!(!Ue&&!n.isValid)&&b()):Ue=ge=await B(r);return f.state.next({...!gs(ne)||c.isValid&&ge!==n.isValid?{}:{name:ne},...t.resolver||!ne?{isValid:ge}:{},errors:n.errors}),de.shouldFocus&&!Ue&&S0(r,K,ne?Fe:s.mount),Ue},re=ne=>{const de={...a.mount?o:i};return Cr(ne)?de:gs(ne)?Ze(de,ne):ne.map(ge=>Ze(de,ge))},ie=(ne,de)=>({invalid:!!Ze((de||n).errors,ne),isDirty:!!Ze((de||n).dirtyFields,ne),error:Ze((de||n).errors,ne),isValidating:!!Ze(n.validatingFields,ne),isTouched:!!Ze((de||n).touchedFields,ne)}),se=ne=>{ne&&_0(ne).forEach(de=>Ur(n.errors,de)),f.state.next({errors:ne?n.errors:{}})},ye=(ne,de,ge)=>{const Ue=(Ze(r,ne,{_f:{}})._f||{}).ref,Fe=Ze(n.errors,ne)||{},{ref:Ae,message:tt,type:mt,...wn}=Fe;Pn(n.errors,ne,{...wn,...de,ref:Ue}),f.state.next({name:ne,errors:n.errors,isValid:!1}),ge&&ge.shouldFocus&&Ue&&Ue.focus&&Ue.focus()},we=(ne,de)=>ds(ne)?f.values.subscribe({next:ge=>ne(ee(void 0,de),ge)}):ee(ne,de,!0),He=(ne,de={})=>{for(const ge of ne?_0(ne):s.mount)s.mount.delete(ge),s.array.delete(ge),de.keepValue||(Ur(r,ge),Ur(o,ge)),!de.keepError&&Ur(n.errors,ge),!de.keepDirty&&Ur(n.dirtyFields,ge),!de.keepTouched&&Ur(n.touchedFields,ge),!de.keepIsValidating&&Ur(n.validatingFields,ge),!t.shouldUnregister&&!de.keepDefaultValue&&Ur(i,ge);f.values.next({values:{...o}}),f.state.next({...n,...de.keepDirty?{isDirty:W()}:{}}),!de.keepIsValid&&b()},Ee=({disabled:ne,name:de,field:ge,fields:Ue})=>{(aa(ne)&&a.mount||ne||s.disabled.has(de))&&(ne?s.disabled.add(de):s.disabled.delete(de),C(de,PS(ge?ge._f:Ze(Ue,de)._f),!1,!1,!0))},it=(ne,de={})=>{let ge=Ze(r,ne);const Ue=aa(de.disabled)||aa(t.disabled);return Pn(r,ne,{...ge||{},_f:{...ge&&ge._f?ge._f:{ref:{name:ne}},name:ne,mount:!0,...de}}),s.mount.add(ne),ge?Ee({field:ge,disabled:aa(de.disabled)?de.disabled:t.disabled,name:ne}):E(ne,!0,de.value),{...Ue?{disabled:de.disabled||t.disabled}:{},...t.progressive?{required:!!de.required,min:Np(de.min),max:Np(de.max),minLength:Np(de.minLength),maxLength:Np(de.maxLength),pattern:Np(de.pattern)}:{},name:ne,onChange:j,onBlur:j,ref:Fe=>{if(Fe){it(ne,de),ge=Ze(r,ne);const Ae=Cr(Fe.value)&&Fe.querySelectorAll&&Fe.querySelectorAll("input,select,textarea")[0]||Fe,tt=Ule(Ae),mt=ge._f.refs||[];if(tt?mt.find(wn=>wn===Ae):Ae===ge._f.ref)return;Pn(r,ne,{_f:{...ge._f,...tt?{refs:[...mt.filter(AS),Ae,...Array.isArray(Ze(i,ne))?[{}]:[]],ref:{type:Ae.type,name:ne}}:{ref:Ae}}}),E(ne,!1,void 0,Ae)}else ge=Ze(r,ne,{}),ge._f&&(ge._f.mount=!1),(t.shouldUnregister||de.shouldUnregister)&&!(qj(s.array,ne)&&a.action)&&s.unMount.add(ne)}}},ke=()=>t.shouldFocusError&&S0(r,K,s.mount),Le=ne=>{aa(ne)&&(f.state.next({disabled:ne}),S0(r,(de,ge)=>{const Ue=Ze(r,ge);Ue&&(de.disabled=Ue._f.disabled||ne,Array.isArray(Ue._f.refs)&&Ue._f.refs.forEach(Fe=>{Fe.disabled=Ue._f.disabled||ne}))},0,!1))},De=(ne,de)=>async ge=>{let Ue;ge&&(ge.preventDefault&&ge.preventDefault(),ge.persist&&ge.persist());let Fe=to(o);if(s.disabled.size)for(const Ae of s.disabled)Pn(Fe,Ae,void 0);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:Ae,values:tt}=await M();n.errors=Ae,Fe=tt}else await B(r);if(Ur(n.errors,"root"),ro(n.errors)){f.state.next({errors:{}});try{await ne(Fe,ge)}catch(Ae){Ue=Ae}}else de&&await de({...n.errors},ge),ke(),setTimeout(ke);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ro(n.errors)&&!Ue,submitCount:n.submitCount+1,errors:n.errors}),Ue)throw Ue},me=(ne,de={})=>{Ze(r,ne)&&(Cr(de.defaultValue)?H(ne,to(Ze(i,ne))):(H(ne,de.defaultValue),Pn(i,ne,to(de.defaultValue))),de.keepTouched||Ur(n.touchedFields,ne),de.keepDirty||(Ur(n.dirtyFields,ne),n.isDirty=de.defaultValue?W(ne,to(Ze(i,ne))):W()),de.keepError||(Ur(n.errors,ne),c.isValid&&b()),f.state.next({...n}))},yt=(ne,de={})=>{const ge=ne?to(ne):i,Ue=to(ge),Fe=ro(ne),Ae=Fe?i:Ue;if(de.keepDefaultValues||(i=ge),!de.keepValues){if(de.keepDirtyValues){const tt=new Set([...s.mount,...Object.keys(Ip(i,o))]);for(const mt of Array.from(tt))Ze(n.dirtyFields,mt)?Pn(Ae,mt,Ze(o,mt)):H(mt,Ze(Ae,mt))}else{if(QO&&Cr(ne))for(const tt of s.mount){const mt=Ze(r,tt);if(mt&&mt._f){const wn=Array.isArray(mt._f.refs)?mt._f.refs[0]:mt._f.ref;if(J1(wn)){const Kt=wn.closest("form");if(Kt){Kt.reset();break}}}}r={}}o=t.shouldUnregister?de.keepDefaultValues?to(i):{}:to(Ae),f.array.next({values:{...Ae}}),f.values.next({values:{...Ae}})}s={mount:de.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!c.isValid||!!de.keepIsValid||!!de.keepDirtyValues,a.watch=!!t.shouldUnregister,f.state.next({submitCount:de.keepSubmitCount?n.submitCount:0,isDirty:Fe?!1:de.keepDirty?n.isDirty:!!(de.keepDefaultValues&&!nl(ne,i)),isSubmitted:de.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Fe?{}:de.keepDirtyValues?de.keepDefaultValues&&o?Ip(i,o):n.dirtyFields:de.keepDefaultValues&&ne?Ip(i,ne):de.keepDirty?n.dirtyFields:{},touchedFields:de.keepTouched?n.touchedFields:{},errors:de.keepErrors?n.errors:{},isSubmitSuccessful:de.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},lt=(ne,de)=>yt(ds(ne)?ne(o):ne,de);return{control:{register:it,unregister:He,getFieldState:ie,handleSubmit:De,setError:ye,_executeSchema:M,_getWatch:ee,_getDirty:W,_updateValid:b,_removeUnmounted:V,_updateFieldArray:x,_updateDisabledField:Ee,_getFieldArray:Z,_reset:yt,_resetDefaultValues:()=>ds(t.defaultValues)&&t.defaultValues().then(ne=>{lt(ne,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:ne=>{n={...n,...ne}},_disableForm:Le,_subjects:f,_proxyFormState:c,_setErrors:O,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(ne){a=ne},get _defaultValues(){return i},get _names(){return s},set _names(ne){s=ne},get _formState(){return n},set _formState(ne){n=ne},get _options(){return t},set _options(ne){t={...t,...ne}}},trigger:Y,register:it,handleSubmit:De,watch:we,setValue:H,getValues:re,reset:lt,resetField:me,clearErrors:se,unregister:He,setError:ye,setFocus:(ne,de={})=>{const ge=Ze(r,ne),Ue=ge&&ge._f;if(Ue){const Fe=Ue.refs?Ue.refs[0]:Ue.ref;Fe.focus&&(Fe.focus(),de.shouldSelect&&ds(Fe.select)&&Fe.select())}},getFieldState:ie}}function xQe(e={}){const t=F.useRef(void 0),n=F.useRef(void 0),[r,i]=F.useState({isDirty:!1,isValidating:!1,isLoading:ds(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ds(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Gle(e),formState:r});const o=t.current.control;return o._options=e,tA({subject:o._subjects.state,next:a=>{Zj(a,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),F.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),F.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),F.useEffect(()=>{e.values&&!nl(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i(a=>({...a}))):o._resetDefaultValues()},[e.values,o]),F.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),F.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),F.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=Yj(r,o),t.current}const uR=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ze(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},aB=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?uR(r.ref,n,e):r.refs&&r.refs.forEach(i=>uR(i,n,e))}},Yle=(e,t)=>{t.shouldUseNativeValidation&&aB(e,t);const n={};for(const r in e){const i=Ze(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(Zle(t.names||Object.keys(e),r)){const a=Object.assign({},Ze(n,r));Pn(a,"root",o),Pn(n,r,a)}else Pn(n,r,o)}return n},Zle=(e,t)=>e.some(n=>n.startsWith(t+"."));var Xle=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[a]={message:s.message,type:s.code}}else n[a]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(c){return c.errors.forEach(function(f){return e.push(f)})}),t){var u=n[a].types,l=u&&u[r.code];n[a]=Jj(a,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n},wQe=function(e,t,n){return n===void 0&&(n={}),function(r,i,o){try{return Promise.resolve(function(a,s){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return o.shouldUseNativeValidation&&aB({},o),{errors:{},values:n.raw?r:l}})}catch(l){return s(l)}return u&&u.then?u.then(void 0,s):u}(0,function(a){if(function(s){return Array.isArray(s?.errors)}(a))return{values:{},errors:Yle(Xle(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},gn;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(gn||(gn={}));var aE;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(aE||(aE={}));const rt=gn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nu=e=>{switch(typeof e){case"undefined":return rt.undefined;case"string":return rt.string;case"number":return isNaN(e)?rt.nan:rt.number;case"boolean":return rt.boolean;case"function":return rt.function;case"bigint":return rt.bigint;case"symbol":return rt.symbol;case"object":return Array.isArray(e)?rt.array:e===null?rt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?rt.promise:typeof Map<"u"&&e instanceof Map?rt.map:typeof Set<"u"&&e instanceof Set?rt.set:typeof Date<"u"&&e instanceof Date?rt.date:rt.object;default:return rt.unknown}},ze=gn.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"]),Qle=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class No extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,u=0;for(;un.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}No.create=e=>new No(e);const Gd=(e,t)=>{let n;switch(e.code){case ze.invalid_type:e.received===rt.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ze.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,gn.jsonStringifyReplacer)}`;break;case ze.unrecognized_keys:n=`Unrecognized key(s) in object: ${gn.joinValues(e.keys,", ")}`;break;case ze.invalid_union:n="Invalid input";break;case ze.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${gn.joinValues(e.options)}`;break;case ze.invalid_enum_value:n=`Invalid enum value. Expected ${gn.joinValues(e.options)}, received '${e.received}'`;break;case ze.invalid_arguments:n="Invalid function arguments";break;case ze.invalid_return_type:n="Invalid function return type";break;case ze.invalid_date:n="Invalid date";break;case ze.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:gn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ze.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ze.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ze.custom:n="Invalid input";break;case ze.invalid_intersection_types:n="Intersection results could not be merged";break;case ze.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ze.not_finite:n="Number must be finite";break;default:n=t.defaultError,gn.assertNever(e)}return{message:n}};let sB=Gd;function Jle(e){sB=e}function nb(){return sB}const rb=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="";const u=r.filter(l=>!!l).slice().reverse();for(const l of u)s=l(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},ece=[];function et(e,t){const n=nb(),r=rb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Gd?void 0:Gd].filter(i=>!!i)});e.common.issues.push(r)}class Ri{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return $t;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,a=await i.value;r.push({key:o,value:a})}return Ri.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return $t;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const $t=Object.freeze({status:"aborted"}),md=e=>({status:"dirty",value:e}),Vi=e=>({status:"valid",value:e}),sE=e=>e.status==="aborted",uE=e=>e.status==="dirty",Vc=e=>e.status==="valid",tg=e=>typeof Promise<"u"&&e instanceof Promise;function ib(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function uB(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var dt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(dt||(dt={}));var a0,s0;class Ps{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const lR=(e,t)=>{if(Vc(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 n=new No(e.common.issues);return this._error=n,this._error}}};function Yt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{var u,l;const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(u=c??r)!==null&&u!==void 0?u:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(l=c??n)!==null&&l!==void 0?l:s.defaultError}},description:i}}class en{get description(){return this._def.description}_getType(t){return nu(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:nu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ri,ctx:{common:t.parent.common,data:t.data,parsedType:nu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(tg(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)},o=this._parseSync({data:t,path:i.path,parent:i});return lR(i,o)}"~validate"(t){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:i});return Vc(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((r=(n=o?.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(o=>Vc(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:nu(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(tg(i)?i:Promise.resolve(i));return lR(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:ze.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Ya({schema:this,typeName:Mt.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:n=>this["~validate"](n)}}optional(){return Cs.create(this,this._def)}nullable(){return Rl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ha.create(this)}promise(){return Zd.create(this,this._def)}or(t){return og.create([this,t],this._def)}and(t){return ag.create(this,t,this._def)}transform(t){return new Ya({...Yt(this._def),schema:this,typeName:Mt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new fg({...Yt(this._def),innerType:this,defaultValue:n,typeName:Mt.ZodDefault})}brand(){return new iA({typeName:Mt.ZodBranded,type:this,...Yt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new dg({...Yt(this._def),innerType:this,catchValue:n,typeName:Mt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Cm.create(this,t)}readonly(){return hg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tce=/^c[^\s-]{8,}$/i,nce=/^[0-9a-z]+$/,rce=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ice=/^[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,oce=/^[a-z0-9_-]{21}$/i,ace=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sce=/^[-+]?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)?)??$/,uce=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lce="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kS;const cce=/^(?:(?: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])$/,fce=/^(?:(?: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])$/,dce=/^(([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]))$/,hce=/^(([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])$/,pce=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,gce=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lB="((\\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])))",mce=new RegExp(`^${lB}$`);function cB(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function vce(e){return new RegExp(`^${cB(e)}$`)}function fB(e){let t=`${lB}T${cB(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function yce(e,t){return!!((t==="v4"||!t)&&cce.test(e)||(t==="v6"||!t)&&dce.test(e))}function bce(e,t){if(!ace.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function xce(e,t){return!!((t==="v4"||!t)&&fce.test(e)||(t==="v6"||!t)&&hce.test(e))}class Ua extends en{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==rt.string){const o=this._getOrReturnCtx(t);return et(o,{code:ze.invalid_type,expected:rt.string,received:o.parsedType}),$t}const r=new Ri;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(i=this._getOrReturnCtx(t,i),et(i,{code:ze.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.lengtht.test(i),{validation:n,code:ze.invalid_string,...dt.errToObj(r)})}_addCheck(t){return new Ua({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...dt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...dt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...dt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...dt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...dt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...dt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...dt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...dt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...dt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...dt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...dt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...dt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...dt.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,local:(r=t?.local)!==null&&r!==void 0?r:!1,...dt.errToObj(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?.precision>"u"?null:t?.precision,...dt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...dt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...dt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...dt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...dt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...dt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...dt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...dt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...dt.errToObj(n)})}nonempty(t){return this.min(1,dt.errToObj(t))}trim(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ua({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ua({...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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ua({checks:[],typeName:Mt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Yt(e)})};function wce(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class kl extends en{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)!==rt.number){const o=this._getOrReturnCtx(t);return et(o,{code:ze.invalid_type,expected:rt.number,received:o.parsedType}),$t}let r;const i=new Ri;for(const o of this._def.checks)o.kind==="int"?gn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),et(r,{code:ze.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),et(r,{code:ze.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?wce(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),et(r,{code:ze.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),et(r,{code:ze.not_finite,message:o.message}),i.dirty()):gn.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,dt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,dt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,dt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,dt.toString(n))}setLimit(t,n,r,i){return new kl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:dt.toString(i)}]})}_addCheck(t){return new kl({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:dt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:dt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:dt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:dt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:dt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:dt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:dt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:dt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:dt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&gn.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew kl({checks:[],typeName:Mt.ZodNumber,coerce:e?.coerce||!1,...Yt(e)});class Tl extends en{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)!==rt.bigint)return this._getInvalidInput(t);let r;const i=new Ri;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),et(r,{code:ze.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),et(r,{code:ze.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):gn.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return et(n,{code:ze.invalid_type,expected:rt.bigint,received:n.parsedType}),$t}gte(t,n){return this.setLimit("min",t,!0,dt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,dt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,dt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,dt.toString(n))}setLimit(t,n,r,i){return new Tl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:dt.toString(i)}]})}_addCheck(t){return new Tl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:dt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:dt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:dt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:dt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:dt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Tl({checks:[],typeName:Mt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Yt(e)})};class ng extends en{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==rt.boolean){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.boolean,received:r.parsedType}),$t}return Vi(t.data)}}ng.create=e=>new ng({typeName:Mt.ZodBoolean,coerce:e?.coerce||!1,...Yt(e)});class Hc extends en{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==rt.date){const o=this._getOrReturnCtx(t);return et(o,{code:ze.invalid_type,expected:rt.date,received:o.parsedType}),$t}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return et(o,{code:ze.invalid_date}),$t}const r=new Ri;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(i=this._getOrReturnCtx(t,i),et(i,{code:ze.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):gn.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Hc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:dt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:dt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Hc({checks:[],coerce:e?.coerce||!1,typeName:Mt.ZodDate,...Yt(e)});class ob extends en{_parse(t){if(this._getType(t)!==rt.symbol){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.symbol,received:r.parsedType}),$t}return Vi(t.data)}}ob.create=e=>new ob({typeName:Mt.ZodSymbol,...Yt(e)});class rg extends en{_parse(t){if(this._getType(t)!==rt.undefined){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.undefined,received:r.parsedType}),$t}return Vi(t.data)}}rg.create=e=>new rg({typeName:Mt.ZodUndefined,...Yt(e)});class ig extends en{_parse(t){if(this._getType(t)!==rt.null){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.null,received:r.parsedType}),$t}return Vi(t.data)}}ig.create=e=>new ig({typeName:Mt.ZodNull,...Yt(e)});class Yd extends en{constructor(){super(...arguments),this._any=!0}_parse(t){return Vi(t.data)}}Yd.create=e=>new Yd({typeName:Mt.ZodAny,...Yt(e)});class Mc extends en{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vi(t.data)}}Mc.create=e=>new Mc({typeName:Mt.ZodUnknown,...Yt(e)});class yu extends en{_parse(t){const n=this._getOrReturnCtx(t);return et(n,{code:ze.invalid_type,expected:rt.never,received:n.parsedType}),$t}}yu.create=e=>new yu({typeName:Mt.ZodNever,...Yt(e)});class ab extends en{_parse(t){if(this._getType(t)!==rt.undefined){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.void,received:r.parsedType}),$t}return Vi(t.data)}}ab.create=e=>new ab({typeName:Mt.ZodVoid,...Yt(e)});class Ha extends en{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==rt.array)return et(n,{code:ze.invalid_type,expected:rt.array,received:n.parsedType}),$t;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.lengthi.maxLength.value&&(et(n,{code:ze.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new Ps(n,a,n.path,s)))).then(a=>Ri.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new Ps(n,a,n.path,s)));return Ri.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Ha({...this._def,minLength:{value:t,message:dt.toString(n)}})}max(t,n){return new Ha({...this._def,maxLength:{value:t,message:dt.toString(n)}})}length(t,n){return new Ha({...this._def,exactLength:{value:t,message:dt.toString(n)}})}nonempty(t){return this.min(1,t)}}Ha.create=(e,t)=>new Ha({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Mt.ZodArray,...Yt(t)});function td(e){if(e instanceof fr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Cs.create(td(r))}return new fr({...e._def,shape:()=>t})}else return e instanceof Ha?new Ha({...e._def,type:td(e.element)}):e instanceof Cs?Cs.create(td(e.unwrap())):e instanceof Rl?Rl.create(td(e.unwrap())):e instanceof ks?ks.create(e.items.map(t=>td(t))):e}class fr extends en{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(),n=gn.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==rt.object){const l=this._getOrReturnCtx(t);return et(l,{code:ze.invalid_type,expected:rt.object,received:l.parsedType}),$t}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof yu&&this._def.unknownKeys==="strip"))for(const l in i.data)a.includes(l)||s.push(l);const u=[];for(const l of a){const c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Ps(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof yu){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of s)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")s.length>0&&(et(i,{code:ze.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of s){const f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Ps(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of u){const f=await c.key,h=await c.value;l.push({key:f,value:h,alwaysSet:c.alwaysSet})}return l}).then(l=>Ri.mergeObjectSync(r,l)):Ri.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return dt.errToObj,new fr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const u=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=dt.errToObj(t).message)!==null&&s!==void 0?s:u}:{message:u}}}:{}})}strip(){return new fr({...this._def,unknownKeys:"strip"})}passthrough(){return new fr({...this._def,unknownKeys:"passthrough"})}extend(t){return new fr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new fr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Mt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new fr({...this._def,catchall:t})}pick(t){const n={};return gn.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new fr({...this._def,shape:()=>n})}omit(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new fr({...this._def,shape:()=>n})}deepPartial(){return td(this)}partial(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new fr({...this._def,shape:()=>n})}required(t){const n={};return gn.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Cs;)o=o._def.innerType;n[r]=o}}),new fr({...this._def,shape:()=>n})}keyof(){return dB(gn.objectKeys(this.shape))}}fr.create=(e,t)=>new fr({shape:()=>e,unknownKeys:"strip",catchall:yu.create(),typeName:Mt.ZodObject,...Yt(t)});fr.strictCreate=(e,t)=>new fr({shape:()=>e,unknownKeys:"strict",catchall:yu.create(),typeName:Mt.ZodObject,...Yt(t)});fr.lazycreate=(e,t)=>new fr({shape:e,unknownKeys:"strip",catchall:yu.create(),typeName:Mt.ZodObject,...Yt(t)});class og extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new No(s.ctx.common.issues));return et(n,{code:ze.invalid_union,unionErrors:a}),$t}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const u of r){const l={...n,common:{...n.common,issues:[]},parent:null},c=u._parseSync({data:n.data,path:n.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(u=>new No(u));return et(n,{code:ze.invalid_union,unionErrors:s}),$t}}get options(){return this._def.options}}og.create=(e,t)=>new og({options:e,typeName:Mt.ZodUnion,...Yt(t)});const Zs=e=>e instanceof ug?Zs(e.schema):e instanceof Ya?Zs(e.innerType()):e instanceof lg?[e.value]:e instanceof Ml?e.options:e instanceof cg?gn.objectValues(e.enum):e instanceof fg?Zs(e._def.innerType):e instanceof rg?[void 0]:e instanceof ig?[null]:e instanceof Cs?[void 0,...Zs(e.unwrap())]:e instanceof Rl?[null,...Zs(e.unwrap())]:e instanceof iA||e instanceof hg?Zs(e.unwrap()):e instanceof dg?Zs(e._def.innerType):[];class lw extends en{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==rt.object)return et(n,{code:ze.invalid_type,expected:rt.object,received:n.parsedType}),$t;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(et(n,{code:ze.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),$t)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=Zs(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new lw({typeName:Mt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Yt(r)})}}function lE(e,t){const n=nu(e),r=nu(t);if(e===t)return{valid:!0,data:e};if(n===rt.object&&r===rt.object){const i=gn.objectKeys(t),o=gn.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const u=lE(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(n===rt.array&&r===rt.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o{if(sE(o)||sE(a))return $t;const s=lE(o.value,a.value);return s.valid?((uE(o)||uE(a))&&n.dirty(),{status:n.value,value:s.data}):(et(r,{code:ze.invalid_intersection_types}),$t)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ag.create=(e,t,n)=>new ag({left:e,right:t,typeName:Mt.ZodIntersection,...Yt(n)});class ks extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==rt.array)return et(r,{code:ze.invalid_type,expected:rt.array,received:r.parsedType}),$t;if(r.data.lengththis._def.items.length&&(et(r,{code:ze.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const u=this._def.items[s]||this._def.rest;return u?u._parse(new Ps(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Ri.mergeArray(n,a)):Ri.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ks({...this._def,rest:t})}}ks.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ks({items:e,typeName:Mt.ZodTuple,rest:null,...Yt(t)})};class sg extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==rt.object)return et(r,{code:ze.invalid_type,expected:rt.object,received:r.parsedType}),$t;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new Ps(r,s,r.path,s)),value:a._parse(new Ps(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?Ri.mergeObjectAsync(n,i):Ri.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof en?new sg({keyType:t,valueType:n,typeName:Mt.ZodRecord,...Yt(r)}):new sg({keyType:Ua.create(),valueType:t,typeName:Mt.ZodRecord,...Yt(n)})}}class sb extends en{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==rt.map)return et(r,{code:ze.invalid_type,expected:rt.map,received:r.parsedType}),$t;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,u],l)=>({key:i._parse(new Ps(r,s,r.path,[l,"key"])),value:o._parse(new Ps(r,u,r.path,[l,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const u of a){const l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return $t;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const u of a){const l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return $t;(l.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(l.value,c.value)}return{status:n.value,value:s}}}}sb.create=(e,t,n)=>new sb({valueType:t,keyType:e,typeName:Mt.ZodMap,...Yt(n)});class qc extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==rt.set)return et(r,{code:ze.invalid_type,expected:rt.set,received:r.parsedType}),$t;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(et(r,{code:ze.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(u){const l=new Set;for(const c of u){if(c.status==="aborted")return $t;c.status==="dirty"&&n.dirty(),l.add(c.value)}return{status:n.value,value:l}}const s=[...r.data.values()].map((u,l)=>o._parse(new Ps(r,u,r.path,l)));return r.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,n){return new qc({...this._def,minSize:{value:t,message:dt.toString(n)}})}max(t,n){return new qc({...this._def,maxSize:{value:t,message:dt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}qc.create=(e,t)=>new qc({valueType:e,minSize:null,maxSize:null,typeName:Mt.ZodSet,...Yt(t)});class Pd extends en{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==rt.function)return et(n,{code:ze.invalid_type,expected:rt.function,received:n.parsedType}),$t;function r(s,u){return rb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,nb(),Gd].filter(l=>!!l),issueData:{code:ze.invalid_arguments,argumentsError:u}})}function i(s,u){return rb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,nb(),Gd].filter(l=>!!l),issueData:{code:ze.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Zd){const s=this;return Vi(async function(...u){const l=new No([]),c=await s._def.args.parseAsync(u,o).catch(p=>{throw l.addIssue(r(u,p)),l}),f=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(f,o).catch(p=>{throw l.addIssue(i(f,p)),l})})}else{const s=this;return Vi(function(...u){const l=s._def.args.safeParse(u,o);if(!l.success)throw new No([r(u,l.error)]);const c=Reflect.apply(a,this,l.data),f=s._def.returns.safeParse(c,o);if(!f.success)throw new No([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Pd({...this._def,args:ks.create(t).rest(Mc.create())})}returns(t){return new Pd({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Pd({args:t||ks.create([]).rest(Mc.create()),returns:n||Mc.create(),typeName:Mt.ZodFunction,...Yt(r)})}}class ug extends en{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ug.create=(e,t)=>new ug({getter:e,typeName:Mt.ZodLazy,...Yt(t)});class lg extends en{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return et(n,{received:n.data,code:ze.invalid_literal,expected:this._def.value}),$t}return{status:"valid",value:t.data}}get value(){return this._def.value}}lg.create=(e,t)=>new lg({value:e,typeName:Mt.ZodLiteral,...Yt(t)});function dB(e,t){return new Ml({values:e,typeName:Mt.ZodEnum,...Yt(t)})}class Ml extends en{constructor(){super(...arguments),a0.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return et(n,{expected:gn.joinValues(r),received:n.parsedType,code:ze.invalid_type}),$t}if(ib(this,a0)||uB(this,a0,new Set(this._def.values)),!ib(this,a0).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return et(n,{received:n.data,code:ze.invalid_enum_value,options:r}),$t}return Vi(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Ml.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ml.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}a0=new WeakMap;Ml.create=dB;class cg extends en{constructor(){super(...arguments),s0.set(this,void 0)}_parse(t){const n=gn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==rt.string&&r.parsedType!==rt.number){const i=gn.objectValues(n);return et(r,{expected:gn.joinValues(i),received:r.parsedType,code:ze.invalid_type}),$t}if(ib(this,s0)||uB(this,s0,new Set(gn.getValidEnumValues(this._def.values))),!ib(this,s0).has(t.data)){const i=gn.objectValues(n);return et(r,{received:r.data,code:ze.invalid_enum_value,options:i}),$t}return Vi(t.data)}get enum(){return this._def.values}}s0=new WeakMap;cg.create=(e,t)=>new cg({values:e,typeName:Mt.ZodNativeEnum,...Yt(t)});class Zd extends en{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==rt.promise&&n.common.async===!1)return et(n,{code:ze.invalid_type,expected:rt.promise,received:n.parsedType}),$t;const r=n.parsedType===rt.promise?n.data:Promise.resolve(n.data);return Vi(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Zd.create=(e,t)=>new Zd({type:e,typeName:Mt.ZodPromise,...Yt(t)});class Ya extends en{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{et(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return $t;const u=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return u.status==="aborted"?$t:u.status==="dirty"||n.value==="dirty"?md(u.value):u});{if(n.value==="aborted")return $t;const s=this._def.schema._parseSync({data:a,path:r.path,parent:r});return s.status==="aborted"?$t:s.status==="dirty"||n.value==="dirty"?md(s.value):s}}if(i.type==="refinement"){const a=s=>{const u=i.refinement(s,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?$t:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?$t:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Vc(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Vc(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);gn.assertNever(i)}}Ya.create=(e,t,n)=>new Ya({schema:e,typeName:Mt.ZodEffects,effect:t,...Yt(n)});Ya.createWithPreprocess=(e,t,n)=>new Ya({schema:t,effect:{type:"preprocess",transform:e},typeName:Mt.ZodEffects,...Yt(n)});class Cs extends en{_parse(t){return this._getType(t)===rt.undefined?Vi(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Cs.create=(e,t)=>new Cs({innerType:e,typeName:Mt.ZodOptional,...Yt(t)});class Rl extends en{_parse(t){return this._getType(t)===rt.null?Vi(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Rl.create=(e,t)=>new Rl({innerType:e,typeName:Mt.ZodNullable,...Yt(t)});class fg extends en{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===rt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}fg.create=(e,t)=>new fg({innerType:e,typeName:Mt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Yt(t)});class dg extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return tg(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new No(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new No(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}dg.create=(e,t)=>new dg({innerType:e,typeName:Mt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Yt(t)});class ub extends en{_parse(t){if(this._getType(t)!==rt.nan){const r=this._getOrReturnCtx(t);return et(r,{code:ze.invalid_type,expected:rt.nan,received:r.parsedType}),$t}return{status:"valid",value:t.data}}}ub.create=e=>new ub({typeName:Mt.ZodNaN,...Yt(e)});const _ce=Symbol("zod_brand");class iA extends en{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Cm extends en{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?$t:o.status==="dirty"?(n.dirty(),md(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?$t:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Cm({in:t,out:n,typeName:Mt.ZodPipeline})}}class hg extends en{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Vc(i)&&(i.value=Object.freeze(i.value)),i);return tg(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}hg.create=(e,t)=>new hg({innerType:e,typeName:Mt.ZodReadonly,...Yt(t)});function hB(e,t={},n){return e?Yd.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,l=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...l,fatal:u})}}):Yd.create()}const Sce={object:fr.lazycreate};var Mt;(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"})(Mt||(Mt={}));const Cce=(e,t={message:`Input not instance of ${e.name}`})=>hB(n=>n instanceof e,t),pB=Ua.create,gB=kl.create,Ece=ub.create,Oce=Tl.create,mB=ng.create,Ace=Hc.create,Pce=ob.create,kce=rg.create,Tce=ig.create,Mce=Yd.create,Rce=Mc.create,Dce=yu.create,$ce=ab.create,Ice=Ha.create,Nce=fr.create,Lce=fr.strictCreate,Fce=og.create,jce=lw.create,Bce=ag.create,Uce=ks.create,zce=sg.create,Wce=sb.create,Vce=qc.create,Hce=Pd.create,qce=ug.create,Kce=lg.create,Gce=Ml.create,Yce=cg.create,Zce=Zd.create,cR=Ya.create,Xce=Cs.create,Qce=Rl.create,Jce=Ya.createWithPreprocess,efe=Cm.create,tfe=()=>pB().optional(),nfe=()=>gB().optional(),rfe=()=>mB().optional(),ife={string:e=>Ua.create({...e,coerce:!0}),number:e=>kl.create({...e,coerce:!0}),boolean:e=>ng.create({...e,coerce:!0}),bigint:e=>Tl.create({...e,coerce:!0}),date:e=>Hc.create({...e,coerce:!0})},ofe=$t;var _Qe=Object.freeze({__proto__:null,defaultErrorMap:Gd,setErrorMap:Jle,getErrorMap:nb,makeIssue:rb,EMPTY_PATH:ece,addIssueToContext:et,ParseStatus:Ri,INVALID:$t,DIRTY:md,OK:Vi,isAborted:sE,isDirty:uE,isValid:Vc,isAsync:tg,get util(){return gn},get objectUtil(){return aE},ZodParsedType:rt,getParsedType:nu,ZodType:en,datetimeRegex:fB,ZodString:Ua,ZodNumber:kl,ZodBigInt:Tl,ZodBoolean:ng,ZodDate:Hc,ZodSymbol:ob,ZodUndefined:rg,ZodNull:ig,ZodAny:Yd,ZodUnknown:Mc,ZodNever:yu,ZodVoid:ab,ZodArray:Ha,ZodObject:fr,ZodUnion:og,ZodDiscriminatedUnion:lw,ZodIntersection:ag,ZodTuple:ks,ZodRecord:sg,ZodMap:sb,ZodSet:qc,ZodFunction:Pd,ZodLazy:ug,ZodLiteral:lg,ZodEnum:Ml,ZodNativeEnum:cg,ZodPromise:Zd,ZodEffects:Ya,ZodTransformer:Ya,ZodOptional:Cs,ZodNullable:Rl,ZodDefault:fg,ZodCatch:dg,ZodNaN:ub,BRAND:_ce,ZodBranded:iA,ZodPipeline:Cm,ZodReadonly:hg,custom:hB,Schema:en,ZodSchema:en,late:Sce,get ZodFirstPartyTypeKind(){return Mt},coerce:ife,any:Mce,array:Ice,bigint:Oce,boolean:mB,date:Ace,discriminatedUnion:jce,effect:cR,enum:Gce,function:Hce,instanceof:Cce,intersection:Bce,lazy:qce,literal:Kce,map:Wce,nan:Ece,nativeEnum:Yce,never:Dce,null:Tce,nullable:Qce,number:gB,object:Nce,oboolean:rfe,onumber:nfe,optional:Xce,ostring:tfe,pipeline:efe,preprocess:Jce,promise:Zce,record:zce,set:Vce,strictObject:Lce,string:pB,symbol:Pce,transformer:cR,tuple:Uce,undefined:kce,union:Fce,unknown:Rce,void:$ce,NEVER:ofe,ZodIssueCode:ze,quotelessJson:Qle,ZodError:No});const afe=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);Rc(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},fR={},cE=(e,t,n,r)=>{Rc(n)&&fR[n]||(Rc(n)&&(fR[n]=new Date),afe(e,t,n,r))},vB=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},fE=(e,t,n)=>{e.loadNamespaces(t,vB(e,n))},dR=(e,t,n,r)=>{if(Rc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return fE(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,vB(e,r))},sfe=(e,t,n={})=>!t.languages||!t.languages.length?(cE(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n?.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Rc=e=>typeof e=="string",ufe=e=>typeof e=="object"&&e!==null,lfe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,cfe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},ffe=e=>cfe[e],dfe=e=>e.replace(lfe,ffe);let dE={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:dfe};const hfe=(e={})=>{dE={...dE,...e}},pfe=()=>dE;let yB;const gfe=e=>{yB=e},mfe=()=>yB,SQe={type:"3rdParty",init(e){hfe(e.options.react),gfe(e)}},vfe=v.createContext();class yfe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const bfe=(e,t)=>{const n=v.useRef();return v.useEffect(()=>{n.current=e},[e,t]),n.current},bB=(e,t,n,r)=>e.getFixedT(t,n,r),xfe=(e,t,n,r)=>v.useCallback(bB(e,t,n,r),[e,t,n,r]),CQe=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=v.useContext(vfe)||{},o=n||r||mfe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new yfe),!o){cE(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const O=(C,P)=>Rc(P)?P:ufe(P)&&Rc(P.defaultValue)?P.defaultValue:Array.isArray(C)?C[C.length-1]:C,E=[O,{},!1];return E.t=O,E.i18n={},E.ready=!1,E}o.options.react?.wait&&cE(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...pfe(),...o.options.react,...t},{useSuspense:s,keyPrefix:u}=a;let l=e||i||o.options?.defaultNS;l=Rc(l)?[l]:l||["translation"],o.reportNamespaces.addUsedNamespaces?.(l);const c=(o.isInitialized||o.initializedStoreOnce)&&l.every(O=>sfe(O,o,a)),f=xfe(o,t.lng||null,a.nsMode==="fallback"?l:l[0],u),h=()=>f,p=()=>bB(o,t.lng||null,a.nsMode==="fallback"?l:l[0],u),[m,y]=v.useState(h);let b=l.join();t.lng&&(b=`${t.lng}${b}`);const w=bfe(b),x=v.useRef(!0);v.useEffect(()=>{const{bindI18n:O,bindI18nStore:E}=a;x.current=!0,!c&&!s&&(t.lng?dR(o,t.lng,l,()=>{x.current&&y(p)}):fE(o,l,()=>{x.current&&y(p)})),c&&w&&w!==b&&x.current&&y(p);const C=()=>{x.current&&y(p)};return O&&o?.on(O,C),E&&o?.store.on(E,C),()=>{x.current=!1,o&&O?.split(" ").forEach(P=>o.off(P,C)),E&&o&&E.split(" ").forEach(P=>o.store.off(P,C))}},[o,b]),v.useEffect(()=>{x.current&&c&&y(h)},[o,u,c]);const S=[m,o,c];if(S.t=m,S.i18n=o,S.ready=c,c||!c&&!s)return S;throw new Promise(O=>{t.lng?dR(o,t.lng,l,()=>O()):fE(o,l,()=>O())})};var wfe="Label",xB=v.forwardRef((e,t)=>I.jsx(gt.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));xB.displayName=wfe;var EQe=xB;function Ye(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function _fe(e,t){const n=v.createContext(t),r=o=>{const{children:a,...s}=o,u=v.useMemo(()=>s,Object.values(s));return I.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function i(o){const a=v.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Di(e,t=[]){let n=[];function r(o,a){const s=v.createContext(a),u=n.length;n=[...n,a];const l=f=>{const{scope:h,children:p,...m}=f,y=h?.[e]?.[u]||s,b=v.useMemo(()=>m,Object.values(m));return I.jsx(y.Provider,{value:b,children:p})};l.displayName=o+"Provider";function c(f,h){const p=h?.[e]?.[u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,Sfe(i,...t)]}function Sfe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function oA(e){const t=e+"CollectionProvider",[n,r]=Di(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:m,children:y}=p,b=F.useRef(null),w=F.useRef(new Map).current;return I.jsx(i,{scope:m,itemMap:w,collectionRef:b,children:y})};a.displayName=t;const s=e+"CollectionSlot",u=F.forwardRef((p,m)=>{const{scope:y,children:b}=p,w=o(s,y),x=Nt(m,w.collectionRef);return I.jsx(Pl,{ref:x,children:b})});u.displayName=s;const l=e+"CollectionItemSlot",c="data-radix-collection-item",f=F.forwardRef((p,m)=>{const{scope:y,children:b,...w}=p,x=F.useRef(null),S=Nt(m,x),O=o(l,y);return F.useEffect(()=>(O.itemMap.set(x,{ref:x,...w}),()=>void O.itemMap.delete(x))),I.jsx(Pl,{[c]:"",ref:S,children:b})});f.displayName=l;function h(p){const m=o(e+"CollectionConsumer",p);return F.useCallback(()=>{const b=m.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((O,E)=>w.indexOf(O.ref.current)-w.indexOf(E.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:u,ItemSlot:f},h,r]}var Cfe=globalThis?.document?v.useLayoutEffect:()=>{},Efe=zx.useId||(()=>{}),Ofe=0;function Lo(e){const[t,n]=v.useState(Efe());return Cfe(()=>{e||n(r=>r??String(Ofe++))},[e]),e||(t?`radix-${t}`:"")}function Vr(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function Ts({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Afe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Vr(n),u=v.useCallback(l=>{if(o){const f=typeof l=="function"?l(e):l;f!==e&&s(f)}else i(l)},[o,e,i,s]);return[a,u]}function Afe({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,i=v.useRef(r),o=Vr(t);return v.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var Pfe=v.createContext(void 0);function Em(e){const t=v.useContext(Pfe);return e||t||"ltr"}var TS="rovingFocusGroup.onEntryFocus",kfe={bubbles:!1,cancelable:!0},cw="RovingFocusGroup",[hE,wB,Tfe]=oA(cw),[Mfe,fw]=Di(cw,[Tfe]),[Rfe,Dfe]=Mfe(cw),_B=v.forwardRef((e,t)=>I.jsx(hE.Provider,{scope:e.__scopeRovingFocusGroup,children:I.jsx(hE.Slot,{scope:e.__scopeRovingFocusGroup,children:I.jsx($fe,{...e,ref:t})})}));_B.displayName=cw;var $fe=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:c=!1,...f}=e,h=v.useRef(null),p=Nt(t,h),m=Em(o),[y=null,b]=Ts({prop:a,defaultProp:s,onChange:u}),[w,x]=v.useState(!1),S=Vr(l),O=wB(n),E=v.useRef(!1),[C,P]=v.useState(0);return v.useEffect(()=>{const M=h.current;if(M)return M.addEventListener(TS,S),()=>M.removeEventListener(TS,S)},[S]),I.jsx(Rfe,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:y,onItemFocus:v.useCallback(M=>b(M),[b]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>P(M=>M+1),[]),onFocusableItemRemove:v.useCallback(()=>P(M=>M-1),[]),children:I.jsx(gt.div,{tabIndex:w||C===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:Ye(e.onMouseDown,()=>{E.current=!0}),onFocus:Ye(e.onFocus,M=>{const N=!E.current;if(M.target===M.currentTarget&&N&&!w){const B=new CustomEvent(TS,kfe);if(M.currentTarget.dispatchEvent(B),!B.defaultPrevented){const V=O().filter(G=>G.focusable),W=V.find(G=>G.active),ee=V.find(G=>G.id===y),q=[W,ee,...V].filter(Boolean).map(G=>G.ref.current);EB(q,c)}}E.current=!1}),onBlur:Ye(e.onBlur,()=>x(!1))})})}),SB="RovingFocusGroupItem",CB=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...a}=e,s=Lo(),u=o||s,l=Dfe(SB,n),c=l.currentTabStopId===u,f=wB(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=l;return v.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),I.jsx(hE.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:I.jsx(gt.span,{tabIndex:c?0:-1,"data-orientation":l.orientation,...a,ref:t,onMouseDown:Ye(e.onMouseDown,m=>{r?l.onItemFocus(u):m.preventDefault()}),onFocus:Ye(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:Ye(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){l.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=Lfe(m,l.orientation,l.dir);if(y!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let w=f().filter(x=>x.focusable).map(x=>x.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const x=w.indexOf(m.currentTarget);w=l.loop?Ffe(w,x+1):w.slice(x+1)}setTimeout(()=>EB(w))}})})})});CB.displayName=SB;var Ife={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Lfe(e,t,n){const r=Nfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ife[r]}function EB(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ffe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OB=_B,AB=CB,On=globalThis?.document?v.useLayoutEffect:()=>{};function jfe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var PB=e=>{const{present:t,children:n}=e,r=Bfe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,Ufe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};PB.displayName="Presence";function Bfe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=jfe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=sy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=sy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=sy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=sy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function sy(e){return e?.animationName||"none"}function Ufe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var aA="Tabs",[zfe,OQe]=Di(aA,[fw]),kB=fw(),[Wfe,sA]=zfe(aA),TB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:s,activationMode:u="automatic",...l}=e,c=Em(s),[f,h]=Ts({prop:r,onChange:i,defaultProp:o});return I.jsx(Wfe,{scope:n,baseId:Lo(),value:f,onValueChange:h,orientation:a,dir:c,activationMode:u,children:I.jsx(gt.div,{dir:c,"data-orientation":a,...l,ref:t})})});TB.displayName=aA;var MB="TabsList",RB=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=sA(MB,n),a=kB(n);return I.jsx(OB,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:I.jsx(gt.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});RB.displayName=MB;var DB="TabsTrigger",$B=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=sA(DB,n),s=kB(n),u=LB(a.baseId,r),l=FB(a.baseId,r),c=r===a.value;return I.jsx(AB,{asChild:!0,...s,focusable:!i,active:c,children:I.jsx(gt.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":l,"data-state":c?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Ye(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?a.onValueChange(r):f.preventDefault()}),onKeyDown:Ye(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(r)}),onFocus:Ye(e.onFocus,()=>{const f=a.activationMode!=="manual";!c&&!i&&f&&a.onValueChange(r)})})})});$B.displayName=DB;var IB="TabsContent",NB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,s=sA(IB,n),u=LB(s.baseId,r),l=FB(s.baseId,r),c=r===s.value,f=v.useRef(c);return v.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),I.jsx(PB,{present:i||c,children:({present:h})=>I.jsx(gt.div,{"data-state":c?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":u,hidden:!h,id:l,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&o})})});NB.displayName=IB;function LB(e,t){return`${e}-trigger-${t}`}function FB(e,t){return`${e}-content-${t}`}var AQe=TB,PQe=RB,kQe=$B,TQe=NB,Ih=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(){}},Kc=typeof window>"u"||"Deno"in globalThis;function oa(){}function Vfe(e,t){return typeof e=="function"?e(t):e}function pE(e){return typeof e=="number"&&e>=0&&e!==1/0}function jB(e,t){return Math.max(e+(t||0)-Date.now(),0)}function kd(e,t){return typeof e=="function"?e(t):e}function Na(e,t){return typeof e=="function"?e(t):e}function hR(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==uA(a,t.options))return!1}else if(!pg(t.queryKey,a))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function pR(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Gc(t.options.mutationKey)!==Gc(o))return!1}else if(!pg(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function uA(e,t){return(t?.queryKeyHashFn||Gc)(e)}function Gc(e){return JSON.stringify(e,(t,n)=>gE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function pg(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!pg(e[n],t[n])):!1}function BB(e,t){if(e===t)return e;const n=gR(e)&&gR(t);if(n||gE(e)&&gE(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),a=o.length,s=n?[]:{};let u=0;for(let l=0;l{setTimeout(t,e)})}function mE(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?BB(e,t):t}function qfe(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Kfe(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var lA=Symbol();function UB(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===lA?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Gfe=class extends Ih{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!Kc&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},cA=new Gfe,Yfe=class extends Ih{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!Kc&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},cb=new Yfe;function vE(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function Zfe(e){return Math.min(1e3*2**e,3e4)}function zB(e){return(e??"online")==="online"?cb.isOnline():!0}var WB=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function MS(e){return e instanceof WB}function VB(e){let t=!1,n=0,r=!1,i;const o=vE(),a=y=>{r||(h(new WB(y)),e.abort?.())},s=()=>{t=!0},u=()=>{t=!1},l=()=>cA.isFocused()&&(e.networkMode==="always"||cb.isOnline())&&e.canRun(),c=()=>zB(e.networkMode)&&e.canRun(),f=y=>{r||(r=!0,e.onSuccess?.(y),i?.(),o.resolve(y))},h=y=>{r||(r=!0,e.onError?.(y),i?.(),o.reject(y))},p=()=>new Promise(y=>{i=b=>{(r||l())&&y(b)},e.onPause?.()}).then(()=>{i=void 0,r||e.onContinue?.()}),m=()=>{if(r)return;let y;const b=n===0?e.initialPromise:void 0;try{y=b??e.fn()}catch(w){y=Promise.reject(w)}Promise.resolve(y).then(f).catch(w=>{if(r)return;const x=e.retry??(Kc?0:3),S=e.retryDelay??Zfe,O=typeof S=="function"?S(n,w):S,E=x===!0||typeof x=="number"&&nl()?void 0:p()).then(()=>{t?h(w):m()})})};return{promise:o,cancel:a,continue:()=>(i?.(),o),cancelRetry:s,continueRetry:u,canStart:c,start:()=>(c()?m():p().then(m),o)}}function Xfe(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=s=>setTimeout(s,0);const o=s=>{t?e.push(s):i(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(u=>{n(u)})})})};return{batch:s=>{let u;t++;try{u=s()}finally{t--,t||a()}return u},batchCalls:s=>(...u)=>{o(()=>{s(...u)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Wr=Xfe(),HB=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pE(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kc?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Qfe=class extends HB{#e;#t;#r;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Jfe(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=mE(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(oa).catch(oa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Na(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lA||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!jB(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(u=>u.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,r=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const s=UB(this.options,t),u={queryKey:this.queryKey,meta:this.meta};return r(u),this.#o=!1,this.options.persister?this.options.persister(s,u,this):s(u)},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};r(o),this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#i({type:"fetch",meta:o.fetchOptions?.meta});const a=s=>{MS(s)&&s.silent||this.#i({type:"error",error:s}),MS(s)||(this.#r.config.onError?.(s,this),this.#r.config.onSettled?.(this.state.data,s,this)),this.scheduleGc()};return this.#n=VB({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:s=>{if(s===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(s)}catch(u){a(u);return}this.#r.config.onSuccess?.(s,this),this.#r.config.onSettled?.(s,this.state.error,this),this.scheduleGc()},onError:a,onFail:(s,u)=>{this.#i({type:"failed",failureCount:s,error:u})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#n.start()}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...qB(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return MS(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Wr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function qB(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zB(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Jfe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ede=class extends Ih{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??uA(r,t);let o=this.get(i);return o||(o=new Qfe({cache:this,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Wr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>hR(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>hR(e,n)):t}notify(e){Wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Wr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},tde=class extends HB{#e;#t;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||KB(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){this.#r=VB({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,i)=>{this.#n({type:"failed",failureCount:r,error:i})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const t=this.state.status==="pending",n=!this.#r.canStart();try{if(!t){this.#n({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);const i=await this.options.onMutate?.(e);i!==this.state.context&&this.#n({type:"pending",context:i,variables:e,isPaused:n})}const r=await this.#r.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#n({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#n({type:"error",error:r})}}finally{this.#t.runNext(this)}}#n(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Wr.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function KB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var nde=class extends Ih{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){const r=new tde({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=uy(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=uy(e);if(this.#e.has(t)){const n=this.#e.get(t)?.filter(r=>r!==e);n&&(n.length===0?this.#e.delete(t):this.#e.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#e.get(uy(e))?.find(n=>n.state.status==="pending");return!t||t===e}runNext(e){return this.#e.get(uy(e))?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){Wr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#e.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(n=>pR(t,n))}findAll(e={}){return this.getAll().filter(t=>pR(e,t))}notify(e){Wr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Wr.batch(()=>Promise.all(e.map(t=>t.continue().catch(oa))))}};function uy(e){return e.options.scope?.id??String(e.mutationId)}function vR(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},u=0;const l=async()=>{let c=!1;const f=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},h=UB(t.options,t.fetchOptions),p=async(m,y,b)=>{if(c)return Promise.reject();if(y==null&&m.pages.length)return Promise.resolve(m);const w={queryKey:t.queryKey,pageParam:y,direction:b?"backward":"forward",meta:t.options.meta};f(w);const x=await h(w),{maxPages:S}=t.options,O=b?Kfe:qfe;return{pages:O(m.pages,x,S),pageParams:O(m.pageParams,y,S)}};if(i&&o.length){const m=i==="backward",y=m?rde:yR,b={pages:o,pageParams:a},w=y(r,b);s=await p(b,w,m)}else{const m=e??o.length;do{const y=u===0?a[0]??r.initialPageParam:yR(r,s);if(u>0&&y==null)break;s=await p(s,y),u++}while(ut.options.persister?.(l,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function yR(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function rde(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var MQe=class{#e;#t;#r;#n;#a;#o;#i;#s;constructor(e={}){this.#e=e.queryCache||new ede,this.#t=e.mutationCache||new nde,this.#r=e.defaultOptions||{},this.#n=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#i=cA.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=cb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(kd(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=Vfe(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Wr.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Wr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e,r={type:"active",...e};return Wr.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Wr.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(oa).catch(oa)}invalidateQueries(e,t={}){return Wr.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none")return Promise.resolve();const n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Wr.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(oa)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(oa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(kd(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(oa).catch(oa)}fetchInfiniteQuery(e){return e.behavior=vR(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(oa).catch(oa)}ensureInfiniteQueryData(e){return e.behavior=vR(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return cb.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(Gc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()],n={};return t.forEach(r=>{pg(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(Gc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()];let n={};return t.forEach(r=>{pg(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uA(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===lA&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},ide=class extends Ih{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#i=vE(),this.options.experimental_prefetchInRender||this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#n=void 0;#a;#o;#i;#s;#g;#d;#h;#l;#c;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),bR(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yE(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yE(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e,t){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Na(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),n._defaulted&&!lb(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&xR(this.#t,r,this.options,n)&&this.#f(),this.updateResult(t),i&&(this.#t!==r||Na(this.options.enabled,this.#t)!==Na(n.enabled,this.#t)||kd(this.options.staleTime,this.#t)!==kd(n.staleTime,this.#t))&&this.#m();const o=this.#v();i&&(this.#t!==r||Na(this.options.enabled,this.#t)!==Na(n.enabled,this.#t)||o!==this.#u)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ade(this,n)&&(this.#n=n,this.#o=this.options,this.#a=this.#t.state),n}getCurrentResult(){return this.#n}trackResult(e,t){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#f(e){this.#_();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(oa)),t}#m(){this.#x();const e=kd(this.options.staleTime,this.#t);if(Kc||this.#n.isStale||!pE(e))return;const n=jB(this.#n.dataUpdatedAt,e)+1;this.#l=setTimeout(()=>{this.#n.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#u=e,!(Kc||Na(this.options.enabled,this.#t)===!1||!pE(this.#u)||this.#u===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||cA.isFocused())&&this.#f()},this.#u))}#b(){this.#m(),this.#y(this.#v())}#x(){this.#l&&(clearTimeout(this.#l),this.#l=void 0)}#w(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#n,o=this.#a,a=this.#o,u=e!==n?e.state:this.#r,{state:l}=e;let c={...l},f=!1,h;if(t._optimisticResults){const P=this.hasListeners(),M=!P&&bR(e,t),N=P&&xR(e,n,t,r);(M||N)&&(c={...c,...qB(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:y}=c;if(t.select&&c.data!==void 0)if(i&&c.data===o?.data&&t.select===this.#g)h=this.#d;else try{this.#g=t.select,h=t.select(c.data),h=mE(i?.data,h,t),this.#d=h,this.#s=null}catch(P){this.#s=P}else h=c.data;if(t.placeholderData!==void 0&&h===void 0&&y==="pending"){let P;if(i?.isPlaceholderData&&t.placeholderData===a?.placeholderData)P=i.data;else if(P=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,t.select&&P!==void 0)try{P=t.select(P),this.#s=null}catch(M){this.#s=M}P!==void 0&&(y="success",h=mE(i?.data,P,t),f=!0)}this.#s&&(p=this.#s,h=this.#d,m=Date.now(),y="error");const b=c.fetchStatus==="fetching",w=y==="pending",x=y==="error",S=w&&b,O=h!==void 0,C={status:y,fetchStatus:c.fetchStatus,isPending:w,isSuccess:y==="success",isError:x,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:c.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:x&&!O,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&O,isStale:fA(e,t),refetch:this.refetch,promise:this.#i};if(this.options.experimental_prefetchInRender){const P=B=>{C.status==="error"?B.reject(C.error):C.data!==void 0&&B.resolve(C.data)},M=()=>{const B=this.#i=C.promise=vE();P(B)},N=this.#i;switch(N.status){case"pending":e.queryHash===n.queryHash&&P(N);break;case"fulfilled":(C.status==="error"||C.data!==N.value)&&M();break;case"rejected":(C.status!=="error"||C.error!==N.reason)&&M();break}}return C}updateResult(e){const t=this.#n,n=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#t),lb(n,t))return;this.#n=n;const r={},i=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!this.#p.size)return!0;const s=new Set(a??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#n).some(u=>{const l=u;return this.#n[l]!==t[l]&&s.has(l)})};e?.listeners!==!1&&i()&&(r.listeners=!0),this.#S({...r,...e})}#_(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){Wr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function ode(e,t){return Na(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function bR(e,t){return ode(e,t)||e.state.data!==void 0&&yE(e,t,t.refetchOnMount)}function yE(e,t,n){if(Na(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fA(e,t)}return!1}function xR(e,t,n,r){return(e!==t||Na(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&fA(e,n)}function fA(e,t){return Na(t.enabled,e)!==!1&&e.isStaleByTime(kd(t.staleTime,e))}function ade(e,t){return!lb(e.getCurrentResult(),t)}var sde=class extends Ih{#e;#t=void 0;#r;#n;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),lb(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),n?.mutationKey&&this.options.mutationKey&&Gc(n.mutationKey)!==Gc(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#a(),this.#o()}mutate(t,n){return this.#n=n,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#a(){const t=this.#r?.state??KB();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Wr.batch(()=>{if(this.#n&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context;t?.type==="success"?(this.#n.onSuccess?.(t.data,n,r),this.#n.onSettled?.(t.data,null,n,r)):t?.type==="error"&&(this.#n.onError?.(t.error,n,r),this.#n.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#t)})})}},GB=v.createContext(void 0),YB=e=>{const t=v.useContext(GB);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},DQe=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),I.jsx(GB.Provider,{value:e,children:t})),ZB=v.createContext(!1),ude=()=>v.useContext(ZB);ZB.Provider;function lde(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var cde=v.createContext(lde()),fde=()=>v.useContext(cde);function XB(e,t){return typeof e=="function"?e(...t):!!e}function bE(){}var dde=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},hde=e=>{v.useEffect(()=>{e.clearReset()},[e])},pde=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&XB(n,[e.error,r]),gde=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},mde=(e,t)=>e.isLoading&&e.isFetching&&!t,vde=(e,t)=>e?.suspense&&t.isPending,wR=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function yde(e,t,n){const r=YB(),i=ude(),o=fde(),a=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=i?"isRestoring":"optimistic",gde(a),dde(a,o),hde(o);const s=!r.getQueryCache().get(a.queryHash),[u]=v.useState(()=>new t(r,a)),l=u.getOptimisticResult(a);if(v.useSyncExternalStore(v.useCallback(c=>{const f=i?bE:u.subscribe(Wr.batchCalls(c));return u.updateResult(),f},[u,i]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),v.useEffect(()=>{u.setOptions(a,{listeners:!1})},[a,u]),vde(a,l))throw wR(a,u,o);if(pde({result:l,errorResetBoundary:o,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw l.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!Kc&&mde(l,i)&&(s?wR(a,u,o):r.getQueryCache().get(a.queryHash)?.promise)?.catch(bE).finally(()=>{u.updateResult()}),a.notifyOnChangeProps?l:u.trackResult(l)}function $Qe(e,t){return yde(e,ide)}function IQe(e,t){const n=YB(),[r]=v.useState(()=>new sde(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(a=>r.subscribe(Wr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((a,s)=>{r.mutate(a,s).catch(bE)},[r]);if(i.error&&XB(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var QB={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(La,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",u="hour",l="day",c="week",f="month",h="quarter",p="year",m="date",y="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var q=["th","st","nd","rd"],G=Z%100;return"["+Z+(q[(G-20)%10]||q[G]||q[0])+"]"}},S=function(Z,q,G){var H=String(Z);return!H||H.length>=q?Z:""+Array(q+1-H.length).join(G)+Z},O={s:S,z:function(Z){var q=-Z.utcOffset(),G=Math.abs(q),H=Math.floor(G/60),j=G%60;return(q<=0?"+":"-")+S(H,2,"0")+":"+S(j,2,"0")},m:function Z(q,G){if(q.date()1)return Z(Y[0])}else{var re=q.name;C[re]=q,j=re}return!H&&j&&(E=j),j||!H&&E},B=function(Z,q){if(M(Z))return Z.clone();var G=typeof q=="object"?q:{};return G.date=Z,G.args=arguments,new W(G)},V=O;V.l=N,V.i=M,V.w=function(Z,q){return B(Z,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var W=function(){function Z(G){this.$L=N(G.locale,null,!0),this.parse(G),this.$x=this.$x||G.x||{},this[P]=!0}var q=Z.prototype;return q.parse=function(G){this.$d=function(H){var j=H.date,K=H.utc;if(j===null)return new Date(NaN);if(V.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var Y=j.match(b);if(Y){var re=Y[2]-1||0,ie=(Y[7]||"0").substring(0,3);return K?new Date(Date.UTC(Y[1],re,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,ie)):new Date(Y[1],re,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,ie)}}return new Date(j)}(G),this.init()},q.init=function(){var G=this.$d;this.$y=G.getFullYear(),this.$M=G.getMonth(),this.$D=G.getDate(),this.$W=G.getDay(),this.$H=G.getHours(),this.$m=G.getMinutes(),this.$s=G.getSeconds(),this.$ms=G.getMilliseconds()},q.$utils=function(){return V},q.isValid=function(){return this.$d.toString()!==y},q.isSame=function(G,H){var j=B(G);return this.startOf(H)<=j&&j<=this.endOf(H)},q.isAfter=function(G,H){return B(G)t=>{const n=xde.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),es=e=>(e=e.toLowerCase(),t=>dw(t)===e),hw=e=>t=>typeof t===e,{isArray:Nh}=Array,gg=hw("undefined");function wde(e){return e!==null&&!gg(e)&&e.constructor!==null&&!gg(e.constructor)&&Fo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const eU=es("ArrayBuffer");function _de(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&eU(e.buffer),t}const Sde=hw("string"),Fo=hw("function"),tU=hw("number"),pw=e=>e!==null&&typeof e=="object",Cde=e=>e===!0||e===!1,d1=e=>{if(dw(e)!=="object")return!1;const t=dA(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ede=es("Date"),Ode=es("File"),Ade=es("Blob"),Pde=es("FileList"),kde=e=>pw(e)&&Fo(e.pipe),Tde=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Fo(e.append)&&((t=dw(e))==="formdata"||t==="object"&&Fo(e.toString)&&e.toString()==="[object FormData]"))},Mde=es("URLSearchParams"),[Rde,Dde,$de,Ide]=["ReadableStream","Request","Response","Headers"].map(es),Nde=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Om(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Nh(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Sc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,rU=e=>!gg(e)&&e!==Sc;function xE(){const{caseless:e}=rU(this)&&this||{},t={},n=(r,i)=>{const o=e&&nU(t,i)||i;d1(t[o])&&d1(r)?t[o]=xE(t[o],r):d1(r)?t[o]=xE({},r):Nh(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r(Om(t,(i,o)=>{n&&Fo(i)?e[o]=JB(i,n):e[o]=i},{allOwnKeys:r}),e),Fde=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jde=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Bde=(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!r||r(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=n!==!1&&dA(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ude=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},zde=e=>{if(!e)return null;if(Nh(e))return e;let t=e.length;if(!tU(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Wde=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&dA(Uint8Array)),Vde=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},Hde=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},qde=es("HTMLFormElement"),Kde=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),_R=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Gde=es("RegExp"),iU=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Om(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},Yde=e=>{iU(e,(t,n)=>{if(Fo(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Fo(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Zde=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Nh(e)?r(e):r(String(e).split(t)),n},Xde=()=>{},Qde=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,RS="abcdefghijklmnopqrstuvwxyz",SR="0123456789",oU={DIGIT:SR,ALPHA:RS,ALPHA_DIGIT:RS+RS.toUpperCase()+SR},Jde=(e=16,t=oU.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function ehe(e){return!!(e&&Fo(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const the=e=>{const t=new Array(10),n=(r,i)=>{if(pw(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=Nh(r)?[]:{};return Om(r,(a,s)=>{const u=n(a,i+1);!gg(u)&&(o[s]=u)}),t[i]=void 0,o}}return r};return n(e,0)},nhe=es("AsyncFunction"),rhe=e=>e&&(pw(e)||Fo(e))&&Fo(e.then)&&Fo(e.catch),aU=((e,t)=>e?setImmediate:t?((n,r)=>(Sc.addEventListener("message",({source:i,data:o})=>{i===Sc&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Sc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Fo(Sc.postMessage)),ihe=typeof queueMicrotask<"u"?queueMicrotask.bind(Sc):typeof process<"u"&&process.nextTick||aU,xe={isArray:Nh,isArrayBuffer:eU,isBuffer:wde,isFormData:Tde,isArrayBufferView:_de,isString:Sde,isNumber:tU,isBoolean:Cde,isObject:pw,isPlainObject:d1,isReadableStream:Rde,isRequest:Dde,isResponse:$de,isHeaders:Ide,isUndefined:gg,isDate:Ede,isFile:Ode,isBlob:Ade,isRegExp:Gde,isFunction:Fo,isStream:kde,isURLSearchParams:Mde,isTypedArray:Wde,isFileList:Pde,forEach:Om,merge:xE,extend:Lde,trim:Nde,stripBOM:Fde,inherits:jde,toFlatObject:Bde,kindOf:dw,kindOfTest:es,endsWith:Ude,toArray:zde,forEachEntry:Vde,matchAll:Hde,isHTMLForm:qde,hasOwnProperty:_R,hasOwnProp:_R,reduceDescriptors:iU,freezeMethods:Yde,toObjectSet:Zde,toCamelCase:Kde,noop:Xde,toFiniteNumber:Qde,findKey:nU,global:Sc,isContextDefined:rU,ALPHABET:oU,generateString:Jde,isSpecCompliantForm:ehe,toJSONObject:the,isAsyncFn:nhe,isThenable:rhe,setImmediate:aU,asap:ihe};function Gt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}xe.inherits(Gt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:xe.toJSONObject(this.config),code:this.code,status:this.status}}});const sU=Gt.prototype,uU={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{uU[e]={value:e}});Object.defineProperties(Gt,uU);Object.defineProperty(sU,"isAxiosError",{value:!0});Gt.from=(e,t,n,r,i,o)=>{const a=Object.create(sU);return xe.toFlatObject(e,a,function(u){return u!==Error.prototype},s=>s!=="isAxiosError"),Gt.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const ohe=null;function wE(e){return xe.isPlainObject(e)||xe.isArray(e)}function lU(e){return xe.endsWith(e,"[]")?e.slice(0,-2):e}function CR(e,t,n){return e?e.concat(t).map(function(i,o){return i=lU(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function ahe(e){return xe.isArray(e)&&!e.some(wE)}const she=xe.toFlatObject(xe,{},null,function(t){return/^is[A-Z]/.test(t)});function gw(e,t,n){if(!xe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=xe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!xe.isUndefined(b[y])});const r=n.metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&xe.isSpecCompliantForm(t);if(!xe.isFunction(i))throw new TypeError("visitor must be a function");function l(m){if(m===null)return"";if(xe.isDate(m))return m.toISOString();if(!u&&xe.isBlob(m))throw new Gt("Blob is not supported. Use a Buffer instead.");return xe.isArrayBuffer(m)||xe.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,y,b){let w=m;if(m&&!b&&typeof m=="object"){if(xe.endsWith(y,"{}"))y=r?y:y.slice(0,-2),m=JSON.stringify(m);else if(xe.isArray(m)&&ahe(m)||(xe.isFileList(m)||xe.endsWith(y,"[]"))&&(w=xe.toArray(m)))return y=lU(y),w.forEach(function(S,O){!(xe.isUndefined(S)||S===null)&&t.append(a===!0?CR([y],O,o):a===null?y:y+"[]",l(S))}),!1}return wE(m)?!0:(t.append(CR(b,y,o),l(m)),!1)}const f=[],h=Object.assign(she,{defaultVisitor:c,convertValue:l,isVisitable:wE});function p(m,y){if(!xe.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(m),xe.forEach(m,function(w,x){(!(xe.isUndefined(w)||w===null)&&i.call(t,w,xe.isString(x)?x.trim():x,y,h))===!0&&p(w,y?y.concat(x):[x])}),f.pop()}}if(!xe.isObject(e))throw new TypeError("data must be an object");return p(e),t}function ER(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function hA(e,t){this._pairs=[],e&&gw(e,this,t)}const cU=hA.prototype;cU.append=function(t,n){this._pairs.push([t,n])};cU.toString=function(t){const n=t?function(r){return t.call(this,r,ER)}:ER;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function uhe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fU(e,t,n){if(!t)return e;const r=n&&n.encode||uhe;xe.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=xe.isURLSearchParams(t)?t.toString():new hA(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class OR{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){xe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const dU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},lhe=typeof URLSearchParams<"u"?URLSearchParams:hA,che=typeof FormData<"u"?FormData:null,fhe=typeof Blob<"u"?Blob:null,dhe={isBrowser:!0,classes:{URLSearchParams:lhe,FormData:che,Blob:fhe},protocols:["http","https","file","blob","url","data"]},pA=typeof window<"u"&&typeof document<"u",_E=typeof navigator=="object"&&navigator||void 0,hhe=pA&&(!_E||["ReactNative","NativeScript","NS"].indexOf(_E.product)<0),phe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ghe=pA&&window.location.href||"http://localhost",mhe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pA,hasStandardBrowserEnv:hhe,hasStandardBrowserWebWorkerEnv:phe,navigator:_E,origin:ghe},Symbol.toStringTag,{value:"Module"})),ki={...mhe,...dhe};function vhe(e,t){return gw(e,new ki.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return ki.isNode&&xe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function yhe(e){return xe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function bhe(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return a=!a&&xe.isArray(i)?i.length:a,u?(xe.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!s):((!i[a]||!xe.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&xe.isArray(i[a])&&(i[a]=bhe(i[a])),!s)}if(xe.isFormData(e)&&xe.isFunction(e.entries)){const n={};return xe.forEachEntry(e,(r,i)=>{t(yhe(r),i,n,0)}),n}return null}function xhe(e,t,n){if(xe.isString(e))try{return(t||JSON.parse)(e),xe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Am={transitional:dU,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=xe.isObject(t);if(o&&xe.isHTMLForm(t)&&(t=new FormData(t)),xe.isFormData(t))return i?JSON.stringify(hU(t)):t;if(xe.isArrayBuffer(t)||xe.isBuffer(t)||xe.isStream(t)||xe.isFile(t)||xe.isBlob(t)||xe.isReadableStream(t))return t;if(xe.isArrayBufferView(t))return t.buffer;if(xe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return vhe(t,this.formSerializer).toString();if((s=xe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return gw(s?{"files[]":t}:t,u&&new u,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),xhe(t)):t}],transformResponse:[function(t){const n=this.transitional||Am.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(xe.isResponse(t)||xe.isReadableStream(t))return t;if(t&&xe.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(s){if(a)throw s.name==="SyntaxError"?Gt.from(s,Gt.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ki.classes.FormData,Blob:ki.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};xe.forEach(["delete","get","head","post","put","patch"],e=>{Am.headers[e]={}});const whe=xe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_he=e=>{const t={};let n,r,i;return e&&e.split(` `).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||t[n]&&whe[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},AR=Symbol("internals");function Lp(e){return e&&String(e).trim().toLowerCase()}function h1(e){return e===!1||e==null?e:xe.isArray(e)?e.map(h1):String(e)}function She(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Che=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function DS(e,t,n,r,i){if(xe.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!xe.isString(t)){if(xe.isString(r))return t.indexOf(r)!==-1;if(xe.isRegExp(r))return r.test(t)}}function Ehe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Ohe(e,t){const n=xe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,a){return this[r].call(this,t,i,o,a)},configurable:!0})})}class fo{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(s,u,l){const c=Lp(u);if(!c)throw new Error("header name must be a non-empty string");const f=xe.findKey(i,c);(!f||i[f]===void 0||l===!0||l===void 0&&i[f]!==!1)&&(i[f||u]=h1(s))}const a=(s,u)=>xe.forEach(s,(l,c)=>o(l,c,u));if(xe.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(xe.isString(t)&&(t=t.trim())&&!Che(t))a(_he(t),n);else if(xe.isHeaders(t))for(const[s,u]of t.entries())o(u,s,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=Lp(t),t){const r=xe.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return She(i);if(xe.isFunction(n))return n.call(this,i,r);if(xe.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Lp(t),t){const r=xe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||DS(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=Lp(a),a){const s=xe.findKey(r,a);s&&(!n||DS(r,r[s],s,n))&&(delete r[s],i=!0)}}return xe.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||DS(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return xe.forEach(this,(i,o)=>{const a=xe.findKey(r,o);if(a){n[a]=h1(i),delete n[o];return}const s=t?Ehe(o):String(o).trim();s!==o&&delete n[o],n[s]=h1(i),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return xe.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&xe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[AR]=this[AR]={accessors:{}}).accessors,i=this.prototype;function o(a){const s=Lp(a);r[s]||(Ohe(i,a),r[s]=!0)}return xe.isArray(t)?t.forEach(o):o(t),this}}fo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);xe.reduceDescriptors(fo.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});xe.freezeMethods(fo);function $S(e,t){const n=this||Am,r=t||n,i=fo.from(r.headers);let o=r.data;return xe.forEach(e,function(s){o=s.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function pU(e){return!!(e&&e.__CANCEL__)}function Lh(e,t,n){Gt.call(this,e??"canceled",Gt.ERR_CANCELED,t,n),this.name="CanceledError"}xe.inherits(Lh,Gt,{__CANCEL__:!0});function gU(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Gt("Request failed with status code "+n.status,[Gt.ERR_BAD_REQUEST,Gt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Ahe(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Phe(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(u){const l=Date.now(),c=r[o];a||(a=l),n[i]=u,r[i]=l;let f=o,h=0;for(;f!==i;)h+=n[f++],f=f%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),l-a{n=c,i=null,o&&(clearTimeout(o),o=null),e.apply(null,l)};return[(...l)=>{const c=Date.now(),f=c-n;f>=r?a(l,c):(i=l,o||(o=setTimeout(()=>{o=null,a(i)},r-f)))},()=>i&&a(i)]}const fb=(e,t,n=3)=>{let r=0;const i=Phe(50,250);return khe(o=>{const a=o.loaded,s=o.lengthComputable?o.total:void 0,u=a-r,l=i(u),c=a<=s;r=a;const f={loaded:a,total:s,progress:s?a/s:void 0,bytes:u,rate:l||void 0,estimated:l&&s&&c?(s-a)/l:void 0,event:o,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(f)},n)},PR=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},kR=e=>(...t)=>xe.asap(()=>e(...t)),The=ki.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ki.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ki.origin),ki.navigator&&/(msie|trident)/i.test(ki.navigator.userAgent)):()=>!0,Mhe=ki.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const a=[e+"="+encodeURIComponent(t)];xe.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),xe.isString(r)&&a.push("path="+r),xe.isString(i)&&a.push("domain="+i),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Rhe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Dhe(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function mU(e,t){return e&&!Rhe(t)?Dhe(e,t):t}const TR=e=>e instanceof fo?{...e}:e;function Yc(e,t){t=t||{};const n={};function r(l,c,f,h){return xe.isPlainObject(l)&&xe.isPlainObject(c)?xe.merge.call({caseless:h},l,c):xe.isPlainObject(c)?xe.merge({},c):xe.isArray(c)?c.slice():c}function i(l,c,f,h){if(xe.isUndefined(c)){if(!xe.isUndefined(l))return r(void 0,l,f,h)}else return r(l,c,f,h)}function o(l,c){if(!xe.isUndefined(c))return r(void 0,c)}function a(l,c){if(xe.isUndefined(c)){if(!xe.isUndefined(l))return r(void 0,l)}else return r(void 0,c)}function s(l,c,f){if(f in t)return r(l,c);if(f in e)return r(void 0,l)}const u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(l,c,f)=>i(TR(l),TR(c),f,!0)};return xe.forEach(Object.keys(Object.assign({},e,t)),function(c){const f=u[c]||i,h=f(e[c],t[c],c);xe.isUndefined(h)&&f!==s||(n[c]=h)}),n}const vU=e=>{const t=Yc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:s}=t;t.headers=a=fo.from(a),t.url=fU(mU(t.baseURL,t.url),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let u;if(xe.isFormData(n)){if(ki.hasStandardBrowserEnv||ki.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[l,...c]=u?u.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([l||"multipart/form-data",...c].join("; "))}}if(ki.hasStandardBrowserEnv&&(r&&xe.isFunction(r)&&(r=r(t)),r||r!==!1&&The(t.url))){const l=i&&o&&Mhe.read(o);l&&a.set(i,l)}return t},$he=typeof XMLHttpRequest<"u",Ihe=$he&&function(e){return new Promise(function(n,r){const i=vU(e);let o=i.data;const a=fo.from(i.headers).normalize();let{responseType:s,onUploadProgress:u,onDownloadProgress:l}=i,c,f,h,p,m;function y(){p&&p(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let b=new XMLHttpRequest;b.open(i.method.toUpperCase(),i.url,!0),b.timeout=i.timeout;function w(){if(!b)return;const S=fo.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),E={data:!s||s==="text"||s==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:S,config:e,request:b};gU(function(P){n(P),y()},function(P){r(P),y()},E),b=null}"onloadend"in b?b.onloadend=w:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(w)},b.onabort=function(){b&&(r(new Gt("Request aborted",Gt.ECONNABORTED,e,b)),b=null)},b.onerror=function(){r(new Gt("Network Error",Gt.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let O=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const E=i.transitional||dU;i.timeoutErrorMessage&&(O=i.timeoutErrorMessage),r(new Gt(O,E.clarifyTimeoutError?Gt.ETIMEDOUT:Gt.ECONNABORTED,e,b)),b=null},o===void 0&&a.setContentType(null),"setRequestHeader"in b&&xe.forEach(a.toJSON(),function(O,E){b.setRequestHeader(E,O)}),xe.isUndefined(i.withCredentials)||(b.withCredentials=!!i.withCredentials),s&&s!=="json"&&(b.responseType=i.responseType),l&&([h,m]=fb(l,!0),b.addEventListener("progress",h)),u&&b.upload&&([f,p]=fb(u),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(c=S=>{b&&(r(!S||S.type?new Lh(null,e,b):S),b.abort(),b=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const x=Ahe(i.url);if(x&&ki.protocols.indexOf(x)===-1){r(new Gt("Unsupported protocol "+x+":",Gt.ERR_BAD_REQUEST,e));return}b.send(o||null)})},Nhe=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(l){if(!i){i=!0,s();const c=l instanceof Error?l:this.reason;r.abort(c instanceof Gt?c:new Lh(c instanceof Error?c.message:c))}};let a=t&&setTimeout(()=>{a=null,o(new Gt(`timeout ${t} of ms exceeded`,Gt.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:u}=r;return u.unsubscribe=()=>xe.asap(s),u}},Lhe=function*(e,t){let n=e.byteLength;if(n{const i=Fhe(e,t);let o=0,a,s=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:l,value:c}=await i.next();if(l){s(),u.close();return}let f=c.byteLength;if(n){let h=o+=f;n(h)}u.enqueue(new Uint8Array(c))}catch(l){throw s(l),l}},cancel(u){return s(u),i.return()}},{highWaterMark:2})},mw=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",yU=mw&&typeof ReadableStream=="function",Bhe=mw&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),bU=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Uhe=yU&&bU(()=>{let e=!1;const t=new Request(ki.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),RR=64*1024,SE=yU&&bU(()=>xe.isReadableStream(new Response("").body)),db={stream:SE&&(e=>e.body)};mw&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!db[t]&&(db[t]=xe.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Gt(`Response type '${t}' is not supported`,Gt.ERR_NOT_SUPPORT,r)})})})(new Response);const zhe=async e=>{if(e==null)return 0;if(xe.isBlob(e))return e.size;if(xe.isSpecCompliantForm(e))return(await new Request(ki.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(xe.isArrayBufferView(e)||xe.isArrayBuffer(e))return e.byteLength;if(xe.isURLSearchParams(e)&&(e=e+""),xe.isString(e))return(await Bhe(e)).byteLength},Whe=async(e,t)=>{const n=xe.toFiniteNumber(e.getContentLength());return n??zhe(t)},Vhe=mw&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:a,onDownloadProgress:s,onUploadProgress:u,responseType:l,headers:c,withCredentials:f="same-origin",fetchOptions:h}=vU(e);l=l?(l+"").toLowerCase():"text";let p=Nhe([i,o&&o.toAbortSignal()],a),m;const y=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let b;try{if(u&&Uhe&&n!=="get"&&n!=="head"&&(b=await Whe(c,r))!==0){let E=new Request(t,{method:"POST",body:r,duplex:"half"}),C;if(xe.isFormData(r)&&(C=E.headers.get("content-type"))&&c.setContentType(C),E.body){const[P,M]=PR(b,fb(kR(u)));r=MR(E.body,RR,P,M)}}xe.isString(f)||(f=f?"include":"omit");const w="credentials"in Request.prototype;m=new Request(t,{...h,signal:p,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:w?f:void 0});let x=await fetch(m);const S=SE&&(l==="stream"||l==="response");if(SE&&(s||S&&y)){const E={};["status","statusText","headers"].forEach(N=>{E[N]=x[N]});const C=xe.toFiniteNumber(x.headers.get("content-length")),[P,M]=s&&PR(C,fb(kR(s),!0))||[];x=new Response(MR(x.body,RR,P,()=>{M&&M(),y&&y()}),E)}l=l||"text";let O=await db[xe.findKey(db,l)||"text"](x,e);return!S&&y&&y(),await new Promise((E,C)=>{gU(E,C,{data:O,headers:fo.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:m})})}catch(w){throw y&&y(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new Gt("Network Error",Gt.ERR_NETWORK,e,m),{cause:w.cause||w}):Gt.from(w,w&&w.code,e,m)}}),CE={http:ohe,xhr:Ihe,fetch:Vhe};xe.forEach(CE,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const DR=e=>`- ${e}`,Hhe=e=>xe.isFunction(e)||e===null||e===!1,xU={getAdapter:e=>{e=xe.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o`adapter ${s} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since : `+o.map(DR).join(` @@ -179,252 +179,257 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mt=(e,t)=>{const n=v.forwardRef(({className:r,...i},o)=>v.createElement(Tbe,{ref:o,iconNode:t,className:UW(`lucide-${Pbe(e)}`,r),...i}));return n.displayName=`${e}`,n};/** + */const Tt=(e,t)=>{const n=v.forwardRef(({className:r,...i},o)=>v.createElement(Tbe,{ref:o,iconNode:t,className:UW(`lucide-${Pbe(e)}`,r),...i}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NJe=Mt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + */const NJe=Tt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LJe=Mt("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/** + */const LJe=Tt("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FJe=Mt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + */const FJe=Tt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jJe=Mt("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** + */const jJe=Tt("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BJe=Mt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const BJe=Tt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UJe=Mt("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + */const UJe=Tt("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zJe=Mt("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** + */const zJe=Tt("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const WJe=Mt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + */const WJe=Tt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const VJe=Mt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const VJe=Tt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const HJe=Mt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const HJe=Tt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qJe=Mt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const qJe=Tt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const KJe=Mt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const KJe=Tt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const GJe=Mt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + */const GJe=Tt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YJe=Mt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const YJe=Tt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZJe=Mt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const ZJe=Tt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const XJe=Mt("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/** + */const XJe=Tt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const QJe=Mt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + */const QJe=Tt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JJe=Mt("ClipboardCopy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]);/** + */const JJe=Tt("ClipboardCopy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eet=Mt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const eet=Tt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tet=Mt("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"}]]);/** + */const tet=Tt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const net=Mt("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"}]]);/** + */const net=Tt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ret=Mt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + */const ret=Tt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iet=Mt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + */const iet=Tt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oet=Mt("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const oet=Tt("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aet=Mt("FileText",[["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 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + */const aet=Tt("FileText",[["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 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const set=Mt("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const set=Tt("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uet=Mt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + */const uet=Tt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cet=Mt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + */const cet=Tt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fet=Mt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const fet=Tt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const det=Mt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const det=Tt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const het=Mt("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4c0-1.1.9-2 2-2h8a2 2 0 0 1 2 2z",key:"jj09z8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** + */const het=Tt("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4c0-1.1.9-2 2-2h8a2 2 0 0 1 2 2z",key:"jj09z8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pet=Mt("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** + */const pet=Tt("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const get=Mt("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** + */const get=Tt("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const met=Mt("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"}]]);/** + */const met=Tt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vet=Mt("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/** + */const vet=Tt("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yet=Mt("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** + */const yet=Tt("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bet=Mt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const bet=Tt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xet=Mt("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/** + */const xet=Tt("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wet=Mt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const wet=Tt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _et=Mt("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"}]]);/** + */const _et=Tt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cet=Mt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const Cet=Tt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Eet=Mt("ShieldBan",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m4.243 5.21 14.39 12.472",key:"1c9a7c"}]]);/** + */const Eet=Tt("ShieldBan",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m4.243 5.21 14.39 12.472",key:"1c9a7c"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Oet=Mt("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** + */const Oet=Tt("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Aet=Mt("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"}]]);/** + */const Aet=Tt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pet=Mt("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + */const Pet=Tt("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ket=Mt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const ket=Tt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tet=Mt("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"}]]);/** + */const Tet=Tt("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.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Met=Mt("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"}]]);/** + */const Met=Tt("UserCheck",[["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"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** * @license lucide-react v0.399.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ret=Mt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var BD=1,Mbe=.9,Rbe=.8,Dbe=.17,XS=.1,QS=.999,$be=.9999,Ibe=.99,Nbe=/[\\\/_+.#"@\[\(\{&]/,Lbe=/[\\\/_+.#"@\[\(\{&]/g,Fbe=/[\s-]/,zW=/[\s-]/g;function WE(e,t,n,r,i,o,a){if(o===t.length)return i===e.length?BD:Ibe;var s=`${i},${o}`;if(a[s]!==void 0)return a[s];for(var u=r.charAt(o),l=n.indexOf(u,i),c=0,f,h,p,m;l>=0;)f=WE(e,t,n,r,l+1,o+1,a),f>c&&(l===i?f*=BD:Nbe.test(e.charAt(l-1))?(f*=Rbe,p=e.slice(i,l-1).match(Lbe),p&&i>0&&(f*=Math.pow(QS,p.length))):Fbe.test(e.charAt(l-1))?(f*=Mbe,m=e.slice(i,l-1).match(zW),m&&i>0&&(f*=Math.pow(QS,m.length))):(f*=Dbe,i>0&&(f*=Math.pow(QS,l-i))),e.charAt(l)!==t.charAt(o)&&(f*=$be)),(ff&&(f=h*XS)),f>c&&(c=f),l=n.indexOf(u,l+1);return a[s]=c,c}function UD(e){return e.toLowerCase().replace(zW," ")}function jbe(e,t){return WE(e,t,UD(e),UD(t),0,0,{})}function Hi(){return Hi=Object.assign?Object.assign.bind():function(e){for(var t=1;te.forEach(n=>Bbe(n,t))}function Fm(...e){return v.useCallback(WW(...e),e)}function Ube(e,t=[]){let n=[];function r(o,a){const s=v.createContext(a),u=n.length;n=[...n,a];function l(f){const{scope:h,children:p,...m}=f,y=h?.[e][u]||s,b=v.useMemo(()=>m,Object.values(m));return v.createElement(y.Provider,{value:b},p)}function c(f,h){const p=h?.[e][u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return l.displayName=o+"Provider",[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,zbe(i,...t)]}function zbe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}const Wbe=globalThis?.document?v.useLayoutEffect:()=>{},Vbe=zx.useId||(()=>{});let Hbe=0;function JS(e){const[t,n]=v.useState(Vbe());return Wbe(()=>{e||n(r=>r??String(Hbe++))},[e]),e||(t?`radix-${t}`:"")}function VW(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function qbe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Kbe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=VW(n),u=v.useCallback(l=>{if(o){const f=typeof l=="function"?l(e):l;f!==e&&s(f)}else i(l)},[o,e,i,s]);return[a,u]}function Kbe({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,i=v.useRef(r),o=VW(t);return v.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const ZA=v.forwardRef((e,t)=>{const{children:n,...r}=e,i=v.Children.toArray(n),o=i.find(Ybe);if(o){const a=o.props.children,s=i.map(u=>u===o?v.Children.count(a)>1?v.Children.only(null):v.isValidElement(a)?a.props.children:null:u);return v.createElement(VE,Hi({},r,{ref:t}),v.isValidElement(a)?v.cloneElement(a,void 0,s):null)}return v.createElement(VE,Hi({},r,{ref:t}),n)});ZA.displayName="Slot";const VE=v.forwardRef((e,t)=>{const{children:n,...r}=e;return v.isValidElement(n)?v.cloneElement(n,{...Zbe(r,n.props),ref:WW(t,n.ref)}):v.Children.count(n)>1?v.Children.only(null):null});VE.displayName="SlotClone";const Gbe=({children:e})=>v.createElement(v.Fragment,null,e);function Ybe(e){return v.isValidElement(e)&&e.type===Gbe}function Zbe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?n[r]=(...s)=>{o?.(...s),i?.(...s)}:r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const Xbe=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],Lw=Xbe.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?ZA:t;return v.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),v.createElement(s,Hi({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Qbe(e,t){e&&Au.flushSync(()=>e.dispatchEvent(t))}function XA(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Jbe(e){const t=XA(e);v.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const HE="dismissableLayer.update",exe="dismissableLayer.pointerDownOutside",txe="dismissableLayer.focusOutside";let zD;const nxe=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rxe=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...u}=e,l=v.useContext(nxe),[c,f]=v.useState(null),[,h]=v.useState({}),p=Fm(t,C=>f(C)),m=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(y),w=c?m.indexOf(c):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,O=ixe(C=>{const P=C.target,M=[...l.branches].some(N=>N.contains(P));!S||M||(i?.(C),a?.(C),C.defaultPrevented||s?.())}),E=oxe(C=>{const P=C.target;[...l.branches].some(N=>N.contains(P))||(o?.(C),a?.(C),C.defaultPrevented||s?.())});return Jbe(C=>{w===l.layers.size-1&&(r?.(C),!C.defaultPrevented&&s&&(C.preventDefault(),s()))}),v.useEffect(()=>{if(c)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(zD=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),WD(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=zD)}},[c,n,l]),v.useEffect(()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),WD())},[c,l]),v.useEffect(()=>{const C=()=>h({});return document.addEventListener(HE,C),()=>document.removeEventListener(HE,C)},[]),v.createElement(Lw.div,Hi({},u,{ref:p,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:Rd(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Rd(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Rd(e.onPointerDownCapture,O.onPointerDownCapture)}))});function ixe(e){const t=XA(e),n=v.useRef(!1),r=v.useRef(()=>{});return v.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let u=function(){HW(exe,t,s,{discrete:!0})};const s={originalEvent:a};a.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=u,document.addEventListener("click",r.current,{once:!0})):u()}n.current=!1},o=window.setTimeout(()=>{document.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),document.removeEventListener("pointerdown",i),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function oxe(e){const t=XA(e),n=v.useRef(!1);return v.useEffect(()=>{const r=i=>{i.target&&!n.current&&HW(txe,t,{originalEvent:i},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function WD(){const e=new CustomEvent(HE);document.dispatchEvent(e)}function HW(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Qbe(i,o):i.dispatchEvent(o)}function VD(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const e3="focusScope.autoFocusOnMount",t3="focusScope.autoFocusOnUnmount",HD={bubbles:!1,cancelable:!0},axe=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,u]=v.useState(null),l=VD(i),c=VD(o),f=v.useRef(null),h=Fm(t,y=>u(y)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let y=function(w){if(p.paused||!s)return;const x=w.target;s.contains(x)?f.current=x:fc(f.current,{select:!0})},b=function(w){p.paused||!s||s.contains(w.relatedTarget)||fc(f.current,{select:!0})};return document.addEventListener("focusin",y),document.addEventListener("focusout",b),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b)}}},[r,s,p.paused]),v.useEffect(()=>{if(s){KD.add(p);const y=document.activeElement;if(!s.contains(y)){const w=new CustomEvent(e3,HD);s.addEventListener(e3,l),s.dispatchEvent(w),w.defaultPrevented||(sxe(dxe(qW(s)),{select:!0}),document.activeElement===y&&fc(s))}return()=>{s.removeEventListener(e3,l),setTimeout(()=>{const w=new CustomEvent(t3,HD);s.addEventListener(t3,c),s.dispatchEvent(w),w.defaultPrevented||fc(y??document.body,{select:!0}),s.removeEventListener(t3,c),KD.remove(p)},0)}}},[s,l,c,p]);const m=v.useCallback(y=>{if(!n&&!r||p.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(b&&w){const x=y.currentTarget,[S,O]=uxe(x);S&&O?!y.shiftKey&&w===O?(y.preventDefault(),n&&fc(S,{select:!0})):y.shiftKey&&w===S&&(y.preventDefault(),n&&fc(O,{select:!0})):w===x&&y.preventDefault()}},[n,r,p.paused]);return v.createElement(Lw.div,Hi({tabIndex:-1},a,{ref:h,onKeyDown:m}))});function sxe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fc(r,{select:t}),document.activeElement!==n)return}function uxe(e){const t=qW(e),n=qD(t,e),r=qD(t.reverse(),e);return[n,r]}function qW(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qD(e,t){for(const n of e)if(!lxe(n,{upTo:t}))return n}function lxe(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 cxe(e){return e instanceof HTMLInputElement&&"select"in e}function fc(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cxe(e)&&t&&e.select()}}const KD=fxe();function fxe(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=GD(e,t),e.unshift(t)},remove(t){var n;e=GD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function GD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dxe(e){return e.filter(t=>t.tagName!=="A")}const hxe=v.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?iw.createPortal(v.createElement(Lw.div,Hi({},i,{ref:t})),r):null}),YD=globalThis?.document?v.useLayoutEffect:()=>{};function pxe(e,t){return v.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Fw=e=>{const{present:t,children:n}=e,r=gxe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Fm(r.ref,i.ref);return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};Fw.displayName="Presence";function gxe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=pxe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Cy(r.current);o.current=s==="mounted"?l:"none"},[s]),YD(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Cy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),YD(()=>{if(t){const l=f=>{const p=Cy(r.current).includes(f.animationName);f.target===t&&p&&Au.flushSync(()=>u("ANIMATION_END"))},c=f=>{f.target===t&&(o.current=Cy(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Cy(e){return e?.animationName||"none"}let n3=0;function mxe(){v.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:ZD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:ZD()),n3++,()=>{n3===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),n3--}},[])}function ZD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var y1="right-scroll-bar-position",b1="width-before-scroll-bar",vxe="with-scroll-bars-hidden",yxe="--removed-body-scroll-bar-size";function r3(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function bxe(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var xxe=typeof window<"u"?v.useLayoutEffect:v.useEffect,XD=new WeakMap;function wxe(e,t){var n=bxe(null,function(r){return e.forEach(function(i){return r3(i,r)})});return xxe(function(){var r=XD.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||r3(s,null)}),o.forEach(function(s){i.has(s)||r3(s,a)})}XD.set(n,e)},[e]),n}var KW=QU(),i3=function(){},jw=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:i3,onWheelCapture:i3,onTouchMoveCapture:i3}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,c=e.enabled,f=e.shards,h=e.sideCar,p=e.noIsolation,m=e.inert,y=e.allowPinchZoom,b=e.as,w=b===void 0?"div":b,x=bA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=h,O=wxe([n,t]),E=Ti(Ti({},x),i);return v.createElement(v.Fragment,null,c&&v.createElement(S,{sideCar:KW,removeScrollBar:l,shards:f,noIsolation:p,inert:m,setCallbacks:o,allowPinchZoom:!!y,lockRef:n}),a?v.cloneElement(v.Children.only(s),Ti(Ti({},E),{ref:O})):v.createElement(w,Ti({},E,{className:u,ref:O}),s))});jw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};jw.classNames={fullWidth:b1,zeroRight:y1};var _xe={left:0,top:0,right:0,gap:0},o3=function(e){return parseInt(e||"",10)||0},Sxe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[o3(n),o3(r),o3(i)]},Cxe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return _xe;var t=Sxe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Exe=xA(),Dd="data-scroll-locked",Oxe=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` + */const Ret=Tt("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.399.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Det=Tt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var BD=1,Mbe=.9,Rbe=.8,Dbe=.17,XS=.1,QS=.999,$be=.9999,Ibe=.99,Nbe=/[\\\/_+.#"@\[\(\{&]/,Lbe=/[\\\/_+.#"@\[\(\{&]/g,Fbe=/[\s-]/,zW=/[\s-]/g;function WE(e,t,n,r,i,o,a){if(o===t.length)return i===e.length?BD:Ibe;var s=`${i},${o}`;if(a[s]!==void 0)return a[s];for(var u=r.charAt(o),l=n.indexOf(u,i),c=0,f,h,p,m;l>=0;)f=WE(e,t,n,r,l+1,o+1,a),f>c&&(l===i?f*=BD:Nbe.test(e.charAt(l-1))?(f*=Rbe,p=e.slice(i,l-1).match(Lbe),p&&i>0&&(f*=Math.pow(QS,p.length))):Fbe.test(e.charAt(l-1))?(f*=Mbe,m=e.slice(i,l-1).match(zW),m&&i>0&&(f*=Math.pow(QS,m.length))):(f*=Dbe,i>0&&(f*=Math.pow(QS,l-i))),e.charAt(l)!==t.charAt(o)&&(f*=$be)),(ff&&(f=h*XS)),f>c&&(c=f),l=n.indexOf(u,l+1);return a[s]=c,c}function UD(e){return e.toLowerCase().replace(zW," ")}function jbe(e,t){return WE(e,t,UD(e),UD(t),0,0,{})}function Hi(){return Hi=Object.assign?Object.assign.bind():function(e){for(var t=1;te.forEach(n=>Bbe(n,t))}function Fm(...e){return v.useCallback(WW(...e),e)}function Ube(e,t=[]){let n=[];function r(o,a){const s=v.createContext(a),u=n.length;n=[...n,a];function l(f){const{scope:h,children:p,...m}=f,y=h?.[e][u]||s,b=v.useMemo(()=>m,Object.values(m));return v.createElement(y.Provider,{value:b},p)}function c(f,h){const p=h?.[e][u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return l.displayName=o+"Provider",[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,zbe(i,...t)]}function zbe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}const Wbe=globalThis?.document?v.useLayoutEffect:()=>{},Vbe=zx.useId||(()=>{});let Hbe=0;function JS(e){const[t,n]=v.useState(Vbe());return Wbe(()=>{e||n(r=>r??String(Hbe++))},[e]),e||(t?`radix-${t}`:"")}function VW(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function qbe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Kbe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=VW(n),u=v.useCallback(l=>{if(o){const f=typeof l=="function"?l(e):l;f!==e&&s(f)}else i(l)},[o,e,i,s]);return[a,u]}function Kbe({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,i=v.useRef(r),o=VW(t);return v.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const ZA=v.forwardRef((e,t)=>{const{children:n,...r}=e,i=v.Children.toArray(n),o=i.find(Ybe);if(o){const a=o.props.children,s=i.map(u=>u===o?v.Children.count(a)>1?v.Children.only(null):v.isValidElement(a)?a.props.children:null:u);return v.createElement(VE,Hi({},r,{ref:t}),v.isValidElement(a)?v.cloneElement(a,void 0,s):null)}return v.createElement(VE,Hi({},r,{ref:t}),n)});ZA.displayName="Slot";const VE=v.forwardRef((e,t)=>{const{children:n,...r}=e;return v.isValidElement(n)?v.cloneElement(n,{...Zbe(r,n.props),ref:WW(t,n.ref)}):v.Children.count(n)>1?v.Children.only(null):null});VE.displayName="SlotClone";const Gbe=({children:e})=>v.createElement(v.Fragment,null,e);function Ybe(e){return v.isValidElement(e)&&e.type===Gbe}function Zbe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?n[r]=(...s)=>{o?.(...s),i?.(...s)}:r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const Xbe=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],Lw=Xbe.reduce((e,t)=>{const n=v.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?ZA:t;return v.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),v.createElement(s,Hi({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Qbe(e,t){e&&Au.flushSync(()=>e.dispatchEvent(t))}function XA(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Jbe(e){const t=XA(e);v.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const HE="dismissableLayer.update",exe="dismissableLayer.pointerDownOutside",txe="dismissableLayer.focusOutside";let zD;const nxe=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rxe=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...u}=e,l=v.useContext(nxe),[c,f]=v.useState(null),[,h]=v.useState({}),p=Fm(t,C=>f(C)),m=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(y),w=c?m.indexOf(c):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,O=ixe(C=>{const P=C.target,M=[...l.branches].some(N=>N.contains(P));!S||M||(i?.(C),a?.(C),C.defaultPrevented||s?.())}),E=oxe(C=>{const P=C.target;[...l.branches].some(N=>N.contains(P))||(o?.(C),a?.(C),C.defaultPrevented||s?.())});return Jbe(C=>{w===l.layers.size-1&&(r?.(C),!C.defaultPrevented&&s&&(C.preventDefault(),s()))}),v.useEffect(()=>{if(c)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(zD=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),WD(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=zD)}},[c,n,l]),v.useEffect(()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),WD())},[c,l]),v.useEffect(()=>{const C=()=>h({});return document.addEventListener(HE,C),()=>document.removeEventListener(HE,C)},[]),v.createElement(Lw.div,Hi({},u,{ref:p,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:Rd(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Rd(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Rd(e.onPointerDownCapture,O.onPointerDownCapture)}))});function ixe(e){const t=XA(e),n=v.useRef(!1),r=v.useRef(()=>{});return v.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let u=function(){HW(exe,t,s,{discrete:!0})};const s={originalEvent:a};a.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=u,document.addEventListener("click",r.current,{once:!0})):u()}n.current=!1},o=window.setTimeout(()=>{document.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),document.removeEventListener("pointerdown",i),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function oxe(e){const t=XA(e),n=v.useRef(!1);return v.useEffect(()=>{const r=i=>{i.target&&!n.current&&HW(txe,t,{originalEvent:i},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function WD(){const e=new CustomEvent(HE);document.dispatchEvent(e)}function HW(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Qbe(i,o):i.dispatchEvent(o)}function VD(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const e3="focusScope.autoFocusOnMount",t3="focusScope.autoFocusOnUnmount",HD={bubbles:!1,cancelable:!0},axe=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,u]=v.useState(null),l=VD(i),c=VD(o),f=v.useRef(null),h=Fm(t,y=>u(y)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let y=function(w){if(p.paused||!s)return;const x=w.target;s.contains(x)?f.current=x:fc(f.current,{select:!0})},b=function(w){p.paused||!s||s.contains(w.relatedTarget)||fc(f.current,{select:!0})};return document.addEventListener("focusin",y),document.addEventListener("focusout",b),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b)}}},[r,s,p.paused]),v.useEffect(()=>{if(s){KD.add(p);const y=document.activeElement;if(!s.contains(y)){const w=new CustomEvent(e3,HD);s.addEventListener(e3,l),s.dispatchEvent(w),w.defaultPrevented||(sxe(dxe(qW(s)),{select:!0}),document.activeElement===y&&fc(s))}return()=>{s.removeEventListener(e3,l),setTimeout(()=>{const w=new CustomEvent(t3,HD);s.addEventListener(t3,c),s.dispatchEvent(w),w.defaultPrevented||fc(y??document.body,{select:!0}),s.removeEventListener(t3,c),KD.remove(p)},0)}}},[s,l,c,p]);const m=v.useCallback(y=>{if(!n&&!r||p.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(b&&w){const x=y.currentTarget,[S,O]=uxe(x);S&&O?!y.shiftKey&&w===O?(y.preventDefault(),n&&fc(S,{select:!0})):y.shiftKey&&w===S&&(y.preventDefault(),n&&fc(O,{select:!0})):w===x&&y.preventDefault()}},[n,r,p.paused]);return v.createElement(Lw.div,Hi({tabIndex:-1},a,{ref:h,onKeyDown:m}))});function sxe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fc(r,{select:t}),document.activeElement!==n)return}function uxe(e){const t=qW(e),n=qD(t,e),r=qD(t.reverse(),e);return[n,r]}function qW(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qD(e,t){for(const n of e)if(!lxe(n,{upTo:t}))return n}function lxe(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 cxe(e){return e instanceof HTMLInputElement&&"select"in e}function fc(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cxe(e)&&t&&e.select()}}const KD=fxe();function fxe(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=GD(e,t),e.unshift(t)},remove(t){var n;e=GD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function GD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dxe(e){return e.filter(t=>t.tagName!=="A")}const hxe=v.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?iw.createPortal(v.createElement(Lw.div,Hi({},i,{ref:t})),r):null}),YD=globalThis?.document?v.useLayoutEffect:()=>{};function pxe(e,t){return v.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Fw=e=>{const{present:t,children:n}=e,r=gxe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Fm(r.ref,i.ref);return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};Fw.displayName="Presence";function gxe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=pxe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Cy(r.current);o.current=s==="mounted"?l:"none"},[s]),YD(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Cy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),YD(()=>{if(t){const l=f=>{const p=Cy(r.current).includes(f.animationName);f.target===t&&p&&Au.flushSync(()=>u("ANIMATION_END"))},c=f=>{f.target===t&&(o.current=Cy(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Cy(e){return e?.animationName||"none"}let n3=0;function mxe(){v.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:ZD()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:ZD()),n3++,()=>{n3===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),n3--}},[])}function ZD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var y1="right-scroll-bar-position",b1="width-before-scroll-bar",vxe="with-scroll-bars-hidden",yxe="--removed-body-scroll-bar-size";function r3(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function bxe(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var xxe=typeof window<"u"?v.useLayoutEffect:v.useEffect,XD=new WeakMap;function wxe(e,t){var n=bxe(null,function(r){return e.forEach(function(i){return r3(i,r)})});return xxe(function(){var r=XD.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||r3(s,null)}),o.forEach(function(s){i.has(s)||r3(s,a)})}XD.set(n,e)},[e]),n}var KW=QU(),i3=function(){},jw=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:i3,onWheelCapture:i3,onTouchMoveCapture:i3}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,u=e.className,l=e.removeScrollBar,c=e.enabled,f=e.shards,h=e.sideCar,p=e.noIsolation,m=e.inert,y=e.allowPinchZoom,b=e.as,w=b===void 0?"div":b,x=bA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=h,O=wxe([n,t]),E=Ti(Ti({},x),i);return v.createElement(v.Fragment,null,c&&v.createElement(S,{sideCar:KW,removeScrollBar:l,shards:f,noIsolation:p,inert:m,setCallbacks:o,allowPinchZoom:!!y,lockRef:n}),a?v.cloneElement(v.Children.only(s),Ti(Ti({},E),{ref:O})):v.createElement(w,Ti({},E,{className:u,ref:O}),s))});jw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};jw.classNames={fullWidth:b1,zeroRight:y1};var _xe={left:0,top:0,right:0,gap:0},o3=function(e){return parseInt(e||"",10)||0},Sxe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[o3(n),o3(r),o3(i)]},Cxe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return _xe;var t=Sxe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Exe=xA(),Dd="data-scroll-locked",Oxe=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` .`.concat(vxe,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; @@ -464,7 +469,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do `)},QD=function(){var e=parseInt(document.body.getAttribute(Dd)||"0",10);return isFinite(e)?e:0},Axe=function(){v.useEffect(function(){return document.body.setAttribute(Dd,(QD()+1).toString()),function(){var e=QD()-1;e<=0?document.body.removeAttribute(Dd):document.body.setAttribute(Dd,e.toString())}},[])},Pxe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Axe();var o=v.useMemo(function(){return Cxe(i)},[i]);return v.createElement(Exe,{styles:Oxe(o,!t,i,n?"":"!important")})},qE=!1;if(typeof window<"u")try{var Ey=Object.defineProperty({},"passive",{get:function(){return qE=!0,!0}});window.addEventListener("test",Ey,Ey),window.removeEventListener("test",Ey,Ey)}catch{qE=!1}var Kf=qE?{passive:!1}:!1,kxe=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},Txe=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},JD=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=GW(e,n);if(r){var i=YW(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Mxe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Rxe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},GW=function(e,t){return e==="v"?kxe(t):Txe(t)},YW=function(e,t){return e==="v"?Mxe(t):Rxe(t)},Dxe=function(e,t){return e==="h"&&t==="rtl"?-1:1},$xe=function(e,t,n,r,i){var o=Dxe(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,u=t.contains(s),l=!1,c=a>0,f=0,h=0;do{var p=YW(e,s),m=p[0],y=p[1],b=p[2],w=y-b-o*m;(m||w)&&GW(e,s)&&(f+=w,h+=m),s=s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return(c&&(f===0||!i)||!c&&(h===0||!i))&&(l=!0),l},Oy=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},e9=function(e){return[e.deltaX,e.deltaY]},t9=function(e){return e&&"current"in e?e.current:e},Ixe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nxe=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Lxe=0,Gf=[];function Fxe(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(Lxe++)[0],o=v.useState(function(){return xA()})[0],a=v.useRef(e);v.useEffect(function(){a.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=XU([e.lockRef.current],(e.shards||[]).map(t9),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(y,b){if("touches"in y&&y.touches.length===2)return!a.current.allowPinchZoom;var w=Oy(y),x=n.current,S="deltaX"in y?y.deltaX:x[0]-w[0],O="deltaY"in y?y.deltaY:x[1]-w[1],E,C=y.target,P=Math.abs(S)>Math.abs(O)?"h":"v";if("touches"in y&&P==="h"&&C.type==="range")return!1;var M=JD(P,C);if(!M)return!0;if(M?E=P:(E=P==="v"?"h":"v",M=JD(P,C)),!M)return!1;if(!r.current&&"changedTouches"in y&&(S||O)&&(r.current=E),!E)return!0;var N=r.current||E;return $xe(N,b,y,N==="h"?S:O,!0)},[]),u=v.useCallback(function(y){var b=y;if(!(!Gf.length||Gf[Gf.length-1]!==o)){var w="deltaY"in b?e9(b):Oy(b),x=t.current.filter(function(E){return E.name===b.type&&E.target===b.target&&Ixe(E.delta,w)})[0];if(x&&x.should){b.preventDefault();return}if(!x){var S=(a.current.shards||[]).map(t9).filter(Boolean).filter(function(E){return E.contains(b.target)}),O=S.length>0?s(b,S[0]):!a.current.noIsolation;O&&b.preventDefault()}}},[]),l=v.useCallback(function(y,b,w,x){var S={name:y,delta:b,target:w,should:x};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(O){return O!==S})},1)},[]),c=v.useCallback(function(y){n.current=Oy(y),r.current=void 0},[]),f=v.useCallback(function(y){l(y.type,e9(y),y.target,s(y,e.lockRef.current))},[]),h=v.useCallback(function(y){l(y.type,Oy(y),y.target,s(y,e.lockRef.current))},[]);v.useEffect(function(){return Gf.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,Kf),document.addEventListener("touchmove",u,Kf),document.addEventListener("touchstart",c,Kf),function(){Gf=Gf.filter(function(y){return y!==o}),document.removeEventListener("wheel",u,Kf),document.removeEventListener("touchmove",u,Kf),document.removeEventListener("touchstart",c,Kf)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(o,{styles:Nxe(i)}):null,p?v.createElement(Pxe,{gapMode:"margin"}):null)}const jxe=ez(KW,Fxe);var ZW=v.forwardRef(function(e,t){return v.createElement(jw,Ti({},e,{ref:t,sideCar:jxe}))});ZW.classNames=jw.classNames;const XW="Dialog",[QW,Det]=Ube(XW),[Bxe,mf]=QW(XW),Uxe=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=v.useRef(null),u=v.useRef(null),[l=!1,c]=qbe({prop:r,defaultProp:i,onChange:o});return v.createElement(Bxe,{scope:t,triggerRef:s,contentRef:u,contentId:JS(),titleId:JS(),descriptionId:JS(),open:l,onOpenChange:c,onOpenToggle:v.useCallback(()=>c(f=>!f),[c]),modal:a},n)},JW="DialogPortal",[zxe,eV]=QW(JW,{forceMount:void 0}),Wxe=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=mf(JW,t);return v.createElement(zxe,{scope:t,forceMount:n},v.Children.map(r,a=>v.createElement(Fw,{present:n||o.open},v.createElement(hxe,{asChild:!0,container:i},a))))},KE="DialogOverlay",Vxe=v.forwardRef((e,t)=>{const n=eV(KE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=mf(KE,e.__scopeDialog);return o.modal?v.createElement(Fw,{present:r||o.open},v.createElement(Hxe,Hi({},i,{ref:t}))):null}),Hxe=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=mf(KE,n);return v.createElement(ZW,{as:ZA,allowPinchZoom:!0,shards:[i.contentRef]},v.createElement(Lw.div,Hi({"data-state":nV(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Cg="DialogContent",qxe=v.forwardRef((e,t)=>{const n=eV(Cg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=mf(Cg,e.__scopeDialog);return v.createElement(Fw,{present:r||o.open},o.modal?v.createElement(Kxe,Hi({},i,{ref:t})):v.createElement(Gxe,Hi({},i,{ref:t})))}),Kxe=v.forwardRef((e,t)=>{const n=mf(Cg,e.__scopeDialog),r=v.useRef(null),i=Fm(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Mm(o)},[]),v.createElement(tV,Hi({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Rd(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Rd(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Rd(e.onFocusOutside,o=>o.preventDefault())}))}),Gxe=v.forwardRef((e,t)=>{const n=mf(Cg,e.__scopeDialog),r=v.useRef(!1);return v.createElement(tV,Hi({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1},onInteractOutside:i=>{var o,a;(o=e.onInteractOutside)===null||o===void 0||o.call(e,i),i.defaultPrevented||(r.current=!0);const s=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(s))&&i.preventDefault()}}))}),tV=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=mf(Cg,n),u=v.useRef(null),l=Fm(t,u);return mxe(),v.createElement(v.Fragment,null,v.createElement(axe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},v.createElement(rxe,Hi({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":nV(s.open)},a,{ref:l,onDismiss:()=>s.onOpenChange(!1)}))),!1)});function nV(e){return e?"open":"closed"}const Yxe=Uxe,Zxe=Wxe,Xxe=Vxe,Qxe=qxe;var Jxe='[cmdk-list-sizer=""]',Up='[cmdk-group=""]',a3='[cmdk-group-items=""]',ewe='[cmdk-group-heading=""]',QA='[cmdk-item=""]',n9=`${QA}:not([aria-disabled="true"])`,GE="cmdk-item-select",Qs="data-value",twe=(e,t)=>jbe(e,t),rV=v.createContext(void 0),jm=()=>v.useContext(rV),iV=v.createContext(void 0),JA=()=>v.useContext(iV),oV=v.createContext(void 0),aV=v.forwardRef((e,t)=>{let n=v.useRef(null),r=nd(()=>{var Y,re,ie;return{search:"",value:(ie=(re=e.value)!=null?re:(Y=e.defaultValue)==null?void 0:Y.toLowerCase())!=null?ie:"",filtered:{count:0,items:new Map,groups:new Set}}}),i=nd(()=>new Set),o=nd(()=>new Map),a=nd(()=>new Map),s=nd(()=>new Set),u=sV(e),{label:l,children:c,value:f,onValueChange:h,filter:p,shouldFilter:m,vimBindings:y=!0,...b}=e,w=v.useId(),x=v.useId(),S=v.useId(),O=dwe();zh(()=>{if(f!==void 0){let Y=f.trim().toLowerCase();r.current.value=Y,O(6,V),E.emit()}},[f]);let E=v.useMemo(()=>({subscribe:Y=>(s.current.add(Y),()=>s.current.delete(Y)),snapshot:()=>r.current,setState:(Y,re,ie)=>{var se,ye,we;if(!Object.is(r.current[Y],re)){if(r.current[Y]=re,Y==="search")B(),M(),O(1,N);else if(Y==="value")if(((se=u.current)==null?void 0:se.value)!==void 0){let He=re??"";(we=(ye=u.current).onValueChange)==null||we.call(ye,He);return}else ie||O(5,V);E.emit()}},emit:()=>{s.current.forEach(Y=>Y())}}),[]),C=v.useMemo(()=>({value:(Y,re)=>{re!==a.current.get(Y)&&(a.current.set(Y,re),r.current.filtered.items.set(Y,P(re)),O(2,()=>{M(),E.emit()}))},item:(Y,re)=>(i.current.add(Y),re&&(o.current.has(re)?o.current.get(re).add(Y):o.current.set(re,new Set([Y]))),O(3,()=>{B(),M(),r.current.value||N(),E.emit()}),()=>{a.current.delete(Y),i.current.delete(Y),r.current.filtered.items.delete(Y);let ie=W();O(4,()=>{B(),ie?.getAttribute("id")===Y&&N(),E.emit()})}),group:Y=>(o.current.has(Y)||o.current.set(Y,new Set),()=>{a.current.delete(Y),o.current.delete(Y)}),filter:()=>u.current.shouldFilter,label:l||e["aria-label"],commandRef:n,listId:w,inputId:S,labelId:x}),[]);function P(Y){var re,ie;let se=(ie=(re=u.current)==null?void 0:re.filter)!=null?ie:twe;return Y?se(Y,r.current.search):0}function M(){if(!n.current||!r.current.search||u.current.shouldFilter===!1)return;let Y=r.current.filtered.items,re=[];r.current.filtered.groups.forEach(se=>{let ye=o.current.get(se),we=0;ye.forEach(He=>{let Ee=Y.get(He);we=Math.max(Ee,we)}),re.push([se,we])});let ie=n.current.querySelector(Jxe);ee().sort((se,ye)=>{var we,He;let Ee=se.getAttribute(Qs),it=ye.getAttribute(Qs);return((we=Y.get(it))!=null?we:0)-((He=Y.get(Ee))!=null?He:0)}).forEach(se=>{let ye=se.closest(a3);ye?ye.appendChild(se.parentElement===ye?se:se.closest(`${a3} > *`)):ie.appendChild(se.parentElement===ie?se:se.closest(`${a3} > *`))}),re.sort((se,ye)=>ye[1]-se[1]).forEach(se=>{let ye=n.current.querySelector(`${Up}[${Qs}="${se[0]}"]`);ye?.parentElement.appendChild(ye)})}function N(){let Y=ee().find(ie=>!ie.ariaDisabled),re=Y?.getAttribute(Qs);E.setState("value",re||void 0)}function B(){if(!r.current.search||u.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let Y=0;for(let re of i.current){let ie=a.current.get(re),se=P(ie);r.current.filtered.items.set(re,se),se>0&&Y++}for(let[re,ie]of o.current)for(let se of ie)if(r.current.filtered.items.get(se)>0){r.current.filtered.groups.add(re);break}r.current.filtered.count=Y}function V(){var Y,re,ie;let se=W();se&&(((Y=se.parentElement)==null?void 0:Y.firstChild)===se&&((ie=(re=se.closest(Up))==null?void 0:re.querySelector(ewe))==null||ie.scrollIntoView({block:"nearest"})),se.scrollIntoView({block:"nearest"}))}function W(){var Y;return(Y=n.current)==null?void 0:Y.querySelector(`${QA}[aria-selected="true"]`)}function ee(){return Array.from(n.current.querySelectorAll(n9))}function Z(Y){let re=ee()[Y];re&&E.setState("value",re.getAttribute(Qs))}function q(Y){var re;let ie=W(),se=ee(),ye=se.findIndex(He=>He===ie),we=se[ye+Y];(re=u.current)!=null&&re.loop&&(we=ye+Y<0?se[se.length-1]:ye+Y===se.length?se[0]:se[ye+Y]),we&&E.setState("value",we.getAttribute(Qs))}function G(Y){let re=W(),ie=re?.closest(Up),se;for(;ie&&!se;)ie=Y>0?cwe(ie,Up):fwe(ie,Up),se=ie?.querySelector(n9);se?E.setState("value",se.getAttribute(Qs)):q(Y)}let H=()=>Z(ee().length-1),j=Y=>{Y.preventDefault(),Y.metaKey?H():Y.altKey?G(1):q(1)},K=Y=>{Y.preventDefault(),Y.metaKey?Z(0):Y.altKey?G(-1):q(-1)};return v.createElement("div",{ref:Bm([n,t]),...b,"cmdk-root":"",onKeyDown:Y=>{var re;if((re=b.onKeyDown)==null||re.call(b,Y),!Y.defaultPrevented)switch(Y.key){case"n":case"j":{y&&Y.ctrlKey&&j(Y);break}case"ArrowDown":{j(Y);break}case"p":case"k":{y&&Y.ctrlKey&&K(Y);break}case"ArrowUp":{K(Y);break}case"Home":{Y.preventDefault(),Z(0);break}case"End":{Y.preventDefault(),H();break}case"Enter":if(!Y.nativeEvent.isComposing){Y.preventDefault();let ie=W();if(ie){let se=new Event(GE);ie.dispatchEvent(se)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:hwe},l),v.createElement(iV.Provider,{value:E},v.createElement(rV.Provider,{value:C},c)))}),nwe=v.forwardRef((e,t)=>{var n,r;let i=v.useId(),o=v.useRef(null),a=v.useContext(oV),s=jm(),u=sV(e),l=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;zh(()=>s.item(i,a?.id),[]);let c=uV(i,o,[e.value,e.children,o]),f=JA(),h=ef(E=>E.value&&E.value===c.current),p=ef(E=>l||s.filter()===!1?!0:E.search?E.filtered.items.get(i)>0:!0);v.useEffect(()=>{let E=o.current;if(!(!E||e.disabled))return E.addEventListener(GE,m),()=>E.removeEventListener(GE,m)},[p,e.onSelect,e.disabled]);function m(){var E,C;y(),(C=(E=u.current).onSelect)==null||C.call(E,c.current)}function y(){f.setState("value",c.current,!0)}if(!p)return null;let{disabled:b,value:w,onSelect:x,forceMount:S,...O}=e;return v.createElement("div",{ref:Bm([o,t]),...O,id:i,"cmdk-item":"",role:"option","aria-disabled":b||void 0,"aria-selected":h||void 0,"data-disabled":b||void 0,"data-selected":h||void 0,onPointerMove:b?void 0:y,onClick:b?void 0:m},e.children)}),rwe=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,a=v.useId(),s=v.useRef(null),u=v.useRef(null),l=v.useId(),c=jm(),f=ef(m=>i||c.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);zh(()=>c.group(a),[]),uV(a,s,[e.value,e.heading,u]);let h=v.useMemo(()=>({id:a,forceMount:i}),[i]),p=v.createElement(oV.Provider,{value:h},r);return v.createElement("div",{ref:Bm([s,t]),...o,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&v.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},p))}),iwe=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=v.useRef(null),o=ef(a=>!a.search);return!n&&!o?null:v.createElement("div",{ref:Bm([i,t]),...r,"cmdk-separator":"",role:"separator"})}),owe=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=JA(),a=ef(c=>c.search),s=ef(c=>c.value),u=jm(),l=v.useMemo(()=>{var c;let f=(c=u.commandRef.current)==null?void 0:c.querySelector(`${QA}[${Qs}="${s}"]`);return f?.getAttribute("id")},[s,u.commandRef]);return v.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),v.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:i?e.value:a,onChange:c=>{i||o.setState("search",c.target.value),n?.(c.target.value)}})}),awe=v.forwardRef((e,t)=>{let{children:n,...r}=e,i=v.useRef(null),o=v.useRef(null),a=jm();return v.useEffect(()=>{if(o.current&&i.current){let s=o.current,u=i.current,l,c=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let f=s.offsetHeight;u.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return c.observe(s),()=>{cancelAnimationFrame(l),c.unobserve(s)}}},[]),v.createElement("div",{ref:Bm([i,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:a.listId,"aria-labelledby":a.inputId},v.createElement("div",{ref:o,"cmdk-list-sizer":""},n))}),swe=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=e;return v.createElement(Yxe,{open:n,onOpenChange:r},v.createElement(Zxe,{container:a},v.createElement(Xxe,{"cmdk-overlay":"",className:i}),v.createElement(Qxe,{"aria-label":e.label,"cmdk-dialog":"",className:o},v.createElement(aV,{ref:t,...s}))))}),uwe=v.forwardRef((e,t)=>{let n=v.useRef(!0),r=ef(i=>i.filtered.count===0);return v.useEffect(()=>{n.current=!1},[]),n.current||!r?null:v.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),lwe=v.forwardRef((e,t)=>{let{progress:n,children:r,...i}=e;return v.createElement("div",{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},v.createElement("div",{"aria-hidden":!0},r))}),$et=Object.assign(aV,{List:awe,Item:nwe,Input:owe,Group:rwe,Separator:iwe,Dialog:swe,Empty:uwe,Loading:lwe});function cwe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function fwe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function sV(e){let t=v.useRef(e);return zh(()=>{t.current=e}),t}var zh=typeof window>"u"?v.useEffect:v.useLayoutEffect;function nd(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Bm(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function ef(e){let t=JA(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function uV(e,t,n){let r=v.useRef(),i=jm();return zh(()=>{var o;let a=(()=>{var s;for(let u of n){if(typeof u=="string")return u.trim().toLowerCase();if(typeof u=="object"&&"current"in u)return u.current?(s=u.current.textContent)==null?void 0:s.trim().toLowerCase():r.current}})();i.value(e,a),(o=t.current)==null||o.setAttribute(Qs,a),r.current=a}),r}var dwe=()=>{let[e,t]=v.useState(),n=nd(()=>new Map);return zh(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}},hwe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},eP="Avatar",[pwe,Iet]=Di(eP),[gwe,lV]=pwe(eP),cV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=v.useState("idle");return I.jsx(gwe,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:I.jsx(gt.span,{...r,ref:t})})});cV.displayName=eP;var fV="AvatarImage",dV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=lV(fV,n),s=mwe(r,o.referrerPolicy),u=Vr(l=>{i(l),a.onImageLoadingStatusChange(l)});return On(()=>{s!=="idle"&&u(s)},[s,u]),s==="loaded"?I.jsx(gt.img,{...o,ref:t,src:r}):null});dV.displayName=fV;var hV="AvatarFallback",pV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=lV(hV,n),[a,s]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(u)}},[r]),a&&o.imageLoadingStatus!=="loaded"?I.jsx(gt.span,{...i,ref:t}):null});pV.displayName=hV;function mwe(e,t){const[n,r]=v.useState("idle");return On(()=>{if(!e){r("error");return}let i=!0;const o=new window.Image,a=s=>()=>{i&&r(s)};return r("loading"),o.onload=a("loaded"),o.onerror=a("error"),o.src=e,t&&(o.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var Net=cV,Let=dV,Fet=pV,vwe=Array.isArray,mo=vwe,ywe=typeof La=="object"&&La&&La.Object===Object&&La,gV=ywe,bwe=gV,xwe=typeof self=="object"&&self&&self.Object===Object&&self,wwe=bwe||xwe||Function("return this")(),Ds=wwe,_we=Ds,Swe=_we.Symbol,Um=Swe,r9=Um,mV=Object.prototype,Cwe=mV.hasOwnProperty,Ewe=mV.toString,zp=r9?r9.toStringTag:void 0;function Owe(e){var t=Cwe.call(e,zp),n=e[zp];try{e[zp]=void 0;var r=!0}catch{}var i=Ewe.call(e);return r&&(t?e[zp]=n:delete e[zp]),i}var Awe=Owe,Pwe=Object.prototype,kwe=Pwe.toString;function Twe(e){return kwe.call(e)}var Mwe=Twe,i9=Um,Rwe=Awe,Dwe=Mwe,$we="[object Null]",Iwe="[object Undefined]",o9=i9?i9.toStringTag:void 0;function Nwe(e){return e==null?e===void 0?Iwe:$we:o9&&o9 in Object(e)?Rwe(e):Dwe(e)}var Tu=Nwe;function Lwe(e){return e!=null&&typeof e=="object"}var Mu=Lwe,Fwe=Tu,jwe=Mu,Bwe="[object Symbol]";function Uwe(e){return typeof e=="symbol"||jwe(e)&&Fwe(e)==Bwe}var Wh=Uwe,zwe=mo,Wwe=Wh,Vwe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hwe=/^\w*$/;function qwe(e,t){if(zwe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Wwe(e)?!0:Hwe.test(e)||!Vwe.test(e)||t!=null&&e in Object(t)}var tP=qwe;function Kwe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Wl=Kwe;const Vh=$n(Wl);var Gwe=Tu,Ywe=Wl,Zwe="[object AsyncFunction]",Xwe="[object Function]",Qwe="[object GeneratorFunction]",Jwe="[object Proxy]";function e2e(e){if(!Ywe(e))return!1;var t=Gwe(e);return t==Xwe||t==Qwe||t==Zwe||t==Jwe}var nP=e2e;const qt=$n(nP);var t2e=Ds,n2e=t2e["__core-js_shared__"],r2e=n2e,s3=r2e,a9=function(){var e=/[^.]+$/.exec(s3&&s3.keys&&s3.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function i2e(e){return!!a9&&a9 in e}var o2e=i2e,a2e=Function.prototype,s2e=a2e.toString;function u2e(e){if(e!=null){try{return s2e.call(e)}catch{}try{return e+""}catch{}}return""}var vV=u2e,l2e=nP,c2e=o2e,f2e=Wl,d2e=vV,h2e=/[\\^$.*+?()[\]{}|]/g,p2e=/^\[object .+?Constructor\]$/,g2e=Function.prototype,m2e=Object.prototype,v2e=g2e.toString,y2e=m2e.hasOwnProperty,b2e=RegExp("^"+v2e.call(y2e).replace(h2e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function x2e(e){if(!f2e(e)||c2e(e))return!1;var t=l2e(e)?b2e:p2e;return t.test(d2e(e))}var w2e=x2e;function _2e(e,t){return e?.[t]}var S2e=_2e,C2e=w2e,E2e=S2e;function O2e(e,t){var n=E2e(e,t);return C2e(n)?n:void 0}var vf=O2e,A2e=vf,P2e=A2e(Object,"create"),Bw=P2e,s9=Bw;function k2e(){this.__data__=s9?s9(null):{},this.size=0}var T2e=k2e;function M2e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var R2e=M2e,D2e=Bw,$2e="__lodash_hash_undefined__",I2e=Object.prototype,N2e=I2e.hasOwnProperty;function L2e(e){var t=this.__data__;if(D2e){var n=t[e];return n===$2e?void 0:n}return N2e.call(t,e)?t[e]:void 0}var F2e=L2e,j2e=Bw,B2e=Object.prototype,U2e=B2e.hasOwnProperty;function z2e(e){var t=this.__data__;return j2e?t[e]!==void 0:U2e.call(t,e)}var W2e=z2e,V2e=Bw,H2e="__lodash_hash_undefined__";function q2e(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=V2e&&t===void 0?H2e:t,this}var K2e=q2e,G2e=T2e,Y2e=R2e,Z2e=F2e,X2e=W2e,Q2e=K2e;function Hh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1}var g_e=p_e,m_e=Uw;function v_e(e,t){var n=this.__data__,r=m_e(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var y_e=v_e,b_e=t_e,x_e=l_e,w_e=d_e,__e=g_e,S_e=y_e;function qh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tMath.abs(O)?"h":"v";if("touches"in y&&P==="h"&&C.type==="range")return!1;var M=JD(P,C);if(!M)return!0;if(M?E=P:(E=P==="v"?"h":"v",M=JD(P,C)),!M)return!1;if(!r.current&&"changedTouches"in y&&(S||O)&&(r.current=E),!E)return!0;var N=r.current||E;return $xe(N,b,y,N==="h"?S:O,!0)},[]),u=v.useCallback(function(y){var b=y;if(!(!Gf.length||Gf[Gf.length-1]!==o)){var w="deltaY"in b?e9(b):Oy(b),x=t.current.filter(function(E){return E.name===b.type&&E.target===b.target&&Ixe(E.delta,w)})[0];if(x&&x.should){b.preventDefault();return}if(!x){var S=(a.current.shards||[]).map(t9).filter(Boolean).filter(function(E){return E.contains(b.target)}),O=S.length>0?s(b,S[0]):!a.current.noIsolation;O&&b.preventDefault()}}},[]),l=v.useCallback(function(y,b,w,x){var S={name:y,delta:b,target:w,should:x};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(O){return O!==S})},1)},[]),c=v.useCallback(function(y){n.current=Oy(y),r.current=void 0},[]),f=v.useCallback(function(y){l(y.type,e9(y),y.target,s(y,e.lockRef.current))},[]),h=v.useCallback(function(y){l(y.type,Oy(y),y.target,s(y,e.lockRef.current))},[]);v.useEffect(function(){return Gf.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,Kf),document.addEventListener("touchmove",u,Kf),document.addEventListener("touchstart",c,Kf),function(){Gf=Gf.filter(function(y){return y!==o}),document.removeEventListener("wheel",u,Kf),document.removeEventListener("touchmove",u,Kf),document.removeEventListener("touchstart",c,Kf)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(o,{styles:Nxe(i)}):null,p?v.createElement(Pxe,{gapMode:"margin"}):null)}const jxe=ez(KW,Fxe);var ZW=v.forwardRef(function(e,t){return v.createElement(jw,Ti({},e,{ref:t,sideCar:jxe}))});ZW.classNames=jw.classNames;const XW="Dialog",[QW,$et]=Ube(XW),[Bxe,mf]=QW(XW),Uxe=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=v.useRef(null),u=v.useRef(null),[l=!1,c]=qbe({prop:r,defaultProp:i,onChange:o});return v.createElement(Bxe,{scope:t,triggerRef:s,contentRef:u,contentId:JS(),titleId:JS(),descriptionId:JS(),open:l,onOpenChange:c,onOpenToggle:v.useCallback(()=>c(f=>!f),[c]),modal:a},n)},JW="DialogPortal",[zxe,eV]=QW(JW,{forceMount:void 0}),Wxe=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=mf(JW,t);return v.createElement(zxe,{scope:t,forceMount:n},v.Children.map(r,a=>v.createElement(Fw,{present:n||o.open},v.createElement(hxe,{asChild:!0,container:i},a))))},KE="DialogOverlay",Vxe=v.forwardRef((e,t)=>{const n=eV(KE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=mf(KE,e.__scopeDialog);return o.modal?v.createElement(Fw,{present:r||o.open},v.createElement(Hxe,Hi({},i,{ref:t}))):null}),Hxe=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=mf(KE,n);return v.createElement(ZW,{as:ZA,allowPinchZoom:!0,shards:[i.contentRef]},v.createElement(Lw.div,Hi({"data-state":nV(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Cg="DialogContent",qxe=v.forwardRef((e,t)=>{const n=eV(Cg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=mf(Cg,e.__scopeDialog);return v.createElement(Fw,{present:r||o.open},o.modal?v.createElement(Kxe,Hi({},i,{ref:t})):v.createElement(Gxe,Hi({},i,{ref:t})))}),Kxe=v.forwardRef((e,t)=>{const n=mf(Cg,e.__scopeDialog),r=v.useRef(null),i=Fm(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Mm(o)},[]),v.createElement(tV,Hi({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Rd(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Rd(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Rd(e.onFocusOutside,o=>o.preventDefault())}))}),Gxe=v.forwardRef((e,t)=>{const n=mf(Cg,e.__scopeDialog),r=v.useRef(!1);return v.createElement(tV,Hi({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1},onInteractOutside:i=>{var o,a;(o=e.onInteractOutside)===null||o===void 0||o.call(e,i),i.defaultPrevented||(r.current=!0);const s=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(s))&&i.preventDefault()}}))}),tV=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=mf(Cg,n),u=v.useRef(null),l=Fm(t,u);return mxe(),v.createElement(v.Fragment,null,v.createElement(axe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},v.createElement(rxe,Hi({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":nV(s.open)},a,{ref:l,onDismiss:()=>s.onOpenChange(!1)}))),!1)});function nV(e){return e?"open":"closed"}const Yxe=Uxe,Zxe=Wxe,Xxe=Vxe,Qxe=qxe;var Jxe='[cmdk-list-sizer=""]',Up='[cmdk-group=""]',a3='[cmdk-group-items=""]',ewe='[cmdk-group-heading=""]',QA='[cmdk-item=""]',n9=`${QA}:not([aria-disabled="true"])`,GE="cmdk-item-select",Qs="data-value",twe=(e,t)=>jbe(e,t),rV=v.createContext(void 0),jm=()=>v.useContext(rV),iV=v.createContext(void 0),JA=()=>v.useContext(iV),oV=v.createContext(void 0),aV=v.forwardRef((e,t)=>{let n=v.useRef(null),r=nd(()=>{var Y,re,ie;return{search:"",value:(ie=(re=e.value)!=null?re:(Y=e.defaultValue)==null?void 0:Y.toLowerCase())!=null?ie:"",filtered:{count:0,items:new Map,groups:new Set}}}),i=nd(()=>new Set),o=nd(()=>new Map),a=nd(()=>new Map),s=nd(()=>new Set),u=sV(e),{label:l,children:c,value:f,onValueChange:h,filter:p,shouldFilter:m,vimBindings:y=!0,...b}=e,w=v.useId(),x=v.useId(),S=v.useId(),O=dwe();zh(()=>{if(f!==void 0){let Y=f.trim().toLowerCase();r.current.value=Y,O(6,V),E.emit()}},[f]);let E=v.useMemo(()=>({subscribe:Y=>(s.current.add(Y),()=>s.current.delete(Y)),snapshot:()=>r.current,setState:(Y,re,ie)=>{var se,ye,we;if(!Object.is(r.current[Y],re)){if(r.current[Y]=re,Y==="search")B(),M(),O(1,N);else if(Y==="value")if(((se=u.current)==null?void 0:se.value)!==void 0){let He=re??"";(we=(ye=u.current).onValueChange)==null||we.call(ye,He);return}else ie||O(5,V);E.emit()}},emit:()=>{s.current.forEach(Y=>Y())}}),[]),C=v.useMemo(()=>({value:(Y,re)=>{re!==a.current.get(Y)&&(a.current.set(Y,re),r.current.filtered.items.set(Y,P(re)),O(2,()=>{M(),E.emit()}))},item:(Y,re)=>(i.current.add(Y),re&&(o.current.has(re)?o.current.get(re).add(Y):o.current.set(re,new Set([Y]))),O(3,()=>{B(),M(),r.current.value||N(),E.emit()}),()=>{a.current.delete(Y),i.current.delete(Y),r.current.filtered.items.delete(Y);let ie=W();O(4,()=>{B(),ie?.getAttribute("id")===Y&&N(),E.emit()})}),group:Y=>(o.current.has(Y)||o.current.set(Y,new Set),()=>{a.current.delete(Y),o.current.delete(Y)}),filter:()=>u.current.shouldFilter,label:l||e["aria-label"],commandRef:n,listId:w,inputId:S,labelId:x}),[]);function P(Y){var re,ie;let se=(ie=(re=u.current)==null?void 0:re.filter)!=null?ie:twe;return Y?se(Y,r.current.search):0}function M(){if(!n.current||!r.current.search||u.current.shouldFilter===!1)return;let Y=r.current.filtered.items,re=[];r.current.filtered.groups.forEach(se=>{let ye=o.current.get(se),we=0;ye.forEach(He=>{let Ee=Y.get(He);we=Math.max(Ee,we)}),re.push([se,we])});let ie=n.current.querySelector(Jxe);ee().sort((se,ye)=>{var we,He;let Ee=se.getAttribute(Qs),it=ye.getAttribute(Qs);return((we=Y.get(it))!=null?we:0)-((He=Y.get(Ee))!=null?He:0)}).forEach(se=>{let ye=se.closest(a3);ye?ye.appendChild(se.parentElement===ye?se:se.closest(`${a3} > *`)):ie.appendChild(se.parentElement===ie?se:se.closest(`${a3} > *`))}),re.sort((se,ye)=>ye[1]-se[1]).forEach(se=>{let ye=n.current.querySelector(`${Up}[${Qs}="${se[0]}"]`);ye?.parentElement.appendChild(ye)})}function N(){let Y=ee().find(ie=>!ie.ariaDisabled),re=Y?.getAttribute(Qs);E.setState("value",re||void 0)}function B(){if(!r.current.search||u.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let Y=0;for(let re of i.current){let ie=a.current.get(re),se=P(ie);r.current.filtered.items.set(re,se),se>0&&Y++}for(let[re,ie]of o.current)for(let se of ie)if(r.current.filtered.items.get(se)>0){r.current.filtered.groups.add(re);break}r.current.filtered.count=Y}function V(){var Y,re,ie;let se=W();se&&(((Y=se.parentElement)==null?void 0:Y.firstChild)===se&&((ie=(re=se.closest(Up))==null?void 0:re.querySelector(ewe))==null||ie.scrollIntoView({block:"nearest"})),se.scrollIntoView({block:"nearest"}))}function W(){var Y;return(Y=n.current)==null?void 0:Y.querySelector(`${QA}[aria-selected="true"]`)}function ee(){return Array.from(n.current.querySelectorAll(n9))}function Z(Y){let re=ee()[Y];re&&E.setState("value",re.getAttribute(Qs))}function q(Y){var re;let ie=W(),se=ee(),ye=se.findIndex(He=>He===ie),we=se[ye+Y];(re=u.current)!=null&&re.loop&&(we=ye+Y<0?se[se.length-1]:ye+Y===se.length?se[0]:se[ye+Y]),we&&E.setState("value",we.getAttribute(Qs))}function G(Y){let re=W(),ie=re?.closest(Up),se;for(;ie&&!se;)ie=Y>0?cwe(ie,Up):fwe(ie,Up),se=ie?.querySelector(n9);se?E.setState("value",se.getAttribute(Qs)):q(Y)}let H=()=>Z(ee().length-1),j=Y=>{Y.preventDefault(),Y.metaKey?H():Y.altKey?G(1):q(1)},K=Y=>{Y.preventDefault(),Y.metaKey?Z(0):Y.altKey?G(-1):q(-1)};return v.createElement("div",{ref:Bm([n,t]),...b,"cmdk-root":"",onKeyDown:Y=>{var re;if((re=b.onKeyDown)==null||re.call(b,Y),!Y.defaultPrevented)switch(Y.key){case"n":case"j":{y&&Y.ctrlKey&&j(Y);break}case"ArrowDown":{j(Y);break}case"p":case"k":{y&&Y.ctrlKey&&K(Y);break}case"ArrowUp":{K(Y);break}case"Home":{Y.preventDefault(),Z(0);break}case"End":{Y.preventDefault(),H();break}case"Enter":if(!Y.nativeEvent.isComposing){Y.preventDefault();let ie=W();if(ie){let se=new Event(GE);ie.dispatchEvent(se)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:hwe},l),v.createElement(iV.Provider,{value:E},v.createElement(rV.Provider,{value:C},c)))}),nwe=v.forwardRef((e,t)=>{var n,r;let i=v.useId(),o=v.useRef(null),a=v.useContext(oV),s=jm(),u=sV(e),l=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;zh(()=>s.item(i,a?.id),[]);let c=uV(i,o,[e.value,e.children,o]),f=JA(),h=ef(E=>E.value&&E.value===c.current),p=ef(E=>l||s.filter()===!1?!0:E.search?E.filtered.items.get(i)>0:!0);v.useEffect(()=>{let E=o.current;if(!(!E||e.disabled))return E.addEventListener(GE,m),()=>E.removeEventListener(GE,m)},[p,e.onSelect,e.disabled]);function m(){var E,C;y(),(C=(E=u.current).onSelect)==null||C.call(E,c.current)}function y(){f.setState("value",c.current,!0)}if(!p)return null;let{disabled:b,value:w,onSelect:x,forceMount:S,...O}=e;return v.createElement("div",{ref:Bm([o,t]),...O,id:i,"cmdk-item":"",role:"option","aria-disabled":b||void 0,"aria-selected":h||void 0,"data-disabled":b||void 0,"data-selected":h||void 0,onPointerMove:b?void 0:y,onClick:b?void 0:m},e.children)}),rwe=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,a=v.useId(),s=v.useRef(null),u=v.useRef(null),l=v.useId(),c=jm(),f=ef(m=>i||c.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);zh(()=>c.group(a),[]),uV(a,s,[e.value,e.heading,u]);let h=v.useMemo(()=>({id:a,forceMount:i}),[i]),p=v.createElement(oV.Provider,{value:h},r);return v.createElement("div",{ref:Bm([s,t]),...o,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&v.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},p))}),iwe=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=v.useRef(null),o=ef(a=>!a.search);return!n&&!o?null:v.createElement("div",{ref:Bm([i,t]),...r,"cmdk-separator":"",role:"separator"})}),owe=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=JA(),a=ef(c=>c.search),s=ef(c=>c.value),u=jm(),l=v.useMemo(()=>{var c;let f=(c=u.commandRef.current)==null?void 0:c.querySelector(`${QA}[${Qs}="${s}"]`);return f?.getAttribute("id")},[s,u.commandRef]);return v.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),v.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:i?e.value:a,onChange:c=>{i||o.setState("search",c.target.value),n?.(c.target.value)}})}),awe=v.forwardRef((e,t)=>{let{children:n,...r}=e,i=v.useRef(null),o=v.useRef(null),a=jm();return v.useEffect(()=>{if(o.current&&i.current){let s=o.current,u=i.current,l,c=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let f=s.offsetHeight;u.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return c.observe(s),()=>{cancelAnimationFrame(l),c.unobserve(s)}}},[]),v.createElement("div",{ref:Bm([i,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:a.listId,"aria-labelledby":a.inputId},v.createElement("div",{ref:o,"cmdk-list-sizer":""},n))}),swe=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=e;return v.createElement(Yxe,{open:n,onOpenChange:r},v.createElement(Zxe,{container:a},v.createElement(Xxe,{"cmdk-overlay":"",className:i}),v.createElement(Qxe,{"aria-label":e.label,"cmdk-dialog":"",className:o},v.createElement(aV,{ref:t,...s}))))}),uwe=v.forwardRef((e,t)=>{let n=v.useRef(!0),r=ef(i=>i.filtered.count===0);return v.useEffect(()=>{n.current=!1},[]),n.current||!r?null:v.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),lwe=v.forwardRef((e,t)=>{let{progress:n,children:r,...i}=e;return v.createElement("div",{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},v.createElement("div",{"aria-hidden":!0},r))}),Iet=Object.assign(aV,{List:awe,Item:nwe,Input:owe,Group:rwe,Separator:iwe,Dialog:swe,Empty:uwe,Loading:lwe});function cwe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function fwe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function sV(e){let t=v.useRef(e);return zh(()=>{t.current=e}),t}var zh=typeof window>"u"?v.useEffect:v.useLayoutEffect;function nd(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Bm(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function ef(e){let t=JA(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function uV(e,t,n){let r=v.useRef(),i=jm();return zh(()=>{var o;let a=(()=>{var s;for(let u of n){if(typeof u=="string")return u.trim().toLowerCase();if(typeof u=="object"&&"current"in u)return u.current?(s=u.current.textContent)==null?void 0:s.trim().toLowerCase():r.current}})();i.value(e,a),(o=t.current)==null||o.setAttribute(Qs,a),r.current=a}),r}var dwe=()=>{let[e,t]=v.useState(),n=nd(()=>new Map);return zh(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}},hwe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},eP="Avatar",[pwe,Net]=Di(eP),[gwe,lV]=pwe(eP),cV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=v.useState("idle");return I.jsx(gwe,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:I.jsx(gt.span,{...r,ref:t})})});cV.displayName=eP;var fV="AvatarImage",dV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=lV(fV,n),s=mwe(r,o.referrerPolicy),u=Vr(l=>{i(l),a.onImageLoadingStatusChange(l)});return On(()=>{s!=="idle"&&u(s)},[s,u]),s==="loaded"?I.jsx(gt.img,{...o,ref:t,src:r}):null});dV.displayName=fV;var hV="AvatarFallback",pV=v.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=lV(hV,n),[a,s]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(u)}},[r]),a&&o.imageLoadingStatus!=="loaded"?I.jsx(gt.span,{...i,ref:t}):null});pV.displayName=hV;function mwe(e,t){const[n,r]=v.useState("idle");return On(()=>{if(!e){r("error");return}let i=!0;const o=new window.Image,a=s=>()=>{i&&r(s)};return r("loading"),o.onload=a("loaded"),o.onerror=a("error"),o.src=e,t&&(o.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var Let=cV,Fet=dV,jet=pV,vwe=Array.isArray,mo=vwe,ywe=typeof La=="object"&&La&&La.Object===Object&&La,gV=ywe,bwe=gV,xwe=typeof self=="object"&&self&&self.Object===Object&&self,wwe=bwe||xwe||Function("return this")(),Ds=wwe,_we=Ds,Swe=_we.Symbol,Um=Swe,r9=Um,mV=Object.prototype,Cwe=mV.hasOwnProperty,Ewe=mV.toString,zp=r9?r9.toStringTag:void 0;function Owe(e){var t=Cwe.call(e,zp),n=e[zp];try{e[zp]=void 0;var r=!0}catch{}var i=Ewe.call(e);return r&&(t?e[zp]=n:delete e[zp]),i}var Awe=Owe,Pwe=Object.prototype,kwe=Pwe.toString;function Twe(e){return kwe.call(e)}var Mwe=Twe,i9=Um,Rwe=Awe,Dwe=Mwe,$we="[object Null]",Iwe="[object Undefined]",o9=i9?i9.toStringTag:void 0;function Nwe(e){return e==null?e===void 0?Iwe:$we:o9&&o9 in Object(e)?Rwe(e):Dwe(e)}var Tu=Nwe;function Lwe(e){return e!=null&&typeof e=="object"}var Mu=Lwe,Fwe=Tu,jwe=Mu,Bwe="[object Symbol]";function Uwe(e){return typeof e=="symbol"||jwe(e)&&Fwe(e)==Bwe}var Wh=Uwe,zwe=mo,Wwe=Wh,Vwe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hwe=/^\w*$/;function qwe(e,t){if(zwe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Wwe(e)?!0:Hwe.test(e)||!Vwe.test(e)||t!=null&&e in Object(t)}var tP=qwe;function Kwe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Wl=Kwe;const Vh=$n(Wl);var Gwe=Tu,Ywe=Wl,Zwe="[object AsyncFunction]",Xwe="[object Function]",Qwe="[object GeneratorFunction]",Jwe="[object Proxy]";function e2e(e){if(!Ywe(e))return!1;var t=Gwe(e);return t==Xwe||t==Qwe||t==Zwe||t==Jwe}var nP=e2e;const qt=$n(nP);var t2e=Ds,n2e=t2e["__core-js_shared__"],r2e=n2e,s3=r2e,a9=function(){var e=/[^.]+$/.exec(s3&&s3.keys&&s3.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function i2e(e){return!!a9&&a9 in e}var o2e=i2e,a2e=Function.prototype,s2e=a2e.toString;function u2e(e){if(e!=null){try{return s2e.call(e)}catch{}try{return e+""}catch{}}return""}var vV=u2e,l2e=nP,c2e=o2e,f2e=Wl,d2e=vV,h2e=/[\\^$.*+?()[\]{}|]/g,p2e=/^\[object .+?Constructor\]$/,g2e=Function.prototype,m2e=Object.prototype,v2e=g2e.toString,y2e=m2e.hasOwnProperty,b2e=RegExp("^"+v2e.call(y2e).replace(h2e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function x2e(e){if(!f2e(e)||c2e(e))return!1;var t=l2e(e)?b2e:p2e;return t.test(d2e(e))}var w2e=x2e;function _2e(e,t){return e?.[t]}var S2e=_2e,C2e=w2e,E2e=S2e;function O2e(e,t){var n=E2e(e,t);return C2e(n)?n:void 0}var vf=O2e,A2e=vf,P2e=A2e(Object,"create"),Bw=P2e,s9=Bw;function k2e(){this.__data__=s9?s9(null):{},this.size=0}var T2e=k2e;function M2e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var R2e=M2e,D2e=Bw,$2e="__lodash_hash_undefined__",I2e=Object.prototype,N2e=I2e.hasOwnProperty;function L2e(e){var t=this.__data__;if(D2e){var n=t[e];return n===$2e?void 0:n}return N2e.call(t,e)?t[e]:void 0}var F2e=L2e,j2e=Bw,B2e=Object.prototype,U2e=B2e.hasOwnProperty;function z2e(e){var t=this.__data__;return j2e?t[e]!==void 0:U2e.call(t,e)}var W2e=z2e,V2e=Bw,H2e="__lodash_hash_undefined__";function q2e(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=V2e&&t===void 0?H2e:t,this}var K2e=q2e,G2e=T2e,Y2e=R2e,Z2e=F2e,X2e=W2e,Q2e=K2e;function Hh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1}var g_e=p_e,m_e=Uw;function v_e(e,t){var n=this.__data__,r=m_e(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var y_e=v_e,b_e=t_e,x_e=l_e,w_e=d_e,__e=g_e,S_e=y_e;function qh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t`);var x=p.inactive?l:p.color;return F.createElement("li",u6({className:b,style:f,key:"legend-item-".concat(m)},Eg(r.props,p,m)),F.createElement(JE,{width:a,height:a,viewBox:c,style:h},r.renderIcon(p)),F.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},y?y(w,p,m):w))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,a=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return F.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(v.PureComponent);Ag(mP,"displayName","Legend");Ag(mP,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var rEe=zw;function iEe(){this.__data__=new rEe,this.size=0}var oEe=iEe;function aEe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var sEe=aEe;function uEe(e){return this.__data__.get(e)}var lEe=uEe;function cEe(e){return this.__data__.has(e)}var fEe=cEe,dEe=zw,hEe=iP,pEe=oP,gEe=200;function mEe(e,t){var n=this.__data__;if(n instanceof dEe){var r=n.__data__;if(!hEe||r.lengths))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var f=-1,h=!0,p=n&FEe?new $Ee:void 0;for(o.set(e,t),o.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=z6e}var xP=W6e,V6e=Tu,H6e=xP,q6e=Mu,K6e="[object Arguments]",G6e="[object Array]",Y6e="[object Boolean]",Z6e="[object Date]",X6e="[object Error]",Q6e="[object Function]",J6e="[object Map]",e4e="[object Number]",t4e="[object Object]",n4e="[object RegExp]",r4e="[object Set]",i4e="[object String]",o4e="[object WeakMap]",a4e="[object ArrayBuffer]",s4e="[object DataView]",u4e="[object Float32Array]",l4e="[object Float64Array]",c4e="[object Int8Array]",f4e="[object Int16Array]",d4e="[object Int32Array]",h4e="[object Uint8Array]",p4e="[object Uint8ClampedArray]",g4e="[object Uint16Array]",m4e="[object Uint32Array]",tr={};tr[u4e]=tr[l4e]=tr[c4e]=tr[f4e]=tr[d4e]=tr[h4e]=tr[p4e]=tr[g4e]=tr[m4e]=!0;tr[K6e]=tr[G6e]=tr[a4e]=tr[Y6e]=tr[s4e]=tr[Z6e]=tr[X6e]=tr[Q6e]=tr[J6e]=tr[e4e]=tr[t4e]=tr[n4e]=tr[r4e]=tr[i4e]=tr[o4e]=!1;function v4e(e){return q6e(e)&&H6e(e.length)&&!!tr[V6e(e)]}var y4e=v4e;function b4e(e){return function(t){return e(t)}}var uH=b4e,Bb={exports:{}};Bb.exports;(function(e,t){var n=gV,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var u=i&&i.require&&i.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s})(Bb,Bb.exports);var x4e=Bb.exports,w4e=y4e,_4e=uH,M9=x4e,R9=M9&&M9.isTypedArray,S4e=R9?_4e(R9):w4e,lH=S4e,C4e=A6e,E4e=yP,O4e=mo,A4e=sH,P4e=bP,k4e=lH,T4e=Object.prototype,M4e=T4e.hasOwnProperty;function R4e(e,t){var n=O4e(e),r=!n&&E4e(e),i=!n&&!r&&A4e(e),o=!n&&!r&&!i&&k4e(e),a=n||r||i||o,s=a?C4e(e.length,String):[],u=s.length;for(var l in e)(t||M4e.call(e,l))&&!(a&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||P4e(l,u)))&&s.push(l);return s}var D4e=R4e,$4e=Object.prototype;function I4e(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||$4e;return e===n}var N4e=I4e;function L4e(e,t){return function(n){return e(t(n))}}var cH=L4e,F4e=cH,j4e=F4e(Object.keys,Object),B4e=j4e,U4e=N4e,z4e=B4e,W4e=Object.prototype,V4e=W4e.hasOwnProperty;function H4e(e){if(!U4e(e))return z4e(e);var t=[];for(var n in Object(e))V4e.call(e,n)&&n!="constructor"&&t.push(n);return t}var q4e=H4e,K4e=nP,G4e=xP;function Y4e(e){return e!=null&&G4e(e.length)&&!K4e(e)}var Wm=Y4e,Z4e=D4e,X4e=q4e,Q4e=Wm;function J4e(e){return Q4e(e)?Z4e(e):X4e(e)}var a2=J4e,eOe=g6e,tOe=E6e,nOe=a2;function rOe(e){return eOe(e,nOe,tOe)}var iOe=rOe,D9=iOe,oOe=1,aOe=Object.prototype,sOe=aOe.hasOwnProperty;function uOe(e,t,n,r,i,o){var a=n&oOe,s=D9(e),u=s.length,l=D9(t),c=l.length;if(u!=c&&!a)return!1;for(var f=u;f--;){var h=s[f];if(!(a?h in t:sOe.call(t,h)))return!1}var p=o.get(e),m=o.get(t);if(p&&m)return p==t&&m==e;var y=!0;o.set(e,t),o.set(t,e);for(var b=a;++f-1}var aPe=oPe;function sPe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r=_Pe){var l=t?null:xPe(e);if(l)return wPe(l);a=!1,i=bPe,u=new mPe}else u=t?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FPe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function jPe(e){return e.value}function BPe(e,t){if(F.isValidElement(e))return F.cloneElement(e,t);if(typeof e=="function")return F.createElement(e,t);t.ref;var n=LPe(t,kPe);return F.createElement(mP,n)}var Y9=1,Id=function(e){function t(){var n;TPe(this,t);for(var r=arguments.length,i=new Array(r),o=0;oY9||Math.abs(i.height-this.lastBoundingBox.height)>Y9)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Gs({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,u=i.margin,l=i.chartWidth,c=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var p=this.getBBoxSnapshot();f={left:((l||0)-p.width)/2}}else f=a==="right"?{right:u&&u.right||0}:{left:u&&u.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var m=this.getBBoxSnapshot();h={top:((c||0)-m.height)/2}}else h=s==="bottom"?{bottom:u&&u.bottom||0}:{top:u&&u.top||0};return Gs(Gs({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,a=i.width,s=i.height,u=i.wrapperStyle,l=i.payloadUniqBy,c=i.payload,f=Gs(Gs({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(u)),u);return F.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},BPe(o,Gs(Gs({},this.props),{},{payload:vH(c,l,jPe)})))}}],[{key:"getWithHeight",value:function(r,i){var o=Gs(Gs({},this.defaultProps),r.props),a=o.layout;return a==="vertical"&&Ke(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}])}(v.PureComponent);s2(Id,"displayName","Legend");s2(Id,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Z9=Um,UPe=yP,zPe=mo,X9=Z9?Z9.isConcatSpreadable:void 0;function WPe(e){return zPe(e)||UPe(e)||!!(X9&&e&&e[X9])}var VPe=WPe,HPe=oH,qPe=VPe;function xH(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=qPe),i||(i=[]);++o0&&n(s)?t>1?xH(s,t-1,n,r,i):HPe(i,s):r||(i[i.length]=s)}return i}var wH=xH;function KPe(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(n(o[u],u,o)===!1)break}return t}}var GPe=KPe,YPe=GPe,ZPe=YPe(),XPe=ZPe,QPe=XPe,JPe=a2;function e5e(e,t){return e&&QPe(e,t,JPe)}var _H=e5e,t5e=Wm;function n5e(e,t){return function(n,r){if(n==null)return n;if(!t5e(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++ot||o&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!l&&e=s)return u;var l=n[r];return u*(l=="desc"?-1:1)}}return e.index-t.index}var m5e=g5e,g3=sP,v5e=uP,y5e=Vl,b5e=SH,x5e=f5e,w5e=uH,_5e=m5e,S5e=Xh,C5e=mo;function E5e(e,t,n){t.length?t=g3(t,function(o){return C5e(o)?function(a){return v5e(a,o.length===1?o[0]:o)}:o}):t=[S5e];var r=-1;t=g3(t,w5e(y5e));var i=b5e(e,function(o,a,s){var u=g3(t,function(l){return l(o)});return{criteria:u,index:++r,value:o}});return x5e(i,function(o,a){return _5e(o,a,n)})}var O5e=E5e;function A5e(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var P5e=A5e,k5e=P5e,J9=Math.max;function T5e(e,t,n){return t=J9(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=J9(r.length-t,0),a=Array(o);++i0){if(++t>=B5e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var V5e=W5e,H5e=j5e,q5e=V5e,K5e=q5e(H5e),G5e=K5e,Y5e=Xh,Z5e=M5e,X5e=G5e;function Q5e(e,t){return X5e(Z5e(e,t,Y5e),e+"")}var J5e=Q5e,e8e=rP,t8e=Wm,n8e=bP,r8e=Wl;function i8e(e,t,n){if(!r8e(n))return!1;var r=typeof t;return(r=="number"?t8e(n)&&n8e(t,n.length):r=="string"&&t in n)?e8e(n[t],e):!1}var u2=i8e,o8e=wH,a8e=O5e,s8e=J5e,t7=u2,u8e=s8e(function(e,t){if(e==null)return[];var n=t.length;return n>1&&t7(e,t[0],t[1])?t=[]:n>2&&t7(t[0],t[1],t[2])&&(t=[t[0]]),a8e(e,o8e(t,1),[])}),l8e=u8e;const SP=$n(l8e);function Pg(e){"@babel/helpers - typeof";return Pg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pg(e)}function m6(){return m6=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(Wp,"-left"),Ke(n)&&t&&Ke(t.x)&&n=t.y),"".concat(Wp,"-top"),Ke(r)&&t&&Ke(t.y)&&ry?Math.max(c,u[r]):Math.max(f,u[r])}function C8e(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function E8e(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,o=e.reverseDirection,a=e.tooltipBox,s=e.useTranslate3d,u=e.viewBox,l,c,f;return a.height>0&&a.width>0&&n?(c=i7({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:u,viewBoxDimension:u.width}),f=i7({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:u,viewBoxDimension:u.height}),l=C8e({translateX:c,translateY:f,useTranslate3d:s})):l=_8e,{cssProperties:l,cssClasses:S8e({translateX:c,translateY:f,coordinate:n})}}function rh(e){"@babel/helpers - typeof";return rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rh(e)}function o7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function a7(e){for(var t=1;ts7||Math.abs(r.height-this.state.lastBoundingBox.height)>s7)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,u=i.animationEasing,l=i.children,c=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,p=i.offset,m=i.position,y=i.reverseDirection,b=i.useTranslate3d,w=i.viewBox,x=i.wrapperStyle,S=E8e({allowEscapeViewBox:a,coordinate:c,offsetTopLeft:p,position:m,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:w}),O=S.cssClasses,E=S.cssProperties,C=a7(a7({transition:h&&o?"transform ".concat(s,"ms ").concat(u):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},x);return F.createElement("div",{tabIndex:-1,className:O,style:C,ref:function(M){r.wrapperNode=M}},l)}}])}(v.PureComponent),I8e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},qa={isSsr:I8e(),get:function(t){return qa[t]},set:function(t,n){if(typeof t=="string")qa[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(i){qa[i]=t[i]})}}};function ih(e){"@babel/helpers - typeof";return ih=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ih(e)}function u7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function l7(e){for(var t=1;t0;return F.createElement($8e,{allowEscapeViewBox:a,animationDuration:s,animationEasing:u,isAnimationActive:h,active:o,coordinate:c,hasPayload:C,offset:p,position:b,reverseDirection:w,useTranslate3d:x,viewBox:S,wrapperStyle:O},H8e(l,l7(l7({},this.props),{},{payload:E})))}}])}(v.PureComponent);CP(Js,"displayName","Tooltip");CP(Js,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!qa.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var q8e=Ds,K8e=function(){return q8e.Date.now()},G8e=K8e,Y8e=/\s/;function Z8e(e){for(var t=e.length;t--&&Y8e.test(e.charAt(t)););return t}var X8e=Z8e,Q8e=X8e,J8e=/^\s+/;function eke(e){return e&&e.slice(0,Q8e(e)+1).replace(J8e,"")}var tke=eke,nke=tke,c7=Wl,rke=Wh,f7=NaN,ike=/^[-+]0x[0-9a-f]+$/i,oke=/^0b[01]+$/i,ake=/^0o[0-7]+$/i,ske=parseInt;function uke(e){if(typeof e=="number")return e;if(rke(e))return f7;if(c7(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=c7(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=nke(e);var n=oke.test(e);return n||ake.test(e)?ske(e.slice(2),n?2:8):ike.test(e)?f7:+e}var kH=uke,lke=Wl,v3=G8e,d7=kH,cke="Expected a function",fke=Math.max,dke=Math.min;function hke(e,t,n){var r,i,o,a,s,u,l=0,c=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(cke);t=d7(t)||0,lke(n)&&(c=!!n.leading,f="maxWait"in n,o=f?fke(d7(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h);function p(C){var P=r,M=i;return r=i=void 0,l=C,a=e.apply(M,P),a}function m(C){return l=C,s=setTimeout(w,t),c?p(C):a}function y(C){var P=C-u,M=C-l,N=t-P;return f?dke(N,o-M):N}function b(C){var P=C-u,M=C-l;return u===void 0||P>=t||P<0||f&&M>=o}function w(){var C=v3();if(b(C))return x(C);s=setTimeout(w,y(C))}function x(C){return s=void 0,h&&r?p(C):(r=i=void 0,a)}function S(){s!==void 0&&clearTimeout(s),l=0,r=u=i=s=void 0}function O(){return s===void 0?a:x(v3())}function E(){var C=v3(),P=b(C);if(r=arguments,i=this,u=C,P){if(s===void 0)return m(u);if(f)return clearTimeout(s),s=setTimeout(w,t),p(u)}return s===void 0&&(s=setTimeout(w,t)),a}return E.cancel=S,E.flush=O,E}var pke=hke,gke=pke,mke=Wl,vke="Expected a function";function yke(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(vke);return mke(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),gke(e,t,{leading:r,maxWait:t,trailing:i})}var bke=yke;const TH=$n(bke);function Tg(e){"@babel/helpers - typeof";return Tg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tg(e)}function h7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ty(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(ee=TH(ee,y,{trailing:!0,leading:!1}));var Z=new ResizeObserver(ee),q=E.current.getBoundingClientRect(),G=q.width,H=q.height;return V(G,H),Z.observe(E.current),function(){Z.disconnect()}},[V,y]);var W=v.useMemo(function(){var ee=N.containerWidth,Z=N.containerHeight;if(ee<0||Z<0)return null;du(Cc(a)||Cc(u),`The width(%s) and height(%s) are both fixed numbers, +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eke(e,t){if(e){if(typeof e=="string")return p7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p7(e,t)}}function p7(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(ee=TH(ee,y,{trailing:!0,leading:!1}));var Z=new ResizeObserver(ee),q=E.current.getBoundingClientRect(),G=q.width,H=q.height;return V(G,H),Z.observe(E.current),function(){Z.disconnect()}},[V,y]);var W=v.useMemo(function(){var ee=N.containerWidth,Z=N.containerHeight;if(ee<0||Z<0)return null;du(Cc(a)||Cc(u),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,a,u),du(!n||n>0,"The aspect(%s) must be greater than zero.",n);var q=Cc(a)?ee:a,G=Cc(u)?Z:u;n&&n>0&&(q?G=q/n:G&&(q=G*n),h&&G>h&&(G=h)),du(q>0||G>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the @@ -532,12 +537,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wje(e,t){if(e){if(typeof e=="string")return l4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l4(e,t)}}function _je(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Sje(e){if(Array.isArray(e))return l4(e)}function l4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nf){p=[].concat(Qf(u.slice(0,m)),[f-y]);break}var b=p.length%2===0?[0,h]:[h];return[].concat(Qf(t.repeat(u,c)),Qf(p),b).map(function(w){return"".concat(w,"px")}).join(", ")}),$a(n,"id",yf("recharts-line-")),$a(n,"pathRef",function(a){n.mainCurve=a}),$a(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),$a(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return kje(t,e),Eje(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,s=o.xAxis,u=o.yAxis,l=o.layout,c=o.children,f=ho(c,tp);if(!f)return null;var h=function(y,b){return{x:y.x,y:y.y,value:y.value,errorVal:Kr(y.payload,b)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return F.createElement(En,p,f.map(function(m){return F.cloneElement(m,{key:"bar-".concat(m.props.dataKey),data:a,xAxis:s,yAxis:u,layout:l,dataPointFormatter:h})}))}},{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var s=this.props,u=s.dot,l=s.points,c=s.dataKey,f=Wt(this.props,!1),h=Wt(u,!0),p=l.map(function(y,b){var w=Eo(Eo(Eo({key:"dot-".concat(b),r:3},f),h),{},{value:y.value,dataKey:c,cx:y.x,cy:y.y,index:b,payload:y.payload});return t.renderDotItem(u,w)}),m={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return F.createElement(En,M0({className:"recharts-line-dots",key:"dots"},m),p)}},{key:"renderCurveStatically",value:function(r,i,o,a){var s=this.props,u=s.type,l=s.layout,c=s.connectNulls;s.ref;var f=NI(s,vje),h=Eo(Eo(Eo({},Wt(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},a),{},{type:u,layout:l,connectNulls:c});return F.createElement(Nc,M0({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,u=a.strokeDasharray,l=a.isAnimationActive,c=a.animationBegin,f=a.animationDuration,h=a.animationEasing,p=a.animationId,m=a.animateNewValues,y=a.width,b=a.height,w=this.state,x=w.prevPoints,S=w.totalLength;return F.createElement(Za,{begin:c,duration:f,isActive:l,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var E=O.t;if(x){var C=x.length/s.length,P=s.map(function(W,ee){var Z=Math.floor(ee*C);if(x[Z]){var q=x[Z],G=Or(q.x,W.x),H=Or(q.y,W.y);return Eo(Eo({},W),{},{x:G(E),y:H(E)})}if(m){var j=Or(y*2,W.x),K=Or(b/2,W.y);return Eo(Eo({},W),{},{x:j(E),y:K(E)})}return Eo(Eo({},W),{},{x:W.x,y:W.y})});return o.renderCurveStatically(P,r,i)}var M=Or(0,S),N=M(E),B;if(u){var V="".concat(u).split(/[,\s]+/gim).map(function(W){return parseFloat(W)});B=o.getStrokeDasharray(N,S,V)}else B=o.generateSimpleStrokeDasharray(S,N);return o.renderCurveStatically(s,r,i,{strokeDasharray:B})})}},{key:"renderCurve",value:function(r,i){var o=this.props,a=o.points,s=o.isAnimationActive,u=this.state,l=u.prevPoints,c=u.totalLength;return s&&a&&a.length&&(!l&&c>0||!nf(l,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,u=i.className,l=i.xAxis,c=i.yAxis,f=i.top,h=i.left,p=i.width,m=i.height,y=i.isAnimationActive,b=i.id;if(o||!s||!s.length)return null;var w=this.state.isAnimationFinished,x=s.length===1,S=dn("recharts-line",u),O=l&&l.allowDataOverflow,E=c&&c.allowDataOverflow,C=O||E,P=Vt(b)?this.id:b,M=(r=Wt(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},N=M.r,B=N===void 0?3:N,V=M.strokeWidth,W=V===void 0?2:V,ee=AV(a)?a:{},Z=ee.clipDot,q=Z===void 0?!0:Z,G=B*2+W;return F.createElement(En,{className:S},O||E?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(P)},F.createElement("rect",{x:O?h:h-p/2,y:E?f:f-m/2,width:O?p:p*2,height:E?m:m*2})),!q&&F.createElement("clipPath",{id:"clipPath-dots-".concat(P)},F.createElement("rect",{x:h-G/2,y:f-G/2,width:p+G,height:m+G}))):null,!x&&this.renderCurve(C,P),this.renderErrorBar(C,P),(x||a)&&this.renderDots(C,q,P),(!y||w)&&Os.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(Qf(r),[0]):r,a=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Dje(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Pc(){return Pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!nf(c,a)||!nf(f,s))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(a,s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,u=i.className,l=i.top,c=i.left,f=i.xAxis,h=i.yAxis,p=i.width,m=i.height,y=i.isAnimationActive,b=i.id;if(o||!s||!s.length)return null;var w=this.state.isAnimationFinished,x=s.length===1,S=dn("recharts-area",u),O=f&&f.allowDataOverflow,E=h&&h.allowDataOverflow,C=O||E,P=Vt(b)?this.id:b,M=(r=Wt(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},N=M.r,B=N===void 0?3:N,V=M.strokeWidth,W=V===void 0?2:V,ee=AV(a)?a:{},Z=ee.clipDot,q=Z===void 0?!0:Z,G=B*2+W;return F.createElement(En,{className:S},O||E?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(P)},F.createElement("rect",{x:O?c:c-p/2,y:E?l:l-m/2,width:O?p:p*2,height:E?m:m*2})),!q&&F.createElement("clipPath",{id:"clipPath-dots-".concat(P)},F.createElement("rect",{x:c-G/2,y:l-G/2,width:p+G,height:m+G}))):null,x?null:this.renderArea(C,P),(a||x)&&this.renderDots(C,q,P),(!y||w)&&Os.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(v.PureComponent);EK=wf;ys(wf,"displayName","Area");ys(wf,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!qa.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});ys(wf,"getBaseValue",function(e,t,n,r){var i=e.layout,o=e.baseValue,a=t.props.baseValue,s=a??o;if(Ke(s)&&typeof s=="number")return s;var u=i==="horizontal"?r:n,l=u.scale.domain();if(u.type==="number"){var c=Math.max(l[0],l[1]),f=Math.min(l[0],l[1]);return s==="dataMin"?f:s==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]});ys(wf,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,o=e.xAxisTicks,a=e.yAxisTicks,s=e.bandSize,u=e.dataKey,l=e.stackedData,c=e.dataStartIndex,f=e.displayedData,h=e.offset,p=t.layout,m=l&&l.length,y=EK.getBaseValue(t,n,r,i),b=p==="horizontal",w=!1,x=f.map(function(O,E){var C;m?C=l[c+E]:(C=Kr(O,u),Array.isArray(C)?w=!0:C=[y,C]);var P=C[1]==null||m&&Kr(O,u)==null;return b?{x:lh({axis:r,ticks:o,bandSize:s,entry:O,index:E}),y:P?null:i.scale(C[1]),value:C,payload:O}:{x:P?null:r.scale(C[1]),y:lh({axis:i,ticks:a,bandSize:s,entry:O,index:E}),value:C,payload:O}}),S;return m||w?S=x.map(function(O){var E=Array.isArray(O.value)?O.value[0]:null;return b?{x:O.x,y:E!=null&&O.y!=null?i.scale(E):null}:{x:E!=null?r.scale(E):null,y:O.y}}):S=b?i.scale(y):r.scale(y),Yu({points:x,baseLine:S,layout:p,isRange:w},h)});ys(wf,"renderDotItem",function(e,t){var n;if(F.isValidElement(e))n=F.cloneElement(e,t);else if(qt(e))n=e(t);else{var r=dn("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,o=OK(t,Rje);n=F.createElement(y2,Pc({},o,{key:i,className:r}))}return n});function xh(e){"@babel/helpers - typeof";return xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xh(e)}function Uje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zje(e,t){for(var n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xje(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Qje(e){var t=e.option,n=e.isActive,r=Zje(e,Yje);return typeof t=="string"?F.createElement(Q6,R0({option:F.createElement(o2,R0({type:t},r)),isActive:n,shapeType:"symbols"},r)):F.createElement(Q6,R0({option:t,isActive:n,shapeType:"symbols"},r))}function wh(e){"@babel/helpers - typeof";return wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wh(e)}function D0(){return D0=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qBe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function KBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GBe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?a:t&&t.length&&Ke(i)&&Ke(o)?t.slice(i,o+1):[]};function GK(e){return e==="number"?[0,"auto"]:void 0}var _4=function(t,n,r,i){var o=t.graphicalItems,a=t.tooltipAxis,s=k2(n,t);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(u,l){var c,f=(c=l.props.data)!==null&&c!==void 0?c:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(a.dataKey&&!a.allowDuplicatedCategory){var p=f===void 0?s:f;h=Tb(p,a.dataKey,i)}else h=f&&f[r]||s[r];return h?[].concat(Eh(u),[Nq(l,h)]):u},[])},GI=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},a=aUe(o,r),s=t.orderedTooltipTicks,u=t.tooltipAxis,l=t.tooltipTicks,c=u9e(a,s,l,u);if(c>=0&&l){var f=l[c]&&l[c].value,h=_4(t,n,c,f),p=sUe(r,s,c,o);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},uUe=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.layout,f=t.children,h=t.stackOffset,p=Dq(c,o);return r.reduce(function(m,y){var b,w=y.type.defaultProps!==void 0?Se(Se({},y.type.defaultProps),y.props):y.props,x=w.type,S=w.dataKey,O=w.allowDataOverflow,E=w.allowDuplicatedCategory,C=w.scale,P=w.ticks,M=w.includeHidden,N=w[a];if(m[N])return m;var B=k2(t.data,{graphicalItems:i.filter(function(ie){var se,ye=a in ie.props?ie.props[a]:(se=ie.type.defaultProps)===null||se===void 0?void 0:se[a];return ye===N}),dataStartIndex:u,dataEndIndex:l}),V=B.length,W,ee,Z;$Be(w.domain,O,x)&&(W=N6(w.domain,null,O),p&&(x==="number"||C!=="auto")&&(Z=k0(B,S,"category")));var q=GK(x);if(!W||W.length===0){var G,H=(G=w.domain)!==null&&G!==void 0?G:q;if(S){if(W=k0(B,S,x),x==="category"&&p){var j=ZSe(W);E&&j?(ee=W,W=px(0,V)):E||(W=_$(H,W,y).reduce(function(ie,se){return ie.indexOf(se)>=0?ie:[].concat(Eh(ie),[se])},[]))}else if(x==="category")E?W=W.filter(function(ie){return ie!==""&&!Vt(ie)}):W=_$(H,W,y).reduce(function(ie,se){return ie.indexOf(se)>=0||se===""||Vt(se)?ie:[].concat(Eh(ie),[se])},[]);else if(x==="number"){var K=h9e(B,i.filter(function(ie){var se,ye,we=a in ie.props?ie.props[a]:(se=ie.type.defaultProps)===null||se===void 0?void 0:se[a],He="hide"in ie.props?ie.props.hide:(ye=ie.type.defaultProps)===null||ye===void 0?void 0:ye.hide;return we===N&&(M||!He)}),S,o,c);K&&(W=K)}p&&(x==="number"||C!=="auto")&&(Z=k0(B,S,"category"))}else p?W=px(0,V):s&&s[N]&&s[N].hasStack&&x==="number"?W=h==="expand"?[0,1]:Iq(s[N].stackGroups,u,l):W=Rq(B,i.filter(function(ie){var se=a in ie.props?ie.props[a]:ie.type.defaultProps[a],ye="hide"in ie.props?ie.props.hide:ie.type.defaultProps.hide;return se===N&&(M||!ye)}),x,c,!0);if(x==="number")W=b4(f,W,N,o,P),H&&(W=N6(H,W,O));else if(x==="category"&&H){var Y=H,re=W.every(function(ie){return Y.indexOf(ie)>=0});re&&(W=Y)}}return Se(Se({},m),{},kt({},N,Se(Se({},w),{},{axisType:o,domain:W,categoricalDomain:Z,duplicateDomain:ee,originalDomain:(b=w.domain)!==null&&b!==void 0?b:q,isCategorical:p,layout:c})))},{})},lUe=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.layout,f=t.children,h=k2(t.data,{graphicalItems:r,dataStartIndex:u,dataEndIndex:l}),p=h.length,m=Dq(c,o),y=-1;return r.reduce(function(b,w){var x=w.type.defaultProps!==void 0?Se(Se({},w.type.defaultProps),w.props):w.props,S=x[a],O=GK("number");if(!b[S]){y++;var E;return m?E=px(0,p):s&&s[S]&&s[S].hasStack?(E=Iq(s[S].stackGroups,u,l),E=b4(f,E,S,o)):(E=N6(O,Rq(h,r.filter(function(C){var P,M,N=a in C.props?C.props[a]:(P=C.type.defaultProps)===null||P===void 0?void 0:P[a],B="hide"in C.props?C.props.hide:(M=C.type.defaultProps)===null||M===void 0?void 0:M.hide;return N===S&&!B}),"number",c),i.defaultProps.allowDataOverflow),E=b4(f,E,S,o)),Se(Se({},b),{},kt({},S,Se(Se({axisType:o},i.defaultProps),{},{hide:!0,orientation:ha(iUe,"".concat(o,".").concat(y%2),null),domain:E,originalDomain:O,isCategorical:m,layout:c})))}return b},{})},cUe=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.children,f="".concat(i,"Id"),h=ho(c,o),p={};return h.length?p=uUe(t,{axes:h,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:u,dataEndIndex:l}):a&&a.length&&(p=lUe(t,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:u,dataEndIndex:l})),p},fUe=function(t){var n=rl(t),r=su(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:SP(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:ox(n,r)}},YI=function(t){var n=t.children,r=t.defaultShowTooltip,i=ko(n,dh),o=0,a=0;return t.data&&t.data.length!==0&&(a=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},dUe=function(t){return!t||!t.length?!1:t.some(function(n){var r=fu(n&&n.type);return r&&r.indexOf("Bar")>=0})},ZI=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},hUe=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,a=o===void 0?{}:o,s=t.yAxisMap,u=s===void 0?{}:s,l=r.width,c=r.height,f=r.children,h=r.margin||{},p=ko(f,dh),m=ko(f,Id),y=Object.keys(u).reduce(function(E,C){var P=u[C],M=P.orientation;return!P.mirror&&!P.hide?Se(Se({},E),{},kt({},M,E[M]+P.width)):E},{left:h.left||0,right:h.right||0}),b=Object.keys(a).reduce(function(E,C){var P=a[C],M=P.orientation;return!P.mirror&&!P.hide?Se(Se({},E),{},kt({},M,ha(E,"".concat(M))+P.height)):E},{top:h.top||0,bottom:h.bottom||0}),w=Se(Se({},b),y),x=w.bottom;p&&(w.bottom+=p.props.height||dh.defaultProps.height),m&&n&&(w=f9e(w,i,r,n));var S=l-w.left-w.right,O=c-w.top-w.bottom;return Se(Se({brushBottom:x},w),{},{width:Math.max(S,0),height:Math.max(O,0)})},pUe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},gUe=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,a=t.validateTooltipEventTypes,s=a===void 0?["axis"]:a,u=t.axisComponents,l=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,h=function(w,x){var S=x.graphicalItems,O=x.stackGroups,E=x.offset,C=x.updateId,P=x.dataStartIndex,M=x.dataEndIndex,N=w.barSize,B=w.layout,V=w.barGap,W=w.barCategoryGap,ee=w.maxBarSize,Z=ZI(B),q=Z.numericAxisName,G=Z.cateAxisName,H=dUe(S),j=[];return S.forEach(function(K,Y){var re=k2(w.data,{graphicalItems:[K],dataStartIndex:P,dataEndIndex:M}),ie=K.type.defaultProps!==void 0?Se(Se({},K.type.defaultProps),K.props):K.props,se=ie.dataKey,ye=ie.maxBarSize,we=ie["".concat(q,"Id")],He=ie["".concat(G,"Id")],Ee={},it=u.reduce(function(Ue,Fe){var Ae=x["".concat(Fe.axisType,"Map")],tt=ie["".concat(Fe.axisType,"Id")];Ae&&Ae[tt]||Fe.axisType==="zAxis"||of();var mt=Ae[tt];return Se(Se({},Ue),{},kt(kt({},Fe.axisType,mt),"".concat(Fe.axisType,"Ticks"),su(mt)))},Ee),ke=it[G],Le=it["".concat(G,"Ticks")],De=O&&O[we]&&O[we].hasStack&&E9e(K,O[we].stackGroups),me=fu(K.type).indexOf("Bar")>=0,yt=ox(ke,Le),lt=[],Ft=H&&l9e({barSize:N,stackGroups:O,totalSize:pUe(it,G)});if(me){var yn,nn,ne=Vt(ye)?ee:ye,de=(yn=(nn=ox(ke,Le,!0))!==null&&nn!==void 0?nn:ne)!==null&&yn!==void 0?yn:0;lt=c9e({barGap:V,barCategoryGap:W,bandSize:de!==yt?de:yt,sizeList:Ft[He],maxBarSize:ne}),de!==yt&&(lt=lt.map(function(Ue){return Se(Se({},Ue),{},{position:Se(Se({},Ue.position),{},{offset:Ue.position.offset-de/2})})}))}var ge=K&&K.type&&K.type.getComposedData;ge&&j.push({props:Se(Se({},ge(Se(Se({},it),{},{displayedData:re,props:w,dataKey:se,item:K,bandSize:yt,barPosition:lt,offset:E,stackedData:De,layout:B,dataStartIndex:P,dataEndIndex:M}))),{},kt(kt(kt({key:K.key||"item-".concat(Y)},q,it[q]),G,it[G]),"animationId",C)),childIndex:u3e(K,w.children),item:K})}),j},p=function(w,x){var S=w.props,O=w.dataStartIndex,E=w.dataEndIndex,C=w.updateId;if(!m9({props:S}))return null;var P=S.children,M=S.layout,N=S.stackOffset,B=S.data,V=S.reverseStackOrder,W=ZI(M),ee=W.numericAxisName,Z=W.cateAxisName,q=ho(P,r),G=_9e(B,q,"".concat(ee,"Id"),"".concat(Z,"Id"),N,V),H=u.reduce(function(ie,se){var ye="".concat(se.axisType,"Map");return Se(Se({},ie),{},kt({},ye,cUe(S,Se(Se({},se),{},{graphicalItems:q,stackGroups:se.axisType===ee&&G,dataStartIndex:O,dataEndIndex:E}))))},{}),j=hUe(Se(Se({},H),{},{props:S,graphicalItems:q}),x?.legendBBox);Object.keys(H).forEach(function(ie){H[ie]=c(S,H[ie],j,ie.replace("Map",""),n)});var K=H["".concat(Z,"Map")],Y=fUe(K),re=h(S,Se(Se({},H),{},{dataStartIndex:O,dataEndIndex:E,updateId:C,graphicalItems:q,stackGroups:G,offset:j}));return Se(Se({formattedGraphicalItems:re,graphicalItems:q,offset:j,stackGroups:G},Y),H)},m=function(b){function w(x){var S,O,E;return KBe(this,w),E=ZBe(this,w,[x]),kt(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),kt(E,"accessibilityManager",new DBe),kt(E,"handleLegendBBoxUpdate",function(C){if(C){var P=E.state,M=P.dataStartIndex,N=P.dataEndIndex,B=P.updateId;E.setState(Se({legendBBox:C},p({props:E.props,dataStartIndex:M,dataEndIndex:N,updateId:B},Se(Se({},E.state),{},{legendBBox:C}))))}}),kt(E,"handleReceiveSyncEvent",function(C,P,M){if(E.props.syncId===C){if(M===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(P)}}),kt(E,"handleBrushChange",function(C){var P=C.startIndex,M=C.endIndex;if(P!==E.state.dataStartIndex||M!==E.state.dataEndIndex){var N=E.state.updateId;E.setState(function(){return Se({dataStartIndex:P,dataEndIndex:M},p({props:E.props,dataStartIndex:P,dataEndIndex:M,updateId:N},E.state))}),E.triggerSyncEvent({dataStartIndex:P,dataEndIndex:M})}}),kt(E,"handleMouseEnter",function(C){var P=E.getMouseInfo(C);if(P){var M=Se(Se({},P),{},{isTooltipActive:!0});E.setState(M),E.triggerSyncEvent(M);var N=E.props.onMouseEnter;qt(N)&&N(M,C)}}),kt(E,"triggeredAfterMouseMove",function(C){var P=E.getMouseInfo(C),M=P?Se(Se({},P),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(M),E.triggerSyncEvent(M);var N=E.props.onMouseMove;qt(N)&&N(M,C)}),kt(E,"handleItemMouseEnter",function(C){E.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),kt(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),kt(E,"handleMouseMove",function(C){C.persist(),E.throttleTriggeredAfterMouseMove(C)}),kt(E,"handleMouseLeave",function(C){E.throttleTriggeredAfterMouseMove.cancel();var P={isTooltipActive:!1};E.setState(P),E.triggerSyncEvent(P);var M=E.props.onMouseLeave;qt(M)&&M(P,C)}),kt(E,"handleOuterEvent",function(C){var P=s3e(C),M=ha(E.props,"".concat(P));if(P&&qt(M)){var N,B;/.*touch.*/i.test(P)?B=E.getMouseInfo(C.changedTouches[0]):B=E.getMouseInfo(C),M((N=B)!==null&&N!==void 0?N:{},C)}}),kt(E,"handleClick",function(C){var P=E.getMouseInfo(C);if(P){var M=Se(Se({},P),{},{isTooltipActive:!0});E.setState(M),E.triggerSyncEvent(M);var N=E.props.onClick;qt(N)&&N(M,C)}}),kt(E,"handleMouseDown",function(C){var P=E.props.onMouseDown;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),kt(E,"handleMouseUp",function(C){var P=E.props.onMouseUp;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),kt(E,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),kt(E,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.handleMouseDown(C.changedTouches[0])}),kt(E,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.handleMouseUp(C.changedTouches[0])}),kt(E,"handleDoubleClick",function(C){var P=E.props.onDoubleClick;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),kt(E,"handleContextMenu",function(C){var P=E.props.onContextMenu;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),kt(E,"triggerSyncEvent",function(C){E.props.syncId!==void 0&&R3.emit(D3,E.props.syncId,C,E.eventEmitterSymbol)}),kt(E,"applySyncEvent",function(C){var P=E.props,M=P.layout,N=P.syncMethod,B=E.state.updateId,V=C.dataStartIndex,W=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)E.setState(Se({dataStartIndex:V,dataEndIndex:W},p({props:E.props,dataStartIndex:V,dataEndIndex:W,updateId:B},E.state)));else if(C.activeTooltipIndex!==void 0){var ee=C.chartX,Z=C.chartY,q=C.activeTooltipIndex,G=E.state,H=G.offset,j=G.tooltipTicks;if(!H)return;if(typeof N=="function")q=N(j,C);else if(N==="value"){q=-1;for(var K=0;K=0){var De,me;if(ee.dataKey&&!ee.allowDuplicatedCategory){var yt=typeof ee.dataKey=="function"?Le:"payload.".concat(ee.dataKey.toString());De=Tb(K,yt,q),me=Y&&re&&Tb(re,yt,q)}else De=K?.[Z],me=Y&&re&&re[Z];if(He||we){var lt=C.props.activeIndex!==void 0?C.props.activeIndex:Z;return[v.cloneElement(C,Se(Se(Se({},N.props),it),{},{activeIndex:lt})),null,null]}if(!Vt(De))return[ke].concat(Eh(E.renderActivePoints({item:N,activePoint:De,basePoint:me,childIndex:Z,isRange:Y})))}else{var Ft,yn=(Ft=E.getItemByXY(E.state.activeCoordinate))!==null&&Ft!==void 0?Ft:{graphicalItem:ke},nn=yn.graphicalItem,ne=nn.item,de=ne===void 0?C:ne,ge=nn.childIndex,Ue=Se(Se(Se({},N.props),it),{},{activeIndex:ge});return[v.cloneElement(de,Ue),null,null]}return Y?[ke,null,null]:[ke,null]}),kt(E,"renderCustomized",function(C,P,M){return v.cloneElement(C,Se(Se({key:"recharts-customized-".concat(M)},E.props),E.state))}),kt(E,"renderMap",{CartesianGrid:{handler:By,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:By},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:By},YAxis:{handler:By},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((S=x.id)!==null&&S!==void 0?S:yf("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=TH(E.triggeredAfterMouseMove,(O=x.throttleDelay)!==null&&O!==void 0?O:1e3/60),E.state={},E}return JBe(w,b),YBe(w,[{key:"componentDidMount",value:function(){var S,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var S=this.props,O=S.children,E=S.data,C=S.height,P=S.layout,M=ko(O,Js);if(M){var N=M.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var B=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,V=_4(this.state,E,N,B),W=this.state.tooltipTicks[N].coordinate,ee=(this.state.offset.top+C)/2,Z=P==="horizontal",q=Z?{x:W,y:ee}:{y:W,x:ee},G=this.state.formattedGraphicalItems.find(function(j){var K=j.item;return K.type.name==="Scatter"});G&&(q=Se(Se({},q),G.props.points[N].tooltipPosition),V=G.props.points[N].tooltipPayload);var H={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:B,activePayload:V,activeCoordinate:q};this.setState(H),this.renderCursor(M),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(S,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==S.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==S.margin){var E,C;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(S){XE([ko(S.children,Js)],[ko(this.props.children,Js)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var S=ko(this.props.children,Js);if(S&&typeof S.props.shared=="boolean"){var O=S.props.shared?"axis":"item";return s.indexOf(O)>=0?O:o}return o}},{key:"getMouseInfo",value:function(S){if(!this.container)return null;var O=this.container,E=O.getBoundingClientRect(),C=$ke(E),P={chartX:Math.round(S.pageX-C.left),chartY:Math.round(S.pageY-C.top)},M=E.width/O.offsetWidth||1,N=this.inRange(P.chartX,P.chartY,M);if(!N)return null;var B=this.state,V=B.xAxisMap,W=B.yAxisMap,ee=this.getTooltipEventType();if(ee!=="axis"&&V&&W){var Z=rl(V).scale,q=rl(W).scale,G=Z&&Z.invert?Z.invert(P.chartX):null,H=q&&q.invert?q.invert(P.chartY):null;return Se(Se({},P),{},{xValue:G,yValue:H})}var j=GI(this.state,this.props.data,this.props.layout,N);return j?Se(Se({},P),j):null}},{key:"inRange",value:function(S,O){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,P=S/E,M=O/E;if(C==="horizontal"||C==="vertical"){var N=this.state.offset,B=P>=N.left&&P<=N.left+N.width&&M>=N.top&&M<=N.top+N.height;return B?{x:P,y:M}:null}var V=this.state,W=V.angleAxisMap,ee=V.radiusAxisMap;if(W&&ee){var Z=rl(W);return E$({x:P,y:M},Z)}return null}},{key:"parseEventsOfWrapper",value:function(){var S=this.props.children,O=this.getTooltipEventType(),E=ko(S,Js),C={};E&&O==="axis"&&(E.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var P=Mb(this.props,this.handleOuterEvent);return Se(Se({},P),C)}},{key:"addListener",value:function(){R3.on(D3,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){R3.removeListener(D3,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(S,O,E){for(var C=this.state.formattedGraphicalItems,P=0,M=C.length;P(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var vUe=[" ","Enter","ArrowUp","ArrowDown"],yUe=[" ","Enter"],Gm="Select",[T2,M2,bUe]=oA(Gm),[op,Uet]=Di(Gm,[bUe,zl]),R2=zl(),[xUe,Gl]=op(Gm),[wUe,_Ue]=op(Gm),YK=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:u,dir:l,name:c,autoComplete:f,disabled:h,required:p,form:m}=e,y=R2(t),[b,w]=v.useState(null),[x,S]=v.useState(null),[O,E]=v.useState(!1),C=Em(l),[P=!1,M]=Ts({prop:r,defaultProp:i,onChange:o}),[N,B]=Ts({prop:a,defaultProp:s,onChange:u}),V=v.useRef(null),W=b?m||!!b.closest("form"):!0,[ee,Z]=v.useState(new Set),q=Array.from(ee).map(G=>G.props.value).join(";");return I.jsx(kw,{...y,children:I.jsxs(xUe,{required:p,scope:t,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:O,onValueNodeHasChildrenChange:E,contentId:Lo(),value:N,onValueChange:B,open:P,onOpenChange:M,dir:C,triggerPointerDownPosRef:V,disabled:h,children:[I.jsx(T2.Provider,{scope:t,children:I.jsx(wUe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(G=>{Z(H=>new Set(H).add(G))},[]),onNativeOptionRemove:v.useCallback(G=>{Z(H=>{const j=new Set(H);return j.delete(G),j})},[]),children:n})}),W?I.jsxs(wG,{"aria-hidden":!0,required:p,tabIndex:-1,name:c,autoComplete:f,value:N,onChange:G=>B(G.target.value),disabled:h,form:m,children:[N===void 0?I.jsx("option",{value:""}):null,Array.from(ee)]},q):null]})})};YK.displayName=Gm;var ZK="SelectTrigger",XK=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=R2(n),a=Gl(ZK,n),s=a.disabled||r,u=Nt(t,a.onTriggerChange),l=M2(n),c=v.useRef("touch"),[f,h,p]=_G(y=>{const b=l().filter(S=>!S.disabled),w=b.find(S=>S.value===a.value),x=SG(b,y,w);x!==void 0&&a.onValueChange(x.value)}),m=y=>{s||(a.onOpenChange(!0),p()),y&&(a.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return I.jsx(Dm,{asChild:!0,...o,children:I.jsx(gt.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:s,"data-disabled":s?"":void 0,"data-placeholder":xG(a.value)?"":void 0,...i,ref:u,onClick:Ye(i.onClick,y=>{y.currentTarget.focus(),c.current!=="mouse"&&m(y)}),onPointerDown:Ye(i.onPointerDown,y=>{c.current=y.pointerType;const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(m(y),y.preventDefault())}),onKeyDown:Ye(i.onKeyDown,y=>{const b=f.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&h(y.key),!(b&&y.key===" ")&&vUe.includes(y.key)&&(m(),y.preventDefault())})})})});XK.displayName=ZK;var QK="SelectValue",JK=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,u=Gl(QK,n),{onValueNodeHasChildrenChange:l}=u,c=o!==void 0,f=Nt(t,u.onValueNodeChange);return On(()=>{l(c)},[l,c]),I.jsx(gt.span,{...s,ref:f,style:{pointerEvents:"none"},children:xG(u.value)?I.jsx(I.Fragment,{children:a}):o})});JK.displayName=QK;var SUe="SelectIcon",eG=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return I.jsx(gt.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});eG.displayName=SUe;var CUe="SelectPortal",tG=e=>I.jsx(jh,{asChild:!0,...e});tG.displayName=CUe;var sf="SelectContent",nG=v.forwardRef((e,t)=>{const n=Gl(sf,e.__scopeSelect),[r,i]=v.useState();if(On(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Au.createPortal(I.jsx(rG,{scope:e.__scopeSelect,children:I.jsx(T2.Slot,{scope:e.__scopeSelect,children:I.jsx("div",{children:e.children})})}),o):null}return I.jsx(iG,{...e,ref:t})});nG.displayName=sf;var ka=10,[rG,Yl]=op(sf),EUe="SelectContentImpl",iG=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:u,align:l,alignOffset:c,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:y,avoidCollisions:b,...w}=e,x=Gl(sf,n),[S,O]=v.useState(null),[E,C]=v.useState(null),P=Nt(t,Ee=>O(Ee)),[M,N]=v.useState(null),[B,V]=v.useState(null),W=M2(n),[ee,Z]=v.useState(!1),q=v.useRef(!1);v.useEffect(()=>{if(S)return Mm(S)},[S]),Ew();const G=v.useCallback(Ee=>{const[it,...ke]=W().map(me=>me.ref.current),[Le]=ke.slice(-1),De=document.activeElement;for(const me of Ee)if(me===De||(me?.scrollIntoView({block:"nearest"}),me===it&&E&&(E.scrollTop=0),me===Le&&E&&(E.scrollTop=E.scrollHeight),me?.focus(),document.activeElement!==De))return},[W,E]),H=v.useCallback(()=>G([M,S]),[G,M,S]);v.useEffect(()=>{ee&&H()},[ee,H]);const{onOpenChange:j,triggerPointerDownPosRef:K}=x;v.useEffect(()=>{if(S){let Ee={x:0,y:0};const it=Le=>{Ee={x:Math.abs(Math.round(Le.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(Le.pageY)-(K.current?.y??0))}},ke=Le=>{Ee.x<=10&&Ee.y<=10?Le.preventDefault():S.contains(Le.target)||j(!1),document.removeEventListener("pointermove",it),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",it),document.addEventListener("pointerup",ke,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",it),document.removeEventListener("pointerup",ke,{capture:!0})}}},[S,j,K]),v.useEffect(()=>{const Ee=()=>j(!1);return window.addEventListener("blur",Ee),window.addEventListener("resize",Ee),()=>{window.removeEventListener("blur",Ee),window.removeEventListener("resize",Ee)}},[j]);const[Y,re]=_G(Ee=>{const it=W().filter(De=>!De.disabled),ke=it.find(De=>De.ref.current===document.activeElement),Le=SG(it,Ee,ke);Le&&setTimeout(()=>Le.ref.current.focus())}),ie=v.useCallback((Ee,it,ke)=>{const Le=!q.current&&!ke;(x.value!==void 0&&x.value===it||Le)&&(N(Ee),Le&&(q.current=!0))},[x.value]),se=v.useCallback(()=>S?.focus(),[S]),ye=v.useCallback((Ee,it,ke)=>{const Le=!q.current&&!ke;(x.value!==void 0&&x.value===it||Le)&&V(Ee)},[x.value]),we=r==="popper"?C4:oG,He=we===C4?{side:s,sideOffset:u,align:l,alignOffset:c,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:y,avoidCollisions:b}:{};return I.jsx(rG,{scope:n,content:S,viewport:E,onViewportChange:C,itemRefCallback:ie,selectedItem:M,onItemLeave:se,itemTextRefCallback:ye,focusSelectedItem:H,selectedItemText:B,position:r,isPositioned:ee,searchRef:Y,children:I.jsx(Tm,{as:Pl,allowPinchZoom:!0,children:I.jsx(km,{asChild:!0,trapped:x.open,onMountAutoFocus:Ee=>{Ee.preventDefault()},onUnmountAutoFocus:Ye(i,Ee=>{x.trigger?.focus({preventScroll:!0}),Ee.preventDefault()}),children:I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Ee=>Ee.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:I.jsx(we,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:Ee=>Ee.preventDefault(),...w,...He,onPlaced:()=>Z(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Ye(w.onKeyDown,Ee=>{const it=Ee.ctrlKey||Ee.altKey||Ee.metaKey;if(Ee.key==="Tab"&&Ee.preventDefault(),!it&&Ee.key.length===1&&re(Ee.key),["ArrowUp","ArrowDown","Home","End"].includes(Ee.key)){let Le=W().filter(De=>!De.disabled).map(De=>De.ref.current);if(["ArrowUp","End"].includes(Ee.key)&&(Le=Le.slice().reverse()),["ArrowUp","ArrowDown"].includes(Ee.key)){const De=Ee.target,me=Le.indexOf(De);Le=Le.slice(me+1)}setTimeout(()=>G(Le)),Ee.preventDefault()}})})})})})})});iG.displayName=EUe;var OUe="SelectItemAlignedPosition",oG=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Gl(sf,n),a=Yl(sf,n),[s,u]=v.useState(null),[l,c]=v.useState(null),f=Nt(t,P=>c(P)),h=M2(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:w,focusSelectedItem:x}=a,S=v.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&l&&y&&b&&w){const P=o.trigger.getBoundingClientRect(),M=l.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),B=w.getBoundingClientRect();if(o.dir!=="rtl"){const De=B.left-M.left,me=N.left-De,yt=P.left-me,lt=P.width+yt,Ft=Math.max(lt,M.width),yn=window.innerWidth-ka,nn=S4(me,[ka,Math.max(ka,yn-Ft)]);s.style.minWidth=lt+"px",s.style.left=nn+"px"}else{const De=M.right-B.right,me=window.innerWidth-N.right-De,yt=window.innerWidth-P.right-me,lt=P.width+yt,Ft=Math.max(lt,M.width),yn=window.innerWidth-ka,nn=S4(me,[ka,Math.max(ka,yn-Ft)]);s.style.minWidth=lt+"px",s.style.right=nn+"px"}const V=h(),W=window.innerHeight-ka*2,ee=y.scrollHeight,Z=window.getComputedStyle(l),q=parseInt(Z.borderTopWidth,10),G=parseInt(Z.paddingTop,10),H=parseInt(Z.borderBottomWidth,10),j=parseInt(Z.paddingBottom,10),K=q+G+ee+j+H,Y=Math.min(b.offsetHeight*5,K),re=window.getComputedStyle(y),ie=parseInt(re.paddingTop,10),se=parseInt(re.paddingBottom,10),ye=P.top+P.height/2-ka,we=W-ye,He=b.offsetHeight/2,Ee=b.offsetTop+He,it=q+G+Ee,ke=K-it;if(it<=ye){const De=V.length>0&&b===V[V.length-1].ref.current;s.style.bottom="0px";const me=l.clientHeight-y.offsetTop-y.offsetHeight,yt=Math.max(we,He+(De?se:0)+me+H),lt=it+yt;s.style.height=lt+"px"}else{const De=V.length>0&&b===V[0].ref.current;s.style.top="0px";const yt=Math.max(ye,q+y.offsetTop+(De?ie:0)+He)+ke;s.style.height=yt+"px",y.scrollTop=it-ye+y.offsetTop}s.style.margin=`${ka}px 0`,s.style.minHeight=Y+"px",s.style.maxHeight=W+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[h,o.trigger,o.valueNode,s,l,y,b,w,o.dir,r]);On(()=>S(),[S]);const[O,E]=v.useState();On(()=>{l&&E(window.getComputedStyle(l).zIndex)},[l]);const C=v.useCallback(P=>{P&&m.current===!0&&(S(),x?.(),m.current=!1)},[S,x]);return I.jsx(PUe,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:I.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:I.jsx(gt.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});oG.displayName=OUe;var AUe="SelectPopperPosition",C4=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ka,...o}=e,a=R2(n);return I.jsx(Tw,{...a,...o,ref:t,align:r,collisionPadding:i,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)"}})});C4.displayName=AUe;var[PUe,l5]=op(sf,{}),E4="SelectViewport",aG=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Yl(E4,n),a=l5(E4,n),s=Nt(t,o.onViewportChange),u=v.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:r}),I.jsx(T2.Slot,{scope:n,children:I.jsx(gt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ye(i.onScroll,l=>{const c=l.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=a;if(h?.current&&f){const p=Math.abs(u.current-c.scrollTop);if(p>0){const m=window.innerHeight-ka*2,y=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),w=Math.max(y,b);if(w0?O:0,f.style.justifyContent="flex-end")}}}u.current=c.scrollTop})})})]})});aG.displayName=E4;var sG="SelectGroup",[kUe,TUe]=op(sG),uG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Lo();return I.jsx(kUe,{scope:n,id:i,children:I.jsx(gt.div,{role:"group","aria-labelledby":i,...r,ref:t})})});uG.displayName=sG;var lG="SelectLabel",cG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=TUe(lG,n);return I.jsx(gt.div,{id:i.id,...r,ref:t})});cG.displayName=lG;var Mx="SelectItem",[MUe,fG]=op(Mx),dG=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=Gl(Mx,n),u=Yl(Mx,n),l=s.value===r,[c,f]=v.useState(o??""),[h,p]=v.useState(!1),m=Nt(t,x=>u.itemRefCallback?.(x,r,i)),y=Lo(),b=v.useRef("touch"),w=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")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(MUe,{scope:n,value:r,disabled:i,textId:y,isSelected:l,onItemTextChange:v.useCallback(x=>{f(S=>S||(x?.textContent??"").trim())},[]),children:I.jsx(T2.ItemSlot,{scope:n,value:r,disabled:i,textValue:c,children:I.jsx(gt.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":l&&h,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:m,onFocus:Ye(a.onFocus,()=>p(!0)),onBlur:Ye(a.onBlur,()=>p(!1)),onClick:Ye(a.onClick,()=>{b.current!=="mouse"&&w()}),onPointerUp:Ye(a.onPointerUp,()=>{b.current==="mouse"&&w()}),onPointerDown:Ye(a.onPointerDown,x=>{b.current=x.pointerType}),onPointerMove:Ye(a.onPointerMove,x=>{b.current=x.pointerType,i?u.onItemLeave?.():b.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ye(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Ye(a.onKeyDown,x=>{u.searchRef?.current!==""&&x.key===" "||(yUe.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})})})})});dG.displayName=Mx;var d0="SelectItemText",hG=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Gl(d0,n),s=Yl(d0,n),u=fG(d0,n),l=_Ue(d0,n),[c,f]=v.useState(null),h=Nt(t,w=>f(w),u.onItemTextChange,w=>s.itemTextRefCallback?.(w,u.value,u.disabled)),p=c?.textContent,m=v.useMemo(()=>I.jsx("option",{value:u.value,disabled:u.disabled,children:p},u.value),[u.disabled,u.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=l;return On(()=>(y(m),()=>b(m)),[y,b,m]),I.jsxs(I.Fragment,{children:[I.jsx(gt.span,{id:u.textId,...o,ref:h}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Au.createPortal(o.children,a.valueNode):null]})});hG.displayName=d0;var pG="SelectItemIndicator",gG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return fG(pG,n).isSelected?I.jsx(gt.span,{"aria-hidden":!0,...r,ref:t}):null});gG.displayName=pG;var O4="SelectScrollUpButton",mG=v.forwardRef((e,t)=>{const n=Yl(O4,e.__scopeSelect),r=l5(O4,e.__scopeSelect),[i,o]=v.useState(!1),a=Nt(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=u.scrollTop>0;o(l)};const u=n.viewport;return s(),u.addEventListener("scroll",s),()=>u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?I.jsx(yG,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop-u.offsetHeight)}}):null});mG.displayName=O4;var A4="SelectScrollDownButton",vG=v.forwardRef((e,t)=>{const n=Yl(A4,e.__scopeSelect),r=l5(A4,e.__scopeSelect),[i,o]=v.useState(!1),a=Nt(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=u.scrollHeight-u.clientHeight,c=Math.ceil(u.scrollTop)u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?I.jsx(yG,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop+u.offsetHeight)}}):null});vG.displayName=A4;var yG=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Yl("SelectScrollButton",n),a=v.useRef(null),s=M2(n),u=v.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return v.useEffect(()=>()=>u(),[u]),On(()=>{s().find(c=>c.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),I.jsx(gt.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ye(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Ye(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Ye(i.onPointerLeave,()=>{u()})})}),RUe="SelectSeparator",bG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return I.jsx(gt.div,{"aria-hidden":!0,...r,ref:t})});bG.displayName=RUe;var P4="SelectArrow",DUe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=R2(n),o=Gl(P4,n),a=Yl(P4,n);return o.open&&a.position==="popper"?I.jsx(Mw,{...i,...r,ref:t}):null});DUe.displayName=P4;function xG(e){return e===""||e===void 0}var wG=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=v.useRef(null),o=Nt(t,i),a=mUe(n);return v.useEffect(()=>{const s=i.current,u=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==n&&c){const f=new Event("change",{bubbles:!0});c.call(s,n),s.dispatchEvent(f)}},[a,n]),I.jsx(KA,{asChild:!0,children:I.jsx("select",{...r,ref:o,defaultValue:n})})});wG.displayName="BubbleSelect";function _G(e){const t=Vr(e),n=v.useRef(""),r=v.useRef(0),i=v.useCallback(a=>{const s=n.current+a;t(s),function u(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(s)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function SG(e,t,n){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=$Ue(e,Math.max(o,0));i.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function $Ue(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zet=YK,Wet=XK,Vet=JK,Het=eG,qet=tG,Ket=nG,Get=aG,Yet=uG,Zet=cG,Xet=dG,Qet=hG,Jet=gG,ett=mG,ttt=vG,ntt=bG;const c5=6048e5,IUe=864e5,XI=Symbol.for("constructDateFrom");function ii(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&XI in e?e[XI](t):e instanceof Date?new e.constructor(t):new Date(t)}function Dn(e,t){return ii(t||e,e)}function Ui(e,t,n){const r=Dn(e,n?.in);return isNaN(t)?ii(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Xa(e,t,n){const r=Dn(e,n?.in);if(isNaN(t))return ii(n?.in||e,NaN);if(!t)return r;const i=r.getDate(),o=ii(n?.in||e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const a=o.getDate();return i>=a?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}let NUe={};function Ym(){return NUe}function ya(e,t){const n=Ym(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Dn(e,t?.in),o=i.getDay(),a=(o=o.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Rx(e){const t=Dn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function _f(e,...t){const n=ii.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function lf(e,t){const n=Dn(e,t?.in);return n.setHours(0,0,0,0),n}function bs(e,t,n){const[r,i]=_f(n?.in,e,t),o=lf(r),a=lf(i),s=+o-Rx(o),u=+a-Rx(a);return Math.round((s-u)/IUe)}function LUe(e,t){const n=CG(e,t),r=ii(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),uf(r)}function k4(e,t,n){return Ui(e,t*7,n)}function FUe(e,t,n){return Xa(e,t*12,n)}function jUe(e,t){let n,r=t?.in;return e.forEach(i=>{!r&&typeof i=="object"&&(r=ii.bind(null,i));const o=Dn(i,r);(!n||n{!r&&typeof i=="object"&&(r=ii.bind(null,i));const o=Dn(i,r);(!n||n>o||isNaN(+o))&&(n=o)}),ii(r,n||NaN)}function so(e,t,n){const[r,i]=_f(n?.in,e,t);return+lf(r)==+lf(i)}function f5(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function UUe(e){return!(!f5(e)&&typeof e!="number"||isNaN(+Dn(e)))}function sm(e,t,n){const[r,i]=_f(n?.in,e,t),o=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return o*12+a}function zUe(e,t,n){const[r,i]=_f(n?.in,e,t),o=ya(r,n),a=ya(i,n),s=+o-Rx(o),u=+a-Rx(a);return Math.round((s-u)/c5)}function d5(e,t){const n=Dn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function po(e,t){const n=Dn(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function EG(e,t){const n=Dn(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function h5(e,t){const n=Ym(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Dn(e,t?.in),o=i.getDay(),a=(o{let r;const i=WUe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Fd(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const HUe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qUe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},KUe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},GUe={date:Fd({formats:HUe,defaultWidth:"full"}),time:Fd({formats:qUe,defaultWidth:"full"}),dateTime:Fd({formats:KUe,defaultWidth:"full"})},YUe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ZUe=(e,t,n,r)=>YUe[e];function hs(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,s=n?.width?String(n.width):a;i=e.formattingValues[s]||e.formattingValues[a]}else{const a=e.defaultWidth,s=n?.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const XUe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},QUe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},JUe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},eze={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},tze={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},nze={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},rze=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ize={ordinalNumber:rze,era:hs({values:XUe,defaultWidth:"wide"}),quarter:hs({values:QUe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hs({values:JUe,defaultWidth:"wide"}),day:hs({values:eze,defaultWidth:"wide"}),dayPeriod:hs({values:tze,defaultWidth:"wide",formattingValues:nze,defaultFormattingWidth:"wide"})};function ps(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const a=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(s)?aze(s,f=>f.test(a)):oze(s,f=>f.test(a));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const c=t.slice(a.length);return{value:l,rest:c}}}function oze(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function aze(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const s=t.slice(i.length);return{value:a,rest:s}}}const sze=/^(\d+)(th|st|nd|rd)?/i,uze=/\d+/i,lze={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},cze={any:[/^b/i,/^(a|c)/i]},fze={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},dze={any:[/1/i,/2/i,/3/i,/4/i]},hze={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},pze={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},gze={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},mze={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},vze={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},yze={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},bze={ordinalNumber:AG({matchPattern:sze,parsePattern:uze,valueCallback:e=>parseInt(e,10)}),era:ps({matchPatterns:lze,defaultMatchWidth:"wide",parsePatterns:cze,defaultParseWidth:"any"}),quarter:ps({matchPatterns:fze,defaultMatchWidth:"wide",parsePatterns:dze,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ps({matchPatterns:hze,defaultMatchWidth:"wide",parsePatterns:pze,defaultParseWidth:"any"}),day:ps({matchPatterns:gze,defaultMatchWidth:"wide",parsePatterns:mze,defaultParseWidth:"any"}),dayPeriod:ps({matchPatterns:vze,defaultMatchWidth:"any",parsePatterns:yze,defaultParseWidth:"any"})},PG={code:"en-US",formatDistance:VUe,formatLong:GUe,formatRelative:ZUe,localize:ize,match:bze,options:{weekStartsOn:0,firstWeekContainsDate:1}};function xze(e,t){const n=Dn(e,t?.in);return bs(n,EG(n))+1}function kG(e,t){const n=Dn(e,t?.in),r=+uf(n)-+LUe(n);return Math.round(r/c5)+1}function TG(e,t){const n=Dn(e,t?.in),r=n.getFullYear(),i=Ym(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=ii(t?.in||e,0);a.setFullYear(r+1,0,o),a.setHours(0,0,0,0);const s=ya(a,t),u=ii(t?.in||e,0);u.setFullYear(r,0,o),u.setHours(0,0,0,0);const l=ya(u,t);return+n>=+s?r+1:+n>=+l?r:r-1}function wze(e,t){const n=Ym(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=TG(e,t),o=ii(t?.in||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),ya(o,t)}function MG(e,t){const n=Dn(e,t?.in),r=+ya(n,t)-+wze(n,t);return Math.round(r/c5)+1}function Mn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const qu={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Mn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Mn(n+1,2)},d(e,t){return Mn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Mn(e.getHours()%12||12,t.length)},H(e,t){return Mn(e.getHours(),t.length)},m(e,t){return Mn(e.getMinutes(),t.length)},s(e,t){return Mn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Mn(i,t.length)}},Jf={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},QI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return qu.y(e,t)},Y:function(e,t,n,r){const i=TG(e,r),o=i>0?i:1-i;if(t==="YY"){const a=o%100;return Mn(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Mn(o,t.length)},R:function(e,t){const n=CG(e);return Mn(n,t.length)},u:function(e,t){const n=e.getFullYear();return Mn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Mn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Mn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return qu.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Mn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=MG(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Mn(i,t.length)},I:function(e,t,n){const r=kG(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Mn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):qu.d(e,t)},D:function(e,t,n){const r=xze(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Mn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Mn(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Mn(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Mn(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Jf.noon:r===0?i=Jf.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Jf.evening:r>=12?i=Jf.afternoon:r>=4?i=Jf.morning:i=Jf.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return qu.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):qu.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Mn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Mn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):qu.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):qu.s(e,t)},S:function(e,t){return qu.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return eN(r);case"XXXX":case"XX":return gc(r);case"XXXXX":case"XXX":default:return gc(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return eN(r);case"xxxx":case"xx":return gc(r);case"xxxxx":case"xxx":default:return gc(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+JI(r,":");case"OOOO":default:return"GMT"+gc(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+JI(r,":");case"zzzz":default:return"GMT"+gc(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Mn(r,t.length)},T:function(e,t,n){return Mn(+e,t.length)}};function JI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Mn(o,2)}function eN(e,t){return e%60===0?(e>0?"-":"+")+Mn(Math.abs(e)/60,2):gc(e,t)}function gc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Mn(Math.trunc(r/60),2),o=Mn(r%60,2);return n+i+t+o}const tN=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},RG=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},_ze=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return tN(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",tN(r,t)).replace("{{time}}",RG(i,t))},Sze={p:RG,P:_ze},Cze=/^D+$/,Eze=/^Y+$/,Oze=["D","DD","YY","YYYY"];function Aze(e){return Cze.test(e)}function Pze(e){return Eze.test(e)}function kze(e,t,n){const r=Tze(e,t,n);if(console.warn(r),Oze.includes(e))throw new RangeError(r)}function Tze(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Mze=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rze=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dze=/^'([^]*?)'?$/,$ze=/''/g,Ize=/[a-zA-Z]/;function Sf(e,t,n){const r=Ym(),i=n?.locale??r.locale??PG,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Dn(e,n?.in);if(!UUe(s))throw new RangeError("Invalid time value");let u=t.match(Rze).map(c=>{const f=c[0];if(f==="p"||f==="P"){const h=Sze[f];return h(c,i.formatLong)}return c}).join("").match(Mze).map(c=>{if(c==="''")return{isToken:!1,value:"'"};const f=c[0];if(f==="'")return{isToken:!1,value:Nze(c)};if(QI[f])return{isToken:!0,value:c};if(f.match(Ize))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:c}});i.localize.preprocessor&&(u=i.localize.preprocessor(s,u));const l={firstWeekContainsDate:o,weekStartsOn:a,locale:i};return u.map(c=>{if(!c.isToken)return c.value;const f=c.value;(!n?.useAdditionalWeekYearTokens&&Pze(f)||!n?.useAdditionalDayOfYearTokens&&Aze(f))&&kze(f,t,String(e));const h=QI[f[0]];return h(s,f,i.localize,l)}).join("")}function Nze(e){const t=e.match(Dze);return t?t[1].replace($ze,"'"):e}function Lze(e,t){const n=Dn(e,t?.in),r=n.getFullYear(),i=n.getMonth(),o=ii(n,0);return o.setFullYear(r,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Fze(e){return Math.trunc(+Dn(e)/1e3)}function jze(e,t){const n=Dn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(0,0,0,0),Dn(n,t?.in)}function Bze(e,t){const n=Dn(e,t?.in);return zUe(jze(n,t),po(n,t),t)+1}function T4(e,t){return+Dn(e)>+Dn(t)}function DG(e,t){return+Dn(e)<+Dn(t)}function Uze(e,t,n){const[r,i]=_f(n?.in,e,t);return+ya(r,n)==+ya(i,n)}function p5(e,t,n){const[r,i]=_f(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function zze(e,t,n){const[r,i]=_f(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function I3(e,t,n){return Ui(e,-t,n)}function N3(e,t,n){const r=Dn(e,n?.in),i=r.getFullYear(),o=r.getDate(),a=ii(e,0);a.setFullYear(i,t,15),a.setHours(0,0,0,0);const s=Lze(a);return r.setMonth(t,Math.min(o,s)),r}function nN(e,t,n){const r=Dn(e,n?.in);return isNaN(+r)?ii(e,NaN):(r.setFullYear(t),r)}function rtt(e){return lf(Date.now(),e)}const Wze={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},Vze=(e,t,n)=>{let r;const i=Wze[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},Hze={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},qze={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},Kze={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Gze={date:Fd({formats:Hze,defaultWidth:"full"}),time:Fd({formats:qze,defaultWidth:"full"}),dateTime:Fd({formats:Kze,defaultWidth:"full"})};function rN(e,t,n){const r="eeee p";return Uze(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const Yze={lastWeek:rN,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:rN,other:"PP p"},Zze=(e,t,n,r)=>{const i=Yze[e];return typeof i=="function"?i(t,n,r):i},Xze={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},Qze={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},Jze={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},eWe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},tWe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},nWe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},rWe=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},iWe={ordinalNumber:rWe,era:hs({values:Xze,defaultWidth:"wide"}),quarter:hs({values:Qze,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hs({values:Jze,defaultWidth:"wide"}),day:hs({values:eWe,defaultWidth:"wide"}),dayPeriod:hs({values:tWe,defaultWidth:"wide",formattingValues:nWe,defaultFormattingWidth:"wide"})},oWe=/^(第\s*)?\d+(日|时|分|秒)?/i,aWe=/\d+/i,sWe={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},uWe={any:[/^(前)/i,/^(公元)/i]},lWe={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},cWe={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},fWe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},dWe={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},hWe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},pWe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},gWe={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},mWe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},vWe={ordinalNumber:AG({matchPattern:oWe,parsePattern:aWe,valueCallback:e=>parseInt(e,10)}),era:ps({matchPatterns:sWe,defaultMatchWidth:"wide",parsePatterns:uWe,defaultParseWidth:"any"}),quarter:ps({matchPatterns:lWe,defaultMatchWidth:"wide",parsePatterns:cWe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ps({matchPatterns:fWe,defaultMatchWidth:"wide",parsePatterns:dWe,defaultParseWidth:"any"}),day:ps({matchPatterns:hWe,defaultMatchWidth:"wide",parsePatterns:pWe,defaultParseWidth:"any"}),dayPeriod:ps({matchPatterns:gWe,defaultMatchWidth:"any",parsePatterns:mWe,defaultParseWidth:"any"})},itt={code:"zh-CN",formatDistance:Vze,formatLong:Gze,formatRelative:Zze,localize:iWe,match:vWe,options:{weekStartsOn:1,firstWeekContainsDate:4}};var Dt=function(){return Dt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r1&&(u||!l),f=t>1&&(l||!u),h=function(){r&&o(r)},p=function(){i&&o(i)};return I.jsx(ZWe,{displayMonth:e.displayMonth,hideNext:c,hidePrevious:f,nextMonth:i,previousMonth:r,onPreviousClick:h,onNextClick:p})}function XWe(e){var t,n=Kn(),r=n.classNames,i=n.disableNavigation,o=n.styles,a=n.captionLayout,s=n.components,u=(t=s?.CaptionLabel)!==null&&t!==void 0?t:NG,l;return i?l=I.jsx(u,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?l=I.jsx(iN,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?l=I.jsxs(I.Fragment,{children:[I.jsx(iN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),I.jsx(oN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):l=I.jsxs(I.Fragment,{children:[I.jsx(u,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),I.jsx(oN,{displayMonth:e.displayMonth,id:e.id})]}),I.jsx("div",{className:r.caption,style:o.caption,children:l})}function QWe(e){var t=Kn(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?I.jsx("tfoot",{className:i,style:r.tfoot,children:I.jsx("tr",{children:I.jsx("td",{colSpan:8,children:n})})}):I.jsx(I.Fragment,{})}function JWe(e,t,n){for(var r=n?uf(new Date):ya(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var a=Ui(r,o);i.push(a)}return i}function eVe(){var e=Kn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,a=e.ISOWeek,s=e.formatters.formatWeekdayName,u=e.labels.labelWeekday,l=JWe(i,o,a);return I.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&I.jsx("td",{style:n.head_cell,className:t.head_cell}),l.map(function(c,f){return I.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":u(c,{locale:i}),children:s(c,{locale:i})},f)})]})}function tVe(){var e,t=Kn(),n=t.classNames,r=t.styles,i=t.components,o=(e=i?.HeadRow)!==null&&e!==void 0?e:eVe;return I.jsx("thead",{style:r.head,className:n.head,children:I.jsx(o,{})})}function nVe(e){var t=Kn(),n=t.locale,r=t.formatters.formatDay;return I.jsx(I.Fragment,{children:r(e.date,{locale:n})})}var g5=v.createContext(void 0);function rVe(e){if(!Zm(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return I.jsx(g5.Provider,{value:t,children:e.children})}return I.jsx(iVe,{initialProps:e.initialProps,children:e.children})}function iVe(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,a=function(l,c,f){var h,p;(h=t.onDayClick)===null||h===void 0||h.call(t,l,c,f);var m=!!(c.selected&&i&&r?.length===i);if(!m){var y=!!(!c.selected&&o&&r?.length===o);if(!y){var b=r?$G([],r):[];if(c.selected){var w=b.findIndex(function(x){return so(l,x)});b.splice(w,1)}else b.push(l);(p=t.onSelect)===null||p===void 0||p.call(t,b,l,c,f)}}},s={disabled:[]};r&&s.disabled.push(function(l){var c=o&&r.length>o-1,f=r.some(function(h){return so(h,l)});return!!(c&&!f)});var u={selected:r,onDayClick:a,modifiers:s};return I.jsx(g5.Provider,{value:u,children:n})}function m5(){var e=v.useContext(g5);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function oVe(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?so(i,e)&&so(r,e)?void 0:so(i,e)?{from:i,to:void 0}:so(r,e)?void 0:T4(r,e)?{from:e,to:i}:{from:r,to:e}:i?T4(e,i)?{from:i,to:e}:{from:e,to:i}:r?DG(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var v5=v.createContext(void 0);function aVe(e){if(!Xm(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return I.jsx(v5.Provider,{value:t,children:e.children})}return I.jsx(sVe,{initialProps:e.initialProps,children:e.children})}function sVe(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,a=i.to,s=t.min,u=t.max,l=function(p,m,y){var b,w;(b=t.onDayClick)===null||b===void 0||b.call(t,p,m,y);var x=oVe(p,r);(w=t.onSelect)===null||w===void 0||w.call(t,x,p,m,y)},c={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(c.range_start=[o],a?(c.range_end=[a],so(o,a)||(c.range_middle=[{after:o,before:a}])):c.range_end=[o]):a&&(c.range_start=[a],c.range_end=[a]),s&&(o&&!a&&c.disabled.push({after:I3(o,s-1),before:Ui(o,s-1)}),o&&a&&c.disabled.push({after:o,before:Ui(o,s-1)}),!o&&a&&c.disabled.push({after:I3(a,s-1),before:Ui(a,s-1)})),u){if(o&&!a&&(c.disabled.push({before:Ui(o,-u+1)}),c.disabled.push({after:Ui(o,u-1)})),o&&a){var f=bs(a,o)+1,h=u-f;c.disabled.push({before:I3(o,h)}),c.disabled.push({after:Ui(a,h)})}!o&&a&&(c.disabled.push({before:Ui(a,-u+1)}),c.disabled.push({after:Ui(a,u-1)}))}return I.jsx(v5.Provider,{value:{selected:r,onDayClick:l,modifiers:c},children:n})}function y5(){var e=v.useContext(v5);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function x1(e){return Array.isArray(e)?$G([],e):e!==void 0?[e]:[]}function uVe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=x1(i)}),t}var Qa;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Qa||(Qa={}));var lVe=Qa.Selected,Ys=Qa.Disabled,cVe=Qa.Hidden,fVe=Qa.Today,L3=Qa.RangeEnd,F3=Qa.RangeMiddle,j3=Qa.RangeStart,dVe=Qa.Outside;function hVe(e,t,n){var r,i=(r={},r[lVe]=x1(e.selected),r[Ys]=x1(e.disabled),r[cVe]=x1(e.hidden),r[fVe]=[e.today],r[L3]=[],r[F3]=[],r[j3]=[],r[dVe]=[],r);return e.fromDate&&i[Ys].push({before:e.fromDate}),e.toDate&&i[Ys].push({after:e.toDate}),Zm(e)?i[Ys]=i[Ys].concat(t.modifiers[Ys]):Xm(e)&&(i[Ys]=i[Ys].concat(n.modifiers[Ys]),i[j3]=n.modifiers[j3],i[F3]=n.modifiers[F3],i[L3]=n.modifiers[L3]),i}var jG=v.createContext(void 0);function pVe(e){var t=Kn(),n=m5(),r=y5(),i=hVe(t,n,r),o=uVe(t.modifiers),a=Dt(Dt({},i),o);return I.jsx(jG.Provider,{value:a,children:e.children})}function BG(){var e=v.useContext(jG);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function gVe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function mVe(e){return!!(e&&typeof e=="object"&&"from"in e)}function vVe(e){return!!(e&&typeof e=="object"&&"after"in e)}function yVe(e){return!!(e&&typeof e=="object"&&"before"in e)}function bVe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function xVe(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=bs(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var a=bs(e,r)>=0&&bs(i,e)>=0;return a}return i?so(i,e):r?so(r,e):!1}function wVe(e){return f5(e)}function _Ve(e){return Array.isArray(e)&&e.every(f5)}function SVe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(wVe(n))return so(e,n);if(_Ve(n))return n.includes(e);if(mVe(n))return xVe(e,n);if(bVe(n))return n.dayOfWeek.includes(e.getDay());if(gVe(n)){var r=bs(n.before,e),i=bs(n.after,e),o=r>0,a=i<0,s=T4(n.before,n.after);return s?a&&o:o||a}return vVe(n)?bs(e,n.after)>0:yVe(n)?bs(n.before,e)>0:typeof n=="function"?n(e):!1})}function b5(e,t,n){var r=Object.keys(t).reduce(function(o,a){var s=t[a];return SVe(e,s)&&o.push(a),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!p5(e,n)&&(i.outside=!0),i}function CVe(e,t){for(var n=po(e[0]),r=d5(e[e.length-1]),i,o,a=n;a<=r;){var s=b5(a,t),u=!s.disabled&&!s.hidden;if(!u){a=Ui(a,1);continue}if(s.selected)return a;s.today&&!o&&(o=a),i||(i=a),a=Ui(a,1)}return o||i}var EVe=365;function UG(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,a=t.retry,s=a===void 0?{count:0,lastFocused:e}:a,u=i.weekStartsOn,l=i.fromDate,c=i.toDate,f=i.locale,h={day:Ui,week:k4,month:Xa,year:FUe,startOfWeek:function(b){return i.ISOWeek?uf(b):ya(b,{locale:f,weekStartsOn:u})},endOfWeek:function(b){return i.ISOWeek?OG(b):h5(b,{locale:f,weekStartsOn:u})}},p=h[n](e,r==="after"?1:-1);r==="before"&&l?p=jUe([l,p]):r==="after"&&c&&(p=BUe([c,p]));var m=!0;if(o){var y=b5(p,o);m=!y.disabled&&!y.hidden}return m?p:s.count>EVe?s.lastFocused:UG(p,{moveBy:n,direction:r,context:i,modifiers:o,retry:Dt(Dt({},s),{count:s.count+1})})}var zG=v.createContext(void 0);function OVe(e){var t=Qm(),n=BG(),r=v.useState(),i=r[0],o=r[1],a=v.useState(),s=a[0],u=a[1],l=CVe(t.displayMonths,n),c=i??(s&&t.isDateDisplayed(s))?s:l,f=function(){u(i),o(void 0)},h=function(b){o(b)},p=Kn(),m=function(b,w){if(i){var x=UG(i,{moveBy:b,direction:w,context:p,modifiers:n});so(i,x)||(t.goToDate(x,i),h(x))}},y={focusedDay:i,focusTarget:c,blur:f,focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return I.jsx(zG.Provider,{value:y,children:e.children})}function x5(){var e=v.useContext(zG);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function AVe(e,t){var n=BG(),r=b5(e,n,t);return r}var w5=v.createContext(void 0);function PVe(e){if(!D2(e.initialProps)){var t={selected:void 0};return I.jsx(w5.Provider,{value:t,children:e.children})}return I.jsx(kVe,{initialProps:e.initialProps,children:e.children})}function kVe(e){var t=e.initialProps,n=e.children,r=function(o,a,s){var u,l,c;if((u=t.onDayClick)===null||u===void 0||u.call(t,o,a,s),a.selected&&!t.required){(l=t.onSelect)===null||l===void 0||l.call(t,void 0,o,a,s);return}(c=t.onSelect)===null||c===void 0||c.call(t,o,o,a,s)},i={selected:t.selected,onDayClick:r};return I.jsx(w5.Provider,{value:i,children:n})}function WG(){var e=v.useContext(w5);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function TVe(e,t){var n=Kn(),r=WG(),i=m5(),o=y5(),a=x5(),s=a.focusDayAfter,u=a.focusDayBefore,l=a.focusWeekAfter,c=a.focusWeekBefore,f=a.blur,h=a.focus,p=a.focusMonthBefore,m=a.focusMonthAfter,y=a.focusYearBefore,b=a.focusYearAfter,w=a.focusStartOfWeek,x=a.focusEndOfWeek,S=function(H){var j,K,Y,re;D2(n)?(j=r.onDayClick)===null||j===void 0||j.call(r,e,t,H):Zm(n)?(K=i.onDayClick)===null||K===void 0||K.call(i,e,t,H):Xm(n)?(Y=o.onDayClick)===null||Y===void 0||Y.call(o,e,t,H):(re=n.onDayClick)===null||re===void 0||re.call(n,e,t,H)},O=function(H){var j;h(e),(j=n.onDayFocus)===null||j===void 0||j.call(n,e,t,H)},E=function(H){var j;f(),(j=n.onDayBlur)===null||j===void 0||j.call(n,e,t,H)},C=function(H){var j;(j=n.onDayMouseEnter)===null||j===void 0||j.call(n,e,t,H)},P=function(H){var j;(j=n.onDayMouseLeave)===null||j===void 0||j.call(n,e,t,H)},M=function(H){var j;(j=n.onDayPointerEnter)===null||j===void 0||j.call(n,e,t,H)},N=function(H){var j;(j=n.onDayPointerLeave)===null||j===void 0||j.call(n,e,t,H)},B=function(H){var j;(j=n.onDayTouchCancel)===null||j===void 0||j.call(n,e,t,H)},V=function(H){var j;(j=n.onDayTouchEnd)===null||j===void 0||j.call(n,e,t,H)},W=function(H){var j;(j=n.onDayTouchMove)===null||j===void 0||j.call(n,e,t,H)},ee=function(H){var j;(j=n.onDayTouchStart)===null||j===void 0||j.call(n,e,t,H)},Z=function(H){var j;(j=n.onDayKeyUp)===null||j===void 0||j.call(n,e,t,H)},q=function(H){var j;switch(H.key){case"ArrowLeft":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?s():u();break;case"ArrowRight":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?u():s();break;case"ArrowDown":H.preventDefault(),H.stopPropagation(),l();break;case"ArrowUp":H.preventDefault(),H.stopPropagation(),c();break;case"PageUp":H.preventDefault(),H.stopPropagation(),H.shiftKey?y():p();break;case"PageDown":H.preventDefault(),H.stopPropagation(),H.shiftKey?b():m();break;case"Home":H.preventDefault(),H.stopPropagation(),w();break;case"End":H.preventDefault(),H.stopPropagation(),x();break}(j=n.onDayKeyDown)===null||j===void 0||j.call(n,e,t,H)},G={onClick:S,onFocus:O,onBlur:E,onKeyDown:q,onKeyUp:Z,onMouseEnter:C,onMouseLeave:P,onPointerEnter:M,onPointerLeave:N,onTouchCancel:B,onTouchEnd:V,onTouchMove:W,onTouchStart:ee};return G}function MVe(){var e=Kn(),t=WG(),n=m5(),r=y5(),i=D2(e)?t.selected:Zm(e)?n.selected:Xm(e)?r.selected:void 0;return i}function RVe(e){return Object.values(Qa).includes(e)}function DVe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(RVe(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function $Ve(e,t){var n=Dt({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Dt(Dt({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function IVe(e,t,n){var r,i,o,a=Kn(),s=x5(),u=AVe(e,t),l=TVe(e,u),c=MVe(),f=!!(a.onDayClick||a.mode!=="default");v.useEffect(function(){var C;u.outside||s.focusedDay&&f&&so(s.focusedDay,e)&&((C=n.current)===null||C===void 0||C.focus())},[s.focusedDay,e,n,f,u.outside]);var h=DVe(a,u).join(" "),p=$Ve(a,u),m=!!(u.outside&&!a.showOutsideDays||u.hidden),y=(o=(i=a.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:nVe,b=I.jsx(y,{date:e,displayMonth:t,activeModifiers:u}),w={style:p,className:h,children:b,role:"gridcell"},x=s.focusTarget&&so(s.focusTarget,e)&&!u.outside,S=s.focusedDay&&so(s.focusedDay,e),O=Dt(Dt(Dt({},w),(r={disabled:u.disabled,role:"gridcell"},r["aria-selected"]=u.selected,r.tabIndex=S||x?0:-1,r)),l),E={isButton:f,isHidden:m,activeModifiers:u,selectedDays:c,buttonProps:O,divProps:w};return E}function NVe(e){var t=v.useRef(null),n=IVe(e.date,e.displayMonth,t);return n.isHidden?I.jsx("div",{role:"gridcell"}):n.isButton?I.jsx(Dx,Dt({name:"day",ref:t},n.buttonProps)):I.jsx("div",Dt({},n.divProps))}function LVe(e){var t=e.number,n=e.dates,r=Kn(),i=r.onWeekNumberClick,o=r.styles,a=r.classNames,s=r.locale,u=r.labels.labelWeekNumber,l=r.formatters.formatWeekNumber,c=l(Number(t),{locale:s});if(!i)return I.jsx("span",{className:a.weeknumber,style:o.weeknumber,children:c});var f=u(Number(t),{locale:s}),h=function(p){i(t,n,p)};return I.jsx(Dx,{name:"week-number","aria-label":f,className:a.weeknumber,style:o.weeknumber,onClick:h,children:c})}function FVe(e){var t,n,r=Kn(),i=r.styles,o=r.classNames,a=r.showWeekNumber,s=r.components,u=(t=s?.Day)!==null&&t!==void 0?t:NVe,l=(n=s?.WeekNumber)!==null&&n!==void 0?n:LVe,c;return a&&(c=I.jsx("td",{className:o.cell,style:i.cell,children:I.jsx(l,{number:e.weekNumber,dates:e.dates})})),I.jsxs("tr",{className:o.row,style:i.row,children:[c,e.dates.map(function(f){return I.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:I.jsx(u,{displayMonth:e.displayMonth,date:f})},Fze(f))})]})}function aN(e,t,n){for(var r=n?.ISOWeek?OG(t):h5(t,n),i=n?.ISOWeek?uf(e):ya(e,n),o=bs(r,i),a=[],s=0;s<=o;s++)a.push(Ui(i,s));var u=a.reduce(function(l,c){var f=n?.ISOWeek?kG(c):MG(c,n),h=l.find(function(p){return p.weekNumber===f});return h?(h.dates.push(c),l):(l.push({weekNumber:f,dates:[c]}),l)},[]);return u}function jVe(e,t){var n=aN(po(e),d5(e),t);if(t?.useFixedWeeks){var r=Bze(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],a=k4(o,6-r),s=aN(k4(o,1),a,t);n.push.apply(n,s)}}return n}function BVe(e){var t,n,r,i=Kn(),o=i.locale,a=i.classNames,s=i.styles,u=i.hideHead,l=i.fixedWeeks,c=i.components,f=i.weekStartsOn,h=i.firstWeekContainsDate,p=i.ISOWeek,m=jVe(e.displayMonth,{useFixedWeeks:!!l,ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:h}),y=(t=c?.Head)!==null&&t!==void 0?t:tVe,b=(n=c?.Row)!==null&&n!==void 0?n:FVe,w=(r=c?.Footer)!==null&&r!==void 0?r:QWe;return I.jsxs("table",{id:e.id,className:a.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!u&&I.jsx(y,{}),I.jsx("tbody",{className:a.tbody,style:s.tbody,children:m.map(function(x){return I.jsx(b,{displayMonth:e.displayMonth,dates:x.dates,weekNumber:x.weekNumber},x.weekNumber)})}),I.jsx(w,{displayMonth:e.displayMonth})]})}function UVe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var zVe=UVe()?v.useLayoutEffect:v.useEffect,B3=!1,WVe=0;function sN(){return"react-day-picker-".concat(++WVe)}function VVe(e){var t,n=e??(B3?sN():null),r=v.useState(n),i=r[0],o=r[1];return zVe(function(){i===null&&o(sN())},[]),v.useEffect(function(){B3===!1&&(B3=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function HVe(e){var t,n,r=Kn(),i=r.dir,o=r.classNames,a=r.styles,s=r.components,u=Qm().displayMonths,l=VVe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),c=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[o.month],h=a.month,p=e.displayIndex===0,m=e.displayIndex===u.length-1,y=!p&&!m;i==="rtl"&&(t=[p,m],m=t[0],p=t[1]),p&&(f.push(o.caption_start),h=Dt(Dt({},h),a.caption_start)),m&&(f.push(o.caption_end),h=Dt(Dt({},h),a.caption_end)),y&&(f.push(o.caption_between),h=Dt(Dt({},h),a.caption_between));var b=(n=s?.Caption)!==null&&n!==void 0?n:XWe;return I.jsxs("div",{className:f.join(" "),style:h,children:[I.jsx(b,{id:l,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),I.jsx(BVe,{id:c,"aria-labelledby":l,displayMonth:e.displayMonth})]},e.displayIndex)}function qVe(e){var t=Kn(),n=t.classNames,r=t.styles;return I.jsx("div",{className:n.months,style:r.months,children:e.children})}function KVe(e){var t,n,r=e.initialProps,i=Kn(),o=x5(),a=Qm(),s=v.useState(!1),u=s[0],l=s[1];v.useEffect(function(){i.initialFocus&&o.focusTarget&&(u||(o.focus(o.focusTarget),l(!0)))},[i.initialFocus,u,o.focus,o.focusTarget,o]);var c=[i.classNames.root,i.className];i.numberOfMonths>1&&c.push(i.classNames.multiple_months),i.showWeekNumber&&c.push(i.classNames.with_weeknumber);var f=Dt(Dt({},i.styles.root),i.style),h=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,y){var b;return Dt(Dt({},m),(b={},b[y]=r[y],b))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:qVe;return I.jsx("div",Dt({className:c.join(" "),style:f,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:I.jsx(p,{children:a.displayMonths.map(function(m,y){return I.jsx(HVe,{displayIndex:y,displayMonth:m},y)})})}))}function GVe(e){var t=e.children,n=yWe(e,["children"]);return I.jsx(LWe,{initialProps:n,children:I.jsx(KWe,{children:I.jsx(PVe,{initialProps:n,children:I.jsx(rVe,{initialProps:n,children:I.jsx(aVe,{initialProps:n,children:I.jsx(pVe,{children:I.jsx(OVe,{children:t})})})})})})})}function ott(e){return I.jsx(GVe,Dt({},e,{children:I.jsx(KVe,{initialProps:e})}))}function YVe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var _5=e=>{const{present:t,children:n}=e,r=ZVe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,XVe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};_5.displayName="Presence";function ZVe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=YVe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Uy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Uy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=Uy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=Uy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Uy(e){return e?.animationName||"none"}function XVe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var S5="Popover",[VG,att]=Di(S5,[zl]),Jm=zl(),[QVe,Zl]=VG(S5),HG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!1}=e,s=Jm(t),u=v.useRef(null),[l,c]=v.useState(!1),[f=!1,h]=Ts({prop:r,defaultProp:i,onChange:o});return I.jsx(kw,{...s,children:I.jsx(QVe,{scope:t,contentId:Lo(),triggerRef:u,open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>c(!0),[]),onCustomAnchorRemove:v.useCallback(()=>c(!1),[]),modal:a,children:n})})};HG.displayName=S5;var qG="PopoverAnchor",JVe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(qG,n),o=Jm(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=i;return v.useEffect(()=>(a(),()=>s()),[a,s]),I.jsx(Dm,{...o,...r,ref:t})});JVe.displayName=qG;var KG="PopoverTrigger",GG=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(KG,n),o=Jm(n),a=Nt(t,i.triggerRef),s=I.jsx(gt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":JG(i.open),...r,ref:a,onClick:Ye(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:I.jsx(Dm,{asChild:!0,...o,children:s})});GG.displayName=KG;var C5="PopoverPortal",[eHe,tHe]=VG(C5,{forceMount:void 0}),YG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=Zl(C5,t);return I.jsx(eHe,{scope:t,forceMount:n,children:I.jsx(_5,{present:n||o.open,children:I.jsx(jh,{asChild:!0,container:i,children:r})})})};YG.displayName=C5;var Oh="PopoverContent",ZG=v.forwardRef((e,t)=>{const n=tHe(Oh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=Zl(Oh,e.__scopePopover);return I.jsx(_5,{present:r||o.open,children:o.modal?I.jsx(nHe,{...i,ref:t}):I.jsx(rHe,{...i,ref:t})})});ZG.displayName=Oh;var nHe=v.forwardRef((e,t)=>{const n=Zl(Oh,e.__scopePopover),r=v.useRef(null),i=Nt(t,r),o=v.useRef(!1);return v.useEffect(()=>{const a=r.current;if(a)return Mm(a)},[]),I.jsx(Tm,{as:Pl,allowPinchZoom:!0,children:I.jsx(XG,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ye(e.onCloseAutoFocus,a=>{a.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ye(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,l=s.button===2||u;o.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:Ye(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),rHe=v.forwardRef((e,t)=>{const n=Zl(Oh,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return I.jsx(XG,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),XG=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:c,...f}=e,h=Zl(Oh,n),p=Jm(n);return Ew(),I.jsx(km,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:c,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),children:I.jsx(Tw,{"data-state":JG(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.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)"}})})})}),QG="PopoverClose",iHe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(QG,n);return I.jsx(gt.button,{type:"button",...r,ref:t,onClick:Ye(e.onClick,()=>i.onOpenChange(!1))})});iHe.displayName=QG;var oHe="PopoverArrow",aHe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Jm(n);return I.jsx(Mw,{...i,...r,ref:t})});aHe.displayName=oHe;function JG(e){return e?"open":"closed"}var stt=HG,utt=GG,ltt=YG,ctt=ZG;function sHe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var ev=e=>{const{present:t,children:n}=e,r=uHe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,lHe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};ev.displayName="Presence";function uHe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=sHe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=zy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=zy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=zy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=zy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function zy(e){return e?.animationName||"none"}function lHe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function cHe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var E5="ScrollArea",[eY,ftt]=Di(E5),[fHe,wa]=eY(E5),tY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...a}=e,[s,u]=v.useState(null),[l,c]=v.useState(null),[f,h]=v.useState(null),[p,m]=v.useState(null),[y,b]=v.useState(null),[w,x]=v.useState(0),[S,O]=v.useState(0),[E,C]=v.useState(!1),[P,M]=v.useState(!1),N=Nt(t,V=>u(V)),B=Em(i);return I.jsx(fHe,{scope:n,type:r,dir:B,scrollHideDelay:o,scrollArea:s,viewport:l,onViewportChange:c,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:b,scrollbarYEnabled:P,onScrollbarYEnabledChange:M,onCornerWidthChange:x,onCornerHeightChange:O,children:I.jsx(gt.div,{dir:B,...a,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});tY.displayName=E5;var nY="ScrollAreaViewport",rY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,a=wa(nY,n),s=v.useRef(null),u=Nt(t,s,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:i}),I.jsx(gt.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,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:r})})]})});rY.displayName=nY;var $s="ScrollAreaScrollbar",dHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wa($s,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,s=e.orientation==="horizontal";return v.useEffect(()=>(s?o(!0):a(!0),()=>{s?o(!1):a(!1)}),[s,o,a]),i.type==="hover"?I.jsx(hHe,{...r,ref:t,forceMount:n}):i.type==="scroll"?I.jsx(pHe,{...r,ref:t,forceMount:n}):i.type==="auto"?I.jsx(iY,{...r,ref:t,forceMount:n}):i.type==="always"?I.jsx(O5,{...r,ref:t}):null});dHe.displayName=$s;var hHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wa($s,e.__scopeScrollArea),[o,a]=v.useState(!1);return v.useEffect(()=>{const s=i.scrollArea;let u=0;if(s){const l=()=>{window.clearTimeout(u),a(!0)},c=()=>{u=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return s.addEventListener("pointerenter",l),s.addEventListener("pointerleave",c),()=>{window.clearTimeout(u),s.removeEventListener("pointerenter",l),s.removeEventListener("pointerleave",c)}}},[i.scrollArea,i.scrollHideDelay]),I.jsx(ev,{present:n||o,children:I.jsx(iY,{"data-state":o?"visible":"hidden",...r,ref:t})})}),pHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wa($s,e.__scopeScrollArea),o=e.orientation==="horizontal",a=I2(()=>u("SCROLL_END"),100),[s,u]=cHe("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 v.useEffect(()=>{if(s==="idle"){const l=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[s,i.scrollHideDelay,u]),v.useEffect(()=>{const l=i.viewport,c=o?"scrollLeft":"scrollTop";if(l){let f=l[c];const h=()=>{const p=l[c];f!==p&&(u("SCROLL"),a()),f=p};return l.addEventListener("scroll",h),()=>l.removeEventListener("scroll",h)}},[i.viewport,o,u,a]),I.jsx(ev,{present:n||s!=="hidden",children:I.jsx(O5,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ye(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ye(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),iY=v.forwardRef((e,t)=>{const n=wa($s,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=v.useState(!1),s=e.orientation==="horizontal",u=I2(()=>{if(n.viewport){const l=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=wa($s,e.__scopeScrollArea),o=v.useRef(null),a=v.useRef(0),[s,u]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=uY(s.viewport,s.content),c={...r,sizes:s,onSizesChange:u,hasThumb:l>0&&l<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function f(h,p){return wHe(h,a.current,s,p)}return n==="horizontal"?I.jsx(gHe,{...c,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const h=i.viewport.scrollLeft,p=uN(h,s,i.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=f(h,i.dir))}}):n==="vertical"?I.jsx(mHe,{...c,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const h=i.viewport.scrollTop,p=uN(h,s);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=f(h))}}):null}),gHe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=wa($s,e.__scopeScrollArea),[a,s]=v.useState(),u=v.useRef(null),l=Nt(t,u,o.onScrollbarXChange);return v.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),I.jsx(aY,{"data-orientation":"horizontal",...i,ref:l,sizes:n,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":$2(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.x),onDragScroll:c=>e.onDragScroll(c.x),onWheelScroll:(c,f)=>{if(o.viewport){const h=o.viewport.scrollLeft+c.deltaX;e.onWheelScroll(h),cY(h,f)&&c.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Ix(a.paddingLeft),paddingEnd:Ix(a.paddingRight)}})}})}),mHe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=wa($s,e.__scopeScrollArea),[a,s]=v.useState(),u=v.useRef(null),l=Nt(t,u,o.onScrollbarYChange);return v.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),I.jsx(aY,{"data-orientation":"vertical",...i,ref:l,sizes:n,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":$2(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.y),onDragScroll:c=>e.onDragScroll(c.y),onWheelScroll:(c,f)=>{if(o.viewport){const h=o.viewport.scrollTop+c.deltaY;e.onWheelScroll(h),cY(h,f)&&c.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Ix(a.paddingTop),paddingEnd:Ix(a.paddingBottom)}})}})}),[vHe,oY]=eY($s),aY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:u,onDragScroll:l,onWheelScroll:c,onResize:f,...h}=e,p=wa($s,n),[m,y]=v.useState(null),b=Nt(t,N=>y(N)),w=v.useRef(null),x=v.useRef(""),S=p.viewport,O=r.content-r.viewport,E=Vr(c),C=Vr(u),P=I2(f,10);function M(N){if(w.current){const B=N.clientX-w.current.left,V=N.clientY-w.current.top;l({x:B,y:V})}}return v.useEffect(()=>{const N=B=>{const V=B.target;m?.contains(V)&&E(B,O)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[S,m,O,E]),v.useEffect(C,[r,C]),Ah(m,P),Ah(p.content,P),I.jsx(vHe,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Vr(o),onThumbPointerUp:Vr(a),onThumbPositionChange:C,onThumbPointerDown:Vr(s),children:I.jsx(gt.div,{...h,ref:b,style:{position:"absolute",...h.style},onPointerDown:Ye(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),w.current=m.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),M(N))}),onPointerMove:Ye(e.onPointerMove,M),onPointerUp:Ye(e.onPointerUp,N=>{const B=N.target;B.hasPointerCapture(N.pointerId)&&B.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),w.current=null})})})}),$x="ScrollAreaThumb",yHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=oY($x,e.__scopeScrollArea);return I.jsx(ev,{present:n||i.hasThumb,children:I.jsx(bHe,{ref:t,...r})})}),bHe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=wa($x,n),a=oY($x,n),{onThumbPositionChange:s}=a,u=Nt(t,f=>a.onThumbChange(f)),l=v.useRef(void 0),c=I2(()=>{l.current&&(l.current(),l.current=void 0)},100);return v.useEffect(()=>{const f=o.viewport;if(f){const h=()=>{if(c(),!l.current){const p=_He(f,s);l.current=p,s()}};return s(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[o.viewport,c,s]),I.jsx(gt.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ye(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),m=f.clientX-p.left,y=f.clientY-p.top;a.onThumbPointerDown({x:m,y})}),onPointerUp:Ye(e.onPointerUp,a.onThumbPointerUp)})});yHe.displayName=$x;var A5="ScrollAreaCorner",sY=v.forwardRef((e,t)=>{const n=wa(A5,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?I.jsx(xHe,{...e,ref:t}):null});sY.displayName=A5;var xHe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=wa(A5,n),[o,a]=v.useState(0),[s,u]=v.useState(0),l=!!(o&&s);return Ah(i.scrollbarX,()=>{const c=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(c),u(c)}),Ah(i.scrollbarY,()=>{const c=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(c),a(c)}),l?I.jsx(gt.div,{...r,ref:t,style:{width:o,height:s,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ix(e){return e?parseInt(e,10):0}function uY(e,t){const n=e/t;return isNaN(n)?0:n}function $2(e){const t=uY(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function wHe(e,t,n,r="ltr"){const i=$2(n),o=i/2,a=t||o,s=i-a,u=n.scrollbar.paddingStart+a,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,c=n.content-n.viewport,f=r==="ltr"?[0,c]:[c*-1,0];return lY([u,l],f)(e)}function uN(e,t,n="ltr"){const r=$2(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,s=o-r,u=n==="ltr"?[0,a]:[a*-1,0],l=S4(e,u);return lY([0,a],[0,s])(l)}function lY(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function cY(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,s=n.top!==o.top;(a||s)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function I2(e,t){const n=Vr(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ah(e,t){const n=Vr(t);On(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var dtt=tY,htt=rY,ptt=sY,P5="Progress",k5=100,[SHe,gtt]=Di(P5),[CHe,EHe]=SHe(P5),fY=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=OHe,...a}=e;(i||i===0)&&!lN(i)&&console.error(AHe(`${i}`,"Progress"));const s=lN(i)?i:k5;r!==null&&!cN(r,s)&&console.error(PHe(`${r}`,"Progress"));const u=cN(r,s)?r:null,l=Nx(u)?o(u,s):void 0;return I.jsx(CHe,{scope:n,value:u,max:s,children:I.jsx(gt.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Nx(u)?u:void 0,"aria-valuetext":l,role:"progressbar","data-state":pY(u,s),"data-value":u??void 0,"data-max":s,...a,ref:t})})});fY.displayName=P5;var dY="ProgressIndicator",hY=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=EHe(dY,n);return I.jsx(gt.div,{"data-state":pY(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});hY.displayName=dY;function OHe(e,t){return`${Math.round(e/t*100)}%`}function pY(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Nx(e){return typeof e=="number"}function lN(e){return Nx(e)&&!isNaN(e)&&e>0}function cN(e,t){return Nx(e)&&!isNaN(e)&&e<=t&&e>=0}function AHe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${k5}\`.`}function PHe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HK(e,t){if(e){if(typeof e=="string")return w4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w4(e,t)}}function tUe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nUe(e){if(Array.isArray(e))return w4(e)}function w4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?a:t&&t.length&&Ke(i)&&Ke(o)?t.slice(i,o+1):[]};function GK(e){return e==="number"?[0,"auto"]:void 0}var _4=function(t,n,r,i){var o=t.graphicalItems,a=t.tooltipAxis,s=k2(n,t);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(u,l){var c,f=(c=l.props.data)!==null&&c!==void 0?c:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(a.dataKey&&!a.allowDuplicatedCategory){var p=f===void 0?s:f;h=Tb(p,a.dataKey,i)}else h=f&&f[r]||s[r];return h?[].concat(Eh(u),[Nq(l,h)]):u},[])},GI=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},a=aUe(o,r),s=t.orderedTooltipTicks,u=t.tooltipAxis,l=t.tooltipTicks,c=u9e(a,s,l,u);if(c>=0&&l){var f=l[c]&&l[c].value,h=_4(t,n,c,f),p=sUe(r,s,c,o);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},uUe=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.layout,f=t.children,h=t.stackOffset,p=Dq(c,o);return r.reduce(function(m,y){var b,w=y.type.defaultProps!==void 0?Se(Se({},y.type.defaultProps),y.props):y.props,x=w.type,S=w.dataKey,O=w.allowDataOverflow,E=w.allowDuplicatedCategory,C=w.scale,P=w.ticks,M=w.includeHidden,N=w[a];if(m[N])return m;var B=k2(t.data,{graphicalItems:i.filter(function(ie){var se,ye=a in ie.props?ie.props[a]:(se=ie.type.defaultProps)===null||se===void 0?void 0:se[a];return ye===N}),dataStartIndex:u,dataEndIndex:l}),V=B.length,W,ee,Z;$Be(w.domain,O,x)&&(W=N6(w.domain,null,O),p&&(x==="number"||C!=="auto")&&(Z=k0(B,S,"category")));var q=GK(x);if(!W||W.length===0){var G,H=(G=w.domain)!==null&&G!==void 0?G:q;if(S){if(W=k0(B,S,x),x==="category"&&p){var j=ZSe(W);E&&j?(ee=W,W=px(0,V)):E||(W=_$(H,W,y).reduce(function(ie,se){return ie.indexOf(se)>=0?ie:[].concat(Eh(ie),[se])},[]))}else if(x==="category")E?W=W.filter(function(ie){return ie!==""&&!Vt(ie)}):W=_$(H,W,y).reduce(function(ie,se){return ie.indexOf(se)>=0||se===""||Vt(se)?ie:[].concat(Eh(ie),[se])},[]);else if(x==="number"){var K=h9e(B,i.filter(function(ie){var se,ye,we=a in ie.props?ie.props[a]:(se=ie.type.defaultProps)===null||se===void 0?void 0:se[a],He="hide"in ie.props?ie.props.hide:(ye=ie.type.defaultProps)===null||ye===void 0?void 0:ye.hide;return we===N&&(M||!He)}),S,o,c);K&&(W=K)}p&&(x==="number"||C!=="auto")&&(Z=k0(B,S,"category"))}else p?W=px(0,V):s&&s[N]&&s[N].hasStack&&x==="number"?W=h==="expand"?[0,1]:Iq(s[N].stackGroups,u,l):W=Rq(B,i.filter(function(ie){var se=a in ie.props?ie.props[a]:ie.type.defaultProps[a],ye="hide"in ie.props?ie.props.hide:ie.type.defaultProps.hide;return se===N&&(M||!ye)}),x,c,!0);if(x==="number")W=b4(f,W,N,o,P),H&&(W=N6(H,W,O));else if(x==="category"&&H){var Y=H,re=W.every(function(ie){return Y.indexOf(ie)>=0});re&&(W=Y)}}return Se(Se({},m),{},kt({},N,Se(Se({},w),{},{axisType:o,domain:W,categoricalDomain:Z,duplicateDomain:ee,originalDomain:(b=w.domain)!==null&&b!==void 0?b:q,isCategorical:p,layout:c})))},{})},lUe=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.layout,f=t.children,h=k2(t.data,{graphicalItems:r,dataStartIndex:u,dataEndIndex:l}),p=h.length,m=Dq(c,o),y=-1;return r.reduce(function(b,w){var x=w.type.defaultProps!==void 0?Se(Se({},w.type.defaultProps),w.props):w.props,S=x[a],O=GK("number");if(!b[S]){y++;var E;return m?E=px(0,p):s&&s[S]&&s[S].hasStack?(E=Iq(s[S].stackGroups,u,l),E=b4(f,E,S,o)):(E=N6(O,Rq(h,r.filter(function(C){var P,M,N=a in C.props?C.props[a]:(P=C.type.defaultProps)===null||P===void 0?void 0:P[a],B="hide"in C.props?C.props.hide:(M=C.type.defaultProps)===null||M===void 0?void 0:M.hide;return N===S&&!B}),"number",c),i.defaultProps.allowDataOverflow),E=b4(f,E,S,o)),Se(Se({},b),{},kt({},S,Se(Se({axisType:o},i.defaultProps),{},{hide:!0,orientation:ha(iUe,"".concat(o,".").concat(y%2),null),domain:E,originalDomain:O,isCategorical:m,layout:c})))}return b},{})},cUe=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,u=n.dataStartIndex,l=n.dataEndIndex,c=t.children,f="".concat(i,"Id"),h=ho(c,o),p={};return h.length?p=uUe(t,{axes:h,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:u,dataEndIndex:l}):a&&a.length&&(p=lUe(t,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:u,dataEndIndex:l})),p},fUe=function(t){var n=rl(t),r=su(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:SP(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:ox(n,r)}},YI=function(t){var n=t.children,r=t.defaultShowTooltip,i=ko(n,dh),o=0,a=0;return t.data&&t.data.length!==0&&(a=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},dUe=function(t){return!t||!t.length?!1:t.some(function(n){var r=fu(n&&n.type);return r&&r.indexOf("Bar")>=0})},ZI=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},hUe=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,a=o===void 0?{}:o,s=t.yAxisMap,u=s===void 0?{}:s,l=r.width,c=r.height,f=r.children,h=r.margin||{},p=ko(f,dh),m=ko(f,Id),y=Object.keys(u).reduce(function(E,C){var P=u[C],M=P.orientation;return!P.mirror&&!P.hide?Se(Se({},E),{},kt({},M,E[M]+P.width)):E},{left:h.left||0,right:h.right||0}),b=Object.keys(a).reduce(function(E,C){var P=a[C],M=P.orientation;return!P.mirror&&!P.hide?Se(Se({},E),{},kt({},M,ha(E,"".concat(M))+P.height)):E},{top:h.top||0,bottom:h.bottom||0}),w=Se(Se({},b),y),x=w.bottom;p&&(w.bottom+=p.props.height||dh.defaultProps.height),m&&n&&(w=f9e(w,i,r,n));var S=l-w.left-w.right,O=c-w.top-w.bottom;return Se(Se({brushBottom:x},w),{},{width:Math.max(S,0),height:Math.max(O,0)})},pUe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},gUe=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,a=t.validateTooltipEventTypes,s=a===void 0?["axis"]:a,u=t.axisComponents,l=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,h=function(w,x){var S=x.graphicalItems,O=x.stackGroups,E=x.offset,C=x.updateId,P=x.dataStartIndex,M=x.dataEndIndex,N=w.barSize,B=w.layout,V=w.barGap,W=w.barCategoryGap,ee=w.maxBarSize,Z=ZI(B),q=Z.numericAxisName,G=Z.cateAxisName,H=dUe(S),j=[];return S.forEach(function(K,Y){var re=k2(w.data,{graphicalItems:[K],dataStartIndex:P,dataEndIndex:M}),ie=K.type.defaultProps!==void 0?Se(Se({},K.type.defaultProps),K.props):K.props,se=ie.dataKey,ye=ie.maxBarSize,we=ie["".concat(q,"Id")],He=ie["".concat(G,"Id")],Ee={},it=u.reduce(function(Ue,Fe){var Ae=x["".concat(Fe.axisType,"Map")],tt=ie["".concat(Fe.axisType,"Id")];Ae&&Ae[tt]||Fe.axisType==="zAxis"||of();var mt=Ae[tt];return Se(Se({},Ue),{},kt(kt({},Fe.axisType,mt),"".concat(Fe.axisType,"Ticks"),su(mt)))},Ee),ke=it[G],Le=it["".concat(G,"Ticks")],De=O&&O[we]&&O[we].hasStack&&E9e(K,O[we].stackGroups),me=fu(K.type).indexOf("Bar")>=0,yt=ox(ke,Le),lt=[],Ft=H&&l9e({barSize:N,stackGroups:O,totalSize:pUe(it,G)});if(me){var yn,nn,ne=Vt(ye)?ee:ye,de=(yn=(nn=ox(ke,Le,!0))!==null&&nn!==void 0?nn:ne)!==null&&yn!==void 0?yn:0;lt=c9e({barGap:V,barCategoryGap:W,bandSize:de!==yt?de:yt,sizeList:Ft[He],maxBarSize:ne}),de!==yt&&(lt=lt.map(function(Ue){return Se(Se({},Ue),{},{position:Se(Se({},Ue.position),{},{offset:Ue.position.offset-de/2})})}))}var ge=K&&K.type&&K.type.getComposedData;ge&&j.push({props:Se(Se({},ge(Se(Se({},it),{},{displayedData:re,props:w,dataKey:se,item:K,bandSize:yt,barPosition:lt,offset:E,stackedData:De,layout:B,dataStartIndex:P,dataEndIndex:M}))),{},kt(kt(kt({key:K.key||"item-".concat(Y)},q,it[q]),G,it[G]),"animationId",C)),childIndex:u3e(K,w.children),item:K})}),j},p=function(w,x){var S=w.props,O=w.dataStartIndex,E=w.dataEndIndex,C=w.updateId;if(!m9({props:S}))return null;var P=S.children,M=S.layout,N=S.stackOffset,B=S.data,V=S.reverseStackOrder,W=ZI(M),ee=W.numericAxisName,Z=W.cateAxisName,q=ho(P,r),G=_9e(B,q,"".concat(ee,"Id"),"".concat(Z,"Id"),N,V),H=u.reduce(function(ie,se){var ye="".concat(se.axisType,"Map");return Se(Se({},ie),{},kt({},ye,cUe(S,Se(Se({},se),{},{graphicalItems:q,stackGroups:se.axisType===ee&&G,dataStartIndex:O,dataEndIndex:E}))))},{}),j=hUe(Se(Se({},H),{},{props:S,graphicalItems:q}),x?.legendBBox);Object.keys(H).forEach(function(ie){H[ie]=c(S,H[ie],j,ie.replace("Map",""),n)});var K=H["".concat(Z,"Map")],Y=fUe(K),re=h(S,Se(Se({},H),{},{dataStartIndex:O,dataEndIndex:E,updateId:C,graphicalItems:q,stackGroups:G,offset:j}));return Se(Se({formattedGraphicalItems:re,graphicalItems:q,offset:j,stackGroups:G},Y),H)},m=function(b){function w(x){var S,O,E;return KBe(this,w),E=ZBe(this,w,[x]),kt(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),kt(E,"accessibilityManager",new DBe),kt(E,"handleLegendBBoxUpdate",function(C){if(C){var P=E.state,M=P.dataStartIndex,N=P.dataEndIndex,B=P.updateId;E.setState(Se({legendBBox:C},p({props:E.props,dataStartIndex:M,dataEndIndex:N,updateId:B},Se(Se({},E.state),{},{legendBBox:C}))))}}),kt(E,"handleReceiveSyncEvent",function(C,P,M){if(E.props.syncId===C){if(M===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(P)}}),kt(E,"handleBrushChange",function(C){var P=C.startIndex,M=C.endIndex;if(P!==E.state.dataStartIndex||M!==E.state.dataEndIndex){var N=E.state.updateId;E.setState(function(){return Se({dataStartIndex:P,dataEndIndex:M},p({props:E.props,dataStartIndex:P,dataEndIndex:M,updateId:N},E.state))}),E.triggerSyncEvent({dataStartIndex:P,dataEndIndex:M})}}),kt(E,"handleMouseEnter",function(C){var P=E.getMouseInfo(C);if(P){var M=Se(Se({},P),{},{isTooltipActive:!0});E.setState(M),E.triggerSyncEvent(M);var N=E.props.onMouseEnter;qt(N)&&N(M,C)}}),kt(E,"triggeredAfterMouseMove",function(C){var P=E.getMouseInfo(C),M=P?Se(Se({},P),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(M),E.triggerSyncEvent(M);var N=E.props.onMouseMove;qt(N)&&N(M,C)}),kt(E,"handleItemMouseEnter",function(C){E.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),kt(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),kt(E,"handleMouseMove",function(C){C.persist(),E.throttleTriggeredAfterMouseMove(C)}),kt(E,"handleMouseLeave",function(C){E.throttleTriggeredAfterMouseMove.cancel();var P={isTooltipActive:!1};E.setState(P),E.triggerSyncEvent(P);var M=E.props.onMouseLeave;qt(M)&&M(P,C)}),kt(E,"handleOuterEvent",function(C){var P=s3e(C),M=ha(E.props,"".concat(P));if(P&&qt(M)){var N,B;/.*touch.*/i.test(P)?B=E.getMouseInfo(C.changedTouches[0]):B=E.getMouseInfo(C),M((N=B)!==null&&N!==void 0?N:{},C)}}),kt(E,"handleClick",function(C){var P=E.getMouseInfo(C);if(P){var M=Se(Se({},P),{},{isTooltipActive:!0});E.setState(M),E.triggerSyncEvent(M);var N=E.props.onClick;qt(N)&&N(M,C)}}),kt(E,"handleMouseDown",function(C){var P=E.props.onMouseDown;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),kt(E,"handleMouseUp",function(C){var P=E.props.onMouseUp;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),kt(E,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),kt(E,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.handleMouseDown(C.changedTouches[0])}),kt(E,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.handleMouseUp(C.changedTouches[0])}),kt(E,"handleDoubleClick",function(C){var P=E.props.onDoubleClick;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),kt(E,"handleContextMenu",function(C){var P=E.props.onContextMenu;if(qt(P)){var M=E.getMouseInfo(C);P(M,C)}}),kt(E,"triggerSyncEvent",function(C){E.props.syncId!==void 0&&R3.emit(D3,E.props.syncId,C,E.eventEmitterSymbol)}),kt(E,"applySyncEvent",function(C){var P=E.props,M=P.layout,N=P.syncMethod,B=E.state.updateId,V=C.dataStartIndex,W=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)E.setState(Se({dataStartIndex:V,dataEndIndex:W},p({props:E.props,dataStartIndex:V,dataEndIndex:W,updateId:B},E.state)));else if(C.activeTooltipIndex!==void 0){var ee=C.chartX,Z=C.chartY,q=C.activeTooltipIndex,G=E.state,H=G.offset,j=G.tooltipTicks;if(!H)return;if(typeof N=="function")q=N(j,C);else if(N==="value"){q=-1;for(var K=0;K=0){var De,me;if(ee.dataKey&&!ee.allowDuplicatedCategory){var yt=typeof ee.dataKey=="function"?Le:"payload.".concat(ee.dataKey.toString());De=Tb(K,yt,q),me=Y&&re&&Tb(re,yt,q)}else De=K?.[Z],me=Y&&re&&re[Z];if(He||we){var lt=C.props.activeIndex!==void 0?C.props.activeIndex:Z;return[v.cloneElement(C,Se(Se(Se({},N.props),it),{},{activeIndex:lt})),null,null]}if(!Vt(De))return[ke].concat(Eh(E.renderActivePoints({item:N,activePoint:De,basePoint:me,childIndex:Z,isRange:Y})))}else{var Ft,yn=(Ft=E.getItemByXY(E.state.activeCoordinate))!==null&&Ft!==void 0?Ft:{graphicalItem:ke},nn=yn.graphicalItem,ne=nn.item,de=ne===void 0?C:ne,ge=nn.childIndex,Ue=Se(Se(Se({},N.props),it),{},{activeIndex:ge});return[v.cloneElement(de,Ue),null,null]}return Y?[ke,null,null]:[ke,null]}),kt(E,"renderCustomized",function(C,P,M){return v.cloneElement(C,Se(Se({key:"recharts-customized-".concat(M)},E.props),E.state))}),kt(E,"renderMap",{CartesianGrid:{handler:By,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:By},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:By},YAxis:{handler:By},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((S=x.id)!==null&&S!==void 0?S:yf("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=TH(E.triggeredAfterMouseMove,(O=x.throttleDelay)!==null&&O!==void 0?O:1e3/60),E.state={},E}return JBe(w,b),YBe(w,[{key:"componentDidMount",value:function(){var S,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var S=this.props,O=S.children,E=S.data,C=S.height,P=S.layout,M=ko(O,Js);if(M){var N=M.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var B=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,V=_4(this.state,E,N,B),W=this.state.tooltipTicks[N].coordinate,ee=(this.state.offset.top+C)/2,Z=P==="horizontal",q=Z?{x:W,y:ee}:{y:W,x:ee},G=this.state.formattedGraphicalItems.find(function(j){var K=j.item;return K.type.name==="Scatter"});G&&(q=Se(Se({},q),G.props.points[N].tooltipPosition),V=G.props.points[N].tooltipPayload);var H={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:B,activePayload:V,activeCoordinate:q};this.setState(H),this.renderCursor(M),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(S,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==S.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==S.margin){var E,C;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(S){XE([ko(S.children,Js)],[ko(this.props.children,Js)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var S=ko(this.props.children,Js);if(S&&typeof S.props.shared=="boolean"){var O=S.props.shared?"axis":"item";return s.indexOf(O)>=0?O:o}return o}},{key:"getMouseInfo",value:function(S){if(!this.container)return null;var O=this.container,E=O.getBoundingClientRect(),C=$ke(E),P={chartX:Math.round(S.pageX-C.left),chartY:Math.round(S.pageY-C.top)},M=E.width/O.offsetWidth||1,N=this.inRange(P.chartX,P.chartY,M);if(!N)return null;var B=this.state,V=B.xAxisMap,W=B.yAxisMap,ee=this.getTooltipEventType();if(ee!=="axis"&&V&&W){var Z=rl(V).scale,q=rl(W).scale,G=Z&&Z.invert?Z.invert(P.chartX):null,H=q&&q.invert?q.invert(P.chartY):null;return Se(Se({},P),{},{xValue:G,yValue:H})}var j=GI(this.state,this.props.data,this.props.layout,N);return j?Se(Se({},P),j):null}},{key:"inRange",value:function(S,O){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,P=S/E,M=O/E;if(C==="horizontal"||C==="vertical"){var N=this.state.offset,B=P>=N.left&&P<=N.left+N.width&&M>=N.top&&M<=N.top+N.height;return B?{x:P,y:M}:null}var V=this.state,W=V.angleAxisMap,ee=V.radiusAxisMap;if(W&&ee){var Z=rl(W);return E$({x:P,y:M},Z)}return null}},{key:"parseEventsOfWrapper",value:function(){var S=this.props.children,O=this.getTooltipEventType(),E=ko(S,Js),C={};E&&O==="axis"&&(E.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var P=Mb(this.props,this.handleOuterEvent);return Se(Se({},P),C)}},{key:"addListener",value:function(){R3.on(D3,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){R3.removeListener(D3,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(S,O,E){for(var C=this.state.formattedGraphicalItems,P=0,M=C.length;P(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var vUe=[" ","Enter","ArrowUp","ArrowDown"],yUe=[" ","Enter"],Gm="Select",[T2,M2,bUe]=oA(Gm),[op,zet]=Di(Gm,[bUe,zl]),R2=zl(),[xUe,Gl]=op(Gm),[wUe,_Ue]=op(Gm),YK=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:u,dir:l,name:c,autoComplete:f,disabled:h,required:p,form:m}=e,y=R2(t),[b,w]=v.useState(null),[x,S]=v.useState(null),[O,E]=v.useState(!1),C=Em(l),[P=!1,M]=Ts({prop:r,defaultProp:i,onChange:o}),[N,B]=Ts({prop:a,defaultProp:s,onChange:u}),V=v.useRef(null),W=b?m||!!b.closest("form"):!0,[ee,Z]=v.useState(new Set),q=Array.from(ee).map(G=>G.props.value).join(";");return I.jsx(kw,{...y,children:I.jsxs(xUe,{required:p,scope:t,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:O,onValueNodeHasChildrenChange:E,contentId:Lo(),value:N,onValueChange:B,open:P,onOpenChange:M,dir:C,triggerPointerDownPosRef:V,disabled:h,children:[I.jsx(T2.Provider,{scope:t,children:I.jsx(wUe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(G=>{Z(H=>new Set(H).add(G))},[]),onNativeOptionRemove:v.useCallback(G=>{Z(H=>{const j=new Set(H);return j.delete(G),j})},[]),children:n})}),W?I.jsxs(wG,{"aria-hidden":!0,required:p,tabIndex:-1,name:c,autoComplete:f,value:N,onChange:G=>B(G.target.value),disabled:h,form:m,children:[N===void 0?I.jsx("option",{value:""}):null,Array.from(ee)]},q):null]})})};YK.displayName=Gm;var ZK="SelectTrigger",XK=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=R2(n),a=Gl(ZK,n),s=a.disabled||r,u=Nt(t,a.onTriggerChange),l=M2(n),c=v.useRef("touch"),[f,h,p]=_G(y=>{const b=l().filter(S=>!S.disabled),w=b.find(S=>S.value===a.value),x=SG(b,y,w);x!==void 0&&a.onValueChange(x.value)}),m=y=>{s||(a.onOpenChange(!0),p()),y&&(a.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return I.jsx(Dm,{asChild:!0,...o,children:I.jsx(gt.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:s,"data-disabled":s?"":void 0,"data-placeholder":xG(a.value)?"":void 0,...i,ref:u,onClick:Ye(i.onClick,y=>{y.currentTarget.focus(),c.current!=="mouse"&&m(y)}),onPointerDown:Ye(i.onPointerDown,y=>{c.current=y.pointerType;const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(m(y),y.preventDefault())}),onKeyDown:Ye(i.onKeyDown,y=>{const b=f.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&h(y.key),!(b&&y.key===" ")&&vUe.includes(y.key)&&(m(),y.preventDefault())})})})});XK.displayName=ZK;var QK="SelectValue",JK=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,u=Gl(QK,n),{onValueNodeHasChildrenChange:l}=u,c=o!==void 0,f=Nt(t,u.onValueNodeChange);return On(()=>{l(c)},[l,c]),I.jsx(gt.span,{...s,ref:f,style:{pointerEvents:"none"},children:xG(u.value)?I.jsx(I.Fragment,{children:a}):o})});JK.displayName=QK;var SUe="SelectIcon",eG=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return I.jsx(gt.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});eG.displayName=SUe;var CUe="SelectPortal",tG=e=>I.jsx(jh,{asChild:!0,...e});tG.displayName=CUe;var sf="SelectContent",nG=v.forwardRef((e,t)=>{const n=Gl(sf,e.__scopeSelect),[r,i]=v.useState();if(On(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Au.createPortal(I.jsx(rG,{scope:e.__scopeSelect,children:I.jsx(T2.Slot,{scope:e.__scopeSelect,children:I.jsx("div",{children:e.children})})}),o):null}return I.jsx(iG,{...e,ref:t})});nG.displayName=sf;var ka=10,[rG,Yl]=op(sf),EUe="SelectContentImpl",iG=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:u,align:l,alignOffset:c,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:y,avoidCollisions:b,...w}=e,x=Gl(sf,n),[S,O]=v.useState(null),[E,C]=v.useState(null),P=Nt(t,Ee=>O(Ee)),[M,N]=v.useState(null),[B,V]=v.useState(null),W=M2(n),[ee,Z]=v.useState(!1),q=v.useRef(!1);v.useEffect(()=>{if(S)return Mm(S)},[S]),Ew();const G=v.useCallback(Ee=>{const[it,...ke]=W().map(me=>me.ref.current),[Le]=ke.slice(-1),De=document.activeElement;for(const me of Ee)if(me===De||(me?.scrollIntoView({block:"nearest"}),me===it&&E&&(E.scrollTop=0),me===Le&&E&&(E.scrollTop=E.scrollHeight),me?.focus(),document.activeElement!==De))return},[W,E]),H=v.useCallback(()=>G([M,S]),[G,M,S]);v.useEffect(()=>{ee&&H()},[ee,H]);const{onOpenChange:j,triggerPointerDownPosRef:K}=x;v.useEffect(()=>{if(S){let Ee={x:0,y:0};const it=Le=>{Ee={x:Math.abs(Math.round(Le.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(Le.pageY)-(K.current?.y??0))}},ke=Le=>{Ee.x<=10&&Ee.y<=10?Le.preventDefault():S.contains(Le.target)||j(!1),document.removeEventListener("pointermove",it),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",it),document.addEventListener("pointerup",ke,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",it),document.removeEventListener("pointerup",ke,{capture:!0})}}},[S,j,K]),v.useEffect(()=>{const Ee=()=>j(!1);return window.addEventListener("blur",Ee),window.addEventListener("resize",Ee),()=>{window.removeEventListener("blur",Ee),window.removeEventListener("resize",Ee)}},[j]);const[Y,re]=_G(Ee=>{const it=W().filter(De=>!De.disabled),ke=it.find(De=>De.ref.current===document.activeElement),Le=SG(it,Ee,ke);Le&&setTimeout(()=>Le.ref.current.focus())}),ie=v.useCallback((Ee,it,ke)=>{const Le=!q.current&&!ke;(x.value!==void 0&&x.value===it||Le)&&(N(Ee),Le&&(q.current=!0))},[x.value]),se=v.useCallback(()=>S?.focus(),[S]),ye=v.useCallback((Ee,it,ke)=>{const Le=!q.current&&!ke;(x.value!==void 0&&x.value===it||Le)&&V(Ee)},[x.value]),we=r==="popper"?C4:oG,He=we===C4?{side:s,sideOffset:u,align:l,alignOffset:c,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:m,hideWhenDetached:y,avoidCollisions:b}:{};return I.jsx(rG,{scope:n,content:S,viewport:E,onViewportChange:C,itemRefCallback:ie,selectedItem:M,onItemLeave:se,itemTextRefCallback:ye,focusSelectedItem:H,selectedItemText:B,position:r,isPositioned:ee,searchRef:Y,children:I.jsx(Tm,{as:Pl,allowPinchZoom:!0,children:I.jsx(km,{asChild:!0,trapped:x.open,onMountAutoFocus:Ee=>{Ee.preventDefault()},onUnmountAutoFocus:Ye(i,Ee=>{x.trigger?.focus({preventScroll:!0}),Ee.preventDefault()}),children:I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Ee=>Ee.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:I.jsx(we,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:Ee=>Ee.preventDefault(),...w,...He,onPlaced:()=>Z(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Ye(w.onKeyDown,Ee=>{const it=Ee.ctrlKey||Ee.altKey||Ee.metaKey;if(Ee.key==="Tab"&&Ee.preventDefault(),!it&&Ee.key.length===1&&re(Ee.key),["ArrowUp","ArrowDown","Home","End"].includes(Ee.key)){let Le=W().filter(De=>!De.disabled).map(De=>De.ref.current);if(["ArrowUp","End"].includes(Ee.key)&&(Le=Le.slice().reverse()),["ArrowUp","ArrowDown"].includes(Ee.key)){const De=Ee.target,me=Le.indexOf(De);Le=Le.slice(me+1)}setTimeout(()=>G(Le)),Ee.preventDefault()}})})})})})})});iG.displayName=EUe;var OUe="SelectItemAlignedPosition",oG=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Gl(sf,n),a=Yl(sf,n),[s,u]=v.useState(null),[l,c]=v.useState(null),f=Nt(t,P=>c(P)),h=M2(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:w,focusSelectedItem:x}=a,S=v.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&l&&y&&b&&w){const P=o.trigger.getBoundingClientRect(),M=l.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),B=w.getBoundingClientRect();if(o.dir!=="rtl"){const De=B.left-M.left,me=N.left-De,yt=P.left-me,lt=P.width+yt,Ft=Math.max(lt,M.width),yn=window.innerWidth-ka,nn=S4(me,[ka,Math.max(ka,yn-Ft)]);s.style.minWidth=lt+"px",s.style.left=nn+"px"}else{const De=M.right-B.right,me=window.innerWidth-N.right-De,yt=window.innerWidth-P.right-me,lt=P.width+yt,Ft=Math.max(lt,M.width),yn=window.innerWidth-ka,nn=S4(me,[ka,Math.max(ka,yn-Ft)]);s.style.minWidth=lt+"px",s.style.right=nn+"px"}const V=h(),W=window.innerHeight-ka*2,ee=y.scrollHeight,Z=window.getComputedStyle(l),q=parseInt(Z.borderTopWidth,10),G=parseInt(Z.paddingTop,10),H=parseInt(Z.borderBottomWidth,10),j=parseInt(Z.paddingBottom,10),K=q+G+ee+j+H,Y=Math.min(b.offsetHeight*5,K),re=window.getComputedStyle(y),ie=parseInt(re.paddingTop,10),se=parseInt(re.paddingBottom,10),ye=P.top+P.height/2-ka,we=W-ye,He=b.offsetHeight/2,Ee=b.offsetTop+He,it=q+G+Ee,ke=K-it;if(it<=ye){const De=V.length>0&&b===V[V.length-1].ref.current;s.style.bottom="0px";const me=l.clientHeight-y.offsetTop-y.offsetHeight,yt=Math.max(we,He+(De?se:0)+me+H),lt=it+yt;s.style.height=lt+"px"}else{const De=V.length>0&&b===V[0].ref.current;s.style.top="0px";const yt=Math.max(ye,q+y.offsetTop+(De?ie:0)+He)+ke;s.style.height=yt+"px",y.scrollTop=it-ye+y.offsetTop}s.style.margin=`${ka}px 0`,s.style.minHeight=Y+"px",s.style.maxHeight=W+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[h,o.trigger,o.valueNode,s,l,y,b,w,o.dir,r]);On(()=>S(),[S]);const[O,E]=v.useState();On(()=>{l&&E(window.getComputedStyle(l).zIndex)},[l]);const C=v.useCallback(P=>{P&&m.current===!0&&(S(),x?.(),m.current=!1)},[S,x]);return I.jsx(PUe,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:I.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:I.jsx(gt.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});oG.displayName=OUe;var AUe="SelectPopperPosition",C4=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ka,...o}=e,a=R2(n);return I.jsx(Tw,{...a,...o,ref:t,align:r,collisionPadding:i,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)"}})});C4.displayName=AUe;var[PUe,l5]=op(sf,{}),E4="SelectViewport",aG=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Yl(E4,n),a=l5(E4,n),s=Nt(t,o.onViewportChange),u=v.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:r}),I.jsx(T2.Slot,{scope:n,children:I.jsx(gt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ye(i.onScroll,l=>{const c=l.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=a;if(h?.current&&f){const p=Math.abs(u.current-c.scrollTop);if(p>0){const m=window.innerHeight-ka*2,y=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),w=Math.max(y,b);if(w0?O:0,f.style.justifyContent="flex-end")}}}u.current=c.scrollTop})})})]})});aG.displayName=E4;var sG="SelectGroup",[kUe,TUe]=op(sG),uG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Lo();return I.jsx(kUe,{scope:n,id:i,children:I.jsx(gt.div,{role:"group","aria-labelledby":i,...r,ref:t})})});uG.displayName=sG;var lG="SelectLabel",cG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=TUe(lG,n);return I.jsx(gt.div,{id:i.id,...r,ref:t})});cG.displayName=lG;var Mx="SelectItem",[MUe,fG]=op(Mx),dG=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=Gl(Mx,n),u=Yl(Mx,n),l=s.value===r,[c,f]=v.useState(o??""),[h,p]=v.useState(!1),m=Nt(t,x=>u.itemRefCallback?.(x,r,i)),y=Lo(),b=v.useRef("touch"),w=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")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(MUe,{scope:n,value:r,disabled:i,textId:y,isSelected:l,onItemTextChange:v.useCallback(x=>{f(S=>S||(x?.textContent??"").trim())},[]),children:I.jsx(T2.ItemSlot,{scope:n,value:r,disabled:i,textValue:c,children:I.jsx(gt.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":l&&h,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:m,onFocus:Ye(a.onFocus,()=>p(!0)),onBlur:Ye(a.onBlur,()=>p(!1)),onClick:Ye(a.onClick,()=>{b.current!=="mouse"&&w()}),onPointerUp:Ye(a.onPointerUp,()=>{b.current==="mouse"&&w()}),onPointerDown:Ye(a.onPointerDown,x=>{b.current=x.pointerType}),onPointerMove:Ye(a.onPointerMove,x=>{b.current=x.pointerType,i?u.onItemLeave?.():b.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ye(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Ye(a.onKeyDown,x=>{u.searchRef?.current!==""&&x.key===" "||(yUe.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})})})})});dG.displayName=Mx;var d0="SelectItemText",hG=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Gl(d0,n),s=Yl(d0,n),u=fG(d0,n),l=_Ue(d0,n),[c,f]=v.useState(null),h=Nt(t,w=>f(w),u.onItemTextChange,w=>s.itemTextRefCallback?.(w,u.value,u.disabled)),p=c?.textContent,m=v.useMemo(()=>I.jsx("option",{value:u.value,disabled:u.disabled,children:p},u.value),[u.disabled,u.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=l;return On(()=>(y(m),()=>b(m)),[y,b,m]),I.jsxs(I.Fragment,{children:[I.jsx(gt.span,{id:u.textId,...o,ref:h}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Au.createPortal(o.children,a.valueNode):null]})});hG.displayName=d0;var pG="SelectItemIndicator",gG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return fG(pG,n).isSelected?I.jsx(gt.span,{"aria-hidden":!0,...r,ref:t}):null});gG.displayName=pG;var O4="SelectScrollUpButton",mG=v.forwardRef((e,t)=>{const n=Yl(O4,e.__scopeSelect),r=l5(O4,e.__scopeSelect),[i,o]=v.useState(!1),a=Nt(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=u.scrollTop>0;o(l)};const u=n.viewport;return s(),u.addEventListener("scroll",s),()=>u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?I.jsx(yG,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop-u.offsetHeight)}}):null});mG.displayName=O4;var A4="SelectScrollDownButton",vG=v.forwardRef((e,t)=>{const n=Yl(A4,e.__scopeSelect),r=l5(A4,e.__scopeSelect),[i,o]=v.useState(!1),a=Nt(t,r.onScrollButtonChange);return On(()=>{if(n.viewport&&n.isPositioned){let s=function(){const l=u.scrollHeight-u.clientHeight,c=Math.ceil(u.scrollTop)u.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?I.jsx(yG,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:u}=n;s&&u&&(s.scrollTop=s.scrollTop+u.offsetHeight)}}):null});vG.displayName=A4;var yG=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Yl("SelectScrollButton",n),a=v.useRef(null),s=M2(n),u=v.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return v.useEffect(()=>()=>u(),[u]),On(()=>{s().find(c=>c.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),I.jsx(gt.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ye(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Ye(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Ye(i.onPointerLeave,()=>{u()})})}),RUe="SelectSeparator",bG=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return I.jsx(gt.div,{"aria-hidden":!0,...r,ref:t})});bG.displayName=RUe;var P4="SelectArrow",DUe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=R2(n),o=Gl(P4,n),a=Yl(P4,n);return o.open&&a.position==="popper"?I.jsx(Mw,{...i,...r,ref:t}):null});DUe.displayName=P4;function xG(e){return e===""||e===void 0}var wG=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=v.useRef(null),o=Nt(t,i),a=mUe(n);return v.useEffect(()=>{const s=i.current,u=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==n&&c){const f=new Event("change",{bubbles:!0});c.call(s,n),s.dispatchEvent(f)}},[a,n]),I.jsx(KA,{asChild:!0,children:I.jsx("select",{...r,ref:o,defaultValue:n})})});wG.displayName="BubbleSelect";function _G(e){const t=Vr(e),n=v.useRef(""),r=v.useRef(0),i=v.useCallback(a=>{const s=n.current+a;t(s),function u(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(s)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function SG(e,t,n){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=$Ue(e,Math.max(o,0));i.length===1&&(a=a.filter(l=>l!==n));const u=a.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function $Ue(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Wet=YK,Vet=XK,Het=JK,qet=eG,Ket=tG,Get=nG,Yet=aG,Zet=uG,Xet=cG,Qet=dG,Jet=hG,ett=gG,ttt=mG,ntt=vG,rtt=bG;const c5=6048e5,IUe=864e5,XI=Symbol.for("constructDateFrom");function ii(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&XI in e?e[XI](t):e instanceof Date?new e.constructor(t):new Date(t)}function Dn(e,t){return ii(t||e,e)}function Ui(e,t,n){const r=Dn(e,n?.in);return isNaN(t)?ii(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Xa(e,t,n){const r=Dn(e,n?.in);if(isNaN(t))return ii(n?.in||e,NaN);if(!t)return r;const i=r.getDate(),o=ii(n?.in||e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const a=o.getDate();return i>=a?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}let NUe={};function Ym(){return NUe}function ya(e,t){const n=Ym(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Dn(e,t?.in),o=i.getDay(),a=(o=o.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Rx(e){const t=Dn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function _f(e,...t){const n=ii.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function lf(e,t){const n=Dn(e,t?.in);return n.setHours(0,0,0,0),n}function bs(e,t,n){const[r,i]=_f(n?.in,e,t),o=lf(r),a=lf(i),s=+o-Rx(o),u=+a-Rx(a);return Math.round((s-u)/IUe)}function LUe(e,t){const n=CG(e,t),r=ii(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),uf(r)}function k4(e,t,n){return Ui(e,t*7,n)}function FUe(e,t,n){return Xa(e,t*12,n)}function jUe(e,t){let n,r=t?.in;return e.forEach(i=>{!r&&typeof i=="object"&&(r=ii.bind(null,i));const o=Dn(i,r);(!n||n{!r&&typeof i=="object"&&(r=ii.bind(null,i));const o=Dn(i,r);(!n||n>o||isNaN(+o))&&(n=o)}),ii(r,n||NaN)}function so(e,t,n){const[r,i]=_f(n?.in,e,t);return+lf(r)==+lf(i)}function f5(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function UUe(e){return!(!f5(e)&&typeof e!="number"||isNaN(+Dn(e)))}function sm(e,t,n){const[r,i]=_f(n?.in,e,t),o=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return o*12+a}function zUe(e,t,n){const[r,i]=_f(n?.in,e,t),o=ya(r,n),a=ya(i,n),s=+o-Rx(o),u=+a-Rx(a);return Math.round((s-u)/c5)}function d5(e,t){const n=Dn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function po(e,t){const n=Dn(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function EG(e,t){const n=Dn(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function h5(e,t){const n=Ym(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Dn(e,t?.in),o=i.getDay(),a=(o{let r;const i=WUe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Fd(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const HUe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qUe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},KUe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},GUe={date:Fd({formats:HUe,defaultWidth:"full"}),time:Fd({formats:qUe,defaultWidth:"full"}),dateTime:Fd({formats:KUe,defaultWidth:"full"})},YUe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ZUe=(e,t,n,r)=>YUe[e];function hs(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,s=n?.width?String(n.width):a;i=e.formattingValues[s]||e.formattingValues[a]}else{const a=e.defaultWidth,s=n?.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const XUe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},QUe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},JUe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},eze={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},tze={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},nze={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},rze=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ize={ordinalNumber:rze,era:hs({values:XUe,defaultWidth:"wide"}),quarter:hs({values:QUe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hs({values:JUe,defaultWidth:"wide"}),day:hs({values:eze,defaultWidth:"wide"}),dayPeriod:hs({values:tze,defaultWidth:"wide",formattingValues:nze,defaultFormattingWidth:"wide"})};function ps(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const a=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(s)?aze(s,f=>f.test(a)):oze(s,f=>f.test(a));let l;l=e.valueCallback?e.valueCallback(u):u,l=n.valueCallback?n.valueCallback(l):l;const c=t.slice(a.length);return{value:l,rest:c}}}function oze(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function aze(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const s=t.slice(i.length);return{value:a,rest:s}}}const sze=/^(\d+)(th|st|nd|rd)?/i,uze=/\d+/i,lze={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},cze={any:[/^b/i,/^(a|c)/i]},fze={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},dze={any:[/1/i,/2/i,/3/i,/4/i]},hze={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},pze={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},gze={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},mze={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},vze={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},yze={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},bze={ordinalNumber:AG({matchPattern:sze,parsePattern:uze,valueCallback:e=>parseInt(e,10)}),era:ps({matchPatterns:lze,defaultMatchWidth:"wide",parsePatterns:cze,defaultParseWidth:"any"}),quarter:ps({matchPatterns:fze,defaultMatchWidth:"wide",parsePatterns:dze,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ps({matchPatterns:hze,defaultMatchWidth:"wide",parsePatterns:pze,defaultParseWidth:"any"}),day:ps({matchPatterns:gze,defaultMatchWidth:"wide",parsePatterns:mze,defaultParseWidth:"any"}),dayPeriod:ps({matchPatterns:vze,defaultMatchWidth:"any",parsePatterns:yze,defaultParseWidth:"any"})},PG={code:"en-US",formatDistance:VUe,formatLong:GUe,formatRelative:ZUe,localize:ize,match:bze,options:{weekStartsOn:0,firstWeekContainsDate:1}};function xze(e,t){const n=Dn(e,t?.in);return bs(n,EG(n))+1}function kG(e,t){const n=Dn(e,t?.in),r=+uf(n)-+LUe(n);return Math.round(r/c5)+1}function TG(e,t){const n=Dn(e,t?.in),r=n.getFullYear(),i=Ym(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=ii(t?.in||e,0);a.setFullYear(r+1,0,o),a.setHours(0,0,0,0);const s=ya(a,t),u=ii(t?.in||e,0);u.setFullYear(r,0,o),u.setHours(0,0,0,0);const l=ya(u,t);return+n>=+s?r+1:+n>=+l?r:r-1}function wze(e,t){const n=Ym(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=TG(e,t),o=ii(t?.in||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),ya(o,t)}function MG(e,t){const n=Dn(e,t?.in),r=+ya(n,t)-+wze(n,t);return Math.round(r/c5)+1}function Mn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const qu={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Mn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Mn(n+1,2)},d(e,t){return Mn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Mn(e.getHours()%12||12,t.length)},H(e,t){return Mn(e.getHours(),t.length)},m(e,t){return Mn(e.getMinutes(),t.length)},s(e,t){return Mn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Mn(i,t.length)}},Jf={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},QI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return qu.y(e,t)},Y:function(e,t,n,r){const i=TG(e,r),o=i>0?i:1-i;if(t==="YY"){const a=o%100;return Mn(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Mn(o,t.length)},R:function(e,t){const n=CG(e);return Mn(n,t.length)},u:function(e,t){const n=e.getFullYear();return Mn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Mn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Mn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return qu.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Mn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=MG(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Mn(i,t.length)},I:function(e,t,n){const r=kG(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Mn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):qu.d(e,t)},D:function(e,t,n){const r=xze(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Mn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Mn(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Mn(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Mn(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Jf.noon:r===0?i=Jf.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Jf.evening:r>=12?i=Jf.afternoon:r>=4?i=Jf.morning:i=Jf.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return qu.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):qu.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Mn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Mn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):qu.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):qu.s(e,t)},S:function(e,t){return qu.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return eN(r);case"XXXX":case"XX":return gc(r);case"XXXXX":case"XXX":default:return gc(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return eN(r);case"xxxx":case"xx":return gc(r);case"xxxxx":case"xxx":default:return gc(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+JI(r,":");case"OOOO":default:return"GMT"+gc(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+JI(r,":");case"zzzz":default:return"GMT"+gc(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Mn(r,t.length)},T:function(e,t,n){return Mn(+e,t.length)}};function JI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Mn(o,2)}function eN(e,t){return e%60===0?(e>0?"-":"+")+Mn(Math.abs(e)/60,2):gc(e,t)}function gc(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Mn(Math.trunc(r/60),2),o=Mn(r%60,2);return n+i+t+o}const tN=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},RG=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},_ze=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return tN(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",tN(r,t)).replace("{{time}}",RG(i,t))},Sze={p:RG,P:_ze},Cze=/^D+$/,Eze=/^Y+$/,Oze=["D","DD","YY","YYYY"];function Aze(e){return Cze.test(e)}function Pze(e){return Eze.test(e)}function kze(e,t,n){const r=Tze(e,t,n);if(console.warn(r),Oze.includes(e))throw new RangeError(r)}function Tze(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Mze=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Rze=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dze=/^'([^]*?)'?$/,$ze=/''/g,Ize=/[a-zA-Z]/;function Sf(e,t,n){const r=Ym(),i=n?.locale??r.locale??PG,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Dn(e,n?.in);if(!UUe(s))throw new RangeError("Invalid time value");let u=t.match(Rze).map(c=>{const f=c[0];if(f==="p"||f==="P"){const h=Sze[f];return h(c,i.formatLong)}return c}).join("").match(Mze).map(c=>{if(c==="''")return{isToken:!1,value:"'"};const f=c[0];if(f==="'")return{isToken:!1,value:Nze(c)};if(QI[f])return{isToken:!0,value:c};if(f.match(Ize))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:c}});i.localize.preprocessor&&(u=i.localize.preprocessor(s,u));const l={firstWeekContainsDate:o,weekStartsOn:a,locale:i};return u.map(c=>{if(!c.isToken)return c.value;const f=c.value;(!n?.useAdditionalWeekYearTokens&&Pze(f)||!n?.useAdditionalDayOfYearTokens&&Aze(f))&&kze(f,t,String(e));const h=QI[f[0]];return h(s,f,i.localize,l)}).join("")}function Nze(e){const t=e.match(Dze);return t?t[1].replace($ze,"'"):e}function Lze(e,t){const n=Dn(e,t?.in),r=n.getFullYear(),i=n.getMonth(),o=ii(n,0);return o.setFullYear(r,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Fze(e){return Math.trunc(+Dn(e)/1e3)}function jze(e,t){const n=Dn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(0,0,0,0),Dn(n,t?.in)}function Bze(e,t){const n=Dn(e,t?.in);return zUe(jze(n,t),po(n,t),t)+1}function T4(e,t){return+Dn(e)>+Dn(t)}function DG(e,t){return+Dn(e)<+Dn(t)}function Uze(e,t,n){const[r,i]=_f(n?.in,e,t);return+ya(r,n)==+ya(i,n)}function p5(e,t,n){const[r,i]=_f(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function zze(e,t,n){const[r,i]=_f(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function I3(e,t,n){return Ui(e,-t,n)}function N3(e,t,n){const r=Dn(e,n?.in),i=r.getFullYear(),o=r.getDate(),a=ii(e,0);a.setFullYear(i,t,15),a.setHours(0,0,0,0);const s=Lze(a);return r.setMonth(t,Math.min(o,s)),r}function nN(e,t,n){const r=Dn(e,n?.in);return isNaN(+r)?ii(e,NaN):(r.setFullYear(t),r)}function itt(e){return lf(Date.now(),e)}const Wze={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},Vze=(e,t,n)=>{let r;const i=Wze[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?r+"内":r+"前":r},Hze={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},qze={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},Kze={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Gze={date:Fd({formats:Hze,defaultWidth:"full"}),time:Fd({formats:qze,defaultWidth:"full"}),dateTime:Fd({formats:Kze,defaultWidth:"full"})};function rN(e,t,n){const r="eeee p";return Uze(e,t,n)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const Yze={lastWeek:rN,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:rN,other:"PP p"},Zze=(e,t,n,r)=>{const i=Yze[e];return typeof i=="function"?i(t,n,r):i},Xze={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},Qze={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},Jze={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},eWe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},tWe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},nWe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},rWe=(e,t)=>{const n=Number(e);switch(t?.unit){case"date":return n.toString()+"日";case"hour":return n.toString()+"时";case"minute":return n.toString()+"分";case"second":return n.toString()+"秒";default:return"第 "+n.toString()}},iWe={ordinalNumber:rWe,era:hs({values:Xze,defaultWidth:"wide"}),quarter:hs({values:Qze,defaultWidth:"wide",argumentCallback:e=>e-1}),month:hs({values:Jze,defaultWidth:"wide"}),day:hs({values:eWe,defaultWidth:"wide"}),dayPeriod:hs({values:tWe,defaultWidth:"wide",formattingValues:nWe,defaultFormattingWidth:"wide"})},oWe=/^(第\s*)?\d+(日|时|分|秒)?/i,aWe=/\d+/i,sWe={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},uWe={any:[/^(前)/i,/^(公元)/i]},lWe={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},cWe={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},fWe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},dWe={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},hWe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},pWe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},gWe={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},mWe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},vWe={ordinalNumber:AG({matchPattern:oWe,parsePattern:aWe,valueCallback:e=>parseInt(e,10)}),era:ps({matchPatterns:sWe,defaultMatchWidth:"wide",parsePatterns:uWe,defaultParseWidth:"any"}),quarter:ps({matchPatterns:lWe,defaultMatchWidth:"wide",parsePatterns:cWe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ps({matchPatterns:fWe,defaultMatchWidth:"wide",parsePatterns:dWe,defaultParseWidth:"any"}),day:ps({matchPatterns:hWe,defaultMatchWidth:"wide",parsePatterns:pWe,defaultParseWidth:"any"}),dayPeriod:ps({matchPatterns:gWe,defaultMatchWidth:"any",parsePatterns:mWe,defaultParseWidth:"any"})},ott={code:"zh-CN",formatDistance:Vze,formatLong:Gze,formatRelative:Zze,localize:iWe,match:vWe,options:{weekStartsOn:1,firstWeekContainsDate:4}};var Dt=function(){return Dt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r1&&(u||!l),f=t>1&&(l||!u),h=function(){r&&o(r)},p=function(){i&&o(i)};return I.jsx(ZWe,{displayMonth:e.displayMonth,hideNext:c,hidePrevious:f,nextMonth:i,previousMonth:r,onPreviousClick:h,onNextClick:p})}function XWe(e){var t,n=Kn(),r=n.classNames,i=n.disableNavigation,o=n.styles,a=n.captionLayout,s=n.components,u=(t=s?.CaptionLabel)!==null&&t!==void 0?t:NG,l;return i?l=I.jsx(u,{id:e.id,displayMonth:e.displayMonth}):a==="dropdown"?l=I.jsx(iN,{displayMonth:e.displayMonth,id:e.id}):a==="dropdown-buttons"?l=I.jsxs(I.Fragment,{children:[I.jsx(iN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),I.jsx(oN,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):l=I.jsxs(I.Fragment,{children:[I.jsx(u,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),I.jsx(oN,{displayMonth:e.displayMonth,id:e.id})]}),I.jsx("div",{className:r.caption,style:o.caption,children:l})}function QWe(e){var t=Kn(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?I.jsx("tfoot",{className:i,style:r.tfoot,children:I.jsx("tr",{children:I.jsx("td",{colSpan:8,children:n})})}):I.jsx(I.Fragment,{})}function JWe(e,t,n){for(var r=n?uf(new Date):ya(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var a=Ui(r,o);i.push(a)}return i}function eVe(){var e=Kn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,a=e.ISOWeek,s=e.formatters.formatWeekdayName,u=e.labels.labelWeekday,l=JWe(i,o,a);return I.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&I.jsx("td",{style:n.head_cell,className:t.head_cell}),l.map(function(c,f){return I.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":u(c,{locale:i}),children:s(c,{locale:i})},f)})]})}function tVe(){var e,t=Kn(),n=t.classNames,r=t.styles,i=t.components,o=(e=i?.HeadRow)!==null&&e!==void 0?e:eVe;return I.jsx("thead",{style:r.head,className:n.head,children:I.jsx(o,{})})}function nVe(e){var t=Kn(),n=t.locale,r=t.formatters.formatDay;return I.jsx(I.Fragment,{children:r(e.date,{locale:n})})}var g5=v.createContext(void 0);function rVe(e){if(!Zm(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return I.jsx(g5.Provider,{value:t,children:e.children})}return I.jsx(iVe,{initialProps:e.initialProps,children:e.children})}function iVe(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,a=function(l,c,f){var h,p;(h=t.onDayClick)===null||h===void 0||h.call(t,l,c,f);var m=!!(c.selected&&i&&r?.length===i);if(!m){var y=!!(!c.selected&&o&&r?.length===o);if(!y){var b=r?$G([],r):[];if(c.selected){var w=b.findIndex(function(x){return so(l,x)});b.splice(w,1)}else b.push(l);(p=t.onSelect)===null||p===void 0||p.call(t,b,l,c,f)}}},s={disabled:[]};r&&s.disabled.push(function(l){var c=o&&r.length>o-1,f=r.some(function(h){return so(h,l)});return!!(c&&!f)});var u={selected:r,onDayClick:a,modifiers:s};return I.jsx(g5.Provider,{value:u,children:n})}function m5(){var e=v.useContext(g5);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function oVe(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?so(i,e)&&so(r,e)?void 0:so(i,e)?{from:i,to:void 0}:so(r,e)?void 0:T4(r,e)?{from:e,to:i}:{from:r,to:e}:i?T4(e,i)?{from:i,to:e}:{from:e,to:i}:r?DG(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var v5=v.createContext(void 0);function aVe(e){if(!Xm(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return I.jsx(v5.Provider,{value:t,children:e.children})}return I.jsx(sVe,{initialProps:e.initialProps,children:e.children})}function sVe(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,a=i.to,s=t.min,u=t.max,l=function(p,m,y){var b,w;(b=t.onDayClick)===null||b===void 0||b.call(t,p,m,y);var x=oVe(p,r);(w=t.onSelect)===null||w===void 0||w.call(t,x,p,m,y)},c={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(c.range_start=[o],a?(c.range_end=[a],so(o,a)||(c.range_middle=[{after:o,before:a}])):c.range_end=[o]):a&&(c.range_start=[a],c.range_end=[a]),s&&(o&&!a&&c.disabled.push({after:I3(o,s-1),before:Ui(o,s-1)}),o&&a&&c.disabled.push({after:o,before:Ui(o,s-1)}),!o&&a&&c.disabled.push({after:I3(a,s-1),before:Ui(a,s-1)})),u){if(o&&!a&&(c.disabled.push({before:Ui(o,-u+1)}),c.disabled.push({after:Ui(o,u-1)})),o&&a){var f=bs(a,o)+1,h=u-f;c.disabled.push({before:I3(o,h)}),c.disabled.push({after:Ui(a,h)})}!o&&a&&(c.disabled.push({before:Ui(a,-u+1)}),c.disabled.push({after:Ui(a,u-1)}))}return I.jsx(v5.Provider,{value:{selected:r,onDayClick:l,modifiers:c},children:n})}function y5(){var e=v.useContext(v5);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function x1(e){return Array.isArray(e)?$G([],e):e!==void 0?[e]:[]}function uVe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=x1(i)}),t}var Qa;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Qa||(Qa={}));var lVe=Qa.Selected,Ys=Qa.Disabled,cVe=Qa.Hidden,fVe=Qa.Today,L3=Qa.RangeEnd,F3=Qa.RangeMiddle,j3=Qa.RangeStart,dVe=Qa.Outside;function hVe(e,t,n){var r,i=(r={},r[lVe]=x1(e.selected),r[Ys]=x1(e.disabled),r[cVe]=x1(e.hidden),r[fVe]=[e.today],r[L3]=[],r[F3]=[],r[j3]=[],r[dVe]=[],r);return e.fromDate&&i[Ys].push({before:e.fromDate}),e.toDate&&i[Ys].push({after:e.toDate}),Zm(e)?i[Ys]=i[Ys].concat(t.modifiers[Ys]):Xm(e)&&(i[Ys]=i[Ys].concat(n.modifiers[Ys]),i[j3]=n.modifiers[j3],i[F3]=n.modifiers[F3],i[L3]=n.modifiers[L3]),i}var jG=v.createContext(void 0);function pVe(e){var t=Kn(),n=m5(),r=y5(),i=hVe(t,n,r),o=uVe(t.modifiers),a=Dt(Dt({},i),o);return I.jsx(jG.Provider,{value:a,children:e.children})}function BG(){var e=v.useContext(jG);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function gVe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function mVe(e){return!!(e&&typeof e=="object"&&"from"in e)}function vVe(e){return!!(e&&typeof e=="object"&&"after"in e)}function yVe(e){return!!(e&&typeof e=="object"&&"before"in e)}function bVe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function xVe(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=bs(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var a=bs(e,r)>=0&&bs(i,e)>=0;return a}return i?so(i,e):r?so(r,e):!1}function wVe(e){return f5(e)}function _Ve(e){return Array.isArray(e)&&e.every(f5)}function SVe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(wVe(n))return so(e,n);if(_Ve(n))return n.includes(e);if(mVe(n))return xVe(e,n);if(bVe(n))return n.dayOfWeek.includes(e.getDay());if(gVe(n)){var r=bs(n.before,e),i=bs(n.after,e),o=r>0,a=i<0,s=T4(n.before,n.after);return s?a&&o:o||a}return vVe(n)?bs(e,n.after)>0:yVe(n)?bs(n.before,e)>0:typeof n=="function"?n(e):!1})}function b5(e,t,n){var r=Object.keys(t).reduce(function(o,a){var s=t[a];return SVe(e,s)&&o.push(a),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!p5(e,n)&&(i.outside=!0),i}function CVe(e,t){for(var n=po(e[0]),r=d5(e[e.length-1]),i,o,a=n;a<=r;){var s=b5(a,t),u=!s.disabled&&!s.hidden;if(!u){a=Ui(a,1);continue}if(s.selected)return a;s.today&&!o&&(o=a),i||(i=a),a=Ui(a,1)}return o||i}var EVe=365;function UG(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,a=t.retry,s=a===void 0?{count:0,lastFocused:e}:a,u=i.weekStartsOn,l=i.fromDate,c=i.toDate,f=i.locale,h={day:Ui,week:k4,month:Xa,year:FUe,startOfWeek:function(b){return i.ISOWeek?uf(b):ya(b,{locale:f,weekStartsOn:u})},endOfWeek:function(b){return i.ISOWeek?OG(b):h5(b,{locale:f,weekStartsOn:u})}},p=h[n](e,r==="after"?1:-1);r==="before"&&l?p=jUe([l,p]):r==="after"&&c&&(p=BUe([c,p]));var m=!0;if(o){var y=b5(p,o);m=!y.disabled&&!y.hidden}return m?p:s.count>EVe?s.lastFocused:UG(p,{moveBy:n,direction:r,context:i,modifiers:o,retry:Dt(Dt({},s),{count:s.count+1})})}var zG=v.createContext(void 0);function OVe(e){var t=Qm(),n=BG(),r=v.useState(),i=r[0],o=r[1],a=v.useState(),s=a[0],u=a[1],l=CVe(t.displayMonths,n),c=i??(s&&t.isDateDisplayed(s))?s:l,f=function(){u(i),o(void 0)},h=function(b){o(b)},p=Kn(),m=function(b,w){if(i){var x=UG(i,{moveBy:b,direction:w,context:p,modifiers:n});so(i,x)||(t.goToDate(x,i),h(x))}},y={focusedDay:i,focusTarget:c,blur:f,focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return I.jsx(zG.Provider,{value:y,children:e.children})}function x5(){var e=v.useContext(zG);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function AVe(e,t){var n=BG(),r=b5(e,n,t);return r}var w5=v.createContext(void 0);function PVe(e){if(!D2(e.initialProps)){var t={selected:void 0};return I.jsx(w5.Provider,{value:t,children:e.children})}return I.jsx(kVe,{initialProps:e.initialProps,children:e.children})}function kVe(e){var t=e.initialProps,n=e.children,r=function(o,a,s){var u,l,c;if((u=t.onDayClick)===null||u===void 0||u.call(t,o,a,s),a.selected&&!t.required){(l=t.onSelect)===null||l===void 0||l.call(t,void 0,o,a,s);return}(c=t.onSelect)===null||c===void 0||c.call(t,o,o,a,s)},i={selected:t.selected,onDayClick:r};return I.jsx(w5.Provider,{value:i,children:n})}function WG(){var e=v.useContext(w5);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function TVe(e,t){var n=Kn(),r=WG(),i=m5(),o=y5(),a=x5(),s=a.focusDayAfter,u=a.focusDayBefore,l=a.focusWeekAfter,c=a.focusWeekBefore,f=a.blur,h=a.focus,p=a.focusMonthBefore,m=a.focusMonthAfter,y=a.focusYearBefore,b=a.focusYearAfter,w=a.focusStartOfWeek,x=a.focusEndOfWeek,S=function(H){var j,K,Y,re;D2(n)?(j=r.onDayClick)===null||j===void 0||j.call(r,e,t,H):Zm(n)?(K=i.onDayClick)===null||K===void 0||K.call(i,e,t,H):Xm(n)?(Y=o.onDayClick)===null||Y===void 0||Y.call(o,e,t,H):(re=n.onDayClick)===null||re===void 0||re.call(n,e,t,H)},O=function(H){var j;h(e),(j=n.onDayFocus)===null||j===void 0||j.call(n,e,t,H)},E=function(H){var j;f(),(j=n.onDayBlur)===null||j===void 0||j.call(n,e,t,H)},C=function(H){var j;(j=n.onDayMouseEnter)===null||j===void 0||j.call(n,e,t,H)},P=function(H){var j;(j=n.onDayMouseLeave)===null||j===void 0||j.call(n,e,t,H)},M=function(H){var j;(j=n.onDayPointerEnter)===null||j===void 0||j.call(n,e,t,H)},N=function(H){var j;(j=n.onDayPointerLeave)===null||j===void 0||j.call(n,e,t,H)},B=function(H){var j;(j=n.onDayTouchCancel)===null||j===void 0||j.call(n,e,t,H)},V=function(H){var j;(j=n.onDayTouchEnd)===null||j===void 0||j.call(n,e,t,H)},W=function(H){var j;(j=n.onDayTouchMove)===null||j===void 0||j.call(n,e,t,H)},ee=function(H){var j;(j=n.onDayTouchStart)===null||j===void 0||j.call(n,e,t,H)},Z=function(H){var j;(j=n.onDayKeyUp)===null||j===void 0||j.call(n,e,t,H)},q=function(H){var j;switch(H.key){case"ArrowLeft":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?s():u();break;case"ArrowRight":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?u():s();break;case"ArrowDown":H.preventDefault(),H.stopPropagation(),l();break;case"ArrowUp":H.preventDefault(),H.stopPropagation(),c();break;case"PageUp":H.preventDefault(),H.stopPropagation(),H.shiftKey?y():p();break;case"PageDown":H.preventDefault(),H.stopPropagation(),H.shiftKey?b():m();break;case"Home":H.preventDefault(),H.stopPropagation(),w();break;case"End":H.preventDefault(),H.stopPropagation(),x();break}(j=n.onDayKeyDown)===null||j===void 0||j.call(n,e,t,H)},G={onClick:S,onFocus:O,onBlur:E,onKeyDown:q,onKeyUp:Z,onMouseEnter:C,onMouseLeave:P,onPointerEnter:M,onPointerLeave:N,onTouchCancel:B,onTouchEnd:V,onTouchMove:W,onTouchStart:ee};return G}function MVe(){var e=Kn(),t=WG(),n=m5(),r=y5(),i=D2(e)?t.selected:Zm(e)?n.selected:Xm(e)?r.selected:void 0;return i}function RVe(e){return Object.values(Qa).includes(e)}function DVe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(RVe(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function $Ve(e,t){var n=Dt({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Dt(Dt({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function IVe(e,t,n){var r,i,o,a=Kn(),s=x5(),u=AVe(e,t),l=TVe(e,u),c=MVe(),f=!!(a.onDayClick||a.mode!=="default");v.useEffect(function(){var C;u.outside||s.focusedDay&&f&&so(s.focusedDay,e)&&((C=n.current)===null||C===void 0||C.focus())},[s.focusedDay,e,n,f,u.outside]);var h=DVe(a,u).join(" "),p=$Ve(a,u),m=!!(u.outside&&!a.showOutsideDays||u.hidden),y=(o=(i=a.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:nVe,b=I.jsx(y,{date:e,displayMonth:t,activeModifiers:u}),w={style:p,className:h,children:b,role:"gridcell"},x=s.focusTarget&&so(s.focusTarget,e)&&!u.outside,S=s.focusedDay&&so(s.focusedDay,e),O=Dt(Dt(Dt({},w),(r={disabled:u.disabled,role:"gridcell"},r["aria-selected"]=u.selected,r.tabIndex=S||x?0:-1,r)),l),E={isButton:f,isHidden:m,activeModifiers:u,selectedDays:c,buttonProps:O,divProps:w};return E}function NVe(e){var t=v.useRef(null),n=IVe(e.date,e.displayMonth,t);return n.isHidden?I.jsx("div",{role:"gridcell"}):n.isButton?I.jsx(Dx,Dt({name:"day",ref:t},n.buttonProps)):I.jsx("div",Dt({},n.divProps))}function LVe(e){var t=e.number,n=e.dates,r=Kn(),i=r.onWeekNumberClick,o=r.styles,a=r.classNames,s=r.locale,u=r.labels.labelWeekNumber,l=r.formatters.formatWeekNumber,c=l(Number(t),{locale:s});if(!i)return I.jsx("span",{className:a.weeknumber,style:o.weeknumber,children:c});var f=u(Number(t),{locale:s}),h=function(p){i(t,n,p)};return I.jsx(Dx,{name:"week-number","aria-label":f,className:a.weeknumber,style:o.weeknumber,onClick:h,children:c})}function FVe(e){var t,n,r=Kn(),i=r.styles,o=r.classNames,a=r.showWeekNumber,s=r.components,u=(t=s?.Day)!==null&&t!==void 0?t:NVe,l=(n=s?.WeekNumber)!==null&&n!==void 0?n:LVe,c;return a&&(c=I.jsx("td",{className:o.cell,style:i.cell,children:I.jsx(l,{number:e.weekNumber,dates:e.dates})})),I.jsxs("tr",{className:o.row,style:i.row,children:[c,e.dates.map(function(f){return I.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:I.jsx(u,{displayMonth:e.displayMonth,date:f})},Fze(f))})]})}function aN(e,t,n){for(var r=n?.ISOWeek?OG(t):h5(t,n),i=n?.ISOWeek?uf(e):ya(e,n),o=bs(r,i),a=[],s=0;s<=o;s++)a.push(Ui(i,s));var u=a.reduce(function(l,c){var f=n?.ISOWeek?kG(c):MG(c,n),h=l.find(function(p){return p.weekNumber===f});return h?(h.dates.push(c),l):(l.push({weekNumber:f,dates:[c]}),l)},[]);return u}function jVe(e,t){var n=aN(po(e),d5(e),t);if(t?.useFixedWeeks){var r=Bze(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],a=k4(o,6-r),s=aN(k4(o,1),a,t);n.push.apply(n,s)}}return n}function BVe(e){var t,n,r,i=Kn(),o=i.locale,a=i.classNames,s=i.styles,u=i.hideHead,l=i.fixedWeeks,c=i.components,f=i.weekStartsOn,h=i.firstWeekContainsDate,p=i.ISOWeek,m=jVe(e.displayMonth,{useFixedWeeks:!!l,ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:h}),y=(t=c?.Head)!==null&&t!==void 0?t:tVe,b=(n=c?.Row)!==null&&n!==void 0?n:FVe,w=(r=c?.Footer)!==null&&r!==void 0?r:QWe;return I.jsxs("table",{id:e.id,className:a.table,style:s.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!u&&I.jsx(y,{}),I.jsx("tbody",{className:a.tbody,style:s.tbody,children:m.map(function(x){return I.jsx(b,{displayMonth:e.displayMonth,dates:x.dates,weekNumber:x.weekNumber},x.weekNumber)})}),I.jsx(w,{displayMonth:e.displayMonth})]})}function UVe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var zVe=UVe()?v.useLayoutEffect:v.useEffect,B3=!1,WVe=0;function sN(){return"react-day-picker-".concat(++WVe)}function VVe(e){var t,n=e??(B3?sN():null),r=v.useState(n),i=r[0],o=r[1];return zVe(function(){i===null&&o(sN())},[]),v.useEffect(function(){B3===!1&&(B3=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function HVe(e){var t,n,r=Kn(),i=r.dir,o=r.classNames,a=r.styles,s=r.components,u=Qm().displayMonths,l=VVe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),c=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[o.month],h=a.month,p=e.displayIndex===0,m=e.displayIndex===u.length-1,y=!p&&!m;i==="rtl"&&(t=[p,m],m=t[0],p=t[1]),p&&(f.push(o.caption_start),h=Dt(Dt({},h),a.caption_start)),m&&(f.push(o.caption_end),h=Dt(Dt({},h),a.caption_end)),y&&(f.push(o.caption_between),h=Dt(Dt({},h),a.caption_between));var b=(n=s?.Caption)!==null&&n!==void 0?n:XWe;return I.jsxs("div",{className:f.join(" "),style:h,children:[I.jsx(b,{id:l,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),I.jsx(BVe,{id:c,"aria-labelledby":l,displayMonth:e.displayMonth})]},e.displayIndex)}function qVe(e){var t=Kn(),n=t.classNames,r=t.styles;return I.jsx("div",{className:n.months,style:r.months,children:e.children})}function KVe(e){var t,n,r=e.initialProps,i=Kn(),o=x5(),a=Qm(),s=v.useState(!1),u=s[0],l=s[1];v.useEffect(function(){i.initialFocus&&o.focusTarget&&(u||(o.focus(o.focusTarget),l(!0)))},[i.initialFocus,u,o.focus,o.focusTarget,o]);var c=[i.classNames.root,i.className];i.numberOfMonths>1&&c.push(i.classNames.multiple_months),i.showWeekNumber&&c.push(i.classNames.with_weeknumber);var f=Dt(Dt({},i.styles.root),i.style),h=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,y){var b;return Dt(Dt({},m),(b={},b[y]=r[y],b))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:qVe;return I.jsx("div",Dt({className:c.join(" "),style:f,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:I.jsx(p,{children:a.displayMonths.map(function(m,y){return I.jsx(HVe,{displayIndex:y,displayMonth:m},y)})})}))}function GVe(e){var t=e.children,n=yWe(e,["children"]);return I.jsx(LWe,{initialProps:n,children:I.jsx(KWe,{children:I.jsx(PVe,{initialProps:n,children:I.jsx(rVe,{initialProps:n,children:I.jsx(aVe,{initialProps:n,children:I.jsx(pVe,{children:I.jsx(OVe,{children:t})})})})})})})}function att(e){return I.jsx(GVe,Dt({},e,{children:I.jsx(KVe,{initialProps:e})}))}function YVe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var _5=e=>{const{present:t,children:n}=e,r=ZVe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,XVe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};_5.displayName="Presence";function ZVe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=YVe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Uy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Uy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=Uy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=Uy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Uy(e){return e?.animationName||"none"}function XVe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var S5="Popover",[VG,stt]=Di(S5,[zl]),Jm=zl(),[QVe,Zl]=VG(S5),HG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!1}=e,s=Jm(t),u=v.useRef(null),[l,c]=v.useState(!1),[f=!1,h]=Ts({prop:r,defaultProp:i,onChange:o});return I.jsx(kw,{...s,children:I.jsx(QVe,{scope:t,contentId:Lo(),triggerRef:u,open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>c(!0),[]),onCustomAnchorRemove:v.useCallback(()=>c(!1),[]),modal:a,children:n})})};HG.displayName=S5;var qG="PopoverAnchor",JVe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(qG,n),o=Jm(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=i;return v.useEffect(()=>(a(),()=>s()),[a,s]),I.jsx(Dm,{...o,...r,ref:t})});JVe.displayName=qG;var KG="PopoverTrigger",GG=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(KG,n),o=Jm(n),a=Nt(t,i.triggerRef),s=I.jsx(gt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":JG(i.open),...r,ref:a,onClick:Ye(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:I.jsx(Dm,{asChild:!0,...o,children:s})});GG.displayName=KG;var C5="PopoverPortal",[eHe,tHe]=VG(C5,{forceMount:void 0}),YG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=Zl(C5,t);return I.jsx(eHe,{scope:t,forceMount:n,children:I.jsx(_5,{present:n||o.open,children:I.jsx(jh,{asChild:!0,container:i,children:r})})})};YG.displayName=C5;var Oh="PopoverContent",ZG=v.forwardRef((e,t)=>{const n=tHe(Oh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=Zl(Oh,e.__scopePopover);return I.jsx(_5,{present:r||o.open,children:o.modal?I.jsx(nHe,{...i,ref:t}):I.jsx(rHe,{...i,ref:t})})});ZG.displayName=Oh;var nHe=v.forwardRef((e,t)=>{const n=Zl(Oh,e.__scopePopover),r=v.useRef(null),i=Nt(t,r),o=v.useRef(!1);return v.useEffect(()=>{const a=r.current;if(a)return Mm(a)},[]),I.jsx(Tm,{as:Pl,allowPinchZoom:!0,children:I.jsx(XG,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ye(e.onCloseAutoFocus,a=>{a.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ye(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0,l=s.button===2||u;o.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:Ye(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),rHe=v.forwardRef((e,t)=>{const n=Zl(Oh,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return I.jsx(XG,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;n.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),XG=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:c,...f}=e,h=Zl(Oh,n),p=Jm(n);return Ew(),I.jsx(km,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:I.jsx(Fh,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:c,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),children:I.jsx(Tw,{"data-state":JG(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.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)"}})})})}),QG="PopoverClose",iHe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zl(QG,n);return I.jsx(gt.button,{type:"button",...r,ref:t,onClick:Ye(e.onClick,()=>i.onOpenChange(!1))})});iHe.displayName=QG;var oHe="PopoverArrow",aHe=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Jm(n);return I.jsx(Mw,{...i,...r,ref:t})});aHe.displayName=oHe;function JG(e){return e?"open":"closed"}var utt=HG,ltt=GG,ctt=YG,ftt=ZG;function sHe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var ev=e=>{const{present:t,children:n}=e,r=uHe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Nt(r.ref,lHe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};ev.displayName="Presence";function uHe(e){const[t,n]=v.useState(),r=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=sHe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=zy(r.current);o.current=s==="mounted"?l:"none"},[s]),On(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=zy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),On(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=zy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=zy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function zy(e){return e?.animationName||"none"}function lHe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function cHe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var E5="ScrollArea",[eY,dtt]=Di(E5),[fHe,wa]=eY(E5),tY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...a}=e,[s,u]=v.useState(null),[l,c]=v.useState(null),[f,h]=v.useState(null),[p,m]=v.useState(null),[y,b]=v.useState(null),[w,x]=v.useState(0),[S,O]=v.useState(0),[E,C]=v.useState(!1),[P,M]=v.useState(!1),N=Nt(t,V=>u(V)),B=Em(i);return I.jsx(fHe,{scope:n,type:r,dir:B,scrollHideDelay:o,scrollArea:s,viewport:l,onViewportChange:c,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:b,scrollbarYEnabled:P,onScrollbarYEnabledChange:M,onCornerWidthChange:x,onCornerHeightChange:O,children:I.jsx(gt.div,{dir:B,...a,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});tY.displayName=E5;var nY="ScrollAreaViewport",rY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,a=wa(nY,n),s=v.useRef(null),u=Nt(t,s,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:i}),I.jsx(gt.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,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:r})})]})});rY.displayName=nY;var $s="ScrollAreaScrollbar",dHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wa($s,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,s=e.orientation==="horizontal";return v.useEffect(()=>(s?o(!0):a(!0),()=>{s?o(!1):a(!1)}),[s,o,a]),i.type==="hover"?I.jsx(hHe,{...r,ref:t,forceMount:n}):i.type==="scroll"?I.jsx(pHe,{...r,ref:t,forceMount:n}):i.type==="auto"?I.jsx(iY,{...r,ref:t,forceMount:n}):i.type==="always"?I.jsx(O5,{...r,ref:t}):null});dHe.displayName=$s;var hHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wa($s,e.__scopeScrollArea),[o,a]=v.useState(!1);return v.useEffect(()=>{const s=i.scrollArea;let u=0;if(s){const l=()=>{window.clearTimeout(u),a(!0)},c=()=>{u=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return s.addEventListener("pointerenter",l),s.addEventListener("pointerleave",c),()=>{window.clearTimeout(u),s.removeEventListener("pointerenter",l),s.removeEventListener("pointerleave",c)}}},[i.scrollArea,i.scrollHideDelay]),I.jsx(ev,{present:n||o,children:I.jsx(iY,{"data-state":o?"visible":"hidden",...r,ref:t})})}),pHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=wa($s,e.__scopeScrollArea),o=e.orientation==="horizontal",a=I2(()=>u("SCROLL_END"),100),[s,u]=cHe("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 v.useEffect(()=>{if(s==="idle"){const l=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[s,i.scrollHideDelay,u]),v.useEffect(()=>{const l=i.viewport,c=o?"scrollLeft":"scrollTop";if(l){let f=l[c];const h=()=>{const p=l[c];f!==p&&(u("SCROLL"),a()),f=p};return l.addEventListener("scroll",h),()=>l.removeEventListener("scroll",h)}},[i.viewport,o,u,a]),I.jsx(ev,{present:n||s!=="hidden",children:I.jsx(O5,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ye(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ye(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),iY=v.forwardRef((e,t)=>{const n=wa($s,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=v.useState(!1),s=e.orientation==="horizontal",u=I2(()=>{if(n.viewport){const l=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=wa($s,e.__scopeScrollArea),o=v.useRef(null),a=v.useRef(0),[s,u]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=uY(s.viewport,s.content),c={...r,sizes:s,onSizesChange:u,hasThumb:l>0&&l<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:h=>a.current=h};function f(h,p){return wHe(h,a.current,s,p)}return n==="horizontal"?I.jsx(gHe,{...c,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const h=i.viewport.scrollLeft,p=uN(h,s,i.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollLeft=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollLeft=f(h,i.dir))}}):n==="vertical"?I.jsx(mHe,{...c,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const h=i.viewport.scrollTop,p=uN(h,s);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:h=>{i.viewport&&(i.viewport.scrollTop=h)},onDragScroll:h=>{i.viewport&&(i.viewport.scrollTop=f(h))}}):null}),gHe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=wa($s,e.__scopeScrollArea),[a,s]=v.useState(),u=v.useRef(null),l=Nt(t,u,o.onScrollbarXChange);return v.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),I.jsx(aY,{"data-orientation":"horizontal",...i,ref:l,sizes:n,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":$2(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.x),onDragScroll:c=>e.onDragScroll(c.x),onWheelScroll:(c,f)=>{if(o.viewport){const h=o.viewport.scrollLeft+c.deltaX;e.onWheelScroll(h),cY(h,f)&&c.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Ix(a.paddingLeft),paddingEnd:Ix(a.paddingRight)}})}})}),mHe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=wa($s,e.__scopeScrollArea),[a,s]=v.useState(),u=v.useRef(null),l=Nt(t,u,o.onScrollbarYChange);return v.useEffect(()=>{u.current&&s(getComputedStyle(u.current))},[u]),I.jsx(aY,{"data-orientation":"vertical",...i,ref:l,sizes:n,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":$2(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.y),onDragScroll:c=>e.onDragScroll(c.y),onWheelScroll:(c,f)=>{if(o.viewport){const h=o.viewport.scrollTop+c.deltaY;e.onWheelScroll(h),cY(h,f)&&c.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Ix(a.paddingTop),paddingEnd:Ix(a.paddingBottom)}})}})}),[vHe,oY]=eY($s),aY=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:u,onDragScroll:l,onWheelScroll:c,onResize:f,...h}=e,p=wa($s,n),[m,y]=v.useState(null),b=Nt(t,N=>y(N)),w=v.useRef(null),x=v.useRef(""),S=p.viewport,O=r.content-r.viewport,E=Vr(c),C=Vr(u),P=I2(f,10);function M(N){if(w.current){const B=N.clientX-w.current.left,V=N.clientY-w.current.top;l({x:B,y:V})}}return v.useEffect(()=>{const N=B=>{const V=B.target;m?.contains(V)&&E(B,O)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[S,m,O,E]),v.useEffect(C,[r,C]),Ah(m,P),Ah(p.content,P),I.jsx(vHe,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Vr(o),onThumbPointerUp:Vr(a),onThumbPositionChange:C,onThumbPointerDown:Vr(s),children:I.jsx(gt.div,{...h,ref:b,style:{position:"absolute",...h.style},onPointerDown:Ye(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),w.current=m.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),M(N))}),onPointerMove:Ye(e.onPointerMove,M),onPointerUp:Ye(e.onPointerUp,N=>{const B=N.target;B.hasPointerCapture(N.pointerId)&&B.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),w.current=null})})})}),$x="ScrollAreaThumb",yHe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=oY($x,e.__scopeScrollArea);return I.jsx(ev,{present:n||i.hasThumb,children:I.jsx(bHe,{ref:t,...r})})}),bHe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=wa($x,n),a=oY($x,n),{onThumbPositionChange:s}=a,u=Nt(t,f=>a.onThumbChange(f)),l=v.useRef(void 0),c=I2(()=>{l.current&&(l.current(),l.current=void 0)},100);return v.useEffect(()=>{const f=o.viewport;if(f){const h=()=>{if(c(),!l.current){const p=_He(f,s);l.current=p,s()}};return s(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[o.viewport,c,s]),I.jsx(gt.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ye(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),m=f.clientX-p.left,y=f.clientY-p.top;a.onThumbPointerDown({x:m,y})}),onPointerUp:Ye(e.onPointerUp,a.onThumbPointerUp)})});yHe.displayName=$x;var A5="ScrollAreaCorner",sY=v.forwardRef((e,t)=>{const n=wa(A5,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?I.jsx(xHe,{...e,ref:t}):null});sY.displayName=A5;var xHe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=wa(A5,n),[o,a]=v.useState(0),[s,u]=v.useState(0),l=!!(o&&s);return Ah(i.scrollbarX,()=>{const c=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(c),u(c)}),Ah(i.scrollbarY,()=>{const c=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(c),a(c)}),l?I.jsx(gt.div,{...r,ref:t,style:{width:o,height:s,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ix(e){return e?parseInt(e,10):0}function uY(e,t){const n=e/t;return isNaN(n)?0:n}function $2(e){const t=uY(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function wHe(e,t,n,r="ltr"){const i=$2(n),o=i/2,a=t||o,s=i-a,u=n.scrollbar.paddingStart+a,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,c=n.content-n.viewport,f=r==="ltr"?[0,c]:[c*-1,0];return lY([u,l],f)(e)}function uN(e,t,n="ltr"){const r=$2(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,s=o-r,u=n==="ltr"?[0,a]:[a*-1,0],l=S4(e,u);return lY([0,a],[0,s])(l)}function lY(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function cY(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,s=n.top!==o.top;(a||s)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function I2(e,t){const n=Vr(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ah(e,t){const n=Vr(t);On(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var htt=tY,ptt=rY,gtt=sY,P5="Progress",k5=100,[SHe,mtt]=Di(P5),[CHe,EHe]=SHe(P5),fY=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=OHe,...a}=e;(i||i===0)&&!lN(i)&&console.error(AHe(`${i}`,"Progress"));const s=lN(i)?i:k5;r!==null&&!cN(r,s)&&console.error(PHe(`${r}`,"Progress"));const u=cN(r,s)?r:null,l=Nx(u)?o(u,s):void 0;return I.jsx(CHe,{scope:n,value:u,max:s,children:I.jsx(gt.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Nx(u)?u:void 0,"aria-valuetext":l,role:"progressbar","data-state":pY(u,s),"data-value":u??void 0,"data-max":s,...a,ref:t})})});fY.displayName=P5;var dY="ProgressIndicator",hY=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=EHe(dY,n);return I.jsx(gt.div,{"data-state":pY(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});hY.displayName=dY;function OHe(e,t){return`${Math.round(e/t*100)}%`}function pY(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Nx(e){return typeof e=="number"}function lN(e){return Nx(e)&&!isNaN(e)&&e>0}function cN(e,t){return Nx(e)&&!isNaN(e)&&e<=t&&e>=0}function AHe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${k5}\`.`}function PHe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${k5} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. -Defaulting to \`null\`.`}var mtt=fY,vtt=hY;/** +Defaulting to \`null\`.`}var vtt=fY,ytt=hY;/** * table-core * * Copyright (c) TanStack @@ -546,10 +551,10 @@ Defaulting to \`null\`.`}var mtt=fY,vtt=hY;/** * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ytt(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function fl(e,t){return typeof e=="function"?e(t):e}function Wo(e,t){return n=>{t.setState(r=>({...r,[e]:fl(n,r[e])}))}}function N2(e){return e instanceof Function}function kHe(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function THe(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const a=t(o);a!=null&&a.length&&r(a)})};return r(e),n}function St(e,t,n){let r=[],i;return o=>{let a;n.key&&n.debug&&(a=Date.now());const s=e(o);if(!(s.length!==r.length||s.some((c,f)=>r[f]!==c)))return i;r=s;let l;if(n.key&&n.debug&&(l=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-a)*100)/100,f=Math.round((Date.now()-l)*100)/100,h=f/16,p=(m,y)=>{for(m=String(m);m.lengthtypeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function fl(e,t){return typeof e=="function"?e(t):e}function Wo(e,t){return n=>{t.setState(r=>({...r,[e]:fl(n,r[e])}))}}function N2(e){return e instanceof Function}function kHe(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function THe(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const a=t(o);a!=null&&a.length&&r(a)})};return r(e),n}function St(e,t,n){let r=[],i;return o=>{let a;n.key&&n.debug&&(a=Date.now());const s=e(o);if(!(s.length!==r.length||s.some((c,f)=>r[f]!==c)))return i;r=s;let l;if(n.key&&n.debug&&(l=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-a)*100)/100,f=Math.round((Date.now()-l)*100)/100,h=f/16,p=(m,y)=>{for(m=String(m);m.length{var i;return(i=e?.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function MHe(e,t,n,r){const i=()=>{var a;return(a=o.getValue())!=null?a:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:St(()=>[e,n,t,o],(a,s,u,l)=>({table:a,column:s,row:u,cell:l,getValue:l.getValue,renderValue:l.renderValue}),Ct(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function RHe(e,t,n,r){var i,o;const s={...e._getDefaultColumnDef(),...t},u=s.accessorKey;let l=(i=(o=s.id)!=null?o:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?i:typeof s.header=="string"?s.header:void 0,c;if(s.accessorFn?c=s.accessorFn:u&&(u.includes(".")?c=h=>{let p=h;for(const y of u.split(".")){var m;p=(m=p)==null?void 0:m[y]}return p}:c=h=>h[s.accessorKey]),!l)throw new Error;let f={id:`${String(l)}`,accessorFn:c,parent:r,depth:n,columnDef:s,columns:[],getFlatColumns:St(()=>[!0],()=>{var h;return[f,...(h=f.columns)==null?void 0:h.flatMap(p=>p.getFlatColumns())]},Ct(e.options,"debugColumns")),getLeafColumns:St(()=>[e._getOrderColumnsFn()],h=>{var p;if((p=f.columns)!=null&&p.length){let m=f.columns.flatMap(y=>y.getLeafColumns());return h(m)}return[f]},Ct(e.options,"debugColumns"))};for(const h of e._features)h.createColumn==null||h.createColumn(f,e);return f}const Si="debugHeaders";function fN(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],s=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(s),a.push(u)};return s(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const DHe={createTable:e=>{e.getHeaderGroups=St(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,a;const s=(o=r?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?o:[],u=(a=i?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?a:[],l=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(i!=null&&i.includes(f.id)));return Wy(t,[...s,...l,...u],e)},Ct(e.options,Si)),e.getCenterHeaderGroups=St(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),Wy(t,n,e,"center")),Ct(e.options,Si)),e.getLeftHeaderGroups=St(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?i:[];return Wy(t,o,e,"left")},Ct(e.options,Si)),e.getRightHeaderGroups=St(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?i:[];return Wy(t,o,e,"right")},Ct(e.options,Si)),e.getFooterGroups=St(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ct(e.options,Si)),e.getLeftFooterGroups=St(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ct(e.options,Si)),e.getCenterFooterGroups=St(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ct(e.options,Si)),e.getRightFooterGroups=St(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ct(e.options,Si)),e.getFlatHeaders=St(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ct(e.options,Si)),e.getLeftFlatHeaders=St(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ct(e.options,Si)),e.getCenterFlatHeaders=St(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ct(e.options,Si)),e.getRightFlatHeaders=St(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ct(e.options,Si)),e.getCenterLeafHeaders=St(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ct(e.options,Si)),e.getLeftLeafHeaders=St(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ct(e.options,Si)),e.getRightLeafHeaders=St(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ct(e.options,Si)),e.getLeafHeaders=St(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,a,s,u,l;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(a=(s=n[0])==null?void 0:s.headers)!=null?a:[],...(u=(l=r[0])==null?void 0:l.headers)!=null?u:[]].map(c=>c.getLeafHeaders()).flat()},Ct(e.options,Si))}};function Wy(e,t,n,r){var i,o;let a=0;const s=function(h,p){p===void 0&&(p=1),a=Math.max(a,p),h.filter(m=>m.getIsVisible()).forEach(m=>{var y;(y=m.columns)!=null&&y.length&&s(m.columns,p+1)},0)};s(e);let u=[];const l=(h,p)=>{const m={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},y=[];h.forEach(b=>{const w=[...y].reverse()[0],x=b.column.depth===m.depth;let S,O=!1;if(x&&b.column.parent?S=b.column.parent:(S=b.column,O=!0),w&&w?.column===S)w.subHeaders.push(b);else{const E=fN(n,S,{id:[r,p,S.id,b?.id].filter(Boolean).join("_"),isPlaceholder:O,placeholderId:O?`${y.filter(C=>C.column===S).length}`:void 0,depth:p,index:y.length});E.subHeaders.push(b),y.push(E)}m.headers.push(b),b.headerGroup=m}),u.push(m),p>0&&l(y,p-1)},c=t.map((h,p)=>fN(n,h,{depth:a,index:p}));l(c,a-1),u.reverse();const f=h=>h.filter(m=>m.column.getIsVisible()).map(m=>{let y=0,b=0,w=[0];m.subHeaders&&m.subHeaders.length?(w=[],f(m.subHeaders).forEach(S=>{let{colSpan:O,rowSpan:E}=S;y+=O,w.push(E)})):y=1;const x=Math.min(...w);return b=b+x,m.colSpan=y,m.rowSpan=b,{colSpan:y,rowSpan:b}});return f((i=(o=u[0])==null?void 0:o.headers)!=null?i:[]),u}const T5=(e,t,n,r,i,o,a)=>{let s={id:t,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(s._valuesCache.hasOwnProperty(u))return s._valuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return s._valuesCache[u]=l.accessorFn(s.original,r),s._valuesCache[u]},getUniqueValues:u=>{if(s._uniqueValuesCache.hasOwnProperty(u))return s._uniqueValuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return l.columnDef.getUniqueValues?(s._uniqueValuesCache[u]=l.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[u]):(s._uniqueValuesCache[u]=[s.getValue(u)],s._uniqueValuesCache[u])},renderValue:u=>{var l;return(l=s.getValue(u))!=null?l:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>THe(s.subRows,u=>u.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let u=[],l=s;for(;;){const c=l.getParentRow();if(!c)break;u.push(c),l=c}return u.reverse()},getAllCells:St(()=>[e.getAllLeafColumns()],u=>u.map(l=>MHe(e,s,l,l.id)),Ct(e.options,"debugRows")),_getAllCellsByColumnId:St(()=>[s.getAllCells()],u=>u.reduce((l,c)=>(l[c.column.id]=c,l),{}),Ct(e.options,"debugRows"))};for(let u=0;u{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},gY=(e,t,n)=>{var r,i;const o=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(o))};gY.autoRemove=e=>Ka(e);const mY=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};mY.autoRemove=e=>Ka(e);const vY=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};vY.autoRemove=e=>Ka(e);const yY=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};yY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const bY=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});bY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const xY=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});xY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const wY=(e,t,n)=>e.getValue(t)===n;wY.autoRemove=e=>Ka(e);const _Y=(e,t,n)=>e.getValue(t)==n;_Y.autoRemove=e=>Ka(e);const M5=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};M5.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(i)?1/0:i;if(o>a){const s=o;o=a,a=s}return[o,a]};M5.autoRemove=e=>Ka(e)||Ka(e[0])&&Ka(e[1]);const eu={includesString:gY,includesStringSensitive:mY,equalsString:vY,arrIncludes:yY,arrIncludesAll:bY,arrIncludesSome:xY,equals:wY,weakEquals:_Y,inNumberRange:M5};function Ka(e){return e==null||e===""}const IHe={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Wo("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?eu.includesString:typeof r=="number"?eu.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?eu.equals:Array.isArray(r)?eu.arrIncludes:eu.weakEquals},e.getFilterFn=()=>{var n,r;return N2(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:eu[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r?.find(c=>c.id===e.id),a=fl(n,o?o.value:void 0);if(dN(i,a,e)){var s;return(s=r?.filter(c=>c.id!==e.id))!=null?s:[]}const u={id:e.id,value:a};if(o){var l;return(l=r?.map(c=>c.id===e.id?u:c))!=null?l:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=fl(t,i))==null?void 0:o.filter(a=>{const s=n.find(u=>u.id===a.id);if(s){const u=s.getFilterFn();if(dN(u,a.value,s))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function dN(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const NHe=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),LHe=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},FHe=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r=o)&&(r=o)}),r},jHe=(e,t,n)=>{let r,i;return n.forEach(o=>{const a=o.getValue(e);a!=null&&(r===void 0?a>=a&&(r=i=a):(r>a&&(r=a),i{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},UHe=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!kHe(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,a)=>o-a);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},zHe=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),WHe=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,VHe=(e,t)=>t.length,U3={sum:NHe,min:LHe,max:FHe,extent:jHe,mean:BHe,median:UHe,unique:zHe,uniqueCount:WHe,count:VHe},HHe={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Wo("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return U3.sum;if(Object.prototype.toString.call(r)==="[object Date]")return U3.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return N2(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:U3[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function qHe(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(a=>a.id===o)).filter(Boolean),...r]}const KHe={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Wo("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=St(n=>[$0(t,n)],n=>n.findIndex(r=>r.id===e.id),Ct(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=$0(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=$0(t,n);return((r=i[i.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=St(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const a=[...t],s=[...i];for(;s.length&&a.length;){const u=a.shift(),l=s.findIndex(c=>c.id===u);l>-1&&o.push(s.splice(l,1)[0])}o=[...o,...s]}return qHe(o,n,r)},Ct(e.options,"debugTable"))}},z3=()=>({left:[],right:[]}),GHe={getInitialState:e=>({columnPinning:z3(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Wo("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,a;if(n==="right"){var s,u;return{left:((s=i?.left)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((u=i?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var l,c;return{left:[...((l=i?.left)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((c=i?.right)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((o=i?.left)!=null?o:[]).filter(f=>!(r!=null&&r.includes(f))),right:((a=i?.right)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,a;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(s=>s.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(s=>r?.includes(s)),a=n.some(s=>i?.includes(s));return o?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=St(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(a=>!o.includes(a.column.id))},Ct(t.options,"debugRows")),e.getLeftVisibleCells=St(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Ct(t.options,"debugRows")),e.getRightVisibleCells=St(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Ct(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?z3():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:z3())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=St(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Ct(e.options,"debugColumns")),e.getRightLeafColumns=St(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Ct(e.options,"debugColumns")),e.getCenterLeafColumns=St(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},Ct(e.options,"debugColumns"))}},Vy={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},W3=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),YHe={getDefaultColumnDef:()=>Vy,getInitialState:e=>({columnSizing:{},columnSizingInfo:W3(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Wo("columnSizing",e),onColumnSizingInfoChange:Wo("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Vy.minSize,(r=o??e.columnDef.size)!=null?r:Vy.size),(i=e.columnDef.maxSize)!=null?i:Vy.maxSize)},e.getStart=St(n=>[n,$0(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),Ct(t.options,"debugColumns")),e.getAfter=St(n=>[n,$0(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),Ct(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r?.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),V3(o)&&o.touches&&o.touches.length>1))return;const a=e.getSize(),s=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=V3(o)?Math.round(o.touches[0].clientX):o.clientX,l={},c=(w,x)=>{typeof x=="number"&&(t.setColumnSizingInfo(S=>{var O,E;const C=t.options.columnResizeDirection==="rtl"?-1:1,P=(x-((O=S?.startOffset)!=null?O:0))*C,M=Math.max(P/((E=S?.startSize)!=null?E:0),-.999999);return S.columnSizingStart.forEach(N=>{let[B,V]=N;l[B]=Math.round(Math.max(V+V*M,0)*100)/100}),{...S,deltaOffset:P,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...l})))},f=w=>c("move",w),h=w=>{c("end",w),t.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,m={moveHandler:w=>f(w.clientX),upHandler:w=>{p?.removeEventListener("mousemove",m.moveHandler),p?.removeEventListener("mouseup",m.upHandler),h(w.clientX)}},y={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),f(w.touches[0].clientX),!1),upHandler:w=>{var x;p?.removeEventListener("touchmove",y.moveHandler),p?.removeEventListener("touchend",y.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),h((x=w.touches[0])==null?void 0:x.clientX)}},b=ZHe()?{passive:!1}:!1;V3(o)?(p?.addEventListener("touchmove",y.moveHandler,b),p?.addEventListener("touchend",y.upHandler,b)):(p?.addEventListener("mousemove",m.moveHandler,b),p?.addEventListener("mouseup",m.upHandler,b)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?W3():(n=e.initialState.columnSizingInfo)!=null?n:W3())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let Hy=null;function ZHe(){if(typeof Hy=="boolean")return Hy;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Hy=e,Hy}function V3(e){return e.type==="touchstart"}const XHe={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Wo("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const i=e.columns;return(n=i.length?i.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=St(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ct(t.options,"debugRows")),e.getVisibleCells=St(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],Ct(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>St(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Ct(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function $0(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const QHe={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},JHe={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Wo("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>eu.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return N2(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:eu[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},eqe={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Wo("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const a=o.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(s=>{a[s]=!0}):a=r,n=(i=n)!=null?i:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){const{[e.id]:s,...u}=a;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},M4=0,R4=10,H3=()=>({pageIndex:M4,pageSize:R4}),tqe={getInitialState:e=>({...e,pagination:{...H3(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Wo("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>fl(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?H3():(i=e.initialState.pagination)!=null?i:H3())},e.setPageIndex=r=>{e.setPagination(i=>{let o=fl(r,i.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,a)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?M4:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:M4)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?R4:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:R4)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,fl(r,i.pageSize)),a=i.pageSize*i.pageIndex,s=Math.floor(a/o);return{...i,pageIndex:s,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let a=fl(r,(o=e.options.pageCount)!=null?o:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),e.getPageOptions=St(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,a)=>a)),i},Ct(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},q3=()=>({top:[],bottom:[]}),nqe={getInitialState:e=>({rowPinning:q3(),...e}),getDefaultOptions:e=>({onRowPinningChange:Wo("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(u=>{let{id:l}=u;return l}):[],a=i?e.getParentRows().map(u=>{let{id:l}=u;return l}):[],s=new Set([...a,e.id,...o]);t.setRowPinning(u=>{var l,c;if(n==="bottom"){var f,h;return{top:((f=u?.top)!=null?f:[]).filter(y=>!(s!=null&&s.has(y))),bottom:[...((h=u?.bottom)!=null?h:[]).filter(y=>!(s!=null&&s.has(y))),...Array.from(s)]}}if(n==="top"){var p,m;return{top:[...((p=u?.top)!=null?p:[]).filter(y=>!(s!=null&&s.has(y))),...Array.from(s)],bottom:((m=u?.bottom)!=null?m:[]).filter(y=>!(s!=null&&s.has(y)))}}return{top:((l=u?.top)!=null?l:[]).filter(y=>!(s!=null&&s.has(y))),bottom:((c=u?.bottom)!=null?c:[]).filter(y=>!(s!=null&&s.has(y)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(s=>r?.includes(s)),a=n.some(s=>i?.includes(s));return o?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:s}=a;return s});return(r=o?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?q3():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:q3())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(a=>{const s=e.getRow(a,!0);return s.getIsAllParentsExpanded()?s:null}):(n??[]).map(a=>t.find(s=>s.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=St(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Ct(e.options,"debugRows")),e.getBottomRows=St(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Ct(e.options,"debugRows")),e.getCenterRows=St(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},Ct(e.options,"debugRows"))}},rqe={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Wo("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{D4(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=St(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Ct(e.options,"debugTable")),e.getFilteredSelectedRowModel=St(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Ct(e.options,"debugTable")),e.getGroupedSelectedRowModel=St(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Ct(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const s={...o};return D4(s,e.id,n,(a=r?.selectChildren)!=null?a:!0,t),s})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return R5(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return $4(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return $4(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},D4=(e,t,n,r,i)=>{var o;const a=i.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=a.subRows)!=null&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(s=>D4(e,s.id,n,r,i))};function K3(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(a,s){return a.map(u=>{var l;const c=R5(u,n);if(c&&(r.push(u),i[u.id]=u),(l=u.subRows)!=null&&l.length&&(u={...u,subRows:o(u.subRows)}),c)return u}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function R5(e,t){var n;return(n=t[e.id])!=null?n:!1}function $4(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(a=>{if(!(o&&!i)&&(a.getCanSelect()&&(R5(a,t)?o=!0:i=!1),a.subRows&&a.subRows.length)){const s=$4(a,t);s==="all"?o=!0:(s==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const I4=/([0-9]+)/gm,iqe=(e,t,n)=>SY(Nl(e.getValue(n)).toLowerCase(),Nl(t.getValue(n)).toLowerCase()),oqe=(e,t,n)=>SY(Nl(e.getValue(n)),Nl(t.getValue(n))),aqe=(e,t,n)=>D5(Nl(e.getValue(n)).toLowerCase(),Nl(t.getValue(n)).toLowerCase()),sqe=(e,t,n)=>D5(Nl(e.getValue(n)),Nl(t.getValue(n))),uqe=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:rD5(e.getValue(n),t.getValue(n));function D5(e,t){return e===t?0:e>t?1:-1}function Nl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function SY(e,t){const n=e.split(I4).filter(Boolean),r=t.split(I4).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),a=parseInt(i,10),s=parseInt(o,10),u=[a,s].sort();if(isNaN(u[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(u[1]))return isNaN(a)?-1:1;if(a>s)return 1;if(s>a)return-1}return n.length-r.length}const Qp={alphanumeric:iqe,alphanumericCaseSensitive:oqe,text:aqe,textCaseSensitive:sqe,datetime:uqe,basic:lqe},cqe={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Wo("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i?.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Qp.datetime;if(typeof o=="string"&&(r=!0,o.split(I4).length>1))return Qp.alphanumeric}return r?Qp.text:Qp.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return N2(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Qp[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const s=a?.find(p=>p.id===e.id),u=a?.findIndex(p=>p.id===e.id);let l=[],c,f=o?n:i==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?s?c="toggle":c="add":a!=null&&a.length&&u!==a.length-1?c="replace":s?c="toggle":c="replace",c==="toggle"&&(o||i||(c="remove")),c==="add"){var h;l=[...a,{id:e.id,desc:f}],l.splice(0,l.length-((h=t.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else c==="toggle"?l=a.map(p=>p.id===e.id?{...p,desc:f}:p):c==="remove"?l=a.filter(p=>p.id!==e.id):l=[{id:e.id,desc:f}];return l})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:a==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},fqe=[DHe,XHe,KHe,GHe,$He,IHe,QHe,JHe,cqe,HHe,eqe,tqe,nqe,rqe,YHe];function dqe(e){var t,n;const r=[...fqe,...(t=e._features)!=null?t:[]];let i={_features:r};const o=i._features.reduce((h,p)=>Object.assign(h,p.getDefaultOptions==null?void 0:p.getDefaultOptions(i)),{}),a=h=>i.options.mergeOptions?i.options.mergeOptions(o,h):{...o,...h};let u={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(h=>{var p;u=(p=h.getInitialState==null?void 0:h.getInitialState(u))!=null?p:u});const l=[];let c=!1;const f={_features:r,options:{...o,...e},initialState:u,_queue:h=>{l.push(h),c||(c=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();c=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{i.setState(i.initialState)},setOptions:h=>{const p=fl(h,i.options);i.options=a(p)},getState:()=>i.options.state,setState:h=>{i.options.onStateChange==null||i.options.onStateChange(h)},_getRowId:(h,p,m)=>{var y;return(y=i.options.getRowId==null?void 0:i.options.getRowId(h,p,m))!=null?y:`${m?[m.id,p].join("."):p}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(h,p)=>{let m=(p?i.getPrePaginationRowModel():i.getRowModel()).rowsById[h];if(!m&&(m=i.getCoreRowModel().rowsById[h],!m))throw new Error;return m},_getDefaultColumnDef:St(()=>[i.options.defaultColumn],h=>{var p;return h=(p=h)!=null?p:{},{header:m=>{const y=m.header.column.columnDef;return y.accessorKey?y.accessorKey:y.accessorFn?y.id:null},cell:m=>{var y,b;return(y=(b=m.renderValue())==null||b.toString==null?void 0:b.toString())!=null?y:null},...i._features.reduce((m,y)=>Object.assign(m,y.getDefaultColumnDef==null?void 0:y.getDefaultColumnDef()),{}),...h}},Ct(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:St(()=>[i._getColumnDefs()],h=>{const p=function(m,y,b){return b===void 0&&(b=0),m.map(w=>{const x=RHe(i,w,b,y),S=w;return x.columns=S.columns?p(S.columns,x,b+1):[],x})};return p(h)},Ct(e,"debugColumns")),getAllFlatColumns:St(()=>[i.getAllColumns()],h=>h.flatMap(p=>p.getFlatColumns()),Ct(e,"debugColumns")),_getAllFlatColumnsById:St(()=>[i.getAllFlatColumns()],h=>h.reduce((p,m)=>(p[m.id]=m,p),{}),Ct(e,"debugColumns")),getAllLeafColumns:St(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(h,p)=>{let m=h.flatMap(y=>y.getLeafColumns());return p(m)},Ct(e,"debugColumns")),getColumn:h=>i._getAllFlatColumnsById()[h]};Object.assign(i,f);for(let h=0;hSt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,a){o===void 0&&(o=0);const s=[];for(let l=0;le._autoResetPageIndex()))}function hqe(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function CY(e,t,n){return n.options.filterFromLeafRows?pqe(e,t,n):gqe(e,t,n)}function pqe(e,t,n){var r;const i=[],o={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,s=function(u,l){l===void 0&&(l=0);const c=[];for(let h=0;hSt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,i)=>{if(!n.rows.length||!(r!=null&&r.length)&&!i)return n;const o=[...r.map(s=>s.id).filter(s=>s!==t),i?"__global__":void 0].filter(Boolean),a=s=>{for(let u=0;uSt(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let o=0;oSt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let h=0;h{var p;const m=e.getColumn(h.id);if(!m)return;const y=m.getFilterFn();y&&i.push({id:h.id,filterFn:y,resolvedValue:(p=y.resolveFilterValue==null?void 0:y.resolveFilterValue(h.value))!=null?p:h.value})});const a=(n??[]).map(h=>h.id),s=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());r&&s&&u.length&&(a.push("__global__"),u.forEach(h=>{var p;o.push({id:h.id,filterFn:s,resolvedValue:(p=s.resolveFilterValue==null?void 0:s.resolveFilterValue(r))!=null?p:r})}));let l,c;for(let h=0;h{p.columnFiltersMeta[y]=b})}if(o.length){for(let m=0;m{p.columnFiltersMeta[y]=b})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const f=h=>{for(let p=0;pe._autoResetPageIndex()))}function Stt(e){return t=>St(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:a,flatRows:s,rowsById:u}=r;const l=i*o,c=l+i;a=a.slice(l,c);let f;t.options.paginateExpandedRows?f={rows:a,flatRows:s,rowsById:u}:f=hqe({rows:a,flatRows:s,rowsById:u}),f.flatRows=[];const h=p=>{f.flatRows.push(p),p.subRows.length&&p.subRows.forEach(h)};return f.rows.forEach(h),f},Ct(t.options,"debugTable"))}function Ctt(){return e=>St(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(u=>{var l;return(l=e.getColumn(u.id))==null?void 0:l.getCanSort()}),a={};o.forEach(u=>{const l=e.getColumn(u.id);l&&(a[u.id]={sortUndefined:l.columnDef.sortUndefined,invertSorting:l.columnDef.invertSorting,sortingFn:l.getSortingFn()})});const s=u=>{const l=u.map(c=>({...c}));return l.sort((c,f)=>{for(let p=0;p{var f;i.push(c),(f=c.subRows)!=null&&f.length&&(c.subRows=s(c.subRows))}),l};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},Ct(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** + color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n?.key)}return i}}function Ct(e,t,n,r){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function MHe(e,t,n,r){const i=()=>{var a;return(a=o.getValue())!=null?a:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:St(()=>[e,n,t,o],(a,s,u,l)=>({table:a,column:s,row:u,cell:l,getValue:l.getValue,renderValue:l.renderValue}),Ct(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function RHe(e,t,n,r){var i,o;const s={...e._getDefaultColumnDef(),...t},u=s.accessorKey;let l=(i=(o=s.id)!=null?o:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?i:typeof s.header=="string"?s.header:void 0,c;if(s.accessorFn?c=s.accessorFn:u&&(u.includes(".")?c=h=>{let p=h;for(const y of u.split(".")){var m;p=(m=p)==null?void 0:m[y]}return p}:c=h=>h[s.accessorKey]),!l)throw new Error;let f={id:`${String(l)}`,accessorFn:c,parent:r,depth:n,columnDef:s,columns:[],getFlatColumns:St(()=>[!0],()=>{var h;return[f,...(h=f.columns)==null?void 0:h.flatMap(p=>p.getFlatColumns())]},Ct(e.options,"debugColumns")),getLeafColumns:St(()=>[e._getOrderColumnsFn()],h=>{var p;if((p=f.columns)!=null&&p.length){let m=f.columns.flatMap(y=>y.getLeafColumns());return h(m)}return[f]},Ct(e.options,"debugColumns"))};for(const h of e._features)h.createColumn==null||h.createColumn(f,e);return f}const Si="debugHeaders";function fN(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],s=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(s),a.push(u)};return s(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const DHe={createTable:e=>{e.getHeaderGroups=St(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,a;const s=(o=r?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?o:[],u=(a=i?.map(f=>n.find(h=>h.id===f)).filter(Boolean))!=null?a:[],l=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(i!=null&&i.includes(f.id)));return Wy(t,[...s,...l,...u],e)},Ct(e.options,Si)),e.getCenterHeaderGroups=St(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),Wy(t,n,e,"center")),Ct(e.options,Si)),e.getLeftHeaderGroups=St(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?i:[];return Wy(t,o,e,"left")},Ct(e.options,Si)),e.getRightHeaderGroups=St(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r?.map(a=>n.find(s=>s.id===a)).filter(Boolean))!=null?i:[];return Wy(t,o,e,"right")},Ct(e.options,Si)),e.getFooterGroups=St(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ct(e.options,Si)),e.getLeftFooterGroups=St(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ct(e.options,Si)),e.getCenterFooterGroups=St(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ct(e.options,Si)),e.getRightFooterGroups=St(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ct(e.options,Si)),e.getFlatHeaders=St(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ct(e.options,Si)),e.getLeftFlatHeaders=St(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ct(e.options,Si)),e.getCenterFlatHeaders=St(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ct(e.options,Si)),e.getRightFlatHeaders=St(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ct(e.options,Si)),e.getCenterLeafHeaders=St(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ct(e.options,Si)),e.getLeftLeafHeaders=St(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ct(e.options,Si)),e.getRightLeafHeaders=St(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ct(e.options,Si)),e.getLeafHeaders=St(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,a,s,u,l;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(a=(s=n[0])==null?void 0:s.headers)!=null?a:[],...(u=(l=r[0])==null?void 0:l.headers)!=null?u:[]].map(c=>c.getLeafHeaders()).flat()},Ct(e.options,Si))}};function Wy(e,t,n,r){var i,o;let a=0;const s=function(h,p){p===void 0&&(p=1),a=Math.max(a,p),h.filter(m=>m.getIsVisible()).forEach(m=>{var y;(y=m.columns)!=null&&y.length&&s(m.columns,p+1)},0)};s(e);let u=[];const l=(h,p)=>{const m={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},y=[];h.forEach(b=>{const w=[...y].reverse()[0],x=b.column.depth===m.depth;let S,O=!1;if(x&&b.column.parent?S=b.column.parent:(S=b.column,O=!0),w&&w?.column===S)w.subHeaders.push(b);else{const E=fN(n,S,{id:[r,p,S.id,b?.id].filter(Boolean).join("_"),isPlaceholder:O,placeholderId:O?`${y.filter(C=>C.column===S).length}`:void 0,depth:p,index:y.length});E.subHeaders.push(b),y.push(E)}m.headers.push(b),b.headerGroup=m}),u.push(m),p>0&&l(y,p-1)},c=t.map((h,p)=>fN(n,h,{depth:a,index:p}));l(c,a-1),u.reverse();const f=h=>h.filter(m=>m.column.getIsVisible()).map(m=>{let y=0,b=0,w=[0];m.subHeaders&&m.subHeaders.length?(w=[],f(m.subHeaders).forEach(S=>{let{colSpan:O,rowSpan:E}=S;y+=O,w.push(E)})):y=1;const x=Math.min(...w);return b=b+x,m.colSpan=y,m.rowSpan=b,{colSpan:y,rowSpan:b}});return f((i=(o=u[0])==null?void 0:o.headers)!=null?i:[]),u}const T5=(e,t,n,r,i,o,a)=>{let s={id:t,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(s._valuesCache.hasOwnProperty(u))return s._valuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return s._valuesCache[u]=l.accessorFn(s.original,r),s._valuesCache[u]},getUniqueValues:u=>{if(s._uniqueValuesCache.hasOwnProperty(u))return s._uniqueValuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return l.columnDef.getUniqueValues?(s._uniqueValuesCache[u]=l.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[u]):(s._uniqueValuesCache[u]=[s.getValue(u)],s._uniqueValuesCache[u])},renderValue:u=>{var l;return(l=s.getValue(u))!=null?l:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>THe(s.subRows,u=>u.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let u=[],l=s;for(;;){const c=l.getParentRow();if(!c)break;u.push(c),l=c}return u.reverse()},getAllCells:St(()=>[e.getAllLeafColumns()],u=>u.map(l=>MHe(e,s,l,l.id)),Ct(e.options,"debugRows")),_getAllCellsByColumnId:St(()=>[s.getAllCells()],u=>u.reduce((l,c)=>(l[c.column.id]=c,l),{}),Ct(e.options,"debugRows"))};for(let u=0;u{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},gY=(e,t,n)=>{var r,i;const o=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(o))};gY.autoRemove=e=>Ka(e);const mY=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};mY.autoRemove=e=>Ka(e);const vY=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};vY.autoRemove=e=>Ka(e);const yY=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};yY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const bY=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});bY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const xY=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});xY.autoRemove=e=>Ka(e)||!(e!=null&&e.length);const wY=(e,t,n)=>e.getValue(t)===n;wY.autoRemove=e=>Ka(e);const _Y=(e,t,n)=>e.getValue(t)==n;_Y.autoRemove=e=>Ka(e);const M5=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};M5.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(i)?1/0:i;if(o>a){const s=o;o=a,a=s}return[o,a]};M5.autoRemove=e=>Ka(e)||Ka(e[0])&&Ka(e[1]);const eu={includesString:gY,includesStringSensitive:mY,equalsString:vY,arrIncludes:yY,arrIncludesAll:bY,arrIncludesSome:xY,equals:wY,weakEquals:_Y,inNumberRange:M5};function Ka(e){return e==null||e===""}const IHe={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Wo("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?eu.includesString:typeof r=="number"?eu.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?eu.equals:Array.isArray(r)?eu.arrIncludes:eu.weakEquals},e.getFilterFn=()=>{var n,r;return N2(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:eu[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r?.find(c=>c.id===e.id),a=fl(n,o?o.value:void 0);if(dN(i,a,e)){var s;return(s=r?.filter(c=>c.id!==e.id))!=null?s:[]}const u={id:e.id,value:a};if(o){var l;return(l=r?.map(c=>c.id===e.id?u:c))!=null?l:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=fl(t,i))==null?void 0:o.filter(a=>{const s=n.find(u=>u.id===a.id);if(s){const u=s.getFilterFn();if(dN(u,a.value,s))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function dN(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const NHe=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),LHe=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},FHe=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r=o)&&(r=o)}),r},jHe=(e,t,n)=>{let r,i;return n.forEach(o=>{const a=o.getValue(e);a!=null&&(r===void 0?a>=a&&(r=i=a):(r>a&&(r=a),i{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},UHe=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!kHe(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,a)=>o-a);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},zHe=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),WHe=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,VHe=(e,t)=>t.length,U3={sum:NHe,min:LHe,max:FHe,extent:jHe,mean:BHe,median:UHe,unique:zHe,uniqueCount:WHe,count:VHe},HHe={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Wo("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return U3.sum;if(Object.prototype.toString.call(r)==="[object Date]")return U3.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return N2(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:U3[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function qHe(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(a=>a.id===o)).filter(Boolean),...r]}const KHe={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Wo("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=St(n=>[$0(t,n)],n=>n.findIndex(r=>r.id===e.id),Ct(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=$0(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=$0(t,n);return((r=i[i.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=St(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const a=[...t],s=[...i];for(;s.length&&a.length;){const u=a.shift(),l=s.findIndex(c=>c.id===u);l>-1&&o.push(s.splice(l,1)[0])}o=[...o,...s]}return qHe(o,n,r)},Ct(e.options,"debugTable"))}},z3=()=>({left:[],right:[]}),GHe={getInitialState:e=>({columnPinning:z3(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Wo("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,a;if(n==="right"){var s,u;return{left:((s=i?.left)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((u=i?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var l,c;return{left:[...((l=i?.left)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((c=i?.right)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((o=i?.left)!=null?o:[]).filter(f=>!(r!=null&&r.includes(f))),right:((a=i?.right)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,a;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(s=>s.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(s=>r?.includes(s)),a=n.some(s=>i?.includes(s));return o?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=St(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(a=>!o.includes(a.column.id))},Ct(t.options,"debugRows")),e.getLeftVisibleCells=St(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Ct(t.options,"debugRows")),e.getRightVisibleCells=St(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Ct(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?z3():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:z3())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=St(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Ct(e.options,"debugColumns")),e.getRightLeafColumns=St(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Ct(e.options,"debugColumns")),e.getCenterLeafColumns=St(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},Ct(e.options,"debugColumns"))}},Vy={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},W3=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),YHe={getDefaultColumnDef:()=>Vy,getInitialState:e=>({columnSizing:{},columnSizingInfo:W3(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Wo("columnSizing",e),onColumnSizingInfoChange:Wo("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Vy.minSize,(r=o??e.columnDef.size)!=null?r:Vy.size),(i=e.columnDef.maxSize)!=null?i:Vy.maxSize)},e.getStart=St(n=>[n,$0(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),Ct(t.options,"debugColumns")),e.getAfter=St(n=>[n,$0(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),Ct(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r?.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),V3(o)&&o.touches&&o.touches.length>1))return;const a=e.getSize(),s=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=V3(o)?Math.round(o.touches[0].clientX):o.clientX,l={},c=(w,x)=>{typeof x=="number"&&(t.setColumnSizingInfo(S=>{var O,E;const C=t.options.columnResizeDirection==="rtl"?-1:1,P=(x-((O=S?.startOffset)!=null?O:0))*C,M=Math.max(P/((E=S?.startSize)!=null?E:0),-.999999);return S.columnSizingStart.forEach(N=>{let[B,V]=N;l[B]=Math.round(Math.max(V+V*M,0)*100)/100}),{...S,deltaOffset:P,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...l})))},f=w=>c("move",w),h=w=>{c("end",w),t.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,m={moveHandler:w=>f(w.clientX),upHandler:w=>{p?.removeEventListener("mousemove",m.moveHandler),p?.removeEventListener("mouseup",m.upHandler),h(w.clientX)}},y={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),f(w.touches[0].clientX),!1),upHandler:w=>{var x;p?.removeEventListener("touchmove",y.moveHandler),p?.removeEventListener("touchend",y.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),h((x=w.touches[0])==null?void 0:x.clientX)}},b=ZHe()?{passive:!1}:!1;V3(o)?(p?.addEventListener("touchmove",y.moveHandler,b),p?.addEventListener("touchend",y.upHandler,b)):(p?.addEventListener("mousemove",m.moveHandler,b),p?.addEventListener("mouseup",m.upHandler,b)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?W3():(n=e.initialState.columnSizingInfo)!=null?n:W3())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let Hy=null;function ZHe(){if(typeof Hy=="boolean")return Hy;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Hy=e,Hy}function V3(e){return e.type==="touchstart"}const XHe={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Wo("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const i=e.columns;return(n=i.length?i.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=St(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ct(t.options,"debugRows")),e.getVisibleCells=St(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],Ct(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>St(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Ct(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function $0(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const QHe={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},JHe={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Wo("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>eu.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return N2(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:eu[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},eqe={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Wo("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const a=o.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(s=>{a[s]=!0}):a=r,n=(i=n)!=null?i:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){const{[e.id]:s,...u}=a;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},M4=0,R4=10,H3=()=>({pageIndex:M4,pageSize:R4}),tqe={getInitialState:e=>({...e,pagination:{...H3(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Wo("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>fl(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?H3():(i=e.initialState.pagination)!=null?i:H3())},e.setPageIndex=r=>{e.setPagination(i=>{let o=fl(r,i.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,a)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?M4:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:M4)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?R4:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:R4)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,fl(r,i.pageSize)),a=i.pageSize*i.pageIndex,s=Math.floor(a/o);return{...i,pageIndex:s,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let a=fl(r,(o=e.options.pageCount)!=null?o:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),e.getPageOptions=St(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,a)=>a)),i},Ct(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},q3=()=>({top:[],bottom:[]}),nqe={getInitialState:e=>({rowPinning:q3(),...e}),getDefaultOptions:e=>({onRowPinningChange:Wo("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(u=>{let{id:l}=u;return l}):[],a=i?e.getParentRows().map(u=>{let{id:l}=u;return l}):[],s=new Set([...a,e.id,...o]);t.setRowPinning(u=>{var l,c;if(n==="bottom"){var f,h;return{top:((f=u?.top)!=null?f:[]).filter(y=>!(s!=null&&s.has(y))),bottom:[...((h=u?.bottom)!=null?h:[]).filter(y=>!(s!=null&&s.has(y))),...Array.from(s)]}}if(n==="top"){var p,m;return{top:[...((p=u?.top)!=null?p:[]).filter(y=>!(s!=null&&s.has(y))),...Array.from(s)],bottom:((m=u?.bottom)!=null?m:[]).filter(y=>!(s!=null&&s.has(y)))}}return{top:((l=u?.top)!=null?l:[]).filter(y=>!(s!=null&&s.has(y))),bottom:((c=u?.bottom)!=null?c:[]).filter(y=>!(s!=null&&s.has(y)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(s=>r?.includes(s)),a=n.some(s=>i?.includes(s));return o?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:s}=a;return s});return(r=o?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?q3():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:q3())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(a=>{const s=e.getRow(a,!0);return s.getIsAllParentsExpanded()?s:null}):(n??[]).map(a=>t.find(s=>s.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=St(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Ct(e.options,"debugRows")),e.getBottomRows=St(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Ct(e.options,"debugRows")),e.getCenterRows=St(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},Ct(e.options,"debugRows"))}},rqe={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Wo("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{D4(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=St(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Ct(e.options,"debugTable")),e.getFilteredSelectedRowModel=St(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Ct(e.options,"debugTable")),e.getGroupedSelectedRowModel=St(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?K3(e,n):{rows:[],flatRows:[],rowsById:{}},Ct(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const s={...o};return D4(s,e.id,n,(a=r?.selectChildren)!=null?a:!0,t),s})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return R5(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return $4(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return $4(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},D4=(e,t,n,r,i)=>{var o;const a=i.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=a.subRows)!=null&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(s=>D4(e,s.id,n,r,i))};function K3(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(a,s){return a.map(u=>{var l;const c=R5(u,n);if(c&&(r.push(u),i[u.id]=u),(l=u.subRows)!=null&&l.length&&(u={...u,subRows:o(u.subRows)}),c)return u}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function R5(e,t){var n;return(n=t[e.id])!=null?n:!1}function $4(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(a=>{if(!(o&&!i)&&(a.getCanSelect()&&(R5(a,t)?o=!0:i=!1),a.subRows&&a.subRows.length)){const s=$4(a,t);s==="all"?o=!0:(s==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const I4=/([0-9]+)/gm,iqe=(e,t,n)=>SY(Nl(e.getValue(n)).toLowerCase(),Nl(t.getValue(n)).toLowerCase()),oqe=(e,t,n)=>SY(Nl(e.getValue(n)),Nl(t.getValue(n))),aqe=(e,t,n)=>D5(Nl(e.getValue(n)).toLowerCase(),Nl(t.getValue(n)).toLowerCase()),sqe=(e,t,n)=>D5(Nl(e.getValue(n)),Nl(t.getValue(n))),uqe=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:rD5(e.getValue(n),t.getValue(n));function D5(e,t){return e===t?0:e>t?1:-1}function Nl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function SY(e,t){const n=e.split(I4).filter(Boolean),r=t.split(I4).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),a=parseInt(i,10),s=parseInt(o,10),u=[a,s].sort();if(isNaN(u[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(u[1]))return isNaN(a)?-1:1;if(a>s)return 1;if(s>a)return-1}return n.length-r.length}const Qp={alphanumeric:iqe,alphanumericCaseSensitive:oqe,text:aqe,textCaseSensitive:sqe,datetime:uqe,basic:lqe},cqe={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Wo("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i?.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Qp.datetime;if(typeof o=="string"&&(r=!0,o.split(I4).length>1))return Qp.alphanumeric}return r?Qp.text:Qp.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return N2(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Qp[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const s=a?.find(p=>p.id===e.id),u=a?.findIndex(p=>p.id===e.id);let l=[],c,f=o?n:i==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?s?c="toggle":c="add":a!=null&&a.length&&u!==a.length-1?c="replace":s?c="toggle":c="replace",c==="toggle"&&(o||i||(c="remove")),c==="add"){var h;l=[...a,{id:e.id,desc:f}],l.splice(0,l.length-((h=t.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else c==="toggle"?l=a.map(p=>p.id===e.id?{...p,desc:f}:p):c==="remove"?l=a.filter(p=>p.id!==e.id):l=[{id:e.id,desc:f}];return l})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:a==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},fqe=[DHe,XHe,KHe,GHe,$He,IHe,QHe,JHe,cqe,HHe,eqe,tqe,nqe,rqe,YHe];function dqe(e){var t,n;const r=[...fqe,...(t=e._features)!=null?t:[]];let i={_features:r};const o=i._features.reduce((h,p)=>Object.assign(h,p.getDefaultOptions==null?void 0:p.getDefaultOptions(i)),{}),a=h=>i.options.mergeOptions?i.options.mergeOptions(o,h):{...o,...h};let u={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(h=>{var p;u=(p=h.getInitialState==null?void 0:h.getInitialState(u))!=null?p:u});const l=[];let c=!1;const f={_features:r,options:{...o,...e},initialState:u,_queue:h=>{l.push(h),c||(c=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();c=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{i.setState(i.initialState)},setOptions:h=>{const p=fl(h,i.options);i.options=a(p)},getState:()=>i.options.state,setState:h=>{i.options.onStateChange==null||i.options.onStateChange(h)},_getRowId:(h,p,m)=>{var y;return(y=i.options.getRowId==null?void 0:i.options.getRowId(h,p,m))!=null?y:`${m?[m.id,p].join("."):p}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(h,p)=>{let m=(p?i.getPrePaginationRowModel():i.getRowModel()).rowsById[h];if(!m&&(m=i.getCoreRowModel().rowsById[h],!m))throw new Error;return m},_getDefaultColumnDef:St(()=>[i.options.defaultColumn],h=>{var p;return h=(p=h)!=null?p:{},{header:m=>{const y=m.header.column.columnDef;return y.accessorKey?y.accessorKey:y.accessorFn?y.id:null},cell:m=>{var y,b;return(y=(b=m.renderValue())==null||b.toString==null?void 0:b.toString())!=null?y:null},...i._features.reduce((m,y)=>Object.assign(m,y.getDefaultColumnDef==null?void 0:y.getDefaultColumnDef()),{}),...h}},Ct(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:St(()=>[i._getColumnDefs()],h=>{const p=function(m,y,b){return b===void 0&&(b=0),m.map(w=>{const x=RHe(i,w,b,y),S=w;return x.columns=S.columns?p(S.columns,x,b+1):[],x})};return p(h)},Ct(e,"debugColumns")),getAllFlatColumns:St(()=>[i.getAllColumns()],h=>h.flatMap(p=>p.getFlatColumns()),Ct(e,"debugColumns")),_getAllFlatColumnsById:St(()=>[i.getAllFlatColumns()],h=>h.reduce((p,m)=>(p[m.id]=m,p),{}),Ct(e,"debugColumns")),getAllLeafColumns:St(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(h,p)=>{let m=h.flatMap(y=>y.getLeafColumns());return p(m)},Ct(e,"debugColumns")),getColumn:h=>i._getAllFlatColumnsById()[h]};Object.assign(i,f);for(let h=0;hSt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,a){o===void 0&&(o=0);const s=[];for(let l=0;le._autoResetPageIndex()))}function hqe(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function CY(e,t,n){return n.options.filterFromLeafRows?pqe(e,t,n):gqe(e,t,n)}function pqe(e,t,n){var r;const i=[],o={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,s=function(u,l){l===void 0&&(l=0);const c=[];for(let h=0;hSt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,i)=>{if(!n.rows.length||!(r!=null&&r.length)&&!i)return n;const o=[...r.map(s=>s.id).filter(s=>s!==t),i?"__global__":void 0].filter(Boolean),a=s=>{for(let u=0;uSt(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let o=0;oSt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let h=0;h{var p;const m=e.getColumn(h.id);if(!m)return;const y=m.getFilterFn();y&&i.push({id:h.id,filterFn:y,resolvedValue:(p=y.resolveFilterValue==null?void 0:y.resolveFilterValue(h.value))!=null?p:h.value})});const a=(n??[]).map(h=>h.id),s=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());r&&s&&u.length&&(a.push("__global__"),u.forEach(h=>{var p;o.push({id:h.id,filterFn:s,resolvedValue:(p=s.resolveFilterValue==null?void 0:s.resolveFilterValue(r))!=null?p:r})}));let l,c;for(let h=0;h{p.columnFiltersMeta[y]=b})}if(o.length){for(let m=0;m{p.columnFiltersMeta[y]=b})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const f=h=>{for(let p=0;pe._autoResetPageIndex()))}function Ctt(e){return t=>St(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:a,flatRows:s,rowsById:u}=r;const l=i*o,c=l+i;a=a.slice(l,c);let f;t.options.paginateExpandedRows?f={rows:a,flatRows:s,rowsById:u}:f=hqe({rows:a,flatRows:s,rowsById:u}),f.flatRows=[];const h=p=>{f.flatRows.push(p),p.subRows.length&&p.subRows.forEach(h)};return f.rows.forEach(h),f},Ct(t.options,"debugTable"))}function Ett(){return e=>St(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(u=>{var l;return(l=e.getColumn(u.id))==null?void 0:l.getCanSort()}),a={};o.forEach(u=>{const l=e.getColumn(u.id);l&&(a[u.id]={sortUndefined:l.columnDef.sortUndefined,invertSorting:l.columnDef.invertSorting,sortingFn:l.getSortingFn()})});const s=u=>{const l=u.map(c=>({...c}));return l.sort((c,f)=>{for(let p=0;p{var f;i.push(c),(f=c.subRows)!=null&&f.length&&(c.subRows=s(c.subRows))}),l};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},Ct(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** * react-table * * Copyright (c) TanStack @@ -558,13 +563,13 @@ Defaulting to \`null\`.`}var mtt=fY,vtt=hY;/** * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ett(e,t){return e?mqe(e)?v.createElement(e,t):e:null}function mqe(e){return vqe(e)||typeof e=="function"||yqe(e)}function vqe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function yqe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Ott(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=v.useState(()=>({current:dqe(t)})),[r,i]=v.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:a=>{i(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}function bqe(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function xqe(e){const[t,n]=v.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var $5="Switch",[wqe,Att]=Di($5),[_qe,Sqe]=wqe($5),EY=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:u="on",onCheckedChange:l,form:c,...f}=e,[h,p]=v.useState(null),m=Nt(t,S=>p(S)),y=v.useRef(!1),b=h?c||!!h.closest("form"):!0,[w=!1,x]=Ts({prop:i,defaultProp:o,onChange:l});return I.jsxs(_qe,{scope:n,checked:w,disabled:s,children:[I.jsx(gt.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":PY(w),"data-disabled":s?"":void 0,disabled:s,value:u,...f,ref:m,onClick:Ye(e.onClick,S=>{x(O=>!O),b&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),b&&I.jsx(Cqe,{control:h,bubbles:!y.current,name:r,value:u,checked:w,required:a,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});EY.displayName=$5;var OY="SwitchThumb",AY=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Sqe(OY,n);return I.jsx(gt.span,{"data-state":PY(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});AY.displayName=OY;var Cqe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=v.useRef(null),a=bqe(n),s=xqe(t);return v.useEffect(()=>{const u=o.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(a!==n&&f){const h=new Event("click",{bubbles:r});f.call(u,n),u.dispatchEvent(h)}},[a,n,r]),I.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function PY(e){return e?"checked":"unchecked"}var Ptt=EY,ktt=AY;const kY=Object.freeze({left:0,top:0,width:16,height:16}),Lx=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),I5=Object.freeze({...kY,...Lx}),N4=Object.freeze({...I5,body:"",hidden:!1});function Eqe(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function hN(e,t){const n=Eqe(e,t);for(const r in N4)r in Lx?r in e&&!(r in n)&&(n[r]=Lx[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Oqe(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function o(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const s=r[a]&&r[a].parent,u=s&&o(s);u&&(i[a]=[s].concat(u))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(o),i}function Aqe(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let o={};function a(s){o=hN(r[s]||i[s],o)}return a(t),n.forEach(a),hN(e,o)}function TY(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=Oqe(e);for(const i in r){const o=r[i];o&&(t(i,Aqe(e,i,o)),n.push(i))}return n}const Pqe={provider:"",aliases:{},not_found:{},...kY};function G3(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function MY(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!G3(e,Pqe))return null;const n=t.icons;for(const i in n){const o=n[i];if(!i||typeof o.body!="string"||!G3(o,N4))return null}const r=t.aliases||Object.create(null);for(const i in r){const o=r[i],a=o.parent;if(!i||typeof a!="string"||!n[a]&&!r[a]||!G3(o,N4))return null}return t}const RY=/^[a-z0-9]+(-[a-z0-9]+)*$/,L2=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const s=i.pop(),u=i.pop(),l={provider:i.length>0?i[0]:r,prefix:u,name:s};return t&&!w1(l)?null:l}const o=i[0],a=o.split("-");if(a.length>1){const s={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!w1(s)?null:s}if(n&&r===""){const s={provider:r,prefix:"",name:o};return t&&!w1(s,n)?null:s}return null},w1=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,pN=Object.create(null);function kqe(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function cf(e,t){const n=pN[e]||(pN[e]=Object.create(null));return n[t]||(n[t]=kqe(e,t))}function N5(e,t){return MY(t)?TY(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Tqe(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let um=!1;function DY(e){return typeof e=="boolean"&&(um=e),um}function gN(e){const t=typeof e=="string"?L2(e,!0,um):e;if(t){const n=cf(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Mqe(e,t){const n=L2(e,!0,um);if(!n)return!1;const r=cf(n.provider,n.prefix);return t?Tqe(r,n.name,t):(r.missing.add(n.name),!0)}function Rqe(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),um&&!t&&!e.prefix){let i=!1;return MY(e)&&(e.prefix="",TY(e,(o,a)=>{Mqe(o,a)&&(i=!0)})),i}const n=e.prefix;if(!w1({provider:t,prefix:n,name:"a"}))return!1;const r=cf(t,n);return!!N5(r,e)}const $Y=Object.freeze({width:null,height:null}),IY=Object.freeze({...$Y,...Lx}),Dqe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,$qe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function mN(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Dqe);if(r===null||!r.length)return e;const i=[];let o=r.shift(),a=$qe.test(o);for(;;){if(a){const s=parseFloat(o);isNaN(s)?i.push(o):i.push(Math.ceil(s*t*n)/n)}else i.push(o);if(o=r.shift(),o===void 0)return i.join("");a=!a}}function Iqe(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),o=e.indexOf("",o);if(a===-1)break;n+=e.slice(i+1,o).trim(),e=e.slice(0,r).trim()+e.slice(a+1)}return{defs:n,content:e}}function Nqe(e,t){return e?""+e+""+t:t}function Lqe(e,t,n){const r=Iqe(e);return Nqe(r.defs,t+r.content+n)}const Fqe=e=>e==="unset"||e==="undefined"||e==="none";function jqe(e,t){const n={...I5,...e},r={...IY,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let o=n.body;[n,r].forEach(y=>{const b=[],w=y.hFlip,x=y.vFlip;let S=y.rotate;w?x?S+=2:(b.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),b.push("scale(-1 1)"),i.top=i.left=0):x&&(b.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),b.push("scale(1 -1)"),i.top=i.left=0);let O;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:O=i.height/2+i.top,b.unshift("rotate(90 "+O.toString()+" "+O.toString()+")");break;case 2:b.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:O=i.width/2+i.left,b.unshift("rotate(-90 "+O.toString()+" "+O.toString()+")");break}S%2===1&&(i.left!==i.top&&(O=i.left,i.left=i.top,i.top=O),i.width!==i.height&&(O=i.width,i.width=i.height,i.height=O)),b.length&&(o=Lqe(o,'',""))});const a=r.width,s=r.height,u=i.width,l=i.height;let c,f;a===null?(f=s===null?"1em":s==="auto"?l:s,c=mN(f,u/l)):(c=a==="auto"?u:a,f=s===null?mN(c,l/u):s==="auto"?l:s);const h={},p=(y,b)=>{Fqe(b)||(h[y]=b.toString())};p("width",c),p("height",f);const m=[i.left,i.top,u,l];return h.viewBox=m.join(" "),{attributes:h,viewBox:m,body:o}}const Bqe=/\sid="(\S+)"/g,Uqe="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let zqe=0;function Wqe(e,t=Uqe){const n=[];let r;for(;r=Bqe.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(o=>{const a=typeof t=="function"?t(o):t+(zqe++).toString(),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const L4=Object.create(null);function Vqe(e,t){L4[e]=t}function F4(e){return L4[e]||L4[""]}function L5(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const F5=Object.create(null),Jp=["https://api.simplesvg.com","https://api.unisvg.com"],_1=[];for(;Jp.length>0;)Jp.length===1||Math.random()>.5?_1.push(Jp.shift()):_1.push(Jp.pop());F5[""]=L5({resources:["https://api.iconify.design"].concat(_1)});function Hqe(e,t){const n=L5(t);return n===null?!1:(F5[e]=n,!0)}function j5(e){return F5[e]}const qqe=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let vN=qqe();function Kqe(e,t){const n=j5(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const o=t+".json?icons=";r=n.maxURL-i-n.path.length-o.length}return r}function Gqe(e){return e===404}const Yqe=(e,t,n)=>{const r=[],i=Kqe(e,t),o="icons";let a={type:o,provider:e,prefix:t,icons:[]},s=0;return n.forEach((u,l)=>{s+=u.length+1,s>=i&&l>0&&(r.push(a),a={type:o,provider:e,prefix:t,icons:[]},s=u.length),a.icons.push(u)}),r.push(a),r};function Zqe(e){if(typeof e=="string"){const t=j5(e);if(t)return t.path}return"/"}const Xqe=(e,t,n)=>{if(!vN){n("abort",424);return}let r=Zqe(t.provider);switch(t.type){case"icons":{const o=t.prefix,s=t.icons.join(","),u=new URLSearchParams({icons:s});r+=o+".json?"+u.toString();break}case"custom":{const o=t.uri;r+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n("abort",400);return}let i=503;vN(e+r).then(o=>{const a=o.status;if(a!==200){setTimeout(()=>{n(Gqe(a)?"abort":"next",a)});return}return i=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?n("abort",o):n("next",i)});return}setTimeout(()=>{n("success",o)})}).catch(()=>{n("next",i)})},Qqe={prepare:Yqe,send:Xqe};function Jqe(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,o)=>i.provider!==o.provider?i.provider.localeCompare(o.provider):i.prefix!==o.prefix?i.prefix.localeCompare(o.prefix):i.name.localeCompare(o.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const o=i.provider,a=i.prefix,s=i.name,u=n[o]||(n[o]=Object.create(null)),l=u[a]||(u[a]=cf(o,a));let c;s in l.icons?c=t.loaded:a===""||l.missing.has(s)?c=t.missing:c=t.pending;const f={provider:o,prefix:a,name:s};c.push(f)}),t}function NY(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function eKe(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(o=>{const a=o.icons,s=a.pending.length;a.pending=a.pending.filter(u=>{if(u.prefix!==i)return!0;const l=u.name;if(e.icons[l])a.loaded.push({provider:r,prefix:i,name:l});else if(e.missing.has(l))a.missing.push({provider:r,prefix:i,name:l});else return n=!0,!0;return!1}),a.pending.length!==s&&(n||NY([e],o.id),o.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),o.abort))})}))}let tKe=0;function nKe(e,t,n){const r=tKe++,i=NY.bind(null,n,r);if(!t.pending.length)return i;const o={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(o)}),i}function rKe(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const o=typeof i=="string"?L2(i,t,n):i;o&&r.push(o)}),r}var iKe={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function oKe(e,t,n,r){const i=e.resources.length,o=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let C=e.resources.slice(0);for(a=[];C.length>1;){const P=Math.floor(Math.random()*C.length);a.push(C[P]),C=C.slice(0,P).concat(C.slice(P+1))}a=a.concat(C)}else a=e.resources.slice(o).concat(e.resources.slice(0,o));const s=Date.now();let u="pending",l=0,c,f=null,h=[],p=[];typeof r=="function"&&p.push(r);function m(){f&&(clearTimeout(f),f=null)}function y(){u==="pending"&&(u="aborted"),m(),h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function b(C,P){P&&(p=[]),typeof C=="function"&&p.push(C)}function w(){return{startTime:s,payload:t,status:u,queriesSent:l,queriesPending:h.length,subscribe:b,abort:y}}function x(){u="failed",p.forEach(C=>{C(void 0,c)})}function S(){h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function O(C,P,M){const N=P!=="success";switch(h=h.filter(B=>B!==C),u){case"pending":break;case"failed":if(N||!e.dataAfterTimeout)return;break;default:return}if(P==="abort"){c=M,x();return}if(N){c=M,h.length||(a.length?E():x());return}if(m(),S(),!e.random){const B=e.resources.indexOf(C.resource);B!==-1&&B!==e.index&&(e.index=B)}u="completed",p.forEach(B=>{B(M)})}function E(){if(u!=="pending")return;m();const C=a.shift();if(C===void 0){if(h.length){f=setTimeout(()=>{m(),u==="pending"&&(S(),x())},e.timeout);return}x();return}const P={status:"pending",resource:C,callback:(M,N)=>{O(P,M,N)}};h.push(P),l++,f=setTimeout(E,e.rotate),n(C,t,P.callback)}return setTimeout(E),w}function LY(e){const t={...iKe,...e};let n=[];function r(){n=n.filter(s=>s().status==="pending")}function i(s,u,l){const c=oKe(t,s,u,(f,h)=>{r(),l&&l(f,h)});return n.push(c),c}function o(s){return n.find(u=>s(u))||null}return{query:i,find:o,setIndex:s=>{t.index=s},getIndex:()=>t.index,cleanup:r}}function yN(){}const Y3=Object.create(null);function aKe(e){if(!Y3[e]){const t=j5(e);if(!t)return;const n=LY(t),r={config:t,redundancy:n};Y3[e]=r}return Y3[e]}function sKe(e,t,n){let r,i;if(typeof e=="string"){const o=F4(e);if(!o)return n(void 0,424),yN;i=o.send;const a=aKe(e);a&&(r=a.redundancy)}else{const o=L5(e);if(o){r=LY(o);const a=e.resources?e.resources[0]:"",s=F4(a);s&&(i=s.send)}}return!r||!i?(n(void 0,424),yN):r.query(t,i,n)().abort}const bN="iconify2",lm="iconify",FY=lm+"-count",xN=lm+"-version",jY=36e5,uKe=168,lKe=50;function j4(e,t){try{return e.getItem(t)}catch{}}function B5(e,t,n){try{return e.setItem(t,n),!0}catch{}}function wN(e,t){try{e.removeItem(t)}catch{}}function B4(e,t){return B5(e,FY,t.toString())}function U4(e){return parseInt(j4(e,FY))||0}const F2={local:!0,session:!0},BY={local:new Set,session:new Set};let U5=!1;function cKe(e){U5=e}let qy=typeof window>"u"?{}:window;function UY(e){const t=e+"Storage";try{if(qy&&qy[t]&&typeof qy[t].length=="number")return qy[t]}catch{}F2[e]=!1}function zY(e,t){const n=UY(e);if(!n)return;const r=j4(n,xN);if(r!==bN){if(r){const s=U4(n);for(let u=0;u{const u=lm+s.toString(),l=j4(n,u);if(typeof l=="string"){try{const c=JSON.parse(l);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>i&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,s))return!0}catch{}wN(n,u)}};let a=U4(n);for(let s=a-1;s>=0;s--)o(s)||(s===a-1?(a--,B4(n,a)):BY[e].add(s))}function WY(){if(!U5){cKe(!0);for(const e in F2)zY(e,t=>{const n=t.data,r=t.provider,i=n.prefix,o=cf(r,i);if(!N5(o,n).length)return!1;const a=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,a):a,!0})}}function fKe(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in F2)zY(r,i=>{const o=i.data;return i.provider!==e.provider||o.prefix!==e.prefix||o.lastModified===t});return!0}function dKe(e,t){U5||WY();function n(r){let i;if(!F2[r]||!(i=UY(r)))return;const o=BY[r];let a;if(o.size)o.delete(a=Array.from(o).shift());else if(a=U4(i),a>=lKe||!B4(i,a+1))return;const s={cached:Math.floor(Date.now()/jY),provider:e.provider,data:t};return B5(i,lm+a.toString(),JSON.stringify(s))}t.lastModified&&!fKe(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function hKe(){}function pKe(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,eKe(e)}))}function gKe(e){const t=[],n=[];return e.forEach(r=>{(r.match(RY)?t:n).push(r)}),{valid:t,invalid:n}}function e0(e,t,n,r){function i(){const o=e.pendingIcons;t.forEach(a=>{o&&o.delete(a),e.icons[a]||e.missing.add(a)})}if(n&&typeof n=="object")try{if(!N5(e,n).length){i();return}r&&dKe(e,n)}catch(o){console.error(o)}i(),pKe(e)}function _N(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function mKe(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const o=e.loadIcon;if(e.loadIcons&&(i.length>1||!o)){_N(e.loadIcons(i,r,n),c=>{e0(e,i,c,!1)});return}if(o){i.forEach(c=>{const f=o(c,r,n);_N(f,h=>{const p=h?{prefix:r,icons:{[c]:h}}:null;e0(e,[c],p,!1)})});return}const{valid:a,invalid:s}=gKe(i);if(s.length&&e0(e,s,null,!1),!a.length)return;const u=r.match(RY)?F4(n):null;if(!u){e0(e,a,null,!1);return}u.prepare(n,r,a).forEach(c=>{sKe(n,c,f=>{e0(e,c.icons,f,!0)})})}))}const vKe=(e,t)=>{const n=rKe(e,!0,DY()),r=Jqe(n);if(!r.pending.length){let u=!0;return setTimeout(()=>{u&&t(r.loaded,r.missing,r.pending,hKe)}),()=>{u=!1}}const i=Object.create(null),o=[];let a,s;return r.pending.forEach(u=>{const{provider:l,prefix:c}=u;if(c===s&&l===a)return;a=l,s=c,o.push(cf(l,c));const f=i[l]||(i[l]=Object.create(null));f[c]||(f[c]=[])}),r.pending.forEach(u=>{const{provider:l,prefix:c,name:f}=u,h=cf(l,c),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(f)||(p.add(f),i[l][c].push(f))}),o.forEach(u=>{const l=i[u.provider][u.prefix];l.length&&mKe(u,l)}),nKe(t,r,o)};function yKe(e,t){const n={...e};for(const r in t){const i=t[r],o=typeof i;r in $Y?(i===null||i&&(o==="string"||o==="number"))&&(n[r]=i):o===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const bKe=/[\s,]+/;function xKe(e,t){t.split(bKe).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function wKe(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let o=parseFloat(e.slice(0,e.length-n.length));return isNaN(o)?0:(o=o/i,o%1===0?r(o):0)}}return t}function _Ke(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'"+e+""}function SKe(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function CKe(e){return"data:image/svg+xml,"+SKe(e)}function EKe(e){return'url("'+CKe(e)+'")'}let I0;function OKe(){try{I0=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{I0=null}}function AKe(e){return I0===void 0&&OKe(),I0?I0.createHTML(e):e}const VY={...IY,inline:!1},PKe={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},kKe={display:"inline-block"},z4={backgroundColor:"currentColor"},HY={backgroundColor:"transparent"},SN={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},CN={WebkitMask:z4,mask:z4,background:HY};for(const e in CN){const t=CN[e];for(const n in SN)t[e+n]=SN[n]}const TKe={...VY,inline:!0};function EN(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const MKe=(e,t,n)=>{const r=t.inline?TKe:VY,i=yKe(r,t),o=t.mode||"svg",a={},s=t.style||{},u={...o==="svg"?PKe:{}};if(n){const b=L2(n,!1,!0);if(b){const w=["iconify"],x=["provider","prefix"];for(const S of x)b[S]&&w.push("iconify--"+b[S]);u.className=w.join(" ")}}for(let b in t){const w=t[b];if(w!==void 0)switch(b){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":u.ref=w;break;case"className":u[b]=(u[b]?u[b]+" ":"")+w;break;case"inline":case"hFlip":case"vFlip":i[b]=w===!0||w==="true"||w===1;break;case"flip":typeof w=="string"&&xKe(i,w);break;case"color":a.color=w;break;case"rotate":typeof w=="string"?i[b]=wKe(w):typeof w=="number"&&(i[b]=w);break;case"ariaHidden":case"aria-hidden":w!==!0&&w!=="true"&&delete u["aria-hidden"];break;default:r[b]===void 0&&(u[b]=w)}}const l=jqe(e,i),c=l.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),o==="svg"){u.style={...a,...s},Object.assign(u,c);let b=0,w=t.id;return typeof w=="string"&&(w=w.replace(/-/g,"_")),u.dangerouslySetInnerHTML={__html:AKe(Wqe(l.body,w?()=>w+"ID"+b++:"iconifyReact"))},v.createElement("svg",u)}const{body:f,width:h,height:p}=e,m=o==="mask"||(o==="bg"?!1:f.indexOf("currentColor")!==-1),y=_Ke(f,{...c,width:h+"",height:p+""});return u.style={...a,"--svg":EKe(y),width:EN(c.width),height:EN(c.height),...kKe,...m?z4:HY,...s},v.createElement("span",u)};DY(!0);Vqe("",Qqe);if(typeof document<"u"&&typeof window<"u"){WY();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!Rqe(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;Hqe(n,i)||console.error(r)}catch{console.error(r)}}}}function qY(e){const[t,n]=v.useState(!!e.ssr),[r,i]=v.useState({});function o(p){if(p){const m=e.icon;if(typeof m=="object")return{name:"",data:m};const y=gN(m);if(y)return{name:m,data:y}}return{name:""}}const[a,s]=v.useState(o(!!e.ssr));function u(){const p=r.callback;p&&(p(),i({}))}function l(p){if(JSON.stringify(a)!==JSON.stringify(p))return u(),s(p),!0}function c(){var p;const m=e.icon;if(typeof m=="object"){l({name:"",data:m});return}const y=gN(m);if(l({name:m,data:y}))if(y===void 0){const b=vKe([m],c);i({callback:b})}else y&&((p=e.onLoad)===null||p===void 0||p.call(e,m))}v.useEffect(()=>(n(!0),u),[]),v.useEffect(()=>{t&&c()},[e.icon,t]);const{name:f,data:h}=a;return h?MKe({...I5,...h},e,f):e.children?e.children:v.createElement("span",{})}const Ttt=v.forwardRef((e,t)=>qY({...e,_ref:t}));v.forwardRef((e,t)=>qY({inline:!0,...e,_ref:t}));var KY="AlertDialog",[RKe,Mtt]=Di(KY,[uz]),Du=uz(),GY=e=>{const{__scopeAlertDialog:t,...n}=e,r=Du(t);return I.jsx(yve,{...r,...n,modal:!0})};GY.displayName=KY;var DKe="AlertDialogTrigger",YY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(bve,{...i,...r,ref:t})});YY.displayName=DKe;var $Ke="AlertDialogPortal",ZY=e=>{const{__scopeAlertDialog:t,...n}=e,r=Du(t);return I.jsx(xve,{...r,...n})};ZY.displayName=$Ke;var IKe="AlertDialogOverlay",XY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(wve,{...i,...r,ref:t})});XY.displayName=IKe;var jd="AlertDialogContent",[NKe,LKe]=RKe(jd),QY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Du(n),a=v.useRef(null),s=Nt(t,a),u=v.useRef(null);return I.jsx(pve,{contentName:jd,titleName:JY,docsSlug:"alert-dialog",children:I.jsx(NKe,{scope:n,cancelRef:u,children:I.jsxs(_ve,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Ye(i.onOpenAutoFocus,l=>{l.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:[I.jsx(ZO,{children:r}),I.jsx(jKe,{contentRef:a})]})})})});QY.displayName=jd;var JY="AlertDialogTitle",eZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Sve,{...i,...r,ref:t})});eZ.displayName=JY;var tZ="AlertDialogDescription",nZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Cve,{...i,...r,ref:t})});nZ.displayName=tZ;var FKe="AlertDialogAction",rZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Cz,{...i,...r,ref:t})});rZ.displayName=FKe;var iZ="AlertDialogCancel",oZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=LKe(iZ,n),o=Du(n),a=Nt(t,i);return I.jsx(Cz,{...o,...r,ref:a})});oZ.displayName=iZ;var jKe=({contentRef:e})=>{const t=`\`${jd}\` requires a description for the component to be accessible for screen reader users. + */function Ott(e,t){return e?mqe(e)?v.createElement(e,t):e:null}function mqe(e){return vqe(e)||typeof e=="function"||yqe(e)}function vqe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function yqe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Att(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=v.useState(()=>({current:dqe(t)})),[r,i]=v.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:a=>{i(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}function bqe(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function xqe(e){const[t,n]=v.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var $5="Switch",[wqe,Ptt]=Di($5),[_qe,Sqe]=wqe($5),EY=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:u="on",onCheckedChange:l,form:c,...f}=e,[h,p]=v.useState(null),m=Nt(t,S=>p(S)),y=v.useRef(!1),b=h?c||!!h.closest("form"):!0,[w=!1,x]=Ts({prop:i,defaultProp:o,onChange:l});return I.jsxs(_qe,{scope:n,checked:w,disabled:s,children:[I.jsx(gt.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":PY(w),"data-disabled":s?"":void 0,disabled:s,value:u,...f,ref:m,onClick:Ye(e.onClick,S=>{x(O=>!O),b&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),b&&I.jsx(Cqe,{control:h,bubbles:!y.current,name:r,value:u,checked:w,required:a,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});EY.displayName=$5;var OY="SwitchThumb",AY=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Sqe(OY,n);return I.jsx(gt.span,{"data-state":PY(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});AY.displayName=OY;var Cqe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=v.useRef(null),a=bqe(n),s=xqe(t);return v.useEffect(()=>{const u=o.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(a!==n&&f){const h=new Event("click",{bubbles:r});f.call(u,n),u.dispatchEvent(h)}},[a,n,r]),I.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function PY(e){return e?"checked":"unchecked"}var ktt=EY,Ttt=AY;const kY=Object.freeze({left:0,top:0,width:16,height:16}),Lx=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),I5=Object.freeze({...kY,...Lx}),N4=Object.freeze({...I5,body:"",hidden:!1});function Eqe(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function hN(e,t){const n=Eqe(e,t);for(const r in N4)r in Lx?r in e&&!(r in n)&&(n[r]=Lx[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Oqe(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function o(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const s=r[a]&&r[a].parent,u=s&&o(s);u&&(i[a]=[s].concat(u))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(o),i}function Aqe(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let o={};function a(s){o=hN(r[s]||i[s],o)}return a(t),n.forEach(a),hN(e,o)}function TY(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=Oqe(e);for(const i in r){const o=r[i];o&&(t(i,Aqe(e,i,o)),n.push(i))}return n}const Pqe={provider:"",aliases:{},not_found:{},...kY};function G3(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function MY(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!G3(e,Pqe))return null;const n=t.icons;for(const i in n){const o=n[i];if(!i||typeof o.body!="string"||!G3(o,N4))return null}const r=t.aliases||Object.create(null);for(const i in r){const o=r[i],a=o.parent;if(!i||typeof a!="string"||!n[a]&&!r[a]||!G3(o,N4))return null}return t}const RY=/^[a-z0-9]+(-[a-z0-9]+)*$/,L2=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const s=i.pop(),u=i.pop(),l={provider:i.length>0?i[0]:r,prefix:u,name:s};return t&&!w1(l)?null:l}const o=i[0],a=o.split("-");if(a.length>1){const s={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!w1(s)?null:s}if(n&&r===""){const s={provider:r,prefix:"",name:o};return t&&!w1(s,n)?null:s}return null},w1=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,pN=Object.create(null);function kqe(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function cf(e,t){const n=pN[e]||(pN[e]=Object.create(null));return n[t]||(n[t]=kqe(e,t))}function N5(e,t){return MY(t)?TY(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Tqe(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let um=!1;function DY(e){return typeof e=="boolean"&&(um=e),um}function gN(e){const t=typeof e=="string"?L2(e,!0,um):e;if(t){const n=cf(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Mqe(e,t){const n=L2(e,!0,um);if(!n)return!1;const r=cf(n.provider,n.prefix);return t?Tqe(r,n.name,t):(r.missing.add(n.name),!0)}function Rqe(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),um&&!t&&!e.prefix){let i=!1;return MY(e)&&(e.prefix="",TY(e,(o,a)=>{Mqe(o,a)&&(i=!0)})),i}const n=e.prefix;if(!w1({provider:t,prefix:n,name:"a"}))return!1;const r=cf(t,n);return!!N5(r,e)}const $Y=Object.freeze({width:null,height:null}),IY=Object.freeze({...$Y,...Lx}),Dqe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,$qe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function mN(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Dqe);if(r===null||!r.length)return e;const i=[];let o=r.shift(),a=$qe.test(o);for(;;){if(a){const s=parseFloat(o);isNaN(s)?i.push(o):i.push(Math.ceil(s*t*n)/n)}else i.push(o);if(o=r.shift(),o===void 0)return i.join("");a=!a}}function Iqe(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),o=e.indexOf("",o);if(a===-1)break;n+=e.slice(i+1,o).trim(),e=e.slice(0,r).trim()+e.slice(a+1)}return{defs:n,content:e}}function Nqe(e,t){return e?""+e+""+t:t}function Lqe(e,t,n){const r=Iqe(e);return Nqe(r.defs,t+r.content+n)}const Fqe=e=>e==="unset"||e==="undefined"||e==="none";function jqe(e,t){const n={...I5,...e},r={...IY,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let o=n.body;[n,r].forEach(y=>{const b=[],w=y.hFlip,x=y.vFlip;let S=y.rotate;w?x?S+=2:(b.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),b.push("scale(-1 1)"),i.top=i.left=0):x&&(b.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),b.push("scale(1 -1)"),i.top=i.left=0);let O;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:O=i.height/2+i.top,b.unshift("rotate(90 "+O.toString()+" "+O.toString()+")");break;case 2:b.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:O=i.width/2+i.left,b.unshift("rotate(-90 "+O.toString()+" "+O.toString()+")");break}S%2===1&&(i.left!==i.top&&(O=i.left,i.left=i.top,i.top=O),i.width!==i.height&&(O=i.width,i.width=i.height,i.height=O)),b.length&&(o=Lqe(o,'',""))});const a=r.width,s=r.height,u=i.width,l=i.height;let c,f;a===null?(f=s===null?"1em":s==="auto"?l:s,c=mN(f,u/l)):(c=a==="auto"?u:a,f=s===null?mN(c,l/u):s==="auto"?l:s);const h={},p=(y,b)=>{Fqe(b)||(h[y]=b.toString())};p("width",c),p("height",f);const m=[i.left,i.top,u,l];return h.viewBox=m.join(" "),{attributes:h,viewBox:m,body:o}}const Bqe=/\sid="(\S+)"/g,Uqe="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let zqe=0;function Wqe(e,t=Uqe){const n=[];let r;for(;r=Bqe.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(o=>{const a=typeof t=="function"?t(o):t+(zqe++).toString(),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const L4=Object.create(null);function Vqe(e,t){L4[e]=t}function F4(e){return L4[e]||L4[""]}function L5(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const F5=Object.create(null),Jp=["https://api.simplesvg.com","https://api.unisvg.com"],_1=[];for(;Jp.length>0;)Jp.length===1||Math.random()>.5?_1.push(Jp.shift()):_1.push(Jp.pop());F5[""]=L5({resources:["https://api.iconify.design"].concat(_1)});function Hqe(e,t){const n=L5(t);return n===null?!1:(F5[e]=n,!0)}function j5(e){return F5[e]}const qqe=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let vN=qqe();function Kqe(e,t){const n=j5(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const o=t+".json?icons=";r=n.maxURL-i-n.path.length-o.length}return r}function Gqe(e){return e===404}const Yqe=(e,t,n)=>{const r=[],i=Kqe(e,t),o="icons";let a={type:o,provider:e,prefix:t,icons:[]},s=0;return n.forEach((u,l)=>{s+=u.length+1,s>=i&&l>0&&(r.push(a),a={type:o,provider:e,prefix:t,icons:[]},s=u.length),a.icons.push(u)}),r.push(a),r};function Zqe(e){if(typeof e=="string"){const t=j5(e);if(t)return t.path}return"/"}const Xqe=(e,t,n)=>{if(!vN){n("abort",424);return}let r=Zqe(t.provider);switch(t.type){case"icons":{const o=t.prefix,s=t.icons.join(","),u=new URLSearchParams({icons:s});r+=o+".json?"+u.toString();break}case"custom":{const o=t.uri;r+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n("abort",400);return}let i=503;vN(e+r).then(o=>{const a=o.status;if(a!==200){setTimeout(()=>{n(Gqe(a)?"abort":"next",a)});return}return i=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?n("abort",o):n("next",i)});return}setTimeout(()=>{n("success",o)})}).catch(()=>{n("next",i)})},Qqe={prepare:Yqe,send:Xqe};function Jqe(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,o)=>i.provider!==o.provider?i.provider.localeCompare(o.provider):i.prefix!==o.prefix?i.prefix.localeCompare(o.prefix):i.name.localeCompare(o.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const o=i.provider,a=i.prefix,s=i.name,u=n[o]||(n[o]=Object.create(null)),l=u[a]||(u[a]=cf(o,a));let c;s in l.icons?c=t.loaded:a===""||l.missing.has(s)?c=t.missing:c=t.pending;const f={provider:o,prefix:a,name:s};c.push(f)}),t}function NY(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function eKe(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(o=>{const a=o.icons,s=a.pending.length;a.pending=a.pending.filter(u=>{if(u.prefix!==i)return!0;const l=u.name;if(e.icons[l])a.loaded.push({provider:r,prefix:i,name:l});else if(e.missing.has(l))a.missing.push({provider:r,prefix:i,name:l});else return n=!0,!0;return!1}),a.pending.length!==s&&(n||NY([e],o.id),o.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),o.abort))})}))}let tKe=0;function nKe(e,t,n){const r=tKe++,i=NY.bind(null,n,r);if(!t.pending.length)return i;const o={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(o)}),i}function rKe(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const o=typeof i=="string"?L2(i,t,n):i;o&&r.push(o)}),r}var iKe={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function oKe(e,t,n,r){const i=e.resources.length,o=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let C=e.resources.slice(0);for(a=[];C.length>1;){const P=Math.floor(Math.random()*C.length);a.push(C[P]),C=C.slice(0,P).concat(C.slice(P+1))}a=a.concat(C)}else a=e.resources.slice(o).concat(e.resources.slice(0,o));const s=Date.now();let u="pending",l=0,c,f=null,h=[],p=[];typeof r=="function"&&p.push(r);function m(){f&&(clearTimeout(f),f=null)}function y(){u==="pending"&&(u="aborted"),m(),h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function b(C,P){P&&(p=[]),typeof C=="function"&&p.push(C)}function w(){return{startTime:s,payload:t,status:u,queriesSent:l,queriesPending:h.length,subscribe:b,abort:y}}function x(){u="failed",p.forEach(C=>{C(void 0,c)})}function S(){h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function O(C,P,M){const N=P!=="success";switch(h=h.filter(B=>B!==C),u){case"pending":break;case"failed":if(N||!e.dataAfterTimeout)return;break;default:return}if(P==="abort"){c=M,x();return}if(N){c=M,h.length||(a.length?E():x());return}if(m(),S(),!e.random){const B=e.resources.indexOf(C.resource);B!==-1&&B!==e.index&&(e.index=B)}u="completed",p.forEach(B=>{B(M)})}function E(){if(u!=="pending")return;m();const C=a.shift();if(C===void 0){if(h.length){f=setTimeout(()=>{m(),u==="pending"&&(S(),x())},e.timeout);return}x();return}const P={status:"pending",resource:C,callback:(M,N)=>{O(P,M,N)}};h.push(P),l++,f=setTimeout(E,e.rotate),n(C,t,P.callback)}return setTimeout(E),w}function LY(e){const t={...iKe,...e};let n=[];function r(){n=n.filter(s=>s().status==="pending")}function i(s,u,l){const c=oKe(t,s,u,(f,h)=>{r(),l&&l(f,h)});return n.push(c),c}function o(s){return n.find(u=>s(u))||null}return{query:i,find:o,setIndex:s=>{t.index=s},getIndex:()=>t.index,cleanup:r}}function yN(){}const Y3=Object.create(null);function aKe(e){if(!Y3[e]){const t=j5(e);if(!t)return;const n=LY(t),r={config:t,redundancy:n};Y3[e]=r}return Y3[e]}function sKe(e,t,n){let r,i;if(typeof e=="string"){const o=F4(e);if(!o)return n(void 0,424),yN;i=o.send;const a=aKe(e);a&&(r=a.redundancy)}else{const o=L5(e);if(o){r=LY(o);const a=e.resources?e.resources[0]:"",s=F4(a);s&&(i=s.send)}}return!r||!i?(n(void 0,424),yN):r.query(t,i,n)().abort}const bN="iconify2",lm="iconify",FY=lm+"-count",xN=lm+"-version",jY=36e5,uKe=168,lKe=50;function j4(e,t){try{return e.getItem(t)}catch{}}function B5(e,t,n){try{return e.setItem(t,n),!0}catch{}}function wN(e,t){try{e.removeItem(t)}catch{}}function B4(e,t){return B5(e,FY,t.toString())}function U4(e){return parseInt(j4(e,FY))||0}const F2={local:!0,session:!0},BY={local:new Set,session:new Set};let U5=!1;function cKe(e){U5=e}let qy=typeof window>"u"?{}:window;function UY(e){const t=e+"Storage";try{if(qy&&qy[t]&&typeof qy[t].length=="number")return qy[t]}catch{}F2[e]=!1}function zY(e,t){const n=UY(e);if(!n)return;const r=j4(n,xN);if(r!==bN){if(r){const s=U4(n);for(let u=0;u{const u=lm+s.toString(),l=j4(n,u);if(typeof l=="string"){try{const c=JSON.parse(l);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>i&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,s))return!0}catch{}wN(n,u)}};let a=U4(n);for(let s=a-1;s>=0;s--)o(s)||(s===a-1?(a--,B4(n,a)):BY[e].add(s))}function WY(){if(!U5){cKe(!0);for(const e in F2)zY(e,t=>{const n=t.data,r=t.provider,i=n.prefix,o=cf(r,i);if(!N5(o,n).length)return!1;const a=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,a):a,!0})}}function fKe(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in F2)zY(r,i=>{const o=i.data;return i.provider!==e.provider||o.prefix!==e.prefix||o.lastModified===t});return!0}function dKe(e,t){U5||WY();function n(r){let i;if(!F2[r]||!(i=UY(r)))return;const o=BY[r];let a;if(o.size)o.delete(a=Array.from(o).shift());else if(a=U4(i),a>=lKe||!B4(i,a+1))return;const s={cached:Math.floor(Date.now()/jY),provider:e.provider,data:t};return B5(i,lm+a.toString(),JSON.stringify(s))}t.lastModified&&!fKe(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function hKe(){}function pKe(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,eKe(e)}))}function gKe(e){const t=[],n=[];return e.forEach(r=>{(r.match(RY)?t:n).push(r)}),{valid:t,invalid:n}}function e0(e,t,n,r){function i(){const o=e.pendingIcons;t.forEach(a=>{o&&o.delete(a),e.icons[a]||e.missing.add(a)})}if(n&&typeof n=="object")try{if(!N5(e,n).length){i();return}r&&dKe(e,n)}catch(o){console.error(o)}i(),pKe(e)}function _N(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function mKe(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const o=e.loadIcon;if(e.loadIcons&&(i.length>1||!o)){_N(e.loadIcons(i,r,n),c=>{e0(e,i,c,!1)});return}if(o){i.forEach(c=>{const f=o(c,r,n);_N(f,h=>{const p=h?{prefix:r,icons:{[c]:h}}:null;e0(e,[c],p,!1)})});return}const{valid:a,invalid:s}=gKe(i);if(s.length&&e0(e,s,null,!1),!a.length)return;const u=r.match(RY)?F4(n):null;if(!u){e0(e,a,null,!1);return}u.prepare(n,r,a).forEach(c=>{sKe(n,c,f=>{e0(e,c.icons,f,!0)})})}))}const vKe=(e,t)=>{const n=rKe(e,!0,DY()),r=Jqe(n);if(!r.pending.length){let u=!0;return setTimeout(()=>{u&&t(r.loaded,r.missing,r.pending,hKe)}),()=>{u=!1}}const i=Object.create(null),o=[];let a,s;return r.pending.forEach(u=>{const{provider:l,prefix:c}=u;if(c===s&&l===a)return;a=l,s=c,o.push(cf(l,c));const f=i[l]||(i[l]=Object.create(null));f[c]||(f[c]=[])}),r.pending.forEach(u=>{const{provider:l,prefix:c,name:f}=u,h=cf(l,c),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(f)||(p.add(f),i[l][c].push(f))}),o.forEach(u=>{const l=i[u.provider][u.prefix];l.length&&mKe(u,l)}),nKe(t,r,o)};function yKe(e,t){const n={...e};for(const r in t){const i=t[r],o=typeof i;r in $Y?(i===null||i&&(o==="string"||o==="number"))&&(n[r]=i):o===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const bKe=/[\s,]+/;function xKe(e,t){t.split(bKe).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function wKe(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let o=parseFloat(e.slice(0,e.length-n.length));return isNaN(o)?0:(o=o/i,o%1===0?r(o):0)}}return t}function _Ke(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'"+e+""}function SKe(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function CKe(e){return"data:image/svg+xml,"+SKe(e)}function EKe(e){return'url("'+CKe(e)+'")'}let I0;function OKe(){try{I0=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{I0=null}}function AKe(e){return I0===void 0&&OKe(),I0?I0.createHTML(e):e}const VY={...IY,inline:!1},PKe={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},kKe={display:"inline-block"},z4={backgroundColor:"currentColor"},HY={backgroundColor:"transparent"},SN={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},CN={WebkitMask:z4,mask:z4,background:HY};for(const e in CN){const t=CN[e];for(const n in SN)t[e+n]=SN[n]}const TKe={...VY,inline:!0};function EN(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const MKe=(e,t,n)=>{const r=t.inline?TKe:VY,i=yKe(r,t),o=t.mode||"svg",a={},s=t.style||{},u={...o==="svg"?PKe:{}};if(n){const b=L2(n,!1,!0);if(b){const w=["iconify"],x=["provider","prefix"];for(const S of x)b[S]&&w.push("iconify--"+b[S]);u.className=w.join(" ")}}for(let b in t){const w=t[b];if(w!==void 0)switch(b){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":u.ref=w;break;case"className":u[b]=(u[b]?u[b]+" ":"")+w;break;case"inline":case"hFlip":case"vFlip":i[b]=w===!0||w==="true"||w===1;break;case"flip":typeof w=="string"&&xKe(i,w);break;case"color":a.color=w;break;case"rotate":typeof w=="string"?i[b]=wKe(w):typeof w=="number"&&(i[b]=w);break;case"ariaHidden":case"aria-hidden":w!==!0&&w!=="true"&&delete u["aria-hidden"];break;default:r[b]===void 0&&(u[b]=w)}}const l=jqe(e,i),c=l.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),o==="svg"){u.style={...a,...s},Object.assign(u,c);let b=0,w=t.id;return typeof w=="string"&&(w=w.replace(/-/g,"_")),u.dangerouslySetInnerHTML={__html:AKe(Wqe(l.body,w?()=>w+"ID"+b++:"iconifyReact"))},v.createElement("svg",u)}const{body:f,width:h,height:p}=e,m=o==="mask"||(o==="bg"?!1:f.indexOf("currentColor")!==-1),y=_Ke(f,{...c,width:h+"",height:p+""});return u.style={...a,"--svg":EKe(y),width:EN(c.width),height:EN(c.height),...kKe,...m?z4:HY,...s},v.createElement("span",u)};DY(!0);Vqe("",Qqe);if(typeof document<"u"&&typeof window<"u"){WY();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!Rqe(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;Hqe(n,i)||console.error(r)}catch{console.error(r)}}}}function qY(e){const[t,n]=v.useState(!!e.ssr),[r,i]=v.useState({});function o(p){if(p){const m=e.icon;if(typeof m=="object")return{name:"",data:m};const y=gN(m);if(y)return{name:m,data:y}}return{name:""}}const[a,s]=v.useState(o(!!e.ssr));function u(){const p=r.callback;p&&(p(),i({}))}function l(p){if(JSON.stringify(a)!==JSON.stringify(p))return u(),s(p),!0}function c(){var p;const m=e.icon;if(typeof m=="object"){l({name:"",data:m});return}const y=gN(m);if(l({name:m,data:y}))if(y===void 0){const b=vKe([m],c);i({callback:b})}else y&&((p=e.onLoad)===null||p===void 0||p.call(e,m))}v.useEffect(()=>(n(!0),u),[]),v.useEffect(()=>{t&&c()},[e.icon,t]);const{name:f,data:h}=a;return h?MKe({...I5,...h},e,f):e.children?e.children:v.createElement("span",{})}const Mtt=v.forwardRef((e,t)=>qY({...e,_ref:t}));v.forwardRef((e,t)=>qY({inline:!0,...e,_ref:t}));var KY="AlertDialog",[RKe,Rtt]=Di(KY,[uz]),Du=uz(),GY=e=>{const{__scopeAlertDialog:t,...n}=e,r=Du(t);return I.jsx(yve,{...r,...n,modal:!0})};GY.displayName=KY;var DKe="AlertDialogTrigger",YY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(bve,{...i,...r,ref:t})});YY.displayName=DKe;var $Ke="AlertDialogPortal",ZY=e=>{const{__scopeAlertDialog:t,...n}=e,r=Du(t);return I.jsx(xve,{...r,...n})};ZY.displayName=$Ke;var IKe="AlertDialogOverlay",XY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(wve,{...i,...r,ref:t})});XY.displayName=IKe;var jd="AlertDialogContent",[NKe,LKe]=RKe(jd),QY=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Du(n),a=v.useRef(null),s=Nt(t,a),u=v.useRef(null);return I.jsx(pve,{contentName:jd,titleName:JY,docsSlug:"alert-dialog",children:I.jsx(NKe,{scope:n,cancelRef:u,children:I.jsxs(_ve,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Ye(i.onOpenAutoFocus,l=>{l.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:[I.jsx(ZO,{children:r}),I.jsx(jKe,{contentRef:a})]})})})});QY.displayName=jd;var JY="AlertDialogTitle",eZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Sve,{...i,...r,ref:t})});eZ.displayName=JY;var tZ="AlertDialogDescription",nZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Cve,{...i,...r,ref:t})});nZ.displayName=tZ;var FKe="AlertDialogAction",rZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Du(n);return I.jsx(Cz,{...i,...r,ref:t})});rZ.displayName=FKe;var iZ="AlertDialogCancel",oZ=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=LKe(iZ,n),o=Du(n),a=Nt(t,i);return I.jsx(Cz,{...o,...r,ref:a})});oZ.displayName=iZ;var jKe=({contentRef:e})=>{const t=`\`${jd}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${jd}\` by passing a \`${tZ}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${jd}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Rtt=GY,Dtt=YY,$tt=ZY,Itt=XY,Ntt=QY,Ltt=rZ,Ftt=oZ,jtt=eZ,Btt=nZ;function cs(){return cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:0,n=(li[e[t+0]]+li[e[t+1]]+li[e[t+2]]+li[e[t+3]]+"-"+li[e[t+4]]+li[e[t+5]]+"-"+li[e[t+6]]+li[e[t+7]]+"-"+li[e[t+8]]+li[e[t+9]]+"-"+li[e[t+10]]+li[e[t+11]]+li[e[t+12]]+li[e[t+13]]+li[e[t+14]]+li[e[t+15]]).toLowerCase();if(!WKe(n))throw TypeError("Stringified UUID is invalid");return n}function aZ(e,t,n){e=e||{};var r=e.random||(e.rng||UKe)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,VKe(r)}function Pr(e){return v.createElement("i",{className:"rmel-iconfont rmel-icon-"+e.type})}function HKe(e){return v.createElement("div",{className:"rc-md-navigation "+(e.visible?"visible":"in-visible")},v.createElement("div",{className:"navigation-nav left"},v.createElement("div",{className:"button-wrap"},e.left)),v.createElement("div",{className:"navigation-nav right"},v.createElement("div",{className:"button-wrap"},e.right)))}function qKe(e){return v.createElement("div",{className:"tool-bar",style:e.style},e.children)}var sZ=function(e){jn(t,e);function t(){for(var n,r=arguments.length,i=new Array(r),o=0;o"u")){var r="enUS";if(navigator.language){var i=navigator.language.split("-");r=i[0],i.length!==1&&(r+=i[i.length-1].toUpperCase())}if(navigator.browserLanguage){var o=navigator.browserLanguage.split("-");r=o[0],o[1]&&(r+=o[1].toUpperCase())}this.current!==r&&this.isAvailable(r)&&(this.current=r,dl.emit(dl.EVENT_LANG_CHANGE,this,r,this.langs[r]))}},t.isAvailable=function(r){return typeof this.langs[r]<"u"},t.add=function(r,i){this.langs[r]=i},t.setCurrent=function(r){if(!this.isAvailable(r))throw new Error("Language "+r+" is not exists");this.current!==r&&(this.current=r,dl.emit(dl.EVENT_LANG_CHANGE,this,r,this.langs[r]))},t.get=function(r,i){var o=this.langs[this.current][r]||"";return i&&Object.keys(i).forEach(function(a){o=o.replace(new RegExp("\\{"+a+"\\}","g"),i[a])}),o},t.getCurrent=function(){return this.current},e}(),Fn=new YKe;function cm(e){"@babel/helpers - typeof";return cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cm(e)}function ZKe(e,t){if(cm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function XKe(e){var t=ZKe(e,"string");return cm(t)=="symbol"?t:t+""}function QKe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Dtt=GY,$tt=YY,Itt=ZY,Ntt=XY,Ltt=QY,Ftt=rZ,jtt=oZ,Btt=eZ,Utt=nZ;function cs(){return cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:0,n=(li[e[t+0]]+li[e[t+1]]+li[e[t+2]]+li[e[t+3]]+"-"+li[e[t+4]]+li[e[t+5]]+"-"+li[e[t+6]]+li[e[t+7]]+"-"+li[e[t+8]]+li[e[t+9]]+"-"+li[e[t+10]]+li[e[t+11]]+li[e[t+12]]+li[e[t+13]]+li[e[t+14]]+li[e[t+15]]).toLowerCase();if(!WKe(n))throw TypeError("Stringified UUID is invalid");return n}function aZ(e,t,n){e=e||{};var r=e.random||(e.rng||UKe)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,VKe(r)}function Pr(e){return v.createElement("i",{className:"rmel-iconfont rmel-icon-"+e.type})}function HKe(e){return v.createElement("div",{className:"rc-md-navigation "+(e.visible?"visible":"in-visible")},v.createElement("div",{className:"navigation-nav left"},v.createElement("div",{className:"button-wrap"},e.left)),v.createElement("div",{className:"navigation-nav right"},v.createElement("div",{className:"button-wrap"},e.right)))}function qKe(e){return v.createElement("div",{className:"tool-bar",style:e.style},e.children)}var sZ=function(e){jn(t,e);function t(){for(var n,r=arguments.length,i=new Array(r),o=0;o"u")){var r="enUS";if(navigator.language){var i=navigator.language.split("-");r=i[0],i.length!==1&&(r+=i[i.length-1].toUpperCase())}if(navigator.browserLanguage){var o=navigator.browserLanguage.split("-");r=o[0],o[1]&&(r+=o[1].toUpperCase())}this.current!==r&&this.isAvailable(r)&&(this.current=r,dl.emit(dl.EVENT_LANG_CHANGE,this,r,this.langs[r]))}},t.isAvailable=function(r){return typeof this.langs[r]<"u"},t.add=function(r,i){this.langs[r]=i},t.setCurrent=function(r){if(!this.isAvailable(r))throw new Error("Language "+r+" is not exists");this.current!==r&&(this.current=r,dl.emit(dl.EVENT_LANG_CHANGE,this,r,this.langs[r]))},t.get=function(r,i){var o=this.langs[this.current][r]||"";return i&&Object.keys(i).forEach(function(a){o=o.replace(new RegExp("\\{"+a+"\\}","g"),i[a])}),o},t.getCurrent=function(){return this.current},e}(),Fn=new YKe;function cm(e){"@babel/helpers - typeof";return cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cm(e)}function ZKe(e,t){if(cm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function XKe(e){var t=ZKe(e,"string");return cm(t)=="symbol"?t:t+""}function QKe(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tGe(e,t){if(e){if(typeof e=="string")return ON(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ON(e,t)}}function ON(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0)for(var s=eGe(n),u;!(u=s()).done;){var l=u.value;if(typeof a[l]<"u"&&!a[l])return!1}else if(a.metaKey||a.ctrlKey||a.shiftKey||a.altKey)return!1;return a.key?a.key===i:a.keyCode===r}function X3(e,t){var n=e.split(` `),r=e.substr(0,t).split(` `),i=r.length,o=r[r.length-1].length,a=n[r.length-1],s=r.length>1?r[r.length-2]:null,u=n.length>r.length?n[r.length]:null;return{line:i,col:o,beforeText:e.substr(0,t),afterText:e.substr(t),curLine:a,prevLine:s,nextLine:u}}var rd={bold:["**","**"],italic:["*","*"],underline:["++","++"],strikethrough:["~~","~~"],quote:[` @@ -610,4 +615,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `:">",o};ap.prototype.renderInline=function(e,t,n){let r="";const i=this.rules;for(let o=0,a=e.length;o=0&&(r=this.attrs[n][1]),r};rs.prototype.attrJoin=function(t,n){const r=this.attrIndex(t);r<0?this.attrPush([t,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function IZ(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}IZ.prototype.Token=rs;const aYe=/\r\n?|\n/g,sYe=/\0/g;function uYe(e){let t;t=e.src.replace(aYe,` `),t=t.replace(sYe,"�"),e.src=t}function lYe(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function cYe(e){const t=e.tokens;for(let n=0,r=t.length;n\s]/i.test(e)}function dYe(e){return/^<\/a\s*>/i.test(e)}function hYe(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n=0;a--){const s=i[a];if(s.type==="link_close"){for(a--;i[a].level!==s.level&&i[a].type!=="link_open";)a--;continue}if(s.type==="html_inline"&&(fYe(s.content)&&o>0&&o--,dYe(s.content)&&o++),!(o>0)&&s.type==="text"&&e.md.linkify.test(s.content)){const u=s.content;let l=e.md.linkify.match(u);const c=[];let f=s.level,h=0;l.length>0&&l[0].index===0&&a>0&&i[a-1].type==="text_special"&&(l=l.slice(1));for(let p=0;ph){const E=new e.Token("text","",0);E.content=u.slice(h,w),E.level=f,c.push(E)}const x=new e.Token("link_open","a",1);x.attrs=[["href",y]],x.level=f++,x.markup="linkify",x.info="auto",c.push(x);const S=new e.Token("text","",0);S.content=b,S.level=f,c.push(S);const O=new e.Token("link_close","a",-1);O.level=--f,O.markup="linkify",O.info="auto",c.push(O),h=l[p].lastIndex}if(h=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(gYe,vYe)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function bYe(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&NZ.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function xYe(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(pYe.test(e.tokens[t].content)&&yYe(e.tokens[t].children),NZ.test(e.tokens[t].content)&&bYe(e.tokens[t].children))}const wYe=/['"]/,LN=/['"]/g,FN="’";function Yy(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function _Ye(e,t){let n;const r=[];for(let i=0;i=0&&!(r[n].level<=a);n--);if(r.length=n+1,o.type!=="text")continue;let s=o.content,u=0,l=s.length;e:for(;u=0)m=s.charCodeAt(c.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(u=48&&m<=57&&(h=f=!1),f&&h&&(f=b,h=w),!f&&!h){p&&(o.content=Yy(o.content,c.index,FN));continue}if(h)for(n=r.length-1;n>=0;n--){let O=r[n];if(r[n].level=0;t--)e.tokens[t].type!=="inline"||!wYe.test(e.tokens[t].content)||_Ye(e.tokens[t].children,e)}function CYe(e){let t,n;const r=e.tokens,i=r.length;for(let o=0;o0&&this.level++,this.tokens.push(r),r};Ns.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};Ns.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;tn;)if(!qn(this.src.charCodeAt(--t)))return t+1;return t};Ns.prototype.skipChars=function(t,n){for(let r=this.src.length;tr;)if(n!==this.src.charCodeAt(--t))return t+1;return t};Ns.prototype.getLines=function(t,n,r,i){if(t>=n)return"";const o=new Array(n-t);for(let a=0,s=t;sr?o[a]=new Array(u-r+1).join(" ")+this.src.slice(c,f):o[a]=this.src.slice(c,f)}return o.join("")};Ns.prototype.Token=rs;const EYe=65536;function nC(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function jN(e){const t=[],n=e.length;let r=0,i=e.charCodeAt(r),o=!1,a=0,s="";for(;rn)return!1;let i=t+1;if(e.sCount[i]=4)return!1;let o=e.bMarks[i]+e.tShift[i];if(o>=e.eMarks[i])return!1;const a=e.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58||o>=e.eMarks[i])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58&&!qn(s)||a===45&&qn(s))return!1;for(;o=4)return!1;l=jN(u),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop();const f=l.length;if(f===0||f!==c.length)return!1;if(r)return!0;const h=e.parentType;e.parentType="table";const p=e.md.block.ruler.getRules("blockquote"),m=e.push("table_open","table",1),y=[t,0];m.map=y;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const w=e.push("tr_open","tr",1);w.map=[t,t+1];for(let O=0;O=4||(l=jN(u),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop(),S+=f-l.length,S>EYe))break;if(i===t+2){const C=e.push("tbody_open","tbody",1);C.map=x=[t+2,0]}const E=e.push("tr_open","tr",1);E.map=[i,i+1];for(let C=0;C=4){r++,i=r;continue}break}e.line=i;const o=e.push("code_block","code",0);return o.content=e.getLines(t,i,4+e.blkIndent,!1)+` -`,o.map=[t,e.line],!0}function PYe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;const a=e.src.charCodeAt(i);if(a!==126&&a!==96)return!1;let s=i;i=e.skipChars(i,a);let u=i-s;if(u<3)return!1;const l=e.src.slice(s,i),c=e.src.slice(i,o);if(a===96&&c.indexOf(String.fromCharCode(a))>=0)return!1;if(r)return!0;let f=t,h=!1;for(;f++,!(f>=n||(i=s=e.bMarks[f]+e.tShift[f],o=e.eMarks[f],i=4)&&(i=e.skipChars(i,a),!(i-s=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;const s=[],u=[],l=[],c=[],f=e.md.block.ruler.getRules("blockquote"),h=e.parentType;e.parentType="blockquote";let p=!1,m;for(m=t;m=o)break;if(e.src.charCodeAt(i++)===62&&!S){let E=e.sCount[m]+1,C,P;e.src.charCodeAt(i)===32?(i++,E++,P=!1,C=!0):e.src.charCodeAt(i)===9?(C=!0,(e.bsCount[m]+E)%4===3?(i++,E++,P=!1):P=!0):C=!1;let M=E;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i=o,u.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+(C?1:0),l.push(e.sCount[m]),e.sCount[m]=M-E,c.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let O=!1;for(let E=0,C=f.length;E";const w=[t,0];b.map=w,e.md.block.tokenize(e,t,m);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=a,e.parentType=h,w[1]=e.line;for(let S=0;S=4)return!1;let o=e.bMarks[t]+e.tShift[t];const a=e.src.charCodeAt(o++);if(a!==42&&a!==45&&a!==95)return!1;let s=1;for(;o=r)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=e.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i=4||e.listIndent>=0&&e.sCount[u]-e.listIndent>=4&&e.sCount[u]=e.blkIndent&&(c=!0);let f,h,p;if((p=UN(e,u))>=0){if(f=!0,a=e.bMarks[u]+e.tShift[u],h=Number(e.src.slice(a,p-1)),c&&h!==1)return!1}else if((p=BN(e,u))>=0)f=!1;else return!1;if(c&&e.skipSpaces(p)>=e.eMarks[u])return!1;if(r)return!0;const m=e.src.charCodeAt(p-1),y=e.tokens.length;f?(s=e.push("ordered_list_open","ol",1),h!==1&&(s.attrs=[["start",h]])):s=e.push("bullet_list_open","ul",1);const b=[u,0];s.map=b,s.markup=String.fromCharCode(m);let w=!1;const x=e.md.block.ruler.getRules("list"),S=e.parentType;for(e.parentType="list";u=i?P=1:P=E-O,P>4&&(P=1);const M=O+P;s=e.push("list_item_open","li",1),s.markup=String.fromCharCode(m);const N=[u,0];s.map=N,f&&(s.info=e.src.slice(a,p-1));const B=e.tight,V=e.tShift[u],W=e.sCount[u],ee=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=M,e.tight=!0,e.tShift[u]=C-e.bMarks[u],e.sCount[u]=E,C>=i&&e.isEmpty(u+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,u,n,!0),(!e.tight||w)&&(l=!1),w=e.line-u>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ee,e.tShift[u]=V,e.sCount[u]=W,e.tight=B,s=e.push("list_item_close","li",-1),s.markup=String.fromCharCode(m),u=e.line,N[1]=u,u>=n||e.sCount[u]=4)break;let Z=!1;for(let q=0,G=x.length;q=4||e.src.charCodeAt(i)!==91)return!1;function s(x){const S=e.lineMax;if(x>=S||e.isEmpty(x))return null;let O=!1;if(e.sCount[x]-e.blkIndent>3&&(O=!0),e.sCount[x]<0&&(O=!0),!O){const P=e.md.block.ruler.getRules("reference"),M=e.parentType;e.parentType="reference";let N=!1;for(let B=0,V=P.length;B"u"&&(e.env.references={}),typeof e.env.references[w]>"u"&&(e.env.references[w]={title:b,href:f}),e.line=a),!0):!1}const $Ye=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],IYe="[a-zA-Z_:][a-zA-Z0-9:._-]*",NYe="[^\"'=<>`\\x00-\\x20]+",LYe="'[^']*'",FYe='"[^"]*"',jYe="(?:"+NYe+"|"+LYe+"|"+FYe+")",BYe="(?:\\s+"+IYe+"(?:\\s*=\\s*"+jYe+")?)",LZ="<[A-Za-z][A-Za-z0-9\\-]*"+BYe+"*\\s*\\/?>",FZ="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",UYe="",zYe="<[?][\\s\\S]*?[?]>",WYe="]*>",VYe="",HYe=new RegExp("^(?:"+LZ+"|"+FZ+"|"+UYe+"|"+zYe+"|"+WYe+"|"+VYe+")"),qYe=new RegExp("^(?:"+LZ+"|"+FZ+")"),ed=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(qYe.source+"\\s*$"),/^$/,!1]];function KYe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let a=e.src.slice(i,o),s=0;for(;s=4)return!1;let a=e.src.charCodeAt(i);if(a!==35||i>=o)return!1;let s=1;for(a=e.src.charCodeAt(++i);a===35&&i6||ii&&qn(e.src.charCodeAt(u-1))&&(o=u),e.line=t+1;const l=e.push("heading_open","h"+String(s),1);l.markup="########".slice(0,s),l.map=[t,e.line];const c=e.push("inline","",0);c.content=e.src.slice(i,o).trim(),c.map=[t,e.line],c.children=[];const f=e.push("heading_close","h"+String(s),-1);return f.markup="########".slice(0,s),!0}function YYe(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let o=0,a,s=t+1;for(;s3)continue;if(e.sCount[s]>=e.blkIndent){let p=e.bMarks[s]+e.tShift[s];const m=e.eMarks[s];if(p=m))){o=a===61?1:2;break}}if(e.sCount[s]<0)continue;let h=!1;for(let p=0,m=r.length;p3||e.sCount[o]<0)continue;let l=!1;for(let c=0,f=r.length;c=n||e.sCount[a]=o){e.line=n;break}const u=e.line;let l=!1;for(let c=0;c=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),a=e.line,a0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};nv.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=e.pending.match(JYe);if(!i)return!1;const o=i[1],a=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!a)return!1;let s=a.url;if(s.length<=o.length)return!1;s=s.replace(/\*+$/,"");const u=e.md.normalizeLink(s);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const l=e.push("link_open","a",1);l.attrs=[["href",u]],l.markup="linkify",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=s.length-o.length,!0}function tZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(e){Q5[e.charCodeAt(0)]=1});function nZe(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&s<=57343&&(o+=e.src[n+1],n++)}const a="\\"+o;if(!t){const s=e.push("text_special","",0);i<256&&Q5[i]!==0?s.content=o:s.content=a,s.markup=a,s.info="escape"}return e.pos=n+1,!0}function rZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=e.posMax;for(;n=0;r--){const i=t[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=t[i.end],a=r>0&&t[r-1].end===i.end+1&&t[r-1].marker===i.marker&&t[r-1].token===i.token-1&&t[i.end+1].token===o.token+1,s=String.fromCharCode(i.marker),u=e.tokens[i.token];u.type=a?"strong_open":"em_open",u.tag=a?"strong":"em",u.nesting=1,u.markup=a?s+s:s,u.content="";const l=e.tokens[o.token];l.type=a?"strong_close":"em_close",l.tag=a?"strong":"em",l.nesting=-1,l.markup=a?s+s:s,l.content="",a&&(e.tokens[t[r-1].token].content="",e.tokens[t[i.end+1].token].content="",r--)}}function sZe(e){const t=e.tokens_meta,n=e.tokens_meta.length;WN(e,e.delimiters);for(let r=0;r=f)return!1;if(u=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(a=e.md.normalizeLink(i.str),e.md.validateLink(a)?m=i.pos:a="",u=m;m=f||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(typeof e.env.references>"u")return!1;if(m=0?r=e.src.slice(u,m++):m=p+1):m=p+1,r||(r=e.src.slice(h,p)),o=e.env.references[B2(r)],!o)return e.pos=c,!1;a=o.href,s=o.title}if(!t){e.pos=h,e.posMax=p;const y=e.push("link_open","a",1),b=[["href",a]];y.attrs=b,s&&b.push(["title",s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=m,e.posMax=f,!0}function lZe(e,t){let n,r,i,o,a,s,u,l,c="";const f=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(o=m+1,o=h)return!1;for(l=o,s=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),s.ok&&(c=e.md.normalizeLink(s.str),e.md.validateLink(c)?o=s.pos:c=""),l=o;o=h||e.src.charCodeAt(o)!==41)return e.pos=f,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o=0?i=e.src.slice(l,o++):o=m+1):o=m+1,i||(i=e.src.slice(p,m)),a=e.env.references[B2(i)],!a)return e.pos=f,!1;c=a.href,u=a.title}if(!t){r=e.src.slice(p,m);const y=[];e.md.inline.parse(r,e.md,e.env,y);const b=e.push("image","img",0),w=[["src",c],["alt",""]];b.attrs=w,b.children=y,b.content=r,u&&w.push(["title",u])}return e.pos=o,e.posMax=h,!0}const cZe=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,fZe=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function dZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const a=e.src.charCodeAt(n);if(a===60)return!1;if(a===62)break}const o=e.src.slice(r+1,n);if(fZe.test(o)){const a=e.md.normalizeLink(o);if(!e.md.validateLink(a))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}if(cZe.test(o)){const a=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(a))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}return!1}function hZe(e){return/^\s]/i.test(e)}function pZe(e){return/^<\/a\s*>/i.test(e)}function gZe(e){const t=e|32;return t>=97&&t<=122}function mZe(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!gZe(i))return!1;const o=e.src.slice(r).match(HYe);if(!o)return!1;if(!t){const a=e.push("html_inline","",0);a.content=o[0],hZe(a.content)&&e.linkLevel++,pZe(a.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const vZe=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,yZe=/^&([a-z][a-z0-9]{1,31});/i;function bZe(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(vZe);if(o){if(!t){const a=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),s=e.push("text_special","",0);s.content=Z5(a)?jx(a):jx(65533),s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(yZe);if(o){const a=RZ(o[0]);if(a!==o[0]){if(!t){const s=e.push("text_special","",0);s.content=a,s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function VN(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let a=0;au;l-=o[l]+1){const f=e[l];if(f.marker===s.marker&&f.open&&f.end<0){let h=!1;if((f.close||s.open)&&(f.length+s.length)%3===0&&(f.length%3!==0||s.length%3!==0)&&(h=!0),!h){const p=l>0&&!e[l-1].open?o[l-1]+1:0;o[a]=a-l+p,o[l]=p,s.open=!1,f.end=a,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(t[s.marker][(s.open?3:0)+(s.length||0)%3]=c)}}function xZe(e){const t=e.tokens_meta,n=e.tokens_meta.length;VN(e.delimiters);for(let r=0;r0&&r++,i[t].type==="text"&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,o[t]=e.pos};rv.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};rv.prototype.parse=function(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),a=o.length;for(let s=0;s|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function K4(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function z2(e){return Object.prototype.toString.call(e)}function SZe(e){return z2(e)==="[object String]"}function CZe(e){return z2(e)==="[object Object]"}function EZe(e){return z2(e)==="[object RegExp]"}function HN(e){return z2(e)==="[object Function]"}function OZe(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const UZ={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function AZe(e){return Object.keys(e||{}).reduce(function(t,n){return t||UZ.hasOwnProperty(n)},!1)}const PZe={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},kZe="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",TZe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function MZe(e){e.__index__=-1,e.__text_cache__=""}function RZe(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function qN(){return function(e,t){t.normalize(e)}}function Bx(e){const t=e.re=_Ze(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(kZe),n.push(t.src_xn),t.src_tlds=n.join("|");function r(s){return s.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function o(s,u){throw new Error('(LinkifyIt) Invalid schema "'+s+'": '+u)}Object.keys(e.__schemas__).forEach(function(s){const u=e.__schemas__[s];if(u===null)return;const l={validate:null,link:null};if(e.__compiled__[s]=l,CZe(u)){EZe(u.validate)?l.validate=RZe(u.validate):HN(u.validate)?l.validate=u.validate:o(s,u),HN(u.normalize)?l.normalize=u.normalize:u.normalize?o(s,u):l.normalize=qN();return}if(SZe(u)){i.push(s);return}o(s,u)}),i.forEach(function(s){e.__compiled__[e.__schemas__[s]]&&(e.__compiled__[s].validate=e.__compiled__[e.__schemas__[s]].validate,e.__compiled__[s].normalize=e.__compiled__[e.__schemas__[s]].normalize)}),e.__compiled__[""]={validate:null,normalize:qN()};const a=Object.keys(e.__compiled__).filter(function(s){return s.length>0&&e.__compiled__[s]}).map(OZe).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),MZe(e)}function DZe(e,t){const n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function G4(e,t){const n=new DZe(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Vo(e,t){if(!(this instanceof Vo))return new Vo(e,t);t||AZe(e)&&(t=e,e={}),this.__opts__=K4({},UZ,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=K4({},PZe,e),this.__compiled__={},this.__tlds__=TZe,this.__tlds_replaced__=!1,this.re={},Bx(this)}Vo.prototype.add=function(t,n){return this.__schemas__[t]=n,Bx(this),this};Vo.prototype.set=function(t){return this.__opts__=K4(this.__opts__,t),this};Vo.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,r,i,o,a,s,u,l,c;if(this.re.schema_test.test(t)){for(u=this.re.schema_search,u.lastIndex=0;(n=u.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],u.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l=0&&(i=t.match(this.re.email_fuzzy))!==null&&(a=i.index+i[1].length,s=i.index+i[0].length,(this.__index__<0||athis.__last_index__)&&(this.__schema__="mailto:",this.__index__=a,this.__last_index__=s))),this.__index__>=0};Vo.prototype.pretest=function(t){return this.re.pretest.test(t)};Vo.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};Vo.prototype.match=function(t){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(G4(this,r)),r=this.__last_index__);let i=r?t.slice(r):t;for(;this.test(i);)n.push(G4(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Vo.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const r=this.testSchemaAt(t,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,G4(this,0)):null};Vo.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),Bx(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Bx(this),this)};Vo.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Vo.prototype.onCompile=function(){};const Bd=2147483647,xs=36,J5=1,pm=26,$Ze=38,IZe=700,zZ=72,WZ=128,VZ="-",NZe=/^xn--/,LZe=/[^\0-\x7F]/,FZe=/[\x2E\u3002\uFF0E\uFF61]/g,jZe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},oC=xs-J5,ws=Math.floor,aC=String.fromCharCode;function Ju(e){throw new RangeError(jZe[e])}function BZe(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function HZ(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(FZe,".");const i=e.split("."),o=BZe(i,t).join(".");return r+o}function qZ(e){const t=[];let n=0;const r=e.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...e),zZe=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:xs},KN=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},KZ=function(e,t,n){let r=0;for(e=n?ws(e/IZe):e>>1,e+=ws(e/t);e>oC*pm>>1;r+=xs)e=ws(e/oC);return ws(r+(oC+1)*e/(e+$Ze))},GZ=function(e){const t=[],n=e.length;let r=0,i=WZ,o=zZ,a=e.lastIndexOf(VZ);a<0&&(a=0);for(let s=0;s=128&&Ju("not-basic"),t.push(e.charCodeAt(s));for(let s=a>0?a+1:0;s=n&&Ju("invalid-input");const h=zZe(e.charCodeAt(s++));h>=xs&&Ju("invalid-input"),h>ws((Bd-r)/c)&&Ju("overflow"),r+=h*c;const p=f<=o?J5:f>=o+pm?pm:f-o;if(hws(Bd/m)&&Ju("overflow"),c*=m}const l=t.length+1;o=KZ(r-u,l,u==0),ws(r/l)>Bd-i&&Ju("overflow"),i+=ws(r/l),r%=l,t.splice(r++,0,i)}return String.fromCodePoint(...t)},YZ=function(e){const t=[];e=qZ(e);const n=e.length;let r=WZ,i=0,o=zZ;for(const u of e)u<128&&t.push(aC(u));const a=t.length;let s=a;for(a&&t.push(VZ);s=r&&cws((Bd-i)/l)&&Ju("overflow"),i+=(u-r)*l,r=u;for(const c of e)if(cBd&&Ju("overflow"),c===r){let f=i;for(let h=xs;;h+=xs){const p=h<=o?J5:h>=o+pm?pm:h-o;if(f=0))try{t.hostname=ZZ.toASCII(t.hostname)}catch{}return tv(q5(t))}function JZe(e){const t=K5(e,!0);if(t.hostname&&(!t.protocol||XZ.indexOf(t.protocol)>=0))try{t.hostname=ZZ.toUnicode(t.hostname)}catch{}return Ph(q5(t),Ph.defaultChars+"%")}function Ja(e,t){if(!(this instanceof Ja))return new Ja(e,t);t||Y5(e)||(t=e||{},e="default"),this.inline=new rv,this.block=new U2,this.core=new X5,this.renderer=new ap,this.linkify=new Vo,this.validateLink=XZe,this.normalizeLink=QZe,this.normalizeLinkText=JZe,this.utils=tYe,this.helpers=j2({},oYe),this.options={},this.configure(e),t&&this.set(t)}Ja.prototype.set=function(e){return j2(this.options,e),this};Ja.prototype.configure=function(e){const t=this;if(Y5(e)){const n=e;if(e=GZe[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};Ja.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Ja.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Ja.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Ja.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};Ja.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Ja.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Ja.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};var QZ={exports:{}};(function(e){(function(t){var n=function(T){var D,$=new Float64Array(16);if(T)for(D=0;D>24&255,T[D+1]=$>>16&255,T[D+2]=$>>8&255,T[D+3]=$&255,T[D+4]=A>>24&255,T[D+5]=A>>16&255,T[D+6]=A>>8&255,T[D+7]=A&255}function y(T,D,$,A,L){var Q,te=0;for(Q=0;Q>>8)-1}function b(T,D,$,A){return y(T,D,$,A,16)}function w(T,D,$,A){return y(T,D,$,A,32)}function x(T,D,$,A){for(var L=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,Q=$[0]&255|($[1]&255)<<8|($[2]&255)<<16|($[3]&255)<<24,te=$[4]&255|($[5]&255)<<8|($[6]&255)<<16|($[7]&255)<<24,fe=$[8]&255|($[9]&255)<<8|($[10]&255)<<16|($[11]&255)<<24,_e=$[12]&255|($[13]&255)<<8|($[14]&255)<<16|($[15]&255)<<24,je=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,Ve=D[0]&255|(D[1]&255)<<8|(D[2]&255)<<16|(D[3]&255)<<24,ct=D[4]&255|(D[5]&255)<<8|(D[6]&255)<<16|(D[7]&255)<<24,Ie=D[8]&255|(D[9]&255)<<8|(D[10]&255)<<16|(D[11]&255)<<24,nt=D[12]&255|(D[13]&255)<<8|(D[14]&255)<<16|(D[15]&255)<<24,bt=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Ot=$[16]&255|($[17]&255)<<8|($[18]&255)<<16|($[19]&255)<<24,pt=$[20]&255|($[21]&255)<<8|($[22]&255)<<16|($[23]&255)<<24,ht=$[24]&255|($[25]&255)<<8|($[26]&255)<<16|($[27]&255)<<24,xt=$[28]&255|($[29]&255)<<8|($[30]&255)<<16|($[31]&255)<<24,wt=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Qe=L,ut=Q,Xe=te,Ne=fe,qe=_e,Ge=je,pe=Ve,he=ct,Re=Ie,Oe=nt,Pe=bt,Be=Ot,vt=pt,jt=ht,Bt=xt,It=wt,J,Zt=0;Zt<20;Zt+=2)J=Qe+vt|0,qe^=J<<7|J>>>25,J=qe+Qe|0,Re^=J<<9|J>>>23,J=Re+qe|0,vt^=J<<13|J>>>19,J=vt+Re|0,Qe^=J<<18|J>>>14,J=Ge+ut|0,Oe^=J<<7|J>>>25,J=Oe+Ge|0,jt^=J<<9|J>>>23,J=jt+Oe|0,ut^=J<<13|J>>>19,J=ut+jt|0,Ge^=J<<18|J>>>14,J=Pe+pe|0,Bt^=J<<7|J>>>25,J=Bt+Pe|0,Xe^=J<<9|J>>>23,J=Xe+Bt|0,pe^=J<<13|J>>>19,J=pe+Xe|0,Pe^=J<<18|J>>>14,J=It+Be|0,Ne^=J<<7|J>>>25,J=Ne+It|0,he^=J<<9|J>>>23,J=he+Ne|0,Be^=J<<13|J>>>19,J=Be+he|0,It^=J<<18|J>>>14,J=Qe+Ne|0,ut^=J<<7|J>>>25,J=ut+Qe|0,Xe^=J<<9|J>>>23,J=Xe+ut|0,Ne^=J<<13|J>>>19,J=Ne+Xe|0,Qe^=J<<18|J>>>14,J=Ge+qe|0,pe^=J<<7|J>>>25,J=pe+Ge|0,he^=J<<9|J>>>23,J=he+pe|0,qe^=J<<13|J>>>19,J=qe+he|0,Ge^=J<<18|J>>>14,J=Pe+Oe|0,Be^=J<<7|J>>>25,J=Be+Pe|0,Re^=J<<9|J>>>23,J=Re+Be|0,Oe^=J<<13|J>>>19,J=Oe+Re|0,Pe^=J<<18|J>>>14,J=It+Bt|0,vt^=J<<7|J>>>25,J=vt+It|0,jt^=J<<9|J>>>23,J=jt+vt|0,Bt^=J<<13|J>>>19,J=Bt+jt|0,It^=J<<18|J>>>14;Qe=Qe+L|0,ut=ut+Q|0,Xe=Xe+te|0,Ne=Ne+fe|0,qe=qe+_e|0,Ge=Ge+je|0,pe=pe+Ve|0,he=he+ct|0,Re=Re+Ie|0,Oe=Oe+nt|0,Pe=Pe+bt|0,Be=Be+Ot|0,vt=vt+pt|0,jt=jt+ht|0,Bt=Bt+xt|0,It=It+wt|0,T[0]=Qe>>>0&255,T[1]=Qe>>>8&255,T[2]=Qe>>>16&255,T[3]=Qe>>>24&255,T[4]=ut>>>0&255,T[5]=ut>>>8&255,T[6]=ut>>>16&255,T[7]=ut>>>24&255,T[8]=Xe>>>0&255,T[9]=Xe>>>8&255,T[10]=Xe>>>16&255,T[11]=Xe>>>24&255,T[12]=Ne>>>0&255,T[13]=Ne>>>8&255,T[14]=Ne>>>16&255,T[15]=Ne>>>24&255,T[16]=qe>>>0&255,T[17]=qe>>>8&255,T[18]=qe>>>16&255,T[19]=qe>>>24&255,T[20]=Ge>>>0&255,T[21]=Ge>>>8&255,T[22]=Ge>>>16&255,T[23]=Ge>>>24&255,T[24]=pe>>>0&255,T[25]=pe>>>8&255,T[26]=pe>>>16&255,T[27]=pe>>>24&255,T[28]=he>>>0&255,T[29]=he>>>8&255,T[30]=he>>>16&255,T[31]=he>>>24&255,T[32]=Re>>>0&255,T[33]=Re>>>8&255,T[34]=Re>>>16&255,T[35]=Re>>>24&255,T[36]=Oe>>>0&255,T[37]=Oe>>>8&255,T[38]=Oe>>>16&255,T[39]=Oe>>>24&255,T[40]=Pe>>>0&255,T[41]=Pe>>>8&255,T[42]=Pe>>>16&255,T[43]=Pe>>>24&255,T[44]=Be>>>0&255,T[45]=Be>>>8&255,T[46]=Be>>>16&255,T[47]=Be>>>24&255,T[48]=vt>>>0&255,T[49]=vt>>>8&255,T[50]=vt>>>16&255,T[51]=vt>>>24&255,T[52]=jt>>>0&255,T[53]=jt>>>8&255,T[54]=jt>>>16&255,T[55]=jt>>>24&255,T[56]=Bt>>>0&255,T[57]=Bt>>>8&255,T[58]=Bt>>>16&255,T[59]=Bt>>>24&255,T[60]=It>>>0&255,T[61]=It>>>8&255,T[62]=It>>>16&255,T[63]=It>>>24&255}function S(T,D,$,A){for(var L=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,Q=$[0]&255|($[1]&255)<<8|($[2]&255)<<16|($[3]&255)<<24,te=$[4]&255|($[5]&255)<<8|($[6]&255)<<16|($[7]&255)<<24,fe=$[8]&255|($[9]&255)<<8|($[10]&255)<<16|($[11]&255)<<24,_e=$[12]&255|($[13]&255)<<8|($[14]&255)<<16|($[15]&255)<<24,je=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,Ve=D[0]&255|(D[1]&255)<<8|(D[2]&255)<<16|(D[3]&255)<<24,ct=D[4]&255|(D[5]&255)<<8|(D[6]&255)<<16|(D[7]&255)<<24,Ie=D[8]&255|(D[9]&255)<<8|(D[10]&255)<<16|(D[11]&255)<<24,nt=D[12]&255|(D[13]&255)<<8|(D[14]&255)<<16|(D[15]&255)<<24,bt=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Ot=$[16]&255|($[17]&255)<<8|($[18]&255)<<16|($[19]&255)<<24,pt=$[20]&255|($[21]&255)<<8|($[22]&255)<<16|($[23]&255)<<24,ht=$[24]&255|($[25]&255)<<8|($[26]&255)<<16|($[27]&255)<<24,xt=$[28]&255|($[29]&255)<<8|($[30]&255)<<16|($[31]&255)<<24,wt=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Qe=L,ut=Q,Xe=te,Ne=fe,qe=_e,Ge=je,pe=Ve,he=ct,Re=Ie,Oe=nt,Pe=bt,Be=Ot,vt=pt,jt=ht,Bt=xt,It=wt,J,Zt=0;Zt<20;Zt+=2)J=Qe+vt|0,qe^=J<<7|J>>>25,J=qe+Qe|0,Re^=J<<9|J>>>23,J=Re+qe|0,vt^=J<<13|J>>>19,J=vt+Re|0,Qe^=J<<18|J>>>14,J=Ge+ut|0,Oe^=J<<7|J>>>25,J=Oe+Ge|0,jt^=J<<9|J>>>23,J=jt+Oe|0,ut^=J<<13|J>>>19,J=ut+jt|0,Ge^=J<<18|J>>>14,J=Pe+pe|0,Bt^=J<<7|J>>>25,J=Bt+Pe|0,Xe^=J<<9|J>>>23,J=Xe+Bt|0,pe^=J<<13|J>>>19,J=pe+Xe|0,Pe^=J<<18|J>>>14,J=It+Be|0,Ne^=J<<7|J>>>25,J=Ne+It|0,he^=J<<9|J>>>23,J=he+Ne|0,Be^=J<<13|J>>>19,J=Be+he|0,It^=J<<18|J>>>14,J=Qe+Ne|0,ut^=J<<7|J>>>25,J=ut+Qe|0,Xe^=J<<9|J>>>23,J=Xe+ut|0,Ne^=J<<13|J>>>19,J=Ne+Xe|0,Qe^=J<<18|J>>>14,J=Ge+qe|0,pe^=J<<7|J>>>25,J=pe+Ge|0,he^=J<<9|J>>>23,J=he+pe|0,qe^=J<<13|J>>>19,J=qe+he|0,Ge^=J<<18|J>>>14,J=Pe+Oe|0,Be^=J<<7|J>>>25,J=Be+Pe|0,Re^=J<<9|J>>>23,J=Re+Be|0,Oe^=J<<13|J>>>19,J=Oe+Re|0,Pe^=J<<18|J>>>14,J=It+Bt|0,vt^=J<<7|J>>>25,J=vt+It|0,jt^=J<<9|J>>>23,J=jt+vt|0,Bt^=J<<13|J>>>19,J=Bt+jt|0,It^=J<<18|J>>>14;T[0]=Qe>>>0&255,T[1]=Qe>>>8&255,T[2]=Qe>>>16&255,T[3]=Qe>>>24&255,T[4]=Ge>>>0&255,T[5]=Ge>>>8&255,T[6]=Ge>>>16&255,T[7]=Ge>>>24&255,T[8]=Pe>>>0&255,T[9]=Pe>>>8&255,T[10]=Pe>>>16&255,T[11]=Pe>>>24&255,T[12]=It>>>0&255,T[13]=It>>>8&255,T[14]=It>>>16&255,T[15]=It>>>24&255,T[16]=pe>>>0&255,T[17]=pe>>>8&255,T[18]=pe>>>16&255,T[19]=pe>>>24&255,T[20]=he>>>0&255,T[21]=he>>>8&255,T[22]=he>>>16&255,T[23]=he>>>24&255,T[24]=Re>>>0&255,T[25]=Re>>>8&255,T[26]=Re>>>16&255,T[27]=Re>>>24&255,T[28]=Oe>>>0&255,T[29]=Oe>>>8&255,T[30]=Oe>>>16&255,T[31]=Oe>>>24&255}function O(T,D,$,A){x(T,D,$,A)}function E(T,D,$,A){S(T,D,$,A)}var C=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function P(T,D,$,A,L,Q,te){var fe=new Uint8Array(16),_e=new Uint8Array(64),je,Ve;for(Ve=0;Ve<16;Ve++)fe[Ve]=0;for(Ve=0;Ve<8;Ve++)fe[Ve]=Q[Ve];for(;L>=64;){for(O(_e,fe,te,C),Ve=0;Ve<64;Ve++)T[D+Ve]=$[A+Ve]^_e[Ve];for(je=1,Ve=8;Ve<16;Ve++)je=je+(fe[Ve]&255)|0,fe[Ve]=je&255,je>>>=8;L-=64,D+=64,A+=64}if(L>0)for(O(_e,fe,te,C),Ve=0;Ve=64;){for(O(te,Q,L,C),_e=0;_e<64;_e++)T[D+_e]=te[_e];for(fe=1,_e=8;_e<16;_e++)fe=fe+(Q[_e]&255)|0,Q[_e]=fe&255,fe>>>=8;$-=64,D+=64}if($>0)for(O(te,Q,L,C),_e=0;_e<$;_e++)T[D+_e]=te[_e];return 0}function N(T,D,$,A,L){var Q=new Uint8Array(32);E(Q,A,L,C);for(var te=new Uint8Array(8),fe=0;fe<8;fe++)te[fe]=A[fe+16];return M(T,D,$,te,Q)}function B(T,D,$,A,L,Q,te){var fe=new Uint8Array(32);E(fe,Q,te,C);for(var _e=new Uint8Array(8),je=0;je<8;je++)_e[je]=Q[je+16];return P(T,D,$,A,L,_e,fe)}var V=function(T){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var D,$,A,L,Q,te,fe,_e;D=T[0]&255|(T[1]&255)<<8,this.r[0]=D&8191,$=T[2]&255|(T[3]&255)<<8,this.r[1]=(D>>>13|$<<3)&8191,A=T[4]&255|(T[5]&255)<<8,this.r[2]=($>>>10|A<<6)&7939,L=T[6]&255|(T[7]&255)<<8,this.r[3]=(A>>>7|L<<9)&8191,Q=T[8]&255|(T[9]&255)<<8,this.r[4]=(L>>>4|Q<<12)&255,this.r[5]=Q>>>1&8190,te=T[10]&255|(T[11]&255)<<8,this.r[6]=(Q>>>14|te<<2)&8191,fe=T[12]&255|(T[13]&255)<<8,this.r[7]=(te>>>11|fe<<5)&8065,_e=T[14]&255|(T[15]&255)<<8,this.r[8]=(fe>>>8|_e<<8)&8191,this.r[9]=_e>>>5&127,this.pad[0]=T[16]&255|(T[17]&255)<<8,this.pad[1]=T[18]&255|(T[19]&255)<<8,this.pad[2]=T[20]&255|(T[21]&255)<<8,this.pad[3]=T[22]&255|(T[23]&255)<<8,this.pad[4]=T[24]&255|(T[25]&255)<<8,this.pad[5]=T[26]&255|(T[27]&255)<<8,this.pad[6]=T[28]&255|(T[29]&255)<<8,this.pad[7]=T[30]&255|(T[31]&255)<<8};V.prototype.blocks=function(T,D,$){for(var A=this.fin?0:2048,L,Q,te,fe,_e,je,Ve,ct,Ie,nt,bt,Ot,pt,ht,xt,wt,Qe,ut,Xe,Ne=this.h[0],qe=this.h[1],Ge=this.h[2],pe=this.h[3],he=this.h[4],Re=this.h[5],Oe=this.h[6],Pe=this.h[7],Be=this.h[8],vt=this.h[9],jt=this.r[0],Bt=this.r[1],It=this.r[2],J=this.r[3],Zt=this.r[4],sn=this.r[5],un=this.r[6],Ut=this.r[7],ln=this.r[8],rn=this.r[9];$>=16;)L=T[D+0]&255|(T[D+1]&255)<<8,Ne+=L&8191,Q=T[D+2]&255|(T[D+3]&255)<<8,qe+=(L>>>13|Q<<3)&8191,te=T[D+4]&255|(T[D+5]&255)<<8,Ge+=(Q>>>10|te<<6)&8191,fe=T[D+6]&255|(T[D+7]&255)<<8,pe+=(te>>>7|fe<<9)&8191,_e=T[D+8]&255|(T[D+9]&255)<<8,he+=(fe>>>4|_e<<12)&8191,Re+=_e>>>1&8191,je=T[D+10]&255|(T[D+11]&255)<<8,Oe+=(_e>>>14|je<<2)&8191,Ve=T[D+12]&255|(T[D+13]&255)<<8,Pe+=(je>>>11|Ve<<5)&8191,ct=T[D+14]&255|(T[D+15]&255)<<8,Be+=(Ve>>>8|ct<<8)&8191,vt+=ct>>>5|A,Ie=0,nt=Ie,nt+=Ne*jt,nt+=qe*(5*rn),nt+=Ge*(5*ln),nt+=pe*(5*Ut),nt+=he*(5*un),Ie=nt>>>13,nt&=8191,nt+=Re*(5*sn),nt+=Oe*(5*Zt),nt+=Pe*(5*J),nt+=Be*(5*It),nt+=vt*(5*Bt),Ie+=nt>>>13,nt&=8191,bt=Ie,bt+=Ne*Bt,bt+=qe*jt,bt+=Ge*(5*rn),bt+=pe*(5*ln),bt+=he*(5*Ut),Ie=bt>>>13,bt&=8191,bt+=Re*(5*un),bt+=Oe*(5*sn),bt+=Pe*(5*Zt),bt+=Be*(5*J),bt+=vt*(5*It),Ie+=bt>>>13,bt&=8191,Ot=Ie,Ot+=Ne*It,Ot+=qe*Bt,Ot+=Ge*jt,Ot+=pe*(5*rn),Ot+=he*(5*ln),Ie=Ot>>>13,Ot&=8191,Ot+=Re*(5*Ut),Ot+=Oe*(5*un),Ot+=Pe*(5*sn),Ot+=Be*(5*Zt),Ot+=vt*(5*J),Ie+=Ot>>>13,Ot&=8191,pt=Ie,pt+=Ne*J,pt+=qe*It,pt+=Ge*Bt,pt+=pe*jt,pt+=he*(5*rn),Ie=pt>>>13,pt&=8191,pt+=Re*(5*ln),pt+=Oe*(5*Ut),pt+=Pe*(5*un),pt+=Be*(5*sn),pt+=vt*(5*Zt),Ie+=pt>>>13,pt&=8191,ht=Ie,ht+=Ne*Zt,ht+=qe*J,ht+=Ge*It,ht+=pe*Bt,ht+=he*jt,Ie=ht>>>13,ht&=8191,ht+=Re*(5*rn),ht+=Oe*(5*ln),ht+=Pe*(5*Ut),ht+=Be*(5*un),ht+=vt*(5*sn),Ie+=ht>>>13,ht&=8191,xt=Ie,xt+=Ne*sn,xt+=qe*Zt,xt+=Ge*J,xt+=pe*It,xt+=he*Bt,Ie=xt>>>13,xt&=8191,xt+=Re*jt,xt+=Oe*(5*rn),xt+=Pe*(5*ln),xt+=Be*(5*Ut),xt+=vt*(5*un),Ie+=xt>>>13,xt&=8191,wt=Ie,wt+=Ne*un,wt+=qe*sn,wt+=Ge*Zt,wt+=pe*J,wt+=he*It,Ie=wt>>>13,wt&=8191,wt+=Re*Bt,wt+=Oe*jt,wt+=Pe*(5*rn),wt+=Be*(5*ln),wt+=vt*(5*Ut),Ie+=wt>>>13,wt&=8191,Qe=Ie,Qe+=Ne*Ut,Qe+=qe*un,Qe+=Ge*sn,Qe+=pe*Zt,Qe+=he*J,Ie=Qe>>>13,Qe&=8191,Qe+=Re*It,Qe+=Oe*Bt,Qe+=Pe*jt,Qe+=Be*(5*rn),Qe+=vt*(5*ln),Ie+=Qe>>>13,Qe&=8191,ut=Ie,ut+=Ne*ln,ut+=qe*Ut,ut+=Ge*un,ut+=pe*sn,ut+=he*Zt,Ie=ut>>>13,ut&=8191,ut+=Re*J,ut+=Oe*It,ut+=Pe*Bt,ut+=Be*jt,ut+=vt*(5*rn),Ie+=ut>>>13,ut&=8191,Xe=Ie,Xe+=Ne*rn,Xe+=qe*ln,Xe+=Ge*Ut,Xe+=pe*un,Xe+=he*sn,Ie=Xe>>>13,Xe&=8191,Xe+=Re*Zt,Xe+=Oe*J,Xe+=Pe*It,Xe+=Be*Bt,Xe+=vt*jt,Ie+=Xe>>>13,Xe&=8191,Ie=(Ie<<2)+Ie|0,Ie=Ie+nt|0,nt=Ie&8191,Ie=Ie>>>13,bt+=Ie,Ne=nt,qe=bt,Ge=Ot,pe=pt,he=ht,Re=xt,Oe=wt,Pe=Qe,Be=ut,vt=Xe,D+=16,$-=16;this.h[0]=Ne,this.h[1]=qe,this.h[2]=Ge,this.h[3]=pe,this.h[4]=he,this.h[5]=Re,this.h[6]=Oe,this.h[7]=Pe,this.h[8]=Be,this.h[9]=vt},V.prototype.finish=function(T,D){var $=new Uint16Array(10),A,L,Q,te;if(this.leftover){for(te=this.leftover,this.buffer[te++]=1;te<16;te++)this.buffer[te]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(A=this.h[1]>>>13,this.h[1]&=8191,te=2;te<10;te++)this.h[te]+=A,A=this.h[te]>>>13,this.h[te]&=8191;for(this.h[0]+=A*5,A=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=A,A=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=A,$[0]=this.h[0]+5,A=$[0]>>>13,$[0]&=8191,te=1;te<10;te++)$[te]=this.h[te]+A,A=$[te]>>>13,$[te]&=8191;for($[9]-=8192,L=(A^1)-1,te=0;te<10;te++)$[te]&=L;for(L=~L,te=0;te<10;te++)this.h[te]=this.h[te]&L|$[te];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,Q=this.h[0]+this.pad[0],this.h[0]=Q&65535,te=1;te<8;te++)Q=(this.h[te]+this.pad[te]|0)+(Q>>>16)|0,this.h[te]=Q&65535;T[D+0]=this.h[0]>>>0&255,T[D+1]=this.h[0]>>>8&255,T[D+2]=this.h[1]>>>0&255,T[D+3]=this.h[1]>>>8&255,T[D+4]=this.h[2]>>>0&255,T[D+5]=this.h[2]>>>8&255,T[D+6]=this.h[3]>>>0&255,T[D+7]=this.h[3]>>>8&255,T[D+8]=this.h[4]>>>0&255,T[D+9]=this.h[4]>>>8&255,T[D+10]=this.h[5]>>>0&255,T[D+11]=this.h[5]>>>8&255,T[D+12]=this.h[6]>>>0&255,T[D+13]=this.h[6]>>>8&255,T[D+14]=this.h[7]>>>0&255,T[D+15]=this.h[7]>>>8&255},V.prototype.update=function(T,D,$){var A,L;if(this.leftover){for(L=16-this.leftover,L>$&&(L=$),A=0;A=16&&(L=$-$%16,this.blocks(T,D,L),D+=L,$-=L),$){for(A=0;A<$;A++)this.buffer[this.leftover+A]=T[D+A];this.leftover+=$}};function W(T,D,$,A,L,Q){var te=new V(Q);return te.update($,A,L),te.finish(T,D),0}function ee(T,D,$,A,L,Q){var te=new Uint8Array(16);return W(te,0,$,A,L,Q),b(T,D,te,0)}function Z(T,D,$,A,L){var Q;if($<32)return-1;for(B(T,0,D,0,$,A,L),W(T,16,T,32,$-32,T),Q=0;Q<16;Q++)T[Q]=0;return 0}function q(T,D,$,A,L){var Q,te=new Uint8Array(32);if($<32||(N(te,0,32,A,L),ee(D,16,D,32,$-32,te)!==0))return-1;for(B(T,0,D,0,$,A,L),Q=0;Q<32;Q++)T[Q]=0;return 0}function G(T,D){var $;for($=0;$<16;$++)T[$]=D[$]|0}function H(T){var D,$,A=1;for(D=0;D<16;D++)$=T[D]+A+65535,A=Math.floor($/65536),T[D]=$-A*65536;T[0]+=A-1+37*(A-1)}function j(T,D,$){for(var A,L=~($-1),Q=0;Q<16;Q++)A=L&(T[Q]^D[Q]),T[Q]^=A,D[Q]^=A}function K(T,D){var $,A,L,Q=n(),te=n();for($=0;$<16;$++)te[$]=D[$];for(H(te),H(te),H(te),A=0;A<2;A++){for(Q[0]=te[0]-65517,$=1;$<15;$++)Q[$]=te[$]-65535-(Q[$-1]>>16&1),Q[$-1]&=65535;Q[15]=te[15]-32767-(Q[14]>>16&1),L=Q[15]>>16&1,Q[14]&=65535,j(te,Q,1-L)}for($=0;$<16;$++)T[2*$]=te[$]&255,T[2*$+1]=te[$]>>8}function Y(T,D){var $=new Uint8Array(32),A=new Uint8Array(32);return K($,T),K(A,D),w($,0,A,0)}function re(T){var D=new Uint8Array(32);return K(D,T),D[0]&1}function ie(T,D){var $;for($=0;$<16;$++)T[$]=D[2*$]+(D[2*$+1]<<8);T[15]&=32767}function se(T,D,$){for(var A=0;A<16;A++)T[A]=D[A]+$[A]}function ye(T,D,$){for(var A=0;A<16;A++)T[A]=D[A]-$[A]}function we(T,D,$){var A,L,Q=0,te=0,fe=0,_e=0,je=0,Ve=0,ct=0,Ie=0,nt=0,bt=0,Ot=0,pt=0,ht=0,xt=0,wt=0,Qe=0,ut=0,Xe=0,Ne=0,qe=0,Ge=0,pe=0,he=0,Re=0,Oe=0,Pe=0,Be=0,vt=0,jt=0,Bt=0,It=0,J=$[0],Zt=$[1],sn=$[2],un=$[3],Ut=$[4],ln=$[5],rn=$[6],Yn=$[7],mn=$[8],kn=$[9],Zn=$[10],Xn=$[11],wr=$[12],Ir=$[13],Nr=$[14],Lr=$[15];A=D[0],Q+=A*J,te+=A*Zt,fe+=A*sn,_e+=A*un,je+=A*Ut,Ve+=A*ln,ct+=A*rn,Ie+=A*Yn,nt+=A*mn,bt+=A*kn,Ot+=A*Zn,pt+=A*Xn,ht+=A*wr,xt+=A*Ir,wt+=A*Nr,Qe+=A*Lr,A=D[1],te+=A*J,fe+=A*Zt,_e+=A*sn,je+=A*un,Ve+=A*Ut,ct+=A*ln,Ie+=A*rn,nt+=A*Yn,bt+=A*mn,Ot+=A*kn,pt+=A*Zn,ht+=A*Xn,xt+=A*wr,wt+=A*Ir,Qe+=A*Nr,ut+=A*Lr,A=D[2],fe+=A*J,_e+=A*Zt,je+=A*sn,Ve+=A*un,ct+=A*Ut,Ie+=A*ln,nt+=A*rn,bt+=A*Yn,Ot+=A*mn,pt+=A*kn,ht+=A*Zn,xt+=A*Xn,wt+=A*wr,Qe+=A*Ir,ut+=A*Nr,Xe+=A*Lr,A=D[3],_e+=A*J,je+=A*Zt,Ve+=A*sn,ct+=A*un,Ie+=A*Ut,nt+=A*ln,bt+=A*rn,Ot+=A*Yn,pt+=A*mn,ht+=A*kn,xt+=A*Zn,wt+=A*Xn,Qe+=A*wr,ut+=A*Ir,Xe+=A*Nr,Ne+=A*Lr,A=D[4],je+=A*J,Ve+=A*Zt,ct+=A*sn,Ie+=A*un,nt+=A*Ut,bt+=A*ln,Ot+=A*rn,pt+=A*Yn,ht+=A*mn,xt+=A*kn,wt+=A*Zn,Qe+=A*Xn,ut+=A*wr,Xe+=A*Ir,Ne+=A*Nr,qe+=A*Lr,A=D[5],Ve+=A*J,ct+=A*Zt,Ie+=A*sn,nt+=A*un,bt+=A*Ut,Ot+=A*ln,pt+=A*rn,ht+=A*Yn,xt+=A*mn,wt+=A*kn,Qe+=A*Zn,ut+=A*Xn,Xe+=A*wr,Ne+=A*Ir,qe+=A*Nr,Ge+=A*Lr,A=D[6],ct+=A*J,Ie+=A*Zt,nt+=A*sn,bt+=A*un,Ot+=A*Ut,pt+=A*ln,ht+=A*rn,xt+=A*Yn,wt+=A*mn,Qe+=A*kn,ut+=A*Zn,Xe+=A*Xn,Ne+=A*wr,qe+=A*Ir,Ge+=A*Nr,pe+=A*Lr,A=D[7],Ie+=A*J,nt+=A*Zt,bt+=A*sn,Ot+=A*un,pt+=A*Ut,ht+=A*ln,xt+=A*rn,wt+=A*Yn,Qe+=A*mn,ut+=A*kn,Xe+=A*Zn,Ne+=A*Xn,qe+=A*wr,Ge+=A*Ir,pe+=A*Nr,he+=A*Lr,A=D[8],nt+=A*J,bt+=A*Zt,Ot+=A*sn,pt+=A*un,ht+=A*Ut,xt+=A*ln,wt+=A*rn,Qe+=A*Yn,ut+=A*mn,Xe+=A*kn,Ne+=A*Zn,qe+=A*Xn,Ge+=A*wr,pe+=A*Ir,he+=A*Nr,Re+=A*Lr,A=D[9],bt+=A*J,Ot+=A*Zt,pt+=A*sn,ht+=A*un,xt+=A*Ut,wt+=A*ln,Qe+=A*rn,ut+=A*Yn,Xe+=A*mn,Ne+=A*kn,qe+=A*Zn,Ge+=A*Xn,pe+=A*wr,he+=A*Ir,Re+=A*Nr,Oe+=A*Lr,A=D[10],Ot+=A*J,pt+=A*Zt,ht+=A*sn,xt+=A*un,wt+=A*Ut,Qe+=A*ln,ut+=A*rn,Xe+=A*Yn,Ne+=A*mn,qe+=A*kn,Ge+=A*Zn,pe+=A*Xn,he+=A*wr,Re+=A*Ir,Oe+=A*Nr,Pe+=A*Lr,A=D[11],pt+=A*J,ht+=A*Zt,xt+=A*sn,wt+=A*un,Qe+=A*Ut,ut+=A*ln,Xe+=A*rn,Ne+=A*Yn,qe+=A*mn,Ge+=A*kn,pe+=A*Zn,he+=A*Xn,Re+=A*wr,Oe+=A*Ir,Pe+=A*Nr,Be+=A*Lr,A=D[12],ht+=A*J,xt+=A*Zt,wt+=A*sn,Qe+=A*un,ut+=A*Ut,Xe+=A*ln,Ne+=A*rn,qe+=A*Yn,Ge+=A*mn,pe+=A*kn,he+=A*Zn,Re+=A*Xn,Oe+=A*wr,Pe+=A*Ir,Be+=A*Nr,vt+=A*Lr,A=D[13],xt+=A*J,wt+=A*Zt,Qe+=A*sn,ut+=A*un,Xe+=A*Ut,Ne+=A*ln,qe+=A*rn,Ge+=A*Yn,pe+=A*mn,he+=A*kn,Re+=A*Zn,Oe+=A*Xn,Pe+=A*wr,Be+=A*Ir,vt+=A*Nr,jt+=A*Lr,A=D[14],wt+=A*J,Qe+=A*Zt,ut+=A*sn,Xe+=A*un,Ne+=A*Ut,qe+=A*ln,Ge+=A*rn,pe+=A*Yn,he+=A*mn,Re+=A*kn,Oe+=A*Zn,Pe+=A*Xn,Be+=A*wr,vt+=A*Ir,jt+=A*Nr,Bt+=A*Lr,A=D[15],Qe+=A*J,ut+=A*Zt,Xe+=A*sn,Ne+=A*un,qe+=A*Ut,Ge+=A*ln,pe+=A*rn,he+=A*Yn,Re+=A*mn,Oe+=A*kn,Pe+=A*Zn,Be+=A*Xn,vt+=A*wr,jt+=A*Ir,Bt+=A*Nr,It+=A*Lr,Q+=38*ut,te+=38*Xe,fe+=38*Ne,_e+=38*qe,je+=38*Ge,Ve+=38*pe,ct+=38*he,Ie+=38*Re,nt+=38*Oe,bt+=38*Pe,Ot+=38*Be,pt+=38*vt,ht+=38*jt,xt+=38*Bt,wt+=38*It,L=1,A=Q+L+65535,L=Math.floor(A/65536),Q=A-L*65536,A=te+L+65535,L=Math.floor(A/65536),te=A-L*65536,A=fe+L+65535,L=Math.floor(A/65536),fe=A-L*65536,A=_e+L+65535,L=Math.floor(A/65536),_e=A-L*65536,A=je+L+65535,L=Math.floor(A/65536),je=A-L*65536,A=Ve+L+65535,L=Math.floor(A/65536),Ve=A-L*65536,A=ct+L+65535,L=Math.floor(A/65536),ct=A-L*65536,A=Ie+L+65535,L=Math.floor(A/65536),Ie=A-L*65536,A=nt+L+65535,L=Math.floor(A/65536),nt=A-L*65536,A=bt+L+65535,L=Math.floor(A/65536),bt=A-L*65536,A=Ot+L+65535,L=Math.floor(A/65536),Ot=A-L*65536,A=pt+L+65535,L=Math.floor(A/65536),pt=A-L*65536,A=ht+L+65535,L=Math.floor(A/65536),ht=A-L*65536,A=xt+L+65535,L=Math.floor(A/65536),xt=A-L*65536,A=wt+L+65535,L=Math.floor(A/65536),wt=A-L*65536,A=Qe+L+65535,L=Math.floor(A/65536),Qe=A-L*65536,Q+=L-1+37*(L-1),L=1,A=Q+L+65535,L=Math.floor(A/65536),Q=A-L*65536,A=te+L+65535,L=Math.floor(A/65536),te=A-L*65536,A=fe+L+65535,L=Math.floor(A/65536),fe=A-L*65536,A=_e+L+65535,L=Math.floor(A/65536),_e=A-L*65536,A=je+L+65535,L=Math.floor(A/65536),je=A-L*65536,A=Ve+L+65535,L=Math.floor(A/65536),Ve=A-L*65536,A=ct+L+65535,L=Math.floor(A/65536),ct=A-L*65536,A=Ie+L+65535,L=Math.floor(A/65536),Ie=A-L*65536,A=nt+L+65535,L=Math.floor(A/65536),nt=A-L*65536,A=bt+L+65535,L=Math.floor(A/65536),bt=A-L*65536,A=Ot+L+65535,L=Math.floor(A/65536),Ot=A-L*65536,A=pt+L+65535,L=Math.floor(A/65536),pt=A-L*65536,A=ht+L+65535,L=Math.floor(A/65536),ht=A-L*65536,A=xt+L+65535,L=Math.floor(A/65536),xt=A-L*65536,A=wt+L+65535,L=Math.floor(A/65536),wt=A-L*65536,A=Qe+L+65535,L=Math.floor(A/65536),Qe=A-L*65536,Q+=L-1+37*(L-1),T[0]=Q,T[1]=te,T[2]=fe,T[3]=_e,T[4]=je,T[5]=Ve,T[6]=ct,T[7]=Ie,T[8]=nt,T[9]=bt,T[10]=Ot,T[11]=pt,T[12]=ht,T[13]=xt,T[14]=wt,T[15]=Qe}function He(T,D){we(T,D,D)}function Ee(T,D){var $=n(),A;for(A=0;A<16;A++)$[A]=D[A];for(A=253;A>=0;A--)He($,$),A!==2&&A!==4&&we($,$,D);for(A=0;A<16;A++)T[A]=$[A]}function it(T,D){var $=n(),A;for(A=0;A<16;A++)$[A]=D[A];for(A=250;A>=0;A--)He($,$),A!==1&&we($,$,D);for(A=0;A<16;A++)T[A]=$[A]}function ke(T,D,$){var A=new Uint8Array(32),L=new Float64Array(80),Q,te,fe=n(),_e=n(),je=n(),Ve=n(),ct=n(),Ie=n();for(te=0;te<31;te++)A[te]=D[te];for(A[31]=D[31]&127|64,A[0]&=248,ie(L,$),te=0;te<16;te++)_e[te]=L[te],Ve[te]=fe[te]=je[te]=0;for(fe[0]=Ve[0]=1,te=254;te>=0;--te)Q=A[te>>>3]>>>(te&7)&1,j(fe,_e,Q),j(je,Ve,Q),se(ct,fe,je),ye(fe,fe,je),se(je,_e,Ve),ye(_e,_e,Ve),He(Ve,ct),He(Ie,fe),we(fe,je,fe),we(je,_e,ct),se(ct,fe,je),ye(fe,fe,je),He(_e,fe),ye(je,Ve,Ie),we(fe,je,u),se(fe,fe,Ve),we(je,je,fe),we(fe,Ve,Ie),we(Ve,_e,L),He(_e,ct),j(fe,_e,Q),j(je,Ve,Q);for(te=0;te<16;te++)L[te+16]=fe[te],L[te+32]=je[te],L[te+48]=_e[te],L[te+64]=Ve[te];var nt=L.subarray(32),bt=L.subarray(16);return Ee(nt,nt),we(bt,bt,nt),K(T,bt),0}function Le(T,D){return ke(T,D,o)}function De(T,D){return r(D,32),Le(T,D)}function me(T,D,$){var A=new Uint8Array(32);return ke(A,$,D),E(T,i,A,C)}var yt=Z,lt=q;function Ft(T,D,$,A,L,Q){var te=new Uint8Array(32);return me(te,L,Q),yt(T,D,$,A,te)}function yn(T,D,$,A,L,Q){var te=new Uint8Array(32);return me(te,L,Q),lt(T,D,$,A,te)}var nn=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ne(T,D,$,A){for(var L=new Int32Array(16),Q=new Int32Array(16),te,fe,_e,je,Ve,ct,Ie,nt,bt,Ot,pt,ht,xt,wt,Qe,ut,Xe,Ne,qe,Ge,pe,he,Re,Oe,Pe,Be,vt=T[0],jt=T[1],Bt=T[2],It=T[3],J=T[4],Zt=T[5],sn=T[6],un=T[7],Ut=D[0],ln=D[1],rn=D[2],Yn=D[3],mn=D[4],kn=D[5],Zn=D[6],Xn=D[7],wr=0;A>=128;){for(qe=0;qe<16;qe++)Ge=8*qe+wr,L[qe]=$[Ge+0]<<24|$[Ge+1]<<16|$[Ge+2]<<8|$[Ge+3],Q[qe]=$[Ge+4]<<24|$[Ge+5]<<16|$[Ge+6]<<8|$[Ge+7];for(qe=0;qe<80;qe++)if(te=vt,fe=jt,_e=Bt,je=It,Ve=J,ct=Zt,Ie=sn,nt=un,bt=Ut,Ot=ln,pt=rn,ht=Yn,xt=mn,wt=kn,Qe=Zn,ut=Xn,pe=un,he=Xn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=(J>>>14|mn<<18)^(J>>>18|mn<<14)^(mn>>>9|J<<23),he=(mn>>>14|J<<18)^(mn>>>18|J<<14)^(J>>>9|mn<<23),Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,pe=J&Zt^~J&sn,he=mn&kn^~mn&Zn,Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,pe=nn[qe*2],he=nn[qe*2+1],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,pe=L[qe%16],he=Q[qe%16],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,Xe=Pe&65535|Be<<16,Ne=Re&65535|Oe<<16,pe=Xe,he=Ne,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=(vt>>>28|Ut<<4)^(Ut>>>2|vt<<30)^(Ut>>>7|vt<<25),he=(Ut>>>28|vt<<4)^(vt>>>2|Ut<<30)^(vt>>>7|Ut<<25),Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,pe=vt&jt^vt&Bt^jt&Bt,he=Ut&ln^Ut&rn^ln&rn,Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,nt=Pe&65535|Be<<16,ut=Re&65535|Oe<<16,pe=je,he=ht,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=Xe,he=Ne,Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,je=Pe&65535|Be<<16,ht=Re&65535|Oe<<16,jt=te,Bt=fe,It=_e,J=je,Zt=Ve,sn=ct,un=Ie,vt=nt,ln=bt,rn=Ot,Yn=pt,mn=ht,kn=xt,Zn=wt,Xn=Qe,Ut=ut,qe%16===15)for(Ge=0;Ge<16;Ge++)pe=L[Ge],he=Q[Ge],Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=L[(Ge+9)%16],he=Q[(Ge+9)%16],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Xe=L[(Ge+1)%16],Ne=Q[(Ge+1)%16],pe=(Xe>>>1|Ne<<31)^(Xe>>>8|Ne<<24)^Xe>>>7,he=(Ne>>>1|Xe<<31)^(Ne>>>8|Xe<<24)^(Ne>>>7|Xe<<25),Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Xe=L[(Ge+14)%16],Ne=Q[(Ge+14)%16],pe=(Xe>>>19|Ne<<13)^(Ne>>>29|Xe<<3)^Xe>>>6,he=(Ne>>>19|Xe<<13)^(Xe>>>29|Ne<<3)^(Ne>>>6|Xe<<26),Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,L[Ge]=Pe&65535|Be<<16,Q[Ge]=Re&65535|Oe<<16;pe=vt,he=Ut,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[0],he=D[0],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[0]=vt=Pe&65535|Be<<16,D[0]=Ut=Re&65535|Oe<<16,pe=jt,he=ln,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[1],he=D[1],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[1]=jt=Pe&65535|Be<<16,D[1]=ln=Re&65535|Oe<<16,pe=Bt,he=rn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[2],he=D[2],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[2]=Bt=Pe&65535|Be<<16,D[2]=rn=Re&65535|Oe<<16,pe=It,he=Yn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[3],he=D[3],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[3]=It=Pe&65535|Be<<16,D[3]=Yn=Re&65535|Oe<<16,pe=J,he=mn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[4],he=D[4],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[4]=J=Pe&65535|Be<<16,D[4]=mn=Re&65535|Oe<<16,pe=Zt,he=kn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[5],he=D[5],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[5]=Zt=Pe&65535|Be<<16,D[5]=kn=Re&65535|Oe<<16,pe=sn,he=Zn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[6],he=D[6],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[6]=sn=Pe&65535|Be<<16,D[6]=Zn=Re&65535|Oe<<16,pe=un,he=Xn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[7],he=D[7],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[7]=un=Pe&65535|Be<<16,D[7]=Xn=Re&65535|Oe<<16,wr+=128,A-=128}return A}function de(T,D,$){var A=new Int32Array(8),L=new Int32Array(8),Q=new Uint8Array(256),te,fe=$;for(A[0]=1779033703,A[1]=3144134277,A[2]=1013904242,A[3]=2773480762,A[4]=1359893119,A[5]=2600822924,A[6]=528734635,A[7]=1541459225,L[0]=4089235720,L[1]=2227873595,L[2]=4271175723,L[3]=1595750129,L[4]=2917565137,L[5]=725511199,L[6]=4215389547,L[7]=327033209,ne(A,L,D,$),$%=128,te=0;te<$;te++)Q[te]=D[fe-$+te];for(Q[$]=128,$=256-128*($<112?1:0),Q[$-9]=0,m(Q,$-8,fe/536870912|0,fe<<3),ne(A,L,Q,$),te=0;te<8;te++)m(T,8*te,A[te],L[te]);return 0}function ge(T,D){var $=n(),A=n(),L=n(),Q=n(),te=n(),fe=n(),_e=n(),je=n(),Ve=n();ye($,T[1],T[0]),ye(Ve,D[1],D[0]),we($,$,Ve),se(A,T[0],T[1]),se(Ve,D[0],D[1]),we(A,A,Ve),we(L,T[3],D[3]),we(L,L,c),we(Q,T[2],D[2]),se(Q,Q,Q),ye(te,A,$),ye(fe,Q,L),se(_e,Q,L),se(je,A,$),we(T[0],te,fe),we(T[1],je,_e),we(T[2],_e,fe),we(T[3],te,je)}function Ue(T,D,$){var A;for(A=0;A<4;A++)j(T[A],D[A],$)}function Fe(T,D){var $=n(),A=n(),L=n();Ee(L,D[2]),we($,D[0],L),we(A,D[1],L),K(T,A),T[31]^=re($)<<7}function Ae(T,D,$){var A,L;for(G(T[0],a),G(T[1],s),G(T[2],s),G(T[3],a),L=255;L>=0;--L)A=$[L/8|0]>>(L&7)&1,Ue(T,D,A),ge(D,T),ge(T,T),Ue(T,D,A)}function tt(T,D){var $=[n(),n(),n(),n()];G($[0],f),G($[1],h),G($[2],s),we($[3],f,h),Ae(T,$,D)}function mt(T,D,$){var A=new Uint8Array(64),L=[n(),n(),n(),n()],Q;for($||r(D,32),de(A,D,32),A[0]&=248,A[31]&=127,A[31]|=64,tt(L,A),Fe(T,L),Q=0;Q<32;Q++)D[Q+32]=T[Q];return 0}var wn=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Kt(T,D){var $,A,L,Q;for(A=63;A>=32;--A){for($=0,L=A-32,Q=A-12;L>4)*wn[L],$=D[L]>>8,D[L]&=255;for(L=0;L<32;L++)D[L]-=$*wn[L];for(A=0;A<32;A++)D[A+1]+=D[A]>>8,T[A]=D[A]&255}function _n(T){var D=new Float64Array(64),$;for($=0;$<64;$++)D[$]=T[$];for($=0;$<64;$++)T[$]=0;Kt(T,D)}function $i(T,D,$,A){var L=new Uint8Array(64),Q=new Uint8Array(64),te=new Uint8Array(64),fe,_e,je=new Float64Array(64),Ve=[n(),n(),n(),n()];de(L,A,32),L[0]&=248,L[31]&=127,L[31]|=64;var ct=$+64;for(fe=0;fe<$;fe++)T[64+fe]=D[fe];for(fe=0;fe<32;fe++)T[32+fe]=L[32+fe];for(de(te,T.subarray(32),$+32),_n(te),tt(Ve,te),Fe(T,Ve),fe=32;fe<64;fe++)T[fe]=A[fe];for(de(Q,T,$+64),_n(Q),fe=0;fe<64;fe++)je[fe]=0;for(fe=0;fe<32;fe++)je[fe]=te[fe];for(fe=0;fe<32;fe++)for(_e=0;_e<32;_e++)je[fe+_e]+=Q[fe]*L[_e];return Kt(T.subarray(32),je),ct}function xr(T,D){var $=n(),A=n(),L=n(),Q=n(),te=n(),fe=n(),_e=n();return G(T[2],s),ie(T[1],D),He(L,T[1]),we(Q,L,l),ye(L,L,T[2]),se(Q,T[2],Q),He(te,Q),He(fe,te),we(_e,fe,te),we($,_e,L),we($,$,Q),it($,$),we($,$,L),we($,$,Q),we($,$,Q),we(T[0],$,Q),He(A,T[0]),we(A,A,Q),Y(A,L)&&we(T[0],T[0],p),He(A,T[0]),we(A,A,Q),Y(A,L)?-1:(re(T[0])===D[31]>>7&&ye(T[0],a,T[0]),we(T[3],T[0],T[1]),0)}function mi(T,D,$,A){var L,Q=new Uint8Array(32),te=new Uint8Array(64),fe=[n(),n(),n(),n()],_e=[n(),n(),n(),n()];if($<64||xr(_e,A))return-1;for(L=0;L<$;L++)T[L]=D[L];for(L=0;L<32;L++)T[L+32]=A[L];if(de(te,T,$),_n(te),Ae(fe,_e,te),tt(_e,D.subarray(32)),ge(fe,_e),Fe(Q,fe),$-=64,w(D,0,Q,0)){for(L=0;L<$;L++)T[L]=0;return-1}for(L=0;L<$;L++)T[L]=D[L+64];return $}var ur=32,ai=24,vi=32,Dr=16,Zi=32,vo=32,yi=32,$r=32,_a=32,_t=ai,hn=vi,Sn=Dr,Gn=64,lr=32,Xr=64,yo=32,Xl=64;t.lowlevel={crypto_core_hsalsa20:E,crypto_stream_xor:B,crypto_stream:N,crypto_stream_salsa20_xor:P,crypto_stream_salsa20:M,crypto_onetimeauth:W,crypto_onetimeauth_verify:ee,crypto_verify_16:b,crypto_verify_32:w,crypto_secretbox:Z,crypto_secretbox_open:q,crypto_scalarmult:ke,crypto_scalarmult_base:Le,crypto_box_beforenm:me,crypto_box_afternm:yt,crypto_box:Ft,crypto_box_open:yn,crypto_box_keypair:De,crypto_hash:de,crypto_sign:$i,crypto_sign_keypair:mt,crypto_sign_open:mi,crypto_secretbox_KEYBYTES:ur,crypto_secretbox_NONCEBYTES:ai,crypto_secretbox_ZEROBYTES:vi,crypto_secretbox_BOXZEROBYTES:Dr,crypto_scalarmult_BYTES:Zi,crypto_scalarmult_SCALARBYTES:vo,crypto_box_PUBLICKEYBYTES:yi,crypto_box_SECRETKEYBYTES:$r,crypto_box_BEFORENMBYTES:_a,crypto_box_NONCEBYTES:_t,crypto_box_ZEROBYTES:hn,crypto_box_BOXZEROBYTES:Sn,crypto_sign_BYTES:Gn,crypto_sign_PUBLICKEYBYTES:lr,crypto_sign_SECRETKEYBYTES:Xr,crypto_sign_SEEDBYTES:yo,crypto_hash_BYTES:Xl,gf:n,D:l,L:wn,pack25519:K,unpack25519:ie,M:we,A:se,S:He,Z:ye,pow2523:it,add:ge,set25519:G,modL:Kt,scalarmult:Ae,scalarbase:tt};function Cf(T,D){if(T.length!==ur)throw new Error("bad key size");if(D.length!==ai)throw new Error("bad nonce size")}function oe(T,D){if(T.length!==yi)throw new Error("bad public key size");if(D.length!==$r)throw new Error("bad secret key size")}function ue(){for(var T=0;T=0},t.sign.keyPair=function(){var T=new Uint8Array(lr),D=new Uint8Array(Xr);return mt(T,D),{publicKey:T,secretKey:D}},t.sign.keyPair.fromSecretKey=function(T){if(ue(T),T.length!==Xr)throw new Error("bad secret key size");for(var D=new Uint8Array(lr),$=0;$"u"?typeof Buffer.from<"u"?(t.encodeBase64=function(r){return Buffer.from(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(Buffer.from(r,"base64"),0))}):(t.encodeBase64=function(r){return new Buffer(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0))}):(t.encodeBase64=function(r){var i,o=[],a=r.length;for(i=0;i{let n=!1;const r=e.map(i=>{const o=GN(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{scope:h,children:p,...m}=f,y=h?.[e]?.[u]||s,b=v.useMemo(()=>m,Object.values(m));return I.jsx(y.Provider,{value:b,children:p})};l.displayName=o+"Provider";function c(f,h){const p=h?.[e]?.[u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,tXe(i,...t)]}function tXe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function YN(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}var nXe=globalThis?.document?v.useLayoutEffect:()=>{},rXe=zx[" useInsertionEffect ".trim().toString()]||nXe;function iXe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=oXe({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:i;{const c=v.useRef(e!==void 0);v.useEffect(()=>{const f=c.current;f!==s&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${s?"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.`),c.current=s},[s,r])}const l=v.useCallback(c=>{if(s){const f=aXe(c)?c(e):c;f!==e&&a.current?.(f)}else o(c)},[s,e,o,a]);return[u,l]}function oXe({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),i=v.useRef(n),o=v.useRef(t);return rXe(()=>{o.current=t},[t]),v.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function aXe(e){return typeof e=="function"}function sXe(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var uXe=globalThis?.document?v.useLayoutEffect:()=>{};function lXe(e){const[t,n]=v.useState(void 0);return uXe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function ZN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cXe(...e){return t=>{let n=!1;const r=e.map(i=>{const o=ZN(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{};function dXe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var nX=e=>{const{present:t,children:n}=e,r=hXe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=fXe(r.ref,pXe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};nX.displayName="Presence";function hXe(e){const[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=dXe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Xy(r.current);o.current=s==="mounted"?l:"none"},[s]),XN(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Xy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),XN(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=Xy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=Xy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Xy(e){return e?.animationName||"none"}function pXe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function gXe(e){const t=mXe(e),n=v.forwardRef((r,i)=>{const{children:o,...a}=r,s=v.Children.toArray(o),u=s.find(yXe);if(u){const l=u.props.children,c=s.map(f=>f===u?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:f);return I.jsx(t,{...a,ref:i,children:v.isValidElement(l)?v.cloneElement(l,void 0,c):null})}return I.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function mXe(e){const t=v.forwardRef((n,r)=>{const{children:i,...o}=n;if(v.isValidElement(i)){const a=xXe(i),s=bXe(o,i.props);return i.type!==v.Fragment&&(s.ref=r?eX(r,a):a),v.cloneElement(i,s)}return v.Children.count(i)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vXe=Symbol("radix.slottable");function yXe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vXe}function bXe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const u=o(...s);return i(...s),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function xXe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wXe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],e8=wXe.reduce((e,t)=>{const n=gXe(`Primitive.${t}`),r=v.forwardRef((i,o)=>{const{asChild:a,...s}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(u,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),W2="Checkbox",[_Xe,Wtt]=eXe(W2),[SXe,t8]=_Xe(W2);function CXe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:a,name:s,onCheckedChange:u,required:l,value:c="on",internal_do_not_use_render:f}=e,[h,p]=iXe({prop:n,defaultProp:i??!1,onChange:u,caller:W2}),[m,y]=v.useState(null),[b,w]=v.useState(null),x=v.useRef(!1),S=m?!!a||!!m.closest("form"):!0,O={checked:h,disabled:o,setChecked:p,control:m,setControl:y,name:s,form:a,value:c,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:Cl(i)?!1:i,isFormControl:S,bubbleInput:b,setBubbleInput:w};return I.jsx(SXe,{scope:t,...O,children:AXe(f)?f(O):r})}var rX="CheckboxTrigger",iX=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:o,value:a,disabled:s,checked:u,required:l,setControl:c,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:m}=t8(rX,e),y=tX(i,c),b=v.useRef(u);return v.useEffect(()=>{const w=o?.form;if(w){const x=()=>f(b.current);return w.addEventListener("reset",x),()=>w.removeEventListener("reset",x)}},[o,f]),I.jsx(e8.button,{type:"button",role:"checkbox","aria-checked":Cl(u)?"mixed":u,"aria-required":l,"data-state":uX(u),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:y,onKeyDown:YN(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:YN(n,w=>{f(x=>Cl(x)?!0:!x),m&&p&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})})});iX.displayName=rX;var EXe=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:u,onCheckedChange:l,form:c,...f}=e;return I.jsx(CXe,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:s,required:a,onCheckedChange:l,name:r,form:c,value:u,internal_do_not_use_render:({isFormControl:h})=>I.jsxs(I.Fragment,{children:[I.jsx(iX,{...f,ref:t,__scopeCheckbox:n}),h&&I.jsx(sX,{__scopeCheckbox:n})]})})});EXe.displayName=W2;var oX="CheckboxIndicator",OXe=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=t8(oX,n);return I.jsx(nX,{present:r||Cl(o.checked)||o.checked===!0,children:I.jsx(e8.span,{"data-state":uX(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});OXe.displayName=oX;var aX="CheckboxBubbleInput",sX=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:a,required:s,disabled:u,name:l,value:c,form:f,bubbleInput:h,setBubbleInput:p}=t8(aX,e),m=tX(n,p),y=sXe(o),b=lXe(r);v.useEffect(()=>{const x=h;if(!x)return;const S=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(S,"checked").set,C=!i.current;if(y!==o&&E){const P=new Event("click",{bubbles:C});x.indeterminate=Cl(o),E.call(x,Cl(o)?!1:o),x.dispatchEvent(P)}},[h,y,o,i]);const w=v.useRef(Cl(o)?!1:o);return I.jsx(e8.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:s,disabled:u,name:l,value:c,form:f,...t,tabIndex:-1,ref:m,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});sX.displayName=aX;function AXe(e){return typeof e=="function"}function Cl(e){return e==="indeterminate"}function uX(e){return Cl(e)?"indeterminate":e?"checked":"unchecked"}export{Sve as $,UQe as A,Gi as B,bQe as C,tme as D,SQe as E,yQe as F,pT as G,F as H,eQe as I,DQe as J,MXe as K,PQe as L,FQe as M,QXe as N,kXe as O,$Xe as P,MQe as Q,vQe as R,Pl as S,kQe as T,XXe as U,IXe as V,yve as W,wve as X,_ve as Y,Cz as Z,QQe as _,LXe as a,Vet as a$,Cve as a0,bve as a1,xve as a2,OJe as a3,YQe as a4,AJe as a5,vJe as a6,yJe as a7,wJe as a8,_Je as a9,YXe as aA,oQe as aB,KXe as aC,JXe as aD,uQe as aE,sQe as aF,tQe as aG,aQe as aH,WXe as aI,UXe as aJ,ZXe as aK,gQe as aL,pQe as aM,dQe as aN,mQe as aO,rQe as aP,HXe as aQ,$et as aR,iJe as aS,wet as aT,iQe as aU,cQe as aV,Net as aW,Let as aX,Fet as aY,NXe as aZ,zet as a_,CJe as aa,HQe as ab,SJe as ac,eJe as ad,xJe as ae,EJe as af,gJe as ag,mJe as ah,bJe as ai,fJe as aj,cJe as ak,dJe as al,qXe as am,kJe as an,obe as ao,abe as ap,MJe as aq,IJe as ar,RJe as as,DJe as at,RXe as au,VXe as av,GXe as aw,lQe as ax,jXe as ay,get as az,Use as b,aet as b$,Wet as b0,Het as b1,KQe as b2,ett as b3,ZQe as b4,ttt as b5,qet as b6,Ket as b7,Get as b8,Zet as b9,zJe as bA,Met as bB,Tet as bC,net as bD,Pet as bE,dtt as bF,htt as bG,ptt as bH,dHe as bI,yHe as bJ,pet as bK,NJe as bL,BJe as bM,FJe as bN,rtt as bO,Ui as bP,mtt as bQ,vtt as bR,tJe as bS,nJe as bT,Ett as bU,oet as bV,Ott as bW,det as bX,Oet as bY,xet as bZ,tet as b_,Xet as ba,Jet as bb,Qet as bc,ntt as bd,Yet as be,ott as bf,GQe as bg,ltt as bh,ctt as bi,stt as bj,utt as bk,I3 as bl,Sf as bm,WJe as bn,jet as bo,Bet as bp,s5 as bq,u5 as br,mje as bs,Js as bt,wf as bu,rp as bv,itt as bw,LJe as bx,UJe as by,het as bz,dn as c,lJe as c$,Aet as c0,fet as c1,ket as c2,QJe as c3,ytt as c4,btt as c5,Stt as c6,YJe as c7,GJe as c8,zXe as c9,vet as cA,Cet as cB,yet as cC,cet as cD,qJe as cE,KJe as cF,Ret as cG,Ja as cH,br as cI,uet as cJ,xtt as cK,wtt as cL,sJe as cM,ef as cN,$Je as cO,Utt as cP,ztt as cQ,_et as cR,JJe as cS,ret as cT,met as cU,eet as cV,Eet as cW,set as cX,EXe as cY,OXe as cZ,XQe as c_,hQe as ca,nQe as cb,BXe as cc,fQe as cd,Ptt as ce,ktt as cf,bet as cg,Ttt as ch,ZJe as ci,jJe as cj,Itt as ck,Ntt as cl,jtt as cm,Btt as cn,Ltt as co,Ftt as cp,Rtt as cq,Dtt as cr,$tt as cs,rJe as ct,aJe as cu,_tt as cv,Ctt as cw,Nce as cx,zce as cy,Mce as cz,wm as d,qQe as d0,JQe as d1,uJe as d2,iet as d3,DXe as d4,HJe as d5,iHe as d6,oJe as d7,XJe as d8,VJe as d9,EQe as e,eA as f,TQe as g,AQe as h,NQe as i,I as j,Gr as k,LQe as l,CQe as m,xQe as n,wQe as o,$Qe as p,IQe as q,v as r,jQe as s,FXe as t,Sj as u,BQe as v,TXe as w,zQe as x,WQe as y,_Qe as z}; +`,o.map=[t,e.line],!0}function PYe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;const a=e.src.charCodeAt(i);if(a!==126&&a!==96)return!1;let s=i;i=e.skipChars(i,a);let u=i-s;if(u<3)return!1;const l=e.src.slice(s,i),c=e.src.slice(i,o);if(a===96&&c.indexOf(String.fromCharCode(a))>=0)return!1;if(r)return!0;let f=t,h=!1;for(;f++,!(f>=n||(i=s=e.bMarks[f]+e.tShift[f],o=e.eMarks[f],i=4)&&(i=e.skipChars(i,a),!(i-s=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;const s=[],u=[],l=[],c=[],f=e.md.block.ruler.getRules("blockquote"),h=e.parentType;e.parentType="blockquote";let p=!1,m;for(m=t;m=o)break;if(e.src.charCodeAt(i++)===62&&!S){let E=e.sCount[m]+1,C,P;e.src.charCodeAt(i)===32?(i++,E++,P=!1,C=!0):e.src.charCodeAt(i)===9?(C=!0,(e.bsCount[m]+E)%4===3?(i++,E++,P=!1):P=!0):C=!1;let M=E;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i=o,u.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+(C?1:0),l.push(e.sCount[m]),e.sCount[m]=M-E,c.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let O=!1;for(let E=0,C=f.length;E";const w=[t,0];b.map=w,e.md.block.tokenize(e,t,m);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=a,e.parentType=h,w[1]=e.line;for(let S=0;S=4)return!1;let o=e.bMarks[t]+e.tShift[t];const a=e.src.charCodeAt(o++);if(a!==42&&a!==45&&a!==95)return!1;let s=1;for(;o=r)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=e.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i=4||e.listIndent>=0&&e.sCount[u]-e.listIndent>=4&&e.sCount[u]=e.blkIndent&&(c=!0);let f,h,p;if((p=UN(e,u))>=0){if(f=!0,a=e.bMarks[u]+e.tShift[u],h=Number(e.src.slice(a,p-1)),c&&h!==1)return!1}else if((p=BN(e,u))>=0)f=!1;else return!1;if(c&&e.skipSpaces(p)>=e.eMarks[u])return!1;if(r)return!0;const m=e.src.charCodeAt(p-1),y=e.tokens.length;f?(s=e.push("ordered_list_open","ol",1),h!==1&&(s.attrs=[["start",h]])):s=e.push("bullet_list_open","ul",1);const b=[u,0];s.map=b,s.markup=String.fromCharCode(m);let w=!1;const x=e.md.block.ruler.getRules("list"),S=e.parentType;for(e.parentType="list";u=i?P=1:P=E-O,P>4&&(P=1);const M=O+P;s=e.push("list_item_open","li",1),s.markup=String.fromCharCode(m);const N=[u,0];s.map=N,f&&(s.info=e.src.slice(a,p-1));const B=e.tight,V=e.tShift[u],W=e.sCount[u],ee=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=M,e.tight=!0,e.tShift[u]=C-e.bMarks[u],e.sCount[u]=E,C>=i&&e.isEmpty(u+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,u,n,!0),(!e.tight||w)&&(l=!1),w=e.line-u>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ee,e.tShift[u]=V,e.sCount[u]=W,e.tight=B,s=e.push("list_item_close","li",-1),s.markup=String.fromCharCode(m),u=e.line,N[1]=u,u>=n||e.sCount[u]=4)break;let Z=!1;for(let q=0,G=x.length;q=4||e.src.charCodeAt(i)!==91)return!1;function s(x){const S=e.lineMax;if(x>=S||e.isEmpty(x))return null;let O=!1;if(e.sCount[x]-e.blkIndent>3&&(O=!0),e.sCount[x]<0&&(O=!0),!O){const P=e.md.block.ruler.getRules("reference"),M=e.parentType;e.parentType="reference";let N=!1;for(let B=0,V=P.length;B"u"&&(e.env.references={}),typeof e.env.references[w]>"u"&&(e.env.references[w]={title:b,href:f}),e.line=a),!0):!1}const $Ye=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],IYe="[a-zA-Z_:][a-zA-Z0-9:._-]*",NYe="[^\"'=<>`\\x00-\\x20]+",LYe="'[^']*'",FYe='"[^"]*"',jYe="(?:"+NYe+"|"+LYe+"|"+FYe+")",BYe="(?:\\s+"+IYe+"(?:\\s*=\\s*"+jYe+")?)",LZ="<[A-Za-z][A-Za-z0-9\\-]*"+BYe+"*\\s*\\/?>",FZ="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",UYe="",zYe="<[?][\\s\\S]*?[?]>",WYe="]*>",VYe="",HYe=new RegExp("^(?:"+LZ+"|"+FZ+"|"+UYe+"|"+zYe+"|"+WYe+"|"+VYe+")"),qYe=new RegExp("^(?:"+LZ+"|"+FZ+")"),ed=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(qYe.source+"\\s*$"),/^$/,!1]];function KYe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let a=e.src.slice(i,o),s=0;for(;s=4)return!1;let a=e.src.charCodeAt(i);if(a!==35||i>=o)return!1;let s=1;for(a=e.src.charCodeAt(++i);a===35&&i6||ii&&qn(e.src.charCodeAt(u-1))&&(o=u),e.line=t+1;const l=e.push("heading_open","h"+String(s),1);l.markup="########".slice(0,s),l.map=[t,e.line];const c=e.push("inline","",0);c.content=e.src.slice(i,o).trim(),c.map=[t,e.line],c.children=[];const f=e.push("heading_close","h"+String(s),-1);return f.markup="########".slice(0,s),!0}function YYe(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let o=0,a,s=t+1;for(;s3)continue;if(e.sCount[s]>=e.blkIndent){let p=e.bMarks[s]+e.tShift[s];const m=e.eMarks[s];if(p=m))){o=a===61?1:2;break}}if(e.sCount[s]<0)continue;let h=!1;for(let p=0,m=r.length;p3||e.sCount[o]<0)continue;let l=!1;for(let c=0,f=r.length;c=n||e.sCount[a]=o){e.line=n;break}const u=e.line;let l=!1;for(let c=0;c=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),a=e.line,a0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};nv.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=e.pending.match(JYe);if(!i)return!1;const o=i[1],a=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!a)return!1;let s=a.url;if(s.length<=o.length)return!1;s=s.replace(/\*+$/,"");const u=e.md.normalizeLink(s);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const l=e.push("link_open","a",1);l.attrs=[["href",u]],l.markup="linkify",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=s.length-o.length,!0}function tZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(e){Q5[e.charCodeAt(0)]=1});function nZe(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&s<=57343&&(o+=e.src[n+1],n++)}const a="\\"+o;if(!t){const s=e.push("text_special","",0);i<256&&Q5[i]!==0?s.content=o:s.content=a,s.markup=a,s.info="escape"}return e.pos=n+1,!0}function rZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=e.posMax;for(;n=0;r--){const i=t[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=t[i.end],a=r>0&&t[r-1].end===i.end+1&&t[r-1].marker===i.marker&&t[r-1].token===i.token-1&&t[i.end+1].token===o.token+1,s=String.fromCharCode(i.marker),u=e.tokens[i.token];u.type=a?"strong_open":"em_open",u.tag=a?"strong":"em",u.nesting=1,u.markup=a?s+s:s,u.content="";const l=e.tokens[o.token];l.type=a?"strong_close":"em_close",l.tag=a?"strong":"em",l.nesting=-1,l.markup=a?s+s:s,l.content="",a&&(e.tokens[t[r-1].token].content="",e.tokens[t[i.end+1].token].content="",r--)}}function sZe(e){const t=e.tokens_meta,n=e.tokens_meta.length;WN(e,e.delimiters);for(let r=0;r=f)return!1;if(u=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(a=e.md.normalizeLink(i.str),e.md.validateLink(a)?m=i.pos:a="",u=m;m=f||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(typeof e.env.references>"u")return!1;if(m=0?r=e.src.slice(u,m++):m=p+1):m=p+1,r||(r=e.src.slice(h,p)),o=e.env.references[B2(r)],!o)return e.pos=c,!1;a=o.href,s=o.title}if(!t){e.pos=h,e.posMax=p;const y=e.push("link_open","a",1),b=[["href",a]];y.attrs=b,s&&b.push(["title",s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=m,e.posMax=f,!0}function lZe(e,t){let n,r,i,o,a,s,u,l,c="";const f=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(o=m+1,o=h)return!1;for(l=o,s=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),s.ok&&(c=e.md.normalizeLink(s.str),e.md.validateLink(c)?o=s.pos:c=""),l=o;o=h||e.src.charCodeAt(o)!==41)return e.pos=f,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o=0?i=e.src.slice(l,o++):o=m+1):o=m+1,i||(i=e.src.slice(p,m)),a=e.env.references[B2(i)],!a)return e.pos=f,!1;c=a.href,u=a.title}if(!t){r=e.src.slice(p,m);const y=[];e.md.inline.parse(r,e.md,e.env,y);const b=e.push("image","img",0),w=[["src",c],["alt",""]];b.attrs=w,b.children=y,b.content=r,u&&w.push(["title",u])}return e.pos=o,e.posMax=h,!0}const cZe=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,fZe=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function dZe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const a=e.src.charCodeAt(n);if(a===60)return!1;if(a===62)break}const o=e.src.slice(r+1,n);if(fZe.test(o)){const a=e.md.normalizeLink(o);if(!e.md.validateLink(a))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}if(cZe.test(o)){const a=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(a))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}return!1}function hZe(e){return/^\s]/i.test(e)}function pZe(e){return/^<\/a\s*>/i.test(e)}function gZe(e){const t=e|32;return t>=97&&t<=122}function mZe(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!gZe(i))return!1;const o=e.src.slice(r).match(HYe);if(!o)return!1;if(!t){const a=e.push("html_inline","",0);a.content=o[0],hZe(a.content)&&e.linkLevel++,pZe(a.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const vZe=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,yZe=/^&([a-z][a-z0-9]{1,31});/i;function bZe(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(vZe);if(o){if(!t){const a=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),s=e.push("text_special","",0);s.content=Z5(a)?jx(a):jx(65533),s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(yZe);if(o){const a=RZ(o[0]);if(a!==o[0]){if(!t){const s=e.push("text_special","",0);s.content=a,s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function VN(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let a=0;au;l-=o[l]+1){const f=e[l];if(f.marker===s.marker&&f.open&&f.end<0){let h=!1;if((f.close||s.open)&&(f.length+s.length)%3===0&&(f.length%3!==0||s.length%3!==0)&&(h=!0),!h){const p=l>0&&!e[l-1].open?o[l-1]+1:0;o[a]=a-l+p,o[l]=p,s.open=!1,f.end=a,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(t[s.marker][(s.open?3:0)+(s.length||0)%3]=c)}}function xZe(e){const t=e.tokens_meta,n=e.tokens_meta.length;VN(e.delimiters);for(let r=0;r0&&r++,i[t].type==="text"&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,o[t]=e.pos};rv.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};rv.prototype.parse=function(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),a=o.length;for(let s=0;s|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function K4(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function z2(e){return Object.prototype.toString.call(e)}function SZe(e){return z2(e)==="[object String]"}function CZe(e){return z2(e)==="[object Object]"}function EZe(e){return z2(e)==="[object RegExp]"}function HN(e){return z2(e)==="[object Function]"}function OZe(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const UZ={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function AZe(e){return Object.keys(e||{}).reduce(function(t,n){return t||UZ.hasOwnProperty(n)},!1)}const PZe={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},kZe="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",TZe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function MZe(e){e.__index__=-1,e.__text_cache__=""}function RZe(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function qN(){return function(e,t){t.normalize(e)}}function Bx(e){const t=e.re=_Ze(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(kZe),n.push(t.src_xn),t.src_tlds=n.join("|");function r(s){return s.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function o(s,u){throw new Error('(LinkifyIt) Invalid schema "'+s+'": '+u)}Object.keys(e.__schemas__).forEach(function(s){const u=e.__schemas__[s];if(u===null)return;const l={validate:null,link:null};if(e.__compiled__[s]=l,CZe(u)){EZe(u.validate)?l.validate=RZe(u.validate):HN(u.validate)?l.validate=u.validate:o(s,u),HN(u.normalize)?l.normalize=u.normalize:u.normalize?o(s,u):l.normalize=qN();return}if(SZe(u)){i.push(s);return}o(s,u)}),i.forEach(function(s){e.__compiled__[e.__schemas__[s]]&&(e.__compiled__[s].validate=e.__compiled__[e.__schemas__[s]].validate,e.__compiled__[s].normalize=e.__compiled__[e.__schemas__[s]].normalize)}),e.__compiled__[""]={validate:null,normalize:qN()};const a=Object.keys(e.__compiled__).filter(function(s){return s.length>0&&e.__compiled__[s]}).map(OZe).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),MZe(e)}function DZe(e,t){const n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function G4(e,t){const n=new DZe(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Vo(e,t){if(!(this instanceof Vo))return new Vo(e,t);t||AZe(e)&&(t=e,e={}),this.__opts__=K4({},UZ,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=K4({},PZe,e),this.__compiled__={},this.__tlds__=TZe,this.__tlds_replaced__=!1,this.re={},Bx(this)}Vo.prototype.add=function(t,n){return this.__schemas__[t]=n,Bx(this),this};Vo.prototype.set=function(t){return this.__opts__=K4(this.__opts__,t),this};Vo.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,r,i,o,a,s,u,l,c;if(this.re.schema_test.test(t)){for(u=this.re.schema_search,u.lastIndex=0;(n=u.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],u.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l=0&&(i=t.match(this.re.email_fuzzy))!==null&&(a=i.index+i[1].length,s=i.index+i[0].length,(this.__index__<0||athis.__last_index__)&&(this.__schema__="mailto:",this.__index__=a,this.__last_index__=s))),this.__index__>=0};Vo.prototype.pretest=function(t){return this.re.pretest.test(t)};Vo.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};Vo.prototype.match=function(t){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(G4(this,r)),r=this.__last_index__);let i=r?t.slice(r):t;for(;this.test(i);)n.push(G4(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};Vo.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const r=this.testSchemaAt(t,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,G4(this,0)):null};Vo.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),Bx(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Bx(this),this)};Vo.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Vo.prototype.onCompile=function(){};const Bd=2147483647,xs=36,J5=1,pm=26,$Ze=38,IZe=700,zZ=72,WZ=128,VZ="-",NZe=/^xn--/,LZe=/[^\0-\x7F]/,FZe=/[\x2E\u3002\uFF0E\uFF61]/g,jZe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},oC=xs-J5,ws=Math.floor,aC=String.fromCharCode;function Ju(e){throw new RangeError(jZe[e])}function BZe(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function HZ(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(FZe,".");const i=e.split("."),o=BZe(i,t).join(".");return r+o}function qZ(e){const t=[];let n=0;const r=e.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...e),zZe=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:xs},KN=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},KZ=function(e,t,n){let r=0;for(e=n?ws(e/IZe):e>>1,e+=ws(e/t);e>oC*pm>>1;r+=xs)e=ws(e/oC);return ws(r+(oC+1)*e/(e+$Ze))},GZ=function(e){const t=[],n=e.length;let r=0,i=WZ,o=zZ,a=e.lastIndexOf(VZ);a<0&&(a=0);for(let s=0;s=128&&Ju("not-basic"),t.push(e.charCodeAt(s));for(let s=a>0?a+1:0;s=n&&Ju("invalid-input");const h=zZe(e.charCodeAt(s++));h>=xs&&Ju("invalid-input"),h>ws((Bd-r)/c)&&Ju("overflow"),r+=h*c;const p=f<=o?J5:f>=o+pm?pm:f-o;if(hws(Bd/m)&&Ju("overflow"),c*=m}const l=t.length+1;o=KZ(r-u,l,u==0),ws(r/l)>Bd-i&&Ju("overflow"),i+=ws(r/l),r%=l,t.splice(r++,0,i)}return String.fromCodePoint(...t)},YZ=function(e){const t=[];e=qZ(e);const n=e.length;let r=WZ,i=0,o=zZ;for(const u of e)u<128&&t.push(aC(u));const a=t.length;let s=a;for(a&&t.push(VZ);s=r&&cws((Bd-i)/l)&&Ju("overflow"),i+=(u-r)*l,r=u;for(const c of e)if(cBd&&Ju("overflow"),c===r){let f=i;for(let h=xs;;h+=xs){const p=h<=o?J5:h>=o+pm?pm:h-o;if(f=0))try{t.hostname=ZZ.toASCII(t.hostname)}catch{}return tv(q5(t))}function JZe(e){const t=K5(e,!0);if(t.hostname&&(!t.protocol||XZ.indexOf(t.protocol)>=0))try{t.hostname=ZZ.toUnicode(t.hostname)}catch{}return Ph(q5(t),Ph.defaultChars+"%")}function Ja(e,t){if(!(this instanceof Ja))return new Ja(e,t);t||Y5(e)||(t=e||{},e="default"),this.inline=new rv,this.block=new U2,this.core=new X5,this.renderer=new ap,this.linkify=new Vo,this.validateLink=XZe,this.normalizeLink=QZe,this.normalizeLinkText=JZe,this.utils=tYe,this.helpers=j2({},oYe),this.options={},this.configure(e),t&&this.set(t)}Ja.prototype.set=function(e){return j2(this.options,e),this};Ja.prototype.configure=function(e){const t=this;if(Y5(e)){const n=e;if(e=GZe[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};Ja.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Ja.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Ja.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Ja.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};Ja.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Ja.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Ja.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};var QZ={exports:{}};(function(e){(function(t){var n=function(T){var D,$=new Float64Array(16);if(T)for(D=0;D>24&255,T[D+1]=$>>16&255,T[D+2]=$>>8&255,T[D+3]=$&255,T[D+4]=A>>24&255,T[D+5]=A>>16&255,T[D+6]=A>>8&255,T[D+7]=A&255}function y(T,D,$,A,L){var Q,te=0;for(Q=0;Q>>8)-1}function b(T,D,$,A){return y(T,D,$,A,16)}function w(T,D,$,A){return y(T,D,$,A,32)}function x(T,D,$,A){for(var L=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,Q=$[0]&255|($[1]&255)<<8|($[2]&255)<<16|($[3]&255)<<24,te=$[4]&255|($[5]&255)<<8|($[6]&255)<<16|($[7]&255)<<24,fe=$[8]&255|($[9]&255)<<8|($[10]&255)<<16|($[11]&255)<<24,_e=$[12]&255|($[13]&255)<<8|($[14]&255)<<16|($[15]&255)<<24,je=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,Ve=D[0]&255|(D[1]&255)<<8|(D[2]&255)<<16|(D[3]&255)<<24,ct=D[4]&255|(D[5]&255)<<8|(D[6]&255)<<16|(D[7]&255)<<24,Ie=D[8]&255|(D[9]&255)<<8|(D[10]&255)<<16|(D[11]&255)<<24,nt=D[12]&255|(D[13]&255)<<8|(D[14]&255)<<16|(D[15]&255)<<24,bt=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Ot=$[16]&255|($[17]&255)<<8|($[18]&255)<<16|($[19]&255)<<24,pt=$[20]&255|($[21]&255)<<8|($[22]&255)<<16|($[23]&255)<<24,ht=$[24]&255|($[25]&255)<<8|($[26]&255)<<16|($[27]&255)<<24,xt=$[28]&255|($[29]&255)<<8|($[30]&255)<<16|($[31]&255)<<24,wt=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Qe=L,ut=Q,Xe=te,Ne=fe,qe=_e,Ge=je,pe=Ve,he=ct,Re=Ie,Oe=nt,Pe=bt,Be=Ot,vt=pt,jt=ht,Bt=xt,It=wt,J,Zt=0;Zt<20;Zt+=2)J=Qe+vt|0,qe^=J<<7|J>>>25,J=qe+Qe|0,Re^=J<<9|J>>>23,J=Re+qe|0,vt^=J<<13|J>>>19,J=vt+Re|0,Qe^=J<<18|J>>>14,J=Ge+ut|0,Oe^=J<<7|J>>>25,J=Oe+Ge|0,jt^=J<<9|J>>>23,J=jt+Oe|0,ut^=J<<13|J>>>19,J=ut+jt|0,Ge^=J<<18|J>>>14,J=Pe+pe|0,Bt^=J<<7|J>>>25,J=Bt+Pe|0,Xe^=J<<9|J>>>23,J=Xe+Bt|0,pe^=J<<13|J>>>19,J=pe+Xe|0,Pe^=J<<18|J>>>14,J=It+Be|0,Ne^=J<<7|J>>>25,J=Ne+It|0,he^=J<<9|J>>>23,J=he+Ne|0,Be^=J<<13|J>>>19,J=Be+he|0,It^=J<<18|J>>>14,J=Qe+Ne|0,ut^=J<<7|J>>>25,J=ut+Qe|0,Xe^=J<<9|J>>>23,J=Xe+ut|0,Ne^=J<<13|J>>>19,J=Ne+Xe|0,Qe^=J<<18|J>>>14,J=Ge+qe|0,pe^=J<<7|J>>>25,J=pe+Ge|0,he^=J<<9|J>>>23,J=he+pe|0,qe^=J<<13|J>>>19,J=qe+he|0,Ge^=J<<18|J>>>14,J=Pe+Oe|0,Be^=J<<7|J>>>25,J=Be+Pe|0,Re^=J<<9|J>>>23,J=Re+Be|0,Oe^=J<<13|J>>>19,J=Oe+Re|0,Pe^=J<<18|J>>>14,J=It+Bt|0,vt^=J<<7|J>>>25,J=vt+It|0,jt^=J<<9|J>>>23,J=jt+vt|0,Bt^=J<<13|J>>>19,J=Bt+jt|0,It^=J<<18|J>>>14;Qe=Qe+L|0,ut=ut+Q|0,Xe=Xe+te|0,Ne=Ne+fe|0,qe=qe+_e|0,Ge=Ge+je|0,pe=pe+Ve|0,he=he+ct|0,Re=Re+Ie|0,Oe=Oe+nt|0,Pe=Pe+bt|0,Be=Be+Ot|0,vt=vt+pt|0,jt=jt+ht|0,Bt=Bt+xt|0,It=It+wt|0,T[0]=Qe>>>0&255,T[1]=Qe>>>8&255,T[2]=Qe>>>16&255,T[3]=Qe>>>24&255,T[4]=ut>>>0&255,T[5]=ut>>>8&255,T[6]=ut>>>16&255,T[7]=ut>>>24&255,T[8]=Xe>>>0&255,T[9]=Xe>>>8&255,T[10]=Xe>>>16&255,T[11]=Xe>>>24&255,T[12]=Ne>>>0&255,T[13]=Ne>>>8&255,T[14]=Ne>>>16&255,T[15]=Ne>>>24&255,T[16]=qe>>>0&255,T[17]=qe>>>8&255,T[18]=qe>>>16&255,T[19]=qe>>>24&255,T[20]=Ge>>>0&255,T[21]=Ge>>>8&255,T[22]=Ge>>>16&255,T[23]=Ge>>>24&255,T[24]=pe>>>0&255,T[25]=pe>>>8&255,T[26]=pe>>>16&255,T[27]=pe>>>24&255,T[28]=he>>>0&255,T[29]=he>>>8&255,T[30]=he>>>16&255,T[31]=he>>>24&255,T[32]=Re>>>0&255,T[33]=Re>>>8&255,T[34]=Re>>>16&255,T[35]=Re>>>24&255,T[36]=Oe>>>0&255,T[37]=Oe>>>8&255,T[38]=Oe>>>16&255,T[39]=Oe>>>24&255,T[40]=Pe>>>0&255,T[41]=Pe>>>8&255,T[42]=Pe>>>16&255,T[43]=Pe>>>24&255,T[44]=Be>>>0&255,T[45]=Be>>>8&255,T[46]=Be>>>16&255,T[47]=Be>>>24&255,T[48]=vt>>>0&255,T[49]=vt>>>8&255,T[50]=vt>>>16&255,T[51]=vt>>>24&255,T[52]=jt>>>0&255,T[53]=jt>>>8&255,T[54]=jt>>>16&255,T[55]=jt>>>24&255,T[56]=Bt>>>0&255,T[57]=Bt>>>8&255,T[58]=Bt>>>16&255,T[59]=Bt>>>24&255,T[60]=It>>>0&255,T[61]=It>>>8&255,T[62]=It>>>16&255,T[63]=It>>>24&255}function S(T,D,$,A){for(var L=A[0]&255|(A[1]&255)<<8|(A[2]&255)<<16|(A[3]&255)<<24,Q=$[0]&255|($[1]&255)<<8|($[2]&255)<<16|($[3]&255)<<24,te=$[4]&255|($[5]&255)<<8|($[6]&255)<<16|($[7]&255)<<24,fe=$[8]&255|($[9]&255)<<8|($[10]&255)<<16|($[11]&255)<<24,_e=$[12]&255|($[13]&255)<<8|($[14]&255)<<16|($[15]&255)<<24,je=A[4]&255|(A[5]&255)<<8|(A[6]&255)<<16|(A[7]&255)<<24,Ve=D[0]&255|(D[1]&255)<<8|(D[2]&255)<<16|(D[3]&255)<<24,ct=D[4]&255|(D[5]&255)<<8|(D[6]&255)<<16|(D[7]&255)<<24,Ie=D[8]&255|(D[9]&255)<<8|(D[10]&255)<<16|(D[11]&255)<<24,nt=D[12]&255|(D[13]&255)<<8|(D[14]&255)<<16|(D[15]&255)<<24,bt=A[8]&255|(A[9]&255)<<8|(A[10]&255)<<16|(A[11]&255)<<24,Ot=$[16]&255|($[17]&255)<<8|($[18]&255)<<16|($[19]&255)<<24,pt=$[20]&255|($[21]&255)<<8|($[22]&255)<<16|($[23]&255)<<24,ht=$[24]&255|($[25]&255)<<8|($[26]&255)<<16|($[27]&255)<<24,xt=$[28]&255|($[29]&255)<<8|($[30]&255)<<16|($[31]&255)<<24,wt=A[12]&255|(A[13]&255)<<8|(A[14]&255)<<16|(A[15]&255)<<24,Qe=L,ut=Q,Xe=te,Ne=fe,qe=_e,Ge=je,pe=Ve,he=ct,Re=Ie,Oe=nt,Pe=bt,Be=Ot,vt=pt,jt=ht,Bt=xt,It=wt,J,Zt=0;Zt<20;Zt+=2)J=Qe+vt|0,qe^=J<<7|J>>>25,J=qe+Qe|0,Re^=J<<9|J>>>23,J=Re+qe|0,vt^=J<<13|J>>>19,J=vt+Re|0,Qe^=J<<18|J>>>14,J=Ge+ut|0,Oe^=J<<7|J>>>25,J=Oe+Ge|0,jt^=J<<9|J>>>23,J=jt+Oe|0,ut^=J<<13|J>>>19,J=ut+jt|0,Ge^=J<<18|J>>>14,J=Pe+pe|0,Bt^=J<<7|J>>>25,J=Bt+Pe|0,Xe^=J<<9|J>>>23,J=Xe+Bt|0,pe^=J<<13|J>>>19,J=pe+Xe|0,Pe^=J<<18|J>>>14,J=It+Be|0,Ne^=J<<7|J>>>25,J=Ne+It|0,he^=J<<9|J>>>23,J=he+Ne|0,Be^=J<<13|J>>>19,J=Be+he|0,It^=J<<18|J>>>14,J=Qe+Ne|0,ut^=J<<7|J>>>25,J=ut+Qe|0,Xe^=J<<9|J>>>23,J=Xe+ut|0,Ne^=J<<13|J>>>19,J=Ne+Xe|0,Qe^=J<<18|J>>>14,J=Ge+qe|0,pe^=J<<7|J>>>25,J=pe+Ge|0,he^=J<<9|J>>>23,J=he+pe|0,qe^=J<<13|J>>>19,J=qe+he|0,Ge^=J<<18|J>>>14,J=Pe+Oe|0,Be^=J<<7|J>>>25,J=Be+Pe|0,Re^=J<<9|J>>>23,J=Re+Be|0,Oe^=J<<13|J>>>19,J=Oe+Re|0,Pe^=J<<18|J>>>14,J=It+Bt|0,vt^=J<<7|J>>>25,J=vt+It|0,jt^=J<<9|J>>>23,J=jt+vt|0,Bt^=J<<13|J>>>19,J=Bt+jt|0,It^=J<<18|J>>>14;T[0]=Qe>>>0&255,T[1]=Qe>>>8&255,T[2]=Qe>>>16&255,T[3]=Qe>>>24&255,T[4]=Ge>>>0&255,T[5]=Ge>>>8&255,T[6]=Ge>>>16&255,T[7]=Ge>>>24&255,T[8]=Pe>>>0&255,T[9]=Pe>>>8&255,T[10]=Pe>>>16&255,T[11]=Pe>>>24&255,T[12]=It>>>0&255,T[13]=It>>>8&255,T[14]=It>>>16&255,T[15]=It>>>24&255,T[16]=pe>>>0&255,T[17]=pe>>>8&255,T[18]=pe>>>16&255,T[19]=pe>>>24&255,T[20]=he>>>0&255,T[21]=he>>>8&255,T[22]=he>>>16&255,T[23]=he>>>24&255,T[24]=Re>>>0&255,T[25]=Re>>>8&255,T[26]=Re>>>16&255,T[27]=Re>>>24&255,T[28]=Oe>>>0&255,T[29]=Oe>>>8&255,T[30]=Oe>>>16&255,T[31]=Oe>>>24&255}function O(T,D,$,A){x(T,D,$,A)}function E(T,D,$,A){S(T,D,$,A)}var C=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function P(T,D,$,A,L,Q,te){var fe=new Uint8Array(16),_e=new Uint8Array(64),je,Ve;for(Ve=0;Ve<16;Ve++)fe[Ve]=0;for(Ve=0;Ve<8;Ve++)fe[Ve]=Q[Ve];for(;L>=64;){for(O(_e,fe,te,C),Ve=0;Ve<64;Ve++)T[D+Ve]=$[A+Ve]^_e[Ve];for(je=1,Ve=8;Ve<16;Ve++)je=je+(fe[Ve]&255)|0,fe[Ve]=je&255,je>>>=8;L-=64,D+=64,A+=64}if(L>0)for(O(_e,fe,te,C),Ve=0;Ve=64;){for(O(te,Q,L,C),_e=0;_e<64;_e++)T[D+_e]=te[_e];for(fe=1,_e=8;_e<16;_e++)fe=fe+(Q[_e]&255)|0,Q[_e]=fe&255,fe>>>=8;$-=64,D+=64}if($>0)for(O(te,Q,L,C),_e=0;_e<$;_e++)T[D+_e]=te[_e];return 0}function N(T,D,$,A,L){var Q=new Uint8Array(32);E(Q,A,L,C);for(var te=new Uint8Array(8),fe=0;fe<8;fe++)te[fe]=A[fe+16];return M(T,D,$,te,Q)}function B(T,D,$,A,L,Q,te){var fe=new Uint8Array(32);E(fe,Q,te,C);for(var _e=new Uint8Array(8),je=0;je<8;je++)_e[je]=Q[je+16];return P(T,D,$,A,L,_e,fe)}var V=function(T){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var D,$,A,L,Q,te,fe,_e;D=T[0]&255|(T[1]&255)<<8,this.r[0]=D&8191,$=T[2]&255|(T[3]&255)<<8,this.r[1]=(D>>>13|$<<3)&8191,A=T[4]&255|(T[5]&255)<<8,this.r[2]=($>>>10|A<<6)&7939,L=T[6]&255|(T[7]&255)<<8,this.r[3]=(A>>>7|L<<9)&8191,Q=T[8]&255|(T[9]&255)<<8,this.r[4]=(L>>>4|Q<<12)&255,this.r[5]=Q>>>1&8190,te=T[10]&255|(T[11]&255)<<8,this.r[6]=(Q>>>14|te<<2)&8191,fe=T[12]&255|(T[13]&255)<<8,this.r[7]=(te>>>11|fe<<5)&8065,_e=T[14]&255|(T[15]&255)<<8,this.r[8]=(fe>>>8|_e<<8)&8191,this.r[9]=_e>>>5&127,this.pad[0]=T[16]&255|(T[17]&255)<<8,this.pad[1]=T[18]&255|(T[19]&255)<<8,this.pad[2]=T[20]&255|(T[21]&255)<<8,this.pad[3]=T[22]&255|(T[23]&255)<<8,this.pad[4]=T[24]&255|(T[25]&255)<<8,this.pad[5]=T[26]&255|(T[27]&255)<<8,this.pad[6]=T[28]&255|(T[29]&255)<<8,this.pad[7]=T[30]&255|(T[31]&255)<<8};V.prototype.blocks=function(T,D,$){for(var A=this.fin?0:2048,L,Q,te,fe,_e,je,Ve,ct,Ie,nt,bt,Ot,pt,ht,xt,wt,Qe,ut,Xe,Ne=this.h[0],qe=this.h[1],Ge=this.h[2],pe=this.h[3],he=this.h[4],Re=this.h[5],Oe=this.h[6],Pe=this.h[7],Be=this.h[8],vt=this.h[9],jt=this.r[0],Bt=this.r[1],It=this.r[2],J=this.r[3],Zt=this.r[4],sn=this.r[5],un=this.r[6],Ut=this.r[7],ln=this.r[8],rn=this.r[9];$>=16;)L=T[D+0]&255|(T[D+1]&255)<<8,Ne+=L&8191,Q=T[D+2]&255|(T[D+3]&255)<<8,qe+=(L>>>13|Q<<3)&8191,te=T[D+4]&255|(T[D+5]&255)<<8,Ge+=(Q>>>10|te<<6)&8191,fe=T[D+6]&255|(T[D+7]&255)<<8,pe+=(te>>>7|fe<<9)&8191,_e=T[D+8]&255|(T[D+9]&255)<<8,he+=(fe>>>4|_e<<12)&8191,Re+=_e>>>1&8191,je=T[D+10]&255|(T[D+11]&255)<<8,Oe+=(_e>>>14|je<<2)&8191,Ve=T[D+12]&255|(T[D+13]&255)<<8,Pe+=(je>>>11|Ve<<5)&8191,ct=T[D+14]&255|(T[D+15]&255)<<8,Be+=(Ve>>>8|ct<<8)&8191,vt+=ct>>>5|A,Ie=0,nt=Ie,nt+=Ne*jt,nt+=qe*(5*rn),nt+=Ge*(5*ln),nt+=pe*(5*Ut),nt+=he*(5*un),Ie=nt>>>13,nt&=8191,nt+=Re*(5*sn),nt+=Oe*(5*Zt),nt+=Pe*(5*J),nt+=Be*(5*It),nt+=vt*(5*Bt),Ie+=nt>>>13,nt&=8191,bt=Ie,bt+=Ne*Bt,bt+=qe*jt,bt+=Ge*(5*rn),bt+=pe*(5*ln),bt+=he*(5*Ut),Ie=bt>>>13,bt&=8191,bt+=Re*(5*un),bt+=Oe*(5*sn),bt+=Pe*(5*Zt),bt+=Be*(5*J),bt+=vt*(5*It),Ie+=bt>>>13,bt&=8191,Ot=Ie,Ot+=Ne*It,Ot+=qe*Bt,Ot+=Ge*jt,Ot+=pe*(5*rn),Ot+=he*(5*ln),Ie=Ot>>>13,Ot&=8191,Ot+=Re*(5*Ut),Ot+=Oe*(5*un),Ot+=Pe*(5*sn),Ot+=Be*(5*Zt),Ot+=vt*(5*J),Ie+=Ot>>>13,Ot&=8191,pt=Ie,pt+=Ne*J,pt+=qe*It,pt+=Ge*Bt,pt+=pe*jt,pt+=he*(5*rn),Ie=pt>>>13,pt&=8191,pt+=Re*(5*ln),pt+=Oe*(5*Ut),pt+=Pe*(5*un),pt+=Be*(5*sn),pt+=vt*(5*Zt),Ie+=pt>>>13,pt&=8191,ht=Ie,ht+=Ne*Zt,ht+=qe*J,ht+=Ge*It,ht+=pe*Bt,ht+=he*jt,Ie=ht>>>13,ht&=8191,ht+=Re*(5*rn),ht+=Oe*(5*ln),ht+=Pe*(5*Ut),ht+=Be*(5*un),ht+=vt*(5*sn),Ie+=ht>>>13,ht&=8191,xt=Ie,xt+=Ne*sn,xt+=qe*Zt,xt+=Ge*J,xt+=pe*It,xt+=he*Bt,Ie=xt>>>13,xt&=8191,xt+=Re*jt,xt+=Oe*(5*rn),xt+=Pe*(5*ln),xt+=Be*(5*Ut),xt+=vt*(5*un),Ie+=xt>>>13,xt&=8191,wt=Ie,wt+=Ne*un,wt+=qe*sn,wt+=Ge*Zt,wt+=pe*J,wt+=he*It,Ie=wt>>>13,wt&=8191,wt+=Re*Bt,wt+=Oe*jt,wt+=Pe*(5*rn),wt+=Be*(5*ln),wt+=vt*(5*Ut),Ie+=wt>>>13,wt&=8191,Qe=Ie,Qe+=Ne*Ut,Qe+=qe*un,Qe+=Ge*sn,Qe+=pe*Zt,Qe+=he*J,Ie=Qe>>>13,Qe&=8191,Qe+=Re*It,Qe+=Oe*Bt,Qe+=Pe*jt,Qe+=Be*(5*rn),Qe+=vt*(5*ln),Ie+=Qe>>>13,Qe&=8191,ut=Ie,ut+=Ne*ln,ut+=qe*Ut,ut+=Ge*un,ut+=pe*sn,ut+=he*Zt,Ie=ut>>>13,ut&=8191,ut+=Re*J,ut+=Oe*It,ut+=Pe*Bt,ut+=Be*jt,ut+=vt*(5*rn),Ie+=ut>>>13,ut&=8191,Xe=Ie,Xe+=Ne*rn,Xe+=qe*ln,Xe+=Ge*Ut,Xe+=pe*un,Xe+=he*sn,Ie=Xe>>>13,Xe&=8191,Xe+=Re*Zt,Xe+=Oe*J,Xe+=Pe*It,Xe+=Be*Bt,Xe+=vt*jt,Ie+=Xe>>>13,Xe&=8191,Ie=(Ie<<2)+Ie|0,Ie=Ie+nt|0,nt=Ie&8191,Ie=Ie>>>13,bt+=Ie,Ne=nt,qe=bt,Ge=Ot,pe=pt,he=ht,Re=xt,Oe=wt,Pe=Qe,Be=ut,vt=Xe,D+=16,$-=16;this.h[0]=Ne,this.h[1]=qe,this.h[2]=Ge,this.h[3]=pe,this.h[4]=he,this.h[5]=Re,this.h[6]=Oe,this.h[7]=Pe,this.h[8]=Be,this.h[9]=vt},V.prototype.finish=function(T,D){var $=new Uint16Array(10),A,L,Q,te;if(this.leftover){for(te=this.leftover,this.buffer[te++]=1;te<16;te++)this.buffer[te]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(A=this.h[1]>>>13,this.h[1]&=8191,te=2;te<10;te++)this.h[te]+=A,A=this.h[te]>>>13,this.h[te]&=8191;for(this.h[0]+=A*5,A=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=A,A=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=A,$[0]=this.h[0]+5,A=$[0]>>>13,$[0]&=8191,te=1;te<10;te++)$[te]=this.h[te]+A,A=$[te]>>>13,$[te]&=8191;for($[9]-=8192,L=(A^1)-1,te=0;te<10;te++)$[te]&=L;for(L=~L,te=0;te<10;te++)this.h[te]=this.h[te]&L|$[te];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,Q=this.h[0]+this.pad[0],this.h[0]=Q&65535,te=1;te<8;te++)Q=(this.h[te]+this.pad[te]|0)+(Q>>>16)|0,this.h[te]=Q&65535;T[D+0]=this.h[0]>>>0&255,T[D+1]=this.h[0]>>>8&255,T[D+2]=this.h[1]>>>0&255,T[D+3]=this.h[1]>>>8&255,T[D+4]=this.h[2]>>>0&255,T[D+5]=this.h[2]>>>8&255,T[D+6]=this.h[3]>>>0&255,T[D+7]=this.h[3]>>>8&255,T[D+8]=this.h[4]>>>0&255,T[D+9]=this.h[4]>>>8&255,T[D+10]=this.h[5]>>>0&255,T[D+11]=this.h[5]>>>8&255,T[D+12]=this.h[6]>>>0&255,T[D+13]=this.h[6]>>>8&255,T[D+14]=this.h[7]>>>0&255,T[D+15]=this.h[7]>>>8&255},V.prototype.update=function(T,D,$){var A,L;if(this.leftover){for(L=16-this.leftover,L>$&&(L=$),A=0;A=16&&(L=$-$%16,this.blocks(T,D,L),D+=L,$-=L),$){for(A=0;A<$;A++)this.buffer[this.leftover+A]=T[D+A];this.leftover+=$}};function W(T,D,$,A,L,Q){var te=new V(Q);return te.update($,A,L),te.finish(T,D),0}function ee(T,D,$,A,L,Q){var te=new Uint8Array(16);return W(te,0,$,A,L,Q),b(T,D,te,0)}function Z(T,D,$,A,L){var Q;if($<32)return-1;for(B(T,0,D,0,$,A,L),W(T,16,T,32,$-32,T),Q=0;Q<16;Q++)T[Q]=0;return 0}function q(T,D,$,A,L){var Q,te=new Uint8Array(32);if($<32||(N(te,0,32,A,L),ee(D,16,D,32,$-32,te)!==0))return-1;for(B(T,0,D,0,$,A,L),Q=0;Q<32;Q++)T[Q]=0;return 0}function G(T,D){var $;for($=0;$<16;$++)T[$]=D[$]|0}function H(T){var D,$,A=1;for(D=0;D<16;D++)$=T[D]+A+65535,A=Math.floor($/65536),T[D]=$-A*65536;T[0]+=A-1+37*(A-1)}function j(T,D,$){for(var A,L=~($-1),Q=0;Q<16;Q++)A=L&(T[Q]^D[Q]),T[Q]^=A,D[Q]^=A}function K(T,D){var $,A,L,Q=n(),te=n();for($=0;$<16;$++)te[$]=D[$];for(H(te),H(te),H(te),A=0;A<2;A++){for(Q[0]=te[0]-65517,$=1;$<15;$++)Q[$]=te[$]-65535-(Q[$-1]>>16&1),Q[$-1]&=65535;Q[15]=te[15]-32767-(Q[14]>>16&1),L=Q[15]>>16&1,Q[14]&=65535,j(te,Q,1-L)}for($=0;$<16;$++)T[2*$]=te[$]&255,T[2*$+1]=te[$]>>8}function Y(T,D){var $=new Uint8Array(32),A=new Uint8Array(32);return K($,T),K(A,D),w($,0,A,0)}function re(T){var D=new Uint8Array(32);return K(D,T),D[0]&1}function ie(T,D){var $;for($=0;$<16;$++)T[$]=D[2*$]+(D[2*$+1]<<8);T[15]&=32767}function se(T,D,$){for(var A=0;A<16;A++)T[A]=D[A]+$[A]}function ye(T,D,$){for(var A=0;A<16;A++)T[A]=D[A]-$[A]}function we(T,D,$){var A,L,Q=0,te=0,fe=0,_e=0,je=0,Ve=0,ct=0,Ie=0,nt=0,bt=0,Ot=0,pt=0,ht=0,xt=0,wt=0,Qe=0,ut=0,Xe=0,Ne=0,qe=0,Ge=0,pe=0,he=0,Re=0,Oe=0,Pe=0,Be=0,vt=0,jt=0,Bt=0,It=0,J=$[0],Zt=$[1],sn=$[2],un=$[3],Ut=$[4],ln=$[5],rn=$[6],Yn=$[7],mn=$[8],kn=$[9],Zn=$[10],Xn=$[11],wr=$[12],Ir=$[13],Nr=$[14],Lr=$[15];A=D[0],Q+=A*J,te+=A*Zt,fe+=A*sn,_e+=A*un,je+=A*Ut,Ve+=A*ln,ct+=A*rn,Ie+=A*Yn,nt+=A*mn,bt+=A*kn,Ot+=A*Zn,pt+=A*Xn,ht+=A*wr,xt+=A*Ir,wt+=A*Nr,Qe+=A*Lr,A=D[1],te+=A*J,fe+=A*Zt,_e+=A*sn,je+=A*un,Ve+=A*Ut,ct+=A*ln,Ie+=A*rn,nt+=A*Yn,bt+=A*mn,Ot+=A*kn,pt+=A*Zn,ht+=A*Xn,xt+=A*wr,wt+=A*Ir,Qe+=A*Nr,ut+=A*Lr,A=D[2],fe+=A*J,_e+=A*Zt,je+=A*sn,Ve+=A*un,ct+=A*Ut,Ie+=A*ln,nt+=A*rn,bt+=A*Yn,Ot+=A*mn,pt+=A*kn,ht+=A*Zn,xt+=A*Xn,wt+=A*wr,Qe+=A*Ir,ut+=A*Nr,Xe+=A*Lr,A=D[3],_e+=A*J,je+=A*Zt,Ve+=A*sn,ct+=A*un,Ie+=A*Ut,nt+=A*ln,bt+=A*rn,Ot+=A*Yn,pt+=A*mn,ht+=A*kn,xt+=A*Zn,wt+=A*Xn,Qe+=A*wr,ut+=A*Ir,Xe+=A*Nr,Ne+=A*Lr,A=D[4],je+=A*J,Ve+=A*Zt,ct+=A*sn,Ie+=A*un,nt+=A*Ut,bt+=A*ln,Ot+=A*rn,pt+=A*Yn,ht+=A*mn,xt+=A*kn,wt+=A*Zn,Qe+=A*Xn,ut+=A*wr,Xe+=A*Ir,Ne+=A*Nr,qe+=A*Lr,A=D[5],Ve+=A*J,ct+=A*Zt,Ie+=A*sn,nt+=A*un,bt+=A*Ut,Ot+=A*ln,pt+=A*rn,ht+=A*Yn,xt+=A*mn,wt+=A*kn,Qe+=A*Zn,ut+=A*Xn,Xe+=A*wr,Ne+=A*Ir,qe+=A*Nr,Ge+=A*Lr,A=D[6],ct+=A*J,Ie+=A*Zt,nt+=A*sn,bt+=A*un,Ot+=A*Ut,pt+=A*ln,ht+=A*rn,xt+=A*Yn,wt+=A*mn,Qe+=A*kn,ut+=A*Zn,Xe+=A*Xn,Ne+=A*wr,qe+=A*Ir,Ge+=A*Nr,pe+=A*Lr,A=D[7],Ie+=A*J,nt+=A*Zt,bt+=A*sn,Ot+=A*un,pt+=A*Ut,ht+=A*ln,xt+=A*rn,wt+=A*Yn,Qe+=A*mn,ut+=A*kn,Xe+=A*Zn,Ne+=A*Xn,qe+=A*wr,Ge+=A*Ir,pe+=A*Nr,he+=A*Lr,A=D[8],nt+=A*J,bt+=A*Zt,Ot+=A*sn,pt+=A*un,ht+=A*Ut,xt+=A*ln,wt+=A*rn,Qe+=A*Yn,ut+=A*mn,Xe+=A*kn,Ne+=A*Zn,qe+=A*Xn,Ge+=A*wr,pe+=A*Ir,he+=A*Nr,Re+=A*Lr,A=D[9],bt+=A*J,Ot+=A*Zt,pt+=A*sn,ht+=A*un,xt+=A*Ut,wt+=A*ln,Qe+=A*rn,ut+=A*Yn,Xe+=A*mn,Ne+=A*kn,qe+=A*Zn,Ge+=A*Xn,pe+=A*wr,he+=A*Ir,Re+=A*Nr,Oe+=A*Lr,A=D[10],Ot+=A*J,pt+=A*Zt,ht+=A*sn,xt+=A*un,wt+=A*Ut,Qe+=A*ln,ut+=A*rn,Xe+=A*Yn,Ne+=A*mn,qe+=A*kn,Ge+=A*Zn,pe+=A*Xn,he+=A*wr,Re+=A*Ir,Oe+=A*Nr,Pe+=A*Lr,A=D[11],pt+=A*J,ht+=A*Zt,xt+=A*sn,wt+=A*un,Qe+=A*Ut,ut+=A*ln,Xe+=A*rn,Ne+=A*Yn,qe+=A*mn,Ge+=A*kn,pe+=A*Zn,he+=A*Xn,Re+=A*wr,Oe+=A*Ir,Pe+=A*Nr,Be+=A*Lr,A=D[12],ht+=A*J,xt+=A*Zt,wt+=A*sn,Qe+=A*un,ut+=A*Ut,Xe+=A*ln,Ne+=A*rn,qe+=A*Yn,Ge+=A*mn,pe+=A*kn,he+=A*Zn,Re+=A*Xn,Oe+=A*wr,Pe+=A*Ir,Be+=A*Nr,vt+=A*Lr,A=D[13],xt+=A*J,wt+=A*Zt,Qe+=A*sn,ut+=A*un,Xe+=A*Ut,Ne+=A*ln,qe+=A*rn,Ge+=A*Yn,pe+=A*mn,he+=A*kn,Re+=A*Zn,Oe+=A*Xn,Pe+=A*wr,Be+=A*Ir,vt+=A*Nr,jt+=A*Lr,A=D[14],wt+=A*J,Qe+=A*Zt,ut+=A*sn,Xe+=A*un,Ne+=A*Ut,qe+=A*ln,Ge+=A*rn,pe+=A*Yn,he+=A*mn,Re+=A*kn,Oe+=A*Zn,Pe+=A*Xn,Be+=A*wr,vt+=A*Ir,jt+=A*Nr,Bt+=A*Lr,A=D[15],Qe+=A*J,ut+=A*Zt,Xe+=A*sn,Ne+=A*un,qe+=A*Ut,Ge+=A*ln,pe+=A*rn,he+=A*Yn,Re+=A*mn,Oe+=A*kn,Pe+=A*Zn,Be+=A*Xn,vt+=A*wr,jt+=A*Ir,Bt+=A*Nr,It+=A*Lr,Q+=38*ut,te+=38*Xe,fe+=38*Ne,_e+=38*qe,je+=38*Ge,Ve+=38*pe,ct+=38*he,Ie+=38*Re,nt+=38*Oe,bt+=38*Pe,Ot+=38*Be,pt+=38*vt,ht+=38*jt,xt+=38*Bt,wt+=38*It,L=1,A=Q+L+65535,L=Math.floor(A/65536),Q=A-L*65536,A=te+L+65535,L=Math.floor(A/65536),te=A-L*65536,A=fe+L+65535,L=Math.floor(A/65536),fe=A-L*65536,A=_e+L+65535,L=Math.floor(A/65536),_e=A-L*65536,A=je+L+65535,L=Math.floor(A/65536),je=A-L*65536,A=Ve+L+65535,L=Math.floor(A/65536),Ve=A-L*65536,A=ct+L+65535,L=Math.floor(A/65536),ct=A-L*65536,A=Ie+L+65535,L=Math.floor(A/65536),Ie=A-L*65536,A=nt+L+65535,L=Math.floor(A/65536),nt=A-L*65536,A=bt+L+65535,L=Math.floor(A/65536),bt=A-L*65536,A=Ot+L+65535,L=Math.floor(A/65536),Ot=A-L*65536,A=pt+L+65535,L=Math.floor(A/65536),pt=A-L*65536,A=ht+L+65535,L=Math.floor(A/65536),ht=A-L*65536,A=xt+L+65535,L=Math.floor(A/65536),xt=A-L*65536,A=wt+L+65535,L=Math.floor(A/65536),wt=A-L*65536,A=Qe+L+65535,L=Math.floor(A/65536),Qe=A-L*65536,Q+=L-1+37*(L-1),L=1,A=Q+L+65535,L=Math.floor(A/65536),Q=A-L*65536,A=te+L+65535,L=Math.floor(A/65536),te=A-L*65536,A=fe+L+65535,L=Math.floor(A/65536),fe=A-L*65536,A=_e+L+65535,L=Math.floor(A/65536),_e=A-L*65536,A=je+L+65535,L=Math.floor(A/65536),je=A-L*65536,A=Ve+L+65535,L=Math.floor(A/65536),Ve=A-L*65536,A=ct+L+65535,L=Math.floor(A/65536),ct=A-L*65536,A=Ie+L+65535,L=Math.floor(A/65536),Ie=A-L*65536,A=nt+L+65535,L=Math.floor(A/65536),nt=A-L*65536,A=bt+L+65535,L=Math.floor(A/65536),bt=A-L*65536,A=Ot+L+65535,L=Math.floor(A/65536),Ot=A-L*65536,A=pt+L+65535,L=Math.floor(A/65536),pt=A-L*65536,A=ht+L+65535,L=Math.floor(A/65536),ht=A-L*65536,A=xt+L+65535,L=Math.floor(A/65536),xt=A-L*65536,A=wt+L+65535,L=Math.floor(A/65536),wt=A-L*65536,A=Qe+L+65535,L=Math.floor(A/65536),Qe=A-L*65536,Q+=L-1+37*(L-1),T[0]=Q,T[1]=te,T[2]=fe,T[3]=_e,T[4]=je,T[5]=Ve,T[6]=ct,T[7]=Ie,T[8]=nt,T[9]=bt,T[10]=Ot,T[11]=pt,T[12]=ht,T[13]=xt,T[14]=wt,T[15]=Qe}function He(T,D){we(T,D,D)}function Ee(T,D){var $=n(),A;for(A=0;A<16;A++)$[A]=D[A];for(A=253;A>=0;A--)He($,$),A!==2&&A!==4&&we($,$,D);for(A=0;A<16;A++)T[A]=$[A]}function it(T,D){var $=n(),A;for(A=0;A<16;A++)$[A]=D[A];for(A=250;A>=0;A--)He($,$),A!==1&&we($,$,D);for(A=0;A<16;A++)T[A]=$[A]}function ke(T,D,$){var A=new Uint8Array(32),L=new Float64Array(80),Q,te,fe=n(),_e=n(),je=n(),Ve=n(),ct=n(),Ie=n();for(te=0;te<31;te++)A[te]=D[te];for(A[31]=D[31]&127|64,A[0]&=248,ie(L,$),te=0;te<16;te++)_e[te]=L[te],Ve[te]=fe[te]=je[te]=0;for(fe[0]=Ve[0]=1,te=254;te>=0;--te)Q=A[te>>>3]>>>(te&7)&1,j(fe,_e,Q),j(je,Ve,Q),se(ct,fe,je),ye(fe,fe,je),se(je,_e,Ve),ye(_e,_e,Ve),He(Ve,ct),He(Ie,fe),we(fe,je,fe),we(je,_e,ct),se(ct,fe,je),ye(fe,fe,je),He(_e,fe),ye(je,Ve,Ie),we(fe,je,u),se(fe,fe,Ve),we(je,je,fe),we(fe,Ve,Ie),we(Ve,_e,L),He(_e,ct),j(fe,_e,Q),j(je,Ve,Q);for(te=0;te<16;te++)L[te+16]=fe[te],L[te+32]=je[te],L[te+48]=_e[te],L[te+64]=Ve[te];var nt=L.subarray(32),bt=L.subarray(16);return Ee(nt,nt),we(bt,bt,nt),K(T,bt),0}function Le(T,D){return ke(T,D,o)}function De(T,D){return r(D,32),Le(T,D)}function me(T,D,$){var A=new Uint8Array(32);return ke(A,$,D),E(T,i,A,C)}var yt=Z,lt=q;function Ft(T,D,$,A,L,Q){var te=new Uint8Array(32);return me(te,L,Q),yt(T,D,$,A,te)}function yn(T,D,$,A,L,Q){var te=new Uint8Array(32);return me(te,L,Q),lt(T,D,$,A,te)}var nn=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ne(T,D,$,A){for(var L=new Int32Array(16),Q=new Int32Array(16),te,fe,_e,je,Ve,ct,Ie,nt,bt,Ot,pt,ht,xt,wt,Qe,ut,Xe,Ne,qe,Ge,pe,he,Re,Oe,Pe,Be,vt=T[0],jt=T[1],Bt=T[2],It=T[3],J=T[4],Zt=T[5],sn=T[6],un=T[7],Ut=D[0],ln=D[1],rn=D[2],Yn=D[3],mn=D[4],kn=D[5],Zn=D[6],Xn=D[7],wr=0;A>=128;){for(qe=0;qe<16;qe++)Ge=8*qe+wr,L[qe]=$[Ge+0]<<24|$[Ge+1]<<16|$[Ge+2]<<8|$[Ge+3],Q[qe]=$[Ge+4]<<24|$[Ge+5]<<16|$[Ge+6]<<8|$[Ge+7];for(qe=0;qe<80;qe++)if(te=vt,fe=jt,_e=Bt,je=It,Ve=J,ct=Zt,Ie=sn,nt=un,bt=Ut,Ot=ln,pt=rn,ht=Yn,xt=mn,wt=kn,Qe=Zn,ut=Xn,pe=un,he=Xn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=(J>>>14|mn<<18)^(J>>>18|mn<<14)^(mn>>>9|J<<23),he=(mn>>>14|J<<18)^(mn>>>18|J<<14)^(J>>>9|mn<<23),Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,pe=J&Zt^~J&sn,he=mn&kn^~mn&Zn,Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,pe=nn[qe*2],he=nn[qe*2+1],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,pe=L[qe%16],he=Q[qe%16],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,Xe=Pe&65535|Be<<16,Ne=Re&65535|Oe<<16,pe=Xe,he=Ne,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=(vt>>>28|Ut<<4)^(Ut>>>2|vt<<30)^(Ut>>>7|vt<<25),he=(Ut>>>28|vt<<4)^(vt>>>2|Ut<<30)^(vt>>>7|Ut<<25),Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,pe=vt&jt^vt&Bt^jt&Bt,he=Ut&ln^Ut&rn^ln&rn,Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,nt=Pe&65535|Be<<16,ut=Re&65535|Oe<<16,pe=je,he=ht,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=Xe,he=Ne,Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,je=Pe&65535|Be<<16,ht=Re&65535|Oe<<16,jt=te,Bt=fe,It=_e,J=je,Zt=Ve,sn=ct,un=Ie,vt=nt,ln=bt,rn=Ot,Yn=pt,mn=ht,kn=xt,Zn=wt,Xn=Qe,Ut=ut,qe%16===15)for(Ge=0;Ge<16;Ge++)pe=L[Ge],he=Q[Ge],Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=L[(Ge+9)%16],he=Q[(Ge+9)%16],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Xe=L[(Ge+1)%16],Ne=Q[(Ge+1)%16],pe=(Xe>>>1|Ne<<31)^(Xe>>>8|Ne<<24)^Xe>>>7,he=(Ne>>>1|Xe<<31)^(Ne>>>8|Xe<<24)^(Ne>>>7|Xe<<25),Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Xe=L[(Ge+14)%16],Ne=Q[(Ge+14)%16],pe=(Xe>>>19|Ne<<13)^(Ne>>>29|Xe<<3)^Xe>>>6,he=(Ne>>>19|Xe<<13)^(Xe>>>29|Ne<<3)^(Ne>>>6|Xe<<26),Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,L[Ge]=Pe&65535|Be<<16,Q[Ge]=Re&65535|Oe<<16;pe=vt,he=Ut,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[0],he=D[0],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[0]=vt=Pe&65535|Be<<16,D[0]=Ut=Re&65535|Oe<<16,pe=jt,he=ln,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[1],he=D[1],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[1]=jt=Pe&65535|Be<<16,D[1]=ln=Re&65535|Oe<<16,pe=Bt,he=rn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[2],he=D[2],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[2]=Bt=Pe&65535|Be<<16,D[2]=rn=Re&65535|Oe<<16,pe=It,he=Yn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[3],he=D[3],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[3]=It=Pe&65535|Be<<16,D[3]=Yn=Re&65535|Oe<<16,pe=J,he=mn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[4],he=D[4],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[4]=J=Pe&65535|Be<<16,D[4]=mn=Re&65535|Oe<<16,pe=Zt,he=kn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[5],he=D[5],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[5]=Zt=Pe&65535|Be<<16,D[5]=kn=Re&65535|Oe<<16,pe=sn,he=Zn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[6],he=D[6],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[6]=sn=Pe&65535|Be<<16,D[6]=Zn=Re&65535|Oe<<16,pe=un,he=Xn,Re=he&65535,Oe=he>>>16,Pe=pe&65535,Be=pe>>>16,pe=T[7],he=D[7],Re+=he&65535,Oe+=he>>>16,Pe+=pe&65535,Be+=pe>>>16,Oe+=Re>>>16,Pe+=Oe>>>16,Be+=Pe>>>16,T[7]=un=Pe&65535|Be<<16,D[7]=Xn=Re&65535|Oe<<16,wr+=128,A-=128}return A}function de(T,D,$){var A=new Int32Array(8),L=new Int32Array(8),Q=new Uint8Array(256),te,fe=$;for(A[0]=1779033703,A[1]=3144134277,A[2]=1013904242,A[3]=2773480762,A[4]=1359893119,A[5]=2600822924,A[6]=528734635,A[7]=1541459225,L[0]=4089235720,L[1]=2227873595,L[2]=4271175723,L[3]=1595750129,L[4]=2917565137,L[5]=725511199,L[6]=4215389547,L[7]=327033209,ne(A,L,D,$),$%=128,te=0;te<$;te++)Q[te]=D[fe-$+te];for(Q[$]=128,$=256-128*($<112?1:0),Q[$-9]=0,m(Q,$-8,fe/536870912|0,fe<<3),ne(A,L,Q,$),te=0;te<8;te++)m(T,8*te,A[te],L[te]);return 0}function ge(T,D){var $=n(),A=n(),L=n(),Q=n(),te=n(),fe=n(),_e=n(),je=n(),Ve=n();ye($,T[1],T[0]),ye(Ve,D[1],D[0]),we($,$,Ve),se(A,T[0],T[1]),se(Ve,D[0],D[1]),we(A,A,Ve),we(L,T[3],D[3]),we(L,L,c),we(Q,T[2],D[2]),se(Q,Q,Q),ye(te,A,$),ye(fe,Q,L),se(_e,Q,L),se(je,A,$),we(T[0],te,fe),we(T[1],je,_e),we(T[2],_e,fe),we(T[3],te,je)}function Ue(T,D,$){var A;for(A=0;A<4;A++)j(T[A],D[A],$)}function Fe(T,D){var $=n(),A=n(),L=n();Ee(L,D[2]),we($,D[0],L),we(A,D[1],L),K(T,A),T[31]^=re($)<<7}function Ae(T,D,$){var A,L;for(G(T[0],a),G(T[1],s),G(T[2],s),G(T[3],a),L=255;L>=0;--L)A=$[L/8|0]>>(L&7)&1,Ue(T,D,A),ge(D,T),ge(T,T),Ue(T,D,A)}function tt(T,D){var $=[n(),n(),n(),n()];G($[0],f),G($[1],h),G($[2],s),we($[3],f,h),Ae(T,$,D)}function mt(T,D,$){var A=new Uint8Array(64),L=[n(),n(),n(),n()],Q;for($||r(D,32),de(A,D,32),A[0]&=248,A[31]&=127,A[31]|=64,tt(L,A),Fe(T,L),Q=0;Q<32;Q++)D[Q+32]=T[Q];return 0}var wn=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Kt(T,D){var $,A,L,Q;for(A=63;A>=32;--A){for($=0,L=A-32,Q=A-12;L>4)*wn[L],$=D[L]>>8,D[L]&=255;for(L=0;L<32;L++)D[L]-=$*wn[L];for(A=0;A<32;A++)D[A+1]+=D[A]>>8,T[A]=D[A]&255}function _n(T){var D=new Float64Array(64),$;for($=0;$<64;$++)D[$]=T[$];for($=0;$<64;$++)T[$]=0;Kt(T,D)}function $i(T,D,$,A){var L=new Uint8Array(64),Q=new Uint8Array(64),te=new Uint8Array(64),fe,_e,je=new Float64Array(64),Ve=[n(),n(),n(),n()];de(L,A,32),L[0]&=248,L[31]&=127,L[31]|=64;var ct=$+64;for(fe=0;fe<$;fe++)T[64+fe]=D[fe];for(fe=0;fe<32;fe++)T[32+fe]=L[32+fe];for(de(te,T.subarray(32),$+32),_n(te),tt(Ve,te),Fe(T,Ve),fe=32;fe<64;fe++)T[fe]=A[fe];for(de(Q,T,$+64),_n(Q),fe=0;fe<64;fe++)je[fe]=0;for(fe=0;fe<32;fe++)je[fe]=te[fe];for(fe=0;fe<32;fe++)for(_e=0;_e<32;_e++)je[fe+_e]+=Q[fe]*L[_e];return Kt(T.subarray(32),je),ct}function xr(T,D){var $=n(),A=n(),L=n(),Q=n(),te=n(),fe=n(),_e=n();return G(T[2],s),ie(T[1],D),He(L,T[1]),we(Q,L,l),ye(L,L,T[2]),se(Q,T[2],Q),He(te,Q),He(fe,te),we(_e,fe,te),we($,_e,L),we($,$,Q),it($,$),we($,$,L),we($,$,Q),we($,$,Q),we(T[0],$,Q),He(A,T[0]),we(A,A,Q),Y(A,L)&&we(T[0],T[0],p),He(A,T[0]),we(A,A,Q),Y(A,L)?-1:(re(T[0])===D[31]>>7&&ye(T[0],a,T[0]),we(T[3],T[0],T[1]),0)}function mi(T,D,$,A){var L,Q=new Uint8Array(32),te=new Uint8Array(64),fe=[n(),n(),n(),n()],_e=[n(),n(),n(),n()];if($<64||xr(_e,A))return-1;for(L=0;L<$;L++)T[L]=D[L];for(L=0;L<32;L++)T[L+32]=A[L];if(de(te,T,$),_n(te),Ae(fe,_e,te),tt(_e,D.subarray(32)),ge(fe,_e),Fe(Q,fe),$-=64,w(D,0,Q,0)){for(L=0;L<$;L++)T[L]=0;return-1}for(L=0;L<$;L++)T[L]=D[L+64];return $}var ur=32,ai=24,vi=32,Dr=16,Zi=32,vo=32,yi=32,$r=32,_a=32,_t=ai,hn=vi,Sn=Dr,Gn=64,lr=32,Xr=64,yo=32,Xl=64;t.lowlevel={crypto_core_hsalsa20:E,crypto_stream_xor:B,crypto_stream:N,crypto_stream_salsa20_xor:P,crypto_stream_salsa20:M,crypto_onetimeauth:W,crypto_onetimeauth_verify:ee,crypto_verify_16:b,crypto_verify_32:w,crypto_secretbox:Z,crypto_secretbox_open:q,crypto_scalarmult:ke,crypto_scalarmult_base:Le,crypto_box_beforenm:me,crypto_box_afternm:yt,crypto_box:Ft,crypto_box_open:yn,crypto_box_keypair:De,crypto_hash:de,crypto_sign:$i,crypto_sign_keypair:mt,crypto_sign_open:mi,crypto_secretbox_KEYBYTES:ur,crypto_secretbox_NONCEBYTES:ai,crypto_secretbox_ZEROBYTES:vi,crypto_secretbox_BOXZEROBYTES:Dr,crypto_scalarmult_BYTES:Zi,crypto_scalarmult_SCALARBYTES:vo,crypto_box_PUBLICKEYBYTES:yi,crypto_box_SECRETKEYBYTES:$r,crypto_box_BEFORENMBYTES:_a,crypto_box_NONCEBYTES:_t,crypto_box_ZEROBYTES:hn,crypto_box_BOXZEROBYTES:Sn,crypto_sign_BYTES:Gn,crypto_sign_PUBLICKEYBYTES:lr,crypto_sign_SECRETKEYBYTES:Xr,crypto_sign_SEEDBYTES:yo,crypto_hash_BYTES:Xl,gf:n,D:l,L:wn,pack25519:K,unpack25519:ie,M:we,A:se,S:He,Z:ye,pow2523:it,add:ge,set25519:G,modL:Kt,scalarmult:Ae,scalarbase:tt};function Cf(T,D){if(T.length!==ur)throw new Error("bad key size");if(D.length!==ai)throw new Error("bad nonce size")}function oe(T,D){if(T.length!==yi)throw new Error("bad public key size");if(D.length!==$r)throw new Error("bad secret key size")}function ue(){for(var T=0;T=0},t.sign.keyPair=function(){var T=new Uint8Array(lr),D=new Uint8Array(Xr);return mt(T,D),{publicKey:T,secretKey:D}},t.sign.keyPair.fromSecretKey=function(T){if(ue(T),T.length!==Xr)throw new Error("bad secret key size");for(var D=new Uint8Array(lr),$=0;$"u"?typeof Buffer.from<"u"?(t.encodeBase64=function(r){return Buffer.from(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(Buffer.from(r,"base64"),0))}):(t.encodeBase64=function(r){return new Buffer(r).toString("base64")},t.decodeBase64=function(r){return n(r),new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0))}):(t.encodeBase64=function(r){var i,o=[],a=r.length;for(i=0;i{let n=!1;const r=e.map(i=>{const o=GN(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{scope:h,children:p,...m}=f,y=h?.[e]?.[u]||s,b=v.useMemo(()=>m,Object.values(m));return I.jsx(y.Provider,{value:b,children:p})};l.displayName=o+"Provider";function c(f,h){const p=h?.[e]?.[u]||s,m=v.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[l,c]}const i=()=>{const o=n.map(a=>v.createContext(a));return function(s){const u=s?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[r,tXe(i,...t)]}function tXe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:u,scopeName:l})=>{const f=u(o)[`__scope${l}`];return{...s,...f}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function YN(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}var nXe=globalThis?.document?v.useLayoutEffect:()=>{},rXe=zx[" useInsertionEffect ".trim().toString()]||nXe;function iXe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=oXe({defaultProp:t,onChange:n}),s=e!==void 0,u=s?e:i;{const c=v.useRef(e!==void 0);v.useEffect(()=>{const f=c.current;f!==s&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${s?"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.`),c.current=s},[s,r])}const l=v.useCallback(c=>{if(s){const f=aXe(c)?c(e):c;f!==e&&a.current?.(f)}else o(c)},[s,e,o,a]);return[u,l]}function oXe({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),i=v.useRef(n),o=v.useRef(t);return rXe(()=>{o.current=t},[t]),v.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function aXe(e){return typeof e=="function"}function sXe(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var uXe=globalThis?.document?v.useLayoutEffect:()=>{};function lXe(e){const[t,n]=v.useState(void 0);return uXe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const u=o.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,s=l.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function ZN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cXe(...e){return t=>{let n=!1;const r=e.map(i=>{const o=ZN(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{};function dXe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var nX=e=>{const{present:t,children:n}=e,r=hXe(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=fXe(r.ref,pXe(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};nX.displayName="Presence";function hXe(e){const[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,u]=dXe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const l=Xy(r.current);o.current=s==="mounted"?l:"none"},[s]),XN(()=>{const l=r.current,c=i.current;if(c!==e){const h=o.current,p=Xy(l);e?u("MOUNT"):p==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),XN(()=>{if(t){let l;const c=t.ownerDocument.defaultView??window,f=p=>{const y=Xy(r.current).includes(p.animationName);if(p.target===t&&y&&(u("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=p=>{p.target===t&&(o.current=Xy(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Xy(e){return e?.animationName||"none"}function pXe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function gXe(e){const t=mXe(e),n=v.forwardRef((r,i)=>{const{children:o,...a}=r,s=v.Children.toArray(o),u=s.find(yXe);if(u){const l=u.props.children,c=s.map(f=>f===u?v.Children.count(l)>1?v.Children.only(null):v.isValidElement(l)?l.props.children:null:f);return I.jsx(t,{...a,ref:i,children:v.isValidElement(l)?v.cloneElement(l,void 0,c):null})}return I.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function mXe(e){const t=v.forwardRef((n,r)=>{const{children:i,...o}=n;if(v.isValidElement(i)){const a=xXe(i),s=bXe(o,i.props);return i.type!==v.Fragment&&(s.ref=r?eX(r,a):a),v.cloneElement(i,s)}return v.Children.count(i)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vXe=Symbol("radix.slottable");function yXe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vXe}function bXe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const u=o(...s);return i(...s),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function xXe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wXe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],e8=wXe.reduce((e,t)=>{const n=gXe(`Primitive.${t}`),r=v.forwardRef((i,o)=>{const{asChild:a,...s}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),I.jsx(u,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),W2="Checkbox",[_Xe,Vtt]=eXe(W2),[SXe,t8]=_Xe(W2);function CXe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:a,name:s,onCheckedChange:u,required:l,value:c="on",internal_do_not_use_render:f}=e,[h,p]=iXe({prop:n,defaultProp:i??!1,onChange:u,caller:W2}),[m,y]=v.useState(null),[b,w]=v.useState(null),x=v.useRef(!1),S=m?!!a||!!m.closest("form"):!0,O={checked:h,disabled:o,setChecked:p,control:m,setControl:y,name:s,form:a,value:c,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:Cl(i)?!1:i,isFormControl:S,bubbleInput:b,setBubbleInput:w};return I.jsx(SXe,{scope:t,...O,children:AXe(f)?f(O):r})}var rX="CheckboxTrigger",iX=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:o,value:a,disabled:s,checked:u,required:l,setControl:c,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:m}=t8(rX,e),y=tX(i,c),b=v.useRef(u);return v.useEffect(()=>{const w=o?.form;if(w){const x=()=>f(b.current);return w.addEventListener("reset",x),()=>w.removeEventListener("reset",x)}},[o,f]),I.jsx(e8.button,{type:"button",role:"checkbox","aria-checked":Cl(u)?"mixed":u,"aria-required":l,"data-state":uX(u),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:y,onKeyDown:YN(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:YN(n,w=>{f(x=>Cl(x)?!0:!x),m&&p&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})})});iX.displayName=rX;var EXe=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:u,onCheckedChange:l,form:c,...f}=e;return I.jsx(CXe,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:s,required:a,onCheckedChange:l,name:r,form:c,value:u,internal_do_not_use_render:({isFormControl:h})=>I.jsxs(I.Fragment,{children:[I.jsx(iX,{...f,ref:t,__scopeCheckbox:n}),h&&I.jsx(sX,{__scopeCheckbox:n})]})})});EXe.displayName=W2;var oX="CheckboxIndicator",OXe=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=t8(oX,n);return I.jsx(nX,{present:r||Cl(o.checked)||o.checked===!0,children:I.jsx(e8.span,{"data-state":uX(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});OXe.displayName=oX;var aX="CheckboxBubbleInput",sX=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:a,required:s,disabled:u,name:l,value:c,form:f,bubbleInput:h,setBubbleInput:p}=t8(aX,e),m=tX(n,p),y=sXe(o),b=lXe(r);v.useEffect(()=>{const x=h;if(!x)return;const S=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(S,"checked").set,C=!i.current;if(y!==o&&E){const P=new Event("click",{bubbles:C});x.indeterminate=Cl(o),E.call(x,Cl(o)?!1:o),x.dispatchEvent(P)}},[h,y,o,i]);const w=v.useRef(Cl(o)?!1:o);return I.jsx(e8.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:s,disabled:u,name:l,value:c,form:f,...t,tabIndex:-1,ref:m,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});sX.displayName=aX;function AXe(e){return typeof e=="function"}function Cl(e){return e==="indeterminate"}function uX(e){return Cl(e)?"indeterminate":e?"checked":"unchecked"}export{Sve as $,UQe as A,Gi as B,bQe as C,tme as D,SQe as E,yQe as F,pT as G,F as H,eQe as I,DQe as J,MXe as K,PQe as L,FQe as M,QXe as N,kXe as O,$Xe as P,MQe as Q,vQe as R,Pl as S,kQe as T,XXe as U,IXe as V,yve as W,wve as X,_ve as Y,Cz as Z,QQe as _,LXe as a,Het as a$,Cve as a0,bve as a1,xve as a2,OJe as a3,YQe as a4,AJe as a5,vJe as a6,yJe as a7,wJe as a8,_Je as a9,YXe as aA,oQe as aB,KXe as aC,JXe as aD,uQe as aE,sQe as aF,tQe as aG,aQe as aH,WXe as aI,UXe as aJ,ZXe as aK,gQe as aL,pQe as aM,dQe as aN,mQe as aO,rQe as aP,HXe as aQ,Iet as aR,iJe as aS,wet as aT,iQe as aU,cQe as aV,Let as aW,Fet as aX,jet as aY,NXe as aZ,Wet as a_,CJe as aa,HQe as ab,SJe as ac,eJe as ad,xJe as ae,EJe as af,gJe as ag,mJe as ah,bJe as ai,fJe as aj,cJe as ak,dJe as al,qXe as am,kJe as an,obe as ao,abe as ap,MJe as aq,IJe as ar,RJe as as,DJe as at,RXe as au,VXe as av,GXe as aw,lQe as ax,jXe as ay,get as az,Use as b,aet as b$,Vet as b0,qet as b1,KQe as b2,ttt as b3,ZQe as b4,ntt as b5,Ket as b6,Get as b7,Yet as b8,Xet as b9,zJe as bA,Ret as bB,Tet as bC,net as bD,Pet as bE,htt as bF,ptt as bG,gtt as bH,dHe as bI,yHe as bJ,pet as bK,NJe as bL,BJe as bM,FJe as bN,itt as bO,Ui as bP,vtt as bQ,ytt as bR,tJe as bS,nJe as bT,Ott as bU,oet as bV,Att as bW,det as bX,Oet as bY,xet as bZ,tet as b_,Qet as ba,ett as bb,Jet as bc,rtt as bd,Zet as be,att as bf,GQe as bg,ctt as bh,ftt as bi,utt as bj,ltt as bk,I3 as bl,Sf as bm,WJe as bn,Bet as bo,Uet as bp,s5 as bq,u5 as br,mje as bs,Js as bt,wf as bu,rp as bv,ott as bw,LJe as bx,UJe as by,het as bz,dn as c,XQe as c$,Aet as c0,fet as c1,ket as c2,QJe as c3,btt as c4,xtt as c5,Ctt as c6,YJe as c7,GJe as c8,zXe as c9,vet as cA,Cet as cB,yet as cC,cet as cD,qJe as cE,KJe as cF,Det as cG,Ja as cH,br as cI,uet as cJ,wtt as cK,_tt as cL,sJe as cM,ef as cN,$Je as cO,ztt as cP,Wtt as cQ,_et as cR,JJe as cS,ret as cT,met as cU,eet as cV,Eet as cW,set as cX,Met as cY,EXe as cZ,OXe as c_,hQe as ca,nQe as cb,BXe as cc,fQe as cd,ktt as ce,Ttt as cf,bet as cg,Mtt as ch,ZJe as ci,jJe as cj,Ntt as ck,Ltt as cl,Btt as cm,Utt as cn,Ftt as co,jtt as cp,Dtt as cq,$tt as cr,Itt as cs,rJe as ct,aJe as cu,Stt as cv,Ett as cw,Nce as cx,zce as cy,Mce as cz,wm as d,lJe as d0,qQe as d1,JQe as d2,uJe as d3,iet as d4,DXe as d5,HJe as d6,iHe as d7,oJe as d8,XJe as d9,VJe as da,EQe as e,eA as f,TQe as g,AQe as h,NQe as i,I as j,Gr as k,LQe as l,CQe as m,xQe as n,wQe as o,$Qe as p,IQe as q,v as r,jQe as s,FXe as t,Sj as u,BQe as v,TXe as w,zQe as x,WQe as y,_Qe as z};