ldrouter 1.19.1 → 1.20.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.
@@ -0,0 +1,353 @@
1
+ var Oy=n=>{throw TypeError(n)};var _y=(n,a,l)=>a.has(n)||Oy("Cannot "+l);var hn=(n,a,l)=>(_y(n,a,"read from private field"),l?l.call(n):a.get(n)),ky=(n,a,l)=>a.has(n)?Oy("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,l),dh=(n,a,l,o)=>(_y(n,a,"write to private field"),o?o.call(n,l):a.set(n,l),l);function s2(n,a){for(var l=0;l<a.length;l++){const o=a[l];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 l(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=l(c);fetch(c.href,u)}})();function Em(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var fh={exports:{}},Vo={};/**
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 zy;function o2(){if(zy)return Vo;zy=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(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 Vo.Fragment=a,Vo.jsx=l,Vo.jsxs=l,Vo}var Ly;function i2(){return Ly||(Ly=1,fh.exports=o2()),fh.exports}var s=i2(),hh={exports:{}},_e={};/**
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 Uy;function c2(){if(Uy)return _e;Uy=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=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(k){return k===null||typeof k!="object"?null:(k=b&&k[b]||k["@@iterator"],typeof k=="function"?k:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function R(k,P,Z){this.props=k,this.context=P,this.refs=C,this.updater=Z||E}R.prototype.isReactComponent={},R.prototype.setState=function(k,P){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,P,"setState")},R.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function M(){}M.prototype=R.prototype;function T(k,P,Z){this.props=k,this.context=P,this.refs=C,this.updater=Z||E}var A=T.prototype=new M;A.constructor=T,j(A,R.prototype),A.isPureReactComponent=!0;var U=Array.isArray;function D(){}var B={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function V(k,P,Z){var le=Z.ref;return{$$typeof:n,type:k,key:P,ref:le!==void 0?le:null,props:Z}}function L(k,P){return V(k.type,P,k.props)}function J(k){return typeof k=="object"&&k!==null&&k.$$typeof===n}function G(k){var P={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(Z){return P[Z]})}var oe=/\/+/g;function ce(k,P){return typeof k=="object"&&k!==null&&k.key!=null?G(""+k.key):P.toString(36)}function ae(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(D,D):(k.status="pending",k.then(function(P){k.status==="pending"&&(k.status="fulfilled",k.value=P)},function(P){k.status==="pending"&&(k.status="rejected",k.reason=P)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function _(k,P,Z,le,de){var ve=typeof k;(ve==="undefined"||ve==="boolean")&&(k=null);var $=!1;if(k===null)$=!0;else switch(ve){case"bigint":case"string":case"number":$=!0;break;case"object":switch(k.$$typeof){case n:case a:$=!0;break;case x:return $=k._init,_($(k._payload),P,Z,le,de)}}if($)return de=de(k),$=le===""?"."+ce(k,0):le,U(de)?(Z="",$!=null&&(Z=$.replace(oe,"$&/")+"/"),_(de,P,Z,"",function(me){return me})):de!=null&&(J(de)&&(de=L(de,Z+(de.key==null||k&&k.key===de.key?"":(""+de.key).replace(oe,"$&/")+"/")+$)),P.push(de)),1;$=0;var ie=le===""?".":le+":";if(U(k))for(var he=0;he<k.length;he++)le=k[he],ve=ie+ce(le,he),$+=_(le,P,Z,ve,de);else if(he=w(k),typeof he=="function")for(k=he.call(k),he=0;!(le=k.next()).done;)le=le.value,ve=ie+ce(le,he++),$+=_(le,P,Z,ve,de);else if(ve==="object"){if(typeof k.then=="function")return _(ae(k),P,Z,le,de);throw P=String(k),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return $}function H(k,P,Z){if(k==null)return k;var le=[],de=0;return _(k,le,"","",function(ve){return P.call(Z,ve,de++)}),le}function X(k){if(k._status===-1){var P=k._result;P=P(),P.then(function(Z){(k._status===0||k._status===-1)&&(k._status=1,k._result=Z)},function(Z){(k._status===0||k._status===-1)&&(k._status=2,k._result=Z)}),k._status===-1&&(k._status=0,k._result=P)}if(k._status===1)return k._result.default;throw k._result}var W=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},te={map:H,forEach:function(k,P,Z){H(k,function(){P.apply(this,arguments)},Z)},count:function(k){var P=0;return H(k,function(){P++}),P},toArray:function(k){return H(k,function(P){return P})||[]},only:function(k){if(!J(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return _e.Activity=y,_e.Children=te,_e.Component=R,_e.Fragment=l,_e.Profiler=c,_e.PureComponent=T,_e.StrictMode=o,_e.Suspense=g,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,_e.__COMPILER_RUNTIME={__proto__:null,c:function(k){return B.H.useMemoCache(k)}},_e.cache=function(k){return function(){return k.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(k,P,Z){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var le=j({},k.props),de=k.key;if(P!=null)for(ve in P.key!==void 0&&(de=""+P.key),P)!O.call(P,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&P.ref===void 0||(le[ve]=P[ve]);var ve=arguments.length-2;if(ve===1)le.children=Z;else if(1<ve){for(var $=Array(ve),ie=0;ie<ve;ie++)$[ie]=arguments[ie+2];le.children=$}return V(k.type,de,le)},_e.createContext=function(k){return k={$$typeof:f,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:u,_context:k},k},_e.createElement=function(k,P,Z){var le,de={},ve=null;if(P!=null)for(le in P.key!==void 0&&(ve=""+P.key),P)O.call(P,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(de[le]=P[le]);var $=arguments.length-2;if($===1)de.children=Z;else if(1<$){for(var ie=Array($),he=0;he<$;he++)ie[he]=arguments[he+2];de.children=ie}if(k&&k.defaultProps)for(le in $=k.defaultProps,$)de[le]===void 0&&(de[le]=$[le]);return V(k,ve,de)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(k){return{$$typeof:p,render:k}},_e.isValidElement=J,_e.lazy=function(k){return{$$typeof:x,_payload:{_status:-1,_result:k},_init:X}},_e.memo=function(k,P){return{$$typeof:v,type:k,compare:P===void 0?null:P}},_e.startTransition=function(k){var P=B.T,Z={};B.T=Z;try{var le=k(),de=B.S;de!==null&&de(Z,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(D,W)}catch(ve){W(ve)}finally{P!==null&&Z.types!==null&&(P.types=Z.types),B.T=P}},_e.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},_e.use=function(k){return B.H.use(k)},_e.useActionState=function(k,P,Z){return B.H.useActionState(k,P,Z)},_e.useCallback=function(k,P){return B.H.useCallback(k,P)},_e.useContext=function(k){return B.H.useContext(k)},_e.useDebugValue=function(){},_e.useDeferredValue=function(k,P){return B.H.useDeferredValue(k,P)},_e.useEffect=function(k,P){return B.H.useEffect(k,P)},_e.useEffectEvent=function(k){return B.H.useEffectEvent(k)},_e.useId=function(){return B.H.useId()},_e.useImperativeHandle=function(k,P,Z){return B.H.useImperativeHandle(k,P,Z)},_e.useInsertionEffect=function(k,P){return B.H.useInsertionEffect(k,P)},_e.useLayoutEffect=function(k,P){return B.H.useLayoutEffect(k,P)},_e.useMemo=function(k,P){return B.H.useMemo(k,P)},_e.useOptimistic=function(k,P){return B.H.useOptimistic(k,P)},_e.useReducer=function(k,P,Z){return B.H.useReducer(k,P,Z)},_e.useRef=function(k){return B.H.useRef(k)},_e.useState=function(k){return B.H.useState(k)},_e.useSyncExternalStore=function(k,P,Z){return B.H.useSyncExternalStore(k,P,Z)},_e.useTransition=function(){return B.H.useTransition()},_e.version="19.2.8",_e}var By;function Rm(){return By||(By=1,hh.exports=c2()),hh.exports}var m=Rm();const ue=Em(m),Is=s2({__proto__:null,default:ue},[m]);var mh={exports:{}},$o={},ph={exports:{}},gh={};/**
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 Hy;function u2(){return Hy||(Hy=1,(function(n){function a(_,H){var X=_.length;_.push(H);e:for(;0<X;){var W=X-1>>>1,te=_[W];if(0<c(te,H))_[W]=H,_[X]=te,X=W;else break e}}function l(_){return _.length===0?null:_[0]}function o(_){if(_.length===0)return null;var H=_[0],X=_.pop();if(X!==H){_[0]=X;e:for(var W=0,te=_.length,k=te>>>1;W<k;){var P=2*(W+1)-1,Z=_[P],le=P+1,de=_[le];if(0>c(Z,X))le<te&&0>c(de,Z)?(_[W]=de,_[le]=X,W=le):(_[W]=Z,_[P]=X,W=P);else if(le<te&&0>c(de,X))_[W]=de,_[le]=X,W=le;else break e}}return H}function c(_,H){var X=_.sortIndex-H.sortIndex;return X!==0?X:_.id-H.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,E=!1,j=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(_){for(var H=l(v);H!==null;){if(H.callback===null)o(v);else if(H.startTime<=_)o(v),H.sortIndex=H.expirationTime,a(g,H);else break;H=l(v)}}function U(_){if(j=!1,A(_),!E)if(l(g)!==null)E=!0,D||(D=!0,G());else{var H=l(v);H!==null&&ae(U,H.startTime-_)}}var D=!1,B=-1,O=5,V=-1;function L(){return C?!0:!(n.unstable_now()-V<O)}function J(){if(C=!1,D){var _=n.unstable_now();V=_;var H=!0;try{e:{E=!1,j&&(j=!1,M(B),B=-1),w=!0;var X=b;try{t:{for(A(_),y=l(g);y!==null&&!(y.expirationTime>_&&L());){var W=y.callback;if(typeof W=="function"){y.callback=null,b=y.priorityLevel;var te=W(y.expirationTime<=_);if(_=n.unstable_now(),typeof te=="function"){y.callback=te,A(_),H=!0;break t}y===l(g)&&o(g),A(_)}else o(g);y=l(g)}if(y!==null)H=!0;else{var k=l(v);k!==null&&ae(U,k.startTime-_),H=!1}}break e}finally{y=null,b=X,w=!1}H=void 0}}finally{H?G():D=!1}}}var G;if(typeof T=="function")G=function(){T(J)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,ce=oe.port2;oe.port1.onmessage=J,G=function(){ce.postMessage(null)}}else G=function(){R(J,0)};function ae(_,H){B=R(function(){_(n.unstable_now())},H)}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(_){_.callback=null},n.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<_?Math.floor(1e3/_):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(_){switch(b){case 1:case 2:case 3:var H=3;break;default:H=b}var X=b;b=H;try{return _()}finally{b=X}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(_,H){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var X=b;b=_;try{return H()}finally{b=X}},n.unstable_scheduleCallback=function(_,H,X){var W=n.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?W+X:W):X=W,_){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=X+te,_={id:x++,callback:H,priorityLevel:_,startTime:X,expirationTime:te,sortIndex:-1},X>W?(_.sortIndex=X,a(v,_),l(g)===null&&_===l(v)&&(j?(M(B),B=-1):j=!0,ae(U,X-W))):(_.sortIndex=te,a(g,_),E||w||(E=!0,D||(D=!0,G()))),_},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(_){var H=b;return function(){var X=b;b=H;try{return _.apply(this,arguments)}finally{b=X}}}})(gh)),gh}var Iy;function d2(){return Iy||(Iy=1,ph.exports=u2()),ph.exports}var vh={exports:{}},mn={};/**
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 Py;function f2(){if(Py)return mn;Py=1;var n=Rm();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 l(){}var o={d:{f:l,r:function(){throw Error(a(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},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 mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,mn.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)},mn.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()}},mn.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))},mn.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},mn.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})}},mn.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)},mn.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})}},mn.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)},mn.requestFormReset=function(g){o.d.r(g)},mn.unstable_batchedUpdates=function(g,v){return g(v)},mn.useFormState=function(g,v,x){return f.H.useFormState(g,v,x)},mn.useFormStatus=function(){return f.H.useHostTransitionStatus()},mn.version="19.2.8",mn}var qy;function t0(){if(qy)return vh.exports;qy=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=f2(),vh.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 Vy;function h2(){if(Vy)return $o;Vy=1;var n=d2(),a=Rm(),l=t0();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 h=d.alternate;if(h===null){if(i=d.return,i!==null){r=i;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===r)return g(d),e;if(h===i)return g(d),t;h=h.sibling}throw Error(o(188))}if(r.return!==i.return)r=d,i=h;else{for(var S=!1,N=d.child;N;){if(N===r){S=!0,r=d,i=h;break}if(N===i){S=!0,i=d,r=h;break}N=N.sibling}if(!S){for(N=h.child;N;){if(N===r){S=!0,r=h,i=d;break}if(N===i){S=!0,i=h,r=d;break}N=N.sibling}if(!S)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"),E=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function G(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var oe=Symbol.for("react.client.reference");function ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case R:return"Profiler";case C:return"StrictMode";case U:return"Suspense";case D:return"SuspenseList";case V:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case T:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case A:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return t=e.displayName||null,t!==null?t:ce(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var ae=Array.isArray,_=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},W=[],te=-1;function k(e){return{current:e}}function P(e){0>te||(e.current=W[te],W[te]=null,te--)}function Z(e,t){te++,W[te]=e.current,e.current=t}var le=k(null),de=k(null),ve=k(null),$=k(null);function ie(e,t){switch(Z(ve,t),Z(de,e),Z(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ty(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ty(t),e=ny(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(le),Z(le,e)}function he(){P(le),P(de),P(ve)}function me(e){e.memoizedState!==null&&Z($,e);var t=le.current,r=ny(t,e.type);t!==r&&(Z(de,e),Z(le,r))}function Te(e){de.current===e&&(P(le),P(de)),$.current===e&&(P($),Ho._currentValue=X)}var je,De;function Xe(e){if(je===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||"",De=-1<r.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+je+e+De}var ze=!1;function Je(e,t){if(!e||ze)return"";ze=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Q){var K=Q}Reflect.construct(e,[],re)}else{try{re.call()}catch(Q){K=Q}e.call(re.prototype)}}else{try{throw Error()}catch(Q){K=Q}(re=e())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Q){if(Q&&K&&typeof Q.stack=="string")return[Q.stack,K.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 h=i.DetermineComponentFrameRoot(),S=h[0],N=h[1];if(S&&N){var z=S.split(`
44
+ `),F=N.split(`
45
+ `);for(d=i=0;i<z.length&&!z[i].includes("DetermineComponentFrameRoot");)i++;for(;d<F.length&&!F[d].includes("DetermineComponentFrameRoot");)d++;if(i===z.length||d===F.length)for(i=z.length-1,d=F.length-1;1<=i&&0<=d&&z[i]!==F[d];)d--;for(;1<=i&&0<=d;i--,d--)if(z[i]!==F[d]){if(i!==1||d!==1)do if(i--,d--,0>d||z[i]!==F[d]){var ee=`
46
+ `+z[i].replace(" at new "," at ");return e.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",e.displayName)),ee}while(1<=i&&0<=d);break}}}finally{ze=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Xe(r):""}function Mt(e,t){switch(e.tag){case 26:case 27:case 5:return Xe(e.type);case 16:return Xe("Lazy");case 13:return e.child!==t&&t!==null?Xe("Suspense Fallback"):Xe("Suspense");case 19:return Xe("SuspenseList");case 0:case 15:return Je(e.type,!1);case 11:return Je(e.type.render,!1);case 1:return Je(e.type,!0);case 31:return Xe("Activity");default:return""}}function gt(e){try{var t="",r=null;do t+=Mt(e,r),r=e,e=e.return;while(e);return t}catch(i){return`
47
+ Error generating stack: `+i.message+`
48
+ `+i.stack}}var ln=Object.prototype.hasOwnProperty,jt=n.unstable_scheduleCallback,Bt=n.unstable_cancelCallback,zt=n.unstable_shouldYield,yt=n.unstable_requestPaint,bt=n.unstable_now,sn=n.unstable_getCurrentPriorityLevel,At=n.unstable_ImmediatePriority,Dt=n.unstable_UserBlockingPriority,Wt=n.unstable_NormalPriority,Hn=n.unstable_LowPriority,In=n.unstable_IdlePriority,pn=n.log,Xa=n.unstable_setDisableYieldValue,se=null,Oe=null;function Qe(e){if(typeof pn=="function"&&Xa(e),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(se,e)}catch{}}var ot=Math.clz32?Math.clz32:$l,xa=Math.log,ka=Math.LN2;function $l(e){return e>>>=0,e===0?32:31-(xa(e)/ka|0)|0}var Qa=256,Dr=262144,Ct=4194304;function it(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 qt(e,t,r){var i=e.pendingLanes;if(i===0)return 0;var d=0,h=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var N=i&134217727;return N!==0?(i=N&~h,i!==0?d=it(i):(S&=N,S!==0?d=it(S):r||(r=N&~e,r!==0&&(d=it(r))))):(N=i&~h,N!==0?d=it(N):S!==0?d=it(S):r||(r=i&~e,r!==0&&(d=it(r)))),d===0?0:t!==0&&t!==d&&(t&h)===0&&(h=d&-d,r=t&-t,h>=r||h===32&&(r&4194048)!==0)?t:d}function Ee(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Le(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 Be(){var e=Ct;return Ct<<=1,(Ct&62914560)===0&&(Ct=4194304),e}function wt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ot(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dt(e,t,r,i,d,h){var S=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 N=e.entanglements,z=e.expirationTimes,F=e.hiddenUpdates;for(r=S&~r;0<r;){var ee=31-ot(r),re=1<<ee;N[ee]=0,z[ee]=-1;var K=F[ee];if(K!==null)for(F[ee]=null,ee=0;ee<K.length;ee++){var Q=K[ee];Q!==null&&(Q.lane&=-536870913)}r&=~re}i!==0&&Kt(e,i,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(S&~t))}function Kt(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-ot(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|r&261930}function Et(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-ot(r),d=1<<i;d&t|e[i]&t&&(e[i]|=t),r&=~d}}function Ht(e,t){var r=t&-t;return r=(r&42)!==0?1:Za(r),(r&(e.suspendedLanes|t))!==0?0:r}function Za(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 Ja(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ya(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Ey(e.type))}function Or(e,t){var r=H.p;try{return H.p=e,t()}finally{H.p=r}}var Zn=Math.random().toString(36).slice(2),on="__reactFiber$"+Zn,Sn="__reactProps$"+Zn,Yl="__reactContainer$"+Zn,td="__reactEvents$"+Zn,XS="__reactListeners$"+Zn,QS="__reactHandles$"+Zn,qp="__reactResources$"+Zn,Ws="__reactMarker$"+Zn;function nd(e){delete e[on],delete e[Sn],delete e[td],delete e[XS],delete e[QS]}function Gl(e){var t=e[on];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Yl]||r[on]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=cy(e);e!==null;){if(r=e[on])return r;e=cy(e)}return t}e=r,r=e.parentNode}return null}function Fl(e){if(e=e[on]||e[Yl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function eo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Kl(e){var t=e[qp];return t||(t=e[qp]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function en(e){e[Ws]=!0}var Vp=new Set,$p={};function pl(e,t){Xl(e,t),Xl(e+"Capture",t)}function Xl(e,t){for($p[e]=t,e=0;e<t.length;e++)Vp.add(t[e])}var ZS=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]*$"),Yp={},Gp={};function JS(e){return ln.call(Gp,e)?!0:ln.call(Yp,e)?!1:ZS.test(e)?Gp[e]=!0:(Yp[e]=!0,!1)}function Ei(e,t,r){if(JS(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 Ri(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 Wa(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 Jn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function WS(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,h=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(S){r=""+S,h.call(this,S)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(S){r=""+S},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ad(e){if(!e._valueTracker){var t=Fp(e)?"checked":"value";e._valueTracker=WS(e,t,""+e[t])}}function Kp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Fp(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Ni(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 ej=/[\n"\\]/g;function Wn(e){return e.replace(ej,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function rd(e,t,r,i,d,h,S,N){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),t!=null?S==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Jn(t)):e.value!==""+Jn(t)&&(e.value=""+Jn(t)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),t!=null?ld(e,S,Jn(t)):r!=null?ld(e,S,Jn(r)):i!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+Jn(N):e.removeAttribute("name")}function Xp(e,t,r,i,d,h,S,N){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){ad(e);return}r=r!=null?""+Jn(r):"",t=t!=null?""+Jn(t):r,N||t===e.value||(e.value=t),e.defaultValue=t}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=N?e.checked:!!i,e.defaultChecked=!!i,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),ad(e)}function ld(e,t,r){t==="number"&&Ni(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Ql(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=""+Jn(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 Qp(e,t,r){if(t!=null&&(t=""+Jn(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+Jn(r):""}function Zp(e,t,r,i){if(t==null){if(i!=null){if(r!=null)throw Error(o(92));if(ae(i)){if(1<i.length)throw Error(o(93));i=i[0]}r=i}r==null&&(r=""),t=r}r=Jn(t),e.defaultValue=r,i=e.textContent,i===r&&i!==""&&i!==null&&(e.value=i),ad(e)}function Zl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var tj=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 Jp(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||tj.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function Wp(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&&Jp(e,d,i)}else for(var h in t)t.hasOwnProperty(h)&&Jp(e,h,t[h])}function sd(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 nj=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"]]),aj=/^[\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 Ti(e){return aj.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function er(){}var od=null;function id(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jl=null,Wl=null;function eg(e){var t=Fl(e);if(t&&(e=t.stateNode)){var r=e[Sn]||null;e:switch(e=t.stateNode,t.type){case"input":if(rd(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="'+Wn(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var d=i[Sn]||null;if(!d)throw Error(o(90));rd(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&&Kp(i)}break e;case"textarea":Qp(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&Ql(e,!!r.multiple,t,!1)}}}var cd=!1;function tg(e,t,r){if(cd)return e(t,r);cd=!0;try{var i=e(t);return i}finally{if(cd=!1,(Jl!==null||Wl!==null)&&(pc(),Jl&&(t=Jl,e=Wl,Wl=Jl=null,eg(t),e)))for(t=0;t<e.length;t++)eg(e[t])}}function to(e,t){var r=e.stateNode;if(r===null)return null;var i=r[Sn]||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 tr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ud=!1;if(tr)try{var no={};Object.defineProperty(no,"passive",{get:function(){ud=!0}}),window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{ud=!1}var _r=null,dd=null,Mi=null;function ng(){if(Mi)return Mi;var e,t=dd,r=t.length,i,d="value"in _r?_r.value:_r.textContent,h=d.length;for(e=0;e<r&&t[e]===d[e];e++);var S=r-e;for(i=1;i<=S&&t[r-i]===d[h-i];i++);return Mi=d.slice(e,1<i?1-i:void 0)}function Ai(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 Di(){return!0}function ag(){return!1}function jn(e){function t(r,i,d,h,S){this._reactName=r,this._targetInst=d,this.type=i,this.nativeEvent=h,this.target=S,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(r=e[N],this[N]=r?r(h):h[N]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Di:ag,this.isPropagationStopped=ag,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=Di)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Di)},persist:function(){},isPersistent:Di}),t}var gl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oi=jn(gl),ao=y({},gl,{view:0,detail:0}),rj=jn(ao),fd,hd,ro,_i=y({},ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pd,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!==ro&&(ro&&e.type==="mousemove"?(fd=e.screenX-ro.screenX,hd=e.screenY-ro.screenY):hd=fd=0,ro=e),fd)},movementY:function(e){return"movementY"in e?e.movementY:hd}}),rg=jn(_i),lj=y({},_i,{dataTransfer:0}),sj=jn(lj),oj=y({},ao,{relatedTarget:0}),md=jn(oj),ij=y({},gl,{animationName:0,elapsedTime:0,pseudoElement:0}),cj=jn(ij),uj=y({},gl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dj=jn(uj),fj=y({},gl,{data:0}),lg=jn(fj),hj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mj={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"},pj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=pj[e])?!!t[e]:!1}function pd(){return gj}var vj=y({},ao,{key:function(e){if(e.key){var t=hj[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ai(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mj[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pd,charCode:function(e){return e.type==="keypress"?Ai(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ai(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),xj=jn(vj),yj=y({},_i,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sg=jn(yj),bj=y({},ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pd}),wj=jn(bj),Sj=y({},gl,{propertyName:0,elapsedTime:0,pseudoElement:0}),jj=jn(Sj),Cj=y({},_i,{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}),Ej=jn(Cj),Rj=y({},gl,{newState:0,oldState:0}),Nj=jn(Rj),Tj=[9,13,27,32],gd=tr&&"CompositionEvent"in window,lo=null;tr&&"documentMode"in document&&(lo=document.documentMode);var Mj=tr&&"TextEvent"in window&&!lo,og=tr&&(!gd||lo&&8<lo&&11>=lo),ig=" ",cg=!1;function ug(e,t){switch(e){case"keyup":return Tj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var es=!1;function Aj(e,t){switch(e){case"compositionend":return dg(t);case"keypress":return t.which!==32?null:(cg=!0,ig);case"textInput":return e=t.data,e===ig&&cg?null:e;default:return null}}function Dj(e,t){if(es)return e==="compositionend"||!gd&&ug(e,t)?(e=ng(),Mi=dd=_r=null,es=!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 og&&t.locale!=="ko"?null:t.data;default:return null}}var Oj={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 fg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Oj[e.type]:t==="textarea"}function hg(e,t,r,i){Jl?Wl?Wl.push(i):Wl=[i]:Jl=i,t=Sc(t,"onChange"),0<t.length&&(r=new Oi("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var so=null,oo=null;function _j(e){Xx(e,0)}function ki(e){var t=eo(e);if(Kp(t))return e}function mg(e,t){if(e==="change")return t}var pg=!1;if(tr){var vd;if(tr){var xd="oninput"in document;if(!xd){var gg=document.createElement("div");gg.setAttribute("oninput","return;"),xd=typeof gg.oninput=="function"}vd=xd}else vd=!1;pg=vd&&(!document.documentMode||9<document.documentMode)}function vg(){so&&(so.detachEvent("onpropertychange",xg),oo=so=null)}function xg(e){if(e.propertyName==="value"&&ki(oo)){var t=[];hg(t,oo,e,id(e)),tg(_j,t)}}function kj(e,t,r){e==="focusin"?(vg(),so=t,oo=r,so.attachEvent("onpropertychange",xg)):e==="focusout"&&vg()}function zj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ki(oo)}function Lj(e,t){if(e==="click")return ki(t)}function Uj(e,t){if(e==="input"||e==="change")return ki(t)}function Bj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pn=typeof Object.is=="function"?Object.is:Bj;function io(e,t){if(Pn(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(!ln.call(t,d)||!Pn(e[d],t[d]))return!1}return!0}function yg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bg(e,t){var r=yg(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=yg(r)}}function wg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ni(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=Ni(e.document)}return t}function yd(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 Hj=tr&&"documentMode"in document&&11>=document.documentMode,ts=null,bd=null,co=null,wd=!1;function jg(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;wd||ts==null||ts!==Ni(i)||(i=ts,"selectionStart"in i&&yd(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}),co&&io(co,i)||(co=i,i=Sc(bd,"onSelect"),0<i.length&&(t=new Oi("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=ts)))}function vl(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ns={animationend:vl("Animation","AnimationEnd"),animationiteration:vl("Animation","AnimationIteration"),animationstart:vl("Animation","AnimationStart"),transitionrun:vl("Transition","TransitionRun"),transitionstart:vl("Transition","TransitionStart"),transitioncancel:vl("Transition","TransitionCancel"),transitionend:vl("Transition","TransitionEnd")},Sd={},Cg={};tr&&(Cg=document.createElement("div").style,"AnimationEvent"in window||(delete ns.animationend.animation,delete ns.animationiteration.animation,delete ns.animationstart.animation),"TransitionEvent"in window||delete ns.transitionend.transition);function xl(e){if(Sd[e])return Sd[e];if(!ns[e])return e;var t=ns[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Cg)return Sd[e]=t[r];return e}var Eg=xl("animationend"),Rg=xl("animationiteration"),Ng=xl("animationstart"),Ij=xl("transitionrun"),Pj=xl("transitionstart"),qj=xl("transitioncancel"),Tg=xl("transitionend"),Mg=new Map,jd="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(" ");jd.push("scrollEnd");function ba(e,t){Mg.set(e,t),pl(t,[e])}var zi=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)},ea=[],as=0,Cd=0;function Li(){for(var e=as,t=Cd=as=0;t<e;){var r=ea[t];ea[t++]=null;var i=ea[t];ea[t++]=null;var d=ea[t];ea[t++]=null;var h=ea[t];if(ea[t++]=null,i!==null&&d!==null){var S=i.pending;S===null?d.next=d:(d.next=S.next,S.next=d),i.pending=d}h!==0&&Ag(r,d,h)}}function Ui(e,t,r,i){ea[as++]=e,ea[as++]=t,ea[as++]=r,ea[as++]=i,Cd|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Ed(e,t,r,i){return Ui(e,t,r,i),Bi(e)}function yl(e,t){return Ui(e,null,null,t),Bi(e)}function Ag(e,t,r){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r);for(var d=!1,h=e.return;h!==null;)h.childLanes|=r,i=h.alternate,i!==null&&(i.childLanes|=r),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&t!==null&&(d=31-ot(r),e=h.hiddenUpdates,i=e[d],i===null?e[d]=[t]:i.push(t),t.lane=r|536870912),h):null}function Bi(e){if(50<Oo)throw Oo=0,zf=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var rs={};function Vj(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 qn(e,t,r,i){return new Vj(e,t,r,i)}function Rd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nr(e,t){var r=e.alternate;return r===null?(r=qn(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 Dg(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 Hi(e,t,r,i,d,h){var S=0;if(i=e,typeof e=="function")Rd(e)&&(S=1);else if(typeof e=="string")S=KC(e,r,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case V:return e=qn(31,r,t,d),e.elementType=V,e.lanes=h,e;case j:return bl(r.children,d,h,t);case C:S=8,d|=24;break;case R:return e=qn(12,r,t,d|2),e.elementType=R,e.lanes=h,e;case U:return e=qn(13,r,t,d),e.elementType=U,e.lanes=h,e;case D:return e=qn(19,r,t,d),e.elementType=D,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:S=10;break e;case M:S=9;break e;case A:S=11;break e;case B:S=14;break e;case O:S=16,i=null;break e}S=29,r=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=qn(S,r,t,d),t.elementType=e,t.type=i,t.lanes=h,t}function bl(e,t,r,i){return e=qn(7,e,i,t),e.lanes=r,e}function Nd(e,t,r){return e=qn(6,e,null,t),e.lanes=r,e}function Og(e){var t=qn(18,null,null,0);return t.stateNode=e,t}function Td(e,t,r){return t=qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _g=new WeakMap;function ta(e,t){if(typeof e=="object"&&e!==null){var r=_g.get(e);return r!==void 0?r:(t={value:e,source:t,stack:gt(t)},_g.set(e,t),t)}return{value:e,source:t,stack:gt(t)}}var ls=[],ss=0,Ii=null,uo=0,na=[],aa=0,kr=null,za=1,La="";function ar(e,t){ls[ss++]=uo,ls[ss++]=Ii,Ii=e,uo=t}function kg(e,t,r){na[aa++]=za,na[aa++]=La,na[aa++]=kr,kr=e;var i=za;e=La;var d=32-ot(i)-1;i&=~(1<<d),r+=1;var h=32-ot(t)+d;if(30<h){var S=d-d%5;h=(i&(1<<S)-1).toString(32),i>>=S,d-=S,za=1<<32-ot(t)+d|r<<d|i,La=h+e}else za=1<<h|r<<d|i,La=e}function Md(e){e.return!==null&&(ar(e,1),kg(e,1,0))}function Ad(e){for(;e===Ii;)Ii=ls[--ss],ls[ss]=null,uo=ls[--ss],ls[ss]=null;for(;e===kr;)kr=na[--aa],na[aa]=null,La=na[--aa],na[aa]=null,za=na[--aa],na[aa]=null}function zg(e,t){na[aa++]=za,na[aa++]=La,na[aa++]=kr,za=t.id,La=t.overflow,kr=e}var cn=null,Rt=null,Ge=!1,zr=null,ra=!1,Dd=Error(o(519));function Lr(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fo(ta(t,e)),Dd}function Lg(e){var t=e.stateNode,r=e.type,i=e.memoizedProps;switch(t[on]=e,t[Sn]=i,r){case"dialog":qe("cancel",t),qe("close",t);break;case"iframe":case"object":case"embed":qe("load",t);break;case"video":case"audio":for(r=0;r<ko.length;r++)qe(ko[r],t);break;case"source":qe("error",t);break;case"img":case"image":case"link":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"input":qe("invalid",t),Xp(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),Zp(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||Wx(t.textContent,r)?(i.popover!=null&&(qe("beforetoggle",t),qe("toggle",t)),i.onScroll!=null&&qe("scroll",t),i.onScrollEnd!=null&&qe("scrollend",t),i.onClick!=null&&(t.onclick=er),t=!0):t=!1,t||Lr(e,!0)}function Ug(e){for(cn=e.return;cn;)switch(cn.tag){case 5:case 31:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:cn=cn.return}}function os(e){if(e!==cn)return!1;if(!Ge)return Ug(e),Ge=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Qf(e.type,e.memoizedProps)),r=!r),r&&Rt&&Lr(e),Ug(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Rt=iy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Rt=iy(e)}else t===27?(t=Rt,Qr(e.type)?(e=th,th=null,Rt=e):Rt=t):Rt=cn?sa(e.stateNode.nextSibling):null;return!0}function wl(){Rt=cn=null,Ge=!1}function Od(){var e=zr;return e!==null&&(Nn===null?Nn=e:Nn.push.apply(Nn,e),zr=null),e}function fo(e){zr===null?zr=[e]:zr.push(e)}var _d=k(null),Sl=null,rr=null;function Ur(e,t,r){Z(_d,t._currentValue),t._currentValue=r}function lr(e){e._currentValue=_d.current,P(_d)}function kd(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 zd(e,t,r,i){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var S=d.child;h=h.firstContext;e:for(;h!==null;){var N=h;h=d;for(var z=0;z<t.length;z++)if(N.context===t[z]){h.lanes|=r,N=h.alternate,N!==null&&(N.lanes|=r),kd(h.return,r,e),i||(S=null);break e}h=N.next}}else if(d.tag===18){if(S=d.return,S===null)throw Error(o(341));S.lanes|=r,h=S.alternate,h!==null&&(h.lanes|=r),kd(S,r,e),S=null}else S=d.child;if(S!==null)S.return=d;else for(S=d;S!==null;){if(S===e){S=null;break}if(d=S.sibling,d!==null){d.return=S.return,S=d;break}S=S.return}d=S}}function is(e,t,r,i){e=null;for(var d=t,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var S=d.alternate;if(S===null)throw Error(o(387));if(S=S.memoizedProps,S!==null){var N=d.type;Pn(d.pendingProps.value,S.value)||(e!==null?e.push(N):e=[N])}}else if(d===$.current){if(S=d.alternate,S===null)throw Error(o(387));S.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Ho):e=[Ho])}d=d.return}e!==null&&zd(t,e,r,i),t.flags|=262144}function Pi(e){for(e=e.firstContext;e!==null;){if(!Pn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function jl(e){Sl=e,rr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function un(e){return Bg(Sl,e)}function qi(e,t){return Sl===null&&jl(e),Bg(e,t)}function Bg(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},rr===null){if(e===null)throw Error(o(308));rr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else rr=rr.next=t;return r}var $j=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()})}},Yj=n.unstable_scheduleCallback,Gj=n.unstable_NormalPriority,Vt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ld(){return{controller:new $j,data:new Map,refCount:0}}function ho(e){e.refCount--,e.refCount===0&&Yj(Gj,function(){e.controller.abort()})}var mo=null,Ud=0,cs=0,us=null;function Fj(e,t){if(mo===null){var r=mo=[];Ud=0,cs=Pf(),us={status:"pending",value:void 0,then:function(i){r.push(i)}}}return Ud++,t.then(Hg,Hg),t}function Hg(){if(--Ud===0&&mo!==null){us!==null&&(us.status="fulfilled");var e=mo;mo=null,cs=0,us=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Kj(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 Ig=_.S;_.S=function(e,t){jx=bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Fj(e,t),Ig!==null&&Ig(e,t)};var Cl=k(null);function Bd(){var e=Cl.current;return e!==null?e:vt.pooledCache}function Vi(e,t){t===null?Z(Cl,Cl.current):Z(Cl,t.pool)}function Pg(){var e=Bd();return e===null?null:{parent:Vt._currentValue,pool:e}}var ds=Error(o(460)),Hd=Error(o(474)),$i=Error(o(542)),Yi={then:function(){}};function qg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Vg(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(er,er),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Yg(e),e;default:if(typeof t.status=="string")t.then(er,er);else{if(e=vt,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,Yg(e),e}throw Rl=t,ds}}function El(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Rl=r,ds):r}}var Rl=null;function $g(){if(Rl===null)throw Error(o(459));var e=Rl;return Rl=null,e}function Yg(e){if(e===ds||e===$i)throw Error(o(483))}var fs=null,po=0;function Gi(e){var t=po;return po+=1,fs===null&&(fs=[]),Vg(fs,e,t)}function go(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Fi(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 Gg(e){function t(q,I){if(e){var Y=q.deletions;Y===null?(q.deletions=[I],q.flags|=16):Y.push(I)}}function r(q,I){if(!e)return null;for(;I!==null;)t(q,I),I=I.sibling;return null}function i(q){for(var I=new Map;q!==null;)q.key!==null?I.set(q.key,q):I.set(q.index,q),q=q.sibling;return I}function d(q,I){return q=nr(q,I),q.index=0,q.sibling=null,q}function h(q,I,Y){return q.index=Y,e?(Y=q.alternate,Y!==null?(Y=Y.index,Y<I?(q.flags|=67108866,I):Y):(q.flags|=67108866,I)):(q.flags|=1048576,I)}function S(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function N(q,I,Y,ne){return I===null||I.tag!==6?(I=Nd(Y,q.mode,ne),I.return=q,I):(I=d(I,Y),I.return=q,I)}function z(q,I,Y,ne){var Re=Y.type;return Re===j?ee(q,I,Y.props.children,ne,Y.key):I!==null&&(I.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===O&&El(Re)===I.type)?(I=d(I,Y.props),go(I,Y),I.return=q,I):(I=Hi(Y.type,Y.key,Y.props,null,q.mode,ne),go(I,Y),I.return=q,I)}function F(q,I,Y,ne){return I===null||I.tag!==4||I.stateNode.containerInfo!==Y.containerInfo||I.stateNode.implementation!==Y.implementation?(I=Td(Y,q.mode,ne),I.return=q,I):(I=d(I,Y.children||[]),I.return=q,I)}function ee(q,I,Y,ne,Re){return I===null||I.tag!==7?(I=bl(Y,q.mode,ne,Re),I.return=q,I):(I=d(I,Y),I.return=q,I)}function re(q,I,Y){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=Nd(""+I,q.mode,Y),I.return=q,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case w:return Y=Hi(I.type,I.key,I.props,null,q.mode,Y),go(Y,I),Y.return=q,Y;case E:return I=Td(I,q.mode,Y),I.return=q,I;case O:return I=El(I),re(q,I,Y)}if(ae(I)||G(I))return I=bl(I,q.mode,Y,null),I.return=q,I;if(typeof I.then=="function")return re(q,Gi(I),Y);if(I.$$typeof===T)return re(q,qi(q,I),Y);Fi(q,I)}return null}function K(q,I,Y,ne){var Re=I!==null?I.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Re!==null?null:N(q,I,""+Y,ne);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return Y.key===Re?z(q,I,Y,ne):null;case E:return Y.key===Re?F(q,I,Y,ne):null;case O:return Y=El(Y),K(q,I,Y,ne)}if(ae(Y)||G(Y))return Re!==null?null:ee(q,I,Y,ne,null);if(typeof Y.then=="function")return K(q,I,Gi(Y),ne);if(Y.$$typeof===T)return K(q,I,qi(q,Y),ne);Fi(q,Y)}return null}function Q(q,I,Y,ne,Re){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return q=q.get(Y)||null,N(I,q,""+ne,Re);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:return q=q.get(ne.key===null?Y:ne.key)||null,z(I,q,ne,Re);case E:return q=q.get(ne.key===null?Y:ne.key)||null,F(I,q,ne,Re);case O:return ne=El(ne),Q(q,I,Y,ne,Re)}if(ae(ne)||G(ne))return q=q.get(Y)||null,ee(I,q,ne,Re,null);if(typeof ne.then=="function")return Q(q,I,Y,Gi(ne),Re);if(ne.$$typeof===T)return Q(q,I,Y,qi(I,ne),Re);Fi(I,ne)}return null}function ye(q,I,Y,ne){for(var Re=null,We=null,Se=I,He=I=0,Ye=null;Se!==null&&He<Y.length;He++){Se.index>He?(Ye=Se,Se=null):Ye=Se.sibling;var et=K(q,Se,Y[He],ne);if(et===null){Se===null&&(Se=Ye);break}e&&Se&&et.alternate===null&&t(q,Se),I=h(et,I,He),We===null?Re=et:We.sibling=et,We=et,Se=Ye}if(He===Y.length)return r(q,Se),Ge&&ar(q,He),Re;if(Se===null){for(;He<Y.length;He++)Se=re(q,Y[He],ne),Se!==null&&(I=h(Se,I,He),We===null?Re=Se:We.sibling=Se,We=Se);return Ge&&ar(q,He),Re}for(Se=i(Se);He<Y.length;He++)Ye=Q(Se,q,He,Y[He],ne),Ye!==null&&(e&&Ye.alternate!==null&&Se.delete(Ye.key===null?He:Ye.key),I=h(Ye,I,He),We===null?Re=Ye:We.sibling=Ye,We=Ye);return e&&Se.forEach(function(tl){return t(q,tl)}),Ge&&ar(q,He),Re}function Me(q,I,Y,ne){if(Y==null)throw Error(o(151));for(var Re=null,We=null,Se=I,He=I=0,Ye=null,et=Y.next();Se!==null&&!et.done;He++,et=Y.next()){Se.index>He?(Ye=Se,Se=null):Ye=Se.sibling;var tl=K(q,Se,et.value,ne);if(tl===null){Se===null&&(Se=Ye);break}e&&Se&&tl.alternate===null&&t(q,Se),I=h(tl,I,He),We===null?Re=tl:We.sibling=tl,We=tl,Se=Ye}if(et.done)return r(q,Se),Ge&&ar(q,He),Re;if(Se===null){for(;!et.done;He++,et=Y.next())et=re(q,et.value,ne),et!==null&&(I=h(et,I,He),We===null?Re=et:We.sibling=et,We=et);return Ge&&ar(q,He),Re}for(Se=i(Se);!et.done;He++,et=Y.next())et=Q(Se,q,He,et.value,ne),et!==null&&(e&&et.alternate!==null&&Se.delete(et.key===null?He:et.key),I=h(et,I,He),We===null?Re=et:We.sibling=et,We=et);return e&&Se.forEach(function(l2){return t(q,l2)}),Ge&&ar(q,He),Re}function mt(q,I,Y,ne){if(typeof Y=="object"&&Y!==null&&Y.type===j&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:e:{for(var Re=Y.key;I!==null;){if(I.key===Re){if(Re=Y.type,Re===j){if(I.tag===7){r(q,I.sibling),ne=d(I,Y.props.children),ne.return=q,q=ne;break e}}else if(I.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===O&&El(Re)===I.type){r(q,I.sibling),ne=d(I,Y.props),go(ne,Y),ne.return=q,q=ne;break e}r(q,I);break}else t(q,I);I=I.sibling}Y.type===j?(ne=bl(Y.props.children,q.mode,ne,Y.key),ne.return=q,q=ne):(ne=Hi(Y.type,Y.key,Y.props,null,q.mode,ne),go(ne,Y),ne.return=q,q=ne)}return S(q);case E:e:{for(Re=Y.key;I!==null;){if(I.key===Re)if(I.tag===4&&I.stateNode.containerInfo===Y.containerInfo&&I.stateNode.implementation===Y.implementation){r(q,I.sibling),ne=d(I,Y.children||[]),ne.return=q,q=ne;break e}else{r(q,I);break}else t(q,I);I=I.sibling}ne=Td(Y,q.mode,ne),ne.return=q,q=ne}return S(q);case O:return Y=El(Y),mt(q,I,Y,ne)}if(ae(Y))return ye(q,I,Y,ne);if(G(Y)){if(Re=G(Y),typeof Re!="function")throw Error(o(150));return Y=Re.call(Y),Me(q,I,Y,ne)}if(typeof Y.then=="function")return mt(q,I,Gi(Y),ne);if(Y.$$typeof===T)return mt(q,I,qi(q,Y),ne);Fi(q,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,I!==null&&I.tag===6?(r(q,I.sibling),ne=d(I,Y),ne.return=q,q=ne):(r(q,I),ne=Nd(Y,q.mode,ne),ne.return=q,q=ne),S(q)):r(q,I)}return function(q,I,Y,ne){try{po=0;var Re=mt(q,I,Y,ne);return fs=null,Re}catch(Se){if(Se===ds||Se===$i)throw Se;var We=qn(29,Se,null,q.mode);return We.lanes=ne,We.return=q,We}finally{}}}var Nl=Gg(!0),Fg=Gg(!1),Br=!1;function Id(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pd(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 Hr(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,(nt&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,t=Bi(e),Ag(e,null,r),t}return Ui(e,i,t,r),Bi(e)}function vo(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,Et(e,r)}}function qd(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var d=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var S={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?d=h=S:h=h.next=S,r=r.next}while(r!==null);h===null?d=h=t:h=h.next=t}else d=h=t;r={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:h,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 Vd=!1;function xo(){if(Vd){var e=us;if(e!==null)throw e}}function yo(e,t,r,i){Vd=!1;var d=e.updateQueue;Br=!1;var h=d.firstBaseUpdate,S=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var z=N,F=z.next;z.next=null,S===null?h=F:S.next=F,S=z;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,N=ee.lastBaseUpdate,N!==S&&(N===null?ee.firstBaseUpdate=F:N.next=F,ee.lastBaseUpdate=z))}if(h!==null){var re=d.baseState;S=0,ee=F=z=null,N=h;do{var K=N.lane&-536870913,Q=K!==N.lane;if(Q?($e&K)===K:(i&K)===K){K!==0&&K===cs&&(Vd=!0),ee!==null&&(ee=ee.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ye=e,Me=N;K=t;var mt=r;switch(Me.tag){case 1:if(ye=Me.payload,typeof ye=="function"){re=ye.call(mt,re,K);break e}re=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Me.payload,K=typeof ye=="function"?ye.call(mt,re,K):ye,K==null)break e;re=y({},re,K);break e;case 2:Br=!0}}K=N.callback,K!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=d.callbacks,Q===null?d.callbacks=[K]:Q.push(K))}else Q={lane:K,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ee===null?(F=ee=Q,z=re):ee=ee.next=Q,S|=K;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;Q=N,N=Q.next,Q.next=null,d.lastBaseUpdate=Q,d.shared.pending=null}}while(!0);ee===null&&(z=re),d.baseState=z,d.firstBaseUpdate=F,d.lastBaseUpdate=ee,h===null&&(d.shared.lanes=0),Yr|=S,e.lanes=S,e.memoizedState=re}}function Kg(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Xg(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Kg(r[e],t)}var hs=k(null),Ki=k(0);function Qg(e,t){e=mr,Z(Ki,e),Z(hs,t),mr=e|t.baseLanes}function $d(){Z(Ki,mr),Z(hs,hs.current)}function Yd(){mr=Ki.current,P(hs),P(Ki)}var Vn=k(null),la=null;function Pr(e){var t=e.alternate;Z(It,It.current&1),Z(Vn,e),la===null&&(t===null||hs.current!==null||t.memoizedState!==null)&&(la=e)}function Gd(e){Z(It,It.current),Z(Vn,e),la===null&&(la=e)}function Zg(e){e.tag===22?(Z(It,It.current),Z(Vn,e),la===null&&(la=e)):qr()}function qr(){Z(It,It.current),Z(Vn,Vn.current)}function $n(e){P(Vn),la===e&&(la=null),P(It)}var It=k(0);function Xi(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Wf(r)||eh(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 sr=0,Ue=null,ft=null,$t=null,Qi=!1,ms=!1,Tl=!1,Zi=0,bo=0,ps=null,Xj=0;function Lt(){throw Error(o(321))}function Fd(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Pn(e[r],t[r]))return!1;return!0}function Kd(e,t,r,i,d,h){return sr=h,Ue=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_.H=e===null||e.memoizedState===null?kv:uf,Tl=!1,h=r(i,d),Tl=!1,ms&&(h=Wg(t,r,i,d)),Jg(e),h}function Jg(e){_.H=jo;var t=ft!==null&&ft.next!==null;if(sr=0,$t=ft=Ue=null,Qi=!1,bo=0,ps=null,t)throw Error(o(300));e===null||Yt||(e=e.dependencies,e!==null&&Pi(e)&&(Yt=!0))}function Wg(e,t,r,i){Ue=e;var d=0;do{if(ms&&(ps=null),bo=0,ms=!1,25<=d)throw Error(o(301));if(d+=1,$t=ft=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}_.H=zv,h=t(r,i)}while(ms);return h}function Qj(){var e=_.H,t=e.useState()[0];return t=typeof t.then=="function"?wo(t):t,e=e.useState()[0],(ft!==null?ft.memoizedState:null)!==e&&(Ue.flags|=1024),t}function Xd(){var e=Zi!==0;return Zi=0,e}function Qd(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function Zd(e){if(Qi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qi=!1}sr=0,$t=ft=Ue=null,ms=!1,bo=Zi=0,ps=null}function gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Ue.memoizedState=$t=e:$t=$t.next=e,$t}function Pt(){if(ft===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var t=$t===null?Ue.memoizedState:$t.next;if(t!==null)$t=t,ft=e;else{if(e===null)throw Ue.alternate===null?Error(o(467)):Error(o(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},$t===null?Ue.memoizedState=$t=e:$t=$t.next=e}return $t}function Ji(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wo(e){var t=bo;return bo+=1,ps===null&&(ps=[]),e=Vg(ps,e,t),t=Ue,($t===null?t.memoizedState:$t.next)===null&&(t=t.alternate,_.H=t===null||t.memoizedState===null?kv:uf),e}function Wi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wo(e);if(e.$$typeof===T)return un(e)}throw Error(o(438,String(e)))}function Jd(e){var t=null,r=Ue.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var i=Ue.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=Ji(),Ue.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]=L;return t.index++,r}function or(e,t){return typeof t=="function"?t(e):t}function ec(e){var t=Pt();return Wd(t,ft,e)}function Wd(e,t,r){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=r;var d=e.baseQueue,h=i.pending;if(h!==null){if(d!==null){var S=d.next;d.next=h.next,h.next=S}t.baseQueue=d=h,i.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{t=d.next;var N=S=null,z=null,F=t,ee=!1;do{var re=F.lane&-536870913;if(re!==F.lane?($e&re)===re:(sr&re)===re){var K=F.revertLane;if(K===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),re===cs&&(ee=!0);else if((sr&K)===K){F=F.next,K===cs&&(ee=!0);continue}else re={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},z===null?(N=z=re,S=h):z=z.next=re,Ue.lanes|=K,Yr|=K;re=F.action,Tl&&r(h,re),h=F.hasEagerState?F.eagerState:r(h,re)}else K={lane:re,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},z===null?(N=z=K,S=h):z=z.next=K,Ue.lanes|=re,Yr|=re;F=F.next}while(F!==null&&F!==t);if(z===null?S=h:z.next=N,!Pn(h,e.memoizedState)&&(Yt=!0,ee&&(r=us,r!==null)))throw r;e.memoizedState=h,e.baseState=S,e.baseQueue=z,i.lastRenderedState=h}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function ef(e){var t=Pt(),r=t.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=e;var i=r.dispatch,d=r.pending,h=t.memoizedState;if(d!==null){r.pending=null;var S=d=d.next;do h=e(h,S.action),S=S.next;while(S!==d);Pn(h,t.memoizedState)||(Yt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),r.lastRenderedState=h}return[h,i]}function ev(e,t,r){var i=Ue,d=Pt(),h=Ge;if(h){if(r===void 0)throw Error(o(407));r=r()}else r=t();var S=!Pn((ft||d).memoizedState,r);if(S&&(d.memoizedState=r,Yt=!0),d=d.queue,af(av.bind(null,i,d,e),[e]),d.getSnapshot!==t||S||$t!==null&&$t.memoizedState.tag&1){if(i.flags|=2048,gs(9,{destroy:void 0},nv.bind(null,i,d,r,t),null),vt===null)throw Error(o(349));h||(sr&127)!==0||tv(i,t,r)}return r}function tv(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ue.updateQueue,t===null?(t=Ji(),Ue.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function nv(e,t,r,i){t.value=r,t.getSnapshot=i,rv(t)&&lv(e)}function av(e,t,r){return r(function(){rv(t)&&lv(e)})}function rv(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Pn(e,r)}catch{return!0}}function lv(e){var t=yl(e,2);t!==null&&Tn(t,e,2)}function tf(e){var t=gn();if(typeof e=="function"){var r=e;if(e=r(),Tl){Qe(!0);try{r()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:e},t}function sv(e,t,r,i){return e.baseState=r,Wd(e,ft,typeof i=="function"?i:or)}function Zj(e,t,r,i,d){if(ac(e))throw Error(o(485));if(e=t.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){h.listeners.push(S)}};_.T!==null?r(!0):h.isTransition=!1,i(h),r=t.pending,r===null?(h.next=t.pending=h,ov(t,h)):(h.next=r.next,t.pending=r.next=h)}}function ov(e,t){var r=t.action,i=t.payload,d=e.state;if(t.isTransition){var h=_.T,S={};_.T=S;try{var N=r(d,i),z=_.S;z!==null&&z(S,N),iv(e,t,N)}catch(F){nf(e,t,F)}finally{h!==null&&S.types!==null&&(h.types=S.types),_.T=h}}else try{h=r(d,i),iv(e,t,h)}catch(F){nf(e,t,F)}}function iv(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){cv(e,t,i)},function(i){return nf(e,t,i)}):cv(e,t,r)}function cv(e,t,r){t.status="fulfilled",t.value=r,uv(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,ov(e,r)))}function nf(e,t,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=r,uv(t),t=t.next;while(t!==i)}e.action=null}function uv(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function dv(e,t){return t}function fv(e,t){if(Ge){var r=vt.formState;if(r!==null){e:{var i=Ue;if(Ge){if(Rt){t:{for(var d=Rt,h=ra;d.nodeType!==8;){if(!h){d=null;break t}if(d=sa(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){Rt=sa(d.nextSibling),i=d.data==="F!";break e}}Lr(i)}i=!1}i&&(t=r[0])}}return r=gn(),r.memoizedState=r.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dv,lastRenderedState:t},r.queue=i,r=Dv.bind(null,Ue,i),i.dispatch=r,i=tf(!1),h=cf.bind(null,Ue,!1,i.queue),i=gn(),d={state:t,dispatch:null,action:e,pending:null},i.queue=d,r=Zj.bind(null,Ue,d,h,r),d.dispatch=r,i.memoizedState=e,[t,r,!1]}function hv(e){var t=Pt();return mv(t,ft,e)}function mv(e,t,r){if(t=Wd(e,t,dv)[0],e=ec(or)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=wo(t)}catch(S){throw S===ds?$i:S}else i=t;t=Pt();var d=t.queue,h=d.dispatch;return r!==t.memoizedState&&(Ue.flags|=2048,gs(9,{destroy:void 0},Jj.bind(null,d,r),null)),[i,h,e]}function Jj(e,t){e.action=t}function pv(e){var t=Pt(),r=ft;if(r!==null)return mv(t,r,e);Pt(),t=t.memoizedState,r=Pt();var i=r.queue.dispatch;return r.memoizedState=e,[t,i,!1]}function gs(e,t,r,i){return e={tag:e,create:r,deps:i,inst:t,next:null},t=Ue.updateQueue,t===null&&(t=Ji(),Ue.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 gv(){return Pt().memoizedState}function tc(e,t,r,i){var d=gn();Ue.flags|=e,d.memoizedState=gs(1|t,{destroy:void 0},r,i===void 0?null:i)}function nc(e,t,r,i){var d=Pt();i=i===void 0?null:i;var h=d.memoizedState.inst;ft!==null&&i!==null&&Fd(i,ft.memoizedState.deps)?d.memoizedState=gs(t,h,r,i):(Ue.flags|=e,d.memoizedState=gs(1|t,h,r,i))}function vv(e,t){tc(8390656,8,e,t)}function af(e,t){nc(2048,8,e,t)}function Wj(e){Ue.flags|=4;var t=Ue.updateQueue;if(t===null)t=Ji(),Ue.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function xv(e){var t=Pt().memoizedState;return Wj({ref:t,nextImpl:e}),function(){if((nt&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function yv(e,t){return nc(4,2,e,t)}function bv(e,t){return nc(4,4,e,t)}function wv(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 Sv(e,t,r){r=r!=null?r.concat([e]):null,nc(4,4,wv.bind(null,t,e),r)}function rf(){}function jv(e,t){var r=Pt();t=t===void 0?null:t;var i=r.memoizedState;return t!==null&&Fd(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Cv(e,t){var r=Pt();t=t===void 0?null:t;var i=r.memoizedState;if(t!==null&&Fd(t,i[1]))return i[0];if(i=e(),Tl){Qe(!0);try{e()}finally{Qe(!1)}}return r.memoizedState=[i,t],i}function lf(e,t,r){return r===void 0||(sr&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=Ex(),Ue.lanes|=e,Yr|=e,r)}function Ev(e,t,r,i){return Pn(r,t)?r:hs.current!==null?(e=lf(e,r,i),Pn(e,t)||(Yt=!0),e):(sr&42)===0||(sr&1073741824)!==0&&($e&261930)===0?(Yt=!0,e.memoizedState=r):(e=Ex(),Ue.lanes|=e,Yr|=e,t)}function Rv(e,t,r,i,d){var h=H.p;H.p=h!==0&&8>h?h:8;var S=_.T,N={};_.T=N,cf(e,!1,t,r);try{var z=d(),F=_.S;if(F!==null&&F(N,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ee=Kj(z,i);So(e,t,ee,Fn(e))}else So(e,t,i,Fn(e))}catch(re){So(e,t,{then:function(){},status:"rejected",reason:re},Fn())}finally{H.p=h,S!==null&&N.types!==null&&(S.types=N.types),_.T=S}}function eC(){}function sf(e,t,r,i){if(e.tag!==5)throw Error(o(476));var d=Nv(e).queue;Rv(e,d,t,X,r===null?eC:function(){return Tv(e),r(i)})}function Nv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:X},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Tv(e){var t=Nv(e);t.next===null&&(t=e.alternate.memoizedState),So(e,t.next.queue,{},Fn())}function of(){return un(Ho)}function Mv(){return Pt().memoizedState}function Av(){return Pt().memoizedState}function tC(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=Fn();e=Hr(r);var i=Ir(t,e,r);i!==null&&(Tn(i,t,r),vo(i,t,r)),t={cache:Ld()},e.payload=t;return}t=t.return}}function nC(e,t,r){var i=Fn();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ac(e)?Ov(t,r):(r=Ed(e,t,r,i),r!==null&&(Tn(r,e,i),_v(r,t,i)))}function Dv(e,t,r){var i=Fn();So(e,t,r,i)}function So(e,t,r,i){var d={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(ac(e))Ov(t,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var S=t.lastRenderedState,N=h(S,r);if(d.hasEagerState=!0,d.eagerState=N,Pn(N,S))return Ui(e,t,d,0),vt===null&&Li(),!1}catch{}finally{}if(r=Ed(e,t,d,i),r!==null)return Tn(r,e,i),_v(r,t,i),!0}return!1}function cf(e,t,r,i){if(i={lane:2,revertLane:Pf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(o(479))}else t=Ed(e,r,i,2),t!==null&&Tn(t,e,2)}function ac(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Ov(e,t){ms=Qi=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function _v(e,t,r){if((r&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Et(e,r)}}var jo={readContext:un,use:Wi,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};jo.useEffectEvent=Lt;var kv={readContext:un,use:Wi,useCallback:function(e,t){return gn().memoizedState=[e,t===void 0?null:t],e},useContext:un,useEffect:vv,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,tc(4194308,4,wv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return tc(4194308,4,e,t)},useInsertionEffect:function(e,t){tc(4,2,e,t)},useMemo:function(e,t){var r=gn();t=t===void 0?null:t;var i=e();if(Tl){Qe(!0);try{e()}finally{Qe(!1)}}return r.memoizedState=[i,t],i},useReducer:function(e,t,r){var i=gn();if(r!==void 0){var d=r(t);if(Tl){Qe(!0);try{r(t)}finally{Qe(!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=nC.bind(null,Ue,e),[i.memoizedState,e]},useRef:function(e){var t=gn();return e={current:e},t.memoizedState=e},useState:function(e){e=tf(e);var t=e.queue,r=Dv.bind(null,Ue,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:rf,useDeferredValue:function(e,t){var r=gn();return lf(r,e,t)},useTransition:function(){var e=tf(!1);return e=Rv.bind(null,Ue,e.queue,!0,!1),gn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var i=Ue,d=gn();if(Ge){if(r===void 0)throw Error(o(407));r=r()}else{if(r=t(),vt===null)throw Error(o(349));($e&127)!==0||tv(i,t,r)}d.memoizedState=r;var h={value:r,getSnapshot:t};return d.queue=h,vv(av.bind(null,i,h,e),[e]),i.flags|=2048,gs(9,{destroy:void 0},nv.bind(null,i,h,r,t),null),r},useId:function(){var e=gn(),t=vt.identifierPrefix;if(Ge){var r=La,i=za;r=(i&~(1<<32-ot(i)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Zi++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=Xj++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:of,useFormState:fv,useActionState:fv,useOptimistic:function(e){var t=gn();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=cf.bind(null,Ue,!0,r),r.dispatch=t,[e,t]},useMemoCache:Jd,useCacheRefresh:function(){return gn().memoizedState=tC.bind(null,Ue)},useEffectEvent:function(e){var t=gn(),r={impl:e};return t.memoizedState=r,function(){if((nt&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}},uf={readContext:un,use:Wi,useCallback:jv,useContext:un,useEffect:af,useImperativeHandle:Sv,useInsertionEffect:yv,useLayoutEffect:bv,useMemo:Cv,useReducer:ec,useRef:gv,useState:function(){return ec(or)},useDebugValue:rf,useDeferredValue:function(e,t){var r=Pt();return Ev(r,ft.memoizedState,e,t)},useTransition:function(){var e=ec(or)[0],t=Pt().memoizedState;return[typeof e=="boolean"?e:wo(e),t]},useSyncExternalStore:ev,useId:Mv,useHostTransitionStatus:of,useFormState:hv,useActionState:hv,useOptimistic:function(e,t){var r=Pt();return sv(r,ft,e,t)},useMemoCache:Jd,useCacheRefresh:Av};uf.useEffectEvent=xv;var zv={readContext:un,use:Wi,useCallback:jv,useContext:un,useEffect:af,useImperativeHandle:Sv,useInsertionEffect:yv,useLayoutEffect:bv,useMemo:Cv,useReducer:ef,useRef:gv,useState:function(){return ef(or)},useDebugValue:rf,useDeferredValue:function(e,t){var r=Pt();return ft===null?lf(r,e,t):Ev(r,ft.memoizedState,e,t)},useTransition:function(){var e=ef(or)[0],t=Pt().memoizedState;return[typeof e=="boolean"?e:wo(e),t]},useSyncExternalStore:ev,useId:Mv,useHostTransitionStatus:of,useFormState:pv,useActionState:pv,useOptimistic:function(e,t){var r=Pt();return ft!==null?sv(r,ft,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Jd,useCacheRefresh:Av};zv.useEffectEvent=xv;function df(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 ff={enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Fn(),d=Hr(i);d.payload=t,r!=null&&(d.callback=r),t=Ir(e,d,i),t!==null&&(Tn(t,e,i),vo(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Fn(),d=Hr(i);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=Ir(e,d,i),t!==null&&(Tn(t,e,i),vo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Fn(),i=Hr(r);i.tag=2,t!=null&&(i.callback=t),t=Ir(e,i,r),t!==null&&(Tn(t,e,r),vo(t,e,r))}};function Lv(e,t,r,i,d,h,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,S):t.prototype&&t.prototype.isPureReactComponent?!io(r,i)||!io(d,h):!0}function Uv(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&&ff.enqueueReplaceState(t,t.state,null)}function Ml(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 Bv(e){zi(e)}function Hv(e){console.error(e)}function Iv(e){zi(e)}function rc(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Pv(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 hf(e,t,r){return r=Hr(r),r.tag=3,r.payload={element:null},r.callback=function(){rc(e,t)},r}function qv(e){return e=Hr(e),e.tag=3,e}function Vv(e,t,r,i){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var h=i.value;e.payload=function(){return d(h)},e.callback=function(){Pv(t,r,i)}}var S=r.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){Pv(t,r,i),typeof d!="function"&&(Gr===null?Gr=new Set([this]):Gr.add(this));var N=i.stack;this.componentDidCatch(i.value,{componentStack:N!==null?N:""})})}function aC(e,t,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=r.alternate,t!==null&&is(t,r,d,!0),r=Vn.current,r!==null){switch(r.tag){case 31:case 13:return la===null?gc():r.alternate===null&&Ut===0&&(Ut=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===Yi?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([i]):t.add(i),Bf(e,i,d)),!1;case 22:return r.flags|=65536,i===Yi?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)),Bf(e,i,d)),!1}throw Error(o(435,r.tag))}return Bf(e,i,d),gc(),!1}if(Ge)return t=Vn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,i!==Dd&&(e=Error(o(422),{cause:i}),fo(ta(e,r)))):(i!==Dd&&(t=Error(o(423),{cause:i}),fo(ta(t,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=ta(i,r),d=hf(e.stateNode,i,d),qd(e,d),Ut!==4&&(Ut=2)),!1;var h=Error(o(520),{cause:i});if(h=ta(h,r),Do===null?Do=[h]:Do.push(h),Ut!==4&&(Ut=2),t===null)return!0;i=ta(i,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=hf(r.stateNode,i,e),qd(r,e),!1;case 1:if(t=r.type,h=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Gr===null||!Gr.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=qv(d),Vv(d,e,r,i),qd(r,d),!1}r=r.return}while(r!==null);return!1}var mf=Error(o(461)),Yt=!1;function dn(e,t,r,i){t.child=e===null?Fg(t,null,r,i):Nl(t,e.child,r,i)}function $v(e,t,r,i,d){r=r.render;var h=t.ref;if("ref"in i){var S={};for(var N in i)N!=="ref"&&(S[N]=i[N])}else S=i;return jl(t),i=Kd(e,t,r,S,h,d),N=Xd(),e!==null&&!Yt?(Qd(e,t,d),ir(e,t,d)):(Ge&&N&&Md(t),t.flags|=1,dn(e,t,i,d),t.child)}function Yv(e,t,r,i,d){if(e===null){var h=r.type;return typeof h=="function"&&!Rd(h)&&h.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=h,Gv(e,t,h,i,d)):(e=Hi(r.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Sf(e,d)){var S=h.memoizedProps;if(r=r.compare,r=r!==null?r:io,r(S,i)&&e.ref===t.ref)return ir(e,t,d)}return t.flags|=1,e=nr(h,i),e.ref=t.ref,e.return=t,t.child=e}function Gv(e,t,r,i,d){if(e!==null){var h=e.memoizedProps;if(io(h,i)&&e.ref===t.ref)if(Yt=!1,t.pendingProps=i=h,Sf(e,d))(e.flags&131072)!==0&&(Yt=!0);else return t.lanes=e.lanes,ir(e,t,d)}return pf(e,t,r,i,d)}function Fv(e,t,r,i){var d=i.children,h=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(h=h!==null?h.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&~h}else i=0,t.child=null;return Kv(e,t,h,r,i)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Vi(t,h!==null?h.cachePool:null),h!==null?Qg(t,h):$d(),Zg(t);else return i=t.lanes=536870912,Kv(e,t,h!==null?h.baseLanes|r:r,r,i)}else h!==null?(Vi(t,h.cachePool),Qg(t,h),qr(),t.memoizedState=null):(e!==null&&Vi(t,null),$d(),qr());return dn(e,t,d,r),t.child}function Co(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kv(e,t,r,i,d){var h=Bd();return h=h===null?null:{parent:Vt._currentValue,pool:h},t.memoizedState={baseLanes:r,cachePool:h},e!==null&&Vi(t,null),$d(),Zg(t),e!==null&&is(e,t,i,!0),t.childLanes=d,null}function lc(e,t){return t=oc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xv(e,t,r){return Nl(t,e.child,null,r),e=lc(t,t.pendingProps),e.flags|=2,$n(t),t.memoizedState=null,e}function rC(e,t,r){var i=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(i.mode==="hidden")return e=lc(t,i),t.lanes=536870912,Co(null,e);if(Gd(t),(e=Rt)?(e=oy(e,ra),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:kr!==null?{id:za,overflow:La}:null,retryLane:536870912,hydrationErrors:null},r=Og(e),r.return=t,t.child=r,cn=t,Rt=null)):e=null,e===null)throw Lr(t);return t.lanes=536870912,null}return lc(t,i)}var h=e.memoizedState;if(h!==null){var S=h.dehydrated;if(Gd(t),d)if(t.flags&256)t.flags&=-257,t=Xv(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Yt||is(e,t,r,!1),d=(r&e.childLanes)!==0,Yt||d){if(i=vt,i!==null&&(S=Ht(i,r),S!==0&&S!==h.retryLane))throw h.retryLane=S,yl(e,S),Tn(i,e,S),mf;gc(),t=Xv(e,t,r)}else e=h.treeContext,Rt=sa(S.nextSibling),cn=t,Ge=!0,zr=null,ra=!1,e!==null&&zg(t,e),t=lc(t,i),t.flags|=4096;return t}return e=nr(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(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 pf(e,t,r,i,d){return jl(t),r=Kd(e,t,r,i,void 0,d),i=Xd(),e!==null&&!Yt?(Qd(e,t,d),ir(e,t,d)):(Ge&&i&&Md(t),t.flags|=1,dn(e,t,r,d),t.child)}function Qv(e,t,r,i,d,h){return jl(t),t.updateQueue=null,r=Wg(t,i,r,d),Jg(e),i=Xd(),e!==null&&!Yt?(Qd(e,t,h),ir(e,t,h)):(Ge&&i&&Md(t),t.flags|=1,dn(e,t,r,h),t.child)}function Zv(e,t,r,i,d){if(jl(t),t.stateNode===null){var h=rs,S=r.contextType;typeof S=="object"&&S!==null&&(h=un(S)),h=new r(i,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=ff,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=i,h.state=t.memoizedState,h.refs={},Id(t),S=r.contextType,h.context=typeof S=="object"&&S!==null?un(S):rs,h.state=t.memoizedState,S=r.getDerivedStateFromProps,typeof S=="function"&&(df(t,r,S,i),h.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(S=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),S!==h.state&&ff.enqueueReplaceState(h,h.state,null),yo(t,i,h,d),xo(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){h=t.stateNode;var N=t.memoizedProps,z=Ml(r,N);h.props=z;var F=h.context,ee=r.contextType;S=rs,typeof ee=="object"&&ee!==null&&(S=un(ee));var re=r.getDerivedStateFromProps;ee=typeof re=="function"||typeof h.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,ee||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(N||F!==S)&&Uv(t,h,i,S),Br=!1;var K=t.memoizedState;h.state=K,yo(t,i,h,d),xo(),F=t.memoizedState,N||K!==F||Br?(typeof re=="function"&&(df(t,r,re,i),F=t.memoizedState),(z=Br||Lv(t,r,z,i,K,F,S))?(ee||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=F),h.props=i,h.state=F,h.context=S,i=z):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{h=t.stateNode,Pd(e,t),S=t.memoizedProps,ee=Ml(r,S),h.props=ee,re=t.pendingProps,K=h.context,F=r.contextType,z=rs,typeof F=="object"&&F!==null&&(z=un(F)),N=r.getDerivedStateFromProps,(F=typeof N=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S!==re||K!==z)&&Uv(t,h,i,z),Br=!1,K=t.memoizedState,h.state=K,yo(t,i,h,d),xo();var Q=t.memoizedState;S!==re||K!==Q||Br||e!==null&&e.dependencies!==null&&Pi(e.dependencies)?(typeof N=="function"&&(df(t,r,N,i),Q=t.memoizedState),(ee=Br||Lv(t,r,ee,i,K,Q,z)||e!==null&&e.dependencies!==null&&Pi(e.dependencies))?(F||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(i,Q,z),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(i,Q,z)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=Q),h.props=i,h.state=Q,h.context=z,i=ee):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),i=!1)}return h=i,sc(e,t),i=(t.flags&128)!==0,h||i?(h=t.stateNode,r=i&&typeof r.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&i?(t.child=Nl(t,e.child,null,d),t.child=Nl(t,null,r,d)):dn(e,t,r,d),t.memoizedState=h.state,e=t.child):e=ir(e,t,d),e}function Jv(e,t,r,i){return wl(),t.flags|=256,dn(e,t,r,i),t.child}var gf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vf(e){return{baseLanes:e,cachePool:Pg()}}function xf(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=Gn),e}function Wv(e,t,r){var i=t.pendingProps,d=!1,h=(t.flags&128)!==0,S;if((S=h)||(S=e!==null&&e.memoizedState===null?!1:(It.current&2)!==0),S&&(d=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(d?Pr(t):qr(),(e=Rt)?(e=oy(e,ra),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:kr!==null?{id:za,overflow:La}:null,retryLane:536870912,hydrationErrors:null},r=Og(e),r.return=t,t.child=r,cn=t,Rt=null)):e=null,e===null)throw Lr(t);return eh(e)?t.lanes=32:t.lanes=536870912,null}var N=i.children;return i=i.fallback,d?(qr(),d=t.mode,N=oc({mode:"hidden",children:N},d),i=bl(i,d,r,null),N.return=t,i.return=t,N.sibling=i,t.child=N,i=t.child,i.memoizedState=vf(r),i.childLanes=xf(e,S,r),t.memoizedState=gf,Co(null,i)):(Pr(t),yf(t,N))}var z=e.memoizedState;if(z!==null&&(N=z.dehydrated,N!==null)){if(h)t.flags&256?(Pr(t),t.flags&=-257,t=bf(e,t,r)):t.memoizedState!==null?(qr(),t.child=e.child,t.flags|=128,t=null):(qr(),N=i.fallback,d=t.mode,i=oc({mode:"visible",children:i.children},d),N=bl(N,d,r,null),N.flags|=2,i.return=t,N.return=t,i.sibling=N,t.child=i,Nl(t,e.child,null,r),i=t.child,i.memoizedState=vf(r),i.childLanes=xf(e,S,r),t.memoizedState=gf,t=Co(null,i));else if(Pr(t),eh(N)){if(S=N.nextSibling&&N.nextSibling.dataset,S)var F=S.dgst;S=F,i=Error(o(419)),i.stack="",i.digest=S,fo({value:i,source:null,stack:null}),t=bf(e,t,r)}else if(Yt||is(e,t,r,!1),S=(r&e.childLanes)!==0,Yt||S){if(S=vt,S!==null&&(i=Ht(S,r),i!==0&&i!==z.retryLane))throw z.retryLane=i,yl(e,i),Tn(S,e,i),mf;Wf(N)||gc(),t=bf(e,t,r)}else Wf(N)?(t.flags|=192,t.child=e.child,t=null):(e=z.treeContext,Rt=sa(N.nextSibling),cn=t,Ge=!0,zr=null,ra=!1,e!==null&&zg(t,e),t=yf(t,i.children),t.flags|=4096);return t}return d?(qr(),N=i.fallback,d=t.mode,z=e.child,F=z.sibling,i=nr(z,{mode:"hidden",children:i.children}),i.subtreeFlags=z.subtreeFlags&65011712,F!==null?N=nr(F,N):(N=bl(N,d,r,null),N.flags|=2),N.return=t,i.return=t,i.sibling=N,t.child=i,Co(null,i),i=t.child,N=e.child.memoizedState,N===null?N=vf(r):(d=N.cachePool,d!==null?(z=Vt._currentValue,d=d.parent!==z?{parent:z,pool:z}:d):d=Pg(),N={baseLanes:N.baseLanes|r,cachePool:d}),i.memoizedState=N,i.childLanes=xf(e,S,r),t.memoizedState=gf,Co(e.child,i)):(Pr(t),r=e.child,e=r.sibling,r=nr(r,{mode:"visible",children:i.children}),r.return=t,r.sibling=null,e!==null&&(S=t.deletions,S===null?(t.deletions=[e],t.flags|=16):S.push(e)),t.child=r,t.memoizedState=null,r)}function yf(e,t){return t=oc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function oc(e,t){return e=qn(22,e,null,t),e.lanes=0,e}function bf(e,t,r){return Nl(t,e.child,null,r),e=yf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ex(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),kd(e.return,t,r)}function wf(e,t,r,i,d,h){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:d,treeForkCount:h}:(S.isBackwards=t,S.rendering=null,S.renderingStartTime=0,S.last=i,S.tail=r,S.tailMode=d,S.treeForkCount=h)}function tx(e,t,r){var i=t.pendingProps,d=i.revealOrder,h=i.tail;i=i.children;var S=It.current,N=(S&2)!==0;if(N?(S=S&1|2,t.flags|=128):S&=1,Z(It,S),dn(e,t,i,r),i=Ge?uo:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ex(e,r,t);else if(e.tag===19)ex(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&&Xi(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=t.child,t.child=null):(d=r.sibling,r.sibling=null),wf(t,!1,d,r,h,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&&Xi(e)===null){t.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}wf(t,!0,r,null,h,i);break;case"together":wf(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function ir(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Yr|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(is(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=nr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=nr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Sf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Pi(e)))}function lC(e,t,r){switch(t.tag){case 3:ie(t,t.stateNode.containerInfo),Ur(t,Vt,e.memoizedState.cache),wl();break;case 27:case 5:me(t);break;case 4:ie(t,t.stateNode.containerInfo);break;case 10:Ur(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Gd(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?Wv(e,t,r):(Pr(t),e=ir(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||(is(e,t,r,!1),i=(r&t.childLanes)!==0),d){if(i)return tx(e,t,r);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Z(It,It.current),i)break;return null;case 22:return t.lanes=0,Fv(e,t,r,t.pendingProps);case 24:Ur(t,Vt,e.memoizedState.cache)}return ir(e,t,r)}function nx(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Yt=!0;else{if(!Sf(e,r)&&(t.flags&128)===0)return Yt=!1,lC(e,t,r);Yt=(e.flags&131072)!==0}else Yt=!1,Ge&&(t.flags&1048576)!==0&&kg(t,uo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=El(t.elementType),t.type=e,typeof e=="function")Rd(e)?(i=Ml(e,i),t.tag=1,t=Zv(null,t,e,i,r)):(t.tag=0,t=pf(null,t,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===A){t.tag=11,t=$v(null,t,e,i,r);break e}else if(d===B){t.tag=14,t=Yv(null,t,e,i,r);break e}}throw t=ce(e)||e,Error(o(306,t,""))}}return t;case 0:return pf(e,t,t.type,t.pendingProps,r);case 1:return i=t.type,d=Ml(i,t.pendingProps),Zv(e,t,i,d,r);case 3:e:{if(ie(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var h=t.memoizedState;d=h.element,Pd(e,t),yo(t,i,null,r);var S=t.memoizedState;if(i=S.cache,Ur(t,Vt,i),i!==h.cache&&zd(t,[Vt],r,!0),xo(),i=S.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:S.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=Jv(e,t,i,r);break e}else if(i!==d){d=ta(Error(o(424)),t),fo(d),t=Jv(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(Rt=sa(e.firstChild),cn=t,Ge=!0,zr=null,ra=!0,r=Fg(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(wl(),i===d){t=ir(e,t,r);break e}dn(e,t,i,r)}t=t.child}return t;case 26:return sc(e,t),e===null?(r=hy(t.type,null,t.pendingProps,null))?t.memoizedState=r:Ge||(r=t.type,e=t.pendingProps,i=jc(ve.current).createElement(r),i[on]=t,i[Sn]=e,fn(i,r,e),en(i),t.stateNode=i):t.memoizedState=hy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return me(t),e===null&&Ge&&(i=t.stateNode=uy(t.type,t.pendingProps,ve.current),cn=t,ra=!0,d=Rt,Qr(t.type)?(th=d,Rt=sa(i.firstChild)):Rt=d),dn(e,t,t.pendingProps.children,r),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((d=i=Rt)&&(i=zC(i,t.type,t.pendingProps,ra),i!==null?(t.stateNode=i,cn=t,Rt=sa(i.firstChild),ra=!1,d=!0):d=!1),d||Lr(t)),me(t),d=t.type,h=t.pendingProps,S=e!==null?e.memoizedProps:null,i=h.children,Qf(d,h)?i=null:S!==null&&Qf(d,S)&&(t.flags|=32),t.memoizedState!==null&&(d=Kd(e,t,Qj,null,null,r),Ho._currentValue=d),sc(e,t),dn(e,t,i,r),t.child;case 6:return e===null&&Ge&&((e=r=Rt)&&(r=LC(r,t.pendingProps,ra),r!==null?(t.stateNode=r,cn=t,Rt=null,e=!0):e=!1),e||Lr(t)),null;case 13:return Wv(e,t,r);case 4:return ie(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Nl(t,null,i,r):dn(e,t,i,r),t.child;case 11:return $v(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,Ur(t,t.type,i.value),dn(e,t,i.children,r),t.child;case 9:return d=t.type._context,i=t.pendingProps.children,jl(t),d=un(d),i=i(d),t.flags|=1,dn(e,t,i,r),t.child;case 14:return Yv(e,t,t.type,t.pendingProps,r);case 15:return Gv(e,t,t.type,t.pendingProps,r);case 19:return tx(e,t,r);case 31:return rC(e,t,r);case 22:return Fv(e,t,r,t.pendingProps);case 24:return jl(t),i=un(Vt),e===null?(d=Bd(),d===null&&(d=vt,h=Ld(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),t.memoizedState={parent:i,cache:d},Id(t),Ur(t,Vt,d)):((e.lanes&r)!==0&&(Pd(e,t),yo(t,null,null,r),xo()),d=e.memoizedState,h=t.memoizedState,d.parent!==i?(d={parent:i,cache:i},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),Ur(t,Vt,i)):(i=h.cache,Ur(t,Vt,i),i!==d.cache&&zd(t,[Vt],r,!0))),dn(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function cr(e){e.flags|=4}function jf(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(Mx())e.flags|=8192;else throw Rl=Yi,Hd}else e.flags&=-16777217}function ax(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!xy(t))if(Mx())e.flags|=8192;else throw Rl=Yi,Hd}function ic(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Be():536870912,e.lanes|=t,bs|=t)}function Eo(e,t){if(!Ge)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 Nt(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 sC(e,t,r){var i=t.pendingProps;switch(Ad(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(t),null;case 1:return Nt(t),null;case 3:return r=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),lr(Vt),he(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(os(t)?cr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Od())),Nt(t),null;case 26:var d=t.type,h=t.memoizedState;return e===null?(cr(t),h!==null?(Nt(t),ax(t,h)):(Nt(t),jf(t,d,null,i,r))):h?h!==e.memoizedState?(cr(t),Nt(t),ax(t,h)):(Nt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&cr(t),Nt(t),jf(t,d,e,i,r)),null;case 27:if(Te(t),r=ve.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&cr(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return Nt(t),null}e=le.current,os(t)?Lg(t):(e=uy(d,i,r),t.stateNode=e,cr(t))}return Nt(t),null;case 5:if(Te(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&cr(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return Nt(t),null}if(h=le.current,os(t))Lg(t);else{var S=jc(ve.current);switch(h){case 1:h=S.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=S.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=S.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof i.is=="string"?S.createElement("select",{is:i.is}):S.createElement("select"),i.multiple?h.multiple=!0:i.size&&(h.size=i.size);break;default:h=typeof i.is=="string"?S.createElement(d,{is:i.is}):S.createElement(d)}}h[on]=t,h[Sn]=i;e:for(S=t.child;S!==null;){if(S.tag===5||S.tag===6)h.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===t)break e;for(;S.sibling===null;){if(S.return===null||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}t.stateNode=h;e:switch(fn(h,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&&cr(t)}}return Nt(t),jf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&cr(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=ve.current,os(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||Wx(e.nodeValue,r)),e||Lr(t,!0)}else e=jc(e).createTextNode(i),e[on]=t,t.stateNode=e}return Nt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(i=os(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 wl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Nt(t),e=!1}else r=Od(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?($n(t),t):($n(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Nt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=os(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 wl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Nt(t),d=!1}else d=Od(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?($n(t),t):($n(t),null)}return $n(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),h=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),h!==d&&(i.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),ic(t,t.updateQueue),Nt(t),null);case 4:return he(),e===null&&Yf(t.stateNode.containerInfo),Nt(t),null;case 10:return lr(t.type),Nt(t),null;case 19:if(P(It),i=t.memoizedState,i===null)return Nt(t),null;if(d=(t.flags&128)!==0,h=i.rendering,h===null)if(d)Eo(i,!1);else{if(Ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Xi(e),h!==null){for(t.flags|=128,Eo(i,!1),e=h.updateQueue,t.updateQueue=e,ic(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Dg(r,e),r=r.sibling;return Z(It,It.current&1|2),Ge&&ar(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&bt()>hc&&(t.flags|=128,d=!0,Eo(i,!1),t.lanes=4194304)}else{if(!d)if(e=Xi(h),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,ic(t,e),Eo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!h.alternate&&!Ge)return Nt(t),null}else 2*bt()-i.renderingStartTime>hc&&r!==536870912&&(t.flags|=128,d=!0,Eo(i,!1),t.lanes=4194304);i.isBackwards?(h.sibling=t.child,t.child=h):(e=i.last,e!==null?e.sibling=h:t.child=h,i.last=h)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=bt(),e.sibling=null,r=It.current,Z(It,d?r&1|2:r&1),Ge&&ar(t,i.treeForkCount),e):(Nt(t),null);case 22:case 23:return $n(t),Yd(),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&&(Nt(t),t.subtreeFlags&6&&(t.flags|=8192)):Nt(t),r=t.updateQueue,r!==null&&ic(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&&P(Cl),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),lr(Vt),Nt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function oC(e,t){switch(Ad(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lr(Vt),he(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Te(t),null;case 31:if(t.memoizedState!==null){if($n(t),t.alternate===null)throw Error(o(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($n(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(It),null;case 4:return he(),null;case 10:return lr(t.type),null;case 22:case 23:return $n(t),Yd(),e!==null&&P(Cl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return lr(Vt),null;case 25:return null;default:return null}}function rx(e,t){switch(Ad(t),t.tag){case 3:lr(Vt),he();break;case 26:case 27:case 5:Te(t);break;case 4:he();break;case 31:t.memoizedState!==null&&$n(t);break;case 13:$n(t);break;case 19:P(It);break;case 10:lr(t.type);break;case 22:case 23:$n(t),Yd(),e!==null&&P(Cl);break;case 24:lr(Vt)}}function Ro(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 h=r.create,S=r.inst;i=h(),S.destroy=i}r=r.next}while(r!==d)}}catch(N){ut(t,t.return,N)}}function Vr(e,t,r){try{var i=t.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var h=d.next;i=h;do{if((i.tag&e)===e){var S=i.inst,N=S.destroy;if(N!==void 0){S.destroy=void 0,d=t;var z=r,F=N;try{F()}catch(ee){ut(d,z,ee)}}}i=i.next}while(i!==h)}}catch(ee){ut(t,t.return,ee)}}function lx(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{Xg(t,r)}catch(i){ut(e,e.return,i)}}}function sx(e,t,r){r.props=Ml(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){ut(e,t,i)}}function No(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){ut(e,t,d)}}function Ua(e,t){var r=e.ref,i=e.refCleanup;if(r!==null)if(typeof i=="function")try{i()}catch(d){ut(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){ut(e,t,d)}else r.current=null}function ox(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){ut(e,e.return,d)}}function Cf(e,t,r){try{var i=e.stateNode;MC(i,e.type,r,t),i[Sn]=t}catch(d){ut(e,e.return,d)}}function ix(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qr(e.type)||e.tag===4}function Ef(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ix(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&&Qr(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 Rf(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=er));else if(i!==4&&(i===27&&Qr(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(Rf(e,t,r),e=e.sibling;e!==null;)Rf(e,t,r),e=e.sibling}function cc(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&&Qr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(cc(e,t,r),e=e.sibling;e!==null;)cc(e,t,r),e=e.sibling}function cx(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[Sn]=r}catch(h){ut(e,e.return,h)}}var ur=!1,Gt=!1,Nf=!1,ux=typeof WeakSet=="function"?WeakSet:Set,tn=null;function iC(e,t){if(e=e.containerInfo,Kf=Ac,e=Sg(e),yd(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,h=i.focusNode;i=i.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var S=0,N=-1,z=-1,F=0,ee=0,re=e,K=null;t:for(;;){for(var Q;re!==r||d!==0&&re.nodeType!==3||(N=S+d),re!==h||i!==0&&re.nodeType!==3||(z=S+i),re.nodeType===3&&(S+=re.nodeValue.length),(Q=re.firstChild)!==null;)K=re,re=Q;for(;;){if(re===e)break t;if(K===r&&++F===d&&(N=S),K===h&&++ee===i&&(z=S),(Q=re.nextSibling)!==null)break;re=K,K=re.parentNode}re=Q}r=N===-1||z===-1?null:{start:N,end:z}}else r=null}r=r||{start:0,end:0}}else r=null;for(Xf={focusedElem:e,selectionRange:r},Ac=!1,tn=t;tn!==null;)if(t=tn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,tn=e;else for(;tn!==null;){switch(t=tn,h=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&&h!==null){e=void 0,r=t,d=h.memoizedProps,h=h.memoizedState,i=r.stateNode;try{var ye=Ml(r.type,d);e=i.getSnapshotBeforeUpdate(ye,h),i.__reactInternalSnapshotBeforeUpdate=e}catch(Me){ut(r,r.return,Me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)Jf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Jf(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,tn=e;break}tn=t.return}}function dx(e,t,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:fr(e,r),i&4&&Ro(5,r);break;case 1:if(fr(e,r),i&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(S){ut(r,r.return,S)}else{var d=Ml(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(S){ut(r,r.return,S)}}i&64&&lx(r),i&512&&No(r,r.return);break;case 3:if(fr(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{Xg(e,t)}catch(S){ut(r,r.return,S)}}break;case 27:t===null&&i&4&&cx(r);case 26:case 5:fr(e,r),t===null&&i&4&&ox(r),i&512&&No(r,r.return);break;case 12:fr(e,r);break;case 31:fr(e,r),i&4&&mx(e,r);break;case 13:fr(e,r),i&4&&px(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=vC.bind(null,r),UC(e,r))));break;case 22:if(i=r.memoizedState!==null||ur,!i){t=t!==null&&t.memoizedState!==null||Gt,d=ur;var h=Gt;ur=i,(Gt=t)&&!h?hr(e,r,(r.subtreeFlags&8772)!==0):fr(e,r),ur=d,Gt=h}break;case 30:break;default:fr(e,r)}}function fx(e){var t=e.alternate;t!==null&&(e.alternate=null,fx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&nd(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 _t=null,Cn=!1;function dr(e,t,r){for(r=r.child;r!==null;)hx(e,t,r),r=r.sibling}function hx(e,t,r){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount(se,r)}catch{}switch(r.tag){case 26:Gt||Ua(r,t),dr(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Gt||Ua(r,t);var i=_t,d=Cn;Qr(r.type)&&(_t=r.stateNode,Cn=!1),dr(e,t,r),Lo(r.stateNode),_t=i,Cn=d;break;case 5:Gt||Ua(r,t);case 6:if(i=_t,d=Cn,_t=null,dr(e,t,r),_t=i,Cn=d,_t!==null)if(Cn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(r.stateNode)}catch(h){ut(r,t,h)}else try{_t.removeChild(r.stateNode)}catch(h){ut(r,t,h)}break;case 18:_t!==null&&(Cn?(e=_t,ly(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Ts(e)):ly(_t,r.stateNode));break;case 4:i=_t,d=Cn,_t=r.stateNode.containerInfo,Cn=!0,dr(e,t,r),_t=i,Cn=d;break;case 0:case 11:case 14:case 15:Vr(2,r,t),Gt||Vr(4,r,t),dr(e,t,r);break;case 1:Gt||(Ua(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"&&sx(r,t,i)),dr(e,t,r);break;case 21:dr(e,t,r);break;case 22:Gt=(i=Gt)||r.memoizedState!==null,dr(e,t,r),Gt=i;break;default:dr(e,t,r)}}function mx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ts(e)}catch(r){ut(t,t.return,r)}}}function px(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ts(e)}catch(r){ut(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 ux),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ux),t;default:throw Error(o(435,e.tag))}}function uc(e,t){var r=cC(e);t.forEach(function(i){if(!r.has(i)){r.add(i);var d=xC.bind(null,e,i);i.then(d,d)}})}function En(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var d=r[i],h=e,S=t,N=S;e:for(;N!==null;){switch(N.tag){case 27:if(Qr(N.type)){_t=N.stateNode,Cn=!1;break e}break;case 5:_t=N.stateNode,Cn=!1;break e;case 3:case 4:_t=N.stateNode.containerInfo,Cn=!0;break e}N=N.return}if(_t===null)throw Error(o(160));hx(h,S,d),_t=null,Cn=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gx(t,e),t=t.sibling}var wa=null;function gx(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:En(t,e),Rn(e),i&4&&(Vr(3,e,e.return),Ro(3,e),Vr(5,e,e.return));break;case 1:En(t,e),Rn(e),i&512&&(Gt||r===null||Ua(r,r.return)),i&64&&ur&&(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=wa;if(En(t,e),Rn(e),i&512&&(Gt||r===null||Ua(r,r.return)),i&4){var h=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":h=d.getElementsByTagName("title")[0],(!h||h[Ws]||h[on]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(i),d.head.insertBefore(h,d.querySelector("head > title"))),fn(h,i,r),h[on]=e,en(h),i=h;break e;case"link":var S=gy("link","href",d).get(i+(r.href||""));if(S){for(var N=0;N<S.length;N++)if(h=S[N],h.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&h.getAttribute("rel")===(r.rel==null?null:r.rel)&&h.getAttribute("title")===(r.title==null?null:r.title)&&h.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){S.splice(N,1);break t}}h=d.createElement(i),fn(h,i,r),d.head.appendChild(h);break;case"meta":if(S=gy("meta","content",d).get(i+(r.content||""))){for(N=0;N<S.length;N++)if(h=S[N],h.getAttribute("content")===(r.content==null?null:""+r.content)&&h.getAttribute("name")===(r.name==null?null:r.name)&&h.getAttribute("property")===(r.property==null?null:r.property)&&h.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&h.getAttribute("charset")===(r.charSet==null?null:r.charSet)){S.splice(N,1);break t}}h=d.createElement(i),fn(h,i,r),d.head.appendChild(h);break;default:throw Error(o(468,i))}h[on]=e,en(h),i=h}e.stateNode=i}else vy(d,e.type,e.stateNode);else e.stateNode=py(d,i,e.memoizedProps);else h!==i?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,i===null?vy(d,e.type,e.stateNode):py(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Cf(e,e.memoizedProps,r.memoizedProps)}break;case 27:En(t,e),Rn(e),i&512&&(Gt||r===null||Ua(r,r.return)),r!==null&&i&4&&Cf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(En(t,e),Rn(e),i&512&&(Gt||r===null||Ua(r,r.return)),e.flags&32){d=e.stateNode;try{Zl(d,"")}catch(ye){ut(e,e.return,ye)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,Cf(e,d,r!==null?r.memoizedProps:d)),i&1024&&(Nf=!0);break;case 6:if(En(t,e),Rn(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,r=e.stateNode;try{r.nodeValue=i}catch(ye){ut(e,e.return,ye)}}break;case 3:if(Rc=null,d=wa,wa=Cc(t.containerInfo),En(t,e),wa=d,Rn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Ts(t.containerInfo)}catch(ye){ut(e,e.return,ye)}Nf&&(Nf=!1,vx(e));break;case 4:i=wa,wa=Cc(e.stateNode.containerInfo),En(t,e),Rn(e),wa=i;break;case 12:En(t,e),Rn(e);break;case 31:En(t,e),Rn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 13:En(t,e),Rn(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fc=bt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 22:d=e.memoizedState!==null;var z=r!==null&&r.memoizedState!==null,F=ur,ee=Gt;if(ur=F||d,Gt=ee||z,En(t,e),Gt=ee,ur=F,Rn(e),i&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(r===null||z||ur||Gt||Al(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){z=r=t;try{if(h=z.stateNode,d)S=h.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{N=z.stateNode;var re=z.memoizedProps.style,K=re!=null&&re.hasOwnProperty("display")?re.display:null;N.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(ye){ut(z,z.return,ye)}}}else if(t.tag===6){if(r===null){z=t;try{z.stateNode.nodeValue=d?"":z.memoizedProps}catch(ye){ut(z,z.return,ye)}}}else if(t.tag===18){if(r===null){z=t;try{var Q=z.stateNode;d?sy(Q,!0):sy(z.stateNode,!1)}catch(ye){ut(z,z.return,ye)}}}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,uc(e,r))));break;case 19:En(t,e),Rn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 30:break;case 21:break;default:En(t,e),Rn(e)}}function Rn(e){var t=e.flags;if(t&2){try{for(var r,i=e.return;i!==null;){if(ix(i)){r=i;break}i=i.return}if(r==null)throw Error(o(160));switch(r.tag){case 27:var d=r.stateNode,h=Ef(e);cc(e,h,d);break;case 5:var S=r.stateNode;r.flags&32&&(Zl(S,""),r.flags&=-33);var N=Ef(e);cc(e,N,S);break;case 3:case 4:var z=r.stateNode.containerInfo,F=Ef(e);Rf(e,F,z);break;default:throw Error(o(161))}}catch(ee){ut(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vx(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function fr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dx(e,t.alternate,t),t=t.sibling}function Al(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vr(4,t,t.return),Al(t);break;case 1:Ua(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&sx(t,t.return,r),Al(t);break;case 27:Lo(t.stateNode);case 26:case 5:Ua(t,t.return),Al(t);break;case 22:t.memoizedState===null&&Al(t);break;case 30:Al(t);break;default:Al(t)}e=e.sibling}}function hr(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,d=e,h=t,S=h.flags;switch(h.tag){case 0:case 11:case 15:hr(d,h,r),Ro(4,h);break;case 1:if(hr(d,h,r),i=h,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(F){ut(i,i.return,F)}if(i=h,d=i.updateQueue,d!==null){var N=i.stateNode;try{var z=d.shared.hiddenCallbacks;if(z!==null)for(d.shared.hiddenCallbacks=null,d=0;d<z.length;d++)Kg(z[d],N)}catch(F){ut(i,i.return,F)}}r&&S&64&&lx(h),No(h,h.return);break;case 27:cx(h);case 26:case 5:hr(d,h,r),r&&i===null&&S&4&&ox(h),No(h,h.return);break;case 12:hr(d,h,r);break;case 31:hr(d,h,r),r&&S&4&&mx(d,h);break;case 13:hr(d,h,r),r&&S&4&&px(d,h);break;case 22:h.memoizedState===null&&hr(d,h,r),No(h,h.return);break;case 30:break;default:hr(d,h,r)}t=t.sibling}}function Tf(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&&ho(r))}function Mf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ho(e))}function Sa(e,t,r,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xx(e,t,r,i),t=t.sibling}function xx(e,t,r,i){var d=t.flags;switch(t.tag){case 0:case 11:case 15:Sa(e,t,r,i),d&2048&&Ro(9,t);break;case 1:Sa(e,t,r,i);break;case 3:Sa(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&&ho(e)));break;case 12:if(d&2048){Sa(e,t,r,i),e=t.stateNode;try{var h=t.memoizedProps,S=h.id,N=h.onPostCommit;typeof N=="function"&&N(S,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){ut(t,t.return,z)}}else Sa(e,t,r,i);break;case 31:Sa(e,t,r,i);break;case 13:Sa(e,t,r,i);break;case 23:break;case 22:h=t.stateNode,S=t.alternate,t.memoizedState!==null?h._visibility&2?Sa(e,t,r,i):To(e,t):h._visibility&2?Sa(e,t,r,i):(h._visibility|=2,vs(e,t,r,i,(t.subtreeFlags&10256)!==0||!1)),d&2048&&Tf(S,t);break;case 24:Sa(e,t,r,i),d&2048&&Mf(t.alternate,t);break;default:Sa(e,t,r,i)}}function vs(e,t,r,i,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,S=t,N=r,z=i,F=S.flags;switch(S.tag){case 0:case 11:case 15:vs(h,S,N,z,d),Ro(8,S);break;case 23:break;case 22:var ee=S.stateNode;S.memoizedState!==null?ee._visibility&2?vs(h,S,N,z,d):To(h,S):(ee._visibility|=2,vs(h,S,N,z,d)),d&&F&2048&&Tf(S.alternate,S);break;case 24:vs(h,S,N,z,d),d&&F&2048&&Mf(S.alternate,S);break;default:vs(h,S,N,z,d)}t=t.sibling}}function To(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:To(r,i),d&2048&&Tf(i.alternate,i);break;case 24:To(r,i),d&2048&&Mf(i.alternate,i);break;default:To(r,i)}t=t.sibling}}var Mo=8192;function xs(e,t,r){if(e.subtreeFlags&Mo)for(e=e.child;e!==null;)yx(e,t,r),e=e.sibling}function yx(e,t,r){switch(e.tag){case 26:xs(e,t,r),e.flags&Mo&&e.memoizedState!==null&&XC(r,wa,e.memoizedState,e.memoizedProps);break;case 5:xs(e,t,r);break;case 3:case 4:var i=wa;wa=Cc(e.stateNode.containerInfo),xs(e,t,r),wa=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Mo,Mo=16777216,xs(e,t,r),Mo=i):xs(e,t,r));break;default:xs(e,t,r)}}function bx(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 Ao(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];tn=i,Sx(i,e)}bx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wx(e),e=e.sibling}function wx(e){switch(e.tag){case 0:case 11:case 15:Ao(e),e.flags&2048&&Vr(9,e,e.return);break;case 3:Ao(e);break;case 12:Ao(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,dc(e)):Ao(e);break;default:Ao(e)}}function dc(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];tn=i,Sx(i,e)}bx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vr(8,t,t.return),dc(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,dc(t));break;default:dc(t)}e=e.sibling}}function Sx(e,t){for(;tn!==null;){var r=tn;switch(r.tag){case 0:case 11:case 15:Vr(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:ho(r.memoizedState.cache)}if(i=r.child,i!==null)i.return=r,tn=i;else e:for(r=e;tn!==null;){i=tn;var d=i.sibling,h=i.return;if(fx(i),i===r){tn=null;break e}if(d!==null){d.return=h,tn=d;break e}tn=h}}}var uC={getCacheForType:function(e){var t=un(Vt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return un(Vt).controller.signal}},dC=typeof WeakMap=="function"?WeakMap:Map,nt=0,vt=null,Pe=null,$e=0,ct=0,Yn=null,$r=!1,ys=!1,Af=!1,mr=0,Ut=0,Yr=0,Dl=0,Df=0,Gn=0,bs=0,Do=null,Nn=null,Of=!1,fc=0,jx=0,hc=1/0,mc=null,Gr=null,Xt=0,Fr=null,ws=null,pr=0,_f=0,kf=null,Cx=null,Oo=0,zf=null;function Fn(){return(nt&2)!==0&&$e!==0?$e&-$e:_.T!==null?Pf():ya()}function Ex(){if(Gn===0)if(($e&536870912)===0||Ge){var e=Dr;Dr<<=1,(Dr&3932160)===0&&(Dr=262144),Gn=e}else Gn=536870912;return e=Vn.current,e!==null&&(e.flags|=32),Gn}function Tn(e,t,r){(e===vt&&(ct===2||ct===9)||e.cancelPendingCommit!==null)&&(Ss(e,0),Kr(e,$e,Gn,!1)),Ot(e,r),((nt&2)===0||e!==vt)&&(e===vt&&((nt&2)===0&&(Dl|=r),Ut===4&&Kr(e,$e,Gn,!1)),Ba(e))}function Rx(e,t,r){if((nt&6)!==0)throw Error(o(327));var i=!r&&(t&127)===0&&(t&e.expiredLanes)===0||Ee(e,t),d=i?mC(e,t):Uf(e,t,!0),h=i;do{if(d===0){ys&&!i&&Kr(e,t,0,!1);break}else{if(r=e.current.alternate,h&&!fC(r)){d=Uf(e,t,!1),h=!1;continue}if(d===2){if(h=t,e.errorRecoveryDisabledLanes&h)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){t=S;e:{var N=e;d=Do;var z=N.current.memoizedState.isDehydrated;if(z&&(Ss(N,S).flags|=256),S=Uf(N,S,!1),S!==2){if(Af&&!z){N.errorRecoveryDisabledLanes|=h,Dl|=h,d=4;break e}h=Nn,Nn=d,h!==null&&(Nn===null?Nn=h:Nn.push.apply(Nn,h))}d=S}if(h=!1,d!==2)continue}}if(d===1){Ss(e,0),Kr(e,t,0,!0);break}e:{switch(i=e,h=d,h){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Kr(i,t,Gn,!$r);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(d=fc+300-bt(),10<d)){if(Kr(i,t,Gn,!$r),qt(i,0,!0)!==0)break e;pr=t,i.timeoutHandle=ay(Nx.bind(null,i,r,Nn,mc,Of,t,Gn,Dl,bs,$r,h,"Throttled",-0,0),d);break e}Nx(i,r,Nn,mc,Of,t,Gn,Dl,bs,$r,h,null,-0,0)}}break}while(!0);Ba(e)}function Nx(e,t,r,i,d,h,S,N,z,F,ee,re,K,Q){if(e.timeoutHandle=-1,re=t.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:er},yx(t,h,re);var ye=(h&62914560)===h?fc-bt():(h&4194048)===h?jx-bt():0;if(ye=QC(re,ye),ye!==null){pr=h,e.cancelPendingCommit=ye(zx.bind(null,e,t,h,r,i,d,S,N,z,ee,re,null,K,Q)),Kr(e,h,S,!F);return}}zx(e,t,h,r,i,d,S,N,z)}function fC(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],h=d.getSnapshot;d=d.value;try{if(!Pn(h(),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 Kr(e,t,r,i){t&=~Df,t&=~Dl,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var d=t;0<d;){var h=31-ot(d),S=1<<h;i[h]=-1,d&=~S}r!==0&&Kt(e,r,t)}function pc(){return(nt&6)===0?(_o(0),!1):!0}function Lf(){if(Pe!==null){if(ct===0)var e=Pe.return;else e=Pe,rr=Sl=null,Zd(e),fs=null,po=0,e=Pe;for(;e!==null;)rx(e.alternate,e),e=e.return;Pe=null}}function Ss(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,OC(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),pr=0,Lf(),vt=e,Pe=r=nr(e.current,null),$e=t,ct=0,Yn=null,$r=!1,ys=Ee(e,t),Af=!1,bs=Gn=Df=Dl=Yr=Ut=0,Nn=Do=null,Of=!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-ot(i),h=1<<d;t|=e[d],i&=~h}return mr=t,Li(),r}function Tx(e,t){Ue=null,_.H=jo,t===ds||t===$i?(t=$g(),ct=3):t===Hd?(t=$g(),ct=4):ct=t===mf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Yn=t,Pe===null&&(Ut=1,rc(e,ta(t,e.current)))}function Mx(){var e=Vn.current;return e===null?!0:($e&4194048)===$e?la===null:($e&62914560)===$e||($e&536870912)!==0?e===la:!1}function Ax(){var e=_.H;return _.H=jo,e===null?jo:e}function Dx(){var e=_.A;return _.A=uC,e}function gc(){Ut=4,$r||($e&4194048)!==$e&&Vn.current!==null||(ys=!0),(Yr&134217727)===0&&(Dl&134217727)===0||vt===null||Kr(vt,$e,Gn,!1)}function Uf(e,t,r){var i=nt;nt|=2;var d=Ax(),h=Dx();(vt!==e||$e!==t)&&(mc=null,Ss(e,t)),t=!1;var S=Ut;e:do try{if(ct!==0&&Pe!==null){var N=Pe,z=Yn;switch(ct){case 8:Lf(),S=6;break e;case 3:case 2:case 9:case 6:Vn.current===null&&(t=!0);var F=ct;if(ct=0,Yn=null,js(e,N,z,F),r&&ys){S=0;break e}break;default:F=ct,ct=0,Yn=null,js(e,N,z,F)}}hC(),S=Ut;break}catch(ee){Tx(e,ee)}while(!0);return t&&e.shellSuspendCounter++,rr=Sl=null,nt=i,_.H=d,_.A=h,Pe===null&&(vt=null,$e=0,Li()),S}function hC(){for(;Pe!==null;)Ox(Pe)}function mC(e,t){var r=nt;nt|=2;var i=Ax(),d=Dx();vt!==e||$e!==t?(mc=null,hc=bt()+500,Ss(e,t)):ys=Ee(e,t);e:do try{if(ct!==0&&Pe!==null){t=Pe;var h=Yn;t:switch(ct){case 1:ct=0,Yn=null,js(e,t,h,1);break;case 2:case 9:if(qg(h)){ct=0,Yn=null,_x(t);break}t=function(){ct!==2&&ct!==9||vt!==e||(ct=7),Ba(e)},h.then(t,t);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:qg(h)?(ct=0,Yn=null,_x(t)):(ct=0,Yn=null,js(e,t,h,7));break;case 5:var S=null;switch(Pe.tag){case 26:S=Pe.memoizedState;case 5:case 27:var N=Pe;if(S?xy(S):N.stateNode.complete){ct=0,Yn=null;var z=N.sibling;if(z!==null)Pe=z;else{var F=N.return;F!==null?(Pe=F,vc(F)):Pe=null}break t}}ct=0,Yn=null,js(e,t,h,5);break;case 6:ct=0,Yn=null,js(e,t,h,6);break;case 8:Lf(),Ut=6;break e;default:throw Error(o(462))}}pC();break}catch(ee){Tx(e,ee)}while(!0);return rr=Sl=null,_.H=i,_.A=d,nt=r,Pe!==null?0:(vt=null,$e=0,Li(),Ut)}function pC(){for(;Pe!==null&&!zt();)Ox(Pe)}function Ox(e){var t=nx(e.alternate,e,mr);e.memoizedProps=e.pendingProps,t===null?vc(e):Pe=t}function _x(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=Qv(r,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=Qv(r,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:Zd(t);default:rx(r,t),t=Pe=Dg(t,mr),t=nx(r,t,mr)}e.memoizedProps=e.pendingProps,t===null?vc(e):Pe=t}function js(e,t,r,i){rr=Sl=null,Zd(t),fs=null,po=0;var d=t.return;try{if(aC(e,d,t,r,$e)){Ut=1,rc(e,ta(r,e.current)),Pe=null;return}}catch(h){if(d!==null)throw Pe=d,h;Ut=1,rc(e,ta(r,e.current)),Pe=null;return}t.flags&32768?(Ge||i===1?e=!0:ys||($e&536870912)!==0?e=!1:($r=e=!0,(i===2||i===9||i===3||i===6)&&(i=Vn.current,i!==null&&i.tag===13&&(i.flags|=16384))),kx(t,e)):vc(t)}function vc(e){var t=e;do{if((t.flags&32768)!==0){kx(t,$r);return}e=t.return;var r=sC(t.alternate,t,mr);if(r!==null){Pe=r;return}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);Ut===0&&(Ut=5)}function kx(e,t){do{var r=oC(e.alternate,e);if(r!==null){r.flags&=32767,Pe=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){Pe=e;return}Pe=e=r}while(e!==null);Ut=6,Pe=null}function zx(e,t,r,i,d,h,S,N,z){e.cancelPendingCommit=null;do xc();while(Xt!==0);if((nt&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(h=t.lanes|t.childLanes,h|=Cd,dt(e,r,h,S,N,z),e===vt&&(Pe=vt=null,$e=0),ws=t,Fr=e,pr=r,_f=h,kf=d,Cx=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,yC(Wt,function(){return Ix(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=_.T,_.T=null,d=H.p,H.p=2,S=nt,nt|=4;try{iC(e,t,r)}finally{nt=S,H.p=d,_.T=i}}Xt=1,Lx(),Ux(),Bx()}}function Lx(){if(Xt===1){Xt=0;var e=Fr,t=ws,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=_.T,_.T=null;var i=H.p;H.p=2;var d=nt;nt|=4;try{gx(t,e);var h=Xf,S=Sg(e.containerInfo),N=h.focusedElem,z=h.selectionRange;if(S!==N&&N&&N.ownerDocument&&wg(N.ownerDocument.documentElement,N)){if(z!==null&&yd(N)){var F=z.start,ee=z.end;if(ee===void 0&&(ee=F),"selectionStart"in N)N.selectionStart=F,N.selectionEnd=Math.min(ee,N.value.length);else{var re=N.ownerDocument||document,K=re&&re.defaultView||window;if(K.getSelection){var Q=K.getSelection(),ye=N.textContent.length,Me=Math.min(z.start,ye),mt=z.end===void 0?Me:Math.min(z.end,ye);!Q.extend&&Me>mt&&(S=mt,mt=Me,Me=S);var q=bg(N,Me),I=bg(N,mt);if(q&&I&&(Q.rangeCount!==1||Q.anchorNode!==q.node||Q.anchorOffset!==q.offset||Q.focusNode!==I.node||Q.focusOffset!==I.offset)){var Y=re.createRange();Y.setStart(q.node,q.offset),Q.removeAllRanges(),Me>mt?(Q.addRange(Y),Q.extend(I.node,I.offset)):(Y.setEnd(I.node,I.offset),Q.addRange(Y))}}}}for(re=[],Q=N;Q=Q.parentNode;)Q.nodeType===1&&re.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<re.length;N++){var ne=re[N];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Ac=!!Kf,Xf=Kf=null}finally{nt=d,H.p=i,_.T=r}}e.current=t,Xt=2}}function Ux(){if(Xt===2){Xt=0;var e=Fr,t=ws,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=_.T,_.T=null;var i=H.p;H.p=2;var d=nt;nt|=4;try{dx(e,t.alternate,t)}finally{nt=d,H.p=i,_.T=r}}Xt=3}}function Bx(){if(Xt===4||Xt===3){Xt=0,yt();var e=Fr,t=ws,r=pr,i=Cx;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Xt=5:(Xt=0,ws=Fr=null,Hx(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Gr=null),Ja(r),t=t.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot(se,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=_.T,d=H.p,H.p=2,_.T=null;try{for(var h=e.onRecoverableError,S=0;S<i.length;S++){var N=i[S];h(N.value,{componentStack:N.stack})}}finally{_.T=t,H.p=d}}(pr&3)!==0&&xc(),Ba(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===zf?Oo++:(Oo=0,zf=e):Oo=0,_o(0)}}function Hx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ho(t)))}function xc(){return Lx(),Ux(),Bx(),Ix()}function Ix(){if(Xt!==5)return!1;var e=Fr,t=_f;_f=0;var r=Ja(pr),i=_.T,d=H.p;try{H.p=32>r?32:r,_.T=null,r=kf,kf=null;var h=Fr,S=pr;if(Xt=0,ws=Fr=null,pr=0,(nt&6)!==0)throw Error(o(331));var N=nt;if(nt|=4,wx(h.current),xx(h,h.current,S,r),nt=N,_o(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(se,h)}catch{}return!0}finally{H.p=d,_.T=i,Hx(e,t)}}function Px(e,t,r){t=ta(r,t),t=hf(e.stateNode,t,2),e=Ir(e,t,2),e!==null&&(Ot(e,2),Ba(e))}function ut(e,t,r){if(e.tag===3)Px(e,e,r);else for(;t!==null;){if(t.tag===3){Px(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Gr===null||!Gr.has(i))){e=ta(r,e),r=qv(2),i=Ir(t,r,2),i!==null&&(Vv(r,i,t,e),Ot(i,2),Ba(i));break}}t=t.return}}function Bf(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new dC;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)||(Af=!0,d.add(r),e=gC.bind(null,e,t,r),t.then(e,e))}function gC(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,vt===e&&($e&r)===r&&(Ut===4||Ut===3&&($e&62914560)===$e&&300>bt()-fc?(nt&2)===0&&Ss(e,0):Df|=r,bs===$e&&(bs=0)),Ba(e)}function qx(e,t){t===0&&(t=Be()),e=yl(e,t),e!==null&&(Ot(e,t),Ba(e))}function vC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),qx(e,r)}function xC(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),qx(e,r)}function yC(e,t){return jt(e,t)}var yc=null,Cs=null,Hf=!1,bc=!1,If=!1,Xr=0;function Ba(e){e!==Cs&&e.next===null&&(Cs===null?yc=Cs=e:Cs=Cs.next=e),bc=!0,Hf||(Hf=!0,wC())}function _o(e,t){if(!If&&bc){If=!0;do for(var r=!1,i=yc;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var h=0;else{var S=i.suspendedLanes,N=i.pingedLanes;h=(1<<31-ot(42|e)+1)-1,h&=d&~(S&~N),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,Gx(i,h))}else h=$e,h=qt(i,i===vt?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(h&3)===0||Ee(i,h)||(r=!0,Gx(i,h));i=i.next}while(r);If=!1}}function bC(){Vx()}function Vx(){bc=Hf=!1;var e=0;Xr!==0&&DC()&&(e=Xr);for(var t=bt(),r=null,i=yc;i!==null;){var d=i.next,h=$x(i,t);h===0?(i.next=null,r===null?yc=d:r.next=d,d===null&&(Cs=r)):(r=i,(e!==0||(h&3)!==0)&&(bc=!0)),i=d}Xt!==0&&Xt!==5||_o(e),Xr!==0&&(Xr=0)}function $x(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var S=31-ot(h),N=1<<S,z=d[S];z===-1?((N&r)===0||(N&i)!==0)&&(d[S]=Le(N,t)):z<=t&&(e.expiredLanes|=N),h&=~N}if(t=vt,r=$e,r=qt(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,r===0||e===t&&(ct===2||ct===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Bt(i),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Ee(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(i!==null&&Bt(i),Ja(r)){case 2:case 8:r=Dt;break;case 32:r=Wt;break;case 268435456:r=In;break;default:r=Wt}return i=Yx.bind(null,e),r=jt(r,i),e.callbackPriority=t,e.callbackNode=r,t}return i!==null&&i!==null&&Bt(i),e.callbackPriority=2,e.callbackNode=null,2}function Yx(e,t){if(Xt!==0&&Xt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(xc()&&e.callbackNode!==r)return null;var i=$e;return i=qt(e,e===vt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Rx(e,i,t),$x(e,bt()),e.callbackNode!=null&&e.callbackNode===r?Yx.bind(null,e):null)}function Gx(e,t){if(xc())return null;Rx(e,t,!0)}function wC(){_C(function(){(nt&6)!==0?jt(At,bC):Vx()})}function Pf(){if(Xr===0){var e=cs;e===0&&(e=Qa,Qa<<=1,(Qa&261888)===0&&(Qa=256)),Xr=e}return Xr}function Fx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ti(""+e)}function Kx(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 SC(e,t,r,i,d){if(t==="submit"&&r&&r.stateNode===d){var h=Fx((d[Sn]||null).action),S=i.submitter;S&&(t=(t=S[Sn]||null)?Fx(t.formAction):S.getAttribute("formAction"),t!==null&&(h=t,S=null));var N=new Oi("action","action",null,i,d);e.push({event:N,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Xr!==0){var z=S?Kx(d,S):new FormData(d);sf(r,{pending:!0,data:z,method:d.method,action:h},null,z)}}else typeof h=="function"&&(N.preventDefault(),z=S?Kx(d,S):new FormData(d),sf(r,{pending:!0,data:z,method:d.method,action:h},h,z))},currentTarget:d}]})}}for(var qf=0;qf<jd.length;qf++){var Vf=jd[qf],jC=Vf.toLowerCase(),CC=Vf[0].toUpperCase()+Vf.slice(1);ba(jC,"on"+CC)}ba(Eg,"onAnimationEnd"),ba(Rg,"onAnimationIteration"),ba(Ng,"onAnimationStart"),ba("dblclick","onDoubleClick"),ba("focusin","onFocus"),ba("focusout","onBlur"),ba(Ij,"onTransitionRun"),ba(Pj,"onTransitionStart"),ba(qj,"onTransitionCancel"),ba(Tg,"onTransitionEnd"),Xl("onMouseEnter",["mouseout","mouseover"]),Xl("onMouseLeave",["mouseout","mouseover"]),Xl("onPointerEnter",["pointerout","pointerover"]),Xl("onPointerLeave",["pointerout","pointerover"]),pl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pl("onBeforeInput",["compositionend","keypress","textInput","paste"]),pl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ko="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(" "),EC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ko));function Xx(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 h=void 0;if(t)for(var S=i.length-1;0<=S;S--){var N=i[S],z=N.instance,F=N.currentTarget;if(N=N.listener,z!==h&&d.isPropagationStopped())break e;h=N,d.currentTarget=F;try{h(d)}catch(ee){zi(ee)}d.currentTarget=null,h=z}else for(S=0;S<i.length;S++){if(N=i[S],z=N.instance,F=N.currentTarget,N=N.listener,z!==h&&d.isPropagationStopped())break e;h=N,d.currentTarget=F;try{h(d)}catch(ee){zi(ee)}d.currentTarget=null,h=z}}}}function qe(e,t){var r=t[td];r===void 0&&(r=t[td]=new Set);var i=e+"__bubble";r.has(i)||(Qx(t,e,2,!1),r.add(i))}function $f(e,t,r){var i=0;t&&(i|=4),Qx(r,e,i,t)}var wc="_reactListening"+Math.random().toString(36).slice(2);function Yf(e){if(!e[wc]){e[wc]=!0,Vp.forEach(function(r){r!=="selectionchange"&&(EC.has(r)||$f(r,!1,e),$f(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wc]||(t[wc]=!0,$f("selectionchange",!1,t))}}function Qx(e,t,r,i){switch(Ey(t)){case 2:var d=WC;break;case 8:d=e2;break;default:d=sh}r=d.bind(null,t,r,e),d=void 0,!ud||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 Gf(e,t,r,i,d){var h=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var S=i.tag;if(S===3||S===4){var N=i.stateNode.containerInfo;if(N===d)break;if(S===4)for(S=i.return;S!==null;){var z=S.tag;if((z===3||z===4)&&S.stateNode.containerInfo===d)return;S=S.return}for(;N!==null;){if(S=Gl(N),S===null)return;if(z=S.tag,z===5||z===6||z===26||z===27){i=h=S;continue e}N=N.parentNode}}i=i.return}tg(function(){var F=h,ee=id(r),re=[];e:{var K=Mg.get(e);if(K!==void 0){var Q=Oi,ye=e;switch(e){case"keypress":if(Ai(r)===0)break e;case"keydown":case"keyup":Q=xj;break;case"focusin":ye="focus",Q=md;break;case"focusout":ye="blur",Q=md;break;case"beforeblur":case"afterblur":Q=md;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":Q=rg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=sj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=wj;break;case Eg:case Rg:case Ng:Q=cj;break;case Tg:Q=jj;break;case"scroll":case"scrollend":Q=rj;break;case"wheel":Q=Ej;break;case"copy":case"cut":case"paste":Q=dj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=sg;break;case"toggle":case"beforetoggle":Q=Nj}var Me=(t&4)!==0,mt=!Me&&(e==="scroll"||e==="scrollend"),q=Me?K!==null?K+"Capture":null:K;Me=[];for(var I=F,Y;I!==null;){var ne=I;if(Y=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||Y===null||q===null||(ne=to(I,q),ne!=null&&Me.push(zo(I,ne,Y))),mt)break;I=I.return}0<Me.length&&(K=new Q(K,ye,null,r,ee),re.push({event:K,listeners:Me}))}}if((t&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",K&&r!==od&&(ye=r.relatedTarget||r.fromElement)&&(Gl(ye)||ye[Yl]))break e;if((Q||K)&&(K=ee.window===ee?ee:(K=ee.ownerDocument)?K.defaultView||K.parentWindow:window,Q?(ye=r.relatedTarget||r.toElement,Q=F,ye=ye?Gl(ye):null,ye!==null&&(mt=u(ye),Me=ye.tag,ye!==mt||Me!==5&&Me!==27&&Me!==6)&&(ye=null)):(Q=null,ye=F),Q!==ye)){if(Me=rg,ne="onMouseLeave",q="onMouseEnter",I="mouse",(e==="pointerout"||e==="pointerover")&&(Me=sg,ne="onPointerLeave",q="onPointerEnter",I="pointer"),mt=Q==null?K:eo(Q),Y=ye==null?K:eo(ye),K=new Me(ne,I+"leave",Q,r,ee),K.target=mt,K.relatedTarget=Y,ne=null,Gl(ee)===F&&(Me=new Me(q,I+"enter",ye,r,ee),Me.target=Y,Me.relatedTarget=mt,ne=Me),mt=ne,Q&&ye)t:{for(Me=RC,q=Q,I=ye,Y=0,ne=q;ne;ne=Me(ne))Y++;ne=0;for(var Re=I;Re;Re=Me(Re))ne++;for(;0<Y-ne;)q=Me(q),Y--;for(;0<ne-Y;)I=Me(I),ne--;for(;Y--;){if(q===I||I!==null&&q===I.alternate){Me=q;break t}q=Me(q),I=Me(I)}Me=null}else Me=null;Q!==null&&Zx(re,K,Q,Me,!1),ye!==null&&mt!==null&&Zx(re,mt,ye,Me,!0)}}e:{if(K=F?eo(F):window,Q=K.nodeName&&K.nodeName.toLowerCase(),Q==="select"||Q==="input"&&K.type==="file")var We=mg;else if(fg(K))if(pg)We=Uj;else{We=zj;var Se=kj}else Q=K.nodeName,!Q||Q.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?F&&sd(F.elementType)&&(We=mg):We=Lj;if(We&&(We=We(e,F))){hg(re,We,r,ee);break e}Se&&Se(e,K,F),e==="focusout"&&F&&K.type==="number"&&F.memoizedProps.value!=null&&ld(K,"number",K.value)}switch(Se=F?eo(F):window,e){case"focusin":(fg(Se)||Se.contentEditable==="true")&&(ts=Se,bd=F,co=null);break;case"focusout":co=bd=ts=null;break;case"mousedown":wd=!0;break;case"contextmenu":case"mouseup":case"dragend":wd=!1,jg(re,r,ee);break;case"selectionchange":if(Hj)break;case"keydown":case"keyup":jg(re,r,ee)}var He;if(gd)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else es?ug(e,r)&&(Ye="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ye="onCompositionStart");Ye&&(og&&r.locale!=="ko"&&(es||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&es&&(He=ng()):(_r=ee,dd="value"in _r?_r.value:_r.textContent,es=!0)),Se=Sc(F,Ye),0<Se.length&&(Ye=new lg(Ye,e,null,r,ee),re.push({event:Ye,listeners:Se}),He?Ye.data=He:(He=dg(r),He!==null&&(Ye.data=He)))),(He=Mj?Aj(e,r):Dj(e,r))&&(Ye=Sc(F,"onBeforeInput"),0<Ye.length&&(Se=new lg("onBeforeInput","beforeinput",null,r,ee),re.push({event:Se,listeners:Ye}),Se.data=He)),SC(re,e,F,r,ee)}Xx(re,t)})}function zo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Sc(e,t){for(var r=t+"Capture",i=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=to(e,r),d!=null&&i.unshift(zo(e,d,h)),d=to(e,t),d!=null&&i.push(zo(e,d,h))),e.tag===3)return i;e=e.return}return[]}function RC(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zx(e,t,r,i,d){for(var h=t._reactName,S=[];r!==null&&r!==i;){var N=r,z=N.alternate,F=N.stateNode;if(N=N.tag,z!==null&&z===i)break;N!==5&&N!==26&&N!==27||F===null||(z=F,d?(F=to(r,h),F!=null&&S.unshift(zo(r,F,z))):d||(F=to(r,h),F!=null&&S.push(zo(r,F,z)))),r=r.return}S.length!==0&&e.push({event:t,listeners:S})}var NC=/\r\n?/g,TC=/\u0000|\uFFFD/g;function Jx(e){return(typeof e=="string"?e:""+e).replace(NC,`
49
+ `).replace(TC,"")}function Wx(e,t){return t=Jx(t),Jx(e)===t}function ht(e,t,r,i,d,h){switch(r){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Zl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Zl(e,""+i);break;case"className":Ri(e,"class",i);break;case"tabIndex":Ri(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Ri(e,r,i);break;case"style":Wp(e,i,h);break;case"data":if(t!=="object"){Ri(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=Ti(""+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 h=="function"&&(r==="formAction"?(t!=="input"&&ht(e,t,"name",d.name,d,null),ht(e,t,"formEncType",d.formEncType,d,null),ht(e,t,"formMethod",d.formMethod,d,null),ht(e,t,"formTarget",d.formTarget,d,null)):(ht(e,t,"encType",d.encType,d,null),ht(e,t,"method",d.method,d,null),ht(e,t,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=Ti(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=er);break;case"onScroll":i!=null&&qe("scroll",e);break;case"onScrollEnd":i!=null&&qe("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=Ti(""+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":qe("beforetoggle",e),qe("toggle",e),Ei(e,"popover",i);break;case"xlinkActuate":Wa(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Wa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Wa(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Wa(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Wa(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Wa(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Wa(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Wa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Wa(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ei(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=nj.get(r)||r,Ei(e,r,i))}}function Ff(e,t,r,i,d,h){switch(r){case"style":Wp(e,i,h);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"?Zl(e,i):(typeof i=="number"||typeof i=="bigint")&&Zl(e,""+i);break;case"onScroll":i!=null&&qe("scroll",e);break;case"onScrollEnd":i!=null&&qe("scrollend",e);break;case"onClick":i!=null&&(e.onclick=er);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$p.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),t=r.slice(2,d?r.length-7:void 0),h=e[Sn]||null,h=h!=null?h[r]:null,typeof h=="function"&&e.removeEventListener(t,h,d),typeof i=="function")){typeof h!="function"&&h!==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,""):Ei(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":qe("error",e),qe("load",e);var i=!1,d=!1,h;for(h in r)if(r.hasOwnProperty(h)){var S=r[h];if(S!=null)switch(h){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ht(e,t,h,S,r,null)}}d&&ht(e,t,"srcSet",r.srcSet,r,null),i&&ht(e,t,"src",r.src,r,null);return;case"input":qe("invalid",e);var N=h=S=d=null,z=null,F=null;for(i in r)if(r.hasOwnProperty(i)){var ee=r[i];if(ee!=null)switch(i){case"name":d=ee;break;case"type":S=ee;break;case"checked":z=ee;break;case"defaultChecked":F=ee;break;case"value":h=ee;break;case"defaultValue":N=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,t));break;default:ht(e,t,i,ee,r,null)}}Xp(e,h,N,z,F,S,d,!1);return;case"select":qe("invalid",e),i=S=h=null;for(d in r)if(r.hasOwnProperty(d)&&(N=r[d],N!=null))switch(d){case"value":h=N;break;case"defaultValue":S=N;break;case"multiple":i=N;default:ht(e,t,d,N,r,null)}t=h,r=S,e.multiple=!!i,t!=null?Ql(e,!!i,t,!1):r!=null&&Ql(e,!!i,r,!0);return;case"textarea":qe("invalid",e),h=d=i=null;for(S in r)if(r.hasOwnProperty(S)&&(N=r[S],N!=null))switch(S){case"value":i=N;break;case"defaultValue":d=N;break;case"children":h=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(o(91));break;default:ht(e,t,S,N,r,null)}Zp(e,i,d,h);return;case"option":for(z in r)if(r.hasOwnProperty(z)&&(i=r[z],i!=null))switch(z){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:ht(e,t,z,i,r,null)}return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(i=0;i<ko.length;i++)qe(ko[i],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("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(F in r)if(r.hasOwnProperty(F)&&(i=r[F],i!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ht(e,t,F,i,r,null)}return;default:if(sd(t)){for(ee in r)r.hasOwnProperty(ee)&&(i=r[ee],i!==void 0&&Ff(e,t,ee,i,r,void 0));return}}for(N in r)r.hasOwnProperty(N)&&(i=r[N],i!=null&&ht(e,t,N,i,r,null))}function MC(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,h=null,S=null,N=null,z=null,F=null,ee=null;for(Q in r){var re=r[Q];if(r.hasOwnProperty(Q)&&re!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":z=re;default:i.hasOwnProperty(Q)||ht(e,t,Q,null,i,re)}}for(var K in i){var Q=i[K];if(re=r[K],i.hasOwnProperty(K)&&(Q!=null||re!=null))switch(K){case"type":h=Q;break;case"name":d=Q;break;case"checked":F=Q;break;case"defaultChecked":ee=Q;break;case"value":S=Q;break;case"defaultValue":N=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(o(137,t));break;default:Q!==re&&ht(e,t,K,Q,i,re)}}rd(e,S,N,z,F,ee,h,d);return;case"select":Q=S=N=K=null;for(h in r)if(z=r[h],r.hasOwnProperty(h)&&z!=null)switch(h){case"value":break;case"multiple":Q=z;default:i.hasOwnProperty(h)||ht(e,t,h,null,i,z)}for(d in i)if(h=i[d],z=r[d],i.hasOwnProperty(d)&&(h!=null||z!=null))switch(d){case"value":K=h;break;case"defaultValue":N=h;break;case"multiple":S=h;default:h!==z&&ht(e,t,d,h,i,z)}t=N,r=S,i=Q,K!=null?Ql(e,!!r,K,!1):!!i!=!!r&&(t!=null?Ql(e,!!r,t,!0):Ql(e,!!r,r?[]:"",!1));return;case"textarea":Q=K=null;for(N in r)if(d=r[N],r.hasOwnProperty(N)&&d!=null&&!i.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:ht(e,t,N,null,i,d)}for(S in i)if(d=i[S],h=r[S],i.hasOwnProperty(S)&&(d!=null||h!=null))switch(S){case"value":K=d;break;case"defaultValue":Q=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==h&&ht(e,t,S,d,i,h)}Qp(e,K,Q);return;case"option":for(var ye in r)if(K=r[ye],r.hasOwnProperty(ye)&&K!=null&&!i.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:ht(e,t,ye,null,i,K)}for(z in i)if(K=i[z],Q=r[z],i.hasOwnProperty(z)&&K!==Q&&(K!=null||Q!=null))switch(z){case"selected":e.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:ht(e,t,z,K,i,Q)}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 Me in r)K=r[Me],r.hasOwnProperty(Me)&&K!=null&&!i.hasOwnProperty(Me)&&ht(e,t,Me,null,i,K);for(F in i)if(K=i[F],Q=r[F],i.hasOwnProperty(F)&&K!==Q&&(K!=null||Q!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(o(137,t));break;default:ht(e,t,F,K,i,Q)}return;default:if(sd(t)){for(var mt in r)K=r[mt],r.hasOwnProperty(mt)&&K!==void 0&&!i.hasOwnProperty(mt)&&Ff(e,t,mt,void 0,i,K);for(ee in i)K=i[ee],Q=r[ee],!i.hasOwnProperty(ee)||K===Q||K===void 0&&Q===void 0||Ff(e,t,ee,K,i,Q);return}}for(var q in r)K=r[q],r.hasOwnProperty(q)&&K!=null&&!i.hasOwnProperty(q)&&ht(e,t,q,null,i,K);for(re in i)K=i[re],Q=r[re],!i.hasOwnProperty(re)||K===Q||K==null&&Q==null||ht(e,t,re,K,i,Q)}function ey(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function AC(){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],h=d.transferSize,S=d.initiatorType,N=d.duration;if(h&&N&&ey(S)){for(S=0,N=d.responseEnd,i+=1;i<r.length;i++){var z=r[i],F=z.startTime;if(F>N)break;var ee=z.transferSize,re=z.initiatorType;ee&&ey(re)&&(z=z.responseEnd,S+=ee*(z<N?1:(N-F)/(z-F)))}if(--i,t+=8*(h+S)/(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 Kf=null,Xf=null;function jc(e){return e.nodeType===9?e:e.ownerDocument}function ty(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 ny(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 Qf(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 Zf=null;function DC(){var e=window.event;return e&&e.type==="popstate"?e===Zf?!1:(Zf=e,!0):(Zf=null,!1)}var ay=typeof setTimeout=="function"?setTimeout:void 0,OC=typeof clearTimeout=="function"?clearTimeout:void 0,ry=typeof Promise=="function"?Promise:void 0,_C=typeof queueMicrotask=="function"?queueMicrotask:typeof ry<"u"?function(e){return ry.resolve(null).then(e).catch(kC)}:ay;function kC(e){setTimeout(function(){throw e})}function Qr(e){return e==="head"}function ly(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),Ts(t);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")Lo(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Lo(r);for(var h=r.firstChild;h;){var S=h.nextSibling,N=h.nodeName;h[Ws]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=S}}else r==="body"&&Lo(e.ownerDocument.body);r=d}while(r);Ts(t)}function sy(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 Jf(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":Jf(r),nd(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function zC(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[Ws])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==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(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=sa(e.nextSibling),e===null)break}return null}function LC(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=sa(e.nextSibling),e===null))return null;return e}function oy(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=sa(e.nextSibling),e===null))return null;return e}function Wf(e){return e.data==="$?"||e.data==="$~"}function eh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function UC(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 sa(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 th=null;function iy(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return sa(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function cy(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 uy(e,t,r){switch(t=jc(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 Lo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);nd(e)}var oa=new Map,dy=new Set;function Cc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gr=H.d;H.d={f:BC,r:HC,D:IC,C:PC,L:qC,m:VC,X:YC,S:$C,M:GC};function BC(){var e=gr.f(),t=pc();return e||t}function HC(e){var t=Fl(e);t!==null&&t.tag===5&&t.type==="form"?Tv(t):gr.r(e)}var Es=typeof document>"u"?null:document;function fy(e,t,r){var i=Es;if(i&&typeof t=="string"&&t){var d=Wn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),dy.has(d)||(dy.add(d),e={rel:e,crossOrigin:r,href:t},i.querySelector(d)===null&&(t=i.createElement("link"),fn(t,"link",e),en(t),i.head.appendChild(t)))}}function IC(e){gr.D(e),fy("dns-prefetch",e,null)}function PC(e,t){gr.C(e,t),fy("preconnect",e,t)}function qC(e,t,r){gr.L(e,t,r);var i=Es;if(i&&e&&t){var d='link[rel="preload"][as="'+Wn(t)+'"]';t==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+Wn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+Wn(r.imageSizes)+'"]')):d+='[href="'+Wn(e)+'"]';var h=d;switch(t){case"style":h=Rs(e);break;case"script":h=Ns(e)}oa.has(h)||(e=y({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),oa.set(h,e),i.querySelector(d)!==null||t==="style"&&i.querySelector(Uo(h))||t==="script"&&i.querySelector(Bo(h))||(t=i.createElement("link"),fn(t,"link",e),en(t),i.head.appendChild(t)))}}function VC(e,t){gr.m(e,t);var r=Es;if(r&&e){var i=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+Wn(i)+'"][href="'+Wn(e)+'"]',h=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ns(e)}if(!oa.has(h)&&(e=y({rel:"modulepreload",href:e},t),oa.set(h,e),r.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Bo(h)))return}i=r.createElement("link"),fn(i,"link",e),en(i),r.head.appendChild(i)}}}function $C(e,t,r){gr.S(e,t,r);var i=Es;if(i&&e){var d=Kl(i).hoistableStyles,h=Rs(e);t=t||"default";var S=d.get(h);if(!S){var N={loading:0,preload:null};if(S=i.querySelector(Uo(h)))N.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},r),(r=oa.get(h))&&nh(e,r);var z=S=i.createElement("link");en(z),fn(z,"link",e),z._p=new Promise(function(F,ee){z.onload=F,z.onerror=ee}),z.addEventListener("load",function(){N.loading|=1}),z.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Ec(S,t,i)}S={type:"stylesheet",instance:S,count:1,state:N},d.set(h,S)}}}function YC(e,t){gr.X(e,t);var r=Es;if(r&&e){var i=Kl(r).hoistableScripts,d=Ns(e),h=i.get(d);h||(h=r.querySelector(Bo(d)),h||(e=y({src:e,async:!0},t),(t=oa.get(d))&&ah(e,t),h=r.createElement("script"),en(h),fn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(d,h))}}function GC(e,t){gr.M(e,t);var r=Es;if(r&&e){var i=Kl(r).hoistableScripts,d=Ns(e),h=i.get(d);h||(h=r.querySelector(Bo(d)),h||(e=y({src:e,async:!0,type:"module"},t),(t=oa.get(d))&&ah(e,t),h=r.createElement("script"),en(h),fn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(d,h))}}function hy(e,t,r,i){var d=(d=ve.current)?Cc(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=Rs(r.href),r=Kl(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=Rs(r.href);var h=Kl(d).hoistableStyles,S=h.get(e);if(S||(d=d.ownerDocument||d,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,S),(h=d.querySelector(Uo(e)))&&!h._p&&(S.instance=h,S.state.loading=5),oa.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},oa.set(e,r),h||FC(d,e,r,S.state))),t&&i===null)throw Error(o(528,""));return S}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=Ns(r),r=Kl(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 Rs(e){return'href="'+Wn(e)+'"'}function Uo(e){return'link[rel="stylesheet"]['+e+"]"}function my(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function FC(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),en(t),e.head.appendChild(t))}function Ns(e){return'[src="'+Wn(e)+'"]'}function Bo(e){return"script[async]"+e}function py(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Wn(r.href)+'"]');if(i)return t.instance=i,en(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"),en(i),fn(i,"style",d),Ec(i,r.precedence,e),t.instance=i;case"stylesheet":d=Rs(r.href);var h=e.querySelector(Uo(d));if(h)return t.state.loading|=4,t.instance=h,en(h),h;i=my(r),(d=oa.get(d))&&nh(i,d),h=(e.ownerDocument||e).createElement("link"),en(h);var S=h;return S._p=new Promise(function(N,z){S.onload=N,S.onerror=z}),fn(h,"link",i),t.state.loading|=4,Ec(h,r.precedence,e),t.instance=h;case"script":return h=Ns(r.src),(d=e.querySelector(Bo(h)))?(t.instance=d,en(d),d):(i=r,(d=oa.get(h))&&(i=y({},r),ah(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),en(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,Ec(i,r.precedence,e));return t.instance}function Ec(e,t,r){for(var i=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,h=d,S=0;S<i.length;S++){var N=i[S];if(N.dataset.precedence===t)h=N;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function nh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ah(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Rc=null;function gy(e,t,r){if(Rc===null){var i=new Map,d=Rc=new Map;d.set(r,i)}else d=Rc,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 h=r[d];if(!(h[Ws]||h[on]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var S=h.getAttribute(t)||"";S=e+S;var N=i.get(S);N?N.push(h):i.set(S,[h])}}return i}function vy(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function KC(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 xy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function XC(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=Rs(i.href),h=t.querySelector(Uo(d));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Nc.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=h,en(h);return}h=t.ownerDocument||t,i=my(i),(d=oa.get(d))&&nh(i,d),h=h.createElement("link"),en(h);var S=h;S._p=new Promise(function(N,z){S.onload=N,S.onerror=z}),fn(h,"link",i),r.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Nc.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var rh=0;function QC(e,t){return e.stylesheets&&e.count===0&&Mc(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&Mc(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&rh===0&&(rh=62500*AC());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Mc(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>rh?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function Nc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Tc=null;function Mc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Tc=new Map,t.forEach(ZC,e),Tc=null,Nc.call(e))}function ZC(e,t){if(!(t.state.loading&4)){var r=Tc.get(e);if(r)var i=r.get(null);else{r=new Map,Tc.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var S=d[h];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(r.set(S.dataset.precedence,S),i=S)}i&&r.set(null,i)}d=t.instance,S=d.getAttribute("data-precedence"),h=r.get(S)||i,h===i&&r.set(null,d),r.set(S,d),this.count++,i=Nc.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Ho={$$typeof:T,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function JC(e,t,r,i,d,h,S,N,z){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=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function yy(e,t,r,i,d,h,S,N,z,F,ee,re){return e=new JC(e,t,r,S,z,F,ee,re,N),t=1,h===!0&&(t|=24),h=qn(3,null,null,t),e.current=h,h.stateNode=e,t=Ld(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:i,isDehydrated:r,cache:t},Id(h),e}function by(e){return e?(e=rs,e):rs}function wy(e,t,r,i,d,h){d=by(d),i.context===null?i.context=d:i.pendingContext=d,i=Hr(t),i.payload={element:r},h=h===void 0?null:h,h!==null&&(i.callback=h),r=Ir(e,i,t),r!==null&&(Tn(r,e,t),vo(r,e,t))}function Sy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function lh(e,t){Sy(e,t),(e=e.alternate)&&Sy(e,t)}function jy(e){if(e.tag===13||e.tag===31){var t=yl(e,67108864);t!==null&&Tn(t,e,67108864),lh(e,67108864)}}function Cy(e){if(e.tag===13||e.tag===31){var t=Fn();t=Za(t);var r=yl(e,t);r!==null&&Tn(r,e,t),lh(e,t)}}var Ac=!0;function WC(e,t,r,i){var d=_.T;_.T=null;var h=H.p;try{H.p=2,sh(e,t,r,i)}finally{H.p=h,_.T=d}}function e2(e,t,r,i){var d=_.T;_.T=null;var h=H.p;try{H.p=8,sh(e,t,r,i)}finally{H.p=h,_.T=d}}function sh(e,t,r,i){if(Ac){var d=oh(i);if(d===null)Gf(e,t,i,Dc,r),Ry(e,i);else if(n2(d,e,t,r,i))i.stopPropagation();else if(Ry(e,i),t&4&&-1<t2.indexOf(e)){for(;d!==null;){var h=Fl(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var S=it(h.pendingLanes);if(S!==0){var N=h;for(N.pendingLanes|=2,N.entangledLanes|=2;S;){var z=1<<31-ot(S);N.entanglements[1]|=z,S&=~z}Ba(h),(nt&6)===0&&(hc=bt()+500,_o(0))}}break;case 31:case 13:N=yl(h,2),N!==null&&Tn(N,h,2),pc(),lh(h,2)}if(h=oh(i),h===null&&Gf(e,t,i,Dc,r),h===d)break;d=h}d!==null&&i.stopPropagation()}else Gf(e,t,i,null,r)}}function oh(e){return e=id(e),ih(e)}var Dc=null;function ih(e){if(Dc=null,e=Gl(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 Dc=e,null}function Ey(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(sn()){case At:return 2;case Dt:return 8;case Wt:case Hn:return 32;case In:return 268435456;default:return 32}default:return 32}}var ch=!1,Zr=null,Jr=null,Wr=null,Io=new Map,Po=new Map,el=[],t2="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 Ry(e,t){switch(e){case"focusin":case"focusout":Zr=null;break;case"dragenter":case"dragleave":Jr=null;break;case"mouseover":case"mouseout":Wr=null;break;case"pointerover":case"pointerout":Io.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Po.delete(t.pointerId)}}function qo(e,t,r,i,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:h,targetContainers:[d]},t!==null&&(t=Fl(t),t!==null&&jy(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function n2(e,t,r,i,d){switch(t){case"focusin":return Zr=qo(Zr,e,t,r,i,d),!0;case"dragenter":return Jr=qo(Jr,e,t,r,i,d),!0;case"mouseover":return Wr=qo(Wr,e,t,r,i,d),!0;case"pointerover":var h=d.pointerId;return Io.set(h,qo(Io.get(h)||null,e,t,r,i,d)),!0;case"gotpointercapture":return h=d.pointerId,Po.set(h,qo(Po.get(h)||null,e,t,r,i,d)),!0}return!1}function Ny(e){var t=Gl(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,Or(e.priority,function(){Cy(r)});return}}else if(t===31){if(t=p(r),t!==null){e.blockedOn=t,Or(e.priority,function(){Cy(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 Oc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=oh(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);od=i,r.target.dispatchEvent(i),od=null}else return t=Fl(r),t!==null&&jy(t),e.blockedOn=r,!1;t.shift()}return!0}function Ty(e,t,r){Oc(e)&&r.delete(t)}function a2(){ch=!1,Zr!==null&&Oc(Zr)&&(Zr=null),Jr!==null&&Oc(Jr)&&(Jr=null),Wr!==null&&Oc(Wr)&&(Wr=null),Io.forEach(Ty),Po.forEach(Ty)}function _c(e,t){e.blockedOn===t&&(e.blockedOn=null,ch||(ch=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,a2)))}var kc=null;function My(e){kc!==e&&(kc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){kc===e&&(kc=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(ih(i||r)===null)continue;break}var h=Fl(r);h!==null&&(e.splice(t,3),t-=3,sf(h,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function Ts(e){function t(z){return _c(z,e)}Zr!==null&&_c(Zr,e),Jr!==null&&_c(Jr,e),Wr!==null&&_c(Wr,e),Io.forEach(t),Po.forEach(t);for(var r=0;r<el.length;r++){var i=el[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<el.length&&(r=el[0],r.blockedOn===null);)Ny(r),r.blockedOn===null&&el.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(i=0;i<r.length;i+=3){var d=r[i],h=r[i+1],S=d[Sn]||null;if(typeof h=="function")S||My(r);else if(S){var N=null;if(h&&h.hasAttribute("formAction")){if(d=h,S=h[Sn]||null)N=S.formAction;else if(ih(d)!==null)continue}else N=S.action;typeof N=="function"?r[i+1]=N:(r.splice(i,3),i-=3),My(r)}}}function Ay(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(S){return d=S})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),i||setTimeout(r,20)}function r(){if(!i&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.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 uh(e){this._internalRoot=e}zc.prototype.render=uh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var r=t.current,i=Fn();wy(r,i,e,t,null,null)},zc.prototype.unmount=uh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wy(e.current,2,null,e,null,null),pc(),t[Yl]=null}};function zc(e){this._internalRoot=e}zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=ya();e={blockedOn:null,target:e,priority:t};for(var r=0;r<el.length&&t!==0&&t<el[r].priority;r++);el.splice(r,0,e),r===0&&Ny(e)}};var Dy=a.version;if(Dy!=="19.2.8")throw Error(o(527,Dy,"19.2.8"));H.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 r2={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lc.isDisabled&&Lc.supportsFiber)try{se=Lc.inject(r2),Oe=Lc}catch{}}return $o.createRoot=function(e,t){if(!c(e))throw Error(o(299));var r=!1,i="",d=Bv,h=Hv,S=Iv;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&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(S=t.onRecoverableError)),t=yy(e,1,!1,null,null,r,i,null,d,h,S,Ay),e[Yl]=t.current,Yf(e),new uh(t)},$o.hydrateRoot=function(e,t,r){if(!c(e))throw Error(o(299));var i=!1,d="",h=Bv,S=Hv,N=Iv,z=null;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(S=r.onCaughtError),r.onRecoverableError!==void 0&&(N=r.onRecoverableError),r.formState!==void 0&&(z=r.formState)),t=yy(e,1,!0,t,r??null,i,d,z,h,S,N,Ay),t.context=by(null),r=t.current,i=Fn(),i=Za(i),d=Hr(i),d.callback=null,Ir(r,d,i),r=i,t.current.lanes=r,Ot(t,r),Ba(t),e[Yl]=t.current,Yf(e),new zc(t)},$o.version="19.2.8",$o}var $y;function m2(){if($y)return mh.exports;$y=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(),mh.exports=h2(),mh.exports}var p2=m2();const g2=Em(p2);/**
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 Nm=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,n0=/^[\\/]{2}/;function v2(n,a){return a+n.replace(/\\/g,"/")}var Yy="popstate";function Gy(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function x2(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 Vh("",{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 l(o,c){return typeof c=="string"?c:Jo(c)}return b2(a,l,null,n)}function kt(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 y2(){return Math.random().toString(36).substring(2,10)}function Fy(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 Vh(n,a,l=null,o,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Ps(a):a,state:l,key:a&&a.key||o||y2(),mask:c}}function Jo({pathname:n="/",search:a="",hash:l=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),l&&l!=="#"&&(n+=l.charAt(0)==="#"?l:"#"+l),n}function Ps(n){let a={};if(n){let l=n.indexOf("#");l>=0&&(a.hash=n.substring(l),n=n.substring(0,l));let o=n.indexOf("?");o>=0&&(a.search=n.substring(o),n=n.substring(0,o)),n&&(a.pathname=n)}return a}function b2(n,a,l,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:j.location,delta:R})}function b(C,R){p="PUSH";let M=Gy(C)?C:Vh(j.location,C,R);v=x()+1;let T=Fy(M,v),A=j.createHref(M.mask||M);try{f.pushState(T,"",A)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;c.location.assign(A)}u&&g&&g({action:p,location:j.location,delta:1})}function w(C,R){p="REPLACE";let M=Gy(C)?C:Vh(j.location,C,R);v=x();let T=Fy(M,v),A=j.createHref(M.mask||M);f.replaceState(T,"",A),u&&g&&g({action:p,location:j.location,delta:0})}function E(C){return w2(c,C)}let j={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(Yy,y),g=C,()=>{c.removeEventListener(Yy,y),g=null}},createHref(C){return a(c,C)},createURL:E,encodeLocation(C){let R=E(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:b,replace:w,go(C){return f.go(C)}};return j}function w2(n,a,l=!1){let o="http://localhost";n&&(o=n.location.origin!=="null"?n.location.origin:n.location.href),kt(o,"No window.location.(origin|href) available to create URL");let c=typeof a=="string"?a:Jo(a);return c=c.replace(/ $/,"%20"),!l&&n0.test(c)&&(c=o+c),new URL(c,o)}function a0(n,a,l="/"){return S2(n,a,l,!1)}function S2(n,a,l,o,c){let u=typeof a=="string"?Ps(a):a,f=Sr(u.pathname||"/",l);if(f==null)return null;let p=j2(n),g=null,v=k2(f);for(let x=0;g==null&&x<p.length;++x)g=_2(p[x],v,o);return g}function j2(n){let a=r0(n);return C2(a),a}function r0(n,a=[],l=[],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;kt(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=Na([o,x.relativePath]),b=l.concat(x);f.children&&f.children.length>0&&(kt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),r0(f.children,a,b,y,g)),!(f.path==null&&!f.index)&&a.push({path:y,score:D2(y,f.index),routesMeta:b.map((w,E)=>{let[j,C]=o0(w.relativePath,w.caseSensitive,E===b.length-1);return{...w,matcher:j,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 l0(f.path))u(f,p,!0,v)}),a}function l0(n){let a=n.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let f=l0(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 C2(n){n.sort((a,l)=>a.score!==l.score?l.score-a.score:O2(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}var E2=/^:[\w-]+$/,R2=3,N2=2,T2=1,M2=10,A2=-2,Ky=n=>n==="*";function D2(n,a){let l=n.split("/"),o=l.length;return l.some(Ky)&&(o+=A2),a&&(o+=N2),l.filter(c=>!Ky(c)).reduce((c,u)=>c+(E2.test(u)?R2:u===""?T2:M2),o)}function O2(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 _2(n,a,l=!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?s0(y,x,g.matcher,g.compiledParams):su(y,x),w=g.route;if(!b&&v&&l&&!o[o.length-1].route.index&&(b=su({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Na([u,b.pathname]),pathnameBase:U2(Na([u,b.pathnameBase])),route:w}),b.pathnameBase!=="/"&&(u=Na([u,b.pathnameBase]))}return f}function su(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[l,o]=o0(n.path,n.caseSensitive,n.end);return s0(n,a,l,o)}function s0(n,a,l,o){let c=a.match(l);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 E=p[b]||"";f=u.slice(0,u.length-E.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 o0(n,a=!1,l=!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==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?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 Sr(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=n.charAt(l);return o&&o!=="/"?null:n.slice(l)||"/"}function z2(n,a="/"){let{pathname:l,search:o="",hash:c=""}=typeof n=="string"?Ps(n):n,u;return l?(l=i0(l),l.startsWith("/")?u=Xy(l.substring(1),"/"):u=Xy(l,a)):u=a,{pathname:u,search:B2(o),hash:H2(c)}}function Xy(n,a){let l=ou(a).split("/");return n.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function xh(n,a,l,o){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function L2(n){return n.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Tm(n){let a=L2(n);return a.map((l,o)=>o===a.length-1?l.pathname:l.pathnameBase)}function Cu(n,a,l,o=!1){let c;typeof n=="string"?c=Ps(n):(c={...n},kt(!c.pathname||!c.pathname.includes("?"),xh("?","pathname","search",c)),kt(!c.pathname||!c.pathname.includes("#"),xh("#","pathname","hash",c)),kt(!c.search||!c.search.includes("#"),xh("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=l;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=z2(c,p),v=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}var i0=n=>n.replace(/[\\/]{2,}/g,"/"),Na=n=>i0(n.join("/")),ou=n=>n.replace(/\/+$/,""),U2=n=>ou(n).replace(/^\/*/,"/"),B2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,H2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,I2=class{constructor(n,a,l,o=!1){this.status=n,this.statusText=a||"",this.internal=o,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function P2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function q2(n){let a=n.map(l=>l.route.path).filter(Boolean);return Na(a)||"/"}var c0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function u0(n,a){let l=n;if(typeof l!="string"||!Nm.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let o=l,c=!1;if(c0)try{let u=new URL(window.location.href),f=n0.test(l)?new URL(v2(l,u.protocol)):new URL(l),p=Sr(f.pathname,a);f.origin===u.origin&&p!=null?l=p+f.search+f.hash:c=!0}catch{ha(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:c,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var d0=["POST","PUT","PATCH","DELETE"];new Set(d0);var V2=["GET",...d0];new Set(V2);var $2=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Y2(n){try{return $2.includes(new URL(n).protocol)}catch{return!1}}var qs=m.createContext(null);qs.displayName="DataRouter";var Eu=m.createContext(null);Eu.displayName="DataRouterState";var f0=m.createContext(!1);function G2(){return m.useContext(f0)}var h0=m.createContext({isTransitioning:!1});h0.displayName="ViewTransition";var F2=m.createContext(new Map);F2.displayName="Fetchers";var K2=m.createContext(null);K2.displayName="Await";var Xn=m.createContext(null);Xn.displayName="Navigation";var fi=m.createContext(null);fi.displayName="Location";var Fa=m.createContext({outlet:null,matches:[],isDataRoute:!1});Fa.displayName="Route";var Mm=m.createContext(null);Mm.displayName="RouteError";var m0="REACT_ROUTER_ERROR",X2="REDIRECT",Q2="ROUTE_ERROR_RESPONSE";function Z2(n){if(n.startsWith(`${m0}:${X2}:{`))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 J2(n){if(n.startsWith(`${m0}:${Q2}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new I2(a.status,a.statusText,a.data)}catch{}}function W2(n,{relative:a}={}){kt(Vs(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:o}=m.useContext(Xn),{hash:c,pathname:u,search:f}=mi(n,{relative:a}),p=u;return l!=="/"&&(p=u==="/"?l:Na([l,u])),o.createHref({pathname:p,search:f,hash:c})}function Vs(){return m.useContext(fi)!=null}function Ln(){return kt(Vs(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(fi).location}var p0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function g0(n){m.useContext(Xn).static||m.useLayoutEffect(n)}function hi(){let{isDataRoute:n}=m.useContext(Fa);return n?fE():eE()}function eE(){kt(Vs(),"useNavigate() may be used only in the context of a <Router> component.");let n=m.useContext(qs),{basename:a,navigator:l}=m.useContext(Xn),{matches:o}=m.useContext(Fa),{pathname:c}=Ln(),u=JSON.stringify(Tm(o)),f=m.useRef(!1);return g0(()=>{f.current=!0}),m.useCallback((g,v={})=>{if(ha(f.current,p0),!f.current)return;if(typeof g=="number"){l.go(g);return}let x=Cu(g,JSON.parse(u),c,v.relative==="path");n==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Na([a,x.pathname])),(v.replace?l.replace:l.push)(x,v.state,v)},[a,l,u,c,n])}m.createContext(null);function mi(n,{relative:a}={}){let{matches:l}=m.useContext(Fa),{pathname:o}=Ln(),c=JSON.stringify(Tm(l));return m.useMemo(()=>Cu(n,JSON.parse(c),o,a==="path"),[n,c,o,a])}function tE(n,a){return v0(n,a)}function v0(n,a,l){var C;kt(Vs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=m.useContext(Xn),{matches:c}=m.useContext(Fa),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||"";y0(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=Ln(),y;if(a){let R=typeof a=="string"?Ps(a):a;kt(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 E=l&&l.state.matches.length?l.state.matches.map(R=>Object.assign(R,{route:l.manifest[R.route.id]||R.route})):a0(n,{pathname:w});ha(v||E!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),ha(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.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 j=sE(E&&E.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Na([g,o.encodeLocation?o.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?g:Na([g,o.encodeLocation?o.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),c,l);return a&&j?m.createElement(fi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},j):j}function nE(){let n=dE(),a=P2(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),l=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=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:u},"ErrorBoundary")," or"," ",m.createElement("code",{style:u},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},a),l?m.createElement("pre",{style:c},l):null,f)}var aE=m.createElement(nE,null),x0=class extends m.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 l=J2(n.digest);l&&(n=l)}let a=n!==void 0?m.createElement(Fa.Provider,{value:this.props.routeContext},m.createElement(Mm.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?m.createElement(rE,{error:n},a):a}};x0.contextType=f0;var yh=new WeakMap;function rE({children:n,error:a}){let{basename:l}=m.useContext(Xn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=Z2(a.digest);if(o){let c=yh.get(a);if(c)throw c;let u=u0(o.location,l),f=u.absoluteURL||u.to;if(Y2(f))throw new Error("Invalid redirect location");if(c0&&!yh.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 yh.set(a,p),p}return m.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return n}function lE({routeContext:n,match:a,children:l}){let o=m.useContext(qs);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),m.createElement(Fa.Provider,{value:n},l)}function sE(n,a=[],l){let o=l==null?void 0:l.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);kt(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(l&&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,E=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||E){l.isStatic&&(f=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let g=l==null?void 0:l.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:q2(o.matches),errorInfo:y})}:void 0;return c.reduceRight((x,y,b)=>{let w,E=!1,j=null,C=null;o&&(w=u&&y.route.id?u[y.route.id]:void 0,j=y.route.errorElement||aE,f&&(p<0&&b===0?(y0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,C=null):p===b&&(E=!0,C=y.route.hydrateFallbackElement||null)));let R=a.concat(c.slice(0,b+1)),M=()=>{let T;return w?T=j:E?T=C:y.route.Component?T=m.createElement(y.route.Component,null):y.route.element?T=y.route.element:T=x,m.createElement(lE,{match:y,routeContext:{outlet:x,matches:R,isDataRoute:o!=null},children:T})};return o&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?m.createElement(x0,{location:o.location,revalidation:o.revalidation,component:j,error:w,children:M(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:v}):M()},null)}function Am(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function oE(n){let a=m.useContext(qs);return kt(a,Am(n)),a}function iE(n){let a=m.useContext(Eu);return kt(a,Am(n)),a}function cE(n){let a=m.useContext(Fa);return kt(a,Am(n)),a}function Dm(n){let a=cE(n),l=a.matches[a.matches.length-1];return kt(l.route.id,`${n} can only be used on routes that contain a unique "id"`),l.route.id}function uE(){return Dm("useRouteId")}function dE(){var o;let n=m.useContext(Mm),a=iE("useRouteError"),l=Dm("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[l]}function fE(){let{router:n}=oE("useNavigate"),a=Dm("useNavigate"),l=m.useRef(!1);return g0(()=>{l.current=!0}),m.useCallback(async(c,u={})=>{ha(l.current,p0),l.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...u}))},[n,a])}var Qy={};function y0(n,a,l){!a&&!Qy[n]&&(Qy[n]=!0,ha(!1,l))}m.memo(hE);function hE({routes:n,manifest:a,future:l,state:o,isStatic:c,onError:u}){return v0(n,void 0,{manifest:a,state:o,isStatic:c,onError:u})}function $h({to:n,replace:a,state:l,relative:o}){kt(Vs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=m.useContext(Xn);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}=m.useContext(Fa),{pathname:f}=Ln(),p=hi(),g=Cu(n,Tm(u),f,o==="path"),v=JSON.stringify(g);return m.useEffect(()=>{p(JSON.parse(v),{replace:a,state:l,relative:o})},[p,v,o,a,l]),null}function Mn(n){kt(!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 mE({basename:n="/",children:a=null,location:l,navigationType:o="POP",navigator:c,static:u=!1,useTransitions:f}){kt(!Vs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=m.useMemo(()=>({basename:p,navigator:c,static:u,useTransitions:f,future:{}}),[p,c,u,f]);typeof l=="string"&&(l=Ps(l));let{pathname:v="/",search:x="",hash:y="",state:b=null,key:w="default",mask:E}=l,j=m.useMemo(()=>{let C=Sr(v,p);return C==null?null:{location:{pathname:C,search:x,hash:y,state:b,key:w,mask:E},navigationType:o}},[p,v,x,y,b,w,o,E]);return ha(j!=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.`),j==null?null:m.createElement(Xn.Provider,{value:g},m.createElement(fi.Provider,{children:a,value:j}))}function b0({children:n,location:a}){return tE(Yh(n),a)}function Yh(n,a=[]){let l=[];return m.Children.forEach(n,(o,c)=>{if(!m.isValidElement(o))return;let u=[...a,c];if(o.type===m.Fragment){l.push.apply(l,Yh(o.props.children,u));return}kt(o.type===Mn,`[${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>`),kt(!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)),l.push(f)}),l}var Wc="get",eu="application/x-www-form-urlencoded";function Ru(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function pE(n){return Ru(n)&&n.tagName.toLowerCase()==="button"}function gE(n){return Ru(n)&&n.tagName.toLowerCase()==="form"}function vE(n){return Ru(n)&&n.tagName.toLowerCase()==="input"}function xE(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function yE(n,a){return n.button===0&&(!a||a==="_self")&&!xE(n)}function Gh(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,l)=>{let o=n[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function bE(n,a){let l=Gh(n);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(u=>{l.append(c,u)})}),l}var Uc=null;function wE(){if(Uc===null)try{new FormData(document.createElement("form"),0),Uc=!1}catch{Uc=!0}return Uc}var SE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function bh(n){return n!=null&&!SE.has(n)?(ha(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${eu}"`),null):n}function jE(n,a){let l,o,c,u,f;if(gE(n)){let p=n.getAttribute("action");o=p?Sr(p,a):null,l=n.getAttribute("method")||Wc,c=bh(n.getAttribute("enctype"))||eu,u=new FormData(n)}else if(pE(n)||vE(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?Sr(g,a):null,l=n.getAttribute("formmethod")||p.getAttribute("method")||Wc,c=bh(n.getAttribute("formenctype"))||bh(p.getAttribute("enctype"))||eu,u=new FormData(p,n),!wE()){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(Ru(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=Wc,o=null,c=eu,f=n}return u&&c==="text/plain"&&(f=u,u=void 0),{action:o,method:l.toLowerCase(),encType:c,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Om(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function w0(n,a,l,o){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return l?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:a&&Sr(c.pathname,a)==="/"?c.pathname=`${ou(a)}/_root.${o}`:c.pathname=`${ou(c.pathname)}.${o}`,c}async function CE(n,a){if(n.id in a)return a[n.id];try{let l=await import(n.module);return a[n.id]=l,l}catch(l){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function EE(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 RE(n,a,l){let o=await Promise.all(n.map(async c=>{let u=a.routes[c.route.id];if(u){let f=await CE(u,l);return f.links?f.links():[]}return[]}));return AE(o.flat(1).filter(EE).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Zy(n,a,l,o,c,u){let f=(g,v)=>l[v]?g.route.id!==l[v].route.id:!0,p=(g,v)=>{var x;return l[v].pathname!==g.pathname||((x=l[v].route.path)==null?void 0:x.endsWith("*"))&&l[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=l[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 NE(n,a,{includeHydrateFallback:l}={}){return TE(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)),l&&c.hydrateFallbackModule&&(u=u.concat(c.hydrateFallbackModule)),c.imports&&(u=u.concat(c.imports)),u}).flat(1))}function TE(n){return[...new Set(n)]}function ME(n){let a={},l=Object.keys(n).sort();for(let o of l)a[o]=n[o];return a}function AE(n,a){let l=new Set;return new Set(a),n.reduce((o,c)=>{let u=JSON.stringify(ME(c));return l.has(u)||(l.add(u),o.push({key:u,link:c})),o},[])}function _m(){let n=m.useContext(qs);return Om(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function DE(){let n=m.useContext(Eu);return Om(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var km=m.createContext(void 0);km.displayName="FrameworkContext";function Nu(){let n=m.useContext(km);return Om(n,"You must render this element inside a <HydratedRouter> element"),n}function OE(n,a){let l=m.useContext(km),[o,c]=m.useState(!1),[u,f]=m.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:v,onMouseLeave:x,onTouchStart:y}=a,b=m.useRef(null);m.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let j=R=>{R.forEach(M=>{f(M.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[n]),m.useEffect(()=>{if(o){let j=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(j)}}},[o]);let w=()=>{c(!0)},E=()=>{c(!1),f(!1)};return l?n!=="intent"?[u,b,{}]:[u,b,{onFocus:Yo(p,w),onBlur:Yo(g,E),onMouseEnter:Yo(v,w),onMouseLeave:Yo(x,E),onTouchStart:Yo(y,w)}]:[!1,b,{}]}function Yo(n,a){return l=>{n&&n(l),l.defaultPrevented||a(l)}}function _E({page:n,...a}){let l=G2(),{nonce:o}=Nu(),{router:c}=_m(),u=m.useMemo(()=>a0(c.routes,n,c.basename),[c.routes,n,c.basename]);return u?(a.nonce==null&&o&&(a={...a,nonce:o}),l?m.createElement(zE,{page:n,matches:u,...a}):m.createElement(LE,{page:n,matches:u,...a})):null}function kE(n){let{manifest:a,routeModules:l}=Nu(),[o,c]=m.useState([]);return m.useEffect(()=>{let u=!1;return RE(n,a,l).then(f=>{u||c(f)}),()=>{u=!0}},[n,a,l]),o}function zE({page:n,matches:a,...l}){let o=Ln(),{future:c}=Nu(),{basename:u}=_m(),f=m.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let p=w0(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 m.createElement(m.Fragment,null,f.map(p=>m.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...l})))}function LE({page:n,matches:a,...l}){let o=Ln(),{future:c,manifest:u,routeModules:f}=Nu(),{basename:p}=_m(),{loaderData:g,matches:v}=DE(),x=m.useMemo(()=>Zy(n,a,v,u,o,"data"),[n,a,v,u,o]),y=m.useMemo(()=>Zy(n,a,v,u,o,"assets"),[n,a,v,u,o]),b=m.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let j=new Set,C=!1;if(a.forEach(M=>{var A;let T=u.routes[M.route.id];!T||!T.hasLoader||(!x.some(U=>U.route.id===M.route.id)&&M.route.id in g&&((A=f[M.route.id])!=null&&A.shouldRevalidate)||T.hasClientLoader?C=!0:j.add(M.route.id))}),j.size===0)return[];let R=w0(n,p,c.v8_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&R.searchParams.set("_routes",a.filter(M=>j.has(M.route.id)).map(M=>M.route.id).join(",")),[R.pathname+R.search]},[p,c.v8_trailingSlashAwareDataRequests,g,o,u,x,a,n,f]),w=m.useMemo(()=>NE(y,u),[y,u]),E=kE(y);return m.createElement(m.Fragment,null,b.map(j=>m.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...l})),w.map(j=>m.createElement("link",{key:j,rel:"modulepreload",href:j,...l})),E.map(({key:j,link:C})=>m.createElement("link",{key:j,nonce:l.nonce,...C,crossOrigin:C.crossOrigin??l.crossOrigin})))}function UE(...n){return a=>{n.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var BE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{BE&&(window.__reactRouterVersion="7.18.2")}catch{}function HE({basename:n,children:a,useTransitions:l,window:o}){let c=m.useRef();c.current==null&&(c.current=x2({window:o,v5Compat:!0}));let u=c.current,[f,p]=m.useState({action:u.action,location:u.location}),g=m.useCallback(v=>{l===!1?p(v):m.startTransition(()=>p(v))},[l]);return m.useLayoutEffect(()=>u.listen(g),[u,g]),m.createElement(mE,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:u,useTransitions:l})}var ia=m.forwardRef(function({onClick:a,discover:l="render",prefetch:o="none",relative:c,reloadDocument:u,replace:f,mask:p,state:g,target:v,to:x,preventScrollReset:y,viewTransition:b,defaultShouldRevalidate:w,...E},j){let{basename:C,navigator:R,useTransitions:M}=m.useContext(Xn),T=typeof x=="string"&&Nm.test(x),A=u0(x,C);x=A.to;let U=W2(x,{relative:c}),D=Ln(),B=null;if(p){let ae=Cu(p,[],D.mask?D.mask.pathname:"/",!0);C!=="/"&&(ae.pathname=ae.pathname==="/"?C:Na([C,ae.pathname])),B=R.createHref(ae)}let[O,V,L]=OE(o,E),J=qE(x,{replace:f,mask:p,state:g,target:v,preventScrollReset:y,relative:c,viewTransition:b,defaultShouldRevalidate:w,useTransitions:M});function G(ae){a&&a(ae),ae.defaultPrevented||J(ae)}let oe=!(A.isExternal||u),ce=m.createElement("a",{...E,...L,href:(oe?B:void 0)||A.absoluteURL||U,onClick:oe?G:a,ref:UE(j,V),target:v,"data-discover":!T&&l==="render"?"true":void 0});return O&&!T?m.createElement(m.Fragment,null,ce,m.createElement(_E,{page:U})):ce});ia.displayName="Link";var S0=m.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:o="",end:c=!1,style:u,to:f,viewTransition:p,children:g,...v},x){let y=mi(f,{relative:v.relative}),b=Ln(),w=m.useContext(Eu),{navigator:E,basename:j}=m.useContext(Xn),C=w!=null&&KE(y)&&p===!0,R=E.encodeLocation?E.encodeLocation(y).pathname:y.pathname,M=b.pathname,T=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;l||(M=M.toLowerCase(),T=T?T.toLowerCase():null,R=R.toLowerCase()),T&&j&&(T=Sr(T,j)||T);const A=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let U=M===R||!c&&M.startsWith(R)&&M.charAt(A)==="/",D=T!=null&&(T===R||!c&&T.startsWith(R)&&T.charAt(R.length)==="/"),B={isActive:U,isPending:D,isTransitioning:C},O=U?a:void 0,V;typeof o=="function"?V=o(B):V=[o,U?"active":null,D?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let L=typeof u=="function"?u(B):u;return m.createElement(ia,{...v,"aria-current":O,className:V,ref:x,style:L,to:f,viewTransition:p},typeof g=="function"?g(B):g)});S0.displayName="NavLink";var IE=m.forwardRef(({discover:n="render",fetcherKey:a,navigate:l,reloadDocument:o,replace:c,state:u,method:f=Wc,action:p,onSubmit:g,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b,...w},E)=>{let{useTransitions:j}=m.useContext(Xn),C=GE(),R=FE(p,{relative:v}),M=f.toLowerCase()==="get"?"get":"post",T=typeof p=="string"&&Nm.test(p),A=U=>{if(g&&g(U),U.defaultPrevented)return;U.preventDefault();let D=U.nativeEvent.submitter,B=(D==null?void 0:D.getAttribute("formmethod"))||f,O=()=>C(D||U.currentTarget,{fetcherKey:a,method:B,navigate:l,replace:c,state:u,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b});j&&l!==!1?m.startTransition(()=>O()):O()};return m.createElement("form",{ref:E,method:M,action:R,onSubmit:o?g:A,...w,"data-discover":!T&&n==="render"?"true":void 0})});IE.displayName="Form";function PE(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function j0(n){let a=m.useContext(qs);return kt(a,PE(n)),a}function qE(n,{target:a,replace:l,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g,useTransitions:v}={}){let x=hi(),y=Ln(),b=mi(n,{relative:f});return m.useCallback(w=>{if(yE(w,a)){w.preventDefault();let E=l!==void 0?l:Jo(y)===Jo(b),j=()=>x(n,{replace:E,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g});v?m.startTransition(()=>j()):j()}},[y,x,b,l,o,c,a,n,u,f,p,g,v])}function VE(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=m.useRef(Gh(n)),l=m.useRef(!1),o=Ln(),c=m.useMemo(()=>bE(o.search,l.current?null:a.current),[o.search]),u=hi(),f=m.useCallback((p,g)=>{const v=Gh(typeof p=="function"?p(new URLSearchParams(c)):p);l.current=!0,u("?"+v,g)},[u,c]);return[c,f]}var $E=0,YE=()=>`__${String(++$E)}__`;function GE(){let{router:n}=j0("useSubmit"),{basename:a}=m.useContext(Xn),l=uE(),o=n.fetch,c=n.navigate;return m.useCallback(async(u,f={})=>{let{action:p,method:g,encType:v,formData:x,body:y}=jE(u,a);if(f.navigate===!1){let b=f.fetcherKey||YE();await o(b,l,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:l,flushSync:f.flushSync,viewTransition:f.viewTransition})},[o,c,a,l])}function FE(n,{relative:a}={}){let{basename:l}=m.useContext(Xn),o=m.useContext(Fa);kt(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),u={...mi(n||".",{relative:a})},f=Ln();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"),l!=="/"&&(u.pathname=u.pathname==="/"?l:Na([l,u.pathname])),Jo(u)}function KE(n,{relative:a}={}){let l=m.useContext(h0);kt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=j0("useViewTransitionState"),c=mi(n,{relative:a});if(!l.isTransitioning)return!1;let u=Sr(l.currentLocation.pathname,o)||l.currentLocation.pathname,f=Sr(l.nextLocation.pathname,o)||l.nextLocation.pathname;return su(c.pathname,f)!=null||su(c.pathname,u)!=null}var Ra=t0();const XE=Em(Ra),Tu="",iu="x-csrf-token",Jy=new Set(["/api/admin/login","/api/admin/setup"]);let kl=null,wh=null;async function zm(){return kl||(wh??(wh=fetch(`${Tu}/api/admin/csrf`,{credentials:"include"}).then(async n=>{if(!n.ok)throw new Error("Unable to acquire CSRF token");return kl=(await n.json()).csrfToken,kl}).finally(()=>{wh=null})),wh)}class Lm extends Error{constructor(a,l,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=l,this.body=o}}async function C0(n){var o;const a=await n.text();let l;try{l=a?JSON.parse(a):void 0}catch{l=a}if(!n.ok)throw new Lm(n.status,typeof l=="object"&&l&&"error"in l?String(((o=l.error)==null?void 0:o.type)??"error"):"error",l);return l}async function Os(n,a,l,o,c=!0){const u=l!==void 0,f={...o==null?void 0:o.headers};u&&!f["content-type"]&&(f["content-type"]="application/json"),n!=="GET"&&n!=="HEAD"&&!Jy.has(a)&&!f[iu]&&(f[iu]=await zm());const p=await fetch(`${Tu}${a}`,{...o,method:n,headers:f,body:u?JSON.stringify(l):void 0,credentials:"include"});try{return await C0(p)}catch(g){const v=g instanceof Lm&&(g.status===401||g.status===403)&&(g.type==="authentication_error"||g.type==="csrf_error");if(c&&v&&n!=="GET"&&n!=="HEAD"&&!Jy.has(a))return kl=null,Os(n,a,l,o,!1);throw g}}async function E0(n,a,l=!0){const o=await fetch(`${Tu}${n}`,{method:"POST",headers:{[iu]:await zm()},body:a,credentials:"include"});try{return await C0(o)}catch(c){const u=c instanceof Lm&&(c.status===401||c.status===403)&&(c.type==="authentication_error"||c.type==="csrf_error");if(l&&u)return kl=null,E0(n,a,!1);throw c}}async function Um(n,a,l=!0){const o={...a==null?void 0:a.headers,[iu]:await zm()},c=await fetch(`${Tu}${n}`,{...a,headers:o,credentials:"include"});return l&&c.status===403?(kl=null,Um(n,a,!1)):c}const we={get:(n,a)=>Os("GET",n,void 0,a),post:(n,a,l)=>Os("POST",n,a,l),upload:E0,patch:(n,a,l)=>Os("PATCH",n,a,l),put:(n,a,l)=>Os("PUT",n,a,l),del:(n,a)=>Os("DELETE",n,void 0,a)},R0=m.createContext(void 0);function QE({children:n}){const[a,l]=m.useState(null),[o,c]=m.useState(!0),u=m.useCallback(async()=>{try{const g=await we.get("/api/admin/me");l(g)}catch{l(null)}finally{c(!1)}},[]);m.useEffect(()=>{u()},[u]);const f=m.useCallback(async(g,v,x,y)=>{const b={username:g,password:v};x&&(b.totp=x),y&&(b.recoveryCode=y);try{const w=await we.post("/api/admin/login",b);return l({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const E=w.status,j=w.type;if(E===401&&j==="totp_required")return{totpRequired:!0};throw w}},[]),p=m.useCallback(async()=>{await we.post("/api/admin/logout"),l(null)},[]);return s.jsx(R0.Provider,{value:{user:a,loading:o,login:f,logout:p,refresh:u},children:n})}function Bm(){const n=m.useContext(R0);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 ZE=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),N0=(...n)=>n.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).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 JE={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 WE=m.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:f,...p},g)=>m.createElement("svg",{ref:g,...JE,width:a,height:a,stroke:n,strokeWidth:o?Number(l)*24/Number(a):l,className:N0("lucide",c),...p},[...f.map(([v,x])=>m.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 ke=(n,a)=>{const l=m.forwardRef(({className:o,...c},u)=>m.createElement(WE,{ref:u,iconNode:a,className:N0(`lucide-${ZE(n)}`,o),...c}));return l.displayName=`${n}`,l};/**
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 Hm=ke("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 eR=ke("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 tR=ke("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 nR=ke("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 T0=ke("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 aR=ke("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 rR=ke("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"}]]);/**
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 pi=ke("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 lR=ke("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"}]]);/**
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 sR=ke("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
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 oR=ke("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"}]]);/**
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 iR=ke("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"}]]);/**
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 Ko=ke("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"}]]);/**
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 cR=ke("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"}]]);/**
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 uR=ke("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"}]]);/**
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 M0=ke("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"}]]);/**
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 dR=ke("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"}]]);/**
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 fR=ke("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"}]]);/**
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 hR=ke("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"}]]);/**
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 A0=ke("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
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 mR=ke("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"}]]);/**
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 D0=ke("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"}]]);/**
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 O0=ke("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"}]]);/**
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 ks=ke("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 pR=ke("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"}]]);/**
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 gR=ke("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"}]]);/**
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 vR=ke("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
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 _0=ke("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"}]]);/**
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 xR=ke("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"}]]);/**
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 k0=ke("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
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 Mu=ke("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 yR=ke("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"}]]);/**
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 bR=ke("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"}]]);/**
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 z0=ke("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 wR=ke("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"}]]);/**
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 SR=ke("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"}]]);/**
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 jR=ke("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"}]]);/**
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 CR=ke("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"}]]);/**
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 Au=ke("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"}]]);/**
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 ER=ke("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"}]]);/**
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 L0=ke("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
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 RR=ke("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"}]]);/**
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 Du=ke("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
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 NR=ke("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 U0(n){var a,l,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]&&(l=U0(n[a]))&&(o&&(o+=" "),o+=l)}else for(l in n)n[l]&&(o&&(o+=" "),o+=l);return o}function B0(){for(var n,a,l=0,o="",c=arguments.length;l<c;l++)(n=arguments[l])&&(a=U0(n))&&(o&&(o+=" "),o+=a);return o}const Im="-",TR=n=>{const a=AR(n),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:f=>{const p=f.split(Im);return p[0]===""&&p.length!==1&&p.shift(),H0(p,a)||MR(f)},getConflictingClassGroupIds:(f,p)=>{const g=l[f]||[];return p&&o[f]?[...g,...o[f]]:g}}},H0=(n,a)=>{var f;if(n.length===0)return a.classGroupId;const l=n[0],o=a.nextPart.get(l),c=o?H0(n.slice(1),o):void 0;if(c)return c;if(a.validators.length===0)return;const u=n.join(Im);return(f=a.validators.find(({validator:p})=>p(u)))==null?void 0:f.classGroupId},Wy=/^\[(.+)\]$/,MR=n=>{if(Wy.test(n)){const a=Wy.exec(n)[1],l=a==null?void 0:a.substring(0,a.indexOf(":"));if(l)return"arbitrary.."+l}},AR=n=>{const{theme:a,prefix:l}=n,o={nextPart:new Map,validators:[]};return OR(Object.entries(n.classGroups),l).forEach(([u,f])=>{Fh(f,o,u,a)}),o},Fh=(n,a,l,o)=>{n.forEach(c=>{if(typeof c=="string"){const u=c===""?a:eb(a,c);u.classGroupId=l;return}if(typeof c=="function"){if(DR(c)){Fh(c(o),a,l,o);return}a.validators.push({validator:c,classGroupId:l});return}Object.entries(c).forEach(([u,f])=>{Fh(f,eb(a,u),l,o)})})},eb=(n,a)=>{let l=n;return a.split(Im).forEach(o=>{l.nextPart.has(o)||l.nextPart.set(o,{nextPart:new Map,validators:[]}),l=l.nextPart.get(o)}),l},DR=n=>n.isThemeGetter,OR=(n,a)=>a?n.map(([l,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[l,c]}):n,_R=n=>{if(n<1)return{get:()=>{},set:()=>{}};let a=0,l=new Map,o=new Map;const c=(u,f)=>{l.set(u,f),a++,a>n&&(a=0,o=l,l=new Map)};return{get(u){let f=l.get(u);if(f!==void 0)return f;if((f=o.get(u))!==void 0)return c(u,f),f},set(u,f){l.has(u)?l.set(u,f):c(u,f)}}},I0="!",kR=n=>{const{separator:a,experimentalParseClassName:l}=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(I0),E=w?b.substring(1):b,j=y&&y>x?y-x:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:E,maybePostfixModifierPosition:j}};return l?p=>l({className:p,parseClassName:f}):f},zR=n=>{if(n.length<=1)return n;const a=[];let l=[];return n.forEach(o=>{o[0]==="["?(a.push(...l.sort(),o),l=[]):l.push(o)}),a.push(...l.sort()),a},LR=n=>({cache:_R(n.cacheSize),parseClassName:kR(n),...TR(n)}),UR=/\s+/,BR=(n,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c}=a,u=[],f=n.trim().split(UR);let p="";for(let g=f.length-1;g>=0;g-=1){const v=f[g],{modifiers:x,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:w}=l(v);let E=!!w,j=o(E?b.substring(0,w):b);if(!j){if(!E){p=v+(p.length>0?" "+p:p);continue}if(j=o(b),!j){p=v+(p.length>0?" "+p:p);continue}E=!1}const C=zR(x).join(":"),R=y?C+I0:C,M=R+j;if(u.includes(M))continue;u.push(M);const T=c(j,E);for(let A=0;A<T.length;++A){const U=T[A];u.push(R+U)}p=v+(p.length>0?" "+p:p)}return p};function HR(){let n=0,a,l,o="";for(;n<arguments.length;)(a=arguments[n++])&&(l=P0(a))&&(o&&(o+=" "),o+=l);return o}const P0=n=>{if(typeof n=="string")return n;let a,l="";for(let o=0;o<n.length;o++)n[o]&&(a=P0(n[o]))&&(l&&(l+=" "),l+=a);return l};function IR(n,...a){let l,o,c,u=f;function f(g){const v=a.reduce((x,y)=>y(x),n());return l=LR(v),o=l.cache.get,c=l.cache.set,u=p,p(g)}function p(g){const v=o(g);if(v)return v;const x=BR(g,l);return c(g,x),x}return function(){return u(HR.apply(null,arguments))}}const Tt=n=>{const a=l=>l[n]||[];return a.isThemeGetter=!0,a},q0=/^\[(?:([a-z-]+):)?(.+)\]$/i,PR=/^\d+\/\d+$/,qR=new Set(["px","full","screen"]),VR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$R=/\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$/,YR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,GR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vr=n=>zs(n)||qR.has(n)||PR.test(n),nl=n=>$s(n,"length",tN),zs=n=>!!n&&!Number.isNaN(Number(n)),Sh=n=>$s(n,"number",zs),Go=n=>!!n&&Number.isInteger(Number(n)),KR=n=>n.endsWith("%")&&zs(n.slice(0,-1)),Ie=n=>q0.test(n),al=n=>VR.test(n),XR=new Set(["length","size","percentage"]),QR=n=>$s(n,XR,V0),ZR=n=>$s(n,"position",V0),JR=new Set(["image","url"]),WR=n=>$s(n,JR,aN),eN=n=>$s(n,"",nN),Fo=()=>!0,$s=(n,a,l)=>{const o=q0.exec(n);return o?o[1]?typeof a=="string"?o[1]===a:a.has(o[1]):l(o[2]):!1},tN=n=>$R.test(n)&&!YR.test(n),V0=()=>!1,nN=n=>GR.test(n),aN=n=>FR.test(n),rN=()=>{const n=Tt("colors"),a=Tt("spacing"),l=Tt("blur"),o=Tt("brightness"),c=Tt("borderColor"),u=Tt("borderRadius"),f=Tt("borderSpacing"),p=Tt("borderWidth"),g=Tt("contrast"),v=Tt("grayscale"),x=Tt("hueRotate"),y=Tt("invert"),b=Tt("gap"),w=Tt("gradientColorStops"),E=Tt("gradientColorStopPositions"),j=Tt("inset"),C=Tt("margin"),R=Tt("opacity"),M=Tt("padding"),T=Tt("saturate"),A=Tt("scale"),U=Tt("sepia"),D=Tt("skew"),B=Tt("space"),O=Tt("translate"),V=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],J=()=>["auto",Ie,a],G=()=>[Ie,a],oe=()=>["",vr,nl],ce=()=>["auto",zs,Ie],ae=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",Ie],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>[zs,Ie];return{cacheSize:500,separator:":",theme:{colors:[Fo],spacing:[vr,nl],blur:["none","",al,Ie],brightness:k(),borderColor:[n],borderRadius:["none","","full",al,Ie],borderSpacing:G(),borderWidth:oe(),contrast:k(),grayscale:W(),hueRotate:k(),invert:W(),gap:G(),gradientColorStops:[n],gradientColorStopPositions:[KR,nl],inset:J(),margin:J(),opacity:k(),padding:G(),saturate:k(),scale:k(),sepia:W(),skew:k(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",Ie]}],container:["container"],columns:[{columns:[al]}],"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:[...ae(),Ie]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Go,Ie]}],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",Ie]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Go,Ie]}],"grid-cols":[{"grid-cols":[Fo]}],"col-start-end":[{col:["auto",{span:["full",Go,Ie]},Ie]}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":[Fo]}],"row-start-end":[{row:["auto",{span:[Go,Ie]},Ie]}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ie]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],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":[B]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[B]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ie,a]}],"min-w":[{"min-w":[Ie,a,"min","max","fit"]}],"max-w":[{"max-w":[Ie,a,"none","full","min","max","fit","prose",{screen:[al]},al]}],h:[{h:[Ie,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ie,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ie,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ie,a,"auto","min","max","fit"]}],"font-size":[{text:["base",al,nl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Sh]}],"font-family":[{font:[Fo]}],"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",Ie]}],"line-clamp":[{"line-clamp":["none",zs,Sh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",vr,Ie]}],"list-image":[{"list-image":["none",Ie]}],"list-style-type":[{list:["none","disc","decimal",Ie]}],"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:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",vr,nl]}],"underline-offset":[{"underline-offset":["auto",vr,Ie]}],"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:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie]}],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",Ie]}],"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:[...ae(),ZR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",QR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},WR]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"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:[..._(),"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:_()}],"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:["",..._()]}],"outline-offset":[{"outline-offset":[vr,Ie]}],"outline-w":[{outline:[vr,nl]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[vr,nl]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",al,eN]}],"shadow-color":[{shadow:[Fo]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[l]}],brightness:[{brightness:[o]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",al,Ie]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[T]}],sepia:[{sepia:[U]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[l]}],"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":[T]}],"backdrop-sepia":[{"backdrop-sepia":[U]}],"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",Ie]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",Ie]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[Go,Ie]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ie]}],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",Ie]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"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",Ie]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[vr,nl,Sh]}],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"]}}},lN=IR(rN);function Ce(...n){return lN(B0(n))}function Zt(n,a="—"){return n==null||Number.isNaN(n)?a:n.toLocaleString()}function Ou(n,a=1,l="—"){return n==null||Number.isNaN(n)?l:`${(n*100).toFixed(a)}%`}function zl(n){return n?n<1e3?`${Math.round(n)} ms`:`${(n/1e3).toFixed(2)} s`:"—"}function Pm(n){if(!n)return"—";try{return new Date(n).toLocaleString()}catch{return n}}function sN(n,a=8){return n?n.length>a?`${n.slice(0,a)}…`:n:"—"}function oN(n){if(!n)return"—";const a=Date.now()-new Date(n).getTime();if(!Number.isFinite(a)||a<0)return"—";const l=Math.floor(a/1e3);if(l<60)return`${l}s ago`;const o=Math.floor(l/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 iN=[{to:"/",label:"Dashboard",icon:A0,end:!0},{to:"/providers",label:"Providers",icon:_0},{to:"/models",label:"Models",icon:nR},{to:"/combos",label:"Combos",icon:O0},{to:"/aliases",label:"Aliases",icon:oR},{to:"/api-keys",label:"API Keys",icon:D0},{to:"/requests",label:"Requests",icon:Hm},{to:"/statistics",label:"Statistics",icon:fR},{to:"/audit",label:"Audit Logs",icon:bR},{to:"/settings",label:"Settings",icon:iR}];function cN(){const[n,a]=m.useState(null);return m.useEffect(()=>{let l=!1;return fetch("/api/admin/settings/system",{credentials:"include"}).then(o=>o.ok?o.json():null).then(o=>{!l&&(o!=null&&o.appVersion)&&a(o.appVersion)}).catch(()=>{}),()=>{l=!0}},[]),s.jsxs("aside",{className:"hidden w-60 shrink-0 border-r bg-sidebar text-sidebar-foreground md:flex md:flex-col",children:[s.jsxs("div",{className:"flex h-14 items-center gap-2 border-b px-4",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-7 w-7 object-contain"}),s.jsx("div",{className:"font-semibold tracking-tight",children:"LateDev Router"})]}),s.jsx("nav",{className:"flex-1 space-y-0.5 p-2",children:iN.map(l=>s.jsxs(S0,{to:l.to,end:l.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:[s.jsx(l.icon,{className:"h-4 w-4"}),l.label]},l.to))}),s.jsxs("div",{className:"border-t p-3 text-xs text-muted-foreground flex items-center gap-2",children:[s.jsx(wR,{className:"h-3.5 w-3.5 text-primary"})," ",n?`v${n}`:"v…"]})]})}var uN=Object.defineProperty,qm=(n,a)=>uN(n,"name",{value:a,configurable:!0});function Kh(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}qm(Kh,"setRef");function $0(...n){return a=>{let l=!1;const o=n.map(c=>{const u=Kh(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c<o.length;c++){const u=o[c];typeof u=="function"?u():Kh(n[c],null)}}}}qm($0,"composeRefs");function Ke(...n){return m.useCallback($0(...n),n)}qm(Ke,"useComposedRefs");var dN=Object.defineProperty,Oa=(n,a)=>dN(n,"name",{value:a,configurable:!0});function Va(n){const a=m.forwardRef((l,o)=>{let{children:c,...u}=l,f=null,p=!1;const g=[];Xh(c)&&typeof Bc=="function"&&(c=Bc(c._payload)),m.Children.forEach(c,b=>{var w;if(X0(b)){p=!0;const E=b;let j="child"in E.props?E.props.child:E.props.children;Xh(j)&&typeof Bc=="function"&&(j=Bc(j._payload)),f=hN(E,j),g.push((w=f==null?void 0:f.props)==null?void 0:w.children)}else g.push(b)}),f?f=m.cloneElement(f,void 0,g):!p&&m.Children.count(c)===1&&m.isValidElement(c)&&(f=c);const v=f?K0(f):void 0,x=Ke(o,v);if(!f){if(c||c===0)throw new Error(p?gN(n):pN(n));return c}const y=F0(u,f.props??{});return f.type!==m.Fragment&&(y.ref=o?x:v),m.cloneElement(f,y)});return a.displayName=`${n}.Slot`,a}Oa(Va,"createSlot");var fN=Va("Slot"),Y0=Symbol.for("radix.slottable");function G0(n){const a=Oa(l=>"child"in l?l.children(l.child):l.children,"Slottable");return a.displayName=`${n}.Slottable`,a.__radixId=Y0,a}Oa(G0,"createSlottable");var hN=Oa((n,a)=>{if("child"in n.props){const l=n.props.child;return m.isValidElement(l)?m.cloneElement(l,void 0,n.props.children(l.props.children)):null}return m.isValidElement(a)?a:null},"getSlottableElementFromSlottable");function F0(n,a){const l={...a};for(const o in a){const c=n[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...p)=>{const g=u(...p);return c(...p),g}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...n,...l}}Oa(F0,"mergeProps");function K0(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}Oa(K0,"getElementRef");function X0(n){return m.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===Y0}Oa(X0,"isSlottable");var mN=Symbol.for("react.lazy");function Xh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===mN&&"_payload"in n&&Q0(n._payload)}Oa(Xh,"isLazyComponent");function Q0(n){return typeof n=="object"&&n!==null&&"then"in n}Oa(Q0,"isPromiseLike");var pN=Oa(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),gN=Oa(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Bc=Is[" use ".trim().toString()];const tb=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,nb=B0,Z0=(n,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return nb(n,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:u}=a,f=Object.keys(c).map(v=>{const x=l==null?void 0:l[v],y=u==null?void 0:u[v];if(x===null)return null;const b=tb(x)||tb(y);return c[v][b]}),p=l&&Object.entries(l).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(E=>{let[j,C]=E;return Array.isArray(C)?C.includes({...u,...p}[j]):{...u,...p}[j]===C})?[...v,y,b]:v},[]);return nb(n,f,g,l==null?void 0:l.class,l==null?void 0:l.className)},vN=Z0("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"}}),fe=m.forwardRef(({className:n,variant:a,size:l,asChild:o=!1,...c},u)=>{const f=o?fN:"button";return s.jsx(f,{className:Ce(vN({variant:a,size:l,className:n})),ref:u,...c})});fe.displayName="Button";const J0=m.createContext(void 0);function xN({children:n,defaultTheme:a="system",storageKey:l="latedev-theme"}){const[o,c]=m.useState(()=>localStorage.getItem(l)||a);m.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(l,f),c(f)}};return s.jsx(J0.Provider,{value:u,children:n})}function yN(){const n=m.useContext(J0);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}var bN=Object.defineProperty,Ys=(n,a)=>bN(n,"name",{value:a,configurable:!0}),W0=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ne(n,a,{checkForDefaultPrevented:l=!0}={}){return Ys(function(c){if(n==null||n(c),l===!1||!c||!c.defaultPrevented)return a==null?void 0:a(c)},"handleEvent")}Ys(Ne,"composeEventHandlers");function wN(n){var a;if(!W0)throw new Error("Cannot access window outside of the DOM");return((a=n==null?void 0:n.ownerDocument)==null?void 0:a.defaultView)??window}Ys(wN,"getOwnerWindow");function Qh(n){if(!W0)throw new Error("Cannot access document outside of the DOM");return(n==null?void 0:n.ownerDocument)??document}Ys(Qh,"getOwnerDocument");function e1(n,a=!1){const{activeElement:l}=Qh(n);if(!(l!=null&&l.nodeName))return null;if(t1(l)&&l.contentDocument)return e1(l.contentDocument.body,a);if(a){const o=l.getAttribute("aria-activedescendant");if(o){const c=Qh(l).getElementById(o);if(c)return c}}return l}Ys(e1,"getActiveElement");function t1(n){return n.tagName==="IFRAME"}Ys(t1,"isFrame");var SN=Object.defineProperty,ua=(n,a)=>SN(n,"name",{value:a,configurable:!0});function jN(n,a){const l=m.createContext(a);l.displayName=n+"Context";const o=ua(u=>{const{children:f,...p}=u,g=m.useMemo(()=>p,Object.values(p));return s.jsx(l.Provider,{value:g,children:f})},"Provider");o.displayName=n+"Provider";function c(u,f={}){const{optional:p=!1}=f,g=m.useContext(l);if(g)return g;if(a!==void 0)return a;if(!p)throw new Error(`\`${u}\` must be used within \`${n}\``)}return ua(c,"useContext"),[o,c]}ua(jN,"createContext");function Un(n,a=[]){let l=[];function o(u,f){const p=m.createContext(f);p.displayName=u+"Context";const g=l.length;l=[...l,f];const v=ua(y=>{var R;const{scope:b,children:w,...E}=y,j=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=m.useMemo(()=>E,Object.values(E));return s.jsx(j.Provider,{value:C,children:w})},"Provider");v.displayName=u+"Provider";function x(y,b,w={}){var R;const{optional:E=!1}=w,j=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=m.useContext(j);if(C)return C;if(f!==void 0)return f;if(!E)throw new Error(`\`${y}\` must be used within \`${u}\``)}return ua(x,"useContext"),[v,x]}ua(o,"createContext");const c=ua(()=>{const u=l.map(f=>m.createContext(f));return ua(function(p){const g=(p==null?void 0:p[n])||u;return m.useMemo(()=>({[`__scope${n}`]:{...p,[n]:g}}),[p,g])},"useScope")},"createScope");return c.scopeName=n,[o,n1(c,...a)]}ua(Un,"createContextScope");function n1(...n){const a=n[0];if(n.length===1)return a;const l=ua(()=>{const o=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return ua(function(u){const f=o.reduce((p,{useScope:g,scopeName:v})=>{const y=g(u)[`__scope${v}`];return{...p,...y}},{});return m.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])},"useComposedScopes")},"createScope");return l.scopeName=a.scopeName,l}ua(n1,"composeContextScopes");var Jt=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},CN=Object.defineProperty,EN=(n,a)=>CN(n,"name",{value:a,configurable:!0}),ab=Is[" useEffectEvent ".trim().toString()],rb=Is[" useInsertionEffect ".trim().toString()];function a1(n){if(typeof ab=="function")return ab(n);const a=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof rb=="function"?rb(()=>{a.current=n}):Jt(()=>{a.current=n}),m.useMemo(()=>((...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)}),[])}EN(a1,"useEffectEvent");var RN=Object.defineProperty,gi=(n,a)=>RN(n,"name",{value:a,configurable:!0}),NN=Is[" useInsertionEffect ".trim().toString()]||Jt;function jr({prop:n,defaultProp:a,onChange:l=gi(()=>{},"onChange"),caller:o}){const[c,u,f]=r1({defaultProp:a,onChange:l}),p=n!==void 0,g=p?n:c,v=m.useCallback(x=>{var y;if(p){const b=l1(x)?x(n):x;b!==n&&((y=f.current)==null||y.call(f,b))}else u(x)},[p,n,u,f]);return[g,v]}gi(jr,"useControllableState");function r1({defaultProp:n,onChange:a}){const[l,o]=m.useState(n),c=m.useRef(l),u=m.useRef(a);return NN(()=>{u.current=a},[a]),m.useEffect(()=>{var f;c.current!==l&&((f=u.current)==null||f.call(u,l),c.current=l)},[l,c]),[l,o,u]}gi(r1,"useUncontrolledState");function l1(n){return typeof n=="function"}gi(l1,"isFunction");var lb=Symbol("RADIX:SYNC_STATE");function TN(n,a,l,o){const{prop:c,defaultProp:u,onChange:f,caller:p}=a,g=c!==void 0,v=a1(f),x=[{...l,state:u}];o&&x.push(o);const[y,b]=m.useReducer((C,R)=>{if(R.type===lb)return{...C,state:R.state};const M=n(C,R);return g&&!Object.is(M.state,C.state)&&v(M.state),M},...x),w=y.state,E=m.useRef(w);m.useEffect(()=>{E.current!==w&&(E.current=w,g||v(w))},[w,E,g]);const j=m.useMemo(()=>c!==void 0?{...y,state:c}:y,[y,c]);return m.useEffect(()=>{g&&!Object.is(c,y.state)&&b({type:lb,state:c})},[c,y.state,g]),[j,b]}gi(TN,"useControllableStateReducer");var MN=Object.defineProperty,AN=(n,a)=>MN(n,"name",{value:a,configurable:!0}),DN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ve=DN.reduce((n,a)=>{const l=Va(`Primitive.${a}`),o=m.forwardRef((c,u)=>{const{asChild:f,...p}=c,g=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(g,{...p,ref:u})});return o.displayName=`Primitive.${a}`,{...n,[a]:o}},{});function Vm(n,a){n&&Ra.flushSync(()=>n.dispatchEvent(a))}AN(Vm,"dispatchDiscreteCustomEvent");var ON=Object.defineProperty,rn=(n,a)=>ON(n,"name",{value:a,configurable:!0});function _u(n){const a=n+"CollectionProvider",[l,o]=Un(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=rn(j=>{const{scope:C,children:R}=j,M=m.useRef(null),T=m.useRef(new Map).current;return s.jsx(c,{scope:C,itemMap:T,collectionRef:M,children:R})},"CollectionProvider");f.displayName=a;const p=n+"CollectionSlot",g=Va(p),v=m.forwardRef((j,C)=>{const{scope:R,children:M}=j,T=u(p,R),A=Ke(C,T.collectionRef);return s.jsx(g,{ref:A,children:M})});v.displayName=p;const x=n+"CollectionItemSlot",y="data-radix-collection-item",b=Va(x),w=m.forwardRef((j,C)=>{const{scope:R,children:M,...T}=j,A=m.useRef(null),U=Ke(C,A),D=u(x,R);return m.useEffect(()=>(D.itemMap.set(A,{ref:A,...T}),()=>void D.itemMap.delete(A))),s.jsx(b,{[y]:"",ref:U,children:M})});w.displayName=x;function E(j){const C=u(n+"CollectionConsumer",j);return m.useCallback(()=>{const M=C.collectionRef.current;if(!M)return[];const T=Array.from(M.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((D,B)=>T.indexOf(D.ref.current)-T.indexOf(B.ref.current))},[C.collectionRef,C.itemMap])}return rn(E,"useCollection"),[{Provider:f,Slot:v,ItemSlot:w},E,o]}rn(_u,"createCollection");var sb=new WeakMap,Ft,Kn,jh=(Kn=class extends Map{constructor(l){super(l);ky(this,Ft);dh(this,Ft,[...super.keys()]),sb.set(this,!0)}set(l,o){return sb.get(this)&&(this.has(l)?hn(this,Ft)[hn(this,Ft).indexOf(l)]=l:hn(this,Ft).push(l)),super.set(l,o),this}insert(l,o,c){const u=this.has(o),f=hn(this,Ft).length,p=$m(l);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=[...hn(this,Ft)];let b,w=!1;for(let E=g;E<x;E++)if(g===E){let j=y[E];y[E]===o&&(j=y[E+1]),u&&this.delete(o),b=this.get(j),this.set(o,c)}else{!w&&y[E-1]===o&&(w=!0);const j=y[w?E:E-1],C=b;b=this.get(j),this.delete(j),this.set(j,C)}return this}with(l,o,c){const u=new Kn(this);return u.insert(l,o,c),u}before(l){const o=hn(this,Ft).indexOf(l)-1;if(!(o<0))return this.entryAt(o)}setBefore(l,o,c){const u=hn(this,Ft).indexOf(l);return u===-1?this:this.insert(u,o,c)}after(l){let o=hn(this,Ft).indexOf(l);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(l,o,c){const u=hn(this,Ft).indexOf(l);return u===-1?this:this.insert(u+1,o,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return dh(this,Ft,[]),super.clear()}delete(l){const o=super.delete(l);return o&&hn(this,Ft).splice(hn(this,Ft).indexOf(l),1),o}deleteAt(l){const o=this.keyAt(l);return o!==void 0?this.delete(o):!1}at(l){const o=tu(hn(this,Ft),l);if(o!==void 0)return this.get(o)}entryAt(l){const o=tu(hn(this,Ft),l);if(o!==void 0)return[o,this.get(o)]}indexOf(l){return hn(this,Ft).indexOf(l)}keyAt(l){return tu(hn(this,Ft),l)}from(l,o){const c=this.indexOf(l);if(c===-1)return;let u=c+o;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.at(u)}keyFrom(l,o){const c=this.indexOf(l);if(c===-1)return;let u=c+o;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.keyAt(u)}find(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return u;c++}}findIndex(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return c;c++}return-1}filter(l,o){const c=[];let u=0;for(const f of this)Reflect.apply(l,o,[f,u,this])&&c.push(f),u++;return new Kn(c)}map(l,o){const c=[];let u=0;for(const f of this)c.push([f[0],Reflect.apply(l,o,[f,u,this])]),u++;return new Kn(c)}reduce(...l){const[o,c]=l;let u=0,f=c??this.at(0);for(const p of this)u===0&&l.length===1?f=p:f=Reflect.apply(o,this,[f,p,u,this]),u++;return f}reduceRight(...l){const[o,c]=l;let u=c??this.at(-1);for(let f=this.size-1;f>=0;f--){const p=this.at(f);f===this.size-1&&l.length===1?u=p:u=Reflect.apply(o,this,[u,p,f,this])}return u}toSorted(l){const o=[...this.entries()].sort(l);return new Kn(o)}toReversed(){const l=new Kn;for(let o=this.size-1;o>=0;o--){const c=this.keyAt(o),u=this.get(c);l.set(c,u)}return l}toSpliced(...l){const o=[...this.entries()];return o.splice(...l),new Kn(o)}slice(l,o){const c=new Kn;let u=this.size-1;if(l===void 0)return c;l<0&&(l=l+this.size),o!==void 0&&o>0&&(u=o-1);for(let f=l;f<=u;f++){const p=this.keyAt(f),g=this.get(p);c.set(p,g)}return c}every(l,o){let c=0;for(const u of this){if(!Reflect.apply(l,o,[u,c,this]))return!1;c++}return!0}some(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return!0;c++}return!1}},Ft=new WeakMap,rn(Kn,"OrderedDict"),Kn);function tu(n,a){if("at"in Array.prototype)return Array.prototype.at.call(n,a);const l=s1(n,a);return l===-1?void 0:n[l]}rn(tu,"at");function s1(n,a){const l=n.length,o=$m(a),c=o>=0?o:l+o;return c<0||c>=l?-1:c}rn(s1,"toSafeIndex");function $m(n){return n!==n||n===0?0:Math.trunc(n)}rn($m,"toSafeInteger");function _N(n){const a=n+"CollectionProvider",[l,o]=Un(a),[c,u]=l(a,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new jh,setItemMap:rn(()=>{},"setItemMap")}),f=rn(({state:T,...A})=>T?s.jsx(g,{...A,state:T}):s.jsx(p,{...A}),"CollectionProvider");f.displayName=a;const p=rn(T=>{const A=C();return s.jsx(g,{...T,state:A})},"CollectionInit");p.displayName=a+"Init";const g=rn(T=>{const{scope:A,children:U,state:D}=T,B=m.useRef(null),[O,V]=m.useState(null),L=Ke(B,V),[J,G]=D;return m.useEffect(()=>{if(!O)return;const oe=c1(()=>{});return oe.observe(O,{childList:!0,subtree:!0}),()=>{oe.disconnect()}},[O]),s.jsx(c,{scope:A,itemMap:J,setItemMap:G,collectionRef:L,collectionRefObject:B,collectionElement:O,children:U})},"CollectionProviderImpl");g.displayName=a+"Impl";const v=n+"CollectionSlot",x=Va(v),y=m.forwardRef((T,A)=>{const{scope:U,children:D}=T,B=u(v,U),O=Ke(A,B.collectionRef);return s.jsx(x,{ref:O,children:D})});y.displayName=v;const b=n+"CollectionItemSlot",w="data-radix-collection-item",E=Va(b),j=m.forwardRef((T,A)=>{const{scope:U,children:D,...B}=T,O=m.useRef(null),[V,L]=m.useState(null),J=Ke(A,O,L),G=u(b,U),{setItemMap:oe}=G,ce=m.useRef(B);o1(ce.current,B)||(ce.current=B);const ae=ce.current;return m.useEffect(()=>{const _=ae;return oe(H=>V?H.has(V)?H.set(V,{..._,element:V}).toSorted(Zh):(H.set(V,{..._,element:V}),H.toSorted(Zh)):H),()=>{oe(H=>!V||!H.has(V)?H:(H.delete(V),new jh(H)))}},[V,ae,oe]),s.jsx(E,{[w]:"",ref:J,children:D})});j.displayName=b;function C(){return m.useState(new jh)}rn(C,"useInitCollection");function R(T){const{itemMap:A}=u(n+"CollectionConsumer",T);return A}return rn(R,"useCollection"),[{Provider:f,Slot:y,ItemSlot:j},{createCollectionScope:o,useCollection:R,useInitCollection:C}]}rn(_N,"createCollection");function o1(n,a){if(n===a)return!0;if(typeof n!="object"||typeof a!="object"||n==null||a==null)return!1;const l=Object.keys(n),o=Object.keys(a);if(l.length!==o.length)return!1;for(const c of l)if(!Object.prototype.hasOwnProperty.call(a,c)||n[c]!==a[c])return!1;return!0}rn(o1,"shallowEqual");function i1(n,a){return!!(a.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}rn(i1,"isElementPreceding");function Zh(n,a){return!n[1].element||!a[1].element?0:i1(n[1].element,a[1].element)?-1:1}rn(Zh,"sortByDocumentPosition");function c1(n){return new MutationObserver(l=>{for(const o of l)if(o.type==="childList"){n();return}})}rn(c1,"getChildListObserver");var kN=Object.defineProperty,zN=(n,a)=>kN(n,"name",{value:a,configurable:!0}),LN=m.createContext(void 0);function vi(n){const a=m.useContext(LN);return n||a||"ltr"}zN(vi,"useDirection");var UN=Object.defineProperty,BN=(n,a)=>UN(n,"name",{value:a,configurable:!0});function ma(n){const a=m.useRef(n);return m.useEffect(()=>{a.current=n}),m.useMemo(()=>((...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)}),[])}BN(ma,"useCallbackRef");var HN=Object.defineProperty,an=(n,a)=>HN(n,"name",{value:a,configurable:!0}),Jh="dismissableLayer.update",IN="dismissableLayer.pointerDownOutside",PN="dismissableLayer.focusOutside",ob,u1=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ku=m.forwardRef(an(function(a,l){const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:g,onDismiss:v,...x}=a,y=m.useContext(u1),[b,w]=m.useState(null),E=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=m.useState({}),C=Ke(l,w),R=Array.from(y.layers),[M]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),T=M?R.indexOf(M):-1,A=b?R.indexOf(b):-1,U=y.layersWithOutsidePointerEventsDisabled.size>0,D=A>=T,B=m.useRef(!1),O=f1(G=>{f==null||f(G),g==null||g(G),G.defaultPrevented||v==null||v()},{ownerDocument:E,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:B,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(G=>{if(!(G instanceof Node))return!1;const oe=[...y.branches].some(ce=>ce.contains(G));return D&&!oe},[y.branches,D])}),V=h1(G=>{if(c&&B.current)return;const oe=G.target;[...y.branches].some(ae=>ae.contains(oe))||(p==null||p(G),g==null||g(G),G.defaultPrevented||v==null||v())},E),L=b?A===R.length-1:!1,J=ma(G=>{G.key==="Escape"&&(u==null||u(G),!G.defaultPrevented&&v&&(G.preventDefault(),v()))});return m.useEffect(()=>{if(L)return E.addEventListener("keydown",J,{capture:!0}),()=>E.removeEventListener("keydown",J,{capture:!0})},[E,L,J]),m.useEffect(()=>{if(b)return o&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(ob=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(b)),y.layers.add(b),Wh(),()=>{o&&(y.layersWithOutsidePointerEventsDisabled.delete(b),y.layersWithOutsidePointerEventsDisabled.size===0&&(E.body.style.pointerEvents=ob))}},[b,E,o,y]),m.useEffect(()=>()=>{b&&(y.layers.delete(b),y.layersWithOutsidePointerEventsDisabled.delete(b),Wh())},[b,y]),m.useEffect(()=>{const G=an(()=>j({}),"handleUpdate");return document.addEventListener(Jh,G),()=>document.removeEventListener(Jh,G)},[]),s.jsx(Ve.div,{...x,ref:C,style:{pointerEvents:U?D?"auto":"none":void 0,...a.style},onFocusCapture:Ne(a.onFocusCapture,V.onFocusCapture),onBlurCapture:Ne(a.onBlurCapture,V.onBlurCapture),onPointerDownCapture:Ne(a.onPointerDownCapture,O.onPointerDownCapture)})},"DismissableLayer"));function d1(){const n=m.useContext(u1),[a,l]=m.useState(null);return m.useEffect(()=>{if(a)return n.dismissableSurfaces.add(a),()=>{n.dismissableSurfaces.delete(a)}},[a,n.dismissableSurfaces]),l}an(d1,"useDismissableLayerSurface");var qN=an(()=>!0,"IS_TRUE");function f1(n,a){const{ownerDocument:l=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:u,shouldHandlePointerDownOutside:f=qN}=a,p=ma(n),g=m.useRef(!1),v=m.useRef(!1),x=m.useRef(new Map),y=m.useRef(()=>{});return m.useEffect(()=>{function b(){v.current=!1,c.current=!1,x.current.clear()}an(b,"resetOutsideInteraction");function w(){return Array.from(x.current.values()).some(Boolean)}an(w,"isOutsideInteractionIntercepted");function E(T){if(!v.current)return;const A=T.target;A instanceof Node&&[...u].some(D=>D.contains(A))||x.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{v.current&&y.current()},0)}an(E,"handleInteractionCapture");function j(T){v.current&&x.current.set(T.type,!1)}an(j,"handleInteractionBubble");const C=an(T=>{if(T.target&&!g.current){let A=function(){l.removeEventListener("click",y.current);const D=w();b(),D||Ym(IN,p,U,{discrete:!0})};if(an(A,"handleAndDispatchPointerDownOutsideEvent"),!f(T.target)){l.removeEventListener("click",y.current),b(),g.current=!1;return}const U={originalEvent:T};v.current=!0,c.current=o&&T.button===0,x.current.clear(),!o||T.button!==0?A():(l.removeEventListener("click",y.current),y.current=A,l.addEventListener("click",y.current,{once:!0}))}else l.removeEventListener("click",y.current),b();g.current=!1},"handlePointerDown"),R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of R)l.addEventListener(T,E,!0),l.addEventListener(T,j);const M=window.setTimeout(()=>{l.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(M),l.removeEventListener("pointerdown",C),l.removeEventListener("click",y.current);for(const T of R)l.removeEventListener(T,E,!0),l.removeEventListener(T,j)}},[l,p,o,c,u,f]),{onPointerDownCapture:an(()=>g.current=!0,"onPointerDownCapture")}}an(f1,"usePointerDownOutside");function h1(n,a=globalThis==null?void 0:globalThis.document){const l=ma(n),o=m.useRef(!1);return m.useEffect(()=>{const c=an(u=>{u.target&&!o.current&&Ym(PN,l,{originalEvent:u},{discrete:!1})},"handleFocus");return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:an(()=>o.current=!0,"onFocusCapture"),onBlurCapture:an(()=>o.current=!1,"onBlurCapture")}}an(h1,"useFocusOutside");function Wh(){const n=new CustomEvent(Jh);document.dispatchEvent(n)}an(Wh,"dispatchUpdate");function Ym(n,a,l,{discrete:o}){const c=l.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(n,a,{once:!0}),o?Vm(c,u):c.dispatchEvent(u)}an(Ym,"handleAndDispatchCustomEvent");var VN=Object.defineProperty,Gm=(n,a)=>VN(n,"name",{value:a,configurable:!0}),Hc=0,Ha=null;function $N(n){return xi(),n.children}Gm($N,"FocusGuards");function xi(){m.useEffect(()=>{Ha||(Ha={start:em(),end:em()});const{start:n,end:a}=Ha;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==a&&document.body.insertAdjacentElement("beforeend",a),Hc++,()=>{Hc===1&&(Ha==null||Ha.start.remove(),Ha==null||Ha.end.remove(),Ha=null),Hc=Math.max(0,Hc-1)}},[])}Gm(xi,"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}Gm(em,"createFocusGuard");var YN=Object.defineProperty,vn=(n,a)=>YN(n,"name",{value:a,configurable:!0}),Ch="focusScope.autoFocusOnMount",Eh="focusScope.autoFocusOnUnmount",ib={bubbles:!1,cancelable:!0},Fm=m.forwardRef(vn(function(a,l){const{loop:o=!1,trapped:c=!1,onMountAutoFocus:u,onUnmountAutoFocus:f,...p}=a,[g,v]=m.useState(null),x=ma(u),y=ma(f),b=m.useRef(null),w=Ke(l,v),E=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(c){let C=function(A){if(E.paused||!g)return;const U=A.target;g.contains(U)?b.current=U:xr(b.current,{select:!0})},R=function(A){if(E.paused||!g)return;const U=A.relatedTarget;U!==null&&(g.contains(U)||xr(b.current,{select:!0}))},M=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&xr(g)};vn(C,"handleFocusIn"),vn(R,"handleFocusOut"),vn(M,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",R);const T=new MutationObserver(M);return g&&T.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",R),T.disconnect()}}},[c,g,E.paused]),m.useEffect(()=>{if(g){cb.add(E);const C=document.activeElement;if(!g.contains(C)){const M=new CustomEvent(Ch,ib);g.addEventListener(Ch,x),g.dispatchEvent(M),M.defaultPrevented||(m1(y1(Km(g)),{select:!0}),document.activeElement===C&&xr(g))}return()=>{g.removeEventListener(Ch,x),setTimeout(()=>{const M=new CustomEvent(Eh,ib);g.addEventListener(Eh,y),g.dispatchEvent(M),M.defaultPrevented||xr(C??document.body,{select:!0}),g.removeEventListener(Eh,y),cb.remove(E)},0)}}},[g,x,y,E]);const j=m.useCallback(C=>{if(!o&&!c||E.paused)return;const R=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,M=document.activeElement;if(R&&M){const T=C.currentTarget,[A,U]=p1(T);A&&U?!C.shiftKey&&M===U?(C.preventDefault(),o&&xr(A,{select:!0})):C.shiftKey&&M===A&&(C.preventDefault(),o&&xr(U,{select:!0})):M===T&&C.preventDefault()}},[o,c,E.paused]);return s.jsx(Ve.div,{tabIndex:-1,...p,ref:w,onKeyDown:j})},"FocusScope"));function m1(n,{select:a=!1}={}){const l=document.activeElement;for(const o of n)if(xr(o,{select:a}),document.activeElement!==l)return}vn(m1,"focusFirst");function p1(n){const a=Km(n),l=tm(a,n),o=tm(a.reverse(),n);return[l,o]}vn(p1,"getTabbableEdges");function Km(n){const a=[],l=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:vn(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(;l.nextNode();)a.push(l.currentNode);return a}vn(Km,"getTabbableCandidates");function tm(n,a){const l=typeof a.checkVisibility=="function"&&a.checkVisibility({checkVisibilityCSS:!0});for(const o of n)if(!(l?!o.checkVisibility({checkVisibilityCSS:!0}):g1(o,{upTo:a})))return o}vn(tm,"findVisible");function g1(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}vn(g1,"isHidden");function v1(n){return n instanceof HTMLInputElement&&"select"in n}vn(v1,"isSelectableInput");function xr(n,{select:a=!1}={}){if(n&&n.focus){const l=document.activeElement;n.focus({preventScroll:!0}),n!==l&&v1(n)&&a&&n.select()}}vn(xr,"focus");var cb=x1();function x1(){let n=[];return{add(a){const l=n[0];a!==l&&(l==null||l.pause()),n=nm(n,a),n.unshift(a)},remove(a){var l;n=nm(n,a),(l=n[0])==null||l.resume()}}}vn(x1,"createFocusScopesStack");function nm(n,a){const l=[...n],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}vn(nm,"arrayRemove");function y1(n){return n.filter(a=>a.tagName!=="A")}vn(y1,"removeLinks");var GN=Object.defineProperty,FN=(n,a)=>GN(n,"name",{value:a,configurable:!0}),KN=Is[" useId ".trim().toString()]||(()=>{}),XN=0;function qa(n){const[a,l]=m.useState(KN());return Jt(()=>{n||l(o=>o??String(XN++))},[n]),n||(a?`radix-${a}`:"")}FN(qa,"useId");const QN=["top","right","bottom","left"],ul=Math.min,yr=Math.max,cu=Math.round,Ic=Math.floor,br=n=>({x:n,y:n}),ZN={left:"right",right:"left",bottom:"top",top:"bottom"};function b1(n,a,l){return yr(n,ul(a,l))}function Cr(n,a){return typeof n=="function"?n(a):n}function dl(n){return n.split("-")[0]}function Gs(n){return n.split("-")[1]}function Xm(n){return n==="x"?"y":"x"}function Qm(n){return n==="y"?"height":"width"}function Pa(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function Zm(n){return Xm(Pa(n))}function JN(n,a,l){l===void 0&&(l=!1);const o=Gs(n),c=Zm(n),u=Qm(c);let f=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=uu(f)),[f,uu(f)]}function WN(n){const a=uu(n);return[am(n),a,am(a)]}function am(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const ub=["left","right"],db=["right","left"],eT=["top","bottom"],tT=["bottom","top"];function nT(n,a,l){switch(n){case"top":case"bottom":return l?a?db:ub:a?ub:db;case"left":case"right":return a?eT:tT;default:return[]}}function aT(n,a,l,o){const c=Gs(n);let u=nT(dl(n),l==="start",o);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(am)))),u}function uu(n){const a=dl(n);return ZN[a]+n.slice(a.length)}function rT(n){var a,l,o,c;return{top:(a=n.top)!=null?a:0,right:(l=n.right)!=null?l:0,bottom:(o=n.bottom)!=null?o:0,left:(c=n.left)!=null?c:0}}function w1(n){return typeof n!="number"?rT(n):{top:n,right:n,bottom:n,left:n}}function du(n){const{x:a,y:l,width:o,height:c}=n;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function fb(n,a,l){let{reference:o,floating:c}=n;const u=Pa(a),f=Zm(a),p=Qm(f),g=dl(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 E=Gs(a);return E&&(w[f]+=b*(E==="end"?1:-1)*(l&&v?-1:1)),w}async function lT(n,a){var l;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}=Cr(a,n),E=w1(w),C=p[b?y==="floating"?"reference":"floating":y],R=du(await u.getClippingRect({element:(l=await(u.isElement==null?void 0:u.isElement(C)))==null||l?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(p.floating)),boundary:v,rootBoundary:x,strategy:g})),M=y==="floating"?{x:o,y:c,width:f.floating.width,height:f.floating.height}:f.reference,T=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),A=await(u.isElement==null?void 0:u.isElement(T))&&await(u.getScale==null?void 0:u.getScale(T))||{x:1,y:1},U=du(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:M,offsetParent:T,strategy:g}):M);return{top:(R.top-U.top+E.top)/A.y,bottom:(U.bottom-R.bottom+E.bottom)/A.y,left:(R.left-U.left+E.left)/A.x,right:(U.right-R.right+E.right)/A.x}}const sT=50,oT=async(n,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:f}=l,p=f.detectOverflow?f:{...f,detectOverflow:lT},g=await(f.isRTL==null?void 0:f.isRTL(a));let v=await f.getElementRects({reference:n,floating:a,strategy:c}),{x,y}=fb(v,o,g),b=o,w=0;const E={};for(let j=0;j<u.length;j++){const C=u[j];if(!C)continue;const{name:R,fn:M}=C,{x:T,y:A,data:U,reset:D}=await M({x,y,initialPlacement:o,placement:b,strategy:c,middlewareData:E,rects:v,platform:p,elements:{reference:n,floating:a}});x=T??x,y=A??y,E[R]={...E[R],...U},D&&w<sT&&(w++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(v=D.rects===!0?await f.getElementRects({reference:n,floating:a,strategy:c}):D.rects),{x,y}=fb(v,b,g)),j=-1)}return{x,y,placement:b,strategy:c,middlewareData:E}},iT=n=>({name:"arrow",options:n,async fn(a){const{x:l,y:o,placement:c,rects:u,platform:f,elements:p,middlewareData:g}=a,{element:v,padding:x=0}=Cr(n,a)||{};if(v==null)return{};const y=w1(x),b={x:l,y:o},w=Zm(c),E=Qm(w),j=await f.getDimensions(v),C=w==="y",R=C?"top":"left",M=C?"bottom":"right",T=C?"clientHeight":"clientWidth",A=u.reference[E]+u.reference[w]-b[w]-u.floating[E],U=b[w]-u.reference[w],D=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v));let B=D?D[T]:0;(!B||!await(f.isElement==null?void 0:f.isElement(D)))&&(B=p.floating[T]||u.floating[E]);const O=A/2-U/2,V=B/2-j[E]/2-1,L=ul(y[R],V),J=ul(y[M],V),G=B-j[E]-J,oe=B/2-j[E]/2+O,ce=b1(L,oe,G),ae=!g.arrow&&Gs(c)!=null&&oe!==ce&&u.reference[E]/2-(oe<L?L:J)-j[E]/2<0,_=ae?oe<L?oe-L:oe-G:0;return{[w]:b[w]+_,data:{[w]:ce,centerOffset:oe-ce-_,...ae&&{alignmentOffset:_}},reset:ae}}}),cT=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var l,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:E="none",flipAlignment:j=!0,...C}=Cr(n,a);if((l=u.arrow)!=null&&l.alignmentOffset)return{};const R=dl(c),M=Pa(p),T=dl(p)===p,A=await(g.isRTL==null?void 0:g.isRTL(v.floating)),U=b||(T||!j?[uu(p)]:WN(p)),D=E!=="none";!b&&D&&U.push(...aT(p,j,E,A));const B=[p,...U],O=await g.detectOverflow(a,C),V=[];let L=((o=u.flip)==null?void 0:o.overflows)||[];if(x&&V.push(O[R]),y){const ce=JN(c,f,A);V.push(O[ce[0]],O[ce[1]])}if(L=[...L,{placement:c,overflows:V}],!V.every(ce=>ce<=0)){var J,G;const ce=(((J=u.flip)==null?void 0:J.index)||0)+1,ae=B[ce];if(ae&&(!(y==="alignment"?M!==Pa(ae):!1)||L.every(X=>Pa(X.placement)===M?X.overflows[0]>0:!0)))return{data:{index:ce,overflows:L},reset:{placement:ae}};let _=(G=L.filter(H=>H.overflows[0]<=0).sort((H,X)=>H.overflows[1]-X.overflows[1])[0])==null?void 0:G.placement;if(!_)switch(w){case"bestFit":{var oe;const H=(oe=L.filter(X=>{if(D){const W=Pa(X.placement);return W===M||W==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(W=>W>0).reduce((W,te)=>W+te,0)]).sort((X,W)=>X[1]-W[1])[0])==null?void 0:oe[0];H&&(_=H);break}case"initialPlacement":_=p;break}if(c!==_)return{reset:{placement:_}}}return{}}}};function hb(n,a){return{top:n.top-a.height,right:n.right-a.width,bottom:n.bottom-a.height,left:n.left-a.width}}function mb(n){return QN.some(a=>n[a]>=0)}const uT=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...u}=Cr(n,a);switch(c){case"referenceHidden":{const f=await o.detectOverflow(a,{...u,elementContext:"reference"}),p=hb(f,l.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:mb(p)}}}case"escaped":{const f=await o.detectOverflow(a,{...u,altBoundary:!0}),p=hb(f,l.floating);return{data:{escapedOffsets:p,escaped:mb(p)}}}default:return{}}}}},S1=new Set(["left","top"]);async function dT(n,a){const{placement:l,platform:o,elements:c}=n,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),f=dl(l),p=Gs(l),g=Pa(l)==="y",v=S1.has(f)?-1:1,x=u&&g?-1:1,y=Cr(a,n);let{mainAxis:b,crossAxis:w,alignmentAxis:E}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof E=="number"&&(w=p==="end"?E*-1:E),g?{x:w*x,y:b*v}:{x:b*v,y:w*x}}const fT=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var l,o;const{x:c,y:u,placement:f,middlewareData:p}=a,g=await dT(a,n);return f===((l=p.offset)==null?void 0:l.placement)&&(o=p.arrow)!=null&&o.alignmentOffset?{}:{x:c+g.x,y:u+g.y,data:{...g,placement:f}}}}},hT=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(a){const{x:l,y:o,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:g={fn:M=>{let{x:T,y:A}=M;return{x:T,y:A}}},...v}=Cr(n,a),x={x:l,y:o},y=await u.detectOverflow(a,v),b=Pa(c),w=Xm(b);let E=x[w],j=x[b];const C=(M,T)=>b1(T+y[M==="y"?"top":"left"],T,T-y[M==="y"?"bottom":"right"]);f&&(E=C(w,E)),p&&(j=C(b,j));const R=g.fn({...a,[w]:E,[b]:j});return{...R,data:{x:R.x-l,y:R.y-o,enabled:{[w]:f,[b]:p}}}}}},mT=function(n){return n===void 0&&(n={}),{options:n,fn(a){var l,o;const{x:c,y:u,placement:f,rects:p,middlewareData:g}=a,{offset:v=0,mainAxis:x=!0,crossAxis:y=!0}=Cr(n,a),b={x:c,y:u},w=Pa(f),E=Xm(w);let j=b[E],C=b[w];const R=Cr(v,a),M=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(l=R.mainAxis)!=null?l:0,crossAxis:(o=R.crossAxis)!=null?o:0};if(x){const U=E==="y"?"height":"width",D=p.reference[E]-p.floating[U]+M.mainAxis,B=p.reference[E]+p.reference[U]-M.mainAxis;j<D?j=D:j>B&&(j=B)}if(y){var T,A;const U=E==="y"?"width":"height",D=S1.has(dl(f)),B=p.reference[w]-p.floating[U]+(D&&((T=g.offset)==null?void 0:T[w])||0)+(D?0:M.crossAxis),O=p.reference[w]+p.reference[U]+(D?0:((A=g.offset)==null?void 0:A[w])||0)-(D?M.crossAxis:0);C<B?C=B:C>O&&(C=O)}return{[E]:j,[w]:C}}}},pT=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(a){const{placement:l,rects:o,platform:c,elements:u}=a,{apply:f=()=>{},...p}=Cr(n,a),g=await c.detectOverflow(a,p),v=dl(l),x=Gs(l),y=Pa(l)==="y",{width:b,height:w}=o.floating;let E,j;v==="top"||v==="bottom"?(E=v,j=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(j=v,E=x==="end"?"top":"bottom");const C=w-g.top-g.bottom,R=b-g.left-g.right,M=ul(w-g[E],C),T=ul(b-g[j],R),A=a.middlewareData.shift,U=!A;let D=M,B=T;A!=null&&A.enabled.x&&(B=R),A!=null&&A.enabled.y&&(D=C),U&&!x&&(y?B=b-2*yr(g.left,g.right):D=w-2*yr(g.top,g.bottom)),await f({...a,availableWidth:B,availableHeight:D});const O=await c.getDimensions(u.floating);return b!==O.width||w!==O.height?{reset:{rects:!0}}:{}}}};function zu(){return typeof window<"u"}function Fs(n){return j1(n)?(n.nodeName||"").toLowerCase():"#document"}function zn(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function Nr(n){var a;return(a=(j1(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function j1(n){return zu()?n instanceof Node||n instanceof zn(n).Node:!1}function $a(n){return zu()?n instanceof Element||n instanceof zn(n).Element:!1}function hl(n){return zu()?n instanceof HTMLElement||n instanceof zn(n).HTMLElement:!1}function pb(n){return!zu()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof zn(n).ShadowRoot}function Lu(n){const{overflow:a,overflowX:l,overflowY:o,display:c}=Ya(n);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&c!=="inline"&&c!=="contents"}function gT(n){return/^(table|td|th)$/.test(Fs(n))}function Uu(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const vT=/transform|translate|scale|rotate|perspective|filter/,xT=/paint|layout|strict|content/,Ol=n=>!!n&&n!=="none";let Rh;function Jm(n){const a=$a(n)?Ya(n):n;return Ol(a.transform)||Ol(a.translate)||Ol(a.scale)||Ol(a.rotate)||Ol(a.perspective)||!Wm()&&(Ol(a.backdropFilter)||Ol(a.filter))||vT.test(a.willChange||"")||xT.test(a.contain||"")}function yT(n){let a=Ll(n);for(;hl(a)&&!Wo(a);){if(Jm(a))return a;if(Uu(a))return null;a=Ll(a)}return null}function Wm(){return Rh==null&&(Rh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Rh}function Wo(n){return/^(html|body|#document)$/.test(Fs(n))}function Ya(n){return zn(n).getComputedStyle(n)}function Bu(n){return $a(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Ll(n){if(Fs(n)==="html")return n;const a=n.assignedSlot||n.parentNode||pb(n)&&n.host||Nr(n);return pb(a)?a.host:a}function C1(n){const a=Ll(n);return Wo(a)?(n.ownerDocument||n).body:hl(a)&&Lu(a)?a:C1(a)}function ei(n,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=C1(n),u=c===((o=n.ownerDocument)==null?void 0:o.body),f=zn(c);if(u){const p=rm(f);return a.concat(f,f.visualViewport||[],Lu(c)?c:[],p&&l?ei(p):[])}else return a.concat(c,ei(c,[],l))}function rm(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function E1(n){const a=Ya(n);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=hl(n),u=c?n.offsetWidth:l,f=c?n.offsetHeight:o,p=cu(l)!==u||cu(o)!==f;return p&&(l=u,o=f),{width:l,height:o,$:p}}function ep(n){return $a(n)?n:n.contextElement}function Ls(n){const a=ep(n);if(!hl(a))return br(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=E1(a);let f=(u?cu(l.width):l.width)/o,p=(u?cu(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const bT=br(0);function R1(n){const a=zn(n);return!Wm()||!a.visualViewport?bT:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function wT(n,a,l){return a===void 0&&(a=!1),!!l&&a&&l===zn(n)}function Ul(n,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),u=ep(n);let f=br(1);a&&(o?$a(o)&&(f=Ls(o)):f=Ls(n));const p=wT(u,l,o)?R1(u):br(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=zn(u),w=$a(o)?zn(o):o;let E=b,j=rm(E);for(;j&&w!==E;){const C=Ls(j),R=j.getBoundingClientRect(),M=Ya(j),T=R.left+(j.clientLeft+parseFloat(M.paddingLeft))*C.x,A=R.top+(j.clientTop+parseFloat(M.paddingTop))*C.y;g*=C.x,v*=C.y,x*=C.x,y*=C.y,g+=T,v+=A,E=zn(j),j=rm(E)}}return du({width:x,height:y,x:g,y:v})}function Hu(n,a){const l=Bu(n).scrollLeft;return a?a.left+l:Ul(Nr(n)).left+l}function N1(n,a){const l=n.getBoundingClientRect(),o=l.left+a.scrollLeft-Hu(n,l),c=l.top+a.scrollTop;return{x:o,y:c}}function ST(n){let{elements:a,rect:l,offsetParent:o,strategy:c}=n;const u=c==="fixed",f=Nr(o),p=a?Uu(a.floating):!1;if(o===f||p&&u)return l;let g={scrollLeft:0,scrollTop:0},v=br(1);const x=br(0),y=hl(o);if((y||!u)&&((Fs(o)!=="body"||Lu(f))&&(g=Bu(o)),y)){const w=Ul(o);v=Ls(o),x.x=w.x+o.clientLeft,x.y=w.y+o.clientTop}const b=f&&!y&&!u?N1(f,g):br(0);return{width:l.width*v.x,height:l.height*v.y,x:l.x*v.x-g.scrollLeft*v.x+x.x+b.x,y:l.y*v.y-g.scrollTop*v.y+x.y+b.y}}function jT(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function CT(n){const a=Bu(n),l=n.ownerDocument.body,o=yr(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),c=yr(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let u=-a.scrollLeft+Hu(n);const f=-a.scrollTop;return Ya(l).direction==="rtl"&&(u+=yr(n.clientWidth,l.clientWidth)-o),{width:o,height:c,x:u,y:f}}const ET=25;function RT(n,a,l){l===void 0&&(l="viewport");const o=l==="layoutViewport",c=zn(n),u=Nr(n),f=c.visualViewport;let p=u.clientWidth,g=u.clientHeight,v=0,x=0;if(f){const b=!Wm()||a==="fixed";o?b||(v=-f.offsetLeft,x=-f.offsetTop):(p=f.width,g=f.height,b&&(v=f.offsetLeft,x=f.offsetTop))}if(Hu(u)<=0){const b=u.ownerDocument,w=b.body,E=getComputedStyle(w),j=b.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,C=Math.abs(u.clientWidth-w.clientWidth-j),R=getComputedStyle(u).scrollbarGutter==="stable both-edges"?C/2:C;R<=ET&&(p-=R)}return{width:p,height:g,x:v,y:x}}function NT(n,a){const l=Ul(n,!0,a==="fixed"),o=l.top+n.clientTop,c=l.left+n.clientLeft,u=Ls(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 gb(n,a,l){let o;if(a==="viewport"||a==="layoutViewport")o=RT(n,l,a);else if(a==="document")o=CT(Nr(n));else if($a(a))o=NT(a,l);else{const c=R1(n);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return du(o)}function TT(n,a){const l=a.get(n);if(l)return l;let o=ei(n,[],!1).filter(p=>$a(p)&&Fs(p)!=="body"),c=null;const u=Ya(n).position==="fixed";let f=u?Ll(n):n;for(;$a(f)&&!Wo(f);){const p=Ya(f),g=Jm(f),v=c?c.position:u?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&p.position==="static")?o=o.filter(y=>y!==f):c=p,f=Ll(f)}return a.set(n,o),o}function MT(n){let{element:a,boundary:l,rootBoundary:o,strategy:c}=n;const f=[...l==="clippingAncestors"?Uu(a)?[]:TT(a,this._c):[].concat(l),o],p=gb(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=gb(a,f[b],c);g=yr(w.top,g),v=ul(w.right,v),x=ul(w.bottom,x),y=yr(w.left,y)}return{width:v-y,height:x-g,x:y,y:g}}function AT(n){const{width:a,height:l}=E1(n);return{width:a,height:l}}function DT(n,a,l){const o=hl(a),c=Nr(a),u=l==="fixed",f=Ul(n,!0,u,a);let p={scrollLeft:0,scrollTop:0};const g=br(0);if((o||!u)&&((Fs(a)!=="body"||Lu(c))&&(p=Bu(a)),o)){const b=Ul(a,!0,u,a);g.x=b.x+a.clientLeft,g.y=b.y+a.clientTop}!o&&c&&(g.x=Hu(c));const v=c&&!o&&!u?N1(c,p):br(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 Nh(n){return Ya(n).position==="static"}function vb(n,a){if(!hl(n)||Ya(n).position==="fixed")return null;if(a)return a(n);let l=n.offsetParent;return Nr(n)===l&&(l=l.ownerDocument.body),l}function T1(n,a){const l=zn(n);if(Uu(n))return l;if(!hl(n)){let c=Ll(n);for(;c&&!Wo(c);){if($a(c)&&!Nh(c))return c;c=Ll(c)}return l}let o=vb(n,a);for(;o&&gT(o)&&Nh(o);)o=vb(o,a);return o&&Wo(o)&&Nh(o)&&!Jm(o)?l:o||yT(n)||l}const OT=async function(n){const a=this.getOffsetParent||T1,l=this.getDimensions,o=await l(n.floating);return{reference:DT(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function _T(n){return Ya(n).direction==="rtl"}const kT={convertOffsetParentRelativeRectToViewportRelativeRect:ST,getDocumentElement:Nr,getClippingRect:MT,getOffsetParent:T1,getElementRects:OT,getClientRects:jT,getDimensions:AT,getScale:Ls,isElement:$a,isRTL:_T};function M1(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function zT(n,a,l){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:E,width:j,height:C}=b;if(x||a(),!j||!C)return;const R=Ic(E),M=Ic(u.clientWidth-(w+j)),T=Ic(u.clientHeight-(E+C)),A=Ic(w),D={rootMargin:-R+"px "+-M+"px "+-T+"px "+-A+"px",threshold:yr(0,ul(1,y))||1};let B=!0;function O(V){const L=V[0].intersectionRatio;if(!M1(b,n.getBoundingClientRect()))return p();if(L!==y){if(!B)return p();L?p(!1,L):c=setTimeout(()=>{p(!1,1e-7)},1e3)}B=!1}try{o=new IntersectionObserver(O,{...D,root:u.ownerDocument})}catch{o=new IntersectionObserver(O,D)}o.observe(n)}const g=zn(n),v=()=>p(l);return g.addEventListener("resize",v),p(!0),()=>{g.removeEventListener("resize",v),f()}}function LT(n,a,l,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=ep(n),x=c||u?[...v?ei(v):[],...a?ei(a):[]]:[];x.forEach(R=>{c&&R.addEventListener("scroll",l),u&&R.addEventListener("resize",l)});const y=v&&p?zT(v,l,u):null;let b=-1,w=null;f&&(w=new ResizeObserver(R=>{let[M]=R;M&&M.target===v&&w&&a&&(w.unobserve(a),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var T;(T=w)==null||T.observe(a)})),l()}),v&&!g&&w.observe(v),a&&w.observe(a));let E,j=g?Ul(n):null;g&&C();function C(){const R=Ul(n);j&&!M1(j,R)&&l(),j=R,E=requestAnimationFrame(C)}return l(),()=>{var R;x.forEach(M=>{c&&M.removeEventListener("scroll",l),u&&M.removeEventListener("resize",l)}),y==null||y(),(R=w)==null||R.disconnect(),w=null,g&&cancelAnimationFrame(E)}}const UT=fT,BT=hT,HT=cT,IT=pT,PT=uT,xb=iT,qT=mT,VT=(n,a,l)=>{const o=new Map,c=l??{},u={...kT,...c.platform,_c:o};return oT(n,a,{...c,platform:u})};var $T=typeof document<"u",YT=function(){},nu=$T?m.useLayoutEffect:YT;function fu(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 l,o,c;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!fu(n[o],a[o]))return!1;return!0}if(c=Object.keys(n),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const u=c[o];if(!(u==="_owner"&&n.$$typeof)&&!fu(n[u],a[u]))return!1}return!0}return n!==n&&a!==a}function A1(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function yb(n,a){const l=A1(n);return Math.round(a*l)/l}function Th(n){const a=m.useRef(n);return nu(()=>{a.current=n}),a}function GT(n){n===void 0&&(n={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:f}={},transform:p=!0,whileElementsMounted:g,open:v}=n,[x,y]=m.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[b,w]=m.useState(o);fu(b,o)||w(o);const[E,j]=m.useState(null),[C,R]=m.useState(null),M=m.useCallback(X=>{X!==D.current&&(D.current=X,j(X))},[]),T=m.useCallback(X=>{X!==B.current&&(B.current=X,R(X))},[]),A=u||E,U=f||C,D=m.useRef(null),B=m.useRef(null),O=m.useRef(x),V=g!=null,L=Th(g),J=Th(c),G=Th(v),oe=m.useCallback(()=>{if(!D.current||!B.current)return;const X={placement:a,strategy:l,middleware:b};J.current&&(X.platform=J.current),VT(D.current,B.current,X).then(W=>{const te={...W,isPositioned:G.current!==!1};ce.current&&!fu(O.current,te)&&(O.current=te,Ra.flushSync(()=>{y(te)}))})},[b,a,l,J,G]);nu(()=>{v===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,y(X=>({...X,isPositioned:!1})))},[v]);const ce=m.useRef(!1);nu(()=>(ce.current=!0,()=>{ce.current=!1}),[]),nu(()=>{if(A&&(D.current=A),U&&(B.current=U),A&&U){if(L.current)return L.current(A,U,oe);oe()}},[A,U,oe,L,V]);const ae=m.useMemo(()=>({reference:D,floating:B,setReference:M,setFloating:T}),[M,T]),_=m.useMemo(()=>({reference:A,floating:U}),[A,U]),H=m.useMemo(()=>{const X={position:l,left:0,top:0};if(!_.floating)return X;const W=yb(_.floating,x.x),te=yb(_.floating,x.y);return p?{...X,transform:"translate("+W+"px, "+te+"px)",...A1(_.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:W,top:te}},[l,p,_.floating,x.x,x.y]);return m.useMemo(()=>({...x,update:oe,refs:ae,elements:_,floatingStyles:H}),[x,oe,ae,_,H])}const FT=n=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:o,padding:c}=typeof n=="function"?n(l):n;return o&&a(o)?o.current!=null?xb({element:o.current,padding:c}).fn(l):{}:o?xb({element:o,padding:c}).fn(l):{}}}},KT=(n,a)=>{const l=UT(n);return{name:l.name,fn:l.fn,options:[n,a]}},XT=(n,a)=>{const l=BT(n);return{name:l.name,fn:l.fn,options:[n,a]}},QT=(n,a)=>({fn:qT(n).fn,options:[n,a]}),ZT=(n,a)=>{const l=HT(n);return{name:l.name,fn:l.fn,options:[n,a]}},JT=(n,a)=>{const l=IT(n);return{name:l.name,fn:l.fn,options:[n,a]}},WT=(n,a)=>{const l=PT(n);return{name:l.name,fn:l.fn,options:[n,a]}},eM=(n,a)=>{const l=FT(n);return{name:l.name,fn:l.fn,options:[n,a]}};var tM=Object.defineProperty,nM=(n,a)=>tM(n,"name",{value:a,configurable:!0});function Iu(n){const[a,l]=m.useState(void 0);return Jt(()=>{if(n){l({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;l({width:f,height:p})});return o.observe(n,{box:"border-box"}),()=>o.unobserve(n)}else l(void 0)},[n]),a}nM(Iu,"useSize");var aM=Object.defineProperty,il=(n,a)=>aM(n,"name",{value:a,configurable:!0}),D1="Popper",[O1,Ks]=Un(D1),[rM,_1]=O1(D1),lM=il(n=>{const{__scopePopper:a,children:l}=n,[o,c]=m.useState(null),[u,f]=m.useState(void 0);return s.jsx(rM,{scope:a,anchor:o,onAnchorChange:c,placementState:u,setPlacementState:f,children:l})},"Popper"),sM="PopperAnchor",oM=m.forwardRef(il(function(a,l){const{__scopePopper:o,virtualRef:c,...u}=a,f=_1(sM,o),p=m.useRef(null),g=f.onAnchorChange,v=m.useCallback(j=>{p.current=j,j&&g(j)},[g]),x=Ke(l,v),y=m.useRef(null);m.useEffect(()=>{if(!c)return;const j=y.current;y.current=c.current,j!==y.current&&g(y.current)});const b=f.placementState&&Pu(f.placementState),w=b==null?void 0:b[0],E=b==null?void 0:b[1];return c?null:s.jsx(Ve.div,{"data-radix-popper-side":w,"data-radix-popper-align":E,...u,ref:x})},"PopperAnchor")),k1="PopperContent",[iM,V4]=O1(k1),cM=m.forwardRef(il(function(a,l){var he,me,Te,je,De,Xe,ze;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:E="optimized",onPlaced:j,...C}=a,R=_1(k1,o),[M,T]=m.useState(null),A=Ke(l,T),[U,D]=m.useState(null),B=Iu(U),O=(B==null?void 0:B.width)??0,V=(B==null?void 0:B.height)??0,L=c+(f!=="center"?"-"+f:""),J=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},G=Array.isArray(x)?x:[x],oe=G.length>0,ce={padding:J,boundary:G.filter(z1),altBoundary:oe},{refs:ae,floatingStyles:_,placement:H,isPositioned:X,middlewareData:W}=GT({strategy:"fixed",placement:L,whileElementsMounted:il((...Je)=>LT(...Je,{animationFrame:E==="always"}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[KT({mainAxis:u+V,alignmentAxis:p}),v&&XT({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?QT():void 0,...ce}),v&&ZT({...ce}),JT({...ce,apply:il(({elements:Je,rects:Mt,availableWidth:gt,availableHeight:ln})=>{const{width:jt,height:Bt}=Mt.reference,zt=Je.floating.style;zt.setProperty("--radix-popper-available-width",`${gt}px`),zt.setProperty("--radix-popper-available-height",`${ln}px`),zt.setProperty("--radix-popper-anchor-width",`${jt}px`),zt.setProperty("--radix-popper-anchor-height",`${Bt}px`)},"apply")}),U&&eM({element:U,padding:g}),uM({arrowWidth:O,arrowHeight:V}),w&&WT({strategy:"referenceHidden",...ce,boundary:oe?ce.boundary:void 0})]}),te=R.setPlacementState;Jt(()=>(te(H),()=>{te(void 0)}),[H,te]);const[k,P]=Pu(H),Z=ma(j);Jt(()=>{X&&(Z==null||Z())},[X,Z]);const le=(he=W.arrow)==null?void 0:he.x,de=(me=W.arrow)==null?void 0:me.y,ve=((Te=W.arrow)==null?void 0:Te.centerOffset)!==0,[$,ie]=m.useState();return Jt(()=>{M&&ie(window.getComputedStyle(M).zIndex)},[M]),s.jsx("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:X?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$,"--radix-popper-transform-origin":[(je=W.transformOrigin)==null?void 0:je.x,(De=W.transformOrigin)==null?void 0:De.y].join(" "),...((Xe=W.hide)==null?void 0:Xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:s.jsx(iM,{scope:o,placedSide:k,placedAlign:P,onArrowChange:D,arrowX:le,arrowY:de,shouldHideArrow:ve,children:s.jsx(Ve.div,{"data-side":k,"data-align":P,...C,ref:A,style:{...C.style,animation:X?(ze=C.style)==null?void 0:ze.animation:"none"}})})})},"PopperContent"));function z1(n){return n!==null}il(z1,"isNotNull");var uM=il(n=>({name:"transformOrigin",options:n,fn(a){var C,R,M;const{placement:l,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]=Pu(l),y={start:"0%",center:"50%",end:"100%"}[x],b=(((R=c.arrow)==null?void 0:R.x)??0)+p/2,w=(((M=c.arrow)==null?void 0:M.y)??0)+g/2;let E="",j="";return v==="bottom"?(E=f?y:`${b}px`,j=`${-g}px`):v==="top"?(E=f?y:`${b}px`,j=`${o.floating.height+g}px`):v==="right"?(E=`${-g}px`,j=f?y:`${w}px`):v==="left"&&(E=`${o.floating.width+g}px`,j=f?y:`${w}px`),{data:{x:E,y:j}}}}),"transformOrigin");function Pu(n){const[a,l="center"]=n.split("-");return[a,l]}il(Pu,"getSideAndAlignFromPlacement");var L1=lM,U1=oM,tp=cM,dM=Object.defineProperty,fM=(n,a)=>dM(n,"name",{value:a,configurable:!0}),np=m.forwardRef(fM(function(a,l){var g;const{container:o,...c}=a,[u,f]=m.useState(!1);Jt(()=>f(!0),[]);const p=o||u&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?Ra.createPortal(s.jsx(Ve.div,{...c,ref:l}),p):null},"Portal")),hM=Object.defineProperty,Er=(n,a)=>hM(n,"name",{value:a,configurable:!0});function B1(n,a){return m.useReducer((l,o)=>a[l][o]??l,n)}Er(B1,"useStateMachine");var Tr=Er(n=>{const{present:a,children:l}=n,o=H1(a),c=typeof l=="function"?l({present:o.isPresent}):m.Children.only(l),u=I1(o.ref,P1(c));return typeof l=="function"||o.isPresent?m.cloneElement(c,{ref:u}):null},"Presence");function H1(n){const[a,l]=m.useState(),o=m.useRef(null),c=m.useRef(n),u=m.useRef("none"),f=m.useRef(void 0),p=n?"mounted":"unmounted",[g,v]=B1(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{g==="mounted"?(u.current=f.current??_s(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,E=_s(x);n?(f.current=E,v("MOUNT")):E==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(y&&w!==E?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,v]),Jt(()=>{if(a){let x;const y=a.ownerDocument.defaultView??window,b=Er(E=>{const C=_s(o.current).includes(CSS.escape(E.animationName));if(E.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=Er(E=>{E.target===a&&(u.current=_s(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:m.useCallback(x=>{if(x){const y=getComputedStyle(x);o.current=y,f.current=_s(y)}else o.current=null;l(x)},[])}}Er(H1,"usePresence");function lm(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}Er(lm,"setRef");function I1(...n){const a=m.useRef(n);return a.current=n,m.useCallback(l=>{const o=a.current;let c=!1;const u=o.map(f=>{const p=lm(f,l);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():lm(o[f],null)}}},[])}Er(I1,"useStableComposedRefs");function _s(n){return(n==null?void 0:n.animationName)||"none"}Er(_s,"getAnimationName");function P1(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}Er(P1,"getElementRef");var mM=Object.defineProperty,ap=(n,a)=>mM(n,"name",{value:a,configurable:!0}),Mh=!1;function q1(){const[n,a]=m.useState(Mh);return m.useEffect(()=>{Mh||(Mh=!0,a(!0))},[]),n}ap(q1,"useIsHydrated");var V1=Is[" useSyncExternalStore ".trim().toString()];function $1(){return()=>{}}ap($1,"subscribe");function Y1(){return V1($1,()=>!0,()=>!1)}ap(Y1,"useIsHydratedModern");var pM=typeof V1=="function"?Y1:q1,gM=Object.defineProperty,Hl=(n,a)=>gM(n,"name",{value:a,configurable:!0}),Ah="rovingFocusGroup.onEntryFocus",vM={bubbles:!1,cancelable:!0},qu="RovingFocusGroup",[sm,G1,xM]=_u(qu),[yM,Vu]=Un(qu,[xM]),[bM,wM]=yM(qu),SM=m.forwardRef(Hl(function(a,l){return s.jsx(sm.Provider,{scope:a.__scopeRovingFocusGroup,children:s.jsx(sm.Slot,{scope:a.__scopeRovingFocusGroup,children:s.jsx(jM,{...a,ref:l})})})},"RovingFocusGroup")),jM=m.forwardRef(Hl(function(a,l){const{__scopeRovingFocusGroup:o,orientation:c,loop:u=!1,dir:f,currentTabStopId:p,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:x,preventScrollOnEntryFocus:y=!1,...b}=a,w=m.useRef(null),E=Ke(l,w),j=vi(f),[C,R]=jr({prop:p,defaultProp:g??null,onChange:v,caller:qu}),[M,T]=m.useState(!1),A=ma(x),U=G1(o),D=m.useRef(!1),[B,O]=m.useState(0);return m.useEffect(()=>{const V=w.current;if(V)return V.addEventListener(Ah,A),()=>V.removeEventListener(Ah,A)},[A]),s.jsx(bM,{scope:o,orientation:c,dir:j,loop:u,currentTabStopId:C,onItemFocus:m.useCallback(V=>R(V),[R]),onItemShiftTab:m.useCallback(()=>T(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(V=>V+1),[]),onFocusableItemRemove:m.useCallback(()=>O(V=>V-1),[]),children:s.jsx(Ve.div,{tabIndex:M||B===0?-1:0,"data-orientation":c,...b,ref:E,style:{outline:"none",...a.style},onMouseDown:Ne(a.onMouseDown,()=>{D.current=!0}),onFocus:Ne(a.onFocus,V=>{const L=!D.current;if(V.target===V.currentTarget&&L&&!M){const J=new CustomEvent(Ah,vM);if(V.currentTarget.dispatchEvent(J),!J.defaultPrevented){const G=U().filter(H=>H.focusable),oe=G.find(H=>H.active),ce=G.find(H=>H.id===C),_=[oe,ce,...G].filter(Boolean).map(H=>H.ref.current);rp(_,y)}}D.current=!1}),onBlur:Ne(a.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),CM="RovingFocusGroupItem",EM=m.forwardRef(Hl(function(a,l){const{__scopeRovingFocusGroup:o,focusable:c=!0,active:u=!1,tabStopId:f,children:p,...g}=a,v=qa(),x=f||v,y=wM(CM,o),b=y.currentTabStopId===x,w=G1(o),{onFocusableItemAdd:E,onFocusableItemRemove:j,currentTabStopId:C}=y,R=pM();return Jt(()=>{if(!(!R||!c))return E(),()=>j()},[R,c,E,j]),m.useEffect(()=>{if(!(R||!c))return E(),()=>j()},[R,c,E,j]),s.jsx(sm.ItemSlot,{scope:o,id:x,focusable:c,active:u,children:s.jsx(Ve.span,{tabIndex:b?0:-1,"data-orientation":y.orientation,...g,ref:l,onMouseDown:Ne(a.onMouseDown,M=>{c?y.onItemFocus(x):M.preventDefault()}),onFocus:Ne(a.onFocus,()=>y.onItemFocus(x)),onKeyDown:Ne(a.onKeyDown,M=>{if(M.key==="Tab"&&M.shiftKey){y.onItemShiftTab();return}if(M.target!==M.currentTarget)return;const T=K1(M,y.orientation,y.dir);if(T!==void 0){if(M.metaKey||M.ctrlKey||M.altKey||M.shiftKey)return;M.preventDefault();let U=w().filter(D=>D.focusable).map(D=>D.ref.current);if(T==="last")U.reverse();else if(T==="prev"||T==="next"){T==="prev"&&U.reverse();const D=U.indexOf(M.currentTarget);U=y.loop?X1(U,D+1):U.slice(D+1)}setTimeout(()=>rp(U))}}),children:typeof p=="function"?p({isCurrentTabStop:b,hasTabStop:C!=null}):p})})},"RovingFocusGroupItem")),RM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function F1(n,a){return a!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}Hl(F1,"getDirectionAwareKey");function K1(n,a,l){const o=F1(n.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return RM[o]}Hl(K1,"getFocusIntent");function rp(n,a=!1){const l=document.activeElement;for(const o of n)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}Hl(rp,"focusFirst");function X1(n,a){return n.map((l,o)=>n[(a+o)%n.length])}Hl(X1,"wrapArray");var Q1=SM,Z1=EM,NM=function(n){if(typeof document>"u")return null;var a=Array.isArray(n)?n[0]:n;return a.ownerDocument.body},Ms=new WeakMap,Pc=new WeakMap,qc={},Dh=0,J1=function(n){return n&&(n.host||J1(n.parentNode))},TM=function(n,a){return a.map(function(l){if(n.contains(l))return l;var o=J1(l);return o&&n.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",n,". Doing nothing"),null)}).filter(function(l){return!!l})},MM=function(n,a,l,o){var c=TM(a,Array.isArray(n)?n:[n]);qc[l]||(qc[l]=new WeakMap);var u=qc[l],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),E=w!==null&&w!=="false",j=(Ms.get(b)||0)+1,C=(u.get(b)||0)+1;Ms.set(b,j),u.set(b,C),f.push(b),j===1&&E&&Pc.set(b,!0),C===1&&b.setAttribute(l,"true"),E||b.setAttribute(o,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return x(a),p.clear(),Dh++,function(){f.forEach(function(y){var b=Ms.get(y)-1,w=u.get(y)-1;Ms.set(y,b),u.set(y,w),b||(Pc.has(y)||y.removeAttribute(o),Pc.delete(y)),w||y.removeAttribute(l)}),Dh--,Dh||(Ms=new WeakMap,Ms=new WeakMap,Pc=new WeakMap,qc={})}},lp=function(n,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(n)?n:[n]),c=NM(n);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),MM(o,c,l,"aria-hidden")):function(){return null}},Ia=function(){return Ia=Object.assign||function(a){for(var l,o=1,c=arguments.length;o<c;o++){l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},Ia.apply(this,arguments)};function W1(n,a){var l={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&a.indexOf(o)<0&&(l[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])&&(l[o[c]]=n[o[c]]);return l}function AM(n,a,l){if(l||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 au="right-scroll-bar-position",ru="width-before-scroll-bar",DM="with-scroll-bars-hidden",OM="--removed-body-scroll-bar-size";function Oh(n,a){return typeof n=="function"?n(a):n&&(n.current=a),n}function _M(n,a){var l=m.useState(function(){return{value:n,callback:a,facade:{get current(){return l.value},set current(o){var c=l.value;c!==o&&(l.value=o,l.callback(o,c))}}}})[0];return l.callback=a,l.facade}var kM=typeof window<"u"?m.useLayoutEffect:m.useEffect,bb=new WeakMap;function zM(n,a){var l=_M(null,function(o){return n.forEach(function(c){return Oh(c,o)})});return kM(function(){var o=bb.get(l);if(o){var c=new Set(o),u=new Set(n),f=l.current;c.forEach(function(p){u.has(p)||Oh(p,null)}),u.forEach(function(p){c.has(p)||Oh(p,f)})}bb.set(l,n)},[n]),l}function LM(n){return n}function UM(n,a){a===void 0&&(a=LM);var l=[],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 l.length?l[l.length-1]:n},useMedium:function(u){var f=a(u,o);return l.push(f),function(){l=l.filter(function(p){return p!==f})}},assignSyncMedium:function(u){for(o=!0;l.length;){var f=l;l=[],f.forEach(u)}l={push:function(p){return u(p)},filter:function(){return l}}},assignMedium:function(u){o=!0;var f=[];if(l.length){var p=l;l=[],p.forEach(u),f=l}var g=function(){var x=f;f=[],x.forEach(u)},v=function(){return Promise.resolve().then(g)};v(),l={push:function(x){f.push(x),v()},filter:function(x){return f=f.filter(x),l}}}};return c}function BM(n){n===void 0&&(n={});var a=UM(null);return a.options=Ia({async:!0,ssr:!1},n),a}var ew=function(n){var a=n.sideCar,l=W1(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 m.createElement(o,Ia({},l))};ew.isSideCarExport=!0;function HM(n,a){return n.useMedium(a),ew}var tw=BM(),_h=function(){},$u=m.forwardRef(function(n,a){var l=m.useRef(null),o=m.useState({onScrollCapture:_h,onWheelCapture:_h,onTouchMoveCapture:_h}),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,E=n.noIsolation,j=n.inert,C=n.allowPinchZoom,R=n.as,M=R===void 0?"div":R,T=n.gapMode,A=W1(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),U=b,D=zM([l,a]),B=Ia(Ia({},A),c);return m.createElement(m.Fragment,null,x&&m.createElement(U,{sideCar:tw,removeScrollBar:v,shards:y,noRelative:w,noIsolation:E,inert:j,setCallbacks:u,allowPinchZoom:!!C,lockRef:l,gapMode:T}),f?m.cloneElement(m.Children.only(p),Ia(Ia({},B),{ref:D})):m.createElement(M,Ia({},B,{className:g,ref:D}),p))});$u.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$u.classNames={fullWidth:ru,zeroRight:au};var IM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function PM(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var a=IM();return a&&n.setAttribute("nonce",a),n}function qM(n,a){n.styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a))}function VM(n){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(n)}var $M=function(){var n=0,a=null;return{add:function(l){n==0&&(a=PM())&&(qM(a,l),VM(a)),n++},remove:function(){n--,!n&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},YM=function(){var n=$M();return function(a,l){m.useEffect(function(){return n.add(a),function(){n.remove()}},[a&&l])}},nw=function(){var n=YM(),a=function(l){var o=l.styles,c=l.dynamic;return n(o,c),null};return a},GM={left:0,top:0,right:0,gap:0},kh=function(n){return parseInt(n||"",10)||0},FM=function(n){var a=window.getComputedStyle(document.body),l=a[n==="padding"?"paddingLeft":"marginLeft"],o=a[n==="padding"?"paddingTop":"marginTop"],c=a[n==="padding"?"paddingRight":"marginRight"];return[kh(l),kh(o),kh(c)]},KM=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return GM;var a=FM(n),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},XM=nw(),Us="data-scroll-locked",QM=function(n,a,l,o){var c=n.left,u=n.top,f=n.right,p=n.gap;return l===void 0&&(l="margin"),`
301
+ .`.concat(DM,` {
302
+ overflow: hidden `).concat(o,`;
303
+ padding-right: `).concat(p,"px ").concat(o,`;
304
+ }
305
+ body[`).concat(Us,`] {
306
+ overflow: hidden `).concat(o,`;
307
+ overscroll-behavior: contain;
308
+ `).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&`
309
+ padding-left: `.concat(c,`px;
310
+ padding-top: `).concat(u,`px;
311
+ padding-right: `).concat(f,`px;
312
+ margin-left:0;
313
+ margin-top:0;
314
+ margin-right: `).concat(p,"px ").concat(o,`;
315
+ `),l==="padding"&&"padding-right: ".concat(p,"px ").concat(o,";")].filter(Boolean).join(""),`
316
+ }
317
+
318
+ .`).concat(au,` {
319
+ right: `).concat(p,"px ").concat(o,`;
320
+ }
321
+
322
+ .`).concat(ru,` {
323
+ margin-right: `).concat(p,"px ").concat(o,`;
324
+ }
325
+
326
+ .`).concat(au," .").concat(au,` {
327
+ right: 0 `).concat(o,`;
328
+ }
329
+
330
+ .`).concat(ru," .").concat(ru,` {
331
+ margin-right: 0 `).concat(o,`;
332
+ }
333
+
334
+ body[`).concat(Us,`] {
335
+ `).concat(OM,": ").concat(p,`px;
336
+ }
337
+ `)},wb=function(){var n=parseInt(document.body.getAttribute(Us)||"0",10);return isFinite(n)?n:0},ZM=function(){m.useEffect(function(){return document.body.setAttribute(Us,(wb()+1).toString()),function(){var n=wb()-1;n<=0?document.body.removeAttribute(Us):document.body.setAttribute(Us,n.toString())}},[])},JM=function(n){var a=n.noRelative,l=n.noImportant,o=n.gapMode,c=o===void 0?"margin":o;ZM();var u=m.useMemo(function(){return KM(c)},[c]);return m.createElement(XM,{styles:QM(u,!a,c,l?"":"!important")})},om=!1;if(typeof window<"u")try{var Vc=Object.defineProperty({},"passive",{get:function(){return om=!0,!0}});window.addEventListener("test",Vc,Vc),window.removeEventListener("test",Vc,Vc)}catch{om=!1}var As=om?{passive:!1}:!1,WM=function(n){return n.tagName==="TEXTAREA"},aw=function(n,a){if(!(n instanceof Element))return!1;var l=window.getComputedStyle(n);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!WM(n)&&l[a]==="visible")},eA=function(n){return aw(n,"overflowY")},tA=function(n){return aw(n,"overflowX")},Sb=function(n,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=rw(n,o);if(c){var u=lw(n,o),f=u[1],p=u[2];if(f>p)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},nA=function(n){var a=n.scrollTop,l=n.scrollHeight,o=n.clientHeight;return[a,l,o]},aA=function(n){var a=n.scrollLeft,l=n.scrollWidth,o=n.clientWidth;return[a,l,o]},rw=function(n,a){return n==="v"?eA(a):tA(a)},lw=function(n,a){return n==="v"?nA(a):aA(a)},rA=function(n,a){return n==="h"&&a==="rtl"?-1:1},lA=function(n,a,l,o,c){var u=rA(n,window.getComputedStyle(a).direction),f=u*o,p=l.target,g=a.contains(p),v=!1,x=f>0,y=0,b=0;do{if(!p)break;var w=lw(n,p),E=w[0],j=w[1],C=w[2],R=j-C-u*E;(E||R)&&rw(n,p)&&(y+=R,b+=E);var M=p.parentNode;p=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}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},$c=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},jb=function(n){return[n.deltaX,n.deltaY]},Cb=function(n){return n&&"current"in n?n.current:n},sA=function(n,a){return n[0]===a[0]&&n[1]===a[1]},oA=function(n){return`
338
+ .block-interactivity-`.concat(n,` {pointer-events: none;}
339
+ .allow-interactivity-`).concat(n,` {pointer-events: all;}
340
+ `)},iA=0,Ds=[];function cA(n){var a=m.useRef([]),l=m.useRef([0,0]),o=m.useRef(),c=m.useState(iA++)[0],u=m.useState(nw)[0],f=m.useRef(n);m.useEffect(function(){f.current=n},[n]),m.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var j=AM([n.lockRef.current],(n.shards||[]).map(Cb),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var p=m.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!f.current.allowPinchZoom;var R=$c(j),M=l.current,T="deltaX"in j?j.deltaX:M[0]-R[0],A="deltaY"in j?j.deltaY:M[1]-R[1],U,D=j.target,B=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in j&&B==="h"&&D.type==="range")return!1;var O=window.getSelection(),V=O&&O.anchorNode,L=V?V===D||V.contains(D):!1;if(L)return!1;var J=Sb(B,D);if(!J)return!0;if(J?U=B:(U=B==="v"?"h":"v",J=Sb(B,D)),!J)return!1;if(!o.current&&"changedTouches"in j&&(T||A)&&(o.current=U),!U)return!0;var G=o.current||U;return lA(G,C,j,G==="h"?T:A)},[]),g=m.useCallback(function(j){var C=j;if(!(!Ds.length||Ds[Ds.length-1]!==u)){var R="deltaY"in C?jb(C):$c(C),M=a.current.filter(function(U){return U.name===C.type&&(U.target===C.target||C.target===U.shadowParent)&&sA(U.delta,R)})[0];if(M&&M.should){C.cancelable&&C.preventDefault();return}if(!M){var T=(f.current.shards||[]).map(Cb).filter(Boolean).filter(function(U){return U.contains(C.target)}),A=T.length>0?p(C,T[0]):!f.current.noIsolation;A&&C.cancelable&&C.preventDefault()}}},[]),v=m.useCallback(function(j,C,R,M){var T={name:j,delta:C,target:R,should:M,shadowParent:uA(R)};a.current.push(T),setTimeout(function(){a.current=a.current.filter(function(A){return A!==T})},1)},[]),x=m.useCallback(function(j){l.current=$c(j),o.current=void 0},[]),y=m.useCallback(function(j){v(j.type,jb(j),j.target,p(j,n.lockRef.current))},[]),b=m.useCallback(function(j){v(j.type,$c(j),j.target,p(j,n.lockRef.current))},[]);m.useEffect(function(){return Ds.push(u),n.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",g,As),document.addEventListener("touchmove",g,As),document.addEventListener("touchstart",x,As),function(){Ds=Ds.filter(function(j){return j!==u}),document.removeEventListener("wheel",g,As),document.removeEventListener("touchmove",g,As),document.removeEventListener("touchstart",x,As)}},[]);var w=n.removeScrollBar,E=n.inert;return m.createElement(m.Fragment,null,E?m.createElement(u,{styles:oA(c)}):null,w?m.createElement(JM,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function uA(n){for(var a=null;n!==null;)n instanceof ShadowRoot&&(a=n.host,n=n.host),n=n.parentNode;return a}const dA=HM(tw,cA);var Yu=m.forwardRef(function(n,a){return m.createElement($u,Ia({},n,{ref:a,sideCar:dA}))});Yu.classNames=$u.classNames;var fA=Object.defineProperty,xt=(n,a)=>fA(n,"name",{value:a,configurable:!0}),hA=["Enter"," "],mA=["ArrowDown","PageUp","Home"],sw=["ArrowUp","PageDown","End"],pA=[...mA,...sw],Gu="Menu",[im,gA,vA]=_u(Gu),[Il,ow]=Un(Gu,[vA,Ks,Vu]),sp=Ks(),iw=Vu(),[xA,yi]=Il(Gu),[yA,op]=Il(Gu),bA=xt(n=>{const{__scopeMenu:a,open:l=!1,children:o,dir:c,onOpenChange:u,modal:f=!0}=n,p=sp(a),[g,v]=m.useState(null),x=m.useRef(!1),y=ma(u),b=vi(c);return m.useEffect(()=>{const w=xt(()=>{x.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},"handleKeyDown"),E=xt(()=>x.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),m.useEffect(()=>{if(!l)return;const w=xt(()=>y(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[l,y]),s.jsx(L1,{...p,children:s.jsx(xA,{scope:a,open:l,onOpenChange:y,content:g,onContentChange:v,children:s.jsx(yA,{scope:a,onClose:m.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:x,dir:b,modal:f,children:o})})})},"Menu"),wA=m.forwardRef(xt(function(a,l){const{__scopeMenu:o,...c}=a,u=sp(o);return s.jsx(U1,{...u,...c,ref:l})},"MenuAnchor")),cw="MenuPortal",[SA,jA]=Il(cw,{forceMount:void 0}),CA=xt(n=>{const{__scopeMenu:a,forceMount:l,children:o,container:c}=n,u=yi(cw,a);return s.jsx(SA,{scope:a,forceMount:l,children:s.jsx(Tr,{present:l||u.open,children:s.jsx(np,{asChild:!0,container:c,children:o})})})},"MenuPortal"),cl="MenuContent",[EA,uw]=Il(cl),RA=m.forwardRef(xt(function(a,l){const o=jA(cl,a.__scopeMenu),{forceMount:c=o.forceMount,...u}=a,f=yi(cl,a.__scopeMenu),p=op(cl,a.__scopeMenu);return s.jsx(im.Provider,{scope:a.__scopeMenu,children:s.jsx(Tr,{present:c||f.open,children:s.jsx(im.Slot,{scope:a.__scopeMenu,children:p.modal?s.jsx(NA,{...u,ref:l}):s.jsx(TA,{...u,ref:l})})})})},"MenuContent")),NA=m.forwardRef(xt(function(a,l){const o=yi(cl,a.__scopeMenu),c=m.useRef(null),u=Ke(l,c);return m.useEffect(()=>{const f=c.current;if(f)return lp(f)},[]),s.jsx(dw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:Ne(a.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),TA=m.forwardRef(xt(function(a,l){const o=yi(cl,a.__scopeMenu);return s.jsx(dw,{...a,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),MA=Va("MenuContent.ScrollLock"),dw=m.forwardRef(xt(function(a,l){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:E,disableOutsideScroll:j,...C}=a,R=yi(cl,o),M=op(cl,o),T=sp(o),A=iw(o),U=gA(o),[D,B]=m.useState(null),O=m.useRef(null),V=Ke(l,O,R.onContentChange),L=m.useRef(0),J=m.useRef(""),G=m.useRef(0),oe=m.useRef(null),ce=m.useRef("right"),ae=m.useRef(0),_=j?Yu:m.Fragment,H=j?{as:MA,allowPinchZoom:!0}:void 0,X=xt(te=>{var ie,he;const k=J.current+te,P=U().filter(me=>!me.disabled),Z=document.activeElement,le=(ie=P.find(me=>me.ref.current===Z))==null?void 0:ie.textValue,de=P.map(me=>me.textValue),ve=gw(de,k,le),$=(he=P.find(me=>me.textValue===ve))==null?void 0:he.ref.current;xt((function me(Te){J.current=Te,window.clearTimeout(L.current),Te!==""&&(L.current=window.setTimeout(()=>me(""),1e3))}),"updateSearch")(k),$&&setTimeout(()=>$.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(L.current),[]),xi();const W=m.useCallback(te=>{var P,Z;return ce.current===((P=oe.current)==null?void 0:P.side)&&xw(te,(Z=oe.current)==null?void 0:Z.area)},[]);return s.jsx(EA,{scope:o,searchRef:J,onItemEnter:m.useCallback(te=>{W(te)&&te.preventDefault()},[W]),onItemLeave:m.useCallback(te=>{var k;W(te)||((k=O.current)==null||k.focus(),B(null))},[W]),onTriggerLeave:m.useCallback(te=>{W(te)&&te.preventDefault()},[W]),pointerGraceTimerRef:G,onPointerGraceIntentChange:m.useCallback(te=>{oe.current=te},[]),children:s.jsx(_,{...H,children:s.jsx(Fm,{asChild:!0,trapped:u,onMountAutoFocus:Ne(f,te=>{var k;te.preventDefault(),(k=O.current)==null||k.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:s.jsx(ku,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:E,children:s.jsx(Q1,{asChild:!0,...A,dir:M.dir,orientation:"vertical",loop:c,currentTabStopId:D,onCurrentTabStopIdChange:B,onEntryFocus:Ne(v,te=>{M.isUsingKeyboardRef.current||te.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(tp,{role:"menu","aria-orientation":"vertical","data-state":fw(R.open),"data-radix-menu-content":"",dir:M.dir,...T,...C,ref:V,style:{outline:"none",...C.style},onKeyDown:Ne(C.onKeyDown,te=>{const P=te.target.closest("[data-radix-menu-content]")===te.currentTarget,Z=te.ctrlKey||te.altKey||te.metaKey,le=te.key.length===1;P&&(te.key==="Tab"&&te.preventDefault(),!Z&&le&&X(te.key));const de=O.current;if(te.target!==de||!pA.includes(te.key))return;te.preventDefault();const $=U().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);sw.includes(te.key)&&$.reverse(),mw($)}),onBlur:Ne(a.onBlur,te=>{te.currentTarget.contains(te.target)||(window.clearTimeout(L.current),J.current="")}),onPointerMove:Ne(a.onPointerMove,hu(te=>{const k=te.target,P=ae.current!==te.clientX;if(te.currentTarget.contains(k)&&P){const Z=te.clientX>ae.current?"right":"left";ce.current=Z,ae.current=te.clientX}}))})})})})})})},"MenuContentImpl")),AA=m.forwardRef(xt(function(a,l){const{__scopeMenu:o,...c}=a;return s.jsx(Ve.div,{...c,ref:l})},"MenuLabel")),cm="MenuItem",Eb="menu.itemSelect",DA=m.forwardRef(xt(function(a,l){const{disabled:o=!1,onSelect:c,...u}=a,f=m.useRef(null),p=op(cm,a.__scopeMenu),g=uw(cm,a.__scopeMenu),v=Ke(l,f),x=m.useRef(!1),y=xt(()=>{const b=f.current;if(!o&&b){const w=new CustomEvent(Eb,{bubbles:!0,cancelable:!0});b.addEventListener(Eb,E=>c==null?void 0:c(E),{once:!0}),Vm(b,w),w.defaultPrevented?x.current=!1:p.onClose()}},"handleSelect");return s.jsx(OA,{...u,ref:v,disabled:o,onClick:Ne(a.onClick,y),onPointerDown:b=>{var w;(w=a.onPointerDown)==null||w.call(a,b),x.current=!0},onPointerUp:Ne(a.onPointerUp,b=>{var w;x.current||(w=b.currentTarget)==null||w.click()}),onKeyDown:Ne(a.onKeyDown,b=>{o||b.target!==b.currentTarget||g.searchRef.current!==""&&b.key===" "||hA.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),OA=m.forwardRef(xt(function(a,l){const{__scopeMenu:o,disabled:c=!1,textValue:u,...f}=a,p=uw(cm,o),g=iw(o),v=m.useRef(null),x=Ke(l,v),[y,b]=m.useState(!1),[w,E]=m.useState("");return m.useEffect(()=>{const j=v.current;j&&E((j.textContent??"").trim())},[f.children]),s.jsx(im.ItemSlot,{scope:o,disabled:c,textValue:u??w,children:s.jsx(Z1,{asChild:!0,...g,focusable:!c,children:s.jsx(Ve.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...f,ref:x,onPointerMove:Ne(a.onPointerMove,hu(j=>{c?p.onItemLeave(j):(p.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ne(a.onPointerLeave,hu(j=>p.onItemLeave(j))),onFocus:Ne(a.onFocus,()=>b(!0)),onBlur:Ne(a.onBlur,()=>b(!1))})})})},"MenuItemImpl")),_A="MenuRadioGroup",[$4,Y4]=Il(_A,{value:void 0,onValueChange:xt(()=>{},"onValueChange")}),kA="MenuItemIndicator",[G4,F4]=Il(kA,{checked:!1}),zA=m.forwardRef(xt(function(a,l){const{__scopeMenu:o,...c}=a;return s.jsx(Ve.div,{role:"separator","aria-orientation":"horizontal",...c,ref:l})},"MenuSeparator")),LA="MenuSub",[K4,X4]=Il(LA);function fw(n){return n?"open":"closed"}xt(fw,"getOpenState");function hw(n){return n==="indeterminate"}xt(hw,"isIndeterminate");function UA(n){return hw(n)?"indeterminate":n?"checked":"unchecked"}xt(UA,"getCheckedState");function mw(n){const a=document.activeElement;for(const l of n)if(l===a||(l.focus(),document.activeElement!==a))return}xt(mw,"focusFirst");function pw(n,a){return n.map((l,o)=>n[(a+o)%n.length])}xt(pw,"wrapArray");function gw(n,a,l){const c=a.length>1&&Array.from(a).every(v=>v===a[0])?a[0]:a,u=l?n.indexOf(l):-1;let f=pw(n,Math.max(u,0));c.length===1&&(f=f.filter(v=>v!==l));const g=f.find(v=>v.toLowerCase().startsWith(c.toLowerCase()));return g!==l?g:void 0}xt(gw,"getNextMatch");function vw(n,a){const{x:l,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&&l<(y-v)*(o-x)/(b-x)+v&&(c=!c)}return c}xt(vw,"isPointInPolygon");function xw(n,a){if(!a)return!1;const l={x:n.clientX,y:n.clientY};return vw(l,a)}xt(xw,"isPointerInGraceArea");function hu(n){return a=>a.pointerType==="mouse"?n(a):void 0}xt(hu,"whenMouse");var BA=bA,HA=wA,IA=CA,PA=RA,qA=AA,VA=DA,$A=zA,YA=Object.defineProperty,Pl=(n,a)=>YA(n,"name",{value:a,configurable:!0}),ip="DropdownMenu",[GA,Q4]=Un(ip,[ow]),ql=ow(),[FA,yw]=GA(ip),KA=Pl(n=>{const{__scopeDropdownMenu:a,children:l,dir:o,open:c,defaultOpen:u,onOpenChange:f,modal:p=!0}=n,g=ql(a),v=m.useRef(null),[x,y]=jr({prop:c,defaultProp:u??!1,onChange:f,caller:ip});return s.jsx(FA,{scope:a,triggerId:qa(),triggerRef:v,contentId:qa(),open:x,onOpenChange:y,onOpenToggle:m.useCallback(()=>y(b=>!b),[y]),modal:p,children:s.jsx(BA,{...g,open:x,onOpenChange:y,dir:o,modal:p,children:l})})},"DropdownMenu"),XA="DropdownMenuTrigger",QA=m.forwardRef(Pl(function(a,l){const{__scopeDropdownMenu:o,disabled:c=!1,...u}=a,f=yw(XA,o),p=ql(o),g=Ke(l,f.triggerRef);return s.jsx(HA,{asChild:!0,...p,children:s.jsx(Ve.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:Ne(a.onPointerDown,v=>{!c&&v.button===0&&v.ctrlKey===!1&&(f.onOpenToggle(),f.open||v.preventDefault())}),onKeyDown:Ne(a.onKeyDown,v=>{c||(["Enter"," "].includes(v.key)&&f.onOpenToggle(),v.key==="ArrowDown"&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),ZA=Pl(n=>{const{__scopeDropdownMenu:a,...l}=n,o=ql(a);return s.jsx(IA,{...o,...l})},"DropdownMenuPortal"),JA="DropdownMenuContent",WA=m.forwardRef(Pl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=yw(JA,o),f=ql(o),p=m.useRef(!1);return s.jsx(PA,{id:u.contentId,"aria-labelledby":u.triggerId,...f,...c,ref:l,onCloseAutoFocus:Ne(a.onCloseAutoFocus,g=>{var v;p.current||(v=u.triggerRef.current)==null||v.focus(),p.current=!1,g.preventDefault()}),onInteractOutside:Ne(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")),eD=m.forwardRef(Pl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=ql(o);return s.jsx(qA,{...u,...c,ref:l})},"DropdownMenuLabel")),tD=m.forwardRef(Pl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=ql(o);return s.jsx(VA,{...u,...c,ref:l})},"DropdownMenuItem")),nD=m.forwardRef(Pl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=ql(o);return s.jsx($A,{...u,...c,ref:l})},"DropdownMenuSeparator")),aD=KA,rD=QA,lD=ZA,bw=WA,ww=eD,Sw=tD,jw=nD;const sD=aD,oD=rD,Cw=m.forwardRef(({className:n,sideOffset:a=4,...l},o)=>s.jsx(lD,{children:s.jsx(bw,{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),...l})}));Cw.displayName=bw.displayName;const Ew=m.forwardRef(({className:n,inset:a,...l},o)=>s.jsx(Sw,{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),...l}));Ew.displayName=Sw.displayName;const iD=m.forwardRef(({className:n,...a},l)=>s.jsx(ww,{ref:l,className:Ce("px-2 py-1.5 text-sm font-semibold",n),...a}));iD.displayName=ww.displayName;const cD=m.forwardRef(({className:n,...a},l)=>s.jsx(jw,{ref:l,className:Ce("-mx-1 my-1 h-px bg-muted",n),...a}));cD.displayName=jw.displayName;function uD(){const{theme:n,setTheme:a}=yN(),{user:l,logout:o}=Bm(),[c,u]=m.useState(!1),[f,p]=m.useState(null),g=hi(),v=n==="light"?CR:n==="dark"?vR:gR;return m.useEffect(()=>{we.get("/api/admin/update/check?force=1").then(x=>p(x)).catch(()=>{})},[]),s.jsxs("header",{className:"flex h-14 items-center justify-between border-b bg-background px-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"Admin"}),s.jsxs("div",{className:"flex items-center gap-2",children:[(f==null?void 0:f.hasUpdate)&&s.jsxs(fe,{variant:"ghost",size:"sm",title:`New version available: v${f.latestVersion} — go to Settings → System to update`,onClick:()=>g("/settings?tab=system"),children:[s.jsx(rR,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",f.latestVersion]}),s.jsx(fe,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:s.jsx(v,{className:"h-4 w-4"})}),s.jsxs(sD,{open:c,onOpenChange:u,children:[s.jsx(oD,{asChild:!0,children:s.jsx(fe,{variant:"ghost",children:(l==null?void 0:l.username)??"admin"})}),s.jsx(Cw,{align:"end",children:s.jsxs(Ew,{onClick:()=>void o(),children:[s.jsx(pR,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Ae=m.forwardRef(({className:n,type:a,...l},o)=>s.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,...l}));Ae.displayName="Input";var dD=Object.defineProperty,fD=(n,a)=>dD(n,"name",{value:a,configurable:!0}),hD=m.forwardRef(fD(function(a,l){return s.jsx(Ve.label,{...a,ref:l,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")),Rw=hD;const be=m.forwardRef(({className:n,...a},l)=>s.jsx(Rw,{ref:l,className:Ce("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...a}));be.displayName=Rw.displayName;const at=m.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ce("rounded-lg border bg-card text-card-foreground shadow-sm",n),...a}));at.displayName="Card";const rt=m.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ce("flex flex-col space-y-1.5 p-6",n),...a}));rt.displayName="CardHeader";const lt=m.forwardRef(({className:n,...a},l)=>s.jsx("h3",{ref:l,className:Ce("text-lg font-semibold leading-none tracking-tight",n),...a}));lt.displayName="CardTitle";const xn=m.forwardRef(({className:n,...a},l)=>s.jsx("p",{ref:l,className:Ce("text-sm text-muted-foreground",n),...a}));xn.displayName="CardDescription";const st=m.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ce("p-6 pt-0",n),...a}));st.displayName="CardContent";const Nw=m.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ce("flex items-center p-6 pt-0",n),...a}));Nw.displayName="CardFooter";var mD=n=>{switch(n){case"success":return vD;case"info":return yD;case"warning":return xD;case"error":return bD;default:return null}},pD=Array(12).fill(0),gD=({visible:n,className:a})=>ue.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":n},ue.createElement("div",{className:"sonner-spinner"},pD.map((l,o)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),vD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),xD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.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"})),yD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),bD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),wD=ue.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"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),SD=()=>{let[n,a]=ue.useState(document.hidden);return ue.useEffect(()=>{let l=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",l),()=>window.removeEventListener("visibilitychange",l)},[]),n},um=1,jD=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:l,...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:l}),{...p,...n,id:c,dismissible:f,title:l}):p):this.addToast({title:l,...o,dismissible:f,id:c}),c},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(a=>{this.subscribers.forEach(l=>l({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 l;a.loading!==void 0&&(l=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=l!==void 0,u,f=o.then(async g=>{if(u=["resolve",g],ue.isValidElement(g))c=!1,this.create({id:l,type:"default",message:g});else if(ED(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:l,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:l,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:l,type:"error",message:v,description:x})}}).finally(()=>{var g;c&&(this.dismiss(l),l=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 l!="string"&&typeof l!="number"?{unwrap:p}:Object.assign(l,{unwrap:p})},this.custom=(n,a)=>{let l=(a==null?void 0:a.id)||um++;return this.create({jsx:n(l),id:l,...a}),l},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},An=new jD,CD=(n,a)=>{let l=(a==null?void 0:a.id)||um++;return An.addToast({title:n,...a,id:l}),l},ED=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",RD=CD,ND=()=>An.toasts,TD=()=>An.getActiveToasts(),ge=Object.assign(RD,{success:An.success,info:An.info,warning:An.warning,error:An.error,custom:An.custom,message:An.message,promise:An.promise,dismiss:An.dismiss,loading:An.loading},{getHistory:ND,getToasts:TD});function MD(n,{insertAt:a}={}){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",a==="top"&&l.firstChild?l.insertBefore(o,l.firstChild):l.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}MD(`: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%)}
341
+ `);function Yc(n){return n.label!==void 0}var AD=3,DD="32px",OD="16px",Rb=4e3,_D=356,kD=14,zD=20,LD=200;function ja(...n){return n.filter(Boolean).join(" ")}function UD(n){let[a,l]=n.split("-"),o=[];return a&&o.push(a),l&&o.push(l),o}var BD=n=>{var a,l,o,c,u,f,p,g,v,x,y;let{invert:b,toast:w,unstyled:E,interacting:j,setHeights:C,visibleToasts:R,heights:M,index:T,toasts:A,expanded:U,removeToast:D,defaultRichColors:B,closeButton:O,style:V,cancelButtonStyle:L,actionButtonStyle:J,className:G="",descriptionClassName:oe="",duration:ce,position:ae,gap:_,loadingIcon:H,expandByDefault:X,classNames:W,icons:te,closeButtonAriaLabel:k="Close toast",pauseWhenPageIsHidden:P}=n,[Z,le]=ue.useState(null),[de,ve]=ue.useState(null),[$,ie]=ue.useState(!1),[he,me]=ue.useState(!1),[Te,je]=ue.useState(!1),[De,Xe]=ue.useState(!1),[ze,Je]=ue.useState(!1),[Mt,gt]=ue.useState(0),[ln,jt]=ue.useState(0),Bt=ue.useRef(w.duration||ce||Rb),zt=ue.useRef(null),yt=ue.useRef(null),bt=T===0,sn=T+1<=R,At=w.type,Dt=w.dismissible!==!1,Wt=w.className||"",Hn=w.descriptionClassName||"",In=ue.useMemo(()=>M.findIndex(Ee=>Ee.toastId===w.id)||0,[M,w.id]),pn=ue.useMemo(()=>{var Ee;return(Ee=w.closeButton)!=null?Ee:O},[w.closeButton,O]),Xa=ue.useMemo(()=>w.duration||ce||Rb,[w.duration,ce]),se=ue.useRef(0),Oe=ue.useRef(0),Qe=ue.useRef(0),ot=ue.useRef(null),[xa,ka]=ae.split("-"),$l=ue.useMemo(()=>M.reduce((Ee,Le,Be)=>Be>=In?Ee:Ee+Le.height,0),[M,In]),Qa=SD(),Dr=w.invert||b,Ct=At==="loading";Oe.current=ue.useMemo(()=>In*_+$l,[In,$l]),ue.useEffect(()=>{Bt.current=Xa},[Xa]),ue.useEffect(()=>{ie(!0)},[]),ue.useEffect(()=>{let Ee=yt.current;if(Ee){let Le=Ee.getBoundingClientRect().height;return jt(Le),C(Be=>[{toastId:w.id,height:Le,position:w.position},...Be]),()=>C(Be=>Be.filter(wt=>wt.toastId!==w.id))}},[C,w.id]),ue.useLayoutEffect(()=>{if(!$)return;let Ee=yt.current,Le=Ee.style.height;Ee.style.height="auto";let Be=Ee.getBoundingClientRect().height;Ee.style.height=Le,jt(Be),C(wt=>wt.find(Ot=>Ot.toastId===w.id)?wt.map(Ot=>Ot.toastId===w.id?{...Ot,height:Be}:Ot):[{toastId:w.id,height:Be,position:w.position},...wt])},[$,w.title,w.description,C,w.id]);let it=ue.useCallback(()=>{me(!0),gt(Oe.current),C(Ee=>Ee.filter(Le=>Le.toastId!==w.id)),setTimeout(()=>{D(w)},LD)},[w,D,C,Oe]);ue.useEffect(()=>{if(w.promise&&At==="loading"||w.duration===1/0||w.type==="loading")return;let Ee;return U||j||P&&Qa?(()=>{if(Qe.current<se.current){let Le=new Date().getTime()-se.current;Bt.current=Bt.current-Le}Qe.current=new Date().getTime()})():Bt.current!==1/0&&(se.current=new Date().getTime(),Ee=setTimeout(()=>{var Le;(Le=w.onAutoClose)==null||Le.call(w,w),it()},Bt.current)),()=>clearTimeout(Ee)},[U,j,w,At,P,Qa,it]),ue.useEffect(()=>{w.delete&&it()},[it,w.delete]);function qt(){var Ee,Le,Be;return te!=null&&te.loading?ue.createElement("div",{className:ja(W==null?void 0:W.loader,(Ee=w==null?void 0:w.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":At==="loading"},te.loading):H?ue.createElement("div",{className:ja(W==null?void 0:W.loader,(Le=w==null?void 0:w.classNames)==null?void 0:Le.loader,"sonner-loader"),"data-visible":At==="loading"},H):ue.createElement(gD,{className:ja(W==null?void 0:W.loader,(Be=w==null?void 0:w.classNames)==null?void 0:Be.loader),visible:At==="loading"})}return ue.createElement("li",{tabIndex:0,ref:yt,className:ja(G,Wt,W==null?void 0:W.toast,(a=w==null?void 0:w.classNames)==null?void 0:a.toast,W==null?void 0:W.default,W==null?void 0:W[At],(l=w==null?void 0:w.classNames)==null?void 0:l[At]),"data-sonner-toast":"","data-rich-colors":(o=w.richColors)!=null?o:B,"data-styled":!(w.jsx||w.unstyled||E),"data-mounted":$,"data-promise":!!w.promise,"data-swiped":ze,"data-removed":he,"data-visible":sn,"data-y-position":xa,"data-x-position":ka,"data-index":T,"data-front":bt,"data-swiping":Te,"data-dismissible":Dt,"data-type":At,"data-invert":Dr,"data-swipe-out":De,"data-swipe-direction":de,"data-expanded":!!(U||X&&$),style:{"--index":T,"--toasts-before":T,"--z-index":A.length-T,"--offset":`${he?Mt:Oe.current}px`,"--initial-height":X?"auto":`${ln}px`,...V,...w.style},onDragEnd:()=>{je(!1),le(null),ot.current=null},onPointerDown:Ee=>{Ct||!Dt||(zt.current=new Date,gt(Oe.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(je(!0),ot.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,Le,Be,wt;if(De||!Dt)return;ot.current=null;let Ot=Number(((Ee=yt.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),dt=Number(((Le=yt.current)==null?void 0:Le.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Kt=new Date().getTime()-((Be=zt.current)==null?void 0:Be.getTime()),Et=Z==="x"?Ot:dt,Ht=Math.abs(Et)/Kt;if(Math.abs(Et)>=zD||Ht>.11){gt(Oe.current),(wt=w.onDismiss)==null||wt.call(w,w),ve(Z==="x"?Ot>0?"right":"left":dt>0?"down":"up"),it(),Xe(!0),Je(!1);return}je(!1),le(null)},onPointerMove:Ee=>{var Le,Be,wt,Ot;if(!ot.current||!Dt||((Le=window.getSelection())==null?void 0:Le.toString().length)>0)return;let dt=Ee.clientY-ot.current.y,Kt=Ee.clientX-ot.current.x,Et=(Be=n.swipeDirections)!=null?Be:UD(ae);!Z&&(Math.abs(Kt)>1||Math.abs(dt)>1)&&le(Math.abs(Kt)>Math.abs(dt)?"x":"y");let Ht={x:0,y:0};Z==="y"?(Et.includes("top")||Et.includes("bottom"))&&(Et.includes("top")&&dt<0||Et.includes("bottom")&&dt>0)&&(Ht.y=dt):Z==="x"&&(Et.includes("left")||Et.includes("right"))&&(Et.includes("left")&&Kt<0||Et.includes("right")&&Kt>0)&&(Ht.x=Kt),(Math.abs(Ht.x)>0||Math.abs(Ht.y)>0)&&Je(!0),(wt=yt.current)==null||wt.style.setProperty("--swipe-amount-x",`${Ht.x}px`),(Ot=yt.current)==null||Ot.style.setProperty("--swipe-amount-y",`${Ht.y}px`)}},pn&&!w.jsx?ue.createElement("button",{"aria-label":k,"data-disabled":Ct,"data-close-button":!0,onClick:Ct||!Dt?()=>{}:()=>{var Ee;it(),(Ee=w.onDismiss)==null||Ee.call(w,w)},className:ja(W==null?void 0:W.closeButton,(c=w==null?void 0:w.classNames)==null?void 0:c.closeButton)},(u=te==null?void 0:te.close)!=null?u:wD):null,w.jsx||m.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ue.createElement(ue.Fragment,null,At||w.icon||w.promise?ue.createElement("div",{"data-icon":"",className:ja(W==null?void 0:W.icon,(f=w==null?void 0:w.classNames)==null?void 0:f.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||qt():null,w.type!=="loading"?w.icon||(te==null?void 0:te[At])||mD(At):null):null,ue.createElement("div",{"data-content":"",className:ja(W==null?void 0:W.content,(p=w==null?void 0:w.classNames)==null?void 0:p.content)},ue.createElement("div",{"data-title":"",className:ja(W==null?void 0:W.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?ue.createElement("div",{"data-description":"",className:ja(oe,Hn,W==null?void 0:W.description,(v=w==null?void 0:w.classNames)==null?void 0:v.description)},typeof w.description=="function"?w.description():w.description):null),m.isValidElement(w.cancel)?w.cancel:w.cancel&&Yc(w.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||L,onClick:Ee=>{var Le,Be;Yc(w.cancel)&&Dt&&((Be=(Le=w.cancel).onClick)==null||Be.call(Le,Ee),it())},className:ja(W==null?void 0:W.cancelButton,(x=w==null?void 0:w.classNames)==null?void 0:x.cancelButton)},w.cancel.label):null,m.isValidElement(w.action)?w.action:w.action&&Yc(w.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||J,onClick:Ee=>{var Le,Be;Yc(w.action)&&((Be=(Le=w.action).onClick)==null||Be.call(Le,Ee),!Ee.defaultPrevented&&it())},className:ja(W==null?void 0:W.actionButton,(y=w==null?void 0:w.classNames)==null?void 0:y.actionButton)},w.action.label):null))};function Nb(){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 HD(n,a){let l={};return[n,a].forEach((o,c)=>{let u=c===1,f=u?"--mobile-offset":"--offset",p=u?OD:DD;function g(v){["top","right","bottom","left"].forEach(x=>{l[`${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?l[`${f}-${v}`]=p:l[`${f}-${v}`]=typeof o[v]=="number"?`${o[v]}px`:o[v]}):g(p)}),l}var ID=m.forwardRef(function(n,a){let{invert:l,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:E=AD,toastOptions:j,dir:C=Nb(),gap:R=kD,loadingIcon:M,icons:T,containerAriaLabel:A="Notifications",pauseWhenPageIsHidden:U}=n,[D,B]=ue.useState([]),O=ue.useMemo(()=>Array.from(new Set([o].concat(D.filter(P=>P.position).map(P=>P.position)))),[D,o]),[V,L]=ue.useState([]),[J,G]=ue.useState(!1),[oe,ce]=ue.useState(!1),[ae,_]=ue.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=ue.useRef(null),X=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ue.useRef(null),te=ue.useRef(!1),k=ue.useCallback(P=>{B(Z=>{var le;return(le=Z.find(de=>de.id===P.id))!=null&&le.delete||An.dismiss(P.id),Z.filter(({id:de})=>de!==P.id)})},[]);return ue.useEffect(()=>An.subscribe(P=>{if(P.dismiss){B(Z=>Z.map(le=>le.id===P.id?{...le,delete:!0}:le));return}setTimeout(()=>{XE.flushSync(()=>{B(Z=>{let le=Z.findIndex(de=>de.id===P.id);return le!==-1?[...Z.slice(0,le),{...Z[le],...P},...Z.slice(le+1)]:[P,...Z]})})})}),[]),ue.useEffect(()=>{if(x!=="system"){_(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?_("dark"):_("light")),typeof window>"u")return;let P=window.matchMedia("(prefers-color-scheme: dark)");try{P.addEventListener("change",({matches:Z})=>{_(Z?"dark":"light")})}catch{P.addListener(({matches:le})=>{try{_(le?"dark":"light")}catch(de){console.error(de)}})}},[x]),ue.useEffect(()=>{D.length<=1&&G(!1)},[D]),ue.useEffect(()=>{let P=Z=>{var le,de;c.every(ve=>Z[ve]||Z.code===ve)&&(G(!0),(le=H.current)==null||le.focus()),Z.code==="Escape"&&(document.activeElement===H.current||(de=H.current)!=null&&de.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[c]),ue.useEffect(()=>{if(H.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,te.current=!1)}},[H.current]),ue.createElement("section",{ref:a,"aria-label":`${A} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((P,Z)=>{var le;let[de,ve]=P.split("-");return D.length?ue.createElement("ol",{key:P,dir:C==="auto"?Nb():C,tabIndex:-1,ref:H,className:p,"data-sonner-toaster":!0,"data-theme":ae,"data-y-position":de,"data-lifted":J&&D.length>1&&!u,"data-x-position":ve,style:{"--front-toast-height":`${((le=V[0])==null?void 0:le.height)||0}px`,"--width":`${_D}px`,"--gap":`${R}px`,...w,...HD(g,v)},onBlur:$=>{te.current&&!$.currentTarget.contains($.relatedTarget)&&(te.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:$=>{$.target instanceof HTMLElement&&$.target.dataset.dismissible==="false"||te.current||(te.current=!0,W.current=$.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{oe||G(!1)},onDragEnd:()=>G(!1),onPointerDown:$=>{$.target instanceof HTMLElement&&$.target.dataset.dismissible==="false"||ce(!0)},onPointerUp:()=>ce(!1)},D.filter($=>!$.position&&Z===0||$.position===P).map(($,ie)=>{var he,me;return ue.createElement(BD,{key:$.id,icons:T,index:ie,toast:$,defaultRichColors:y,duration:(he=j==null?void 0:j.duration)!=null?he:b,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:l,visibleToasts:E,closeButton:(me=j==null?void 0:j.closeButton)!=null?me:f,interacting:oe,position:P,style:j==null?void 0:j.style,unstyled:j==null?void 0:j.unstyled,classNames:j==null?void 0:j.classNames,cancelButtonStyle:j==null?void 0:j.cancelButtonStyle,actionButtonStyle:j==null?void 0:j.actionButtonStyle,removeToast:k,toasts:D.filter(Te=>Te.position==$.position),heights:V.filter(Te=>Te.position==$.position),setHeights:L,expandByDefault:u,gap:R,loadingIcon:M,expanded:J,pauseWhenPageIsHidden:U,swipeDirections:n.swipeDirections})})):null}))});function PD(){const{login:n}=Bm(),[a,l]=m.useState("admin"),[o,c]=m.useState(""),[u,f]=m.useState(""),[p,g]=m.useState(""),[v,x]=m.useState(!1),[y,b]=m.useState(!1),w=hi(),E=Ln();return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(at,{className:"w-full max-w-sm",children:[s.jsxs(rt,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain"}),s.jsx(lt,{children:"Sign in"})]}),s.jsx(xn,{children:"Enter your admin credentials."})]}),s.jsxs(st,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Username"}),s.jsx(Ae,{value:a,onChange:j=>l(j.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Password"}),s.jsx(Ae,{type:"password",value:o,onChange:j=>c(j.target.value)})]}),v&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"2FA code (or recovery code)"}),s.jsx(Ae,{value:u,onChange:j=>f(j.target.value),placeholder:"123456",maxLength:6})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Recovery code (alternative)"}),s.jsx(Ae,{value:p,onChange:j=>g(j.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),s.jsx("div",{className:"px-6 pb-6",children:s.jsx(fe,{className:"w-full",disabled:y,onClick:async()=>{var j,C;b(!0);try{if((await n(a,o,u||void 0,p||void 0)).totpRequired){x(!0);return}const M=((C=(j=E.state)==null?void 0:j.from)==null?void 0:C.pathname)??"/";w(M,{replace:!0})}catch(R){ge.error(R.message)}finally{b(!1)}},children:"Sign in"})})]})})}function Tw({value:n,className:a,indicatorClassName:l}){const o=Math.max(0,Math.min(100,Number.isFinite(n)?n:0));return s.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:s.jsx("div",{className:Ce("h-full w-full flex-1 bg-primary transition-all",l),style:{transform:`translateX(-${100-o}%)`}})})}function zh(){const n=new Error("Upload cancelled");return n.name="AbortError",n}function qD(n){var a;try{const l=JSON.parse(n);if((a=l==null?void 0:l.error)!=null&&a.message)return l.error.message}catch{}return"Restore failed"}function VD(n){try{const a=JSON.parse(n);return{ok:a.ok!==!1,profile:a.profile,message:a.message}}catch{return{ok:!0}}}function Mw({file:n,passphrase:a,onProgress:l,signal:o,includeCsrf:c=!0}){return new Promise((u,f)=>{if(o!=null&&o.aborted){f(zh());return}const p=new FormData;p.append("backup",n),a&&p.append("passphrase",a);const g=new XMLHttpRequest;g.open("POST","/api/admin/backup/restore"),g.withCredentials=!0;let v=!1;const x=b=>{v||(v=!0,o==null||o.removeEventListener("abort",y),b())};function y(){x(()=>f(zh())),g.abort()}g.upload.onprogress=b=>{const w=b.total||n.size,E=w>0?Math.min(100,Math.round(b.loaded/w*100)):0;l==null||l({loaded:b.loaded,total:w,percent:E})},g.onload=()=>{g.status>=200&&g.status<300?x(()=>u(VD(g.responseText))):x(()=>f(new Error(qD(g.responseText))))},g.onerror=()=>x(()=>f(new Error("Restore failed"))),g.onabort=()=>x(()=>f(zh())),o==null||o.addEventListener("abort",y),(async()=>{try{if(c){const b=await fetch("/api/admin/csrf",{credentials:"include"});if(b.ok){const{csrfToken:w}=await b.json();g.setRequestHeader("x-csrf-token",w)}}v||g.send(p)}catch{x(()=>f(new Error("Restore failed")))}})()})}function $D(){const[n,a]=m.useState("admin"),[l,o]=m.useState(""),[c,u]=m.useState(""),[f,p]=m.useState(!1),[g,v]=m.useState(!0),[x,y]=m.useState(null),[b,w]=m.useState(""),[E,j]=m.useState(!1),[C,R]=m.useState("idle"),[M,T]=m.useState(null),A=m.useRef(null);m.useEffect(()=>{we.get("/api/admin/setup/status").then(O=>v(!O.masterKeyConfigured)).catch(()=>v(!0))},[]);const U=!g||c.trim().length>=32,D=!f&&l.length>=12&&U,B=async()=>{if(!x)return;const O=new AbortController;A.current=O,j(!0),T({loaded:0,total:x.size,percent:0}),R("uploading");let V;try{await Mw({file:x,passphrase:b||void 0,signal:O.signal,includeCsrf:!1,onProgress:L=>{T(L),L.percent>=100&&(R("validating"),V=setTimeout(()=>R("restoring"),1500))}}),clearTimeout(V),ge.success("Database imported"),window.location.assign("/login")}catch(L){clearTimeout(V),L.name==="AbortError"?(ge.info("Import cancelled"),R("idle")):(ge.error(L.message),R("failed"))}finally{A.current=null,j(!1)}};return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(at,{className:"w-full max-w-md",children:[s.jsxs(rt,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain rounded"}),s.jsx(lt,{children:"Welcome to LateDev Router"})]}),s.jsx(xn,{children:"Set up the administrator account to get started."})]}),s.jsxs(st,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Username"}),s.jsx(Ae,{value:n,onChange:O=>a(O.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Password (12+ chars)"}),s.jsx(Ae,{type:"password",value:l,onChange:O=>o(O.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(be,{children:["Master encryption key ",g?"(required, 32+ chars)":"(already configured)"]}),s.jsx(Ae,{type:"password",value:c,onChange:O=>u(O.target.value),placeholder:"Paste or generate a 32+ character key"}),s.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:"," ",s.jsx("code",{className:"break-all",children:`node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"`})]})]})]}),s.jsxs(Nw,{className:"flex-col items-stretch gap-4",children:[s.jsx(fe,{disabled:!D,onClick:async()=>{p(!0);try{await we.post("/api/admin/setup",{username:n,password:l,setupMasterKey:c.trim()||void 0}),ge.success("Admin account created"),window.location.assign("/login")}catch(O){ge.error(O.message)}finally{p(!1)}},children:"Create admin"}),s.jsxs("div",{className:"border-t pt-4 space-y-2",children:[s.jsx(be,{children:"Import existing database"}),s.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."}),s.jsx(Ae,{type:"file",accept:".ldb,.ldb.json,application/octet-stream,application/json",disabled:E,onChange:O=>{var V;return y(((V=O.target.files)==null?void 0:V[0])??null)}}),s.jsx(Ae,{inputMode:"numeric",maxLength:6,value:b,onChange:O=>w(O.target.value.replace(/\D/g,"")),placeholder:"Backup passphrase (6 digits)"}),s.jsx(fe,{variant:"outline",disabled:!x||b.length!==6||E,onClick:B,children:"Import database"}),C!=="idle"&&s.jsxs("div",{className:"space-y-2 rounded border p-3","data-testid":"import-progress",children:[s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("span",{children:[C==="uploading"&&"Uploading…",C==="validating"&&"Validating…",C==="restoring"&&"Restoring…",C==="failed"&&"Failed"]}),C==="uploading"&&M&&s.jsxs("span",{className:"text-muted-foreground",children:[(M.loaded/1048576).toFixed(1)," / ",(M.total/1048576).toFixed(1)," MiB · ",M.percent,"%"]})]}),s.jsx(Tw,{value:C==="uploading"?(M==null?void 0:M.percent)??0:100,className:C!=="uploading"?"animate-pulse":void 0}),C==="uploading"&&s.jsx(fe,{variant:"outline",size:"sm",onClick:()=>{var O;return(O=A.current)==null?void 0:O.abort()},children:"Cancel"})]})]})]})]})})}function Ka({title:n,description:a,actions:l,className:o}){return s.jsxs("div",{className:Ce("mb-6 flex items-start justify-between gap-4",o),children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:n}),a&&s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a})]}),l&&s.jsx("div",{className:"flex items-center gap-2",children:l})]})}const YD=Z0("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 Ze({className:n,variant:a,...l}){return s.jsx("div",{className:Ce(YD({variant:a}),n),...l})}const Lh=n=>n==="ready"||n==="healthy"?"success":n==="disabled"?"secondary":"destructive";function GD(){const[n,a]=m.useState(null);return m.useEffect(()=>{we.get("/api/admin/dashboard").then(a).catch(()=>a(null))},[]),n?s.jsxs("div",{children:[s.jsx(Ka,{title:"Dashboard",description:"Operational summary for today",actions:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(fe,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ia,{to:"/providers",children:[s.jsx(Mu,{className:"mr-1 h-4 w-4"})," Provider"]})}),s.jsx(fe,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ia,{to:"/combos",children:[s.jsx(O0,{className:"mr-1 h-4 w-4"})," Combo"]})}),s.jsx(fe,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ia,{to:"/api-keys",children:[s.jsx(D0,{className:"mr-1 h-4 w-4"})," API Key"]})})]})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs(at,{children:[s.jsx(rt,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Requests today"})}),s.jsx(st,{className:"text-2xl font-semibold",children:Zt(n.today.total)})]}),s.jsxs(at,{children:[s.jsx(rt,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Success rate"})}),s.jsx(st,{className:"text-2xl font-semibold",children:n.today.total?Ou(n.today.success/n.today.total):"—"})]}),s.jsxs(at,{children:[s.jsx(rt,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Failed"})}),s.jsx(st,{className:"text-2xl font-semibold",children:Zt(n.today.failed)})]}),s.jsxs(at,{children:[s.jsx(rt,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),s.jsx(st,{className:"text-2xl font-semibold",children:Zt(n.today.totalTokens)})]})]}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[s.jsxs(at,{children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"text-base",children:"Provider health"}),s.jsxs(xn,{children:[n.providers.length," configured"]})]}),s.jsxs(st,{className:"space-y-2",children:[n.providers.length===0&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["No providers yet. ",s.jsx(ia,{to:"/providers",className:"text-primary",children:"Add one"}),"."]}),n.providers.map(l=>s.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(_0,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),s.jsx(ia,{className:"truncate font-medium text-primary hover:underline",to:`/providers?providerId=${encodeURIComponent(l.id)}`,children:l.name}),s.jsx("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:l.slug}),s.jsx(Ze,{variant:"outline",className:"ml-2",children:l.type})]}),s.jsx(Ze,{variant:Lh(l.health),children:l.health})]},l.id))]})]}),s.jsxs(at,{children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"text-base",children:"Recent failures"}),s.jsx(xn,{children:"Today"})]}),s.jsxs(st,{className:"space-y-1 text-sm",children:[n.recentFailures.length===0&&s.jsx("p",{className:"text-muted-foreground",children:"No failures today."}),n.recentFailures.map(l=>{var o;return s.jsxs("div",{className:"flex items-center justify-between border-b py-1 last:border-0",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-mono text-xs",children:l.requestedModel}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.errorType??`HTTP ${l.httpStatus}`," — ",(o=l.errorMessage)==null?void 0:o.slice(0,60)]})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:Pm(l.createdAt)})]},l.id)})]})]})]}),s.jsxs(at,{className:"mt-6",children:[s.jsxs(rt,{children:[s.jsxs(lt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Hm,{className:"h-4 w-4"})," Health center"]}),s.jsx(xn,{children:"Passive status from recent traffic; no active provider polling."})]}),s.jsxs(st,{className:"grid gap-4 lg:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"mb-2 text-sm font-medium",children:"Combos"}),s.jsx("div",{className:"space-y-2",children:n.combos.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No combos configured."}):n.combos.map(l=>s.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(ia,{className:"font-mono text-xs text-primary hover:underline",to:"/combos",children:l.publicModelId}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.readyMembers,"/",l.memberCount," members ready",l.reasons.length>0?` · ${l.reasons.join(", ")}`:""]})]}),s.jsx(Ze,{variant:Lh(l.state),children:l.state})]},l.id))})]}),s.jsxs("div",{children:[s.jsx("div",{className:"mb-2 text-sm font-medium",children:"Models"}),s.jsx("div",{className:"max-h-64 space-y-2 overflow-auto",children:n.models.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No models imported."}):n.models.map(l=>s.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(ia,{className:"font-mono text-xs text-primary hover:underline",to:`/models?providerId=${encodeURIComponent(l.providerId)}`,children:l.publicModelId}),s.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:[l.providerName??"Unknown provider",l.lastFailureReason?` · last: ${l.lastFailureReason}`:""]})]}),s.jsx(Ze,{variant:Lh(l.state),children:l.state})]},l.id))})]})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const pa=m.forwardRef(({className:n,...a},l)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:l,className:Ce("w-full caption-bottom text-sm",n),...a})}));pa.displayName="Table";const ga=m.forwardRef(({className:n,...a},l)=>s.jsx("thead",{ref:l,className:Ce("[&_tr]:border-b",n),...a}));ga.displayName="TableHeader";const va=m.forwardRef(({className:n,...a},l)=>s.jsx("tbody",{ref:l,className:Ce("[&_tr:last-child]:border-0",n),...a}));va.displayName="TableBody";const tt=m.forwardRef(({className:n,...a},l)=>s.jsx("tr",{ref:l,className:Ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...a}));tt.displayName="TableRow";const xe=m.forwardRef(({className:n,...a},l)=>s.jsx("th",{ref:l,className:Ce("h-10 px-2 text-left align-middle font-medium text-muted-foreground",n),...a}));xe.displayName="TableHead";const pe=m.forwardRef(({className:n,...a},l)=>s.jsx("td",{ref:l,className:Ce("p-2 align-middle",n),...a}));pe.displayName="TableCell";var FD=Object.defineProperty,Qn=(n,a)=>FD(n,"name",{value:a,configurable:!0}),cp="Dialog",[Aw,Dw]=Un(cp),[KD,_a]=Aw(cp),Ow=Qn(n=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:u,modal:f=!0}=n,p=m.useRef(null),g=m.useRef(null),[v,x]=jr({prop:o,defaultProp:c??!1,onChange:u,caller:cp}),[y,b]=m.useState(0),[w,E]=m.useState(0);return s.jsx(KD,{scope:a,triggerRef:p,contentRef:g,contentId:qa(),titleId:qa(),descriptionId:qa(),titlePresent:y>0,descriptionPresent:w>0,setTitleCount:b,setDescriptionCount:E,open:v,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(j=>!j),[x]),modal:f,children:l})},"Dialog"),XD="DialogTrigger",_w=m.forwardRef(Qn(function(a,l){const{__scopeDialog:o,...c}=a,u=_a(XD,o),f=Ke(l,u.triggerRef);return s.jsx(Ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":Fu(u.open),...c,ref:f,onClick:Ne(a.onClick,u.onOpenToggle)})},"DialogTrigger")),kw="DialogPortal",[QD,zw]=Aw(kw,{forceMount:void 0}),Lw=Qn(n=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=n,u=_a(kw,a);return s.jsx(QD,{scope:a,forceMount:l,children:m.Children.map(o,f=>s.jsx(Tr,{present:l||u.open,children:s.jsx(np,{asChild:!0,container:c,children:f})}))})},"DialogPortal"),dm="DialogOverlay",up=m.forwardRef(Qn(function(a,l){const o=zw(dm,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=_a(dm,a.__scopeDialog);return f.modal?s.jsx(Tr,{present:c||f.open,children:s.jsx(JD,{...u,ref:l})}):null},"DialogOverlay")),ZD=Va("DialogOverlay.RemoveScroll"),JD=m.forwardRef(Qn(function(a,l){const{__scopeDialog:o,...c}=a,u=_a(dm,o),f=d1(),p=Ke(l,f);return s.jsx(Yu,{as:ZD,allowPinchZoom:!0,shards:[u.contentRef],children:s.jsx(Ve.div,{"data-state":Fu(u.open),...c,ref:p,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),ti="DialogContent",dp=m.forwardRef(Qn(function(a,l){const o=zw(ti,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=_a(ti,a.__scopeDialog);return s.jsx(Tr,{present:c||f.open,children:f.modal?s.jsx(WD,{...u,ref:l}):s.jsx(eO,{...u,ref:l})})},"DialogContent")),WD=m.forwardRef(Qn(function(a,l){const o=_a(ti,a.__scopeDialog),c=m.useRef(null),u=Ke(l,o.contentRef,c);return m.useEffect(()=>{const f=c.current;if(f)return lp(f)},[]),s.jsx(Uw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:Ne(a.onCloseAutoFocus,f=>{var p;f.preventDefault(),(p=o.triggerRef.current)==null||p.focus()}),onPointerDownOutside:Ne(a.onPointerDownOutside,f=>{const p=f.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&f.preventDefault()}),onFocusOutside:Ne(a.onFocusOutside,f=>f.preventDefault())})},"DialogContentModal")),eO=m.forwardRef(Qn(function(a,l){const o=_a(ti,a.__scopeDialog),c=m.useRef(!1),u=m.useRef(!1);return s.jsx(Uw,{...a,ref:l,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")),Uw=m.forwardRef(Qn(function(a,l){const{__scopeDialog:o,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,...p}=a,g=_a(ti,o);return xi(),s.jsx(s.Fragment,{children:s.jsx(Fm,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:u,onUnmountAutoFocus:f,children:s.jsx(ku,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Fu(g.open),...p,ref:l,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),tO="DialogTitle",fp=m.forwardRef(Qn(function(a,l){const{__scopeDialog:o,...c}=a,u=_a(tO,o),{setTitleCount:f}=u;return Jt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),s.jsx(Ve.h2,{id:u.titleId,...c,ref:l})},"DialogTitle")),nO="DialogDescription",hp=m.forwardRef(Qn(function(a,l){const{__scopeDialog:o,...c}=a,u=_a(nO,o),{setDescriptionCount:f}=u;return Jt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),s.jsx(Ve.p,{id:u.descriptionId,...c,ref:l})},"DialogDescription")),aO="DialogClose",mp=m.forwardRef(Qn(function(a,l){const{__scopeDialog:o,...c}=a,u=_a(aO,o);return s.jsx(Ve.button,{type:"button",...c,ref:l,onClick:Ne(a.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function Fu(n){return n?"open":"closed"}Qn(Fu,"getState");const On=Ow,bi=_w,rO=Lw,Bw=m.forwardRef(({className:n,...a},l)=>s.jsx(up,{ref:l,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}));Bw.displayName=up.displayName;const yn=m.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(rO,{children:[s.jsx(Bw,{}),s.jsxs(dp,{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),...l,children:[a,s.jsxs(mp,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[s.jsx(Du,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yn.displayName=dp.displayName;const bn=({className:n,...a})=>s.jsx("div",{className:Ce("flex flex-col space-y-1.5 text-center sm:text-left",n),...a});bn.displayName="DialogHeader";const _n=({className:n,...a})=>s.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a});_n.displayName="DialogFooter";const wn=m.forwardRef(({className:n,...a},l)=>s.jsx(fp,{ref:l,className:Ce("text-lg font-semibold leading-none tracking-tight",n),...a}));wn.displayName=fp.displayName;const mu=m.forwardRef(({className:n,...a},l)=>s.jsx(hp,{ref:l,className:Ce("text-sm text-muted-foreground",n),...a}));mu.displayName=hp.displayName;var lO=Object.defineProperty,Mr=(n,a)=>lO(n,"name",{value:a,configurable:!0}),sO="AlertDialog",[oO,Z4]=Un(sO,[Dw]),Ar=Dw(),iO=Mr(n=>{const{__scopeAlertDialog:a,...l}=n,o=Ar(a);return s.jsx(Ow,{...o,...l,modal:!0})},"AlertDialog"),cO=m.forwardRef(Mr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Ar(o);return s.jsx(_w,{...u,...c,ref:l})},"AlertDialogTrigger")),uO=Mr(n=>{const{__scopeAlertDialog:a,...l}=n,o=Ar(a);return s.jsx(Lw,{...o,...l})},"AlertDialogPortal"),dO=m.forwardRef(Mr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Ar(o);return s.jsx(up,{...u,...c,ref:l})},"AlertDialogOverlay")),fO="AlertDialogContent",[hO,mO]=oO(fO),pO=m.forwardRef(Mr(function(a,l){const{__scopeAlertDialog:o,children:c,...u}=a,f=Ar(o),p=m.useRef(null),g=Ke(l,p),v=m.useRef(null);return s.jsx(hO,{scope:o,cancelRef:v,children:s.jsx(dp,{role:"alertdialog",...f,...u,ref:g,onOpenAutoFocus:Ne(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")),gO=m.forwardRef(Mr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Ar(o);return s.jsx(fp,{...u,...c,ref:l})},"AlertDialogTitle")),vO=m.forwardRef(Mr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Ar(o);return s.jsx(hp,{...u,...c,ref:l})},"AlertDialogDescription")),xO=m.forwardRef(Mr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Ar(o);return s.jsx(mp,{...u,...c,ref:l})},"AlertDialogAction")),yO="AlertDialogCancel",bO=m.forwardRef(Mr(function(a,l){const{__scopeAlertDialog:o,...c}=a,{cancelRef:u}=mO(yO,o),f=Ar(o),p=Ke(l,u);return s.jsx(mp,{...f,...c,ref:p})},"AlertDialogCancel")),wO=iO,SO=cO,jO=uO,Hw=dO,Iw=pO,Pw=xO,qw=bO,Vw=gO,$w=vO;const pu=wO,Tb=SO,CO=jO,Yw=m.forwardRef(({className:n,...a},l)=>s.jsx(Hw,{ref:l,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}));Yw.displayName=Hw.displayName;const ni=m.forwardRef(({className:n,...a},l)=>s.jsxs(CO,{children:[s.jsx(Yw,{}),s.jsx(Iw,{ref:l,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})]}));ni.displayName=Iw.displayName;const gu=({className:n,...a})=>s.jsx("div",{className:Ce("flex flex-col space-y-2 text-center sm:text-left",n),...a}),vu=({className:n,...a})=>s.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a}),ai=m.forwardRef(({className:n,...a},l)=>s.jsx(Vw,{ref:l,className:Ce("text-lg font-semibold",n),...a}));ai.displayName=Vw.displayName;const ri=m.forwardRef(({className:n,...a},l)=>s.jsx($w,{ref:l,className:Ce("text-sm text-muted-foreground",n),...a}));ri.displayName=$w.displayName;const li=m.forwardRef(({className:n,...a},l)=>s.jsx(Pw,{ref:l,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}));li.displayName=Pw.displayName;const si=m.forwardRef(({className:n,...a},l)=>s.jsx(qw,{ref:l,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}));si.displayName=qw.displayName;var EO=Object.defineProperty,RO=(n,a)=>EO(n,"name",{value:a,configurable:!0});function fm(n,[a,l]){return Math.min(l,Math.max(a,n))}RO(fm,"clamp");var NO=Object.defineProperty,TO=(n,a)=>NO(n,"name",{value:a,configurable:!0});function Gw(n){const a=m.useRef({value:n,previous:n});return m.useMemo(()=>(a.current.value!==n&&(a.current.previous=a.current.value,a.current.value=n),a.current.previous),[n])}TO(Gw,"usePrevious");var MO=Object.defineProperty,AO=(n,a)=>MO(n,"name",{value:a,configurable:!0}),Fw=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"}),DO=m.forwardRef(AO(function(a,l){return s.jsx(Ve.span,{...a,ref:l,style:{...Fw,...a.style}})},"VisuallyHidden")),OO=DO,_O=Object.defineProperty,pt=(n,a)=>_O(n,"name",{value:a,configurable:!0}),kO=[" ","Enter","ArrowUp","ArrowDown"],zO=[" ","Enter"],Hs="Select",[Ku,pp,LO]=_u(Hs),[Vl,J4]=Un(Hs,[LO,Ks]),gp=Ks(),[UO,ml]=Vl(Hs),[BO,HO]=Vl(Hs);function Kw(n){const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:u,value:f,defaultValue:p,onValueChange:g,dir:v,name:x,autoComplete:y,disabled:b,required:w,form:E,internal_do_not_use_render:j}=n,C=gp(a),[R,M]=m.useState(null),[T,A]=m.useState(null),[U,D]=m.useState(!1),B=vi(v),[O,V]=jr({prop:o,defaultProp:c??!1,onChange:u,caller:Hs}),[L,J]=jr({prop:f,defaultProp:p,onChange:g,caller:Hs}),G=m.useRef(null),oe=m.useRef(L);m.useEffect(()=>{const P=E?R==null?void 0:R.ownerDocument.getElementById(E):R==null?void 0:R.form;if(P instanceof HTMLFormElement){const Z=pt(()=>J(oe.current),"reset");return P.addEventListener("reset",Z),()=>P.removeEventListener("reset",Z)}},[E,R,J]);const ce=R?!!E||!!R.closest("form"):!0,[ae,_]=m.useState(new Set),H=qa(),X=Array.from(ae).map(P=>P.props.value).join(";"),W=m.useCallback(P=>{_(Z=>new Set(Z).add(P))},[]),te=m.useCallback(P=>{_(Z=>{const le=new Set(Z);return le.delete(P),le})},[]),k={required:w,trigger:R,onTriggerChange:M,valueNode:T,onValueNodeChange:A,valueNodeHasChildren:U,onValueNodeHasChildrenChange:D,contentId:H,value:L,onValueChange:J,open:O,onOpenChange:V,dir:B,triggerPointerDownPosRef:G,disabled:b,name:x,autoComplete:y,form:E,nativeOptions:ae,nativeSelectKey:X,isFormControl:ce};return s.jsx(L1,{...C,children:s.jsx(UO,{scope:a,...k,children:s.jsx(Ku.Provider,{scope:a,children:s.jsx(BO,{scope:a,onNativeOptionAdd:W,onNativeOptionRemove:te,children:eS(j)?j(k):l})})})})}pt(Kw,"SelectProvider");var IO=pt(n=>{const{__scopeSelect:a,children:l,...o}=n;return s.jsx(Kw,{__scopeSelect:a,...o,internal_do_not_use_render:({isFormControl:c})=>s.jsxs(s.Fragment,{children:[l,c?s.jsx(i_,{__scopeSelect:a}):null]})})},"Select"),PO="SelectTrigger",Xw=m.forwardRef(pt(function(a,l){const{__scopeSelect:o,disabled:c=!1,...u}=a,f=gp(o),p=ml(PO,o),g=p.disabled||c,v=Ke(l,p.onTriggerChange),x=pp(o),y=m.useRef("touch"),[b,w,E]=vp(C=>{const R=x().filter(A=>!A.disabled),M=R.find(A=>A.value===p.value),T=xp(R,C,M);T!==void 0&&p.onValueChange(T.value)}),j=pt(C=>{g||(p.onOpenChange(!0),E()),C&&(p.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return s.jsx(U1,{asChild:!0,...f,children:s.jsx(Ve.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":wi(p.value)?"":void 0,...u,ref:v,onClick:Ne(u.onClick,C=>{C.currentTarget.focus(),y.current!=="mouse"&&j(C)}),onPointerDown:Ne(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"&&(j(C),C.preventDefault())}),onKeyDown:Ne(u.onKeyDown,C=>{const R=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&w(C.key),!(R&&C.key===" ")&&kO.includes(C.key)&&(j(),C.preventDefault())})})})},"SelectTrigger")),qO="SelectValue",VO=m.forwardRef(pt(function(a,l){const{__scopeSelect:o,className:c,style:u,children:f,placeholder:p="",...g}=a,v=ml(qO,o),{onValueNodeHasChildrenChange:x}=v,y=f!==void 0,b=Ke(l,v.onValueNodeChange);Jt(()=>{x(y)},[x,y]);const w=wi(v.value);return s.jsx(Ve.span,{...g,asChild:w?!1:g.asChild,ref:b,style:{pointerEvents:"none"},children:s.jsx(m.Fragment,{children:w?p:f},w?"placeholder":"value")})},"SelectValue")),$O=m.forwardRef(pt(function(a,l){const{__scopeSelect:o,children:c,...u}=a;return s.jsx(Ve.span,{"aria-hidden":!0,...u,ref:l,children:c||"▼"})},"SelectIcon")),YO="SelectPortal",[GO,FO]=Vl(YO,{forceMount:void 0}),KO=pt(n=>{const{__scopeSelect:a,forceMount:l,...o}=n;return s.jsx(GO,{scope:n.__scopeSelect,forceMount:l,children:s.jsx(np,{asChild:!0,...o})})},"SelectPortal"),Bl="SelectContent",Qw=m.forwardRef(pt(function(a,l){const o=FO(Bl,a.__scopeSelect),{forceMount:c=o.forceMount,...u}=a,f=ml(Bl,a.__scopeSelect),[p,g]=m.useState();return Jt(()=>{g(new DocumentFragment)},[]),s.jsx(Tr,{present:c||f.open,children:({present:v})=>v?s.jsx(ZO,{...u,ref:l}):s.jsx(XO,{...u,fragment:p})})},"SelectContent")),XO=m.forwardRef(pt(function(a,l){const{__scopeSelect:o,children:c,fragment:u}=a;return u?Ra.createPortal(s.jsx(Zw,{scope:o,children:s.jsx(Ku.Slot,{scope:o,children:s.jsx("div",{ref:l,children:c})})}),u):null},"SelectContentFragment")),Ca=10,[Zw,Xu]=Vl(Bl),QO=Va("SelectContent.RemoveScroll"),ZO=m.forwardRef(pt(function(a,l){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:E,sticky:j,hideWhenDetached:C,avoidCollisions:R,...M}=a,T=ml(Bl,o),[A,U]=m.useState(null),[D,B]=m.useState(null),O=Ke(l,U),[V,L]=m.useState(null),[J,G]=m.useState(null),oe=pp(o),[ce,ae]=m.useState(!1),_=m.useRef(!1);m.useEffect(()=>{if(A)return lp(A)},[A]),xi();const H=m.useCallback(ie=>{const[he,...me]=oe().map(De=>De.ref.current),[Te]=me.slice(-1),je=document.activeElement;for(const De of ie)if(De===je||(De==null||De.scrollIntoView({block:"nearest"}),De===he&&D&&(D.scrollTop=0),De===Te&&D&&(D.scrollTop=D.scrollHeight),De==null||De.focus(),document.activeElement!==je))return},[oe,D]),X=m.useCallback(()=>H([V,A]),[H,V,A]);m.useEffect(()=>{ce&&X()},[ce,X]);const{onOpenChange:W,triggerPointerDownPosRef:te}=T;m.useEffect(()=>{if(A){let ie={x:0,y:0};const he=pt(Te=>{var je,De;ie={x:Math.abs(Math.round(Te.pageX)-(((je=te.current)==null?void 0:je.x)??0)),y:Math.abs(Math.round(Te.pageY)-(((De=te.current)==null?void 0:De.y)??0))}},"handlePointerMove"),me=pt(Te=>{ie.x<=10&&ie.y<=10?Te.preventDefault():Te.composedPath().includes(A)||W(!1),document.removeEventListener("pointermove",he),te.current=null},"handlePointerUp");return te.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",me,{capture:!0})}}},[A,W,te]),m.useEffect(()=>{const ie=pt(()=>W(!1),"close");return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[W]);const[k,P]=vp(ie=>{const he=oe().filter(je=>!je.disabled),me=he.find(je=>je.ref.current===document.activeElement),Te=xp(he,ie,me);Te&&setTimeout(()=>{var je;return(je=Te.ref.current)==null?void 0:je.focus()})}),Z=m.useCallback((ie,he,me)=>{const Te=!_.current&&!me;(T.value!==void 0&&T.value===he||Te)&&(L(ie),Te&&(_.current=!0))},[T.value]),le=m.useCallback(()=>A==null?void 0:A.focus(),[A]),de=m.useCallback((ie,he,me)=>{const Te=!_.current&&!me;(T.value!==void 0&&T.value===he||Te)&&G(ie)},[T.value]),ve=c==="popper"?Mb:JO,$=ve===Mb?{side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:E,sticky:j,hideWhenDetached:C,avoidCollisions:R}:{};return s.jsx(Zw,{scope:o,content:A,viewport:D,onViewportChange:B,itemRefCallback:Z,selectedItem:V,onItemLeave:le,itemTextRefCallback:de,focusSelectedItem:X,selectedItemText:J,position:c,isPositioned:ce,searchRef:k,children:s.jsx(Yu,{as:QO,allowPinchZoom:!0,children:s.jsx(Fm,{asChild:!0,trapped:T.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Ne(u,ie=>{var he;(he=T.trigger)==null||he.focus({preventScroll:!0}),ie.preventDefault()}),children:s.jsx(ku,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:s.jsx(ve,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ie=>ie.preventDefault(),...M,...$,onPlaced:()=>ae(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:Ne(M.onKeyDown,ie=>{const he=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!he&&ie.key.length===1&&P(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let Te=oe().filter(je=>!je.disabled).map(je=>je.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const je=ie.target,De=Te.indexOf(je);Te=Te.slice(De+1)}setTimeout(()=>H(Te)),ie.preventDefault()}})})})})})})},"SelectContentImpl")),JO=m.forwardRef(pt(function(a,l){const{__scopeSelect:o,onPlaced:c,...u}=a,f=ml(Bl,o),p=Xu(Bl,o),[g,v]=m.useState(null),[x,y]=m.useState(null),b=Ke(l,y),w=pp(o),E=m.useRef(!1),j=m.useRef(!0),{viewport:C,selectedItem:R,selectedItemText:M,focusSelectedItem:T}=p,A=m.useCallback(()=>{if(f.trigger&&f.valueNode&&g&&x&&C&&R&&M){const O=f.trigger.getBoundingClientRect(),V=x.getBoundingClientRect(),L=f.valueNode.getBoundingClientRect(),J=M.getBoundingClientRect();if(f.dir!=="rtl"){const je=J.left-V.left,De=L.left-je,Xe=O.left-De,ze=O.width+Xe,Je=Math.max(ze,V.width),Mt=window.innerWidth-Ca,gt=fm(De,[Ca,Math.max(Ca,Mt-Je)]);g.style.minWidth=ze+"px",g.style.left=gt+"px"}else{const je=V.right-J.right,De=window.innerWidth-L.right-je,Xe=window.innerWidth-O.right-De,ze=O.width+Xe,Je=Math.max(ze,V.width),Mt=window.innerWidth-Ca,gt=fm(De,[Ca,Math.max(Ca,Mt-Je)]);g.style.minWidth=ze+"px",g.style.right=gt+"px"}const G=w(),oe=window.innerHeight-Ca*2,ce=C.scrollHeight,ae=window.getComputedStyle(x),_=parseInt(ae.borderTopWidth,10),H=parseInt(ae.paddingTop,10),X=parseInt(ae.borderBottomWidth,10),W=parseInt(ae.paddingBottom,10),te=_+H+ce+W+X,k=Math.min(R.offsetHeight*5,te),P=window.getComputedStyle(C),Z=parseInt(P.paddingTop,10),le=parseInt(P.paddingBottom,10),de=O.top+O.height/2-Ca,ve=oe-de,$=R.offsetHeight/2,ie=R.offsetTop+$,he=_+H+ie,me=te-he;if(he<=de){const je=G.length>0&&R===G[G.length-1].ref.current;g.style.bottom="0px";const De=x.clientHeight-C.offsetTop-C.offsetHeight,Xe=Math.max(ve,$+(je?le:0)+De+X),ze=he+Xe;g.style.height=ze+"px"}else{const je=G.length>0&&R===G[0].ref.current;g.style.top="0px";const Xe=Math.max(de,_+C.offsetTop+(je?Z:0)+$)+me;g.style.height=Xe+"px",C.scrollTop=he-de+C.offsetTop}g.style.margin=`${Ca}px 0`,g.style.minHeight=k+"px",g.style.maxHeight=oe+"px",c==null||c(),requestAnimationFrame(()=>E.current=!0)}},[w,f.trigger,f.valueNode,g,x,C,R,M,f.dir,c]);Jt(()=>A(),[A]);const[U,D]=m.useState();Jt(()=>{x&&D(window.getComputedStyle(x).zIndex)},[x]);const B=m.useCallback(O=>{O&&j.current===!0&&(A(),T==null||T(),j.current=!1)},[A,T]);return s.jsx(WO,{scope:o,contentWrapper:g,shouldExpandOnScrollRef:E,onScrollButtonChange:B,children:s.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:s.jsx(Ve.div,{...u,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...u.style}})})})},"SelectItemAlignedPosition")),Mb=m.forwardRef(pt(function(a,l){const{__scopeSelect:o,align:c="start",collisionPadding:u=Ca,...f}=a,p=gp(o);return s.jsx(tp,{...p,...f,ref:l,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")),[WO,e_]=Vl(Bl,{}),Ab="SelectViewport",t_=m.forwardRef(pt(function(a,l){const{__scopeSelect:o,nonce:c,...u}=a,f=Xu(Ab,o),p=e_(Ab,o),g=Ke(l,f.onViewportChange),v=m.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(Ku.Slot,{scope:o,children:s.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...u,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...u.style},onScroll:Ne(u.onScroll,x=>{const y=x.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:w}=p;if(w!=null&&w.current&&b){const E=Math.abs(v.current-y.scrollTop);if(E>0){const j=window.innerHeight-Ca*2,C=parseFloat(b.style.minHeight),R=parseFloat(b.style.height),M=Math.max(C,R);if(M<j){const T=M+E,A=Math.min(j,T),U=T-A;b.style.height=A+"px",b.style.bottom==="0px"&&(y.scrollTop=U>0?U:0,b.style.justifyContent="flex-end")}}}v.current=y.scrollTop})})})]})},"SelectViewport")),n_="SelectGroup",[W4,e5]=Vl(n_),hm="SelectItem",[a_,Jw]=Vl(hm),Ww=m.forwardRef(pt(function(a,l){const{__scopeSelect:o,value:c,disabled:u=!1,textValue:f,...p}=a,g=ml(hm,o),v=Xu(hm,o),x=g.value===c,[y,b]=m.useState(f??""),[w,E]=m.useState(!1),j=ma(A=>{var U;return(U=v.itemRefCallback)==null?void 0:U.call(v,A,c,u)}),C=Ke(l,j),R=qa(),M=m.useRef("touch"),T=pt(()=>{u||(g.onValueChange(c),g.onOpenChange(!1))},"handleSelect");return s.jsx(a_,{scope:o,value:c,disabled:u,textId:R,isSelected:x,onItemTextChange:m.useCallback(A=>{b(U=>U||((A==null?void 0:A.textContent)??"").trim())},[]),children:s.jsx(Ku.ItemSlot,{scope:o,value:c,disabled:u,textValue:y,children:s.jsx(Ve.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:Ne(p.onFocus,()=>E(!0)),onBlur:Ne(p.onBlur,()=>E(!1)),onClick:Ne(p.onClick,()=>{M.current!=="mouse"&&T()}),onPointerUp:Ne(p.onPointerUp,()=>{M.current==="mouse"&&T()}),onPointerDown:Ne(p.onPointerDown,A=>{M.current=A.pointerType}),onPointerMove:Ne(p.onPointerMove,A=>{var U;M.current=A.pointerType,u?(U=v.onItemLeave)==null||U.call(v):M.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ne(p.onPointerLeave,A=>{var U;A.currentTarget===document.activeElement&&((U=v.onItemLeave)==null||U.call(v))}),onKeyDown:Ne(p.onKeyDown,A=>{var D;u||A.target!==A.currentTarget||((D=v.searchRef)==null?void 0:D.current)!==""&&A.key===" "||(zO.includes(A.key)&&T(),A.key===" "&&A.preventDefault())})})})})},"SelectItem")),Gc="SelectItemText",r_=m.forwardRef(pt(function(a,l){const{__scopeSelect:o,className:c,style:u,...f}=a,p=ml(Gc,o),g=Xu(Gc,o),v=Jw(Gc,o),x=HO(Gc,o),[y,b]=m.useState(null),w=ma(T=>{var A;return(A=g.itemTextRefCallback)==null?void 0:A.call(g,T,v.value,v.disabled)}),E=Ke(l,b,v.onItemTextChange,w),j=y==null?void 0:y.textContent,C=m.useMemo(()=>s.jsx("option",{value:v.value,disabled:v.disabled,children:j},v.value),[v.disabled,v.value,j]),{onNativeOptionAdd:R,onNativeOptionRemove:M}=x;return Jt(()=>(R(C),()=>M(C)),[R,M,C]),s.jsxs(s.Fragment,{children:[s.jsx(Ve.span,{id:v.textId,...f,ref:E}),v.isSelected&&p.valueNode&&!p.valueNodeHasChildren&&!wi(p.value)?Ra.createPortal(f.children,p.valueNode):null]})},"SelectItemText")),l_="SelectItemIndicator",s_=m.forwardRef(pt(function(a,l){const{__scopeSelect:o,...c}=a;return Jw(l_,o).isSelected?s.jsx(Ve.span,{"aria-hidden":!0,...c,ref:l}):null},"SelectItemIndicator")),o_="SelectBubbleInput",i_=m.forwardRef(pt(function({__scopeSelect:a,...l},o){const c=ml(o_,a),{value:u,onValueChange:f,required:p,disabled:g,name:v,autoComplete:x,form:y}=c,{nativeOptions:b,nativeSelectKey:w}=c,E=m.useRef(null),j=Ke(o,E),C=u??"",R=Gw(C),M=Array.from(b).some(T=>(T.props.value??"")==="");return m.useEffect(()=>{const T=E.current;if(!T)return;const A=window.HTMLSelectElement.prototype,D=Object.getOwnPropertyDescriptor(A,"value").set;if(R!==C&&D){const B=new Event("change",{bubbles:!0});D.call(T,C),T.dispatchEvent(B)}},[R,C]),s.jsxs(Ve.select,{"aria-hidden":!0,required:p,tabIndex:-1,name:v,autoComplete:x,disabled:g,form:y,onChange:T=>f(T.target.value),...l,style:{...Fw,...l.style},ref:j,defaultValue:C,children:[wi(u)&&!M?s.jsx("option",{value:""}):null,Array.from(b)]},w)},"SelectBubbleInput"));function eS(n){return typeof n=="function"}pt(eS,"isFunction");function wi(n){return n===""||n===void 0}pt(wi,"shouldShowPlaceholder");function vp(n){const a=ma(n),l=m.useRef(""),o=m.useRef(0),c=m.useCallback(f=>{const p=l.current+f;a(p),pt((function g(v){l.current=v,window.clearTimeout(o.current),v!==""&&(o.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(p)},[a]),u=m.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,u]}pt(vp,"useTypeaheadSearch");function xp(n,a,l){const c=a.length>1&&Array.from(a).every(v=>v===a[0])?a[0]:a,u=l?n.indexOf(l):-1;let f=tS(n,Math.max(u,0));c.length===1&&(f=f.filter(v=>v!==l));const g=f.find(v=>v.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==l?g:void 0}pt(xp,"findNextItem");function tS(n,a){return n.map((l,o)=>n[(a+o)%n.length])}pt(tS,"wrapArray");const Ta=IO,Ma=VO,da=m.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(Xw,{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),...l,children:[a,s.jsx($O,{asChild:!0,children:s.jsx(aR,{className:"h-4 w-4 opacity-50"})})]}));da.displayName=Xw.displayName;const fa=m.forwardRef(({className:n,children:a,position:l="popper",...o},c)=>s.jsx(KO,{children:s.jsx(Qw,{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:l,...o,children:s.jsx(t_,{className:Ce("p-1",l==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:a})})}));fa.displayName=Qw.displayName;const St=m.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(Ww,{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),...l,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(s_,{children:s.jsx(T0,{className:"h-4 w-4"})})}),s.jsx(r_,{children:a})]}));St.displayName=Ww.displayName;var c_=Object.defineProperty,fl=(n,a)=>c_(n,"name",{value:a,configurable:!0}),yp="Switch",[u_,t5]=Un(yp),[d_,bp]=u_(yp);function nS(n){const{__scopeSwitch:a,checked:l,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]=jr({prop:l,defaultProp:c??!1,onChange:g,caller:yp}),[E,j]=m.useState(null),[C,R]=m.useState(null),M=m.useRef(!1),[T,A]=m.useReducer(B=>B+1,0),U=E?!!f||!!E.closest("form"):!0,D={checked:b,setChecked:w,disabled:u,control:E,setControl:j,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:M,userInteractionCount:T,onUserInteraction:A,required:v,defaultChecked:c,isFormControl:U,bubbleInput:C,setBubbleInput:R};return s.jsx(d_,{scope:a,...D,children:rS(y)?y(D):o})}fl(nS,"SwitchProvider");var f_="SwitchTrigger",h_=m.forwardRef(fl(function({__scopeSwitch:a,onClick:l,...o},c){const{control:u,form:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:E,isFormControl:j,bubbleInput:C}=bp(f_,a),R=Ke(c,y),M=m.useRef(v);return m.useEffect(()=>{const T=f?u==null?void 0:u.ownerDocument.getElementById(f):u==null?void 0:u.form;if(T instanceof HTMLFormElement){const A=fl(()=>b(M.current),"reset");return T.addEventListener("reset",A),()=>T.removeEventListener("reset",A)}},[u,f,b]),s.jsx(Ve.button,{type:"button",role:"switch","aria-checked":v,"aria-required":x,"data-state":wp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...o,ref:R,onClick:Ne(l,T=>{E(),b(A=>!A),C&&j&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"SwitchTrigger")),aS=m.forwardRef(fl(function(a,l){const{__scopeSwitch:o,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return s.jsx(nS,{__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})=>s.jsxs(s.Fragment,{children:[s.jsx(h_,{...b,ref:l,__scopeSwitch:o}),w&&s.jsx(v_,{__scopeSwitch:o})]})})},"Switch")),m_="SwitchThumb",p_=m.forwardRef(fl(function(a,l){const{__scopeSwitch:o,...c}=a,u=bp(m_,o);return s.jsx(Ve.span,{"data-state":wp(u.checked),"data-disabled":u.disabled?"":void 0,...c,ref:l})},"SwitchThumb")),g_="SwitchBubbleInput",v_=m.forwardRef(fl(function({__scopeSwitch:a,onClick:l,...o},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:E,bubbleInput:j,setBubbleInput:C}=bp(g_,a),R=Ke(c,C),M=Iu(u),T=m.useRef(!1),A=m.useRef(g),U=m.useRef(p);m.useEffect(()=>{const B=j;if(!B)return;const O=window.HTMLInputElement.prototype,L=Object.getOwnPropertyDescriptor(O,"checked").set,J=p!==U.current;U.current=p;const G=A.current!==g;A.current=g;const oe=!(J&&f.current);if(G&&L){T.current=!J;const ce=new Event("click",{bubbles:oe});L.call(B,g),B.dispatchEvent(ce),T.current=!1}},[j,g,f,p]);const D=m.useRef(g);return s.jsx(Ve.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??D.current,required:x,disabled:y,name:b,value:w,form:E,...o,tabIndex:-1,ref:R,onClick:Ne(l,B=>{T.current&&B.stopPropagation()}),style:{...o.style,...M,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function rS(n){return typeof n=="function"}fl(rS,"isFunction");function wp(n){return n?"checked":"unchecked"}fl(wp,"getState");const Aa=m.forwardRef(({className:n,...a},l)=>s.jsx(aS,{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:l,children:s.jsx(p_,{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")})}));Aa.displayName=aS.displayName;const _l={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0},x_={openai:"https://api.openai.com",anthropic:"https://api.anthropic.com"};function y_(){const[n,a]=m.useState([]),[l,o]=m.useState(!1),[c,u]=m.useState(_l),[f,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(null),[b,w]=m.useState(_l),[E,j]=m.useState(null),[C,R]=m.useState(!1),M=async()=>{try{const O=await we.get("/api/admin/providers");a(O.providers)}catch(O){ge.error(O.message||"Unable to load providers")}};m.useEffect(()=>{M()},[]);const T=async()=>{p(!0);try{let O;if(c.customHeaders.trim())try{O=JSON.parse(c.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await we.post("/api/admin/providers",{name:c.name,slug:c.slug||void 0,type:c.type,baseUrl:c.baseUrl,apiKey:c.apiKey,customHeaders:O,enabled:c.enabled}),ge.success("Provider created"),o(!1),u(_l),M()}catch(O){ge.error(O.message)}finally{p(!1)}},A=async O=>{v(O);try{const V=await we.post(`/api/admin/providers/${O}/test`);ge.success(V.ok?`Connection OK: ${V.detail}`:`Failed: ${V.detail}`),M()}catch(V){ge.error(V.message)}finally{v(null)}},U=O=>{y(O.id),w({..._l,name:O.name,slug:O.slug||"",type:O.type,baseUrl:O.baseUrl,apiKey:"",customHeaders:"",enabled:O.enabled})},D=async()=>{if(x){p(!0);try{let O;if(b.customHeaders.trim())try{O=JSON.parse(b.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await we.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:O,enabled:b.enabled}),ge.success("Provider updated"),y(null),w(_l),M()}catch(O){ge.error(O.message)}finally{p(!1)}}},B=async O=>{R(!0);try{await we.del(`/api/admin/providers/${O}`),ge.success("Provider removed"),M()}catch(V){ge.error(V.message)}finally{R(!1),j(null)}};return s.jsxs("div",{children:[s.jsx(Ka,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:s.jsx("div",{className:"flex gap-2",children:s.jsxs(On,{open:l,onOpenChange:o,children:[s.jsx(bi,{asChild:!0,children:s.jsx(fe,{children:"Add compatible provider"})}),s.jsxs(yn,{children:[s.jsxs(bn,{children:[s.jsx(wn,{children:"New provider"}),s.jsx(mu,{children:"API-key or compatible endpoint."})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-name",children:"Name"}),s.jsx(Ae,{id:"provider-name",value:c.name,onChange:O=>u({...c,name:O.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-slug",children:"Slug (optional)"}),s.jsx(Ae,{id:"provider-slug",value:c.slug,onChange:O=>u({...c,slug:O.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(Ta,{value:c.type,onValueChange:O=>u(V=>({...V,type:O,baseUrl:x_[O]})),children:[s.jsx(da,{children:s.jsx(Ma,{})}),s.jsxs(fa,{children:[s.jsx(St,{value:"openai",children:"OpenAI-compatible"}),s.jsx(St,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-base-url",children:"Base URL"}),s.jsx(Ae,{id:"provider-base-url",value:c.baseUrl,onChange:O=>u({...c,baseUrl:O.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-api-key",children:"API key"}),s.jsx(Ae,{id:"provider-api-key",type:"password",value:c.apiKey,onChange:O=>u({...c,apiKey:O.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-headers",children:"Custom headers (JSON)"}),s.jsx(Ae,{id:"provider-headers",value:c.customHeaders,onChange:O=>u({...c,customHeaders:O.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Aa,{checked:c.enabled,onCheckedChange:O=>u({...c,enabled:O})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(_n,{children:[s.jsx(fe,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),s.jsx(fe,{disabled:f||!c.name||!c.apiKey,onClick:T,children:f?"Creating…":"Create"})]})]})]})})}),s.jsxs(at,{children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"text-base",children:"All providers"}),s.jsxs(xn,{children:[n.length," total"]})]}),s.jsx(st,{children:s.jsxs(pa,{children:[s.jsx(ga,{children:s.jsxs(tt,{children:[s.jsx(xe,{children:"Name"}),s.jsx(xe,{children:"Type"}),s.jsx(xe,{children:"Base URL"}),s.jsx(xe,{children:"Models"}),s.jsx(xe,{children:"Health"}),s.jsx(xe,{children:"Enabled"}),s.jsx(xe,{className:"text-right",children:"Actions"})]})}),s.jsxs(va,{children:[n.length===0&&s.jsx(tt,{children:s.jsx(pe,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),n.map(O=>s.jsxs(tt,{children:[s.jsxs(pe,{className:"font-medium",children:[O.name," ",s.jsx("span",{className:"text-xs text-muted-foreground",children:O.slug})]}),s.jsx(pe,{children:s.jsx(Ze,{variant:"outline",children:O.type})}),s.jsx(pe,{className:"text-xs text-muted-foreground",children:O.baseUrl}),s.jsx(pe,{children:O.modelCount}),s.jsx(pe,{children:s.jsx(Ze,{variant:O.health==="healthy"?"success":O.health==="down"?"destructive":"secondary",children:O.health})}),s.jsx(pe,{children:O.enabled?"Yes":"No"}),s.jsx(pe,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(fe,{size:"sm",variant:"outline",disabled:g===O.id,onClick:()=>A(O.id),children:s.jsx(k0,{className:"h-3 w-3"})}),s.jsx(fe,{size:"sm",variant:"outline",onClick:()=>U(O),children:"✎"}),s.jsx(fe,{size:"sm",variant:"outline",onClick:()=>j(O.id),children:s.jsx(Au,{className:"h-3 w-3"})})]})})]},O.id))]})]})})]}),s.jsx(On,{open:!!x,onOpenChange:O=>{O||(y(null),w(_l))},children:s.jsxs(yn,{children:[s.jsx(bn,{children:s.jsx(wn,{children:"Edit provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ae,{value:b.name,onChange:O=>w({...b,name:O.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional)"}),s.jsx(Ae,{value:b.slug,onChange:O=>w({...b,slug:O.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(Ta,{value:b.type,onValueChange:O=>w({...b,type:O}),children:[s.jsx(da,{children:s.jsx(Ma,{})}),s.jsxs(fa,{children:[s.jsx(St,{value:"openai",children:"OpenAI-compatible"}),s.jsx(St,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Base URL"}),s.jsx(Ae,{value:b.baseUrl,onChange:O=>w({...b,baseUrl:O.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"API key (leave empty to keep current)"}),s.jsx(Ae,{type:"password",value:b.apiKey,onChange:O=>w({...b,apiKey:O.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Custom headers (JSON)"}),s.jsx(Ae,{value:b.customHeaders,onChange:O=>w({...b,customHeaders:O.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Aa,{checked:b.enabled,onCheckedChange:O=>w({...b,enabled:O})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(_n,{children:[s.jsx(fe,{variant:"outline",onClick:()=>{y(null),w(_l)},children:"Cancel"}),s.jsx(fe,{disabled:f||!b.name,onClick:D,children:"Save changes"})]})]})}),s.jsx(pu,{open:!!E,onOpenChange:O=>{O||j(null)},children:s.jsxs(ni,{children:[s.jsxs(gu,{children:[s.jsx(ai,{children:"Delete provider?"}),s.jsx(ri,{children:"This permanently removes the provider, its models, and dependent routing configuration."})]}),s.jsxs(vu,{children:[s.jsx(si,{children:"Cancel"}),s.jsx(li,{disabled:C,onClick:O=>{E&&(O.preventDefault(),B(E))},children:C?"Deleting…":"Delete"})]})]})})]})}var b_=Object.defineProperty,Rr=(n,a)=>b_(n,"name",{value:a,configurable:!0}),Sp="Checkbox",[w_,n5]=Un(Sp),[S_,jp]=w_(Sp);function lS(n){const{__scopeCheckbox:a,checked:l,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]=jr({prop:l,defaultProp:c??!1,onChange:g,caller:Sp}),[E,j]=m.useState(null),[C,R]=m.useState(null),M=m.useRef(!1),[T,A]=m.useReducer(B=>B+1,0),U=E?!!f||!!E.closest("form"):!0,D={checked:b,disabled:u,setChecked:w,control:E,setControl:j,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:M,userInteractionCount:T,onUserInteraction:A,required:v,defaultChecked:wr(c)?!1:c,isFormControl:U,bubbleInput:C,setBubbleInput:R};return s.jsx(S_,{scope:a,...D,children:oS(y)?y(D):o})}Rr(lS,"CheckboxProvider");var j_="CheckboxTrigger",C_=m.forwardRef(Rr(function({__scopeCheckbox:a,onKeyDown:l,onClick:o,...c},u){const{control:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:E,isFormControl:j,bubbleInput:C}=jp(j_,a),R=Ke(u,y),M=m.useRef(v);return m.useEffect(()=>{const T=f==null?void 0:f.form;if(T){const A=Rr(()=>b(M.current),"reset");return T.addEventListener("reset",A),()=>T.removeEventListener("reset",A)}},[f,b]),s.jsx(Ve.button,{type:"button",role:"checkbox","aria-checked":wr(v)?"mixed":v,"aria-required":x,"data-state":Cp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...c,ref:R,onKeyDown:Ne(l,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:Ne(o,T=>{E(),b(A=>wr(A)?!0:!A),C&&j&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"CheckboxTrigger")),sS=m.forwardRef(Rr(function(a,l){const{__scopeCheckbox:o,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return s.jsx(lS,{__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})=>s.jsxs(s.Fragment,{children:[s.jsx(C_,{...b,ref:l,__scopeCheckbox:o}),w&&s.jsx(T_,{__scopeCheckbox:o})]})})},"Checkbox")),E_="CheckboxIndicator",R_=m.forwardRef(Rr(function(a,l){const{__scopeCheckbox:o,forceMount:c,...u}=a,f=jp(E_,o);return s.jsx(Tr,{present:c||wr(f.checked)||f.checked===!0,children:s.jsx(Ve.span,{"data-state":Cp(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:l,style:{pointerEvents:"none",...a.style}})})},"CheckboxIndicator")),N_="CheckboxBubbleInput",T_=m.forwardRef(Rr(function({__scopeCheckbox:a,onClick:l,...o},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:E,bubbleInput:j,setBubbleInput:C}=jp(N_,a),R=Ke(c,C),M=Iu(u),T=m.useRef(!1),A=m.useRef(g),U=m.useRef(p);m.useEffect(()=>{const B=j;if(!B)return;const O=window.HTMLInputElement.prototype,L=Object.getOwnPropertyDescriptor(O,"checked").set,J=p!==U.current;U.current=p;const G=A.current!==g;A.current=g;const oe=!(J&&f.current);if(G&&L){T.current=!J;const ce=new Event("click",{bubbles:oe});B.indeterminate=wr(g),L.call(B,wr(g)?!1:g),B.dispatchEvent(ce),T.current=!1}},[j,g,f,p]);const D=m.useRef(wr(g)?!1:g);return s.jsx(Ve.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??D.current,required:x,disabled:y,name:b,value:w,form:E,...o,tabIndex:-1,ref:R,onClick:Ne(l,B=>{T.current&&B.stopPropagation()}),style:{...o.style,...M,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function oS(n){return typeof n=="function"}Rr(oS,"isFunction");function wr(n){return n==="indeterminate"}Rr(wr,"isIndeterminate");function Cp(n){return wr(n)?"indeterminate":n?"checked":"unchecked"}Rr(Cp,"getState");const Ep=m.forwardRef(({className:n,...a},l)=>s.jsx(sS,{ref:l,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:s.jsx(R_,{className:Ce("flex items-center justify-center text-current"),children:s.jsx(T0,{className:"h-3.5 w-3.5"})})}));Ep.displayName=sS.displayName;const mm=["image_input","audio_input","tools","structured_output","reasoning","chat","streaming"],M_=["unknown","yes","no"];function A_(n,a){return n[a]===!0?"yes":n[a]===!1?"no":"unknown"}function D_(n){const a={};for(const l of mm)a[l]=n[l]==="yes"?!0:n[l]==="no"?!1:null;return a}function O_(){const[n,a]=m.useState([]),[l,o]=m.useState([]),[c,u]=m.useState("all"),[f,p]=m.useState(!1),[g,v]=m.useState(""),[x,y]=m.useState([]),[b,w]=m.useState(new Set),[E,j]=m.useState(!1),[C,R]=m.useState(""),[M,T]=m.useState(""),[A,U]=m.useState(null),[D,B]=m.useState(!1),[O,V]=m.useState(null),[L,J]=m.useState(null),[G,oe]=m.useState(null),[ce,ae]=m.useState({}),[_,H]=m.useState(!1),X=$=>{const ie={};for(const he of mm)ie[he]=A_($.capabilities,he);ae(ie),oe($)},W=async()=>{if(G){H(!0);try{await we.patch("/api/admin/models",{id:G.id,capabilities:D_(ce)}),ge.success("Capabilities updated"),oe(null),te()}catch($){ge.error($.message)}finally{H(!1)}}},te=async()=>{const[$,ie]=await Promise.all([we.get("/api/admin/models"),we.get("/api/admin/providers")]);a($.models),o(ie.providers)};m.useEffect(()=>{te()},[]);const k=n.filter($=>!(c!=="all"&&$.providerId!==c||C&&!$.publicModelId.toLowerCase().includes(C.toLowerCase()))),P=x.filter($=>{if(!M)return!0;const ie=M.toLowerCase();return $.upstreamId.toLowerCase().includes(ie)||$.displayName.toLowerCase().includes(ie)}),Z=async()=>{if(g){j(!0);try{const $=await we.post(`/api/admin/providers/${g}/discover`);y($.models),w(new Set)}catch($){ge.error($.message)}finally{j(!1)}}},le=async()=>{if(b.size!==0)try{const $=await we.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(b)});ge.success(`Imported ${$.imported} of ${$.requested}`),p(!1),y([]),w(new Set),te()}catch($){ge.error($.message)}},de=async()=>{if(L)try{await we.del(`/api/admin/models/${L.id}`),ge.success("Model deleted"),J(null),te()}catch($){ge.error($.message)}},ve=async $=>{var he,me,Te;U($),B(!0);const ie=Date.now();V({phase:"streaming",startedAt:ie,text:"",progress:{}});try{const je=await Um(`/api/admin/models/${$}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!je.ok){const gt=await je.text().catch(()=>"");V({phase:"error",model:$,error:`HTTP ${je.status}: ${gt}`});return}const De=(he=je.body)==null?void 0:he.getReader();if(!De){V({phase:"error",model:$,error:"No response body"});return}const Xe=new TextDecoder;let ze="",Je="",Mt=!1;for(;!Mt;){const{value:gt,done:ln}=await De.read();Mt=ln,gt&&(ze+=Xe.decode(gt,{stream:!0}));let jt;for(;(jt=ze.indexOf(`
342
+
343
+ `))>=0;){const Bt=ze.slice(0,jt);ze=ze.slice(jt+2);const zt=Bt.split(`
344
+ `);let yt="",bt="";for(const sn of zt)sn.startsWith("event: ")?yt=sn.slice(7):sn.startsWith("data: ")&&(bt=sn.slice(6));if(bt){if(yt===""||yt==="message")try{const At=(me=JSON.parse(bt).choices)==null?void 0:me[0];(Te=At==null?void 0:At.delta)!=null&&Te.content&&(Je+=At.delta.content),V(Dt=>{if(!Dt||Dt.phase!=="streaming")return Dt;const Wt=Date.now()-ie,Hn=Dt.progress.ttftMs??Wt;return{...Dt,text:Je,progress:{ttftMs:Hn,elapsedMs:Wt}}})}catch{}if(yt==="test_meta")try{const sn=JSON.parse(bt);V({phase:"done",model:$,result:sn,text:Je})}catch{}if(yt==="test_error")try{const sn=JSON.parse(bt);V({phase:"error",model:$,error:sn.message})}catch{}}}}V(gt=>!gt||gt.phase==="streaming"?{phase:"error",model:$,error:"Stream ended unexpectedly"}:gt)}catch(je){V({phase:"error",model:$,error:je.message})}finally{U(null)}};return s.jsxs("div",{children:[s.jsx(Ka,{title:"Models",description:"Physical models imported from providers",actions:s.jsxs(On,{open:f,onOpenChange:p,children:[s.jsx(bi,{asChild:!0,children:s.jsxs(fe,{variant:"outline",children:[s.jsx(M0,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),s.jsxs(yn,{className:"max-w-2xl",children:[s.jsx(bn,{children:s.jsx(wn,{children:"Discover models"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsxs(Ta,{value:g,onValueChange:v,children:[s.jsx(da,{children:s.jsx(Ma,{placeholder:"Choose provider"})}),s.jsx(fa,{children:l.map($=>s.jsx(St,{value:$.id,children:$.name},$.id))})]})}),s.jsx(fe,{onClick:Z,disabled:!g||E,children:E?"Fetching…":"Fetch"})]}),x.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:s.jsxs("div",{className:"relative flex-1",children:[s.jsx(z0,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ae,{className:"pl-8",placeholder:"Search models…",value:M,onChange:$=>T($.target.value)}),M&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>T(""),children:s.jsx(Du,{className:"h-4 w-4"})})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm text-muted-foreground",children:[P.length," / ",x.length," · ",b.size," selected"]}),s.jsx(fe,{variant:"outline",size:"sm",onClick:()=>w(new Set(P.filter($=>!$.alreadyImported).map($=>$.upstreamId))),children:"Select All (new)"}),s.jsx(fe,{variant:"outline",size:"sm",onClick:()=>w(new Set),children:"Clear"})]})]}),s.jsx("div",{className:"max-h-80 space-y-1 overflow-auto rounded border p-2",children:P.length===0&&x.length>0?s.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):P.map($=>s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(Ep,{checked:b.has($.upstreamId),onCheckedChange:ie=>{const he=new Set(b);ie?he.add($.upstreamId):he.delete($.upstreamId),w(he)}}),s.jsx("span",{className:"font-mono text-xs",children:$.upstreamId}),$.alreadyImported&&s.jsx(Ze,{variant:"secondary",children:"imported"})]},$.upstreamId))})]})]}),s.jsxs(_n,{children:[s.jsx(fe,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsxs(fe,{disabled:b.size===0,onClick:le,children:["Import ",b.size||""]})]})]})]})}),s.jsxs(at,{children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"text-base",children:"All models"}),s.jsxs(xn,{children:[n.length," total"]})]}),s.jsxs(st,{children:[s.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[s.jsxs(Ta,{value:c,onValueChange:u,children:[s.jsx(da,{className:"w-56",children:s.jsx(Ma,{})}),s.jsxs(fa,{children:[s.jsx(St,{value:"all",children:"All providers"}),l.map($=>s.jsx(St,{value:$.id,children:$.name},$.id))]})]}),s.jsx(Ae,{className:"max-w-xs",placeholder:"Search public ID",value:C,onChange:$=>R($.target.value)})]}),s.jsxs(pa,{children:[s.jsx(ga,{children:s.jsxs(tt,{children:[s.jsx(xe,{children:"Public ID"}),s.jsx(xe,{children:"Provider"}),s.jsx(xe,{children:"Upstream ID"}),s.jsx(xe,{children:"Capabilities"}),s.jsx(xe,{children:"Available"}),s.jsx(xe,{children:"Enabled"}),s.jsx(xe,{})]})}),s.jsxs(va,{children:[k.length===0&&s.jsx(tt,{children:s.jsx(pe,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),k.map($=>s.jsxs(tt,{children:[s.jsx(pe,{className:"font-mono text-xs",children:$.publicModelId}),s.jsx(pe,{children:$.providerSlug}),s.jsx(pe,{className:"text-xs text-muted-foreground",children:$.upstreamModelId}),s.jsx(pe,{className:"space-x-1",children:Object.entries($.capabilities).filter(([,ie])=>ie===!0).slice(0,4).map(([ie])=>s.jsx(Ze,{variant:"outline",className:"mr-1",children:ie},ie))}),s.jsx(pe,{children:$.upstreamAvailable?s.jsx(Ze,{variant:"success",children:"up"}):s.jsx(Ze,{variant:"destructive",children:"down"})}),s.jsx(pe,{children:$.enabled?"Yes":"No"}),s.jsx(pe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(fe,{size:"sm",variant:"outline",onClick:()=>X($),disabled:A!==null,children:[s.jsx(SR,{className:"h-3.5 w-3.5"})," Capabilities"]}),s.jsxs(fe,{size:"sm",variant:"outline",onClick:()=>void ve($.id),disabled:A!==null,children:[A===$.id?s.jsx(ks,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(hR,{className:"h-3.5 w-3.5"})," Test"]}),s.jsxs(fe,{size:"sm",variant:"destructive",onClick:()=>J($),disabled:A!==null,children:[s.jsx(Au,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},$.id))]})]})]})]}),s.jsx(On,{open:!!L,onOpenChange:$=>{$||J(null)},children:s.jsxs(yn,{className:"max-w-md",children:[s.jsx(bn,{children:s.jsx(wn,{children:"Xoá model"})}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("p",{children:["Bạn có chắc muốn xoá model ",s.jsx("span",{className:"font-mono",children:L==null?void 0:L.publicModelId}),"?"]}),s.jsx("p",{className:"text-muted-foreground",children:"Model sẽ bị xoá khỏi combo, alias, permission và cache trước khi xoá hẳn."})]}),s.jsxs(_n,{children:[s.jsx(fe,{variant:"outline",onClick:()=>J(null),children:"Huỷ"}),s.jsx(fe,{variant:"destructive",onClick:de,children:"Xoá"})]})]})}),s.jsx(On,{open:G!==null,onOpenChange:$=>{$||oe(null)},children:s.jsxs(yn,{className:"max-w-lg",children:[s.jsx(bn,{children:s.jsxs(wn,{children:["Capabilities — ",G==null?void 0:G.publicModelId]})}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.jsx("strong",{children:"Unknown"})," means the router has no verified answer and will attempt the request."," ",s.jsx("strong",{children:"No"})," blocks requests needing that capability (HTTP 400/502 before any upstream call)."]}),mm.map($=>{var he;const ie=(he=G==null?void 0:G.discoveredCapabilities)==null?void 0:he[$];return s.jsxs("div",{className:"flex items-center justify-between gap-3 rounded px-1 py-1 text-sm hover:bg-accent",children:[s.jsxs("span",{className:"flex items-baseline gap-2",children:[s.jsx("code",{className:"text-xs",children:$}),s.jsx("span",{className:"text-xs text-muted-foreground",children:ie===void 0?"discovered: unknown":`discovered: ${String(ie)}`})]}),s.jsx("div",{className:"flex gap-1",children:M_.map(me=>s.jsx(fe,{size:"sm",variant:ce[$]===me?"default":"outline",onClick:()=>ae(Te=>({...Te,[$]:me})),children:me==="unknown"?"Unknown":me==="yes"?"Yes":"No"},me))})]},$)})]}),s.jsxs(_n,{children:[s.jsx(fe,{variant:"outline",onClick:()=>oe(null),children:"Huỷ"}),s.jsx(fe,{onClick:W,disabled:_,children:_?"Saving…":"Lưu"})]})]})}),s.jsx(On,{open:D,onOpenChange:B,children:s.jsxs(yn,{className:"max-w-2xl",children:[s.jsx(bn,{children:s.jsx(wn,{children:"Kết quả test model"})}),O&&O.phase==="streaming"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(ks,{className:"h-4 w-4 animate-spin"})," Đang stream…",s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["TTFT ",O.progress.ttftMs!=null?`${O.progress.ttftMs} ms`:"…"]}),s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["· ",O.progress.elapsedMs!=null?`${O.progress.elapsedMs} ms`:"…"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi (streaming)"}),s.jsxs("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:[O.text||s.jsx("span",{className:"text-muted-foreground/60 animate-pulse",children:"waiting for first token…"}),O.phase==="streaming"&&s.jsx("span",{className:"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-primary/70"})]})]})]}),O&&O.phase==="done"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(Ze,{variant:O.result.success?"success":"destructive",children:O.result.success?"Thành công":"Thất bại"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Thời gian phản hồi"}),s.jsxs("div",{className:"font-mono",children:[O.result.latencyMs," ms"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"TTFT"}),s.jsx("div",{className:"font-mono",children:O.result.ttftMs!=null?`${O.result.ttftMs} ms`:"—"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tokens (in / out)"}),s.jsxs("div",{className:"font-mono",children:[O.result.usage.input," / ",O.result.usage.output]})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi của model"}),s.jsx("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:O.text||O.result.text||"(trống)"})]}),O.result.attempts.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Attempts"}),s.jsx("div",{className:"space-y-1",children:O.result.attempts.map(($,ie)=>s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[s.jsx(Ze,{variant:$.success?"success":"destructive",children:$.success?"OK":"FAIL"}),s.jsxs("span",{className:"font-mono",children:[$.providerName," / ",$.modelId]}),s.jsxs("span",{className:"text-muted-foreground",children:[$.latencyMs," ms"]}),$.failureReason&&s.jsx("span",{className:"text-destructive",children:$.failureReason})]},ie))})]})]}),O&&O.phase==="error"&&s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx(Ze,{variant:"destructive",children:"Thất bại"}),s.jsx("p",{className:"text-destructive",children:O.error})]}),s.jsx(_n,{children:s.jsx(fe,{variant:"outline",onClick:()=>B(!1),children:"Đóng"})})]})})]})}function __(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return m.useMemo(()=>o=>{a.forEach(c=>c(o))},a)}const Qu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xs(n){const a=Object.prototype.toString.call(n);return a==="[object Window]"||a==="[object global]"}function Rp(n){return"nodeType"in n}function Bn(n){var a,l;return n?Xs(n)?n:Rp(n)&&(a=(l=n.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function Np(n){const{Document:a}=Bn(n);return n instanceof a}function Si(n){return Xs(n)?!1:n instanceof Bn(n).HTMLElement}function iS(n){return n instanceof Bn(n).SVGElement}function Qs(n){return n?Xs(n)?n.document:Rp(n)?Np(n)?n:Si(n)||iS(n)?n.ownerDocument:document:document:document}const Ga=Qu?m.useLayoutEffect:m.useEffect;function Tp(n){const a=m.useRef(n);return Ga(()=>{a.current=n}),m.useCallback(function(){for(var l=arguments.length,o=new Array(l),c=0;c<l;c++)o[c]=arguments[c];return a.current==null?void 0:a.current(...o)},[])}function k_(){const n=m.useRef(null),a=m.useCallback((o,c)=>{n.current=setInterval(o,c)},[]),l=m.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[a,l]}function oi(n,a){a===void 0&&(a=[n]);const l=m.useRef(n);return Ga(()=>{l.current!==n&&(l.current=n)},a),l}function ji(n,a){const l=m.useRef();return m.useMemo(()=>{const o=n(l.current);return l.current=o,o},[...a])}function xu(n){const a=Tp(n),l=m.useRef(null),o=m.useCallback(c=>{c!==l.current&&(a==null||a(c,l.current)),l.current=c},[]);return[l,o]}function pm(n){const a=m.useRef();return m.useEffect(()=>{a.current=n},[n]),a.current}let Uh={};function Ci(n,a){return m.useMemo(()=>{if(a)return a;const l=Uh[n]==null?0:Uh[n]+1;return Uh[n]=l,n+"-"+l},[n,a])}function cS(n){return function(a){for(var l=arguments.length,o=new Array(l>1?l-1:0),c=1;c<l;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 Bs=cS(1),ii=cS(-1);function z_(n){return"clientX"in n&&"clientY"in n}function Mp(n){if(!n)return!1;const{KeyboardEvent:a}=Bn(n.target);return a&&n instanceof a}function L_(n){if(!n)return!1;const{TouchEvent:a}=Bn(n.target);return a&&n instanceof a}function gm(n){if(L_(n)){if(n.touches&&n.touches.length){const{clientX:a,clientY:l}=n.touches[0];return{x:a,y:l}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:a,clientY:l}=n.changedTouches[0];return{x:a,y:l}}}return z_(n)?{x:n.clientX,y:n.clientY}:null}const yu=Object.freeze({Translate:{toString(n){if(!n)return;const{x:a,y:l}=n;return"translate3d("+(a?Math.round(a):0)+"px, "+(l?Math.round(l):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:a,scaleY:l}=n;return"scaleX("+a+") scaleY("+l+")"}},Transform:{toString(n){if(n)return[yu.Translate.toString(n),yu.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:a,duration:l,easing:o}=n;return a+" "+l+"ms "+o}}}),Db="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function U_(n){return n.matches(Db)?n:n.querySelector(Db)}const B_={display:"none"};function H_(n){let{id:a,value:l}=n;return ue.createElement("div",{id:a,style:B_},l)}function I_(n){let{id:a,announcement:l,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 ue.createElement("div",{id:a,style:c,role:"status","aria-live":o,"aria-atomic":!0},l)}function P_(){const[n,a]=m.useState("");return{announce:m.useCallback(o=>{o!=null&&a(o)},[]),announcement:n}}const uS=m.createContext(null);function q_(n){const a=m.useContext(uS);m.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(n)},[n,a])}function V_(){const[n]=m.useState(()=>new Set),a=m.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[m.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 $_={draggable:`
345
+ To pick up a draggable item, press the space bar.
346
+ While dragging, use the arrow keys to move the item.
347
+ Press space again to drop the item in its new position, or press escape to cancel.
348
+ `},Y_={onDragStart(n){let{active:a}=n;return"Picked up draggable item "+a.id+"."},onDragOver(n){let{active:a,over:l}=n;return l?"Draggable item "+a.id+" was moved over droppable area "+l.id+".":"Draggable item "+a.id+" is no longer over a droppable area."},onDragEnd(n){let{active:a,over:l}=n;return l?"Draggable item "+a.id+" was dropped over droppable area "+l.id:"Draggable item "+a.id+" was dropped."},onDragCancel(n){let{active:a}=n;return"Dragging was cancelled. Draggable item "+a.id+" was dropped."}};function G_(n){let{announcements:a=Y_,container:l,hiddenTextDescribedById:o,screenReaderInstructions:c=$_}=n;const{announce:u,announcement:f}=P_(),p=Ci("DndLiveRegion"),[g,v]=m.useState(!1);if(m.useEffect(()=>{v(!0)},[]),q_(m.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=ue.createElement(ue.Fragment,null,ue.createElement(H_,{id:o,value:c.draggable}),ue.createElement(I_,{id:p,announcement:f}));return l?Ra.createPortal(x,l):x}var Qt;(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"})(Qt||(Qt={}));function bu(){}function Ob(n,a){return m.useMemo(()=>({sensor:n,options:a??{}}),[n,a])}function F_(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return m.useMemo(()=>[...a].filter(o=>o!=null),[...a])}const Da=Object.freeze({x:0,y:0});function dS(n,a){return Math.sqrt(Math.pow(n.x-a.x,2)+Math.pow(n.y-a.y,2))}function fS(n,a){let{data:{value:l}}=n,{data:{value:o}}=a;return l-o}function K_(n,a){let{data:{value:l}}=n,{data:{value:o}}=a;return o-l}function _b(n){let{left:a,top:l,height:o,width:c}=n;return[{x:a,y:l},{x:a+c,y:l},{x:a,y:l+o},{x:a+c,y:l+o}]}function hS(n,a){if(!n||n.length===0)return null;const[l]=n;return l[a]}function kb(n,a,l){return a===void 0&&(a=n.left),l===void 0&&(l=n.top),{x:a+n.width*.5,y:l+n.height*.5}}const X_=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=kb(a,a.left,a.top),u=[];for(const f of o){const{id:p}=f,g=l.get(p);if(g){const v=dS(kb(g),c);u.push({id:p,data:{droppableContainer:f,value:v}})}}return u.sort(fS)},Q_=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=_b(a),u=[];for(const f of o){const{id:p}=f,g=l.get(p);if(g){const v=_b(g),x=c.reduce((b,w,E)=>b+dS(v[E],w),0),y=Number((x/4).toFixed(4));u.push({id:p,data:{droppableContainer:f,value:y}})}}return u.sort(fS)};function Z_(n,a){const l=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-l;if(o<c&&l<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 J_=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=[];for(const u of o){const{id:f}=u,p=l.get(f);if(p){const g=Z_(p,a);g>0&&c.push({id:f,data:{droppableContainer:u,value:g}})}}return c.sort(K_)};function W_(n,a,l){return{...n,scaleX:a&&l?a.width/l.width:1,scaleY:a&&l?a.height/l.height:1}}function mS(n,a){return n&&a?{x:n.left-a.left,y:n.top-a.top}:Da}function ek(n){return function(l){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}),{...l})}}const tk=ek(1);function nk(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 ak(n,a,l){const o=nk(a);if(!o)return n;const{scaleX:c,scaleY:u,x:f,y:p}=o,g=n.left-f-(1-c)*parseFloat(l),v=n.top-p-(1-u)*parseFloat(l.slice(l.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 rk={ignoreTransform:!1};function Zs(n,a){a===void 0&&(a=rk);let l=n.getBoundingClientRect();if(a.ignoreTransform){const{transform:v,transformOrigin:x}=Bn(n).getComputedStyle(n);v&&(l=ak(l,v,x))}const{top:o,left:c,width:u,height:f,bottom:p,right:g}=l;return{top:o,left:c,width:u,height:f,bottom:p,right:g}}function zb(n){return Zs(n,{ignoreTransform:!0})}function lk(n){const a=n.innerWidth,l=n.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function sk(n,a){return a===void 0&&(a=Bn(n).getComputedStyle(n)),a.position==="fixed"}function ok(n,a){a===void 0&&(a=Bn(n).getComputedStyle(n));const l=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(c=>{const u=a[c];return typeof u=="string"?l.test(u):!1})}function Zu(n,a){const l=[];function o(c){if(a!=null&&l.length>=a||!c)return l;if(Np(c)&&c.scrollingElement!=null&&!l.includes(c.scrollingElement))return l.push(c.scrollingElement),l;if(!Si(c)||iS(c)||l.includes(c))return l;const u=Bn(n).getComputedStyle(c);return c!==n&&ok(c,u)&&l.push(c),sk(c,u)?l:o(c.parentNode)}return n?o(n):l}function pS(n){const[a]=Zu(n,1);return a??null}function Bh(n){return!Qu||!n?null:Xs(n)?n:Rp(n)?Np(n)||n===Qs(n).scrollingElement?window:Si(n)?n:null:null}function gS(n){return Xs(n)?n.scrollX:n.scrollLeft}function vS(n){return Xs(n)?n.scrollY:n.scrollTop}function vm(n){return{x:gS(n),y:vS(n)}}var nn;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(nn||(nn={}));function xS(n){return!Qu||!n?!1:n===document.scrollingElement}function yS(n){const a={x:0,y:0},l=xS(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-l.width,y:n.scrollHeight-l.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 ik={x:.2,y:.2};function ck(n,a,l,o,c){let{top:u,left:f,right:p,bottom:g}=l;o===void 0&&(o=10),c===void 0&&(c=ik);const{isTop:v,isBottom:x,isLeft:y,isRight:b}=yS(n),w={x:0,y:0},E={x:0,y:0},j={height:a.height*c.y,width:a.width*c.x};return!v&&u<=a.top+j.height?(w.y=nn.Backward,E.y=o*Math.abs((a.top+j.height-u)/j.height)):!x&&g>=a.bottom-j.height&&(w.y=nn.Forward,E.y=o*Math.abs((a.bottom-j.height-g)/j.height)),!b&&p>=a.right-j.width?(w.x=nn.Forward,E.x=o*Math.abs((a.right-j.width-p)/j.width)):!y&&f<=a.left+j.width&&(w.x=nn.Backward,E.x=o*Math.abs((a.left+j.width-f)/j.width)),{direction:w,speed:E}}function uk(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:l,right:o,bottom:c}=n.getBoundingClientRect();return{top:a,left:l,right:o,bottom:c,width:n.clientWidth,height:n.clientHeight}}function bS(n){return n.reduce((a,l)=>Bs(a,vm(l)),Da)}function dk(n){return n.reduce((a,l)=>a+gS(l),0)}function fk(n){return n.reduce((a,l)=>a+vS(l),0)}function hk(n,a){if(a===void 0&&(a=Zs),!n)return;const{top:l,left:o,bottom:c,right:u}=a(n);pS(n)&&(c<=0||u<=0||l>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const mk=[["x",["left","right"],dk],["y",["top","bottom"],fk]];class Ap{constructor(a,l){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=Zu(l),c=bS(o);this.rect={...a},this.width=a.width,this.height=a.height;for(const[u,f,p]of mk)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 Xo{constructor(a){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(l=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...l)})},this.target=a}add(a,l,o){var c;(c=this.target)==null||c.addEventListener(a,l,o),this.listeners.push([a,l,o])}}function pk(n){const{EventTarget:a}=Bn(n);return n instanceof a?n:Qs(n)}function Hh(n,a){const l=Math.abs(n.x),o=Math.abs(n.y);return typeof a=="number"?Math.sqrt(l**2+o**2)>a:"x"in a&&"y"in a?l>a.x&&o>a.y:"x"in a?l>a.x:"y"in a?o>a.y:!1}var ca;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(ca||(ca={}));function Lb(n){n.preventDefault()}function gk(n){n.stopPropagation()}var Fe;(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"})(Fe||(Fe={}));const wS={start:[Fe.Space,Fe.Enter],cancel:[Fe.Esc],end:[Fe.Space,Fe.Enter,Fe.Tab]},vk=(n,a)=>{let{currentCoordinates:l}=a;switch(n.code){case Fe.Right:return{...l,x:l.x+25};case Fe.Left:return{...l,x:l.x-25};case Fe.Down:return{...l,y:l.y+25};case Fe.Up:return{...l,y:l.y-25}}};class Dp{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:l}}=a;this.props=a,this.listeners=new Xo(Qs(l)),this.windowListeners=new Xo(Bn(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ca.Resize,this.handleCancel),this.windowListeners.add(ca.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ca.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:l}=this.props,o=a.node.current;o&&hk(o),l(Da)}handleKeyDown(a){if(Mp(a)){const{active:l,context:o,options:c}=this.props,{keyboardCodes:u=wS,coordinateGetter:f=vk,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}:Da;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:l,context:o.current,currentCoordinates:x});if(y){const b=ii(y,x),w={x:0,y:0},{scrollableAncestors:E}=o.current;for(const j of E){const C=a.code,{isTop:R,isRight:M,isLeft:T,isBottom:A,maxScroll:U,minScroll:D}=yS(j),B=uk(j),O={x:Math.min(C===Fe.Right?B.right-B.width/2:B.right,Math.max(C===Fe.Right?B.left:B.left+B.width/2,y.x)),y:Math.min(C===Fe.Down?B.bottom-B.height/2:B.bottom,Math.max(C===Fe.Down?B.top:B.top+B.height/2,y.y))},V=C===Fe.Right&&!M||C===Fe.Left&&!T,L=C===Fe.Down&&!A||C===Fe.Up&&!R;if(V&&O.x!==y.x){const J=j.scrollLeft+b.x,G=C===Fe.Right&&J<=U.x||C===Fe.Left&&J>=D.x;if(G&&!b.y){j.scrollTo({left:J,behavior:p});return}G?w.x=j.scrollLeft-J:w.x=C===Fe.Right?j.scrollLeft-U.x:j.scrollLeft-D.x,w.x&&j.scrollBy({left:-w.x,behavior:p});break}else if(L&&O.y!==y.y){const J=j.scrollTop+b.y,G=C===Fe.Down&&J<=U.y||C===Fe.Up&&J>=D.y;if(G&&!b.x){j.scrollTo({top:J,behavior:p});return}G?w.y=j.scrollTop-J:w.y=C===Fe.Down?j.scrollTop-U.y:j.scrollTop-D.y,w.y&&j.scrollBy({top:-w.y,behavior:p});break}}this.handleMove(a,Bs(ii(y,this.referenceCoordinates),w))}}}handleMove(a,l){const{onMove:o}=this.props;a.preventDefault(),o(l)}handleEnd(a){const{onEnd:l}=this.props;a.preventDefault(),this.detach(),l()}handleCancel(a){const{onCancel:l}=this.props;a.preventDefault(),this.detach(),l()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Dp.activators=[{eventName:"onKeyDown",handler:(n,a,l)=>{let{keyboardCodes:o=wS,onActivation:c}=a,{active:u}=l;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 Ub(n){return!!(n&&"distance"in n)}function Bb(n){return!!(n&&"delay"in n)}class Op{constructor(a,l,o){var c;o===void 0&&(o=pk(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=l;const{event:u}=a,{target:f}=u;this.props=a,this.events=l,this.document=Qs(f),this.documentListeners=new Xo(this.document),this.listeners=new Xo(o),this.windowListeners=new Xo(Bn(f)),this.initialCoordinates=(c=gm(u))!=null?c:Da,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:l,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(ca.Resize,this.handleCancel),this.windowListeners.add(ca.DragStart,Lb),this.windowListeners.add(ca.VisibilityChange,this.handleCancel),this.windowListeners.add(ca.ContextMenu,Lb),this.documentListeners.add(ca.Keydown,this.handleKeydown),l){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Bb(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(Ub(l)){this.handlePending(l);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,l){const{active:o,onPending:c}=this.props;c(o,a,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:a}=this,{onStart:l}=this.props;a&&(this.activated=!0,this.documentListeners.add(ca.Click,gk,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ca.SelectionChange,this.removeTextSelection),l(a))}handleMove(a){var l;const{activated:o,initialCoordinates:c,props:u}=this,{onMove:f,options:{activationConstraint:p}}=u;if(!c)return;const g=(l=gm(a))!=null?l:Da,v=ii(c,g);if(!o&&p){if(Ub(p)){if(p.tolerance!=null&&Hh(v,p.tolerance))return this.handleCancel();if(Hh(v,p.distance))return this.handleStart()}if(Bb(p)&&Hh(v,p.tolerance))return this.handleCancel();this.handlePending(p,v);return}a.cancelable&&a.preventDefault(),f(g)}handleEnd(){const{onAbort:a,onEnd:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleCancel(){const{onAbort:a,onCancel:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleKeydown(a){a.code===Fe.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const xk={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class _p extends Op{constructor(a){const{event:l}=a,o=Qs(l.target);super(a,xk,o)}}_p.activators=[{eventName:"onPointerDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;return!l.isPrimary||l.button!==0?!1:(o==null||o({event:l}),!0)}}];const yk={move:{name:"mousemove"},end:{name:"mouseup"}};var xm;(function(n){n[n.RightClick=2]="RightClick"})(xm||(xm={}));class bk extends Op{constructor(a){super(a,yk,Qs(a.event.target))}}bk.activators=[{eventName:"onMouseDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;return l.button===xm.RightClick?!1:(o==null||o({event:l}),!0)}}];const Ih={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class wk extends Op{constructor(a){super(a,Ih)}static setup(){return window.addEventListener(Ih.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Ih.move.name,a)};function a(){}}}wk.activators=[{eventName:"onTouchStart",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;const{touches:c}=l;return c.length>1?!1:(o==null||o({event:l}),!0)}}];var Qo;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Qo||(Qo={}));var wu;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(wu||(wu={}));function Sk(n){let{acceleration:a,activator:l=Qo.Pointer,canScroll:o,draggingRect:c,enabled:u,interval:f=5,order:p=wu.TreeOrder,pointerCoordinates:g,scrollableAncestors:v,scrollableAncestorRects:x,delta:y,threshold:b}=n;const w=Ck({delta:y,disabled:!u}),[E,j]=k_(),C=m.useRef({x:0,y:0}),R=m.useRef({x:0,y:0}),M=m.useMemo(()=>{switch(l){case Qo.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case Qo.DraggableRect:return c}},[l,c,g]),T=m.useRef(null),A=m.useCallback(()=>{const D=T.current;if(!D)return;const B=C.current.x*R.current.x,O=C.current.y*R.current.y;D.scrollBy(B,O)},[]),U=m.useMemo(()=>p===wu.TreeOrder?[...v].reverse():v,[p,v]);m.useEffect(()=>{if(!u||!v.length||!M){j();return}for(const D of U){if((o==null?void 0:o(D))===!1)continue;const B=v.indexOf(D),O=x[B];if(!O)continue;const{direction:V,speed:L}=ck(D,O,M,a,b);for(const J of["x","y"])w[J][V[J]]||(L[J]=0,V[J]=0);if(L.x>0||L.y>0){j(),T.current=D,E(A,f),C.current=L,R.current=V;return}}C.current={x:0,y:0},R.current={x:0,y:0},j()},[a,A,o,j,u,f,JSON.stringify(M),JSON.stringify(w),E,v,U,x,JSON.stringify(b)])}const jk={x:{[nn.Backward]:!1,[nn.Forward]:!1},y:{[nn.Backward]:!1,[nn.Forward]:!1}};function Ck(n){let{delta:a,disabled:l}=n;const o=pm(a);return ji(c=>{if(l||!o||!c)return jk;const u={x:Math.sign(a.x-o.x),y:Math.sign(a.y-o.y)};return{x:{[nn.Backward]:c.x[nn.Backward]||u.x===-1,[nn.Forward]:c.x[nn.Forward]||u.x===1},y:{[nn.Backward]:c.y[nn.Backward]||u.y===-1,[nn.Forward]:c.y[nn.Forward]||u.y===1}}},[l,a,o])}function Ek(n,a){const l=a!=null?n.get(a):void 0,o=l?l.node.current:null;return ji(c=>{var u;return a==null?null:(u=o??c)!=null?u:null},[o,a])}function Rk(n,a){return m.useMemo(()=>n.reduce((l,o)=>{const{sensor:c}=o,u=c.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,o)}));return[...l,...u]},[]),[n,a])}var ci;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(ci||(ci={}));var ym;(function(n){n.Optimized="optimized"})(ym||(ym={}));const Hb=new Map;function Nk(n,a){let{dragging:l,dependencies:o,config:c}=a;const[u,f]=m.useState(null),{frequency:p,measure:g,strategy:v}=c,x=m.useRef(n),y=C(),b=oi(y),w=m.useCallback(function(R){R===void 0&&(R=[]),!b.current&&f(M=>M===null?R:M.concat(R.filter(T=>!M.includes(T))))},[b]),E=m.useRef(null),j=ji(R=>{if(y&&!l)return Hb;if(!R||R===Hb||x.current!==n||u!=null){const M=new Map;for(let T of n){if(!T)continue;if(u&&u.length>0&&!u.includes(T.id)&&T.rect.current){M.set(T.id,T.rect.current);continue}const A=T.node.current,U=A?new Ap(g(A),A):null;T.rect.current=U,U&&M.set(T.id,U)}return M}return R},[n,u,l,y,g]);return m.useEffect(()=>{x.current=n},[n]),m.useEffect(()=>{y||w()},[l,y]),m.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),m.useEffect(()=>{y||typeof p!="number"||E.current!==null||(E.current=setTimeout(()=>{w(),E.current=null},p))},[p,y,w,...o]),{droppableRects:j,measureDroppableContainers:w,measuringScheduled:u!=null};function C(){switch(v){case ci.Always:return!1;case ci.BeforeDragging:return l;default:return!l}}}function SS(n,a){return ji(l=>n?l||(typeof a=="function"?a(n):n):null,[a,n])}function Tk(n,a){return SS(n,a)}function Mk(n){let{callback:a,disabled:l}=n;const o=Tp(a),c=m.useMemo(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,l]);return m.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function Ju(n){let{callback:a,disabled:l}=n;const o=Tp(a),c=m.useMemo(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[l]);return m.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function Ak(n){return new Ap(Zs(n),n)}function Ib(n,a,l){a===void 0&&(a=Ak);const[o,c]=m.useState(null);function u(){c(g=>{if(!n)return null;if(n.isConnected===!1){var v;return(v=g??l)!=null?v:null}const x=a(n);return JSON.stringify(g)===JSON.stringify(x)?g:x})}const f=Mk({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=Ju({callback:u});return Ga(()=>{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 Dk(n){const a=SS(n);return mS(n,a)}const Pb=[];function Ok(n){const a=m.useRef(n),l=ji(o=>n?o&&o!==Pb&&n&&a.current&&n.parentNode===a.current.parentNode?o:Zu(n):Pb,[n]);return m.useEffect(()=>{a.current=n},[n]),l}function _k(n){const[a,l]=m.useState(null),o=m.useRef(n),c=m.useCallback(u=>{const f=Bh(u.target);f&&l(p=>p?(p.set(f,vm(f)),new Map(p)):null)},[]);return m.useEffect(()=>{const u=o.current;if(n!==u){f(u);const p=n.map(g=>{const v=Bh(g);return v?(v.addEventListener("scroll",c,{passive:!0}),[v,vm(v)]):null}).filter(g=>g!=null);l(p.length?new Map(p):null),o.current=n}return()=>{f(n),f(u)};function f(p){p.forEach(g=>{const v=Bh(g);v==null||v.removeEventListener("scroll",c)})}},[c,n]),m.useMemo(()=>n.length?a?Array.from(a.values()).reduce((u,f)=>Bs(u,f),Da):bS(n):Da,[n,a])}function qb(n,a){a===void 0&&(a=[]);const l=m.useRef(null);return m.useEffect(()=>{l.current=null},a),m.useEffect(()=>{const o=n!==Da;o&&!l.current&&(l.current=n),!o&&l.current&&(l.current=null)},[n]),l.current?ii(n,l.current):Da}function kk(n){m.useEffect(()=>{if(!Qu)return;const a=n.map(l=>{let{sensor:o}=l;return o.setup==null?void 0:o.setup()});return()=>{for(const l of a)l==null||l()}},n.map(a=>{let{sensor:l}=a;return l}))}function zk(n,a){return m.useMemo(()=>n.reduce((l,o)=>{let{eventName:c,handler:u}=o;return l[c]=f=>{u(f,a)},l},{}),[n,a])}function jS(n){return m.useMemo(()=>n?lk(n):null,[n])}const Vb=[];function Lk(n,a){a===void 0&&(a=Zs);const[l]=n,o=jS(l?Bn(l):null),[c,u]=m.useState(Vb);function f(){u(()=>n.length?n.map(g=>xS(g)?o:new Ap(a(g),g)):Vb)}const p=Ju({callback:f});return Ga(()=>{p==null||p.disconnect(),f(),n.forEach(g=>p==null?void 0:p.observe(g))},[n]),c}function Uk(n){if(!n)return null;if(n.children.length>1)return n;const a=n.children[0];return Si(a)?a:n}function Bk(n){let{measure:a}=n;const[l,o]=m.useState(null),c=m.useCallback(v=>{for(const{target:x}of v)if(Si(x)){o(y=>{const b=a(x);return y?{...y,width:b.width,height:b.height}:b});break}},[a]),u=Ju({callback:c}),f=m.useCallback(v=>{const x=Uk(v);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?a(x):null)},[a,u]),[p,g]=xu(f);return m.useMemo(()=>({nodeRef:p,rect:l,setRef:g}),[l,p,g])}const Hk=[{sensor:_p,options:{}},{sensor:Dp,options:{}}],Ik={current:{}},lu={draggable:{measure:zb},droppable:{measure:zb,strategy:ci.WhileDragging,frequency:ym.Optimized},dragOverlay:{measure:Zs}};class Zo extends Map{get(a){var l;return a!=null&&(l=super.get(a))!=null?l:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(a=>{let{disabled:l}=a;return!l})}getNodeFor(a){var l,o;return(l=(o=this.get(a))==null?void 0:o.node.current)!=null?l:void 0}}const Pk={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Zo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:bu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:lu,measureDroppableContainers:bu,windowRect:null,measuringScheduled:!1},qk={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:bu,draggableNodes:new Map,over:null,measureDroppableContainers:bu},Wu=m.createContext(qk),CS=m.createContext(Pk);function Vk(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Zo}}}function $k(n,a){switch(a.type){case Qt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case Qt.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 Qt.DragEnd:case Qt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Qt.RegisterDroppable:{const{element:l}=a,{id:o}=l,c=new Zo(n.droppable.containers);return c.set(o,l),{...n,droppable:{...n.droppable,containers:c}}}case Qt.SetDroppableDisabled:{const{id:l,key:o,disabled:c}=a,u=n.droppable.containers.get(l);if(!u||o!==u.key)return n;const f=new Zo(n.droppable.containers);return f.set(l,{...u,disabled:c}),{...n,droppable:{...n.droppable,containers:f}}}case Qt.UnregisterDroppable:{const{id:l,key:o}=a,c=n.droppable.containers.get(l);if(!c||o!==c.key)return n;const u=new Zo(n.droppable.containers);return u.delete(l),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function Yk(n){let{disabled:a}=n;const{active:l,activatorEvent:o,draggableNodes:c}=m.useContext(Wu),u=pm(o),f=pm(l==null?void 0:l.id);return m.useEffect(()=>{if(!a&&!o&&u&&f!=null){if(!Mp(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=U_(x);if(y){y.focus();break}}})}},[o,a,c,f,u]),null}function Gk(n,a){let{transform:l,...o}=a;return n!=null&&n.length?n.reduce((c,u)=>u({transform:c,...o}),l):l}function Fk(n){return m.useMemo(()=>({draggable:{...lu.draggable,...n==null?void 0:n.draggable},droppable:{...lu.droppable,...n==null?void 0:n.droppable},dragOverlay:{...lu.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 Kk(n){let{activeNode:a,measure:l,initialRect:o,config:c=!0}=n;const u=m.useRef(!1),{x:f,y:p}=typeof c=="boolean"?{x:c,y:c}:c;Ga(()=>{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=l(v),y=mS(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=pS(v);b&&b.scrollBy({top:y.y,left:y.x})}},[a,f,p,o,l])}const ES=m.createContext({...Da,scaleX:1,scaleY:1});var ol;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(ol||(ol={}));const Xk=m.memo(function(a){var l,o,c,u;let{id:f,accessibility:p,autoScroll:g=!0,children:v,sensors:x=Hk,collisionDetection:y=J_,measuring:b,modifiers:w,...E}=a;const j=m.useReducer($k,void 0,Vk),[C,R]=j,[M,T]=V_(),[A,U]=m.useState(ol.Uninitialized),D=A===ol.Initialized,{draggable:{active:B,nodes:O,translate:V},droppable:{containers:L}}=C,J=B!=null?O.get(B):null,G=m.useRef({initial:null,translated:null}),oe=m.useMemo(()=>{var Ct;return B!=null?{id:B,data:(Ct=J==null?void 0:J.data)!=null?Ct:Ik,rect:G}:null},[B,J]),ce=m.useRef(null),[ae,_]=m.useState(null),[H,X]=m.useState(null),W=oi(E,Object.values(E)),te=Ci("DndDescribedBy",f),k=m.useMemo(()=>L.getEnabled(),[L]),P=Fk(b),{droppableRects:Z,measureDroppableContainers:le,measuringScheduled:de}=Nk(k,{dragging:D,dependencies:[V.x,V.y],config:P.droppable}),ve=Ek(O,B),$=m.useMemo(()=>H?gm(H):null,[H]),ie=Dr(),he=Tk(ve,P.draggable.measure);Kk({activeNode:B!=null?O.get(B):null,config:ie.layoutShiftCompensation,initialRect:he,measure:P.draggable.measure});const me=Ib(ve,P.draggable.measure,he),Te=Ib(ve?ve.parentElement:null),je=m.useRef({activatorEvent:null,active:null,activeNode:ve,collisionRect:null,collisions:null,droppableRects:Z,draggableNodes:O,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),De=L.getNodeFor((l=je.current.over)==null?void 0:l.id),Xe=Bk({measure:P.dragOverlay.measure}),ze=(o=Xe.nodeRef.current)!=null?o:ve,Je=D?(c=Xe.rect)!=null?c:me:null,Mt=!!(Xe.nodeRef.current&&Xe.rect),gt=Dk(Mt?null:me),ln=jS(ze?Bn(ze):null),jt=Ok(D?De??ve:null),Bt=Lk(jt),zt=Gk(w,{transform:{x:V.x-gt.x,y:V.y-gt.y,scaleX:1,scaleY:1},activatorEvent:H,active:oe,activeNodeRect:me,containerNodeRect:Te,draggingNodeRect:Je,over:je.current.over,overlayNodeRect:Xe.rect,scrollableAncestors:jt,scrollableAncestorRects:Bt,windowRect:ln}),yt=$?Bs($,V):null,bt=_k(jt),sn=qb(bt),At=qb(bt,[me]),Dt=Bs(zt,sn),Wt=Je?tk(Je,zt):null,Hn=oe&&Wt?y({active:oe,collisionRect:Wt,droppableRects:Z,droppableContainers:k,pointerCoordinates:yt}):null,In=hS(Hn,"id"),[pn,Xa]=m.useState(null),se=Mt?zt:Bs(zt,At),Oe=W_(se,(u=pn==null?void 0:pn.rect)!=null?u:null,me),Qe=m.useRef(null),ot=m.useCallback((Ct,it)=>{let{sensor:qt,options:Ee}=it;if(ce.current==null)return;const Le=O.get(ce.current);if(!Le)return;const Be=Ct.nativeEvent,wt=new qt({active:ce.current,activeNode:Le,event:Be,options:Ee,context:je,onAbort(dt){if(!O.get(dt))return;const{onDragAbort:Et}=W.current,Ht={id:dt};Et==null||Et(Ht),M({type:"onDragAbort",event:Ht})},onPending(dt,Kt,Et,Ht){if(!O.get(dt))return;const{onDragPending:Ja}=W.current,ya={id:dt,constraint:Kt,initialCoordinates:Et,offset:Ht};Ja==null||Ja(ya),M({type:"onDragPending",event:ya})},onStart(dt){const Kt=ce.current;if(Kt==null)return;const Et=O.get(Kt);if(!Et)return;const{onDragStart:Ht}=W.current,Za={activatorEvent:Be,active:{id:Kt,data:Et.data,rect:G}};Ra.unstable_batchedUpdates(()=>{Ht==null||Ht(Za),U(ol.Initializing),R({type:Qt.DragStart,initialCoordinates:dt,active:Kt}),M({type:"onDragStart",event:Za}),_(Qe.current),X(Be)})},onMove(dt){R({type:Qt.DragMove,coordinates:dt})},onEnd:Ot(Qt.DragEnd),onCancel:Ot(Qt.DragCancel)});Qe.current=wt;function Ot(dt){return async function(){const{active:Et,collisions:Ht,over:Za,scrollAdjustedTranslate:Ja}=je.current;let ya=null;if(Et&&Ja){const{cancelDrop:Or}=W.current;ya={activatorEvent:Be,active:Et,collisions:Ht,delta:Ja,over:Za},dt===Qt.DragEnd&&typeof Or=="function"&&await Promise.resolve(Or(ya))&&(dt=Qt.DragCancel)}ce.current=null,Ra.unstable_batchedUpdates(()=>{R({type:dt}),U(ol.Uninitialized),Xa(null),_(null),X(null),Qe.current=null;const Or=dt===Qt.DragEnd?"onDragEnd":"onDragCancel";if(ya){const Zn=W.current[Or];Zn==null||Zn(ya),M({type:Or,event:ya})}})}}},[O]),xa=m.useCallback((Ct,it)=>(qt,Ee)=>{const Le=qt.nativeEvent,Be=O.get(Ee);if(ce.current!==null||!Be||Le.dndKit||Le.defaultPrevented)return;const wt={active:Be};Ct(qt,it.options,wt)===!0&&(Le.dndKit={capturedBy:it.sensor},ce.current=Ee,ot(qt,it))},[O,ot]),ka=Rk(x,xa);kk(x),Ga(()=>{me&&A===ol.Initializing&&U(ol.Initialized)},[me,A]),m.useEffect(()=>{const{onDragMove:Ct}=W.current,{active:it,activatorEvent:qt,collisions:Ee,over:Le}=je.current;if(!it||!qt)return;const Be={active:it,activatorEvent:qt,collisions:Ee,delta:{x:Dt.x,y:Dt.y},over:Le};Ra.unstable_batchedUpdates(()=>{Ct==null||Ct(Be),M({type:"onDragMove",event:Be})})},[Dt.x,Dt.y]),m.useEffect(()=>{const{active:Ct,activatorEvent:it,collisions:qt,droppableContainers:Ee,scrollAdjustedTranslate:Le}=je.current;if(!Ct||ce.current==null||!it||!Le)return;const{onDragOver:Be}=W.current,wt=Ee.get(In),Ot=wt&&wt.rect.current?{id:wt.id,rect:wt.rect.current,data:wt.data,disabled:wt.disabled}:null,dt={active:Ct,activatorEvent:it,collisions:qt,delta:{x:Le.x,y:Le.y},over:Ot};Ra.unstable_batchedUpdates(()=>{Xa(Ot),Be==null||Be(dt),M({type:"onDragOver",event:dt})})},[In]),Ga(()=>{je.current={activatorEvent:H,active:oe,activeNode:ve,collisionRect:Wt,collisions:Hn,droppableRects:Z,draggableNodes:O,draggingNode:ze,draggingNodeRect:Je,droppableContainers:L,over:pn,scrollableAncestors:jt,scrollAdjustedTranslate:Dt},G.current={initial:Je,translated:Wt}},[oe,ve,Hn,Wt,O,ze,Je,Z,L,pn,jt,Dt]),Sk({...ie,delta:V,draggingRect:Wt,pointerCoordinates:yt,scrollableAncestors:jt,scrollableAncestorRects:Bt});const $l=m.useMemo(()=>({active:oe,activeNode:ve,activeNodeRect:me,activatorEvent:H,collisions:Hn,containerNodeRect:Te,dragOverlay:Xe,draggableNodes:O,droppableContainers:L,droppableRects:Z,over:pn,measureDroppableContainers:le,scrollableAncestors:jt,scrollableAncestorRects:Bt,measuringConfiguration:P,measuringScheduled:de,windowRect:ln}),[oe,ve,me,H,Hn,Te,Xe,O,L,Z,pn,le,jt,Bt,P,de,ln]),Qa=m.useMemo(()=>({activatorEvent:H,activators:ka,active:oe,activeNodeRect:me,ariaDescribedById:{draggable:te},dispatch:R,draggableNodes:O,over:pn,measureDroppableContainers:le}),[H,ka,oe,me,R,te,O,pn,le]);return ue.createElement(uS.Provider,{value:T},ue.createElement(Wu.Provider,{value:Qa},ue.createElement(CS.Provider,{value:$l},ue.createElement(ES.Provider,{value:Oe},v)),ue.createElement(Yk,{disabled:(p==null?void 0:p.restoreFocus)===!1})),ue.createElement(G_,{...p,hiddenTextDescribedById:te}));function Dr(){const Ct=(ae==null?void 0:ae.autoScrollEnabled)===!1,it=typeof g=="object"?g.enabled===!1:g===!1,qt=D&&!Ct&&!it;return typeof g=="object"?{...g,enabled:qt}:{enabled:qt}}}),Qk=m.createContext(null),$b="button",Zk="Draggable";function Jk(n){let{id:a,data:l,disabled:o=!1,attributes:c}=n;const u=Ci(Zk),{activators:f,activatorEvent:p,active:g,activeNodeRect:v,ariaDescribedById:x,draggableNodes:y,over:b}=m.useContext(Wu),{role:w=$b,roleDescription:E="draggable",tabIndex:j=0}=c??{},C=(g==null?void 0:g.id)===a,R=m.useContext(C?ES:Qk),[M,T]=xu(),[A,U]=xu(),D=zk(f,a),B=oi(l);Ga(()=>(y.set(a,{id:a,key:u,node:M,activatorNode:A,data:B}),()=>{const V=y.get(a);V&&V.key===u&&y.delete(a)}),[y,a]);const O=m.useMemo(()=>({role:w,tabIndex:j,"aria-disabled":o,"aria-pressed":C&&w===$b?!0:void 0,"aria-roledescription":E,"aria-describedby":x.draggable}),[o,w,j,C,E,x.draggable]);return{active:g,activatorEvent:p,activeNodeRect:v,attributes:O,isDragging:C,listeners:o?void 0:D,node:M,over:b,setNodeRef:T,setActivatorNodeRef:U,transform:R}}function Wk(){return m.useContext(CS)}const e3="Droppable",t3={timeout:25};function n3(n){let{data:a,disabled:l=!1,id:o,resizeObserverConfig:c}=n;const u=Ci(e3),{active:f,dispatch:p,over:g,measureDroppableContainers:v}=m.useContext(Wu),x=m.useRef({disabled:l}),y=m.useRef(!1),b=m.useRef(null),w=m.useRef(null),{disabled:E,updateMeasurementsFor:j,timeout:C}={...t3,...c},R=oi(j??o),M=m.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]),T=Ju({callback:M,disabled:E||!f}),A=m.useCallback((O,V)=>{T&&(V&&(T.unobserve(V),y.current=!1),O&&T.observe(O))},[T]),[U,D]=xu(A),B=oi(a);return m.useEffect(()=>{!T||!U.current||(T.disconnect(),y.current=!1,T.observe(U.current))},[U,T]),m.useEffect(()=>(p({type:Qt.RegisterDroppable,element:{id:o,key:u,disabled:l,node:U,rect:b,data:B}}),()=>p({type:Qt.UnregisterDroppable,key:u,id:o})),[o]),m.useEffect(()=>{l!==x.current.disabled&&(p({type:Qt.SetDroppableDisabled,id:o,key:u,disabled:l}),x.current.disabled=l)},[o,u,l,p]),{active:f,rect:b,isOver:(g==null?void 0:g.id)===o,node:U,over:g,setNodeRef:D}}function a3(n,a,l){const o={...n};return a.top+n.y<=l.top?o.y=l.top-a.top:a.bottom+n.y>=l.top+l.height&&(o.y=l.top+l.height-a.bottom),a.left+n.x<=l.left?o.x=l.left-a.left:a.right+n.x>=l.left+l.width&&(o.x=l.left+l.width-a.right),o}const r3=n=>{let{containerNodeRect:a,draggingNodeRect:l,transform:o}=n;return!l||!a?o:a3(o,l,a)},l3=n=>{let{transform:a}=n;return{...a,x:0}};function kp(n,a,l){const o=n.slice();return o.splice(l<0?o.length+l:l,0,o.splice(a,1)[0]),o}function s3(n,a){return n.reduce((l,o,c)=>{const u=a.get(o);return u&&(l[c]=u),l},Array(n.length))}function Fc(n){return n!==null&&n>=0}function o3(n,a){if(n===a)return!0;if(n.length!==a.length)return!1;for(let l=0;l<n.length;l++)if(n[l]!==a[l])return!1;return!0}function i3(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const RS=n=>{let{rects:a,activeIndex:l,overIndex:o,index:c}=n;const u=kp(a,o,l),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}},Kc={scaleX:1,scaleY:1},c3=n=>{var a;let{activeIndex:l,activeNodeRect:o,index:c,rects:u,overIndex:f}=n;const p=(a=u[l])!=null?a:o;if(!p)return null;if(c===l){const v=u[f];return v?{x:0,y:l<f?v.top+v.height-(p.top+p.height):v.top-p.top,...Kc}:null}const g=u3(u,c,l);return c>l&&c<=f?{x:0,y:-p.height-g,...Kc}:c<l&&c>=f?{x:0,y:p.height+g,...Kc}:{x:0,y:0,...Kc}};function u3(n,a,l){const o=n[a],c=n[a-1],u=n[a+1];return o?l<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 NS="Sortable",TS=ue.createContext({activeIndex:-1,containerId:NS,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:RS,disabled:{draggable:!1,droppable:!1}});function d3(n){let{children:a,id:l,items:o,strategy:c=RS,disabled:u=!1}=n;const{active:f,dragOverlay:p,droppableRects:g,over:v,measureDroppableContainers:x}=Wk(),y=Ci(NS,l),b=p.rect!==null,w=m.useMemo(()=>o.map(D=>typeof D=="object"&&"id"in D?D.id:D),[o]),E=f!=null,j=f?w.indexOf(f.id):-1,C=v?w.indexOf(v.id):-1,R=m.useRef(w),M=!o3(w,R.current),T=C!==-1&&j===-1||M,A=i3(u);Ga(()=>{M&&E&&x(w)},[M,w,E,x]),m.useEffect(()=>{R.current=w},[w]);const U=m.useMemo(()=>({activeIndex:j,containerId:y,disabled:A,disableTransforms:T,items:w,overIndex:C,useDragOverlay:b,sortedRects:s3(w,g),strategy:c}),[j,y,A.draggable,A.droppable,T,w,C,g,b,c]);return ue.createElement(TS.Provider,{value:U},a)}const f3=n=>{let{id:a,items:l,activeIndex:o,overIndex:c}=n;return kp(l,o,c).indexOf(a)},h3=n=>{let{containerId:a,isSorting:l,wasDragging:o,index:c,items:u,newIndex:f,previousItems:p,previousContainerId:g,transition:v}=n;return!v||!o||p!==u&&c===f?!1:l?!0:f!==c&&a===g},m3={duration:200,easing:"ease"},MS="transform",p3=yu.Transition.toString({property:MS,duration:0,easing:"linear"}),g3={roleDescription:"sortable"};function v3(n){let{disabled:a,index:l,node:o,rect:c}=n;const[u,f]=m.useState(null),p=m.useRef(l);return Ga(()=>{if(!a&&l!==p.current&&o.current){const g=c.current;if(g){const v=Zs(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)}}l!==p.current&&(p.current=l)},[a,l,o,c]),m.useEffect(()=>{u&&f(null)},[u]),u}function x3(n){let{animateLayoutChanges:a=h3,attributes:l,disabled:o,data:c,getNewIndex:u=f3,id:f,strategy:p,resizeObserverConfig:g,transition:v=m3}=n;const{items:x,containerId:y,activeIndex:b,disabled:w,disableTransforms:E,sortedRects:j,overIndex:C,useDragOverlay:R,strategy:M}=m.useContext(TS),T=y3(o,w),A=x.indexOf(f),U=m.useMemo(()=>({sortable:{containerId:y,index:A,items:x},...c}),[y,c,A,x]),D=m.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:B,node:O,isOver:V,setNodeRef:L}=n3({id:f,data:U,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...g}}),{active:J,activatorEvent:G,activeNodeRect:oe,attributes:ce,setNodeRef:ae,listeners:_,isDragging:H,over:X,setActivatorNodeRef:W,transform:te}=Jk({id:f,data:U,attributes:{...g3,...l},disabled:T.draggable}),k=__(L,ae),P=!!J,Z=P&&!E&&Fc(b)&&Fc(C),le=!R&&H,de=le&&Z?te:null,$=Z?de??(p??M)({rects:j,activeNodeRect:oe,activeIndex:b,overIndex:C,index:A}):null,ie=Fc(b)&&Fc(C)?u({id:f,items:x,activeIndex:b,overIndex:C}):A,he=J==null?void 0:J.id,me=m.useRef({activeId:he,items:x,newIndex:ie,containerId:y}),Te=x!==me.current.items,je=a({active:J,containerId:y,isDragging:H,isSorting:P,id:f,index:A,items:x,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:v,wasDragging:me.current.activeId!=null}),De=v3({disabled:!je,index:A,node:O,rect:B});return m.useEffect(()=>{P&&me.current.newIndex!==ie&&(me.current.newIndex=ie),y!==me.current.containerId&&(me.current.containerId=y),x!==me.current.items&&(me.current.items=x)},[P,ie,y,x]),m.useEffect(()=>{if(he===me.current.activeId)return;if(he!=null&&me.current.activeId==null){me.current.activeId=he;return}const ze=setTimeout(()=>{me.current.activeId=he},50);return()=>clearTimeout(ze)},[he]),{active:J,activeIndex:b,attributes:ce,data:U,rect:B,index:A,newIndex:ie,items:x,isOver:V,isSorting:P,isDragging:H,listeners:_,node:O,overIndex:C,over:X,setNodeRef:k,setActivatorNodeRef:W,setDroppableNodeRef:L,setDraggableNodeRef:ae,transform:De??$,transition:Xe()};function Xe(){if(De||Te&&me.current.newIndex===A)return p3;if(!(le&&!Mp(G)||!v)&&(P||je))return yu.Transition.toString({...v,property:MS})}}function y3(n,a){var l,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(l=n==null?void 0:n.draggable)!=null?l:a.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:a.droppable}}function Su(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 b3=[Fe.Down,Fe.Right,Fe.Up,Fe.Left],w3=(n,a)=>{let{context:{active:l,collisionRect:o,droppableRects:c,droppableContainers:u,over:f,scrollableAncestors:p}}=a;if(b3.includes(n.code)){if(n.preventDefault(),!l||!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 Fe.Down:o.top<b.top&&g.push(y);break;case Fe.Up:o.top>b.top&&g.push(y);break;case Fe.Left:o.left>b.left&&g.push(y);break;case Fe.Right:o.left<b.left&&g.push(y);break}});const v=Q_({collisionRect:o,droppableRects:c,droppableContainers:g});let x=hS(v,"id");if(x===(f==null?void 0:f.id)&&v.length>1&&(x=v[1].id),x!=null){const y=u.get(l.id),b=u.get(x),w=b?c.get(b.id):null,E=b==null?void 0:b.node.current;if(E&&w&&y&&b){const C=Zu(E).some((D,B)=>p[B]!==D),R=AS(y,b),M=S3(y,b),T=C||!R?{x:0,y:0}:{x:M?o.width-w.width:0,y:M?o.height-w.height:0},A={x:w.left,y:w.top};return T.x&&T.y?A:ii(A,T)}}}};function AS(n,a){return!Su(n)||!Su(a)?!1:n.data.current.sortable.containerId===a.data.current.sortable.containerId}function S3(n,a){return!Su(n)||!Su(a)||!AS(n,a)?!1:n.data.current.sortable.index<a.data.current.sortable.index}const Ph={maxTotalAttempts:3,fallbackOnConnection:!0,fallbackOnConnectTimeout:!0,fallbackOnFirstTokenTimeout:!0,fallbackOn408:!0,fallbackOn429:!0,fallbackOn5xx:!0},j3={member_disabled:"member disabled",model_missing:"model missing",provider_disabled:"provider disabled",provider_down:"provider down",model_disabled:"model disabled",upstream_unavailable:"upstream unavailable",circuit_open:"circuit open",chat_capability_unavailable:"chat capability unavailable"},ju=n=>n.map((a,l)=>({...a,position:l}));function C3(){const[n,a]=m.useState([]),[l,o]=m.useState([]),[c,u]=m.useState(!1),[f,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(!1),[b,w]=m.useState(!1),[E,j]=m.useState(null),[C,R]=m.useState(null),[M,T]=m.useState({name:"",slug:"",enabled:!0,...Ph,members:[]}),[A,U]=m.useState({name:"",slug:"",enabled:!0,...Ph,members:[]}),[D,B]=m.useState(null),O=async()=>{const[_,H]=await Promise.all([we.get("/api/admin/combos"),we.get("/api/admin/models")]);a(_.combos),o(H.models)};m.useEffect(()=>{O()},[]);const V=async _=>{j(_.id);try{R(await we.post("/api/admin/combos/"+_.id+"/test"))}catch(H){ge.error(H.message)}finally{j(null)}},L=async()=>{if(M.members.length===0){ge.error("Add at least one member");return}y(!0);try{await we.post("/api/admin/combos",{name:M.name,slug:M.slug.trim()||void 0,enabled:M.enabled,...M,members:M.members}),ge.success("Combo created"),u(!1),T({name:"",slug:"",enabled:!0,...Ph,members:[]}),O()}catch(_){ge.error(_.message)}finally{y(!1)}},J=async _=>{try{const X=(await we.get(`/api/admin/combos/${_.id}`)).combo;v(X.id),U({name:X.name,slug:X.publicModelId.startsWith("combo/")?X.slug:"",enabled:X.enabled,maxTotalAttempts:X.maxTotalAttempts,fallbackOnConnection:X.fallbackOnConnection,fallbackOnConnectTimeout:X.fallbackOnConnectTimeout,fallbackOnFirstTokenTimeout:X.fallbackOnFirstTokenTimeout,fallbackOn408:X.fallbackOn408,fallbackOn429:X.fallbackOn429,fallbackOn5xx:X.fallbackOn5xx,members:X.members.map(W=>({modelId:W.modelId,position:W.position,enabled:W.enabled}))}),p(!0)}catch(H){ge.error(H.message)}},G=async()=>{if(g){if(A.members.length===0){ge.error("Add at least one member");return}w(!0);try{await we.patch("/api/admin/combos",{id:g,name:A.name,slug:A.slug.trim()||void 0,enabled:A.enabled,...A,members:A.members}),ge.success("Combo updated"),p(!1),v(null),O()}catch(_){ge.error(_.message)}finally{w(!1)}}},oe=_=>{T(H=>({...H,members:ju([...H.members,{modelId:_,position:H.members.length,enabled:!0}])}))},ce=_=>{U(H=>({...H,members:ju([...H.members,{modelId:_,position:H.members.length,enabled:!0}])}))},ae=async _=>{try{await we.del(`/api/admin/combos/${_}`),ge.success("Combo removed"),B(null),O()}catch(H){ge.error(H.message)}};return s.jsxs("div",{children:[s.jsx(Ka,{title:"Combos",description:"Virtual models combining physical models",actions:s.jsxs(On,{open:c,onOpenChange:u,children:[s.jsx(bi,{asChild:!0,children:s.jsxs(fe,{children:[s.jsx(Mu,{className:"mr-1 h-4 w-4"})," New combo"]})}),s.jsxs(yn,{className:"max-h-[calc(100vh-2rem)] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[s.jsx(bn,{children:s.jsx(wn,{children:"New combo"})}),s.jsxs("div",{className:"min-h-0 space-y-3 overflow-y-auto pr-1",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ae,{value:M.name,onChange:_=>T({...M,name:_.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — empty uses the name as the model ID)"}),s.jsx(Ae,{value:M.slug,onChange:_=>T({...M,slug:_.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Aa,{checked:M.enabled,onCheckedChange:_=>T({...M,enabled:_})}),s.jsx(be,{children:"Enabled"})]}),s.jsx(Yb,{value:M,onChange:_=>T(H=>({...H,..._}))}),s.jsxs("div",{children:[s.jsx(be,{children:"Members — priority order · drag to reorder"}),s.jsx(Kb,{models:l,addedIds:M.members.map(_=>_.modelId),onAdd:oe}),s.jsx(Gb,{members:M.members,modelFor:_=>l.find(H=>H.id===_.modelId)??null}),s.jsx(Fb,{className:"mt-2",members:M.members,label:_=>{var H;return((H=l.find(X=>X.id===_.modelId))==null?void 0:H.publicModelId)??_.modelId},modelFor:_=>l.find(H=>H.id===_.modelId)??null,onChange:_=>T(H=>({...H,members:_}))})]})]}),s.jsxs(_n,{children:[s.jsx(fe,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),s.jsx(fe,{disabled:!M.name||x,onClick:L,children:x?"Creating…":"Create"})]})]})]})}),s.jsxs(at,{children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"text-base",children:"All combos"}),s.jsxs(xn,{children:[n.length," total"]})]}),s.jsx(st,{children:s.jsxs(pa,{children:[s.jsx(ga,{children:s.jsxs(tt,{children:[s.jsx(xe,{children:"Public ID"}),s.jsx(xe,{children:"Members"}),s.jsx(xe,{children:"Status"}),s.jsx(xe,{children:"Enabled"}),s.jsx(xe,{})]})}),s.jsxs(va,{children:[n.length===0&&s.jsx(tt,{children:s.jsx(pe,{colSpan:5,className:"text-center text-muted-foreground",children:"No combos yet."})}),n.map(_=>s.jsxs(tt,{children:[s.jsx(pe,{className:"font-mono text-xs",children:_.publicModelId}),s.jsx(pe,{children:_.memberCount}),s.jsxs(pe,{children:[s.jsxs(Ze,{variant:_.status==="ready"?"success":_.status==="disabled"?"secondary":"destructive",children:[_.healthyMemberCount,"/",_.memberCount," ready"]}),_.capabilityWarnings.length>0&&s.jsx("div",{className:"text-xs text-amber-600",children:"Capability metadata differs"}),_.status==="unavailable"&&_.unavailableReasons.length>0&&s.jsx("div",{className:"text-xs text-muted-foreground",children:_.unavailableReasons.map(H=>j3[H]??H).join(", ")})]}),s.jsx(pe,{children:_.enabled?"Yes":"No"}),s.jsx(pe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(fe,{size:"sm",variant:"outline",title:"Sends a real non-streaming inference request",onClick:()=>void V(_),disabled:E===_.id,children:[E===_.id?s.jsx(ks,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):s.jsx(k0,{className:"mr-1 h-3.5 w-3.5"})," Test"]}),s.jsxs(fe,{size:"sm",variant:"outline",onClick:()=>void J(_),children:[s.jsx(jR,{className:"h-3.5 w-3.5"})," Sửa"]}),s.jsxs(fe,{size:"sm",variant:"destructive",onClick:()=>B(_),children:[s.jsx(Au,{className:"h-3.5 w-3.5"})," Delete"]})]})})]},_.id))]})]})})]}),s.jsx(On,{open:f,onOpenChange:p,children:s.jsxs(yn,{className:"max-h-[calc(100vh-2rem)] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[s.jsx(bn,{children:s.jsx(wn,{children:"Edit combo"})}),s.jsxs("div",{className:"min-h-0 space-y-3 overflow-y-auto pr-1",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ae,{value:A.name,onChange:_=>U({...A,name:_.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Ae,{value:A.slug,onChange:_=>U({...A,slug:_.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Aa,{checked:A.enabled,onCheckedChange:_=>U({...A,enabled:_})}),s.jsx(be,{children:"Enabled"})]}),s.jsx(Yb,{value:A,onChange:_=>U(H=>({...H,..._}))}),s.jsxs("div",{children:[s.jsx(be,{children:"Members — priority order · drag to reorder"}),s.jsx(Kb,{models:l,addedIds:A.members.map(_=>_.modelId),onAdd:ce}),s.jsx(Gb,{members:A.members,modelFor:_=>l.find(H=>H.id===_.modelId)??null}),s.jsx(Fb,{className:"mt-2",members:A.members,label:_=>{var H;return((H=l.find(X=>X.id===_.modelId))==null?void 0:H.publicModelId)??_.modelId},modelFor:_=>l.find(H=>H.id===_.modelId)??null,onChange:_=>U(H=>({...H,members:_}))})]})]}),s.jsxs(_n,{children:[s.jsx(fe,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(fe,{disabled:!A.name||b,onClick:G,children:b?"Saving…":"Save"})]})]})}),s.jsx(On,{open:C!==null,onOpenChange:_=>{_||R(null)},children:s.jsxs(yn,{className:"max-w-2xl",children:[s.jsxs(bn,{children:[s.jsx(wn,{children:"Combo test result"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Test sends a real non-streaming inference request through this combo."})]}),C&&s.jsx(E3,{result:C}),s.jsx(_n,{children:s.jsx(fe,{onClick:()=>R(null),children:"Close"})})]})}),s.jsx(pu,{open:D!==null,onOpenChange:_=>{_||B(null)},children:s.jsxs(ni,{children:[s.jsxs(gu,{children:[s.jsx(ai,{children:"Delete combo?"}),s.jsx(ri,{children:"This removes the virtual model and its ordered fallback configuration. Request history is preserved."})]}),s.jsxs(vu,{children:[s.jsx(si,{children:"Cancel"}),s.jsx(li,{onClick:()=>D&&void ae(D.id),children:"Delete"})]})]})})]})}function Yb({value:n,onChange:a}){const l=[["fallbackOnConnection","Connection failure"],["fallbackOnConnectTimeout","Connect timeout"],["fallbackOnFirstTokenTimeout","First-token timeout"],["fallbackOn408","HTTP 408"],["fallbackOn429","HTTP 429"],["fallbackOn5xx","HTTP 5xx"]];return s.jsxs("div",{className:"rounded border bg-muted/20 p-3",children:[s.jsx("div",{className:"mb-2 text-sm font-medium",children:"Fallback policy"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-[10rem_1fr]",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Max total attempts"}),s.jsx(Ae,{type:"number",min:1,max:8,value:n.maxTotalAttempts,onChange:o=>a({maxTotalAttempts:Math.min(8,Math.max(1,Number(o.target.value)||1))})})]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:l.map(([o,c])=>s.jsxs("label",{className:"flex items-center gap-2 text-xs",children:[s.jsx(Aa,{checked:!!n[o],onCheckedChange:u=>a({[o]:u})}),s.jsx("span",{children:c})]},o))})]})]})}function Gb({members:n,modelFor:a}){if(n.length===0)return null;const l=n.map(a).filter(c=>!!c),o=["chat","streaming","tools","structured_output","image_input","reasoning"].filter(c=>new Set(l.map(u=>u.capabilities[c]===!0?"yes":u.capabilities[c]===!1?"no":"unknown")).size>1);return s.jsxs("div",{className:"rounded border bg-muted/20 p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 font-medium",children:["Route preview ",s.jsx("span",{className:"font-normal text-muted-foreground",children:"(first available member wins)"})]}),o.length>0&&s.jsxs("div",{className:"mb-2 flex items-center gap-1 text-amber-600",children:[s.jsx(L0,{className:"h-3.5 w-3.5"})," Members differ on: ",o.join(", ")]}),s.jsx("div",{className:"space-y-1",children:n.map((c,u)=>{const f=a(c);return s.jsxs("div",{className:"flex items-center gap-2 font-mono",children:[s.jsxs("span",{className:"w-4 text-muted-foreground",children:[u+1,"."]}),s.jsx("span",{children:(f==null?void 0:f.publicModelId)??c.modelId}),s.jsxs("span",{className:"text-muted-foreground",children:["→ ",(f==null?void 0:f.upstreamModelId)??"upstream model unknown"]})]},c.id??c.modelId)})})]})}function E3({result:n}){return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between rounded border p-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[n.success?s.jsx(pi,{className:"h-4 w-4 text-emerald-600"}):s.jsx(L0,{className:"h-4 w-4 text-amber-600"}),s.jsx(Ze,{variant:n.success?"success":"warning",children:n.success?"Success":"Failed"})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.latencyMs," ms total"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-sm font-medium",children:"Selected upstream"}),n.selectedModel?s.jsxs("div",{className:"rounded border bg-muted/20 p-2 font-mono text-xs",children:[n.selectedModel.publicModelId," → ",n.selectedModel.upstreamModelId,s.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",n.selectedModel.providerSlug,")"]})]}):s.jsx("p",{className:"text-sm text-muted-foreground",children:"No member completed successfully."})]}),s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-sm font-medium",children:"Attempts"}),s.jsx("div",{className:"space-y-1",children:n.attempts.map((a,l)=>s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[s.jsxs("span",{className:"w-4 text-muted-foreground",children:[l+1,"."]}),s.jsxs("span",{className:"min-w-0 flex-1 font-mono",children:[a.publicModelId," → ",a.upstreamModelId]}),s.jsxs("span",{className:"text-muted-foreground",children:[a.latencyMs," ms"]}),s.jsx(Ze,{variant:a.success?"success":"warning",children:a.success?"Used":a.failureReason??"Skipped"})]},a.publicModelId+"-"+l))})]}),n.text&&s.jsx("pre",{className:"max-h-32 overflow-auto whitespace-pre-wrap rounded border bg-muted/20 p-2 text-xs",children:n.text})]})}function Fb({members:n,label:a,modelFor:l,onChange:o,className:c}){const u=F_(Ob(_p,{activationConstraint:{distance:4}}),Ob(Dp,{coordinateGetter:w3}));if(n.length===0)return s.jsx("p",{className:Ce("text-xs text-muted-foreground",c),children:"No members yet — add at least one."});const f=({active:p,over:g})=>{!g||p.id===g.id||o(ju(kp(n,Number(p.id),Number(g.id))))};return s.jsx(Xk,{sensors:u,collisionDetection:X_,modifiers:[l3,r3],onDragEnd:f,children:s.jsx(d3,{items:n.map((p,g)=>g),strategy:c3,children:s.jsx("div",{className:Ce("space-y-1",c),children:n.map((p,g)=>s.jsx(R3,{index:g,label:a(p),model:l(p),onRemove:()=>o(ju(n.filter((v,x)=>x!==g)))},p.id??p.modelId))})})})}function R3({index:n,label:a,model:l,onRemove:o}){const{attributes:c,listeners:u,setNodeRef:f,transform:p,transition:g,isDragging:v}=x3({id:n});return s.jsxs("div",{ref:f,style:{transform:p?`translate3d(${p.x}px, ${p.y}px, 0)`:void 0,transition:g},className:Ce("flex items-center gap-2 rounded border p-2 text-sm",v&&"relative z-10 bg-muted/60 shadow-sm"),children:[s.jsx("button",{type:"button",...c,...u,"aria-label":`Reorder ${a}`,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:s.jsx(mR,{className:"h-4 w-4"})}),s.jsx("span",{className:"w-5 text-xs tabular-nums text-muted-foreground",children:n+1}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"truncate font-mono text-xs",children:a}),s.jsxs("div",{className:"truncate text-[11px] text-muted-foreground",children:[(l==null?void 0:l.providerSlug)||"provider"," · upstream: ",(l==null?void 0:l.upstreamModelId)??"unknown"]})]}),s.jsx(Ze,{variant:l&&l.enabled&&l.providerEnabled&&l.providerHealth!=="down"&&l.providerHealth!=="circuit_open"&&!l.circuitOpen&&l.upstreamAvailable&&l.capabilities.chat!==!1?"success":"warning",children:l&&l.enabled&&l.providerEnabled&&l.providerHealth!=="down"&&l.providerHealth!=="circuit_open"&&!l.circuitOpen&&l.upstreamAvailable&&l.capabilities.chat!==!1?"Ready":"Unavailable"}),s.jsx(fe,{size:"sm",variant:"outline",onClick:o,children:"Remove"})]})}function Kb({models:n,addedIds:a,onAdd:l}){const[o,c]=m.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 s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"relative",children:[s.jsx(z0,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ae,{className:"pl-8",placeholder:"Search models…",value:o,onChange:p=>c(p.target.value)}),o&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>c(""),children:s.jsx(Du,{className:"h-4 w-4"})})]}),f.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No models match."}):s.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded border p-1",children:f.map(p=>s.jsxs("div",{className:"flex items-center justify-between rounded p-1 text-sm hover:bg-accent",children:[s.jsx("span",{className:"font-mono text-xs",children:p.publicModelId}),s.jsx(fe,{size:"sm",variant:"ghost",onClick:()=>l(p.id),children:"+ Add"})]},p.id))})]})}function N3(){const[n,a]=m.useState([]),[l,o]=m.useState([]),[c,u]=m.useState([]),[f,p]=m.useState(!1),[g,v]=m.useState({alias:"",targetKind:"model",targetId:"",enabled:!0}),x=async()=>{const[b,w,E]=await Promise.all([we.get("/api/admin/aliases"),we.get("/api/admin/models"),we.get("/api/admin/combos")]);a(b.aliases),o(w.models),u(E.combos)};m.useEffect(()=>{x()},[]);const y=async()=>{try{await we.post("/api/admin/aliases",g),ge.success("Alias created"),p(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),x()}catch(b){ge.error(b.message)}};return s.jsxs("div",{children:[s.jsx(Ka,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:s.jsxs(On,{open:f,onOpenChange:p,children:[s.jsx(bi,{asChild:!0,children:s.jsxs(fe,{children:[s.jsx(Mu,{className:"mr-1 h-4 w-4"})," New alias"]})}),s.jsxs(yn,{children:[s.jsx(bn,{children:s.jsx(wn,{children:"New alias"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Alias"}),s.jsx(Ae,{value:g.alias,onChange:b=>v({...g,alias:b.target.value}),placeholder:"coding"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Target type"}),s.jsxs(Ta,{value:g.targetKind,onValueChange:b=>v({...g,targetKind:b}),children:[s.jsx(da,{children:s.jsx(Ma,{})}),s.jsxs(fa,{children:[s.jsx(St,{value:"model",children:"Model"}),s.jsx(St,{value:"combo",children:"Combo"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Target"}),s.jsxs(Ta,{value:g.targetId,onValueChange:b=>v({...g,targetId:b}),children:[s.jsx(da,{children:s.jsx(Ma,{placeholder:"Choose target"})}),s.jsx(fa,{children:(g.targetKind==="model"?l:c).map(b=>s.jsx(St,{value:b.id,children:b.publicModelId},b.id))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Aa,{checked:g.enabled,onCheckedChange:b=>v({...g,enabled:b})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(_n,{children:[s.jsx(fe,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(fe,{disabled:!g.alias||!g.targetId,onClick:y,children:"Create"})]})]})]})}),s.jsxs(at,{children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"text-base",children:"All aliases"}),s.jsxs(xn,{children:[n.length," total"]})]}),s.jsx(st,{children:s.jsxs(pa,{children:[s.jsx(ga,{children:s.jsxs(tt,{children:[s.jsx(xe,{children:"Alias"}),s.jsx(xe,{children:"Target"}),s.jsx(xe,{children:"Type"}),s.jsx(xe,{children:"Enabled"}),s.jsx(xe,{})]})}),s.jsxs(va,{children:[n.length===0&&s.jsx(tt,{children:s.jsx(pe,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),n.map(b=>s.jsxs(tt,{children:[s.jsx(pe,{className:"font-mono text-xs",children:b.alias}),s.jsx(pe,{className:"font-mono text-xs",children:b.targetName??b.targetId}),s.jsx(pe,{children:s.jsx(Ze,{variant:"outline",children:b.targetKind})}),s.jsx(pe,{children:b.enabled?"Yes":"No"}),s.jsx(pe,{className:"text-right",children:s.jsx(fe,{size:"sm",variant:"outline",onClick:async()=>{await we.del(`/api/admin/aliases/${b.id}`),ge.success("Removed"),x()},children:"Delete"})})]},b.id))]})]})})]})]})}function T3(){const[n,a]=m.useState([]),[l,o]=m.useState([]),[c,u]=m.useState([]),[f,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(null),[b,w]=m.useState(null),[E,j]=m.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C=async()=>{const[D,B,O]=await Promise.all([we.get("/api/admin/api-keys"),we.get("/api/admin/models"),we.get("/api/admin/combos")]);a(D.apiKeys),o(B.models),u(O.combos)};m.useEffect(()=>{C()},[]);const R=async()=>{try{if(g){await we.patch("/api/admin/api-keys",{id:g,name:E.name,expiresAt:E.expiresAt||null,allowAllModels:E.allowAll,permissions:E.allowAll?[]:E.permissions,rpmLimit:E.rpmLimit?Number(E.rpmLimit):null,tpmLimit:E.tpmLimit?Number(E.tpmLimit):null,maxConcurrent:E.concurrency?Number(E.concurrency):null}),p(!1),v(null),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),ge.success("Key updated"),C();return}const D=await we.post("/api/admin/api-keys",{name:E.name,expiresAt:E.expiresAt||null,allowAllModels:E.allowAll,permissions:E.allowAll?void 0:E.permissions,rpmLimit:E.rpmLimit?Number(E.rpmLimit):null,tpmLimit:E.tpmLimit?Number(E.tpmLimit):null,maxConcurrent:E.concurrency?Number(E.concurrency):null,...E.customSecret.trim()?{secret:E.customSecret.trim()}:{}});p(!1),y({secret:D.secret,name:D.name}),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C()}catch(D){ge.error(D.message)}},M=async D=>{try{const O=((await we.get(`/api/admin/api-keys/${D.id}`)).apiKey.permissions??[]).filter(V=>V.targetKind==="model"||V.targetKind==="combo");v(D.id),j({name:D.name,expiresAt:D.expiresAt?D.expiresAt.slice(0,16):"",allowAll:D.allowAllModels,permissions:O,rpmLimit:D.rpmLimit!=null?String(D.rpmLimit):"",tpmLimit:D.tpmLimit!=null?String(D.tpmLimit):"",concurrency:D.concurrencyLimit!=null?String(D.concurrencyLimit):"",customSecret:""}),p(!0)}catch(B){ge.error(B.message)}},T=()=>{p(!1),v(null),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""})},A=async(D,B)=>{try{await we.patch("/api/admin/api-keys",{id:D,enabled:!B}),ge.success(B?"Key disabled":"Key enabled"),C()}catch(O){ge.error(O.message)}},U=async D=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await we.del(`/api/admin/api-keys/${D}`),ge.success("Key deleted"),C()}catch(B){ge.error(B.message)}};return s.jsxs("div",{children:[s.jsx(Ka,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:s.jsxs(On,{open:f,onOpenChange:D=>{D?p(!0):T()},children:[s.jsx(bi,{asChild:!0,children:s.jsxs(fe,{children:[s.jsx(Mu,{className:"mr-1 h-4 w-4"})," New key"]})}),s.jsxs(yn,{className:"max-w-2xl",children:[s.jsx(bn,{children:s.jsx(wn,{children:g?"Edit API key":"New API key"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ae,{value:E.name,onChange:D=>j({...E,name:D.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Expires (optional)"}),s.jsx(Ae,{type:"datetime-local",value:E.expiresAt,onChange:D=>j({...E,expiresAt:D.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{children:[s.jsx(be,{children:"RPM limit"}),s.jsx(Ae,{value:E.rpmLimit,onChange:D=>j({...E,rpmLimit:D.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TPM limit"}),s.jsx(Ae,{value:E.tpmLimit,onChange:D=>j({...E,tpmLimit:D.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Concurrency"}),s.jsx(Ae,{value:E.concurrency,onChange:D=>j({...E,concurrency:D.target.value}),type:"number"})]})]}),!g&&s.jsxs("div",{children:[s.jsx(be,{children:"Key value (optional)"}),s.jsx(Ae,{value:E.customSecret,onChange:D=>j({...E,customSecret:D.target.value}),placeholder:"Leave empty to auto-generate ld-…"}),s.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."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Aa,{checked:E.allowAll,onCheckedChange:D=>j({...E,allowAll:D})}),s.jsx(be,{children:"Allow all current and future models"})]}),!E.allowAll&&s.jsxs("div",{children:[s.jsx(be,{children:"Scope"}),s.jsx("div",{className:"max-h-48 space-y-1 overflow-auto rounded border p-2",children:[...l.map(D=>({targetKind:"model",targetId:D.id,label:D.publicModelId})),...c.map(D=>({targetKind:"combo",targetId:D.id,label:D.publicModelId}))].map(D=>{const B=E.permissions.some(O=>O.targetKind===D.targetKind&&O.targetId===D.targetId);return s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(Ep,{checked:B,onCheckedChange:O=>{j(V=>({...V,permissions:O?[...V.permissions,{targetKind:D.targetKind,targetId:D.targetId}]:V.permissions.filter(L=>!(L.targetKind===D.targetKind&&L.targetId===D.targetId))}))}}),s.jsx("span",{className:"font-mono text-xs",children:D.label}),s.jsx(Ze,{variant:"outline",className:"ml-1",children:D.targetKind})]},`${D.targetKind}:${D.targetId}`)})})]})]}),s.jsxs(_n,{children:[s.jsx(fe,{variant:"outline",onClick:T,children:"Cancel"}),s.jsx(fe,{disabled:!E.name,onClick:R,children:g?"Save changes":"Create"})]})]})]})}),s.jsxs(at,{children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"text-base",children:"All keys"}),s.jsxs(xn,{children:[n.length," total"]})]}),s.jsx(st,{children:s.jsxs(pa,{children:[s.jsx(ga,{children:s.jsxs(tt,{children:[s.jsx(xe,{children:"Name"}),s.jsx(xe,{children:"Prefix"}),s.jsx(xe,{children:"Status"}),s.jsx(xe,{children:"Scope"}),s.jsx(xe,{children:"RPM/TPM/Conc"}),s.jsx(xe,{})]})}),s.jsxs(va,{children:[n.length===0&&s.jsx(tt,{children:s.jsx(pe,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),n.map(D=>s.jsxs(tt,{children:[s.jsx(pe,{className:"font-medium",children:D.name}),s.jsxs(pe,{className:"font-mono text-xs",children:[D.keyPrefix,"…"]}),s.jsx(pe,{children:D.enabled?s.jsx(Ze,{variant:"success",children:"enabled"}):s.jsx(Ze,{variant:"destructive",children:"disabled"})}),s.jsx(pe,{children:D.allowAllModels?"all":`${D.modelScopeCount} scoped`}),s.jsx(pe,{className:"text-xs",children:[D.rpmLimit,D.tpmLimit,D.concurrencyLimit].map((B,O)=>B?["","RPM","TPM","Conc"][O+1]:null).filter(Boolean).join(" / ")||"—"}),s.jsx(pe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[D.secret&&s.jsxs(s.Fragment,{children:[s.jsx(fe,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(D.secret),ge.success("Copied")},children:s.jsx(Ko,{className:"h-3.5 w-3.5"})}),s.jsx(fe,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>w({secret:D.secret,name:D.name}),children:s.jsx(dR,{className:"h-3.5 w-3.5"})})]}),s.jsx(fe,{size:"sm",variant:"ghost",title:"Edit",onClick:()=>void M(D),children:s.jsx(xR,{className:"h-3.5 w-3.5"})}),s.jsxs(fe,{size:"sm",variant:"outline",onClick:()=>A(D.id,D.enabled),children:[D.enabled?s.jsx(eR,{className:"mr-1 h-3.5 w-3.5"}):s.jsx(pi,{className:"mr-1 h-3.5 w-3.5"}),D.enabled?"Disable":"Enable"]}),s.jsx(fe,{size:"sm",variant:"destructive",onClick:()=>U(D.id),children:s.jsx(Au,{className:"h-3.5 w-3.5"})})]})})]},D.id))]})]})})]}),s.jsx(On,{open:!!x,onOpenChange:D=>{D||y(null)},children:s.jsxs(yn,{children:[s.jsxs(bn,{children:[s.jsx(wn,{children:"API key created"}),s.jsx(mu,{children:"Copy now — this secret will not be shown again."})]}),s.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:x==null?void 0:x.secret}),s.jsxs(_n,{children:[s.jsxs(fe,{onClick:()=>{x&&(navigator.clipboard.writeText(x.secret),ge.success("Copied"))},children:[s.jsx(Ko,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(fe,{variant:"outline",onClick:()=>y(null),children:"I have saved it"})]})]})}),s.jsx(On,{open:!!b,onOpenChange:D=>{D||w(null)},children:s.jsxs(yn,{children:[s.jsxs(bn,{children:[s.jsxs(wn,{children:["API key: ",b==null?void 0:b.name]}),s.jsx(mu,{children:"Full secret for this key, readable any time."})]}),s.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:b==null?void 0:b.secret}),s.jsxs(_n,{children:[s.jsxs(fe,{onClick:()=>{b&&(navigator.clipboard.writeText(b.secret),ge.success("Copied"))},children:[s.jsx(Ko,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(fe,{variant:"outline",onClick:()=>w(null),children:"Close"})]})]})})]})}var M3=Object.defineProperty,Js=(n,a)=>M3(n,"name",{value:a,configurable:!0}),zp="Tabs",[A3,a5]=Un(zp,[Vu]),DS=Vu(),[D3,Lp]=A3(zp),O3=m.forwardRef(Js(function(a,l){const{__scopeTabs:o,value:c,onValueChange:u,defaultValue:f,orientation:p="horizontal",dir:g,activationMode:v="automatic",...x}=a,y=vi(g),[b,w]=jr({prop:c,onChange:u,defaultProp:f??"",caller:zp});return s.jsx(D3,{scope:o,baseId:qa(),value:b,onValueChange:w,orientation:p,dir:y,activationMode:v,children:s.jsx(Ve.div,{dir:y,"data-orientation":p,...x,ref:l})})},"Tabs")),_3="TabsList",k3=m.forwardRef(Js(function(a,l){const{__scopeTabs:o,loop:c=!0,...u}=a,f=Lp(_3,o),p=DS(o);return s.jsx(Q1,{asChild:!0,...p,orientation:f.orientation,dir:f.dir,loop:c,children:s.jsx(Ve.div,{role:"tablist","aria-orientation":f.orientation,...u,ref:l})})},"TabsList")),z3="TabsTrigger",L3=m.forwardRef(Js(function(a,l){const{__scopeTabs:o,value:c,disabled:u=!1,...f}=a,p=Lp(z3,o),g=DS(o),v=Up(p.baseId,c),x=Bp(p.baseId,c),y=c===p.value;return s.jsx(Z1,{asChild:!0,...g,focusable:!u,active:y,children:s.jsx(Ve.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:l,onMouseDown:Ne(a.onMouseDown,b=>{!u&&b.button===0&&b.ctrlKey===!1?p.onValueChange(c):b.preventDefault()}),onKeyDown:Ne(a.onKeyDown,b=>{u||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&p.onValueChange(c)}),onFocus:Ne(a.onFocus,()=>{const b=p.activationMode!=="manual";!y&&!u&&b&&p.onValueChange(c)})})})},"TabsTrigger")),U3="TabsContent",B3=m.forwardRef(Js(function(a,l){const{__scopeTabs:o,value:c,forceMount:u,children:f,...p}=a,g=Lp(U3,o),v=Up(g.baseId,c),x=Bp(g.baseId,c),y=c===g.value,b=m.useRef(y);return m.useEffect(()=>{const w=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(w)},[]),s.jsx(Tr,{present:u||y,children:({present:w})=>s.jsx(Ve.div,{"data-state":y?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:x,tabIndex:0,...p,ref:l,style:{...a.style,animationDuration:b.current?"0s":void 0},children:w&&f})})},"TabsContent"));function Up(n,a){return`${n}-trigger-${a}`}Js(Up,"makeTriggerId");function Bp(n,a){return`${n}-content-${a}`}Js(Bp,"makeContentId");var H3=O3,OS=k3,_S=L3,kS=B3;const Hp=H3,ed=m.forwardRef(({className:n,...a},l)=>s.jsx(OS,{ref:l,className:Ce("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...a}));ed.displayName=OS.displayName;const Dn=m.forwardRef(({className:n,...a},l)=>s.jsx(_S,{ref:l,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}));Dn.displayName=_S.displayName;const Ea=m.forwardRef(({className:n,...a},l)=>s.jsx(kS,{ref:l,className:Ce("mt-2 ring-offset-background focus-visible:outline-none",n),...a}));Ea.displayName=kS.displayName;const I3=3e3;function P3(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 q3(){const[n,a]=m.useState([]),[l,o]=m.useState(0),[c,u]=m.useState(0),[f,p]=m.useState({success:"all",protocol:"all",streaming:"all",model:""}),[g,v]=m.useState(null),[x,y]=m.useState(null),[b,w]=m.useState("overview"),[E,j]=m.useState(0),C=50,R=m.useRef(Date.now()),M=m.useRef(new Set),T=m.useRef(f);T.current=f;const A=m.useRef(c);A.current=c;const U=m.useCallback(async()=>{const L=new URLSearchParams;L.set("limit",String(C)),L.set("offset",String(c)),f.success!=="all"&&L.set("success",f.success),f.protocol!=="all"&&L.set("protocol",f.protocol),f.streaming!=="all"&&L.set("streaming",f.streaming),f.model&&L.set("requestedModel",f.model);const J=await we.get(`/api/admin/requests?${L.toString()}`);a(J.requests),o(J.total);for(const G of J.requests)M.current.add(G.id)},[c,f]);m.useEffect(()=>{U()},[U]),m.useEffect(()=>{j(0)},[c,f]),m.useEffect(()=>{let L=!1,J=null;const G=new Set,oe=()=>{L||(J=new EventSource(`/api/admin/requests/stream?since=${R.current}`),J.addEventListener("request",ce=>{if(!L)try{const ae=JSON.parse(ce.data),_=new Date(ae.createdAt).getTime();if(Number.isFinite(_)&&(R.current=Math.max(R.current,_)),M.current.has(ae.id))return;M.current.add(ae.id),j(H=>H+1),A.current===0&&P3(ae,T.current)&&(a(H=>H.some(X=>X.id===ae.id)?H:[ae,...H].slice(0,C)),o(H=>H+1))}catch{}}),J.onerror=()=>{J==null||J.close(),J=null,L||G.add(setTimeout(oe,I3))})};return oe(),()=>{L=!0,J==null||J.close();for(const ce of G)clearTimeout(ce);G.clear()}},[]);const D=async L=>{v(L),w("overview");const J=await we.get(`/api/admin/requests/${L}`);y(J)},B=(L,J)=>{navigator.clipboard.writeText(L).then(()=>ge.success(`${J} copied`))},O=(L,J)=>{const G=URL.createObjectURL(new Blob([L],{type:"application/json"})),oe=document.createElement("a");oe.href=G,oe.download=J,oe.click(),URL.revokeObjectURL(G)},V=(L,J=12e3)=>{if(L.length<=J)return{text:L,truncated:!1};const G=Math.floor(J/2);return{text:`${L.slice(0,G)}
349
+
350
+ … ${L.length-J} characters hidden …
351
+
352
+ ${L.slice(-G)}`,truncated:!0}};return s.jsxs("div",{children:[s.jsx(Ka,{title:"Requests",description:`${l} matching · live updates`}),s.jsxs(at,{children:[s.jsxs(rt,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Ta,{value:f.success,onValueChange:L=>{u(0),p({...f,success:L})},children:[s.jsx(da,{className:"w-36",children:s.jsx(Ma,{})}),s.jsxs(fa,{children:[s.jsx(St,{value:"all",children:"All"}),s.jsx(St,{value:"true",children:"Success"}),s.jsx(St,{value:"false",children:"Failed"})]})]}),s.jsxs(Ta,{value:f.protocol,onValueChange:L=>{u(0),p({...f,protocol:L})},children:[s.jsx(da,{className:"w-32",children:s.jsx(Ma,{})}),s.jsxs(fa,{children:[s.jsx(St,{value:"all",children:"Any protocol"}),s.jsx(St,{value:"openai",children:"OpenAI"}),s.jsx(St,{value:"anthropic",children:"Anthropic"})]})]}),s.jsxs(Ta,{value:f.streaming,onValueChange:L=>{u(0),p({...f,streaming:L})},children:[s.jsx(da,{className:"w-32",children:s.jsx(Ma,{})}),s.jsxs(fa,{children:[s.jsx(St,{value:"all",children:"Any"}),s.jsx(St,{value:"true",children:"Streaming"}),s.jsx(St,{value:"false",children:"Non-stream"})]})]}),s.jsx(Ae,{className:"max-w-xs",placeholder:"Model contains…",value:f.model,onChange:L=>{u(0),p({...f,model:L.target.value})}}),E>0&&s.jsxs(fe,{size:"sm",variant:"secondary",onClick:()=>{j(0),U()},children:[E," new request",E>1?"s":""," — refresh"]})]}),s.jsx(lt,{className:"mt-3 text-base",children:"Results"})]}),s.jsxs(st,{children:[s.jsxs(pa,{children:[s.jsx(ga,{children:s.jsxs(tt,{children:[s.jsx(xe,{children:"Time"}),s.jsx(xe,{children:"Status"}),s.jsx(xe,{children:"Requested"}),s.jsx(xe,{children:"Final"}),s.jsx(xe,{children:"Tokens"}),s.jsx(xe,{children:"Latency"}),s.jsx(xe,{children:"Attempts"}),s.jsx(xe,{children:"Key"}),s.jsx(xe,{children:"IP"}),s.jsx(xe,{})]})}),s.jsxs(va,{children:[n.length===0&&s.jsx(tt,{children:s.jsx(pe,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),n.map(L=>s.jsxs(tt,{className:"cursor-pointer",onClick:()=>D(L.id),children:[s.jsx(pe,{className:"text-xs",children:Pm(L.createdAt)}),s.jsx(pe,{children:L.success?s.jsx(Ze,{variant:"success",children:L.httpStatus}):s.jsx(Ze,{variant:"destructive",children:L.httpStatus})}),s.jsx(pe,{className:"font-mono text-xs",children:L.requestedModel}),s.jsx(pe,{className:"font-mono text-xs text-muted-foreground",children:L.finalModelPublicId??"—"}),s.jsxs(pe,{className:"text-xs",children:[Zt(L.inputTokens+L.outputTokens)," ",L.cacheReadTokens?s.jsxs("span",{className:"text-amber-600",children:["(+",L.cacheReadTokens," cache)"]}):null]}),s.jsxs(pe,{className:"text-xs",children:[zl(L.totalLatencyMs),L.ttftMs?s.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",L.ttftMs,"ms"]}):null]}),s.jsxs(pe,{className:"text-xs",children:[L.attemptsCount,L.gatewayCacheHit?s.jsx(Ze,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),s.jsx(pe,{className:"text-xs",children:L.apiKeyName??"—"}),s.jsx(pe,{className:"text-xs",children:L.clientIp}),s.jsx(pe,{className:"text-right",children:s.jsx(fe,{size:"sm",variant:"ghost",children:"View"})})]},L.id))]})]}),s.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Showing ",c+1,"–",Math.min(c+C,l)," of ",l]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(fe,{size:"sm",variant:"outline",disabled:c===0,onClick:()=>u(Math.max(0,c-C)),children:"Prev"}),s.jsx(fe,{size:"sm",variant:"outline",disabled:c+C>=l,onClick:()=>u(c+C),children:"Next"})]})]})]})]}),s.jsx(On,{open:!!g,onOpenChange:L=>{L||(v(null),y(null))},children:s.jsxs(yn,{className:"max-h-[90vh] max-w-6xl overflow-y-auto",children:[s.jsx(bn,{children:s.jsxs(wn,{children:["Request ",sN(g,16)]})}),x?s.jsxs(Hp,{value:b,onValueChange:w,className:"min-w-0",children:[s.jsxs(ed,{className:"flex h-auto flex-wrap justify-start gap-1",children:[s.jsx(Dn,{value:"overview",children:"Overview"}),s.jsxs(Dn,{value:"attempts",children:["Attempts (",x.attempts.length,")"]}),s.jsx(Dn,{value:"request",children:"Request"}),s.jsx(Dn,{value:"response",children:"Response"}),s.jsx(Dn,{value:"replay",children:"Replay curl"})]}),s.jsxs(Ea,{value:"overview",className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Requested model"}),s.jsx("span",{className:"font-mono text-xs",children:x.request.requestedModel})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Upstream model"}),s.jsx("span",{className:"font-mono text-xs",children:x.request.finalModelUpstreamId??"—"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Provider"}),x.request.providerId?s.jsx(ia,{className:"text-primary underline",to:`/providers?providerId=${encodeURIComponent(x.request.providerId)}`,children:x.request.providerName??x.request.providerSlug??x.request.providerId}):"—"]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Route"}),x.request.resolvedTargetId?s.jsx(ia,{className:"text-primary underline",to:x.request.resolvedTargetKind==="combo"?"/combos":"/models",children:x.request.resolvedTargetKind??"target"}):"—"]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Status"}),x.request.success?s.jsx(Ze,{variant:"success",children:x.request.httpStatus}):s.jsx(Ze,{variant:"destructive",children:x.request.httpStatus})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),zl(x.request.totalLatencyMs)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Zt(x.request.inputTokens)," · out ",Zt(x.request.outputTokens)," · cache ",Zt(x.request.cacheReadTokens)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Attempts"}),x.request.attemptsCount]})]}),x.request.errorType&&s.jsxs("div",{className:"rounded border border-destructive/40 bg-destructive/10 p-2",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Error"}),s.jsxs("div",{className:"font-mono text-xs",children:[x.request.errorType,": ",x.request.errorMessage]})]}),x.request.fallbackReasons.length>0&&s.jsxs("div",{className:"rounded border border-amber-500/40 bg-amber-500/10 p-2",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Fallback reasons"}),s.jsx("div",{className:"text-xs",children:x.request.fallbackReasons.join(", ")})]})]}),s.jsx(Ea,{value:"attempts",className:"min-w-0 overflow-x-auto",children:x.attempts.length>0?s.jsxs(pa,{children:[s.jsx(ga,{children:s.jsxs(tt,{children:[s.jsx(xe,{children:"#"}),s.jsx(xe,{children:"Provider"}),s.jsx(xe,{children:"Model"}),s.jsx(xe,{children:"Status"}),s.jsx(xe,{children:"Latency"}),s.jsx(xe,{children:"Selection"}),s.jsx(xe,{children:"Failure"})]})}),s.jsx(va,{children:x.attempts.map(L=>s.jsxs(tt,{children:[s.jsx(pe,{children:L.attemptNumber}),s.jsx(pe,{children:L.providerName}),s.jsxs(pe,{children:[s.jsx("div",{className:"font-mono text-xs",children:L.modelPublicId}),s.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["upstream: ",L.upstreamModelId]})]}),s.jsx(pe,{children:L.success?s.jsx(Ze,{variant:"success",children:String(L.statusCode??"OK")}):s.jsx(Ze,{variant:"destructive",children:String(L.statusCode??"err")})}),s.jsx(pe,{className:"text-xs",children:zl(L.latencyMs)}),s.jsx(pe,{className:"text-xs",children:L.selectionReason}),s.jsxs(pe,{className:"min-w-[220px] max-w-[320px] text-xs",children:[L.failureReason?s.jsx("div",{className:"font-medium text-destructive",children:L.failureReason}):s.jsx("span",{className:"text-muted-foreground",children:"—"}),L.sanitizedError?s.jsx("div",{className:"mt-1 break-all text-muted-foreground",children:L.sanitizedError}):null,L.upstreamRequestId?s.jsxs("div",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground",children:["upstream request: ",L.upstreamRequestId]}):null]})]},L.id))})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"No upstream attempts."})}),s.jsx(Ea,{value:"request",className:"min-w-0",children:x.request.requestPayload?(()=>{const L=V(x.request.requestPayload);return s.jsx(Xb,{label:"Request content",value:x.request.requestPayload,preview:L,onCopy:()=>B(x.request.requestPayload,"Request JSON"),onDownload:()=>O(x.request.requestPayload,`request-${x.request.id}.json`)})})():s.jsx("div",{className:"text-sm text-muted-foreground",children:"Request content was not retained."})}),s.jsx(Ea,{value:"response",className:"min-w-0",children:x.request.responsePayload?(()=>{const L=V(x.request.responsePayload);return s.jsx(Xb,{label:"Response content",value:x.request.responsePayload,preview:L,onCopy:()=>B(x.request.responsePayload,"Response JSON"),onDownload:()=>O(x.request.responsePayload,`response-${x.request.id}.json`)})})():s.jsx("div",{className:"text-sm text-muted-foreground",children:"Response content was not retained."})}),s.jsxs(Ea,{value:"replay",className:"min-w-0",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[s.jsx("span",{children:"Safe replay curl"}),s.jsxs(fe,{size:"sm",variant:"ghost",onClick:()=>B(x.request.reproductionCurl,"Curl"),children:[s.jsx(Ko,{className:"mr-1 h-3.5 w-3.5"})," Copy"]})]}),s.jsx("pre",{className:"max-h-[55vh] overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 font-mono text-xs",children:x.request.reproductionCurl}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Replace the placeholder key before running. No stored secret is included."})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}function Xb({label:n,value:a,preview:l,onCopy:o,onDownload:c}){return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:[n,l.truncated?" (preview)":""]}),s.jsxs("div",{className:"flex gap-1",children:[s.jsxs(fe,{size:"sm",variant:"ghost",onClick:o,children:[s.jsx(Ko,{className:"mr-1 h-3.5 w-3.5"})," Copy"]}),s.jsx(fe,{size:"sm",variant:"ghost",onClick:c,children:"Download"})]})]}),s.jsx("pre",{className:"max-h-[55vh] overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 font-mono text-xs",children:l.text}),l.truncated&&s.jsx(fe,{size:"sm",variant:"outline",onClick:()=>{const u=document.getElementById(`full-${n}`);u==null||u.classList.remove("hidden")},children:"Show full content"}),s.jsx("pre",{id:`full-${n}`,className:"hidden max-h-[55vh] overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 font-mono text-xs",children:a})]})}const V3=3e3,$3=1600,Y3=10,G3=3,F3=12,K3=10*6e4,X3={cacheReadTokens:0,promptTokens:0,gatewayCacheHits:0,fallbacks:0};function zS(n,a,l){return l==="anthropic"?n+a:n}function Q3(n){return n.promptTokens>0?n.cacheReadTokens/n.promptTokens:0}function Z3(n,a){return a>0?n.fallbacks/a:0}function J3(n,a){return a>0?n.gatewayCacheHits/a:0}function W3(n,a,l){const o=n.totalRequests+1,c=n.successfulRequests+(l.success?1:0),u={cacheReadTokens:a.cacheReadTokens+l.cacheReadTokens,promptTokens:a.promptTokens+zS(l.inputTokens,l.cacheReadTokens,l.providerType),gatewayCacheHits:a.gatewayCacheHits+(l.gatewayCacheHit?1:0),fallbacks:a.fallbacks+(l.attemptsCount>1?1:0)};return{...n,...u,totalRequests:o,successfulRequests:c,failedRequests:n.failedRequests+(l.success?0:1),successRate:c/o,inputTokens:n.inputTokens+l.inputTokens,outputTokens:n.outputTokens+l.outputTokens,totalTokens:n.totalTokens+l.inputTokens+l.outputTokens,cacheHitRate:Q3(u),gatewayCacheHitRate:J3(u,o),fallbackRate:Z3(u,o),averageLatencyMs:(n.averageLatencyMs*n.totalRequests+l.totalLatencyMs)/o}}function e4(n){const[a,l]=m.useState(null),[o,c]=m.useState(null),[u,f]=m.useState([]),[p,g]=m.useState([]),[v,x]=m.useState([]),[y,b]=m.useState([]),[w,E]=m.useState(!0),[j,C]=m.useState(null),R=m.useRef([]),M=m.useRef(null),T=m.useRef(X3),A=m.useRef(new Set),U=m.useRef(Date.now()),D=m.useRef(0),B=m.useRef([]),O=m.useRef([]);return m.useEffect(()=>{let V=!1;return E(!0),C(null),A.current=new Set,U.current=Date.now(),we.get(`/api/admin/stats?preset=${n}`).then(L=>{if(!V){l(L),c(L.summary),M.current=L.summary,T.current={cacheReadTokens:L.summary.cacheReadTokens,promptTokens:L.summary.cacheHitRate!==null&&L.summary.cacheHitRate>0?Math.round(L.summary.cacheReadTokens/L.summary.cacheHitRate):L.summary.inputTokens,gatewayCacheHits:Math.round(L.summary.gatewayCacheHitRate*L.summary.totalRequests),fallbacks:Math.round(L.summary.fallbackRate*L.summary.totalRequests)},f(L.recent),g(L.providers),R.current=L.providers;for(const J of L.recent)A.current.add(J.id);E(!1)}}).catch(L=>{V||(C(L.message),E(!1))}),()=>{V=!0}},[n]),m.useEffect(()=>{let V=!1,L=null;const J=new Set,G=()=>{V||(L=new EventSource(`/api/admin/requests/stream?since=${U.current}`),L.addEventListener("request",ce=>{if(!V)try{const ae=JSON.parse(ce.data),_=new Date(ae.createdAt).getTime();if(Number.isFinite(_)&&(U.current=Math.max(U.current,_)),A.current.has(ae.id))return;A.current.add(ae.id);const H={cacheReadTokens:T.current.cacheReadTokens+ae.cacheReadTokens,promptTokens:T.current.promptTokens+zS(ae.inputTokens,ae.cacheReadTokens,ae.providerType),gatewayCacheHits:T.current.gatewayCacheHits+(ae.gatewayCacheHit?1:0),fallbacks:T.current.fallbacks+(ae.attemptsCount>1?1:0)};if(T.current=H,M.current&&c(W3(M.current,H,ae)),f(X=>X.some(W=>W.id===ae.id)?X:[ae,...X].slice(0,Y3)),ae.providerId){R.current=R.current.map(k=>k.id===ae.providerId?{...k,requests:k.requests+1,errorRate:k.requests+1?(k.errorRate*k.requests+(ae.success?0:1))/(k.requests+1):0}:k),g(R.current);const X=`p${++D.current}`,W={id:X,providerId:ae.providerId,success:ae.success};B.current=[...B.current.slice(-(G3*4)),W],x(B.current);const te=setTimeout(()=>{B.current=B.current.filter(k=>k.id!==X),x(B.current)},$3);J.add(te)}O.current.some(X=>X.id===ae.id)&&(O.current=O.current.filter(X=>X.id!==ae.id),b(O.current))}catch{}}),L.addEventListener("request_started",ce=>{if(!V)try{const ae=JSON.parse(ce.data);if(!ae.providerId||ae.providerId==="")return;O.current=[...O.current.filter(_=>_.id!==ae.requestId).slice(-(F3-1)),{id:ae.requestId,providerId:ae.providerId,startedAt:Date.now(),ttftMs:ae.ttftMs??0}],b(O.current)}catch{}}),L.onerror=()=>{L==null||L.close(),L=null,V||J.add(setTimeout(G,V3))})};G();const oe=setInterval(()=>{const ce=Date.now()-K3;O.current.some(ae=>ae.startedAt<ce)&&(O.current=O.current.filter(ae=>ae.startedAt>=ce),b(O.current))},3e4);return()=>{V=!0,L==null||L.close();for(const ce of J)clearTimeout(ce);J.clear(),clearInterval(oe)}},[]),m.useEffect(()=>{const V=setInterval(()=>{we.get("/api/admin/providers").then(L=>{const J=new Map(L.providers.map(G=>[G.id,G]));R.current=R.current.map(G=>{const oe=J.get(G.id);return oe?{...G,health:oe.health,enabled:oe.enabled}:G}),g(R.current)}).catch(()=>{})},3e4);return()=>clearInterval(V)},[]),{snapshot:a,live:o??(a==null?void 0:a.summary)??t4,recent:u,providers:p,pulses:v,activeRoutes:y,loading:w,error:j}}const t4={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 LS({data:n,className:a,strokeClass:l="stroke-primary",fillClass:o}){if(n.length===0)return s.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,E=22-(y-p)/g*20;return`${w.toFixed(1)},${E.toFixed(1)}`}).join(" ");return s.jsxs("svg",{className:Ce("h-6 w-20",a),viewBox:"0 0 80 24",preserveAspectRatio:"none",children:[o&&s.jsx("polygon",{points:`1,23 ${x} 79,23`,className:o}),s.jsx("polyline",{points:x,fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:l})]})}function n4(n,a,l){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,l(g)),p<1&&requestAnimationFrame(u)};requestAnimationFrame(u)}function a4({delta:n,inverse:a}){if(Math.abs(n)<.005)return null;const l=n>0,o=a?!l:l,c=`${(Math.abs(n)*100).toFixed(1)}%`;return s.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:[s.jsx("span",{className:"mr-0.5",children:l?"▲":"▼"}),c]})}function rl({icon:n,label:a,value:l,format:o="number",delta:c,deltaInverse:u,sparkData:f,sparkStroke:p}){const[g,v]=m.useState(0),x=m.useRef(0);m.useEffect(()=>{const b=x.current,w=l;w!==null&&(x.current=w,b!==w&&n4(Math.abs(w-b),600,E=>v(b+(w>b?E:-E))))},[l]);const y=l===null?"Unavailable":o==="percent"?Ou(g):o==="latency"?zl(g):Zt(Math.round(g));return s.jsxs(at,{children:[s.jsxs(rt,{className:"flex flex-row items-center justify-between pb-1",children:[s.jsxs(lt,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(n,{className:"h-4 w-4"}),a]}),c!==void 0&&s.jsx(a4,{delta:c,inverse:u})]}),s.jsxs(st,{className:"flex items-end justify-between",children:[s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:y}),f&&f.length>1&&s.jsx(LS,{data:f,strokeClass:p??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const US=1e3,Qb=380,Xc=60,ll=US/2,sl=720,qh=62,r4=260;function l4(n){return n==="healthy"?"fill-emerald-400":n==="degraded"?"fill-amber-400":"fill-red-400"}function Qc(n,a,l,o){const c=n+(l-n)*.45,u=n+(l-n)*.55;return`M${n},${a} C${c},${a} ${u},${o} ${l},${o}`}function s4({liveRequests:n,successRate:a,providers:l,pulses:o,activeRoutes:c}){const u=Qb/2,f=u,p=Math.max(1,l.reduce((x,y)=>x+y.requests,0)),g=new Set(c.map(x=>x.providerId)),v=g.size>0;return s.jsxs(at,{children:[s.jsx(rt,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(lt,{className:"text-base",children:"Real-time Request Routing"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-emerald-400"})," healthy"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-400"})," degraded"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-red-400"})," down"]})]})]})}),s.jsx(st,{className:"pt-0",children:s.jsx("div",{className:"relative w-full",children:s.jsxs("svg",{viewBox:`0 0 ${US} ${Qb}`,className:"w-full h-auto",preserveAspectRatio:"xMidYMid meet",children:[s.jsx("defs",{children:s.jsxs("filter",{id:"glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[s.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),s.jsxs("feMerge",{children:[s.jsx("feMergeNode",{in:"blur"}),s.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),l.map(x=>{const b=60+l.indexOf(x)*qh,w=x.requests/p,E=Math.max(1.5,Math.min(6,2+w*8)),j=g.has(x.id);return s.jsxs("g",{children:[j&&s.jsx("path",{d:Qc(ll,u,sl-20,b),fill:"none",stroke:"hsl(var(--primary) / 0.25)",strokeWidth:E+6,strokeLinecap:"round"}),s.jsx("path",{d:Qc(ll,u,sl-20,b),fill:"none",stroke:j?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:j?E+1:E,strokeLinecap:"round",opacity:j?.95:.6,className:j?"route-active":void 0})]},x.id)}),s.jsx("path",{d:Qc(Xc+30,f,ll-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=l.findIndex(j=>j.id===x.providerId);if(y===-1)return null;const b=60+y*qh,w=Qc(ll,u,sl-20,b),E=x.success?"var(--primary)":"#f87171";return s.jsxs("g",{filter:"url(#glow)",children:[s.jsx("circle",{r:5,fill:E,opacity:.9,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})}),s.jsx("circle",{r:9,fill:E,opacity:.25,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})})]},x.id)}),s.jsx("circle",{cx:Xc,cy:f,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),s.jsx("text",{x:Xc,y:f-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:Zb(n)}),s.jsx("text",{x:Xc,y:f+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),s.jsx("circle",{cx:ll,cy:u,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),s.jsx("image",{x:ll-12,y:u-16,width:24,height:24,href:"/logo.png"}),s.jsx("text",{x:ll,y:u+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),s.jsxs("text",{x:ll,y:u+38,textAnchor:"middle",className:"fill-emerald-500",fontSize:10,fontWeight:600,children:[(a*100).toFixed(1),"%"]}),l.map((x,y)=>{const b=60+y*qh,w=x.requests/p,E=!x.enabled||x.requests===0;return s.jsxs("g",{opacity:E?.4:1,children:[s.jsx("rect",{x:sl-20,y:b-14,width:r4,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),s.jsx("circle",{cx:sl-6,cy:b+10,r:4,className:l4(x.health)}),s.jsx("text",{x:sl+6,y:b-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:x.name}),s.jsxs("text",{x:sl+6,y:b+12,className:"fill-muted-foreground",fontSize:10,children:[x.modelCount," model",x.modelCount!==1?"s":""," · ",Zb(x.requests)," req"]}),s.jsxs("text",{x:sl+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&&s.jsxs("tspan",{className:"fill-red-500",children:[" · ",(x.errorRate*100).toFixed(0),"% err"]})]})]},x.id)})]})})})]})}function Zb(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}function o4({rows:n}){return s.jsxs(at,{children:[s.jsx(rt,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Recent Requests"})}),s.jsx(st,{children:n.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No requests yet — traffic will appear here live."}):s.jsxs(pa,{children:[s.jsx(ga,{children:s.jsxs(tt,{children:[s.jsx(xe,{children:"Model"}),s.jsx(xe,{children:"Provider"}),s.jsx(xe,{children:"Tokens"}),s.jsx(xe,{children:"Status"}),s.jsx(xe,{children:"Time"})]})}),s.jsx(va,{children:n.map(a=>s.jsxs(tt,{children:[s.jsx(pe,{className:"font-mono text-xs",children:a.requestedModel}),s.jsx(pe,{className:"text-xs text-muted-foreground",children:a.providerName??"—"}),s.jsxs(pe,{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["in ",Zt(a.inputTokens)," · out ",Zt(a.outputTokens)]}),a.cacheReadTokens>0&&s.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",Zt(a.cacheReadTokens)," cache)"]})]}),s.jsx(pe,{children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:a.success?"h-2 w-2 rounded-full bg-emerald-400":"h-2 w-2 rounded-full bg-red-400"}),s.jsx("span",{className:"text-xs",children:a.success?a.httpStatus:`${a.httpStatus} err`})]})}),s.jsx(pe,{className:"text-xs text-muted-foreground",children:oN(a.createdAt)})]},a.id))})]})})]})}const bm=34,Jb=2*Math.PI*bm;function i4(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 c4({successRate:n,averageLatencyMs:a,latencySpark:l}){const{stroke:o,text:c}=i4(n),u=Math.min(1,Math.max(0,n)),f=Jb*(1-u);return s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs(at,{children:[s.jsx(rt,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Success Rate"})}),s.jsxs(st,{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"relative h-20 w-20",children:[s.jsxs("svg",{viewBox:"0 0 80 80",className:"h-20 w-20 -rotate-90",children:[s.jsx("circle",{cx:"40",cy:"40",r:bm,fill:"none",stroke:"hsl(var(--border))",strokeWidth:7}),s.jsx("circle",{cx:"40",cy:"40",r:bm,fill:"none",stroke:o,strokeWidth:7,strokeLinecap:"round",strokeDasharray:Jb,strokeDashoffset:f,style:{transition:"stroke-dashoffset 0.6s ease, stroke 0.4s ease"}})]}),s.jsx("span",{className:`absolute inset-0 flex items-center justify-center text-sm font-semibold tabular-nums ${c}`,children:Ou(n)})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Share of requests that completed successfully over the selected window. Updated in real time."})]})]}),s.jsxs(at,{children:[s.jsx(rt,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Average Latency"})}),s.jsxs(st,{className:"flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:zl(a)}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Live average across the selected window"})]}),s.jsx(LS,{data:l,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function u4(){const[n,a]=m.useState("7d"),{snapshot:l,live:o,recent:c,providers:u,pulses:f,activeRoutes:p,loading:g,error:v}=e4(n);if(g)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(v||!l)return s.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",v??"unknown error"]});const x=o,y=l.previous,b=l.series;function w(C,R){return R>0?(C-R)/R:void 0}const E=b.map(C=>C.requests),j=b.map(C=>C.avgLatency);return s.jsxs("div",{children:[s.jsx(Ka,{title:"Statistics",description:"Real-time monitoring dashboard",actions:s.jsx(Hp,{value:n,onValueChange:C=>void a(C),children:s.jsxs(ed,{children:[s.jsx(Dn,{value:"today",children:"Today"}),s.jsx(Dn,{value:"7d",children:"7 days"}),s.jsx(Dn,{value:"30d",children:"30 days"})]})})}),!l.percentilesAvailable&&s.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:"Percentiles are unavailable for compacted historical data; cache hit rate is unavailable when provider token semantics were not retained."}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsx(rl,{icon:Hm,label:"Requests",value:x.totalRequests,delta:w(x.totalRequests,y.totalRequests),sparkData:E}),s.jsx(rl,{icon:pi,label:"Success rate",format:"percent",value:x.successRate,delta:w(x.successRate,y.successRate),sparkData:E,sparkStroke:"stroke-emerald-500"}),s.jsx(rl,{icon:cR,label:"Total tokens",value:x.totalTokens,delta:w(x.totalTokens,y.totalTokens),sparkData:b.map(C=>C.inputTokens+C.outputTokens)}),s.jsx(rl,{icon:uR,label:"Cache hit rate",format:"percent",value:x.cacheHitRate,delta:x.cacheHitRate!==null&&y.cacheHitRate!==null?w(x.cacheHitRate,y.cacheHitRate):void 0,sparkData:b.map(C=>C.cacheRead)}),s.jsx(rl,{icon:sR,label:"Avg latency",format:"latency",value:x.averageLatencyMs,delta:w(x.averageLatencyMs,y.averageLatencyMs),deltaInverse:!0,sparkData:j,sparkStroke:"stroke-amber-500"}),s.jsx(rl,{icon:A0,label:"p95 latency",format:"latency",value:x.p95LatencyMs}),s.jsx(rl,{icon:ER,label:"Avg TTFT",format:"latency",value:x.averageTtftMs}),s.jsx(rl,{icon:yR,label:"Fallback rate",format:"percent",value:x.fallbackRate,delta:w(x.fallbackRate,y.fallbackRate),deltaInverse:!0})]}),s.jsx("div",{className:"mt-6",children:s.jsx(s4,{liveRequests:x.totalRequests,successRate:x.successRate,providers:u,pulses:f,activeRoutes:p})}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-3",children:[s.jsx("div",{className:"lg:col-span-2",children:s.jsx(o4,{rows:c})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(at,{children:[s.jsx(rt,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Top Models"})}),s.jsx(st,{children:s.jsxs(pa,{children:[s.jsx(ga,{children:s.jsxs(tt,{children:[s.jsx(xe,{children:"Model"}),s.jsx(xe,{children:"Req"}),s.jsx(xe,{children:"Errors"}),s.jsx(xe,{children:"Tokens"})]})}),s.jsxs(va,{children:[l.topModels.length===0&&s.jsx(tt,{children:s.jsx(pe,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),l.topModels.map(C=>s.jsxs(tt,{children:[s.jsx(pe,{className:"font-mono text-xs",children:C.publicId}),s.jsx(pe,{className:"text-xs",children:Zt(C.requests)}),s.jsx(pe,{className:"text-xs",children:s.jsx("span",{className:C.errorRate>.1?"text-destructive":"text-muted-foreground",children:Ou(C.errorRate)})}),s.jsx(pe,{className:"text-xs",children:Zt(C.totalTokens)})]},C.publicId))]})]})})]}),s.jsxs(at,{children:[s.jsx(rt,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Top API Keys"})}),s.jsx(st,{children:s.jsxs(pa,{children:[s.jsx(ga,{children:s.jsxs(tt,{children:[s.jsx(xe,{children:"Key"}),s.jsx(xe,{children:"Requests"}),s.jsx(xe,{children:"Tokens"})]})}),s.jsxs(va,{children:[l.topApiKeys.length===0&&s.jsx(tt,{children:s.jsx(pe,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),l.topApiKeys.map((C,R)=>s.jsxs(tt,{children:[s.jsx(pe,{className:"text-xs",children:C.name}),s.jsx(pe,{className:"text-xs",children:Zt(C.requests)}),s.jsx(pe,{className:"text-xs",children:Zt(C.totalTokens)})]},R))]})]})})]})]})]}),s.jsx("div",{className:"mt-6",children:s.jsx(c4,{successRate:x.successRate,averageLatencyMs:x.averageLatencyMs,latencySpark:j})})]})}function d4(){const[n,a]=m.useState([]),[l,o]=m.useState(0);return m.useEffect(()=>{we.get("/api/admin/audit?limit=200").then(c=>{a(c.rows),o(c.total)})},[]),s.jsxs("div",{children:[s.jsx(Ka,{title:"Audit Logs",description:`${l} entries · immutable`}),s.jsxs(at,{children:[s.jsx(rt,{children:s.jsx(lt,{className:"text-base",children:"All entries"})}),s.jsx(st,{children:s.jsxs(pa,{children:[s.jsx(ga,{children:s.jsxs(tt,{children:[s.jsx(xe,{children:"Time"}),s.jsx(xe,{children:"Action"}),s.jsx(xe,{children:"Status"}),s.jsx(xe,{children:"Target"}),s.jsx(xe,{children:"IP"}),s.jsx(xe,{children:"Actor"})]})}),s.jsxs(va,{children:[n.length===0&&s.jsx(tt,{children:s.jsx(pe,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),n.map(c=>s.jsxs(tt,{children:[s.jsx(pe,{className:"text-xs",children:Pm(c.createdAt)}),s.jsx(pe,{className:"font-mono text-xs",children:c.action}),s.jsx(pe,{children:c.success?s.jsx(Ze,{variant:"success",children:"ok"}):s.jsx(Ze,{variant:"destructive",children:"fail"})}),s.jsx(pe,{className:"text-xs",children:c.targetName??c.targetId??"—"}),s.jsx(pe,{className:"text-xs",children:c.ip}),s.jsx(pe,{className:"text-xs",children:c.actor})]},c.id))]})]})})]})]})}const wm={enabled:!0,sound:!0};let ui=wm,Sm=!1,Zc=null;const jm=new Set;function BS(){for(const n of jm)n()}function HS(n=!1){return Sm&&!n?Promise.resolve():(!n&&Zc||(Zc=(async()=>{try{const a=await we.get("/api/admin/settings");ui={enabled:a.settings.notificationsEnabled??wm.enabled,sound:a.settings.notificationSoundEnabled??wm.sound},Sm=!0,BS()}catch{}})()),Zc)}async function Wb(n){const a={};n.enabled!==void 0&&(a.notificationsEnabled=n.enabled),n.sound!==void 0&&(a.notificationSoundEnabled=n.sound),await we.patch("/api/admin/settings",a),ui={...ui,...n},Sm=!0,BS()}function f4(n){return jm.add(n),()=>jm.delete(n)}function IS(){return m.useSyncExternalStore(f4,()=>ui,()=>ui)}const Cm=m.forwardRef(({className:n,...a},l)=>s.jsx("textarea",{ref:l,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}));Cm.displayName="Textarea";function h4(){const[n]=VE(),[a,l]=m.useState(null),[o,c]=m.useState(null),[u,f]=m.useState({current:"",next:""}),[p,g]=m.useState(""),[v,x]=m.useState(""),[y,b]=m.useState(null),[w,E]=m.useState(!1),[j,C]=m.useState(null),[R,M]=m.useState(!1),[T,A]=m.useState("idle"),[U,D]=m.useState(null),B=async(se=!1)=>{A("checking"),D(null);try{const Oe=await we.get(`/api/admin/update/check${se?"?force=1":""}`);C(Oe),A("idle")}catch(Oe){D(Oe.message),A("error")}},O=async()=>{M(!0),A("installing"),D(null);try{const se=await we.post("/api/admin/update/run");A("restarting"),ge.success(se.message||"Update started — the gateway will restart shortly.");const Oe=setInterval(()=>{fetch("/health").then(Qe=>{Qe.ok&&(clearInterval(Oe),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(Oe),12e4)}catch(se){ge.error(se.message),D(se.message),A("error")}finally{M(!1)}},[V,L]=m.useState("disabled"),[J,G]=m.useState(""),[oe,ce]=m.useState(""),[ae,_]=m.useState(""),[H,X]=m.useState([]),[W,te]=m.useState(""),[k,P]=m.useState(""),[Z,le]=m.useState(!1),[de,ve]=m.useState(null),[$,ie]=m.useState(""),[he,me]=m.useState(""),[Te,je]=m.useState(""),[De,Xe]=m.useState("compact"),[ze,Je]=m.useState("idle"),[Mt,gt]=m.useState(null),ln=m.useRef(null),[jt,Bt]=m.useState(null),zt=async()=>{const se=await we.get("/api/admin/settings");l(se.settings),g(se.settings.adminIpAllow??""),x(se.settings.adminIpBlock??"");const Oe=await we.get("/api/admin/settings/system");c(Oe),we.get("/api/admin/settings/cleanup/preview").then(Qe=>b(Qe.preview)).catch(()=>b(null));try{const Qe=await we.get("/api/admin/me");L(Qe.totpEnabled?"enabled":"disabled")}catch{}};if(m.useEffect(()=>{HS(!0)},[]),m.useEffect(()=>{zt(),B(!0)},[]),m.useEffect(()=>{we.get("/api/admin/backup/capabilities").then(se=>Bt(se.maxUploadBytes)).catch(()=>Bt(null))},[]),!a)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const yt=async se=>{try{await we.patch("/api/admin/settings",se),ge.success("Saved"),zt()}catch(Oe){ge.error(Oe.message)}},bt=async()=>{try{const se=await we.post("/api/admin/account/totp/begin");G(se.secret),ce(se.qr),L("setup"),ge.info("Scan the QR code with your authenticator app")}catch(se){ge.error(se.message)}},sn=async()=>{if(!ae||ae.length!==6){ge.error("Enter a 6-digit code");return}try{const se=await we.post("/api/admin/account/totp/verify",{code:ae});X(se.recoveryCodes),L("showingRecovery"),ge.success("TOTP enabled successfully")}catch(se){ge.error(se.message)}},At=async()=>{if(!W){ge.error("Enter your password");return}if(!k){ge.error("Enter a TOTP code or recovery code");return}try{await we.post("/api/admin/account/totp/disable",{password:W,totp:k}),L("disabled"),te(""),P(""),ge.success("TOTP disabled"),zt()}catch(se){ge.error(se.message)}},Dt=async()=>{le(!0);try{const se=await we.post("/api/admin/account/totp/recovery/regenerate",{password:W,totp:k});X(se.recoveryCodes),L("showingRecovery"),ge.success("Recovery codes regenerated")}catch(se){ge.error(se.message)}le(!1)},Wt=async()=>{var se,Oe;try{const Qe=await Um("/api/admin/backup/create",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({passphrase:$,profile:De})});if(!Qe.ok)throw new Error(((Oe=(se=await Qe.json().catch(()=>null))==null?void 0:se.error)==null?void 0:Oe.message)??"Backup failed");const ot=await Qe.blob(),xa=URL.createObjectURL(ot),ka=document.createElement("a");ka.href=xa,ka.download=`latedev-backup-${new Date().toISOString().replace(/[:.]/g,"-")}.ldb`,ka.click(),URL.revokeObjectURL(xa),ge.success("Backup downloaded"),ie(""),me("")}catch(Qe){ge.error(Qe.message)}},Hn=async()=>{const se=de;if(!se)return;const Oe=new AbortController;ln.current=Oe,gt({loaded:0,total:se.size,percent:0}),Je("uploading");let Qe;try{const ot=await Mw({file:se,passphrase:Te||void 0,signal:Oe.signal,onProgress:xa=>{gt(xa),xa.percent>=100&&(Je("validating"),Qe=setTimeout(()=>Je("restoring"),1500))}});clearTimeout(Qe),Je("complete"),ge.success(ot.message||"Restored. Reloading…"),ve(null),setTimeout(()=>location.reload(),600)}catch(ot){clearTimeout(Qe),ot.name==="AbortError"?(ge.info("Restore cancelled"),Je("idle")):(ge.error(ot.message),Je("failed"))}finally{ln.current=null}},In=ze==="uploading"||ze==="validating"||ze==="restoring",pn=jt!==null&&de!==null&&de.size>jt,Xa=n.get("tab")||"logging";return s.jsxs("div",{children:[s.jsx(Ka,{title:"Settings",description:"Logging, security, backup, and system info"}),s.jsxs(Hp,{defaultValue:Xa,children:[s.jsxs(ed,{children:[s.jsx(Dn,{value:"logging",children:"Logging"}),s.jsx(Dn,{value:"access",children:"Access Control"}),s.jsx(Dn,{value:"security",children:"Security"}),s.jsx(Dn,{value:"backup",children:"Backup"}),s.jsx(Dn,{value:"system",children:"System"})]}),s.jsx(Ea,{value:"logging",children:s.jsxs(at,{children:[s.jsx(rt,{children:s.jsx(lt,{className:"text-base",children:"Logging policy"})}),s.jsxs(st,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Request-content logging"}),s.jsxs(Ta,{value:a.contentLogMode,onValueChange:se=>yt({contentLogMode:se}),children:[s.jsx(da,{children:s.jsx(Ma,{})}),s.jsxs(fa,{children:[s.jsx(St,{value:"off",children:"Off"}),s.jsx(St,{value:"metadata",children:"Metadata only (default)"}),s.jsx(St,{value:"prompt",children:"Prompt (sanitized)"}),s.jsx(St,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Retention (days)"}),s.jsx(Ae,{type:"number",min:1,max:3650,value:a.retentionDays,onChange:se=>yt({retentionDays:Number(se.target.value)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Database size limit (MB)"}),s.jsx(Ae,{type:"number",min:64,value:a.dbSizeLimitMb,onChange:se=>yt({dbSizeLimitMb:Number(se.target.value)})})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-2",children:[y&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Pending: ",y.deletedRequests," requests / ",y.deletedAttempts," attempts older than ",y.cutoff.slice(0,10)," — daily stats and audit logs are kept."]}),s.jsxs(pu,{children:[s.jsx(Tb,{asChild:!0,children:s.jsx(fe,{variant:"outline",disabled:w,children:"Run cleanup now"})}),s.jsxs(ni,{children:[s.jsxs(gu,{children:[s.jsx(ai,{children:"Delete old request history?"}),s.jsxs(ri,{children:["This removes ",(y==null?void 0:y.deletedRequests)??0," requests and ",(y==null?void 0:y.deletedAttempts)??0," attempts older than ",y==null?void 0:y.cutoff.slice(0,10),". Daily statistics and audit logs are preserved."]})]}),s.jsxs(vu,{children:[s.jsx(si,{children:"Cancel"}),s.jsx(li,{onClick:async()=>{E(!0);try{const se=await we.post("/api/admin/settings/cleanup");ge.success(`Deleted ${se.result.deletedRequests} requests and ${se.result.deletedAttempts} attempts`),zt()}catch(se){ge.error(se.message)}finally{E(!1)}},children:"Delete"})]})]})]})]})]})]})}),s.jsx(Ea,{value:"access",children:s.jsxs(at,{children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"text-base",children:"IP access control"}),s.jsx(xn,{children:"Allowlist / Blocklist for this admin website (not model traffic)"})]}),s.jsxs(st,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Allow only these IPs"}),s.jsx(Cm,{placeholder:`192.168.1.0/24
353
+ 10.0.0.1`,value:p,onChange:se=>g(se.target.value)}),s.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."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Block these IPs"}),s.jsx(Cm,{placeholder:"192.168.1.100",value:v,onChange:se=>x(se.target.value)}),s.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.'})]}),s.jsx(fe,{onClick:()=>{const se={};p!==((a==null?void 0:a.adminIpAllow)??"")&&(se.adminIpAllow=p||null),v!==((a==null?void 0:a.adminIpBlock)??"")&&(se.adminIpBlock=v||null),we.patch("/api/admin/settings",se).then(Oe=>{ge.success("Saved"+(Oe.addedIp?` — added your IP: ${Oe.addedIp}`:"")),zt(),g(""),x("")}).catch(Oe=>ge.error(Oe.message))},children:"Save access control"}),s.jsxs("div",{className:"rounded bg-amber-50 border border-amber-200 p-3 dark:bg-amber-950/20 dark:border-amber-800",children:[s.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."}),s.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."})]})]})]})}),s.jsx(Ea,{value:"security",children:s.jsxs(at,{children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"text-base",children:"Security"}),s.jsx(xn,{children:"Change password, 2FA, and trusted proxy configuration"})]}),s.jsxs(st,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Trusted proxy hops"}),s.jsx(Ae,{type:"number",min:0,max:8,value:a.trustProxyHops,onChange:se=>yt({trustProxyHops:Number(se.target.value)})}),s.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."})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(be,{className:"text-base",children:"TOTP 2FA"}),V==="enabled"?s.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,V==="disabled"?s.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:"Disabled"}):null]}),V==="disabled"&&s.jsx(fe,{variant:"outline",onClick:bt,children:"Enable TOTP"}),V==="setup"&&s.jsxs("div",{className:"space-y-3 rounded border p-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan this QR code with your authenticator app, or enter the secret manually."}),oe&&s.jsx("img",{src:oe,alt:"TOTP QR code",className:"h-40 w-40"}),s.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",J]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(be,{children:"Verify code"}),s.jsx(Ae,{value:ae,onChange:se=>_(se.target.value),placeholder:"123456",maxLength:6})]}),s.jsx(fe,{disabled:ae.length<6,onClick:sn,children:"Verify & enable"})]})]}),V==="showingRecovery"&&s.jsxs("div",{className:"space-y-3 rounded border border-amber-500/40 bg-amber-50 p-3 dark:bg-amber-950/20",children:[s.jsx("p",{className:"text-sm font-medium",children:"Recovery codes — save these now!"}),s.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."}),s.jsx("div",{className:"space-y-1",children:H.map((se,Oe)=>s.jsx("div",{className:"font-mono text-xs",children:se},Oe))}),s.jsx(fe,{onClick:()=>{L("enabled"),ge.success("Recovery codes saved")},children:"I have saved them"})]}),V==="enabled"&&s.jsxs("div",{className:"space-y-3 rounded border p-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Password"}),s.jsx(Ae,{type:"password",value:W,onChange:se=>te(se.target.value),placeholder:"Current password"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TOTP code"}),s.jsx(Ae,{value:k,onChange:se=>P(se.target.value),placeholder:"123456",maxLength:6})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fe,{variant:"outline",size:"sm",disabled:Z||!W||k.length<6,onClick:Dt,children:"Regenerate recovery codes"}),s.jsx(fe,{variant:"destructive",size:"sm",disabled:!W||k.length<6,onClick:At,children:"Disable TOTP"})]})]})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx(be,{children:"Change password"}),s.jsx(Ae,{type:"password",placeholder:"Current password",value:u.current,onChange:se=>f({...u,current:se.target.value})}),s.jsx(Ae,{type:"password",placeholder:"New password (12+ chars)",value:u.next,onChange:se=>f({...u,next:se.target.value})}),s.jsx(fe,{disabled:!u.current||u.next.length<12,onClick:async()=>{try{await we.post("/api/admin/account/password",{currentPassword:u.current,newPassword:u.next}),ge.success("Password changed"),f({current:"",next:""})}catch(se){ge.error(se.message)}},children:"Change password"})]})]})]})}),s.jsx(Ea,{value:"backup",children:s.jsxs(at,{children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"text-base",children:"Backup & restore"}),s.jsx(xn,{children:"Download a snapshot or restore from a previous backup"})]}),s.jsxs(st,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(be,{children:"Backup profile"}),s.jsxs(Ta,{value:De,onValueChange:se=>Xe(se),children:[s.jsx(da,{"data-testid":"backup-profile",children:s.jsx(Ma,{})}),s.jsxs(fa,{children:[s.jsx(St,{value:"compact",children:"Compact (default)"}),s.jsx(St,{value:"full",children:"Full forensic"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:De==="compact"?"Keeps configuration and daily statistics by model, provider, and API key. Excludes requests, attempts, audit logs, and the response cache — much smaller, less sensitive.":"Keeps everything, including requests, attempts, audit logs, and the response cache. May be much larger and contains sensitive request data."}),De==="full"&&s.jsx("p",{className:"rounded bg-amber-50 border border-amber-200 p-2 text-xs text-amber-900 dark:bg-amber-950/20 dark:border-amber-800 dark:text-amber-200",children:"⚠️ Full forensic backups include raw request content and audit logs. Store the file securely."})]}),s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(be,{children:"Backup passphrase (6 digits)"}),s.jsx(Ae,{inputMode:"numeric",maxLength:6,value:$,onChange:se=>ie(se.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.jsx(Ae,{inputMode:"numeric",maxLength:6,value:he,onChange:se=>me(se.target.value.replace(/\D/g,"")),placeholder:"Repeat passphrase"}),s.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."})]}),s.jsx(fe,{disabled:$.length!==6||$!==he,onClick:Wt,children:"Download backup"}),s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(be,{children:"Backup passphrase for restore"}),s.jsx(Ae,{inputMode:"numeric",maxLength:6,value:Te,onChange:se=>je(se.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.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."})]}),s.jsxs(pu,{open:de!==null&&!In,onOpenChange:se=>{se||ve(null)},children:[s.jsx(Tb,{asChild:!0,children:s.jsxs("div",{children:[s.jsx(be,{children:"Restore from backup file"}),s.jsx(Ae,{type:"file",accept:".ldb,.ldb.json,application/octet-stream,application/json","data-testid":"restore-file",disabled:In,onChange:se=>{var Qe;const Oe=(Qe=se.target.files)==null?void 0:Qe[0];ve(Oe??null)}})]})}),s.jsxs(ni,{children:[s.jsxs(gu,{children:[s.jsx(ai,{children:"Restore backup?"}),s.jsxs(ri,{children:["Restoring will replace the entire current database with the selected backup (",(de==null?void 0:de.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),s.jsxs(vu,{children:[s.jsx(si,{children:"Cancel"}),s.jsx(li,{disabled:pn,onClick:Hn,children:"Restore"})]})]})]}),pn&&s.jsxs("p",{"data-testid":"size-warning",className:"rounded bg-amber-50 border border-amber-200 p-2 text-xs text-amber-900 dark:bg-amber-950/20 dark:border-amber-800 dark:text-amber-200",children:["⚠️ This file is ",(((de==null?void 0:de.size)??0)/1048576).toFixed(1)," MiB, over the server limit of ",(jt/1048576).toFixed(0)," MiB. The upload will be rejected — choose a smaller backup."]}),ze!=="idle"&&s.jsxs("div",{className:"space-y-2 rounded border p-3","data-testid":"restore-progress",children:[s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("span",{children:[ze==="uploading"&&"Uploading…",ze==="validating"&&"Validating…",ze==="restoring"&&"Restoring…",ze==="complete"&&"Complete",ze==="failed"&&"Failed"]}),ze==="uploading"&&Mt&&s.jsxs("span",{className:"text-muted-foreground",children:[(Mt.loaded/1048576).toFixed(1)," / ",(Mt.total/1048576).toFixed(1)," MiB · ",Mt.percent,"%"]})]}),s.jsx(Tw,{value:ze==="uploading"?(Mt==null?void 0:Mt.percent)??0:100,className:ze!=="uploading"?"animate-pulse":void 0}),s.jsxs("div",{className:"flex items-center gap-2",children:[ze==="uploading"&&s.jsx(fe,{variant:"outline",size:"sm",onClick:()=>{var se;return(se=ln.current)==null?void 0:se.abort()},children:"Cancel"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Uploads are not resumable — cancelling restarts from the beginning."})]})]})]})]})}),s.jsxs(Ea,{value:"system",children:[s.jsxs(at,{children:[s.jsx(rt,{children:s.jsx(lt,{className:"text-base",children:"System"})}),s.jsxs(st,{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"App version:"})," ",o==null?void 0:o.appVersion]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Data directory:"})," ",s.jsx("span",{className:"font-mono",children:o==null?void 0:o.dataDir})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Encryption:"})," ",o!=null&&o.masterKeyConfigured?"Configured":"Not configured"," (v",o==null?void 0:o.masterKeyVersion,")"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Environment:"})," ",o==null?void 0:o.environment]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(Aa,{checked:a.gatewayCacheEnabled,onCheckedChange:se=>yt({gatewayCacheEnabled:se})}),s.jsx(be,{children:"Gateway response cache (disabled by default)"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Cache TTL (s)"}),s.jsx(Ae,{type:"number",min:1,value:a.gatewayCacheDefaultTtlSeconds,onChange:se=>yt({gatewayCacheDefaultTtlSeconds:Number(se.target.value)})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Cache max size (MB)"}),s.jsx(Ae,{type:"number",min:1,value:a.gatewayCacheMaxSizeMb,onChange:se=>yt({gatewayCacheMaxSizeMb:Number(se.target.value)})})]})]}),s.jsx(fe,{variant:"outline",onClick:async()=>{const se=await we.post("/api/admin/settings/cache/clear");ge.success(`Cleared ${se.deleted} entries`)},children:"Clear gateway cache"})]})]}),s.jsx(m4,{}),s.jsxs(at,{className:"mt-4",children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"text-base",children:"Updates"}),s.jsx(xn,{children:"Automatic updates from the npm registry"})]}),s.jsxs(st,{className:"space-y-3 text-sm",children:[T==="checking"&&!j&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(ks,{className:"h-4 w-4 animate-spin"})," Checking for updates…"]}),j&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Current version"}),s.jsxs("div",{className:"font-mono",children:["v",j.currentVersion]})]}),s.jsx("span",{className:"text-muted-foreground",children:"→"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Latest version"}),s.jsx("div",{className:"font-mono",children:j.latestVersion?`v${j.latestVersion}`:"—"})]}),j.status.docker?s.jsx(Ze,{variant:"secondary",children:j.status.watchtower?"Docker + Watchtower":"Docker"}):j.latestVersion===null?s.jsx(Ze,{variant:"secondary",children:"Registry unreachable"}):j.hasUpdate?s.jsx(Ze,{variant:"success",children:"Update available"}):s.jsxs(Ze,{variant:"outline",children:[s.jsx(pi,{className:"mr-1 h-3 w-3"})," Up to date"]})]}),j.status.docker&&j.status.watchtower&&j.watchtowerReachable&&s.jsx("p",{className:"text-muted-foreground",children:"Watchtower pulls new images automatically every hour — or use Update now for an instant update."}),j.status.docker&&j.status.watchtower&&j.watchtowerReachable===!1&&s.jsxs("p",{className:"text-muted-foreground",children:["The Watchtower sidecar is configured but not running — start it with ",s.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"docker compose --profile updater up -d"}),"."]}),j.status.docker&&!j.status.watchtower&&s.jsx("p",{className:"text-muted-foreground",children:j.status.reason??"This instance runs in Docker — update by pulling the new image tag."}),!j.status.docker&&j.latestVersion===null&&s.jsxs("p",{className:"text-muted-foreground",children:["Could not reach the npm registry (offline or blocked). ",U&&s.jsx("span",{className:"text-destructive",children:U})]}),T==="installing"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(ks,{className:"h-4 w-4 animate-spin"})," Applying the update… this can take a minute."]}),T==="restarting"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(ks,{className:"h-4 w-4 animate-spin"})," Update applied — the gateway is restarting on the new version. This page reloads automatically."]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j.hasUpdate&&T==="idle"&&(!j.status.docker||j.status.watchtower&&j.watchtowerReachable!==!1)&&s.jsxs(fe,{disabled:R||j.status.docker&&j.watchtowerReachable===!1,onClick:O,children:[s.jsx(M0,{className:"mr-1 h-4 w-4"})," Update now"]}),j.hasUpdate&&j.changelogUrl&&s.jsx(fe,{variant:"outline",asChild:!0,children:s.jsx("a",{href:j.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),T==="idle"&&s.jsx(fe,{variant:"ghost",disabled:R,onClick:()=>B(!0),children:"Check again"})]})]})]})]})]})]})]})}function m4(){const n=IS();return s.jsxs(at,{className:"mt-4",children:[s.jsx(rt,{children:s.jsxs(lt,{className:"text-base flex items-center gap-2",children:[s.jsx(tR,{className:"h-4 w-4"})," Notifications"]})}),s.jsxs(st,{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:"Show request notifications"}),s.jsx(Aa,{checked:n.enabled,onCheckedChange:a=>void Wb({enabled:a})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(RR,{className:"h-3 w-3"})," Play notification sound"]}),s.jsx(Aa,{checked:n.sound,onCheckedChange:a=>void Wb({sound:a})})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function p4({items:n,onDismiss:a}){return n.length?s.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(l=>{const o=!l.success,c=l.success&&l.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 s.jsxs(ia,{to:"/requests",className:Ce("block shrink-0 p-3 hover:opacity-95",u),children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[o?s.jsx(lR,{className:"h-4 w-4 shrink-0"}):l.success?s.jsx(pi,{className:"h-4 w-4 shrink-0"}):s.jsx(NR,{className:"h-4 w-4 shrink-0 opacity-70"}),s.jsx("div",{className:"min-w-0 truncate text-sm font-medium",title:l.requestedModel,children:l.requestedModel})]}),s.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100",onClick:f=>{f.preventDefault(),f.stopPropagation(),a(l.id)},"aria-label":"Dismiss",type:"button",children:s.jsx(Du,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"mt-1 text-xs",children:[l.success?"Thành công":"Thất bại",!l.success&&l.errorType&&s.jsx("span",{className:"ml-1 inline-block rounded bg-black/15 px-1 py-0.5 align-text-bottom text-[10px]",children:l.errorType})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:["in ",Zt(l.inputTokens)," · out ",Zt(l.outputTokens),(l.cacheReadTokens>0||l.cacheWriteTokens>0)&&s.jsxs(s.Fragment,{children:[" · cache ",l.cacheReadTokens>0&&s.jsxs("span",{children:["r",Zt(l.cacheReadTokens)]}),l.cacheReadTokens>0&&l.cacheWriteTokens>0&&"/",l.cacheWriteTokens>0&&s.jsxs("span",{children:["w",Zt(l.cacheWriteTokens)]})]})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[zl(l.totalLatencyMs),l.ttftMs!=null&&l.ttftMs>=0&&s.jsxs("span",{children:[" · TTFT ",zl(l.ttftMs)]})]})]},l.id)})}):null}const g4=5e3,v4=8,x4=3e3;let Jc=null;function y4(){try{Jc||(Jc=new Audio("/notification.mp3")),Jc.currentTime=0,Jc.play().catch(()=>{})}catch{}}function b4(){const[n,a]=m.useState([]),l=m.useRef(null),o=m.useRef(new Map),c=m.useRef(Date.now()),u=m.useRef(new Set),f=IS(),p=m.useRef(f.sound);p.current=f.sound,m.useEffect(()=>{HS()},[]);const g=f.enabled;return m.useEffect(()=>{var w;if(!g){(w=l.current)==null||w.close(),l.current=null;const E=o.current;for(const j of E.values())clearTimeout(j);E.clear(),a([]);return}let x=!1;const y=o.current,b=()=>{if(x)return;const E=new EventSource(`/api/admin/requests/stream?since=${c.current}`);l.current=E,E.addEventListener("request",j=>{if(!x)try{const C=JSON.parse(j.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(T=>T.some(A=>A.id===C.id)?T:[C,...T].slice(0,v4));const M=setTimeout(()=>{a(T=>T.filter(A=>A.id!==C.id)),y.delete(C.id)},g4);y.set(C.id,M),p.current&&y4()}catch{}}),E.onerror=()=>{E.close(),l.current=null,x||setTimeout(b,x4)}};return b(),()=>{var E;x=!0,(E=l.current)==null||E.close(),l.current=null;for(const j of y.values())clearTimeout(j);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 w4({children:n}){const{user:a,loading:l}=Bm(),o=Ln();return l?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):a?s.jsx(s.Fragment,{children:n}):s.jsx($h,{to:"/login",state:{from:o},replace:!0})}function S4(){const{items:n,dismiss:a}=b4();return s.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[s.jsx(cN,{}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(uD,{}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsxs(b0,{children:[s.jsx(Mn,{index:!0,element:s.jsx(GD,{})}),s.jsx(Mn,{path:"/providers",element:s.jsx(y_,{})}),s.jsx(Mn,{path:"/models",element:s.jsx(O_,{})}),s.jsx(Mn,{path:"/combos",element:s.jsx(C3,{})}),s.jsx(Mn,{path:"/aliases",element:s.jsx(N3,{})}),s.jsx(Mn,{path:"/api-keys",element:s.jsx(T3,{})}),s.jsx(Mn,{path:"/requests",element:s.jsx(q3,{})}),s.jsx(Mn,{path:"/statistics",element:s.jsx(u4,{})}),s.jsx(Mn,{path:"/audit",element:s.jsx(d4,{})}),s.jsx(Mn,{path:"/settings/*",element:s.jsx(h4,{})})]})})]}),s.jsx(p4,{items:n,onDismiss:a})]})}function j4({children:n}){const[a,l]=m.useState(null),o=Ln();return m.useEffect(()=>{we.get("/api/admin/setup/status").then(c=>l(c.setupComplete)).catch(()=>l(!0))},[]),a===null?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):!a&&o.pathname!=="/setup"?s.jsx($h,{to:"/setup",replace:!0}):a&&o.pathname==="/setup"?s.jsx($h,{to:"/",replace:!0}):s.jsx(s.Fragment,{children:n})}function C4(){return s.jsx(QE,{children:s.jsx(j4,{children:s.jsxs(b0,{children:[s.jsx(Mn,{path:"/setup",element:s.jsx($D,{})}),s.jsx(Mn,{path:"/login",element:s.jsx(PD,{})}),s.jsx(Mn,{path:"/*",element:s.jsx(w4,{children:s.jsx(S4,{})})})]})})})}const E4=ID;var R4=Object.defineProperty,kn=(n,a)=>R4(n,"name",{value:a,configurable:!0}),[Ip,r5]=Un("Tooltip",[Ks]),N4=Ks(),T4="TooltipProvider",M4=700,e0="tooltip.open",[A4,D4]=Ip(T4),O4=kn(n=>{const{__scopeTooltip:a,delayDuration:l=M4,skipDelayDuration:o=300,disableHoverableContent:c=!1,children:u}=n,f=m.useRef(!0),p=m.useRef(!1),g=m.useRef(0);return m.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),s.jsx(A4,{scope:a,isOpenDelayedRef:f,delayDuration:l,onOpen:m.useCallback(()=>{o<=0||(window.clearTimeout(g.current),f.current=!1)},[o]),onClose:m.useCallback(()=>{o<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,o))},[o]),isPointerInTransitRef:p,onPointerInTransitChange:m.useCallback(v=>{p.current=v},[]),disableHoverableContent:c,children:u})},"TooltipProvider"),_4="Tooltip",[l5,Pp]=Ip(_4),k4="TooltipPortal",[s5,z4]=Ip(k4,{forceMount:void 0}),di="TooltipContent",L4=m.forwardRef(kn(function(a,l){const o=z4(di,a.__scopeTooltip),{forceMount:c=o.forceMount,side:u="top",...f}=a,p=Pp(di,a.__scopeTooltip);return s.jsx(Tr,{present:c||p.open,children:p.disableHoverableContent?s.jsx(PS,{side:u,...f,ref:l}):s.jsx(U4,{side:u,...f,ref:l})})},"TooltipContent")),U4=m.forwardRef(kn(function(a,l){const o=Pp(di,a.__scopeTooltip),c=D4(di,a.__scopeTooltip),u=m.useRef(null),f=Ke(l,u),[p,g]=m.useState(null),{trigger:v,onClose:x}=o,y=u.current,{onPointerInTransitChange:b}=c,w=m.useCallback(()=>{g(null),b(!1)},[b]),E=m.useCallback((j,C)=>{const R=j.currentTarget,M={x:j.clientX,y:j.clientY},T=qS(M,R.getBoundingClientRect()),A=VS(M,T),U=$S(C.getBoundingClientRect()),D=GS([...A,...U]);g(D),b(!0)},[b]);return m.useEffect(()=>()=>w(),[w]),m.useEffect(()=>{if(v&&y){const j=kn(R=>E(R,y),"handleTriggerLeave"),C=kn(R=>E(R,v),"handleContentLeave");return v.addEventListener("pointerleave",j),y.addEventListener("pointerleave",C),()=>{v.removeEventListener("pointerleave",j),y.removeEventListener("pointerleave",C)}}},[v,y,E,w]),m.useEffect(()=>{if(p){const j=kn(C=>{const R=C.target,M={x:C.clientX,y:C.clientY},T=(v==null?void 0:v.contains(R))||(y==null?void 0:y.contains(R)),A=!YS(M,p);T?w():A&&(w(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[v,y,p,x,w]),s.jsx(PS,{...a,ref:f})},"TooltipContentHoverable")),B4=G0("TooltipContent"),PS=m.forwardRef(kn(function(a,l){const{__scopeTooltip:o,children:c,"aria-label":u,id:f,onEscapeKeyDown:p,onPointerDownOutside:g,...v}=a,x=Pp(di,o),y=N4(o),{onClose:b}=x;m.useEffect(()=>(document.addEventListener(e0,b),()=>document.removeEventListener(e0,b)),[b]),m.useEffect(()=>{if(x.trigger){const E=kn(j=>{j.target instanceof Node&&j.target.contains(x.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",E,{capture:!0}),()=>window.removeEventListener("scroll",E,{capture:!0})}},[x.trigger,b]);const{setContentId:w}=x;return Jt(()=>(w(f),()=>{w(void 0)}),[f,w]),s.jsx(ku,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:E=>E.preventDefault(),onDismiss:b,children:s.jsxs(tp,{"data-state":x.stateAttribute,role:u?void 0:"tooltip",id:u?void 0:x.contentId,...y,...v,ref:l,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:[s.jsx(B4,{children:c}),u?s.jsx(OO,{id:x.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl"));function qS(n,a){const l=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(l,o,c,u)){case u:return"left";case c:return"right";case l:return"top";case o:return"bottom";default:throw new Error("unreachable")}}kn(qS,"getExitSideFromRect");function VS(n,a,l=5){const o=[];switch(a){case"top":o.push({x:n.x-l,y:n.y+l},{x:n.x+l,y:n.y+l});break;case"bottom":o.push({x:n.x-l,y:n.y-l},{x:n.x+l,y:n.y-l});break;case"left":o.push({x:n.x+l,y:n.y-l},{x:n.x+l,y:n.y+l});break;case"right":o.push({x:n.x-l,y:n.y-l},{x:n.x-l,y:n.y+l});break}return o}kn(VS,"getPaddedExitPoints");function $S(n){const{top:a,right:l,bottom:o,left:c}=n;return[{x:c,y:a},{x:l,y:a},{x:l,y:o},{x:c,y:o}]}kn($S,"getPointsFromRect");function YS(n,a){const{x:l,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&&l<(y-v)*(o-x)/(b-x)+v&&(c=!c)}return c}kn(YS,"isPointInPolygon");function GS(n){const a=n.slice();return a.sort((l,o)=>l.x<o.x?-1:l.x>o.x?1:l.y<o.y?-1:l.y>o.y?1:0),FS(a)}kn(GS,"getHull");function FS(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 l=[];for(let o=n.length-1;o>=0;o--){const c=n[o];for(;l.length>=2;){const u=l[l.length-1],f=l[l.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))l.pop();else break}l.push(c)}return l.pop(),a.length===1&&l.length===1&&a[0].x===l[0].x&&a[0].y===l[0].y?a:a.concat(l)}kn(FS,"getHullPresorted");var H4=O4,KS=L4;const I4=H4,P4=m.forwardRef(({className:n,sideOffset:a=4,...l},o)=>s.jsx(KS,{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),...l}));P4.displayName=KS.displayName;g2.createRoot(document.getElementById("root")).render(s.jsx(ue.StrictMode,{children:s.jsx(xN,{defaultTheme:"dark",storageKey:"latedev-theme",children:s.jsxs(I4,{children:[s.jsx(HE,{children:s.jsx(C4,{})}),s.jsx(E4,{position:"top-right"})]})})}));