ldrouter 1.17.8 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -66
- package/dist/server/app.js +0 -2
- package/dist/server/db/migrate.js +1 -2
- package/dist/server/db/schema.js +1 -2
- package/dist/server/gateway/runner.js +14 -5
- package/dist/server/routes/admin/combos.js +128 -11
- package/dist/server/routes/admin/dashboard.js +24 -0
- package/dist/server/routes/admin/models.js +7 -2
- package/dist/server/routes/admin/providers.js +25 -64
- package/dist/server/routes/admin/requests.js +32 -0
- package/dist/server/routes/admin.js +0 -8
- package/dist/server/routing/circuit.js +13 -0
- package/dist/server/routing/combo.js +8 -31
- package/dist/server/upstream/client.js +3 -26
- package/dist/web/assets/index-CyboDiyN.js +349 -0
- package/dist/web/assets/index-n9bGQMSj.css +1 -0
- package/dist/web/index.html +2 -2
- package/migrations/0010_ordered_combos.sql +55 -0
- package/package.json +1 -1
- package/dist/web/assets/index-CbKRlw3a.css +0 -1
- package/dist/web/assets/index-D-rviQ3G.js +0 -391
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
var Zy=n=>{throw TypeError(n)};var Jy=(n,a,s)=>a.has(n)||Zy("Cannot "+s);var gn=(n,a,s)=>(Jy(n,a,"read from private field"),s?s.call(n):a.get(n)),Wy=(n,a,s)=>a.has(n)?Zy("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,s),mh=(n,a,s,o)=>(Jy(n,a,"write to private field"),o?o.call(n,s):a.set(n,s),s);function w2(n,a){for(var s=0;s<a.length;s++){const o=a[s];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in n)){const u=Object.getOwnPropertyDescriptor(o,c);u&&Object.defineProperty(n,c,u.get?u:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(c){if(c.ep)return;c.ep=!0;const u=s(c);fetch(c.href,u)}})();function Rm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ph={exports:{}},Zo={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var eb;function j2(){if(eb)return Zo;eb=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function s(o,c,u){var f=null;if(u!==void 0&&(f=""+u),c.key!==void 0&&(f=""+c.key),"key"in c){u={};for(var p in c)p!=="key"&&(u[p]=c[p])}else u=c;return c=u.ref,{$$typeof:n,type:o,key:f,ref:c!==void 0?c:null,props:u}}return Zo.Fragment=a,Zo.jsx=s,Zo.jsxs=s,Zo}var tb;function S2(){return tb||(tb=1,ph.exports=j2()),ph.exports}var l=S2(),gh={exports:{}},ke={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var nb;function C2(){if(nb)return ke;nb=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function w(z){return z===null||typeof z!="object"?null:(z=b&&z[b]||z["@@iterator"],typeof z=="function"?z:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function R(z,L,F){this.props=z,this.context=L,this.refs=C,this.updater=F||N}R.prototype.isReactComponent={},R.prototype.setState=function(z,L){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,L,"setState")},R.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function D(){}D.prototype=R.prototype;function A(z,L,F){this.props=z,this.context=L,this.refs=C,this.updater=F||N}var M=A.prototype=new D;M.constructor=A,S(M,R.prototype),M.isPureReactComponent=!0;var O=Array.isArray;function E(){}var _={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function P(z,L,F){var ae=F.ref;return{$$typeof:n,type:z,key:L,ref:ae!==void 0?ae:null,props:F}}function $(z,L){return P(z.type,L,z.props)}function J(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function Y(z){var L={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(F){return L[F]})}var ce=/\/+/g;function ue(z,L){return typeof z=="object"&&z!==null&&z.key!=null?Y(""+z.key):L.toString(36)}function B(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(E,E):(z.status="pending",z.then(function(L){z.status==="pending"&&(z.status="fulfilled",z.value=L)},function(L){z.status==="pending"&&(z.status="rejected",z.reason=L)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function k(z,L,F,ae,ge){var ye=typeof z;(ye==="undefined"||ye==="boolean")&&(z=null);var G=!1;if(z===null)G=!0;else switch(ye){case"bigint":case"string":case"number":G=!0;break;case"object":switch(z.$$typeof){case n:case a:G=!0;break;case x:return G=z._init,k(G(z._payload),L,F,ae,ge)}}if(G)return ge=ge(z),G=ae===""?"."+ue(z,0):ae,O(ge)?(F="",G!=null&&(F=G.replace(ce,"$&/")+"/"),k(ge,L,F,"",function(xe){return xe})):ge!=null&&(J(ge)&&(ge=$(ge,F+(ge.key==null||z&&z.key===ge.key?"":(""+ge.key).replace(ce,"$&/")+"/")+G)),L.push(ge)),1;G=0;var ie=ae===""?".":ae+":";if(O(z))for(var he=0;he<z.length;he++)ae=z[he],ye=ie+ue(ae,he),G+=k(ae,L,F,ye,ge);else if(he=w(z),typeof he=="function")for(z=he.call(z),he=0;!(ae=z.next()).done;)ae=ae.value,ye=ie+ue(ae,he++),G+=k(ae,L,F,ye,ge);else if(ye==="object"){if(typeof z.then=="function")return k(B(z),L,F,ae,ge);throw L=String(z),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return G}function q(z,L,F){if(z==null)return z;var ae=[],ge=0;return k(z,ae,"","",function(ye){return L.call(F,ye,ge++)}),ae}function Z(z){if(z._status===-1){var L=z._result;L=L(),L.then(function(F){(z._status===0||z._status===-1)&&(z._status=1,z._result=F)},function(F){(z._status===0||z._status===-1)&&(z._status=2,z._result=F)}),z._status===-1&&(z._status=0,z._result=L)}if(z._status===1)return z._result.default;throw z._result}var ee=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},te={map:q,forEach:function(z,L,F){q(z,function(){L.apply(this,arguments)},F)},count:function(z){var L=0;return q(z,function(){L++}),L},toArray:function(z){return q(z,function(L){return L})||[]},only:function(z){if(!J(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return ke.Activity=y,ke.Children=te,ke.Component=R,ke.Fragment=s,ke.Profiler=c,ke.PureComponent=A,ke.StrictMode=o,ke.Suspense=g,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,ke.__COMPILER_RUNTIME={__proto__:null,c:function(z){return _.H.useMemoCache(z)}},ke.cache=function(z){return function(){return z.apply(null,arguments)}},ke.cacheSignal=function(){return null},ke.cloneElement=function(z,L,F){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var ae=S({},z.props),ge=z.key;if(L!=null)for(ye in L.key!==void 0&&(ge=""+L.key),L)!U.call(L,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&L.ref===void 0||(ae[ye]=L[ye]);var ye=arguments.length-2;if(ye===1)ae.children=F;else if(1<ye){for(var G=Array(ye),ie=0;ie<ye;ie++)G[ie]=arguments[ie+2];ae.children=G}return P(z.type,ge,ae)},ke.createContext=function(z){return z={$$typeof:f,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:u,_context:z},z},ke.createElement=function(z,L,F){var ae,ge={},ye=null;if(L!=null)for(ae in L.key!==void 0&&(ye=""+L.key),L)U.call(L,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ge[ae]=L[ae]);var G=arguments.length-2;if(G===1)ge.children=F;else if(1<G){for(var ie=Array(G),he=0;he<G;he++)ie[he]=arguments[he+2];ge.children=ie}if(z&&z.defaultProps)for(ae in G=z.defaultProps,G)ge[ae]===void 0&&(ge[ae]=G[ae]);return P(z,ye,ge)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(z){return{$$typeof:p,render:z}},ke.isValidElement=J,ke.lazy=function(z){return{$$typeof:x,_payload:{_status:-1,_result:z},_init:Z}},ke.memo=function(z,L){return{$$typeof:v,type:z,compare:L===void 0?null:L}},ke.startTransition=function(z){var L=_.T,F={};_.T=F;try{var ae=z(),ge=_.S;ge!==null&&ge(F,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(E,ee)}catch(ye){ee(ye)}finally{L!==null&&F.types!==null&&(L.types=F.types),_.T=L}},ke.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},ke.use=function(z){return _.H.use(z)},ke.useActionState=function(z,L,F){return _.H.useActionState(z,L,F)},ke.useCallback=function(z,L){return _.H.useCallback(z,L)},ke.useContext=function(z){return _.H.useContext(z)},ke.useDebugValue=function(){},ke.useDeferredValue=function(z,L){return _.H.useDeferredValue(z,L)},ke.useEffect=function(z,L){return _.H.useEffect(z,L)},ke.useEffectEvent=function(z){return _.H.useEffectEvent(z)},ke.useId=function(){return _.H.useId()},ke.useImperativeHandle=function(z,L,F){return _.H.useImperativeHandle(z,L,F)},ke.useInsertionEffect=function(z,L){return _.H.useInsertionEffect(z,L)},ke.useLayoutEffect=function(z,L){return _.H.useLayoutEffect(z,L)},ke.useMemo=function(z,L){return _.H.useMemo(z,L)},ke.useOptimistic=function(z,L){return _.H.useOptimistic(z,L)},ke.useReducer=function(z,L,F){return _.H.useReducer(z,L,F)},ke.useRef=function(z){return _.H.useRef(z)},ke.useState=function(z){return _.H.useState(z)},ke.useSyncExternalStore=function(z,L,F){return _.H.useSyncExternalStore(z,L,F)},ke.useTransition=function(){return _.H.useTransition()},ke.version="19.2.8",ke}var ab;function Tm(){return ab||(ab=1,gh.exports=C2()),gh.exports}var h=Tm();const me=Rm(h),Yl=w2({__proto__:null,default:me},[h]);var vh={exports:{}},Jo={},xh={exports:{}},yh={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var rb;function N2(){return rb||(rb=1,(function(n){function a(k,q){var Z=k.length;k.push(q);e:for(;0<Z;){var ee=Z-1>>>1,te=k[ee];if(0<c(te,q))k[ee]=q,k[Z]=te,Z=ee;else break e}}function s(k){return k.length===0?null:k[0]}function o(k){if(k.length===0)return null;var q=k[0],Z=k.pop();if(Z!==q){k[0]=Z;e:for(var ee=0,te=k.length,z=te>>>1;ee<z;){var L=2*(ee+1)-1,F=k[L],ae=L+1,ge=k[ae];if(0>c(F,Z))ae<te&&0>c(ge,F)?(k[ee]=ge,k[ae]=Z,ee=ae):(k[ee]=F,k[L]=Z,ee=L);else if(ae<te&&0>c(ge,Z))k[ee]=ge,k[ae]=Z,ee=ae;else break e}}return q}function c(k,q){var Z=k.sortIndex-q.sortIndex;return Z!==0?Z:k.id-q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var g=[],v=[],x=1,y=null,b=3,w=!1,N=!1,S=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function M(k){for(var q=s(v);q!==null;){if(q.callback===null)o(v);else if(q.startTime<=k)o(v),q.sortIndex=q.expirationTime,a(g,q);else break;q=s(v)}}function O(k){if(S=!1,M(k),!N)if(s(g)!==null)N=!0,E||(E=!0,Y());else{var q=s(v);q!==null&&B(O,q.startTime-k)}}var E=!1,_=-1,U=5,P=-1;function $(){return C?!0:!(n.unstable_now()-P<U)}function J(){if(C=!1,E){var k=n.unstable_now();P=k;var q=!0;try{e:{N=!1,S&&(S=!1,D(_),_=-1),w=!0;var Z=b;try{t:{for(M(k),y=s(g);y!==null&&!(y.expirationTime>k&&$());){var ee=y.callback;if(typeof ee=="function"){y.callback=null,b=y.priorityLevel;var te=ee(y.expirationTime<=k);if(k=n.unstable_now(),typeof te=="function"){y.callback=te,M(k),q=!0;break t}y===s(g)&&o(g),M(k)}else o(g);y=s(g)}if(y!==null)q=!0;else{var z=s(v);z!==null&&B(O,z.startTime-k),q=!1}}break e}finally{y=null,b=Z,w=!1}q=void 0}}finally{q?Y():E=!1}}}var Y;if(typeof A=="function")Y=function(){A(J)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,ue=ce.port2;ce.port1.onmessage=J,Y=function(){ue.postMessage(null)}}else Y=function(){R(J,0)};function B(k,q){_=R(function(){k(n.unstable_now())},q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(k){k.callback=null},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(k){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var Z=b;b=q;try{return k()}finally{b=Z}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(k,q){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var Z=b;b=k;try{return q()}finally{b=Z}},n.unstable_scheduleCallback=function(k,q,Z){var ee=n.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?ee+Z:ee):Z=ee,k){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=Z+te,k={id:x++,callback:q,priorityLevel:k,startTime:Z,expirationTime:te,sortIndex:-1},Z>ee?(k.sortIndex=Z,a(v,k),s(g)===null&&k===s(v)&&(S?(D(_),_=-1):S=!0,B(O,Z-ee))):(k.sortIndex=te,a(g,k),N||w||(N=!0,E||(E=!0,Y()))),k},n.unstable_shouldYield=$,n.unstable_wrapCallback=function(k){var q=b;return function(){var Z=b;b=q;try{return k.apply(this,arguments)}finally{b=Z}}}})(yh)),yh}var sb;function E2(){return sb||(sb=1,xh.exports=N2()),xh.exports}var bh={exports:{}},vn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var lb;function R2(){if(lb)return vn;lb=1;var n=Tm();function a(g){var v="https://react.dev/errors/"+g;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)v+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+g+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var o={d:{f:s,r:function(){throw Error(a(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},c=Symbol.for("react.portal");function u(g,v,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:y==null?null:""+y,children:g,containerInfo:v,implementation:x}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return vn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,vn.createPortal=function(g,v){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(a(299));return u(g,v,null,x)},vn.flushSync=function(g){var v=f.T,x=o.p;try{if(f.T=null,o.p=2,g)return g()}finally{f.T=v,o.p=x,o.d.f()}},vn.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,o.d.C(g,v))},vn.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},vn.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin),b=typeof v.integrity=="string"?v.integrity:void 0,w=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;x==="style"?o.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:w}):x==="script"&&o.d.X(g,{crossOrigin:y,integrity:b,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},vn.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var x=p(v.as,v.crossOrigin);o.d.M(g,{crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&o.d.M(g)},vn.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin);o.d.L(g,x,{crossOrigin:y,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},vn.preloadModule=function(g,v){if(typeof g=="string")if(v){var x=p(v.as,v.crossOrigin);o.d.m(g,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else o.d.m(g)},vn.requestFormReset=function(g){o.d.r(g)},vn.unstable_batchedUpdates=function(g,v){return g(v)},vn.useFormState=function(g,v,x){return f.H.useFormState(g,v,x)},vn.useFormStatus=function(){return f.H.useHostTransitionStatus()},vn.version="19.2.8",vn}var ob;function g0(){if(ob)return bh.exports;ob=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),bh.exports=R2(),bh.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var ib;function T2(){if(ib)return Jo;ib=1;var n=E2(),a=Tm(),s=g0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(o(188))}function v(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(o(188));return t!==e?null:e}for(var r=e,i=t;;){var d=r.return;if(d===null)break;var m=d.alternate;if(m===null){if(i=d.return,i!==null){r=i;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===r)return g(d),e;if(m===i)return g(d),t;m=m.sibling}throw Error(o(188))}if(r.return!==i.return)r=d,i=m;else{for(var j=!1,T=d.child;T;){if(T===r){j=!0,r=d,i=m;break}if(T===i){j=!0,i=d,r=m;break}T=T.sibling}if(!j){for(T=m.child;T;){if(T===r){j=!0,r=m,i=d;break}if(T===i){j=!0,i=m,r=d;break}T=T.sibling}if(!j)throw Error(o(189))}}if(r.alternate!==i)throw Error(o(190))}if(r.tag!==3)throw Error(o(188));return r.stateNode.current===r?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),A=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var ce=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case R:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case E:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case A:return e.displayName||"Context";case D:return(e._context.displayName||"Context")+".Consumer";case M:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var B=Array.isArray,k=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},ee=[],te=-1;function z(e){return{current:e}}function L(e){0>te||(e.current=ee[te],ee[te]=null,te--)}function F(e,t){te++,ee[te]=e.current,e.current=t}var ae=z(null),ge=z(null),ye=z(null),G=z(null);function ie(e,t){switch(F(ye,t),F(ge,e),F(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?by(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=by(t),e=wy(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(ae),F(ae,e)}function he(){L(ae),L(ge),L(ye)}function xe(e){e.memoizedState!==null&&F(G,e);var t=ae.current,r=wy(t,e.type);t!==r&&(F(ge,e),F(ae,r))}function Ae(e){ge.current===e&&(L(ae),L(ge)),G.current===e&&(L(G),Fo._currentValue=Z)}var Ne,Oe;function Qe(e){if(Ne===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||"",Oe=-1<r.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ne+e+Oe}var et=!1;function oe(e,t){if(!e||et)return"";et=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(W){var Q=W}Reflect.construct(e,[],le)}else{try{le.call()}catch(W){Q=W}e.call(le.prototype)}}else{try{throw Error()}catch(W){Q=W}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(W){if(W&&Q&&typeof W.stack=="string")return[W.stack,Q.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=i.DetermineComponentFrameRoot(),j=m[0],T=m[1];if(j&&T){var I=j.split(`
|
|
44
|
-
`),K=T.split(`
|
|
45
|
-
`);for(d=i=0;i<I.length&&!I[i].includes("DetermineComponentFrameRoot");)i++;for(;d<K.length&&!K[d].includes("DetermineComponentFrameRoot");)d++;if(i===I.length||d===K.length)for(i=I.length-1,d=K.length-1;1<=i&&0<=d&&I[i]!==K[d];)d--;for(;1<=i&&0<=d;i--,d--)if(I[i]!==K[d]){if(i!==1||d!==1)do if(i--,d--,0>d||I[i]!==K[d]){var ne=`
|
|
46
|
-
`+I[i].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=i&&0<=d);break}}}finally{et=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Qe(r):""}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return Qe(e.type);case 16:return Qe("Lazy");case 13:return e.child!==t&&t!==null?Qe("Suspense Fallback"):Qe("Suspense");case 19:return Qe("SuspenseList");case 0:case 15:return oe(e.type,!1);case 11:return oe(e.type.render,!1);case 1:return oe(e.type,!0);case 31:return Qe("Activity");default:return""}}function qe(e){try{var t="",r=null;do t+=Le(e,r),r=e,e=e.return;while(e);return t}catch(i){return`
|
|
47
|
-
Error generating stack: `+i.message+`
|
|
48
|
-
`+i.stack}}var _t=Object.prototype.hasOwnProperty,St=n.unstable_scheduleCallback,Wt=n.unstable_cancelCallback,mn=n.unstable_shouldYield,en=n.unstable_requestPaint,Ct=n.unstable_now,xn=n.unstable_getCurrentPriorityLevel,At=n.unstable_ImmediatePriority,Mt=n.unstable_UserBlockingPriority,pn=n.unstable_NormalPriority,pa=n.unstable_LowPriority,Aa=n.unstable_IdlePriority,Wn=n.log,ms=n.unstable_setDisableYieldValue,ga=null,Dt=null;function yn(e){if(typeof Wn=="function"&&ms(e),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(ga,e)}catch{}}var Tt=Math.clz32?Math.clz32:Xs,lo=Math.log,Fs=Math.LN2;function Xs(e){return e>>>=0,e===0?32:31-(lo(e)/Fs|0)|0}var Ya=256,Ar=262144,xt=4194304;function at(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function It(e,t,r){var i=e.pendingLanes;if(i===0)return 0;var d=0,m=e.suspendedLanes,j=e.pingedLanes;e=e.warmLanes;var T=i&134217727;return T!==0?(i=T&~m,i!==0?d=at(i):(j&=T,j!==0?d=at(j):r||(r=T&~e,r!==0&&(d=at(r))))):(T=i&~m,T!==0?d=at(T):j!==0?d=at(j):r||(r=i&~e,r!==0&&(d=at(r)))),d===0?0:t!==0&&t!==d&&(t&m)===0&&(m=d&-d,r=t&-t,m>=r||m===32&&(r&4194048)!==0)?t:d}function Re(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _e(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(){var e=xt;return xt<<=1,(xt&62914560)===0&&(xt=4194304),e}function vt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(e,t,r,i,d,m){var j=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var T=e.entanglements,I=e.expirationTimes,K=e.hiddenUpdates;for(r=j&~r;0<r;){var ne=31-Tt(r),le=1<<ne;T[ne]=0,I[ne]=-1;var Q=K[ne];if(Q!==null)for(K[ne]=null,ne=0;ne<Q.length;ne++){var W=Q[ne];W!==null&&(W.lane&=-536870913)}r&=~le}i!==0&&Yt(e,i,0),m!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=m&~(j&~t))}function Yt(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Tt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|r&261930}function yt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Tt(r),d=1<<i;d&t|e[i]&t&&(e[i]|=t),r&=~d}}function zt(e,t){var r=t&-t;return r=(r&42)!==0?1:Ga(r),(r&(e.suspendedLanes|t))!==0?0:r}function Ga(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Fa(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function va(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:Vy(e.type))}function Mr(e,t){var r=q.p;try{return q.p=e,t()}finally{q.p=r}}var ea=Math.random().toString(36).slice(2),on="__reactFiber$"+ea,Cn="__reactProps$"+ea,Ks="__reactContainer$"+ea,rd="__reactEvents$"+ea,uS="__reactListeners$"+ea,dS="__reactHandles$"+ea,og="__reactResources$"+ea,oo="__reactMarker$"+ea;function sd(e){delete e[on],delete e[Cn],delete e[rd],delete e[uS],delete e[dS]}function Qs(e){var t=e[on];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ks]||r[on]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ty(e);e!==null;){if(r=e[on])return r;e=Ty(e)}return t}e=r,r=e.parentNode}return null}function Zs(e){if(e=e[on]||e[Ks]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function io(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Js(e){var t=e[og];return t||(t=e[og]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function tn(e){e[oo]=!0}var ig=new Set,cg={};function ps(e,t){Ws(e,t),Ws(e+"Capture",t)}function Ws(e,t){for(cg[e]=t,e=0;e<t.length;e++)ig.add(t[e])}var fS=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ug={},dg={};function hS(e){return _t.call(dg,e)?!0:_t.call(ug,e)?!1:fS.test(e)?dg[e]=!0:(ug[e]=!0,!1)}function Di(e,t,r){if(hS(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function Oi(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function Xa(e,t,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+i)}}function ta(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mS(e,t,r){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,m=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(j){r=""+j,m.call(this,j)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(j){r=""+j},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ld(e){if(!e._valueTracker){var t=fg(e)?"checked":"value";e._valueTracker=mS(e,t,""+e[t])}}function hg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=fg(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function ki(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var pS=/[\n"\\]/g;function na(e){return e.replace(pS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function od(e,t,r,i,d,m,j,T){e.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.type=j:e.removeAttribute("type"),t!=null?j==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ta(t)):e.value!==""+ta(t)&&(e.value=""+ta(t)):j!=="submit"&&j!=="reset"||e.removeAttribute("value"),t!=null?id(e,j,ta(t)):r!=null?id(e,j,ta(r)):i!=null&&e.removeAttribute("value"),d==null&&m!=null&&(e.defaultChecked=!!m),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+ta(T):e.removeAttribute("name")}function mg(e,t,r,i,d,m,j,T){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),t!=null||r!=null){if(!(m!=="submit"&&m!=="reset"||t!=null)){ld(e);return}r=r!=null?""+ta(r):"",t=t!=null?""+ta(t):r,T||t===e.value||(e.value=t),e.defaultValue=t}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=T?e.checked:!!i,e.defaultChecked=!!i,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(e.name=j),ld(e)}function id(e,t,r){t==="number"&&ki(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function el(e,t,r,i){if(e=e.options,t){t={};for(var d=0;d<r.length;d++)t["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=t.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&i&&(e[r].defaultSelected=!0)}else{for(r=""+ta(r),t=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function pg(e,t,r){if(t!=null&&(t=""+ta(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+ta(r):""}function gg(e,t,r,i){if(t==null){if(i!=null){if(r!=null)throw Error(o(92));if(B(i)){if(1<i.length)throw Error(o(93));i=i[0]}r=i}r==null&&(r=""),t=r}r=ta(t),e.defaultValue=r,i=e.textContent,i===r&&i!==""&&i!==null&&(e.value=i),ld(e)}function tl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var gS=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function vg(e,t,r){var i=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,r):typeof r!="number"||r===0||gS.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function xg(e,t,r){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,r!=null){for(var i in r)!r.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var d in t)i=t[d],t.hasOwnProperty(d)&&r[d]!==i&&vg(e,d,i)}else for(var m in t)t.hasOwnProperty(m)&&vg(e,m,t[m])}function cd(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vS=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),xS=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function _i(e){return xS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ka(){}var ud=null;function dd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nl=null,al=null;function yg(e){var t=Zs(e);if(t&&(e=t.stateNode)){var r=e[Cn]||null;e:switch(e=t.stateNode,t.type){case"input":if(od(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+na(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var d=i[Cn]||null;if(!d)throw Error(o(90));od(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<r.length;t++)i=r[t],i.form===e.form&&hg(i)}break e;case"textarea":pg(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&el(e,!!r.multiple,t,!1)}}}var fd=!1;function bg(e,t,r){if(fd)return e(t,r);fd=!0;try{var i=e(t);return i}finally{if(fd=!1,(nl!==null||al!==null)&&(wc(),nl&&(t=nl,e=al,al=nl=null,yg(t),e)))for(t=0;t<e.length;t++)yg(e[t])}}function co(e,t){var r=e.stateNode;if(r===null)return null;var i=r[Cn]||null;if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(o(231,t,typeof r));return r}var Qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hd=!1;if(Qa)try{var uo={};Object.defineProperty(uo,"passive",{get:function(){hd=!0}}),window.addEventListener("test",uo,uo),window.removeEventListener("test",uo,uo)}catch{hd=!1}var Dr=null,md=null,zi=null;function wg(){if(zi)return zi;var e,t=md,r=t.length,i,d="value"in Dr?Dr.value:Dr.textContent,m=d.length;for(e=0;e<r&&t[e]===d[e];e++);var j=r-e;for(i=1;i<=j&&t[r-i]===d[m-i];i++);return zi=d.slice(e,1<i?1-i:void 0)}function Li(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ui(){return!0}function jg(){return!1}function Nn(e){function t(r,i,d,m,j){this._reactName=r,this._targetInst=d,this.type=i,this.nativeEvent=m,this.target=j,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(r=e[T],this[T]=r?r(m):m[T]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Ui:jg,this.isPropagationStopped=jg,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ui)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ui)},persist:function(){},isPersistent:Ui}),t}var gs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ii=Nn(gs),fo=y({},gs,{view:0,detail:0}),yS=Nn(fo),pd,gd,ho,Pi=y({},fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ho&&(ho&&e.type==="mousemove"?(pd=e.screenX-ho.screenX,gd=e.screenY-ho.screenY):gd=pd=0,ho=e),pd)},movementY:function(e){return"movementY"in e?e.movementY:gd}}),Sg=Nn(Pi),bS=y({},Pi,{dataTransfer:0}),wS=Nn(bS),jS=y({},fo,{relatedTarget:0}),vd=Nn(jS),SS=y({},gs,{animationName:0,elapsedTime:0,pseudoElement:0}),CS=Nn(SS),NS=y({},gs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ES=Nn(NS),RS=y({},gs,{data:0}),Cg=Nn(RS),TS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},MS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=MS[e])?!!t[e]:!1}function xd(){return DS}var OS=y({},fo,{key:function(e){if(e.key){var t=TS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Li(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?AS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xd,charCode:function(e){return e.type==="keypress"?Li(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Li(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kS=Nn(OS),_S=y({},Pi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ng=Nn(_S),zS=y({},fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xd}),LS=Nn(zS),US=y({},gs,{propertyName:0,elapsedTime:0,pseudoElement:0}),IS=Nn(US),PS=y({},Pi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),BS=Nn(PS),HS=y({},gs,{newState:0,oldState:0}),qS=Nn(HS),$S=[9,13,27,32],yd=Qa&&"CompositionEvent"in window,mo=null;Qa&&"documentMode"in document&&(mo=document.documentMode);var VS=Qa&&"TextEvent"in window&&!mo,Eg=Qa&&(!yd||mo&&8<mo&&11>=mo),Rg=" ",Tg=!1;function Ag(e,t){switch(e){case"keyup":return $S.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rl=!1;function YS(e,t){switch(e){case"compositionend":return Mg(t);case"keypress":return t.which!==32?null:(Tg=!0,Rg);case"textInput":return e=t.data,e===Rg&&Tg?null:e;default:return null}}function GS(e,t){if(rl)return e==="compositionend"||!yd&&Ag(e,t)?(e=wg(),zi=md=Dr=null,rl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Eg&&t.locale!=="ko"?null:t.data;default:return null}}var FS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Dg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!FS[e.type]:t==="textarea"}function Og(e,t,r,i){nl?al?al.push(i):al=[i]:nl=i,t=Tc(t,"onChange"),0<t.length&&(r=new Ii("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var po=null,go=null;function XS(e){my(e,0)}function Bi(e){var t=io(e);if(hg(t))return e}function kg(e,t){if(e==="change")return t}var _g=!1;if(Qa){var bd;if(Qa){var wd="oninput"in document;if(!wd){var zg=document.createElement("div");zg.setAttribute("oninput","return;"),wd=typeof zg.oninput=="function"}bd=wd}else bd=!1;_g=bd&&(!document.documentMode||9<document.documentMode)}function Lg(){po&&(po.detachEvent("onpropertychange",Ug),go=po=null)}function Ug(e){if(e.propertyName==="value"&&Bi(go)){var t=[];Og(t,go,e,dd(e)),bg(XS,t)}}function KS(e,t,r){e==="focusin"?(Lg(),po=t,go=r,po.attachEvent("onpropertychange",Ug)):e==="focusout"&&Lg()}function QS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bi(go)}function ZS(e,t){if(e==="click")return Bi(t)}function JS(e,t){if(e==="input"||e==="change")return Bi(t)}function WS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $n=typeof Object.is=="function"?Object.is:WS;function vo(e,t){if($n(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var d=r[i];if(!_t.call(t,d)||!$n(e[d],t[d]))return!1}return!0}function Ig(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pg(e,t){var r=Ig(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ig(r)}}function Bg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ki(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ki(e.document)}return t}function jd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var eC=Qa&&"documentMode"in document&&11>=document.documentMode,sl=null,Sd=null,xo=null,Cd=!1;function qg(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Cd||sl==null||sl!==ki(i)||(i=sl,"selectionStart"in i&&jd(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),xo&&vo(xo,i)||(xo=i,i=Tc(Sd,"onSelect"),0<i.length&&(t=new Ii("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=sl)))}function vs(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ll={animationend:vs("Animation","AnimationEnd"),animationiteration:vs("Animation","AnimationIteration"),animationstart:vs("Animation","AnimationStart"),transitionrun:vs("Transition","TransitionRun"),transitionstart:vs("Transition","TransitionStart"),transitioncancel:vs("Transition","TransitionCancel"),transitionend:vs("Transition","TransitionEnd")},Nd={},$g={};Qa&&($g=document.createElement("div").style,"AnimationEvent"in window||(delete ll.animationend.animation,delete ll.animationiteration.animation,delete ll.animationstart.animation),"TransitionEvent"in window||delete ll.transitionend.transition);function xs(e){if(Nd[e])return Nd[e];if(!ll[e])return e;var t=ll[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in $g)return Nd[e]=t[r];return e}var Vg=xs("animationend"),Yg=xs("animationiteration"),Gg=xs("animationstart"),tC=xs("transitionrun"),nC=xs("transitionstart"),aC=xs("transitioncancel"),Fg=xs("transitionend"),Xg=new Map,Ed="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ed.push("scrollEnd");function xa(e,t){Xg.set(e,t),ps(t,[e])}var Hi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},aa=[],ol=0,Rd=0;function qi(){for(var e=ol,t=Rd=ol=0;t<e;){var r=aa[t];aa[t++]=null;var i=aa[t];aa[t++]=null;var d=aa[t];aa[t++]=null;var m=aa[t];if(aa[t++]=null,i!==null&&d!==null){var j=i.pending;j===null?d.next=d:(d.next=j.next,j.next=d),i.pending=d}m!==0&&Kg(r,d,m)}}function $i(e,t,r,i){aa[ol++]=e,aa[ol++]=t,aa[ol++]=r,aa[ol++]=i,Rd|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Td(e,t,r,i){return $i(e,t,r,i),Vi(e)}function ys(e,t){return $i(e,null,null,t),Vi(e)}function Kg(e,t,r){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r);for(var d=!1,m=e.return;m!==null;)m.childLanes|=r,i=m.alternate,i!==null&&(i.childLanes|=r),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(d=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,d&&t!==null&&(d=31-Tt(r),e=m.hiddenUpdates,i=e[d],i===null?e[d]=[t]:i.push(t),t.lane=r|536870912),m):null}function Vi(e){if(50<Bo)throw Bo=0,If=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var il={};function rC(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vn(e,t,r,i){return new rC(e,t,r,i)}function Ad(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Za(e,t){var r=e.alternate;return r===null?(r=Vn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Qg(e,t){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Yi(e,t,r,i,d,m){var j=0;if(i=e,typeof e=="function")Ad(e)&&(j=1);else if(typeof e=="string")j=c2(e,r,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=Vn(31,r,t,d),e.elementType=P,e.lanes=m,e;case S:return bs(r.children,d,m,t);case C:j=8,d|=24;break;case R:return e=Vn(12,r,t,d|2),e.elementType=R,e.lanes=m,e;case O:return e=Vn(13,r,t,d),e.elementType=O,e.lanes=m,e;case E:return e=Vn(19,r,t,d),e.elementType=E,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:j=10;break e;case D:j=9;break e;case M:j=11;break e;case _:j=14;break e;case U:j=16,i=null;break e}j=29,r=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=Vn(j,r,t,d),t.elementType=e,t.type=i,t.lanes=m,t}function bs(e,t,r,i){return e=Vn(7,e,i,t),e.lanes=r,e}function Md(e,t,r){return e=Vn(6,e,null,t),e.lanes=r,e}function Zg(e){var t=Vn(18,null,null,0);return t.stateNode=e,t}function Dd(e,t,r){return t=Vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Jg=new WeakMap;function ra(e,t){if(typeof e=="object"&&e!==null){var r=Jg.get(e);return r!==void 0?r:(t={value:e,source:t,stack:qe(t)},Jg.set(e,t),t)}return{value:e,source:t,stack:qe(t)}}var cl=[],ul=0,Gi=null,yo=0,sa=[],la=0,Or=null,Ma=1,Da="";function Ja(e,t){cl[ul++]=yo,cl[ul++]=Gi,Gi=e,yo=t}function Wg(e,t,r){sa[la++]=Ma,sa[la++]=Da,sa[la++]=Or,Or=e;var i=Ma;e=Da;var d=32-Tt(i)-1;i&=~(1<<d),r+=1;var m=32-Tt(t)+d;if(30<m){var j=d-d%5;m=(i&(1<<j)-1).toString(32),i>>=j,d-=j,Ma=1<<32-Tt(t)+d|r<<d|i,Da=m+e}else Ma=1<<m|r<<d|i,Da=e}function Od(e){e.return!==null&&(Ja(e,1),Wg(e,1,0))}function kd(e){for(;e===Gi;)Gi=cl[--ul],cl[ul]=null,yo=cl[--ul],cl[ul]=null;for(;e===Or;)Or=sa[--la],sa[la]=null,Da=sa[--la],sa[la]=null,Ma=sa[--la],sa[la]=null}function ev(e,t){sa[la++]=Ma,sa[la++]=Da,sa[la++]=Or,Ma=t.id,Da=t.overflow,Or=e}var cn=null,bt=null,Xe=!1,kr=null,oa=!1,_d=Error(o(519));function _r(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bo(ra(t,e)),_d}function tv(e){var t=e.stateNode,r=e.type,i=e.memoizedProps;switch(t[on]=e,t[Cn]=i,r){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(r=0;r<qo.length;r++)Ve(qo[r],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),mg(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),gg(t,i.value,i.defaultValue,i.children)}r=i.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||i.suppressHydrationWarning===!0||xy(t.textContent,r)?(i.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),i.onScroll!=null&&Ve("scroll",t),i.onScrollEnd!=null&&Ve("scrollend",t),i.onClick!=null&&(t.onclick=Ka),t=!0):t=!1,t||_r(e,!0)}function nv(e){for(cn=e.return;cn;)switch(cn.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:cn=cn.return}}function dl(e){if(e!==cn)return!1;if(!Xe)return nv(e),Xe=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Wf(e.type,e.memoizedProps)),r=!r),r&&bt&&_r(e),nv(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));bt=Ry(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));bt=Ry(e)}else t===27?(t=bt,Xr(e.type)?(e=rh,rh=null,bt=e):bt=t):bt=cn?ca(e.stateNode.nextSibling):null;return!0}function ws(){bt=cn=null,Xe=!1}function zd(){var e=kr;return e!==null&&(An===null?An=e:An.push.apply(An,e),kr=null),e}function bo(e){kr===null?kr=[e]:kr.push(e)}var Ld=z(null),js=null,Wa=null;function zr(e,t,r){F(Ld,t._currentValue),t._currentValue=r}function er(e){e._currentValue=Ld.current,L(Ld)}function Ud(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Id(e,t,r,i){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var m=d.dependencies;if(m!==null){var j=d.child;m=m.firstContext;e:for(;m!==null;){var T=m;m=d;for(var I=0;I<t.length;I++)if(T.context===t[I]){m.lanes|=r,T=m.alternate,T!==null&&(T.lanes|=r),Ud(m.return,r,e),i||(j=null);break e}m=T.next}}else if(d.tag===18){if(j=d.return,j===null)throw Error(o(341));j.lanes|=r,m=j.alternate,m!==null&&(m.lanes|=r),Ud(j,r,e),j=null}else j=d.child;if(j!==null)j.return=d;else for(j=d;j!==null;){if(j===e){j=null;break}if(d=j.sibling,d!==null){d.return=j.return,j=d;break}j=j.return}d=j}}function fl(e,t,r,i){e=null;for(var d=t,m=!1;d!==null;){if(!m){if((d.flags&524288)!==0)m=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var j=d.alternate;if(j===null)throw Error(o(387));if(j=j.memoizedProps,j!==null){var T=d.type;$n(d.pendingProps.value,j.value)||(e!==null?e.push(T):e=[T])}}else if(d===G.current){if(j=d.alternate,j===null)throw Error(o(387));j.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Fo):e=[Fo])}d=d.return}e!==null&&Id(t,e,r,i),t.flags|=262144}function Fi(e){for(e=e.firstContext;e!==null;){if(!$n(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ss(e){js=e,Wa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function un(e){return av(js,e)}function Xi(e,t){return js===null&&Ss(e),av(e,t)}function av(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},Wa===null){if(e===null)throw Error(o(308));Wa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wa=Wa.next=t;return r}var sC=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},lC=n.unstable_scheduleCallback,oC=n.unstable_NormalPriority,Pt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pd(){return{controller:new sC,data:new Map,refCount:0}}function wo(e){e.refCount--,e.refCount===0&&lC(oC,function(){e.controller.abort()})}var jo=null,Bd=0,hl=0,ml=null;function iC(e,t){if(jo===null){var r=jo=[];Bd=0,hl=Vf(),ml={status:"pending",value:void 0,then:function(i){r.push(i)}}}return Bd++,t.then(rv,rv),t}function rv(){if(--Bd===0&&jo!==null){ml!==null&&(ml.status="fulfilled");var e=jo;jo=null,hl=0,ml=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function cC(e,t){var r=[],i={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var d=0;d<r.length;d++)(0,r[d])(t)},function(d){for(i.status="rejected",i.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),i}var sv=k.S;k.S=function(e,t){qx=Ct(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&iC(e,t),sv!==null&&sv(e,t)};var Cs=z(null);function Hd(){var e=Cs.current;return e!==null?e:pt.pooledCache}function Ki(e,t){t===null?F(Cs,Cs.current):F(Cs,t.pool)}function lv(){var e=Hd();return e===null?null:{parent:Pt._currentValue,pool:e}}var pl=Error(o(460)),qd=Error(o(474)),Qi=Error(o(542)),Zi={then:function(){}};function ov(e){return e=e.status,e==="fulfilled"||e==="rejected"}function iv(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(Ka,Ka),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uv(e),e;default:if(typeof t.status=="string")t.then(Ka,Ka);else{if(e=pt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=i}},function(i){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uv(e),e}throw Es=t,pl}}function Ns(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Es=r,pl):r}}var Es=null;function cv(){if(Es===null)throw Error(o(459));var e=Es;return Es=null,e}function uv(e){if(e===pl||e===Qi)throw Error(o(483))}var gl=null,So=0;function Ji(e){var t=So;return So+=1,gl===null&&(gl=[]),iv(gl,e,t)}function Co(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Wi(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function dv(e){function t(V,H){if(e){var X=V.deletions;X===null?(V.deletions=[H],V.flags|=16):X.push(H)}}function r(V,H){if(!e)return null;for(;H!==null;)t(V,H),H=H.sibling;return null}function i(V){for(var H=new Map;V!==null;)V.key!==null?H.set(V.key,V):H.set(V.index,V),V=V.sibling;return H}function d(V,H){return V=Za(V,H),V.index=0,V.sibling=null,V}function m(V,H,X){return V.index=X,e?(X=V.alternate,X!==null?(X=X.index,X<H?(V.flags|=67108866,H):X):(V.flags|=67108866,H)):(V.flags|=1048576,H)}function j(V){return e&&V.alternate===null&&(V.flags|=67108866),V}function T(V,H,X,re){return H===null||H.tag!==6?(H=Md(X,V.mode,re),H.return=V,H):(H=d(H,X),H.return=V,H)}function I(V,H,X,re){var Te=X.type;return Te===S?ne(V,H,X.props.children,re,X.key):H!==null&&(H.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===U&&Ns(Te)===H.type)?(H=d(H,X.props),Co(H,X),H.return=V,H):(H=Yi(X.type,X.key,X.props,null,V.mode,re),Co(H,X),H.return=V,H)}function K(V,H,X,re){return H===null||H.tag!==4||H.stateNode.containerInfo!==X.containerInfo||H.stateNode.implementation!==X.implementation?(H=Dd(X,V.mode,re),H.return=V,H):(H=d(H,X.children||[]),H.return=V,H)}function ne(V,H,X,re,Te){return H===null||H.tag!==7?(H=bs(X,V.mode,re,Te),H.return=V,H):(H=d(H,X),H.return=V,H)}function le(V,H,X){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Md(""+H,V.mode,X),H.return=V,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return X=Yi(H.type,H.key,H.props,null,V.mode,X),Co(X,H),X.return=V,X;case N:return H=Dd(H,V.mode,X),H.return=V,H;case U:return H=Ns(H),le(V,H,X)}if(B(H)||Y(H))return H=bs(H,V.mode,X,null),H.return=V,H;if(typeof H.then=="function")return le(V,Ji(H),X);if(H.$$typeof===A)return le(V,Xi(V,H),X);Wi(V,H)}return null}function Q(V,H,X,re){var Te=H!==null?H.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return Te!==null?null:T(V,H,""+X,re);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case w:return X.key===Te?I(V,H,X,re):null;case N:return X.key===Te?K(V,H,X,re):null;case U:return X=Ns(X),Q(V,H,X,re)}if(B(X)||Y(X))return Te!==null?null:ne(V,H,X,re,null);if(typeof X.then=="function")return Q(V,H,Ji(X),re);if(X.$$typeof===A)return Q(V,H,Xi(V,X),re);Wi(V,X)}return null}function W(V,H,X,re,Te){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return V=V.get(X)||null,T(H,V,""+re,Te);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case w:return V=V.get(re.key===null?X:re.key)||null,I(H,V,re,Te);case N:return V=V.get(re.key===null?X:re.key)||null,K(H,V,re,Te);case U:return re=Ns(re),W(V,H,X,re,Te)}if(B(re)||Y(re))return V=V.get(X)||null,ne(H,V,re,Te,null);if(typeof re.then=="function")return W(V,H,X,Ji(re),Te);if(re.$$typeof===A)return W(V,H,X,Xi(H,re),Te);Wi(H,re)}return null}function we(V,H,X,re){for(var Te=null,Ze=null,je=H,Ie=H=0,Ge=null;je!==null&&Ie<X.length;Ie++){je.index>Ie?(Ge=je,je=null):Ge=je.sibling;var Je=Q(V,je,X[Ie],re);if(Je===null){je===null&&(je=Ge);break}e&&je&&Je.alternate===null&&t(V,je),H=m(Je,H,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je,je=Ge}if(Ie===X.length)return r(V,je),Xe&&Ja(V,Ie),Te;if(je===null){for(;Ie<X.length;Ie++)je=le(V,X[Ie],re),je!==null&&(H=m(je,H,Ie),Ze===null?Te=je:Ze.sibling=je,Ze=je);return Xe&&Ja(V,Ie),Te}for(je=i(je);Ie<X.length;Ie++)Ge=W(je,V,Ie,X[Ie],re),Ge!==null&&(e&&Ge.alternate!==null&&je.delete(Ge.key===null?Ie:Ge.key),H=m(Ge,H,Ie),Ze===null?Te=Ge:Ze.sibling=Ge,Ze=Ge);return e&&je.forEach(function(Wr){return t(V,Wr)}),Xe&&Ja(V,Ie),Te}function De(V,H,X,re){if(X==null)throw Error(o(151));for(var Te=null,Ze=null,je=H,Ie=H=0,Ge=null,Je=X.next();je!==null&&!Je.done;Ie++,Je=X.next()){je.index>Ie?(Ge=je,je=null):Ge=je.sibling;var Wr=Q(V,je,Je.value,re);if(Wr===null){je===null&&(je=Ge);break}e&&je&&Wr.alternate===null&&t(V,je),H=m(Wr,H,Ie),Ze===null?Te=Wr:Ze.sibling=Wr,Ze=Wr,je=Ge}if(Je.done)return r(V,je),Xe&&Ja(V,Ie),Te;if(je===null){for(;!Je.done;Ie++,Je=X.next())Je=le(V,Je.value,re),Je!==null&&(H=m(Je,H,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je);return Xe&&Ja(V,Ie),Te}for(je=i(je);!Je.done;Ie++,Je=X.next())Je=W(je,V,Ie,Je.value,re),Je!==null&&(e&&Je.alternate!==null&&je.delete(Je.key===null?Ie:Je.key),H=m(Je,H,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je);return e&&je.forEach(function(b2){return t(V,b2)}),Xe&&Ja(V,Ie),Te}function ht(V,H,X,re){if(typeof X=="object"&&X!==null&&X.type===S&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case w:e:{for(var Te=X.key;H!==null;){if(H.key===Te){if(Te=X.type,Te===S){if(H.tag===7){r(V,H.sibling),re=d(H,X.props.children),re.return=V,V=re;break e}}else if(H.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===U&&Ns(Te)===H.type){r(V,H.sibling),re=d(H,X.props),Co(re,X),re.return=V,V=re;break e}r(V,H);break}else t(V,H);H=H.sibling}X.type===S?(re=bs(X.props.children,V.mode,re,X.key),re.return=V,V=re):(re=Yi(X.type,X.key,X.props,null,V.mode,re),Co(re,X),re.return=V,V=re)}return j(V);case N:e:{for(Te=X.key;H!==null;){if(H.key===Te)if(H.tag===4&&H.stateNode.containerInfo===X.containerInfo&&H.stateNode.implementation===X.implementation){r(V,H.sibling),re=d(H,X.children||[]),re.return=V,V=re;break e}else{r(V,H);break}else t(V,H);H=H.sibling}re=Dd(X,V.mode,re),re.return=V,V=re}return j(V);case U:return X=Ns(X),ht(V,H,X,re)}if(B(X))return we(V,H,X,re);if(Y(X)){if(Te=Y(X),typeof Te!="function")throw Error(o(150));return X=Te.call(X),De(V,H,X,re)}if(typeof X.then=="function")return ht(V,H,Ji(X),re);if(X.$$typeof===A)return ht(V,H,Xi(V,X),re);Wi(V,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,H!==null&&H.tag===6?(r(V,H.sibling),re=d(H,X),re.return=V,V=re):(r(V,H),re=Md(X,V.mode,re),re.return=V,V=re),j(V)):r(V,H)}return function(V,H,X,re){try{So=0;var Te=ht(V,H,X,re);return gl=null,Te}catch(je){if(je===pl||je===Qi)throw je;var Ze=Vn(29,je,null,V.mode);return Ze.lanes=re,Ze.return=V,Ze}finally{}}}var Rs=dv(!0),fv=dv(!1),Lr=!1;function $d(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ur(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ir(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(tt&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,t=Vi(e),Kg(e,null,r),t}return $i(e,i,t,r),Vi(e)}function No(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,yt(e,r)}}function Yd(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var d=null,m=null;if(r=r.firstBaseUpdate,r!==null){do{var j={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};m===null?d=m=j:m=m.next=j,r=r.next}while(r!==null);m===null?d=m=t:m=m.next=t}else d=m=t;r={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:i.shared,callbacks:i.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Gd=!1;function Eo(){if(Gd){var e=ml;if(e!==null)throw e}}function Ro(e,t,r,i){Gd=!1;var d=e.updateQueue;Lr=!1;var m=d.firstBaseUpdate,j=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var I=T,K=I.next;I.next=null,j===null?m=K:j.next=K,j=I;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,T=ne.lastBaseUpdate,T!==j&&(T===null?ne.firstBaseUpdate=K:T.next=K,ne.lastBaseUpdate=I))}if(m!==null){var le=d.baseState;j=0,ne=K=I=null,T=m;do{var Q=T.lane&-536870913,W=Q!==T.lane;if(W?(Ye&Q)===Q:(i&Q)===Q){Q!==0&&Q===hl&&(Gd=!0),ne!==null&&(ne=ne.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var we=e,De=T;Q=t;var ht=r;switch(De.tag){case 1:if(we=De.payload,typeof we=="function"){le=we.call(ht,le,Q);break e}le=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=De.payload,Q=typeof we=="function"?we.call(ht,le,Q):we,Q==null)break e;le=y({},le,Q);break e;case 2:Lr=!0}}Q=T.callback,Q!==null&&(e.flags|=64,W&&(e.flags|=8192),W=d.callbacks,W===null?d.callbacks=[Q]:W.push(Q))}else W={lane:Q,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ne===null?(K=ne=W,I=le):ne=ne.next=W,j|=Q;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;W=T,T=W.next,W.next=null,d.lastBaseUpdate=W,d.shared.pending=null}}while(!0);ne===null&&(I=le),d.baseState=I,d.firstBaseUpdate=K,d.lastBaseUpdate=ne,m===null&&(d.shared.lanes=0),$r|=j,e.lanes=j,e.memoizedState=le}}function hv(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function mv(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)hv(r[e],t)}var vl=z(null),ec=z(0);function pv(e,t){e=cr,F(ec,e),F(vl,t),cr=e|t.baseLanes}function Fd(){F(ec,cr),F(vl,vl.current)}function Xd(){cr=ec.current,L(vl),L(ec)}var Yn=z(null),ia=null;function Pr(e){var t=e.alternate;F(Lt,Lt.current&1),F(Yn,e),ia===null&&(t===null||vl.current!==null||t.memoizedState!==null)&&(ia=e)}function Kd(e){F(Lt,Lt.current),F(Yn,e),ia===null&&(ia=e)}function gv(e){e.tag===22?(F(Lt,Lt.current),F(Yn,e),ia===null&&(ia=e)):Br()}function Br(){F(Lt,Lt.current),F(Yn,Yn.current)}function Gn(e){L(Yn),ia===e&&(ia=null),L(Lt)}var Lt=z(0);function tc(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||nh(r)||ah(r)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var tr=0,ze=null,dt=null,Bt=null,nc=!1,xl=!1,Ts=!1,ac=0,To=0,yl=null,uC=0;function Ot(){throw Error(o(321))}function Qd(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!$n(e[r],t[r]))return!1;return!0}function Zd(e,t,r,i,d,m){return tr=m,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Wv:hf,Ts=!1,m=r(i,d),Ts=!1,xl&&(m=xv(t,r,i,d)),vv(e),m}function vv(e){k.H=Do;var t=dt!==null&&dt.next!==null;if(tr=0,Bt=dt=ze=null,nc=!1,To=0,yl=null,t)throw Error(o(300));e===null||Ht||(e=e.dependencies,e!==null&&Fi(e)&&(Ht=!0))}function xv(e,t,r,i){ze=e;var d=0;do{if(xl&&(yl=null),To=0,xl=!1,25<=d)throw Error(o(301));if(d+=1,Bt=dt=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}k.H=ex,m=t(r,i)}while(xl);return m}function dC(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Ao(t):t,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(ze.flags|=1024),t}function Jd(){var e=ac!==0;return ac=0,e}function Wd(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function ef(e){if(nc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nc=!1}tr=0,Bt=dt=ze=null,xl=!1,To=ac=0,yl=null}function bn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?ze.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function Ut(){if(dt===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=Bt===null?ze.memoizedState:Bt.next;if(t!==null)Bt=t,dt=e;else{if(e===null)throw ze.alternate===null?Error(o(467)):Error(o(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Bt===null?ze.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function rc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=To;return To+=1,yl===null&&(yl=[]),e=iv(yl,e,t),t=ze,(Bt===null?t.memoizedState:Bt.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Wv:hf),e}function sc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ao(e);if(e.$$typeof===A)return un(e)}throw Error(o(438,String(e)))}function tf(e){var t=null,r=ze.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=rc(),ze.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),i=0;i<e;i++)r[i]=$;return t.index++,r}function nr(e,t){return typeof t=="function"?t(e):t}function lc(e){var t=Ut();return nf(t,dt,e)}function nf(e,t,r){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=r;var d=e.baseQueue,m=i.pending;if(m!==null){if(d!==null){var j=d.next;d.next=m.next,m.next=j}t.baseQueue=d=m,i.pending=null}if(m=e.baseState,d===null)e.memoizedState=m;else{t=d.next;var T=j=null,I=null,K=t,ne=!1;do{var le=K.lane&-536870913;if(le!==K.lane?(Ye&le)===le:(tr&le)===le){var Q=K.revertLane;if(Q===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),le===hl&&(ne=!0);else if((tr&Q)===Q){K=K.next,Q===hl&&(ne=!0);continue}else le={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},I===null?(T=I=le,j=m):I=I.next=le,ze.lanes|=Q,$r|=Q;le=K.action,Ts&&r(m,le),m=K.hasEagerState?K.eagerState:r(m,le)}else Q={lane:le,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},I===null?(T=I=Q,j=m):I=I.next=Q,ze.lanes|=le,$r|=le;K=K.next}while(K!==null&&K!==t);if(I===null?j=m:I.next=T,!$n(m,e.memoizedState)&&(Ht=!0,ne&&(r=ml,r!==null)))throw r;e.memoizedState=m,e.baseState=j,e.baseQueue=I,i.lastRenderedState=m}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function af(e){var t=Ut(),r=t.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=e;var i=r.dispatch,d=r.pending,m=t.memoizedState;if(d!==null){r.pending=null;var j=d=d.next;do m=e(m,j.action),j=j.next;while(j!==d);$n(m,t.memoizedState)||(Ht=!0),t.memoizedState=m,t.baseQueue===null&&(t.baseState=m),r.lastRenderedState=m}return[m,i]}function yv(e,t,r){var i=ze,d=Ut(),m=Xe;if(m){if(r===void 0)throw Error(o(407));r=r()}else r=t();var j=!$n((dt||d).memoizedState,r);if(j&&(d.memoizedState=r,Ht=!0),d=d.queue,lf(jv.bind(null,i,d,e),[e]),d.getSnapshot!==t||j||Bt!==null&&Bt.memoizedState.tag&1){if(i.flags|=2048,bl(9,{destroy:void 0},wv.bind(null,i,d,r,t),null),pt===null)throw Error(o(349));m||(tr&127)!==0||bv(i,t,r)}return r}function bv(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ze.updateQueue,t===null?(t=rc(),ze.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function wv(e,t,r,i){t.value=r,t.getSnapshot=i,Sv(t)&&Cv(e)}function jv(e,t,r){return r(function(){Sv(t)&&Cv(e)})}function Sv(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!$n(e,r)}catch{return!0}}function Cv(e){var t=ys(e,2);t!==null&&Mn(t,e,2)}function rf(e){var t=bn();if(typeof e=="function"){var r=e;if(e=r(),Ts){yn(!0);try{r()}finally{yn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:e},t}function Nv(e,t,r,i){return e.baseState=r,nf(e,dt,typeof i=="function"?i:nr)}function fC(e,t,r,i,d){if(cc(e))throw Error(o(485));if(e=t.action,e!==null){var m={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){m.listeners.push(j)}};k.T!==null?r(!0):m.isTransition=!1,i(m),r=t.pending,r===null?(m.next=t.pending=m,Ev(t,m)):(m.next=r.next,t.pending=r.next=m)}}function Ev(e,t){var r=t.action,i=t.payload,d=e.state;if(t.isTransition){var m=k.T,j={};k.T=j;try{var T=r(d,i),I=k.S;I!==null&&I(j,T),Rv(e,t,T)}catch(K){sf(e,t,K)}finally{m!==null&&j.types!==null&&(m.types=j.types),k.T=m}}else try{m=r(d,i),Rv(e,t,m)}catch(K){sf(e,t,K)}}function Rv(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){Tv(e,t,i)},function(i){return sf(e,t,i)}):Tv(e,t,r)}function Tv(e,t,r){t.status="fulfilled",t.value=r,Av(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,Ev(e,r)))}function sf(e,t,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=r,Av(t),t=t.next;while(t!==i)}e.action=null}function Av(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Mv(e,t){return t}function Dv(e,t){if(Xe){var r=pt.formState;if(r!==null){e:{var i=ze;if(Xe){if(bt){t:{for(var d=bt,m=oa;d.nodeType!==8;){if(!m){d=null;break t}if(d=ca(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){bt=ca(d.nextSibling),i=d.data==="F!";break e}}_r(i)}i=!1}i&&(t=r[0])}}return r=bn(),r.memoizedState=r.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mv,lastRenderedState:t},r.queue=i,r=Qv.bind(null,ze,i),i.dispatch=r,i=rf(!1),m=ff.bind(null,ze,!1,i.queue),i=bn(),d={state:t,dispatch:null,action:e,pending:null},i.queue=d,r=fC.bind(null,ze,d,m,r),d.dispatch=r,i.memoizedState=e,[t,r,!1]}function Ov(e){var t=Ut();return kv(t,dt,e)}function kv(e,t,r){if(t=nf(e,t,Mv)[0],e=lc(nr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Ao(t)}catch(j){throw j===pl?Qi:j}else i=t;t=Ut();var d=t.queue,m=d.dispatch;return r!==t.memoizedState&&(ze.flags|=2048,bl(9,{destroy:void 0},hC.bind(null,d,r),null)),[i,m,e]}function hC(e,t){e.action=t}function _v(e){var t=Ut(),r=dt;if(r!==null)return kv(t,r,e);Ut(),t=t.memoizedState,r=Ut();var i=r.queue.dispatch;return r.memoizedState=e,[t,i,!1]}function bl(e,t,r,i){return e={tag:e,create:r,deps:i,inst:t,next:null},t=ze.updateQueue,t===null&&(t=rc(),ze.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e),e}function zv(){return Ut().memoizedState}function oc(e,t,r,i){var d=bn();ze.flags|=e,d.memoizedState=bl(1|t,{destroy:void 0},r,i===void 0?null:i)}function ic(e,t,r,i){var d=Ut();i=i===void 0?null:i;var m=d.memoizedState.inst;dt!==null&&i!==null&&Qd(i,dt.memoizedState.deps)?d.memoizedState=bl(t,m,r,i):(ze.flags|=e,d.memoizedState=bl(1|t,m,r,i))}function Lv(e,t){oc(8390656,8,e,t)}function lf(e,t){ic(2048,8,e,t)}function mC(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=rc(),ze.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function Uv(e){var t=Ut().memoizedState;return mC({ref:t,nextImpl:e}),function(){if((tt&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Iv(e,t){return ic(4,2,e,t)}function Pv(e,t){return ic(4,4,e,t)}function Bv(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hv(e,t,r){r=r!=null?r.concat([e]):null,ic(4,4,Bv.bind(null,t,e),r)}function of(){}function qv(e,t){var r=Ut();t=t===void 0?null:t;var i=r.memoizedState;return t!==null&&Qd(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function $v(e,t){var r=Ut();t=t===void 0?null:t;var i=r.memoizedState;if(t!==null&&Qd(t,i[1]))return i[0];if(i=e(),Ts){yn(!0);try{e()}finally{yn(!1)}}return r.memoizedState=[i,t],i}function cf(e,t,r){return r===void 0||(tr&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=Vx(),ze.lanes|=e,$r|=e,r)}function Vv(e,t,r,i){return $n(r,t)?r:vl.current!==null?(e=cf(e,r,i),$n(e,t)||(Ht=!0),e):(tr&42)===0||(tr&1073741824)!==0&&(Ye&261930)===0?(Ht=!0,e.memoizedState=r):(e=Vx(),ze.lanes|=e,$r|=e,t)}function Yv(e,t,r,i,d){var m=q.p;q.p=m!==0&&8>m?m:8;var j=k.T,T={};k.T=T,ff(e,!1,t,r);try{var I=d(),K=k.S;if(K!==null&&K(T,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ne=cC(I,i);Mo(e,t,ne,Kn(e))}else Mo(e,t,i,Kn(e))}catch(le){Mo(e,t,{then:function(){},status:"rejected",reason:le},Kn())}finally{q.p=m,j!==null&&T.types!==null&&(j.types=T.types),k.T=j}}function pC(){}function uf(e,t,r,i){if(e.tag!==5)throw Error(o(476));var d=Gv(e).queue;Yv(e,d,t,Z,r===null?pC:function(){return Fv(e),r(i)})}function Gv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:Z},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Fv(e){var t=Gv(e);t.next===null&&(t=e.alternate.memoizedState),Mo(e,t.next.queue,{},Kn())}function df(){return un(Fo)}function Xv(){return Ut().memoizedState}function Kv(){return Ut().memoizedState}function gC(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=Kn();e=Ur(r);var i=Ir(t,e,r);i!==null&&(Mn(i,t,r),No(i,t,r)),t={cache:Pd()},e.payload=t;return}t=t.return}}function vC(e,t,r){var i=Kn();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},cc(e)?Zv(t,r):(r=Td(e,t,r,i),r!==null&&(Mn(r,e,i),Jv(r,t,i)))}function Qv(e,t,r){var i=Kn();Mo(e,t,r,i)}function Mo(e,t,r,i){var d={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(cc(e))Zv(t,d);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=t.lastRenderedReducer,m!==null))try{var j=t.lastRenderedState,T=m(j,r);if(d.hasEagerState=!0,d.eagerState=T,$n(T,j))return $i(e,t,d,0),pt===null&&qi(),!1}catch{}finally{}if(r=Td(e,t,d,i),r!==null)return Mn(r,e,i),Jv(r,t,i),!0}return!1}function ff(e,t,r,i){if(i={lane:2,revertLane:Vf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},cc(e)){if(t)throw Error(o(479))}else t=Td(e,r,i,2),t!==null&&Mn(t,e,2)}function cc(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Zv(e,t){xl=nc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Jv(e,t,r){if((r&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,yt(e,r)}}var Do={readContext:un,use:sc,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useLayoutEffect:Ot,useInsertionEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useSyncExternalStore:Ot,useId:Ot,useHostTransitionStatus:Ot,useFormState:Ot,useActionState:Ot,useOptimistic:Ot,useMemoCache:Ot,useCacheRefresh:Ot};Do.useEffectEvent=Ot;var Wv={readContext:un,use:sc,useCallback:function(e,t){return bn().memoizedState=[e,t===void 0?null:t],e},useContext:un,useEffect:Lv,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,oc(4194308,4,Bv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return oc(4194308,4,e,t)},useInsertionEffect:function(e,t){oc(4,2,e,t)},useMemo:function(e,t){var r=bn();t=t===void 0?null:t;var i=e();if(Ts){yn(!0);try{e()}finally{yn(!1)}}return r.memoizedState=[i,t],i},useReducer:function(e,t,r){var i=bn();if(r!==void 0){var d=r(t);if(Ts){yn(!0);try{r(t)}finally{yn(!1)}}}else d=t;return i.memoizedState=i.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},i.queue=e,e=e.dispatch=vC.bind(null,ze,e),[i.memoizedState,e]},useRef:function(e){var t=bn();return e={current:e},t.memoizedState=e},useState:function(e){e=rf(e);var t=e.queue,r=Qv.bind(null,ze,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:of,useDeferredValue:function(e,t){var r=bn();return cf(r,e,t)},useTransition:function(){var e=rf(!1);return e=Yv.bind(null,ze,e.queue,!0,!1),bn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var i=ze,d=bn();if(Xe){if(r===void 0)throw Error(o(407));r=r()}else{if(r=t(),pt===null)throw Error(o(349));(Ye&127)!==0||bv(i,t,r)}d.memoizedState=r;var m={value:r,getSnapshot:t};return d.queue=m,Lv(jv.bind(null,i,m,e),[e]),i.flags|=2048,bl(9,{destroy:void 0},wv.bind(null,i,m,r,t),null),r},useId:function(){var e=bn(),t=pt.identifierPrefix;if(Xe){var r=Da,i=Ma;r=(i&~(1<<32-Tt(i)-1)).toString(32)+r,t="_"+t+"R_"+r,r=ac++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=uC++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:df,useFormState:Dv,useActionState:Dv,useOptimistic:function(e){var t=bn();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=ff.bind(null,ze,!0,r),r.dispatch=t,[e,t]},useMemoCache:tf,useCacheRefresh:function(){return bn().memoizedState=gC.bind(null,ze)},useEffectEvent:function(e){var t=bn(),r={impl:e};return t.memoizedState=r,function(){if((tt&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}},hf={readContext:un,use:sc,useCallback:qv,useContext:un,useEffect:lf,useImperativeHandle:Hv,useInsertionEffect:Iv,useLayoutEffect:Pv,useMemo:$v,useReducer:lc,useRef:zv,useState:function(){return lc(nr)},useDebugValue:of,useDeferredValue:function(e,t){var r=Ut();return Vv(r,dt.memoizedState,e,t)},useTransition:function(){var e=lc(nr)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:Ao(e),t]},useSyncExternalStore:yv,useId:Xv,useHostTransitionStatus:df,useFormState:Ov,useActionState:Ov,useOptimistic:function(e,t){var r=Ut();return Nv(r,dt,e,t)},useMemoCache:tf,useCacheRefresh:Kv};hf.useEffectEvent=Uv;var ex={readContext:un,use:sc,useCallback:qv,useContext:un,useEffect:lf,useImperativeHandle:Hv,useInsertionEffect:Iv,useLayoutEffect:Pv,useMemo:$v,useReducer:af,useRef:zv,useState:function(){return af(nr)},useDebugValue:of,useDeferredValue:function(e,t){var r=Ut();return dt===null?cf(r,e,t):Vv(r,dt.memoizedState,e,t)},useTransition:function(){var e=af(nr)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:Ao(e),t]},useSyncExternalStore:yv,useId:Xv,useHostTransitionStatus:df,useFormState:_v,useActionState:_v,useOptimistic:function(e,t){var r=Ut();return dt!==null?Nv(r,dt,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:tf,useCacheRefresh:Kv};ex.useEffectEvent=Uv;function mf(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:y({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var pf={enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Kn(),d=Ur(i);d.payload=t,r!=null&&(d.callback=r),t=Ir(e,d,i),t!==null&&(Mn(t,e,i),No(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Kn(),d=Ur(i);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=Ir(e,d,i),t!==null&&(Mn(t,e,i),No(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Kn(),i=Ur(r);i.tag=2,t!=null&&(i.callback=t),t=Ir(e,i,r),t!==null&&(Mn(t,e,r),No(t,e,r))}};function tx(e,t,r,i,d,m,j){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,m,j):t.prototype&&t.prototype.isPureReactComponent?!vo(r,i)||!vo(d,m):!0}function nx(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&pf.enqueueReplaceState(t,t.state,null)}function As(e,t){var r=t;if("ref"in t){r={};for(var i in t)i!=="ref"&&(r[i]=t[i])}if(e=e.defaultProps){r===t&&(r=y({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function ax(e){Hi(e)}function rx(e){console.error(e)}function sx(e){Hi(e)}function uc(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function lx(e,t,r){try{var i=e.onCaughtError;i(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function gf(e,t,r){return r=Ur(r),r.tag=3,r.payload={element:null},r.callback=function(){uc(e,t)},r}function ox(e){return e=Ur(e),e.tag=3,e}function ix(e,t,r,i){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var m=i.value;e.payload=function(){return d(m)},e.callback=function(){lx(t,r,i)}}var j=r.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(e.callback=function(){lx(t,r,i),typeof d!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var T=i.stack;this.componentDidCatch(i.value,{componentStack:T!==null?T:""})})}function xC(e,t,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=r.alternate,t!==null&&fl(t,r,d,!0),r=Yn.current,r!==null){switch(r.tag){case 31:case 13:return ia===null?jc():r.alternate===null&&kt===0&&(kt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===Zi?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([i]):t.add(i),Hf(e,i,d)),!1;case 22:return r.flags|=65536,i===Zi?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([i]):r.add(i)),Hf(e,i,d)),!1}throw Error(o(435,r.tag))}return Hf(e,i,d),jc(),!1}if(Xe)return t=Yn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,i!==_d&&(e=Error(o(422),{cause:i}),bo(ra(e,r)))):(i!==_d&&(t=Error(o(423),{cause:i}),bo(ra(t,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=ra(i,r),d=gf(e.stateNode,i,d),Yd(e,d),kt!==4&&(kt=2)),!1;var m=Error(o(520),{cause:i});if(m=ra(m,r),Po===null?Po=[m]:Po.push(m),kt!==4&&(kt=2),t===null)return!0;i=ra(i,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=gf(r.stateNode,i,e),Yd(r,e),!1;case 1:if(t=r.type,m=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Vr===null||!Vr.has(m))))return r.flags|=65536,d&=-d,r.lanes|=d,d=ox(d),ix(d,e,r,i),Yd(r,d),!1}r=r.return}while(r!==null);return!1}var vf=Error(o(461)),Ht=!1;function dn(e,t,r,i){t.child=e===null?fv(t,null,r,i):Rs(t,e.child,r,i)}function cx(e,t,r,i,d){r=r.render;var m=t.ref;if("ref"in i){var j={};for(var T in i)T!=="ref"&&(j[T]=i[T])}else j=i;return Ss(t),i=Zd(e,t,r,j,m,d),T=Jd(),e!==null&&!Ht?(Wd(e,t,d),ar(e,t,d)):(Xe&&T&&Od(t),t.flags|=1,dn(e,t,i,d),t.child)}function ux(e,t,r,i,d){if(e===null){var m=r.type;return typeof m=="function"&&!Ad(m)&&m.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=m,dx(e,t,m,i,d)):(e=Yi(r.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,!Nf(e,d)){var j=m.memoizedProps;if(r=r.compare,r=r!==null?r:vo,r(j,i)&&e.ref===t.ref)return ar(e,t,d)}return t.flags|=1,e=Za(m,i),e.ref=t.ref,e.return=t,t.child=e}function dx(e,t,r,i,d){if(e!==null){var m=e.memoizedProps;if(vo(m,i)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=i=m,Nf(e,d))(e.flags&131072)!==0&&(Ht=!0);else return t.lanes=e.lanes,ar(e,t,d)}return xf(e,t,r,i,d)}function fx(e,t,r,i){var d=i.children,m=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(m=m!==null?m.baseLanes|r:r,e!==null){for(i=t.child=e.child,d=0;i!==null;)d=d|i.lanes|i.childLanes,i=i.sibling;i=d&~m}else i=0,t.child=null;return hx(e,t,m,r,i)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ki(t,m!==null?m.cachePool:null),m!==null?pv(t,m):Fd(),gv(t);else return i=t.lanes=536870912,hx(e,t,m!==null?m.baseLanes|r:r,r,i)}else m!==null?(Ki(t,m.cachePool),pv(t,m),Br(),t.memoizedState=null):(e!==null&&Ki(t,null),Fd(),Br());return dn(e,t,d,r),t.child}function Oo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function hx(e,t,r,i,d){var m=Hd();return m=m===null?null:{parent:Pt._currentValue,pool:m},t.memoizedState={baseLanes:r,cachePool:m},e!==null&&Ki(t,null),Fd(),gv(t),e!==null&&fl(e,t,i,!0),t.childLanes=d,null}function dc(e,t){return t=hc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mx(e,t,r){return Rs(t,e.child,null,r),e=dc(t,t.pendingProps),e.flags|=2,Gn(t),t.memoizedState=null,e}function yC(e,t,r){var i=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Xe){if(i.mode==="hidden")return e=dc(t,i),t.lanes=536870912,Oo(null,e);if(Kd(t),(e=bt)?(e=Ey(e,oa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Or!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},r=Zg(e),r.return=t,t.child=r,cn=t,bt=null)):e=null,e===null)throw _r(t);return t.lanes=536870912,null}return dc(t,i)}var m=e.memoizedState;if(m!==null){var j=m.dehydrated;if(Kd(t),d)if(t.flags&256)t.flags&=-257,t=mx(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ht||fl(e,t,r,!1),d=(r&e.childLanes)!==0,Ht||d){if(i=pt,i!==null&&(j=zt(i,r),j!==0&&j!==m.retryLane))throw m.retryLane=j,ys(e,j),Mn(i,e,j),vf;jc(),t=mx(e,t,r)}else e=m.treeContext,bt=ca(j.nextSibling),cn=t,Xe=!0,kr=null,oa=!1,e!==null&&ev(t,e),t=dc(t,i),t.flags|=4096;return t}return e=Za(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(o(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function xf(e,t,r,i,d){return Ss(t),r=Zd(e,t,r,i,void 0,d),i=Jd(),e!==null&&!Ht?(Wd(e,t,d),ar(e,t,d)):(Xe&&i&&Od(t),t.flags|=1,dn(e,t,r,d),t.child)}function px(e,t,r,i,d,m){return Ss(t),t.updateQueue=null,r=xv(t,i,r,d),vv(e),i=Jd(),e!==null&&!Ht?(Wd(e,t,m),ar(e,t,m)):(Xe&&i&&Od(t),t.flags|=1,dn(e,t,r,m),t.child)}function gx(e,t,r,i,d){if(Ss(t),t.stateNode===null){var m=il,j=r.contextType;typeof j=="object"&&j!==null&&(m=un(j)),m=new r(i,m),t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=pf,t.stateNode=m,m._reactInternals=t,m=t.stateNode,m.props=i,m.state=t.memoizedState,m.refs={},$d(t),j=r.contextType,m.context=typeof j=="object"&&j!==null?un(j):il,m.state=t.memoizedState,j=r.getDerivedStateFromProps,typeof j=="function"&&(mf(t,r,j,i),m.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(j=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),j!==m.state&&pf.enqueueReplaceState(m,m.state,null),Ro(t,i,m,d),Eo(),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){m=t.stateNode;var T=t.memoizedProps,I=As(r,T);m.props=I;var K=m.context,ne=r.contextType;j=il,typeof ne=="object"&&ne!==null&&(j=un(ne));var le=r.getDerivedStateFromProps;ne=typeof le=="function"||typeof m.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,ne||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(T||K!==j)&&nx(t,m,i,j),Lr=!1;var Q=t.memoizedState;m.state=Q,Ro(t,i,m,d),Eo(),K=t.memoizedState,T||Q!==K||Lr?(typeof le=="function"&&(mf(t,r,le,i),K=t.memoizedState),(I=Lr||tx(t,r,I,i,Q,K,j))?(ne||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=K),m.props=i,m.state=K,m.context=j,i=I):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{m=t.stateNode,Vd(e,t),j=t.memoizedProps,ne=As(r,j),m.props=ne,le=t.pendingProps,Q=m.context,K=r.contextType,I=il,typeof K=="object"&&K!==null&&(I=un(K)),T=r.getDerivedStateFromProps,(K=typeof T=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(j!==le||Q!==I)&&nx(t,m,i,I),Lr=!1,Q=t.memoizedState,m.state=Q,Ro(t,i,m,d),Eo();var W=t.memoizedState;j!==le||Q!==W||Lr||e!==null&&e.dependencies!==null&&Fi(e.dependencies)?(typeof T=="function"&&(mf(t,r,T,i),W=t.memoizedState),(ne=Lr||tx(t,r,ne,i,Q,W,I)||e!==null&&e.dependencies!==null&&Fi(e.dependencies))?(K||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,W,I),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,W,I)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||j===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=W),m.props=i,m.state=W,m.context=I,i=ne):(typeof m.componentDidUpdate!="function"||j===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),i=!1)}return m=i,fc(e,t),i=(t.flags&128)!==0,m||i?(m=t.stateNode,r=i&&typeof r.getDerivedStateFromError!="function"?null:m.render(),t.flags|=1,e!==null&&i?(t.child=Rs(t,e.child,null,d),t.child=Rs(t,null,r,d)):dn(e,t,r,d),t.memoizedState=m.state,e=t.child):e=ar(e,t,d),e}function vx(e,t,r,i){return ws(),t.flags|=256,dn(e,t,r,i),t.child}var yf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bf(e){return{baseLanes:e,cachePool:lv()}}function wf(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=Xn),e}function xx(e,t,r){var i=t.pendingProps,d=!1,m=(t.flags&128)!==0,j;if((j=m)||(j=e!==null&&e.memoizedState===null?!1:(Lt.current&2)!==0),j&&(d=!0,t.flags&=-129),j=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(d?Pr(t):Br(),(e=bt)?(e=Ey(e,oa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Or!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},r=Zg(e),r.return=t,t.child=r,cn=t,bt=null)):e=null,e===null)throw _r(t);return ah(e)?t.lanes=32:t.lanes=536870912,null}var T=i.children;return i=i.fallback,d?(Br(),d=t.mode,T=hc({mode:"hidden",children:T},d),i=bs(i,d,r,null),T.return=t,i.return=t,T.sibling=i,t.child=T,i=t.child,i.memoizedState=bf(r),i.childLanes=wf(e,j,r),t.memoizedState=yf,Oo(null,i)):(Pr(t),jf(t,T))}var I=e.memoizedState;if(I!==null&&(T=I.dehydrated,T!==null)){if(m)t.flags&256?(Pr(t),t.flags&=-257,t=Sf(e,t,r)):t.memoizedState!==null?(Br(),t.child=e.child,t.flags|=128,t=null):(Br(),T=i.fallback,d=t.mode,i=hc({mode:"visible",children:i.children},d),T=bs(T,d,r,null),T.flags|=2,i.return=t,T.return=t,i.sibling=T,t.child=i,Rs(t,e.child,null,r),i=t.child,i.memoizedState=bf(r),i.childLanes=wf(e,j,r),t.memoizedState=yf,t=Oo(null,i));else if(Pr(t),ah(T)){if(j=T.nextSibling&&T.nextSibling.dataset,j)var K=j.dgst;j=K,i=Error(o(419)),i.stack="",i.digest=j,bo({value:i,source:null,stack:null}),t=Sf(e,t,r)}else if(Ht||fl(e,t,r,!1),j=(r&e.childLanes)!==0,Ht||j){if(j=pt,j!==null&&(i=zt(j,r),i!==0&&i!==I.retryLane))throw I.retryLane=i,ys(e,i),Mn(j,e,i),vf;nh(T)||jc(),t=Sf(e,t,r)}else nh(T)?(t.flags|=192,t.child=e.child,t=null):(e=I.treeContext,bt=ca(T.nextSibling),cn=t,Xe=!0,kr=null,oa=!1,e!==null&&ev(t,e),t=jf(t,i.children),t.flags|=4096);return t}return d?(Br(),T=i.fallback,d=t.mode,I=e.child,K=I.sibling,i=Za(I,{mode:"hidden",children:i.children}),i.subtreeFlags=I.subtreeFlags&65011712,K!==null?T=Za(K,T):(T=bs(T,d,r,null),T.flags|=2),T.return=t,i.return=t,i.sibling=T,t.child=i,Oo(null,i),i=t.child,T=e.child.memoizedState,T===null?T=bf(r):(d=T.cachePool,d!==null?(I=Pt._currentValue,d=d.parent!==I?{parent:I,pool:I}:d):d=lv(),T={baseLanes:T.baseLanes|r,cachePool:d}),i.memoizedState=T,i.childLanes=wf(e,j,r),t.memoizedState=yf,Oo(e.child,i)):(Pr(t),r=e.child,e=r.sibling,r=Za(r,{mode:"visible",children:i.children}),r.return=t,r.sibling=null,e!==null&&(j=t.deletions,j===null?(t.deletions=[e],t.flags|=16):j.push(e)),t.child=r,t.memoizedState=null,r)}function jf(e,t){return t=hc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function hc(e,t){return e=Vn(22,e,null,t),e.lanes=0,e}function Sf(e,t,r){return Rs(t,e.child,null,r),e=jf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yx(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Ud(e.return,t,r)}function Cf(e,t,r,i,d,m){var j=e.memoizedState;j===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:d,treeForkCount:m}:(j.isBackwards=t,j.rendering=null,j.renderingStartTime=0,j.last=i,j.tail=r,j.tailMode=d,j.treeForkCount=m)}function bx(e,t,r){var i=t.pendingProps,d=i.revealOrder,m=i.tail;i=i.children;var j=Lt.current,T=(j&2)!==0;if(T?(j=j&1|2,t.flags|=128):j&=1,F(Lt,j),dn(e,t,i,r),i=Xe?yo:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yx(e,r,t);else if(e.tag===19)yx(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(r=t.child,d=null;r!==null;)e=r.alternate,e!==null&&tc(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=t.child,t.child=null):(d=r.sibling,r.sibling=null),Cf(t,!1,d,r,m,i);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&tc(e)===null){t.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}Cf(t,!0,r,null,m,i);break;case"together":Cf(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function ar(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),$r|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(fl(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,r=Za(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Za(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Nf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fi(e)))}function bC(e,t,r){switch(t.tag){case 3:ie(t,t.stateNode.containerInfo),zr(t,Pt,e.memoizedState.cache),ws();break;case 27:case 5:xe(t);break;case 4:ie(t,t.stateNode.containerInfo);break;case 10:zr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Kd(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Pr(t),t.flags|=128,null):(r&t.child.childLanes)!==0?xx(e,t,r):(Pr(t),e=ar(e,t,r),e!==null?e.sibling:null);Pr(t);break;case 19:var d=(e.flags&128)!==0;if(i=(r&t.childLanes)!==0,i||(fl(e,t,r,!1),i=(r&t.childLanes)!==0),d){if(i)return bx(e,t,r);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),F(Lt,Lt.current),i)break;return null;case 22:return t.lanes=0,fx(e,t,r,t.pendingProps);case 24:zr(t,Pt,e.memoizedState.cache)}return ar(e,t,r)}function wx(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ht=!0;else{if(!Nf(e,r)&&(t.flags&128)===0)return Ht=!1,bC(e,t,r);Ht=(e.flags&131072)!==0}else Ht=!1,Xe&&(t.flags&1048576)!==0&&Wg(t,yo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ns(t.elementType),t.type=e,typeof e=="function")Ad(e)?(i=As(e,i),t.tag=1,t=gx(null,t,e,i,r)):(t.tag=0,t=xf(null,t,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===M){t.tag=11,t=cx(null,t,e,i,r);break e}else if(d===_){t.tag=14,t=ux(null,t,e,i,r);break e}}throw t=ue(e)||e,Error(o(306,t,""))}}return t;case 0:return xf(e,t,t.type,t.pendingProps,r);case 1:return i=t.type,d=As(i,t.pendingProps),gx(e,t,i,d,r);case 3:e:{if(ie(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var m=t.memoizedState;d=m.element,Vd(e,t),Ro(t,i,null,r);var j=t.memoizedState;if(i=j.cache,zr(t,Pt,i),i!==m.cache&&Id(t,[Pt],r,!0),Eo(),i=j.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:j.cache},t.updateQueue.baseState=m,t.memoizedState=m,t.flags&256){t=vx(e,t,i,r);break e}else if(i!==d){d=ra(Error(o(424)),t),bo(d),t=vx(e,t,i,r);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(bt=ca(e.firstChild),cn=t,Xe=!0,kr=null,oa=!0,r=fv(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ws(),i===d){t=ar(e,t,r);break e}dn(e,t,i,r)}t=t.child}return t;case 26:return fc(e,t),e===null?(r=Oy(t.type,null,t.pendingProps,null))?t.memoizedState=r:Xe||(r=t.type,e=t.pendingProps,i=Ac(ye.current).createElement(r),i[on]=t,i[Cn]=e,fn(i,r,e),tn(i),t.stateNode=i):t.memoizedState=Oy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xe(t),e===null&&Xe&&(i=t.stateNode=Ay(t.type,t.pendingProps,ye.current),cn=t,oa=!0,d=bt,Xr(t.type)?(rh=d,bt=ca(i.firstChild)):bt=d),dn(e,t,t.pendingProps.children,r),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((d=i=bt)&&(i=QC(i,t.type,t.pendingProps,oa),i!==null?(t.stateNode=i,cn=t,bt=ca(i.firstChild),oa=!1,d=!0):d=!1),d||_r(t)),xe(t),d=t.type,m=t.pendingProps,j=e!==null?e.memoizedProps:null,i=m.children,Wf(d,m)?i=null:j!==null&&Wf(d,j)&&(t.flags|=32),t.memoizedState!==null&&(d=Zd(e,t,dC,null,null,r),Fo._currentValue=d),fc(e,t),dn(e,t,i,r),t.child;case 6:return e===null&&Xe&&((e=r=bt)&&(r=ZC(r,t.pendingProps,oa),r!==null?(t.stateNode=r,cn=t,bt=null,e=!0):e=!1),e||_r(t)),null;case 13:return xx(e,t,r);case 4:return ie(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Rs(t,null,i,r):dn(e,t,i,r),t.child;case 11:return cx(e,t,t.type,t.pendingProps,r);case 7:return dn(e,t,t.pendingProps,r),t.child;case 8:return dn(e,t,t.pendingProps.children,r),t.child;case 12:return dn(e,t,t.pendingProps.children,r),t.child;case 10:return i=t.pendingProps,zr(t,t.type,i.value),dn(e,t,i.children,r),t.child;case 9:return d=t.type._context,i=t.pendingProps.children,Ss(t),d=un(d),i=i(d),t.flags|=1,dn(e,t,i,r),t.child;case 14:return ux(e,t,t.type,t.pendingProps,r);case 15:return dx(e,t,t.type,t.pendingProps,r);case 19:return bx(e,t,r);case 31:return yC(e,t,r);case 22:return fx(e,t,r,t.pendingProps);case 24:return Ss(t),i=un(Pt),e===null?(d=Hd(),d===null&&(d=pt,m=Pd(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=r),d=m),t.memoizedState={parent:i,cache:d},$d(t),zr(t,Pt,d)):((e.lanes&r)!==0&&(Vd(e,t),Ro(t,null,null,r),Eo()),d=e.memoizedState,m=t.memoizedState,d.parent!==i?(d={parent:i,cache:i},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),zr(t,Pt,i)):(i=m.cache,zr(t,Pt,i),i!==d.cache&&Id(t,[Pt],r,!0))),dn(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function rr(e){e.flags|=4}function Ef(e,t,r,i,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Xx())e.flags|=8192;else throw Es=Zi,qd}else e.flags&=-16777217}function jx(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Uy(t))if(Xx())e.flags|=8192;else throw Es=Zi,qd}function mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ue():536870912,e.lanes|=t,Cl|=t)}function ko(e,t){if(!Xe)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var d=e.child;d!==null;)r|=d.lanes|d.childLanes,i|=d.subtreeFlags&65011712,i|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)r|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function wC(e,t,r){var i=t.pendingProps;switch(kd(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(t),null;case 1:return wt(t),null;case 3:return r=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),er(Pt),he(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(dl(t)?rr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,zd())),wt(t),null;case 26:var d=t.type,m=t.memoizedState;return e===null?(rr(t),m!==null?(wt(t),jx(t,m)):(wt(t),Ef(t,d,null,i,r))):m?m!==e.memoizedState?(rr(t),wt(t),jx(t,m)):(wt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&rr(t),wt(t),Ef(t,d,e,i,r)),null;case 27:if(Ae(t),r=ye.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&rr(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return wt(t),null}e=ae.current,dl(t)?tv(t):(e=Ay(d,i,r),t.stateNode=e,rr(t))}return wt(t),null;case 5:if(Ae(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&rr(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return wt(t),null}if(m=ae.current,dl(t))tv(t);else{var j=Ac(ye.current);switch(m){case 1:m=j.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=j.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=j.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=j.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=j.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof i.is=="string"?j.createElement("select",{is:i.is}):j.createElement("select"),i.multiple?m.multiple=!0:i.size&&(m.size=i.size);break;default:m=typeof i.is=="string"?j.createElement(d,{is:i.is}):j.createElement(d)}}m[on]=t,m[Cn]=i;e:for(j=t.child;j!==null;){if(j.tag===5||j.tag===6)m.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===t)break e;for(;j.sibling===null;){if(j.return===null||j.return===t)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}t.stateNode=m;e:switch(fn(m,d,i),d){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&rr(t)}}return wt(t),Ef(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&rr(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=ye.current,dl(t)){if(e=t.stateNode,r=t.memoizedProps,i=null,d=cn,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[on]=t,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||xy(e.nodeValue,r)),e||_r(t,!0)}else e=Ac(e).createTextNode(i),e[on]=t,t.stateNode=e}return wt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(i=dl(t),r!==null){if(e===null){if(!i)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[on]=t}else ws(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;wt(t),e=!1}else r=zd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(Gn(t),t):(Gn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return wt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=dl(t),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(o(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));d[on]=t}else ws(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;wt(t),d=!1}else d=zd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(Gn(t),t):(Gn(t),null)}return Gn(t),(t.flags&128)!==0?(t.lanes=r,t):(r=i!==null,e=e!==null&&e.memoizedState!==null,r&&(i=t.child,d=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(d=i.alternate.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==d&&(i.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),mc(t,t.updateQueue),wt(t),null);case 4:return he(),e===null&&Xf(t.stateNode.containerInfo),wt(t),null;case 10:return er(t.type),wt(t),null;case 19:if(L(Lt),i=t.memoizedState,i===null)return wt(t),null;if(d=(t.flags&128)!==0,m=i.rendering,m===null)if(d)ko(i,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=tc(e),m!==null){for(t.flags|=128,ko(i,!1),e=m.updateQueue,t.updateQueue=e,mc(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Qg(r,e),r=r.sibling;return F(Lt,Lt.current&1|2),Xe&&Ja(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Ct()>yc&&(t.flags|=128,d=!0,ko(i,!1),t.lanes=4194304)}else{if(!d)if(e=tc(m),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,mc(t,e),ko(i,!0),i.tail===null&&i.tailMode==="hidden"&&!m.alternate&&!Xe)return wt(t),null}else 2*Ct()-i.renderingStartTime>yc&&r!==536870912&&(t.flags|=128,d=!0,ko(i,!1),t.lanes=4194304);i.isBackwards?(m.sibling=t.child,t.child=m):(e=i.last,e!==null?e.sibling=m:t.child=m,i.last=m)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ct(),e.sibling=null,r=Lt.current,F(Lt,d?r&1|2:r&1),Xe&&Ja(t,i.treeForkCount),e):(wt(t),null);case 22:case 23:return Gn(t),Xd(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(r&536870912)!==0&&(t.flags&128)===0&&(wt(t),t.subtreeFlags&6&&(t.flags|=8192)):wt(t),r=t.updateQueue,r!==null&&mc(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==r&&(t.flags|=2048),e!==null&&L(Cs),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),er(Pt),wt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function jC(e,t){switch(kd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return er(Pt),he(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Gn(t),t.alternate===null)throw Error(o(340));ws()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ws()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(Lt),null;case 4:return he(),null;case 10:return er(t.type),null;case 22:case 23:return Gn(t),Xd(),e!==null&&L(Cs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return er(Pt),null;case 25:return null;default:return null}}function Sx(e,t){switch(kd(t),t.tag){case 3:er(Pt),he();break;case 26:case 27:case 5:Ae(t);break;case 4:he();break;case 31:t.memoizedState!==null&&Gn(t);break;case 13:Gn(t);break;case 19:L(Lt);break;case 10:er(t.type);break;case 22:case 23:Gn(t),Xd(),e!==null&&L(Cs);break;case 24:er(Pt)}}function _o(e,t){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var d=i.next;r=d;do{if((r.tag&e)===e){i=void 0;var m=r.create,j=r.inst;i=m(),j.destroy=i}r=r.next}while(r!==d)}}catch(T){ct(t,t.return,T)}}function Hr(e,t,r){try{var i=t.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var m=d.next;i=m;do{if((i.tag&e)===e){var j=i.inst,T=j.destroy;if(T!==void 0){j.destroy=void 0,d=t;var I=r,K=T;try{K()}catch(ne){ct(d,I,ne)}}}i=i.next}while(i!==m)}}catch(ne){ct(t,t.return,ne)}}function Cx(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{mv(t,r)}catch(i){ct(e,e.return,i)}}}function Nx(e,t,r){r.props=As(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){ct(e,t,i)}}function zo(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof r=="function"?e.refCleanup=r(i):r.current=i}}catch(d){ct(e,t,d)}}function Oa(e,t){var r=e.ref,i=e.refCleanup;if(r!==null)if(typeof i=="function")try{i()}catch(d){ct(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(d){ct(e,t,d)}else r.current=null}function Ex(e){var t=e.type,r=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&i.focus();break e;case"img":r.src?i.src=r.src:r.srcSet&&(i.srcset=r.srcSet)}}catch(d){ct(e,e.return,d)}}function Rf(e,t,r){try{var i=e.stateNode;VC(i,e.type,r,t),i[Cn]=t}catch(d){ct(e,e.return,d)}}function Rx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xr(e.type)||e.tag===4}function Tf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Xr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Af(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ka));else if(i!==4&&(i===27&&Xr(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(Af(e,t,r),e=e.sibling;e!==null;)Af(e,t,r),e=e.sibling}function pc(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(i===27&&Xr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(pc(e,t,r),e=e.sibling;e!==null;)pc(e,t,r),e=e.sibling}function Tx(e){var t=e.stateNode,r=e.memoizedProps;try{for(var i=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);fn(t,i,r),t[on]=e,t[Cn]=r}catch(m){ct(e,e.return,m)}}var sr=!1,qt=!1,Mf=!1,Ax=typeof WeakSet=="function"?WeakSet:Set,nn=null;function SC(e,t){if(e=e.containerInfo,Zf=Lc,e=Hg(e),jd(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var d=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{r.nodeType,m.nodeType}catch{r=null;break e}var j=0,T=-1,I=-1,K=0,ne=0,le=e,Q=null;t:for(;;){for(var W;le!==r||d!==0&&le.nodeType!==3||(T=j+d),le!==m||i!==0&&le.nodeType!==3||(I=j+i),le.nodeType===3&&(j+=le.nodeValue.length),(W=le.firstChild)!==null;)Q=le,le=W;for(;;){if(le===e)break t;if(Q===r&&++K===d&&(T=j),Q===m&&++ne===i&&(I=j),(W=le.nextSibling)!==null)break;le=Q,Q=le.parentNode}le=W}r=T===-1||I===-1?null:{start:T,end:I}}else r=null}r=r||{start:0,end:0}}else r=null;for(Jf={focusedElem:e,selectionRange:r},Lc=!1,nn=t;nn!==null;)if(t=nn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,nn=e;else for(;nn!==null;){switch(t=nn,m=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,r=t,d=m.memoizedProps,m=m.memoizedState,i=r.stateNode;try{var we=As(r.type,d);e=i.getSnapshotBeforeUpdate(we,m),i.__reactInternalSnapshotBeforeUpdate=e}catch(De){ct(r,r.return,De)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)th(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":th(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,nn=e;break}nn=t.return}}function Mx(e,t,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:or(e,r),i&4&&_o(5,r);break;case 1:if(or(e,r),i&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(j){ct(r,r.return,j)}else{var d=As(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(j){ct(r,r.return,j)}}i&64&&Cx(r),i&512&&zo(r,r.return);break;case 3:if(or(e,r),i&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{mv(e,t)}catch(j){ct(r,r.return,j)}}break;case 27:t===null&&i&4&&Tx(r);case 26:case 5:or(e,r),t===null&&i&4&&Ex(r),i&512&&zo(r,r.return);break;case 12:or(e,r);break;case 31:or(e,r),i&4&&kx(e,r);break;case 13:or(e,r),i&4&&_x(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=OC.bind(null,r),JC(e,r))));break;case 22:if(i=r.memoizedState!==null||sr,!i){t=t!==null&&t.memoizedState!==null||qt,d=sr;var m=qt;sr=i,(qt=t)&&!m?ir(e,r,(r.subtreeFlags&8772)!==0):or(e,r),sr=d,qt=m}break;case 30:break;default:or(e,r)}}function Dx(e){var t=e.alternate;t!==null&&(e.alternate=null,Dx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&sd(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Et=null,En=!1;function lr(e,t,r){for(r=r.child;r!==null;)Ox(e,t,r),r=r.sibling}function Ox(e,t,r){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(ga,r)}catch{}switch(r.tag){case 26:qt||Oa(r,t),lr(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:qt||Oa(r,t);var i=Et,d=En;Xr(r.type)&&(Et=r.stateNode,En=!1),lr(e,t,r),Vo(r.stateNode),Et=i,En=d;break;case 5:qt||Oa(r,t);case 6:if(i=Et,d=En,Et=null,lr(e,t,r),Et=i,En=d,Et!==null)if(En)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(r.stateNode)}catch(m){ct(r,t,m)}else try{Et.removeChild(r.stateNode)}catch(m){ct(r,t,m)}break;case 18:Et!==null&&(En?(e=Et,Cy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Ol(e)):Cy(Et,r.stateNode));break;case 4:i=Et,d=En,Et=r.stateNode.containerInfo,En=!0,lr(e,t,r),Et=i,En=d;break;case 0:case 11:case 14:case 15:Hr(2,r,t),qt||Hr(4,r,t),lr(e,t,r);break;case 1:qt||(Oa(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"&&Nx(r,t,i)),lr(e,t,r);break;case 21:lr(e,t,r);break;case 22:qt=(i=qt)||r.memoizedState!==null,lr(e,t,r),qt=i;break;default:lr(e,t,r)}}function kx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ol(e)}catch(r){ct(t,t.return,r)}}}function _x(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ol(e)}catch(r){ct(t,t.return,r)}}function CC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ax),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ax),t;default:throw Error(o(435,e.tag))}}function gc(e,t){var r=CC(e);t.forEach(function(i){if(!r.has(i)){r.add(i);var d=kC.bind(null,e,i);i.then(d,d)}})}function Rn(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var d=r[i],m=e,j=t,T=j;e:for(;T!==null;){switch(T.tag){case 27:if(Xr(T.type)){Et=T.stateNode,En=!1;break e}break;case 5:Et=T.stateNode,En=!1;break e;case 3:case 4:Et=T.stateNode.containerInfo,En=!0;break e}T=T.return}if(Et===null)throw Error(o(160));Ox(m,j,d),Et=null,En=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)zx(t,e),t=t.sibling}var ya=null;function zx(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rn(t,e),Tn(e),i&4&&(Hr(3,e,e.return),_o(3,e),Hr(5,e,e.return));break;case 1:Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),i&64&&sr&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?i:r.concat(i))));break;case 26:var d=ya;if(Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),i&4){var m=r!==null?r.memoizedState:null;if(i=e.memoizedState,r===null)if(i===null)if(e.stateNode===null){e:{i=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":m=d.getElementsByTagName("title")[0],(!m||m[oo]||m[on]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(i),d.head.insertBefore(m,d.querySelector("head > title"))),fn(m,i,r),m[on]=e,tn(m),i=m;break e;case"link":var j=zy("link","href",d).get(i+(r.href||""));if(j){for(var T=0;T<j.length;T++)if(m=j[T],m.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&m.getAttribute("rel")===(r.rel==null?null:r.rel)&&m.getAttribute("title")===(r.title==null?null:r.title)&&m.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){j.splice(T,1);break t}}m=d.createElement(i),fn(m,i,r),d.head.appendChild(m);break;case"meta":if(j=zy("meta","content",d).get(i+(r.content||""))){for(T=0;T<j.length;T++)if(m=j[T],m.getAttribute("content")===(r.content==null?null:""+r.content)&&m.getAttribute("name")===(r.name==null?null:r.name)&&m.getAttribute("property")===(r.property==null?null:r.property)&&m.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&m.getAttribute("charset")===(r.charSet==null?null:r.charSet)){j.splice(T,1);break t}}m=d.createElement(i),fn(m,i,r),d.head.appendChild(m);break;default:throw Error(o(468,i))}m[on]=e,tn(m),i=m}e.stateNode=i}else Ly(d,e.type,e.stateNode);else e.stateNode=_y(d,i,e.memoizedProps);else m!==i?(m===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):m.count--,i===null?Ly(d,e.type,e.stateNode):_y(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Rf(e,e.memoizedProps,r.memoizedProps)}break;case 27:Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),r!==null&&i&4&&Rf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),e.flags&32){d=e.stateNode;try{tl(d,"")}catch(we){ct(e,e.return,we)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,Rf(e,d,r!==null?r.memoizedProps:d)),i&1024&&(Mf=!0);break;case 6:if(Rn(t,e),Tn(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,r=e.stateNode;try{r.nodeValue=i}catch(we){ct(e,e.return,we)}}break;case 3:if(Oc=null,d=ya,ya=Mc(t.containerInfo),Rn(t,e),ya=d,Tn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Ol(t.containerInfo)}catch(we){ct(e,e.return,we)}Mf&&(Mf=!1,Lx(e));break;case 4:i=ya,ya=Mc(e.stateNode.containerInfo),Rn(t,e),Tn(e),ya=i;break;case 12:Rn(t,e),Tn(e);break;case 31:Rn(t,e),Tn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,gc(e,i)));break;case 13:Rn(t,e),Tn(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(xc=Ct()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,gc(e,i)));break;case 22:d=e.memoizedState!==null;var I=r!==null&&r.memoizedState!==null,K=sr,ne=qt;if(sr=K||d,qt=ne||I,Rn(t,e),qt=ne,sr=K,Tn(e),i&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(r===null||I||sr||qt||Ms(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){I=r=t;try{if(m=I.stateNode,d)j=m.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{T=I.stateNode;var le=I.memoizedProps.style,Q=le!=null&&le.hasOwnProperty("display")?le.display:null;T.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(we){ct(I,I.return,we)}}}else if(t.tag===6){if(r===null){I=t;try{I.stateNode.nodeValue=d?"":I.memoizedProps}catch(we){ct(I,I.return,we)}}}else if(t.tag===18){if(r===null){I=t;try{var W=I.stateNode;d?Ny(W,!0):Ny(I.stateNode,!1)}catch(we){ct(I,I.return,we)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(r=i.retryQueue,r!==null&&(i.retryQueue=null,gc(e,r))));break;case 19:Rn(t,e),Tn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,gc(e,i)));break;case 30:break;case 21:break;default:Rn(t,e),Tn(e)}}function Tn(e){var t=e.flags;if(t&2){try{for(var r,i=e.return;i!==null;){if(Rx(i)){r=i;break}i=i.return}if(r==null)throw Error(o(160));switch(r.tag){case 27:var d=r.stateNode,m=Tf(e);pc(e,m,d);break;case 5:var j=r.stateNode;r.flags&32&&(tl(j,""),r.flags&=-33);var T=Tf(e);pc(e,T,j);break;case 3:case 4:var I=r.stateNode.containerInfo,K=Tf(e);Af(e,K,I);break;default:throw Error(o(161))}}catch(ne){ct(e,e.return,ne)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Lx(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function or(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Mx(e,t.alternate,t),t=t.sibling}function Ms(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hr(4,t,t.return),Ms(t);break;case 1:Oa(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&Nx(t,t.return,r),Ms(t);break;case 27:Vo(t.stateNode);case 26:case 5:Oa(t,t.return),Ms(t);break;case 22:t.memoizedState===null&&Ms(t);break;case 30:Ms(t);break;default:Ms(t)}e=e.sibling}}function ir(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,d=e,m=t,j=m.flags;switch(m.tag){case 0:case 11:case 15:ir(d,m,r),_o(4,m);break;case 1:if(ir(d,m,r),i=m,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(K){ct(i,i.return,K)}if(i=m,d=i.updateQueue,d!==null){var T=i.stateNode;try{var I=d.shared.hiddenCallbacks;if(I!==null)for(d.shared.hiddenCallbacks=null,d=0;d<I.length;d++)hv(I[d],T)}catch(K){ct(i,i.return,K)}}r&&j&64&&Cx(m),zo(m,m.return);break;case 27:Tx(m);case 26:case 5:ir(d,m,r),r&&i===null&&j&4&&Ex(m),zo(m,m.return);break;case 12:ir(d,m,r);break;case 31:ir(d,m,r),r&&j&4&&kx(d,m);break;case 13:ir(d,m,r),r&&j&4&&_x(d,m);break;case 22:m.memoizedState===null&&ir(d,m,r),zo(m,m.return);break;case 30:break;default:ir(d,m,r)}t=t.sibling}}function Df(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&wo(r))}function Of(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wo(e))}function ba(e,t,r,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ux(e,t,r,i),t=t.sibling}function Ux(e,t,r,i){var d=t.flags;switch(t.tag){case 0:case 11:case 15:ba(e,t,r,i),d&2048&&_o(9,t);break;case 1:ba(e,t,r,i);break;case 3:ba(e,t,r,i),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wo(e)));break;case 12:if(d&2048){ba(e,t,r,i),e=t.stateNode;try{var m=t.memoizedProps,j=m.id,T=m.onPostCommit;typeof T=="function"&&T(j,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(I){ct(t,t.return,I)}}else ba(e,t,r,i);break;case 31:ba(e,t,r,i);break;case 13:ba(e,t,r,i);break;case 23:break;case 22:m=t.stateNode,j=t.alternate,t.memoizedState!==null?m._visibility&2?ba(e,t,r,i):Lo(e,t):m._visibility&2?ba(e,t,r,i):(m._visibility|=2,wl(e,t,r,i,(t.subtreeFlags&10256)!==0||!1)),d&2048&&Df(j,t);break;case 24:ba(e,t,r,i),d&2048&&Of(t.alternate,t);break;default:ba(e,t,r,i)}}function wl(e,t,r,i,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var m=e,j=t,T=r,I=i,K=j.flags;switch(j.tag){case 0:case 11:case 15:wl(m,j,T,I,d),_o(8,j);break;case 23:break;case 22:var ne=j.stateNode;j.memoizedState!==null?ne._visibility&2?wl(m,j,T,I,d):Lo(m,j):(ne._visibility|=2,wl(m,j,T,I,d)),d&&K&2048&&Df(j.alternate,j);break;case 24:wl(m,j,T,I,d),d&&K&2048&&Of(j.alternate,j);break;default:wl(m,j,T,I,d)}t=t.sibling}}function Lo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,i=t,d=i.flags;switch(i.tag){case 22:Lo(r,i),d&2048&&Df(i.alternate,i);break;case 24:Lo(r,i),d&2048&&Of(i.alternate,i);break;default:Lo(r,i)}t=t.sibling}}var Uo=8192;function jl(e,t,r){if(e.subtreeFlags&Uo)for(e=e.child;e!==null;)Ix(e,t,r),e=e.sibling}function Ix(e,t,r){switch(e.tag){case 26:jl(e,t,r),e.flags&Uo&&e.memoizedState!==null&&u2(r,ya,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,r);break;case 3:case 4:var i=ya;ya=Mc(e.stateNode.containerInfo),jl(e,t,r),ya=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Uo,Uo=16777216,jl(e,t,r),Uo=i):jl(e,t,r));break;default:jl(e,t,r)}}function Px(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Io(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];nn=i,Hx(i,e)}Px(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bx(e),e=e.sibling}function Bx(e){switch(e.tag){case 0:case 11:case 15:Io(e),e.flags&2048&&Hr(9,e,e.return);break;case 3:Io(e);break;case 12:Io(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,vc(e)):Io(e);break;default:Io(e)}}function vc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];nn=i,Hx(i,e)}Px(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hr(8,t,t.return),vc(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,vc(t));break;default:vc(t)}e=e.sibling}}function Hx(e,t){for(;nn!==null;){var r=nn;switch(r.tag){case 0:case 11:case 15:Hr(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var i=r.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:wo(r.memoizedState.cache)}if(i=r.child,i!==null)i.return=r,nn=i;else e:for(r=e;nn!==null;){i=nn;var d=i.sibling,m=i.return;if(Dx(i),i===r){nn=null;break e}if(d!==null){d.return=m,nn=d;break e}nn=m}}}var NC={getCacheForType:function(e){var t=un(Pt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return un(Pt).controller.signal}},EC=typeof WeakMap=="function"?WeakMap:Map,tt=0,pt=null,$e=null,Ye=0,it=0,Fn=null,qr=!1,Sl=!1,kf=!1,cr=0,kt=0,$r=0,Ds=0,_f=0,Xn=0,Cl=0,Po=null,An=null,zf=!1,xc=0,qx=0,yc=1/0,bc=null,Vr=null,Gt=0,Yr=null,Nl=null,ur=0,Lf=0,Uf=null,$x=null,Bo=0,If=null;function Kn(){return(tt&2)!==0&&Ye!==0?Ye&-Ye:k.T!==null?Vf():va()}function Vx(){if(Xn===0)if((Ye&536870912)===0||Xe){var e=Ar;Ar<<=1,(Ar&3932160)===0&&(Ar=262144),Xn=e}else Xn=536870912;return e=Yn.current,e!==null&&(e.flags|=32),Xn}function Mn(e,t,r){(e===pt&&(it===2||it===9)||e.cancelPendingCommit!==null)&&(El(e,0),Gr(e,Ye,Xn,!1)),Nt(e,r),((tt&2)===0||e!==pt)&&(e===pt&&((tt&2)===0&&(Ds|=r),kt===4&&Gr(e,Ye,Xn,!1)),ka(e))}function Yx(e,t,r){if((tt&6)!==0)throw Error(o(327));var i=!r&&(t&127)===0&&(t&e.expiredLanes)===0||Re(e,t),d=i?AC(e,t):Bf(e,t,!0),m=i;do{if(d===0){Sl&&!i&&Gr(e,t,0,!1);break}else{if(r=e.current.alternate,m&&!RC(r)){d=Bf(e,t,!1),m=!1;continue}if(d===2){if(m=t,e.errorRecoveryDisabledLanes&m)var j=0;else j=e.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){t=j;e:{var T=e;d=Po;var I=T.current.memoizedState.isDehydrated;if(I&&(El(T,j).flags|=256),j=Bf(T,j,!1),j!==2){if(kf&&!I){T.errorRecoveryDisabledLanes|=m,Ds|=m,d=4;break e}m=An,An=d,m!==null&&(An===null?An=m:An.push.apply(An,m))}d=j}if(m=!1,d!==2)continue}}if(d===1){El(e,0),Gr(e,t,0,!0);break}e:{switch(i=e,m=d,m){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Gr(i,t,Xn,!qr);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(d=xc+300-Ct(),10<d)){if(Gr(i,t,Xn,!qr),It(i,0,!0)!==0)break e;ur=t,i.timeoutHandle=jy(Gx.bind(null,i,r,An,bc,zf,t,Xn,Ds,Cl,qr,m,"Throttled",-0,0),d);break e}Gx(i,r,An,bc,zf,t,Xn,Ds,Cl,qr,m,null,-0,0)}}break}while(!0);ka(e)}function Gx(e,t,r,i,d,m,j,T,I,K,ne,le,Q,W){if(e.timeoutHandle=-1,le=t.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ka},Ix(t,m,le);var we=(m&62914560)===m?xc-Ct():(m&4194048)===m?qx-Ct():0;if(we=d2(le,we),we!==null){ur=m,e.cancelPendingCommit=we(ey.bind(null,e,t,m,r,i,d,j,T,I,ne,le,null,Q,W)),Gr(e,m,j,!K);return}}ey(e,t,m,r,i,d,j,T,I)}function RC(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var i=0;i<r.length;i++){var d=r[i],m=d.getSnapshot;d=d.value;try{if(!$n(m(),d))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Gr(e,t,r,i){t&=~_f,t&=~Ds,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var d=t;0<d;){var m=31-Tt(d),j=1<<m;i[m]=-1,d&=~j}r!==0&&Yt(e,r,t)}function wc(){return(tt&6)===0?(Ho(0),!1):!0}function Pf(){if($e!==null){if(it===0)var e=$e.return;else e=$e,Wa=js=null,ef(e),gl=null,So=0,e=$e;for(;e!==null;)Sx(e.alternate,e),e=e.return;$e=null}}function El(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,FC(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),ur=0,Pf(),pt=e,$e=r=Za(e.current,null),Ye=t,it=0,Fn=null,qr=!1,Sl=Re(e,t),kf=!1,Cl=Xn=_f=Ds=$r=kt=0,An=Po=null,zf=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var d=31-Tt(i),m=1<<d;t|=e[d],i&=~m}return cr=t,qi(),r}function Fx(e,t){ze=null,k.H=Do,t===pl||t===Qi?(t=cv(),it=3):t===qd?(t=cv(),it=4):it=t===vf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Fn=t,$e===null&&(kt=1,uc(e,ra(t,e.current)))}function Xx(){var e=Yn.current;return e===null?!0:(Ye&4194048)===Ye?ia===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===ia:!1}function Kx(){var e=k.H;return k.H=Do,e===null?Do:e}function Qx(){var e=k.A;return k.A=NC,e}function jc(){kt=4,qr||(Ye&4194048)!==Ye&&Yn.current!==null||(Sl=!0),($r&134217727)===0&&(Ds&134217727)===0||pt===null||Gr(pt,Ye,Xn,!1)}function Bf(e,t,r){var i=tt;tt|=2;var d=Kx(),m=Qx();(pt!==e||Ye!==t)&&(bc=null,El(e,t)),t=!1;var j=kt;e:do try{if(it!==0&&$e!==null){var T=$e,I=Fn;switch(it){case 8:Pf(),j=6;break e;case 3:case 2:case 9:case 6:Yn.current===null&&(t=!0);var K=it;if(it=0,Fn=null,Rl(e,T,I,K),r&&Sl){j=0;break e}break;default:K=it,it=0,Fn=null,Rl(e,T,I,K)}}TC(),j=kt;break}catch(ne){Fx(e,ne)}while(!0);return t&&e.shellSuspendCounter++,Wa=js=null,tt=i,k.H=d,k.A=m,$e===null&&(pt=null,Ye=0,qi()),j}function TC(){for(;$e!==null;)Zx($e)}function AC(e,t){var r=tt;tt|=2;var i=Kx(),d=Qx();pt!==e||Ye!==t?(bc=null,yc=Ct()+500,El(e,t)):Sl=Re(e,t);e:do try{if(it!==0&&$e!==null){t=$e;var m=Fn;t:switch(it){case 1:it=0,Fn=null,Rl(e,t,m,1);break;case 2:case 9:if(ov(m)){it=0,Fn=null,Jx(t);break}t=function(){it!==2&&it!==9||pt!==e||(it=7),ka(e)},m.then(t,t);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:ov(m)?(it=0,Fn=null,Jx(t)):(it=0,Fn=null,Rl(e,t,m,7));break;case 5:var j=null;switch($e.tag){case 26:j=$e.memoizedState;case 5:case 27:var T=$e;if(j?Uy(j):T.stateNode.complete){it=0,Fn=null;var I=T.sibling;if(I!==null)$e=I;else{var K=T.return;K!==null?($e=K,Sc(K)):$e=null}break t}}it=0,Fn=null,Rl(e,t,m,5);break;case 6:it=0,Fn=null,Rl(e,t,m,6);break;case 8:Pf(),kt=6;break e;default:throw Error(o(462))}}MC();break}catch(ne){Fx(e,ne)}while(!0);return Wa=js=null,k.H=i,k.A=d,tt=r,$e!==null?0:(pt=null,Ye=0,qi(),kt)}function MC(){for(;$e!==null&&!mn();)Zx($e)}function Zx(e){var t=wx(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?Sc(e):$e=t}function Jx(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=px(r,t,t.pendingProps,t.type,void 0,Ye);break;case 11:t=px(r,t,t.pendingProps,t.type.render,t.ref,Ye);break;case 5:ef(t);default:Sx(r,t),t=$e=Qg(t,cr),t=wx(r,t,cr)}e.memoizedProps=e.pendingProps,t===null?Sc(e):$e=t}function Rl(e,t,r,i){Wa=js=null,ef(t),gl=null,So=0;var d=t.return;try{if(xC(e,d,t,r,Ye)){kt=1,uc(e,ra(r,e.current)),$e=null;return}}catch(m){if(d!==null)throw $e=d,m;kt=1,uc(e,ra(r,e.current)),$e=null;return}t.flags&32768?(Xe||i===1?e=!0:Sl||(Ye&536870912)!==0?e=!1:(qr=e=!0,(i===2||i===9||i===3||i===6)&&(i=Yn.current,i!==null&&i.tag===13&&(i.flags|=16384))),Wx(t,e)):Sc(t)}function Sc(e){var t=e;do{if((t.flags&32768)!==0){Wx(t,qr);return}e=t.return;var r=wC(t.alternate,t,cr);if(r!==null){$e=r;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);kt===0&&(kt=5)}function Wx(e,t){do{var r=jC(e.alternate,e);if(r!==null){r.flags&=32767,$e=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=r}while(e!==null);kt=6,$e=null}function ey(e,t,r,i,d,m,j,T,I){e.cancelPendingCommit=null;do Cc();while(Gt!==0);if((tt&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(m=t.lanes|t.childLanes,m|=Rd,ut(e,r,m,j,T,I),e===pt&&($e=pt=null,Ye=0),Nl=t,Yr=e,ur=r,Lf=m,Uf=d,$x=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,_C(pn,function(){return sy(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=k.T,k.T=null,d=q.p,q.p=2,j=tt,tt|=4;try{SC(e,t,r)}finally{tt=j,q.p=d,k.T=i}}Gt=1,ty(),ny(),ay()}}function ty(){if(Gt===1){Gt=0;var e=Yr,t=Nl,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=k.T,k.T=null;var i=q.p;q.p=2;var d=tt;tt|=4;try{zx(t,e);var m=Jf,j=Hg(e.containerInfo),T=m.focusedElem,I=m.selectionRange;if(j!==T&&T&&T.ownerDocument&&Bg(T.ownerDocument.documentElement,T)){if(I!==null&&jd(T)){var K=I.start,ne=I.end;if(ne===void 0&&(ne=K),"selectionStart"in T)T.selectionStart=K,T.selectionEnd=Math.min(ne,T.value.length);else{var le=T.ownerDocument||document,Q=le&&le.defaultView||window;if(Q.getSelection){var W=Q.getSelection(),we=T.textContent.length,De=Math.min(I.start,we),ht=I.end===void 0?De:Math.min(I.end,we);!W.extend&&De>ht&&(j=ht,ht=De,De=j);var V=Pg(T,De),H=Pg(T,ht);if(V&&H&&(W.rangeCount!==1||W.anchorNode!==V.node||W.anchorOffset!==V.offset||W.focusNode!==H.node||W.focusOffset!==H.offset)){var X=le.createRange();X.setStart(V.node,V.offset),W.removeAllRanges(),De>ht?(W.addRange(X),W.extend(H.node,H.offset)):(X.setEnd(H.node,H.offset),W.addRange(X))}}}}for(le=[],W=T;W=W.parentNode;)W.nodeType===1&&le.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<le.length;T++){var re=le[T];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}Lc=!!Zf,Jf=Zf=null}finally{tt=d,q.p=i,k.T=r}}e.current=t,Gt=2}}function ny(){if(Gt===2){Gt=0;var e=Yr,t=Nl,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=k.T,k.T=null;var i=q.p;q.p=2;var d=tt;tt|=4;try{Mx(e,t.alternate,t)}finally{tt=d,q.p=i,k.T=r}}Gt=3}}function ay(){if(Gt===4||Gt===3){Gt=0,en();var e=Yr,t=Nl,r=ur,i=$x;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Gt=5:(Gt=0,Nl=Yr=null,ry(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Vr=null),Fa(r),t=t.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(ga,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=k.T,d=q.p,q.p=2,k.T=null;try{for(var m=e.onRecoverableError,j=0;j<i.length;j++){var T=i[j];m(T.value,{componentStack:T.stack})}}finally{k.T=t,q.p=d}}(ur&3)!==0&&Cc(),ka(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===If?Bo++:(Bo=0,If=e):Bo=0,Ho(0)}}function ry(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,wo(t)))}function Cc(){return ty(),ny(),ay(),sy()}function sy(){if(Gt!==5)return!1;var e=Yr,t=Lf;Lf=0;var r=Fa(ur),i=k.T,d=q.p;try{q.p=32>r?32:r,k.T=null,r=Uf,Uf=null;var m=Yr,j=ur;if(Gt=0,Nl=Yr=null,ur=0,(tt&6)!==0)throw Error(o(331));var T=tt;if(tt|=4,Bx(m.current),Ux(m,m.current,j,r),tt=T,Ho(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(ga,m)}catch{}return!0}finally{q.p=d,k.T=i,ry(e,t)}}function ly(e,t,r){t=ra(r,t),t=gf(e.stateNode,t,2),e=Ir(e,t,2),e!==null&&(Nt(e,2),ka(e))}function ct(e,t,r){if(e.tag===3)ly(e,e,r);else for(;t!==null;){if(t.tag===3){ly(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Vr===null||!Vr.has(i))){e=ra(r,e),r=ox(2),i=Ir(t,r,2),i!==null&&(ix(r,i,t,e),Nt(i,2),ka(i));break}}t=t.return}}function Hf(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new EC;var d=new Set;i.set(t,d)}else d=i.get(t),d===void 0&&(d=new Set,i.set(t,d));d.has(r)||(kf=!0,d.add(r),e=DC.bind(null,e,t,r),t.then(e,e))}function DC(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,pt===e&&(Ye&r)===r&&(kt===4||kt===3&&(Ye&62914560)===Ye&&300>Ct()-xc?(tt&2)===0&&El(e,0):_f|=r,Cl===Ye&&(Cl=0)),ka(e)}function oy(e,t){t===0&&(t=Ue()),e=ys(e,t),e!==null&&(Nt(e,t),ka(e))}function OC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),oy(e,r)}function kC(e,t){var r=0;switch(e.tag){case 31:case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(r=d.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(o(314))}i!==null&&i.delete(t),oy(e,r)}function _C(e,t){return St(e,t)}var Nc=null,Tl=null,qf=!1,Ec=!1,$f=!1,Fr=0;function ka(e){e!==Tl&&e.next===null&&(Tl===null?Nc=Tl=e:Tl=Tl.next=e),Ec=!0,qf||(qf=!0,LC())}function Ho(e,t){if(!$f&&Ec){$f=!0;do for(var r=!1,i=Nc;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var m=0;else{var j=i.suspendedLanes,T=i.pingedLanes;m=(1<<31-Tt(42|e)+1)-1,m&=d&~(j&~T),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(r=!0,dy(i,m))}else m=Ye,m=It(i,i===pt?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(m&3)===0||Re(i,m)||(r=!0,dy(i,m));i=i.next}while(r);$f=!1}}function zC(){iy()}function iy(){Ec=qf=!1;var e=0;Fr!==0&&GC()&&(e=Fr);for(var t=Ct(),r=null,i=Nc;i!==null;){var d=i.next,m=cy(i,t);m===0?(i.next=null,r===null?Nc=d:r.next=d,d===null&&(Tl=r)):(r=i,(e!==0||(m&3)!==0)&&(Ec=!0)),i=d}Gt!==0&&Gt!==5||Ho(e),Fr!==0&&(Fr=0)}function cy(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var j=31-Tt(m),T=1<<j,I=d[j];I===-1?((T&r)===0||(T&i)!==0)&&(d[j]=_e(T,t)):I<=t&&(e.expiredLanes|=T),m&=~T}if(t=pt,r=Ye,r=It(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,r===0||e===t&&(it===2||it===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Wt(i),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Re(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(i!==null&&Wt(i),Fa(r)){case 2:case 8:r=Mt;break;case 32:r=pn;break;case 268435456:r=Aa;break;default:r=pn}return i=uy.bind(null,e),r=St(r,i),e.callbackPriority=t,e.callbackNode=r,t}return i!==null&&i!==null&&Wt(i),e.callbackPriority=2,e.callbackNode=null,2}function uy(e,t){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Cc()&&e.callbackNode!==r)return null;var i=Ye;return i=It(e,e===pt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Yx(e,i,t),cy(e,Ct()),e.callbackNode!=null&&e.callbackNode===r?uy.bind(null,e):null)}function dy(e,t){if(Cc())return null;Yx(e,t,!0)}function LC(){XC(function(){(tt&6)!==0?St(At,zC):iy()})}function Vf(){if(Fr===0){var e=hl;e===0&&(e=Ya,Ya<<=1,(Ya&261888)===0&&(Ya=256)),Fr=e}return Fr}function fy(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_i(""+e)}function hy(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function UC(e,t,r,i,d){if(t==="submit"&&r&&r.stateNode===d){var m=fy((d[Cn]||null).action),j=i.submitter;j&&(t=(t=j[Cn]||null)?fy(t.formAction):j.getAttribute("formAction"),t!==null&&(m=t,j=null));var T=new Ii("action","action",null,i,d);e.push({event:T,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Fr!==0){var I=j?hy(d,j):new FormData(d);uf(r,{pending:!0,data:I,method:d.method,action:m},null,I)}}else typeof m=="function"&&(T.preventDefault(),I=j?hy(d,j):new FormData(d),uf(r,{pending:!0,data:I,method:d.method,action:m},m,I))},currentTarget:d}]})}}for(var Yf=0;Yf<Ed.length;Yf++){var Gf=Ed[Yf],IC=Gf.toLowerCase(),PC=Gf[0].toUpperCase()+Gf.slice(1);xa(IC,"on"+PC)}xa(Vg,"onAnimationEnd"),xa(Yg,"onAnimationIteration"),xa(Gg,"onAnimationStart"),xa("dblclick","onDoubleClick"),xa("focusin","onFocus"),xa("focusout","onBlur"),xa(tC,"onTransitionRun"),xa(nC,"onTransitionStart"),xa(aC,"onTransitionCancel"),xa(Fg,"onTransitionEnd"),Ws("onMouseEnter",["mouseout","mouseover"]),Ws("onMouseLeave",["mouseout","mouseover"]),Ws("onPointerEnter",["pointerout","pointerover"]),Ws("onPointerLeave",["pointerout","pointerover"]),ps("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ps("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ps("onBeforeInput",["compositionend","keypress","textInput","paste"]),ps("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ps("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ps("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),BC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qo));function my(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],d=i.event;i=i.listeners;e:{var m=void 0;if(t)for(var j=i.length-1;0<=j;j--){var T=i[j],I=T.instance,K=T.currentTarget;if(T=T.listener,I!==m&&d.isPropagationStopped())break e;m=T,d.currentTarget=K;try{m(d)}catch(ne){Hi(ne)}d.currentTarget=null,m=I}else for(j=0;j<i.length;j++){if(T=i[j],I=T.instance,K=T.currentTarget,T=T.listener,I!==m&&d.isPropagationStopped())break e;m=T,d.currentTarget=K;try{m(d)}catch(ne){Hi(ne)}d.currentTarget=null,m=I}}}}function Ve(e,t){var r=t[rd];r===void 0&&(r=t[rd]=new Set);var i=e+"__bubble";r.has(i)||(py(t,e,2,!1),r.add(i))}function Ff(e,t,r){var i=0;t&&(i|=4),py(r,e,i,t)}var Rc="_reactListening"+Math.random().toString(36).slice(2);function Xf(e){if(!e[Rc]){e[Rc]=!0,ig.forEach(function(r){r!=="selectionchange"&&(BC.has(r)||Ff(r,!1,e),Ff(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Rc]||(t[Rc]=!0,Ff("selectionchange",!1,t))}}function py(e,t,r,i){switch(Vy(t)){case 2:var d=m2;break;case 8:d=p2;break;default:d=ch}r=d.bind(null,t,r,e),d=void 0,!hd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),i?d!==void 0?e.addEventListener(t,r,{capture:!0,passive:d}):e.addEventListener(t,r,!0):d!==void 0?e.addEventListener(t,r,{passive:d}):e.addEventListener(t,r,!1)}function Kf(e,t,r,i,d){var m=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var j=i.tag;if(j===3||j===4){var T=i.stateNode.containerInfo;if(T===d)break;if(j===4)for(j=i.return;j!==null;){var I=j.tag;if((I===3||I===4)&&j.stateNode.containerInfo===d)return;j=j.return}for(;T!==null;){if(j=Qs(T),j===null)return;if(I=j.tag,I===5||I===6||I===26||I===27){i=m=j;continue e}T=T.parentNode}}i=i.return}bg(function(){var K=m,ne=dd(r),le=[];e:{var Q=Xg.get(e);if(Q!==void 0){var W=Ii,we=e;switch(e){case"keypress":if(Li(r)===0)break e;case"keydown":case"keyup":W=kS;break;case"focusin":we="focus",W=vd;break;case"focusout":we="blur",W=vd;break;case"beforeblur":case"afterblur":W=vd;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":W=Sg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=wS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=LS;break;case Vg:case Yg:case Gg:W=CS;break;case Fg:W=IS;break;case"scroll":case"scrollend":W=yS;break;case"wheel":W=BS;break;case"copy":case"cut":case"paste":W=ES;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=Ng;break;case"toggle":case"beforetoggle":W=qS}var De=(t&4)!==0,ht=!De&&(e==="scroll"||e==="scrollend"),V=De?Q!==null?Q+"Capture":null:Q;De=[];for(var H=K,X;H!==null;){var re=H;if(X=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||X===null||V===null||(re=co(H,V),re!=null&&De.push($o(H,re,X))),ht)break;H=H.return}0<De.length&&(Q=new W(Q,we,null,r,ne),le.push({event:Q,listeners:De}))}}if((t&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",W=e==="mouseout"||e==="pointerout",Q&&r!==ud&&(we=r.relatedTarget||r.fromElement)&&(Qs(we)||we[Ks]))break e;if((W||Q)&&(Q=ne.window===ne?ne:(Q=ne.ownerDocument)?Q.defaultView||Q.parentWindow:window,W?(we=r.relatedTarget||r.toElement,W=K,we=we?Qs(we):null,we!==null&&(ht=u(we),De=we.tag,we!==ht||De!==5&&De!==27&&De!==6)&&(we=null)):(W=null,we=K),W!==we)){if(De=Sg,re="onMouseLeave",V="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(De=Ng,re="onPointerLeave",V="onPointerEnter",H="pointer"),ht=W==null?Q:io(W),X=we==null?Q:io(we),Q=new De(re,H+"leave",W,r,ne),Q.target=ht,Q.relatedTarget=X,re=null,Qs(ne)===K&&(De=new De(V,H+"enter",we,r,ne),De.target=X,De.relatedTarget=ht,re=De),ht=re,W&&we)t:{for(De=HC,V=W,H=we,X=0,re=V;re;re=De(re))X++;re=0;for(var Te=H;Te;Te=De(Te))re++;for(;0<X-re;)V=De(V),X--;for(;0<re-X;)H=De(H),re--;for(;X--;){if(V===H||H!==null&&V===H.alternate){De=V;break t}V=De(V),H=De(H)}De=null}else De=null;W!==null&&gy(le,Q,W,De,!1),we!==null&&ht!==null&&gy(le,ht,we,De,!0)}}e:{if(Q=K?io(K):window,W=Q.nodeName&&Q.nodeName.toLowerCase(),W==="select"||W==="input"&&Q.type==="file")var Ze=kg;else if(Dg(Q))if(_g)Ze=JS;else{Ze=QS;var je=KS}else W=Q.nodeName,!W||W.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?K&&cd(K.elementType)&&(Ze=kg):Ze=ZS;if(Ze&&(Ze=Ze(e,K))){Og(le,Ze,r,ne);break e}je&&je(e,Q,K),e==="focusout"&&K&&Q.type==="number"&&K.memoizedProps.value!=null&&id(Q,"number",Q.value)}switch(je=K?io(K):window,e){case"focusin":(Dg(je)||je.contentEditable==="true")&&(sl=je,Sd=K,xo=null);break;case"focusout":xo=Sd=sl=null;break;case"mousedown":Cd=!0;break;case"contextmenu":case"mouseup":case"dragend":Cd=!1,qg(le,r,ne);break;case"selectionchange":if(eC)break;case"keydown":case"keyup":qg(le,r,ne)}var Ie;if(yd)e:{switch(e){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else rl?Ag(e,r)&&(Ge="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ge="onCompositionStart");Ge&&(Eg&&r.locale!=="ko"&&(rl||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&rl&&(Ie=wg()):(Dr=ne,md="value"in Dr?Dr.value:Dr.textContent,rl=!0)),je=Tc(K,Ge),0<je.length&&(Ge=new Cg(Ge,e,null,r,ne),le.push({event:Ge,listeners:je}),Ie?Ge.data=Ie:(Ie=Mg(r),Ie!==null&&(Ge.data=Ie)))),(Ie=VS?YS(e,r):GS(e,r))&&(Ge=Tc(K,"onBeforeInput"),0<Ge.length&&(je=new Cg("onBeforeInput","beforeinput",null,r,ne),le.push({event:je,listeners:Ge}),je.data=Ie)),UC(le,e,K,r,ne)}my(le,t)})}function $o(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Tc(e,t){for(var r=t+"Capture",i=[];e!==null;){var d=e,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=co(e,r),d!=null&&i.unshift($o(e,d,m)),d=co(e,t),d!=null&&i.push($o(e,d,m))),e.tag===3)return i;e=e.return}return[]}function HC(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gy(e,t,r,i,d){for(var m=t._reactName,j=[];r!==null&&r!==i;){var T=r,I=T.alternate,K=T.stateNode;if(T=T.tag,I!==null&&I===i)break;T!==5&&T!==26&&T!==27||K===null||(I=K,d?(K=co(r,m),K!=null&&j.unshift($o(r,K,I))):d||(K=co(r,m),K!=null&&j.push($o(r,K,I)))),r=r.return}j.length!==0&&e.push({event:t,listeners:j})}var qC=/\r\n?/g,$C=/\u0000|\uFFFD/g;function vy(e){return(typeof e=="string"?e:""+e).replace(qC,`
|
|
49
|
-
`).replace($C,"")}function xy(e,t){return t=vy(t),vy(e)===t}function ft(e,t,r,i,d,m){switch(r){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||tl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&tl(e,""+i);break;case"className":Oi(e,"class",i);break;case"tabIndex":Oi(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Oi(e,r,i);break;case"style":xg(e,i,m);break;case"data":if(t!=="object"){Oi(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=_i(""+i),e.setAttribute(r,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(r==="formAction"?(t!=="input"&&ft(e,t,"name",d.name,d,null),ft(e,t,"formEncType",d.formEncType,d,null),ft(e,t,"formMethod",d.formMethod,d,null),ft(e,t,"formTarget",d.formTarget,d,null)):(ft(e,t,"encType",d.encType,d,null),ft(e,t,"method",d.method,d,null),ft(e,t,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=_i(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=Ka);break;case"onScroll":i!=null&&Ve("scroll",e);break;case"onScrollEnd":i!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}r=_i(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""+i):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":i===!0?e.setAttribute(r,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,i):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(r,i):e.removeAttribute(r);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(r):e.setAttribute(r,i);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),Di(e,"popover",i);break;case"xlinkActuate":Xa(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Xa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Xa(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Xa(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Xa(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Xa(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Di(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=vS.get(r)||r,Di(e,r,i))}}function Qf(e,t,r,i,d,m){switch(r){case"style":xg(e,i,m);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"children":typeof i=="string"?tl(e,i):(typeof i=="number"||typeof i=="bigint")&&tl(e,""+i);break;case"onScroll":i!=null&&Ve("scroll",e);break;case"onScrollEnd":i!=null&&Ve("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Ka);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!cg.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),t=r.slice(2,d?r.length-7:void 0),m=e[Cn]||null,m=m!=null?m[r]:null,typeof m=="function"&&e.removeEventListener(t,m,d),typeof i=="function")){typeof m!="function"&&m!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,i,d);break e}r in e?e[r]=i:i===!0?e.setAttribute(r,""):Di(e,r,i)}}}function fn(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var i=!1,d=!1,m;for(m in r)if(r.hasOwnProperty(m)){var j=r[m];if(j!=null)switch(m){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ft(e,t,m,j,r,null)}}d&&ft(e,t,"srcSet",r.srcSet,r,null),i&&ft(e,t,"src",r.src,r,null);return;case"input":Ve("invalid",e);var T=m=j=d=null,I=null,K=null;for(i in r)if(r.hasOwnProperty(i)){var ne=r[i];if(ne!=null)switch(i){case"name":d=ne;break;case"type":j=ne;break;case"checked":I=ne;break;case"defaultChecked":K=ne;break;case"value":m=ne;break;case"defaultValue":T=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,t));break;default:ft(e,t,i,ne,r,null)}}mg(e,m,T,I,K,j,d,!1);return;case"select":Ve("invalid",e),i=j=m=null;for(d in r)if(r.hasOwnProperty(d)&&(T=r[d],T!=null))switch(d){case"value":m=T;break;case"defaultValue":j=T;break;case"multiple":i=T;default:ft(e,t,d,T,r,null)}t=m,r=j,e.multiple=!!i,t!=null?el(e,!!i,t,!1):r!=null&&el(e,!!i,r,!0);return;case"textarea":Ve("invalid",e),m=d=i=null;for(j in r)if(r.hasOwnProperty(j)&&(T=r[j],T!=null))switch(j){case"value":i=T;break;case"defaultValue":d=T;break;case"children":m=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(91));break;default:ft(e,t,j,T,r,null)}gg(e,i,d,m);return;case"option":for(I in r)if(r.hasOwnProperty(I)&&(i=r[I],i!=null))switch(I){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:ft(e,t,I,i,r,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(i=0;i<qo.length;i++)Ve(qo[i],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in r)if(r.hasOwnProperty(K)&&(i=r[K],i!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ft(e,t,K,i,r,null)}return;default:if(cd(t)){for(ne in r)r.hasOwnProperty(ne)&&(i=r[ne],i!==void 0&&Qf(e,t,ne,i,r,void 0));return}}for(T in r)r.hasOwnProperty(T)&&(i=r[T],i!=null&&ft(e,t,T,i,r,null))}function VC(e,t,r,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,j=null,T=null,I=null,K=null,ne=null;for(W in r){var le=r[W];if(r.hasOwnProperty(W)&&le!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":I=le;default:i.hasOwnProperty(W)||ft(e,t,W,null,i,le)}}for(var Q in i){var W=i[Q];if(le=r[Q],i.hasOwnProperty(Q)&&(W!=null||le!=null))switch(Q){case"type":m=W;break;case"name":d=W;break;case"checked":K=W;break;case"defaultChecked":ne=W;break;case"value":j=W;break;case"defaultValue":T=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(o(137,t));break;default:W!==le&&ft(e,t,Q,W,i,le)}}od(e,j,T,I,K,ne,m,d);return;case"select":W=j=T=Q=null;for(m in r)if(I=r[m],r.hasOwnProperty(m)&&I!=null)switch(m){case"value":break;case"multiple":W=I;default:i.hasOwnProperty(m)||ft(e,t,m,null,i,I)}for(d in i)if(m=i[d],I=r[d],i.hasOwnProperty(d)&&(m!=null||I!=null))switch(d){case"value":Q=m;break;case"defaultValue":T=m;break;case"multiple":j=m;default:m!==I&&ft(e,t,d,m,i,I)}t=T,r=j,i=W,Q!=null?el(e,!!r,Q,!1):!!i!=!!r&&(t!=null?el(e,!!r,t,!0):el(e,!!r,r?[]:"",!1));return;case"textarea":W=Q=null;for(T in r)if(d=r[T],r.hasOwnProperty(T)&&d!=null&&!i.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:ft(e,t,T,null,i,d)}for(j in i)if(d=i[j],m=r[j],i.hasOwnProperty(j)&&(d!=null||m!=null))switch(j){case"value":Q=d;break;case"defaultValue":W=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==m&&ft(e,t,j,d,i,m)}pg(e,Q,W);return;case"option":for(var we in r)if(Q=r[we],r.hasOwnProperty(we)&&Q!=null&&!i.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:ft(e,t,we,null,i,Q)}for(I in i)if(Q=i[I],W=r[I],i.hasOwnProperty(I)&&Q!==W&&(Q!=null||W!=null))switch(I){case"selected":e.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:ft(e,t,I,Q,i,W)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var De in r)Q=r[De],r.hasOwnProperty(De)&&Q!=null&&!i.hasOwnProperty(De)&&ft(e,t,De,null,i,Q);for(K in i)if(Q=i[K],W=r[K],i.hasOwnProperty(K)&&Q!==W&&(Q!=null||W!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(o(137,t));break;default:ft(e,t,K,Q,i,W)}return;default:if(cd(t)){for(var ht in r)Q=r[ht],r.hasOwnProperty(ht)&&Q!==void 0&&!i.hasOwnProperty(ht)&&Qf(e,t,ht,void 0,i,Q);for(ne in i)Q=i[ne],W=r[ne],!i.hasOwnProperty(ne)||Q===W||Q===void 0&&W===void 0||Qf(e,t,ne,Q,i,W);return}}for(var V in r)Q=r[V],r.hasOwnProperty(V)&&Q!=null&&!i.hasOwnProperty(V)&&ft(e,t,V,null,i,Q);for(le in i)Q=i[le],W=r[le],!i.hasOwnProperty(le)||Q===W||Q==null&&W==null||ft(e,t,le,Q,i,W)}function yy(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function YC(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,r=performance.getEntriesByType("resource"),i=0;i<r.length;i++){var d=r[i],m=d.transferSize,j=d.initiatorType,T=d.duration;if(m&&T&&yy(j)){for(j=0,T=d.responseEnd,i+=1;i<r.length;i++){var I=r[i],K=I.startTime;if(K>T)break;var ne=I.transferSize,le=I.initiatorType;ne&&yy(le)&&(I=I.responseEnd,j+=ne*(I<T?1:(T-K)/(I-K)))}if(--i,t+=8*(m+j)/(d.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Zf=null,Jf=null;function Ac(e){return e.nodeType===9?e:e.ownerDocument}function by(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function wy(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Wf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var eh=null;function GC(){var e=window.event;return e&&e.type==="popstate"?e===eh?!1:(eh=e,!0):(eh=null,!1)}var jy=typeof setTimeout=="function"?setTimeout:void 0,FC=typeof clearTimeout=="function"?clearTimeout:void 0,Sy=typeof Promise=="function"?Promise:void 0,XC=typeof queueMicrotask=="function"?queueMicrotask:typeof Sy<"u"?function(e){return Sy.resolve(null).then(e).catch(KC)}:jy;function KC(e){setTimeout(function(){throw e})}function Xr(e){return e==="head"}function Cy(e,t){var r=t,i=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(i===0){e.removeChild(d),Ol(t);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")Vo(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Vo(r);for(var m=r.firstChild;m;){var j=m.nextSibling,T=m.nodeName;m[oo]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&m.rel.toLowerCase()==="stylesheet"||r.removeChild(m),m=j}}else r==="body"&&Vo(e.ownerDocument.body);r=d}while(r);Ol(t)}function Ny(e,t){var r=e;e=0;do{var i=r.nextSibling;if(r.nodeType===1?t?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(t?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=i}while(r)}function th(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":th(r),sd(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function QC(e,t,r,i){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[oo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=ca(e.nextSibling),e===null)break}return null}function ZC(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=ca(e.nextSibling),e===null))return null;return e}function Ey(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ca(e.nextSibling),e===null))return null;return e}function nh(e){return e.data==="$?"||e.data==="$~"}function ah(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function JC(e,t){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||r.readyState!=="loading")t();else{var i=function(){t(),r.removeEventListener("DOMContentLoaded",i)};r.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function ca(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var rh=null;function Ry(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return ca(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function Ty(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(t===0)return e;t--}else r!=="/$"&&r!=="/&"||t++}e=e.previousSibling}return null}function Ay(e,t,r){switch(t=Ac(r),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Vo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);sd(e)}var ua=new Map,My=new Set;function Mc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var dr=q.d;q.d={f:WC,r:e2,D:t2,C:n2,L:a2,m:r2,X:l2,S:s2,M:o2};function WC(){var e=dr.f(),t=wc();return e||t}function e2(e){var t=Zs(e);t!==null&&t.tag===5&&t.type==="form"?Fv(t):dr.r(e)}var Al=typeof document>"u"?null:document;function Dy(e,t,r){var i=Al;if(i&&typeof t=="string"&&t){var d=na(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),My.has(d)||(My.add(d),e={rel:e,crossOrigin:r,href:t},i.querySelector(d)===null&&(t=i.createElement("link"),fn(t,"link",e),tn(t),i.head.appendChild(t)))}}function t2(e){dr.D(e),Dy("dns-prefetch",e,null)}function n2(e,t){dr.C(e,t),Dy("preconnect",e,t)}function a2(e,t,r){dr.L(e,t,r);var i=Al;if(i&&e&&t){var d='link[rel="preload"][as="'+na(t)+'"]';t==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+na(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+na(r.imageSizes)+'"]')):d+='[href="'+na(e)+'"]';var m=d;switch(t){case"style":m=Ml(e);break;case"script":m=Dl(e)}ua.has(m)||(e=y({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),ua.set(m,e),i.querySelector(d)!==null||t==="style"&&i.querySelector(Yo(m))||t==="script"&&i.querySelector(Go(m))||(t=i.createElement("link"),fn(t,"link",e),tn(t),i.head.appendChild(t)))}}function r2(e,t){dr.m(e,t);var r=Al;if(r&&e){var i=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+na(i)+'"][href="'+na(e)+'"]',m=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Dl(e)}if(!ua.has(m)&&(e=y({rel:"modulepreload",href:e},t),ua.set(m,e),r.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Go(m)))return}i=r.createElement("link"),fn(i,"link",e),tn(i),r.head.appendChild(i)}}}function s2(e,t,r){dr.S(e,t,r);var i=Al;if(i&&e){var d=Js(i).hoistableStyles,m=Ml(e);t=t||"default";var j=d.get(m);if(!j){var T={loading:0,preload:null};if(j=i.querySelector(Yo(m)))T.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},r),(r=ua.get(m))&&sh(e,r);var I=j=i.createElement("link");tn(I),fn(I,"link",e),I._p=new Promise(function(K,ne){I.onload=K,I.onerror=ne}),I.addEventListener("load",function(){T.loading|=1}),I.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Dc(j,t,i)}j={type:"stylesheet",instance:j,count:1,state:T},d.set(m,j)}}}function l2(e,t){dr.X(e,t);var r=Al;if(r&&e){var i=Js(r).hoistableScripts,d=Dl(e),m=i.get(d);m||(m=r.querySelector(Go(d)),m||(e=y({src:e,async:!0},t),(t=ua.get(d))&&lh(e,t),m=r.createElement("script"),tn(m),fn(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function o2(e,t){dr.M(e,t);var r=Al;if(r&&e){var i=Js(r).hoistableScripts,d=Dl(e),m=i.get(d);m||(m=r.querySelector(Go(d)),m||(e=y({src:e,async:!0,type:"module"},t),(t=ua.get(d))&&lh(e,t),m=r.createElement("script"),tn(m),fn(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function Oy(e,t,r,i){var d=(d=ye.current)?Mc(d):null;if(!d)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=Ml(r.href),r=Js(d).hoistableStyles,i=r.get(t),i||(i={type:"style",instance:null,count:0,state:null},r.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Ml(r.href);var m=Js(d).hoistableStyles,j=m.get(e);if(j||(d=d.ownerDocument||d,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,j),(m=d.querySelector(Yo(e)))&&!m._p&&(j.instance=m,j.state.loading=5),ua.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},ua.set(e,r),m||i2(d,e,r,j.state))),t&&i===null)throw Error(o(528,""));return j}if(t&&i!==null)throw Error(o(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Dl(r),r=Js(d).hoistableScripts,i=r.get(t),i||(i={type:"script",instance:null,count:0,state:null},r.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ml(e){return'href="'+na(e)+'"'}function Yo(e){return'link[rel="stylesheet"]['+e+"]"}function ky(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function i2(e,t,r,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),fn(t,"link",r),tn(t),e.head.appendChild(t))}function Dl(e){return'[src="'+na(e)+'"]'}function Go(e){return"script[async]"+e}function _y(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+na(r.href)+'"]');if(i)return t.instance=i,tn(i),i;var d=y({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),tn(i),fn(i,"style",d),Dc(i,r.precedence,e),t.instance=i;case"stylesheet":d=Ml(r.href);var m=e.querySelector(Yo(d));if(m)return t.state.loading|=4,t.instance=m,tn(m),m;i=ky(r),(d=ua.get(d))&&sh(i,d),m=(e.ownerDocument||e).createElement("link"),tn(m);var j=m;return j._p=new Promise(function(T,I){j.onload=T,j.onerror=I}),fn(m,"link",i),t.state.loading|=4,Dc(m,r.precedence,e),t.instance=m;case"script":return m=Dl(r.src),(d=e.querySelector(Go(m)))?(t.instance=d,tn(d),d):(i=r,(d=ua.get(m))&&(i=y({},r),lh(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),tn(d),fn(d,"link",i),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Dc(i,r.precedence,e));return t.instance}function Dc(e,t,r){for(var i=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,m=d,j=0;j<i.length;j++){var T=i[j];if(T.dataset.precedence===t)m=T;else if(m!==d)break}m?m.parentNode.insertBefore(e,m.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function sh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function lh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Oc=null;function zy(e,t,r){if(Oc===null){var i=new Map,d=Oc=new Map;d.set(r,i)}else d=Oc,i=d.get(r),i||(i=new Map,d.set(r,i));if(i.has(e))return i;for(i.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var m=r[d];if(!(m[oo]||m[on]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var j=m.getAttribute(t)||"";j=e+j;var T=i.get(j);T?T.push(m):i.set(j,[m])}}return i}function Ly(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function c2(e,t,r){if(r===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Uy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function u2(e,t,r,i){if(r.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=Ml(i.href),m=t.querySelector(Yo(d));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=kc.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=m,tn(m);return}m=t.ownerDocument||t,i=ky(i),(d=ua.get(d))&&sh(i,d),m=m.createElement("link"),tn(m);var j=m;j._p=new Promise(function(T,I){j.onload=T,j.onerror=I}),fn(m,"link",i),r.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=kc.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var oh=0;function d2(e,t){return e.stylesheets&&e.count===0&&zc(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&zc(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*YC());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&zc(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function kc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _c=null;function zc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_c=new Map,t.forEach(f2,e),_c=null,kc.call(e))}function f2(e,t){if(!(t.state.loading&4)){var r=_c.get(e);if(r)var i=r.get(null);else{r=new Map,_c.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var j=d[m];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(r.set(j.dataset.precedence,j),i=j)}i&&r.set(null,i)}d=t.instance,j=d.getAttribute("data-precedence"),m=r.get(j)||i,m===i&&r.set(null,d),r.set(j,d),this.count++,i=kc.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),m?m.parentNode.insertBefore(d,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Fo={$$typeof:A,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function h2(e,t,r,i,d,m,j,T,I){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function Iy(e,t,r,i,d,m,j,T,I,K,ne,le){return e=new h2(e,t,r,j,I,K,ne,le,T),t=1,m===!0&&(t|=24),m=Vn(3,null,null,t),e.current=m,m.stateNode=e,t=Pd(),t.refCount++,e.pooledCache=t,t.refCount++,m.memoizedState={element:i,isDehydrated:r,cache:t},$d(m),e}function Py(e){return e?(e=il,e):il}function By(e,t,r,i,d,m){d=Py(d),i.context===null?i.context=d:i.pendingContext=d,i=Ur(t),i.payload={element:r},m=m===void 0?null:m,m!==null&&(i.callback=m),r=Ir(e,i,t),r!==null&&(Mn(r,e,t),No(r,e,t))}function Hy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ih(e,t){Hy(e,t),(e=e.alternate)&&Hy(e,t)}function qy(e){if(e.tag===13||e.tag===31){var t=ys(e,67108864);t!==null&&Mn(t,e,67108864),ih(e,67108864)}}function $y(e){if(e.tag===13||e.tag===31){var t=Kn();t=Ga(t);var r=ys(e,t);r!==null&&Mn(r,e,t),ih(e,t)}}var Lc=!0;function m2(e,t,r,i){var d=k.T;k.T=null;var m=q.p;try{q.p=2,ch(e,t,r,i)}finally{q.p=m,k.T=d}}function p2(e,t,r,i){var d=k.T;k.T=null;var m=q.p;try{q.p=8,ch(e,t,r,i)}finally{q.p=m,k.T=d}}function ch(e,t,r,i){if(Lc){var d=uh(i);if(d===null)Kf(e,t,i,Uc,r),Yy(e,i);else if(v2(d,e,t,r,i))i.stopPropagation();else if(Yy(e,i),t&4&&-1<g2.indexOf(e)){for(;d!==null;){var m=Zs(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var j=at(m.pendingLanes);if(j!==0){var T=m;for(T.pendingLanes|=2,T.entangledLanes|=2;j;){var I=1<<31-Tt(j);T.entanglements[1]|=I,j&=~I}ka(m),(tt&6)===0&&(yc=Ct()+500,Ho(0))}}break;case 31:case 13:T=ys(m,2),T!==null&&Mn(T,m,2),wc(),ih(m,2)}if(m=uh(i),m===null&&Kf(e,t,i,Uc,r),m===d)break;d=m}d!==null&&i.stopPropagation()}else Kf(e,t,i,null,r)}}function uh(e){return e=dd(e),dh(e)}var Uc=null;function dh(e){if(Uc=null,e=Qs(e),e!==null){var t=u(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=f(t),e!==null)return e;e=null}else if(r===31){if(e=p(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Uc=e,null}function Vy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(xn()){case At:return 2;case Mt:return 8;case pn:case pa:return 32;case Aa:return 268435456;default:return 32}default:return 32}}var fh=!1,Kr=null,Qr=null,Zr=null,Xo=new Map,Ko=new Map,Jr=[],g2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Yy(e,t){switch(e){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Qr=null;break;case"mouseover":case"mouseout":Zr=null;break;case"pointerover":case"pointerout":Xo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ko.delete(t.pointerId)}}function Qo(e,t,r,i,d,m){return e===null||e.nativeEvent!==m?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:m,targetContainers:[d]},t!==null&&(t=Zs(t),t!==null&&qy(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function v2(e,t,r,i,d){switch(t){case"focusin":return Kr=Qo(Kr,e,t,r,i,d),!0;case"dragenter":return Qr=Qo(Qr,e,t,r,i,d),!0;case"mouseover":return Zr=Qo(Zr,e,t,r,i,d),!0;case"pointerover":var m=d.pointerId;return Xo.set(m,Qo(Xo.get(m)||null,e,t,r,i,d)),!0;case"gotpointercapture":return m=d.pointerId,Ko.set(m,Qo(Ko.get(m)||null,e,t,r,i,d)),!0}return!1}function Gy(e){var t=Qs(e.target);if(t!==null){var r=u(t);if(r!==null){if(t=r.tag,t===13){if(t=f(r),t!==null){e.blockedOn=t,Mr(e.priority,function(){$y(r)});return}}else if(t===31){if(t=p(r),t!==null){e.blockedOn=t,Mr(e.priority,function(){$y(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ic(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=uh(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);ud=i,r.target.dispatchEvent(i),ud=null}else return t=Zs(r),t!==null&&qy(t),e.blockedOn=r,!1;t.shift()}return!0}function Fy(e,t,r){Ic(e)&&r.delete(t)}function x2(){fh=!1,Kr!==null&&Ic(Kr)&&(Kr=null),Qr!==null&&Ic(Qr)&&(Qr=null),Zr!==null&&Ic(Zr)&&(Zr=null),Xo.forEach(Fy),Ko.forEach(Fy)}function Pc(e,t){e.blockedOn===t&&(e.blockedOn=null,fh||(fh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,x2)))}var Bc=null;function Xy(e){Bc!==e&&(Bc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Bc===e&&(Bc=null);for(var t=0;t<e.length;t+=3){var r=e[t],i=e[t+1],d=e[t+2];if(typeof i!="function"){if(dh(i||r)===null)continue;break}var m=Zs(r);m!==null&&(e.splice(t,3),t-=3,uf(m,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function Ol(e){function t(I){return Pc(I,e)}Kr!==null&&Pc(Kr,e),Qr!==null&&Pc(Qr,e),Zr!==null&&Pc(Zr,e),Xo.forEach(t),Ko.forEach(t);for(var r=0;r<Jr.length;r++){var i=Jr[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Jr.length&&(r=Jr[0],r.blockedOn===null);)Gy(r),r.blockedOn===null&&Jr.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(i=0;i<r.length;i+=3){var d=r[i],m=r[i+1],j=d[Cn]||null;if(typeof m=="function")j||Xy(r);else if(j){var T=null;if(m&&m.hasAttribute("formAction")){if(d=m,j=m[Cn]||null)T=j.formAction;else if(dh(d)!==null)continue}else T=j.action;typeof T=="function"?r[i+1]=T:(r.splice(i,3),i-=3),Xy(r)}}}function Ky(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(j){return d=j})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),i||setTimeout(r,20)}function r(){if(!i&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(r,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function hh(e){this._internalRoot=e}Hc.prototype.render=hh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var r=t.current,i=Kn();By(r,i,e,t,null,null)},Hc.prototype.unmount=hh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;By(e.current,2,null,e,null,null),wc(),t[Ks]=null}};function Hc(e){this._internalRoot=e}Hc.prototype.unstable_scheduleHydration=function(e){if(e){var t=va();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Jr.length&&t!==0&&t<Jr[r].priority;r++);Jr.splice(r,0,e),r===0&&Gy(e)}};var Qy=a.version;if(Qy!=="19.2.8")throw Error(o(527,Qy,"19.2.8"));q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var y2={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qc.isDisabled&&qc.supportsFiber)try{ga=qc.inject(y2),Dt=qc}catch{}}return Jo.createRoot=function(e,t){if(!c(e))throw Error(o(299));var r=!1,i="",d=ax,m=rx,j=sx;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(m=t.onCaughtError),t.onRecoverableError!==void 0&&(j=t.onRecoverableError)),t=Iy(e,1,!1,null,null,r,i,null,d,m,j,Ky),e[Ks]=t.current,Xf(e),new hh(t)},Jo.hydrateRoot=function(e,t,r){if(!c(e))throw Error(o(299));var i=!1,d="",m=ax,j=rx,T=sx,I=null;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(m=r.onUncaughtError),r.onCaughtError!==void 0&&(j=r.onCaughtError),r.onRecoverableError!==void 0&&(T=r.onRecoverableError),r.formState!==void 0&&(I=r.formState)),t=Iy(e,1,!0,t,r??null,i,d,I,m,j,T,Ky),t.context=Py(null),r=t.current,i=Kn(),i=Ga(i),d=Ur(i),d.callback=null,Ir(r,d,i),r=i,t.current.lanes=r,Nt(t,r),ka(t),e[Ks]=t.current,Xf(e),new Hc(t)},Jo.version="19.2.8",Jo}var cb;function A2(){if(cb)return vh.exports;cb=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),vh.exports=T2(),vh.exports}var M2=A2();const D2=Rm(M2);/**
|
|
50
|
-
* react-router v7.18.2
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var Am=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,v0=/^[\\/]{2}/;function O2(n,a){return a+n.replace(/\\/g,"/")}var ub="popstate";function db(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function k2(n={}){function a(o,c){var v;let u=(v=c.state)==null?void 0:v.masked,{pathname:f,search:p,hash:g}=u||o.location;return $h("",{pathname:f,search:p,hash:g},c.state&&c.state.usr||null,c.state&&c.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function s(o,c){return typeof c=="string"?c:si(c)}return z2(a,s,null,n)}function Rt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function ha(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function _2(){return Math.random().toString(36).substring(2,10)}function fb(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function $h(n,a,s=null,o,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Gl(a):a,state:s,key:a&&a.key||o||_2(),mask:c}}function si({pathname:n="/",search:a="",hash:s=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function Gl(n){let a={};if(n){let s=n.indexOf("#");s>=0&&(a.hash=n.substring(s),n=n.substring(0,s));let o=n.indexOf("?");o>=0&&(a.search=n.substring(o),n=n.substring(0,o)),n&&(a.pathname=n)}return a}function z2(n,a,s,o={}){let{window:c=document.defaultView,v5Compat:u=!1}=o,f=c.history,p="POP",g=null,v=x();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function x(){return(f.state||{idx:null}).idx}function y(){p="POP";let C=x(),R=C==null?null:C-v;v=C,g&&g({action:p,location:S.location,delta:R})}function b(C,R){p="PUSH";let D=db(C)?C:$h(S.location,C,R);v=x()+1;let A=fb(D,v),M=S.createHref(D.mask||D);try{f.pushState(A,"",M)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;c.location.assign(M)}u&&g&&g({action:p,location:S.location,delta:1})}function w(C,R){p="REPLACE";let D=db(C)?C:$h(S.location,C,R);v=x();let A=fb(D,v),M=S.createHref(D.mask||D);f.replaceState(A,"",M),u&&g&&g({action:p,location:S.location,delta:0})}function N(C){return L2(c,C)}let S={get action(){return p},get location(){return n(c,f)},listen(C){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(ub,y),g=C,()=>{c.removeEventListener(ub,y),g=null}},createHref(C){return a(c,C)},createURL:N,encodeLocation(C){let R=N(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:b,replace:w,go(C){return f.go(C)}};return S}function L2(n,a,s=!1){let o="http://localhost";n&&(o=n.location.origin!=="null"?n.location.origin:n.location.href),Rt(o,"No window.location.(origin|href) available to create URL");let c=typeof a=="string"?a:si(a);return c=c.replace(/ $/,"%20"),!s&&v0.test(c)&&(c=o+c),new URL(c,o)}function x0(n,a,s="/"){return U2(n,a,s,!1)}function U2(n,a,s,o,c){let u=typeof a=="string"?Gl(a):a,f=yr(u.pathname||"/",s);if(f==null)return null;let p=I2(n),g=null,v=K2(f);for(let x=0;g==null&&x<p.length;++x)g=X2(p[x],v,o);return g}function I2(n){let a=y0(n);return P2(a),a}function y0(n,a=[],s=[],o="",c=!1){let u=(f,p,g=c,v)=>{let x={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(o)&&g)return;Rt(x.relativePath.startsWith(o),`Absolute route path "${x.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(o.length)}let y=Ca([o,x.relativePath]),b=s.concat(x);f.children&&f.children.length>0&&(Rt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),y0(f.children,a,b,y,g)),!(f.path==null&&!f.index)&&a.push({path:y,score:G2(y,f.index),routesMeta:b.map((w,N)=>{let[S,C]=j0(w.relativePath,w.caseSensitive,N===b.length-1);return{...w,matcher:S,compiledParams:C}})})};return n.forEach((f,p)=>{var g;if(f.path===""||!((g=f.path)!=null&&g.includes("?")))u(f,p);else for(let v of b0(f.path))u(f,p,!0,v)}),a}function b0(n){let a=n.split("/");if(a.length===0)return[];let[s,...o]=a,c=s.endsWith("?"),u=s.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let f=b0(o.join("/")),p=[];return p.push(...f.map(g=>g===""?u:[u,g].join("/"))),c&&p.push(...f),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function P2(n){n.sort((a,s)=>a.score!==s.score?s.score-a.score:F2(a.routesMeta.map(o=>o.childrenIndex),s.routesMeta.map(o=>o.childrenIndex)))}var B2=/^:[\w-]+$/,H2=3,q2=2,$2=1,V2=10,Y2=-2,hb=n=>n==="*";function G2(n,a){let s=n.split("/"),o=s.length;return s.some(hb)&&(o+=Y2),a&&(o+=q2),s.filter(c=>!hb(c)).reduce((c,u)=>c+(B2.test(u)?H2:u===""?$2:V2),o)}function F2(n,a){return n.length===a.length&&n.slice(0,-1).every((o,c)=>o===a[c])?n[n.length-1]-a[a.length-1]:0}function X2(n,a,s=!1){let{routesMeta:o}=n,c={},u="/",f=[];for(let p=0;p<o.length;++p){let g=o[p],v=p===o.length-1,x=u==="/"?a:a.slice(u.length)||"/",y={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},b=g.matcher&&g.compiledParams?w0(y,x,g.matcher,g.compiledParams):hu(y,x),w=g.route;if(!b&&v&&s&&!o[o.length-1].route.index&&(b=hu({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Ca([u,b.pathname]),pathnameBase:J2(Ca([u,b.pathnameBase])),route:w}),b.pathnameBase!=="/"&&(u=Ca([u,b.pathnameBase]))}return f}function hu(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,o]=j0(n.path,n.caseSensitive,n.end);return w0(n,a,s,o)}function w0(n,a,s,o){let c=a.match(s);if(!c)return null;let u=c[0],f=u.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:o.reduce((v,{paramName:x,isOptional:y},b)=>{if(x==="*"){let N=p[b]||"";f=u.slice(0,u.length-N.length).replace(/(.)\/+$/,"$1")}const w=p[b];return y&&!w?v[x]=void 0:v[x]=(w||"").replace(/%2F/g,"/"),v},{}),pathname:u,pathnameBase:f,pattern:n}}function j0(n,a=!1,s=!0){ha(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let o=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,g,v,x)=>{if(o.push({paramName:p,isOptional:g!=null}),g){let y=x.charAt(v+f.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function K2(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return ha(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function yr(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let s=a.endsWith("/")?a.length-1:a.length,o=n.charAt(s);return o&&o!=="/"?null:n.slice(s)||"/"}function Q2(n,a="/"){let{pathname:s,search:o="",hash:c=""}=typeof n=="string"?Gl(n):n,u;return s?(s=S0(s),s.startsWith("/")?u=mb(s.substring(1),"/"):u=mb(s,a)):u=a,{pathname:u,search:W2(o),hash:eN(c)}}function mb(n,a){let s=mu(a).split("/");return n.split("/").forEach(c=>{c===".."?s.length>1&&s.pop():c!=="."&&s.push(c)}),s.length>1?s.join("/"):"/"}function wh(n,a,s,o){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Z2(n){return n.filter((a,s)=>s===0||a.route.path&&a.route.path.length>0)}function Mm(n){let a=Z2(n);return a.map((s,o)=>o===a.length-1?s.pathname:s.pathnameBase)}function Tu(n,a,s,o=!1){let c;typeof n=="string"?c=Gl(n):(c={...n},Rt(!c.pathname||!c.pathname.includes("?"),wh("?","pathname","search",c)),Rt(!c.pathname||!c.pathname.includes("#"),wh("#","pathname","hash",c)),Rt(!c.search||!c.search.includes("#"),wh("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=s;else{let y=a.length-1;if(!o&&f.startsWith("..")){let b=f.split("/");for(;b[0]==="..";)b.shift(),y-=1;c.pathname=b.join("/")}p=y>=0?a[y]:"/"}let g=Q2(c,p),v=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&s.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}var S0=n=>n.replace(/[\\/]{2,}/g,"/"),Ca=n=>S0(n.join("/")),mu=n=>n.replace(/\/+$/,""),J2=n=>mu(n).replace(/^\/*/,"/"),W2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,eN=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,tN=class{constructor(n,a,s,o=!1){this.status=n,this.statusText=a||"",this.internal=o,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function nN(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function aN(n){let a=n.map(s=>s.route.path).filter(Boolean);return Ca(a)||"/"}var C0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function N0(n,a){let s=n;if(typeof s!="string"||!Am.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let o=s,c=!1;if(C0)try{let u=new URL(window.location.href),f=v0.test(s)?new URL(O2(s,u.protocol)):new URL(s),p=yr(f.pathname,a);f.origin===u.origin&&p!=null?s=p+f.search+f.hash:c=!0}catch{ha(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:c,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var E0=["POST","PUT","PATCH","DELETE"];new Set(E0);var rN=["GET",...E0];new Set(rN);var sN=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function lN(n){try{return sN.includes(new URL(n).protocol)}catch{return!1}}var Fl=h.createContext(null);Fl.displayName="DataRouter";var Au=h.createContext(null);Au.displayName="DataRouterState";var R0=h.createContext(!1);function oN(){return h.useContext(R0)}var T0=h.createContext({isTransitioning:!1});T0.displayName="ViewTransition";var iN=h.createContext(new Map);iN.displayName="Fetchers";var cN=h.createContext(null);cN.displayName="Await";var Zn=h.createContext(null);Zn.displayName="Navigation";var gi=h.createContext(null);gi.displayName="Location";var $a=h.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var Dm=h.createContext(null);Dm.displayName="RouteError";var A0="REACT_ROUTER_ERROR",uN="REDIRECT",dN="ROUTE_ERROR_RESPONSE";function fN(n){if(n.startsWith(`${A0}:${uN}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function hN(n){if(n.startsWith(`${A0}:${dN}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new tN(a.status,a.statusText,a.data)}catch{}}function mN(n,{relative:a}={}){Rt(Xl(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:o}=h.useContext(Zn),{hash:c,pathname:u,search:f}=xi(n,{relative:a}),p=u;return s!=="/"&&(p=u==="/"?s:Ca([s,u])),o.createHref({pathname:p,search:f,hash:c})}function Xl(){return h.useContext(gi)!=null}function Bn(){return Rt(Xl(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(gi).location}var M0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function D0(n){h.useContext(Zn).static||h.useLayoutEffect(n)}function vi(){let{isDataRoute:n}=h.useContext($a);return n?RN():pN()}function pN(){Rt(Xl(),"useNavigate() may be used only in the context of a <Router> component.");let n=h.useContext(Fl),{basename:a,navigator:s}=h.useContext(Zn),{matches:o}=h.useContext($a),{pathname:c}=Bn(),u=JSON.stringify(Mm(o)),f=h.useRef(!1);return D0(()=>{f.current=!0}),h.useCallback((g,v={})=>{if(ha(f.current,M0),!f.current)return;if(typeof g=="number"){s.go(g);return}let x=Tu(g,JSON.parse(u),c,v.relative==="path");n==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Ca([a,x.pathname])),(v.replace?s.replace:s.push)(x,v.state,v)},[a,s,u,c,n])}h.createContext(null);function xi(n,{relative:a}={}){let{matches:s}=h.useContext($a),{pathname:o}=Bn(),c=JSON.stringify(Mm(s));return h.useMemo(()=>Tu(n,JSON.parse(c),o,a==="path"),[n,c,o,a])}function gN(n,a){return O0(n,a)}function O0(n,a,s){var C;Rt(Xl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=h.useContext(Zn),{matches:c}=h.useContext($a),u=c[c.length-1],f=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",v=u&&u.route;{let R=v&&v.path||"";_0(p,!v||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let x=Bn(),y;if(a){let R=typeof a=="string"?Gl(a):a;Rt(g==="/"||((C=R.pathname)==null?void 0:C.startsWith(g)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${R.pathname}" was given in the \`location\` prop.`),y=R}else y=x;let b=y.pathname||"/",w=b;if(g!=="/"){let R=g.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(R.length).join("/")}let N=s&&s.state.matches.length?s.state.matches.map(R=>Object.assign(R,{route:s.manifest[R.route.id]||R.route})):x0(n,{pathname:w});ha(v||N!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),ha(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=wN(N&&N.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Ca([g,o.encodeLocation?o.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?g:Ca([g,o.encodeLocation?o.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),c,s);return a&&S?h.createElement(gi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},S):S}function vN(){let n=EN(),a=nN(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:u},"ErrorBoundary")," or"," ",h.createElement("code",{style:u},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},a),s?h.createElement("pre",{style:c},s):null,f)}var xN=h.createElement(vN,null),k0=class extends h.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const s=hN(n.digest);s&&(n=s)}let a=n!==void 0?h.createElement($a.Provider,{value:this.props.routeContext},h.createElement(Dm.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?h.createElement(yN,{error:n},a):a}};k0.contextType=R0;var jh=new WeakMap;function yN({children:n,error:a}){let{basename:s}=h.useContext(Zn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=fN(a.digest);if(o){let c=jh.get(a);if(c)throw c;let u=N0(o.location,s),f=u.absoluteURL||u.to;if(lN(f))throw new Error("Invalid redirect location");if(C0&&!jh.get(a))if(u.isExternal||o.reloadDocument)window.location.href=f;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw jh.set(a,p),p}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return n}function bN({routeContext:n,match:a,children:s}){let o=h.useContext(Fl);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),h.createElement($a.Provider,{value:n},s)}function wN(n,a=[],s){let o=s==null?void 0:s.state;if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let c=n,u=o==null?void 0:o.errors;if(u!=null){let x=c.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);Rt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let f=!1,p=-1;if(s&&o){f=o.renderFallback;for(let x=0;x<c.length;x++){let y=c[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=x),y.route.id){let{loaderData:b,errors:w}=o,N=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||N){s.isStatic&&(f=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let g=s==null?void 0:s.onError,v=o&&g?(x,y)=>{var b,w;g(x,{location:o.location,params:((w=(b=o.matches)==null?void 0:b[0])==null?void 0:w.params)??{},pattern:aN(o.matches),errorInfo:y})}:void 0;return c.reduceRight((x,y,b)=>{let w,N=!1,S=null,C=null;o&&(w=u&&y.route.id?u[y.route.id]:void 0,S=y.route.errorElement||xN,f&&(p<0&&b===0?(_0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,C=null):p===b&&(N=!0,C=y.route.hydrateFallbackElement||null)));let R=a.concat(c.slice(0,b+1)),D=()=>{let A;return w?A=S:N?A=C:y.route.Component?A=h.createElement(y.route.Component,null):y.route.element?A=y.route.element:A=x,h.createElement(bN,{match:y,routeContext:{outlet:x,matches:R,isDataRoute:o!=null},children:A})};return o&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?h.createElement(k0,{location:o.location,revalidation:o.revalidation,component:S,error:w,children:D(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:v}):D()},null)}function Om(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jN(n){let a=h.useContext(Fl);return Rt(a,Om(n)),a}function SN(n){let a=h.useContext(Au);return Rt(a,Om(n)),a}function CN(n){let a=h.useContext($a);return Rt(a,Om(n)),a}function km(n){let a=CN(n),s=a.matches[a.matches.length-1];return Rt(s.route.id,`${n} can only be used on routes that contain a unique "id"`),s.route.id}function NN(){return km("useRouteId")}function EN(){var o;let n=h.useContext(Dm),a=SN("useRouteError"),s=km("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[s]}function RN(){let{router:n}=jN("useNavigate"),a=km("useNavigate"),s=h.useRef(!1);return D0(()=>{s.current=!0}),h.useCallback(async(c,u={})=>{ha(s.current,M0),s.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...u}))},[n,a])}var pb={};function _0(n,a,s){!a&&!pb[n]&&(pb[n]=!0,ha(!1,s))}h.memo(TN);function TN({routes:n,manifest:a,future:s,state:o,isStatic:c,onError:u}){return O0(n,void 0,{manifest:a,state:o,isStatic:c,onError:u})}function Vh({to:n,replace:a,state:s,relative:o}){Rt(Xl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=h.useContext(Zn);ha(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=h.useContext($a),{pathname:f}=Bn(),p=vi(),g=Tu(n,Mm(u),f,o==="path"),v=JSON.stringify(g);return h.useEffect(()=>{p(JSON.parse(v),{replace:a,state:s,relative:o})},[p,v,o,a,s]),null}function Dn(n){Rt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function AN({basename:n="/",children:a=null,location:s,navigationType:o="POP",navigator:c,static:u=!1,useTransitions:f}){Rt(!Xl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=h.useMemo(()=>({basename:p,navigator:c,static:u,useTransitions:f,future:{}}),[p,c,u,f]);typeof s=="string"&&(s=Gl(s));let{pathname:v="/",search:x="",hash:y="",state:b=null,key:w="default",mask:N}=s,S=h.useMemo(()=>{let C=yr(v,p);return C==null?null:{location:{pathname:C,search:x,hash:y,state:b,key:w,mask:N},navigationType:o}},[p,v,x,y,b,w,o,N]);return ha(S!=null,`<Router basename="${p}"> is not able to match the URL "${v}${x}${y}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:h.createElement(Zn.Provider,{value:g},h.createElement(gi.Provider,{children:a,value:S}))}function z0({children:n,location:a}){return gN(Yh(n),a)}function Yh(n,a=[]){let s=[];return h.Children.forEach(n,(o,c)=>{if(!h.isValidElement(o))return;let u=[...a,c];if(o.type===h.Fragment){s.push.apply(s,Yh(o.props.children,u));return}Rt(o.type===Dn,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Rt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let f={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(f.children=Yh(o.props.children,u)),s.push(f)}),s}var su="get",lu="application/x-www-form-urlencoded";function Mu(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function MN(n){return Mu(n)&&n.tagName.toLowerCase()==="button"}function DN(n){return Mu(n)&&n.tagName.toLowerCase()==="form"}function ON(n){return Mu(n)&&n.tagName.toLowerCase()==="input"}function kN(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function _N(n,a){return n.button===0&&(!a||a==="_self")&&!kN(n)}function Gh(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,s)=>{let o=n[s];return a.concat(Array.isArray(o)?o.map(c=>[s,c]):[[s,o]])},[]))}function zN(n,a){let s=Gh(n);return a&&a.forEach((o,c)=>{s.has(c)||a.getAll(c).forEach(u=>{s.append(c,u)})}),s}var $c=null;function LN(){if($c===null)try{new FormData(document.createElement("form"),0),$c=!1}catch{$c=!0}return $c}var UN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Sh(n){return n!=null&&!UN.has(n)?(ha(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${lu}"`),null):n}function IN(n,a){let s,o,c,u,f;if(DN(n)){let p=n.getAttribute("action");o=p?yr(p,a):null,s=n.getAttribute("method")||su,c=Sh(n.getAttribute("enctype"))||lu,u=new FormData(n)}else if(MN(n)||ON(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||p.getAttribute("action");if(o=g?yr(g,a):null,s=n.getAttribute("formmethod")||p.getAttribute("method")||su,c=Sh(n.getAttribute("formenctype"))||Sh(p.getAttribute("enctype"))||lu,u=new FormData(p,n),!LN()){let{name:v,type:x,value:y}=n;if(x==="image"){let b=v?`${v}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else v&&u.append(v,y)}}else{if(Mu(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=su,o=null,c=lu,f=n}return u&&c==="text/plain"&&(f=u,u=void 0),{action:o,method:s.toLowerCase(),encType:c,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _m(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function L0(n,a,s,o){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return s?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:a&&yr(c.pathname,a)==="/"?c.pathname=`${mu(a)}/_root.${o}`:c.pathname=`${mu(c.pathname)}.${o}`,c}async function PN(n,a){if(n.id in a)return a[n.id];try{let s=await import(n.module);return a[n.id]=s,s}catch(s){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function BN(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function HN(n,a,s){let o=await Promise.all(n.map(async c=>{let u=a.routes[c.route.id];if(u){let f=await PN(u,s);return f.links?f.links():[]}return[]}));return YN(o.flat(1).filter(BN).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function gb(n,a,s,o,c,u){let f=(g,v)=>s[v]?g.route.id!==s[v].route.id:!0,p=(g,v)=>{var x;return s[v].pathname!==g.pathname||((x=s[v].route.path)==null?void 0:x.endsWith("*"))&&s[v].params["*"]!==g.params["*"]};return u==="assets"?a.filter((g,v)=>f(g,v)||p(g,v)):u==="data"?a.filter((g,v)=>{var y;let x=o.routes[g.route.id];if(!x||!x.hasLoader)return!1;if(f(g,v)||p(g,v))return!0;if(g.route.shouldRevalidate){let b=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((y=s[0])==null?void 0:y.params)||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function qN(n,a,{includeHydrateFallback:s}={}){return $N(n.map(o=>{let c=a.routes[o.route.id];if(!c)return[];let u=[c.module];return c.clientActionModule&&(u=u.concat(c.clientActionModule)),c.clientLoaderModule&&(u=u.concat(c.clientLoaderModule)),s&&c.hydrateFallbackModule&&(u=u.concat(c.hydrateFallbackModule)),c.imports&&(u=u.concat(c.imports)),u}).flat(1))}function $N(n){return[...new Set(n)]}function VN(n){let a={},s=Object.keys(n).sort();for(let o of s)a[o]=n[o];return a}function YN(n,a){let s=new Set;return new Set(a),n.reduce((o,c)=>{let u=JSON.stringify(VN(c));return s.has(u)||(s.add(u),o.push({key:u,link:c})),o},[])}function zm(){let n=h.useContext(Fl);return _m(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function GN(){let n=h.useContext(Au);return _m(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Lm=h.createContext(void 0);Lm.displayName="FrameworkContext";function Du(){let n=h.useContext(Lm);return _m(n,"You must render this element inside a <HydratedRouter> element"),n}function FN(n,a){let s=h.useContext(Lm),[o,c]=h.useState(!1),[u,f]=h.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:v,onMouseLeave:x,onTouchStart:y}=a,b=h.useRef(null);h.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let S=R=>{R.forEach(D=>{f(D.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[n]),h.useEffect(()=>{if(o){let S=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(S)}}},[o]);let w=()=>{c(!0)},N=()=>{c(!1),f(!1)};return s?n!=="intent"?[u,b,{}]:[u,b,{onFocus:Wo(p,w),onBlur:Wo(g,N),onMouseEnter:Wo(v,w),onMouseLeave:Wo(x,N),onTouchStart:Wo(y,w)}]:[!1,b,{}]}function Wo(n,a){return s=>{n&&n(s),s.defaultPrevented||a(s)}}function XN({page:n,...a}){let s=oN(),{nonce:o}=Du(),{router:c}=zm(),u=h.useMemo(()=>x0(c.routes,n,c.basename),[c.routes,n,c.basename]);return u?(a.nonce==null&&o&&(a={...a,nonce:o}),s?h.createElement(QN,{page:n,matches:u,...a}):h.createElement(ZN,{page:n,matches:u,...a})):null}function KN(n){let{manifest:a,routeModules:s}=Du(),[o,c]=h.useState([]);return h.useEffect(()=>{let u=!1;return HN(n,a,s).then(f=>{u||c(f)}),()=>{u=!0}},[n,a,s]),o}function QN({page:n,matches:a,...s}){let o=Bn(),{future:c}=Du(),{basename:u}=zm(),f=h.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let p=L0(n,u,c.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let x of a)typeof x.route.shouldRevalidate=="function"?g=!0:v.push(x.route.id);return g&&v.length>0&&p.searchParams.set("_routes",v.join(",")),[p.pathname+p.search]},[u,c.v8_trailingSlashAwareDataRequests,n,o,a]);return h.createElement(h.Fragment,null,f.map(p=>h.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...s})))}function ZN({page:n,matches:a,...s}){let o=Bn(),{future:c,manifest:u,routeModules:f}=Du(),{basename:p}=zm(),{loaderData:g,matches:v}=GN(),x=h.useMemo(()=>gb(n,a,v,u,o,"data"),[n,a,v,u,o]),y=h.useMemo(()=>gb(n,a,v,u,o,"assets"),[n,a,v,u,o]),b=h.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let S=new Set,C=!1;if(a.forEach(D=>{var M;let A=u.routes[D.route.id];!A||!A.hasLoader||(!x.some(O=>O.route.id===D.route.id)&&D.route.id in g&&((M=f[D.route.id])!=null&&M.shouldRevalidate)||A.hasClientLoader?C=!0:S.add(D.route.id))}),S.size===0)return[];let R=L0(n,p,c.v8_trailingSlashAwareDataRequests,"data");return C&&S.size>0&&R.searchParams.set("_routes",a.filter(D=>S.has(D.route.id)).map(D=>D.route.id).join(",")),[R.pathname+R.search]},[p,c.v8_trailingSlashAwareDataRequests,g,o,u,x,a,n,f]),w=h.useMemo(()=>qN(y,u),[y,u]),N=KN(y);return h.createElement(h.Fragment,null,b.map(S=>h.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...s})),w.map(S=>h.createElement("link",{key:S,rel:"modulepreload",href:S,...s})),N.map(({key:S,link:C})=>h.createElement("link",{key:S,nonce:s.nonce,...C,crossOrigin:C.crossOrigin??s.crossOrigin})))}function JN(...n){return a=>{n.forEach(s=>{typeof s=="function"?s(a):s!=null&&(s.current=a)})}}var WN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{WN&&(window.__reactRouterVersion="7.18.2")}catch{}function eE({basename:n,children:a,useTransitions:s,window:o}){let c=h.useRef();c.current==null&&(c.current=k2({window:o,v5Compat:!0}));let u=c.current,[f,p]=h.useState({action:u.action,location:u.location}),g=h.useCallback(v=>{s===!1?p(v):h.startTransition(()=>p(v))},[s]);return h.useLayoutEffect(()=>u.listen(g),[u,g]),h.createElement(AN,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:u,useTransitions:s})}var Ls=h.forwardRef(function({onClick:a,discover:s="render",prefetch:o="none",relative:c,reloadDocument:u,replace:f,mask:p,state:g,target:v,to:x,preventScrollReset:y,viewTransition:b,defaultShouldRevalidate:w,...N},S){let{basename:C,navigator:R,useTransitions:D}=h.useContext(Zn),A=typeof x=="string"&&Am.test(x),M=N0(x,C);x=M.to;let O=mN(x,{relative:c}),E=Bn(),_=null;if(p){let B=Tu(p,[],E.mask?E.mask.pathname:"/",!0);C!=="/"&&(B.pathname=B.pathname==="/"?C:Ca([C,B.pathname])),_=R.createHref(B)}let[U,P,$]=FN(o,N),J=aE(x,{replace:f,mask:p,state:g,target:v,preventScrollReset:y,relative:c,viewTransition:b,defaultShouldRevalidate:w,useTransitions:D});function Y(B){a&&a(B),B.defaultPrevented||J(B)}let ce=!(M.isExternal||u),ue=h.createElement("a",{...N,...$,href:(ce?_:void 0)||M.absoluteURL||O,onClick:ce?Y:a,ref:JN(S,P),target:v,"data-discover":!A&&s==="render"?"true":void 0});return U&&!A?h.createElement(h.Fragment,null,ue,h.createElement(XN,{page:O})):ue});Ls.displayName="Link";var U0=h.forwardRef(function({"aria-current":a="page",caseSensitive:s=!1,className:o="",end:c=!1,style:u,to:f,viewTransition:p,children:g,...v},x){let y=xi(f,{relative:v.relative}),b=Bn(),w=h.useContext(Au),{navigator:N,basename:S}=h.useContext(Zn),C=w!=null&&cE(y)&&p===!0,R=N.encodeLocation?N.encodeLocation(y).pathname:y.pathname,D=b.pathname,A=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;s||(D=D.toLowerCase(),A=A?A.toLowerCase():null,R=R.toLowerCase()),A&&S&&(A=yr(A,S)||A);const M=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let O=D===R||!c&&D.startsWith(R)&&D.charAt(M)==="/",E=A!=null&&(A===R||!c&&A.startsWith(R)&&A.charAt(R.length)==="/"),_={isActive:O,isPending:E,isTransitioning:C},U=O?a:void 0,P;typeof o=="function"?P=o(_):P=[o,O?"active":null,E?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let $=typeof u=="function"?u(_):u;return h.createElement(Ls,{...v,"aria-current":U,className:P,ref:x,style:$,to:f,viewTransition:p},typeof g=="function"?g(_):g)});U0.displayName="NavLink";var tE=h.forwardRef(({discover:n="render",fetcherKey:a,navigate:s,reloadDocument:o,replace:c,state:u,method:f=su,action:p,onSubmit:g,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b,...w},N)=>{let{useTransitions:S}=h.useContext(Zn),C=oE(),R=iE(p,{relative:v}),D=f.toLowerCase()==="get"?"get":"post",A=typeof p=="string"&&Am.test(p),M=O=>{if(g&&g(O),O.defaultPrevented)return;O.preventDefault();let E=O.nativeEvent.submitter,_=(E==null?void 0:E.getAttribute("formmethod"))||f,U=()=>C(E||O.currentTarget,{fetcherKey:a,method:_,navigate:s,replace:c,state:u,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b});S&&s!==!1?h.startTransition(()=>U()):U()};return h.createElement("form",{ref:N,method:D,action:R,onSubmit:o?g:M,...w,"data-discover":!A&&n==="render"?"true":void 0})});tE.displayName="Form";function nE(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function I0(n){let a=h.useContext(Fl);return Rt(a,nE(n)),a}function aE(n,{target:a,replace:s,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g,useTransitions:v}={}){let x=vi(),y=Bn(),b=xi(n,{relative:f});return h.useCallback(w=>{if(_N(w,a)){w.preventDefault();let N=s!==void 0?s:si(y)===si(b),S=()=>x(n,{replace:N,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g});v?h.startTransition(()=>S()):S()}},[y,x,b,s,o,c,a,n,u,f,p,g,v])}function rE(n){ha(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=h.useRef(Gh(n)),s=h.useRef(!1),o=Bn(),c=h.useMemo(()=>zN(o.search,s.current?null:a.current),[o.search]),u=vi(),f=h.useCallback((p,g)=>{const v=Gh(typeof p=="function"?p(new URLSearchParams(c)):p);s.current=!0,u("?"+v,g)},[u,c]);return[c,f]}var sE=0,lE=()=>`__${String(++sE)}__`;function oE(){let{router:n}=I0("useSubmit"),{basename:a}=h.useContext(Zn),s=NN(),o=n.fetch,c=n.navigate;return h.useCallback(async(u,f={})=>{let{action:p,method:g,encType:v,formData:x,body:y}=IN(u,a);if(f.navigate===!1){let b=f.fetcherKey||lE();await o(b,s,f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||g,formEncType:f.encType||v,flushSync:f.flushSync})}else await c(f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||g,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:s,flushSync:f.flushSync,viewTransition:f.viewTransition})},[o,c,a,s])}function iE(n,{relative:a}={}){let{basename:s}=h.useContext(Zn),o=h.useContext($a);Rt(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),u={...xi(n||".",{relative:a})},f=Bn();if(n==null){u.search=f.search;let p=new URLSearchParams(u.search),g=p.getAll("index");if(g.some(x=>x==="")){p.delete("index"),g.filter(y=>y).forEach(y=>p.append("index",y));let x=p.toString();u.search=x?`?${x}`:""}}return(!n||n===".")&&c.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(u.pathname=u.pathname==="/"?s:Ca([s,u.pathname])),si(u)}function cE(n,{relative:a}={}){let s=h.useContext(T0);Rt(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=I0("useViewTransitionState"),c=xi(n,{relative:a});if(!s.isTransitioning)return!1;let u=yr(s.currentLocation.pathname,o)||s.currentLocation.pathname,f=yr(s.nextLocation.pathname,o)||s.nextLocation.pathname;return hu(c.pathname,f)!=null||hu(c.pathname,u)!=null}var Sa=g0();const uE=Rm(Sa),Ou="",pu="x-csrf-token",vb=new Set(["/api/admin/login","/api/admin/setup"]);let Us=null,Ch=null;async function Um(){return Us||(Ch??(Ch=fetch(`${Ou}/api/admin/csrf`,{credentials:"include"}).then(async n=>{if(!n.ok)throw new Error("Unable to acquire CSRF token");return Us=(await n.json()).csrfToken,Us}).finally(()=>{Ch=null})),Ch)}class Im extends Error{constructor(a,s,o){var c;super(typeof o=="object"&&o&&"error"in o?String(((c=o.error)==null?void 0:c.message)??o):"Request failed"),this.status=a,this.type=s,this.body=o}}async function P0(n){var o;const a=await n.text();let s;try{s=a?JSON.parse(a):void 0}catch{s=a}if(!n.ok)throw new Im(n.status,typeof s=="object"&&s&&"error"in s?String(((o=s.error)==null?void 0:o.type)??"error"):"error",s);return s}async function Ll(n,a,s,o,c=!0){const u=s!==void 0,f={...o==null?void 0:o.headers};u&&!f["content-type"]&&(f["content-type"]="application/json"),n!=="GET"&&n!=="HEAD"&&!vb.has(a)&&!f[pu]&&(f[pu]=await Um());const p=await fetch(`${Ou}${a}`,{...o,method:n,headers:f,body:u?JSON.stringify(s):void 0,credentials:"include"});try{return await P0(p)}catch(g){const v=g instanceof Im&&(g.status===401||g.status===403)&&(g.type==="authentication_error"||g.type==="csrf_error");if(c&&v&&n!=="GET"&&n!=="HEAD"&&!vb.has(a))return Us=null,Ll(n,a,s,o,!1);throw g}}async function B0(n,a,s=!0){const o=await fetch(`${Ou}${n}`,{method:"POST",headers:{[pu]:await Um()},body:a,credentials:"include"});try{return await P0(o)}catch(c){const u=c instanceof Im&&(c.status===401||c.status===403)&&(c.type==="authentication_error"||c.type==="csrf_error");if(s&&u)return Us=null,B0(n,a,!1);throw c}}async function gu(n,a,s=!0){const o={...a==null?void 0:a.headers,[pu]:await Um()},c=await fetch(`${Ou}${n}`,{...a,headers:o,credentials:"include"});return s&&c.status===403?(Us=null,gu(n,a,!1)):c}const pe={get:(n,a)=>Ll("GET",n,void 0,a),post:(n,a,s)=>Ll("POST",n,a,s),upload:B0,patch:(n,a,s)=>Ll("PATCH",n,a,s),put:(n,a,s)=>Ll("PUT",n,a,s),del:(n,a)=>Ll("DELETE",n,void 0,a)},H0=h.createContext(void 0);function dE({children:n}){const[a,s]=h.useState(null),[o,c]=h.useState(!0),u=h.useCallback(async()=>{try{const g=await pe.get("/api/admin/me");s(g)}catch{s(null)}finally{c(!1)}},[]);h.useEffect(()=>{u()},[u]);const f=h.useCallback(async(g,v,x,y)=>{const b={username:g,password:v};x&&(b.totp=x),y&&(b.recoveryCode=y);try{const w=await pe.post("/api/admin/login",b);return s({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const N=w.status,S=w.type;if(N===401&&S==="totp_required")return{totpRequired:!0};throw w}},[]),p=h.useCallback(async()=>{await pe.post("/api/admin/logout"),s(null)},[]);return l.jsx(H0.Provider,{value:{user:a,loading:o,login:f,logout:p,refresh:u},children:n})}function Pm(){const n=h.useContext(H0);if(!n)throw new Error("useAuth must be inside AuthProvider");return n}/**
|
|
61
|
-
* @license lucide-react v0.469.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const fE=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q0=(...n)=>n.filter((a,s,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===s).join(" ").trim();/**
|
|
66
|
-
* @license lucide-react v0.469.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/var hE={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"};/**
|
|
71
|
-
* @license lucide-react v0.469.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const mE=h.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:f,...p},g)=>h.createElement("svg",{ref:g,...hE,width:a,height:a,stroke:n,strokeWidth:o?Number(s)*24/Number(a):s,className:q0("lucide",c),...p},[...f.map(([v,x])=>h.createElement(v,x)),...Array.isArray(u)?u:[u]]));/**
|
|
76
|
-
* @license lucide-react v0.469.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const Me=(n,a)=>{const s=h.forwardRef(({className:o,...c},u)=>h.createElement(mE,{ref:u,iconNode:a,className:q0(`lucide-${fE(n)}`,o),...c}));return s.displayName=`${n}`,s};/**
|
|
81
|
-
* @license lucide-react v0.469.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/const $0=Me("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"}]]);/**
|
|
86
|
-
* @license lucide-react v0.469.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const pE=Me("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
91
|
-
* @license lucide-react v0.469.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const gE=Me("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
|
96
|
-
* @license lucide-react v0.469.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const vE=Me("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
|
|
101
|
-
* @license lucide-react v0.469.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const Bm=Me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
106
|
-
* @license lucide-react v0.469.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const V0=Me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
111
|
-
* @license lucide-react v0.469.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const Y0=Me("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
116
|
-
* @license lucide-react v0.469.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const Hm=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
121
|
-
* @license lucide-react v0.469.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const xE=Me("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
|
|
126
|
-
* @license lucide-react v0.469.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const ku=Me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
131
|
-
* @license lucide-react v0.469.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const yE=Me("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"}]]);/**
|
|
136
|
-
* @license lucide-react v0.469.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const bE=Me("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
141
|
-
* @license lucide-react v0.469.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const wE=Me("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
146
|
-
* @license lucide-react v0.469.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const jE=Me("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
|
|
151
|
-
* @license lucide-react v0.469.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const ou=Me("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"}]]);/**
|
|
156
|
-
* @license lucide-react v0.469.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const SE=Me("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"}]]);/**
|
|
161
|
-
* @license lucide-react v0.469.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const CE=Me("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
166
|
-
* @license lucide-react v0.469.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const qm=Me("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"}]]);/**
|
|
171
|
-
* @license lucide-react v0.469.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const NE=Me("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"}]]);/**
|
|
176
|
-
* @license lucide-react v0.469.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const EE=Me("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
181
|
-
* @license lucide-react v0.469.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const RE=Me("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"}]]);/**
|
|
186
|
-
* @license lucide-react v0.469.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const TE=Me("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
|
|
191
|
-
* @license lucide-react v0.469.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const G0=Me("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
196
|
-
* @license lucide-react v0.469.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const $m=Me("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"}]]);/**
|
|
201
|
-
* @license lucide-react v0.469.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const F0=Me("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
206
|
-
* @license lucide-react v0.469.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const X0=Me("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
211
|
-
* @license lucide-react v0.469.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const AE=Me("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
216
|
-
* @license lucide-react v0.469.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const pr=Me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
221
|
-
* @license lucide-react v0.469.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const ME=Me("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
226
|
-
* @license lucide-react v0.469.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const DE=Me("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
231
|
-
* @license lucide-react v0.469.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const OE=Me("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
236
|
-
* @license lucide-react v0.469.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const K0=Me("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"}]]);/**
|
|
241
|
-
* @license lucide-react v0.469.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const kE=Me("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"}]]);/**
|
|
246
|
-
* @license lucide-react v0.469.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const _E=Me("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
251
|
-
* @license lucide-react v0.469.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const Kl=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
256
|
-
* @license lucide-react v0.469.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const li=Me("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"}]]);/**
|
|
261
|
-
* @license lucide-react v0.469.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const zE=Me("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
266
|
-
* @license lucide-react v0.469.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const LE=Me("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/**
|
|
271
|
-
* @license lucide-react v0.469.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const UE=Me("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
|
|
276
|
-
* @license lucide-react v0.469.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const Vm=Me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
281
|
-
* @license lucide-react v0.469.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const IE=Me("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
286
|
-
* @license lucide-react v0.469.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const PE=Me("ShieldCheck",[["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:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
291
|
-
* @license lucide-react v0.469.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const BE=Me("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
296
|
-
* @license lucide-react v0.469.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const HE=Me("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
301
|
-
* @license lucide-react v0.469.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const qE=Me("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
306
|
-
* @license lucide-react v0.469.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const Ql=Me("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"}]]);/**
|
|
311
|
-
* @license lucide-react v0.469.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const $E=Me("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"}]]);/**
|
|
316
|
-
* @license lucide-react v0.469.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const Q0=Me("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"}]]);/**
|
|
321
|
-
* @license lucide-react v0.469.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const VE=Me("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
326
|
-
* @license lucide-react v0.469.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const YE=Me("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
331
|
-
* @license lucide-react v0.469.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const _u=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
336
|
-
* @license lucide-react v0.469.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const GE=Me("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Z0(n){var a,s,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(a=0;a<c;a++)n[a]&&(s=Z0(n[a]))&&(o&&(o+=" "),o+=s)}else for(s in n)n[s]&&(o&&(o+=" "),o+=s);return o}function J0(){for(var n,a,s=0,o="",c=arguments.length;s<c;s++)(n=arguments[s])&&(a=Z0(n))&&(o&&(o+=" "),o+=a);return o}const Ym="-",FE=n=>{const a=KE(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:f=>{const p=f.split(Ym);return p[0]===""&&p.length!==1&&p.shift(),W0(p,a)||XE(f)},getConflictingClassGroupIds:(f,p)=>{const g=s[f]||[];return p&&o[f]?[...g,...o[f]]:g}}},W0=(n,a)=>{var f;if(n.length===0)return a.classGroupId;const s=n[0],o=a.nextPart.get(s),c=o?W0(n.slice(1),o):void 0;if(c)return c;if(a.validators.length===0)return;const u=n.join(Ym);return(f=a.validators.find(({validator:p})=>p(u)))==null?void 0:f.classGroupId},xb=/^\[(.+)\]$/,XE=n=>{if(xb.test(n)){const a=xb.exec(n)[1],s=a==null?void 0:a.substring(0,a.indexOf(":"));if(s)return"arbitrary.."+s}},KE=n=>{const{theme:a,prefix:s}=n,o={nextPart:new Map,validators:[]};return ZE(Object.entries(n.classGroups),s).forEach(([u,f])=>{Fh(f,o,u,a)}),o},Fh=(n,a,s,o)=>{n.forEach(c=>{if(typeof c=="string"){const u=c===""?a:yb(a,c);u.classGroupId=s;return}if(typeof c=="function"){if(QE(c)){Fh(c(o),a,s,o);return}a.validators.push({validator:c,classGroupId:s});return}Object.entries(c).forEach(([u,f])=>{Fh(f,yb(a,u),s,o)})})},yb=(n,a)=>{let s=n;return a.split(Ym).forEach(o=>{s.nextPart.has(o)||s.nextPart.set(o,{nextPart:new Map,validators:[]}),s=s.nextPart.get(o)}),s},QE=n=>n.isThemeGetter,ZE=(n,a)=>a?n.map(([s,o])=>{const c=o.map(u=>typeof u=="string"?a+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([f,p])=>[a+f,p])):u);return[s,c]}):n,JE=n=>{if(n<1)return{get:()=>{},set:()=>{}};let a=0,s=new Map,o=new Map;const c=(u,f)=>{s.set(u,f),a++,a>n&&(a=0,o=s,s=new Map)};return{get(u){let f=s.get(u);if(f!==void 0)return f;if((f=o.get(u))!==void 0)return c(u,f),f},set(u,f){s.has(u)?s.set(u,f):c(u,f)}}},e1="!",WE=n=>{const{separator:a,experimentalParseClassName:s}=n,o=a.length===1,c=a[0],u=a.length,f=p=>{const g=[];let v=0,x=0,y;for(let C=0;C<p.length;C++){let R=p[C];if(v===0){if(R===c&&(o||p.slice(C,C+u)===a)){g.push(p.slice(x,C)),x=C+u;continue}if(R==="/"){y=C;continue}}R==="["?v++:R==="]"&&v--}const b=g.length===0?p:p.substring(x),w=b.startsWith(e1),N=w?b.substring(1):b,S=y&&y>x?y-x:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:N,maybePostfixModifierPosition:S}};return s?p=>s({className:p,parseClassName:f}):f},eR=n=>{if(n.length<=1)return n;const a=[];let s=[];return n.forEach(o=>{o[0]==="["?(a.push(...s.sort(),o),s=[]):s.push(o)}),a.push(...s.sort()),a},tR=n=>({cache:JE(n.cacheSize),parseClassName:WE(n),...FE(n)}),nR=/\s+/,aR=(n,a)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:c}=a,u=[],f=n.trim().split(nR);let p="";for(let g=f.length-1;g>=0;g-=1){const v=f[g],{modifiers:x,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:w}=s(v);let N=!!w,S=o(N?b.substring(0,w):b);if(!S){if(!N){p=v+(p.length>0?" "+p:p);continue}if(S=o(b),!S){p=v+(p.length>0?" "+p:p);continue}N=!1}const C=eR(x).join(":"),R=y?C+e1:C,D=R+S;if(u.includes(D))continue;u.push(D);const A=c(S,N);for(let M=0;M<A.length;++M){const O=A[M];u.push(R+O)}p=v+(p.length>0?" "+p:p)}return p};function rR(){let n=0,a,s,o="";for(;n<arguments.length;)(a=arguments[n++])&&(s=t1(a))&&(o&&(o+=" "),o+=s);return o}const t1=n=>{if(typeof n=="string")return n;let a,s="";for(let o=0;o<n.length;o++)n[o]&&(a=t1(n[o]))&&(s&&(s+=" "),s+=a);return s};function sR(n,...a){let s,o,c,u=f;function f(g){const v=a.reduce((x,y)=>y(x),n());return s=tR(v),o=s.cache.get,c=s.cache.set,u=p,p(g)}function p(g){const v=o(g);if(v)return v;const x=aR(g,s);return c(g,x),x}return function(){return u(rR.apply(null,arguments))}}const jt=n=>{const a=s=>s[n]||[];return a.isThemeGetter=!0,a},n1=/^\[(?:([a-z-]+):)?(.+)\]$/i,lR=/^\d+\/\d+$/,oR=new Set(["px","full","screen"]),iR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cR=/\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$/,uR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fr=n=>Pl(n)||oR.has(n)||lR.test(n),es=n=>Zl(n,"length",bR),Pl=n=>!!n&&!Number.isNaN(Number(n)),Nh=n=>Zl(n,"number",Pl),ei=n=>!!n&&Number.isInteger(Number(n)),hR=n=>n.endsWith("%")&&Pl(n.slice(0,-1)),Pe=n=>n1.test(n),ts=n=>iR.test(n),mR=new Set(["length","size","percentage"]),pR=n=>Zl(n,mR,a1),gR=n=>Zl(n,"position",a1),vR=new Set(["image","url"]),xR=n=>Zl(n,vR,jR),yR=n=>Zl(n,"",wR),ti=()=>!0,Zl=(n,a,s)=>{const o=n1.exec(n);return o?o[1]?typeof a=="string"?o[1]===a:a.has(o[1]):s(o[2]):!1},bR=n=>cR.test(n)&&!uR.test(n),a1=()=>!1,wR=n=>dR.test(n),jR=n=>fR.test(n),SR=()=>{const n=jt("colors"),a=jt("spacing"),s=jt("blur"),o=jt("brightness"),c=jt("borderColor"),u=jt("borderRadius"),f=jt("borderSpacing"),p=jt("borderWidth"),g=jt("contrast"),v=jt("grayscale"),x=jt("hueRotate"),y=jt("invert"),b=jt("gap"),w=jt("gradientColorStops"),N=jt("gradientColorStopPositions"),S=jt("inset"),C=jt("margin"),R=jt("opacity"),D=jt("padding"),A=jt("saturate"),M=jt("scale"),O=jt("sepia"),E=jt("skew"),_=jt("space"),U=jt("translate"),P=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],J=()=>["auto",Pe,a],Y=()=>[Pe,a],ce=()=>["",fr,es],ue=()=>["auto",Pl,Pe],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",Pe],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Pl,Pe];return{cacheSize:500,separator:":",theme:{colors:[ti],spacing:[fr,es],blur:["none","",ts,Pe],brightness:z(),borderColor:[n],borderRadius:["none","","full",ts,Pe],borderSpacing:Y(),borderWidth:ce(),contrast:z(),grayscale:ee(),hueRotate:z(),invert:ee(),gap:Y(),gradientColorStops:[n],gradientColorStopPositions:[hR,es],inset:J(),margin:J(),opacity:z(),padding:Y(),saturate:z(),scale:z(),sepia:ee(),skew:z(),space:Y(),translate:Y()},classGroups:{aspect:[{aspect:["auto","square","video",Pe]}],container:["container"],columns:[{columns:[ts]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),Pe]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ei,Pe]}],basis:[{basis:J()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pe]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",ei,Pe]}],"grid-cols":[{"grid-cols":[ti]}],"col-start-end":[{col:["auto",{span:["full",ei,Pe]},Pe]}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":[ti]}],"row-start-end":[{row:["auto",{span:[ei,Pe]},Pe]}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pe]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[D]}],px:[{px:[D]}],py:[{py:[D]}],ps:[{ps:[D]}],pe:[{pe:[D]}],pt:[{pt:[D]}],pr:[{pr:[D]}],pb:[{pb:[D]}],pl:[{pl:[D]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pe,a]}],"min-w":[{"min-w":[Pe,a,"min","max","fit"]}],"max-w":[{"max-w":[Pe,a,"none","full","min","max","fit","prose",{screen:[ts]},ts]}],h:[{h:[Pe,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pe,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pe,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pe,a,"auto","min","max","fit"]}],"font-size":[{text:["base",ts,es]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Nh]}],"font-family":[{font:[ti]}],"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",Pe]}],"line-clamp":[{"line-clamp":["none",Pl,Nh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",fr,Pe]}],"list-image":[{"list-image":["none",Pe]}],"list-style-type":[{list:["none","disc","decimal",Pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",fr,es]}],"underline-offset":[{"underline-offset":["auto",fr,Pe]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe]}],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",Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),gR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xR]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"border-w":[{border:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[R]}],"border-style":[{border:[...k(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[R]}],"divide-style":[{divide:k()}],"border-color":[{border:[c]}],"border-color-x":[{"border-x":[c]}],"border-color-y":[{"border-y":[c]}],"border-color-s":[{"border-s":[c]}],"border-color-e":[{"border-e":[c]}],"border-color-t":[{"border-t":[c]}],"border-color-r":[{"border-r":[c]}],"border-color-b":[{"border-b":[c]}],"border-color-l":[{"border-l":[c]}],"divide-color":[{divide:[c]}],"outline-style":[{outline:["",...k()]}],"outline-offset":[{"outline-offset":[fr,Pe]}],"outline-w":[{outline:[fr,es]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[fr,es]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",ts,yR]}],"shadow-color":[{shadow:[ti]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[o]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",ts,Pe]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[A]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[s]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pe]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",Pe]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[ei,Pe]}],"translate-x":[{"translate-x":[U]}],"translate-y":[{"translate-y":[U]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pe]}],accent:[{accent:["auto",n]}],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",Pe]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"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",Pe]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[fr,es,Nh]}],stroke:[{stroke:[n,"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"]}}},CR=sR(SR);function Ce(...n){return CR(J0(n))}function Xt(n,a="—"){return n==null||Number.isNaN(n)?a:n.toLocaleString()}function zu(n,a=1,s="—"){return n==null||Number.isNaN(n)?s:`${(n*100).toFixed(a)}%`}function Is(n){return n?n<1e3?`${Math.round(n)} ms`:`${(n/1e3).toFixed(2)} s`:"—"}function Gm(n){if(!n)return"—";try{return new Date(n).toLocaleString()}catch{return n}}function NR(n,a=8){return n?n.length>a?`${n.slice(0,a)}…`:n:"—"}function ER(n){if(!n)return"—";const a=Date.now()-new Date(n).getTime();if(!Number.isFinite(a)||a<0)return"—";const s=Math.floor(a/1e3);if(s<60)return`${s}s ago`;const o=Math.floor(s/60);if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const RR=[{to:"/",label:"Dashboard",icon:G0,end:!0},{to:"/providers",label:"Providers",icon:K0},{to:"/models",label:"Models",icon:vE},{to:"/combos",label:"Combos",icon:X0},{to:"/aliases",label:"Aliases",icon:wE},{to:"/api-keys",label:"API Keys",icon:F0},{to:"/requests",label:"Requests",icon:$0},{to:"/statistics",label:"Statistics",icon:RE},{to:"/audit",label:"Audit Logs",icon:UE},{to:"/settings",label:"Settings",icon:jE}];function TR(){const[n,a]=h.useState(null);return h.useEffect(()=>{let s=!1;return fetch("/api/admin/settings/system",{credentials:"include"}).then(o=>o.ok?o.json():null).then(o=>{!s&&(o!=null&&o.appVersion)&&a(o.appVersion)}).catch(()=>{}),()=>{s=!0}},[]),l.jsxs("aside",{className:"hidden w-60 shrink-0 border-r bg-sidebar text-sidebar-foreground md:flex md:flex-col",children:[l.jsxs("div",{className:"flex h-14 items-center gap-2 border-b px-4",children:[l.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-7 w-7 object-contain"}),l.jsx("div",{className:"font-semibold tracking-tight",children:"LateDev Router"})]}),l.jsx("nav",{className:"flex-1 space-y-0.5 p-2",children:RR.map(s=>l.jsxs(U0,{to:s.to,end:s.end,className:({isActive:o})=>Ce("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors",o?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[l.jsx(s.icon,{className:"h-4 w-4"}),s.label]},s.to))}),l.jsxs("div",{className:"border-t p-3 text-xs text-muted-foreground flex items-center gap-2",children:[l.jsx(PE,{className:"h-3.5 w-3.5 text-primary"})," ",n?`v${n}`:"v…"]})]})}var AR=Object.defineProperty,Fm=(n,a)=>AR(n,"name",{value:a,configurable:!0});function Xh(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}Fm(Xh,"setRef");function r1(...n){return a=>{let s=!1;const o=n.map(c=>{const u=Xh(c,a);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let c=0;c<o.length;c++){const u=o[c];typeof u=="function"?u():Xh(n[c],null)}}}}Fm(r1,"composeRefs");function Fe(...n){return h.useCallback(r1(...n),n)}Fm(Fe,"useComposedRefs");var MR=Object.defineProperty,Ra=(n,a)=>MR(n,"name",{value:a,configurable:!0});function Ua(n){const a=h.forwardRef((s,o)=>{let{children:c,...u}=s,f=null,p=!1;const g=[];Kh(c)&&typeof Vc=="function"&&(c=Vc(c._payload)),h.Children.forEach(c,b=>{var w;if(c1(b)){p=!0;const N=b;let S="child"in N.props?N.props.child:N.props.children;Kh(S)&&typeof Vc=="function"&&(S=Vc(S._payload)),f=OR(N,S),g.push((w=f==null?void 0:f.props)==null?void 0:w.children)}else g.push(b)}),f?f=h.cloneElement(f,void 0,g):!p&&h.Children.count(c)===1&&h.isValidElement(c)&&(f=c);const v=f?i1(f):void 0,x=Fe(o,v);if(!f){if(c||c===0)throw new Error(p?zR(n):_R(n));return c}const y=o1(u,f.props??{});return f.type!==h.Fragment&&(y.ref=o?x:v),h.cloneElement(f,y)});return a.displayName=`${n}.Slot`,a}Ra(Ua,"createSlot");var DR=Ua("Slot"),s1=Symbol.for("radix.slottable");function l1(n){const a=Ra(s=>"child"in s?s.children(s.child):s.children,"Slottable");return a.displayName=`${n}.Slottable`,a.__radixId=s1,a}Ra(l1,"createSlottable");var OR=Ra((n,a)=>{if("child"in n.props){const s=n.props.child;return h.isValidElement(s)?h.cloneElement(s,void 0,n.props.children(s.props.children)):null}return h.isValidElement(a)?a:null},"getSlottableElementFromSlottable");function o1(n,a){const s={...a};for(const o in a){const c=n[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?s[o]=(...p)=>{const g=u(...p);return c(...p),g}:c&&(s[o]=c):o==="style"?s[o]={...c,...u}:o==="className"&&(s[o]=[c,u].filter(Boolean).join(" "))}return{...n,...s}}Ra(o1,"mergeProps");function i1(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,s=a&&"isReactWarning"in a&&a.isReactWarning;return s?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,s=a&&"isReactWarning"in a&&a.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}Ra(i1,"getElementRef");function c1(n){return h.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===s1}Ra(c1,"isSlottable");var kR=Symbol.for("react.lazy");function Kh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===kR&&"_payload"in n&&u1(n._payload)}Ra(Kh,"isLazyComponent");function u1(n){return typeof n=="object"&&n!==null&&"then"in n}Ra(u1,"isPromiseLike");var _R=Ra(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),zR=Ra(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Vc=Yl[" use ".trim().toString()];const bb=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,wb=J0,d1=(n,a)=>s=>{var o;if((a==null?void 0:a.variants)==null)return wb(n,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:c,defaultVariants:u}=a,f=Object.keys(c).map(v=>{const x=s==null?void 0:s[v],y=u==null?void 0:u[v];if(x===null)return null;const b=bb(x)||bb(y);return c[v][b]}),p=s&&Object.entries(s).reduce((v,x)=>{let[y,b]=x;return b===void 0||(v[y]=b),v},{}),g=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((v,x)=>{let{class:y,className:b,...w}=x;return Object.entries(w).every(N=>{let[S,C]=N;return Array.isArray(C)?C.includes({...u,...p}[S]):{...u,...p}[S]===C})?[...v,y,b]:v},[]);return wb(n,f,g,s==null?void 0:s.class,s==null?void 0:s.className)},LR=d1("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-6",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),se=h.forwardRef(({className:n,variant:a,size:s,asChild:o=!1,...c},u)=>{const f=o?DR:"button";return l.jsx(f,{className:Ce(LR({variant:a,size:s,className:n})),ref:u,...c})});se.displayName="Button";const f1=h.createContext(void 0);function UR({children:n,defaultTheme:a="system",storageKey:s="latedev-theme"}){const[o,c]=h.useState(()=>localStorage.getItem(s)||a);h.useEffect(()=>{const f=window.document.documentElement;if(f.classList.remove("light","dark"),o==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(p);return}f.classList.add(o)},[o]);const u={theme:o,setTheme:f=>{localStorage.setItem(s,f),c(f)}};return l.jsx(f1.Provider,{value:u,children:n})}function IR(){const n=h.useContext(f1);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}var PR=Object.defineProperty,Jl=(n,a)=>PR(n,"name",{value:a,configurable:!0}),h1=!!(typeof window<"u"&&window.document&&window.document.createElement);function Se(n,a,{checkForDefaultPrevented:s=!0}={}){return Jl(function(c){if(n==null||n(c),s===!1||!c||!c.defaultPrevented)return a==null?void 0:a(c)},"handleEvent")}Jl(Se,"composeEventHandlers");function BR(n){var a;if(!h1)throw new Error("Cannot access window outside of the DOM");return((a=n==null?void 0:n.ownerDocument)==null?void 0:a.defaultView)??window}Jl(BR,"getOwnerWindow");function Qh(n){if(!h1)throw new Error("Cannot access document outside of the DOM");return(n==null?void 0:n.ownerDocument)??document}Jl(Qh,"getOwnerDocument");function m1(n,a=!1){const{activeElement:s}=Qh(n);if(!(s!=null&&s.nodeName))return null;if(p1(s)&&s.contentDocument)return m1(s.contentDocument.body,a);if(a){const o=s.getAttribute("aria-activedescendant");if(o){const c=Qh(s).getElementById(o);if(c)return c}}return s}Jl(m1,"getActiveElement");function p1(n){return n.tagName==="IFRAME"}Jl(p1,"isFrame");var HR=Object.defineProperty,fa=(n,a)=>HR(n,"name",{value:a,configurable:!0});function qR(n,a){const s=h.createContext(a);s.displayName=n+"Context";const o=fa(u=>{const{children:f,...p}=u,g=h.useMemo(()=>p,Object.values(p));return l.jsx(s.Provider,{value:g,children:f})},"Provider");o.displayName=n+"Provider";function c(u,f={}){const{optional:p=!1}=f,g=h.useContext(s);if(g)return g;if(a!==void 0)return a;if(!p)throw new Error(`\`${u}\` must be used within \`${n}\``)}return fa(c,"useContext"),[o,c]}fa(qR,"createContext");function Hn(n,a=[]){let s=[];function o(u,f){const p=h.createContext(f);p.displayName=u+"Context";const g=s.length;s=[...s,f];const v=fa(y=>{var R;const{scope:b,children:w,...N}=y,S=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=h.useMemo(()=>N,Object.values(N));return l.jsx(S.Provider,{value:C,children:w})},"Provider");v.displayName=u+"Provider";function x(y,b,w={}){var R;const{optional:N=!1}=w,S=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=h.useContext(S);if(C)return C;if(f!==void 0)return f;if(!N)throw new Error(`\`${y}\` must be used within \`${u}\``)}return fa(x,"useContext"),[v,x]}fa(o,"createContext");const c=fa(()=>{const u=s.map(f=>h.createContext(f));return fa(function(p){const g=(p==null?void 0:p[n])||u;return h.useMemo(()=>({[`__scope${n}`]:{...p,[n]:g}}),[p,g])},"useScope")},"createScope");return c.scopeName=n,[o,g1(c,...a)]}fa(Hn,"createContextScope");function g1(...n){const a=n[0];if(n.length===1)return a;const s=fa(()=>{const o=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return fa(function(u){const f=o.reduce((p,{useScope:g,scopeName:v})=>{const y=g(u)[`__scope${v}`];return{...p,...y}},{});return h.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])},"useComposedScopes")},"createScope");return s.scopeName=a.scopeName,s}fa(g1,"composeContextScopes");var Jt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},$R=Object.defineProperty,VR=(n,a)=>$R(n,"name",{value:a,configurable:!0}),jb=Yl[" useEffectEvent ".trim().toString()],Sb=Yl[" useInsertionEffect ".trim().toString()];function v1(n){if(typeof jb=="function")return jb(n);const a=h.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Sb=="function"?Sb(()=>{a.current=n}):Jt(()=>{a.current=n}),h.useMemo(()=>((...s)=>{var o;return(o=a.current)==null?void 0:o.call(a,...s)}),[])}VR(v1,"useEffectEvent");var YR=Object.defineProperty,yi=(n,a)=>YR(n,"name",{value:a,configurable:!0}),GR=Yl[" useInsertionEffect ".trim().toString()]||Jt;function Ia({prop:n,defaultProp:a,onChange:s=yi(()=>{},"onChange"),caller:o}){const[c,u,f]=x1({defaultProp:a,onChange:s}),p=n!==void 0,g=p?n:c,v=h.useCallback(x=>{var y;if(p){const b=y1(x)?x(n):x;b!==n&&((y=f.current)==null||y.call(f,b))}else u(x)},[p,n,u,f]);return[g,v]}yi(Ia,"useControllableState");function x1({defaultProp:n,onChange:a}){const[s,o]=h.useState(n),c=h.useRef(s),u=h.useRef(a);return GR(()=>{u.current=a},[a]),h.useEffect(()=>{var f;c.current!==s&&((f=u.current)==null||f.call(u,s),c.current=s)},[s,c]),[s,o,u]}yi(x1,"useUncontrolledState");function y1(n){return typeof n=="function"}yi(y1,"isFunction");var Cb=Symbol("RADIX:SYNC_STATE");function FR(n,a,s,o){const{prop:c,defaultProp:u,onChange:f,caller:p}=a,g=c!==void 0,v=v1(f),x=[{...s,state:u}];o&&x.push(o);const[y,b]=h.useReducer((C,R)=>{if(R.type===Cb)return{...C,state:R.state};const D=n(C,R);return g&&!Object.is(D.state,C.state)&&v(D.state),D},...x),w=y.state,N=h.useRef(w);h.useEffect(()=>{N.current!==w&&(N.current=w,g||v(w))},[w,N,g]);const S=h.useMemo(()=>c!==void 0?{...y,state:c}:y,[y,c]);return h.useEffect(()=>{g&&!Object.is(c,y.state)&&b({type:Cb,state:c})},[c,y.state,g]),[S,b]}yi(FR,"useControllableStateReducer");var XR=Object.defineProperty,KR=(n,a)=>XR(n,"name",{value:a,configurable:!0}),QR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],He=QR.reduce((n,a)=>{const s=Ua(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:f,...p}=c,g=f?s:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(g,{...p,ref:u})});return o.displayName=`Primitive.${a}`,{...n,[a]:o}},{});function Xm(n,a){n&&Sa.flushSync(()=>n.dispatchEvent(a))}KR(Xm,"dispatchDiscreteCustomEvent");var ZR=Object.defineProperty,sn=(n,a)=>ZR(n,"name",{value:a,configurable:!0});function Lu(n){const a=n+"CollectionProvider",[s,o]=Hn(a),[c,u]=s(a,{collectionRef:{current:null},itemMap:new Map}),f=sn(S=>{const{scope:C,children:R}=S,D=h.useRef(null),A=h.useRef(new Map).current;return l.jsx(c,{scope:C,itemMap:A,collectionRef:D,children:R})},"CollectionProvider");f.displayName=a;const p=n+"CollectionSlot",g=Ua(p),v=h.forwardRef((S,C)=>{const{scope:R,children:D}=S,A=u(p,R),M=Fe(C,A.collectionRef);return l.jsx(g,{ref:M,children:D})});v.displayName=p;const x=n+"CollectionItemSlot",y="data-radix-collection-item",b=Ua(x),w=h.forwardRef((S,C)=>{const{scope:R,children:D,...A}=S,M=h.useRef(null),O=Fe(C,M),E=u(x,R);return h.useEffect(()=>(E.itemMap.set(M,{ref:M,...A}),()=>void E.itemMap.delete(M))),l.jsx(b,{[y]:"",ref:O,children:D})});w.displayName=x;function N(S){const C=u(n+"CollectionConsumer",S);return h.useCallback(()=>{const D=C.collectionRef.current;if(!D)return[];const A=Array.from(D.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((E,_)=>A.indexOf(E.ref.current)-A.indexOf(_.ref.current))},[C.collectionRef,C.itemMap])}return sn(N,"useCollection"),[{Provider:f,Slot:v,ItemSlot:w},N,o]}sn(Lu,"createCollection");var Nb=new WeakMap,$t,Qn,Eh=(Qn=class extends Map{constructor(s){super(s);Wy(this,$t);mh(this,$t,[...super.keys()]),Nb.set(this,!0)}set(s,o){return Nb.get(this)&&(this.has(s)?gn(this,$t)[gn(this,$t).indexOf(s)]=s:gn(this,$t).push(s)),super.set(s,o),this}insert(s,o,c){const u=this.has(o),f=gn(this,$t).length,p=Km(s);let g=p>=0?p:f+p;const v=g<0||g>=f?-1:g;if(v===this.size||u&&v===this.size-1||v===-1)return this.set(o,c),this;const x=this.size+(u?0:1);p<0&&g++;const y=[...gn(this,$t)];let b,w=!1;for(let N=g;N<x;N++)if(g===N){let S=y[N];y[N]===o&&(S=y[N+1]),u&&this.delete(o),b=this.get(S),this.set(o,c)}else{!w&&y[N-1]===o&&(w=!0);const S=y[w?N:N-1],C=b;b=this.get(S),this.delete(S),this.set(S,C)}return this}with(s,o,c){const u=new Qn(this);return u.insert(s,o,c),u}before(s){const o=gn(this,$t).indexOf(s)-1;if(!(o<0))return this.entryAt(o)}setBefore(s,o,c){const u=gn(this,$t).indexOf(s);return u===-1?this:this.insert(u,o,c)}after(s){let o=gn(this,$t).indexOf(s);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(s,o,c){const u=gn(this,$t).indexOf(s);return u===-1?this:this.insert(u+1,o,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return mh(this,$t,[]),super.clear()}delete(s){const o=super.delete(s);return o&&gn(this,$t).splice(gn(this,$t).indexOf(s),1),o}deleteAt(s){const o=this.keyAt(s);return o!==void 0?this.delete(o):!1}at(s){const o=iu(gn(this,$t),s);if(o!==void 0)return this.get(o)}entryAt(s){const o=iu(gn(this,$t),s);if(o!==void 0)return[o,this.get(o)]}indexOf(s){return gn(this,$t).indexOf(s)}keyAt(s){return iu(gn(this,$t),s)}from(s,o){const c=this.indexOf(s);if(c===-1)return;let u=c+o;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.at(u)}keyFrom(s,o){const c=this.indexOf(s);if(c===-1)return;let u=c+o;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.keyAt(u)}find(s,o){let c=0;for(const u of this){if(Reflect.apply(s,o,[u,c,this]))return u;c++}}findIndex(s,o){let c=0;for(const u of this){if(Reflect.apply(s,o,[u,c,this]))return c;c++}return-1}filter(s,o){const c=[];let u=0;for(const f of this)Reflect.apply(s,o,[f,u,this])&&c.push(f),u++;return new Qn(c)}map(s,o){const c=[];let u=0;for(const f of this)c.push([f[0],Reflect.apply(s,o,[f,u,this])]),u++;return new Qn(c)}reduce(...s){const[o,c]=s;let u=0,f=c??this.at(0);for(const p of this)u===0&&s.length===1?f=p:f=Reflect.apply(o,this,[f,p,u,this]),u++;return f}reduceRight(...s){const[o,c]=s;let u=c??this.at(-1);for(let f=this.size-1;f>=0;f--){const p=this.at(f);f===this.size-1&&s.length===1?u=p:u=Reflect.apply(o,this,[u,p,f,this])}return u}toSorted(s){const o=[...this.entries()].sort(s);return new Qn(o)}toReversed(){const s=new Qn;for(let o=this.size-1;o>=0;o--){const c=this.keyAt(o),u=this.get(c);s.set(c,u)}return s}toSpliced(...s){const o=[...this.entries()];return o.splice(...s),new Qn(o)}slice(s,o){const c=new Qn;let u=this.size-1;if(s===void 0)return c;s<0&&(s=s+this.size),o!==void 0&&o>0&&(u=o-1);for(let f=s;f<=u;f++){const p=this.keyAt(f),g=this.get(p);c.set(p,g)}return c}every(s,o){let c=0;for(const u of this){if(!Reflect.apply(s,o,[u,c,this]))return!1;c++}return!0}some(s,o){let c=0;for(const u of this){if(Reflect.apply(s,o,[u,c,this]))return!0;c++}return!1}},$t=new WeakMap,sn(Qn,"OrderedDict"),Qn);function iu(n,a){if("at"in Array.prototype)return Array.prototype.at.call(n,a);const s=b1(n,a);return s===-1?void 0:n[s]}sn(iu,"at");function b1(n,a){const s=n.length,o=Km(a),c=o>=0?o:s+o;return c<0||c>=s?-1:c}sn(b1,"toSafeIndex");function Km(n){return n!==n||n===0?0:Math.trunc(n)}sn(Km,"toSafeInteger");function JR(n){const a=n+"CollectionProvider",[s,o]=Hn(a),[c,u]=s(a,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Eh,setItemMap:sn(()=>{},"setItemMap")}),f=sn(({state:A,...M})=>A?l.jsx(g,{...M,state:A}):l.jsx(p,{...M}),"CollectionProvider");f.displayName=a;const p=sn(A=>{const M=C();return l.jsx(g,{...A,state:M})},"CollectionInit");p.displayName=a+"Init";const g=sn(A=>{const{scope:M,children:O,state:E}=A,_=h.useRef(null),[U,P]=h.useState(null),$=Fe(_,P),[J,Y]=E;return h.useEffect(()=>{if(!U)return;const ce=S1(()=>{});return ce.observe(U,{childList:!0,subtree:!0}),()=>{ce.disconnect()}},[U]),l.jsx(c,{scope:M,itemMap:J,setItemMap:Y,collectionRef:$,collectionRefObject:_,collectionElement:U,children:O})},"CollectionProviderImpl");g.displayName=a+"Impl";const v=n+"CollectionSlot",x=Ua(v),y=h.forwardRef((A,M)=>{const{scope:O,children:E}=A,_=u(v,O),U=Fe(M,_.collectionRef);return l.jsx(x,{ref:U,children:E})});y.displayName=v;const b=n+"CollectionItemSlot",w="data-radix-collection-item",N=Ua(b),S=h.forwardRef((A,M)=>{const{scope:O,children:E,..._}=A,U=h.useRef(null),[P,$]=h.useState(null),J=Fe(M,U,$),Y=u(b,O),{setItemMap:ce}=Y,ue=h.useRef(_);w1(ue.current,_)||(ue.current=_);const B=ue.current;return h.useEffect(()=>{const k=B;return ce(q=>P?q.has(P)?q.set(P,{...k,element:P}).toSorted(Zh):(q.set(P,{...k,element:P}),q.toSorted(Zh)):q),()=>{ce(q=>!P||!q.has(P)?q:(q.delete(P),new Eh(q)))}},[P,B,ce]),l.jsx(N,{[w]:"",ref:J,children:E})});S.displayName=b;function C(){return h.useState(new Eh)}sn(C,"useInitCollection");function R(A){const{itemMap:M}=u(n+"CollectionConsumer",A);return M}return sn(R,"useCollection"),[{Provider:f,Slot:y,ItemSlot:S},{createCollectionScope:o,useCollection:R,useInitCollection:C}]}sn(JR,"createCollection");function w1(n,a){if(n===a)return!0;if(typeof n!="object"||typeof a!="object"||n==null||a==null)return!1;const s=Object.keys(n),o=Object.keys(a);if(s.length!==o.length)return!1;for(const c of s)if(!Object.prototype.hasOwnProperty.call(a,c)||n[c]!==a[c])return!1;return!0}sn(w1,"shallowEqual");function j1(n,a){return!!(a.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}sn(j1,"isElementPreceding");function Zh(n,a){return!n[1].element||!a[1].element?0:j1(n[1].element,a[1].element)?-1:1}sn(Zh,"sortByDocumentPosition");function S1(n){return new MutationObserver(s=>{for(const o of s)if(o.type==="childList"){n();return}})}sn(S1,"getChildListObserver");var WR=Object.defineProperty,eT=(n,a)=>WR(n,"name",{value:a,configurable:!0}),tT=h.createContext(void 0);function bi(n){const a=h.useContext(tT);return n||a||"ltr"}eT(bi,"useDirection");var nT=Object.defineProperty,aT=(n,a)=>nT(n,"name",{value:a,configurable:!0});function ma(n){const a=h.useRef(n);return h.useEffect(()=>{a.current=n}),h.useMemo(()=>((...s)=>{var o;return(o=a.current)==null?void 0:o.call(a,...s)}),[])}aT(ma,"useCallbackRef");var rT=Object.defineProperty,rn=(n,a)=>rT(n,"name",{value:a,configurable:!0}),Jh="dismissableLayer.update",sT="dismissableLayer.pointerDownOutside",lT="dismissableLayer.focusOutside",Eb,C1=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Uu=h.forwardRef(rn(function(a,s){const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:g,onDismiss:v,...x}=a,y=h.useContext(C1),[b,w]=h.useState(null),N=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=h.useState({}),C=Fe(s,w),R=Array.from(y.layers),[D]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),A=D?R.indexOf(D):-1,M=b?R.indexOf(b):-1,O=y.layersWithOutsidePointerEventsDisabled.size>0,E=M>=A,_=h.useRef(!1),U=E1(Y=>{f==null||f(Y),g==null||g(Y),Y.defaultPrevented||v==null||v()},{ownerDocument:N,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(Y=>{if(!(Y instanceof Node))return!1;const ce=[...y.branches].some(ue=>ue.contains(Y));return E&&!ce},[y.branches,E])}),P=R1(Y=>{if(c&&_.current)return;const ce=Y.target;[...y.branches].some(B=>B.contains(ce))||(p==null||p(Y),g==null||g(Y),Y.defaultPrevented||v==null||v())},N),$=b?M===R.length-1:!1,J=ma(Y=>{Y.key==="Escape"&&(u==null||u(Y),!Y.defaultPrevented&&v&&(Y.preventDefault(),v()))});return h.useEffect(()=>{if($)return N.addEventListener("keydown",J,{capture:!0}),()=>N.removeEventListener("keydown",J,{capture:!0})},[N,$,J]),h.useEffect(()=>{if(b)return o&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Eb=N.body.style.pointerEvents,N.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(b)),y.layers.add(b),Wh(),()=>{o&&(y.layersWithOutsidePointerEventsDisabled.delete(b),y.layersWithOutsidePointerEventsDisabled.size===0&&(N.body.style.pointerEvents=Eb))}},[b,N,o,y]),h.useEffect(()=>()=>{b&&(y.layers.delete(b),y.layersWithOutsidePointerEventsDisabled.delete(b),Wh())},[b,y]),h.useEffect(()=>{const Y=rn(()=>S({}),"handleUpdate");return document.addEventListener(Jh,Y),()=>document.removeEventListener(Jh,Y)},[]),l.jsx(He.div,{...x,ref:C,style:{pointerEvents:O?E?"auto":"none":void 0,...a.style},onFocusCapture:Se(a.onFocusCapture,P.onFocusCapture),onBlurCapture:Se(a.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Se(a.onPointerDownCapture,U.onPointerDownCapture)})},"DismissableLayer"));function N1(){const n=h.useContext(C1),[a,s]=h.useState(null);return h.useEffect(()=>{if(a)return n.dismissableSurfaces.add(a),()=>{n.dismissableSurfaces.delete(a)}},[a,n.dismissableSurfaces]),s}rn(N1,"useDismissableLayerSurface");var oT=rn(()=>!0,"IS_TRUE");function E1(n,a){const{ownerDocument:s=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:u,shouldHandlePointerDownOutside:f=oT}=a,p=ma(n),g=h.useRef(!1),v=h.useRef(!1),x=h.useRef(new Map),y=h.useRef(()=>{});return h.useEffect(()=>{function b(){v.current=!1,c.current=!1,x.current.clear()}rn(b,"resetOutsideInteraction");function w(){return Array.from(x.current.values()).some(Boolean)}rn(w,"isOutsideInteractionIntercepted");function N(A){if(!v.current)return;const M=A.target;M instanceof Node&&[...u].some(E=>E.contains(M))||x.current.set(A.type,!0),A.type==="click"&&window.setTimeout(()=>{v.current&&y.current()},0)}rn(N,"handleInteractionCapture");function S(A){v.current&&x.current.set(A.type,!1)}rn(S,"handleInteractionBubble");const C=rn(A=>{if(A.target&&!g.current){let M=function(){s.removeEventListener("click",y.current);const E=w();b(),E||Qm(sT,p,O,{discrete:!0})};if(rn(M,"handleAndDispatchPointerDownOutsideEvent"),!f(A.target)){s.removeEventListener("click",y.current),b(),g.current=!1;return}const O={originalEvent:A};v.current=!0,c.current=o&&A.button===0,x.current.clear(),!o||A.button!==0?M():(s.removeEventListener("click",y.current),y.current=M,s.addEventListener("click",y.current,{once:!0}))}else s.removeEventListener("click",y.current),b();g.current=!1},"handlePointerDown"),R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const A of R)s.addEventListener(A,N,!0),s.addEventListener(A,S);const D=window.setTimeout(()=>{s.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(D),s.removeEventListener("pointerdown",C),s.removeEventListener("click",y.current);for(const A of R)s.removeEventListener(A,N,!0),s.removeEventListener(A,S)}},[s,p,o,c,u,f]),{onPointerDownCapture:rn(()=>g.current=!0,"onPointerDownCapture")}}rn(E1,"usePointerDownOutside");function R1(n,a=globalThis==null?void 0:globalThis.document){const s=ma(n),o=h.useRef(!1);return h.useEffect(()=>{const c=rn(u=>{u.target&&!o.current&&Qm(lT,s,{originalEvent:u},{discrete:!1})},"handleFocus");return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,s]),{onFocusCapture:rn(()=>o.current=!0,"onFocusCapture"),onBlurCapture:rn(()=>o.current=!1,"onBlurCapture")}}rn(R1,"useFocusOutside");function Wh(){const n=new CustomEvent(Jh);document.dispatchEvent(n)}rn(Wh,"dispatchUpdate");function Qm(n,a,s,{discrete:o}){const c=s.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:s});a&&c.addEventListener(n,a,{once:!0}),o?Xm(c,u):c.dispatchEvent(u)}rn(Qm,"handleAndDispatchCustomEvent");var iT=Object.defineProperty,Zm=(n,a)=>iT(n,"name",{value:a,configurable:!0}),Yc=0,_a=null;function cT(n){return wi(),n.children}Zm(cT,"FocusGuards");function wi(){h.useEffect(()=>{_a||(_a={start:em(),end:em()});const{start:n,end:a}=_a;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==a&&document.body.insertAdjacentElement("beforeend",a),Yc++,()=>{Yc===1&&(_a==null||_a.start.remove(),_a==null||_a.end.remove(),_a=null),Yc=Math.max(0,Yc-1)}},[])}Zm(wi,"useFocusGuards");function em(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}Zm(em,"createFocusGuard");var uT=Object.defineProperty,wn=(n,a)=>uT(n,"name",{value:a,configurable:!0}),Rh="focusScope.autoFocusOnMount",Th="focusScope.autoFocusOnUnmount",Rb={bubbles:!1,cancelable:!0},Jm=h.forwardRef(wn(function(a,s){const{loop:o=!1,trapped:c=!1,onMountAutoFocus:u,onUnmountAutoFocus:f,...p}=a,[g,v]=h.useState(null),x=ma(u),y=ma(f),b=h.useRef(null),w=Fe(s,v),N=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(c){let C=function(M){if(N.paused||!g)return;const O=M.target;g.contains(O)?b.current=O:hr(b.current,{select:!0})},R=function(M){if(N.paused||!g)return;const O=M.relatedTarget;O!==null&&(g.contains(O)||hr(b.current,{select:!0}))},D=function(M){if(document.activeElement===document.body)for(const E of M)E.removedNodes.length>0&&hr(g)};wn(C,"handleFocusIn"),wn(R,"handleFocusOut"),wn(D,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",R);const A=new MutationObserver(D);return g&&A.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",R),A.disconnect()}}},[c,g,N.paused]),h.useEffect(()=>{if(g){Tb.add(N);const C=document.activeElement;if(!g.contains(C)){const D=new CustomEvent(Rh,Rb);g.addEventListener(Rh,x),g.dispatchEvent(D),D.defaultPrevented||(T1(k1(Wm(g)),{select:!0}),document.activeElement===C&&hr(g))}return()=>{g.removeEventListener(Rh,x),setTimeout(()=>{const D=new CustomEvent(Th,Rb);g.addEventListener(Th,y),g.dispatchEvent(D),D.defaultPrevented||hr(C??document.body,{select:!0}),g.removeEventListener(Th,y),Tb.remove(N)},0)}}},[g,x,y,N]);const S=h.useCallback(C=>{if(!o&&!c||N.paused)return;const R=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,D=document.activeElement;if(R&&D){const A=C.currentTarget,[M,O]=A1(A);M&&O?!C.shiftKey&&D===O?(C.preventDefault(),o&&hr(M,{select:!0})):C.shiftKey&&D===M&&(C.preventDefault(),o&&hr(O,{select:!0})):D===A&&C.preventDefault()}},[o,c,N.paused]);return l.jsx(He.div,{tabIndex:-1,...p,ref:w,onKeyDown:S})},"FocusScope"));function T1(n,{select:a=!1}={}){const s=document.activeElement;for(const o of n)if(hr(o,{select:a}),document.activeElement!==s)return}wn(T1,"focusFirst");function A1(n){const a=Wm(n),s=tm(a,n),o=tm(a.reverse(),n);return[s,o]}wn(A1,"getTabbableEdges");function Wm(n){const a=[],s=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:wn(o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;s.nextNode();)a.push(s.currentNode);return a}wn(Wm,"getTabbableCandidates");function tm(n,a){const s=typeof a.checkVisibility=="function"&&a.checkVisibility({checkVisibilityCSS:!0});for(const o of n)if(!(s?!o.checkVisibility({checkVisibilityCSS:!0}):M1(o,{upTo:a})))return o}wn(tm,"findVisible");function M1(n,{upTo:a}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(a!==void 0&&n===a)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}wn(M1,"isHidden");function D1(n){return n instanceof HTMLInputElement&&"select"in n}wn(D1,"isSelectableInput");function hr(n,{select:a=!1}={}){if(n&&n.focus){const s=document.activeElement;n.focus({preventScroll:!0}),n!==s&&D1(n)&&a&&n.select()}}wn(hr,"focus");var Tb=O1();function O1(){let n=[];return{add(a){const s=n[0];a!==s&&(s==null||s.pause()),n=nm(n,a),n.unshift(a)},remove(a){var s;n=nm(n,a),(s=n[0])==null||s.resume()}}}wn(O1,"createFocusScopesStack");function nm(n,a){const s=[...n],o=s.indexOf(a);return o!==-1&&s.splice(o,1),s}wn(nm,"arrayRemove");function k1(n){return n.filter(a=>a.tagName!=="A")}wn(k1,"removeLinks");var dT=Object.defineProperty,fT=(n,a)=>dT(n,"name",{value:a,configurable:!0}),hT=Yl[" useId ".trim().toString()]||(()=>{}),mT=0;function Na(n){const[a,s]=h.useState(hT());return Jt(()=>{n||s(o=>o??String(mT++))},[n]),n||(a?`radix-${a}`:"")}fT(Na,"useId");const pT=["top","right","bottom","left"],cs=Math.min,gr=Math.max,vu=Math.round,Gc=Math.floor,vr=n=>({x:n,y:n}),gT={left:"right",right:"left",bottom:"top",top:"bottom"};function _1(n,a,s){return gr(n,cs(a,s))}function br(n,a){return typeof n=="function"?n(a):n}function us(n){return n.split("-")[0]}function Wl(n){return n.split("-")[1]}function ep(n){return n==="x"?"y":"x"}function tp(n){return n==="y"?"height":"width"}function La(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function np(n){return ep(La(n))}function vT(n,a,s){s===void 0&&(s=!1);const o=Wl(n),c=np(n),u=tp(c);let f=c==="x"?o===(s?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=xu(f)),[f,xu(f)]}function xT(n){const a=xu(n);return[am(n),a,am(a)]}function am(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Ab=["left","right"],Mb=["right","left"],yT=["top","bottom"],bT=["bottom","top"];function wT(n,a,s){switch(n){case"top":case"bottom":return s?a?Mb:Ab:a?Ab:Mb;case"left":case"right":return a?yT:bT;default:return[]}}function jT(n,a,s,o){const c=Wl(n);let u=wT(us(n),s==="start",o);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(am)))),u}function xu(n){const a=us(n);return gT[a]+n.slice(a.length)}function ST(n){var a,s,o,c;return{top:(a=n.top)!=null?a:0,right:(s=n.right)!=null?s:0,bottom:(o=n.bottom)!=null?o:0,left:(c=n.left)!=null?c:0}}function z1(n){return typeof n!="number"?ST(n):{top:n,right:n,bottom:n,left:n}}function yu(n){const{x:a,y:s,width:o,height:c}=n;return{width:o,height:c,top:s,left:a,right:a+o,bottom:s+c,x:a,y:s}}function Db(n,a,s){let{reference:o,floating:c}=n;const u=La(a),f=np(a),p=tp(f),g=us(a),v=u==="y",x=o.x+o.width/2-c.width/2,y=o.y+o.height/2-c.height/2,b=o[p]/2-c[p]/2;let w;switch(g){case"top":w={x,y:o.y-c.height};break;case"bottom":w={x,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y};break;case"left":w={x:o.x-c.width,y};break;default:w={x:o.x,y:o.y}}const N=Wl(a);return N&&(w[f]+=b*(N==="end"?1:-1)*(s&&v?-1:1)),w}async function CT(n,a){var s;a===void 0&&(a={});const{x:o,y:c,platform:u,rects:f,elements:p,strategy:g}=n,{boundary:v="clippingAncestors",rootBoundary:x="viewport",elementContext:y="floating",altBoundary:b=!1,padding:w=0}=br(a,n),N=z1(w),C=p[b?y==="floating"?"reference":"floating":y],R=yu(await u.getClippingRect({element:(s=await(u.isElement==null?void 0:u.isElement(C)))==null||s?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(p.floating)),boundary:v,rootBoundary:x,strategy:g})),D=y==="floating"?{x:o,y:c,width:f.floating.width,height:f.floating.height}:f.reference,A=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),M=await(u.isElement==null?void 0:u.isElement(A))&&await(u.getScale==null?void 0:u.getScale(A))||{x:1,y:1},O=yu(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:D,offsetParent:A,strategy:g}):D);return{top:(R.top-O.top+N.top)/M.y,bottom:(O.bottom-R.bottom+N.bottom)/M.y,left:(R.left-O.left+N.left)/M.x,right:(O.right-R.right+N.right)/M.x}}const NT=50,ET=async(n,a,s)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:f}=s,p=f.detectOverflow?f:{...f,detectOverflow:CT},g=await(f.isRTL==null?void 0:f.isRTL(a));let v=await f.getElementRects({reference:n,floating:a,strategy:c}),{x,y}=Db(v,o,g),b=o,w=0;const N={};for(let S=0;S<u.length;S++){const C=u[S];if(!C)continue;const{name:R,fn:D}=C,{x:A,y:M,data:O,reset:E}=await D({x,y,initialPlacement:o,placement:b,strategy:c,middlewareData:N,rects:v,platform:p,elements:{reference:n,floating:a}});x=A??x,y=M??y,N[R]={...N[R],...O},E&&w<NT&&(w++,typeof E=="object"&&(E.placement&&(b=E.placement),E.rects&&(v=E.rects===!0?await f.getElementRects({reference:n,floating:a,strategy:c}):E.rects),{x,y}=Db(v,b,g)),S=-1)}return{x,y,placement:b,strategy:c,middlewareData:N}},RT=n=>({name:"arrow",options:n,async fn(a){const{x:s,y:o,placement:c,rects:u,platform:f,elements:p,middlewareData:g}=a,{element:v,padding:x=0}=br(n,a)||{};if(v==null)return{};const y=z1(x),b={x:s,y:o},w=np(c),N=tp(w),S=await f.getDimensions(v),C=w==="y",R=C?"top":"left",D=C?"bottom":"right",A=C?"clientHeight":"clientWidth",M=u.reference[N]+u.reference[w]-b[w]-u.floating[N],O=b[w]-u.reference[w],E=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v));let _=E?E[A]:0;(!_||!await(f.isElement==null?void 0:f.isElement(E)))&&(_=p.floating[A]||u.floating[N]);const U=M/2-O/2,P=_/2-S[N]/2-1,$=cs(y[R],P),J=cs(y[D],P),Y=_-S[N]-J,ce=_/2-S[N]/2+U,ue=_1($,ce,Y),B=!g.arrow&&Wl(c)!=null&&ce!==ue&&u.reference[N]/2-(ce<$?$:J)-S[N]/2<0,k=B?ce<$?ce-$:ce-Y:0;return{[w]:b[w]+k,data:{[w]:ue,centerOffset:ce-ue-k,...B&&{alignmentOffset:k}},reset:B}}}),TT=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var s,o;const{placement:c,middlewareData:u,rects:f,initialPlacement:p,platform:g,elements:v}=a,{mainAxis:x=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:S=!0,...C}=br(n,a);if((s=u.arrow)!=null&&s.alignmentOffset)return{};const R=us(c),D=La(p),A=us(p)===p,M=await(g.isRTL==null?void 0:g.isRTL(v.floating)),O=b||(A||!S?[xu(p)]:xT(p)),E=N!=="none";!b&&E&&O.push(...jT(p,S,N,M));const _=[p,...O],U=await g.detectOverflow(a,C),P=[];let $=((o=u.flip)==null?void 0:o.overflows)||[];if(x&&P.push(U[R]),y){const ue=vT(c,f,M);P.push(U[ue[0]],U[ue[1]])}if($=[...$,{placement:c,overflows:P}],!P.every(ue=>ue<=0)){var J,Y;const ue=(((J=u.flip)==null?void 0:J.index)||0)+1,B=_[ue];if(B&&(!(y==="alignment"?D!==La(B):!1)||$.every(Z=>La(Z.placement)===D?Z.overflows[0]>0:!0)))return{data:{index:ue,overflows:$},reset:{placement:B}};let k=(Y=$.filter(q=>q.overflows[0]<=0).sort((q,Z)=>q.overflows[1]-Z.overflows[1])[0])==null?void 0:Y.placement;if(!k)switch(w){case"bestFit":{var ce;const q=(ce=$.filter(Z=>{if(E){const ee=La(Z.placement);return ee===D||ee==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ee=>ee>0).reduce((ee,te)=>ee+te,0)]).sort((Z,ee)=>Z[1]-ee[1])[0])==null?void 0:ce[0];q&&(k=q);break}case"initialPlacement":k=p;break}if(c!==k)return{reset:{placement:k}}}return{}}}};function Ob(n,a){return{top:n.top-a.height,right:n.right-a.width,bottom:n.bottom-a.height,left:n.left-a.width}}function kb(n){return pT.some(a=>n[a]>=0)}const AT=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(a){const{rects:s,platform:o}=a,{strategy:c="referenceHidden",...u}=br(n,a);switch(c){case"referenceHidden":{const f=await o.detectOverflow(a,{...u,elementContext:"reference"}),p=Ob(f,s.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:kb(p)}}}case"escaped":{const f=await o.detectOverflow(a,{...u,altBoundary:!0}),p=Ob(f,s.floating);return{data:{escapedOffsets:p,escaped:kb(p)}}}default:return{}}}}},L1=new Set(["left","top"]);async function MT(n,a){const{placement:s,platform:o,elements:c}=n,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),f=us(s),p=Wl(s),g=La(s)==="y",v=L1.has(f)?-1:1,x=u&&g?-1:1,y=br(a,n);let{mainAxis:b,crossAxis:w,alignmentAxis:N}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof N=="number"&&(w=p==="end"?N*-1:N),g?{x:w*x,y:b*v}:{x:b*v,y:w*x}}const DT=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var s,o;const{x:c,y:u,placement:f,middlewareData:p}=a,g=await MT(a,n);return f===((s=p.offset)==null?void 0:s.placement)&&(o=p.arrow)!=null&&o.alignmentOffset?{}:{x:c+g.x,y:u+g.y,data:{...g,placement:f}}}}},OT=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(a){const{x:s,y:o,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:g={fn:D=>{let{x:A,y:M}=D;return{x:A,y:M}}},...v}=br(n,a),x={x:s,y:o},y=await u.detectOverflow(a,v),b=La(c),w=ep(b);let N=x[w],S=x[b];const C=(D,A)=>_1(A+y[D==="y"?"top":"left"],A,A-y[D==="y"?"bottom":"right"]);f&&(N=C(w,N)),p&&(S=C(b,S));const R=g.fn({...a,[w]:N,[b]:S});return{...R,data:{x:R.x-s,y:R.y-o,enabled:{[w]:f,[b]:p}}}}}},kT=function(n){return n===void 0&&(n={}),{options:n,fn(a){var s,o;const{x:c,y:u,placement:f,rects:p,middlewareData:g}=a,{offset:v=0,mainAxis:x=!0,crossAxis:y=!0}=br(n,a),b={x:c,y:u},w=La(f),N=ep(w);let S=b[N],C=b[w];const R=br(v,a),D=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(s=R.mainAxis)!=null?s:0,crossAxis:(o=R.crossAxis)!=null?o:0};if(x){const O=N==="y"?"height":"width",E=p.reference[N]-p.floating[O]+D.mainAxis,_=p.reference[N]+p.reference[O]-D.mainAxis;S<E?S=E:S>_&&(S=_)}if(y){var A,M;const O=N==="y"?"width":"height",E=L1.has(us(f)),_=p.reference[w]-p.floating[O]+(E&&((A=g.offset)==null?void 0:A[w])||0)+(E?0:D.crossAxis),U=p.reference[w]+p.reference[O]+(E?0:((M=g.offset)==null?void 0:M[w])||0)-(E?D.crossAxis:0);C<_?C=_:C>U&&(C=U)}return{[N]:S,[w]:C}}}},_T=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(a){const{placement:s,rects:o,platform:c,elements:u}=a,{apply:f=()=>{},...p}=br(n,a),g=await c.detectOverflow(a,p),v=us(s),x=Wl(s),y=La(s)==="y",{width:b,height:w}=o.floating;let N,S;v==="top"||v==="bottom"?(N=v,S=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(S=v,N=x==="end"?"top":"bottom");const C=w-g.top-g.bottom,R=b-g.left-g.right,D=cs(w-g[N],C),A=cs(b-g[S],R),M=a.middlewareData.shift,O=!M;let E=D,_=A;M!=null&&M.enabled.x&&(_=R),M!=null&&M.enabled.y&&(E=C),O&&!x&&(y?_=b-2*gr(g.left,g.right):E=w-2*gr(g.top,g.bottom)),await f({...a,availableWidth:_,availableHeight:E});const U=await c.getDimensions(u.floating);return b!==U.width||w!==U.height?{reset:{rects:!0}}:{}}}};function Iu(){return typeof window<"u"}function eo(n){return U1(n)?(n.nodeName||"").toLowerCase():"#document"}function _n(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function Nr(n){var a;return(a=(U1(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function U1(n){return Iu()?n instanceof Node||n instanceof _n(n).Node:!1}function Pa(n){return Iu()?n instanceof Element||n instanceof _n(n).Element:!1}function fs(n){return Iu()?n instanceof HTMLElement||n instanceof _n(n).HTMLElement:!1}function _b(n){return!Iu()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof _n(n).ShadowRoot}function Pu(n){const{overflow:a,overflowX:s,overflowY:o,display:c}=Ba(n);return/auto|scroll|overlay|hidden|clip/.test(a+o+s)&&c!=="inline"&&c!=="contents"}function zT(n){return/^(table|td|th)$/.test(eo(n))}function Bu(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const LT=/transform|translate|scale|rotate|perspective|filter/,UT=/paint|layout|strict|content/,Os=n=>!!n&&n!=="none";let Ah;function ap(n){const a=Pa(n)?Ba(n):n;return Os(a.transform)||Os(a.translate)||Os(a.scale)||Os(a.rotate)||Os(a.perspective)||!rp()&&(Os(a.backdropFilter)||Os(a.filter))||LT.test(a.willChange||"")||UT.test(a.contain||"")}function IT(n){let a=Ps(n);for(;fs(a)&&!oi(a);){if(ap(a))return a;if(Bu(a))return null;a=Ps(a)}return null}function rp(){return Ah==null&&(Ah=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ah}function oi(n){return/^(html|body|#document)$/.test(eo(n))}function Ba(n){return _n(n).getComputedStyle(n)}function Hu(n){return Pa(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Ps(n){if(eo(n)==="html")return n;const a=n.assignedSlot||n.parentNode||_b(n)&&n.host||Nr(n);return _b(a)?a.host:a}function I1(n){const a=Ps(n);return oi(a)?(n.ownerDocument||n).body:fs(a)&&Pu(a)?a:I1(a)}function ii(n,a,s){var o;a===void 0&&(a=[]),s===void 0&&(s=!0);const c=I1(n),u=c===((o=n.ownerDocument)==null?void 0:o.body),f=_n(c);if(u){const p=rm(f);return a.concat(f,f.visualViewport||[],Pu(c)?c:[],p&&s?ii(p):[])}else return a.concat(c,ii(c,[],s))}function rm(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function P1(n){const a=Ba(n);let s=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=fs(n),u=c?n.offsetWidth:s,f=c?n.offsetHeight:o,p=vu(s)!==u||vu(o)!==f;return p&&(s=u,o=f),{width:s,height:o,$:p}}function sp(n){return Pa(n)?n:n.contextElement}function Bl(n){const a=sp(n);if(!fs(a))return vr(1);const s=a.getBoundingClientRect(),{width:o,height:c,$:u}=P1(a);let f=(u?vu(s.width):s.width)/o,p=(u?vu(s.height):s.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const PT=vr(0);function B1(n){const a=_n(n);return!rp()||!a.visualViewport?PT:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function BT(n,a,s){return a===void 0&&(a=!1),!!s&&a&&s===_n(n)}function Bs(n,a,s,o){a===void 0&&(a=!1),s===void 0&&(s=!1);const c=n.getBoundingClientRect(),u=sp(n);let f=vr(1);a&&(o?Pa(o)&&(f=Bl(o)):f=Bl(n));const p=BT(u,s,o)?B1(u):vr(0);let g=(c.left+p.x)/f.x,v=(c.top+p.y)/f.y,x=c.width/f.x,y=c.height/f.y;if(u&&o){const b=_n(u),w=Pa(o)?_n(o):o;let N=b,S=rm(N);for(;S&&w!==N;){const C=Bl(S),R=S.getBoundingClientRect(),D=Ba(S),A=R.left+(S.clientLeft+parseFloat(D.paddingLeft))*C.x,M=R.top+(S.clientTop+parseFloat(D.paddingTop))*C.y;g*=C.x,v*=C.y,x*=C.x,y*=C.y,g+=A,v+=M,N=_n(S),S=rm(N)}}return yu({width:x,height:y,x:g,y:v})}function qu(n,a){const s=Hu(n).scrollLeft;return a?a.left+s:Bs(Nr(n)).left+s}function H1(n,a){const s=n.getBoundingClientRect(),o=s.left+a.scrollLeft-qu(n,s),c=s.top+a.scrollTop;return{x:o,y:c}}function HT(n){let{elements:a,rect:s,offsetParent:o,strategy:c}=n;const u=c==="fixed",f=Nr(o),p=a?Bu(a.floating):!1;if(o===f||p&&u)return s;let g={scrollLeft:0,scrollTop:0},v=vr(1);const x=vr(0),y=fs(o);if((y||!u)&&((eo(o)!=="body"||Pu(f))&&(g=Hu(o)),y)){const w=Bs(o);v=Bl(o),x.x=w.x+o.clientLeft,x.y=w.y+o.clientTop}const b=f&&!y&&!u?H1(f,g):vr(0);return{width:s.width*v.x,height:s.height*v.y,x:s.x*v.x-g.scrollLeft*v.x+x.x+b.x,y:s.y*v.y-g.scrollTop*v.y+x.y+b.y}}function qT(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function $T(n){const a=Hu(n),s=n.ownerDocument.body,o=gr(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),c=gr(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let u=-a.scrollLeft+qu(n);const f=-a.scrollTop;return Ba(s).direction==="rtl"&&(u+=gr(n.clientWidth,s.clientWidth)-o),{width:o,height:c,x:u,y:f}}const VT=25;function YT(n,a,s){s===void 0&&(s="viewport");const o=s==="layoutViewport",c=_n(n),u=Nr(n),f=c.visualViewport;let p=u.clientWidth,g=u.clientHeight,v=0,x=0;if(f){const b=!rp()||a==="fixed";o?b||(v=-f.offsetLeft,x=-f.offsetTop):(p=f.width,g=f.height,b&&(v=f.offsetLeft,x=f.offsetTop))}if(qu(u)<=0){const b=u.ownerDocument,w=b.body,N=getComputedStyle(w),S=b.compatMode==="CSS1Compat"&&parseFloat(N.marginLeft)+parseFloat(N.marginRight)||0,C=Math.abs(u.clientWidth-w.clientWidth-S),R=getComputedStyle(u).scrollbarGutter==="stable both-edges"?C/2:C;R<=VT&&(p-=R)}return{width:p,height:g,x:v,y:x}}function GT(n,a){const s=Bs(n,!0,a==="fixed"),o=s.top+n.clientTop,c=s.left+n.clientLeft,u=Bl(n),f=n.clientWidth*u.x,p=n.clientHeight*u.y,g=c*u.x,v=o*u.y;return{width:f,height:p,x:g,y:v}}function zb(n,a,s){let o;if(a==="viewport"||a==="layoutViewport")o=YT(n,s,a);else if(a==="document")o=$T(Nr(n));else if(Pa(a))o=GT(a,s);else{const c=B1(n);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return yu(o)}function FT(n,a){const s=a.get(n);if(s)return s;let o=ii(n,[],!1).filter(p=>Pa(p)&&eo(p)!=="body"),c=null;const u=Ba(n).position==="fixed";let f=u?Ps(n):n;for(;Pa(f)&&!oi(f);){const p=Ba(f),g=ap(f),v=c?c.position:u?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&p.position==="static")?o=o.filter(y=>y!==f):c=p,f=Ps(f)}return a.set(n,o),o}function XT(n){let{element:a,boundary:s,rootBoundary:o,strategy:c}=n;const f=[...s==="clippingAncestors"?Bu(a)?[]:FT(a,this._c):[].concat(s),o],p=zb(a,f[0],c);let g=p.top,v=p.right,x=p.bottom,y=p.left;for(let b=1;b<f.length;b++){const w=zb(a,f[b],c);g=gr(w.top,g),v=cs(w.right,v),x=cs(w.bottom,x),y=gr(w.left,y)}return{width:v-y,height:x-g,x:y,y:g}}function KT(n){const{width:a,height:s}=P1(n);return{width:a,height:s}}function QT(n,a,s){const o=fs(a),c=Nr(a),u=s==="fixed",f=Bs(n,!0,u,a);let p={scrollLeft:0,scrollTop:0};const g=vr(0);if((o||!u)&&((eo(a)!=="body"||Pu(c))&&(p=Hu(a)),o)){const b=Bs(a,!0,u,a);g.x=b.x+a.clientLeft,g.y=b.y+a.clientTop}!o&&c&&(g.x=qu(c));const v=c&&!o&&!u?H1(c,p):vr(0),x=f.left+p.scrollLeft-g.x-v.x,y=f.top+p.scrollTop-g.y-v.y;return{x,y,width:f.width,height:f.height}}function Mh(n){return Ba(n).position==="static"}function Lb(n,a){if(!fs(n)||Ba(n).position==="fixed")return null;if(a)return a(n);let s=n.offsetParent;return Nr(n)===s&&(s=s.ownerDocument.body),s}function q1(n,a){const s=_n(n);if(Bu(n))return s;if(!fs(n)){let c=Ps(n);for(;c&&!oi(c);){if(Pa(c)&&!Mh(c))return c;c=Ps(c)}return s}let o=Lb(n,a);for(;o&&zT(o)&&Mh(o);)o=Lb(o,a);return o&&oi(o)&&Mh(o)&&!ap(o)?s:o||IT(n)||s}const ZT=async function(n){const a=this.getOffsetParent||q1,s=this.getDimensions,o=await s(n.floating);return{reference:QT(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function JT(n){return Ba(n).direction==="rtl"}const WT={convertOffsetParentRelativeRectToViewportRelativeRect:HT,getDocumentElement:Nr,getClippingRect:XT,getOffsetParent:q1,getElementRects:ZT,getClientRects:qT,getDimensions:KT,getScale:Bl,isElement:Pa,isRTL:JT};function $1(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function eA(n,a,s){let o=null,c;const u=Nr(n);function f(){var x;clearTimeout(c),(x=o)==null||x.disconnect(),o=null}function p(x,y){x===void 0&&(x=!1),y===void 0&&(y=1),f();const b=n.getBoundingClientRect(),{left:w,top:N,width:S,height:C}=b;if(x||a(),!S||!C)return;const R=Gc(N),D=Gc(u.clientWidth-(w+S)),A=Gc(u.clientHeight-(N+C)),M=Gc(w),E={rootMargin:-R+"px "+-D+"px "+-A+"px "+-M+"px",threshold:gr(0,cs(1,y))||1};let _=!0;function U(P){const $=P[0].intersectionRatio;if(!$1(b,n.getBoundingClientRect()))return p();if($!==y){if(!_)return p();$?p(!1,$):c=setTimeout(()=>{p(!1,1e-7)},1e3)}_=!1}try{o=new IntersectionObserver(U,{...E,root:u.ownerDocument})}catch{o=new IntersectionObserver(U,E)}o.observe(n)}const g=_n(n),v=()=>p(s);return g.addEventListener("resize",v),p(!0),()=>{g.removeEventListener("resize",v),f()}}function tA(n,a,s,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,v=sp(n),x=c||u?[...v?ii(v):[],...a?ii(a):[]]:[];x.forEach(R=>{c&&R.addEventListener("scroll",s),u&&R.addEventListener("resize",s)});const y=v&&p?eA(v,s,u):null;let b=-1,w=null;f&&(w=new ResizeObserver(R=>{let[D]=R;D&&D.target===v&&w&&a&&(w.unobserve(a),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=w)==null||A.observe(a)})),s()}),v&&!g&&w.observe(v),a&&w.observe(a));let N,S=g?Bs(n):null;g&&C();function C(){const R=Bs(n);S&&!$1(S,R)&&s(),S=R,N=requestAnimationFrame(C)}return s(),()=>{var R;x.forEach(D=>{c&&D.removeEventListener("scroll",s),u&&D.removeEventListener("resize",s)}),y==null||y(),(R=w)==null||R.disconnect(),w=null,g&&cancelAnimationFrame(N)}}const nA=DT,aA=OT,rA=TT,sA=_T,lA=AT,Ub=RT,oA=kT,iA=(n,a,s)=>{const o=new Map,c=s??{},u={...WT,...c.platform,_c:o};return ET(n,a,{...c,platform:u})};var cA=typeof document<"u",uA=function(){},cu=cA?h.useLayoutEffect:uA;function bu(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(typeof n=="function"&&n.toString()===a.toString())return!0;let s,o,c;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(s=n.length,s!==a.length)return!1;for(o=s;o--!==0;)if(!bu(n[o],a[o]))return!1;return!0}if(c=Object.keys(n),s=c.length,s!==Object.keys(a).length)return!1;for(o=s;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=s;o--!==0;){const u=c[o];if(!(u==="_owner"&&n.$$typeof)&&!bu(n[u],a[u]))return!1}return!0}return n!==n&&a!==a}function V1(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ib(n,a){const s=V1(n);return Math.round(a*s)/s}function Dh(n){const a=h.useRef(n);return cu(()=>{a.current=n}),a}function dA(n){n===void 0&&(n={});const{placement:a="bottom",strategy:s="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:f}={},transform:p=!0,whileElementsMounted:g,open:v}=n,[x,y]=h.useState({x:0,y:0,strategy:s,placement:a,middlewareData:{},isPositioned:!1}),[b,w]=h.useState(o);bu(b,o)||w(o);const[N,S]=h.useState(null),[C,R]=h.useState(null),D=h.useCallback(Z=>{Z!==E.current&&(E.current=Z,S(Z))},[]),A=h.useCallback(Z=>{Z!==_.current&&(_.current=Z,R(Z))},[]),M=u||N,O=f||C,E=h.useRef(null),_=h.useRef(null),U=h.useRef(x),P=g!=null,$=Dh(g),J=Dh(c),Y=Dh(v),ce=h.useCallback(()=>{if(!E.current||!_.current)return;const Z={placement:a,strategy:s,middleware:b};J.current&&(Z.platform=J.current),iA(E.current,_.current,Z).then(ee=>{const te={...ee,isPositioned:Y.current!==!1};ue.current&&!bu(U.current,te)&&(U.current=te,Sa.flushSync(()=>{y(te)}))})},[b,a,s,J,Y]);cu(()=>{v===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,y(Z=>({...Z,isPositioned:!1})))},[v]);const ue=h.useRef(!1);cu(()=>(ue.current=!0,()=>{ue.current=!1}),[]),cu(()=>{if(M&&(E.current=M),O&&(_.current=O),M&&O){if($.current)return $.current(M,O,ce);ce()}},[M,O,ce,$,P]);const B=h.useMemo(()=>({reference:E,floating:_,setReference:D,setFloating:A}),[D,A]),k=h.useMemo(()=>({reference:M,floating:O}),[M,O]),q=h.useMemo(()=>{const Z={position:s,left:0,top:0};if(!k.floating)return Z;const ee=Ib(k.floating,x.x),te=Ib(k.floating,x.y);return p?{...Z,transform:"translate("+ee+"px, "+te+"px)",...V1(k.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:ee,top:te}},[s,p,k.floating,x.x,x.y]);return h.useMemo(()=>({...x,update:ce,refs:B,elements:k,floatingStyles:q}),[x,ce,B,k,q])}const fA=n=>{function a(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:n,fn(s){const{element:o,padding:c}=typeof n=="function"?n(s):n;return o&&a(o)?o.current!=null?Ub({element:o.current,padding:c}).fn(s):{}:o?Ub({element:o,padding:c}).fn(s):{}}}},hA=(n,a)=>{const s=nA(n);return{name:s.name,fn:s.fn,options:[n,a]}},mA=(n,a)=>{const s=aA(n);return{name:s.name,fn:s.fn,options:[n,a]}},pA=(n,a)=>({fn:oA(n).fn,options:[n,a]}),gA=(n,a)=>{const s=rA(n);return{name:s.name,fn:s.fn,options:[n,a]}},vA=(n,a)=>{const s=sA(n);return{name:s.name,fn:s.fn,options:[n,a]}},xA=(n,a)=>{const s=lA(n);return{name:s.name,fn:s.fn,options:[n,a]}},yA=(n,a)=>{const s=fA(n);return{name:s.name,fn:s.fn,options:[n,a]}};var bA=Object.defineProperty,wA=(n,a)=>bA(n,"name",{value:a,configurable:!0});function $u(n){const[a,s]=h.useState(void 0);return Jt(()=>{if(n){s({width:n.offsetWidth,height:n.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let f,p;if("borderBoxSize"in u){const g=u.borderBoxSize,v=Array.isArray(g)?g[0]:g;f=v.inlineSize,p=v.blockSize}else f=n.offsetWidth,p=n.offsetHeight;s({width:f,height:p})});return o.observe(n,{box:"border-box"}),()=>o.unobserve(n)}else s(void 0)},[n]),a}wA($u,"useSize");var jA=Object.defineProperty,os=(n,a)=>jA(n,"name",{value:a,configurable:!0}),Y1="Popper",[G1,to]=Hn(Y1),[SA,F1]=G1(Y1),CA=os(n=>{const{__scopePopper:a,children:s}=n,[o,c]=h.useState(null),[u,f]=h.useState(void 0);return l.jsx(SA,{scope:a,anchor:o,onAnchorChange:c,placementState:u,setPlacementState:f,children:s})},"Popper"),NA="PopperAnchor",EA=h.forwardRef(os(function(a,s){const{__scopePopper:o,virtualRef:c,...u}=a,f=F1(NA,o),p=h.useRef(null),g=f.onAnchorChange,v=h.useCallback(S=>{p.current=S,S&&g(S)},[g]),x=Fe(s,v),y=h.useRef(null);h.useEffect(()=>{if(!c)return;const S=y.current;y.current=c.current,S!==y.current&&g(y.current)});const b=f.placementState&&Vu(f.placementState),w=b==null?void 0:b[0],N=b==null?void 0:b[1];return c?null:l.jsx(He.div,{"data-radix-popper-side":w,"data-radix-popper-align":N,...u,ref:x})},"PopperAnchor")),X1="PopperContent",[RA,p5]=G1(X1),TA=h.forwardRef(os(function(a,s){var he,xe,Ae,Ne,Oe,Qe,et;const{__scopePopper:o,side:c="bottom",sideOffset:u=0,align:f="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:w=!1,updatePositionStrategy:N="optimized",onPlaced:S,...C}=a,R=F1(X1,o),[D,A]=h.useState(null),M=Fe(s,A),[O,E]=h.useState(null),_=$u(O),U=(_==null?void 0:_.width)??0,P=(_==null?void 0:_.height)??0,$=c+(f!=="center"?"-"+f:""),J=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},Y=Array.isArray(x)?x:[x],ce=Y.length>0,ue={padding:J,boundary:Y.filter(K1),altBoundary:ce},{refs:B,floatingStyles:k,placement:q,isPositioned:Z,middlewareData:ee}=dA({strategy:"fixed",placement:$,whileElementsMounted:os((...oe)=>tA(...oe,{animationFrame:N==="always"}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[hA({mainAxis:u+P,alignmentAxis:p}),v&&mA({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?pA():void 0,...ue}),v&&gA({...ue}),vA({...ue,apply:os(({elements:oe,rects:Le,availableWidth:qe,availableHeight:_t})=>{const{width:St,height:Wt}=Le.reference,mn=oe.floating.style;mn.setProperty("--radix-popper-available-width",`${qe}px`),mn.setProperty("--radix-popper-available-height",`${_t}px`),mn.setProperty("--radix-popper-anchor-width",`${St}px`),mn.setProperty("--radix-popper-anchor-height",`${Wt}px`)},"apply")}),O&&yA({element:O,padding:g}),AA({arrowWidth:U,arrowHeight:P}),w&&xA({strategy:"referenceHidden",...ue,boundary:ce?ue.boundary:void 0})]}),te=R.setPlacementState;Jt(()=>(te(q),()=>{te(void 0)}),[q,te]);const[z,L]=Vu(q),F=ma(S);Jt(()=>{Z&&(F==null||F())},[Z,F]);const ae=(he=ee.arrow)==null?void 0:he.x,ge=(xe=ee.arrow)==null?void 0:xe.y,ye=((Ae=ee.arrow)==null?void 0:Ae.centerOffset)!==0,[G,ie]=h.useState();return Jt(()=>{D&&ie(window.getComputedStyle(D).zIndex)},[D]),l.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:Z?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(Ne=ee.transformOrigin)==null?void 0:Ne.x,(Oe=ee.transformOrigin)==null?void 0:Oe.y].join(" "),...((Qe=ee.hide)==null?void 0:Qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:l.jsx(RA,{scope:o,placedSide:z,placedAlign:L,onArrowChange:E,arrowX:ae,arrowY:ge,shouldHideArrow:ye,children:l.jsx(He.div,{"data-side":z,"data-align":L,...C,ref:M,style:{...C.style,animation:Z?(et=C.style)==null?void 0:et.animation:"none"}})})})},"PopperContent"));function K1(n){return n!==null}os(K1,"isNotNull");var AA=os(n=>({name:"transformOrigin",options:n,fn(a){var C,R,D;const{placement:s,rects:o,middlewareData:c}=a,f=((C=c.arrow)==null?void 0:C.centerOffset)!==0,p=f?0:n.arrowWidth,g=f?0:n.arrowHeight,[v,x]=Vu(s),y={start:"0%",center:"50%",end:"100%"}[x],b=(((R=c.arrow)==null?void 0:R.x)??0)+p/2,w=(((D=c.arrow)==null?void 0:D.y)??0)+g/2;let N="",S="";return v==="bottom"?(N=f?y:`${b}px`,S=`${-g}px`):v==="top"?(N=f?y:`${b}px`,S=`${o.floating.height+g}px`):v==="right"?(N=`${-g}px`,S=f?y:`${w}px`):v==="left"&&(N=`${o.floating.width+g}px`,S=f?y:`${w}px`),{data:{x:N,y:S}}}}),"transformOrigin");function Vu(n){const[a,s="center"]=n.split("-");return[a,s]}os(Vu,"getSideAndAlignFromPlacement");var lp=CA,op=EA,ip=TA,MA=Object.defineProperty,DA=(n,a)=>MA(n,"name",{value:a,configurable:!0}),cp=h.forwardRef(DA(function(a,s){var g;const{container:o,...c}=a,[u,f]=h.useState(!1);Jt(()=>f(!0),[]);const p=o||u&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?Sa.createPortal(l.jsx(He.div,{...c,ref:s}),p):null},"Portal")),OA=Object.defineProperty,wr=(n,a)=>OA(n,"name",{value:a,configurable:!0});function Q1(n,a){return h.useReducer((s,o)=>a[s][o]??s,n)}wr(Q1,"useStateMachine");var Er=wr(n=>{const{present:a,children:s}=n,o=Z1(a),c=typeof s=="function"?s({present:o.isPresent}):h.Children.only(s),u=J1(o.ref,W1(c));return typeof s=="function"||o.isPresent?h.cloneElement(c,{ref:u}):null},"Presence");function Z1(n){const[a,s]=h.useState(),o=h.useRef(null),c=h.useRef(n),u=h.useRef("none"),f=h.useRef(void 0),p=n?"mounted":"unmounted",[g,v]=Q1(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{g==="mounted"?(u.current=f.current??Ul(o.current),f.current=void 0):u.current="none"},[g]),Jt(()=>{const x=o.current,y=c.current;if(y!==n){const w=u.current,N=Ul(x);n?(f.current=N,v("MOUNT")):N==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(y&&w!==N?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,v]),Jt(()=>{if(a){let x;const y=a.ownerDocument.defaultView??window,b=wr(N=>{const C=Ul(o.current).includes(CSS.escape(N.animationName));if(N.target===a&&C&&(v("ANIMATION_END"),!c.current)){const R=a.style.animationFillMode;a.style.animationFillMode="forwards",x=y.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=R)})}},"handleAnimationEnd"),w=wr(N=>{N.target===a&&(u.current=Ul(o.current))},"handleAnimationStart");return a.addEventListener("animationstart",w),a.addEventListener("animationcancel",b),a.addEventListener("animationend",b),()=>{y.clearTimeout(x),a.removeEventListener("animationstart",w),a.removeEventListener("animationcancel",b),a.removeEventListener("animationend",b)}}else v("ANIMATION_END")},[a,v]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:h.useCallback(x=>{if(x){const y=getComputedStyle(x);o.current=y,f.current=Ul(y)}else o.current=null;s(x)},[])}}wr(Z1,"usePresence");function sm(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}wr(sm,"setRef");function J1(...n){const a=h.useRef(n);return a.current=n,h.useCallback(s=>{const o=a.current;let c=!1;const u=o.map(f=>{const p=sm(f,s);return!c&&typeof p=="function"&&(c=!0),p});if(c)return()=>{for(let f=0;f<u.length;f++){const p=u[f];typeof p=="function"?p():sm(o[f],null)}}},[])}wr(J1,"useStableComposedRefs");function Ul(n){return(n==null?void 0:n.animationName)||"none"}wr(Ul,"getAnimationName");function W1(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,s=a&&"isReactWarning"in a&&a.isReactWarning;return s?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,s=a&&"isReactWarning"in a&&a.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}wr(W1,"getElementRef");var kA=Object.defineProperty,up=(n,a)=>kA(n,"name",{value:a,configurable:!0}),Oh=!1;function ew(){const[n,a]=h.useState(Oh);return h.useEffect(()=>{Oh||(Oh=!0,a(!0))},[]),n}up(ew,"useIsHydrated");var tw=Yl[" useSyncExternalStore ".trim().toString()];function nw(){return()=>{}}up(nw,"subscribe");function aw(){return tw(nw,()=>!0,()=>!1)}up(aw,"useIsHydratedModern");var _A=typeof tw=="function"?aw:ew,zA=Object.defineProperty,qs=(n,a)=>zA(n,"name",{value:a,configurable:!0}),kh="rovingFocusGroup.onEntryFocus",LA={bubbles:!1,cancelable:!0},Yu="RovingFocusGroup",[lm,rw,UA]=Lu(Yu),[IA,Gu]=Hn(Yu,[UA]),[PA,BA]=IA(Yu),HA=h.forwardRef(qs(function(a,s){return l.jsx(lm.Provider,{scope:a.__scopeRovingFocusGroup,children:l.jsx(lm.Slot,{scope:a.__scopeRovingFocusGroup,children:l.jsx(qA,{...a,ref:s})})})},"RovingFocusGroup")),qA=h.forwardRef(qs(function(a,s){const{__scopeRovingFocusGroup:o,orientation:c,loop:u=!1,dir:f,currentTabStopId:p,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:x,preventScrollOnEntryFocus:y=!1,...b}=a,w=h.useRef(null),N=Fe(s,w),S=bi(f),[C,R]=Ia({prop:p,defaultProp:g??null,onChange:v,caller:Yu}),[D,A]=h.useState(!1),M=ma(x),O=rw(o),E=h.useRef(!1),[_,U]=h.useState(0);return h.useEffect(()=>{const P=w.current;if(P)return P.addEventListener(kh,M),()=>P.removeEventListener(kh,M)},[M]),l.jsx(PA,{scope:o,orientation:c,dir:S,loop:u,currentTabStopId:C,onItemFocus:h.useCallback(P=>R(P),[R]),onItemShiftTab:h.useCallback(()=>A(!0),[]),onFocusableItemAdd:h.useCallback(()=>U(P=>P+1),[]),onFocusableItemRemove:h.useCallback(()=>U(P=>P-1),[]),children:l.jsx(He.div,{tabIndex:D||_===0?-1:0,"data-orientation":c,...b,ref:N,style:{outline:"none",...a.style},onMouseDown:Se(a.onMouseDown,()=>{E.current=!0}),onFocus:Se(a.onFocus,P=>{const $=!E.current;if(P.target===P.currentTarget&&$&&!D){const J=new CustomEvent(kh,LA);if(P.currentTarget.dispatchEvent(J),!J.defaultPrevented){const Y=O().filter(q=>q.focusable),ce=Y.find(q=>q.active),ue=Y.find(q=>q.id===C),k=[ce,ue,...Y].filter(Boolean).map(q=>q.ref.current);dp(k,y)}}E.current=!1}),onBlur:Se(a.onBlur,()=>A(!1))})})},"RovingFocusGroupImpl")),$A="RovingFocusGroupItem",VA=h.forwardRef(qs(function(a,s){const{__scopeRovingFocusGroup:o,focusable:c=!0,active:u=!1,tabStopId:f,children:p,...g}=a,v=Na(),x=f||v,y=BA($A,o),b=y.currentTabStopId===x,w=rw(o),{onFocusableItemAdd:N,onFocusableItemRemove:S,currentTabStopId:C}=y,R=_A();return Jt(()=>{if(!(!R||!c))return N(),()=>S()},[R,c,N,S]),h.useEffect(()=>{if(!(R||!c))return N(),()=>S()},[R,c,N,S]),l.jsx(lm.ItemSlot,{scope:o,id:x,focusable:c,active:u,children:l.jsx(He.span,{tabIndex:b?0:-1,"data-orientation":y.orientation,...g,ref:s,onMouseDown:Se(a.onMouseDown,D=>{c?y.onItemFocus(x):D.preventDefault()}),onFocus:Se(a.onFocus,()=>y.onItemFocus(x)),onKeyDown:Se(a.onKeyDown,D=>{if(D.key==="Tab"&&D.shiftKey){y.onItemShiftTab();return}if(D.target!==D.currentTarget)return;const A=lw(D,y.orientation,y.dir);if(A!==void 0){if(D.metaKey||D.ctrlKey||D.altKey||D.shiftKey)return;D.preventDefault();let O=w().filter(E=>E.focusable).map(E=>E.ref.current);if(A==="last")O.reverse();else if(A==="prev"||A==="next"){A==="prev"&&O.reverse();const E=O.indexOf(D.currentTarget);O=y.loop?ow(O,E+1):O.slice(E+1)}setTimeout(()=>dp(O))}}),children:typeof p=="function"?p({isCurrentTabStop:b,hasTabStop:C!=null}):p})})},"RovingFocusGroupItem")),YA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sw(n,a){return a!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}qs(sw,"getDirectionAwareKey");function lw(n,a,s){const o=sw(n.key,s);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return YA[o]}qs(lw,"getFocusIntent");function dp(n,a=!1){const s=document.activeElement;for(const o of n)if(o===s||(o.focus({preventScroll:a}),document.activeElement!==s))return}qs(dp,"focusFirst");function ow(n,a){return n.map((s,o)=>n[(a+o)%n.length])}qs(ow,"wrapArray");var iw=HA,cw=VA,GA=function(n){if(typeof document>"u")return null;var a=Array.isArray(n)?n[0]:n;return a.ownerDocument.body},kl=new WeakMap,Fc=new WeakMap,Xc={},_h=0,uw=function(n){return n&&(n.host||uw(n.parentNode))},FA=function(n,a){return a.map(function(s){if(n.contains(s))return s;var o=uw(s);return o&&n.contains(o)?o:(console.error("aria-hidden",s,"in not contained inside",n,". Doing nothing"),null)}).filter(function(s){return!!s})},XA=function(n,a,s,o){var c=FA(a,Array.isArray(n)?n:[n]);Xc[s]||(Xc[s]=new WeakMap);var u=Xc[s],f=[],p=new Set,g=new Set(c),v=function(y){!y||p.has(y)||(p.add(y),v(y.parentNode))};c.forEach(v);var x=function(y){!y||g.has(y)||Array.prototype.forEach.call(y.children,function(b){if(p.has(b))x(b);else try{var w=b.getAttribute(o),N=w!==null&&w!=="false",S=(kl.get(b)||0)+1,C=(u.get(b)||0)+1;kl.set(b,S),u.set(b,C),f.push(b),S===1&&N&&Fc.set(b,!0),C===1&&b.setAttribute(s,"true"),N||b.setAttribute(o,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return x(a),p.clear(),_h++,function(){f.forEach(function(y){var b=kl.get(y)-1,w=u.get(y)-1;kl.set(y,b),u.set(y,w),b||(Fc.has(y)||y.removeAttribute(o),Fc.delete(y)),w||y.removeAttribute(s)}),_h--,_h||(kl=new WeakMap,kl=new WeakMap,Fc=new WeakMap,Xc={})}},fp=function(n,a,s){s===void 0&&(s="data-aria-hidden");var o=Array.from(Array.isArray(n)?n:[n]),c=GA(n);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),XA(o,c,s,"aria-hidden")):function(){return null}},za=function(){return za=Object.assign||function(a){for(var s,o=1,c=arguments.length;o<c;o++){s=arguments[o];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(a[u]=s[u])}return a},za.apply(this,arguments)};function dw(n,a){var s={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&a.indexOf(o)<0&&(s[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(n);c<o.length;c++)a.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(n,o[c])&&(s[o[c]]=n[o[c]]);return s}function KA(n,a,s){if(s||arguments.length===2)for(var o=0,c=a.length,u;o<c;o++)(u||!(o in a))&&(u||(u=Array.prototype.slice.call(a,0,o)),u[o]=a[o]);return n.concat(u||Array.prototype.slice.call(a))}var uu="right-scroll-bar-position",du="width-before-scroll-bar",QA="with-scroll-bars-hidden",ZA="--removed-body-scroll-bar-size";function zh(n,a){return typeof n=="function"?n(a):n&&(n.current=a),n}function JA(n,a){var s=h.useState(function(){return{value:n,callback:a,facade:{get current(){return s.value},set current(o){var c=s.value;c!==o&&(s.value=o,s.callback(o,c))}}}})[0];return s.callback=a,s.facade}var WA=typeof window<"u"?h.useLayoutEffect:h.useEffect,Pb=new WeakMap;function eM(n,a){var s=JA(null,function(o){return n.forEach(function(c){return zh(c,o)})});return WA(function(){var o=Pb.get(s);if(o){var c=new Set(o),u=new Set(n),f=s.current;c.forEach(function(p){u.has(p)||zh(p,null)}),u.forEach(function(p){c.has(p)||zh(p,f)})}Pb.set(s,n)},[n]),s}function tM(n){return n}function nM(n,a){a===void 0&&(a=tM);var s=[],o=!1,c={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:n},useMedium:function(u){var f=a(u,o);return s.push(f),function(){s=s.filter(function(p){return p!==f})}},assignSyncMedium:function(u){for(o=!0;s.length;){var f=s;s=[],f.forEach(u)}s={push:function(p){return u(p)},filter:function(){return s}}},assignMedium:function(u){o=!0;var f=[];if(s.length){var p=s;s=[],p.forEach(u),f=s}var g=function(){var x=f;f=[],x.forEach(u)},v=function(){return Promise.resolve().then(g)};v(),s={push:function(x){f.push(x),v()},filter:function(x){return f=f.filter(x),s}}}};return c}function aM(n){n===void 0&&(n={});var a=nM(null);return a.options=za({async:!0,ssr:!1},n),a}var fw=function(n){var a=n.sideCar,s=dw(n,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=a.read();if(!o)throw new Error("Sidecar medium not found");return h.createElement(o,za({},s))};fw.isSideCarExport=!0;function rM(n,a){return n.useMedium(a),fw}var hw=aM(),Lh=function(){},Fu=h.forwardRef(function(n,a){var s=h.useRef(null),o=h.useState({onScrollCapture:Lh,onWheelCapture:Lh,onTouchMoveCapture:Lh}),c=o[0],u=o[1],f=n.forwardProps,p=n.children,g=n.className,v=n.removeScrollBar,x=n.enabled,y=n.shards,b=n.sideCar,w=n.noRelative,N=n.noIsolation,S=n.inert,C=n.allowPinchZoom,R=n.as,D=R===void 0?"div":R,A=n.gapMode,M=dw(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=b,E=eM([s,a]),_=za(za({},M),c);return h.createElement(h.Fragment,null,x&&h.createElement(O,{sideCar:hw,removeScrollBar:v,shards:y,noRelative:w,noIsolation:N,inert:S,setCallbacks:u,allowPinchZoom:!!C,lockRef:s,gapMode:A}),f?h.cloneElement(h.Children.only(p),za(za({},_),{ref:E})):h.createElement(D,za({},_,{className:g,ref:E}),p))});Fu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fu.classNames={fullWidth:du,zeroRight:uu};var sM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function lM(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var a=sM();return a&&n.setAttribute("nonce",a),n}function oM(n,a){n.styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a))}function iM(n){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(n)}var cM=function(){var n=0,a=null;return{add:function(s){n==0&&(a=lM())&&(oM(a,s),iM(a)),n++},remove:function(){n--,!n&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},uM=function(){var n=cM();return function(a,s){h.useEffect(function(){return n.add(a),function(){n.remove()}},[a&&s])}},mw=function(){var n=uM(),a=function(s){var o=s.styles,c=s.dynamic;return n(o,c),null};return a},dM={left:0,top:0,right:0,gap:0},Uh=function(n){return parseInt(n||"",10)||0},fM=function(n){var a=window.getComputedStyle(document.body),s=a[n==="padding"?"paddingLeft":"marginLeft"],o=a[n==="padding"?"paddingTop":"marginTop"],c=a[n==="padding"?"paddingRight":"marginRight"];return[Uh(s),Uh(o),Uh(c)]},hM=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return dM;var a=fM(n),s=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-s+a[2]-a[0])}},mM=mw(),Hl="data-scroll-locked",pM=function(n,a,s,o){var c=n.left,u=n.top,f=n.right,p=n.gap;return s===void 0&&(s="margin"),`
|
|
341
|
-
.`.concat(QA,` {
|
|
342
|
-
overflow: hidden `).concat(o,`;
|
|
343
|
-
padding-right: `).concat(p,"px ").concat(o,`;
|
|
344
|
-
}
|
|
345
|
-
body[`).concat(Hl,`] {
|
|
346
|
-
overflow: hidden `).concat(o,`;
|
|
347
|
-
overscroll-behavior: contain;
|
|
348
|
-
`).concat([a&&"position: relative ".concat(o,";"),s==="margin"&&`
|
|
349
|
-
padding-left: `.concat(c,`px;
|
|
350
|
-
padding-top: `).concat(u,`px;
|
|
351
|
-
padding-right: `).concat(f,`px;
|
|
352
|
-
margin-left:0;
|
|
353
|
-
margin-top:0;
|
|
354
|
-
margin-right: `).concat(p,"px ").concat(o,`;
|
|
355
|
-
`),s==="padding"&&"padding-right: ".concat(p,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.`).concat(uu,` {
|
|
359
|
-
right: `).concat(p,"px ").concat(o,`;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.`).concat(du,` {
|
|
363
|
-
margin-right: `).concat(p,"px ").concat(o,`;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.`).concat(uu," .").concat(uu,` {
|
|
367
|
-
right: 0 `).concat(o,`;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.`).concat(du," .").concat(du,` {
|
|
371
|
-
margin-right: 0 `).concat(o,`;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
body[`).concat(Hl,`] {
|
|
375
|
-
`).concat(ZA,": ").concat(p,`px;
|
|
376
|
-
}
|
|
377
|
-
`)},Bb=function(){var n=parseInt(document.body.getAttribute(Hl)||"0",10);return isFinite(n)?n:0},gM=function(){h.useEffect(function(){return document.body.setAttribute(Hl,(Bb()+1).toString()),function(){var n=Bb()-1;n<=0?document.body.removeAttribute(Hl):document.body.setAttribute(Hl,n.toString())}},[])},vM=function(n){var a=n.noRelative,s=n.noImportant,o=n.gapMode,c=o===void 0?"margin":o;gM();var u=h.useMemo(function(){return hM(c)},[c]);return h.createElement(mM,{styles:pM(u,!a,c,s?"":"!important")})},om=!1;if(typeof window<"u")try{var Kc=Object.defineProperty({},"passive",{get:function(){return om=!0,!0}});window.addEventListener("test",Kc,Kc),window.removeEventListener("test",Kc,Kc)}catch{om=!1}var _l=om?{passive:!1}:!1,xM=function(n){return n.tagName==="TEXTAREA"},pw=function(n,a){if(!(n instanceof Element))return!1;var s=window.getComputedStyle(n);return s[a]!=="hidden"&&!(s.overflowY===s.overflowX&&!xM(n)&&s[a]==="visible")},yM=function(n){return pw(n,"overflowY")},bM=function(n){return pw(n,"overflowX")},Hb=function(n,a){var s=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=gw(n,o);if(c){var u=vw(n,o),f=u[1],p=u[2];if(f>p)return!0}o=o.parentNode}while(o&&o!==s.body);return!1},wM=function(n){var a=n.scrollTop,s=n.scrollHeight,o=n.clientHeight;return[a,s,o]},jM=function(n){var a=n.scrollLeft,s=n.scrollWidth,o=n.clientWidth;return[a,s,o]},gw=function(n,a){return n==="v"?yM(a):bM(a)},vw=function(n,a){return n==="v"?wM(a):jM(a)},SM=function(n,a){return n==="h"&&a==="rtl"?-1:1},CM=function(n,a,s,o,c){var u=SM(n,window.getComputedStyle(a).direction),f=u*o,p=s.target,g=a.contains(p),v=!1,x=f>0,y=0,b=0;do{if(!p)break;var w=vw(n,p),N=w[0],S=w[1],C=w[2],R=S-C-u*N;(N||R)&&gw(n,p)&&(y+=R,b+=N);var D=p.parentNode;p=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!g&&p!==document.body||g&&(a.contains(p)||a===p));return(x&&Math.abs(y)<1||!x&&Math.abs(b)<1)&&(v=!0),v},Qc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},qb=function(n){return[n.deltaX,n.deltaY]},$b=function(n){return n&&"current"in n?n.current:n},NM=function(n,a){return n[0]===a[0]&&n[1]===a[1]},EM=function(n){return`
|
|
378
|
-
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
|
379
|
-
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
|
380
|
-
`)},RM=0,zl=[];function TM(n){var a=h.useRef([]),s=h.useRef([0,0]),o=h.useRef(),c=h.useState(RM++)[0],u=h.useState(mw)[0],f=h.useRef(n);h.useEffect(function(){f.current=n},[n]),h.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var S=KA([n.lockRef.current],(n.shards||[]).map($b),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var p=h.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!f.current.allowPinchZoom;var R=Qc(S),D=s.current,A="deltaX"in S?S.deltaX:D[0]-R[0],M="deltaY"in S?S.deltaY:D[1]-R[1],O,E=S.target,_=Math.abs(A)>Math.abs(M)?"h":"v";if("touches"in S&&_==="h"&&E.type==="range")return!1;var U=window.getSelection(),P=U&&U.anchorNode,$=P?P===E||P.contains(E):!1;if($)return!1;var J=Hb(_,E);if(!J)return!0;if(J?O=_:(O=_==="v"?"h":"v",J=Hb(_,E)),!J)return!1;if(!o.current&&"changedTouches"in S&&(A||M)&&(o.current=O),!O)return!0;var Y=o.current||O;return CM(Y,C,S,Y==="h"?A:M)},[]),g=h.useCallback(function(S){var C=S;if(!(!zl.length||zl[zl.length-1]!==u)){var R="deltaY"in C?qb(C):Qc(C),D=a.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&NM(O.delta,R)})[0];if(D&&D.should){C.cancelable&&C.preventDefault();return}if(!D){var A=(f.current.shards||[]).map($b).filter(Boolean).filter(function(O){return O.contains(C.target)}),M=A.length>0?p(C,A[0]):!f.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),v=h.useCallback(function(S,C,R,D){var A={name:S,delta:C,target:R,should:D,shadowParent:AM(R)};a.current.push(A),setTimeout(function(){a.current=a.current.filter(function(M){return M!==A})},1)},[]),x=h.useCallback(function(S){s.current=Qc(S),o.current=void 0},[]),y=h.useCallback(function(S){v(S.type,qb(S),S.target,p(S,n.lockRef.current))},[]),b=h.useCallback(function(S){v(S.type,Qc(S),S.target,p(S,n.lockRef.current))},[]);h.useEffect(function(){return zl.push(u),n.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",g,_l),document.addEventListener("touchmove",g,_l),document.addEventListener("touchstart",x,_l),function(){zl=zl.filter(function(S){return S!==u}),document.removeEventListener("wheel",g,_l),document.removeEventListener("touchmove",g,_l),document.removeEventListener("touchstart",x,_l)}},[]);var w=n.removeScrollBar,N=n.inert;return h.createElement(h.Fragment,null,N?h.createElement(u,{styles:EM(c)}):null,w?h.createElement(vM,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function AM(n){for(var a=null;n!==null;)n instanceof ShadowRoot&&(a=n.host,n=n.host),n=n.parentNode;return a}const MM=rM(hw,TM);var Xu=h.forwardRef(function(n,a){return h.createElement(Fu,za({},n,{ref:a,sideCar:MM}))});Xu.classNames=Fu.classNames;var DM=Object.defineProperty,gt=(n,a)=>DM(n,"name",{value:a,configurable:!0}),OM=["Enter"," "],kM=["ArrowDown","PageUp","Home"],xw=["ArrowUp","PageDown","End"],_M=[...kM,...xw],Ku="Menu",[im,zM,LM]=Lu(Ku),[$s,yw]=Hn(Ku,[LM,to,Gu]),hp=to(),bw=Gu(),[UM,ji]=$s(Ku),[IM,mp]=$s(Ku),PM=gt(n=>{const{__scopeMenu:a,open:s=!1,children:o,dir:c,onOpenChange:u,modal:f=!0}=n,p=hp(a),[g,v]=h.useState(null),x=h.useRef(!1),y=ma(u),b=bi(c);return h.useEffect(()=>{const w=gt(()=>{x.current=!0,document.addEventListener("pointerdown",N,{capture:!0,once:!0}),document.addEventListener("pointermove",N,{capture:!0,once:!0})},"handleKeyDown"),N=gt(()=>x.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",N,{capture:!0}),document.removeEventListener("pointermove",N,{capture:!0})}},[]),h.useEffect(()=>{if(!s)return;const w=gt(()=>y(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[s,y]),l.jsx(lp,{...p,children:l.jsx(UM,{scope:a,open:s,onOpenChange:y,content:g,onContentChange:v,children:l.jsx(IM,{scope:a,onClose:h.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:x,dir:b,modal:f,children:o})})})},"Menu"),BM=h.forwardRef(gt(function(a,s){const{__scopeMenu:o,...c}=a,u=hp(o);return l.jsx(op,{...u,...c,ref:s})},"MenuAnchor")),ww="MenuPortal",[HM,qM]=$s(ww,{forceMount:void 0}),$M=gt(n=>{const{__scopeMenu:a,forceMount:s,children:o,container:c}=n,u=ji(ww,a);return l.jsx(HM,{scope:a,forceMount:s,children:l.jsx(Er,{present:s||u.open,children:l.jsx(cp,{asChild:!0,container:c,children:o})})})},"MenuPortal"),is="MenuContent",[VM,jw]=$s(is),YM=h.forwardRef(gt(function(a,s){const o=qM(is,a.__scopeMenu),{forceMount:c=o.forceMount,...u}=a,f=ji(is,a.__scopeMenu),p=mp(is,a.__scopeMenu);return l.jsx(im.Provider,{scope:a.__scopeMenu,children:l.jsx(Er,{present:c||f.open,children:l.jsx(im.Slot,{scope:a.__scopeMenu,children:p.modal?l.jsx(GM,{...u,ref:s}):l.jsx(FM,{...u,ref:s})})})})},"MenuContent")),GM=h.forwardRef(gt(function(a,s){const o=ji(is,a.__scopeMenu),c=h.useRef(null),u=Fe(s,c);return h.useEffect(()=>{const f=c.current;if(f)return fp(f)},[]),l.jsx(Sw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:Se(a.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),FM=h.forwardRef(gt(function(a,s){const o=ji(is,a.__scopeMenu);return l.jsx(Sw,{...a,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),XM=Ua("MenuContent.ScrollLock"),Sw=h.forwardRef(gt(function(a,s){const{__scopeMenu:o,loop:c=!1,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:p,disableOutsidePointerEvents:g,onEntryFocus:v,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:N,disableOutsideScroll:S,...C}=a,R=ji(is,o),D=mp(is,o),A=hp(o),M=bw(o),O=zM(o),[E,_]=h.useState(null),U=h.useRef(null),P=Fe(s,U,R.onContentChange),$=h.useRef(0),J=h.useRef(""),Y=h.useRef(0),ce=h.useRef(null),ue=h.useRef("right"),B=h.useRef(0),k=S?Xu:h.Fragment,q=S?{as:XM,allowPinchZoom:!0}:void 0,Z=gt(te=>{var ie,he;const z=J.current+te,L=O().filter(xe=>!xe.disabled),F=document.activeElement,ae=(ie=L.find(xe=>xe.ref.current===F))==null?void 0:ie.textValue,ge=L.map(xe=>xe.textValue),ye=Tw(ge,z,ae),G=(he=L.find(xe=>xe.textValue===ye))==null?void 0:he.ref.current;gt((function xe(Ae){J.current=Ae,window.clearTimeout($.current),Ae!==""&&($.current=window.setTimeout(()=>xe(""),1e3))}),"updateSearch")(z),G&&setTimeout(()=>G.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout($.current),[]),wi();const ee=h.useCallback(te=>{var L,F;return ue.current===((L=ce.current)==null?void 0:L.side)&&Mw(te,(F=ce.current)==null?void 0:F.area)},[]);return l.jsx(VM,{scope:o,searchRef:J,onItemEnter:h.useCallback(te=>{ee(te)&&te.preventDefault()},[ee]),onItemLeave:h.useCallback(te=>{var z;ee(te)||((z=U.current)==null||z.focus(),_(null))},[ee]),onTriggerLeave:h.useCallback(te=>{ee(te)&&te.preventDefault()},[ee]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:h.useCallback(te=>{ce.current=te},[]),children:l.jsx(k,{...q,children:l.jsx(Jm,{asChild:!0,trapped:u,onMountAutoFocus:Se(f,te=>{var z;te.preventDefault(),(z=U.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:l.jsx(Uu,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:N,children:l.jsx(iw,{asChild:!0,...M,dir:D.dir,orientation:"vertical",loop:c,currentTabStopId:E,onCurrentTabStopIdChange:_,onEntryFocus:Se(v,te=>{D.isUsingKeyboardRef.current||te.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(ip,{role:"menu","aria-orientation":"vertical","data-state":Cw(R.open),"data-radix-menu-content":"",dir:D.dir,...A,...C,ref:P,style:{outline:"none",...C.style},onKeyDown:Se(C.onKeyDown,te=>{const L=te.target.closest("[data-radix-menu-content]")===te.currentTarget,F=te.ctrlKey||te.altKey||te.metaKey,ae=te.key.length===1;L&&(te.key==="Tab"&&te.preventDefault(),!F&&ae&&Z(te.key));const ge=U.current;if(te.target!==ge||!_M.includes(te.key))return;te.preventDefault();const G=O().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);xw.includes(te.key)&&G.reverse(),Ew(G)}),onBlur:Se(a.onBlur,te=>{te.currentTarget.contains(te.target)||(window.clearTimeout($.current),J.current="")}),onPointerMove:Se(a.onPointerMove,wu(te=>{const z=te.target,L=B.current!==te.clientX;if(te.currentTarget.contains(z)&&L){const F=te.clientX>B.current?"right":"left";ue.current=F,B.current=te.clientX}}))})})})})})})},"MenuContentImpl")),KM=h.forwardRef(gt(function(a,s){const{__scopeMenu:o,...c}=a;return l.jsx(He.div,{...c,ref:s})},"MenuLabel")),cm="MenuItem",Vb="menu.itemSelect",QM=h.forwardRef(gt(function(a,s){const{disabled:o=!1,onSelect:c,...u}=a,f=h.useRef(null),p=mp(cm,a.__scopeMenu),g=jw(cm,a.__scopeMenu),v=Fe(s,f),x=h.useRef(!1),y=gt(()=>{const b=f.current;if(!o&&b){const w=new CustomEvent(Vb,{bubbles:!0,cancelable:!0});b.addEventListener(Vb,N=>c==null?void 0:c(N),{once:!0}),Xm(b,w),w.defaultPrevented?x.current=!1:p.onClose()}},"handleSelect");return l.jsx(ZM,{...u,ref:v,disabled:o,onClick:Se(a.onClick,y),onPointerDown:b=>{var w;(w=a.onPointerDown)==null||w.call(a,b),x.current=!0},onPointerUp:Se(a.onPointerUp,b=>{var w;x.current||(w=b.currentTarget)==null||w.click()}),onKeyDown:Se(a.onKeyDown,b=>{o||b.target!==b.currentTarget||g.searchRef.current!==""&&b.key===" "||OM.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),ZM=h.forwardRef(gt(function(a,s){const{__scopeMenu:o,disabled:c=!1,textValue:u,...f}=a,p=jw(cm,o),g=bw(o),v=h.useRef(null),x=Fe(s,v),[y,b]=h.useState(!1),[w,N]=h.useState("");return h.useEffect(()=>{const S=v.current;S&&N((S.textContent??"").trim())},[f.children]),l.jsx(im.ItemSlot,{scope:o,disabled:c,textValue:u??w,children:l.jsx(cw,{asChild:!0,...g,focusable:!c,children:l.jsx(He.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...f,ref:x,onPointerMove:Se(a.onPointerMove,wu(S=>{c?p.onItemLeave(S):(p.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(a.onPointerLeave,wu(S=>p.onItemLeave(S))),onFocus:Se(a.onFocus,()=>b(!0)),onBlur:Se(a.onBlur,()=>b(!1))})})})},"MenuItemImpl")),JM="MenuRadioGroup",[g5,v5]=$s(JM,{value:void 0,onValueChange:gt(()=>{},"onValueChange")}),WM="MenuItemIndicator",[x5,y5]=$s(WM,{checked:!1}),eD=h.forwardRef(gt(function(a,s){const{__scopeMenu:o,...c}=a;return l.jsx(He.div,{role:"separator","aria-orientation":"horizontal",...c,ref:s})},"MenuSeparator")),tD="MenuSub",[b5,w5]=$s(tD);function Cw(n){return n?"open":"closed"}gt(Cw,"getOpenState");function Nw(n){return n==="indeterminate"}gt(Nw,"isIndeterminate");function nD(n){return Nw(n)?"indeterminate":n?"checked":"unchecked"}gt(nD,"getCheckedState");function Ew(n){const a=document.activeElement;for(const s of n)if(s===a||(s.focus(),document.activeElement!==a))return}gt(Ew,"focusFirst");function Rw(n,a){return n.map((s,o)=>n[(a+o)%n.length])}gt(Rw,"wrapArray");function Tw(n,a,s){const c=a.length>1&&Array.from(a).every(v=>v===a[0])?a[0]:a,u=s?n.indexOf(s):-1;let f=Rw(n,Math.max(u,0));c.length===1&&(f=f.filter(v=>v!==s));const g=f.find(v=>v.toLowerCase().startsWith(c.toLowerCase()));return g!==s?g:void 0}gt(Tw,"getNextMatch");function Aw(n,a){const{x:s,y:o}=n;let c=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],v=p.x,x=p.y,y=g.x,b=g.y;x>o!=b>o&&s<(y-v)*(o-x)/(b-x)+v&&(c=!c)}return c}gt(Aw,"isPointInPolygon");function Mw(n,a){if(!a)return!1;const s={x:n.clientX,y:n.clientY};return Aw(s,a)}gt(Mw,"isPointerInGraceArea");function wu(n){return a=>a.pointerType==="mouse"?n(a):void 0}gt(wu,"whenMouse");var aD=PM,rD=BM,sD=$M,lD=YM,oD=KM,iD=QM,cD=eD,uD=Object.defineProperty,Vs=(n,a)=>uD(n,"name",{value:a,configurable:!0}),pp="DropdownMenu",[dD,j5]=Hn(pp,[yw]),Ys=yw(),[fD,Dw]=dD(pp),hD=Vs(n=>{const{__scopeDropdownMenu:a,children:s,dir:o,open:c,defaultOpen:u,onOpenChange:f,modal:p=!0}=n,g=Ys(a),v=h.useRef(null),[x,y]=Ia({prop:c,defaultProp:u??!1,onChange:f,caller:pp});return l.jsx(fD,{scope:a,triggerId:Na(),triggerRef:v,contentId:Na(),open:x,onOpenChange:y,onOpenToggle:h.useCallback(()=>y(b=>!b),[y]),modal:p,children:l.jsx(aD,{...g,open:x,onOpenChange:y,dir:o,modal:p,children:s})})},"DropdownMenu"),mD="DropdownMenuTrigger",pD=h.forwardRef(Vs(function(a,s){const{__scopeDropdownMenu:o,disabled:c=!1,...u}=a,f=Dw(mD,o),p=Ys(o),g=Fe(s,f.triggerRef);return l.jsx(rD,{asChild:!0,...p,children:l.jsx(He.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...u,ref:g,onPointerDown:Se(a.onPointerDown,v=>{!c&&v.button===0&&v.ctrlKey===!1&&(f.onOpenToggle(),f.open||v.preventDefault())}),onKeyDown:Se(a.onKeyDown,v=>{c||(["Enter"," "].includes(v.key)&&f.onOpenToggle(),v.key==="ArrowDown"&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),gD=Vs(n=>{const{__scopeDropdownMenu:a,...s}=n,o=Ys(a);return l.jsx(sD,{...o,...s})},"DropdownMenuPortal"),vD="DropdownMenuContent",xD=h.forwardRef(Vs(function(a,s){const{__scopeDropdownMenu:o,...c}=a,u=Dw(vD,o),f=Ys(o),p=h.useRef(!1);return l.jsx(lD,{id:u.contentId,"aria-labelledby":u.triggerId,...f,...c,ref:s,onCloseAutoFocus:Se(a.onCloseAutoFocus,g=>{var v;p.current||(v=u.triggerRef.current)==null||v.focus(),p.current=!1,g.preventDefault()}),onInteractOutside:Se(a.onInteractOutside,g=>{const v=g.detail.originalEvent,x=v.button===0&&v.ctrlKey===!0,y=v.button===2||x;(!u.modal||y)&&(p.current=!0)}),style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),yD=h.forwardRef(Vs(function(a,s){const{__scopeDropdownMenu:o,...c}=a,u=Ys(o);return l.jsx(oD,{...u,...c,ref:s})},"DropdownMenuLabel")),bD=h.forwardRef(Vs(function(a,s){const{__scopeDropdownMenu:o,...c}=a,u=Ys(o);return l.jsx(iD,{...u,...c,ref:s})},"DropdownMenuItem")),wD=h.forwardRef(Vs(function(a,s){const{__scopeDropdownMenu:o,...c}=a,u=Ys(o);return l.jsx(cD,{...u,...c,ref:s})},"DropdownMenuSeparator")),jD=hD,SD=pD,CD=gD,Ow=xD,kw=yD,_w=bD,zw=wD;const ND=jD,ED=SD,Lw=h.forwardRef(({className:n,sideOffset:a=4,...s},o)=>l.jsx(CD,{children:l.jsx(Ow,{ref:o,sideOffset:a,className:Ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",n),...s})}));Lw.displayName=Ow.displayName;const Uw=h.forwardRef(({className:n,inset:a,...s},o)=>l.jsx(_w,{ref:o,className:Ce("relative flex cursor-default 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",n),...s}));Uw.displayName=_w.displayName;const RD=h.forwardRef(({className:n,...a},s)=>l.jsx(kw,{ref:s,className:Ce("px-2 py-1.5 text-sm font-semibold",n),...a}));RD.displayName=kw.displayName;const TD=h.forwardRef(({className:n,...a},s)=>l.jsx(zw,{ref:s,className:Ce("-mx-1 my-1 h-px bg-muted",n),...a}));TD.displayName=zw.displayName;function AD(){const{theme:n,setTheme:a}=IR(),{user:s,logout:o}=Pm(),[c,u]=h.useState(!1),[f,p]=h.useState(null),g=vi(),v=n==="light"?qE:n==="dark"?OE:DE;return h.useEffect(()=>{pe.get("/api/admin/update/check?force=1").then(x=>p(x)).catch(()=>{})},[]),l.jsxs("header",{className:"flex h-14 items-center justify-between border-b bg-background px-4",children:[l.jsx("div",{className:"text-sm text-muted-foreground",children:"Admin"}),l.jsxs("div",{className:"flex items-center gap-2",children:[(f==null?void 0:f.hasUpdate)&&l.jsxs(se,{variant:"ghost",size:"sm",title:`New version available: v${f.latestVersion} — go to Settings → System to update`,onClick:()=>g("/settings?tab=system"),children:[l.jsx(xE,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",f.latestVersion]}),l.jsx(se,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:l.jsx(v,{className:"h-4 w-4"})}),l.jsxs(ND,{open:c,onOpenChange:u,children:[l.jsx(ED,{asChild:!0,children:l.jsx(se,{variant:"ghost",children:(s==null?void 0:s.username)??"admin"})}),l.jsx(Lw,{align:"end",children:l.jsxs(Uw,{onClick:()=>void o(),children:[l.jsx(ME,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Ee=h.forwardRef(({className:n,type:a,...s},o)=>l.jsx("input",{type:a,className:Ce("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",n),ref:o,...s}));Ee.displayName="Input";var MD=Object.defineProperty,DD=(n,a)=>MD(n,"name",{value:a,configurable:!0}),OD=h.forwardRef(DD(function(a,s){return l.jsx(He.label,{...a,ref:s,onMouseDown:o=>{var u;o.target.closest("button, input, select, textarea")||((u=a.onMouseDown)==null||u.call(a,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}})},"Label")),Iw=OD;const be=h.forwardRef(({className:n,...a},s)=>l.jsx(Iw,{ref:s,className:Ce("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...a}));be.displayName=Iw.displayName;const rt=h.forwardRef(({className:n,...a},s)=>l.jsx("div",{ref:s,className:Ce("rounded-lg border bg-card text-card-foreground shadow-sm",n),...a}));rt.displayName="Card";const st=h.forwardRef(({className:n,...a},s)=>l.jsx("div",{ref:s,className:Ce("flex flex-col space-y-1.5 p-6",n),...a}));st.displayName="CardHeader";const lt=h.forwardRef(({className:n,...a},s)=>l.jsx("h3",{ref:s,className:Ce("text-lg font-semibold leading-none tracking-tight",n),...a}));lt.displayName="CardTitle";const kn=h.forwardRef(({className:n,...a},s)=>l.jsx("p",{ref:s,className:Ce("text-sm text-muted-foreground",n),...a}));kn.displayName="CardDescription";const ot=h.forwardRef(({className:n,...a},s)=>l.jsx("div",{ref:s,className:Ce("p-6 pt-0",n),...a}));ot.displayName="CardContent";const Pw=h.forwardRef(({className:n,...a},s)=>l.jsx("div",{ref:s,className:Ce("flex items-center p-6 pt-0",n),...a}));Pw.displayName="CardFooter";var kD=n=>{switch(n){case"success":return LD;case"info":return ID;case"warning":return UD;case"error":return PD;default:return null}},_D=Array(12).fill(0),zD=({visible:n,className:a})=>me.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":n},me.createElement("div",{className:"sonner-spinner"},_D.map((s,o)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),LD=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),UD=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ID=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),PD=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),BD=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),HD=()=>{let[n,a]=me.useState(document.hidden);return me.useEffect(()=>{let s=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),n},um=1,qD=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;let{message:s,...o}=n,c=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:um++,u=this.toasts.find(p=>p.id===c),f=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),u?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...n,id:c,title:s}),{...p,...n,id:c,dismissible:f,title:s}):p):this.addToast({title:s,...o,dismissible:f,id:c}),c},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),this.subscribers.forEach(a=>a({id:n,dismiss:!0})),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));let o=n instanceof Promise?n:n(),c=s!==void 0,u,f=o.then(async g=>{if(u=["resolve",g],me.isValidElement(g))c=!1,this.create({id:s,type:"default",message:g});else if(VD(g)&&!g.ok){c=!1;let v=typeof a.error=="function"?await a.error(`HTTP error! status: ${g.status}`):a.error,x=typeof a.description=="function"?await a.description(`HTTP error! status: ${g.status}`):a.description;this.create({id:s,type:"error",message:v,description:x})}else if(a.success!==void 0){c=!1;let v=typeof a.success=="function"?await a.success(g):a.success,x=typeof a.description=="function"?await a.description(g):a.description;this.create({id:s,type:"success",message:v,description:x})}}).catch(async g=>{if(u=["reject",g],a.error!==void 0){c=!1;let v=typeof a.error=="function"?await a.error(g):a.error,x=typeof a.description=="function"?await a.description(g):a.description;this.create({id:s,type:"error",message:v,description:x})}}).finally(()=>{var g;c&&(this.dismiss(s),s=void 0),(g=a.finally)==null||g.call(a)}),p=()=>new Promise((g,v)=>f.then(()=>u[0]==="reject"?v(u[1]):g(u[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:p}:Object.assign(s,{unwrap:p})},this.custom=(n,a)=>{let s=(a==null?void 0:a.id)||um++;return this.create({jsx:n(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},On=new qD,$D=(n,a)=>{let s=(a==null?void 0:a.id)||um++;return On.addToast({title:n,...a,id:s}),s},VD=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",YD=$D,GD=()=>On.toasts,FD=()=>On.getActiveToasts(),de=Object.assign(YD,{success:On.success,info:On.info,warning:On.warning,error:On.error,custom:On.custom,message:On.message,promise:On.promise,dismiss:On.dismiss,loading:On.loading},{getHistory:GD,getToasts:FD});function XD(n,{insertAt:a}={}){if(typeof document>"u")return;let s=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",a==="top"&&s.firstChild?s.insertBefore(o,s.firstChild):s.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}XD(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
381
|
-
`);function Zc(n){return n.label!==void 0}var KD=3,QD="32px",ZD="16px",Yb=4e3,JD=356,WD=14,eO=20,tO=200;function wa(...n){return n.filter(Boolean).join(" ")}function nO(n){let[a,s]=n.split("-"),o=[];return a&&o.push(a),s&&o.push(s),o}var aO=n=>{var a,s,o,c,u,f,p,g,v,x,y;let{invert:b,toast:w,unstyled:N,interacting:S,setHeights:C,visibleToasts:R,heights:D,index:A,toasts:M,expanded:O,removeToast:E,defaultRichColors:_,closeButton:U,style:P,cancelButtonStyle:$,actionButtonStyle:J,className:Y="",descriptionClassName:ce="",duration:ue,position:B,gap:k,loadingIcon:q,expandByDefault:Z,classNames:ee,icons:te,closeButtonAriaLabel:z="Close toast",pauseWhenPageIsHidden:L}=n,[F,ae]=me.useState(null),[ge,ye]=me.useState(null),[G,ie]=me.useState(!1),[he,xe]=me.useState(!1),[Ae,Ne]=me.useState(!1),[Oe,Qe]=me.useState(!1),[et,oe]=me.useState(!1),[Le,qe]=me.useState(0),[_t,St]=me.useState(0),Wt=me.useRef(w.duration||ue||Yb),mn=me.useRef(null),en=me.useRef(null),Ct=A===0,xn=A+1<=R,At=w.type,Mt=w.dismissible!==!1,pn=w.className||"",pa=w.descriptionClassName||"",Aa=me.useMemo(()=>D.findIndex(Re=>Re.toastId===w.id)||0,[D,w.id]),Wn=me.useMemo(()=>{var Re;return(Re=w.closeButton)!=null?Re:U},[w.closeButton,U]),ms=me.useMemo(()=>w.duration||ue||Yb,[w.duration,ue]),ga=me.useRef(0),Dt=me.useRef(0),yn=me.useRef(0),Tt=me.useRef(null),[lo,Fs]=B.split("-"),Xs=me.useMemo(()=>D.reduce((Re,_e,Ue)=>Ue>=Aa?Re:Re+_e.height,0),[D,Aa]),Ya=HD(),Ar=w.invert||b,xt=At==="loading";Dt.current=me.useMemo(()=>Aa*k+Xs,[Aa,Xs]),me.useEffect(()=>{Wt.current=ms},[ms]),me.useEffect(()=>{ie(!0)},[]),me.useEffect(()=>{let Re=en.current;if(Re){let _e=Re.getBoundingClientRect().height;return St(_e),C(Ue=>[{toastId:w.id,height:_e,position:w.position},...Ue]),()=>C(Ue=>Ue.filter(vt=>vt.toastId!==w.id))}},[C,w.id]),me.useLayoutEffect(()=>{if(!G)return;let Re=en.current,_e=Re.style.height;Re.style.height="auto";let Ue=Re.getBoundingClientRect().height;Re.style.height=_e,St(Ue),C(vt=>vt.find(Nt=>Nt.toastId===w.id)?vt.map(Nt=>Nt.toastId===w.id?{...Nt,height:Ue}:Nt):[{toastId:w.id,height:Ue,position:w.position},...vt])},[G,w.title,w.description,C,w.id]);let at=me.useCallback(()=>{xe(!0),qe(Dt.current),C(Re=>Re.filter(_e=>_e.toastId!==w.id)),setTimeout(()=>{E(w)},tO)},[w,E,C,Dt]);me.useEffect(()=>{if(w.promise&&At==="loading"||w.duration===1/0||w.type==="loading")return;let Re;return O||S||L&&Ya?(()=>{if(yn.current<ga.current){let _e=new Date().getTime()-ga.current;Wt.current=Wt.current-_e}yn.current=new Date().getTime()})():Wt.current!==1/0&&(ga.current=new Date().getTime(),Re=setTimeout(()=>{var _e;(_e=w.onAutoClose)==null||_e.call(w,w),at()},Wt.current)),()=>clearTimeout(Re)},[O,S,w,At,L,Ya,at]),me.useEffect(()=>{w.delete&&at()},[at,w.delete]);function It(){var Re,_e,Ue;return te!=null&&te.loading?me.createElement("div",{className:wa(ee==null?void 0:ee.loader,(Re=w==null?void 0:w.classNames)==null?void 0:Re.loader,"sonner-loader"),"data-visible":At==="loading"},te.loading):q?me.createElement("div",{className:wa(ee==null?void 0:ee.loader,(_e=w==null?void 0:w.classNames)==null?void 0:_e.loader,"sonner-loader"),"data-visible":At==="loading"},q):me.createElement(zD,{className:wa(ee==null?void 0:ee.loader,(Ue=w==null?void 0:w.classNames)==null?void 0:Ue.loader),visible:At==="loading"})}return me.createElement("li",{tabIndex:0,ref:en,className:wa(Y,pn,ee==null?void 0:ee.toast,(a=w==null?void 0:w.classNames)==null?void 0:a.toast,ee==null?void 0:ee.default,ee==null?void 0:ee[At],(s=w==null?void 0:w.classNames)==null?void 0:s[At]),"data-sonner-toast":"","data-rich-colors":(o=w.richColors)!=null?o:_,"data-styled":!(w.jsx||w.unstyled||N),"data-mounted":G,"data-promise":!!w.promise,"data-swiped":et,"data-removed":he,"data-visible":xn,"data-y-position":lo,"data-x-position":Fs,"data-index":A,"data-front":Ct,"data-swiping":Ae,"data-dismissible":Mt,"data-type":At,"data-invert":Ar,"data-swipe-out":Oe,"data-swipe-direction":ge,"data-expanded":!!(O||Z&&G),style:{"--index":A,"--toasts-before":A,"--z-index":M.length-A,"--offset":`${he?Le:Dt.current}px`,"--initial-height":Z?"auto":`${_t}px`,...P,...w.style},onDragEnd:()=>{Ne(!1),ae(null),Tt.current=null},onPointerDown:Re=>{xt||!Mt||(mn.current=new Date,qe(Dt.current),Re.target.setPointerCapture(Re.pointerId),Re.target.tagName!=="BUTTON"&&(Ne(!0),Tt.current={x:Re.clientX,y:Re.clientY}))},onPointerUp:()=>{var Re,_e,Ue,vt;if(Oe||!Mt)return;Tt.current=null;let Nt=Number(((Re=en.current)==null?void 0:Re.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ut=Number(((_e=en.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Yt=new Date().getTime()-((Ue=mn.current)==null?void 0:Ue.getTime()),yt=F==="x"?Nt:ut,zt=Math.abs(yt)/Yt;if(Math.abs(yt)>=eO||zt>.11){qe(Dt.current),(vt=w.onDismiss)==null||vt.call(w,w),ye(F==="x"?Nt>0?"right":"left":ut>0?"down":"up"),at(),Qe(!0),oe(!1);return}Ne(!1),ae(null)},onPointerMove:Re=>{var _e,Ue,vt,Nt;if(!Tt.current||!Mt||((_e=window.getSelection())==null?void 0:_e.toString().length)>0)return;let ut=Re.clientY-Tt.current.y,Yt=Re.clientX-Tt.current.x,yt=(Ue=n.swipeDirections)!=null?Ue:nO(B);!F&&(Math.abs(Yt)>1||Math.abs(ut)>1)&&ae(Math.abs(Yt)>Math.abs(ut)?"x":"y");let zt={x:0,y:0};F==="y"?(yt.includes("top")||yt.includes("bottom"))&&(yt.includes("top")&&ut<0||yt.includes("bottom")&&ut>0)&&(zt.y=ut):F==="x"&&(yt.includes("left")||yt.includes("right"))&&(yt.includes("left")&&Yt<0||yt.includes("right")&&Yt>0)&&(zt.x=Yt),(Math.abs(zt.x)>0||Math.abs(zt.y)>0)&&oe(!0),(vt=en.current)==null||vt.style.setProperty("--swipe-amount-x",`${zt.x}px`),(Nt=en.current)==null||Nt.style.setProperty("--swipe-amount-y",`${zt.y}px`)}},Wn&&!w.jsx?me.createElement("button",{"aria-label":z,"data-disabled":xt,"data-close-button":!0,onClick:xt||!Mt?()=>{}:()=>{var Re;at(),(Re=w.onDismiss)==null||Re.call(w,w)},className:wa(ee==null?void 0:ee.closeButton,(c=w==null?void 0:w.classNames)==null?void 0:c.closeButton)},(u=te==null?void 0:te.close)!=null?u:BD):null,w.jsx||h.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:me.createElement(me.Fragment,null,At||w.icon||w.promise?me.createElement("div",{"data-icon":"",className:wa(ee==null?void 0:ee.icon,(f=w==null?void 0:w.classNames)==null?void 0:f.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||It():null,w.type!=="loading"?w.icon||(te==null?void 0:te[At])||kD(At):null):null,me.createElement("div",{"data-content":"",className:wa(ee==null?void 0:ee.content,(p=w==null?void 0:w.classNames)==null?void 0:p.content)},me.createElement("div",{"data-title":"",className:wa(ee==null?void 0:ee.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?me.createElement("div",{"data-description":"",className:wa(ce,pa,ee==null?void 0:ee.description,(v=w==null?void 0:w.classNames)==null?void 0:v.description)},typeof w.description=="function"?w.description():w.description):null),h.isValidElement(w.cancel)?w.cancel:w.cancel&&Zc(w.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||$,onClick:Re=>{var _e,Ue;Zc(w.cancel)&&Mt&&((Ue=(_e=w.cancel).onClick)==null||Ue.call(_e,Re),at())},className:wa(ee==null?void 0:ee.cancelButton,(x=w==null?void 0:w.classNames)==null?void 0:x.cancelButton)},w.cancel.label):null,h.isValidElement(w.action)?w.action:w.action&&Zc(w.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||J,onClick:Re=>{var _e,Ue;Zc(w.action)&&((Ue=(_e=w.action).onClick)==null||Ue.call(_e,Re),!Re.defaultPrevented&&at())},className:wa(ee==null?void 0:ee.actionButton,(y=w==null?void 0:w.classNames)==null?void 0:y.actionButton)},w.action.label):null))};function Gb(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function rO(n,a){let s={};return[n,a].forEach((o,c)=>{let u=c===1,f=u?"--mobile-offset":"--offset",p=u?ZD:QD;function g(v){["top","right","bottom","left"].forEach(x=>{s[`${f}-${x}`]=typeof v=="number"?`${v}px`:v})}typeof o=="number"||typeof o=="string"?g(o):typeof o=="object"?["top","right","bottom","left"].forEach(v=>{o[v]===void 0?s[`${f}-${v}`]=p:s[`${f}-${v}`]=typeof o[v]=="number"?`${o[v]}px`:o[v]}):g(p)}),s}var sO=h.forwardRef(function(n,a){let{invert:s,position:o="bottom-right",hotkey:c=["altKey","KeyT"],expand:u,closeButton:f,className:p,offset:g,mobileOffset:v,theme:x="light",richColors:y,duration:b,style:w,visibleToasts:N=KD,toastOptions:S,dir:C=Gb(),gap:R=WD,loadingIcon:D,icons:A,containerAriaLabel:M="Notifications",pauseWhenPageIsHidden:O}=n,[E,_]=me.useState([]),U=me.useMemo(()=>Array.from(new Set([o].concat(E.filter(L=>L.position).map(L=>L.position)))),[E,o]),[P,$]=me.useState([]),[J,Y]=me.useState(!1),[ce,ue]=me.useState(!1),[B,k]=me.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=me.useRef(null),Z=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=me.useRef(null),te=me.useRef(!1),z=me.useCallback(L=>{_(F=>{var ae;return(ae=F.find(ge=>ge.id===L.id))!=null&&ae.delete||On.dismiss(L.id),F.filter(({id:ge})=>ge!==L.id)})},[]);return me.useEffect(()=>On.subscribe(L=>{if(L.dismiss){_(F=>F.map(ae=>ae.id===L.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{uE.flushSync(()=>{_(F=>{let ae=F.findIndex(ge=>ge.id===L.id);return ae!==-1?[...F.slice(0,ae),{...F[ae],...L},...F.slice(ae+1)]:[L,...F]})})})}),[]),me.useEffect(()=>{if(x!=="system"){k(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?k("dark"):k("light")),typeof window>"u")return;let L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:F})=>{k(F?"dark":"light")})}catch{L.addListener(({matches:ae})=>{try{k(ae?"dark":"light")}catch(ge){console.error(ge)}})}},[x]),me.useEffect(()=>{E.length<=1&&Y(!1)},[E]),me.useEffect(()=>{let L=F=>{var ae,ge;c.every(ye=>F[ye]||F.code===ye)&&(Y(!0),(ae=q.current)==null||ae.focus()),F.code==="Escape"&&(document.activeElement===q.current||(ge=q.current)!=null&&ge.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[c]),me.useEffect(()=>{if(q.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,te.current=!1)}},[q.current]),me.createElement("section",{ref:a,"aria-label":`${M} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((L,F)=>{var ae;let[ge,ye]=L.split("-");return E.length?me.createElement("ol",{key:L,dir:C==="auto"?Gb():C,tabIndex:-1,ref:q,className:p,"data-sonner-toaster":!0,"data-theme":B,"data-y-position":ge,"data-lifted":J&&E.length>1&&!u,"data-x-position":ye,style:{"--front-toast-height":`${((ae=P[0])==null?void 0:ae.height)||0}px`,"--width":`${JD}px`,"--gap":`${R}px`,...w,...rO(g,v)},onBlur:G=>{te.current&&!G.currentTarget.contains(G.relatedTarget)&&(te.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||te.current||(te.current=!0,ee.current=G.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{ce||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||ue(!0)},onPointerUp:()=>ue(!1)},E.filter(G=>!G.position&&F===0||G.position===L).map((G,ie)=>{var he,xe;return me.createElement(aO,{key:G.id,icons:A,index:ie,toast:G,defaultRichColors:y,duration:(he=S==null?void 0:S.duration)!=null?he:b,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:s,visibleToasts:N,closeButton:(xe=S==null?void 0:S.closeButton)!=null?xe:f,interacting:ce,position:L,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,removeToast:z,toasts:E.filter(Ae=>Ae.position==G.position),heights:P.filter(Ae=>Ae.position==G.position),setHeights:$,expandByDefault:u,gap:R,loadingIcon:D,expanded:J,pauseWhenPageIsHidden:O,swipeDirections:n.swipeDirections})})):null}))});function lO(){const{login:n}=Pm(),[a,s]=h.useState("admin"),[o,c]=h.useState(""),[u,f]=h.useState(""),[p,g]=h.useState(""),[v,x]=h.useState(!1),[y,b]=h.useState(!1),w=vi(),N=Bn();return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:l.jsxs(rt,{className:"w-full max-w-sm",children:[l.jsxs(st,{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain"}),l.jsx(lt,{children:"Sign in"})]}),l.jsx(kn,{children:"Enter your admin credentials."})]}),l.jsxs(ot,{className:"space-y-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(be,{children:"Username"}),l.jsx(Ee,{value:a,onChange:S=>s(S.target.value),autoFocus:!0})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(be,{children:"Password"}),l.jsx(Ee,{type:"password",value:o,onChange:S=>c(S.target.value)})]}),v&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(be,{children:"2FA code (or recovery code)"}),l.jsx(Ee,{value:u,onChange:S=>f(S.target.value),placeholder:"123456",maxLength:6})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(be,{children:"Recovery code (alternative)"}),l.jsx(Ee,{value:p,onChange:S=>g(S.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),l.jsx("div",{className:"px-6 pb-6",children:l.jsx(se,{className:"w-full",disabled:y,onClick:async()=>{var S,C;b(!0);try{if((await n(a,o,u||void 0,p||void 0)).totpRequired){x(!0);return}const D=((C=(S=N.state)==null?void 0:S.from)==null?void 0:C.pathname)??"/";w(D,{replace:!0})}catch(R){de.error(R.message)}finally{b(!1)}},children:"Sign in"})})]})})}function oO(){const[n,a]=h.useState("admin"),[s,o]=h.useState(""),[c,u]=h.useState(""),[f,p]=h.useState(!1),[g,v]=h.useState(!0),[x,y]=h.useState(null),[b,w]=h.useState(""),[N,S]=h.useState(!1);h.useEffect(()=>{pe.get("/api/admin/setup/status").then(D=>v(!D.masterKeyConfigured)).catch(()=>v(!0))},[]);const C=!g||c.trim().length>=32,R=!f&&s.length>=12&&C;return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:l.jsxs(rt,{className:"w-full max-w-md",children:[l.jsxs(st,{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain rounded"}),l.jsx(lt,{children:"Welcome to LateDev Router"})]}),l.jsx(kn,{children:"Set up the administrator account to get started."})]}),l.jsxs(ot,{className:"space-y-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(be,{children:"Username"}),l.jsx(Ee,{value:n,onChange:D=>a(D.target.value)})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(be,{children:"Password (12+ chars)"}),l.jsx(Ee,{type:"password",value:s,onChange:D=>o(D.target.value)})]}),g&&l.jsxs("div",{className:"space-y-1",children:[l.jsx(be,{children:"Master encryption key (required, 32+ chars)"}),l.jsx(Ee,{type:"password",value:c,onChange:D=>u(D.target.value),placeholder:"Paste or generate a 32+ character key"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Provider API keys are encrypted with this key (AES-256-GCM). Store it somewhere safe — if it is lost, stored provider credentials cannot be recovered. Generate one with:"," ",l.jsx("code",{className:"break-all",children:`node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"`})]})]})]}),l.jsxs(Pw,{className:"flex-col items-stretch gap-4",children:[l.jsx(se,{disabled:!R,onClick:async()=>{p(!0);try{await pe.post("/api/admin/setup",{username:n,password:s,setupMasterKey:g?c.trim():void 0}),de.success("Admin account created"),window.location.assign("/login")}catch(D){de.error(D.message)}finally{p(!1)}},children:"Create admin"}),l.jsxs("div",{className:"border-t pt-4 space-y-2",children:[l.jsx(be,{children:"Import existing database"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Use this to restore the administrator account, password, TOTP settings, providers, models, and master key from a backup without setting up again. Enter the same 6-digit backup passphrase used when the file was created."}),l.jsx(Ee,{type:"file",accept:".json,application/json",onChange:D=>{var A;return y(((A=D.target.files)==null?void 0:A[0])??null)}}),l.jsx(Ee,{inputMode:"numeric",maxLength:6,value:b,onChange:D=>w(D.target.value.replace(/\D/g,"")),placeholder:"Backup passphrase (6 digits)"}),l.jsx(se,{variant:"outline",disabled:!x||b.length!==6||N,onClick:async()=>{var D,A;if(x){S(!0);try{const M=JSON.parse(await x.text()),O=await fetch("/api/admin/backup/restore",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({backup:M,passphrase:b})});if(!O.ok)throw new Error(((A=(D=await O.json())==null?void 0:D.error)==null?void 0:A.message)??"Import failed");de.success("Database imported"),window.location.assign("/login")}catch(M){de.error(M.message)}finally{S(!1)}}},children:"Import database"})]})]})]})})}function Va({title:n,description:a,actions:s,className:o}){return l.jsxs("div",{className:Ce("mb-6 flex items-start justify-between gap-4",o),children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:n}),a&&l.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a})]}),s&&l.jsx("div",{className:"flex items-center gap-2",children:s})]})}const iO=d1("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",success:"border-transparent bg-emerald-600 text-white",warning:"border-transparent bg-amber-500 text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function We({className:n,variant:a,...s}){return l.jsx("div",{className:Ce(iO({variant:a}),n),...s})}function cO(){const[n,a]=h.useState(null);return h.useEffect(()=>{pe.get("/api/admin/dashboard").then(a).catch(()=>a(null))},[]),n?l.jsxs("div",{children:[l.jsx(Va,{title:"Dashboard",description:"Operational summary for today",actions:l.jsxs("div",{className:"flex gap-2",children:[l.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:l.jsxs(Ls,{to:"/providers",children:[l.jsx(Kl,{className:"mr-1 h-4 w-4"})," Provider"]})}),l.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:l.jsxs(Ls,{to:"/combos",children:[l.jsx(X0,{className:"mr-1 h-4 w-4"})," Combo"]})}),l.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:l.jsxs(Ls,{to:"/api-keys",children:[l.jsx(F0,{className:"mr-1 h-4 w-4"})," API Key"]})})]})}),l.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[l.jsxs(rt,{children:[l.jsx(st,{className:"pb-1",children:l.jsx(lt,{className:"text-sm text-muted-foreground",children:"Requests today"})}),l.jsx(ot,{className:"text-2xl font-semibold",children:Xt(n.today.total)})]}),l.jsxs(rt,{children:[l.jsx(st,{className:"pb-1",children:l.jsx(lt,{className:"text-sm text-muted-foreground",children:"Success rate"})}),l.jsx(ot,{className:"text-2xl font-semibold",children:n.today.total?zu(n.today.success/n.today.total):"—"})]}),l.jsxs(rt,{children:[l.jsx(st,{className:"pb-1",children:l.jsx(lt,{className:"text-sm text-muted-foreground",children:"Failed"})}),l.jsx(ot,{className:"text-2xl font-semibold",children:Xt(n.today.failed)})]}),l.jsxs(rt,{children:[l.jsx(st,{className:"pb-1",children:l.jsx(lt,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),l.jsx(ot,{className:"text-2xl font-semibold",children:Xt(n.today.totalTokens)})]})]}),l.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[l.jsxs(rt,{children:[l.jsxs(st,{children:[l.jsx(lt,{className:"text-base",children:"Provider health"}),l.jsxs(kn,{children:[n.providers.length," configured"]})]}),l.jsxs(ot,{className:"space-y-2",children:[n.providers.length===0&&l.jsxs("p",{className:"text-sm text-muted-foreground",children:["No providers yet. ",l.jsx(Ls,{to:"/providers",className:"text-primary",children:"Add one"}),"."]}),n.providers.map(s=>l.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(K0,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"font-medium",children:s.name}),l.jsx("span",{className:"text-xs text-muted-foreground",children:s.slug}),l.jsx(We,{variant:"outline",className:"ml-2",children:s.type})]}),l.jsx(We,{variant:s.health==="healthy"?"success":s.health==="down"?"destructive":"secondary",children:s.health})]},s.id))]})]}),l.jsxs(rt,{children:[l.jsxs(st,{children:[l.jsx(lt,{className:"text-base",children:"Recent failures"}),l.jsx(kn,{children:"Today"})]}),l.jsxs(ot,{className:"space-y-1 text-sm",children:[n.recentFailures.length===0&&l.jsx("p",{className:"text-muted-foreground",children:"No failures today."}),n.recentFailures.map(s=>{var o;return l.jsxs("div",{className:"flex items-center justify-between border-b py-1 last:border-0",children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-mono text-xs",children:s.requestedModel}),l.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.errorType??`HTTP ${s.httpStatus}`," — ",(o=s.errorMessage)==null?void 0:o.slice(0,60)]})]}),l.jsx("span",{className:"text-xs text-muted-foreground",children:Gm(s.createdAt)})]},s.id)})]})]})]})]}):l.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const Un=h.forwardRef(({className:n,...a},s)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:s,className:Ce("w-full caption-bottom text-sm",n),...a})}));Un.displayName="Table";const In=h.forwardRef(({className:n,...a},s)=>l.jsx("thead",{ref:s,className:Ce("[&_tr]:border-b",n),...a}));In.displayName="TableHeader";const Pn=h.forwardRef(({className:n,...a},s)=>l.jsx("tbody",{ref:s,className:Ce("[&_tr:last-child]:border-0",n),...a}));Pn.displayName="TableBody";const Be=h.forwardRef(({className:n,...a},s)=>l.jsx("tr",{ref:s,className:Ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...a}));Be.displayName="TableRow";const ve=h.forwardRef(({className:n,...a},s)=>l.jsx("th",{ref:s,className:Ce("h-10 px-2 text-left align-middle font-medium text-muted-foreground",n),...a}));ve.displayName="TableHead";const fe=h.forwardRef(({className:n,...a},s)=>l.jsx("td",{ref:s,className:Ce("p-2 align-middle",n),...a}));fe.displayName="TableCell";var uO=Object.defineProperty,Jn=(n,a)=>uO(n,"name",{value:a,configurable:!0}),gp="Dialog",[Bw,Hw]=Hn(gp),[dO,Ta]=Bw(gp),qw=Jn(n=>{const{__scopeDialog:a,children:s,open:o,defaultOpen:c,onOpenChange:u,modal:f=!0}=n,p=h.useRef(null),g=h.useRef(null),[v,x]=Ia({prop:o,defaultProp:c??!1,onChange:u,caller:gp}),[y,b]=h.useState(0),[w,N]=h.useState(0);return l.jsx(dO,{scope:a,triggerRef:p,contentRef:g,contentId:Na(),titleId:Na(),descriptionId:Na(),titlePresent:y>0,descriptionPresent:w>0,setTitleCount:b,setDescriptionCount:N,open:v,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(S=>!S),[x]),modal:f,children:s})},"Dialog"),fO="DialogTrigger",$w=h.forwardRef(Jn(function(a,s){const{__scopeDialog:o,...c}=a,u=Ta(fO,o),f=Fe(s,u.triggerRef);return l.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":Qu(u.open),...c,ref:f,onClick:Se(a.onClick,u.onOpenToggle)})},"DialogTrigger")),Vw="DialogPortal",[hO,Yw]=Bw(Vw,{forceMount:void 0}),Gw=Jn(n=>{const{__scopeDialog:a,forceMount:s,children:o,container:c}=n,u=Ta(Vw,a);return l.jsx(hO,{scope:a,forceMount:s,children:h.Children.map(o,f=>l.jsx(Er,{present:s||u.open,children:l.jsx(cp,{asChild:!0,container:c,children:f})}))})},"DialogPortal"),dm="DialogOverlay",vp=h.forwardRef(Jn(function(a,s){const o=Yw(dm,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=Ta(dm,a.__scopeDialog);return f.modal?l.jsx(Er,{present:c||f.open,children:l.jsx(pO,{...u,ref:s})}):null},"DialogOverlay")),mO=Ua("DialogOverlay.RemoveScroll"),pO=h.forwardRef(Jn(function(a,s){const{__scopeDialog:o,...c}=a,u=Ta(dm,o),f=N1(),p=Fe(s,f);return l.jsx(Xu,{as:mO,allowPinchZoom:!0,shards:[u.contentRef],children:l.jsx(He.div,{"data-state":Qu(u.open),...c,ref:p,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),ci="DialogContent",xp=h.forwardRef(Jn(function(a,s){const o=Yw(ci,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=Ta(ci,a.__scopeDialog);return l.jsx(Er,{present:c||f.open,children:f.modal?l.jsx(gO,{...u,ref:s}):l.jsx(vO,{...u,ref:s})})},"DialogContent")),gO=h.forwardRef(Jn(function(a,s){const o=Ta(ci,a.__scopeDialog),c=h.useRef(null),u=Fe(s,o.contentRef,c);return h.useEffect(()=>{const f=c.current;if(f)return fp(f)},[]),l.jsx(Fw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:Se(a.onCloseAutoFocus,f=>{var p;f.preventDefault(),(p=o.triggerRef.current)==null||p.focus()}),onPointerDownOutside:Se(a.onPointerDownOutside,f=>{const p=f.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&f.preventDefault()}),onFocusOutside:Se(a.onFocusOutside,f=>f.preventDefault())})},"DialogContentModal")),vO=h.forwardRef(Jn(function(a,s){const o=Ta(ci,a.__scopeDialog),c=h.useRef(!1),u=h.useRef(!1);return l.jsx(Fw,{...a,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:f=>{var p,g;(p=a.onCloseAutoFocus)==null||p.call(a,f),f.defaultPrevented||(c.current||(g=o.triggerRef.current)==null||g.focus(),f.preventDefault()),c.current=!1,u.current=!1},onInteractOutside:f=>{var v,x;(v=a.onInteractOutside)==null||v.call(a,f),f.defaultPrevented||(c.current=!0,f.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const p=f.target;((x=o.triggerRef.current)==null?void 0:x.contains(p))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&u.current&&f.preventDefault()}})},"DialogContentNonModal")),Fw=h.forwardRef(Jn(function(a,s){const{__scopeDialog:o,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,...p}=a,g=Ta(ci,o);return wi(),l.jsx(l.Fragment,{children:l.jsx(Jm,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:u,onUnmountAutoFocus:f,children:l.jsx(Uu,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Qu(g.open),...p,ref:s,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),xO="DialogTitle",yp=h.forwardRef(Jn(function(a,s){const{__scopeDialog:o,...c}=a,u=Ta(xO,o),{setTitleCount:f}=u;return Jt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),l.jsx(He.h2,{id:u.titleId,...c,ref:s})},"DialogTitle")),yO="DialogDescription",bp=h.forwardRef(Jn(function(a,s){const{__scopeDialog:o,...c}=a,u=Ta(yO,o),{setDescriptionCount:f}=u;return Jt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),l.jsx(He.p,{id:u.descriptionId,...c,ref:s})},"DialogDescription")),bO="DialogClose",wp=h.forwardRef(Jn(function(a,s){const{__scopeDialog:o,...c}=a,u=Ta(bO,o);return l.jsx(He.button,{type:"button",...c,ref:s,onClick:Se(a.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function Qu(n){return n?"open":"closed"}Jn(Qu,"getState");const ln=qw,Si=$w,wO=Gw,Xw=h.forwardRef(({className:n,...a},s)=>l.jsx(vp,{ref:s,className:Ce("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",n),...a}));Xw.displayName=vp.displayName;const Kt=h.forwardRef(({className:n,children:a,...s},o)=>l.jsxs(wO,{children:[l.jsx(Xw,{}),l.jsxs(xp,{ref:o,className:Ce("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 sm:rounded-lg",n),...s,children:[a,l.jsxs(wp,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[l.jsx(_u,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Kt.displayName=xp.displayName;const Qt=({className:n,...a})=>l.jsx("div",{className:Ce("flex flex-col space-y-1.5 text-center sm:text-left",n),...a});Qt.displayName="DialogHeader";const Vt=({className:n,...a})=>l.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a});Vt.displayName="DialogFooter";const Zt=h.forwardRef(({className:n,...a},s)=>l.jsx(yp,{ref:s,className:Ce("text-lg font-semibold leading-none tracking-tight",n),...a}));Zt.displayName=yp.displayName;const jr=h.forwardRef(({className:n,...a},s)=>l.jsx(bp,{ref:s,className:Ce("text-sm text-muted-foreground",n),...a}));jr.displayName=bp.displayName;var jO=Object.defineProperty,Rr=(n,a)=>jO(n,"name",{value:a,configurable:!0}),SO="AlertDialog",[CO,S5]=Hn(SO,[Hw]),Tr=Hw(),NO=Rr(n=>{const{__scopeAlertDialog:a,...s}=n,o=Tr(a);return l.jsx(qw,{...o,...s,modal:!0})},"AlertDialog"),EO=h.forwardRef(Rr(function(a,s){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return l.jsx($w,{...u,...c,ref:s})},"AlertDialogTrigger")),RO=Rr(n=>{const{__scopeAlertDialog:a,...s}=n,o=Tr(a);return l.jsx(Gw,{...o,...s})},"AlertDialogPortal"),TO=h.forwardRef(Rr(function(a,s){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return l.jsx(vp,{...u,...c,ref:s})},"AlertDialogOverlay")),AO="AlertDialogContent",[MO,DO]=CO(AO),OO=h.forwardRef(Rr(function(a,s){const{__scopeAlertDialog:o,children:c,...u}=a,f=Tr(o),p=h.useRef(null),g=Fe(s,p),v=h.useRef(null);return l.jsx(MO,{scope:o,cancelRef:v,children:l.jsx(xp,{role:"alertdialog",...f,...u,ref:g,onOpenAutoFocus:Se(u.onOpenAutoFocus,x=>{var y;x.preventDefault(),(y=v.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),children:c})})},"AlertDialogContent")),kO=h.forwardRef(Rr(function(a,s){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return l.jsx(yp,{...u,...c,ref:s})},"AlertDialogTitle")),_O=h.forwardRef(Rr(function(a,s){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return l.jsx(bp,{...u,...c,ref:s})},"AlertDialogDescription")),zO=h.forwardRef(Rr(function(a,s){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return l.jsx(wp,{...u,...c,ref:s})},"AlertDialogAction")),LO="AlertDialogCancel",UO=h.forwardRef(Rr(function(a,s){const{__scopeAlertDialog:o,...c}=a,{cancelRef:u}=DO(LO,o),f=Tr(o),p=Fe(s,u);return l.jsx(wp,{...f,...c,ref:p})},"AlertDialogCancel")),IO=NO,PO=EO,BO=RO,Kw=TO,Qw=OO,Zw=zO,Jw=UO,Ww=kO,ej=_O;const tj=IO,HO=PO,qO=BO,nj=h.forwardRef(({className:n,...a},s)=>l.jsx(Kw,{ref:s,className:Ce("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",n),...a}));nj.displayName=Kw.displayName;const jp=h.forwardRef(({className:n,...a},s)=>l.jsxs(qO,{children:[l.jsx(nj,{}),l.jsx(Qw,{ref:s,className:Ce("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:max-w-[425px]",n),...a})]}));jp.displayName=Qw.displayName;const aj=({className:n,...a})=>l.jsx("div",{className:Ce("flex flex-col space-y-2 text-center sm:text-left",n),...a}),rj=({className:n,...a})=>l.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a}),Sp=h.forwardRef(({className:n,...a},s)=>l.jsx(Ww,{ref:s,className:Ce("text-lg font-semibold",n),...a}));Sp.displayName=Ww.displayName;const Cp=h.forwardRef(({className:n,...a},s)=>l.jsx(ej,{ref:s,className:Ce("text-sm text-muted-foreground",n),...a}));Cp.displayName=ej.displayName;const Np=h.forwardRef(({className:n,...a},s)=>l.jsx(Zw,{ref:s,className:Ce("inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",n),...a}));Np.displayName=Zw.displayName;const Ep=h.forwardRef(({className:n,...a},s)=>l.jsx(Jw,{ref:s,className:Ce("inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium hover:bg-accent",n),...a}));Ep.displayName=Jw.displayName;var $O=Object.defineProperty,VO=(n,a)=>$O(n,"name",{value:a,configurable:!0});function fm(n,[a,s]){return Math.min(s,Math.max(a,n))}VO(fm,"clamp");var YO=Object.defineProperty,GO=(n,a)=>YO(n,"name",{value:a,configurable:!0});function sj(n){const a=h.useRef({value:n,previous:n});return h.useMemo(()=>(a.current.value!==n&&(a.current.previous=a.current.value,a.current.value=n),a.current.previous),[n])}GO(sj,"usePrevious");var FO=Object.defineProperty,XO=(n,a)=>FO(n,"name",{value:a,configurable:!0}),lj=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),KO=h.forwardRef(XO(function(a,s){return l.jsx(He.span,{...a,ref:s,style:{...lj,...a.style}})},"VisuallyHidden")),QO=KO,ZO=Object.defineProperty,mt=(n,a)=>ZO(n,"name",{value:a,configurable:!0}),JO=[" ","Enter","ArrowUp","ArrowDown"],WO=[" ","Enter"],$l="Select",[Zu,Rp,ek]=Lu($l),[Gs,C5]=Hn($l,[ek,to]),Tp=to(),[tk,hs]=Gs($l),[nk,ak]=Gs($l);function oj(n){const{__scopeSelect:a,children:s,open:o,defaultOpen:c,onOpenChange:u,value:f,defaultValue:p,onValueChange:g,dir:v,name:x,autoComplete:y,disabled:b,required:w,form:N,internal_do_not_use_render:S}=n,C=Tp(a),[R,D]=h.useState(null),[A,M]=h.useState(null),[O,E]=h.useState(!1),_=bi(v),[U,P]=Ia({prop:o,defaultProp:c??!1,onChange:u,caller:$l}),[$,J]=Ia({prop:f,defaultProp:p,onChange:g,caller:$l}),Y=h.useRef(null),ce=h.useRef($);h.useEffect(()=>{const L=N?R==null?void 0:R.ownerDocument.getElementById(N):R==null?void 0:R.form;if(L instanceof HTMLFormElement){const F=mt(()=>J(ce.current),"reset");return L.addEventListener("reset",F),()=>L.removeEventListener("reset",F)}},[N,R,J]);const ue=R?!!N||!!R.closest("form"):!0,[B,k]=h.useState(new Set),q=Na(),Z=Array.from(B).map(L=>L.props.value).join(";"),ee=h.useCallback(L=>{k(F=>new Set(F).add(L))},[]),te=h.useCallback(L=>{k(F=>{const ae=new Set(F);return ae.delete(L),ae})},[]),z={required:w,trigger:R,onTriggerChange:D,valueNode:A,onValueNodeChange:M,valueNodeHasChildren:O,onValueNodeHasChildrenChange:E,contentId:q,value:$,onValueChange:J,open:U,onOpenChange:P,dir:_,triggerPointerDownPosRef:Y,disabled:b,name:x,autoComplete:y,form:N,nativeOptions:B,nativeSelectKey:Z,isFormControl:ue};return l.jsx(lp,{...C,children:l.jsx(tk,{scope:a,...z,children:l.jsx(Zu.Provider,{scope:a,children:l.jsx(nk,{scope:a,onNativeOptionAdd:ee,onNativeOptionRemove:te,children:hj(S)?S(z):s})})})})}mt(oj,"SelectProvider");var rk=mt(n=>{const{__scopeSelect:a,children:s,...o}=n;return l.jsx(oj,{__scopeSelect:a,...o,internal_do_not_use_render:({isFormControl:c})=>l.jsxs(l.Fragment,{children:[s,c?l.jsx(Ek,{__scopeSelect:a}):null]})})},"Select"),sk="SelectTrigger",ij=h.forwardRef(mt(function(a,s){const{__scopeSelect:o,disabled:c=!1,...u}=a,f=Tp(o),p=hs(sk,o),g=p.disabled||c,v=Fe(s,p.onTriggerChange),x=Rp(o),y=h.useRef("touch"),[b,w,N]=Ap(C=>{const R=x().filter(M=>!M.disabled),D=R.find(M=>M.value===p.value),A=Mp(R,C,D);A!==void 0&&p.onValueChange(A.value)}),S=mt(C=>{g||(p.onOpenChange(!0),N()),C&&(p.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return l.jsx(op,{asChild:!0,...f,children:l.jsx(He.button,{type:"button",role:"combobox","aria-controls":p.open?p.contentId:void 0,"aria-expanded":p.open,"aria-required":p.required,"aria-autocomplete":"none",dir:p.dir,"data-state":p.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":Ci(p.value)?"":void 0,...u,ref:v,onClick:Se(u.onClick,C=>{C.currentTarget.focus(),y.current!=="mouse"&&S(C)}),onPointerDown:Se(u.onPointerDown,C=>{y.current=C.pointerType;const R=C.target;R.hasPointerCapture(C.pointerId)&&R.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(S(C),C.preventDefault())}),onKeyDown:Se(u.onKeyDown,C=>{const R=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&w(C.key),!(R&&C.key===" ")&&JO.includes(C.key)&&(S(),C.preventDefault())})})})},"SelectTrigger")),lk="SelectValue",ok=h.forwardRef(mt(function(a,s){const{__scopeSelect:o,className:c,style:u,children:f,placeholder:p="",...g}=a,v=hs(lk,o),{onValueNodeHasChildrenChange:x}=v,y=f!==void 0,b=Fe(s,v.onValueNodeChange);Jt(()=>{x(y)},[x,y]);const w=Ci(v.value);return l.jsx(He.span,{...g,asChild:w?!1:g.asChild,ref:b,style:{pointerEvents:"none"},children:l.jsx(h.Fragment,{children:w?p:f},w?"placeholder":"value")})},"SelectValue")),ik=h.forwardRef(mt(function(a,s){const{__scopeSelect:o,children:c,...u}=a;return l.jsx(He.span,{"aria-hidden":!0,...u,ref:s,children:c||"▼"})},"SelectIcon")),ck="SelectPortal",[uk,dk]=Gs(ck,{forceMount:void 0}),fk=mt(n=>{const{__scopeSelect:a,forceMount:s,...o}=n;return l.jsx(uk,{scope:n.__scopeSelect,forceMount:s,children:l.jsx(cp,{asChild:!0,...o})})},"SelectPortal"),Hs="SelectContent",cj=h.forwardRef(mt(function(a,s){const o=dk(Hs,a.__scopeSelect),{forceMount:c=o.forceMount,...u}=a,f=hs(Hs,a.__scopeSelect),[p,g]=h.useState();return Jt(()=>{g(new DocumentFragment)},[]),l.jsx(Er,{present:c||f.open,children:({present:v})=>v?l.jsx(pk,{...u,ref:s}):l.jsx(hk,{...u,fragment:p})})},"SelectContent")),hk=h.forwardRef(mt(function(a,s){const{__scopeSelect:o,children:c,fragment:u}=a;return u?Sa.createPortal(l.jsx(uj,{scope:o,children:l.jsx(Zu.Slot,{scope:o,children:l.jsx("div",{ref:s,children:c})})}),u):null},"SelectContentFragment")),ja=10,[uj,Ju]=Gs(Hs),mk=Ua("SelectContent.RemoveScroll"),pk=h.forwardRef(mt(function(a,s){const{__scopeSelect:o}=a,{position:c="item-aligned",onCloseAutoFocus:u,onEscapeKeyDown:f,onPointerDownOutside:p,side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:N,sticky:S,hideWhenDetached:C,avoidCollisions:R,...D}=a,A=hs(Hs,o),[M,O]=h.useState(null),[E,_]=h.useState(null),U=Fe(s,O),[P,$]=h.useState(null),[J,Y]=h.useState(null),ce=Rp(o),[ue,B]=h.useState(!1),k=h.useRef(!1);h.useEffect(()=>{if(M)return fp(M)},[M]),wi();const q=h.useCallback(ie=>{const[he,...xe]=ce().map(Oe=>Oe.ref.current),[Ae]=xe.slice(-1),Ne=document.activeElement;for(const Oe of ie)if(Oe===Ne||(Oe==null||Oe.scrollIntoView({block:"nearest"}),Oe===he&&E&&(E.scrollTop=0),Oe===Ae&&E&&(E.scrollTop=E.scrollHeight),Oe==null||Oe.focus(),document.activeElement!==Ne))return},[ce,E]),Z=h.useCallback(()=>q([P,M]),[q,P,M]);h.useEffect(()=>{ue&&Z()},[ue,Z]);const{onOpenChange:ee,triggerPointerDownPosRef:te}=A;h.useEffect(()=>{if(M){let ie={x:0,y:0};const he=mt(Ae=>{var Ne,Oe;ie={x:Math.abs(Math.round(Ae.pageX)-(((Ne=te.current)==null?void 0:Ne.x)??0)),y:Math.abs(Math.round(Ae.pageY)-(((Oe=te.current)==null?void 0:Oe.y)??0))}},"handlePointerMove"),xe=mt(Ae=>{ie.x<=10&&ie.y<=10?Ae.preventDefault():Ae.composedPath().includes(M)||ee(!1),document.removeEventListener("pointermove",he),te.current=null},"handlePointerUp");return te.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",xe,{capture:!0})}}},[M,ee,te]),h.useEffect(()=>{const ie=mt(()=>ee(!1),"close");return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[ee]);const[z,L]=Ap(ie=>{const he=ce().filter(Ne=>!Ne.disabled),xe=he.find(Ne=>Ne.ref.current===document.activeElement),Ae=Mp(he,ie,xe);Ae&&setTimeout(()=>{var Ne;return(Ne=Ae.ref.current)==null?void 0:Ne.focus()})}),F=h.useCallback((ie,he,xe)=>{const Ae=!k.current&&!xe;(A.value!==void 0&&A.value===he||Ae)&&($(ie),Ae&&(k.current=!0))},[A.value]),ae=h.useCallback(()=>M==null?void 0:M.focus(),[M]),ge=h.useCallback((ie,he,xe)=>{const Ae=!k.current&&!xe;(A.value!==void 0&&A.value===he||Ae)&&Y(ie)},[A.value]),ye=c==="popper"?Fb:gk,G=ye===Fb?{side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:N,sticky:S,hideWhenDetached:C,avoidCollisions:R}:{};return l.jsx(uj,{scope:o,content:M,viewport:E,onViewportChange:_,itemRefCallback:F,selectedItem:P,onItemLeave:ae,itemTextRefCallback:ge,focusSelectedItem:Z,selectedItemText:J,position:c,isPositioned:ue,searchRef:z,children:l.jsx(Xu,{as:mk,allowPinchZoom:!0,children:l.jsx(Jm,{asChild:!0,trapped:A.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Se(u,ie=>{var he;(he=A.trigger)==null||he.focus({preventScroll:!0}),ie.preventDefault()}),children:l.jsx(Uu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:l.jsx(ye,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:ie=>ie.preventDefault(),...D,...G,onPlaced:()=>B(!0),ref:U,style:{display:"flex",flexDirection:"column",outline:"none",...D.style},onKeyDown:Se(D.onKeyDown,ie=>{const he=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!he&&ie.key.length===1&&L(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let Ae=ce().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Ne=ie.target,Oe=Ae.indexOf(Ne);Ae=Ae.slice(Oe+1)}setTimeout(()=>q(Ae)),ie.preventDefault()}})})})})})})},"SelectContentImpl")),gk=h.forwardRef(mt(function(a,s){const{__scopeSelect:o,onPlaced:c,...u}=a,f=hs(Hs,o),p=Ju(Hs,o),[g,v]=h.useState(null),[x,y]=h.useState(null),b=Fe(s,y),w=Rp(o),N=h.useRef(!1),S=h.useRef(!0),{viewport:C,selectedItem:R,selectedItemText:D,focusSelectedItem:A}=p,M=h.useCallback(()=>{if(f.trigger&&f.valueNode&&g&&x&&C&&R&&D){const U=f.trigger.getBoundingClientRect(),P=x.getBoundingClientRect(),$=f.valueNode.getBoundingClientRect(),J=D.getBoundingClientRect();if(f.dir!=="rtl"){const Ne=J.left-P.left,Oe=$.left-Ne,Qe=U.left-Oe,et=U.width+Qe,oe=Math.max(et,P.width),Le=window.innerWidth-ja,qe=fm(Oe,[ja,Math.max(ja,Le-oe)]);g.style.minWidth=et+"px",g.style.left=qe+"px"}else{const Ne=P.right-J.right,Oe=window.innerWidth-$.right-Ne,Qe=window.innerWidth-U.right-Oe,et=U.width+Qe,oe=Math.max(et,P.width),Le=window.innerWidth-ja,qe=fm(Oe,[ja,Math.max(ja,Le-oe)]);g.style.minWidth=et+"px",g.style.right=qe+"px"}const Y=w(),ce=window.innerHeight-ja*2,ue=C.scrollHeight,B=window.getComputedStyle(x),k=parseInt(B.borderTopWidth,10),q=parseInt(B.paddingTop,10),Z=parseInt(B.borderBottomWidth,10),ee=parseInt(B.paddingBottom,10),te=k+q+ue+ee+Z,z=Math.min(R.offsetHeight*5,te),L=window.getComputedStyle(C),F=parseInt(L.paddingTop,10),ae=parseInt(L.paddingBottom,10),ge=U.top+U.height/2-ja,ye=ce-ge,G=R.offsetHeight/2,ie=R.offsetTop+G,he=k+q+ie,xe=te-he;if(he<=ge){const Ne=Y.length>0&&R===Y[Y.length-1].ref.current;g.style.bottom="0px";const Oe=x.clientHeight-C.offsetTop-C.offsetHeight,Qe=Math.max(ye,G+(Ne?ae:0)+Oe+Z),et=he+Qe;g.style.height=et+"px"}else{const Ne=Y.length>0&&R===Y[0].ref.current;g.style.top="0px";const Qe=Math.max(ge,k+C.offsetTop+(Ne?F:0)+G)+xe;g.style.height=Qe+"px",C.scrollTop=he-ge+C.offsetTop}g.style.margin=`${ja}px 0`,g.style.minHeight=z+"px",g.style.maxHeight=ce+"px",c==null||c(),requestAnimationFrame(()=>N.current=!0)}},[w,f.trigger,f.valueNode,g,x,C,R,D,f.dir,c]);Jt(()=>M(),[M]);const[O,E]=h.useState();Jt(()=>{x&&E(window.getComputedStyle(x).zIndex)},[x]);const _=h.useCallback(U=>{U&&S.current===!0&&(M(),A==null||A(),S.current=!1)},[M,A]);return l.jsx(vk,{scope:o,contentWrapper:g,shouldExpandOnScrollRef:N,onScrollButtonChange:_,children:l.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:l.jsx(He.div,{...u,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...u.style}})})})},"SelectItemAlignedPosition")),Fb=h.forwardRef(mt(function(a,s){const{__scopeSelect:o,align:c="start",collisionPadding:u=ja,...f}=a,p=Tp(o);return l.jsx(ip,{...p,...f,ref:s,align:c,collisionPadding:u,style:{boxSizing:"border-box",...f.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)"}})},"SelectPopperPosition")),[vk,xk]=Gs(Hs,{}),Xb="SelectViewport",yk=h.forwardRef(mt(function(a,s){const{__scopeSelect:o,nonce:c,...u}=a,f=Ju(Xb,o),p=xk(Xb,o),g=Fe(s,f.onViewportChange),v=h.useRef(0);return l.jsxs(l.Fragment,{children:[l.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:c}),l.jsx(Zu.Slot,{scope:o,children:l.jsx(He.div,{"data-radix-select-viewport":"",role:"presentation",...u,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...u.style},onScroll:Se(u.onScroll,x=>{const y=x.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:w}=p;if(w!=null&&w.current&&b){const N=Math.abs(v.current-y.scrollTop);if(N>0){const S=window.innerHeight-ja*2,C=parseFloat(b.style.minHeight),R=parseFloat(b.style.height),D=Math.max(C,R);if(D<S){const A=D+N,M=Math.min(S,A),O=A-M;b.style.height=M+"px",b.style.bottom==="0px"&&(y.scrollTop=O>0?O:0,b.style.justifyContent="flex-end")}}}v.current=y.scrollTop})})})]})},"SelectViewport")),bk="SelectGroup",[N5,E5]=Gs(bk),hm="SelectItem",[wk,dj]=Gs(hm),fj=h.forwardRef(mt(function(a,s){const{__scopeSelect:o,value:c,disabled:u=!1,textValue:f,...p}=a,g=hs(hm,o),v=Ju(hm,o),x=g.value===c,[y,b]=h.useState(f??""),[w,N]=h.useState(!1),S=ma(M=>{var O;return(O=v.itemRefCallback)==null?void 0:O.call(v,M,c,u)}),C=Fe(s,S),R=Na(),D=h.useRef("touch"),A=mt(()=>{u||(g.onValueChange(c),g.onOpenChange(!1))},"handleSelect");return l.jsx(wk,{scope:o,value:c,disabled:u,textId:R,isSelected:x,onItemTextChange:h.useCallback(M=>{b(O=>O||((M==null?void 0:M.textContent)??"").trim())},[]),children:l.jsx(Zu.ItemSlot,{scope:o,value:c,disabled:u,textValue:y,children:l.jsx(He.div,{role:"option","aria-labelledby":R,"data-highlighted":w?"":void 0,"aria-selected":x&&w,"data-state":x?"checked":"unchecked","aria-disabled":u||void 0,"data-disabled":u?"":void 0,tabIndex:u?void 0:-1,...p,ref:C,onFocus:Se(p.onFocus,()=>N(!0)),onBlur:Se(p.onBlur,()=>N(!1)),onClick:Se(p.onClick,()=>{D.current!=="mouse"&&A()}),onPointerUp:Se(p.onPointerUp,()=>{D.current==="mouse"&&A()}),onPointerDown:Se(p.onPointerDown,M=>{D.current=M.pointerType}),onPointerMove:Se(p.onPointerMove,M=>{var O;D.current=M.pointerType,u?(O=v.onItemLeave)==null||O.call(v):D.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(p.onPointerLeave,M=>{var O;M.currentTarget===document.activeElement&&((O=v.onItemLeave)==null||O.call(v))}),onKeyDown:Se(p.onKeyDown,M=>{var E;u||M.target!==M.currentTarget||((E=v.searchRef)==null?void 0:E.current)!==""&&M.key===" "||(WO.includes(M.key)&&A(),M.key===" "&&M.preventDefault())})})})})},"SelectItem")),Jc="SelectItemText",jk=h.forwardRef(mt(function(a,s){const{__scopeSelect:o,className:c,style:u,...f}=a,p=hs(Jc,o),g=Ju(Jc,o),v=dj(Jc,o),x=ak(Jc,o),[y,b]=h.useState(null),w=ma(A=>{var M;return(M=g.itemTextRefCallback)==null?void 0:M.call(g,A,v.value,v.disabled)}),N=Fe(s,b,v.onItemTextChange,w),S=y==null?void 0:y.textContent,C=h.useMemo(()=>l.jsx("option",{value:v.value,disabled:v.disabled,children:S},v.value),[v.disabled,v.value,S]),{onNativeOptionAdd:R,onNativeOptionRemove:D}=x;return Jt(()=>(R(C),()=>D(C)),[R,D,C]),l.jsxs(l.Fragment,{children:[l.jsx(He.span,{id:v.textId,...f,ref:N}),v.isSelected&&p.valueNode&&!p.valueNodeHasChildren&&!Ci(p.value)?Sa.createPortal(f.children,p.valueNode):null]})},"SelectItemText")),Sk="SelectItemIndicator",Ck=h.forwardRef(mt(function(a,s){const{__scopeSelect:o,...c}=a;return dj(Sk,o).isSelected?l.jsx(He.span,{"aria-hidden":!0,...c,ref:s}):null},"SelectItemIndicator")),Nk="SelectBubbleInput",Ek=h.forwardRef(mt(function({__scopeSelect:a,...s},o){const c=hs(Nk,a),{value:u,onValueChange:f,required:p,disabled:g,name:v,autoComplete:x,form:y}=c,{nativeOptions:b,nativeSelectKey:w}=c,N=h.useRef(null),S=Fe(o,N),C=u??"",R=sj(C),D=Array.from(b).some(A=>(A.props.value??"")==="");return h.useEffect(()=>{const A=N.current;if(!A)return;const M=window.HTMLSelectElement.prototype,E=Object.getOwnPropertyDescriptor(M,"value").set;if(R!==C&&E){const _=new Event("change",{bubbles:!0});E.call(A,C),A.dispatchEvent(_)}},[R,C]),l.jsxs(He.select,{"aria-hidden":!0,required:p,tabIndex:-1,name:v,autoComplete:x,disabled:g,form:y,onChange:A=>f(A.target.value),...s,style:{...lj,...s.style},ref:S,defaultValue:C,children:[Ci(u)&&!D?l.jsx("option",{value:""}):null,Array.from(b)]},w)},"SelectBubbleInput"));function hj(n){return typeof n=="function"}mt(hj,"isFunction");function Ci(n){return n===""||n===void 0}mt(Ci,"shouldShowPlaceholder");function Ap(n){const a=ma(n),s=h.useRef(""),o=h.useRef(0),c=h.useCallback(f=>{const p=s.current+f;a(p),mt((function g(v){s.current=v,window.clearTimeout(o.current),v!==""&&(o.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(p)},[a]),u=h.useCallback(()=>{s.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[s,c,u]}mt(Ap,"useTypeaheadSearch");function Mp(n,a,s){const c=a.length>1&&Array.from(a).every(v=>v===a[0])?a[0]:a,u=s?n.indexOf(s):-1;let f=mj(n,Math.max(u,0));c.length===1&&(f=f.filter(v=>v!==s));const g=f.find(v=>v.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==s?g:void 0}mt(Mp,"findNextItem");function mj(n,a){return n.map((s,o)=>n[(a+o)%n.length])}mt(mj,"wrapArray");const zn=rk,Ln=ok,jn=h.forwardRef(({className:n,children:a,...s},o)=>l.jsxs(ij,{ref:o,className:Ce("flex h-9 w-full items-center justify-between 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",n),...s,children:[a,l.jsx(ik,{asChild:!0,children:l.jsx(V0,{className:"h-4 w-4 opacity-50"})})]}));jn.displayName=ij.displayName;const Sn=h.forwardRef(({className:n,children:a,position:s="popper",...o},c)=>l.jsx(fk,{children:l.jsx(cj,{ref:c,className:Ce("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",n),position:s,...o,children:l.jsx(yk,{className:Ce("p-1",s==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:a})})}));Sn.displayName=cj.displayName;const nt=h.forwardRef(({className:n,children:a,...s},o)=>l.jsxs(fj,{ref:o,className:Ce("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...s,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(Ck,{children:l.jsx(Bm,{className:"h-4 w-4"})})}),l.jsx(jk,{children:a})]}));nt.displayName=fj.displayName;var Rk=Object.defineProperty,ds=(n,a)=>Rk(n,"name",{value:a,configurable:!0}),Dp="Switch",[Tk,R5]=Hn(Dp),[Ak,Op]=Tk(Dp);function pj(n){const{__scopeSwitch:a,checked:s,children:o,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=Ia({prop:s,defaultProp:c??!1,onChange:g,caller:Dp}),[N,S]=h.useState(null),[C,R]=h.useState(null),D=h.useRef(!1),[A,M]=h.useReducer(_=>_+1,0),O=N?!!f||!!N.closest("form"):!0,E={checked:b,setChecked:w,disabled:u,control:N,setControl:S,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:D,userInteractionCount:A,onUserInteraction:M,required:v,defaultChecked:c,isFormControl:O,bubbleInput:C,setBubbleInput:R};return l.jsx(Ak,{scope:a,...E,children:vj(y)?y(E):o})}ds(pj,"SwitchProvider");var Mk="SwitchTrigger",Dk=h.forwardRef(ds(function({__scopeSwitch:a,onClick:s,...o},c){const{control:u,form:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:N,isFormControl:S,bubbleInput:C}=Op(Mk,a),R=Fe(c,y),D=h.useRef(v);return h.useEffect(()=>{const A=f?u==null?void 0:u.ownerDocument.getElementById(f):u==null?void 0:u.form;if(A instanceof HTMLFormElement){const M=ds(()=>b(D.current),"reset");return A.addEventListener("reset",M),()=>A.removeEventListener("reset",M)}},[u,f,b]),l.jsx(He.button,{type:"button",role:"switch","aria-checked":v,"aria-required":x,"data-state":kp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...o,ref:R,onClick:Se(s,A=>{N(),b(M=>!M),C&&S&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"SwitchTrigger")),gj=h.forwardRef(ds(function(a,s){const{__scopeSwitch:o,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return l.jsx(pj,{__scopeSwitch:o,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>l.jsxs(l.Fragment,{children:[l.jsx(Dk,{...b,ref:s,__scopeSwitch:o}),w&&l.jsx(zk,{__scopeSwitch:o})]})})},"Switch")),Ok="SwitchThumb",kk=h.forwardRef(ds(function(a,s){const{__scopeSwitch:o,...c}=a,u=Op(Ok,o);return l.jsx(He.span,{"data-state":kp(u.checked),"data-disabled":u.disabled?"":void 0,...c,ref:s})},"SwitchThumb")),_k="SwitchBubbleInput",zk=h.forwardRef(ds(function({__scopeSwitch:a,onClick:s,...o},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:N,bubbleInput:S,setBubbleInput:C}=Op(_k,a),R=Fe(c,C),D=$u(u),A=h.useRef(!1),M=h.useRef(g),O=h.useRef(p);h.useEffect(()=>{const _=S;if(!_)return;const U=window.HTMLInputElement.prototype,$=Object.getOwnPropertyDescriptor(U,"checked").set,J=p!==O.current;O.current=p;const Y=M.current!==g;M.current=g;const ce=!(J&&f.current);if(Y&&$){A.current=!J;const ue=new Event("click",{bubbles:ce});$.call(_,g),_.dispatchEvent(ue),A.current=!1}},[S,g,f,p]);const E=h.useRef(g);return l.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??E.current,required:x,disabled:y,name:b,value:w,form:N,...o,tabIndex:-1,ref:R,onClick:Se(s,_=>{A.current&&_.stopPropagation()}),style:{...o.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function vj(n){return typeof n=="function"}ds(vj,"isFunction");function kp(n){return n?"checked":"unchecked"}ds(kp,"getState");const Ha=h.forwardRef(({className:n,...a},s)=>l.jsx(gj,{className:Ce("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",n),...a,ref:s,children:l.jsx(kk,{className:Ce("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")})}));Ha.displayName=gj.displayName;function Lk(){for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return h.useMemo(()=>o=>{a.forEach(c=>c(o))},a)}const Wu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function no(n){const a=Object.prototype.toString.call(n);return a==="[object Window]"||a==="[object global]"}function _p(n){return"nodeType"in n}function qn(n){var a,s;return n?no(n)?n:_p(n)&&(a=(s=n.ownerDocument)==null?void 0:s.defaultView)!=null?a:window:window}function zp(n){const{Document:a}=qn(n);return n instanceof a}function Ni(n){return no(n)?!1:n instanceof qn(n).HTMLElement}function xj(n){return n instanceof qn(n).SVGElement}function ao(n){return n?no(n)?n.document:_p(n)?zp(n)?n:Ni(n)||xj(n)?n.ownerDocument:document:document:document}const qa=Wu?h.useLayoutEffect:h.useEffect;function Lp(n){const a=h.useRef(n);return qa(()=>{a.current=n}),h.useCallback(function(){for(var s=arguments.length,o=new Array(s),c=0;c<s;c++)o[c]=arguments[c];return a.current==null?void 0:a.current(...o)},[])}function Uk(){const n=h.useRef(null),a=h.useCallback((o,c)=>{n.current=setInterval(o,c)},[]),s=h.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[a,s]}function ui(n,a){a===void 0&&(a=[n]);const s=h.useRef(n);return qa(()=>{s.current!==n&&(s.current=n)},a),s}function Ei(n,a){const s=h.useRef();return h.useMemo(()=>{const o=n(s.current);return s.current=o,o},[...a])}function ju(n){const a=Lp(n),s=h.useRef(null),o=h.useCallback(c=>{c!==s.current&&(a==null||a(c,s.current)),s.current=c},[]);return[s,o]}function mm(n){const a=h.useRef();return h.useEffect(()=>{a.current=n},[n]),a.current}let Ih={};function Ri(n,a){return h.useMemo(()=>{if(a)return a;const s=Ih[n]==null?0:Ih[n]+1;return Ih[n]=s,n+"-"+s},[n,a])}function yj(n){return function(a){for(var s=arguments.length,o=new Array(s>1?s-1:0),c=1;c<s;c++)o[c-1]=arguments[c];return o.reduce((u,f)=>{const p=Object.entries(f);for(const[g,v]of p){const x=u[g];x!=null&&(u[g]=x+n*v)}return u},{...a})}}const ql=yj(1),di=yj(-1);function Ik(n){return"clientX"in n&&"clientY"in n}function Up(n){if(!n)return!1;const{KeyboardEvent:a}=qn(n.target);return a&&n instanceof a}function Pk(n){if(!n)return!1;const{TouchEvent:a}=qn(n.target);return a&&n instanceof a}function pm(n){if(Pk(n)){if(n.touches&&n.touches.length){const{clientX:a,clientY:s}=n.touches[0];return{x:a,y:s}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:a,clientY:s}=n.changedTouches[0];return{x:a,y:s}}}return Ik(n)?{x:n.clientX,y:n.clientY}:null}const Su=Object.freeze({Translate:{toString(n){if(!n)return;const{x:a,y:s}=n;return"translate3d("+(a?Math.round(a):0)+"px, "+(s?Math.round(s):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:a,scaleY:s}=n;return"scaleX("+a+") scaleY("+s+")"}},Transform:{toString(n){if(n)return[Su.Translate.toString(n),Su.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:a,duration:s,easing:o}=n;return a+" "+s+"ms "+o}}}),Kb="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Bk(n){return n.matches(Kb)?n:n.querySelector(Kb)}const Hk={display:"none"};function qk(n){let{id:a,value:s}=n;return me.createElement("div",{id:a,style:Hk},s)}function $k(n){let{id:a,announcement:s,ariaLiveType:o="assertive"}=n;const c={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return me.createElement("div",{id:a,style:c,role:"status","aria-live":o,"aria-atomic":!0},s)}function Vk(){const[n,a]=h.useState("");return{announce:h.useCallback(o=>{o!=null&&a(o)},[]),announcement:n}}const bj=h.createContext(null);function Yk(n){const a=h.useContext(bj);h.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(n)},[n,a])}function Gk(){const[n]=h.useState(()=>new Set),a=h.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[h.useCallback(o=>{let{type:c,event:u}=o;n.forEach(f=>{var p;return(p=f[c])==null?void 0:p.call(f,u)})},[n]),a]}const Fk={draggable:`
|
|
382
|
-
To pick up a draggable item, press the space bar.
|
|
383
|
-
While dragging, use the arrow keys to move the item.
|
|
384
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
385
|
-
`},Xk={onDragStart(n){let{active:a}=n;return"Picked up draggable item "+a.id+"."},onDragOver(n){let{active:a,over:s}=n;return s?"Draggable item "+a.id+" was moved over droppable area "+s.id+".":"Draggable item "+a.id+" is no longer over a droppable area."},onDragEnd(n){let{active:a,over:s}=n;return s?"Draggable item "+a.id+" was dropped over droppable area "+s.id:"Draggable item "+a.id+" was dropped."},onDragCancel(n){let{active:a}=n;return"Dragging was cancelled. Draggable item "+a.id+" was dropped."}};function Kk(n){let{announcements:a=Xk,container:s,hiddenTextDescribedById:o,screenReaderInstructions:c=Fk}=n;const{announce:u,announcement:f}=Vk(),p=Ri("DndLiveRegion"),[g,v]=h.useState(!1);if(h.useEffect(()=>{v(!0)},[]),Yk(h.useMemo(()=>({onDragStart(y){let{active:b}=y;u(a.onDragStart({active:b}))},onDragMove(y){let{active:b,over:w}=y;a.onDragMove&&u(a.onDragMove({active:b,over:w}))},onDragOver(y){let{active:b,over:w}=y;u(a.onDragOver({active:b,over:w}))},onDragEnd(y){let{active:b,over:w}=y;u(a.onDragEnd({active:b,over:w}))},onDragCancel(y){let{active:b,over:w}=y;u(a.onDragCancel({active:b,over:w}))}}),[u,a])),!g)return null;const x=me.createElement(me.Fragment,null,me.createElement(qk,{id:o,value:c.draggable}),me.createElement($k,{id:p,announcement:f}));return s?Sa.createPortal(x,s):x}var Ft;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(Ft||(Ft={}));function Cu(){}function Vl(n,a){return h.useMemo(()=>({sensor:n,options:a??{}}),[n,a])}function Ip(){for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return h.useMemo(()=>[...a].filter(o=>o!=null),[...a])}const Ea=Object.freeze({x:0,y:0});function wj(n,a){return Math.sqrt(Math.pow(n.x-a.x,2)+Math.pow(n.y-a.y,2))}function jj(n,a){let{data:{value:s}}=n,{data:{value:o}}=a;return s-o}function Qk(n,a){let{data:{value:s}}=n,{data:{value:o}}=a;return o-s}function Qb(n){let{left:a,top:s,height:o,width:c}=n;return[{x:a,y:s},{x:a+c,y:s},{x:a,y:s+o},{x:a+c,y:s+o}]}function Sj(n,a){if(!n||n.length===0)return null;const[s]=n;return s[a]}function Zb(n,a,s){return a===void 0&&(a=n.left),s===void 0&&(s=n.top),{x:a+n.width*.5,y:s+n.height*.5}}const Pp=n=>{let{collisionRect:a,droppableRects:s,droppableContainers:o}=n;const c=Zb(a,a.left,a.top),u=[];for(const f of o){const{id:p}=f,g=s.get(p);if(g){const v=wj(Zb(g),c);u.push({id:p,data:{droppableContainer:f,value:v}})}}return u.sort(jj)},Zk=n=>{let{collisionRect:a,droppableRects:s,droppableContainers:o}=n;const c=Qb(a),u=[];for(const f of o){const{id:p}=f,g=s.get(p);if(g){const v=Qb(g),x=c.reduce((b,w,N)=>b+wj(v[N],w),0),y=Number((x/4).toFixed(4));u.push({id:p,data:{droppableContainer:f,value:y}})}}return u.sort(jj)};function Jk(n,a){const s=Math.max(a.top,n.top),o=Math.max(a.left,n.left),c=Math.min(a.left+a.width,n.left+n.width),u=Math.min(a.top+a.height,n.top+n.height),f=c-o,p=u-s;if(o<c&&s<u){const g=a.width*a.height,v=n.width*n.height,x=f*p,y=x/(g+v-x);return Number(y.toFixed(4))}return 0}const Wk=n=>{let{collisionRect:a,droppableRects:s,droppableContainers:o}=n;const c=[];for(const u of o){const{id:f}=u,p=s.get(f);if(p){const g=Jk(p,a);g>0&&c.push({id:f,data:{droppableContainer:u,value:g}})}}return c.sort(Qk)};function e3(n,a,s){return{...n,scaleX:a&&s?a.width/s.width:1,scaleY:a&&s?a.height/s.height:1}}function Cj(n,a){return n&&a?{x:n.left-a.left,y:n.top-a.top}:Ea}function t3(n){return function(s){for(var o=arguments.length,c=new Array(o>1?o-1:0),u=1;u<o;u++)c[u-1]=arguments[u];return c.reduce((f,p)=>({...f,top:f.top+n*p.y,bottom:f.bottom+n*p.y,left:f.left+n*p.x,right:f.right+n*p.x}),{...s})}}const n3=t3(1);function a3(n){if(n.startsWith("matrix3d(")){const a=n.slice(9,-1).split(/, /);return{x:+a[12],y:+a[13],scaleX:+a[0],scaleY:+a[5]}}else if(n.startsWith("matrix(")){const a=n.slice(7,-1).split(/, /);return{x:+a[4],y:+a[5],scaleX:+a[0],scaleY:+a[3]}}return null}function r3(n,a,s){const o=a3(a);if(!o)return n;const{scaleX:c,scaleY:u,x:f,y:p}=o,g=n.left-f-(1-c)*parseFloat(s),v=n.top-p-(1-u)*parseFloat(s.slice(s.indexOf(" ")+1)),x=c?n.width/c:n.width,y=u?n.height/u:n.height;return{width:x,height:y,top:v,right:g+x,bottom:v+y,left:g}}const s3={ignoreTransform:!1};function ro(n,a){a===void 0&&(a=s3);let s=n.getBoundingClientRect();if(a.ignoreTransform){const{transform:v,transformOrigin:x}=qn(n).getComputedStyle(n);v&&(s=r3(s,v,x))}const{top:o,left:c,width:u,height:f,bottom:p,right:g}=s;return{top:o,left:c,width:u,height:f,bottom:p,right:g}}function Jb(n){return ro(n,{ignoreTransform:!0})}function l3(n){const a=n.innerWidth,s=n.innerHeight;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}function o3(n,a){return a===void 0&&(a=qn(n).getComputedStyle(n)),a.position==="fixed"}function i3(n,a){a===void 0&&(a=qn(n).getComputedStyle(n));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(c=>{const u=a[c];return typeof u=="string"?s.test(u):!1})}function ed(n,a){const s=[];function o(c){if(a!=null&&s.length>=a||!c)return s;if(zp(c)&&c.scrollingElement!=null&&!s.includes(c.scrollingElement))return s.push(c.scrollingElement),s;if(!Ni(c)||xj(c)||s.includes(c))return s;const u=qn(n).getComputedStyle(c);return c!==n&&i3(c,u)&&s.push(c),o3(c,u)?s:o(c.parentNode)}return n?o(n):s}function Nj(n){const[a]=ed(n,1);return a??null}function Ph(n){return!Wu||!n?null:no(n)?n:_p(n)?zp(n)||n===ao(n).scrollingElement?window:Ni(n)?n:null:null}function Ej(n){return no(n)?n.scrollX:n.scrollLeft}function Rj(n){return no(n)?n.scrollY:n.scrollTop}function gm(n){return{x:Ej(n),y:Rj(n)}}var an;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(an||(an={}));function Tj(n){return!Wu||!n?!1:n===document.scrollingElement}function Aj(n){const a={x:0,y:0},s=Tj(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-s.width,y:n.scrollHeight-s.height},c=n.scrollTop<=a.y,u=n.scrollLeft<=a.x,f=n.scrollTop>=o.y,p=n.scrollLeft>=o.x;return{isTop:c,isLeft:u,isBottom:f,isRight:p,maxScroll:o,minScroll:a}}const c3={x:.2,y:.2};function u3(n,a,s,o,c){let{top:u,left:f,right:p,bottom:g}=s;o===void 0&&(o=10),c===void 0&&(c=c3);const{isTop:v,isBottom:x,isLeft:y,isRight:b}=Aj(n),w={x:0,y:0},N={x:0,y:0},S={height:a.height*c.y,width:a.width*c.x};return!v&&u<=a.top+S.height?(w.y=an.Backward,N.y=o*Math.abs((a.top+S.height-u)/S.height)):!x&&g>=a.bottom-S.height&&(w.y=an.Forward,N.y=o*Math.abs((a.bottom-S.height-g)/S.height)),!b&&p>=a.right-S.width?(w.x=an.Forward,N.x=o*Math.abs((a.right-S.width-p)/S.width)):!y&&f<=a.left+S.width&&(w.x=an.Backward,N.x=o*Math.abs((a.left+S.width-f)/S.width)),{direction:w,speed:N}}function d3(n){if(n===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:a,left:s,right:o,bottom:c}=n.getBoundingClientRect();return{top:a,left:s,right:o,bottom:c,width:n.clientWidth,height:n.clientHeight}}function Mj(n){return n.reduce((a,s)=>ql(a,gm(s)),Ea)}function f3(n){return n.reduce((a,s)=>a+Ej(s),0)}function h3(n){return n.reduce((a,s)=>a+Rj(s),0)}function m3(n,a){if(a===void 0&&(a=ro),!n)return;const{top:s,left:o,bottom:c,right:u}=a(n);Nj(n)&&(c<=0||u<=0||s>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const p3=[["x",["left","right"],f3],["y",["top","bottom"],h3]];class Bp{constructor(a,s){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=ed(s),c=Mj(o);this.rect={...a},this.width=a.width,this.height=a.height;for(const[u,f,p]of p3)for(const g of f)Object.defineProperty(this,g,{get:()=>{const v=p(o),x=c[u]-v;return this.rect[g]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ni{constructor(a){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(s=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...s)})},this.target=a}add(a,s,o){var c;(c=this.target)==null||c.addEventListener(a,s,o),this.listeners.push([a,s,o])}}function g3(n){const{EventTarget:a}=qn(n);return n instanceof a?n:ao(n)}function Bh(n,a){const s=Math.abs(n.x),o=Math.abs(n.y);return typeof a=="number"?Math.sqrt(s**2+o**2)>a:"x"in a&&"y"in a?s>a.x&&o>a.y:"x"in a?s>a.x:"y"in a?o>a.y:!1}var da;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(da||(da={}));function Wb(n){n.preventDefault()}function v3(n){n.stopPropagation()}var Ke;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(Ke||(Ke={}));const Dj={start:[Ke.Space,Ke.Enter],cancel:[Ke.Esc],end:[Ke.Space,Ke.Enter,Ke.Tab]},x3=(n,a)=>{let{currentCoordinates:s}=a;switch(n.code){case Ke.Right:return{...s,x:s.x+25};case Ke.Left:return{...s,x:s.x-25};case Ke.Down:return{...s,y:s.y+25};case Ke.Up:return{...s,y:s.y-25}}};class Ti{constructor(a){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=a;const{event:{target:s}}=a;this.props=a,this.listeners=new ni(ao(s)),this.windowListeners=new ni(qn(s)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(da.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:s}=this.props,o=a.node.current;o&&m3(o),s(Ea)}handleKeyDown(a){if(Up(a)){const{active:s,context:o,options:c}=this.props,{keyboardCodes:u=Dj,coordinateGetter:f=x3,scrollBehavior:p="smooth"}=c,{code:g}=a;if(u.end.includes(g)){this.handleEnd(a);return}if(u.cancel.includes(g)){this.handleCancel(a);return}const{collisionRect:v}=o.current,x=v?{x:v.left,y:v.top}:Ea;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:s,context:o.current,currentCoordinates:x});if(y){const b=di(y,x),w={x:0,y:0},{scrollableAncestors:N}=o.current;for(const S of N){const C=a.code,{isTop:R,isRight:D,isLeft:A,isBottom:M,maxScroll:O,minScroll:E}=Aj(S),_=d3(S),U={x:Math.min(C===Ke.Right?_.right-_.width/2:_.right,Math.max(C===Ke.Right?_.left:_.left+_.width/2,y.x)),y:Math.min(C===Ke.Down?_.bottom-_.height/2:_.bottom,Math.max(C===Ke.Down?_.top:_.top+_.height/2,y.y))},P=C===Ke.Right&&!D||C===Ke.Left&&!A,$=C===Ke.Down&&!M||C===Ke.Up&&!R;if(P&&U.x!==y.x){const J=S.scrollLeft+b.x,Y=C===Ke.Right&&J<=O.x||C===Ke.Left&&J>=E.x;if(Y&&!b.y){S.scrollTo({left:J,behavior:p});return}Y?w.x=S.scrollLeft-J:w.x=C===Ke.Right?S.scrollLeft-O.x:S.scrollLeft-E.x,w.x&&S.scrollBy({left:-w.x,behavior:p});break}else if($&&U.y!==y.y){const J=S.scrollTop+b.y,Y=C===Ke.Down&&J<=O.y||C===Ke.Up&&J>=E.y;if(Y&&!b.x){S.scrollTo({top:J,behavior:p});return}Y?w.y=S.scrollTop-J:w.y=C===Ke.Down?S.scrollTop-O.y:S.scrollTop-E.y,w.y&&S.scrollBy({top:-w.y,behavior:p});break}}this.handleMove(a,ql(di(y,this.referenceCoordinates),w))}}}handleMove(a,s){const{onMove:o}=this.props;a.preventDefault(),o(s)}handleEnd(a){const{onEnd:s}=this.props;a.preventDefault(),this.detach(),s()}handleCancel(a){const{onCancel:s}=this.props;a.preventDefault(),this.detach(),s()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ti.activators=[{eventName:"onKeyDown",handler:(n,a,s)=>{let{keyboardCodes:o=Dj,onActivation:c}=a,{active:u}=s;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const p=u.activatorNode.current;return p&&n.target!==p?!1:(n.preventDefault(),c==null||c({event:n.nativeEvent}),!0)}return!1}}];function e0(n){return!!(n&&"distance"in n)}function t0(n){return!!(n&&"delay"in n)}class Hp{constructor(a,s,o){var c;o===void 0&&(o=g3(a.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=a,this.events=s;const{event:u}=a,{target:f}=u;this.props=a,this.events=s,this.document=ao(f),this.documentListeners=new ni(this.document),this.listeners=new ni(o),this.windowListeners=new ni(qn(f)),this.initialCoordinates=(c=pm(u))!=null?c:Ea,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:a,props:{options:{activationConstraint:s,bypassActivationConstraint:o}}}=this;if(this.listeners.add(a.move.name,this.handleMove,{passive:!1}),this.listeners.add(a.end.name,this.handleEnd),a.cancel&&this.listeners.add(a.cancel.name,this.handleCancel),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.DragStart,Wb),this.windowListeners.add(da.VisibilityChange,this.handleCancel),this.windowListeners.add(da.ContextMenu,Wb),this.documentListeners.add(da.Keydown,this.handleKeydown),s){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(t0(s)){this.timeoutId=setTimeout(this.handleStart,s.delay),this.handlePending(s);return}if(e0(s)){this.handlePending(s);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(a,s){const{active:o,onPending:c}=this.props;c(o,a,this.initialCoordinates,s)}handleStart(){const{initialCoordinates:a}=this,{onStart:s}=this.props;a&&(this.activated=!0,this.documentListeners.add(da.Click,v3,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(da.SelectionChange,this.removeTextSelection),s(a))}handleMove(a){var s;const{activated:o,initialCoordinates:c,props:u}=this,{onMove:f,options:{activationConstraint:p}}=u;if(!c)return;const g=(s=pm(a))!=null?s:Ea,v=di(c,g);if(!o&&p){if(e0(p)){if(p.tolerance!=null&&Bh(v,p.tolerance))return this.handleCancel();if(Bh(v,p.distance))return this.handleStart()}if(t0(p)&&Bh(v,p.tolerance))return this.handleCancel();this.handlePending(p,v);return}a.cancelable&&a.preventDefault(),f(g)}handleEnd(){const{onAbort:a,onEnd:s}=this.props;this.detach(),this.activated||a(this.props.active),s()}handleCancel(){const{onAbort:a,onCancel:s}=this.props;this.detach(),this.activated||a(this.props.active),s()}handleKeydown(a){a.code===Ke.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const y3={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ai extends Hp{constructor(a){const{event:s}=a,o=ao(s.target);super(a,y3,o)}}Ai.activators=[{eventName:"onPointerDown",handler:(n,a)=>{let{nativeEvent:s}=n,{onActivation:o}=a;return!s.isPrimary||s.button!==0?!1:(o==null||o({event:s}),!0)}}];const b3={move:{name:"mousemove"},end:{name:"mouseup"}};var vm;(function(n){n[n.RightClick=2]="RightClick"})(vm||(vm={}));class w3 extends Hp{constructor(a){super(a,b3,ao(a.event.target))}}w3.activators=[{eventName:"onMouseDown",handler:(n,a)=>{let{nativeEvent:s}=n,{onActivation:o}=a;return s.button===vm.RightClick?!1:(o==null||o({event:s}),!0)}}];const Hh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class j3 extends Hp{constructor(a){super(a,Hh)}static setup(){return window.addEventListener(Hh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Hh.move.name,a)};function a(){}}}j3.activators=[{eventName:"onTouchStart",handler:(n,a)=>{let{nativeEvent:s}=n,{onActivation:o}=a;const{touches:c}=s;return c.length>1?!1:(o==null||o({event:s}),!0)}}];var ai;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(ai||(ai={}));var Nu;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Nu||(Nu={}));function S3(n){let{acceleration:a,activator:s=ai.Pointer,canScroll:o,draggingRect:c,enabled:u,interval:f=5,order:p=Nu.TreeOrder,pointerCoordinates:g,scrollableAncestors:v,scrollableAncestorRects:x,delta:y,threshold:b}=n;const w=N3({delta:y,disabled:!u}),[N,S]=Uk(),C=h.useRef({x:0,y:0}),R=h.useRef({x:0,y:0}),D=h.useMemo(()=>{switch(s){case ai.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case ai.DraggableRect:return c}},[s,c,g]),A=h.useRef(null),M=h.useCallback(()=>{const E=A.current;if(!E)return;const _=C.current.x*R.current.x,U=C.current.y*R.current.y;E.scrollBy(_,U)},[]),O=h.useMemo(()=>p===Nu.TreeOrder?[...v].reverse():v,[p,v]);h.useEffect(()=>{if(!u||!v.length||!D){S();return}for(const E of O){if((o==null?void 0:o(E))===!1)continue;const _=v.indexOf(E),U=x[_];if(!U)continue;const{direction:P,speed:$}=u3(E,U,D,a,b);for(const J of["x","y"])w[J][P[J]]||($[J]=0,P[J]=0);if($.x>0||$.y>0){S(),A.current=E,N(M,f),C.current=$,R.current=P;return}}C.current={x:0,y:0},R.current={x:0,y:0},S()},[a,M,o,S,u,f,JSON.stringify(D),JSON.stringify(w),N,v,O,x,JSON.stringify(b)])}const C3={x:{[an.Backward]:!1,[an.Forward]:!1},y:{[an.Backward]:!1,[an.Forward]:!1}};function N3(n){let{delta:a,disabled:s}=n;const o=mm(a);return Ei(c=>{if(s||!o||!c)return C3;const u={x:Math.sign(a.x-o.x),y:Math.sign(a.y-o.y)};return{x:{[an.Backward]:c.x[an.Backward]||u.x===-1,[an.Forward]:c.x[an.Forward]||u.x===1},y:{[an.Backward]:c.y[an.Backward]||u.y===-1,[an.Forward]:c.y[an.Forward]||u.y===1}}},[s,a,o])}function E3(n,a){const s=a!=null?n.get(a):void 0,o=s?s.node.current:null;return Ei(c=>{var u;return a==null?null:(u=o??c)!=null?u:null},[o,a])}function R3(n,a){return h.useMemo(()=>n.reduce((s,o)=>{const{sensor:c}=o,u=c.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,o)}));return[...s,...u]},[]),[n,a])}var fi;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(fi||(fi={}));var xm;(function(n){n.Optimized="optimized"})(xm||(xm={}));const n0=new Map;function T3(n,a){let{dragging:s,dependencies:o,config:c}=a;const[u,f]=h.useState(null),{frequency:p,measure:g,strategy:v}=c,x=h.useRef(n),y=C(),b=ui(y),w=h.useCallback(function(R){R===void 0&&(R=[]),!b.current&&f(D=>D===null?R:D.concat(R.filter(A=>!D.includes(A))))},[b]),N=h.useRef(null),S=Ei(R=>{if(y&&!s)return n0;if(!R||R===n0||x.current!==n||u!=null){const D=new Map;for(let A of n){if(!A)continue;if(u&&u.length>0&&!u.includes(A.id)&&A.rect.current){D.set(A.id,A.rect.current);continue}const M=A.node.current,O=M?new Bp(g(M),M):null;A.rect.current=O,O&&D.set(A.id,O)}return D}return R},[n,u,s,y,g]);return h.useEffect(()=>{x.current=n},[n]),h.useEffect(()=>{y||w()},[s,y]),h.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),h.useEffect(()=>{y||typeof p!="number"||N.current!==null||(N.current=setTimeout(()=>{w(),N.current=null},p))},[p,y,w,...o]),{droppableRects:S,measureDroppableContainers:w,measuringScheduled:u!=null};function C(){switch(v){case fi.Always:return!1;case fi.BeforeDragging:return s;default:return!s}}}function Oj(n,a){return Ei(s=>n?s||(typeof a=="function"?a(n):n):null,[a,n])}function A3(n,a){return Oj(n,a)}function M3(n){let{callback:a,disabled:s}=n;const o=Lp(a),c=h.useMemo(()=>{if(s||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,s]);return h.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function td(n){let{callback:a,disabled:s}=n;const o=Lp(a),c=h.useMemo(()=>{if(s||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[s]);return h.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function D3(n){return new Bp(ro(n),n)}function a0(n,a,s){a===void 0&&(a=D3);const[o,c]=h.useState(null);function u(){c(g=>{if(!n)return null;if(n.isConnected===!1){var v;return(v=g??s)!=null?v:null}const x=a(n);return JSON.stringify(g)===JSON.stringify(x)?g:x})}const f=M3({callback(g){if(n)for(const v of g){const{type:x,target:y}=v;if(x==="childList"&&y instanceof HTMLElement&&y.contains(n)){u();break}}}}),p=td({callback:u});return qa(()=>{u(),n?(p==null||p.observe(n),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(p==null||p.disconnect(),f==null||f.disconnect())},[n]),o}function O3(n){const a=Oj(n);return Cj(n,a)}const r0=[];function k3(n){const a=h.useRef(n),s=Ei(o=>n?o&&o!==r0&&n&&a.current&&n.parentNode===a.current.parentNode?o:ed(n):r0,[n]);return h.useEffect(()=>{a.current=n},[n]),s}function _3(n){const[a,s]=h.useState(null),o=h.useRef(n),c=h.useCallback(u=>{const f=Ph(u.target);f&&s(p=>p?(p.set(f,gm(f)),new Map(p)):null)},[]);return h.useEffect(()=>{const u=o.current;if(n!==u){f(u);const p=n.map(g=>{const v=Ph(g);return v?(v.addEventListener("scroll",c,{passive:!0}),[v,gm(v)]):null}).filter(g=>g!=null);s(p.length?new Map(p):null),o.current=n}return()=>{f(n),f(u)};function f(p){p.forEach(g=>{const v=Ph(g);v==null||v.removeEventListener("scroll",c)})}},[c,n]),h.useMemo(()=>n.length?a?Array.from(a.values()).reduce((u,f)=>ql(u,f),Ea):Mj(n):Ea,[n,a])}function s0(n,a){a===void 0&&(a=[]);const s=h.useRef(null);return h.useEffect(()=>{s.current=null},a),h.useEffect(()=>{const o=n!==Ea;o&&!s.current&&(s.current=n),!o&&s.current&&(s.current=null)},[n]),s.current?di(n,s.current):Ea}function z3(n){h.useEffect(()=>{if(!Wu)return;const a=n.map(s=>{let{sensor:o}=s;return o.setup==null?void 0:o.setup()});return()=>{for(const s of a)s==null||s()}},n.map(a=>{let{sensor:s}=a;return s}))}function L3(n,a){return h.useMemo(()=>n.reduce((s,o)=>{let{eventName:c,handler:u}=o;return s[c]=f=>{u(f,a)},s},{}),[n,a])}function kj(n){return h.useMemo(()=>n?l3(n):null,[n])}const l0=[];function U3(n,a){a===void 0&&(a=ro);const[s]=n,o=kj(s?qn(s):null),[c,u]=h.useState(l0);function f(){u(()=>n.length?n.map(g=>Tj(g)?o:new Bp(a(g),g)):l0)}const p=td({callback:f});return qa(()=>{p==null||p.disconnect(),f(),n.forEach(g=>p==null?void 0:p.observe(g))},[n]),c}function I3(n){if(!n)return null;if(n.children.length>1)return n;const a=n.children[0];return Ni(a)?a:n}function P3(n){let{measure:a}=n;const[s,o]=h.useState(null),c=h.useCallback(v=>{for(const{target:x}of v)if(Ni(x)){o(y=>{const b=a(x);return y?{...y,width:b.width,height:b.height}:b});break}},[a]),u=td({callback:c}),f=h.useCallback(v=>{const x=I3(v);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?a(x):null)},[a,u]),[p,g]=ju(f);return h.useMemo(()=>({nodeRef:p,rect:s,setRef:g}),[s,p,g])}const B3=[{sensor:Ai,options:{}},{sensor:Ti,options:{}}],H3={current:{}},fu={draggable:{measure:Jb},droppable:{measure:Jb,strategy:fi.WhileDragging,frequency:xm.Optimized},dragOverlay:{measure:ro}};class ri extends Map{get(a){var s;return a!=null&&(s=super.get(a))!=null?s:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(a=>{let{disabled:s}=a;return!s})}getNodeFor(a){var s,o;return(s=(o=this.get(a))==null?void 0:o.node.current)!=null?s:void 0}}const q3={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ri,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Cu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fu,measureDroppableContainers:Cu,windowRect:null,measuringScheduled:!1},$3={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Cu,draggableNodes:new Map,over:null,measureDroppableContainers:Cu},nd=h.createContext($3),_j=h.createContext(q3);function V3(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ri}}}function Y3(n,a){switch(a.type){case Ft.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case Ft.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:a.coordinates.x-n.draggable.initialCoordinates.x,y:a.coordinates.y-n.draggable.initialCoordinates.y}}};case Ft.DragEnd:case Ft.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ft.RegisterDroppable:{const{element:s}=a,{id:o}=s,c=new ri(n.droppable.containers);return c.set(o,s),{...n,droppable:{...n.droppable,containers:c}}}case Ft.SetDroppableDisabled:{const{id:s,key:o,disabled:c}=a,u=n.droppable.containers.get(s);if(!u||o!==u.key)return n;const f=new ri(n.droppable.containers);return f.set(s,{...u,disabled:c}),{...n,droppable:{...n.droppable,containers:f}}}case Ft.UnregisterDroppable:{const{id:s,key:o}=a,c=n.droppable.containers.get(s);if(!c||o!==c.key)return n;const u=new ri(n.droppable.containers);return u.delete(s),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function G3(n){let{disabled:a}=n;const{active:s,activatorEvent:o,draggableNodes:c}=h.useContext(nd),u=mm(o),f=mm(s==null?void 0:s.id);return h.useEffect(()=>{if(!a&&!o&&u&&f!=null){if(!Up(u)||document.activeElement===u.target)return;const p=c.get(f);if(!p)return;const{activatorNode:g,node:v}=p;if(!g.current&&!v.current)return;requestAnimationFrame(()=>{for(const x of[g.current,v.current]){if(!x)continue;const y=Bk(x);if(y){y.focus();break}}})}},[o,a,c,f,u]),null}function F3(n,a){let{transform:s,...o}=a;return n!=null&&n.length?n.reduce((c,u)=>u({transform:c,...o}),s):s}function X3(n){return h.useMemo(()=>({draggable:{...fu.draggable,...n==null?void 0:n.draggable},droppable:{...fu.droppable,...n==null?void 0:n.droppable},dragOverlay:{...fu.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function K3(n){let{activeNode:a,measure:s,initialRect:o,config:c=!0}=n;const u=h.useRef(!1),{x:f,y:p}=typeof c=="boolean"?{x:c,y:c}:c;qa(()=>{if(!f&&!p||!a){u.current=!1;return}if(u.current||!o)return;const v=a==null?void 0:a.node.current;if(!v||v.isConnected===!1)return;const x=s(v),y=Cj(x,o);if(f||(y.x=0),p||(y.y=0),u.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const b=Nj(v);b&&b.scrollBy({top:y.y,left:y.x})}},[a,f,p,o,s])}const zj=h.createContext({...Ea,scaleX:1,scaleY:1});var ss;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(ss||(ss={}));const qp=h.memo(function(a){var s,o,c,u;let{id:f,accessibility:p,autoScroll:g=!0,children:v,sensors:x=B3,collisionDetection:y=Wk,measuring:b,modifiers:w,...N}=a;const S=h.useReducer(Y3,void 0,V3),[C,R]=S,[D,A]=Gk(),[M,O]=h.useState(ss.Uninitialized),E=M===ss.Initialized,{draggable:{active:_,nodes:U,translate:P},droppable:{containers:$}}=C,J=_!=null?U.get(_):null,Y=h.useRef({initial:null,translated:null}),ce=h.useMemo(()=>{var xt;return _!=null?{id:_,data:(xt=J==null?void 0:J.data)!=null?xt:H3,rect:Y}:null},[_,J]),ue=h.useRef(null),[B,k]=h.useState(null),[q,Z]=h.useState(null),ee=ui(N,Object.values(N)),te=Ri("DndDescribedBy",f),z=h.useMemo(()=>$.getEnabled(),[$]),L=X3(b),{droppableRects:F,measureDroppableContainers:ae,measuringScheduled:ge}=T3(z,{dragging:E,dependencies:[P.x,P.y],config:L.droppable}),ye=E3(U,_),G=h.useMemo(()=>q?pm(q):null,[q]),ie=Ar(),he=A3(ye,L.draggable.measure);K3({activeNode:_!=null?U.get(_):null,config:ie.layoutShiftCompensation,initialRect:he,measure:L.draggable.measure});const xe=a0(ye,L.draggable.measure,he),Ae=a0(ye?ye.parentElement:null),Ne=h.useRef({activatorEvent:null,active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:U,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Oe=$.getNodeFor((s=Ne.current.over)==null?void 0:s.id),Qe=P3({measure:L.dragOverlay.measure}),et=(o=Qe.nodeRef.current)!=null?o:ye,oe=E?(c=Qe.rect)!=null?c:xe:null,Le=!!(Qe.nodeRef.current&&Qe.rect),qe=O3(Le?null:xe),_t=kj(et?qn(et):null),St=k3(E?Oe??ye:null),Wt=U3(St),mn=F3(w,{transform:{x:P.x-qe.x,y:P.y-qe.y,scaleX:1,scaleY:1},activatorEvent:q,active:ce,activeNodeRect:xe,containerNodeRect:Ae,draggingNodeRect:oe,over:Ne.current.over,overlayNodeRect:Qe.rect,scrollableAncestors:St,scrollableAncestorRects:Wt,windowRect:_t}),en=G?ql(G,P):null,Ct=_3(St),xn=s0(Ct),At=s0(Ct,[xe]),Mt=ql(mn,xn),pn=oe?n3(oe,mn):null,pa=ce&&pn?y({active:ce,collisionRect:pn,droppableRects:F,droppableContainers:z,pointerCoordinates:en}):null,Aa=Sj(pa,"id"),[Wn,ms]=h.useState(null),ga=Le?mn:ql(mn,At),Dt=e3(ga,(u=Wn==null?void 0:Wn.rect)!=null?u:null,xe),yn=h.useRef(null),Tt=h.useCallback((xt,at)=>{let{sensor:It,options:Re}=at;if(ue.current==null)return;const _e=U.get(ue.current);if(!_e)return;const Ue=xt.nativeEvent,vt=new It({active:ue.current,activeNode:_e,event:Ue,options:Re,context:Ne,onAbort(ut){if(!U.get(ut))return;const{onDragAbort:yt}=ee.current,zt={id:ut};yt==null||yt(zt),D({type:"onDragAbort",event:zt})},onPending(ut,Yt,yt,zt){if(!U.get(ut))return;const{onDragPending:Fa}=ee.current,va={id:ut,constraint:Yt,initialCoordinates:yt,offset:zt};Fa==null||Fa(va),D({type:"onDragPending",event:va})},onStart(ut){const Yt=ue.current;if(Yt==null)return;const yt=U.get(Yt);if(!yt)return;const{onDragStart:zt}=ee.current,Ga={activatorEvent:Ue,active:{id:Yt,data:yt.data,rect:Y}};Sa.unstable_batchedUpdates(()=>{zt==null||zt(Ga),O(ss.Initializing),R({type:Ft.DragStart,initialCoordinates:ut,active:Yt}),D({type:"onDragStart",event:Ga}),k(yn.current),Z(Ue)})},onMove(ut){R({type:Ft.DragMove,coordinates:ut})},onEnd:Nt(Ft.DragEnd),onCancel:Nt(Ft.DragCancel)});yn.current=vt;function Nt(ut){return async function(){const{active:yt,collisions:zt,over:Ga,scrollAdjustedTranslate:Fa}=Ne.current;let va=null;if(yt&&Fa){const{cancelDrop:Mr}=ee.current;va={activatorEvent:Ue,active:yt,collisions:zt,delta:Fa,over:Ga},ut===Ft.DragEnd&&typeof Mr=="function"&&await Promise.resolve(Mr(va))&&(ut=Ft.DragCancel)}ue.current=null,Sa.unstable_batchedUpdates(()=>{R({type:ut}),O(ss.Uninitialized),ms(null),k(null),Z(null),yn.current=null;const Mr=ut===Ft.DragEnd?"onDragEnd":"onDragCancel";if(va){const ea=ee.current[Mr];ea==null||ea(va),D({type:Mr,event:va})}})}}},[U]),lo=h.useCallback((xt,at)=>(It,Re)=>{const _e=It.nativeEvent,Ue=U.get(Re);if(ue.current!==null||!Ue||_e.dndKit||_e.defaultPrevented)return;const vt={active:Ue};xt(It,at.options,vt)===!0&&(_e.dndKit={capturedBy:at.sensor},ue.current=Re,Tt(It,at))},[U,Tt]),Fs=R3(x,lo);z3(x),qa(()=>{xe&&M===ss.Initializing&&O(ss.Initialized)},[xe,M]),h.useEffect(()=>{const{onDragMove:xt}=ee.current,{active:at,activatorEvent:It,collisions:Re,over:_e}=Ne.current;if(!at||!It)return;const Ue={active:at,activatorEvent:It,collisions:Re,delta:{x:Mt.x,y:Mt.y},over:_e};Sa.unstable_batchedUpdates(()=>{xt==null||xt(Ue),D({type:"onDragMove",event:Ue})})},[Mt.x,Mt.y]),h.useEffect(()=>{const{active:xt,activatorEvent:at,collisions:It,droppableContainers:Re,scrollAdjustedTranslate:_e}=Ne.current;if(!xt||ue.current==null||!at||!_e)return;const{onDragOver:Ue}=ee.current,vt=Re.get(Aa),Nt=vt&&vt.rect.current?{id:vt.id,rect:vt.rect.current,data:vt.data,disabled:vt.disabled}:null,ut={active:xt,activatorEvent:at,collisions:It,delta:{x:_e.x,y:_e.y},over:Nt};Sa.unstable_batchedUpdates(()=>{ms(Nt),Ue==null||Ue(ut),D({type:"onDragOver",event:ut})})},[Aa]),qa(()=>{Ne.current={activatorEvent:q,active:ce,activeNode:ye,collisionRect:pn,collisions:pa,droppableRects:F,draggableNodes:U,draggingNode:et,draggingNodeRect:oe,droppableContainers:$,over:Wn,scrollableAncestors:St,scrollAdjustedTranslate:Mt},Y.current={initial:oe,translated:pn}},[ce,ye,pa,pn,U,et,oe,F,$,Wn,St,Mt]),S3({...ie,delta:P,draggingRect:pn,pointerCoordinates:en,scrollableAncestors:St,scrollableAncestorRects:Wt});const Xs=h.useMemo(()=>({active:ce,activeNode:ye,activeNodeRect:xe,activatorEvent:q,collisions:pa,containerNodeRect:Ae,dragOverlay:Qe,draggableNodes:U,droppableContainers:$,droppableRects:F,over:Wn,measureDroppableContainers:ae,scrollableAncestors:St,scrollableAncestorRects:Wt,measuringConfiguration:L,measuringScheduled:ge,windowRect:_t}),[ce,ye,xe,q,pa,Ae,Qe,U,$,F,Wn,ae,St,Wt,L,ge,_t]),Ya=h.useMemo(()=>({activatorEvent:q,activators:Fs,active:ce,activeNodeRect:xe,ariaDescribedById:{draggable:te},dispatch:R,draggableNodes:U,over:Wn,measureDroppableContainers:ae}),[q,Fs,ce,xe,R,te,U,Wn,ae]);return me.createElement(bj.Provider,{value:A},me.createElement(nd.Provider,{value:Ya},me.createElement(_j.Provider,{value:Xs},me.createElement(zj.Provider,{value:Dt},v)),me.createElement(G3,{disabled:(p==null?void 0:p.restoreFocus)===!1})),me.createElement(Kk,{...p,hiddenTextDescribedById:te}));function Ar(){const xt=(B==null?void 0:B.autoScrollEnabled)===!1,at=typeof g=="object"?g.enabled===!1:g===!1,It=E&&!xt&&!at;return typeof g=="object"?{...g,enabled:It}:{enabled:It}}}),Q3=h.createContext(null),o0="button",Z3="Draggable";function J3(n){let{id:a,data:s,disabled:o=!1,attributes:c}=n;const u=Ri(Z3),{activators:f,activatorEvent:p,active:g,activeNodeRect:v,ariaDescribedById:x,draggableNodes:y,over:b}=h.useContext(nd),{role:w=o0,roleDescription:N="draggable",tabIndex:S=0}=c??{},C=(g==null?void 0:g.id)===a,R=h.useContext(C?zj:Q3),[D,A]=ju(),[M,O]=ju(),E=L3(f,a),_=ui(s);qa(()=>(y.set(a,{id:a,key:u,node:D,activatorNode:M,data:_}),()=>{const P=y.get(a);P&&P.key===u&&y.delete(a)}),[y,a]);const U=h.useMemo(()=>({role:w,tabIndex:S,"aria-disabled":o,"aria-pressed":C&&w===o0?!0:void 0,"aria-roledescription":N,"aria-describedby":x.draggable}),[o,w,S,C,N,x.draggable]);return{active:g,activatorEvent:p,activeNodeRect:v,attributes:U,isDragging:C,listeners:o?void 0:E,node:D,over:b,setNodeRef:A,setActivatorNodeRef:O,transform:R}}function W3(){return h.useContext(_j)}const e_="Droppable",t_={timeout:25};function n_(n){let{data:a,disabled:s=!1,id:o,resizeObserverConfig:c}=n;const u=Ri(e_),{active:f,dispatch:p,over:g,measureDroppableContainers:v}=h.useContext(nd),x=h.useRef({disabled:s}),y=h.useRef(!1),b=h.useRef(null),w=h.useRef(null),{disabled:N,updateMeasurementsFor:S,timeout:C}={...t_,...c},R=ui(S??o),D=h.useCallback(()=>{if(!y.current){y.current=!0;return}w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{v(Array.isArray(R.current)?R.current:[R.current]),w.current=null},C)},[C]),A=td({callback:D,disabled:N||!f}),M=h.useCallback((U,P)=>{A&&(P&&(A.unobserve(P),y.current=!1),U&&A.observe(U))},[A]),[O,E]=ju(M),_=ui(a);return h.useEffect(()=>{!A||!O.current||(A.disconnect(),y.current=!1,A.observe(O.current))},[O,A]),h.useEffect(()=>(p({type:Ft.RegisterDroppable,element:{id:o,key:u,disabled:s,node:O,rect:b,data:_}}),()=>p({type:Ft.UnregisterDroppable,key:u,id:o})),[o]),h.useEffect(()=>{s!==x.current.disabled&&(p({type:Ft.SetDroppableDisabled,id:o,key:u,disabled:s}),x.current.disabled=s)},[o,u,s,p]),{active:f,rect:b,isOver:(g==null?void 0:g.id)===o,node:O,over:g,setNodeRef:E}}function a_(n,a,s){const o={...n};return a.top+n.y<=s.top?o.y=s.top-a.top:a.bottom+n.y>=s.top+s.height&&(o.y=s.top+s.height-a.bottom),a.left+n.x<=s.left?o.x=s.left-a.left:a.right+n.x>=s.left+s.width&&(o.x=s.left+s.width-a.right),o}const $p=n=>{let{containerNodeRect:a,draggingNodeRect:s,transform:o}=n;return!s||!a?o:a_(o,s,a)},Vp=n=>{let{transform:a}=n;return{...a,x:0}};function Mi(n,a,s){const o=n.slice();return o.splice(s<0?o.length+s:s,0,o.splice(a,1)[0]),o}function r_(n,a){return n.reduce((s,o,c)=>{const u=a.get(o);return u&&(s[c]=u),s},Array(n.length))}function Wc(n){return n!==null&&n>=0}function s_(n,a){if(n===a)return!0;if(n.length!==a.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!==a[s])return!1;return!0}function l_(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Lj=n=>{let{rects:a,activeIndex:s,overIndex:o,index:c}=n;const u=Mi(a,o,s),f=a[c],p=u[c];return!p||!f?null:{x:p.left-f.left,y:p.top-f.top,scaleX:p.width/f.width,scaleY:p.height/f.height}},eu={scaleX:1,scaleY:1},Yp=n=>{var a;let{activeIndex:s,activeNodeRect:o,index:c,rects:u,overIndex:f}=n;const p=(a=u[s])!=null?a:o;if(!p)return null;if(c===s){const v=u[f];return v?{x:0,y:s<f?v.top+v.height-(p.top+p.height):v.top-p.top,...eu}:null}const g=o_(u,c,s);return c>s&&c<=f?{x:0,y:-p.height-g,...eu}:c<s&&c>=f?{x:0,y:p.height+g,...eu}:{x:0,y:0,...eu}};function o_(n,a,s){const o=n[a],c=n[a-1],u=n[a+1];return o?s<a?c?o.top-(c.top+c.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):c?o.top-(c.top+c.height):0:0}const Uj="Sortable",Ij=me.createContext({activeIndex:-1,containerId:Uj,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Lj,disabled:{draggable:!1,droppable:!1}});function Gp(n){let{children:a,id:s,items:o,strategy:c=Lj,disabled:u=!1}=n;const{active:f,dragOverlay:p,droppableRects:g,over:v,measureDroppableContainers:x}=W3(),y=Ri(Uj,s),b=p.rect!==null,w=h.useMemo(()=>o.map(E=>typeof E=="object"&&"id"in E?E.id:E),[o]),N=f!=null,S=f?w.indexOf(f.id):-1,C=v?w.indexOf(v.id):-1,R=h.useRef(w),D=!s_(w,R.current),A=C!==-1&&S===-1||D,M=l_(u);qa(()=>{D&&N&&x(w)},[D,w,N,x]),h.useEffect(()=>{R.current=w},[w]);const O=h.useMemo(()=>({activeIndex:S,containerId:y,disabled:M,disableTransforms:A,items:w,overIndex:C,useDragOverlay:b,sortedRects:r_(w,g),strategy:c}),[S,y,M.draggable,M.droppable,A,w,C,g,b,c]);return me.createElement(Ij.Provider,{value:O},a)}const i_=n=>{let{id:a,items:s,activeIndex:o,overIndex:c}=n;return Mi(s,o,c).indexOf(a)},c_=n=>{let{containerId:a,isSorting:s,wasDragging:o,index:c,items:u,newIndex:f,previousItems:p,previousContainerId:g,transition:v}=n;return!v||!o||p!==u&&c===f?!1:s?!0:f!==c&&a===g},u_={duration:200,easing:"ease"},Pj="transform",d_=Su.Transition.toString({property:Pj,duration:0,easing:"linear"}),f_={roleDescription:"sortable"};function h_(n){let{disabled:a,index:s,node:o,rect:c}=n;const[u,f]=h.useState(null),p=h.useRef(s);return qa(()=>{if(!a&&s!==p.current&&o.current){const g=c.current;if(g){const v=ro(o.current,{ignoreTransform:!0}),x={x:g.left-v.left,y:g.top-v.top,scaleX:g.width/v.width,scaleY:g.height/v.height};(x.x||x.y)&&f(x)}}s!==p.current&&(p.current=s)},[a,s,o,c]),h.useEffect(()=>{u&&f(null)},[u]),u}function Fp(n){let{animateLayoutChanges:a=c_,attributes:s,disabled:o,data:c,getNewIndex:u=i_,id:f,strategy:p,resizeObserverConfig:g,transition:v=u_}=n;const{items:x,containerId:y,activeIndex:b,disabled:w,disableTransforms:N,sortedRects:S,overIndex:C,useDragOverlay:R,strategy:D}=h.useContext(Ij),A=m_(o,w),M=x.indexOf(f),O=h.useMemo(()=>({sortable:{containerId:y,index:M,items:x},...c}),[y,c,M,x]),E=h.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:_,node:U,isOver:P,setNodeRef:$}=n_({id:f,data:O,disabled:A.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...g}}),{active:J,activatorEvent:Y,activeNodeRect:ce,attributes:ue,setNodeRef:B,listeners:k,isDragging:q,over:Z,setActivatorNodeRef:ee,transform:te}=J3({id:f,data:O,attributes:{...f_,...s},disabled:A.draggable}),z=Lk($,B),L=!!J,F=L&&!N&&Wc(b)&&Wc(C),ae=!R&&q,ge=ae&&F?te:null,G=F?ge??(p??D)({rects:S,activeNodeRect:ce,activeIndex:b,overIndex:C,index:M}):null,ie=Wc(b)&&Wc(C)?u({id:f,items:x,activeIndex:b,overIndex:C}):M,he=J==null?void 0:J.id,xe=h.useRef({activeId:he,items:x,newIndex:ie,containerId:y}),Ae=x!==xe.current.items,Ne=a({active:J,containerId:y,isDragging:q,isSorting:L,id:f,index:M,items:x,newIndex:xe.current.newIndex,previousItems:xe.current.items,previousContainerId:xe.current.containerId,transition:v,wasDragging:xe.current.activeId!=null}),Oe=h_({disabled:!Ne,index:M,node:U,rect:_});return h.useEffect(()=>{L&&xe.current.newIndex!==ie&&(xe.current.newIndex=ie),y!==xe.current.containerId&&(xe.current.containerId=y),x!==xe.current.items&&(xe.current.items=x)},[L,ie,y,x]),h.useEffect(()=>{if(he===xe.current.activeId)return;if(he!=null&&xe.current.activeId==null){xe.current.activeId=he;return}const et=setTimeout(()=>{xe.current.activeId=he},50);return()=>clearTimeout(et)},[he]),{active:J,activeIndex:b,attributes:ue,data:O,rect:_,index:M,newIndex:ie,items:x,isOver:P,isSorting:L,isDragging:q,listeners:k,node:U,overIndex:C,over:Z,setNodeRef:z,setActivatorNodeRef:ee,setDroppableNodeRef:$,setDraggableNodeRef:B,transform:Oe??G,transition:Qe()};function Qe(){if(Oe||Ae&&xe.current.newIndex===M)return d_;if(!(ae&&!Up(Y)||!v)&&(L||Ne))return Su.Transition.toString({...v,property:Pj})}}function m_(n,a){var s,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(s=n==null?void 0:n.draggable)!=null?s:a.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:a.droppable}}function Eu(n){if(!n)return!1;const a=n.data.current;return!!(a&&"sortable"in a&&typeof a.sortable=="object"&&"containerId"in a.sortable&&"items"in a.sortable&&"index"in a.sortable)}const p_=[Ke.Down,Ke.Right,Ke.Up,Ke.Left],Xp=(n,a)=>{let{context:{active:s,collisionRect:o,droppableRects:c,droppableContainers:u,over:f,scrollableAncestors:p}}=a;if(p_.includes(n.code)){if(n.preventDefault(),!s||!o)return;const g=[];u.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const b=c.get(y.id);if(b)switch(n.code){case Ke.Down:o.top<b.top&&g.push(y);break;case Ke.Up:o.top>b.top&&g.push(y);break;case Ke.Left:o.left>b.left&&g.push(y);break;case Ke.Right:o.left<b.left&&g.push(y);break}});const v=Zk({collisionRect:o,droppableRects:c,droppableContainers:g});let x=Sj(v,"id");if(x===(f==null?void 0:f.id)&&v.length>1&&(x=v[1].id),x!=null){const y=u.get(s.id),b=u.get(x),w=b?c.get(b.id):null,N=b==null?void 0:b.node.current;if(N&&w&&y&&b){const C=ed(N).some((E,_)=>p[_]!==E),R=Bj(y,b),D=g_(y,b),A=C||!R?{x:0,y:0}:{x:D?o.width-w.width:0,y:D?o.height-w.height:0},M={x:w.left,y:w.top};return A.x&&A.y?M:di(M,A)}}}};function Bj(n,a){return!Eu(n)||!Eu(a)?!1:n.data.current.sortable.containerId===a.data.current.sortable.containerId}function g_(n,a){return!Eu(n)||!Eu(a)||!Bj(n,a)?!1:n.data.current.sortable.index<a.data.current.sortable.index}var v_=Object.defineProperty,Sr=(n,a)=>v_(n,"name",{value:a,configurable:!0}),Kp="Checkbox",[x_,T5]=Hn(Kp),[y_,Qp]=x_(Kp);function Hj(n){const{__scopeCheckbox:a,checked:s,children:o,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=Ia({prop:s,defaultProp:c??!1,onChange:g,caller:Kp}),[N,S]=h.useState(null),[C,R]=h.useState(null),D=h.useRef(!1),[A,M]=h.useReducer(_=>_+1,0),O=N?!!f||!!N.closest("form"):!0,E={checked:b,disabled:u,setChecked:w,control:N,setControl:S,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:D,userInteractionCount:A,onUserInteraction:M,required:v,defaultChecked:xr(c)?!1:c,isFormControl:O,bubbleInput:C,setBubbleInput:R};return l.jsx(y_,{scope:a,...E,children:$j(y)?y(E):o})}Sr(Hj,"CheckboxProvider");var b_="CheckboxTrigger",w_=h.forwardRef(Sr(function({__scopeCheckbox:a,onKeyDown:s,onClick:o,...c},u){const{control:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:N,isFormControl:S,bubbleInput:C}=Qp(b_,a),R=Fe(u,y),D=h.useRef(v);return h.useEffect(()=>{const A=f==null?void 0:f.form;if(A){const M=Sr(()=>b(D.current),"reset");return A.addEventListener("reset",M),()=>A.removeEventListener("reset",M)}},[f,b]),l.jsx(He.button,{type:"button",role:"checkbox","aria-checked":xr(v)?"mixed":v,"aria-required":x,"data-state":Zp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...c,ref:R,onKeyDown:Se(s,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:Se(o,A=>{N(),b(M=>xr(M)?!0:!M),C&&S&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"CheckboxTrigger")),qj=h.forwardRef(Sr(function(a,s){const{__scopeCheckbox:o,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return l.jsx(Hj,{__scopeCheckbox:o,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>l.jsxs(l.Fragment,{children:[l.jsx(w_,{...b,ref:s,__scopeCheckbox:o}),w&&l.jsx(N_,{__scopeCheckbox:o})]})})},"Checkbox")),j_="CheckboxIndicator",S_=h.forwardRef(Sr(function(a,s){const{__scopeCheckbox:o,forceMount:c,...u}=a,f=Qp(j_,o);return l.jsx(Er,{present:c||xr(f.checked)||f.checked===!0,children:l.jsx(He.span,{"data-state":Zp(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:s,style:{pointerEvents:"none",...a.style}})})},"CheckboxIndicator")),C_="CheckboxBubbleInput",N_=h.forwardRef(Sr(function({__scopeCheckbox:a,onClick:s,...o},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:N,bubbleInput:S,setBubbleInput:C}=Qp(C_,a),R=Fe(c,C),D=$u(u),A=h.useRef(!1),M=h.useRef(g),O=h.useRef(p);h.useEffect(()=>{const _=S;if(!_)return;const U=window.HTMLInputElement.prototype,$=Object.getOwnPropertyDescriptor(U,"checked").set,J=p!==O.current;O.current=p;const Y=M.current!==g;M.current=g;const ce=!(J&&f.current);if(Y&&$){A.current=!J;const ue=new Event("click",{bubbles:ce});_.indeterminate=xr(g),$.call(_,xr(g)?!1:g),_.dispatchEvent(ue),A.current=!1}},[S,g,f,p]);const E=h.useRef(xr(g)?!1:g);return l.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??E.current,required:x,disabled:y,name:b,value:w,form:N,...o,tabIndex:-1,ref:R,onClick:Se(s,_=>{A.current&&_.stopPropagation()}),style:{...o.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function $j(n){return typeof n=="function"}Sr($j,"isFunction");function xr(n){return n==="indeterminate"}Sr(xr,"isIndeterminate");function Zp(n){return xr(n)?"indeterminate":n?"checked":"unchecked"}Sr(Zp,"getState");const Cr=h.forwardRef(({className:n,...a},s)=>l.jsx(qj,{ref:s,className:Ce("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",n),...a,children:l.jsx(S_,{className:Ce("flex items-center justify-center text-current"),children:l.jsx(Bm,{className:"h-3.5 w-3.5"})})}));Cr.displayName=qj.displayName;function Vj({value:n,className:a,indicatorClassName:s}){const o=Math.max(0,Math.min(100,Number.isFinite(n)?n:0));return l.jsx("div",{role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,className:Ce("h-2 w-full overflow-hidden rounded-full bg-secondary",a),children:l.jsx("div",{className:Ce("h-full w-full flex-1 bg-primary transition-all",s),style:{transform:`translateX(-${100-o}%)`}})})}var E_=Object.defineProperty,hn=(n,a)=>E_(n,"name",{value:a,configurable:!0}),[Jp,A5]=Hn("Tooltip",[to]),Wp=to(),R_="TooltipProvider",T_=700,ym="tooltip.open",[A_,eg]=Jp(R_),M_=hn(n=>{const{__scopeTooltip:a,delayDuration:s=T_,skipDelayDuration:o=300,disableHoverableContent:c=!1,children:u}=n,f=h.useRef(!0),p=h.useRef(!1),g=h.useRef(0);return h.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),l.jsx(A_,{scope:a,isOpenDelayedRef:f,delayDuration:s,onOpen:h.useCallback(()=>{o<=0||(window.clearTimeout(g.current),f.current=!1)},[o]),onClose:h.useCallback(()=>{o<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,o))},[o]),isPointerInTransitRef:p,onPointerInTransitChange:h.useCallback(v=>{p.current=v},[]),disableHoverableContent:c,children:u})},"TooltipProvider"),bm="Tooltip",[D_,ad]=Jp(bm),O_=hn(n=>{const{__scopeTooltip:a,children:s,open:o,defaultOpen:c,onOpenChange:u,disableHoverableContent:f,delayDuration:p}=n,g=eg(bm,n.__scopeTooltip),v=Wp(a),[x,y]=h.useState(null),[b,w]=h.useState(void 0),N=Na(),S=h.useRef(0),C=f??g.disableHoverableContent,R=p??g.delayDuration,D=h.useRef(!1),[A,M]=Ia({prop:o,defaultProp:c??!1,onChange:hn($=>{$?(g.onOpen(),document.dispatchEvent(new CustomEvent(ym))):g.onClose(),u==null||u($)},"onChange"),caller:bm}),O=h.useMemo(()=>A?D.current?"delayed-open":"instant-open":"closed",[A]),E=h.useCallback(()=>{window.clearTimeout(S.current),S.current=0,D.current=!1,M(!0)},[M]),_=h.useCallback(()=>{window.clearTimeout(S.current),S.current=0,M(!1)},[M]),U=h.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{D.current=!0,M(!0),S.current=0},R)},[R,M]);h.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const P=b??N;return l.jsx(lp,{...v,children:l.jsx(D_,{scope:a,contentId:P,setContentId:w,open:A,stateAttribute:O,trigger:x,onTriggerChange:y,onTriggerEnter:h.useCallback(()=>{g.isOpenDelayedRef.current?U():E()},[g.isOpenDelayedRef,U,E]),onTriggerLeave:h.useCallback(()=>{C?_():(window.clearTimeout(S.current),S.current=0)},[_,C]),onOpen:E,onClose:_,disableHoverableContent:C,children:s})})},"Tooltip"),i0="TooltipTrigger",k_=h.forwardRef(hn(function(a,s){const{__scopeTooltip:o,...c}=a,u=ad(i0,o),f=eg(i0,o),p=Wp(o),g=h.useRef(null),v=Fe(s,g,u.onTriggerChange),x=h.useRef(!1),y=h.useRef(!1),b=h.useCallback(()=>x.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),l.jsx(op,{asChild:!0,...p,children:l.jsx(He.button,{"aria-describedby":u.open?u.contentId:void 0,"data-state":u.stateAttribute,...c,ref:v,onPointerMove:Se(a.onPointerMove,w=>{w.pointerType!=="touch"&&!y.current&&!f.isPointerInTransitRef.current&&(u.onTriggerEnter(),y.current=!0)}),onPointerLeave:Se(a.onPointerLeave,()=>{u.onTriggerLeave(),y.current=!1}),onPointerDown:Se(a.onPointerDown,()=>{u.open&&u.onClose(),x.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:Se(a.onFocus,()=>{x.current||u.onOpen()}),onBlur:Se(a.onBlur,u.onClose),onClick:Se(a.onClick,u.onClose)})})},"TooltipTrigger")),__="TooltipPortal",[M5,z_]=Jp(__,{forceMount:void 0}),hi="TooltipContent",L_=h.forwardRef(hn(function(a,s){const o=z_(hi,a.__scopeTooltip),{forceMount:c=o.forceMount,side:u="top",...f}=a,p=ad(hi,a.__scopeTooltip);return l.jsx(Er,{present:c||p.open,children:p.disableHoverableContent?l.jsx(Yj,{side:u,...f,ref:s}):l.jsx(U_,{side:u,...f,ref:s})})},"TooltipContent")),U_=h.forwardRef(hn(function(a,s){const o=ad(hi,a.__scopeTooltip),c=eg(hi,a.__scopeTooltip),u=h.useRef(null),f=Fe(s,u),[p,g]=h.useState(null),{trigger:v,onClose:x}=o,y=u.current,{onPointerInTransitChange:b}=c,w=h.useCallback(()=>{g(null),b(!1)},[b]),N=h.useCallback((S,C)=>{const R=S.currentTarget,D={x:S.clientX,y:S.clientY},A=Gj(D,R.getBoundingClientRect()),M=Fj(D,A),O=Xj(C.getBoundingClientRect()),E=Qj([...M,...O]);g(E),b(!0)},[b]);return h.useEffect(()=>()=>w(),[w]),h.useEffect(()=>{if(v&&y){const S=hn(R=>N(R,y),"handleTriggerLeave"),C=hn(R=>N(R,v),"handleContentLeave");return v.addEventListener("pointerleave",S),y.addEventListener("pointerleave",C),()=>{v.removeEventListener("pointerleave",S),y.removeEventListener("pointerleave",C)}}},[v,y,N,w]),h.useEffect(()=>{if(p){const S=hn(C=>{const R=C.target,D={x:C.clientX,y:C.clientY},A=(v==null?void 0:v.contains(R))||(y==null?void 0:y.contains(R)),M=!Kj(D,p);A?w():M&&(w(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[v,y,p,x,w]),l.jsx(Yj,{...a,ref:f})},"TooltipContentHoverable")),I_=l1("TooltipContent"),Yj=h.forwardRef(hn(function(a,s){const{__scopeTooltip:o,children:c,"aria-label":u,id:f,onEscapeKeyDown:p,onPointerDownOutside:g,...v}=a,x=ad(hi,o),y=Wp(o),{onClose:b}=x;h.useEffect(()=>(document.addEventListener(ym,b),()=>document.removeEventListener(ym,b)),[b]),h.useEffect(()=>{if(x.trigger){const N=hn(S=>{S.target instanceof Node&&S.target.contains(x.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",N,{capture:!0}),()=>window.removeEventListener("scroll",N,{capture:!0})}},[x.trigger,b]);const{setContentId:w}=x;return Jt(()=>(w(f),()=>{w(void 0)}),[f,w]),l.jsx(Uu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:N=>N.preventDefault(),onDismiss:b,children:l.jsxs(ip,{"data-state":x.stateAttribute,role:u?void 0:"tooltip",id:u?void 0:x.contentId,...y,...v,ref:s,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(I_,{children:c}),u?l.jsx(QO,{id:x.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl"));function Gj(n,a){const s=Math.abs(a.top-n.y),o=Math.abs(a.bottom-n.y),c=Math.abs(a.right-n.x),u=Math.abs(a.left-n.x);switch(Math.min(s,o,c,u)){case u:return"left";case c:return"right";case s:return"top";case o:return"bottom";default:throw new Error("unreachable")}}hn(Gj,"getExitSideFromRect");function Fj(n,a,s=5){const o=[];switch(a){case"top":o.push({x:n.x-s,y:n.y+s},{x:n.x+s,y:n.y+s});break;case"bottom":o.push({x:n.x-s,y:n.y-s},{x:n.x+s,y:n.y-s});break;case"left":o.push({x:n.x+s,y:n.y-s},{x:n.x+s,y:n.y+s});break;case"right":o.push({x:n.x-s,y:n.y-s},{x:n.x-s,y:n.y+s});break}return o}hn(Fj,"getPaddedExitPoints");function Xj(n){const{top:a,right:s,bottom:o,left:c}=n;return[{x:c,y:a},{x:s,y:a},{x:s,y:o},{x:c,y:o}]}hn(Xj,"getPointsFromRect");function Kj(n,a){const{x:s,y:o}=n;let c=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],v=p.x,x=p.y,y=g.x,b=g.y;x>o!=b>o&&s<(y-v)*(o-x)/(b-x)+v&&(c=!c)}return c}hn(Kj,"isPointInPolygon");function Qj(n){const a=n.slice();return a.sort((s,o)=>s.x<o.x?-1:s.x>o.x?1:s.y<o.y?-1:s.y>o.y?1:0),Zj(a)}hn(Qj,"getHull");function Zj(n){if(n.length<=1)return n.slice();const a=[];for(let o=0;o<n.length;o++){const c=n[o];for(;a.length>=2;){const u=a[a.length-1],f=a[a.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))a.pop();else break}a.push(c)}a.pop();const s=[];for(let o=n.length-1;o>=0;o--){const c=n[o];for(;s.length>=2;){const u=s[s.length-1],f=s[s.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))s.pop();else break}s.push(c)}return s.pop(),a.length===1&&s.length===1&&a[0].x===s[0].x&&a[0].y===s[0].y?a:a.concat(s)}hn(Zj,"getHullPresorted");var P_=M_,B_=O_,H_=k_,Jj=L_;const tg=P_,_s=B_,zs=H_,ls=h.forwardRef(({className:n,sideOffset:a=4,...s},o)=>l.jsx(Jj,{ref:o,sideOffset:a,className:Ce("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",n),...s}));ls.displayName=Jj.displayName;const mi=h.forwardRef(({className:n,...a},s)=>l.jsx("textarea",{ref:s,className:Ce("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",n),...a}));mi.displayName="Textarea";function q_({providerId:n,open:a,onOpenChange:s,onImported:o}){const[c,u]=h.useState([]),[f,p]=h.useState(""),[g,v]=h.useState(null),[x,y]=h.useState([]),[b,w]=h.useState(!1),[N,S]=h.useState(""),C=E=>{const _=new FormData;return _.append("providerId",n),E&&_.append("selectedIndexes",JSON.stringify(E)),c.forEach(U=>_.append("file",U)),f.trim()&&_.append("text",f),_},R=async()=>{w(!0),S("");try{const E=await pe.upload("/api/admin/codex/accounts/preview",C());v(E),y(E.records.filter(_=>_.valid&&!_.duplicateOf).map(_=>_.index))}catch(E){S(E.message||"Unable to preview import")}finally{w(!1)}},D=async()=>{w(!0),S("");try{const E=await pe.upload("/api/admin/codex/accounts/import",C(x));s(!1),o(),u([]),p(""),v(null),y([]),de.success(`${E.added} added, ${E.updated} updated, ${E.failed} failed`)}catch(E){S(E.message||"Unable to import accounts")}finally{w(!1)}},A=(E,_)=>y(U=>_===!0?[...new Set([...U,E])]:U.filter(P=>P!==E)),M=(g==null?void 0:g.records.filter(E=>E.valid&&!E.duplicateOf).map(E=>E.index))??[],O=M.length>0&&M.every(E=>x.includes(E));return l.jsx(ln,{open:a,onOpenChange:s,children:l.jsxs(Kt,{className:"max-w-3xl",children:[l.jsxs(Qt,{children:[l.jsx(Zt,{children:"Import Codex accounts"}),l.jsx(jr,{children:"Select JSON or JSONL files, or paste records. Secrets are submitted without being displayed in the preview."})]}),g?l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3 text-sm",children:[l.jsxs("span",{children:[g.validCount," valid, ",g.invalidCount," invalid"]}),l.jsxs("label",{className:"flex items-center gap-2",children:[l.jsx(Cr,{checked:O,onCheckedChange:E=>y(E===!0?M:[]),"aria-label":"Select all valid accounts"})," Select all valid"]})]}),l.jsx("div",{className:"max-h-80 overflow-auto rounded-md border",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b text-left",children:[l.jsx("th",{className:"p-2",children:"Select"}),l.jsx("th",{className:"p-2",children:"Account"}),l.jsx("th",{className:"p-2",children:"Plan"}),l.jsx("th",{className:"p-2",children:"Expiry"}),l.jsx("th",{className:"p-2",children:"Result"})]})}),l.jsx("tbody",{children:g.records.map(E=>l.jsxs("tr",{className:"border-b last:border-0",children:[l.jsx("td",{className:"p-2",children:l.jsx(Cr,{checked:x.includes(E.index),disabled:!E.valid||!!E.duplicateOf,onCheckedChange:_=>A(E.index,_),"aria-label":`Select record ${E.index+1}`})}),l.jsxs("td",{className:"p-2",children:[l.jsx("div",{children:E.email||"Unknown email"}),l.jsxs("div",{className:"text-xs text-muted-foreground",children:[E.accountIdMasked||"No account ID",E.workspaceIdMasked?` · ${E.workspaceIdMasked}`:""]})]}),l.jsx("td",{className:"p-2",children:E.planType||"—"}),l.jsx("td",{className:"p-2",children:E.expiresAt?new Date(E.expiresAt).toLocaleDateString():"—"}),l.jsx("td",{className:"p-2",children:E.valid?E.duplicateOf?l.jsx("span",{className:"text-amber-600",children:"Duplicate"}):l.jsx("span",{className:"text-emerald-600",children:"Ready"}):l.jsx("span",{className:"text-destructive",children:E.error||"Invalid record"})})]},`${E.index}-${E.source??""}`))})]})}),N&&l.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>v(null),children:"Back"}),l.jsx(se,{disabled:b||x.length===0,onClick:()=>void D(),children:b?"Importing…":`Import ${x.length} account${x.length===1?"":"s"}`})]})]}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(be,{htmlFor:"codex-files",children:"JSON / JSONL files"}),l.jsx(Ee,{id:"codex-files",type:"file",accept:".json,.jsonl,application/json",multiple:!0,onChange:E=>u(Array.from(E.target.files??[]))})]}),l.jsxs("div",{children:[l.jsx(be,{htmlFor:"codex-paste",children:"Paste JSON / JSONL (optional)"}),l.jsx(mi,{id:"codex-paste",value:f,onChange:E=>p(E.target.value),placeholder:"Paste Codex export records here",className:"min-h-32 font-mono text-xs"})]}),N&&l.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),l.jsx(se,{disabled:b||c.length===0&&!f.trim(),onClick:()=>void R(),children:b?"Reading…":"Preview import"})]})]})]})})}const $_="http://localhost:1455/auth/callback",V_="1455",Y_="http://localhost:8791/oauth/codex/callback";function G_({providerId:n,providerName:a,open:s,onOpenChange:o,onConnected:c}){const[u,f]=h.useState(""),[p,g]=h.useState(""),[v,x]=h.useState(""),[y,b]=h.useState(!0),[w,N]=h.useState(!1),[S,C]=h.useState(""),[R,D]=h.useState(!1),[A,M]=h.useState(!1),O=h.useCallback(async()=>{b(!0),C(""),x("");try{const U=await pe.post("/api/admin/codex/oauth/start",{providerId:n});f(U.state),g(U.authorizeUrl)}catch(U){C(U.message||"Unable to start the Codex authorization flow")}finally{b(!1)}},[n]);h.useEffect(()=>{O()},[O]),h.useEffect(()=>{if(!u)return;const U=setInterval(()=>{pe.get(`/api/admin/codex/oauth/${u}`).then(P=>M(!(P!=null&&P.callbackReceived))).catch(()=>M(!0))},5e3);return()=>clearInterval(U)},[u]);const E=async()=>{N(!0),C("");try{const U=await pe.post("/api/admin/codex/oauth/complete",{providerId:n,state:u,callbackUrl:v});de.success(`Codex account ${U.status==="added"?"connected":"updated"}`),o(!1),c()}catch(U){C(U.message||"Unable to complete the Codex authorization")}finally{N(!1)}},_=async()=>{try{await navigator.clipboard.writeText(p),D(!0),setTimeout(()=>D(!1),2e3)}catch{C("Clipboard is unavailable — select the URL and copy it manually.")}};return l.jsx(ln,{open:s,onOpenChange:o,children:l.jsxs(Kt,{className:"max-w-2xl",children:[l.jsxs(Qt,{children:[l.jsx(Zt,{children:"Connect OpenAI Codex"}),l.jsxs(jr,{children:["Authorize a ChatGPT account for ",a,". The callback is captured on localhost:",V_," — nothing is sent anywhere else."]})]}),y?l.jsxs("p",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[l.jsx(pr,{className:"h-4 w-4 animate-spin"})," Starting authorization…"]}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[l.jsx(pr,{className:"h-3.5 w-3.5 animate-spin"})," Waiting for popup authorization…"]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["The browser will try to hand the callback to ",l.jsx("code",{className:"font-mono",children:Y_}),". Most browsers block that from a public origin — if the page fails to load, copy the address bar and paste it in step 2."]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(be,{children:"Step 1: Open this URL in your browser"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Ee,{readOnly:!0,className:"font-mono text-xs",value:p,onFocus:U=>U.currentTarget.select()}),l.jsx(se,{type:"button",variant:"outline","aria-label":"Copy authorization URL",onClick:()=>void _(),children:R?l.jsx(Bm,{className:"h-4 w-4"}):l.jsx(ou,{className:"h-4 w-4"})}),l.jsx(se,{type:"button",variant:"outline","aria-label":"Open authorization URL",asChild:!0,children:l.jsx("a",{href:p,target:"_blank",rel:"noreferrer",children:l.jsx(NE,{className:"h-4 w-4"})})})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(be,{htmlFor:"codex-callback",children:"Step 2: Paste the callback URL here"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"After authorization, copy the full URL from your browser — or just the authorization code."}),l.jsx(Ee,{id:"codex-callback",value:v,onChange:U=>x(U.target.value),placeholder:`${$_}?code=…`}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Or paste callback URL manually"})]}),S&&l.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),l.jsx(se,{disabled:w||y||A&&!v.trim(),onClick:()=>void E(),children:w?l.jsxs(l.Fragment,{children:[l.jsx(pr,{className:"mr-1 h-4 w-4 animate-spin"})," Connecting…"]}):"Connect"})]})]})})}const F_=["10","25","50"];function X_(n,a){if(!n)return"—";const s=Date.parse(n)-a;if(!Number.isFinite(s))return"—";if(s<=0)return"reset ready";const o=Math.floor(s/6e4);if(o<60)return`${o}m`;const c=Math.floor(o/60),u=o%60;return c<24?`${c}h ${u}m`:`${Math.floor(c/24)}d ${c%24}h`}function c0(n,a,s){if(!n)return l.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const o=n.remaining<=0;return l.jsxs("div",{className:"min-w-[9rem] space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[l.jsxs("span",{className:o?"font-medium text-destructive":"text-muted-foreground",children:[s," ",Math.round(n.remaining),"% left"]}),l.jsx("span",{className:"tabular-nums text-muted-foreground",children:X_(n.resetAt,a)})]}),l.jsx(Vj,{value:n.used,indicatorClassName:o?"bg-destructive":n.remaining<30?"bg-amber-500":"bg-emerald-500"})]})}function K_({providerId:n,providerName:a}){const[s,o]=h.useState([]),[c,u]=h.useState(null),[f,p]=h.useState(!0),[g,v]=h.useState(!1),[x,y]=h.useState(!1),[b,w]=h.useState(1),[N,S]=h.useState("10"),[C,R]=h.useState(""),[D,A]=h.useState(()=>Date.now());h.useEffect(()=>{const k=setInterval(()=>A(Date.now()),3e4);return()=>clearInterval(k)},[]);const M=h.useCallback(async()=>{try{const k=await pe.get(`/api/admin/codex/accounts?providerId=${encodeURIComponent(n)}`);o(k.accounts)}catch(k){de.error(k.message||"Unable to load Codex accounts")}finally{p(!1)}},[n]);h.useEffect(()=>{M()},[M]);const O=async(k,q,Z)=>{u(k.id);try{await Z(),de.success(`${q}: ${k.email||k.accountIdMasked||k.id}`)}catch(ee){de.error(ee.message||`${q} failed`)}finally{u(null)}},E=(k,q)=>o(Z=>Z.map(ee=>ee.id===k?q:ee)),_=(k,q)=>O(s.find(Z=>Z.id===k),"Updated",async()=>{E(k,(await pe.patch(`/api/admin/codex/accounts/${k}`,q)).account)}),U=s.filter(k=>{if(!C)return!0;const q=C.toLowerCase();return[k.email,k.accountIdMasked,k.workspaceIdMasked,k.planType].some(Z=>Z==null?void 0:Z.toLowerCase().includes(q))}),P=Number(N),$=Math.max(1,Math.ceil(U.length/P)),J=Math.min(b,$),Y=U.slice((J-1)*P,J*P),ce=async()=>{u("all");try{await Promise.allSettled(s.map(k=>pe.post(`/api/admin/codex/accounts/${k.id}/usage`))),await M(),de.success("Usage refreshed for all accounts")}finally{u(null)}},ue=Ip(Vl(Ai,{activationConstraint:{distance:4}}),Vl(Ti,{coordinateGetter:Xp})),B=async k=>{const{active:q,over:Z}=k;if(!Z||q.id===Z.id)return;const ee=s.findIndex(F=>F.id===q.id),te=s.findIndex(F=>F.id===Z.id);if(ee<0||te<0)return;const z=s,L=Mi(s,ee,te);o(L);try{await pe.post("/api/admin/codex/accounts/reorder",{providerId:n,ids:L.map(F=>F.id)}),de.success("Routing order updated")}catch(F){o(z),de.error(F.message||"Unable to save the routing order")}};return l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium",children:"Codex accounts"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.length," account",s.length===1?"":"s"," · drag a row to set routing order · quotas come from the ChatGPT usage API"]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(Ee,{className:"h-8 w-40",placeholder:"Filter accounts…",value:C,onChange:k=>{R(k.target.value),w(1)}}),l.jsxs(se,{size:"sm",variant:"outline",disabled:c!==null||s.length===0,onClick:()=>void ce(),children:[l.jsx(li,{className:"mr-1 h-3 w-3"})," Refresh all"]}),l.jsxs(se,{size:"sm",variant:"outline",onClick:()=>y(!0),children:[l.jsx(AE,{className:"mr-1 h-4 w-4"})," Connect Codex"]}),l.jsxs(se,{size:"sm",onClick:()=>v(!0),children:[l.jsx(Q0,{className:"mr-1 h-4 w-4"})," Import accounts"]})]})]}),f?l.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"Loading Codex accounts…"}):s.length===0?l.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"No Codex accounts yet. Use Connect Codex to authorize one, or import existing account JSON."}):U.length===0?l.jsxs("p",{className:"py-3 text-sm text-muted-foreground",children:["No account matches “",C,"”."]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"overflow-x-auto rounded-md border",children:l.jsx(tg,{delayDuration:200,children:l.jsx(qp,{sensors:ue,collisionDetection:Pp,onDragEnd:k=>void B(k),modifiers:[Vp,$p],children:l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{className:"w-8"}),l.jsx(ve,{className:"text-xs",children:"Account"}),l.jsx(ve,{className:"text-xs",children:"Plan"}),l.jsx(ve,{className:"text-xs",children:"5h window"}),l.jsx(ve,{className:"text-xs",children:"Weekly"}),l.jsx(ve,{className:"text-xs",children:"Reset credits"}),l.jsx(ve,{className:"text-xs",children:"Auto-start 5h"}),l.jsx(ve,{className:"text-xs",children:"Token expiry"}),l.jsx(ve,{className:"text-xs",children:"Health"}),l.jsx(ve,{className:"text-right text-xs",children:"Actions"})]})}),l.jsx(Gp,{items:Y.map(k=>k.id),strategy:Yp,children:l.jsx(Pn,{children:Y.map(k=>l.jsx(Q_,{account:k,now:D,busy:c===k.id,onPatch:q=>void _(k.id,q),onUsage:q=>E(k.id,q),onDelete:()=>void O(k,"Deleted",()=>pe.del(`/api/admin/codex/accounts/${k.id}`)).then(()=>M())},k.id))})})]})})})}),l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{children:"Rows per page"}),l.jsxs(zn,{value:N,onValueChange:k=>{S(k),w(1)},children:[l.jsx(jn,{className:"h-7 w-16",children:l.jsx(Ln,{})}),l.jsx(Sn,{children:F_.map(k=>l.jsx(nt,{value:k,children:k},k))})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{children:["Page ",J," of ",$]}),l.jsx(se,{size:"sm",variant:"outline","aria-label":"Previous page",disabled:J<=1,onClick:()=>w(J-1),children:l.jsx(Y0,{className:"h-3 w-3"})}),l.jsx(se,{size:"sm",variant:"outline","aria-label":"Next page",disabled:J>=$,onClick:()=>w(J+1),children:l.jsx(Hm,{className:"h-3 w-3"})})]})]})]}),g&&l.jsx(q_,{providerId:n,open:!0,onOpenChange:k=>{k||v(!1)},onImported:()=>void M()}),x&&l.jsx(G_,{providerId:n,providerName:a||"this Codex provider",open:!0,onOpenChange:k=>{k||y(!1)},onConnected:()=>void M()})]})}function Q_({account:n,now:a,busy:s,onPatch:o,onUsage:c,onDelete:u}){var A,M,O,E,_,U;const{attributes:f,listeners:p,setNodeRef:g,transform:v,transition:x,isDragging:y}=Fp({id:n.id,disabled:s}),b=(M=(A=n.usage)==null?void 0:A.quotas)==null?void 0:M.session,w=(E=(O=n.usage)==null?void 0:O.quotas)==null?void 0:E.blocking,N=((_=n.usage)==null?void 0:_.resetCredits)??0,S=n.email||n.accountIdMasked||n.id,C=()=>void(async()=>{try{c((await pe.post(`/api/admin/codex/accounts/${n.id}/usage`)).account),de.success(`Usage refreshed: ${S}`)}catch(P){de.error(P.message||"Usage refresh failed")}})(),R=()=>{window.confirm(`Spend 1 weekly reset credit to restart the 5h window for ${S}?`)&&(async()=>{try{c((await pe.post(`/api/admin/codex/accounts/${n.id}/reset-quota`)).account),de.success(`Quota reset: ${S}`)}catch(P){de.error(P.message||"Quota reset failed")}})()},D=()=>void Z_(`Test passed: ${S}`,()=>pe.post(`/api/admin/codex/accounts/${n.id}/test`));return l.jsxs(Be,{ref:g,style:{transform:v?`translate3d(${v.x}px, ${v.y}px, 0)`:void 0,transition:x},className:Ce(n.enabled?void 0:"opacity-60",y&&"relative z-10 bg-muted/60 shadow-sm"),children:[l.jsx(fe,{className:"w-8 pr-0",children:l.jsx("button",{type:"button",...f,...p,"aria-label":`Reorder ${S}`,title:"Drag to change routing order",disabled:s,className:"cursor-grab touch-none rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40 active:cursor-grabbing",children:l.jsx($m,{className:"h-4 w-4"})})}),l.jsxs(fe,{children:[l.jsx("div",{className:"text-sm",children:n.email||"Unknown email"}),l.jsxs("div",{className:"text-xs text-muted-foreground",children:[n.accountIdMasked||"—",n.workspaceIdMasked?` · ${n.workspaceIdMasked}`:"",n.usageError?` · usage: ${n.usageError}`:""]})]}),l.jsx(fe,{className:"text-sm",children:((U=n.usage)==null?void 0:U.plan)||n.planType||"—"}),l.jsx(fe,{children:c0(b,a,"5h")}),l.jsx(fe,{children:c0(w,a,"Week")}),l.jsx(fe,{children:l.jsx("span",{className:`text-sm tabular-nums ${N>0?"font-medium":"text-muted-foreground"}`,children:N})}),l.jsx(fe,{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(J_,{checked:n.autostart,disabled:s,onCheckedChange:P=>o({autostart:P}),label:`Auto-start 5h window for ${S}`}),l.jsxs(_s,{children:[l.jsx(zs,{asChild:!0,children:l.jsx("span",{className:"text-xs text-muted-foreground",children:n.lastPingAt?`pinged ${new Date(n.lastPingAt).toLocaleTimeString()}`:"never pinged"})}),l.jsx(ls,{className:"max-w-64",children:"Sends a tiny gpt-5.5 request right after the 5h window resets so the next window starts immediately. Consumes a small amount of quota."})]})]})}),l.jsx(fe,{className:"text-xs",children:new Date(n.tokenExpiresAt).toLocaleString()}),l.jsx(fe,{children:l.jsx(We,{variant:n.healthState==="healthy"?"success":n.healthState==="down"?"destructive":"secondary",children:n.healthState})}),l.jsx(fe,{className:"text-right",children:l.jsxs("div",{className:"flex justify-end gap-1",children:[l.jsxs(_s,{children:[l.jsx(zs,{asChild:!0,children:l.jsx(se,{size:"sm",variant:"outline","aria-label":`Refresh usage for ${S}`,disabled:s,onClick:C,children:l.jsx(li,{className:"h-3 w-3"})})}),l.jsx(ls,{children:"Refresh usage"})]}),l.jsxs(_s,{children:[l.jsx(zs,{asChild:!0,children:l.jsx(se,{size:"sm",variant:"outline","aria-label":`Reset quota for ${S}`,disabled:s||N===0,onClick:R,children:l.jsx(zE,{className:"h-3 w-3"})})}),l.jsx(ls,{children:N===0?"No weekly reset credits available":"Reset quota (uses 1 credit)"})]}),l.jsxs(_s,{children:[l.jsx(zs,{asChild:!0,children:l.jsx(se,{size:"sm",variant:"outline","aria-label":`Test Codex account ${S}`,disabled:s,onClick:D,children:l.jsx(IE,{className:"h-3 w-3"})})}),l.jsx(ls,{children:"Test connection"})]}),l.jsxs(_s,{children:[l.jsx(zs,{asChild:!0,children:l.jsx(se,{size:"sm",variant:"outline","aria-pressed":!n.enabled,disabled:s,onClick:()=>o({enabled:!n.enabled}),children:n.enabled?"Disable":"Enable"})}),l.jsx(ls,{children:n.enabled?"Exclude from routing (keeps the account)":"Include in routing"})]}),l.jsxs(_s,{children:[l.jsx(zs,{asChild:!0,children:l.jsx(se,{size:"sm",variant:"destructive","aria-label":`Delete Codex account ${S}`,disabled:s,onClick:()=>{window.confirm(`Permanently delete ${S}?
|
|
386
|
-
|
|
387
|
-
Stored Codex credentials are erased. Past request logs are kept, but lose the account reference.`)&&u()},children:l.jsx(Ql,{className:"h-3 w-3"})})}),l.jsx(ls,{children:"Delete account (permanent)"})]})]})})]})}async function Z_(n,a){try{await a(),de.success(n)}catch(s){de.error(s.message||"Action failed")}}function J_({checked:n,disabled:a,onCheckedChange:s,label:o}){return l.jsx(Cr,{role:"switch","aria-label":o,"aria-checked":n,checked:n,disabled:a,onCheckedChange:c=>s(c===!0)})}function W_({providerId:n,open:a,onOpenChange:s,onImported:o}){const[c,u]=h.useState([]),[f,p]=h.useState(""),[g,v]=h.useState(null),[x,y]=h.useState([]),[b,w]=h.useState(!1),[N,S]=h.useState(""),C=E=>{const _=new FormData;return _.append("providerId",n),E&&_.append("selectedIndexes",JSON.stringify(E)),c.forEach(U=>_.append("file",U)),f.trim()&&_.append("text",f),_},R=async()=>{w(!0),S("");try{const E=await pe.upload("/api/admin/qoder/accounts/preview",C());v(E),y(E.records.filter(_=>_.valid&&!_.duplicateOf).map(_=>_.index))}catch(E){S(E.message||"Unable to preview import")}finally{w(!1)}},D=async()=>{w(!0),S("");try{const E=await pe.upload("/api/admin/qoder/accounts/import",C(x));s(!1),o(),u([]),p(""),v(null),y([]),de.success(`${E.added} added, ${E.updated} updated, ${E.failed} failed`)}catch(E){S(E.message||"Unable to import tokens")}finally{w(!1)}},A=(E,_)=>y(U=>_===!0?[...new Set([...U,E])]:U.filter(P=>P!==E)),M=(g==null?void 0:g.records.filter(E=>E.valid&&!E.duplicateOf).map(E=>E.index))??[],O=M.length>0&&M.every(E=>x.includes(E));return l.jsx(ln,{open:a,onOpenChange:s,children:l.jsxs(Kt,{className:"max-w-3xl",children:[l.jsxs(Qt,{children:[l.jsx(Zt,{children:"Import Qoder personal access tokens"}),l.jsx(jr,{children:"One token per line, or a .txt/.json file. Tokens are submitted without being displayed back."})]}),g?l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3 text-sm",children:[l.jsxs("span",{children:[g.validCount," valid, ",g.invalidCount," invalid"]}),l.jsxs("label",{className:"flex items-center gap-2",children:[l.jsx(Cr,{checked:O,onCheckedChange:E=>y(E===!0?M:[]),"aria-label":"Select all valid tokens"})," Select all valid"]})]}),l.jsx("div",{className:"max-h-80 overflow-auto rounded-md border",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b text-left",children:[l.jsx("th",{className:"p-2",children:"Select"}),l.jsx("th",{className:"p-2",children:"Token"}),l.jsx("th",{className:"p-2",children:"Label"}),l.jsx("th",{className:"p-2",children:"Result"})]})}),l.jsx("tbody",{children:g.records.map(E=>l.jsxs("tr",{className:"border-b last:border-0",children:[l.jsx("td",{className:"p-2",children:l.jsx(Cr,{checked:x.includes(E.index),disabled:!E.valid||!!E.duplicateOf,onCheckedChange:_=>A(E.index,_),"aria-label":`Select record ${E.index+1}`})}),l.jsx("td",{className:"p-2 font-mono text-xs",children:E.personalTokenMasked||"—"}),l.jsx("td",{className:"p-2",children:E.label||"—"}),l.jsx("td",{className:"p-2",children:E.valid?E.duplicateOf?l.jsx("span",{className:"text-amber-600",children:"Already added"}):l.jsx("span",{className:"text-emerald-600",children:"Ready"}):l.jsx("span",{className:"text-destructive",children:E.error||"Invalid token"})})]},`${E.index}-${E.source??""}`))})]})}),N&&l.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>v(null),children:"Back"}),l.jsx(se,{disabled:b||x.length===0,onClick:()=>void D(),children:b?"Importing…":`Import ${x.length} token${x.length===1?"":"s"}`})]})]}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(be,{htmlFor:"qoder-files",children:"Token files (.txt / .json)"}),l.jsx(Ee,{id:"qoder-files",type:"file",accept:".txt,.json,.jsonl,text/plain,application/json",multiple:!0,onChange:E=>u(Array.from(E.target.files??[]))})]}),l.jsxs("div",{children:[l.jsx(be,{htmlFor:"qoder-paste",children:"Paste tokens (optional)"}),l.jsx(mi,{id:"qoder-paste",value:f,onChange:E=>p(E.target.value),placeholder:"pt-…",className:"min-h-32 font-mono text-xs"})]}),N&&l.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),l.jsx(se,{disabled:b||c.length===0&&!f.trim(),onClick:()=>void R(),children:b?"Reading…":"Preview import"})]})]})]})})}const e4=["10","25","50"];function wm(n,a){if(!n)return"—";const s=Date.parse(n)-a;if(!Number.isFinite(s))return"—";if(s<=0)return"expired";const o=Math.floor(s/6e4);if(o<60)return`${o}m`;const c=Math.floor(o/60);return c<24?`${c}h ${o%60}m`:`${Math.floor(c/24)}d ${c%24}h`}function t4(n){const a=n==="healthy"?"default":n==="degraded"?"secondary":n==="down"?"destructive":"outline";return l.jsx(We,{variant:a,children:n})}function n4(n,a){const{credits:s,creditsError:o}=n;if(!s)return o?l.jsx("span",{className:"text-xs text-destructive",children:o}):l.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const c=s.buckets[0],u=s.totalUsedPercent,f=s.freeModels,p=f.length>2?`${f.slice(0,2).join(", ")} +${f.length-2}`:f.join(", ");return l.jsxs("div",{className:"min-w-[10rem] space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[l.jsx("span",{className:s.exhausted?"font-medium text-destructive":"text-muted-foreground",children:c?`${c.used.toFixed(0)} / ${c.total.toFixed(0)} ${c.unit}`:s.exhausted?"No plan credits":`${u.toFixed(0)}% used`}),l.jsx("span",{className:"tabular-nums text-muted-foreground",children:wm(s.expiresAt,a)})]}),l.jsx(Vj,{value:u,indicatorClassName:s.exhausted?"bg-destructive":u>70?"bg-amber-500":"bg-emerald-500"}),f.length>0&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Free now: ",p]}),o&&l.jsxs("p",{className:"text-xs text-destructive",children:["last read failed: ",o]})]})}function a4({providerId:n,providerName:a}){const[s,o]=h.useState([]),[c,u]=h.useState(null),[f,p]=h.useState(!0),[g,v]=h.useState(!1),[x,y]=h.useState(!1),[b,w]=h.useState(""),[N,S]=h.useState(""),[C,R]=h.useState(!1),[D,A]=h.useState(""),[M,O]=h.useState(1),[E,_]=h.useState("10"),[U,P]=h.useState(""),[$,J]=h.useState(()=>Date.now());h.useEffect(()=>{const L=setInterval(()=>J(Date.now()),3e4);return()=>clearInterval(L)},[]);const Y=h.useCallback(async()=>{try{const L=await pe.get(`/api/admin/qoder/accounts?providerId=${encodeURIComponent(n)}`);o(L.accounts)}catch(L){de.error(L.message||"Unable to load Qoder accounts")}finally{p(!1)}},[n]);h.useEffect(()=>{Y()},[Y]);const ce=async(L,F,ae)=>{u(L.id);try{await ae(),de.success(`${F}: ${L.label||L.qoderUserIdMasked||L.id}`)}catch(ge){de.error(ge.message||`${F} failed`)}finally{u(null)}},ue=async()=>{R(!0),A("");try{const L=await pe.post("/api/admin/qoder/accounts",{providerId:n,personalToken:b,label:N.trim()||void 0});de.success(L.catalogError?"Account added, but the model catalog could not be fetched":"Account added"),y(!1),w(""),S(""),await Y()}catch(L){A(L.message||"Unable to add the token")}finally{R(!1)}},B=s.filter(L=>{if(!U)return!0;const F=U.toLowerCase();return[L.label,L.email,L.qoderUserIdMasked].some(ae=>ae==null?void 0:ae.toLowerCase().includes(F))}),k=Number(E),q=Math.max(1,Math.ceil(B.length/k)),Z=Math.min(M,q),ee=B.slice((Z-1)*k,Z*k),te=Ip(Vl(Ai,{activationConstraint:{distance:4}}),Vl(Ti,{coordinateGetter:Xp})),z=async L=>{const{active:F,over:ae}=L;if(!ae||F.id===ae.id)return;const ge=s.findIndex(he=>he.id===F.id),ye=s.findIndex(he=>he.id===ae.id);if(ge<0||ye<0)return;const G=s,ie=Mi(s,ge,ye);o(ie);try{await pe.post("/api/admin/qoder/accounts/reorder",{providerId:n,ids:ie.map(he=>he.id)}),de.success("Routing order updated")}catch(he){o(G),de.error(he.message||"Unable to save the routing order")}};return l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium",children:"Qoder accounts"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.length," account",s.length===1?"":"s"," · drag a row to set routing order · each account is one personal access token"]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(Ee,{className:"h-8 w-40",placeholder:"Filter accounts…",value:U,onChange:L=>{P(L.target.value),O(1)}}),l.jsxs(se,{size:"sm",variant:"outline",disabled:c!==null||s.length===0,onClick:()=>void(async()=>{u("all");try{await Promise.allSettled(s.map(L=>pe.post(`/api/admin/qoder/accounts/${L.id}/catalog`))),await Y(),de.success("Model catalogs refreshed")}finally{u(null)}})(),children:[l.jsx(li,{className:"mr-1 h-3 w-3"})," Refresh catalogs"]}),l.jsxs(se,{size:"sm",variant:"outline",disabled:c!==null||s.length===0,onClick:()=>void(async()=>{u("all");try{await Promise.allSettled(s.map(L=>pe.post(`/api/admin/qoder/accounts/${L.id}/credits`))),await Y(),de.success("Credits refreshed")}finally{u(null)}})(),children:[l.jsx(li,{className:"mr-1 h-3 w-3"})," Refresh credits"]}),l.jsxs(se,{size:"sm",variant:"outline",onClick:()=>v(!0),children:[l.jsx(Q0,{className:"mr-1 h-4 w-4"})," Import tokens"]}),l.jsxs(se,{size:"sm",onClick:()=>y(!0),children:[l.jsx(Kl,{className:"mr-1 h-4 w-4"})," Add token"]})]})]}),f?l.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"Loading Qoder accounts…"}):s.length===0?l.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"No Qoder accounts yet. Add a personal access token or import a list."}):B.length===0?l.jsxs("p",{className:"py-3 text-sm text-muted-foreground",children:["No account matches “",U,"”."]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"overflow-x-auto rounded-md border",children:l.jsx(qp,{sensors:te,collisionDetection:Pp,onDragEnd:L=>void z(L),modifiers:[Vp,$p],children:l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{className:"w-8"}),l.jsx(ve,{className:"text-xs",children:"Account"}),l.jsx(ve,{className:"text-xs",children:"User"}),l.jsx(ve,{className:"text-xs",children:"Job token"}),l.jsx(ve,{className:"text-xs",children:"Catalog"}),l.jsx(ve,{className:"text-xs",children:"Credits"}),l.jsx(ve,{className:"text-xs",children:"Health"}),l.jsx(ve,{className:"text-xs",children:"Enabled"}),l.jsx(ve,{className:"text-right text-xs",children:"Actions"})]})}),l.jsx(Gp,{items:ee.map(L=>L.id),strategy:Yp,children:l.jsx(Pn,{children:ee.map(L=>l.jsx(r4,{account:L,now:$,busy:c===L.id,onToggle:F=>void ce(L,F?"Enabled":"Disabled",()=>pe.patch(`/api/admin/qoder/accounts/${L.id}`,{enabled:F})).then(()=>Y()),onDelete:()=>void ce(L,"Deleted",()=>pe.del(`/api/admin/qoder/accounts/${L.id}`)).then(()=>Y()),onChanged:()=>void Y()},L.id))})})]})})}),l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{children:"Rows per page"}),l.jsxs(zn,{value:E,onValueChange:L=>{_(L),O(1)},children:[l.jsx(jn,{className:"h-7 w-16",children:l.jsx(Ln,{})}),l.jsx(Sn,{children:e4.map(L=>l.jsx(nt,{value:L,children:L},L))})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{children:["Page ",Z," of ",q]}),l.jsx(se,{size:"sm",variant:"outline","aria-label":"Previous page",disabled:Z<=1,onClick:()=>O(Z-1),children:l.jsx(Y0,{className:"h-3 w-3"})}),l.jsx(se,{size:"sm",variant:"outline","aria-label":"Next page",disabled:Z>=q,onClick:()=>O(Z+1),children:l.jsx(Hm,{className:"h-3 w-3"})})]})]})]}),l.jsx(ln,{open:x,onOpenChange:y,children:l.jsxs(Kt,{children:[l.jsxs(Qt,{children:[l.jsx(Zt,{children:"Add a Qoder token"}),l.jsxs(jr,{children:["Paste a personal access token for ",a||"this provider",". It is exchanged immediately and stored encrypted."]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(be,{htmlFor:"qoder-token",children:"Personal access token"}),l.jsx(Ee,{id:"qoder-token",type:"password",value:b,onChange:L=>w(L.target.value),placeholder:"pt-…",className:"font-mono"})]}),l.jsxs("div",{children:[l.jsx(be,{htmlFor:"qoder-label",children:"Label (optional)"}),l.jsx(Ee,{id:"qoder-label",value:N,onChange:L=>S(L.target.value),placeholder:"Work account"})]}),D&&l.jsx("p",{role:"alert",className:"text-sm text-destructive",children:D})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>y(!1),children:"Cancel"}),l.jsx(se,{disabled:C||!b.trim(),onClick:()=>void ue(),children:C?"Verifying…":"Add token"})]})]})}),g&&l.jsx(W_,{providerId:n,open:!0,onOpenChange:L=>{L||v(!1)},onImported:()=>void Y()})]})}function r4({account:n,now:a,busy:s,onToggle:o,onDelete:c,onChanged:u}){const{attributes:f,listeners:p,setNodeRef:g,transform:v,transition:x,isDragging:y}=Fp({id:n.id,disabled:s}),b=n.label||n.email||n.qoderUserIdMasked||n.id;return l.jsxs(Be,{ref:g,style:{transform:v?`translate3d(${v.x}px, ${v.y}px, 0)`:void 0,transition:x},className:Ce(n.enabled?void 0:"opacity-60",y&&"relative z-10 bg-muted/60 shadow-sm"),children:[l.jsx(fe,{className:"w-8 pr-0",children:l.jsx("button",{className:"cursor-grab text-muted-foreground disabled:cursor-not-allowed","aria-label":`Reorder ${b}`,disabled:s,...f,...p,children:l.jsx($m,{className:"h-4 w-4"})})}),l.jsxs(fe,{children:[l.jsx("div",{className:"text-sm",children:b}),n.email&&n.label&&l.jsx("div",{className:"text-xs text-muted-foreground",children:n.email}),n.lastError&&l.jsx("div",{className:"text-xs text-destructive",children:n.lastError})]}),l.jsx(fe,{className:"font-mono text-xs",children:n.qoderUserIdMasked||"—"}),l.jsx(fe,{className:"text-xs tabular-nums",children:wm(n.jobTokenExpiresAt,a)}),l.jsx(fe,{className:"text-xs tabular-nums",children:n.catalogFetchedAt?`${wm(n.catalogFetchedAt,a)} ago`:"never"}),l.jsx(fe,{children:n4(n,a)}),l.jsx(fe,{children:t4(n.healthState)}),l.jsx(fe,{children:l.jsx(se,{size:"sm",variant:n.enabled?"secondary":"outline",disabled:s,onClick:()=>o(!n.enabled),children:n.enabled?"Enabled":"Disabled"})}),l.jsx(fe,{className:"text-right",children:l.jsxs("div",{className:"flex justify-end gap-1",children:[l.jsx(se,{size:"sm",variant:"outline",disabled:s,onClick:()=>void(async()=>{try{const w=await pe.post(`/api/admin/qoder/accounts/${n.id}/test`);de[w.ok?"success":"error"](`${b}: ${w.detail}${w.modelCount===null?"":` (${w.modelCount} models)`}`),u()}catch(w){de.error(w.message||"Test failed")}})(),children:"Test"}),l.jsx(se,{size:"sm",variant:"outline",disabled:s,onClick:()=>void(async()=>{try{const w=await pe.post(`/api/admin/qoder/accounts/${n.id}/catalog`);de.success(`${b}: ${w.modelCount} models`),u()}catch(w){de.error(w.message||"Catalog refresh failed")}})(),children:"Catalog"}),l.jsx(tg,{children:l.jsxs(_s,{children:[l.jsx(zs,{asChild:!0,children:l.jsx(se,{size:"sm",variant:"outline","aria-label":`Refresh credits for ${b}`,disabled:s,onClick:()=>void(async()=>{try{await pe.post(`/api/admin/qoder/accounts/${n.id}/credits`),de.success(`Credits refreshed: ${b}`),u()}catch(w){de.error(w.message||"Credits refresh failed")}})(),children:l.jsx(li,{className:"h-3 w-3"})})}),l.jsx(ls,{children:"Refresh credits"})]})}),l.jsx(se,{size:"sm",variant:"ghost","aria-label":`Delete ${b}`,disabled:s,onClick:()=>{window.confirm(`Delete the Qoder account ${b}? The stored token is removed permanently.`)&&c()},children:l.jsx(Ql,{className:"h-3 w-3"})})]})})]})}function s4({providerId:n,providerName:a,open:s,onOpenChange:o,onImported:c}){const[u,f]=h.useState([]),[p,g]=h.useState(new Set),[v,x]=h.useState(""),[y,b]=h.useState(!0),[w,N]=h.useState(!1),[S,C]=h.useState(""),R=h.useCallback(async()=>{b(!0),C("");try{const M=await pe.post(`/api/admin/providers/${n}/discover`);f(M.models),g(new Set(M.models.filter(O=>!O.alreadyImported).map(O=>O.upstreamId)))}catch(M){C(M.message||"Unable to fetch Codex models")}finally{b(!1)}},[n]);h.useEffect(()=>{R()},[R]);const D=u.filter(M=>!v||M.upstreamId.toLowerCase().includes(v.toLowerCase())||M.displayName.toLowerCase().includes(v.toLowerCase())),A=async()=>{N(!0),C("");try{const M=await pe.post("/api/admin/models/import",{providerId:n,modelIds:Array.from(p)});de.success(`Imported ${M.imported} of ${M.requested} Codex models`),o(!1),c()}catch(M){C(M.message||"Unable to import models")}finally{N(!1)}};return l.jsx(ln,{open:s,onOpenChange:o,children:l.jsxs(Kt,{className:"max-w-2xl",children:[l.jsxs(Qt,{children:[l.jsxs(Zt,{children:["Import models from ",a]}),l.jsx(jr,{children:"Models are read from the Codex account pool. Nothing is added until you confirm."})]}),y?l.jsxs("p",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[l.jsx(pr,{className:"h-4 w-4 animate-spin"})," Fetching models…"]}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(Vm,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),l.jsx(Ee,{className:"pl-8",placeholder:"Search models…",value:v,onChange:M=>x(M.target.value)})]}),l.jsxs("span",{className:"shrink-0 text-sm text-muted-foreground",children:[D.length," / ",u.length," · ",p.size," selected"]}),l.jsx(se,{variant:"outline",size:"sm",onClick:()=>g(new Set(D.filter(M=>!M.alreadyImported).map(M=>M.upstreamId))),children:"Select All (new)"})]}),l.jsx("div",{className:"max-h-80 overflow-auto rounded-md border",children:D.length===0?l.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:u.length===0?"The Codex account returned no models.":"No model matches your search."}):D.map(M=>l.jsxs("label",{className:"flex cursor-pointer items-center gap-3 border-b px-3 py-2 last:border-0 hover:bg-accent",children:[l.jsx(Cr,{checked:p.has(M.upstreamId),disabled:M.alreadyImported,onCheckedChange:O=>g(E=>{const _=new Set(E);return O===!0?_.add(M.upstreamId):_.delete(M.upstreamId),_})}),l.jsx("span",{className:"flex-1 text-sm",children:M.displayName}),l.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:M.upstreamId}),M.alreadyImported&&l.jsx(We,{variant:"secondary",children:"imported"})]},M.upstreamId))}),S&&l.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>void R(),disabled:y,children:"Refetch"}),l.jsxs(se,{disabled:w||p.size===0,onClick:()=>void A(),children:["Import ",p.size||""]})]})]})})}const ks={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0},l4={openai:"https://api.openai.com",anthropic:"https://api.anthropic.com"},o4=[{type:"codex",label:"Add Codex",hint:"Codex always talks to https://chatgpt.com — the OAuth backend does not exist on api.openai.com."},{type:"qoder",label:"Add Qoder",hint:"Qoder accounts authenticate with a PAT (pt-…) that you add after the provider exists."}];function i4(){const[n,a]=h.useState([]),[s,o]=h.useState(!1),[c,u]=h.useState(ks),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(ks),[N,S]=h.useState(null),[C,R]=h.useState(!1),[D,A]=h.useState(null),[M,O]=h.useState({}),[E,_]=h.useState(null),U=async()=>{try{const B=await pe.get("/api/admin/providers");a(B.providers)}catch(B){de.error(B.message||"Unable to load providers")}};h.useEffect(()=>{U()},[]);const P=async()=>{p(!0);try{let B;if(c.customHeaders.trim())try{B=JSON.parse(c.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await pe.post("/api/admin/providers",{name:c.name,slug:c.slug||void 0,type:c.type,baseUrl:c.baseUrl,apiKey:c.apiKey,customHeaders:B,enabled:c.enabled}),de.success("Provider created"),o(!1),u(ks),U()}catch(B){de.error(B.message)}finally{p(!1)}},$=async B=>{_(B);try{await pe.post("/api/admin/providers",{type:B}),de.success(`${B==="codex"?"Codex":"Qoder"} provider created — add accounts next`);const k=await pe.get("/api/admin/providers");a(k.providers);const q=k.providers.find(Z=>Z.type===B);q&&O(Z=>({...Z,[q.id]:!0}))}catch(k){de.error(k.message)}finally{_(null)}},J=async B=>{v(B);try{const k=await pe.post(`/api/admin/providers/${B}/test`);de.success(k.ok?`Connection OK: ${k.detail}`:`Failed: ${k.detail}`),U()}catch(k){de.error(k.message)}finally{v(null)}},Y=B=>{y(B.id),w({...ks,name:B.name,slug:B.slug||"",type:B.type,baseUrl:B.baseUrl,apiKey:"",customHeaders:"",enabled:B.enabled})},ce=async()=>{if(x){p(!0);try{let B;if(b.customHeaders.trim())try{B=JSON.parse(b.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await pe.patch("/api/admin/providers",{id:x,name:b.name,slug:b.slug||void 0,type:b.type,baseUrl:b.baseUrl,apiKey:b.apiKey||void 0,customHeaders:B,enabled:b.enabled}),de.success("Provider updated"),y(null),w(ks),U()}catch(B){de.error(B.message)}finally{p(!1)}}},ue=async B=>{R(!0);try{await pe.del(`/api/admin/providers/${B}`),de.success("Provider removed"),U()}catch(k){de.error(k.message)}finally{R(!1),S(null)}};return l.jsxs("div",{children:[l.jsx(Va,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:l.jsxs("div",{className:"flex gap-2",children:[o4.map(B=>{const k=n.find(q=>q.type===B.type);return l.jsxs(se,{variant:"outline",disabled:!!k||E===B.type,title:k?`${k.name} already exists`:B.hint,onClick:()=>void $(B.type),children:[l.jsx(Kl,{className:"mr-1 h-4 w-4"}),k?`${B.label} (added)`:B.label]},B.type)}),l.jsxs(ln,{open:s,onOpenChange:o,children:[l.jsx(Si,{asChild:!0,children:l.jsx(se,{children:"Add compatible provider"})}),l.jsxs(Kt,{children:[l.jsxs(Qt,{children:[l.jsx(Zt,{children:"New provider"}),l.jsx(jr,{children:"API-key or compatible endpoint."})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx(be,{htmlFor:"provider-name",children:"Name"}),l.jsx(Ee,{id:"provider-name",value:c.name,onChange:B=>u({...c,name:B.target.value})})]}),l.jsxs("div",{children:[l.jsx(be,{htmlFor:"provider-slug",children:"Slug (optional)"}),l.jsx(Ee,{id:"provider-slug",value:c.slug,onChange:B=>u({...c,slug:B.target.value})})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Type"}),l.jsxs(zn,{value:c.type,onValueChange:B=>u(k=>({...k,type:B,baseUrl:l4[B]})),children:[l.jsx(jn,{children:l.jsx(Ln,{})}),l.jsxs(Sn,{children:[l.jsx(nt,{value:"openai",children:"OpenAI-compatible"}),l.jsx(nt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),l.jsxs("div",{children:[l.jsx(be,{htmlFor:"provider-base-url",children:"Base URL"}),l.jsx(Ee,{id:"provider-base-url",value:c.baseUrl,onChange:B=>u({...c,baseUrl:B.target.value})})]}),l.jsxs("div",{children:[l.jsx(be,{htmlFor:"provider-api-key",children:"API key"}),l.jsx(Ee,{id:"provider-api-key",type:"password",value:c.apiKey,onChange:B=>u({...c,apiKey:B.target.value})})]}),l.jsxs("div",{children:[l.jsx(be,{htmlFor:"provider-headers",children:"Custom headers (JSON)"}),l.jsx(Ee,{id:"provider-headers",value:c.customHeaders,onChange:B=>u({...c,customHeaders:B.target.value}),placeholder:'{"X-Org":"acme"}'})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ha,{checked:c.enabled,onCheckedChange:B=>u({...c,enabled:B})}),l.jsx(be,{children:"Enabled"})]})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),l.jsx(se,{disabled:f||!c.name||!c.apiKey,onClick:P,children:f?"Creating…":"Create"})]})]})]})]})}),l.jsxs(rt,{children:[l.jsxs(st,{children:[l.jsx(lt,{className:"text-base",children:"All providers"}),l.jsxs(kn,{children:[n.length," total"]})]}),l.jsx(ot,{children:l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"Name"}),l.jsx(ve,{children:"Type"}),l.jsx(ve,{children:"Base URL"}),l.jsx(ve,{children:"Models"}),l.jsx(ve,{children:"Health"}),l.jsx(ve,{children:"Enabled"}),l.jsx(ve,{className:"text-right",children:"Actions"})]})}),l.jsxs(Pn,{children:[n.length===0&&l.jsx(Be,{children:l.jsx(fe,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),n.map(B=>l.jsxs(h.Fragment,{children:[l.jsxs(Be,{children:[l.jsxs(fe,{className:"font-medium",children:[B.name," ",l.jsx("span",{className:"text-xs text-muted-foreground",children:B.slug})]}),l.jsx(fe,{children:l.jsx(We,{variant:"outline",children:B.type})}),l.jsx(fe,{className:"text-xs text-muted-foreground",children:B.baseUrl}),l.jsx(fe,{children:B.modelCount}),l.jsx(fe,{children:l.jsx(We,{variant:B.health==="healthy"?"success":B.health==="down"?"destructive":"secondary",children:B.health})}),l.jsx(fe,{children:B.enabled?"Yes":"No"}),l.jsx(fe,{className:"text-right",children:l.jsxs("div",{className:"flex justify-end gap-1",children:[(B.type==="codex"||B.type==="qoder")&&l.jsxs(l.Fragment,{children:[l.jsxs(se,{size:"sm",variant:M[B.id]?"secondary":"outline","aria-expanded":!!M[B.id],onClick:()=>O(k=>({...k,[B.id]:!k[B.id]})),children:[M[B.id]?l.jsx(V0,{className:"h-3 w-3"}):l.jsx(Hm,{className:"h-3 w-3"}),l.jsx("span",{className:"ml-1",children:"Accounts"})]}),l.jsxs(se,{size:"sm",variant:"outline",onClick:()=>A(B),children:[l.jsx(qm,{className:"mr-1 h-3 w-3"})," Import models"]})]}),l.jsx(se,{size:"sm",variant:"outline",disabled:g===B.id,onClick:()=>J(B.id),children:l.jsx(_E,{className:"h-3 w-3"})}),l.jsx(se,{size:"sm",variant:"outline",onClick:()=>Y(B),children:"✎"}),l.jsx(se,{size:"sm",variant:"outline",onClick:()=>S(B.id),children:l.jsx(Ql,{className:"h-3 w-3"})})]})})]}),B.type==="codex"&&M[B.id]&&l.jsx(Be,{children:l.jsx(fe,{colSpan:7,className:"bg-muted/30",children:l.jsx(K_,{providerId:B.id,providerName:B.name})})}),B.type==="qoder"&&M[B.id]&&l.jsx(Be,{children:l.jsx(fe,{colSpan:7,className:"bg-muted/30",children:l.jsx(a4,{providerId:B.id,providerName:B.name})})})]},B.id))]})]})})]}),D&&l.jsx(s4,{providerId:D.id,providerName:D.name,open:!0,onOpenChange:B=>{B||A(null)},onImported:()=>void U()}),l.jsx(ln,{open:!!x,onOpenChange:B=>{B||(y(null),w(ks))},children:l.jsxs(Kt,{children:[l.jsx(Qt,{children:l.jsx(Zt,{children:"Edit provider"})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx(be,{children:"Name"}),l.jsx(Ee,{value:b.name,onChange:B=>w({...b,name:B.target.value})})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Slug (optional)"}),l.jsx(Ee,{value:b.slug,onChange:B=>w({...b,slug:B.target.value})})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Type"}),l.jsxs(zn,{value:b.type,onValueChange:B=>w({...b,type:B}),children:[l.jsx(jn,{children:l.jsx(Ln,{})}),l.jsxs(Sn,{children:[l.jsx(nt,{value:"openai",children:"OpenAI-compatible"}),l.jsx(nt,{value:"anthropic",children:"Anthropic-compatible"}),l.jsx(nt,{value:"codex",children:"Codex OAuth"})]})]})]}),b.type==="codex"?l.jsxs("p",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:[l.jsx(VE,{className:"mr-1 inline h-3 w-3"})," Codex credentials live in the account pool — manage them from the Accounts panel."]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(be,{children:"Base URL"}),l.jsx(Ee,{value:b.baseUrl,onChange:B=>w({...b,baseUrl:B.target.value})})]}),l.jsxs("div",{children:[l.jsx(be,{children:"API key (leave empty to keep current)"}),l.jsx(Ee,{type:"password",value:b.apiKey,onChange:B=>w({...b,apiKey:B.target.value})})]})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Custom headers (JSON)"}),l.jsx(Ee,{value:b.customHeaders,onChange:B=>w({...b,customHeaders:B.target.value}),placeholder:'{"X-Org":"acme"}'})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ha,{checked:b.enabled,onCheckedChange:B=>w({...b,enabled:B})}),l.jsx(be,{children:"Enabled"})]})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>{y(null),w(ks)},children:"Cancel"}),l.jsx(se,{disabled:f||!b.name,onClick:ce,children:"Save changes"})]})]})}),l.jsx(tj,{open:!!N,onOpenChange:B=>{B||S(null)},children:l.jsxs(jp,{children:[l.jsxs(aj,{children:[l.jsx(Sp,{children:"Delete provider?"}),l.jsx(Cp,{children:"This will soft-disable the provider if models depend on it."})]}),l.jsxs(rj,{children:[l.jsx(Ep,{children:"Cancel"}),l.jsx(Np,{disabled:C,onClick:B=>{N&&(B.preventDefault(),ue(N))},children:C?"Deleting…":"Delete"})]})]})})]})}const jm=["image_input","audio_input","tools","structured_output","reasoning","chat","streaming"],c4=["unknown","yes","no"];function u4(n,a){return n[a]===!0?"yes":n[a]===!1?"no":"unknown"}function d4(n){const a={};for(const s of jm)a[s]=n[s]==="yes"?!0:n[s]==="no"?!1:null;return a}function f4(){const[n,a]=h.useState([]),[s,o]=h.useState([]),[c,u]=h.useState("all"),[f,p]=h.useState(!1),[g,v]=h.useState(""),[x,y]=h.useState([]),[b,w]=h.useState(new Set),[N,S]=h.useState(!1),[C,R]=h.useState(""),[D,A]=h.useState(""),[M,O]=h.useState(null),[E,_]=h.useState(!1),[U,P]=h.useState(null),[$,J]=h.useState(null),[Y,ce]=h.useState(null),[ue,B]=h.useState({}),[k,q]=h.useState(!1),Z=G=>{const ie={};for(const he of jm)ie[he]=u4(G.capabilities,he);B(ie),ce(G)},ee=async()=>{if(Y){q(!0);try{await pe.patch("/api/admin/models",{id:Y.id,capabilities:d4(ue)}),de.success("Capabilities updated"),ce(null),te()}catch(G){de.error(G.message)}finally{q(!1)}}},te=async()=>{const[G,ie]=await Promise.all([pe.get("/api/admin/models"),pe.get("/api/admin/providers")]);a(G.models),o(ie.providers)};h.useEffect(()=>{te()},[]);const z=n.filter(G=>!(c!=="all"&&G.providerId!==c||C&&!G.publicModelId.toLowerCase().includes(C.toLowerCase()))),L=x.filter(G=>{if(!D)return!0;const ie=D.toLowerCase();return G.upstreamId.toLowerCase().includes(ie)||G.displayName.toLowerCase().includes(ie)}),F=async()=>{if(g){S(!0);try{const G=await pe.post(`/api/admin/providers/${g}/discover`);y(G.models),w(new Set)}catch(G){de.error(G.message)}finally{S(!1)}}},ae=async()=>{if(b.size!==0)try{const G=await pe.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(b)});de.success(`Imported ${G.imported} of ${G.requested}`),p(!1),y([]),w(new Set),te()}catch(G){de.error(G.message)}},ge=async()=>{if($)try{await pe.del(`/api/admin/models/${$.id}`),de.success("Model deleted"),J(null),te()}catch(G){de.error(G.message)}},ye=async G=>{var he,xe,Ae;O(G),_(!0);const ie=Date.now();P({phase:"streaming",startedAt:ie,text:"",progress:{}});try{const Ne=await gu(`/api/admin/models/${G}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!Ne.ok){const qe=await Ne.text().catch(()=>"");P({phase:"error",model:G,error:`HTTP ${Ne.status}: ${qe}`});return}const Oe=(he=Ne.body)==null?void 0:he.getReader();if(!Oe){P({phase:"error",model:G,error:"No response body"});return}const Qe=new TextDecoder;let et="",oe="",Le=!1;for(;!Le;){const{value:qe,done:_t}=await Oe.read();Le=_t,qe&&(et+=Qe.decode(qe,{stream:!0}));let St;for(;(St=et.indexOf(`
|
|
388
|
-
|
|
389
|
-
`))>=0;){const Wt=et.slice(0,St);et=et.slice(St+2);const mn=Wt.split(`
|
|
390
|
-
`);let en="",Ct="";for(const xn of mn)xn.startsWith("event: ")?en=xn.slice(7):xn.startsWith("data: ")&&(Ct=xn.slice(6));if(Ct){if(en===""||en==="message")try{const At=(xe=JSON.parse(Ct).choices)==null?void 0:xe[0];(Ae=At==null?void 0:At.delta)!=null&&Ae.content&&(oe+=At.delta.content),P(Mt=>{if(!Mt||Mt.phase!=="streaming")return Mt;const pn=Date.now()-ie,pa=Mt.progress.ttftMs??pn;return{...Mt,text:oe,progress:{ttftMs:pa,elapsedMs:pn}}})}catch{}if(en==="test_meta")try{const xn=JSON.parse(Ct);P({phase:"done",model:G,result:xn,text:oe})}catch{}if(en==="test_error")try{const xn=JSON.parse(Ct);P({phase:"error",model:G,error:xn.message})}catch{}}}}P(qe=>!qe||qe.phase==="streaming"?{phase:"error",model:G,error:"Stream ended unexpectedly"}:qe)}catch(Ne){P({phase:"error",model:G,error:Ne.message})}finally{O(null)}};return l.jsxs("div",{children:[l.jsx(Va,{title:"Models",description:"Physical models imported from providers",actions:l.jsxs(ln,{open:f,onOpenChange:p,children:[l.jsx(Si,{asChild:!0,children:l.jsxs(se,{variant:"outline",children:[l.jsx(qm,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),l.jsxs(Kt,{className:"max-w-2xl",children:[l.jsx(Qt,{children:l.jsx(Zt,{children:"Discover models"})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("div",{className:"flex-1",children:l.jsxs(zn,{value:g,onValueChange:v,children:[l.jsx(jn,{children:l.jsx(Ln,{placeholder:"Choose provider"})}),l.jsx(Sn,{children:s.map(G=>l.jsx(nt,{value:G.id,children:G.name},G.id))})]})}),l.jsx(se,{onClick:F,disabled:!g||N,children:N?"Fetching…":"Fetch"})]}),x.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("div",{className:"flex items-center gap-2 flex-1",children:l.jsxs("div",{className:"relative flex-1",children:[l.jsx(Vm,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),l.jsx(Ee,{className:"pl-8",placeholder:"Search models…",value:D,onChange:G=>A(G.target.value)}),D&&l.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>A(""),children:l.jsx(_u,{className:"h-4 w-4"})})]})}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:"text-sm text-muted-foreground",children:[L.length," / ",x.length," · ",b.size," selected"]}),l.jsx(se,{variant:"outline",size:"sm",onClick:()=>w(new Set(L.filter(G=>!G.alreadyImported).map(G=>G.upstreamId))),children:"Select All (new)"}),l.jsx(se,{variant:"outline",size:"sm",onClick:()=>w(new Set),children:"Clear"})]})]}),l.jsx("div",{className:"max-h-80 space-y-1 overflow-auto rounded border p-2",children:L.length===0&&x.length>0?l.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):L.map(G=>l.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[l.jsx(Cr,{checked:b.has(G.upstreamId),onCheckedChange:ie=>{const he=new Set(b);ie?he.add(G.upstreamId):he.delete(G.upstreamId),w(he)}}),l.jsx("span",{className:"font-mono text-xs",children:G.upstreamId}),G.alreadyImported&&l.jsx(We,{variant:"secondary",children:"imported"})]},G.upstreamId))})]})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),l.jsxs(se,{disabled:b.size===0,onClick:ae,children:["Import ",b.size||""]})]})]})]})}),l.jsxs(rt,{children:[l.jsxs(st,{children:[l.jsx(lt,{className:"text-base",children:"All models"}),l.jsxs(kn,{children:[n.length," total"]})]}),l.jsxs(ot,{children:[l.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[l.jsxs(zn,{value:c,onValueChange:u,children:[l.jsx(jn,{className:"w-56",children:l.jsx(Ln,{})}),l.jsxs(Sn,{children:[l.jsx(nt,{value:"all",children:"All providers"}),s.map(G=>l.jsx(nt,{value:G.id,children:G.name},G.id))]})]}),l.jsx(Ee,{className:"max-w-xs",placeholder:"Search public ID",value:C,onChange:G=>R(G.target.value)})]}),l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"Public ID"}),l.jsx(ve,{children:"Provider"}),l.jsx(ve,{children:"Upstream ID"}),l.jsx(ve,{children:"Capabilities"}),l.jsx(ve,{children:"Available"}),l.jsx(ve,{children:"Enabled"}),l.jsx(ve,{})]})}),l.jsxs(Pn,{children:[z.length===0&&l.jsx(Be,{children:l.jsx(fe,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),z.map(G=>l.jsxs(Be,{children:[l.jsx(fe,{className:"font-mono text-xs",children:G.publicModelId}),l.jsx(fe,{children:G.providerSlug}),l.jsx(fe,{className:"text-xs text-muted-foreground",children:G.upstreamModelId}),l.jsx(fe,{className:"space-x-1",children:Object.entries(G.capabilities).filter(([,ie])=>ie===!0).slice(0,4).map(([ie])=>l.jsx(We,{variant:"outline",className:"mr-1",children:ie},ie))}),l.jsx(fe,{children:G.upstreamAvailable?l.jsx(We,{variant:"success",children:"up"}):l.jsx(We,{variant:"destructive",children:"down"})}),l.jsx(fe,{children:G.enabled?"Yes":"No"}),l.jsx(fe,{className:"text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-1",children:[l.jsxs(se,{size:"sm",variant:"outline",onClick:()=>Z(G),disabled:M!==null,children:[l.jsx(BE,{className:"h-3.5 w-3.5"})," Capabilities"]}),l.jsxs(se,{size:"sm",variant:"outline",onClick:()=>void ye(G.id),disabled:M!==null,children:[M===G.id?l.jsx(pr,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(TE,{className:"h-3.5 w-3.5"})," Test"]}),l.jsxs(se,{size:"sm",variant:"destructive",onClick:()=>J(G),disabled:M!==null,children:[l.jsx(Ql,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},G.id))]})]})]})]}),l.jsx(ln,{open:!!$,onOpenChange:G=>{G||J(null)},children:l.jsxs(Kt,{className:"max-w-md",children:[l.jsx(Qt,{children:l.jsx(Zt,{children:"Xoá model"})}),l.jsxs("div",{className:"space-y-2 text-sm",children:[l.jsxs("p",{children:["Bạn có chắc muốn xoá model ",l.jsx("span",{className:"font-mono",children:$==null?void 0:$.publicModelId}),"?"]}),l.jsx("p",{className:"text-muted-foreground",children:"Model đang được dùng trong combo sẽ bị soft-disable (vô hiệu hoá) thay vì xoá hẳn, để giữ lịch sử và tham chiếu combo."})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>J(null),children:"Huỷ"}),l.jsx(se,{variant:"destructive",onClick:ge,children:"Xoá"})]})]})}),l.jsx(ln,{open:Y!==null,onOpenChange:G=>{G||ce(null)},children:l.jsxs(Kt,{className:"max-w-lg",children:[l.jsx(Qt,{children:l.jsxs(Zt,{children:["Capabilities — ",Y==null?void 0:Y.publicModelId]})}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.jsx("strong",{children:"Unknown"})," means the router has no verified answer and will attempt the request."," ",l.jsx("strong",{children:"No"})," blocks requests needing that capability (HTTP 400/502 before any upstream call)."]}),jm.map(G=>{var he;const ie=(he=Y==null?void 0:Y.discoveredCapabilities)==null?void 0:he[G];return l.jsxs("div",{className:"flex items-center justify-between gap-3 rounded px-1 py-1 text-sm hover:bg-accent",children:[l.jsxs("span",{className:"flex items-baseline gap-2",children:[l.jsx("code",{className:"text-xs",children:G}),l.jsx("span",{className:"text-xs text-muted-foreground",children:ie===void 0?"discovered: unknown":`discovered: ${String(ie)}`})]}),l.jsx("div",{className:"flex gap-1",children:c4.map(xe=>l.jsx(se,{size:"sm",variant:ue[G]===xe?"default":"outline",onClick:()=>B(Ae=>({...Ae,[G]:xe})),children:xe==="unknown"?"Unknown":xe==="yes"?"Yes":"No"},xe))})]},G)})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>ce(null),children:"Huỷ"}),l.jsx(se,{onClick:ee,disabled:k,children:k?"Saving…":"Lưu"})]})]})}),l.jsx(ln,{open:E,onOpenChange:_,children:l.jsxs(Kt,{className:"max-w-2xl",children:[l.jsx(Qt,{children:l.jsx(Zt,{children:"Kết quả test model"})}),U&&U.phase==="streaming"&&l.jsxs("div",{className:"space-y-3 text-sm",children:[l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx(pr,{className:"h-4 w-4 animate-spin"})," Đang stream…",l.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["TTFT ",U.progress.ttftMs!=null?`${U.progress.ttftMs} ms`:"…"]}),l.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["· ",U.progress.elapsedMs!=null?`${U.progress.elapsedMs} ms`:"…"]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi (streaming)"}),l.jsxs("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:[U.text||l.jsx("span",{className:"text-muted-foreground/60 animate-pulse",children:"waiting for first token…"}),U.phase==="streaming"&&l.jsx("span",{className:"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-primary/70"})]})]})]}),U&&U.phase==="done"&&l.jsxs("div",{className:"space-y-3 text-sm",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsx(We,{variant:U.result.success?"success":"destructive",children:U.result.success?"Thành công":"Thất bại"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Thời gian phản hồi"}),l.jsxs("div",{className:"font-mono",children:[U.result.latencyMs," ms"]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"TTFT"}),l.jsx("div",{className:"font-mono",children:U.result.ttftMs!=null?`${U.result.ttftMs} ms`:"—"})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Tokens (in / out)"}),l.jsxs("div",{className:"font-mono",children:[U.result.usage.input," / ",U.result.usage.output]})]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi của model"}),l.jsx("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:U.text||U.result.text||"(trống)"})]}),U.result.attempts.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Attempts"}),l.jsx("div",{className:"space-y-1",children:U.result.attempts.map((G,ie)=>l.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[l.jsx(We,{variant:G.success?"success":"destructive",children:G.success?"OK":"FAIL"}),l.jsxs("span",{className:"font-mono",children:[G.providerName," / ",G.modelId]}),l.jsxs("span",{className:"text-muted-foreground",children:[G.latencyMs," ms"]}),G.failureReason&&l.jsx("span",{className:"text-destructive",children:G.failureReason})]},ie))})]})]}),U&&U.phase==="error"&&l.jsxs("div",{className:"space-y-2 text-sm",children:[l.jsx(We,{variant:"destructive",children:"Thất bại"}),l.jsx("p",{className:"text-destructive",children:U.error})]}),l.jsx(Vt,{children:l.jsx(se,{variant:"outline",onClick:()=>_(!1),children:"Đóng"})})]})})]})}const Ru=n=>n.map((a,s)=>({...a,position:s}));function h4(){const[n,a]=h.useState([]),[s,o]=h.useState([]),[c,u]=h.useState(!1),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(!1),[b,w]=h.useState(!1),[N,S]=h.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),[C,R]=h.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),D=async()=>{const[P,$]=await Promise.all([pe.get("/api/admin/combos"),pe.get("/api/admin/models")]);a(P.combos),o($.models)};h.useEffect(()=>{D()},[]);const A=async()=>{if(N.members.length===0){de.error("Add at least one member");return}y(!0);try{await pe.post("/api/admin/combos",{name:N.name,slug:N.slug||void 0,mode:N.mode,enabled:N.enabled,members:N.members}),de.success("Combo created"),u(!1),S({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),D()}catch(P){de.error(P.message)}finally{y(!1)}},M=async P=>{try{const J=(await pe.get(`/api/admin/combos/${P.id}`)).combo;v(J.id),R({name:J.name,slug:J.publicModelId.startsWith("combo/")?J.slug:"",mode:J.mode,enabled:J.enabled,members:J.members.map(Y=>({modelId:Y.modelId,weight:Y.weight,position:Y.position,enabled:Y.enabled}))}),p(!0)}catch($){de.error($.message)}},O=async()=>{if(g){if(C.members.length===0){de.error("Add at least one member");return}w(!0);try{await pe.patch("/api/admin/combos",{id:g,name:C.name,slug:C.slug||void 0,mode:C.mode,enabled:C.enabled,members:C.members}),de.success("Combo updated"),p(!1),v(null),D()}catch(P){de.error(P.message)}finally{w(!1)}}},E=P=>{S($=>({...$,members:Ru([...$.members,{modelId:P,weight:1,position:$.members.length,enabled:!0}])}))},_=P=>{R($=>({...$,members:Ru([...$.members,{modelId:P,weight:1,position:$.members.length,enabled:!0}])}))},U=async P=>{if(confirm("Delete this combo?"))try{await pe.del(`/api/admin/combos/${P}`),de.success("Combo removed"),D()}catch($){de.error($.message)}};return l.jsxs("div",{children:[l.jsx(Va,{title:"Combos",description:"Virtual models combining physical models",actions:l.jsxs(ln,{open:c,onOpenChange:u,children:[l.jsx(Si,{asChild:!0,children:l.jsxs(se,{children:[l.jsx(Kl,{className:"mr-1 h-4 w-4"})," New combo"]})}),l.jsxs(Kt,{className:"max-w-2xl",children:[l.jsx(Qt,{children:l.jsx(Zt,{children:"New combo"})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx(be,{children:"Name"}),l.jsx(Ee,{value:N.name,onChange:P=>S({...N,name:P.target.value})})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Slug (optional — empty uses the name as the model ID)"}),l.jsx(Ee,{value:N.slug,onChange:P=>S({...N,slug:P.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Mode"}),l.jsxs(zn,{value:N.mode,onValueChange:P=>S({...N,mode:P}),children:[l.jsx(jn,{children:l.jsx(Ln,{})}),l.jsxs(Sn,{children:[l.jsx(nt,{value:"fallback",children:"Fallback (ordered)"}),l.jsx(nt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ha,{checked:N.enabled,onCheckedChange:P=>S({...N,enabled:P})}),l.jsx(be,{children:"Enabled"})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Members — priority order · drag to reorder"}),l.jsx(d0,{models:s,addedIds:N.members.map(P=>P.modelId),onAdd:E}),l.jsx(u0,{className:"mt-2",members:N.members,label:P=>{var $;return(($=s.find(J=>J.id===P.modelId))==null?void 0:$.publicModelId)??P.modelId},onChange:P=>S($=>({...$,members:P}))})]})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),l.jsx(se,{disabled:!N.name||x,onClick:A,children:x?"Creating…":"Create"})]})]})]})}),l.jsxs(rt,{children:[l.jsxs(st,{children:[l.jsx(lt,{className:"text-base",children:"All combos"}),l.jsxs(kn,{children:[n.length," total"]})]}),l.jsx(ot,{children:l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"Public ID"}),l.jsx(ve,{children:"Mode"}),l.jsx(ve,{children:"Members"}),l.jsx(ve,{children:"Healthy"}),l.jsx(ve,{children:"Enabled"}),l.jsx(ve,{})]})}),l.jsxs(Pn,{children:[n.length===0&&l.jsx(Be,{children:l.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No combos yet."})}),n.map(P=>l.jsxs(Be,{children:[l.jsx(fe,{className:"font-mono text-xs",children:P.publicModelId}),l.jsx(fe,{children:l.jsx(We,{variant:"outline",children:P.mode})}),l.jsx(fe,{children:P.memberCount}),l.jsx(fe,{children:P.healthyMemberCount}),l.jsx(fe,{children:P.enabled?"Yes":"No"}),l.jsx(fe,{className:"text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-1",children:[l.jsxs(se,{size:"sm",variant:"outline",onClick:()=>void M(P),children:[l.jsx(HE,{className:"h-3.5 w-3.5"})," Sửa"]}),l.jsxs(se,{size:"sm",variant:"destructive",onClick:()=>U(P.id),children:[l.jsx(Ql,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},P.id))]})]})})]}),l.jsx(ln,{open:f,onOpenChange:p,children:l.jsxs(Kt,{className:"max-w-2xl",children:[l.jsx(Qt,{children:l.jsx(Zt,{children:"Edit combo"})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx(be,{children:"Name"}),l.jsx(Ee,{value:C.name,onChange:P=>R({...C,name:P.target.value})})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Slug (optional — leave empty to use the name as the model ID)"}),l.jsx(Ee,{value:C.slug,onChange:P=>R({...C,slug:P.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Mode"}),l.jsxs(zn,{value:C.mode,onValueChange:P=>R({...C,mode:P}),children:[l.jsx(jn,{children:l.jsx(Ln,{})}),l.jsxs(Sn,{children:[l.jsx(nt,{value:"fallback",children:"Fallback (ordered)"}),l.jsx(nt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ha,{checked:C.enabled,onCheckedChange:P=>R({...C,enabled:P})}),l.jsx(be,{children:"Enabled"})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Members — priority order · drag to reorder"}),l.jsx(d0,{models:s,addedIds:C.members.map(P=>P.modelId),onAdd:_}),l.jsx(u0,{className:"mt-2",members:C.members,label:P=>{var $;return(($=s.find(J=>J.id===P.modelId))==null?void 0:$.publicModelId)??P.modelId},onChange:P=>R($=>({...$,members:P}))})]})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),l.jsx(se,{disabled:!C.name||b,onClick:O,children:b?"Saving…":"Save"})]})]})})]})}function u0({members:n,label:a,onChange:s,className:o}){const c=Ip(Vl(Ai,{activationConstraint:{distance:4}}),Vl(Ti,{coordinateGetter:Xp}));if(n.length===0)return l.jsx("p",{className:Ce("text-xs text-muted-foreground",o),children:"No members yet — add at least one."});const u=({active:f,over:p})=>{!p||f.id===p.id||s(Ru(Mi(n,Number(f.id),Number(p.id))))};return l.jsx(qp,{sensors:c,collisionDetection:Pp,modifiers:[Vp,$p],onDragEnd:u,children:l.jsx(Gp,{items:n.map((f,p)=>p),strategy:Yp,children:l.jsx("div",{className:Ce("space-y-1",o),children:n.map((f,p)=>l.jsx(m4,{index:p,member:f,label:a(f),onWeight:g=>s(n.map((v,x)=>x===p?{...v,weight:g}:v)),onRemove:()=>s(Ru(n.filter((g,v)=>v!==p)))},f.id??f.modelId))})})})}function m4({index:n,member:a,label:s,onWeight:o,onRemove:c}){const{attributes:u,listeners:f,setNodeRef:p,transform:g,transition:v,isDragging:x}=Fp({id:n});return l.jsxs("div",{ref:p,style:{transform:g?`translate3d(${g.x}px, ${g.y}px, 0)`:void 0,transition:v},className:Ce("flex items-center gap-2 rounded border p-2 text-sm",x&&"relative z-10 bg-muted/60 shadow-sm"),children:[l.jsx("button",{type:"button",...u,...f,"aria-label":`Reorder ${s}`,title:"Drag to change priority",className:"cursor-grab touch-none rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground active:cursor-grabbing",children:l.jsx($m,{className:"h-4 w-4"})}),l.jsx("span",{className:"w-5 text-xs tabular-nums text-muted-foreground",children:n+1}),l.jsx("span",{className:"flex-1 font-mono text-xs",children:s}),l.jsx(Ee,{type:"number",min:1,value:a.weight,onChange:y=>o(Number(y.target.value)),className:"w-20","aria-label":`Weight for ${s}`}),l.jsx(se,{size:"sm",variant:"outline",onClick:c,children:"Remove"})]})}function d0({models:n,addedIds:a,onAdd:s}){const[o,c]=h.useState(""),f=(o?n.filter(p=>{const g=o.toLowerCase();return p.publicModelId.toLowerCase().includes(g)||p.displayName.toLowerCase().includes(g)}):n).filter(p=>!a.includes(p.id));return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"relative",children:[l.jsx(Vm,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),l.jsx(Ee,{className:"pl-8",placeholder:"Search models…",value:o,onChange:p=>c(p.target.value)}),o&&l.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>c(""),children:l.jsx(_u,{className:"h-4 w-4"})})]}),f.length===0?l.jsx("p",{className:"text-xs text-muted-foreground",children:"No models match."}):l.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded border p-1",children:f.map(p=>l.jsxs("div",{className:"flex items-center justify-between rounded p-1 text-sm hover:bg-accent",children:[l.jsx("span",{className:"font-mono text-xs",children:p.publicModelId}),l.jsx(se,{size:"sm",variant:"ghost",onClick:()=>s(p.id),children:"+ Add"})]},p.id))})]})}function p4(){const[n,a]=h.useState([]),[s,o]=h.useState([]),[c,u]=h.useState([]),[f,p]=h.useState(!1),[g,v]=h.useState({alias:"",targetKind:"model",targetId:"",enabled:!0}),x=async()=>{const[b,w,N]=await Promise.all([pe.get("/api/admin/aliases"),pe.get("/api/admin/models"),pe.get("/api/admin/combos")]);a(b.aliases),o(w.models),u(N.combos)};h.useEffect(()=>{x()},[]);const y=async()=>{try{await pe.post("/api/admin/aliases",g),de.success("Alias created"),p(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),x()}catch(b){de.error(b.message)}};return l.jsxs("div",{children:[l.jsx(Va,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:l.jsxs(ln,{open:f,onOpenChange:p,children:[l.jsx(Si,{asChild:!0,children:l.jsxs(se,{children:[l.jsx(Kl,{className:"mr-1 h-4 w-4"})," New alias"]})}),l.jsxs(Kt,{children:[l.jsx(Qt,{children:l.jsx(Zt,{children:"New alias"})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx(be,{children:"Alias"}),l.jsx(Ee,{value:g.alias,onChange:b=>v({...g,alias:b.target.value}),placeholder:"coding"})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Target type"}),l.jsxs(zn,{value:g.targetKind,onValueChange:b=>v({...g,targetKind:b}),children:[l.jsx(jn,{children:l.jsx(Ln,{})}),l.jsxs(Sn,{children:[l.jsx(nt,{value:"model",children:"Model"}),l.jsx(nt,{value:"combo",children:"Combo"})]})]})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Target"}),l.jsxs(zn,{value:g.targetId,onValueChange:b=>v({...g,targetId:b}),children:[l.jsx(jn,{children:l.jsx(Ln,{placeholder:"Choose target"})}),l.jsx(Sn,{children:(g.targetKind==="model"?s:c).map(b=>l.jsx(nt,{value:b.id,children:b.publicModelId},b.id))})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ha,{checked:g.enabled,onCheckedChange:b=>v({...g,enabled:b})}),l.jsx(be,{children:"Enabled"})]})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),l.jsx(se,{disabled:!g.alias||!g.targetId,onClick:y,children:"Create"})]})]})]})}),l.jsxs(rt,{children:[l.jsxs(st,{children:[l.jsx(lt,{className:"text-base",children:"All aliases"}),l.jsxs(kn,{children:[n.length," total"]})]}),l.jsx(ot,{children:l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"Alias"}),l.jsx(ve,{children:"Target"}),l.jsx(ve,{children:"Type"}),l.jsx(ve,{children:"Enabled"}),l.jsx(ve,{})]})}),l.jsxs(Pn,{children:[n.length===0&&l.jsx(Be,{children:l.jsx(fe,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),n.map(b=>l.jsxs(Be,{children:[l.jsx(fe,{className:"font-mono text-xs",children:b.alias}),l.jsx(fe,{className:"font-mono text-xs",children:b.targetName??b.targetId}),l.jsx(fe,{children:l.jsx(We,{variant:"outline",children:b.targetKind})}),l.jsx(fe,{children:b.enabled?"Yes":"No"}),l.jsx(fe,{className:"text-right",children:l.jsx(se,{size:"sm",variant:"outline",onClick:async()=>{await pe.del(`/api/admin/aliases/${b.id}`),de.success("Removed"),x()},children:"Delete"})})]},b.id))]})]})})]})]})}function g4(){const[n,a]=h.useState([]),[s,o]=h.useState([]),[c,u]=h.useState([]),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(null),[N,S]=h.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C=async()=>{const[E,_,U]=await Promise.all([pe.get("/api/admin/api-keys"),pe.get("/api/admin/models"),pe.get("/api/admin/combos")]);a(E.apiKeys),o(_.models),u(U.combos)};h.useEffect(()=>{C()},[]);const R=async()=>{try{if(g){await pe.patch("/api/admin/api-keys",{id:g,name:N.name,expiresAt:N.expiresAt||null,allowAllModels:N.allowAll,permissions:N.allowAll?[]:N.permissions,rpmLimit:N.rpmLimit?Number(N.rpmLimit):null,tpmLimit:N.tpmLimit?Number(N.tpmLimit):null,maxConcurrent:N.concurrency?Number(N.concurrency):null}),p(!1),v(null),S({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),de.success("Key updated"),C();return}const E=await pe.post("/api/admin/api-keys",{name:N.name,expiresAt:N.expiresAt||null,allowAllModels:N.allowAll,permissions:N.allowAll?void 0:N.permissions,rpmLimit:N.rpmLimit?Number(N.rpmLimit):null,tpmLimit:N.tpmLimit?Number(N.tpmLimit):null,maxConcurrent:N.concurrency?Number(N.concurrency):null,...N.customSecret.trim()?{secret:N.customSecret.trim()}:{}});p(!1),y({secret:E.secret,name:E.name}),S({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C()}catch(E){de.error(E.message)}},D=async E=>{try{const U=((await pe.get(`/api/admin/api-keys/${E.id}`)).apiKey.permissions??[]).filter(P=>P.targetKind==="model"||P.targetKind==="combo");v(E.id),S({name:E.name,expiresAt:E.expiresAt?E.expiresAt.slice(0,16):"",allowAll:E.allowAllModels,permissions:U,rpmLimit:E.rpmLimit!=null?String(E.rpmLimit):"",tpmLimit:E.tpmLimit!=null?String(E.tpmLimit):"",concurrency:E.concurrencyLimit!=null?String(E.concurrencyLimit):"",customSecret:""}),p(!0)}catch(_){de.error(_.message)}},A=()=>{p(!1),v(null),S({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""})},M=async(E,_)=>{try{await pe.patch("/api/admin/api-keys",{id:E,enabled:!_}),de.success(_?"Key disabled":"Key enabled"),C()}catch(U){de.error(U.message)}},O=async E=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await pe.del(`/api/admin/api-keys/${E}`),de.success("Key deleted"),C()}catch(_){de.error(_.message)}};return l.jsxs("div",{children:[l.jsx(Va,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:l.jsxs(ln,{open:f,onOpenChange:E=>{E?p(!0):A()},children:[l.jsx(Si,{asChild:!0,children:l.jsxs(se,{children:[l.jsx(Kl,{className:"mr-1 h-4 w-4"})," New key"]})}),l.jsxs(Kt,{className:"max-w-2xl",children:[l.jsx(Qt,{children:l.jsx(Zt,{children:g?"Edit API key":"New API key"})}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx(be,{children:"Name"}),l.jsx(Ee,{value:N.name,onChange:E=>S({...N,name:E.target.value})})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Expires (optional)"}),l.jsx(Ee,{type:"datetime-local",value:N.expiresAt,onChange:E=>S({...N,expiresAt:E.target.value})})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[l.jsxs("div",{children:[l.jsx(be,{children:"RPM limit"}),l.jsx(Ee,{value:N.rpmLimit,onChange:E=>S({...N,rpmLimit:E.target.value}),type:"number"})]}),l.jsxs("div",{children:[l.jsx(be,{children:"TPM limit"}),l.jsx(Ee,{value:N.tpmLimit,onChange:E=>S({...N,tpmLimit:E.target.value}),type:"number"})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Concurrency"}),l.jsx(Ee,{value:N.concurrency,onChange:E=>S({...N,concurrency:E.target.value}),type:"number"})]})]}),!g&&l.jsxs("div",{children:[l.jsx(be,{children:"Key value (optional)"}),l.jsx(Ee,{value:N.customSecret,onChange:E=>S({...N,customSecret:E.target.value}),placeholder:"Leave empty to auto-generate ld-…"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"If provided, this exact value is stored as the key. Otherwise a random ld-… key is generated."})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ha,{checked:N.allowAll,onCheckedChange:E=>S({...N,allowAll:E})}),l.jsx(be,{children:"Allow all current and future models"})]}),!N.allowAll&&l.jsxs("div",{children:[l.jsx(be,{children:"Scope"}),l.jsx("div",{className:"max-h-48 space-y-1 overflow-auto rounded border p-2",children:[...s.map(E=>({targetKind:"model",targetId:E.id,label:E.publicModelId})),...c.map(E=>({targetKind:"combo",targetId:E.id,label:E.publicModelId}))].map(E=>{const _=N.permissions.some(U=>U.targetKind===E.targetKind&&U.targetId===E.targetId);return l.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[l.jsx(Cr,{checked:_,onCheckedChange:U=>{S(P=>({...P,permissions:U?[...P.permissions,{targetKind:E.targetKind,targetId:E.targetId}]:P.permissions.filter($=>!($.targetKind===E.targetKind&&$.targetId===E.targetId))}))}}),l.jsx("span",{className:"font-mono text-xs",children:E.label}),l.jsx(We,{variant:"outline",className:"ml-1",children:E.targetKind})]},`${E.targetKind}:${E.targetId}`)})})]})]}),l.jsxs(Vt,{children:[l.jsx(se,{variant:"outline",onClick:A,children:"Cancel"}),l.jsx(se,{disabled:!N.name,onClick:R,children:g?"Save changes":"Create"})]})]})]})}),l.jsxs(rt,{children:[l.jsxs(st,{children:[l.jsx(lt,{className:"text-base",children:"All keys"}),l.jsxs(kn,{children:[n.length," total"]})]}),l.jsx(ot,{children:l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"Name"}),l.jsx(ve,{children:"Prefix"}),l.jsx(ve,{children:"Status"}),l.jsx(ve,{children:"Scope"}),l.jsx(ve,{children:"RPM/TPM/Conc"}),l.jsx(ve,{})]})}),l.jsxs(Pn,{children:[n.length===0&&l.jsx(Be,{children:l.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),n.map(E=>l.jsxs(Be,{children:[l.jsx(fe,{className:"font-medium",children:E.name}),l.jsxs(fe,{className:"font-mono text-xs",children:[E.keyPrefix,"…"]}),l.jsx(fe,{children:E.enabled?l.jsx(We,{variant:"success",children:"enabled"}):l.jsx(We,{variant:"destructive",children:"disabled"})}),l.jsx(fe,{children:E.allowAllModels?"all":`${E.modelScopeCount} scoped`}),l.jsx(fe,{className:"text-xs",children:[E.rpmLimit,E.tpmLimit,E.concurrencyLimit].map((_,U)=>_?["","RPM","TPM","Conc"][U+1]:null).filter(Boolean).join(" / ")||"—"}),l.jsx(fe,{className:"text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-1",children:[E.secret&&l.jsxs(l.Fragment,{children:[l.jsx(se,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(E.secret),de.success("Copied")},children:l.jsx(ou,{className:"h-3.5 w-3.5"})}),l.jsx(se,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>w({secret:E.secret,name:E.name}),children:l.jsx(EE,{className:"h-3.5 w-3.5"})})]}),l.jsx(se,{size:"sm",variant:"ghost",title:"Edit",onClick:()=>void D(E),children:l.jsx(kE,{className:"h-3.5 w-3.5"})}),l.jsxs(se,{size:"sm",variant:"outline",onClick:()=>M(E.id,E.enabled),children:[E.enabled?l.jsx(pE,{className:"mr-1 h-3.5 w-3.5"}):l.jsx(ku,{className:"mr-1 h-3.5 w-3.5"}),E.enabled?"Disable":"Enable"]}),l.jsx(se,{size:"sm",variant:"destructive",onClick:()=>O(E.id),children:l.jsx(Ql,{className:"h-3.5 w-3.5"})})]})})]},E.id))]})]})})]}),l.jsx(ln,{open:!!x,onOpenChange:E=>{E||y(null)},children:l.jsxs(Kt,{children:[l.jsxs(Qt,{children:[l.jsx(Zt,{children:"API key created"}),l.jsx(jr,{children:"Copy now — this secret will not be shown again."})]}),l.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:x==null?void 0:x.secret}),l.jsxs(Vt,{children:[l.jsxs(se,{onClick:()=>{x&&(navigator.clipboard.writeText(x.secret),de.success("Copied"))},children:[l.jsx(ou,{className:"mr-1 h-4 w-4"})," Copy"]}),l.jsx(se,{variant:"outline",onClick:()=>y(null),children:"I have saved it"})]})]})}),l.jsx(ln,{open:!!b,onOpenChange:E=>{E||w(null)},children:l.jsxs(Kt,{children:[l.jsxs(Qt,{children:[l.jsxs(Zt,{children:["API key: ",b==null?void 0:b.name]}),l.jsx(jr,{children:"Full secret for this key, readable any time."})]}),l.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:b==null?void 0:b.secret}),l.jsxs(Vt,{children:[l.jsxs(se,{onClick:()=>{b&&(navigator.clipboard.writeText(b.secret),de.success("Copied"))},children:[l.jsx(ou,{className:"mr-1 h-4 w-4"})," Copy"]}),l.jsx(se,{variant:"outline",onClick:()=>w(null),children:"Close"})]})]})})]})}const v4=3e3;function x4(n,a){return!(a.success!=="all"&&n.success!==(a.success==="true")||a.protocol!=="all"&&n.protocol!==a.protocol||a.streaming!=="all"&&n.streaming!==(a.streaming==="true")||a.model&&!n.requestedModel.toLowerCase().includes(a.model.toLowerCase()))}function y4(){const[n,a]=h.useState([]),[s,o]=h.useState(0),[c,u]=h.useState(0),[f,p]=h.useState({success:"all",protocol:"all",streaming:"all",model:""}),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(0),N=50,S=h.useRef(Date.now()),C=h.useRef(new Set),R=h.useRef(f);R.current=f;const D=h.useRef(c);D.current=c;const A=h.useCallback(async()=>{const O=new URLSearchParams;O.set("limit",String(N)),O.set("offset",String(c)),f.success!=="all"&&O.set("success",f.success),f.protocol!=="all"&&O.set("protocol",f.protocol),f.streaming!=="all"&&O.set("streaming",f.streaming),f.model&&O.set("requestedModel",f.model);const E=await pe.get(`/api/admin/requests?${O.toString()}`);a(E.requests),o(E.total);for(const _ of E.requests)C.current.add(_.id)},[c,f]);h.useEffect(()=>{A()},[A]),h.useEffect(()=>{w(0)},[c,f]),h.useEffect(()=>{let O=!1,E=null;const _=new Set,U=()=>{O||(E=new EventSource(`/api/admin/requests/stream?since=${S.current}`),E.addEventListener("request",P=>{if(!O)try{const $=JSON.parse(P.data),J=new Date($.createdAt).getTime();if(Number.isFinite(J)&&(S.current=Math.max(S.current,J)),C.current.has($.id))return;C.current.add($.id),w(Y=>Y+1),D.current===0&&x4($,R.current)&&(a(Y=>Y.some(ce=>ce.id===$.id)?Y:[$,...Y].slice(0,N)),o(Y=>Y+1))}catch{}}),E.onerror=()=>{E==null||E.close(),E=null,O||_.add(setTimeout(U,v4))})};return U(),()=>{O=!0,E==null||E.close();for(const P of _)clearTimeout(P);_.clear()}},[]);const M=async O=>{v(O);const E=await pe.get(`/api/admin/requests/${O}`);y(E)};return l.jsxs("div",{children:[l.jsx(Va,{title:"Requests",description:`${s} matching · live updates`}),l.jsxs(rt,{children:[l.jsxs(st,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs(zn,{value:f.success,onValueChange:O=>{u(0),p({...f,success:O})},children:[l.jsx(jn,{className:"w-36",children:l.jsx(Ln,{})}),l.jsxs(Sn,{children:[l.jsx(nt,{value:"all",children:"All"}),l.jsx(nt,{value:"true",children:"Success"}),l.jsx(nt,{value:"false",children:"Failed"})]})]}),l.jsxs(zn,{value:f.protocol,onValueChange:O=>{u(0),p({...f,protocol:O})},children:[l.jsx(jn,{className:"w-32",children:l.jsx(Ln,{})}),l.jsxs(Sn,{children:[l.jsx(nt,{value:"all",children:"Any protocol"}),l.jsx(nt,{value:"openai",children:"OpenAI"}),l.jsx(nt,{value:"anthropic",children:"Anthropic"})]})]}),l.jsxs(zn,{value:f.streaming,onValueChange:O=>{u(0),p({...f,streaming:O})},children:[l.jsx(jn,{className:"w-32",children:l.jsx(Ln,{})}),l.jsxs(Sn,{children:[l.jsx(nt,{value:"all",children:"Any"}),l.jsx(nt,{value:"true",children:"Streaming"}),l.jsx(nt,{value:"false",children:"Non-stream"})]})]}),l.jsx(Ee,{className:"max-w-xs",placeholder:"Model contains…",value:f.model,onChange:O=>{u(0),p({...f,model:O.target.value})}}),b>0&&l.jsxs(se,{size:"sm",variant:"secondary",onClick:()=>{w(0),A()},children:[b," new request",b>1?"s":""," — refresh"]})]}),l.jsx(lt,{className:"mt-3 text-base",children:"Results"})]}),l.jsxs(ot,{children:[l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"Time"}),l.jsx(ve,{children:"Status"}),l.jsx(ve,{children:"Requested"}),l.jsx(ve,{children:"Final"}),l.jsx(ve,{children:"Tokens"}),l.jsx(ve,{children:"Latency"}),l.jsx(ve,{children:"Attempts"}),l.jsx(ve,{children:"Key"}),l.jsx(ve,{children:"IP"}),l.jsx(ve,{})]})}),l.jsxs(Pn,{children:[n.length===0&&l.jsx(Be,{children:l.jsx(fe,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),n.map(O=>l.jsxs(Be,{className:"cursor-pointer",onClick:()=>M(O.id),children:[l.jsx(fe,{className:"text-xs",children:Gm(O.createdAt)}),l.jsx(fe,{children:O.success?l.jsx(We,{variant:"success",children:O.httpStatus}):l.jsx(We,{variant:"destructive",children:O.httpStatus})}),l.jsx(fe,{className:"font-mono text-xs",children:O.requestedModel}),l.jsx(fe,{className:"font-mono text-xs text-muted-foreground",children:O.finalModelPublicId??"—"}),l.jsxs(fe,{className:"text-xs",children:[Xt(O.inputTokens+O.outputTokens)," ",O.cacheReadTokens?l.jsxs("span",{className:"text-amber-600",children:["(+",O.cacheReadTokens," cache)"]}):null]}),l.jsxs(fe,{className:"text-xs",children:[Is(O.totalLatencyMs),O.ttftMs?l.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",O.ttftMs,"ms"]}):null]}),l.jsxs(fe,{className:"text-xs",children:[O.attemptsCount,O.gatewayCacheHit?l.jsx(We,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),l.jsx(fe,{className:"text-xs",children:O.apiKeyName??"—"}),l.jsx(fe,{className:"text-xs",children:O.clientIp}),l.jsx(fe,{className:"text-right",children:l.jsx(se,{size:"sm",variant:"ghost",children:"View"})})]},O.id))]})]}),l.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs text-muted-foreground",children:["Showing ",c+1,"–",Math.min(c+N,s)," of ",s]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(se,{size:"sm",variant:"outline",disabled:c===0,onClick:()=>u(Math.max(0,c-N)),children:"Prev"}),l.jsx(se,{size:"sm",variant:"outline",disabled:c+N>=s,onClick:()=>u(c+N),children:"Next"})]})]})]})]}),l.jsx(ln,{open:!!g,onOpenChange:O=>{O||(v(null),y(null))},children:l.jsxs(Kt,{className:"max-w-3xl",children:[l.jsx(Qt,{children:l.jsxs(Zt,{children:["Request ",NR(g,16)]})}),x?l.jsxs("div",{className:"space-y-3 text-sm",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground text-xs",children:"Status"}),x.request.success?l.jsx(We,{variant:"success",children:x.request.httpStatus}):l.jsx(We,{variant:"destructive",children:x.request.httpStatus})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),Is(x.request.totalLatencyMs)]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Xt(x.request.inputTokens)," · out ",Xt(x.request.outputTokens)," · cache ",Xt(x.request.cacheReadTokens)]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground text-xs",children:"Attempts"}),x.request.attemptsCount]})]}),x.request.errorType&&l.jsxs("div",{className:"rounded border border-destructive/40 bg-destructive/10 p-2",children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Error"}),l.jsxs("div",{className:"font-mono text-xs",children:[x.request.errorType,": ",x.request.errorMessage]})]}),x.request.requestPayload&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Request content"}),l.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.requestPayload})]}),x.request.responsePayload&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Response content"}),l.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.responsePayload})]}),x.attempts.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Attempts"}),l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"#"}),l.jsx(ve,{children:"Provider"}),l.jsx(ve,{children:"Model"}),l.jsx(ve,{children:"Status"}),l.jsx(ve,{children:"Latency"}),l.jsx(ve,{children:"Reason"})]})}),l.jsx(Pn,{children:x.attempts.map(O=>l.jsxs(Be,{children:[l.jsx(fe,{children:O.attemptNumber}),l.jsx(fe,{children:O.providerName}),l.jsx(fe,{className:"font-mono text-xs",children:O.modelPublicId}),l.jsx(fe,{children:O.success?l.jsx(We,{variant:"success",children:String(O.statusCode??"OK")}):l.jsx(We,{variant:"destructive",children:String(O.statusCode??"err")})}),l.jsx(fe,{className:"text-xs",children:Is(O.latencyMs)}),l.jsx(fe,{className:"text-xs",children:O.failureReason??O.selectionReason})]},O.id))})]})]})]}):l.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}var b4=Object.defineProperty,so=(n,a)=>b4(n,"name",{value:a,configurable:!0}),ng="Tabs",[w4,D5]=Hn(ng,[Gu]),Wj=Gu(),[j4,ag]=w4(ng),S4=h.forwardRef(so(function(a,s){const{__scopeTabs:o,value:c,onValueChange:u,defaultValue:f,orientation:p="horizontal",dir:g,activationMode:v="automatic",...x}=a,y=bi(g),[b,w]=Ia({prop:c,onChange:u,defaultProp:f??"",caller:ng});return l.jsx(j4,{scope:o,baseId:Na(),value:b,onValueChange:w,orientation:p,dir:y,activationMode:v,children:l.jsx(He.div,{dir:y,"data-orientation":p,...x,ref:s})})},"Tabs")),C4="TabsList",N4=h.forwardRef(so(function(a,s){const{__scopeTabs:o,loop:c=!0,...u}=a,f=ag(C4,o),p=Wj(o);return l.jsx(iw,{asChild:!0,...p,orientation:f.orientation,dir:f.dir,loop:c,children:l.jsx(He.div,{role:"tablist","aria-orientation":f.orientation,...u,ref:s})})},"TabsList")),E4="TabsTrigger",R4=h.forwardRef(so(function(a,s){const{__scopeTabs:o,value:c,disabled:u=!1,...f}=a,p=ag(E4,o),g=Wj(o),v=rg(p.baseId,c),x=sg(p.baseId,c),y=c===p.value;return l.jsx(cw,{asChild:!0,...g,focusable:!u,active:y,children:l.jsx(He.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":x,"data-state":y?"active":"inactive","data-disabled":u?"":void 0,disabled:u,id:v,...f,ref:s,onMouseDown:Se(a.onMouseDown,b=>{!u&&b.button===0&&b.ctrlKey===!1?p.onValueChange(c):b.preventDefault()}),onKeyDown:Se(a.onKeyDown,b=>{u||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&p.onValueChange(c)}),onFocus:Se(a.onFocus,()=>{const b=p.activationMode!=="manual";!y&&!u&&b&&p.onValueChange(c)})})})},"TabsTrigger")),T4="TabsContent",A4=h.forwardRef(so(function(a,s){const{__scopeTabs:o,value:c,forceMount:u,children:f,...p}=a,g=ag(T4,o),v=rg(g.baseId,c),x=sg(g.baseId,c),y=c===g.value,b=h.useRef(y);return h.useEffect(()=>{const w=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(w)},[]),l.jsx(Er,{present:u||y,children:({present:w})=>l.jsx(He.div,{"data-state":y?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:x,tabIndex:0,...p,ref:s,style:{...a.style,animationDuration:b.current?"0s":void 0},children:w&&f})})},"TabsContent"));function rg(n,a){return`${n}-trigger-${a}`}so(rg,"makeTriggerId");function sg(n,a){return`${n}-content-${a}`}so(sg,"makeContentId");var M4=S4,eS=N4,tS=R4,nS=A4;const aS=M4,lg=h.forwardRef(({className:n,...a},s)=>l.jsx(eS,{ref:s,className:Ce("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...a}));lg.displayName=eS.displayName;const mr=h.forwardRef(({className:n,...a},s)=>l.jsx(tS,{ref:s,className:Ce("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 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",n),...a}));mr.displayName=tS.displayName;const Il=h.forwardRef(({className:n,...a},s)=>l.jsx(nS,{ref:s,className:Ce("mt-2 ring-offset-background focus-visible:outline-none",n),...a}));Il.displayName=nS.displayName;const D4=3e3,O4=1600,k4=10,_4=3,z4=12,L4=10*6e4,U4={cacheReadTokens:0,promptTokens:0,gatewayCacheHits:0,fallbacks:0};function rS(n,a,s){return s==="anthropic"?n+a:n}function I4(n){return n.promptTokens>0?n.cacheReadTokens/n.promptTokens:0}function P4(n,a){return a>0?n.fallbacks/a:0}function B4(n,a){return a>0?n.gatewayCacheHits/a:0}function H4(n,a,s){const o=n.totalRequests+1,c=n.successfulRequests+(s.success?1:0),u={cacheReadTokens:a.cacheReadTokens+s.cacheReadTokens,promptTokens:a.promptTokens+rS(s.inputTokens,s.cacheReadTokens,s.providerType),gatewayCacheHits:a.gatewayCacheHits+(s.gatewayCacheHit?1:0),fallbacks:a.fallbacks+(s.attemptsCount>1?1:0)};return{...n,...u,totalRequests:o,successfulRequests:c,failedRequests:n.failedRequests+(s.success?0:1),successRate:c/o,inputTokens:n.inputTokens+s.inputTokens,outputTokens:n.outputTokens+s.outputTokens,totalTokens:n.totalTokens+s.inputTokens+s.outputTokens,cacheHitRate:I4(u),gatewayCacheHitRate:B4(u,o),fallbackRate:P4(u,o),averageLatencyMs:(n.averageLatencyMs*n.totalRequests+s.totalLatencyMs)/o}}function q4(n){const[a,s]=h.useState(null),[o,c]=h.useState(null),[u,f]=h.useState([]),[p,g]=h.useState([]),[v,x]=h.useState([]),[y,b]=h.useState([]),[w,N]=h.useState(!0),[S,C]=h.useState(null),R=h.useRef([]),D=h.useRef(null),A=h.useRef(U4),M=h.useRef(new Set),O=h.useRef(Date.now()),E=h.useRef(0),_=h.useRef([]),U=h.useRef([]);return h.useEffect(()=>{let P=!1;return N(!0),C(null),M.current=new Set,O.current=Date.now(),pe.get(`/api/admin/stats?preset=${n}`).then($=>{if(!P){s($),c($.summary),D.current=$.summary,A.current={cacheReadTokens:$.summary.cacheReadTokens,promptTokens:$.summary.cacheHitRate>0?Math.round($.summary.cacheReadTokens/$.summary.cacheHitRate):$.summary.inputTokens,gatewayCacheHits:Math.round($.summary.gatewayCacheHitRate*$.summary.totalRequests),fallbacks:Math.round($.summary.fallbackRate*$.summary.totalRequests)},f($.recent),g($.providers),R.current=$.providers;for(const J of $.recent)M.current.add(J.id);N(!1)}}).catch($=>{P||(C($.message),N(!1))}),()=>{P=!0}},[n]),h.useEffect(()=>{let P=!1,$=null;const J=new Set,Y=()=>{P||($=new EventSource(`/api/admin/requests/stream?since=${O.current}`),$.addEventListener("request",ue=>{if(!P)try{const B=JSON.parse(ue.data),k=new Date(B.createdAt).getTime();if(Number.isFinite(k)&&(O.current=Math.max(O.current,k)),M.current.has(B.id))return;M.current.add(B.id);const q={cacheReadTokens:A.current.cacheReadTokens+B.cacheReadTokens,promptTokens:A.current.promptTokens+rS(B.inputTokens,B.cacheReadTokens,B.providerType),gatewayCacheHits:A.current.gatewayCacheHits+(B.gatewayCacheHit?1:0),fallbacks:A.current.fallbacks+(B.attemptsCount>1?1:0)};if(A.current=q,D.current&&c(H4(D.current,q,B)),f(Z=>Z.some(ee=>ee.id===B.id)?Z:[B,...Z].slice(0,k4)),B.providerId){R.current=R.current.map(z=>z.id===B.providerId?{...z,requests:z.requests+1,errorRate:z.requests+1?(z.errorRate*z.requests+(B.success?0:1))/(z.requests+1):0}:z),g(R.current);const Z=`p${++E.current}`,ee={id:Z,providerId:B.providerId,success:B.success};_.current=[..._.current.slice(-(_4*4)),ee],x(_.current);const te=setTimeout(()=>{_.current=_.current.filter(z=>z.id!==Z),x(_.current)},O4);J.add(te)}U.current.some(Z=>Z.id===B.id)&&(U.current=U.current.filter(Z=>Z.id!==B.id),b(U.current))}catch{}}),$.addEventListener("request_started",ue=>{if(!P)try{const B=JSON.parse(ue.data);if(!B.providerId||B.providerId==="")return;U.current=[...U.current.filter(k=>k.id!==B.requestId).slice(-(z4-1)),{id:B.requestId,providerId:B.providerId,startedAt:Date.now(),ttftMs:B.ttftMs??0}],b(U.current)}catch{}}),$.onerror=()=>{$==null||$.close(),$=null,P||J.add(setTimeout(Y,D4))})};Y();const ce=setInterval(()=>{const ue=Date.now()-L4;U.current.some(B=>B.startedAt<ue)&&(U.current=U.current.filter(B=>B.startedAt>=ue),b(U.current))},3e4);return()=>{P=!0,$==null||$.close();for(const ue of J)clearTimeout(ue);J.clear(),clearInterval(ce)}},[]),h.useEffect(()=>{const P=setInterval(()=>{pe.get("/api/admin/providers").then($=>{const J=new Map($.providers.map(Y=>[Y.id,Y]));R.current=R.current.map(Y=>{const ce=J.get(Y.id);return ce?{...Y,health:ce.health,enabled:ce.enabled}:Y}),g(R.current)}).catch(()=>{})},3e4);return()=>clearInterval(P)},[]),{snapshot:a,live:o??(a==null?void 0:a.summary)??$4,recent:u,providers:p,pulses:v,activeRoutes:y,loading:w,error:S}}const $4={totalRequests:0,successfulRequests:0,failedRequests:0,successRate:0,inputTokens:0,outputTokens:0,totalTokens:0,cacheReadTokens:0,cacheWriteTokens:0,reasoningTokens:0,averageLatencyMs:0,p95LatencyMs:0,averageTtftMs:null,p95TtftMs:null,cacheHitRate:0,gatewayCacheHitRate:0,fallbackRate:0};function sS({data:n,className:a,strokeClass:s="stroke-primary",fillClass:o}){if(n.length===0)return l.jsx("svg",{className:Ce("h-6 w-20",a),viewBox:"0 0 80 24"});const f=Math.max(...n),p=Math.min(...n),g=f-p||1,x=n.map((y,b)=>{const w=b/(n.length-1)*78+1,N=22-(y-p)/g*20;return`${w.toFixed(1)},${N.toFixed(1)}`}).join(" ");return l.jsxs("svg",{className:Ce("h-6 w-20",a),viewBox:"0 0 80 24",preserveAspectRatio:"none",children:[o&&l.jsx("polygon",{points:`1,23 ${x} 79,23`,className:o}),l.jsx("polyline",{points:x,fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:s})]})}function V4(n,a,s){const o=performance.now();let c=0;const u=f=>{const p=Math.min((f-o)/a,1),g=Math.round(n*p);g!==c&&(c=g,s(g)),p<1&&requestAnimationFrame(u)};requestAnimationFrame(u)}function Y4({delta:n,inverse:a}){if(Math.abs(n)<.005)return null;const s=n>0,o=a?!s:s,c=`${(Math.abs(n)*100).toFixed(1)}%`;return l.jsxs("span",{className:Ce("ml-1.5 inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold leading-none",o?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"),children:[l.jsx("span",{className:"mr-0.5",children:s?"▲":"▼"}),c]})}function ns({icon:n,label:a,value:s,format:o="number",delta:c,deltaInverse:u,sparkData:f,sparkStroke:p}){const[g,v]=h.useState(0),x=h.useRef(0);h.useEffect(()=>{const b=x.current,w=s;x.current=s,b!==w&&V4(Math.abs(w-b),600,N=>v(b+(w>b?N:-N)))},[s]);const y=o==="percent"?zu(g):o==="latency"?Is(g):Xt(Math.round(g));return l.jsxs(rt,{children:[l.jsxs(st,{className:"flex flex-row items-center justify-between pb-1",children:[l.jsxs(lt,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[l.jsx(n,{className:"h-4 w-4"}),a]}),c!==void 0&&l.jsx(Y4,{delta:c,inverse:u})]}),l.jsxs(ot,{className:"flex items-end justify-between",children:[l.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:y}),f&&f.length>1&&l.jsx(sS,{data:f,strokeClass:p??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const lS=1e3,f0=380,tu=60,as=lS/2,rs=720,qh=62,G4=260;function F4(n){return n==="healthy"?"fill-emerald-400":n==="degraded"?"fill-amber-400":"fill-red-400"}function nu(n,a,s,o){const c=n+(s-n)*.45,u=n+(s-n)*.55;return`M${n},${a} C${c},${a} ${u},${o} ${s},${o}`}function X4({liveRequests:n,successRate:a,providers:s,pulses:o,activeRoutes:c}){const u=f0/2,f=u,p=Math.max(1,s.reduce((x,y)=>x+y.requests,0)),g=new Set(c.map(x=>x.providerId)),v=g.size>0;return l.jsxs(rt,{children:[l.jsx(st,{className:"pb-2",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(lt,{className:"text-base",children:"Real-time Request Routing"}),l.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-emerald-400"})," healthy"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-400"})," degraded"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-red-400"})," down"]})]})]})}),l.jsx(ot,{className:"pt-0",children:l.jsx("div",{className:"relative w-full",children:l.jsxs("svg",{viewBox:`0 0 ${lS} ${f0}`,className:"w-full h-auto",preserveAspectRatio:"xMidYMid meet",children:[l.jsx("defs",{children:l.jsxs("filter",{id:"glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[l.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),l.jsxs("feMerge",{children:[l.jsx("feMergeNode",{in:"blur"}),l.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),s.map(x=>{const b=60+s.indexOf(x)*qh,w=x.requests/p,N=Math.max(1.5,Math.min(6,2+w*8)),S=g.has(x.id);return l.jsxs("g",{children:[S&&l.jsx("path",{d:nu(as,u,rs-20,b),fill:"none",stroke:"hsl(var(--primary) / 0.25)",strokeWidth:N+6,strokeLinecap:"round"}),l.jsx("path",{d:nu(as,u,rs-20,b),fill:"none",stroke:S?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:S?N+1:N,strokeLinecap:"round",opacity:S?.95:.6,className:S?"route-active":void 0})]},x.id)}),l.jsx("path",{d:nu(tu+30,f,as-30,u),fill:"none",stroke:v?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:3,strokeLinecap:"round",strokeDasharray:"6 3",opacity:v?.9:.5,className:v?"route-active":void 0}),o.map(x=>{const y=s.findIndex(S=>S.id===x.providerId);if(y===-1)return null;const b=60+y*qh,w=nu(as,u,rs-20,b),N=x.success?"var(--primary)":"#f87171";return l.jsxs("g",{filter:"url(#glow)",children:[l.jsx("circle",{r:5,fill:N,opacity:.9,children:l.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})}),l.jsx("circle",{r:9,fill:N,opacity:.25,children:l.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})})]},x.id)}),l.jsx("circle",{cx:tu,cy:f,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),l.jsx("text",{x:tu,y:f-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:h0(n)}),l.jsx("text",{x:tu,y:f+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),l.jsx("circle",{cx:as,cy:u,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),l.jsx("image",{x:as-12,y:u-16,width:24,height:24,href:"/logo.png"}),l.jsx("text",{x:as,y:u+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),l.jsxs("text",{x:as,y:u+38,textAnchor:"middle",className:"fill-emerald-500",fontSize:10,fontWeight:600,children:[(a*100).toFixed(1),"%"]}),s.map((x,y)=>{const b=60+y*qh,w=x.requests/p,N=!x.enabled||x.requests===0;return l.jsxs("g",{opacity:N?.4:1,children:[l.jsx("rect",{x:rs-20,y:b-14,width:G4,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),l.jsx("circle",{cx:rs-6,cy:b+10,r:4,className:F4(x.health)}),l.jsx("text",{x:rs+6,y:b-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:x.name}),l.jsxs("text",{x:rs+6,y:b+12,className:"fill-muted-foreground",fontSize:10,children:[x.modelCount," model",x.modelCount!==1?"s":""," · ",h0(x.requests)," req"]}),l.jsxs("text",{x:rs+6,y:b+25,className:"fill-muted-foreground",fontSize:10,children:[(w*100).toFixed(1),"% traffic · ",x.avgLatencyMs<1e3?`${Math.round(x.avgLatencyMs)}ms`:`${(x.avgLatencyMs/1e3).toFixed(1)}s`," avg",x.errorRate>0&&l.jsxs("tspan",{className:"fill-red-500",children:[" · ",(x.errorRate*100).toFixed(0),"% err"]})]})]},x.id)})]})})})]})}function h0(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}function K4({rows:n}){return l.jsxs(rt,{children:[l.jsx(st,{className:"pb-2",children:l.jsx(lt,{className:"text-base",children:"Recent Requests"})}),l.jsx(ot,{children:n.length===0?l.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No requests yet — traffic will appear here live."}):l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"Model"}),l.jsx(ve,{children:"Provider"}),l.jsx(ve,{children:"Tokens"}),l.jsx(ve,{children:"Status"}),l.jsx(ve,{children:"Time"})]})}),l.jsx(Pn,{children:n.map(a=>l.jsxs(Be,{children:[l.jsx(fe,{className:"font-mono text-xs",children:a.requestedModel}),l.jsx(fe,{className:"text-xs text-muted-foreground",children:a.providerName??"—"}),l.jsxs(fe,{className:"text-xs",children:[l.jsxs("span",{className:"font-mono",children:["in ",Xt(a.inputTokens)," · out ",Xt(a.outputTokens)]}),a.cacheReadTokens>0&&l.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",Xt(a.cacheReadTokens)," cache)"]})]}),l.jsx(fe,{children:l.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[l.jsx("span",{className:a.success?"h-2 w-2 rounded-full bg-emerald-400":"h-2 w-2 rounded-full bg-red-400"}),l.jsx("span",{className:"text-xs",children:a.success?a.httpStatus:`${a.httpStatus} err`})]})}),l.jsx(fe,{className:"text-xs text-muted-foreground",children:ER(a.createdAt)})]},a.id))})]})})]})}const Sm=34,m0=2*Math.PI*Sm;function Q4(n){return n>=.95?{stroke:"#4ade80",text:"text-emerald-500"}:n>=.8?{stroke:"#fbbf24",text:"text-amber-500"}:{stroke:"#f87171",text:"text-red-500"}}function Z4({successRate:n,averageLatencyMs:a,latencySpark:s}){const{stroke:o,text:c}=Q4(n),u=Math.min(1,Math.max(0,n)),f=m0*(1-u);return l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsxs(rt,{children:[l.jsx(st,{className:"pb-2",children:l.jsx(lt,{className:"text-base",children:"Success Rate"})}),l.jsxs(ot,{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"relative h-20 w-20",children:[l.jsxs("svg",{viewBox:"0 0 80 80",className:"h-20 w-20 -rotate-90",children:[l.jsx("circle",{cx:"40",cy:"40",r:Sm,fill:"none",stroke:"hsl(var(--border))",strokeWidth:7}),l.jsx("circle",{cx:"40",cy:"40",r:Sm,fill:"none",stroke:o,strokeWidth:7,strokeLinecap:"round",strokeDasharray:m0,strokeDashoffset:f,style:{transition:"stroke-dashoffset 0.6s ease, stroke 0.4s ease"}})]}),l.jsx("span",{className:`absolute inset-0 flex items-center justify-center text-sm font-semibold tabular-nums ${c}`,children:zu(n)})]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Share of requests that completed successfully over the selected window. Updated in real time."})]})]}),l.jsxs(rt,{children:[l.jsx(st,{className:"pb-2",children:l.jsx(lt,{className:"text-base",children:"Average Latency"})}),l.jsxs(ot,{className:"flex items-end justify-between",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:Is(a)}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Live average across the selected window"})]}),l.jsx(sS,{data:s,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function J4(){const[n,a]=h.useState("7d"),{snapshot:s,live:o,recent:c,providers:u,pulses:f,activeRoutes:p,loading:g,error:v}=q4(n);if(g)return l.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(v||!s)return l.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",v??"unknown error"]});const x=o,y=s.previous,b=s.series;function w(C,R){return R>0?(C-R)/R:void 0}const N=b.map(C=>C.requests),S=b.map(C=>C.avgLatency);return l.jsxs("div",{children:[l.jsx(Va,{title:"Statistics",description:"Real-time monitoring dashboard",actions:l.jsx(aS,{value:n,onValueChange:C=>void a(C),children:l.jsxs(lg,{children:[l.jsx(mr,{value:"today",children:"Today"}),l.jsx(mr,{value:"7d",children:"7 days"}),l.jsx(mr,{value:"30d",children:"30 days"})]})})}),l.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[l.jsx(ns,{icon:$0,label:"Requests",value:x.totalRequests,delta:w(x.totalRequests,y.totalRequests),sparkData:N}),l.jsx(ns,{icon:ku,label:"Success rate",format:"percent",value:x.successRate,delta:w(x.successRate,y.successRate),sparkData:N,sparkStroke:"stroke-emerald-500"}),l.jsx(ns,{icon:SE,label:"Total tokens",value:x.totalTokens,delta:w(x.totalTokens,y.totalTokens),sparkData:b.map(C=>C.inputTokens+C.outputTokens)}),l.jsx(ns,{icon:CE,label:"Cache hit rate",format:"percent",value:x.cacheHitRate,delta:w(x.cacheHitRate,y.cacheHitRate),sparkData:b.map(C=>C.cacheRead)}),l.jsx(ns,{icon:bE,label:"Avg latency",format:"latency",value:x.averageLatencyMs,delta:w(x.averageLatencyMs,y.averageLatencyMs),deltaInverse:!0,sparkData:S,sparkStroke:"stroke-amber-500"}),l.jsx(ns,{icon:G0,label:"p95 latency",format:"latency",value:x.p95LatencyMs}),l.jsx(ns,{icon:$E,label:"Avg TTFT",format:"latency",value:x.averageTtftMs??0}),l.jsx(ns,{icon:LE,label:"Fallback rate",format:"percent",value:x.fallbackRate,delta:w(x.fallbackRate,y.fallbackRate),deltaInverse:!0})]}),l.jsx("div",{className:"mt-6",children:l.jsx(X4,{liveRequests:x.totalRequests,successRate:x.successRate,providers:u,pulses:f,activeRoutes:p})}),l.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-3",children:[l.jsx("div",{className:"lg:col-span-2",children:l.jsx(K4,{rows:c})}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs(rt,{children:[l.jsx(st,{className:"pb-2",children:l.jsx(lt,{className:"text-base",children:"Top Models"})}),l.jsx(ot,{children:l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"Model"}),l.jsx(ve,{children:"Req"}),l.jsx(ve,{children:"Errors"}),l.jsx(ve,{children:"Tokens"})]})}),l.jsxs(Pn,{children:[s.topModels.length===0&&l.jsx(Be,{children:l.jsx(fe,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),s.topModels.map(C=>l.jsxs(Be,{children:[l.jsx(fe,{className:"font-mono text-xs",children:C.publicId}),l.jsx(fe,{className:"text-xs",children:Xt(C.requests)}),l.jsx(fe,{className:"text-xs",children:l.jsx("span",{className:C.errorRate>.1?"text-destructive":"text-muted-foreground",children:zu(C.errorRate)})}),l.jsx(fe,{className:"text-xs",children:Xt(C.totalTokens)})]},C.publicId))]})]})})]}),l.jsxs(rt,{children:[l.jsx(st,{className:"pb-2",children:l.jsx(lt,{className:"text-base",children:"Top API Keys"})}),l.jsx(ot,{children:l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"Key"}),l.jsx(ve,{children:"Requests"}),l.jsx(ve,{children:"Tokens"})]})}),l.jsxs(Pn,{children:[s.topApiKeys.length===0&&l.jsx(Be,{children:l.jsx(fe,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),s.topApiKeys.map((C,R)=>l.jsxs(Be,{children:[l.jsx(fe,{className:"text-xs",children:C.name}),l.jsx(fe,{className:"text-xs",children:Xt(C.requests)}),l.jsx(fe,{className:"text-xs",children:Xt(C.totalTokens)})]},R))]})]})})]})]})]}),l.jsx("div",{className:"mt-6",children:l.jsx(Z4,{successRate:x.successRate,averageLatencyMs:x.averageLatencyMs,latencySpark:S})})]})}function W4(){const[n,a]=h.useState([]),[s,o]=h.useState(0);return h.useEffect(()=>{pe.get("/api/admin/audit?limit=200").then(c=>{a(c.rows),o(c.total)})},[]),l.jsxs("div",{children:[l.jsx(Va,{title:"Audit Logs",description:`${s} entries · immutable`}),l.jsxs(rt,{children:[l.jsx(st,{children:l.jsx(lt,{className:"text-base",children:"All entries"})}),l.jsx(ot,{children:l.jsxs(Un,{children:[l.jsx(In,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"Time"}),l.jsx(ve,{children:"Action"}),l.jsx(ve,{children:"Status"}),l.jsx(ve,{children:"Target"}),l.jsx(ve,{children:"IP"}),l.jsx(ve,{children:"Actor"})]})}),l.jsxs(Pn,{children:[n.length===0&&l.jsx(Be,{children:l.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),n.map(c=>l.jsxs(Be,{children:[l.jsx(fe,{className:"text-xs",children:Gm(c.createdAt)}),l.jsx(fe,{className:"font-mono text-xs",children:c.action}),l.jsx(fe,{children:c.success?l.jsx(We,{variant:"success",children:"ok"}):l.jsx(We,{variant:"destructive",children:"fail"})}),l.jsx(fe,{className:"text-xs",children:c.targetName??c.targetId??"—"}),l.jsx(fe,{className:"text-xs",children:c.ip}),l.jsx(fe,{className:"text-xs",children:c.actor})]},c.id))]})]})})]})]})}const Cm={enabled:!0,sound:!0};let pi=Cm,Nm=!1,au=null;const Em=new Set;function oS(){for(const n of Em)n()}function iS(n=!1){return Nm&&!n?Promise.resolve():(!n&&au||(au=(async()=>{try{const a=await pe.get("/api/admin/settings");pi={enabled:a.settings.notificationsEnabled??Cm.enabled,sound:a.settings.notificationSoundEnabled??Cm.sound},Nm=!0,oS()}catch{}})()),au)}async function p0(n){const a={};n.enabled!==void 0&&(a.notificationsEnabled=n.enabled),n.sound!==void 0&&(a.notificationSoundEnabled=n.sound),await pe.patch("/api/admin/settings",a),pi={...pi,...n},Nm=!0,oS()}function e5(n){return Em.add(n),()=>Em.delete(n)}function cS(){return h.useSyncExternalStore(e5,()=>pi,()=>pi)}function t5(){const[n]=rE(),[a,s]=h.useState(null),[o,c]=h.useState(null),[u,f]=h.useState({current:"",next:""}),[p,g]=h.useState(""),[v,x]=h.useState(""),[y,b]=h.useState(null),[w,N]=h.useState(!1),[S,C]=h.useState("idle"),[R,D]=h.useState(null),A=async(oe=!1)=>{C("checking"),D(null);try{const Le=await pe.get(`/api/admin/update/check${oe?"?force=1":""}`);b(Le),C("idle")}catch(Le){D(Le.message),C("error")}},M=async()=>{N(!0),C("installing"),D(null);try{const oe=await pe.post("/api/admin/update/run");C("restarting"),de.success(oe.message||"Update started — the gateway will restart shortly.");const Le=setInterval(()=>{fetch("/health").then(qe=>{qe.ok&&(clearInterval(Le),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(Le),12e4)}catch(oe){de.error(oe.message),D(oe.message),C("error")}finally{N(!1)}},[O,E]=h.useState("disabled"),[_,U]=h.useState(""),[P,$]=h.useState(""),[J,Y]=h.useState(""),[ce,ue]=h.useState([]),[B,k]=h.useState(""),[q,Z]=h.useState(""),[ee,te]=h.useState(!1),[z,L]=h.useState(null),[F,ae]=h.useState(""),[ge,ye]=h.useState(""),[G,ie]=h.useState(""),he=async()=>{const oe=await pe.get("/api/admin/settings");s(oe.settings),g(oe.settings.adminIpAllow??""),x(oe.settings.adminIpBlock??"");const Le=await pe.get("/api/admin/settings/system");c(Le);try{const qe=await pe.get("/api/admin/me");E(qe.totpEnabled?"enabled":"disabled")}catch{}};if(h.useEffect(()=>{iS(!0)},[]),h.useEffect(()=>{he(),A(!0)},[]),!a)return l.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const xe=async oe=>{try{await pe.patch("/api/admin/settings",oe),de.success("Saved"),he()}catch(Le){de.error(Le.message)}},Ae=async()=>{try{const oe=await pe.post("/api/admin/account/totp/begin");U(oe.secret),$(oe.qr),E("setup"),de.info("Scan the QR code with your authenticator app")}catch(oe){de.error(oe.message)}},Ne=async()=>{if(!J||J.length!==6){de.error("Enter a 6-digit code");return}try{const oe=await pe.post("/api/admin/account/totp/verify",{code:J});ue(oe.recoveryCodes),E("showingRecovery"),de.success("TOTP enabled successfully")}catch(oe){de.error(oe.message)}},Oe=async()=>{if(!B){de.error("Enter your password");return}if(!q){de.error("Enter a TOTP code or recovery code");return}try{await pe.post("/api/admin/account/totp/disable",{password:B,totp:q}),E("disabled"),k(""),Z(""),de.success("TOTP disabled"),he()}catch(oe){de.error(oe.message)}},Qe=async()=>{te(!0);try{const oe=await pe.post("/api/admin/account/totp/recovery/regenerate",{password:B,totp:q});ue(oe.recoveryCodes),E("showingRecovery"),de.success("Recovery codes regenerated")}catch(oe){de.error(oe.message)}te(!1)},et=n.get("tab")||"logging";return l.jsxs("div",{children:[l.jsx(Va,{title:"Settings",description:"Logging, security, backup, and system info"}),l.jsxs(aS,{defaultValue:et,children:[l.jsxs(lg,{children:[l.jsx(mr,{value:"logging",children:"Logging"}),l.jsx(mr,{value:"access",children:"Access Control"}),l.jsx(mr,{value:"security",children:"Security"}),l.jsx(mr,{value:"backup",children:"Backup"}),l.jsx(mr,{value:"system",children:"System"})]}),l.jsx(Il,{value:"logging",children:l.jsxs(rt,{children:[l.jsx(st,{children:l.jsx(lt,{className:"text-base",children:"Logging policy"})}),l.jsxs(ot,{className:"space-y-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(be,{children:"Request-content logging"}),l.jsxs(zn,{value:a.contentLogMode,onValueChange:oe=>xe({contentLogMode:oe}),children:[l.jsx(jn,{children:l.jsx(Ln,{})}),l.jsxs(Sn,{children:[l.jsx(nt,{value:"off",children:"Off"}),l.jsx(nt,{value:"metadata",children:"Metadata only (default)"}),l.jsx(nt,{value:"prompt",children:"Prompt (sanitized)"}),l.jsx(nt,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(be,{children:"Retention (days)"}),l.jsx(Ee,{type:"number",min:1,max:3650,value:a.retentionDays,onChange:oe=>xe({retentionDays:Number(oe.target.value)})})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(be,{children:"Database size limit (MB)"}),l.jsx(Ee,{type:"number",min:64,value:a.dbSizeLimitMb,onChange:oe=>xe({dbSizeLimitMb:Number(oe.target.value)})})]}),l.jsx("div",{className:"flex items-center gap-2 pt-2",children:l.jsx(se,{onClick:async()=>{const oe=await pe.post("/api/admin/settings/cleanup");de.success(`Deleted ${oe.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),l.jsx(Il,{value:"access",children:l.jsxs(rt,{children:[l.jsxs(st,{children:[l.jsx(lt,{className:"text-base",children:"IP access control"}),l.jsx(kn,{children:"Allowlist / Blocklist for this admin website (not model traffic)"})]}),l.jsxs(ot,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(be,{children:"Allow only these IPs"}),l.jsx(mi,{placeholder:`192.168.1.0/24
|
|
391
|
-
10.0.0.1`,value:p,onChange:oe=>g(oe.target.value)}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Newlines-delimited CIDR ranges (IPv4 only). Leave empty = no allow restrictions. When you save a non-empty list, your current IP is auto-added to prevent lockout."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(be,{children:"Block these IPs"}),l.jsx(mi,{placeholder:"192.168.1.100",value:v,onChange:oe=>x(oe.target.value)}),l.jsx("p",{className:"text-xs text-muted-foreground",children:'Newlines-delimited CIDR ranges (IPv4 only). Blocked IPs are rejected with "Không có quyền truy cập" before any login page.'})]}),l.jsx(se,{onClick:()=>{const oe={};p!==((a==null?void 0:a.adminIpAllow)??"")&&(oe.adminIpAllow=p||null),v!==((a==null?void 0:a.adminIpBlock)??"")&&(oe.adminIpBlock=v||null),pe.patch("/api/admin/settings",oe).then(Le=>{de.success("Saved"+(Le.addedIp?` — added your IP: ${Le.addedIp}`:"")),he(),g(""),x("")}).catch(Le=>de.error(Le.message))},children:"Save access control"}),l.jsxs("div",{className:"rounded bg-amber-50 border border-amber-200 p-3 dark:bg-amber-950/20 dark:border-amber-800",children:[l.jsx("p",{className:"text-sm font-medium text-amber-900 dark:text-amber-200",children:"⚠️ If you enable an allow list, you cannot access the gateway unless your IP matches."}),l.jsx("p",{className:"text-xs text-amber-800 dark:text-amber-300",children:"The server automatically adds your current IP when you save — but if you configure it from a different machine, that machine will be locked out immediately."})]})]})]})}),l.jsx(Il,{value:"security",children:l.jsxs(rt,{children:[l.jsxs(st,{children:[l.jsx(lt,{className:"text-base",children:"Security"}),l.jsx(kn,{children:"Change password, 2FA, and trusted proxy configuration"})]}),l.jsxs(ot,{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(be,{children:"Trusted proxy hops"}),l.jsx(Ee,{type:"number",min:0,max:8,value:a.trustProxyHops,onChange:oe=>xe({trustProxyHops:Number(oe.target.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"0 = never trust X-Forwarded-For (direct exposure). 1+ only when behind a single trusted reverse proxy."})]}),l.jsxs("div",{className:"space-y-2 border-t pt-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(be,{className:"text-base",children:"TOTP 2FA"}),O==="enabled"?l.jsx("span",{className:"rounded bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800 dark:bg-green-900 dark:text-green-200",children:"Enabled"}):null,O==="disabled"?l.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:"Disabled"}):null]}),O==="disabled"&&l.jsx(se,{variant:"outline",onClick:Ae,children:"Enable TOTP"}),O==="setup"&&l.jsxs("div",{className:"space-y-3 rounded border p-3",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan this QR code with your authenticator app, or enter the secret manually."}),P&&l.jsx("img",{src:P,alt:"TOTP QR code",className:"h-40 w-40"}),l.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",_]}),l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx(be,{children:"Verify code"}),l.jsx(Ee,{value:J,onChange:oe=>Y(oe.target.value),placeholder:"123456",maxLength:6})]}),l.jsx(se,{disabled:J.length<6,onClick:Ne,children:"Verify & enable"})]})]}),O==="showingRecovery"&&l.jsxs("div",{className:"space-y-3 rounded border border-amber-500/40 bg-amber-50 p-3 dark:bg-amber-950/20",children:[l.jsx("p",{className:"text-sm font-medium",children:"Recovery codes — save these now!"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Each code can be used once to log in without your TOTP device. They will not be shown again."}),l.jsx("div",{className:"space-y-1",children:ce.map((oe,Le)=>l.jsx("div",{className:"font-mono text-xs",children:oe},Le))}),l.jsx(se,{onClick:()=>{E("enabled"),de.success("Recovery codes saved")},children:"I have saved them"})]}),O==="enabled"&&l.jsxs("div",{className:"space-y-3 rounded border p-3",children:[l.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[l.jsxs("div",{children:[l.jsx(be,{children:"Password"}),l.jsx(Ee,{type:"password",value:B,onChange:oe=>k(oe.target.value),placeholder:"Current password"})]}),l.jsxs("div",{children:[l.jsx(be,{children:"TOTP code"}),l.jsx(Ee,{value:q,onChange:oe=>Z(oe.target.value),placeholder:"123456",maxLength:6})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(se,{variant:"outline",size:"sm",disabled:ee||!B||q.length<6,onClick:Qe,children:"Regenerate recovery codes"}),l.jsx(se,{variant:"destructive",size:"sm",disabled:!B||q.length<6,onClick:Oe,children:"Disable TOTP"})]})]})]}),l.jsxs("div",{className:"space-y-2 border-t pt-4",children:[l.jsx(be,{children:"Change password"}),l.jsx(Ee,{type:"password",placeholder:"Current password",value:u.current,onChange:oe=>f({...u,current:oe.target.value})}),l.jsx(Ee,{type:"password",placeholder:"New password (12+ chars)",value:u.next,onChange:oe=>f({...u,next:oe.target.value})}),l.jsx(se,{disabled:!u.current||u.next.length<12,onClick:async()=>{try{await pe.post("/api/admin/account/password",{currentPassword:u.current,newPassword:u.next}),de.success("Password changed"),f({current:"",next:""})}catch(oe){de.error(oe.message)}},children:"Change password"})]})]})]})}),l.jsx(Il,{value:"backup",children:l.jsxs(rt,{children:[l.jsxs(st,{children:[l.jsx(lt,{className:"text-base",children:"Backup & restore"}),l.jsx(kn,{children:"Download a snapshot or restore from a previous backup"})]}),l.jsxs(ot,{className:"space-y-3",children:[l.jsxs("div",{className:"space-y-2 rounded border p-3",children:[l.jsx(be,{children:"Backup passphrase (6 digits)"}),l.jsx(Ee,{inputMode:"numeric",maxLength:6,value:F,onChange:oe=>ae(oe.target.value.replace(/\D/g,"")),placeholder:"123456"}),l.jsx(Ee,{inputMode:"numeric",maxLength:6,value:ge,onChange:oe=>ye(oe.target.value.replace(/\D/g,"")),placeholder:"Repeat passphrase"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"This passphrase encrypts the master key inside the backup. You must enter the same 6 digits when importing on a new instance. Without it, encrypted provider credentials cannot be recovered."})]}),l.jsx(se,{disabled:F.length!==6||F!==ge,onClick:async()=>{try{const oe=await gu("/api/admin/backup/create",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({passphrase:F})});if(!oe.ok)throw new Error("Backup failed");const Le=await oe.blob(),qe=URL.createObjectURL(Le),_t=document.createElement("a");_t.href=qe,_t.download="latedev-backup.json",_t.click(),URL.revokeObjectURL(qe),de.success("Backup downloaded"),ae(""),ye("")}catch(oe){de.error(oe.message)}},children:"Download backup"}),l.jsxs("div",{className:"space-y-2 rounded border p-3",children:[l.jsx(be,{children:"Backup passphrase for restore"}),l.jsx(Ee,{inputMode:"numeric",maxLength:6,value:G,onChange:oe=>ie(oe.target.value.replace(/\D/g,"")),placeholder:"123456"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the 6-digit passphrase entered when the backup was created. It is required to restore the master key and administrator access."})]}),l.jsxs(tj,{open:z!==null,onOpenChange:oe=>{oe||L(null)},children:[l.jsx(HO,{asChild:!0,children:l.jsxs("div",{children:[l.jsx(be,{children:"Restore from backup file"}),l.jsx(Ee,{type:"file",accept:".json,application/json","data-testid":"restore-file",onChange:oe=>{var qe;const Le=(qe=oe.target.files)==null?void 0:qe[0];L(Le??null)}})]})}),l.jsxs(jp,{children:[l.jsxs(aj,{children:[l.jsx(Sp,{children:"Restore backup?"}),l.jsxs(Cp,{children:["Restoring will replace the entire current database with the selected backup (",(z==null?void 0:z.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),l.jsxs(rj,{children:[l.jsx(Ep,{children:"Cancel"}),l.jsx(Np,{onClick:async()=>{var Le,qe;const oe=z;if(oe)try{const _t=JSON.parse(await oe.text()),St=await gu("/api/admin/backup/restore",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({backup:_t,passphrase:G})});if(!St.ok)throw new Error(((qe=(Le=await St.json())==null?void 0:Le.error)==null?void 0:qe.message)??"Restore failed");de.success("Restored. Reloading…"),L(null),setTimeout(()=>location.reload(),600)}catch(_t){de.error(_t.message)}},children:"Restore"})]})]})]})]})]})}),l.jsxs(Il,{value:"system",children:[l.jsxs(rt,{children:[l.jsx(st,{children:l.jsx(lt,{className:"text-base",children:"System"})}),l.jsxs(ot,{className:"space-y-2 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"App version:"})," ",o==null?void 0:o.appVersion]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Data directory:"})," ",l.jsx("span",{className:"font-mono",children:o==null?void 0:o.dataDir})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Encryption:"})," ",o!=null&&o.masterKeyConfigured?"Configured":"Not configured"," (v",o==null?void 0:o.masterKeyVersion,")"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Environment:"})," ",o==null?void 0:o.environment]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[l.jsx(Ha,{checked:a.gatewayCacheEnabled,onCheckedChange:oe=>xe({gatewayCacheEnabled:oe})}),l.jsx(be,{children:"Gateway response cache (disabled by default)"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx(be,{children:"Cache TTL (s)"}),l.jsx(Ee,{type:"number",min:1,value:a.gatewayCacheDefaultTtlSeconds,onChange:oe=>xe({gatewayCacheDefaultTtlSeconds:Number(oe.target.value)})})]}),l.jsxs("div",{children:[l.jsx(be,{children:"Cache max size (MB)"}),l.jsx(Ee,{type:"number",min:1,value:a.gatewayCacheMaxSizeMb,onChange:oe=>xe({gatewayCacheMaxSizeMb:Number(oe.target.value)})})]})]}),l.jsx(se,{variant:"outline",onClick:async()=>{const oe=await pe.post("/api/admin/settings/cache/clear");de.success(`Cleared ${oe.deleted} entries`)},children:"Clear gateway cache"})]})]}),l.jsx(n5,{}),l.jsxs(rt,{className:"mt-4",children:[l.jsxs(st,{children:[l.jsx(lt,{className:"text-base",children:"Updates"}),l.jsx(kn,{children:"Automatic updates from the npm registry"})]}),l.jsxs(ot,{className:"space-y-3 text-sm",children:[S==="checking"&&!y&&l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx(pr,{className:"h-4 w-4 animate-spin"})," Checking for updates…"]}),y&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Current version"}),l.jsxs("div",{className:"font-mono",children:["v",y.currentVersion]})]}),l.jsx("span",{className:"text-muted-foreground",children:"→"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Latest version"}),l.jsx("div",{className:"font-mono",children:y.latestVersion?`v${y.latestVersion}`:"—"})]}),y.status.docker?l.jsx(We,{variant:"secondary",children:y.status.watchtower?"Docker + Watchtower":"Docker"}):y.latestVersion===null?l.jsx(We,{variant:"secondary",children:"Registry unreachable"}):y.hasUpdate?l.jsx(We,{variant:"success",children:"Update available"}):l.jsxs(We,{variant:"outline",children:[l.jsx(ku,{className:"mr-1 h-3 w-3"})," Up to date"]})]}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable&&l.jsx("p",{className:"text-muted-foreground",children:"Watchtower pulls new images automatically every hour — or use Update now for an instant update."}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable===!1&&l.jsxs("p",{className:"text-muted-foreground",children:["The Watchtower sidecar is configured but not running — start it with ",l.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"docker compose --profile updater up -d"}),"."]}),y.status.docker&&!y.status.watchtower&&l.jsx("p",{className:"text-muted-foreground",children:y.status.reason??"This instance runs in Docker — update by pulling the new image tag."}),!y.status.docker&&y.latestVersion===null&&l.jsxs("p",{className:"text-muted-foreground",children:["Could not reach the npm registry (offline or blocked). ",R&&l.jsx("span",{className:"text-destructive",children:R})]}),S==="installing"&&l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx(pr,{className:"h-4 w-4 animate-spin"})," Applying the update… this can take a minute."]}),S==="restarting"&&l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx(pr,{className:"h-4 w-4 animate-spin"})," Update applied — the gateway is restarting on the new version. This page reloads automatically."]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y.hasUpdate&&S==="idle"&&(!y.status.docker||y.status.watchtower&&y.watchtowerReachable!==!1)&&l.jsxs(se,{disabled:w||y.status.docker&&y.watchtowerReachable===!1,onClick:M,children:[l.jsx(qm,{className:"mr-1 h-4 w-4"})," Update now"]}),y.hasUpdate&&y.changelogUrl&&l.jsx(se,{variant:"outline",asChild:!0,children:l.jsx("a",{href:y.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),S==="idle"&&l.jsx(se,{variant:"ghost",disabled:w,onClick:()=>A(!0),children:"Check again"})]})]})]})]})]})]})]})}function n5(){const n=cS();return l.jsxs(rt,{className:"mt-4",children:[l.jsx(st,{children:l.jsxs(lt,{className:"text-base flex items-center gap-2",children:[l.jsx(gE,{className:"h-4 w-4"})," Notifications"]})}),l.jsxs(ot,{className:"space-y-3 text-sm",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{children:"Show request notifications"}),l.jsx(Ha,{checked:n.enabled,onCheckedChange:a=>void p0({enabled:a})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(YE,{className:"h-3 w-3"})," Play notification sound"]}),l.jsx(Ha,{checked:n.sound,onCheckedChange:a=>void p0({sound:a})})]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function a5({items:n,onDismiss:a}){return n.length?l.jsx("div",{className:"fixed top-16 right-4 z-50 flex max-h-[calc(100vh-8rem)] w-80 flex-col gap-2 overflow-y-auto",children:n.map(s=>{const o=!s.success,c=s.success&&s.totalLatencyMs>15e3,u=Ce("rounded-md border shadow-lg transition-all",o&&"bg-destructive text-destructive-foreground border-destructive",c&&"bg-amber-500/90 text-amber-950 border-amber-600/50",!o&&!c&&"bg-card text-card-foreground border-border");return l.jsxs(Ls,{to:"/requests",className:Ce("block shrink-0 p-3 hover:opacity-95",u),children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[o?l.jsx(yE,{className:"h-4 w-4 shrink-0"}):s.success?l.jsx(ku,{className:"h-4 w-4 shrink-0"}):l.jsx(GE,{className:"h-4 w-4 shrink-0 opacity-70"}),l.jsx("div",{className:"min-w-0 truncate text-sm font-medium",title:s.requestedModel,children:s.requestedModel})]}),l.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100",onClick:f=>{f.preventDefault(),f.stopPropagation(),a(s.id)},"aria-label":"Dismiss",type:"button",children:l.jsx(_u,{className:"h-3.5 w-3.5"})})]}),l.jsxs("div",{className:"mt-1 text-xs",children:[s.success?"Thành công":"Thất bại",!s.success&&s.errorType&&l.jsx("span",{className:"ml-1 inline-block rounded bg-black/15 px-1 py-0.5 align-text-bottom text-[10px]",children:s.errorType})]}),l.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:["in ",Xt(s.inputTokens)," · out ",Xt(s.outputTokens),(s.cacheReadTokens>0||s.cacheWriteTokens>0)&&l.jsxs(l.Fragment,{children:[" · cache ",s.cacheReadTokens>0&&l.jsxs("span",{children:["r",Xt(s.cacheReadTokens)]}),s.cacheReadTokens>0&&s.cacheWriteTokens>0&&"/",s.cacheWriteTokens>0&&l.jsxs("span",{children:["w",Xt(s.cacheWriteTokens)]})]})]}),l.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[Is(s.totalLatencyMs),s.ttftMs!=null&&s.ttftMs>=0&&l.jsxs("span",{children:[" · TTFT ",Is(s.ttftMs)]})]})]},s.id)})}):null}const r5=5e3,s5=8,l5=3e3;let ru=null;function o5(){try{ru||(ru=new Audio("/notification.mp3")),ru.currentTime=0,ru.play().catch(()=>{})}catch{}}function i5(){const[n,a]=h.useState([]),s=h.useRef(null),o=h.useRef(new Map),c=h.useRef(Date.now()),u=h.useRef(new Set),f=cS(),p=h.useRef(f.sound);p.current=f.sound,h.useEffect(()=>{iS()},[]);const g=f.enabled;return h.useEffect(()=>{var w;if(!g){(w=s.current)==null||w.close(),s.current=null;const N=o.current;for(const S of N.values())clearTimeout(S);N.clear(),a([]);return}let x=!1;const y=o.current,b=()=>{if(x)return;const N=new EventSource(`/api/admin/requests/stream?since=${c.current}`);s.current=N,N.addEventListener("request",S=>{if(!x)try{const C=JSON.parse(S.data),R=new Date(C.createdAt).getTime();if(Number.isFinite(R)&&(c.current=Math.max(c.current,R)),u.current.has(C.id))return;u.current.add(C.id),a(A=>A.some(M=>M.id===C.id)?A:[C,...A].slice(0,s5));const D=setTimeout(()=>{a(A=>A.filter(M=>M.id!==C.id)),y.delete(C.id)},r5);y.set(C.id,D),p.current&&o5()}catch{}}),N.onerror=()=>{N.close(),s.current=null,x||setTimeout(b,l5)}};return b(),()=>{var N;x=!0,(N=s.current)==null||N.close(),s.current=null;for(const S of y.values())clearTimeout(S);y.clear()}},[g]),{items:n,dismiss:x=>{const y=o.current.get(x);y&&(clearTimeout(y),o.current.delete(x)),a(b=>b.filter(w=>w.id!==x))}}}function c5({children:n}){const{user:a,loading:s}=Pm(),o=Bn();return s?l.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):a?l.jsx(l.Fragment,{children:n}):l.jsx(Vh,{to:"/login",state:{from:o},replace:!0})}function u5(){const{items:n,dismiss:a}=i5();return l.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[l.jsx(TR,{}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsx(AD,{}),l.jsx("main",{className:"flex-1 overflow-auto p-6",children:l.jsxs(z0,{children:[l.jsx(Dn,{index:!0,element:l.jsx(cO,{})}),l.jsx(Dn,{path:"/providers",element:l.jsx(i4,{})}),l.jsx(Dn,{path:"/models",element:l.jsx(f4,{})}),l.jsx(Dn,{path:"/combos",element:l.jsx(h4,{})}),l.jsx(Dn,{path:"/aliases",element:l.jsx(p4,{})}),l.jsx(Dn,{path:"/api-keys",element:l.jsx(g4,{})}),l.jsx(Dn,{path:"/requests",element:l.jsx(y4,{})}),l.jsx(Dn,{path:"/statistics",element:l.jsx(J4,{})}),l.jsx(Dn,{path:"/audit",element:l.jsx(W4,{})}),l.jsx(Dn,{path:"/settings/*",element:l.jsx(t5,{})})]})})]}),l.jsx(a5,{items:n,onDismiss:a})]})}function d5({children:n}){const[a,s]=h.useState(null),o=Bn();return h.useEffect(()=>{pe.get("/api/admin/setup/status").then(c=>s(c.setupComplete)).catch(()=>s(!0))},[]),a===null?l.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):!a&&o.pathname!=="/setup"?l.jsx(Vh,{to:"/setup",replace:!0}):a&&o.pathname==="/setup"?l.jsx(Vh,{to:"/",replace:!0}):l.jsx(l.Fragment,{children:n})}function f5(){return l.jsx(dE,{children:l.jsx(d5,{children:l.jsxs(z0,{children:[l.jsx(Dn,{path:"/setup",element:l.jsx(oO,{})}),l.jsx(Dn,{path:"/login",element:l.jsx(lO,{})}),l.jsx(Dn,{path:"/*",element:l.jsx(c5,{children:l.jsx(u5,{})})})]})})})}const h5=sO;D2.createRoot(document.getElementById("root")).render(l.jsx(me.StrictMode,{children:l.jsx(UR,{defaultTheme:"dark",storageKey:"latedev-theme",children:l.jsxs(tg,{children:[l.jsx(eE,{children:l.jsx(f5,{})}),l.jsx(h5,{position:"top-right"})]})})}));
|