ldrouter 1.18.1 → 1.19.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,349 @@
1
+ var Dy=n=>{throw TypeError(n)};var Oy=(n,a,l)=>a.has(n)||Dy("Cannot "+l);var pn=(n,a,l)=>(Oy(n,a,"read from private field"),l?l.call(n):a.get(n)),_y=(n,a,l)=>a.has(n)?Dy("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,l),oh=(n,a,l,s)=>(Oy(n,a,"write to private field"),s?s.call(n,l):a.set(n,l),l);function r2(n,a){for(var l=0;l<a.length;l++){const s=a[l];if(typeof s!="string"&&!Array.isArray(s)){for(const c in s)if(c!=="default"&&!(c in n)){const u=Object.getOwnPropertyDescriptor(s,c);u&&Object.defineProperty(n,c,u.get?u:{enumerable:!0,get:()=>s[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"]'))s(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"&&s(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 s(c){if(c.ep)return;c.ep=!0;const u=l(c);fetch(c.href,u)}})();function wm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ih={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 ky;function l2(){if(ky)return Vo;ky=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(s,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:s,key:f,ref:c!==void 0?c:null,props:u}}return Vo.Fragment=a,Vo.jsx=l,Vo.jsxs=l,Vo}var zy;function s2(){return zy||(zy=1,ih.exports=l2()),ih.exports}var o=s2(),ch={exports:{}},Oe={};/**
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 Ly;function o2(){if(Ly)return Oe;Ly=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function w(z){return z===null||typeof z!="object"?null:(z=b&&z[b]||z["@@iterator"],typeof z=="function"?z:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function R(z,I,X){this.props=z,this.context=I,this.refs=C,this.updater=X||E}R.prototype.isReactComponent={},R.prototype.setState=function(z,I){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,I,"setState")},R.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function M(){}M.prototype=R.prototype;function T(z,I,X){this.props=z,this.context=I,this.refs=C,this.updater=X||E}var D=T.prototype=new M;D.constructor=T,j(D,R.prototype),D.isPureReactComponent=!0;var _=Array.isArray;function A(){}var U={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function q(z,I,X){var re=X.ref;return{$$typeof:n,type:z,key:I,ref:re!==void 0?re:null,props:X}}function K(z,I){return q(z.type,I,z.props)}function te(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function G(z){var I={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(X){return I[X]})}var ie=/\/+/g;function ce(z,I){return typeof z=="object"&&z!==null&&z.key!=null?G(""+z.key):I.toString(36)}function le(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(A,A):(z.status="pending",z.then(function(I){z.status==="pending"&&(z.status="fulfilled",z.value=I)},function(I){z.status==="pending"&&(z.status="rejected",z.reason=I)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function k(z,I,X,re,fe){var ve=typeof z;(ve==="undefined"||ve==="boolean")&&(z=null);var V=!1;if(z===null)V=!0;else switch(ve){case"bigint":case"string":case"number":V=!0;break;case"object":switch(z.$$typeof){case n:case a:V=!0;break;case x:return V=z._init,k(V(z._payload),I,X,re,fe)}}if(V)return fe=fe(z),V=re===""?"."+ce(z,0):re,_(fe)?(X="",V!=null&&(X=V.replace(ie,"$&/")+"/"),k(fe,I,X,"",function(me){return me})):fe!=null&&(te(fe)&&(fe=K(fe,X+(fe.key==null||z&&z.key===fe.key?"":(""+fe.key).replace(ie,"$&/")+"/")+V)),I.push(fe)),1;V=0;var oe=re===""?".":re+":";if(_(z))for(var de=0;de<z.length;de++)re=z[de],ve=oe+ce(re,de),V+=k(re,I,X,ve,fe);else if(de=w(z),typeof de=="function")for(z=de.call(z),de=0;!(re=z.next()).done;)re=re.value,ve=oe+ce(re,de++),V+=k(re,I,X,ve,fe);else if(ve==="object"){if(typeof z.then=="function")return k(le(z),I,X,re,fe);throw I=String(z),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return V}function H(z,I,X){if(z==null)return z;var re=[],fe=0;return k(z,re,"","",function(ve){return I.call(X,ve,fe++)}),re}function Q(z){if(z._status===-1){var I=z._result;I=I(),I.then(function(X){(z._status===0||z._status===-1)&&(z._status=1,z._result=X)},function(X){(z._status===0||z._status===-1)&&(z._status=2,z._result=X)}),z._status===-1&&(z._status=0,z._result=I)}if(z._status===1)return z._result.default;throw z._result}var J=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},ee={map:H,forEach:function(z,I,X){H(z,function(){I.apply(this,arguments)},X)},count:function(z){var I=0;return H(z,function(){I++}),I},toArray:function(z){return H(z,function(I){return I})||[]},only:function(z){if(!te(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Oe.Activity=y,Oe.Children=ee,Oe.Component=R,Oe.Fragment=l,Oe.Profiler=c,Oe.PureComponent=T,Oe.StrictMode=s,Oe.Suspense=g,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(z){return U.H.useMemoCache(z)}},Oe.cache=function(z){return function(){return z.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(z,I,X){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var re=j({},z.props),fe=z.key;if(I!=null)for(ve in I.key!==void 0&&(fe=""+I.key),I)!O.call(I,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&I.ref===void 0||(re[ve]=I[ve]);var ve=arguments.length-2;if(ve===1)re.children=X;else if(1<ve){for(var V=Array(ve),oe=0;oe<ve;oe++)V[oe]=arguments[oe+2];re.children=V}return q(z.type,fe,re)},Oe.createContext=function(z){return z={$$typeof:f,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:u,_context:z},z},Oe.createElement=function(z,I,X){var re,fe={},ve=null;if(I!=null)for(re in I.key!==void 0&&(ve=""+I.key),I)O.call(I,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(fe[re]=I[re]);var V=arguments.length-2;if(V===1)fe.children=X;else if(1<V){for(var oe=Array(V),de=0;de<V;de++)oe[de]=arguments[de+2];fe.children=oe}if(z&&z.defaultProps)for(re in V=z.defaultProps,V)fe[re]===void 0&&(fe[re]=V[re]);return q(z,ve,fe)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(z){return{$$typeof:p,render:z}},Oe.isValidElement=te,Oe.lazy=function(z){return{$$typeof:x,_payload:{_status:-1,_result:z},_init:Q}},Oe.memo=function(z,I){return{$$typeof:v,type:z,compare:I===void 0?null:I}},Oe.startTransition=function(z){var I=U.T,X={};U.T=X;try{var re=z(),fe=U.S;fe!==null&&fe(X,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(A,J)}catch(ve){J(ve)}finally{I!==null&&X.types!==null&&(I.types=X.types),U.T=I}},Oe.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Oe.use=function(z){return U.H.use(z)},Oe.useActionState=function(z,I,X){return U.H.useActionState(z,I,X)},Oe.useCallback=function(z,I){return U.H.useCallback(z,I)},Oe.useContext=function(z){return U.H.useContext(z)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(z,I){return U.H.useDeferredValue(z,I)},Oe.useEffect=function(z,I){return U.H.useEffect(z,I)},Oe.useEffectEvent=function(z){return U.H.useEffectEvent(z)},Oe.useId=function(){return U.H.useId()},Oe.useImperativeHandle=function(z,I,X){return U.H.useImperativeHandle(z,I,X)},Oe.useInsertionEffect=function(z,I){return U.H.useInsertionEffect(z,I)},Oe.useLayoutEffect=function(z,I){return U.H.useLayoutEffect(z,I)},Oe.useMemo=function(z,I){return U.H.useMemo(z,I)},Oe.useOptimistic=function(z,I){return U.H.useOptimistic(z,I)},Oe.useReducer=function(z,I,X){return U.H.useReducer(z,I,X)},Oe.useRef=function(z){return U.H.useRef(z)},Oe.useState=function(z){return U.H.useState(z)},Oe.useSyncExternalStore=function(z,I,X){return U.H.useSyncExternalStore(z,I,X)},Oe.useTransition=function(){return U.H.useTransition()},Oe.version="19.2.8",Oe}var Uy;function Sm(){return Uy||(Uy=1,ch.exports=o2()),ch.exports}var m=Sm();const ue=wm(m),Hs=r2({__proto__:null,default:ue},[m]);var uh={exports:{}},$o={},dh={exports:{}},fh={};/**
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 By;function i2(){return By||(By=1,(function(n){function a(k,H){var Q=k.length;k.push(H);e:for(;0<Q;){var J=Q-1>>>1,ee=k[J];if(0<c(ee,H))k[J]=H,k[Q]=ee,Q=J;else break e}}function l(k){return k.length===0?null:k[0]}function s(k){if(k.length===0)return null;var H=k[0],Q=k.pop();if(Q!==H){k[0]=Q;e:for(var J=0,ee=k.length,z=ee>>>1;J<z;){var I=2*(J+1)-1,X=k[I],re=I+1,fe=k[re];if(0>c(X,Q))re<ee&&0>c(fe,X)?(k[J]=fe,k[re]=Q,J=re):(k[J]=X,k[I]=Q,J=I);else if(re<ee&&0>c(fe,Q))k[J]=fe,k[re]=Q,J=re;else break e}}return H}function c(k,H){var Q=k.sortIndex-H.sortIndex;return Q!==0?Q:k.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 D(k){for(var H=l(v);H!==null;){if(H.callback===null)s(v);else if(H.startTime<=k)s(v),H.sortIndex=H.expirationTime,a(g,H);else break;H=l(v)}}function _(k){if(j=!1,D(k),!E)if(l(g)!==null)E=!0,A||(A=!0,G());else{var H=l(v);H!==null&&le(_,H.startTime-k)}}var A=!1,U=-1,O=5,q=-1;function K(){return C?!0:!(n.unstable_now()-q<O)}function te(){if(C=!1,A){var k=n.unstable_now();q=k;var H=!0;try{e:{E=!1,j&&(j=!1,M(U),U=-1),w=!0;var Q=b;try{t:{for(D(k),y=l(g);y!==null&&!(y.expirationTime>k&&K());){var J=y.callback;if(typeof J=="function"){y.callback=null,b=y.priorityLevel;var ee=J(y.expirationTime<=k);if(k=n.unstable_now(),typeof ee=="function"){y.callback=ee,D(k),H=!0;break t}y===l(g)&&s(g),D(k)}else s(g);y=l(g)}if(y!==null)H=!0;else{var z=l(v);z!==null&&le(_,z.startTime-k),H=!1}}break e}finally{y=null,b=Q,w=!1}H=void 0}}finally{H?G():A=!1}}}var G;if(typeof T=="function")G=function(){T(te)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,ce=ie.port2;ie.port1.onmessage=te,G=function(){ce.postMessage(null)}}else G=function(){R(te,0)};function le(k,H){U=R(function(){k(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(k){k.callback=null},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(k){switch(b){case 1:case 2:case 3:var H=3;break;default:H=b}var Q=b;b=H;try{return k()}finally{b=Q}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(k,H){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var Q=b;b=k;try{return H()}finally{b=Q}},n.unstable_scheduleCallback=function(k,H,Q){var J=n.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?J+Q:J):Q=J,k){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=Q+ee,k={id:x++,callback:H,priorityLevel:k,startTime:Q,expirationTime:ee,sortIndex:-1},Q>J?(k.sortIndex=Q,a(v,k),l(g)===null&&k===l(v)&&(j?(M(U),U=-1):j=!0,le(_,Q-J))):(k.sortIndex=ee,a(g,k),E||w||(E=!0,A||(A=!0,G()))),k},n.unstable_shouldYield=K,n.unstable_wrapCallback=function(k){var H=b;return function(){var Q=b;b=H;try{return k.apply(this,arguments)}finally{b=Q}}}})(fh)),fh}var Hy;function c2(){return Hy||(Hy=1,dh.exports=i2()),dh.exports}var hh={exports:{}},gn={};/**
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 Iy;function u2(){if(Iy)return gn;Iy=1;var n=Sm();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 s={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 gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,gn.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)},gn.flushSync=function(g){var v=f.T,x=s.p;try{if(f.T=null,s.p=2,g)return g()}finally{f.T=v,s.p=x,s.d.f()}},gn.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,s.d.C(g,v))},gn.prefetchDNS=function(g){typeof g=="string"&&s.d.D(g)},gn.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"?s.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:w}):x==="script"&&s.d.X(g,{crossOrigin:y,integrity:b,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},gn.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);s.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&&s.d.M(g)},gn.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);s.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})}},gn.preloadModule=function(g,v){if(typeof g=="string")if(v){var x=p(v.as,v.crossOrigin);s.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 s.d.m(g)},gn.requestFormReset=function(g){s.d.r(g)},gn.unstable_batchedUpdates=function(g,v){return g(v)},gn.useFormState=function(g,v,x){return f.H.useFormState(g,v,x)},gn.useFormStatus=function(){return f.H.useHostTransitionStatus()},gn.version="19.2.8",gn}var Py;function Jb(){if(Py)return hh.exports;Py=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(),hh.exports=u2(),hh.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 qy;function d2(){if(qy)return $o;qy=1;var n=c2(),a=Sm(),l=Jb();function s(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(s(188))}function v(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(s(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(s(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(s(189))}}if(r.alternate!==i)throw Error(s(190))}if(r.tag!==3)throw Error(s(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"),D=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function G(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Symbol.for("react.client.reference");function ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?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 _:return"Suspense";case A:return"SuspenseList";case q: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 D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U: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 le=Array.isArray,k=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,Q={pending:!1,data:null,method:null,action:null},J=[],ee=-1;function z(e){return{current:e}}function I(e){0>ee||(e.current=J[ee],J[ee]=null,ee--)}function X(e,t){ee++,J[ee]=e.current,e.current=t}var re=z(null),fe=z(null),ve=z(null),V=z(null);function oe(e,t){switch(X(ve,t),X(fe,e),X(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ey(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ey(t),e=ty(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}I(re),X(re,e)}function de(){I(re),I(fe),I(ve)}function me(e){e.memoizedState!==null&&X(V,e);var t=re.current,r=ty(t,e.type);t!==r&&(X(fe,e),X(re,r))}function xe(e){fe.current===e&&(I(re),I(fe)),V.current===e&&(I(V),Ho._currentValue=Q)}var we,Me;function Ye(e){if(we===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||"",Me=-1<r.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+we+e+Me}var Qe=!1;function st(e,t){if(!e||Qe)return"";Qe=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(Z){var F=Z}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(Z){F=Z}e.call(ae.prototype)}}else{try{throw Error()}catch(Z){F=Z}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(Z){if(Z&&F&&typeof Z.stack=="string")return[Z.stack,F.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 L=S.split(`
44
+ `),Y=N.split(`
45
+ `);for(d=i=0;i<L.length&&!L[i].includes("DetermineComponentFrameRoot");)i++;for(;d<Y.length&&!Y[d].includes("DetermineComponentFrameRoot");)d++;if(i===L.length||d===Y.length)for(i=L.length-1,d=Y.length-1;1<=i&&0<=d&&L[i]!==Y[d];)d--;for(;1<=i&&0<=d;i--,d--)if(L[i]!==Y[d]){if(i!==1||d!==1)do if(i--,d--,0>d||L[i]!==Y[d]){var W=`
46
+ `+L[i].replace(" at new "," at ");return e.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",e.displayName)),W}while(1<=i&&0<=d);break}}}finally{Qe=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Ye(r):""}function Kt(e,t){switch(e.tag){case 26:case 27:case 5:return Ye(e.type);case 16:return Ye("Lazy");case 13:return e.child!==t&&t!==null?Ye("Suspense Fallback"):Ye("Suspense");case 19:return Ye("SuspenseList");case 0:case 15:return st(e.type,!1);case 11:return st(e.type.render,!1);case 1:return st(e.type,!0);case 31:return Ye("Activity");default:return""}}function ot(e){try{var t="",r=null;do t+=Kt(e,r),r=e,e=e.return;while(e);return t}catch(i){return`
47
+ Error generating stack: `+i.message+`
48
+ `+i.stack}}var Lt=Object.prototype.hasOwnProperty,Ot=n.unstable_scheduleCallback,It=n.unstable_cancelCallback,en=n.unstable_shouldYield,Pt=n.unstable_requestPaint,xt=n.unstable_now,on=n.unstable_getCurrentPriorityLevel,St=n.unstable_ImmediatePriority,jt=n.unstable_UserBlockingPriority,tn=n.unstable_NormalPriority,se=n.unstable_LowPriority,qe=n.unstable_IdlePriority,it=n.log,Cn=n.unstable_setDisableYieldValue,cn=null,yt=null;function vn(e){if(typeof it=="function"&&Cn(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(cn,e)}catch{}}var _t=Math.clz32?Math.clz32:ql,Js=Math.log,Pl=Math.LN2;function ql(e){return e>>>=0,e===0?32:31-(Js(e)/Pl|0)|0}var Ga=256,Tr=262144,Ct=4194304;function lt(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=lt(i):(S&=N,S!==0?d=lt(S):r||(r=N&~e,r!==0&&(d=lt(r))))):(N=i&~h,N!==0?d=lt(N):S!==0?d=lt(S):r||(r=i&~e,r!==0&&(d=lt(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 Re(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ke(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 Le(){var e=Ct;return Ct<<=1,(Ct&62914560)===0&&(Ct=4194304),e}function bt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Mt(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,L=e.expirationTimes,Y=e.hiddenUpdates;for(r=S&~r;0<r;){var W=31-_t(r),ae=1<<W;N[W]=0,L[W]=-1;var F=Y[W];if(F!==null)for(Y[W]=null,W=0;W<F.length;W++){var Z=F[W];Z!==null&&(Z.lane&=-536870913)}r&=~ae}i!==0&&Xt(e,i,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(S&~t))}function Xt(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-_t(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-_t(r),d=1<<i;d&t|e[i]&t&&(e[i]|=t),r&=~d}}function Ut(e,t){var r=t&-t;return r=(r&42)!==0?1:Fa(r),(r&(e.suspendedLanes|t))!==0?0:r}function Fa(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 Ka(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function xa(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Cy(e.type))}function Mr(e,t){var r=H.p;try{return H.p=e,t()}finally{H.p=r}}var Zn=Math.random().toString(36).slice(2),un="__reactFiber$"+Zn,En="__reactProps$"+Zn,Vl="__reactContainer$"+Zn,Zu="__reactEvents$"+Zn,FS="__reactListeners$"+Zn,KS="__reactHandles$"+Zn,Pp="__reactResources$"+Zn,Ws="__reactMarker$"+Zn;function Ju(e){delete e[un],delete e[En],delete e[Zu],delete e[FS],delete e[KS]}function $l(e){var t=e[un];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Vl]||r[un]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=iy(e);e!==null;){if(r=e[un])return r;e=iy(e)}return t}e=r,r=e.parentNode}return null}function Yl(e){if(e=e[un]||e[Vl]){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(s(33))}function Gl(e){var t=e[Pp];return t||(t=e[Pp]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nn(e){e[Ws]=!0}var qp=new Set,Vp={};function fl(e,t){Fl(e,t),Fl(e+"Capture",t)}function Fl(e,t){for(Vp[e]=t,e=0;e<t.length;e++)qp.add(t[e])}var XS=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]*$"),$p={},Yp={};function QS(e){return Lt.call(Yp,e)?!0:Lt.call($p,e)?!1:XS.test(e)?Yp[e]=!0:($p[e]=!0,!1)}function yi(e,t,r){if(QS(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 bi(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function Xa(e,t,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+i)}}function Jn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ZS(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 Wu(e){if(!e._valueTracker){var t=Gp(e)?"checked":"value";e._valueTracker=ZS(e,t,""+e[t])}}function Fp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Gp(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function wi(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 JS=/[\n"\\]/g;function Wn(e){return e.replace(JS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ed(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?td(e,S,Jn(t)):r!=null?td(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 Kp(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)){Wu(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),Wu(e)}function td(e,t,r){t==="number"&&wi(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Kl(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 Xp(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 Qp(e,t,r,i){if(t==null){if(i!=null){if(r!=null)throw Error(s(92));if(le(i)){if(1<i.length)throw Error(s(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),Wu(e)}function Xl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var WS=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 Zp(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||WS.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function Jp(e,t,r){if(t!=null&&typeof t!="object")throw Error(s(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&&Zp(e,d,i)}else for(var h in t)t.hasOwnProperty(h)&&Zp(e,h,t[h])}function nd(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 ej=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"]]),tj=/^[\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 Si(e){return tj.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Qa(){}var ad=null;function rd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ql=null,Zl=null;function Wp(e){var t=Yl(e);if(t&&(e=t.stateNode)){var r=e[En]||null;e:switch(e=t.stateNode,t.type){case"input":if(ed(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[En]||null;if(!d)throw Error(s(90));ed(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&&Fp(i)}break e;case"textarea":Xp(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&Kl(e,!!r.multiple,t,!1)}}}var ld=!1;function eg(e,t,r){if(ld)return e(t,r);ld=!0;try{var i=e(t);return i}finally{if(ld=!1,(Ql!==null||Zl!==null)&&(cc(),Ql&&(t=Ql,e=Zl,Zl=Ql=null,Wp(t),e)))for(t=0;t<e.length;t++)Wp(e[t])}}function to(e,t){var r=e.stateNode;if(r===null)return null;var i=r[En]||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(s(231,t,typeof r));return r}var Za=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sd=!1;if(Za)try{var no={};Object.defineProperty(no,"passive",{get:function(){sd=!0}}),window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{sd=!1}var Ar=null,od=null,ji=null;function tg(){if(ji)return ji;var e,t=od,r=t.length,i,d="value"in Ar?Ar.value:Ar.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 ji=d.slice(e,1<i?1-i:void 0)}function Ci(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 Ei(){return!0}function ng(){return!1}function Rn(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)?Ei:ng,this.isPropagationStopped=ng,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=Ei)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ei)},persist:function(){},isPersistent:Ei}),t}var hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ri=Rn(hl),ao=y({},hl,{view:0,detail:0}),nj=Rn(ao),id,cd,ro,Ni=y({},ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dd,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"?(id=e.screenX-ro.screenX,cd=e.screenY-ro.screenY):cd=id=0,ro=e),id)},movementY:function(e){return"movementY"in e?e.movementY:cd}}),ag=Rn(Ni),aj=y({},Ni,{dataTransfer:0}),rj=Rn(aj),lj=y({},ao,{relatedTarget:0}),ud=Rn(lj),sj=y({},hl,{animationName:0,elapsedTime:0,pseudoElement:0}),oj=Rn(sj),ij=y({},hl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cj=Rn(ij),uj=y({},hl,{data:0}),rg=Rn(uj),dj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fj={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"},hj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hj[e])?!!t[e]:!1}function dd(){return mj}var pj=y({},ao,{key:function(e){if(e.key){var t=dj[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ci(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fj[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dd,charCode:function(e){return e.type==="keypress"?Ci(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ci(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gj=Rn(pj),vj=y({},Ni,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lg=Rn(vj),xj=y({},ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dd}),yj=Rn(xj),bj=y({},hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),wj=Rn(bj),Sj=y({},Ni,{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}),jj=Rn(Sj),Cj=y({},hl,{newState:0,oldState:0}),Ej=Rn(Cj),Rj=[9,13,27,32],fd=Za&&"CompositionEvent"in window,lo=null;Za&&"documentMode"in document&&(lo=document.documentMode);var Nj=Za&&"TextEvent"in window&&!lo,sg=Za&&(!fd||lo&&8<lo&&11>=lo),og=" ",ig=!1;function cg(e,t){switch(e){case"keyup":return Rj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ug(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jl=!1;function Tj(e,t){switch(e){case"compositionend":return ug(t);case"keypress":return t.which!==32?null:(ig=!0,og);case"textInput":return e=t.data,e===og&&ig?null:e;default:return null}}function Mj(e,t){if(Jl)return e==="compositionend"||!fd&&cg(e,t)?(e=tg(),ji=od=Ar=null,Jl=!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 sg&&t.locale!=="ko"?null:t.data;default:return null}}var Aj={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function dg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Aj[e.type]:t==="textarea"}function fg(e,t,r,i){Ql?Zl?Zl.push(i):Zl=[i]:Ql=i,t=gc(t,"onChange"),0<t.length&&(r=new Ri("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var so=null,oo=null;function Dj(e){Kx(e,0)}function Ti(e){var t=eo(e);if(Fp(t))return e}function hg(e,t){if(e==="change")return t}var mg=!1;if(Za){var hd;if(Za){var md="oninput"in document;if(!md){var pg=document.createElement("div");pg.setAttribute("oninput","return;"),md=typeof pg.oninput=="function"}hd=md}else hd=!1;mg=hd&&(!document.documentMode||9<document.documentMode)}function gg(){so&&(so.detachEvent("onpropertychange",vg),oo=so=null)}function vg(e){if(e.propertyName==="value"&&Ti(oo)){var t=[];fg(t,oo,e,rd(e)),eg(Dj,t)}}function Oj(e,t,r){e==="focusin"?(gg(),so=t,oo=r,so.attachEvent("onpropertychange",vg)):e==="focusout"&&gg()}function _j(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ti(oo)}function kj(e,t){if(e==="click")return Ti(t)}function zj(e,t){if(e==="input"||e==="change")return Ti(t)}function Lj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pn=typeof Object.is=="function"?Object.is:Lj;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(!Lt.call(t,d)||!Pn(e[d],t[d]))return!1}return!0}function xg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yg(e,t){var r=xg(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=xg(r)}}function bg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=wi(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=wi(e.document)}return t}function pd(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 Uj=Za&&"documentMode"in document&&11>=document.documentMode,Wl=null,gd=null,co=null,vd=!1;function Sg(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;vd||Wl==null||Wl!==wi(i)||(i=Wl,"selectionStart"in i&&pd(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=gc(gd,"onSelect"),0<i.length&&(t=new Ri("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Wl)))}function ml(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var es={animationend:ml("Animation","AnimationEnd"),animationiteration:ml("Animation","AnimationIteration"),animationstart:ml("Animation","AnimationStart"),transitionrun:ml("Transition","TransitionRun"),transitionstart:ml("Transition","TransitionStart"),transitioncancel:ml("Transition","TransitionCancel"),transitionend:ml("Transition","TransitionEnd")},xd={},jg={};Za&&(jg=document.createElement("div").style,"AnimationEvent"in window||(delete es.animationend.animation,delete es.animationiteration.animation,delete es.animationstart.animation),"TransitionEvent"in window||delete es.transitionend.transition);function pl(e){if(xd[e])return xd[e];if(!es[e])return e;var t=es[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in jg)return xd[e]=t[r];return e}var Cg=pl("animationend"),Eg=pl("animationiteration"),Rg=pl("animationstart"),Bj=pl("transitionrun"),Hj=pl("transitionstart"),Ij=pl("transitioncancel"),Ng=pl("transitionend"),Tg=new Map,yd="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(" ");yd.push("scrollEnd");function ya(e,t){Tg.set(e,t),fl(t,[e])}var Mi=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=[],ts=0,bd=0;function Ai(){for(var e=ts,t=bd=ts=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&&Mg(r,d,h)}}function Di(e,t,r,i){ea[ts++]=e,ea[ts++]=t,ea[ts++]=r,ea[ts++]=i,bd|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function wd(e,t,r,i){return Di(e,t,r,i),Oi(e)}function gl(e,t){return Di(e,null,null,t),Oi(e)}function Mg(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-_t(r),e=h.hiddenUpdates,i=e[d],i===null?e[d]=[t]:i.push(t),t.lane=r|536870912),h):null}function Oi(e){if(50<Oo)throw Oo=0,Df=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ns={};function Pj(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 Pj(e,t,r,i)}function Sd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ja(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 Ag(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 _i(e,t,r,i,d,h){var S=0;if(i=e,typeof e=="function")Sd(e)&&(S=1);else if(typeof e=="string")S=GC(e,r,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case q:return e=qn(31,r,t,d),e.elementType=q,e.lanes=h,e;case j:return vl(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 _:return e=qn(13,r,t,d),e.elementType=_,e.lanes=h,e;case A:return e=qn(19,r,t,d),e.elementType=A,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 D:S=11;break e;case U:S=14;break e;case O:S=16,i=null;break e}S=29,r=Error(s(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 vl(e,t,r,i){return e=qn(7,e,i,t),e.lanes=r,e}function jd(e,t,r){return e=qn(6,e,null,t),e.lanes=r,e}function Dg(e){var t=qn(18,null,null,0);return t.stateNode=e,t}function Cd(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 Og=new WeakMap;function ta(e,t){if(typeof e=="object"&&e!==null){var r=Og.get(e);return r!==void 0?r:(t={value:e,source:t,stack:ot(t)},Og.set(e,t),t)}return{value:e,source:t,stack:ot(t)}}var as=[],rs=0,ki=null,uo=0,na=[],aa=0,Dr=null,Oa=1,_a="";function Wa(e,t){as[rs++]=uo,as[rs++]=ki,ki=e,uo=t}function _g(e,t,r){na[aa++]=Oa,na[aa++]=_a,na[aa++]=Dr,Dr=e;var i=Oa;e=_a;var d=32-_t(i)-1;i&=~(1<<d),r+=1;var h=32-_t(t)+d;if(30<h){var S=d-d%5;h=(i&(1<<S)-1).toString(32),i>>=S,d-=S,Oa=1<<32-_t(t)+d|r<<d|i,_a=h+e}else Oa=1<<h|r<<d|i,_a=e}function Ed(e){e.return!==null&&(Wa(e,1),_g(e,1,0))}function Rd(e){for(;e===ki;)ki=as[--rs],as[rs]=null,uo=as[--rs],as[rs]=null;for(;e===Dr;)Dr=na[--aa],na[aa]=null,_a=na[--aa],na[aa]=null,Oa=na[--aa],na[aa]=null}function kg(e,t){na[aa++]=Oa,na[aa++]=_a,na[aa++]=Dr,Oa=t.id,_a=t.overflow,Dr=e}var dn=null,Rt=null,Ge=!1,Or=null,ra=!1,Nd=Error(s(519));function _r(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fo(ta(t,e)),Nd}function zg(e){var t=e.stateNode,r=e.type,i=e.memoizedProps;switch(t[un]=e,t[En]=i,r){case"dialog":Ie("cancel",t),Ie("close",t);break;case"iframe":case"object":case"embed":Ie("load",t);break;case"video":case"audio":for(r=0;r<ko.length;r++)Ie(ko[r],t);break;case"source":Ie("error",t);break;case"img":case"image":case"link":Ie("error",t),Ie("load",t);break;case"details":Ie("toggle",t);break;case"input":Ie("invalid",t),Kp(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ie("invalid",t);break;case"textarea":Ie("invalid",t),Qp(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||Jx(t.textContent,r)?(i.popover!=null&&(Ie("beforetoggle",t),Ie("toggle",t)),i.onScroll!=null&&Ie("scroll",t),i.onScrollEnd!=null&&Ie("scrollend",t),i.onClick!=null&&(t.onclick=Qa),t=!0):t=!1,t||_r(e,!0)}function Lg(e){for(dn=e.return;dn;)switch(dn.tag){case 5:case 31:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:dn=dn.return}}function ls(e){if(e!==dn)return!1;if(!Ge)return Lg(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")||Gf(e.type,e.memoizedProps)),r=!r),r&&Rt&&_r(e),Lg(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Rt=oy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Rt=oy(e)}else t===27?(t=Rt,Fr(e.type)?(e=Zf,Zf=null,Rt=e):Rt=t):Rt=dn?sa(e.stateNode.nextSibling):null;return!0}function xl(){Rt=dn=null,Ge=!1}function Td(){var e=Or;return e!==null&&(An===null?An=e:An.push.apply(An,e),Or=null),e}function fo(e){Or===null?Or=[e]:Or.push(e)}var Md=z(null),yl=null,er=null;function kr(e,t,r){X(Md,t._currentValue),t._currentValue=r}function tr(e){e._currentValue=Md.current,I(Md)}function Ad(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 Dd(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 L=0;L<t.length;L++)if(N.context===t[L]){h.lanes|=r,N=h.alternate,N!==null&&(N.lanes|=r),Ad(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(s(341));S.lanes|=r,h=S.alternate,h!==null&&(h.lanes|=r),Ad(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 ss(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(s(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===V.current){if(S=d.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Ho):e=[Ho])}d=d.return}e!==null&&Dd(t,e,r,i),t.flags|=262144}function zi(e){for(e=e.firstContext;e!==null;){if(!Pn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bl(e){yl=e,er=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function fn(e){return Ug(yl,e)}function Li(e,t){return yl===null&&bl(e),Ug(e,t)}function Ug(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},er===null){if(e===null)throw Error(s(308));er=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else er=er.next=t;return r}var qj=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()})}},Vj=n.unstable_scheduleCallback,$j=n.unstable_NormalPriority,Vt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Od(){return{controller:new qj,data:new Map,refCount:0}}function ho(e){e.refCount--,e.refCount===0&&Vj($j,function(){e.controller.abort()})}var mo=null,_d=0,os=0,is=null;function Yj(e,t){if(mo===null){var r=mo=[];_d=0,os=Uf(),is={status:"pending",value:void 0,then:function(i){r.push(i)}}}return _d++,t.then(Bg,Bg),t}function Bg(){if(--_d===0&&mo!==null){is!==null&&(is.status="fulfilled");var e=mo;mo=null,os=0,is=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Gj(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 Hg=k.S;k.S=function(e,t){Sx=xt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Yj(e,t),Hg!==null&&Hg(e,t)};var wl=z(null);function kd(){var e=wl.current;return e!==null?e:gt.pooledCache}function Ui(e,t){t===null?X(wl,wl.current):X(wl,t.pool)}function Ig(){var e=kd();return e===null?null:{parent:Vt._currentValue,pool:e}}var cs=Error(s(460)),zd=Error(s(474)),Bi=Error(s(542)),Hi={then:function(){}};function Pg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qg(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(Qa,Qa),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,$g(e),e;default:if(typeof t.status=="string")t.then(Qa,Qa);else{if(e=gt,e!==null&&100<e.shellSuspendCounter)throw Error(s(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,$g(e),e}throw jl=t,cs}}function Sl(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(jl=r,cs):r}}var jl=null;function Vg(){if(jl===null)throw Error(s(459));var e=jl;return jl=null,e}function $g(e){if(e===cs||e===Bi)throw Error(s(483))}var us=null,po=0;function Ii(e){var t=po;return po+=1,us===null&&(us=[]),qg(us,e,t)}function go(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Pi(e,t){throw t.$$typeof===b?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Yg(e){function t(P,B){if(e){var $=P.deletions;$===null?(P.deletions=[B],P.flags|=16):$.push(B)}}function r(P,B){if(!e)return null;for(;B!==null;)t(P,B),B=B.sibling;return null}function i(P){for(var B=new Map;P!==null;)P.key!==null?B.set(P.key,P):B.set(P.index,P),P=P.sibling;return B}function d(P,B){return P=Ja(P,B),P.index=0,P.sibling=null,P}function h(P,B,$){return P.index=$,e?($=P.alternate,$!==null?($=$.index,$<B?(P.flags|=67108866,B):$):(P.flags|=67108866,B)):(P.flags|=1048576,B)}function S(P){return e&&P.alternate===null&&(P.flags|=67108866),P}function N(P,B,$,ne){return B===null||B.tag!==6?(B=jd($,P.mode,ne),B.return=P,B):(B=d(B,$),B.return=P,B)}function L(P,B,$,ne){var Ne=$.type;return Ne===j?W(P,B,$.props.children,ne,$.key):B!==null&&(B.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===O&&Sl(Ne)===B.type)?(B=d(B,$.props),go(B,$),B.return=P,B):(B=_i($.type,$.key,$.props,null,P.mode,ne),go(B,$),B.return=P,B)}function Y(P,B,$,ne){return B===null||B.tag!==4||B.stateNode.containerInfo!==$.containerInfo||B.stateNode.implementation!==$.implementation?(B=Cd($,P.mode,ne),B.return=P,B):(B=d(B,$.children||[]),B.return=P,B)}function W(P,B,$,ne,Ne){return B===null||B.tag!==7?(B=vl($,P.mode,ne,Ne),B.return=P,B):(B=d(B,$),B.return=P,B)}function ae(P,B,$){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=jd(""+B,P.mode,$),B.return=P,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return $=_i(B.type,B.key,B.props,null,P.mode,$),go($,B),$.return=P,$;case E:return B=Cd(B,P.mode,$),B.return=P,B;case O:return B=Sl(B),ae(P,B,$)}if(le(B)||G(B))return B=vl(B,P.mode,$,null),B.return=P,B;if(typeof B.then=="function")return ae(P,Ii(B),$);if(B.$$typeof===T)return ae(P,Li(P,B),$);Pi(P,B)}return null}function F(P,B,$,ne){var Ne=B!==null?B.key:null;if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return Ne!==null?null:N(P,B,""+$,ne);if(typeof $=="object"&&$!==null){switch($.$$typeof){case w:return $.key===Ne?L(P,B,$,ne):null;case E:return $.key===Ne?Y(P,B,$,ne):null;case O:return $=Sl($),F(P,B,$,ne)}if(le($)||G($))return Ne!==null?null:W(P,B,$,ne,null);if(typeof $.then=="function")return F(P,B,Ii($),ne);if($.$$typeof===T)return F(P,B,Li(P,$),ne);Pi(P,$)}return null}function Z(P,B,$,ne,Ne){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return P=P.get($)||null,N(B,P,""+ne,Ne);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:return P=P.get(ne.key===null?$:ne.key)||null,L(B,P,ne,Ne);case E:return P=P.get(ne.key===null?$:ne.key)||null,Y(B,P,ne,Ne);case O:return ne=Sl(ne),Z(P,B,$,ne,Ne)}if(le(ne)||G(ne))return P=P.get($)||null,W(B,P,ne,Ne,null);if(typeof ne.then=="function")return Z(P,B,$,Ii(ne),Ne);if(ne.$$typeof===T)return Z(P,B,$,Li(B,ne),Ne);Pi(B,ne)}return null}function ye(P,B,$,ne){for(var Ne=null,Ze=null,je=B,Ue=B=0,$e=null;je!==null&&Ue<$.length;Ue++){je.index>Ue?($e=je,je=null):$e=je.sibling;var Je=F(P,je,$[Ue],ne);if(Je===null){je===null&&(je=$e);break}e&&je&&Je.alternate===null&&t(P,je),B=h(Je,B,Ue),Ze===null?Ne=Je:Ze.sibling=Je,Ze=Je,je=$e}if(Ue===$.length)return r(P,je),Ge&&Wa(P,Ue),Ne;if(je===null){for(;Ue<$.length;Ue++)je=ae(P,$[Ue],ne),je!==null&&(B=h(je,B,Ue),Ze===null?Ne=je:Ze.sibling=je,Ze=je);return Ge&&Wa(P,Ue),Ne}for(je=i(je);Ue<$.length;Ue++)$e=Z(je,P,Ue,$[Ue],ne),$e!==null&&(e&&$e.alternate!==null&&je.delete($e.key===null?Ue:$e.key),B=h($e,B,Ue),Ze===null?Ne=$e:Ze.sibling=$e,Ze=$e);return e&&je.forEach(function(Jr){return t(P,Jr)}),Ge&&Wa(P,Ue),Ne}function Ae(P,B,$,ne){if($==null)throw Error(s(151));for(var Ne=null,Ze=null,je=B,Ue=B=0,$e=null,Je=$.next();je!==null&&!Je.done;Ue++,Je=$.next()){je.index>Ue?($e=je,je=null):$e=je.sibling;var Jr=F(P,je,Je.value,ne);if(Jr===null){je===null&&(je=$e);break}e&&je&&Jr.alternate===null&&t(P,je),B=h(Jr,B,Ue),Ze===null?Ne=Jr:Ze.sibling=Jr,Ze=Jr,je=$e}if(Je.done)return r(P,je),Ge&&Wa(P,Ue),Ne;if(je===null){for(;!Je.done;Ue++,Je=$.next())Je=ae(P,Je.value,ne),Je!==null&&(B=h(Je,B,Ue),Ze===null?Ne=Je:Ze.sibling=Je,Ze=Je);return Ge&&Wa(P,Ue),Ne}for(je=i(je);!Je.done;Ue++,Je=$.next())Je=Z(je,P,Ue,Je.value,ne),Je!==null&&(e&&Je.alternate!==null&&je.delete(Je.key===null?Ue:Je.key),B=h(Je,B,Ue),Ze===null?Ne=Je:Ze.sibling=Je,Ze=Je);return e&&je.forEach(function(a2){return t(P,a2)}),Ge&&Wa(P,Ue),Ne}function mt(P,B,$,ne){if(typeof $=="object"&&$!==null&&$.type===j&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case w:e:{for(var Ne=$.key;B!==null;){if(B.key===Ne){if(Ne=$.type,Ne===j){if(B.tag===7){r(P,B.sibling),ne=d(B,$.props.children),ne.return=P,P=ne;break e}}else if(B.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===O&&Sl(Ne)===B.type){r(P,B.sibling),ne=d(B,$.props),go(ne,$),ne.return=P,P=ne;break e}r(P,B);break}else t(P,B);B=B.sibling}$.type===j?(ne=vl($.props.children,P.mode,ne,$.key),ne.return=P,P=ne):(ne=_i($.type,$.key,$.props,null,P.mode,ne),go(ne,$),ne.return=P,P=ne)}return S(P);case E:e:{for(Ne=$.key;B!==null;){if(B.key===Ne)if(B.tag===4&&B.stateNode.containerInfo===$.containerInfo&&B.stateNode.implementation===$.implementation){r(P,B.sibling),ne=d(B,$.children||[]),ne.return=P,P=ne;break e}else{r(P,B);break}else t(P,B);B=B.sibling}ne=Cd($,P.mode,ne),ne.return=P,P=ne}return S(P);case O:return $=Sl($),mt(P,B,$,ne)}if(le($))return ye(P,B,$,ne);if(G($)){if(Ne=G($),typeof Ne!="function")throw Error(s(150));return $=Ne.call($),Ae(P,B,$,ne)}if(typeof $.then=="function")return mt(P,B,Ii($),ne);if($.$$typeof===T)return mt(P,B,Li(P,$),ne);Pi(P,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,B!==null&&B.tag===6?(r(P,B.sibling),ne=d(B,$),ne.return=P,P=ne):(r(P,B),ne=jd($,P.mode,ne),ne.return=P,P=ne),S(P)):r(P,B)}return function(P,B,$,ne){try{po=0;var Ne=mt(P,B,$,ne);return us=null,Ne}catch(je){if(je===cs||je===Bi)throw je;var Ze=qn(29,je,null,P.mode);return Ze.lanes=ne,Ze.return=P,Ze}finally{}}}var Cl=Yg(!0),Gg=Yg(!1),zr=!1;function Ld(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ud(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 Lr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ur(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(et&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,t=Oi(e),Mg(e,null,r),t}return Di(e,i,t,r),Oi(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 Bd(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 Hd=!1;function xo(){if(Hd){var e=is;if(e!==null)throw e}}function yo(e,t,r,i){Hd=!1;var d=e.updateQueue;zr=!1;var h=d.firstBaseUpdate,S=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var L=N,Y=L.next;L.next=null,S===null?h=Y:S.next=Y,S=L;var W=e.alternate;W!==null&&(W=W.updateQueue,N=W.lastBaseUpdate,N!==S&&(N===null?W.firstBaseUpdate=Y:N.next=Y,W.lastBaseUpdate=L))}if(h!==null){var ae=d.baseState;S=0,W=Y=L=null,N=h;do{var F=N.lane&-536870913,Z=F!==N.lane;if(Z?(Ve&F)===F:(i&F)===F){F!==0&&F===os&&(Hd=!0),W!==null&&(W=W.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ye=e,Ae=N;F=t;var mt=r;switch(Ae.tag){case 1:if(ye=Ae.payload,typeof ye=="function"){ae=ye.call(mt,ae,F);break e}ae=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ae.payload,F=typeof ye=="function"?ye.call(mt,ae,F):ye,F==null)break e;ae=y({},ae,F);break e;case 2:zr=!0}}F=N.callback,F!==null&&(e.flags|=64,Z&&(e.flags|=8192),Z=d.callbacks,Z===null?d.callbacks=[F]:Z.push(F))}else Z={lane:F,tag:N.tag,payload:N.payload,callback:N.callback,next:null},W===null?(Y=W=Z,L=ae):W=W.next=Z,S|=F;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;Z=N,N=Z.next,Z.next=null,d.lastBaseUpdate=Z,d.shared.pending=null}}while(!0);W===null&&(L=ae),d.baseState=L,d.firstBaseUpdate=Y,d.lastBaseUpdate=W,h===null&&(d.shared.lanes=0),qr|=S,e.lanes=S,e.memoizedState=ae}}function Fg(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function Kg(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Fg(r[e],t)}var ds=z(null),qi=z(0);function Xg(e,t){e=ur,X(qi,e),X(ds,t),ur=e|t.baseLanes}function Id(){X(qi,ur),X(ds,ds.current)}function Pd(){ur=qi.current,I(ds),I(qi)}var Vn=z(null),la=null;function Br(e){var t=e.alternate;X(Bt,Bt.current&1),X(Vn,e),la===null&&(t===null||ds.current!==null||t.memoizedState!==null)&&(la=e)}function qd(e){X(Bt,Bt.current),X(Vn,e),la===null&&(la=e)}function Qg(e){e.tag===22?(X(Bt,Bt.current),X(Vn,e),la===null&&(la=e)):Hr()}function Hr(){X(Bt,Bt.current),X(Vn,Vn.current)}function $n(e){I(Vn),la===e&&(la=null),I(Bt)}var Bt=z(0);function Vi(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Xf(r)||Qf(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 nr=0,ze=null,ft=null,$t=null,$i=!1,fs=!1,El=!1,Yi=0,bo=0,hs=null,Fj=0;function kt(){throw Error(s(321))}function Vd(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 $d(e,t,r,i,d,h){return nr=h,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?_v:lf,El=!1,h=r(i,d),El=!1,fs&&(h=Jg(t,r,i,d)),Zg(e),h}function Zg(e){k.H=jo;var t=ft!==null&&ft.next!==null;if(nr=0,$t=ft=ze=null,$i=!1,bo=0,hs=null,t)throw Error(s(300));e===null||Yt||(e=e.dependencies,e!==null&&zi(e)&&(Yt=!0))}function Jg(e,t,r,i){ze=e;var d=0;do{if(fs&&(hs=null),bo=0,fs=!1,25<=d)throw Error(s(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)}k.H=kv,h=t(r,i)}while(fs);return h}function Kj(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?wo(t):t,e=e.useState()[0],(ft!==null?ft.memoizedState:null)!==e&&(ze.flags|=1024),t}function Yd(){var e=Yi!==0;return Yi=0,e}function Gd(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function Fd(e){if($i){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}$i=!1}nr=0,$t=ft=ze=null,fs=!1,bo=Yi=0,hs=null}function xn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?ze.memoizedState=$t=e:$t=$t.next=e,$t}function Ht(){if(ft===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var t=$t===null?ze.memoizedState:$t.next;if(t!==null)$t=t,ft=e;else{if(e===null)throw ze.alternate===null?Error(s(467)):Error(s(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},$t===null?ze.memoizedState=$t=e:$t=$t.next=e}return $t}function Gi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wo(e){var t=bo;return bo+=1,hs===null&&(hs=[]),e=qg(hs,e,t),t=ze,($t===null?t.memoizedState:$t.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?_v:lf),e}function Fi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wo(e);if(e.$$typeof===T)return fn(e)}throw Error(s(438,String(e)))}function Kd(e){var t=null,r=ze.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=Gi(),ze.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),i=0;i<e;i++)r[i]=K;return t.index++,r}function ar(e,t){return typeof t=="function"?t(e):t}function Ki(e){var t=Ht();return Xd(t,ft,e)}function Xd(e,t,r){var i=e.queue;if(i===null)throw Error(s(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,L=null,Y=t,W=!1;do{var ae=Y.lane&-536870913;if(ae!==Y.lane?(Ve&ae)===ae:(nr&ae)===ae){var F=Y.revertLane;if(F===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),ae===os&&(W=!0);else if((nr&F)===F){Y=Y.next,F===os&&(W=!0);continue}else ae={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},L===null?(N=L=ae,S=h):L=L.next=ae,ze.lanes|=F,qr|=F;ae=Y.action,El&&r(h,ae),h=Y.hasEagerState?Y.eagerState:r(h,ae)}else F={lane:ae,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},L===null?(N=L=F,S=h):L=L.next=F,ze.lanes|=ae,qr|=ae;Y=Y.next}while(Y!==null&&Y!==t);if(L===null?S=h:L.next=N,!Pn(h,e.memoizedState)&&(Yt=!0,W&&(r=is,r!==null)))throw r;e.memoizedState=h,e.baseState=S,e.baseQueue=L,i.lastRenderedState=h}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Qd(e){var t=Ht(),r=t.queue;if(r===null)throw Error(s(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 Wg(e,t,r){var i=ze,d=Ht(),h=Ge;if(h){if(r===void 0)throw Error(s(407));r=r()}else r=t();var S=!Pn((ft||d).memoizedState,r);if(S&&(d.memoizedState=r,Yt=!0),d=d.queue,Wd(nv.bind(null,i,d,e),[e]),d.getSnapshot!==t||S||$t!==null&&$t.memoizedState.tag&1){if(i.flags|=2048,ms(9,{destroy:void 0},tv.bind(null,i,d,r,t),null),gt===null)throw Error(s(349));h||(nr&127)!==0||ev(i,t,r)}return r}function ev(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ze.updateQueue,t===null?(t=Gi(),ze.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function tv(e,t,r,i){t.value=r,t.getSnapshot=i,av(t)&&rv(e)}function nv(e,t,r){return r(function(){av(t)&&rv(e)})}function av(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Pn(e,r)}catch{return!0}}function rv(e){var t=gl(e,2);t!==null&&Dn(t,e,2)}function Zd(e){var t=xn();if(typeof e=="function"){var r=e;if(e=r(),El){vn(!0);try{r()}finally{vn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ar,lastRenderedState:e},t}function lv(e,t,r,i){return e.baseState=r,Xd(e,ft,typeof i=="function"?i:ar)}function Xj(e,t,r,i,d){if(Zi(e))throw Error(s(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)}};k.T!==null?r(!0):h.isTransition=!1,i(h),r=t.pending,r===null?(h.next=t.pending=h,sv(t,h)):(h.next=r.next,t.pending=r.next=h)}}function sv(e,t){var r=t.action,i=t.payload,d=e.state;if(t.isTransition){var h=k.T,S={};k.T=S;try{var N=r(d,i),L=k.S;L!==null&&L(S,N),ov(e,t,N)}catch(Y){Jd(e,t,Y)}finally{h!==null&&S.types!==null&&(h.types=S.types),k.T=h}}else try{h=r(d,i),ov(e,t,h)}catch(Y){Jd(e,t,Y)}}function ov(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){iv(e,t,i)},function(i){return Jd(e,t,i)}):iv(e,t,r)}function iv(e,t,r){t.status="fulfilled",t.value=r,cv(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,sv(e,r)))}function Jd(e,t,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=r,cv(t),t=t.next;while(t!==i)}e.action=null}function cv(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function uv(e,t){return t}function dv(e,t){if(Ge){var r=gt.formState;if(r!==null){e:{var i=ze;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}}_r(i)}i=!1}i&&(t=r[0])}}return r=xn(),r.memoizedState=r.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:uv,lastRenderedState:t},r.queue=i,r=Av.bind(null,ze,i),i.dispatch=r,i=Zd(!1),h=rf.bind(null,ze,!1,i.queue),i=xn(),d={state:t,dispatch:null,action:e,pending:null},i.queue=d,r=Xj.bind(null,ze,d,h,r),d.dispatch=r,i.memoizedState=e,[t,r,!1]}function fv(e){var t=Ht();return hv(t,ft,e)}function hv(e,t,r){if(t=Xd(e,t,uv)[0],e=Ki(ar)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=wo(t)}catch(S){throw S===cs?Bi:S}else i=t;t=Ht();var d=t.queue,h=d.dispatch;return r!==t.memoizedState&&(ze.flags|=2048,ms(9,{destroy:void 0},Qj.bind(null,d,r),null)),[i,h,e]}function Qj(e,t){e.action=t}function mv(e){var t=Ht(),r=ft;if(r!==null)return hv(t,r,e);Ht(),t=t.memoizedState,r=Ht();var i=r.queue.dispatch;return r.memoizedState=e,[t,i,!1]}function ms(e,t,r,i){return e={tag:e,create:r,deps:i,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Gi(),ze.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e),e}function pv(){return Ht().memoizedState}function Xi(e,t,r,i){var d=xn();ze.flags|=e,d.memoizedState=ms(1|t,{destroy:void 0},r,i===void 0?null:i)}function Qi(e,t,r,i){var d=Ht();i=i===void 0?null:i;var h=d.memoizedState.inst;ft!==null&&i!==null&&Vd(i,ft.memoizedState.deps)?d.memoizedState=ms(t,h,r,i):(ze.flags|=e,d.memoizedState=ms(1|t,h,r,i))}function gv(e,t){Xi(8390656,8,e,t)}function Wd(e,t){Qi(2048,8,e,t)}function Zj(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=Gi(),ze.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function vv(e){var t=Ht().memoizedState;return Zj({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function xv(e,t){return Qi(4,2,e,t)}function yv(e,t){return Qi(4,4,e,t)}function bv(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function wv(e,t,r){r=r!=null?r.concat([e]):null,Qi(4,4,bv.bind(null,t,e),r)}function ef(){}function Sv(e,t){var r=Ht();t=t===void 0?null:t;var i=r.memoizedState;return t!==null&&Vd(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function jv(e,t){var r=Ht();t=t===void 0?null:t;var i=r.memoizedState;if(t!==null&&Vd(t,i[1]))return i[0];if(i=e(),El){vn(!0);try{e()}finally{vn(!1)}}return r.memoizedState=[i,t],i}function tf(e,t,r){return r===void 0||(nr&1073741824)!==0&&(Ve&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=Cx(),ze.lanes|=e,qr|=e,r)}function Cv(e,t,r,i){return Pn(r,t)?r:ds.current!==null?(e=tf(e,r,i),Pn(e,t)||(Yt=!0),e):(nr&42)===0||(nr&1073741824)!==0&&(Ve&261930)===0?(Yt=!0,e.memoizedState=r):(e=Cx(),ze.lanes|=e,qr|=e,t)}function Ev(e,t,r,i,d){var h=H.p;H.p=h!==0&&8>h?h:8;var S=k.T,N={};k.T=N,rf(e,!1,t,r);try{var L=d(),Y=k.S;if(Y!==null&&Y(N,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var W=Gj(L,i);So(e,t,W,Fn(e))}else So(e,t,i,Fn(e))}catch(ae){So(e,t,{then:function(){},status:"rejected",reason:ae},Fn())}finally{H.p=h,S!==null&&N.types!==null&&(S.types=N.types),k.T=S}}function Jj(){}function nf(e,t,r,i){if(e.tag!==5)throw Error(s(476));var d=Rv(e).queue;Ev(e,d,t,Q,r===null?Jj:function(){return Nv(e),r(i)})}function Rv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ar,lastRenderedState:Q},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ar,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Nv(e){var t=Rv(e);t.next===null&&(t=e.alternate.memoizedState),So(e,t.next.queue,{},Fn())}function af(){return fn(Ho)}function Tv(){return Ht().memoizedState}function Mv(){return Ht().memoizedState}function Wj(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=Fn();e=Lr(r);var i=Ur(t,e,r);i!==null&&(Dn(i,t,r),vo(i,t,r)),t={cache:Od()},e.payload=t;return}t=t.return}}function eC(e,t,r){var i=Fn();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Zi(e)?Dv(t,r):(r=wd(e,t,r,i),r!==null&&(Dn(r,e,i),Ov(r,t,i)))}function Av(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(Zi(e))Dv(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 Di(e,t,d,0),gt===null&&Ai(),!1}catch{}finally{}if(r=wd(e,t,d,i),r!==null)return Dn(r,e,i),Ov(r,t,i),!0}return!1}function rf(e,t,r,i){if(i={lane:2,revertLane:Uf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Zi(e)){if(t)throw Error(s(479))}else t=wd(e,r,i,2),t!==null&&Dn(t,e,2)}function Zi(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Dv(e,t){fs=$i=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Ov(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:fn,use:Fi,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useLayoutEffect:kt,useInsertionEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useSyncExternalStore:kt,useId:kt,useHostTransitionStatus:kt,useFormState:kt,useActionState:kt,useOptimistic:kt,useMemoCache:kt,useCacheRefresh:kt};jo.useEffectEvent=kt;var _v={readContext:fn,use:Fi,useCallback:function(e,t){return xn().memoizedState=[e,t===void 0?null:t],e},useContext:fn,useEffect:gv,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,Xi(4194308,4,bv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Xi(4194308,4,e,t)},useInsertionEffect:function(e,t){Xi(4,2,e,t)},useMemo:function(e,t){var r=xn();t=t===void 0?null:t;var i=e();if(El){vn(!0);try{e()}finally{vn(!1)}}return r.memoizedState=[i,t],i},useReducer:function(e,t,r){var i=xn();if(r!==void 0){var d=r(t);if(El){vn(!0);try{r(t)}finally{vn(!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=eC.bind(null,ze,e),[i.memoizedState,e]},useRef:function(e){var t=xn();return e={current:e},t.memoizedState=e},useState:function(e){e=Zd(e);var t=e.queue,r=Av.bind(null,ze,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:ef,useDeferredValue:function(e,t){var r=xn();return tf(r,e,t)},useTransition:function(){var e=Zd(!1);return e=Ev.bind(null,ze,e.queue,!0,!1),xn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var i=ze,d=xn();if(Ge){if(r===void 0)throw Error(s(407));r=r()}else{if(r=t(),gt===null)throw Error(s(349));(Ve&127)!==0||ev(i,t,r)}d.memoizedState=r;var h={value:r,getSnapshot:t};return d.queue=h,gv(nv.bind(null,i,h,e),[e]),i.flags|=2048,ms(9,{destroy:void 0},tv.bind(null,i,h,r,t),null),r},useId:function(){var e=xn(),t=gt.identifierPrefix;if(Ge){var r=_a,i=Oa;r=(i&~(1<<32-_t(i)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Yi++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=Fj++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:af,useFormState:dv,useActionState:dv,useOptimistic:function(e){var t=xn();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=rf.bind(null,ze,!0,r),r.dispatch=t,[e,t]},useMemoCache:Kd,useCacheRefresh:function(){return xn().memoizedState=Wj.bind(null,ze)},useEffectEvent:function(e){var t=xn(),r={impl:e};return t.memoizedState=r,function(){if((et&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},lf={readContext:fn,use:Fi,useCallback:Sv,useContext:fn,useEffect:Wd,useImperativeHandle:wv,useInsertionEffect:xv,useLayoutEffect:yv,useMemo:jv,useReducer:Ki,useRef:pv,useState:function(){return Ki(ar)},useDebugValue:ef,useDeferredValue:function(e,t){var r=Ht();return Cv(r,ft.memoizedState,e,t)},useTransition:function(){var e=Ki(ar)[0],t=Ht().memoizedState;return[typeof e=="boolean"?e:wo(e),t]},useSyncExternalStore:Wg,useId:Tv,useHostTransitionStatus:af,useFormState:fv,useActionState:fv,useOptimistic:function(e,t){var r=Ht();return lv(r,ft,e,t)},useMemoCache:Kd,useCacheRefresh:Mv};lf.useEffectEvent=vv;var kv={readContext:fn,use:Fi,useCallback:Sv,useContext:fn,useEffect:Wd,useImperativeHandle:wv,useInsertionEffect:xv,useLayoutEffect:yv,useMemo:jv,useReducer:Qd,useRef:pv,useState:function(){return Qd(ar)},useDebugValue:ef,useDeferredValue:function(e,t){var r=Ht();return ft===null?tf(r,e,t):Cv(r,ft.memoizedState,e,t)},useTransition:function(){var e=Qd(ar)[0],t=Ht().memoizedState;return[typeof e=="boolean"?e:wo(e),t]},useSyncExternalStore:Wg,useId:Tv,useHostTransitionStatus:af,useFormState:mv,useActionState:mv,useOptimistic:function(e,t){var r=Ht();return ft!==null?lv(r,ft,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Kd,useCacheRefresh:Mv};kv.useEffectEvent=vv;function sf(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 of={enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Fn(),d=Lr(i);d.payload=t,r!=null&&(d.callback=r),t=Ur(e,d,i),t!==null&&(Dn(t,e,i),vo(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Fn(),d=Lr(i);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=Ur(e,d,i),t!==null&&(Dn(t,e,i),vo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Fn(),i=Lr(r);i.tag=2,t!=null&&(i.callback=t),t=Ur(e,i,r),t!==null&&(Dn(t,e,r),vo(t,e,r))}};function zv(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 Lv(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&&of.enqueueReplaceState(t,t.state,null)}function Rl(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 Uv(e){Mi(e)}function Bv(e){console.error(e)}function Hv(e){Mi(e)}function Ji(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Iv(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 cf(e,t,r){return r=Lr(r),r.tag=3,r.payload={element:null},r.callback=function(){Ji(e,t)},r}function Pv(e){return e=Lr(e),e.tag=3,e}function qv(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(){Iv(t,r,i)}}var S=r.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){Iv(t,r,i),typeof d!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var N=i.stack;this.componentDidCatch(i.value,{componentStack:N!==null?N:""})})}function tC(e,t,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=r.alternate,t!==null&&ss(t,r,d,!0),r=Vn.current,r!==null){switch(r.tag){case 31:case 13:return la===null?uc():r.alternate===null&&zt===0&&(zt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===Hi?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([i]):t.add(i),kf(e,i,d)),!1;case 22:return r.flags|=65536,i===Hi?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)),kf(e,i,d)),!1}throw Error(s(435,r.tag))}return kf(e,i,d),uc(),!1}if(Ge)return t=Vn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,i!==Nd&&(e=Error(s(422),{cause:i}),fo(ta(e,r)))):(i!==Nd&&(t=Error(s(423),{cause:i}),fo(ta(t,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=ta(i,r),d=cf(e.stateNode,i,d),Bd(e,d),zt!==4&&(zt=2)),!1;var h=Error(s(520),{cause:i});if(h=ta(h,r),Do===null?Do=[h]:Do.push(h),zt!==4&&(zt=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=cf(r.stateNode,i,e),Bd(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"&&(Vr===null||!Vr.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=Pv(d),qv(d,e,r,i),Bd(r,d),!1}r=r.return}while(r!==null);return!1}var uf=Error(s(461)),Yt=!1;function hn(e,t,r,i){t.child=e===null?Gg(t,null,r,i):Cl(t,e.child,r,i)}function Vv(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 bl(t),i=$d(e,t,r,S,h,d),N=Yd(),e!==null&&!Yt?(Gd(e,t,d),rr(e,t,d)):(Ge&&N&&Ed(t),t.flags|=1,hn(e,t,i,d),t.child)}function $v(e,t,r,i,d){if(e===null){var h=r.type;return typeof h=="function"&&!Sd(h)&&h.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=h,Yv(e,t,h,i,d)):(e=_i(r.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!xf(e,d)){var S=h.memoizedProps;if(r=r.compare,r=r!==null?r:io,r(S,i)&&e.ref===t.ref)return rr(e,t,d)}return t.flags|=1,e=Ja(h,i),e.ref=t.ref,e.return=t,t.child=e}function Yv(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,xf(e,d))(e.flags&131072)!==0&&(Yt=!0);else return t.lanes=e.lanes,rr(e,t,d)}return df(e,t,r,i,d)}function Gv(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 Fv(e,t,h,r,i)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ui(t,h!==null?h.cachePool:null),h!==null?Xg(t,h):Id(),Qg(t);else return i=t.lanes=536870912,Fv(e,t,h!==null?h.baseLanes|r:r,r,i)}else h!==null?(Ui(t,h.cachePool),Xg(t,h),Hr(),t.memoizedState=null):(e!==null&&Ui(t,null),Id(),Hr());return hn(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 Fv(e,t,r,i,d){var h=kd();return h=h===null?null:{parent:Vt._currentValue,pool:h},t.memoizedState={baseLanes:r,cachePool:h},e!==null&&Ui(t,null),Id(),Qg(t),e!==null&&ss(e,t,i,!0),t.childLanes=d,null}function Wi(e,t){return t=tc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Kv(e,t,r){return Cl(t,e.child,null,r),e=Wi(t,t.pendingProps),e.flags|=2,$n(t),t.memoizedState=null,e}function nC(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=Wi(t,i),t.lanes=536870912,Co(null,e);if(qd(t),(e=Rt)?(e=sy(e,ra),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dr!==null?{id:Oa,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},r=Dg(e),r.return=t,t.child=r,dn=t,Rt=null)):e=null,e===null)throw _r(t);return t.lanes=536870912,null}return Wi(t,i)}var h=e.memoizedState;if(h!==null){var S=h.dehydrated;if(qd(t),d)if(t.flags&256)t.flags&=-257,t=Kv(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(Yt||ss(e,t,r,!1),d=(r&e.childLanes)!==0,Yt||d){if(i=gt,i!==null&&(S=Ut(i,r),S!==0&&S!==h.retryLane))throw h.retryLane=S,gl(e,S),Dn(i,e,S),uf;uc(),t=Kv(e,t,r)}else e=h.treeContext,Rt=sa(S.nextSibling),dn=t,Ge=!0,Or=null,ra=!1,e!==null&&kg(t,e),t=Wi(t,i),t.flags|=4096;return t}return e=Ja(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ec(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(s(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function df(e,t,r,i,d){return bl(t),r=$d(e,t,r,i,void 0,d),i=Yd(),e!==null&&!Yt?(Gd(e,t,d),rr(e,t,d)):(Ge&&i&&Ed(t),t.flags|=1,hn(e,t,r,d),t.child)}function Xv(e,t,r,i,d,h){return bl(t),t.updateQueue=null,r=Jg(t,i,r,d),Zg(e),i=Yd(),e!==null&&!Yt?(Gd(e,t,h),rr(e,t,h)):(Ge&&i&&Ed(t),t.flags|=1,hn(e,t,r,h),t.child)}function Qv(e,t,r,i,d){if(bl(t),t.stateNode===null){var h=ns,S=r.contextType;typeof S=="object"&&S!==null&&(h=fn(S)),h=new r(i,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=of,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=i,h.state=t.memoizedState,h.refs={},Ld(t),S=r.contextType,h.context=typeof S=="object"&&S!==null?fn(S):ns,h.state=t.memoizedState,S=r.getDerivedStateFromProps,typeof S=="function"&&(sf(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&&of.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,L=Rl(r,N);h.props=L;var Y=h.context,W=r.contextType;S=ns,typeof W=="object"&&W!==null&&(S=fn(W));var ae=r.getDerivedStateFromProps;W=typeof ae=="function"||typeof h.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,W||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(N||Y!==S)&&Lv(t,h,i,S),zr=!1;var F=t.memoizedState;h.state=F,yo(t,i,h,d),xo(),Y=t.memoizedState,N||F!==Y||zr?(typeof ae=="function"&&(sf(t,r,ae,i),Y=t.memoizedState),(L=zr||zv(t,r,L,i,F,Y,S))?(W||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=Y),h.props=i,h.state=Y,h.context=S,i=L):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{h=t.stateNode,Ud(e,t),S=t.memoizedProps,W=Rl(r,S),h.props=W,ae=t.pendingProps,F=h.context,Y=r.contextType,L=ns,typeof Y=="object"&&Y!==null&&(L=fn(Y)),N=r.getDerivedStateFromProps,(Y=typeof N=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S!==ae||F!==L)&&Lv(t,h,i,L),zr=!1,F=t.memoizedState,h.state=F,yo(t,i,h,d),xo();var Z=t.memoizedState;S!==ae||F!==Z||zr||e!==null&&e.dependencies!==null&&zi(e.dependencies)?(typeof N=="function"&&(sf(t,r,N,i),Z=t.memoizedState),(W=zr||zv(t,r,W,i,F,Z,L)||e!==null&&e.dependencies!==null&&zi(e.dependencies))?(Y||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(i,Z,L),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(i,Z,L)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=Z),h.props=i,h.state=Z,h.context=L,i=W):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),i=!1)}return h=i,ec(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=Cl(t,e.child,null,d),t.child=Cl(t,null,r,d)):hn(e,t,r,d),t.memoizedState=h.state,e=t.child):e=rr(e,t,d),e}function Zv(e,t,r,i){return xl(),t.flags|=256,hn(e,t,r,i),t.child}var ff={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hf(e){return{baseLanes:e,cachePool:Ig()}}function mf(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=Gn),e}function Jv(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:(Bt.current&2)!==0),S&&(d=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(d?Br(t):Hr(),(e=Rt)?(e=sy(e,ra),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dr!==null?{id:Oa,overflow:_a}:null,retryLane:536870912,hydrationErrors:null},r=Dg(e),r.return=t,t.child=r,dn=t,Rt=null)):e=null,e===null)throw _r(t);return Qf(e)?t.lanes=32:t.lanes=536870912,null}var N=i.children;return i=i.fallback,d?(Hr(),d=t.mode,N=tc({mode:"hidden",children:N},d),i=vl(i,d,r,null),N.return=t,i.return=t,N.sibling=i,t.child=N,i=t.child,i.memoizedState=hf(r),i.childLanes=mf(e,S,r),t.memoizedState=ff,Co(null,i)):(Br(t),pf(t,N))}var L=e.memoizedState;if(L!==null&&(N=L.dehydrated,N!==null)){if(h)t.flags&256?(Br(t),t.flags&=-257,t=gf(e,t,r)):t.memoizedState!==null?(Hr(),t.child=e.child,t.flags|=128,t=null):(Hr(),N=i.fallback,d=t.mode,i=tc({mode:"visible",children:i.children},d),N=vl(N,d,r,null),N.flags|=2,i.return=t,N.return=t,i.sibling=N,t.child=i,Cl(t,e.child,null,r),i=t.child,i.memoizedState=hf(r),i.childLanes=mf(e,S,r),t.memoizedState=ff,t=Co(null,i));else if(Br(t),Qf(N)){if(S=N.nextSibling&&N.nextSibling.dataset,S)var Y=S.dgst;S=Y,i=Error(s(419)),i.stack="",i.digest=S,fo({value:i,source:null,stack:null}),t=gf(e,t,r)}else if(Yt||ss(e,t,r,!1),S=(r&e.childLanes)!==0,Yt||S){if(S=gt,S!==null&&(i=Ut(S,r),i!==0&&i!==L.retryLane))throw L.retryLane=i,gl(e,i),Dn(S,e,i),uf;Xf(N)||uc(),t=gf(e,t,r)}else Xf(N)?(t.flags|=192,t.child=e.child,t=null):(e=L.treeContext,Rt=sa(N.nextSibling),dn=t,Ge=!0,Or=null,ra=!1,e!==null&&kg(t,e),t=pf(t,i.children),t.flags|=4096);return t}return d?(Hr(),N=i.fallback,d=t.mode,L=e.child,Y=L.sibling,i=Ja(L,{mode:"hidden",children:i.children}),i.subtreeFlags=L.subtreeFlags&65011712,Y!==null?N=Ja(Y,N):(N=vl(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=hf(r):(d=N.cachePool,d!==null?(L=Vt._currentValue,d=d.parent!==L?{parent:L,pool:L}:d):d=Ig(),N={baseLanes:N.baseLanes|r,cachePool:d}),i.memoizedState=N,i.childLanes=mf(e,S,r),t.memoizedState=ff,Co(e.child,i)):(Br(t),r=e.child,e=r.sibling,r=Ja(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 pf(e,t){return t=tc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function tc(e,t){return e=qn(22,e,null,t),e.lanes=0,e}function gf(e,t,r){return Cl(t,e.child,null,r),e=pf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wv(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Ad(e.return,t,r)}function vf(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 ex(e,t,r){var i=t.pendingProps,d=i.revealOrder,h=i.tail;i=i.children;var S=Bt.current,N=(S&2)!==0;if(N?(S=S&1|2,t.flags|=128):S&=1,X(Bt,S),hn(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&&Wv(e,r,t);else if(e.tag===19)Wv(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&&Vi(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=t.child,t.child=null):(d=r.sibling,r.sibling=null),vf(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&&Vi(e)===null){t.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}vf(t,!0,r,null,h,i);break;case"together":vf(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function rr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),qr|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(ss(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,r=Ja(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Ja(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function xf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&zi(e)))}function aC(e,t,r){switch(t.tag){case 3:oe(t,t.stateNode.containerInfo),kr(t,Vt,e.memoizedState.cache),xl();break;case 27:case 5:me(t);break;case 4:oe(t,t.stateNode.containerInfo);break;case 10:kr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,qd(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Br(t),t.flags|=128,null):(r&t.child.childLanes)!==0?Jv(e,t,r):(Br(t),e=rr(e,t,r),e!==null?e.sibling:null);Br(t);break;case 19:var d=(e.flags&128)!==0;if(i=(r&t.childLanes)!==0,i||(ss(e,t,r,!1),i=(r&t.childLanes)!==0),d){if(i)return ex(e,t,r);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),X(Bt,Bt.current),i)break;return null;case 22:return t.lanes=0,Gv(e,t,r,t.pendingProps);case 24:kr(t,Vt,e.memoizedState.cache)}return rr(e,t,r)}function tx(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Yt=!0;else{if(!xf(e,r)&&(t.flags&128)===0)return Yt=!1,aC(e,t,r);Yt=(e.flags&131072)!==0}else Yt=!1,Ge&&(t.flags&1048576)!==0&&_g(t,uo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Sl(t.elementType),t.type=e,typeof e=="function")Sd(e)?(i=Rl(e,i),t.tag=1,t=Qv(null,t,e,i,r)):(t.tag=0,t=df(null,t,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===D){t.tag=11,t=Vv(null,t,e,i,r);break e}else if(d===U){t.tag=14,t=$v(null,t,e,i,r);break e}}throw t=ce(e)||e,Error(s(306,t,""))}}return t;case 0:return df(e,t,t.type,t.pendingProps,r);case 1:return i=t.type,d=Rl(i,t.pendingProps),Qv(e,t,i,d,r);case 3:e:{if(oe(t,t.stateNode.containerInfo),e===null)throw Error(s(387));i=t.pendingProps;var h=t.memoizedState;d=h.element,Ud(e,t),yo(t,i,null,r);var S=t.memoizedState;if(i=S.cache,kr(t,Vt,i),i!==h.cache&&Dd(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=Zv(e,t,i,r);break e}else if(i!==d){d=ta(Error(s(424)),t),fo(d),t=Zv(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),dn=t,Ge=!0,Or=null,ra=!0,r=Gg(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(xl(),i===d){t=rr(e,t,r);break e}hn(e,t,i,r)}t=t.child}return t;case 26:return ec(e,t),e===null?(r=fy(t.type,null,t.pendingProps,null))?t.memoizedState=r:Ge||(r=t.type,e=t.pendingProps,i=vc(ve.current).createElement(r),i[un]=t,i[En]=e,mn(i,r,e),nn(i),t.stateNode=i):t.memoizedState=fy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return me(t),e===null&&Ge&&(i=t.stateNode=cy(t.type,t.pendingProps,ve.current),dn=t,ra=!0,d=Rt,Fr(t.type)?(Zf=d,Rt=sa(i.firstChild)):Rt=d),hn(e,t,t.pendingProps.children,r),ec(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((d=i=Rt)&&(i=_C(i,t.type,t.pendingProps,ra),i!==null?(t.stateNode=i,dn=t,Rt=sa(i.firstChild),ra=!1,d=!0):d=!1),d||_r(t)),me(t),d=t.type,h=t.pendingProps,S=e!==null?e.memoizedProps:null,i=h.children,Gf(d,h)?i=null:S!==null&&Gf(d,S)&&(t.flags|=32),t.memoizedState!==null&&(d=$d(e,t,Kj,null,null,r),Ho._currentValue=d),ec(e,t),hn(e,t,i,r),t.child;case 6:return e===null&&Ge&&((e=r=Rt)&&(r=kC(r,t.pendingProps,ra),r!==null?(t.stateNode=r,dn=t,Rt=null,e=!0):e=!1),e||_r(t)),null;case 13:return Jv(e,t,r);case 4:return oe(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Cl(t,null,i,r):hn(e,t,i,r),t.child;case 11:return Vv(e,t,t.type,t.pendingProps,r);case 7:return hn(e,t,t.pendingProps,r),t.child;case 8:return hn(e,t,t.pendingProps.children,r),t.child;case 12:return hn(e,t,t.pendingProps.children,r),t.child;case 10:return i=t.pendingProps,kr(t,t.type,i.value),hn(e,t,i.children,r),t.child;case 9:return d=t.type._context,i=t.pendingProps.children,bl(t),d=fn(d),i=i(d),t.flags|=1,hn(e,t,i,r),t.child;case 14:return $v(e,t,t.type,t.pendingProps,r);case 15:return Yv(e,t,t.type,t.pendingProps,r);case 19:return ex(e,t,r);case 31:return nC(e,t,r);case 22:return Gv(e,t,r,t.pendingProps);case 24:return bl(t),i=fn(Vt),e===null?(d=kd(),d===null&&(d=gt,h=Od(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),t.memoizedState={parent:i,cache:d},Ld(t),kr(t,Vt,d)):((e.lanes&r)!==0&&(Ud(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),kr(t,Vt,i)):(i=h.cache,kr(t,Vt,i),i!==d.cache&&Dd(t,[Vt],r,!0))),hn(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function lr(e){e.flags|=4}function yf(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(Tx())e.flags|=8192;else throw jl=Hi,zd}else e.flags&=-16777217}function nx(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!vy(t))if(Tx())e.flags|=8192;else throw jl=Hi,zd}function nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Le():536870912,e.lanes|=t,xs|=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 rC(e,t,r){var i=t.pendingProps;switch(Rd(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),tr(Vt),de(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ls(t)?lr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Td())),Nt(t),null;case 26:var d=t.type,h=t.memoizedState;return e===null?(lr(t),h!==null?(Nt(t),nx(t,h)):(Nt(t),yf(t,d,null,i,r))):h?h!==e.memoizedState?(lr(t),Nt(t),nx(t,h)):(Nt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&lr(t),Nt(t),yf(t,d,e,i,r)),null;case 27:if(xe(t),r=ve.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&lr(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Nt(t),null}e=re.current,ls(t)?zg(t):(e=cy(d,i,r),t.stateNode=e,lr(t))}return Nt(t),null;case 5:if(xe(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&lr(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Nt(t),null}if(h=re.current,ls(t))zg(t);else{var S=vc(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[un]=t,h[En]=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(mn(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&&lr(t)}}return Nt(t),yf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&lr(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(e=ve.current,ls(t)){if(e=t.stateNode,r=t.memoizedProps,i=null,d=dn,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[un]=t,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||Jx(e.nodeValue,r)),e||_r(t,!0)}else e=vc(e).createTextNode(i),e[un]=t,t.stateNode=e}return Nt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(i=ls(t),r!==null){if(e===null){if(!i)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[un]=t}else xl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Nt(t),e=!1}else r=Td(),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(s(558))}return Nt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=ls(t),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(s(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[un]=t}else xl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Nt(t),d=!1}else d=Td(),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),nc(t,t.updateQueue),Nt(t),null);case 4:return de(),e===null&&Pf(t.stateNode.containerInfo),Nt(t),null;case 10:return tr(t.type),Nt(t),null;case 19:if(I(Bt),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(zt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Vi(e),h!==null){for(t.flags|=128,Eo(i,!1),e=h.updateQueue,t.updateQueue=e,nc(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Ag(r,e),r=r.sibling;return X(Bt,Bt.current&1|2),Ge&&Wa(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&xt()>oc&&(t.flags|=128,d=!0,Eo(i,!1),t.lanes=4194304)}else{if(!d)if(e=Vi(h),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,nc(t,e),Eo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!h.alternate&&!Ge)return Nt(t),null}else 2*xt()-i.renderingStartTime>oc&&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=xt(),e.sibling=null,r=Bt.current,X(Bt,d?r&1|2:r&1),Ge&&Wa(t,i.treeForkCount),e):(Nt(t),null);case 22:case 23:return $n(t),Pd(),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&&nc(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&&I(wl),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),tr(Vt),Nt(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function lC(e,t){switch(Rd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return tr(Vt),de(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if($n(t),t.alternate===null)throw Error(s(340));xl()}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(s(340));xl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(Bt),null;case 4:return de(),null;case 10:return tr(t.type),null;case 22:case 23:return $n(t),Pd(),e!==null&&I(wl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return tr(Vt),null;case 25:return null;default:return null}}function ax(e,t){switch(Rd(t),t.tag){case 3:tr(Vt),de();break;case 26:case 27:case 5:xe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&$n(t);break;case 13:$n(t);break;case 19:I(Bt);break;case 10:tr(t.type);break;case 22:case 23:$n(t),Pd(),e!==null&&I(wl);break;case 24:tr(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 Ir(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 L=r,Y=N;try{Y()}catch(W){ut(d,L,W)}}}i=i.next}while(i!==h)}}catch(W){ut(t,t.return,W)}}function rx(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{Kg(t,r)}catch(i){ut(e,e.return,i)}}}function lx(e,t,r){r.props=Rl(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 ka(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 sx(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 bf(e,t,r){try{var i=e.stateNode;NC(i,e.type,r,t),i[En]=t}catch(d){ut(e,e.return,d)}}function ox(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Fr(e.type)||e.tag===4}function wf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ox(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&&Fr(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 Sf(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=Qa));else if(i!==4&&(i===27&&Fr(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(Sf(e,t,r),e=e.sibling;e!==null;)Sf(e,t,r),e=e.sibling}function ac(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&&Fr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(ac(e,t,r),e=e.sibling;e!==null;)ac(e,t,r),e=e.sibling}function ix(e){var t=e.stateNode,r=e.memoizedProps;try{for(var i=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);mn(t,i,r),t[un]=e,t[En]=r}catch(h){ut(e,e.return,h)}}var sr=!1,Gt=!1,jf=!1,cx=typeof WeakSet=="function"?WeakSet:Set,an=null;function sC(e,t){if(e=e.containerInfo,$f=Cc,e=wg(e),pd(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,L=-1,Y=0,W=0,ae=e,F=null;t:for(;;){for(var Z;ae!==r||d!==0&&ae.nodeType!==3||(N=S+d),ae!==h||i!==0&&ae.nodeType!==3||(L=S+i),ae.nodeType===3&&(S+=ae.nodeValue.length),(Z=ae.firstChild)!==null;)F=ae,ae=Z;for(;;){if(ae===e)break t;if(F===r&&++Y===d&&(N=S),F===h&&++W===i&&(L=S),(Z=ae.nextSibling)!==null)break;ae=F,F=ae.parentNode}ae=Z}r=N===-1||L===-1?null:{start:N,end:L}}else r=null}r=r||{start:0,end:0}}else r=null;for(Yf={focusedElem:e,selectionRange:r},Cc=!1,an=t;an!==null;)if(t=an,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,an=e;else for(;an!==null;){switch(t=an,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=Rl(r.type,d);e=i.getSnapshotBeforeUpdate(ye,h),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ae){ut(r,r.return,Ae)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)Kf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Kf(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(s(163))}if(e=t.sibling,e!==null){e.return=t.return,an=e;break}an=t.return}}function ux(e,t,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:ir(e,r),i&4&&Ro(5,r);break;case 1:if(ir(e,r),i&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(S){ut(r,r.return,S)}else{var d=Rl(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(S){ut(r,r.return,S)}}i&64&&rx(r),i&512&&No(r,r.return);break;case 3:if(ir(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{Kg(e,t)}catch(S){ut(r,r.return,S)}}break;case 27:t===null&&i&4&&ix(r);case 26:case 5:ir(e,r),t===null&&i&4&&sx(r),i&512&&No(r,r.return);break;case 12:ir(e,r);break;case 31:ir(e,r),i&4&&hx(e,r);break;case 13:ir(e,r),i&4&&mx(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=pC.bind(null,r),zC(e,r))));break;case 22:if(i=r.memoizedState!==null||sr,!i){t=t!==null&&t.memoizedState!==null||Gt,d=sr;var h=Gt;sr=i,(Gt=t)&&!h?cr(e,r,(r.subtreeFlags&8772)!==0):ir(e,r),sr=d,Gt=h}break;case 30:break;default:ir(e,r)}}function dx(e){var t=e.alternate;t!==null&&(e.alternate=null,dx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ju(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 At=null,Nn=!1;function or(e,t,r){for(r=r.child;r!==null;)fx(e,t,r),r=r.sibling}function fx(e,t,r){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(cn,r)}catch{}switch(r.tag){case 26:Gt||ka(r,t),or(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Gt||ka(r,t);var i=At,d=Nn;Fr(r.type)&&(At=r.stateNode,Nn=!1),or(e,t,r),Lo(r.stateNode),At=i,Nn=d;break;case 5:Gt||ka(r,t);case 6:if(i=At,d=Nn,At=null,or(e,t,r),At=i,Nn=d,At!==null)if(Nn)try{(At.nodeType===9?At.body:At.nodeName==="HTML"?At.ownerDocument.body:At).removeChild(r.stateNode)}catch(h){ut(r,t,h)}else try{At.removeChild(r.stateNode)}catch(h){ut(r,t,h)}break;case 18:At!==null&&(Nn?(e=At,ry(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Rs(e)):ry(At,r.stateNode));break;case 4:i=At,d=Nn,At=r.stateNode.containerInfo,Nn=!0,or(e,t,r),At=i,Nn=d;break;case 0:case 11:case 14:case 15:Ir(2,r,t),Gt||Ir(4,r,t),or(e,t,r);break;case 1:Gt||(ka(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"&&lx(r,t,i)),or(e,t,r);break;case 21:or(e,t,r);break;case 22:Gt=(i=Gt)||r.memoizedState!==null,or(e,t,r),Gt=i;break;default:or(e,t,r)}}function hx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rs(e)}catch(r){ut(t,t.return,r)}}}function mx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rs(e)}catch(r){ut(t,t.return,r)}}function oC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cx),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cx),t;default:throw Error(s(435,e.tag))}}function rc(e,t){var r=oC(e);t.forEach(function(i){if(!r.has(i)){r.add(i);var d=gC.bind(null,e,i);i.then(d,d)}})}function Tn(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(Fr(N.type)){At=N.stateNode,Nn=!1;break e}break;case 5:At=N.stateNode,Nn=!1;break e;case 3:case 4:At=N.stateNode.containerInfo,Nn=!0;break e}N=N.return}if(At===null)throw Error(s(160));fx(h,S,d),At=null,Nn=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)px(t,e),t=t.sibling}var ba=null;function px(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Tn(t,e),Mn(e),i&4&&(Ir(3,e,e.return),Ro(3,e),Ir(5,e,e.return));break;case 1:Tn(t,e),Mn(e),i&512&&(Gt||r===null||ka(r,r.return)),i&64&&sr&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?i:r.concat(i))));break;case 26:var d=ba;if(Tn(t,e),Mn(e),i&512&&(Gt||r===null||ka(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[un]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(i),d.head.insertBefore(h,d.querySelector("head > title"))),mn(h,i,r),h[un]=e,nn(h),i=h;break e;case"link":var S=py("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),mn(h,i,r),d.head.appendChild(h);break;case"meta":if(S=py("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),mn(h,i,r),d.head.appendChild(h);break;default:throw Error(s(468,i))}h[un]=e,nn(h),i=h}e.stateNode=i}else gy(d,e.type,e.stateNode);else e.stateNode=my(d,i,e.memoizedProps);else h!==i?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,i===null?gy(d,e.type,e.stateNode):my(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&bf(e,e.memoizedProps,r.memoizedProps)}break;case 27:Tn(t,e),Mn(e),i&512&&(Gt||r===null||ka(r,r.return)),r!==null&&i&4&&bf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Tn(t,e),Mn(e),i&512&&(Gt||r===null||ka(r,r.return)),e.flags&32){d=e.stateNode;try{Xl(d,"")}catch(ye){ut(e,e.return,ye)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,bf(e,d,r!==null?r.memoizedProps:d)),i&1024&&(jf=!0);break;case 6:if(Tn(t,e),Mn(e),i&4){if(e.stateNode===null)throw Error(s(162));i=e.memoizedProps,r=e.stateNode;try{r.nodeValue=i}catch(ye){ut(e,e.return,ye)}}break;case 3:if(bc=null,d=ba,ba=xc(t.containerInfo),Tn(t,e),ba=d,Mn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Rs(t.containerInfo)}catch(ye){ut(e,e.return,ye)}jf&&(jf=!1,gx(e));break;case 4:i=ba,ba=xc(e.stateNode.containerInfo),Tn(t,e),Mn(e),ba=i;break;case 12:Tn(t,e),Mn(e);break;case 31:Tn(t,e),Mn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,rc(e,i)));break;case 13:Tn(t,e),Mn(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(sc=xt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,rc(e,i)));break;case 22:d=e.memoizedState!==null;var L=r!==null&&r.memoizedState!==null,Y=sr,W=Gt;if(sr=Y||d,Gt=W||L,Tn(t,e),Gt=W,sr=Y,Mn(e),i&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(r===null||L||sr||Gt||Nl(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){L=r=t;try{if(h=L.stateNode,d)S=h.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{N=L.stateNode;var ae=L.memoizedProps.style,F=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;N.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ye){ut(L,L.return,ye)}}}else if(t.tag===6){if(r===null){L=t;try{L.stateNode.nodeValue=d?"":L.memoizedProps}catch(ye){ut(L,L.return,ye)}}}else if(t.tag===18){if(r===null){L=t;try{var Z=L.stateNode;d?ly(Z,!0):ly(L.stateNode,!1)}catch(ye){ut(L,L.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,rc(e,r))));break;case 19:Tn(t,e),Mn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,rc(e,i)));break;case 30:break;case 21:break;default:Tn(t,e),Mn(e)}}function Mn(e){var t=e.flags;if(t&2){try{for(var r,i=e.return;i!==null;){if(ox(i)){r=i;break}i=i.return}if(r==null)throw Error(s(160));switch(r.tag){case 27:var d=r.stateNode,h=wf(e);ac(e,h,d);break;case 5:var S=r.stateNode;r.flags&32&&(Xl(S,""),r.flags&=-33);var N=wf(e);ac(e,N,S);break;case 3:case 4:var L=r.stateNode.containerInfo,Y=wf(e);Sf(e,Y,L);break;default:throw Error(s(161))}}catch(W){ut(e,e.return,W)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gx(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ir(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ux(e,t.alternate,t),t=t.sibling}function Nl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ir(4,t,t.return),Nl(t);break;case 1:ka(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&lx(t,t.return,r),Nl(t);break;case 27:Lo(t.stateNode);case 26:case 5:ka(t,t.return),Nl(t);break;case 22:t.memoizedState===null&&Nl(t);break;case 30:Nl(t);break;default:Nl(t)}e=e.sibling}}function cr(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:cr(d,h,r),Ro(4,h);break;case 1:if(cr(d,h,r),i=h,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(Y){ut(i,i.return,Y)}if(i=h,d=i.updateQueue,d!==null){var N=i.stateNode;try{var L=d.shared.hiddenCallbacks;if(L!==null)for(d.shared.hiddenCallbacks=null,d=0;d<L.length;d++)Fg(L[d],N)}catch(Y){ut(i,i.return,Y)}}r&&S&64&&rx(h),No(h,h.return);break;case 27:ix(h);case 26:case 5:cr(d,h,r),r&&i===null&&S&4&&sx(h),No(h,h.return);break;case 12:cr(d,h,r);break;case 31:cr(d,h,r),r&&S&4&&hx(d,h);break;case 13:cr(d,h,r),r&&S&4&&mx(d,h);break;case 22:h.memoizedState===null&&cr(d,h,r),No(h,h.return);break;case 30:break;default:cr(d,h,r)}t=t.sibling}}function Cf(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 Ef(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 wa(e,t,r,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)vx(e,t,r,i),t=t.sibling}function vx(e,t,r,i){var d=t.flags;switch(t.tag){case 0:case 11:case 15:wa(e,t,r,i),d&2048&&Ro(9,t);break;case 1:wa(e,t,r,i);break;case 3:wa(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){wa(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(L){ut(t,t.return,L)}}else wa(e,t,r,i);break;case 31:wa(e,t,r,i);break;case 13:wa(e,t,r,i);break;case 23:break;case 22:h=t.stateNode,S=t.alternate,t.memoizedState!==null?h._visibility&2?wa(e,t,r,i):To(e,t):h._visibility&2?wa(e,t,r,i):(h._visibility|=2,ps(e,t,r,i,(t.subtreeFlags&10256)!==0||!1)),d&2048&&Cf(S,t);break;case 24:wa(e,t,r,i),d&2048&&Ef(t.alternate,t);break;default:wa(e,t,r,i)}}function ps(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,L=i,Y=S.flags;switch(S.tag){case 0:case 11:case 15:ps(h,S,N,L,d),Ro(8,S);break;case 23:break;case 22:var W=S.stateNode;S.memoizedState!==null?W._visibility&2?ps(h,S,N,L,d):To(h,S):(W._visibility|=2,ps(h,S,N,L,d)),d&&Y&2048&&Cf(S.alternate,S);break;case 24:ps(h,S,N,L,d),d&&Y&2048&&Ef(S.alternate,S);break;default:ps(h,S,N,L,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&&Cf(i.alternate,i);break;case 24:To(r,i),d&2048&&Ef(i.alternate,i);break;default:To(r,i)}t=t.sibling}}var Mo=8192;function gs(e,t,r){if(e.subtreeFlags&Mo)for(e=e.child;e!==null;)xx(e,t,r),e=e.sibling}function xx(e,t,r){switch(e.tag){case 26:gs(e,t,r),e.flags&Mo&&e.memoizedState!==null&&FC(r,ba,e.memoizedState,e.memoizedProps);break;case 5:gs(e,t,r);break;case 3:case 4:var i=ba;ba=xc(e.stateNode.containerInfo),gs(e,t,r),ba=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Mo,Mo=16777216,gs(e,t,r),Mo=i):gs(e,t,r));break;default:gs(e,t,r)}}function yx(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];an=i,wx(i,e)}yx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)bx(e),e=e.sibling}function bx(e){switch(e.tag){case 0:case 11:case 15:Ao(e),e.flags&2048&&Ir(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,lc(e)):Ao(e);break;default:Ao(e)}}function lc(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];an=i,wx(i,e)}yx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ir(8,t,t.return),lc(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,lc(t));break;default:lc(t)}e=e.sibling}}function wx(e,t){for(;an!==null;){var r=an;switch(r.tag){case 0:case 11:case 15:Ir(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,an=i;else e:for(r=e;an!==null;){i=an;var d=i.sibling,h=i.return;if(dx(i),i===r){an=null;break e}if(d!==null){d.return=h,an=d;break e}an=h}}}var iC={getCacheForType:function(e){var t=fn(Vt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return fn(Vt).controller.signal}},cC=typeof WeakMap=="function"?WeakMap:Map,et=0,gt=null,He=null,Ve=0,ct=0,Yn=null,Pr=!1,vs=!1,Rf=!1,ur=0,zt=0,qr=0,Tl=0,Nf=0,Gn=0,xs=0,Do=null,An=null,Tf=!1,sc=0,Sx=0,oc=1/0,ic=null,Vr=null,Qt=0,$r=null,ys=null,dr=0,Mf=0,Af=null,jx=null,Oo=0,Df=null;function Fn(){return(et&2)!==0&&Ve!==0?Ve&-Ve:k.T!==null?Uf():xa()}function Cx(){if(Gn===0)if((Ve&536870912)===0||Ge){var e=Tr;Tr<<=1,(Tr&3932160)===0&&(Tr=262144),Gn=e}else Gn=536870912;return e=Vn.current,e!==null&&(e.flags|=32),Gn}function Dn(e,t,r){(e===gt&&(ct===2||ct===9)||e.cancelPendingCommit!==null)&&(bs(e,0),Yr(e,Ve,Gn,!1)),Mt(e,r),((et&2)===0||e!==gt)&&(e===gt&&((et&2)===0&&(Tl|=r),zt===4&&Yr(e,Ve,Gn,!1)),za(e))}function Ex(e,t,r){if((et&6)!==0)throw Error(s(327));var i=!r&&(t&127)===0&&(t&e.expiredLanes)===0||Re(e,t),d=i?fC(e,t):_f(e,t,!0),h=i;do{if(d===0){vs&&!i&&Yr(e,t,0,!1);break}else{if(r=e.current.alternate,h&&!uC(r)){d=_f(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 L=N.current.memoizedState.isDehydrated;if(L&&(bs(N,S).flags|=256),S=_f(N,S,!1),S!==2){if(Rf&&!L){N.errorRecoveryDisabledLanes|=h,Tl|=h,d=4;break e}h=An,An=d,h!==null&&(An===null?An=h:An.push.apply(An,h))}d=S}if(h=!1,d!==2)continue}}if(d===1){bs(e,0),Yr(e,t,0,!0);break}e:{switch(i=e,h=d,h){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:Yr(i,t,Gn,!Pr);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(d=sc+300-xt(),10<d)){if(Yr(i,t,Gn,!Pr),qt(i,0,!0)!==0)break e;dr=t,i.timeoutHandle=ny(Rx.bind(null,i,r,An,ic,Tf,t,Gn,Tl,xs,Pr,h,"Throttled",-0,0),d);break e}Rx(i,r,An,ic,Tf,t,Gn,Tl,xs,Pr,h,null,-0,0)}}break}while(!0);za(e)}function Rx(e,t,r,i,d,h,S,N,L,Y,W,ae,F,Z){if(e.timeoutHandle=-1,ae=t.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qa},xx(t,h,ae);var ye=(h&62914560)===h?sc-xt():(h&4194048)===h?Sx-xt():0;if(ye=KC(ae,ye),ye!==null){dr=h,e.cancelPendingCommit=ye(kx.bind(null,e,t,h,r,i,d,S,N,L,W,ae,null,F,Z)),Yr(e,h,S,!Y);return}}kx(e,t,h,r,i,d,S,N,L)}function uC(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 Yr(e,t,r,i){t&=~Nf,t&=~Tl,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var d=t;0<d;){var h=31-_t(d),S=1<<h;i[h]=-1,d&=~S}r!==0&&Xt(e,r,t)}function cc(){return(et&6)===0?(_o(0),!1):!0}function Of(){if(He!==null){if(ct===0)var e=He.return;else e=He,er=yl=null,Fd(e),us=null,po=0,e=He;for(;e!==null;)ax(e.alternate,e),e=e.return;He=null}}function bs(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,AC(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),dr=0,Of(),gt=e,He=r=Ja(e.current,null),Ve=t,ct=0,Yn=null,Pr=!1,vs=Re(e,t),Rf=!1,xs=Gn=Nf=Tl=qr=zt=0,An=Do=null,Tf=!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-_t(i),h=1<<d;t|=e[d],i&=~h}return ur=t,Ai(),r}function Nx(e,t){ze=null,k.H=jo,t===cs||t===Bi?(t=Vg(),ct=3):t===zd?(t=Vg(),ct=4):ct=t===uf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Yn=t,He===null&&(zt=1,Ji(e,ta(t,e.current)))}function Tx(){var e=Vn.current;return e===null?!0:(Ve&4194048)===Ve?la===null:(Ve&62914560)===Ve||(Ve&536870912)!==0?e===la:!1}function Mx(){var e=k.H;return k.H=jo,e===null?jo:e}function Ax(){var e=k.A;return k.A=iC,e}function uc(){zt=4,Pr||(Ve&4194048)!==Ve&&Vn.current!==null||(vs=!0),(qr&134217727)===0&&(Tl&134217727)===0||gt===null||Yr(gt,Ve,Gn,!1)}function _f(e,t,r){var i=et;et|=2;var d=Mx(),h=Ax();(gt!==e||Ve!==t)&&(ic=null,bs(e,t)),t=!1;var S=zt;e:do try{if(ct!==0&&He!==null){var N=He,L=Yn;switch(ct){case 8:Of(),S=6;break e;case 3:case 2:case 9:case 6:Vn.current===null&&(t=!0);var Y=ct;if(ct=0,Yn=null,ws(e,N,L,Y),r&&vs){S=0;break e}break;default:Y=ct,ct=0,Yn=null,ws(e,N,L,Y)}}dC(),S=zt;break}catch(W){Nx(e,W)}while(!0);return t&&e.shellSuspendCounter++,er=yl=null,et=i,k.H=d,k.A=h,He===null&&(gt=null,Ve=0,Ai()),S}function dC(){for(;He!==null;)Dx(He)}function fC(e,t){var r=et;et|=2;var i=Mx(),d=Ax();gt!==e||Ve!==t?(ic=null,oc=xt()+500,bs(e,t)):vs=Re(e,t);e:do try{if(ct!==0&&He!==null){t=He;var h=Yn;t:switch(ct){case 1:ct=0,Yn=null,ws(e,t,h,1);break;case 2:case 9:if(Pg(h)){ct=0,Yn=null,Ox(t);break}t=function(){ct!==2&&ct!==9||gt!==e||(ct=7),za(e)},h.then(t,t);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:Pg(h)?(ct=0,Yn=null,Ox(t)):(ct=0,Yn=null,ws(e,t,h,7));break;case 5:var S=null;switch(He.tag){case 26:S=He.memoizedState;case 5:case 27:var N=He;if(S?vy(S):N.stateNode.complete){ct=0,Yn=null;var L=N.sibling;if(L!==null)He=L;else{var Y=N.return;Y!==null?(He=Y,dc(Y)):He=null}break t}}ct=0,Yn=null,ws(e,t,h,5);break;case 6:ct=0,Yn=null,ws(e,t,h,6);break;case 8:Of(),zt=6;break e;default:throw Error(s(462))}}hC();break}catch(W){Nx(e,W)}while(!0);return er=yl=null,k.H=i,k.A=d,et=r,He!==null?0:(gt=null,Ve=0,Ai(),zt)}function hC(){for(;He!==null&&!en();)Dx(He)}function Dx(e){var t=tx(e.alternate,e,ur);e.memoizedProps=e.pendingProps,t===null?dc(e):He=t}function Ox(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=Xv(r,t,t.pendingProps,t.type,void 0,Ve);break;case 11:t=Xv(r,t,t.pendingProps,t.type.render,t.ref,Ve);break;case 5:Fd(t);default:ax(r,t),t=He=Ag(t,ur),t=tx(r,t,ur)}e.memoizedProps=e.pendingProps,t===null?dc(e):He=t}function ws(e,t,r,i){er=yl=null,Fd(t),us=null,po=0;var d=t.return;try{if(tC(e,d,t,r,Ve)){zt=1,Ji(e,ta(r,e.current)),He=null;return}}catch(h){if(d!==null)throw He=d,h;zt=1,Ji(e,ta(r,e.current)),He=null;return}t.flags&32768?(Ge||i===1?e=!0:vs||(Ve&536870912)!==0?e=!1:(Pr=e=!0,(i===2||i===9||i===3||i===6)&&(i=Vn.current,i!==null&&i.tag===13&&(i.flags|=16384))),_x(t,e)):dc(t)}function dc(e){var t=e;do{if((t.flags&32768)!==0){_x(t,Pr);return}e=t.return;var r=rC(t.alternate,t,ur);if(r!==null){He=r;return}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);zt===0&&(zt=5)}function _x(e,t){do{var r=lC(e.alternate,e);if(r!==null){r.flags&=32767,He=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){He=e;return}He=e=r}while(e!==null);zt=6,He=null}function kx(e,t,r,i,d,h,S,N,L){e.cancelPendingCommit=null;do fc();while(Qt!==0);if((et&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(h=t.lanes|t.childLanes,h|=bd,dt(e,r,h,S,N,L),e===gt&&(He=gt=null,Ve=0),ys=t,$r=e,dr=r,Mf=h,Af=d,jx=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,vC(tn,function(){return Hx(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=k.T,k.T=null,d=H.p,H.p=2,S=et,et|=4;try{sC(e,t,r)}finally{et=S,H.p=d,k.T=i}}Qt=1,zx(),Lx(),Ux()}}function zx(){if(Qt===1){Qt=0;var e=$r,t=ys,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=k.T,k.T=null;var i=H.p;H.p=2;var d=et;et|=4;try{px(t,e);var h=Yf,S=wg(e.containerInfo),N=h.focusedElem,L=h.selectionRange;if(S!==N&&N&&N.ownerDocument&&bg(N.ownerDocument.documentElement,N)){if(L!==null&&pd(N)){var Y=L.start,W=L.end;if(W===void 0&&(W=Y),"selectionStart"in N)N.selectionStart=Y,N.selectionEnd=Math.min(W,N.value.length);else{var ae=N.ownerDocument||document,F=ae&&ae.defaultView||window;if(F.getSelection){var Z=F.getSelection(),ye=N.textContent.length,Ae=Math.min(L.start,ye),mt=L.end===void 0?Ae:Math.min(L.end,ye);!Z.extend&&Ae>mt&&(S=mt,mt=Ae,Ae=S);var P=yg(N,Ae),B=yg(N,mt);if(P&&B&&(Z.rangeCount!==1||Z.anchorNode!==P.node||Z.anchorOffset!==P.offset||Z.focusNode!==B.node||Z.focusOffset!==B.offset)){var $=ae.createRange();$.setStart(P.node,P.offset),Z.removeAllRanges(),Ae>mt?(Z.addRange($),Z.extend(B.node,B.offset)):($.setEnd(B.node,B.offset),Z.addRange($))}}}}for(ae=[],Z=N;Z=Z.parentNode;)Z.nodeType===1&&ae.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ae.length;N++){var ne=ae[N];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Cc=!!$f,Yf=$f=null}finally{et=d,H.p=i,k.T=r}}e.current=t,Qt=2}}function Lx(){if(Qt===2){Qt=0;var e=$r,t=ys,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=k.T,k.T=null;var i=H.p;H.p=2;var d=et;et|=4;try{ux(e,t.alternate,t)}finally{et=d,H.p=i,k.T=r}}Qt=3}}function Ux(){if(Qt===4||Qt===3){Qt=0,Pt();var e=$r,t=ys,r=dr,i=jx;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Qt=5:(Qt=0,ys=$r=null,Bx(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Vr=null),Ka(r),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(cn,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=k.T,d=H.p,H.p=2,k.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{k.T=t,H.p=d}}(dr&3)!==0&&fc(),za(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===Df?Oo++:(Oo=0,Df=e):Oo=0,_o(0)}}function Bx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ho(t)))}function fc(){return zx(),Lx(),Ux(),Hx()}function Hx(){if(Qt!==5)return!1;var e=$r,t=Mf;Mf=0;var r=Ka(dr),i=k.T,d=H.p;try{H.p=32>r?32:r,k.T=null,r=Af,Af=null;var h=$r,S=dr;if(Qt=0,ys=$r=null,dr=0,(et&6)!==0)throw Error(s(331));var N=et;if(et|=4,bx(h.current),vx(h,h.current,S,r),et=N,_o(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(cn,h)}catch{}return!0}finally{H.p=d,k.T=i,Bx(e,t)}}function Ix(e,t,r){t=ta(r,t),t=cf(e.stateNode,t,2),e=Ur(e,t,2),e!==null&&(Mt(e,2),za(e))}function ut(e,t,r){if(e.tag===3)Ix(e,e,r);else for(;t!==null;){if(t.tag===3){Ix(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Vr===null||!Vr.has(i))){e=ta(r,e),r=Pv(2),i=Ur(t,r,2),i!==null&&(qv(r,i,t,e),Mt(i,2),za(i));break}}t=t.return}}function kf(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new cC;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)||(Rf=!0,d.add(r),e=mC.bind(null,e,t,r),t.then(e,e))}function mC(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,gt===e&&(Ve&r)===r&&(zt===4||zt===3&&(Ve&62914560)===Ve&&300>xt()-sc?(et&2)===0&&bs(e,0):Nf|=r,xs===Ve&&(xs=0)),za(e)}function Px(e,t){t===0&&(t=Le()),e=gl(e,t),e!==null&&(Mt(e,t),za(e))}function pC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Px(e,r)}function gC(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(s(314))}i!==null&&i.delete(t),Px(e,r)}function vC(e,t){return Ot(e,t)}var hc=null,Ss=null,zf=!1,mc=!1,Lf=!1,Gr=0;function za(e){e!==Ss&&e.next===null&&(Ss===null?hc=Ss=e:Ss=Ss.next=e),mc=!0,zf||(zf=!0,yC())}function _o(e,t){if(!Lf&&mc){Lf=!0;do for(var r=!1,i=hc;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-_t(42|e)+1)-1,h&=d&~(S&~N),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,Yx(i,h))}else h=Ve,h=qt(i,i===gt?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(h&3)===0||Re(i,h)||(r=!0,Yx(i,h));i=i.next}while(r);Lf=!1}}function xC(){qx()}function qx(){mc=zf=!1;var e=0;Gr!==0&&MC()&&(e=Gr);for(var t=xt(),r=null,i=hc;i!==null;){var d=i.next,h=Vx(i,t);h===0?(i.next=null,r===null?hc=d:r.next=d,d===null&&(Ss=r)):(r=i,(e!==0||(h&3)!==0)&&(mc=!0)),i=d}Qt!==0&&Qt!==5||_o(e),Gr!==0&&(Gr=0)}function Vx(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var S=31-_t(h),N=1<<S,L=d[S];L===-1?((N&r)===0||(N&i)!==0)&&(d[S]=ke(N,t)):L<=t&&(e.expiredLanes|=N),h&=~N}if(t=gt,r=Ve,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&&It(i),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Re(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(i!==null&&It(i),Ka(r)){case 2:case 8:r=jt;break;case 32:r=tn;break;case 268435456:r=qe;break;default:r=tn}return i=$x.bind(null,e),r=Ot(r,i),e.callbackPriority=t,e.callbackNode=r,t}return i!==null&&i!==null&&It(i),e.callbackPriority=2,e.callbackNode=null,2}function $x(e,t){if(Qt!==0&&Qt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(fc()&&e.callbackNode!==r)return null;var i=Ve;return i=qt(e,e===gt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Ex(e,i,t),Vx(e,xt()),e.callbackNode!=null&&e.callbackNode===r?$x.bind(null,e):null)}function Yx(e,t){if(fc())return null;Ex(e,t,!0)}function yC(){DC(function(){(et&6)!==0?Ot(St,xC):qx()})}function Uf(){if(Gr===0){var e=os;e===0&&(e=Ga,Ga<<=1,(Ga&261888)===0&&(Ga=256)),Gr=e}return Gr}function Gx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Si(""+e)}function Fx(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 bC(e,t,r,i,d){if(t==="submit"&&r&&r.stateNode===d){var h=Gx((d[En]||null).action),S=i.submitter;S&&(t=(t=S[En]||null)?Gx(t.formAction):S.getAttribute("formAction"),t!==null&&(h=t,S=null));var N=new Ri("action","action",null,i,d);e.push({event:N,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Gr!==0){var L=S?Fx(d,S):new FormData(d);nf(r,{pending:!0,data:L,method:d.method,action:h},null,L)}}else typeof h=="function"&&(N.preventDefault(),L=S?Fx(d,S):new FormData(d),nf(r,{pending:!0,data:L,method:d.method,action:h},h,L))},currentTarget:d}]})}}for(var Bf=0;Bf<yd.length;Bf++){var Hf=yd[Bf],wC=Hf.toLowerCase(),SC=Hf[0].toUpperCase()+Hf.slice(1);ya(wC,"on"+SC)}ya(Cg,"onAnimationEnd"),ya(Eg,"onAnimationIteration"),ya(Rg,"onAnimationStart"),ya("dblclick","onDoubleClick"),ya("focusin","onFocus"),ya("focusout","onBlur"),ya(Bj,"onTransitionRun"),ya(Hj,"onTransitionStart"),ya(Ij,"onTransitionCancel"),ya(Ng,"onTransitionEnd"),Fl("onMouseEnter",["mouseout","mouseover"]),Fl("onMouseLeave",["mouseout","mouseover"]),Fl("onPointerEnter",["pointerout","pointerover"]),Fl("onPointerLeave",["pointerout","pointerover"]),fl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fl("onBeforeInput",["compositionend","keypress","textInput","paste"]),fl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fl("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(" "),jC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ko));function Kx(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],L=N.instance,Y=N.currentTarget;if(N=N.listener,L!==h&&d.isPropagationStopped())break e;h=N,d.currentTarget=Y;try{h(d)}catch(W){Mi(W)}d.currentTarget=null,h=L}else for(S=0;S<i.length;S++){if(N=i[S],L=N.instance,Y=N.currentTarget,N=N.listener,L!==h&&d.isPropagationStopped())break e;h=N,d.currentTarget=Y;try{h(d)}catch(W){Mi(W)}d.currentTarget=null,h=L}}}}function Ie(e,t){var r=t[Zu];r===void 0&&(r=t[Zu]=new Set);var i=e+"__bubble";r.has(i)||(Xx(t,e,2,!1),r.add(i))}function If(e,t,r){var i=0;t&&(i|=4),Xx(r,e,i,t)}var pc="_reactListening"+Math.random().toString(36).slice(2);function Pf(e){if(!e[pc]){e[pc]=!0,qp.forEach(function(r){r!=="selectionchange"&&(jC.has(r)||If(r,!1,e),If(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pc]||(t[pc]=!0,If("selectionchange",!1,t))}}function Xx(e,t,r,i){switch(Cy(t)){case 2:var d=ZC;break;case 8:d=JC;break;default:d=nh}r=d.bind(null,t,r,e),d=void 0,!sd||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 qf(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 L=S.tag;if((L===3||L===4)&&S.stateNode.containerInfo===d)return;S=S.return}for(;N!==null;){if(S=$l(N),S===null)return;if(L=S.tag,L===5||L===6||L===26||L===27){i=h=S;continue e}N=N.parentNode}}i=i.return}eg(function(){var Y=h,W=rd(r),ae=[];e:{var F=Tg.get(e);if(F!==void 0){var Z=Ri,ye=e;switch(e){case"keypress":if(Ci(r)===0)break e;case"keydown":case"keyup":Z=gj;break;case"focusin":ye="focus",Z=ud;break;case"focusout":ye="blur",Z=ud;break;case"beforeblur":case"afterblur":Z=ud;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":Z=ag;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=rj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=yj;break;case Cg:case Eg:case Rg:Z=oj;break;case Ng:Z=wj;break;case"scroll":case"scrollend":Z=nj;break;case"wheel":Z=jj;break;case"copy":case"cut":case"paste":Z=cj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=lg;break;case"toggle":case"beforetoggle":Z=Ej}var Ae=(t&4)!==0,mt=!Ae&&(e==="scroll"||e==="scrollend"),P=Ae?F!==null?F+"Capture":null:F;Ae=[];for(var B=Y,$;B!==null;){var ne=B;if($=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||$===null||P===null||(ne=to(B,P),ne!=null&&Ae.push(zo(B,ne,$))),mt)break;B=B.return}0<Ae.length&&(F=new Z(F,ye,null,r,W),ae.push({event:F,listeners:Ae}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",Z=e==="mouseout"||e==="pointerout",F&&r!==ad&&(ye=r.relatedTarget||r.fromElement)&&($l(ye)||ye[Vl]))break e;if((Z||F)&&(F=W.window===W?W:(F=W.ownerDocument)?F.defaultView||F.parentWindow:window,Z?(ye=r.relatedTarget||r.toElement,Z=Y,ye=ye?$l(ye):null,ye!==null&&(mt=u(ye),Ae=ye.tag,ye!==mt||Ae!==5&&Ae!==27&&Ae!==6)&&(ye=null)):(Z=null,ye=Y),Z!==ye)){if(Ae=ag,ne="onMouseLeave",P="onMouseEnter",B="mouse",(e==="pointerout"||e==="pointerover")&&(Ae=lg,ne="onPointerLeave",P="onPointerEnter",B="pointer"),mt=Z==null?F:eo(Z),$=ye==null?F:eo(ye),F=new Ae(ne,B+"leave",Z,r,W),F.target=mt,F.relatedTarget=$,ne=null,$l(W)===Y&&(Ae=new Ae(P,B+"enter",ye,r,W),Ae.target=$,Ae.relatedTarget=mt,ne=Ae),mt=ne,Z&&ye)t:{for(Ae=CC,P=Z,B=ye,$=0,ne=P;ne;ne=Ae(ne))$++;ne=0;for(var Ne=B;Ne;Ne=Ae(Ne))ne++;for(;0<$-ne;)P=Ae(P),$--;for(;0<ne-$;)B=Ae(B),ne--;for(;$--;){if(P===B||B!==null&&P===B.alternate){Ae=P;break t}P=Ae(P),B=Ae(B)}Ae=null}else Ae=null;Z!==null&&Qx(ae,F,Z,Ae,!1),ye!==null&&mt!==null&&Qx(ae,mt,ye,Ae,!0)}}e:{if(F=Y?eo(Y):window,Z=F.nodeName&&F.nodeName.toLowerCase(),Z==="select"||Z==="input"&&F.type==="file")var Ze=hg;else if(dg(F))if(mg)Ze=zj;else{Ze=_j;var je=Oj}else Z=F.nodeName,!Z||Z.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?Y&&nd(Y.elementType)&&(Ze=hg):Ze=kj;if(Ze&&(Ze=Ze(e,Y))){fg(ae,Ze,r,W);break e}je&&je(e,F,Y),e==="focusout"&&Y&&F.type==="number"&&Y.memoizedProps.value!=null&&td(F,"number",F.value)}switch(je=Y?eo(Y):window,e){case"focusin":(dg(je)||je.contentEditable==="true")&&(Wl=je,gd=Y,co=null);break;case"focusout":co=gd=Wl=null;break;case"mousedown":vd=!0;break;case"contextmenu":case"mouseup":case"dragend":vd=!1,Sg(ae,r,W);break;case"selectionchange":if(Uj)break;case"keydown":case"keyup":Sg(ae,r,W)}var Ue;if(fd)e:{switch(e){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else Jl?cg(e,r)&&($e="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&($e="onCompositionStart");$e&&(sg&&r.locale!=="ko"&&(Jl||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&Jl&&(Ue=tg()):(Ar=W,od="value"in Ar?Ar.value:Ar.textContent,Jl=!0)),je=gc(Y,$e),0<je.length&&($e=new rg($e,e,null,r,W),ae.push({event:$e,listeners:je}),Ue?$e.data=Ue:(Ue=ug(r),Ue!==null&&($e.data=Ue)))),(Ue=Nj?Tj(e,r):Mj(e,r))&&($e=gc(Y,"onBeforeInput"),0<$e.length&&(je=new rg("onBeforeInput","beforeinput",null,r,W),ae.push({event:je,listeners:$e}),je.data=Ue)),bC(ae,e,Y,r,W)}Kx(ae,t)})}function zo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function gc(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 CC(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Qx(e,t,r,i,d){for(var h=t._reactName,S=[];r!==null&&r!==i;){var N=r,L=N.alternate,Y=N.stateNode;if(N=N.tag,L!==null&&L===i)break;N!==5&&N!==26&&N!==27||Y===null||(L=Y,d?(Y=to(r,h),Y!=null&&S.unshift(zo(r,Y,L))):d||(Y=to(r,h),Y!=null&&S.push(zo(r,Y,L)))),r=r.return}S.length!==0&&e.push({event:t,listeners:S})}var EC=/\r\n?/g,RC=/\u0000|\uFFFD/g;function Zx(e){return(typeof e=="string"?e:""+e).replace(EC,`
49
+ `).replace(RC,"")}function Jx(e,t){return t=Zx(t),Zx(e)===t}function ht(e,t,r,i,d,h){switch(r){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Xl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Xl(e,""+i);break;case"className":bi(e,"class",i);break;case"tabIndex":bi(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":bi(e,r,i);break;case"style":Jp(e,i,h);break;case"data":if(t!=="object"){bi(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=Si(""+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=Si(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=Qa);break;case"onScroll":i!=null&&Ie("scroll",e);break;case"onScrollEnd":i!=null&&Ie("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(s(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=Si(""+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":Ie("beforetoggle",e),Ie("toggle",e),yi(e,"popover",i);break;case"xlinkActuate":Xa(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Xa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Xa(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Xa(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Xa(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Xa(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":yi(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=ej.get(r)||r,yi(e,r,i))}}function Vf(e,t,r,i,d,h){switch(r){case"style":Jp(e,i,h);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"children":typeof i=="string"?Xl(e,i):(typeof i=="number"||typeof i=="bigint")&&Xl(e,""+i);break;case"onScroll":i!=null&&Ie("scroll",e);break;case"onScrollEnd":i!=null&&Ie("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Qa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vp.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[En]||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,""):yi(e,r,i)}}}function mn(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",e),Ie("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(s(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":Ie("invalid",e);var N=h=S=d=null,L=null,Y=null;for(i in r)if(r.hasOwnProperty(i)){var W=r[i];if(W!=null)switch(i){case"name":d=W;break;case"type":S=W;break;case"checked":L=W;break;case"defaultChecked":Y=W;break;case"value":h=W;break;case"defaultValue":N=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(s(137,t));break;default:ht(e,t,i,W,r,null)}}Kp(e,h,N,L,Y,S,d,!1);return;case"select":Ie("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?Kl(e,!!i,t,!1):r!=null&&Kl(e,!!i,r,!0);return;case"textarea":Ie("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(s(91));break;default:ht(e,t,S,N,r,null)}Qp(e,i,d,h);return;case"option":for(L in r)if(r.hasOwnProperty(L)&&(i=r[L],i!=null))switch(L){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:ht(e,t,L,i,r,null)}return;case"dialog":Ie("beforetoggle",e),Ie("toggle",e),Ie("cancel",e),Ie("close",e);break;case"iframe":case"object":Ie("load",e);break;case"video":case"audio":for(i=0;i<ko.length;i++)Ie(ko[i],e);break;case"image":Ie("error",e),Ie("load",e);break;case"details":Ie("toggle",e);break;case"embed":case"source":case"link":Ie("error",e),Ie("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(Y in r)if(r.hasOwnProperty(Y)&&(i=r[Y],i!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:ht(e,t,Y,i,r,null)}return;default:if(nd(t)){for(W in r)r.hasOwnProperty(W)&&(i=r[W],i!==void 0&&Vf(e,t,W,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 NC(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,L=null,Y=null,W=null;for(Z in r){var ae=r[Z];if(r.hasOwnProperty(Z)&&ae!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":L=ae;default:i.hasOwnProperty(Z)||ht(e,t,Z,null,i,ae)}}for(var F in i){var Z=i[F];if(ae=r[F],i.hasOwnProperty(F)&&(Z!=null||ae!=null))switch(F){case"type":h=Z;break;case"name":d=Z;break;case"checked":Y=Z;break;case"defaultChecked":W=Z;break;case"value":S=Z;break;case"defaultValue":N=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(s(137,t));break;default:Z!==ae&&ht(e,t,F,Z,i,ae)}}ed(e,S,N,L,Y,W,h,d);return;case"select":Z=S=N=F=null;for(h in r)if(L=r[h],r.hasOwnProperty(h)&&L!=null)switch(h){case"value":break;case"multiple":Z=L;default:i.hasOwnProperty(h)||ht(e,t,h,null,i,L)}for(d in i)if(h=i[d],L=r[d],i.hasOwnProperty(d)&&(h!=null||L!=null))switch(d){case"value":F=h;break;case"defaultValue":N=h;break;case"multiple":S=h;default:h!==L&&ht(e,t,d,h,i,L)}t=N,r=S,i=Z,F!=null?Kl(e,!!r,F,!1):!!i!=!!r&&(t!=null?Kl(e,!!r,t,!0):Kl(e,!!r,r?[]:"",!1));return;case"textarea":Z=F=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":F=d;break;case"defaultValue":Z=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==h&&ht(e,t,S,d,i,h)}Xp(e,F,Z);return;case"option":for(var ye in r)if(F=r[ye],r.hasOwnProperty(ye)&&F!=null&&!i.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:ht(e,t,ye,null,i,F)}for(L in i)if(F=i[L],Z=r[L],i.hasOwnProperty(L)&&F!==Z&&(F!=null||Z!=null))switch(L){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:ht(e,t,L,F,i,Z)}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 Ae in r)F=r[Ae],r.hasOwnProperty(Ae)&&F!=null&&!i.hasOwnProperty(Ae)&&ht(e,t,Ae,null,i,F);for(Y in i)if(F=i[Y],Z=r[Y],i.hasOwnProperty(Y)&&F!==Z&&(F!=null||Z!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(s(137,t));break;default:ht(e,t,Y,F,i,Z)}return;default:if(nd(t)){for(var mt in r)F=r[mt],r.hasOwnProperty(mt)&&F!==void 0&&!i.hasOwnProperty(mt)&&Vf(e,t,mt,void 0,i,F);for(W in i)F=i[W],Z=r[W],!i.hasOwnProperty(W)||F===Z||F===void 0&&Z===void 0||Vf(e,t,W,F,i,Z);return}}for(var P in r)F=r[P],r.hasOwnProperty(P)&&F!=null&&!i.hasOwnProperty(P)&&ht(e,t,P,null,i,F);for(ae in i)F=i[ae],Z=r[ae],!i.hasOwnProperty(ae)||F===Z||F==null&&Z==null||ht(e,t,ae,F,i,Z)}function Wx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TC(){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&&Wx(S)){for(S=0,N=d.responseEnd,i+=1;i<r.length;i++){var L=r[i],Y=L.startTime;if(Y>N)break;var W=L.transferSize,ae=L.initiatorType;W&&Wx(ae)&&(L=L.responseEnd,S+=W*(L<N?1:(N-Y)/(L-Y)))}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 $f=null,Yf=null;function vc(e){return e.nodeType===9?e:e.ownerDocument}function ey(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 ty(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 Gf(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 Ff=null;function MC(){var e=window.event;return e&&e.type==="popstate"?e===Ff?!1:(Ff=e,!0):(Ff=null,!1)}var ny=typeof setTimeout=="function"?setTimeout:void 0,AC=typeof clearTimeout=="function"?clearTimeout:void 0,ay=typeof Promise=="function"?Promise:void 0,DC=typeof queueMicrotask=="function"?queueMicrotask:typeof ay<"u"?function(e){return ay.resolve(null).then(e).catch(OC)}:ny;function OC(e){setTimeout(function(){throw e})}function Fr(e){return e==="head"}function ry(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),Rs(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);Rs(t)}function ly(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 Kf(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":Kf(r),Ju(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function _C(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 kC(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 sy(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 Xf(e){return e.data==="$?"||e.data==="$~"}function Qf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function zC(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 Zf=null;function oy(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 iy(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 cy(e,t,r){switch(t=vc(r),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Lo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ju(e)}var oa=new Map,uy=new Set;function xc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fr=H.d;H.d={f:LC,r:UC,D:BC,C:HC,L:IC,m:PC,X:VC,S:qC,M:$C};function LC(){var e=fr.f(),t=cc();return e||t}function UC(e){var t=Yl(e);t!==null&&t.tag===5&&t.type==="form"?Nv(t):fr.r(e)}var js=typeof document>"u"?null:document;function dy(e,t,r){var i=js;if(i&&typeof t=="string"&&t){var d=Wn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),uy.has(d)||(uy.add(d),e={rel:e,crossOrigin:r,href:t},i.querySelector(d)===null&&(t=i.createElement("link"),mn(t,"link",e),nn(t),i.head.appendChild(t)))}}function BC(e){fr.D(e),dy("dns-prefetch",e,null)}function HC(e,t){fr.C(e,t),dy("preconnect",e,t)}function IC(e,t,r){fr.L(e,t,r);var i=js;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=Cs(e);break;case"script":h=Es(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"),mn(t,"link",e),nn(t),i.head.appendChild(t)))}}function PC(e,t){fr.m(e,t);var r=js;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=Es(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"),mn(i,"link",e),nn(i),r.head.appendChild(i)}}}function qC(e,t,r){fr.S(e,t,r);var i=js;if(i&&e){var d=Gl(i).hoistableStyles,h=Cs(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))&&Jf(e,r);var L=S=i.createElement("link");nn(L),mn(L,"link",e),L._p=new Promise(function(Y,W){L.onload=Y,L.onerror=W}),L.addEventListener("load",function(){N.loading|=1}),L.addEventListener("error",function(){N.loading|=2}),N.loading|=4,yc(S,t,i)}S={type:"stylesheet",instance:S,count:1,state:N},d.set(h,S)}}}function VC(e,t){fr.X(e,t);var r=js;if(r&&e){var i=Gl(r).hoistableScripts,d=Es(e),h=i.get(d);h||(h=r.querySelector(Bo(d)),h||(e=y({src:e,async:!0},t),(t=oa.get(d))&&Wf(e,t),h=r.createElement("script"),nn(h),mn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(d,h))}}function $C(e,t){fr.M(e,t);var r=js;if(r&&e){var i=Gl(r).hoistableScripts,d=Es(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))&&Wf(e,t),h=r.createElement("script"),nn(h),mn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(d,h))}}function fy(e,t,r,i){var d=(d=ve.current)?xc(d):null;if(!d)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=Cs(r.href),r=Gl(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=Cs(r.href);var h=Gl(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||YC(d,e,r,S.state))),t&&i===null)throw Error(s(528,""));return S}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Es(r),r=Gl(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(s(444,e))}}function Cs(e){return'href="'+Wn(e)+'"'}function Uo(e){return'link[rel="stylesheet"]['+e+"]"}function hy(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function YC(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}),mn(t,"link",r),nn(t),e.head.appendChild(t))}function Es(e){return'[src="'+Wn(e)+'"]'}function Bo(e){return"script[async]"+e}function my(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,nn(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"),nn(i),mn(i,"style",d),yc(i,r.precedence,e),t.instance=i;case"stylesheet":d=Cs(r.href);var h=e.querySelector(Uo(d));if(h)return t.state.loading|=4,t.instance=h,nn(h),h;i=hy(r),(d=oa.get(d))&&Jf(i,d),h=(e.ownerDocument||e).createElement("link"),nn(h);var S=h;return S._p=new Promise(function(N,L){S.onload=N,S.onerror=L}),mn(h,"link",i),t.state.loading|=4,yc(h,r.precedence,e),t.instance=h;case"script":return h=Es(r.src),(d=e.querySelector(Bo(h)))?(t.instance=d,nn(d),d):(i=r,(d=oa.get(h))&&(i=y({},r),Wf(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),nn(d),mn(d,"link",i),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,yc(i,r.precedence,e));return t.instance}function yc(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 Jf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Wf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var bc=null;function py(e,t,r){if(bc===null){var i=new Map,d=bc=new Map;d.set(r,i)}else d=bc,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[un]||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 gy(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function GC(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 vy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function FC(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=Cs(i.href),h=t.querySelector(Uo(d));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=wc.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=h,nn(h);return}h=t.ownerDocument||t,i=hy(i),(d=oa.get(d))&&Jf(i,d),h=h.createElement("link"),nn(h);var S=h;S._p=new Promise(function(N,L){S.onload=N,S.onerror=L}),mn(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=wc.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var eh=0;function KC(e,t){return e.stylesheets&&e.count===0&&jc(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&jc(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*TC());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jc(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Sc=null;function jc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Sc=new Map,t.forEach(XC,e),Sc=null,wc.call(e))}function XC(e,t){if(!(t.state.loading&4)){var r=Sc.get(e);if(r)var i=r.get(null);else{r=new Map,Sc.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=wc.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:Q,_currentValue2:Q,_threadCount:0};function QC(e,t,r,i,d,h,S,N,L){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=bt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bt(0),this.hiddenUpdates=bt(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function xy(e,t,r,i,d,h,S,N,L,Y,W,ae){return e=new QC(e,t,r,S,L,Y,W,ae,N),t=1,h===!0&&(t|=24),h=qn(3,null,null,t),e.current=h,h.stateNode=e,t=Od(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:i,isDehydrated:r,cache:t},Ld(h),e}function yy(e){return e?(e=ns,e):ns}function by(e,t,r,i,d,h){d=yy(d),i.context===null?i.context=d:i.pendingContext=d,i=Lr(t),i.payload={element:r},h=h===void 0?null:h,h!==null&&(i.callback=h),r=Ur(e,i,t),r!==null&&(Dn(r,e,t),vo(r,e,t))}function wy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function th(e,t){wy(e,t),(e=e.alternate)&&wy(e,t)}function Sy(e){if(e.tag===13||e.tag===31){var t=gl(e,67108864);t!==null&&Dn(t,e,67108864),th(e,67108864)}}function jy(e){if(e.tag===13||e.tag===31){var t=Fn();t=Fa(t);var r=gl(e,t);r!==null&&Dn(r,e,t),th(e,t)}}var Cc=!0;function ZC(e,t,r,i){var d=k.T;k.T=null;var h=H.p;try{H.p=2,nh(e,t,r,i)}finally{H.p=h,k.T=d}}function JC(e,t,r,i){var d=k.T;k.T=null;var h=H.p;try{H.p=8,nh(e,t,r,i)}finally{H.p=h,k.T=d}}function nh(e,t,r,i){if(Cc){var d=ah(i);if(d===null)qf(e,t,i,Ec,r),Ey(e,i);else if(e2(d,e,t,r,i))i.stopPropagation();else if(Ey(e,i),t&4&&-1<WC.indexOf(e)){for(;d!==null;){var h=Yl(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var S=lt(h.pendingLanes);if(S!==0){var N=h;for(N.pendingLanes|=2,N.entangledLanes|=2;S;){var L=1<<31-_t(S);N.entanglements[1]|=L,S&=~L}za(h),(et&6)===0&&(oc=xt()+500,_o(0))}}break;case 31:case 13:N=gl(h,2),N!==null&&Dn(N,h,2),cc(),th(h,2)}if(h=ah(i),h===null&&qf(e,t,i,Ec,r),h===d)break;d=h}d!==null&&i.stopPropagation()}else qf(e,t,i,null,r)}}function ah(e){return e=rd(e),rh(e)}var Ec=null;function rh(e){if(Ec=null,e=$l(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 Ec=e,null}function Cy(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(on()){case St:return 2;case jt:return 8;case tn:case se:return 32;case qe:return 268435456;default:return 32}default:return 32}}var lh=!1,Kr=null,Xr=null,Qr=null,Io=new Map,Po=new Map,Zr=[],WC="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 Ey(e,t){switch(e){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Xr=null;break;case"mouseover":case"mouseout":Qr=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=Yl(t),t!==null&&Sy(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function e2(e,t,r,i,d){switch(t){case"focusin":return Kr=qo(Kr,e,t,r,i,d),!0;case"dragenter":return Xr=qo(Xr,e,t,r,i,d),!0;case"mouseover":return Qr=qo(Qr,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 Ry(e){var t=$l(e.target);if(t!==null){var r=u(t);if(r!==null){if(t=r.tag,t===13){if(t=f(r),t!==null){e.blockedOn=t,Mr(e.priority,function(){jy(r)});return}}else if(t===31){if(t=p(r),t!==null){e.blockedOn=t,Mr(e.priority,function(){jy(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 Rc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ah(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);ad=i,r.target.dispatchEvent(i),ad=null}else return t=Yl(r),t!==null&&Sy(t),e.blockedOn=r,!1;t.shift()}return!0}function Ny(e,t,r){Rc(e)&&r.delete(t)}function t2(){lh=!1,Kr!==null&&Rc(Kr)&&(Kr=null),Xr!==null&&Rc(Xr)&&(Xr=null),Qr!==null&&Rc(Qr)&&(Qr=null),Io.forEach(Ny),Po.forEach(Ny)}function Nc(e,t){e.blockedOn===t&&(e.blockedOn=null,lh||(lh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,t2)))}var Tc=null;function Ty(e){Tc!==e&&(Tc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Tc===e&&(Tc=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(rh(i||r)===null)continue;break}var h=Yl(r);h!==null&&(e.splice(t,3),t-=3,nf(h,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function Rs(e){function t(L){return Nc(L,e)}Kr!==null&&Nc(Kr,e),Xr!==null&&Nc(Xr,e),Qr!==null&&Nc(Qr,e),Io.forEach(t),Po.forEach(t);for(var r=0;r<Zr.length;r++){var i=Zr[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Zr.length&&(r=Zr[0],r.blockedOn===null);)Ry(r),r.blockedOn===null&&Zr.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[En]||null;if(typeof h=="function")S||Ty(r);else if(S){var N=null;if(h&&h.hasAttribute("formAction")){if(d=h,S=h[En]||null)N=S.formAction;else if(rh(d)!==null)continue}else N=S.action;typeof N=="function"?r[i+1]=N:(r.splice(i,3),i-=3),Ty(r)}}}function My(){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 sh(e){this._internalRoot=e}Mc.prototype.render=sh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var r=t.current,i=Fn();by(r,i,e,t,null,null)},Mc.prototype.unmount=sh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;by(e.current,2,null,e,null,null),cc(),t[Vl]=null}};function Mc(e){this._internalRoot=e}Mc.prototype.unstable_scheduleHydration=function(e){if(e){var t=xa();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Zr.length&&t!==0&&t<Zr[r].priority;r++);Zr.splice(r,0,e),r===0&&Ry(e)}};var Ay=a.version;if(Ay!=="19.2.8")throw Error(s(527,Ay,"19.2.8"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var n2={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ac=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ac.isDisabled&&Ac.supportsFiber)try{cn=Ac.inject(n2),yt=Ac}catch{}}return $o.createRoot=function(e,t){if(!c(e))throw Error(s(299));var r=!1,i="",d=Uv,h=Bv,S=Hv;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=xy(e,1,!1,null,null,r,i,null,d,h,S,My),e[Vl]=t.current,Pf(e),new sh(t)},$o.hydrateRoot=function(e,t,r){if(!c(e))throw Error(s(299));var i=!1,d="",h=Uv,S=Bv,N=Hv,L=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&&(L=r.formState)),t=xy(e,1,!0,t,r??null,i,d,L,h,S,N,My),t.context=yy(null),r=t.current,i=Fn(),i=Fa(i),d=Lr(i),d.callback=null,Ur(r,d,i),r=i,t.current.lanes=r,Mt(t,r),za(t),e[Vl]=t.current,Pf(e),new Mc(t)},$o.version="19.2.8",$o}var Vy;function f2(){if(Vy)return uh.exports;Vy=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(),uh.exports=d2(),uh.exports}var h2=f2();const m2=wm(h2);/**
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 jm=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Wb=/^[\\/]{2}/;function p2(n,a){return a+n.replace(/\\/g,"/")}var $y="popstate";function Yy(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function g2(n={}){function a(s,c){var v;let u=(v=c.state)==null?void 0:v.masked,{pathname:f,search:p,hash:g}=u||s.location;return Hh("",{pathname:f,search:p,hash:g},c.state&&c.state.usr||null,c.state&&c.state.key||"default",u?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function l(s,c){return typeof c=="string"?c:Zo(c)}return x2(a,l,null,n)}function Dt(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 v2(){return Math.random().toString(36).substring(2,10)}function Gy(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 Hh(n,a,l=null,s,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Is(a):a,state:l,key:a&&a.key||s||v2(),mask:c}}function Zo({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 Is(n){let a={};if(n){let l=n.indexOf("#");l>=0&&(a.hash=n.substring(l),n=n.substring(0,l));let s=n.indexOf("?");s>=0&&(a.search=n.substring(s),n=n.substring(0,s)),n&&(a.pathname=n)}return a}function x2(n,a,l,s={}){let{window:c=document.defaultView,v5Compat:u=!1}=s,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=Yy(C)?C:Hh(j.location,C,R);v=x()+1;let T=Gy(M,v),D=j.createHref(M.mask||M);try{f.pushState(T,"",D)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;c.location.assign(D)}u&&g&&g({action:p,location:j.location,delta:1})}function w(C,R){p="REPLACE";let M=Yy(C)?C:Hh(j.location,C,R);v=x();let T=Gy(M,v),D=j.createHref(M.mask||M);f.replaceState(T,"",D),u&&g&&g({action:p,location:j.location,delta:0})}function E(C){return y2(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($y,y),g=C,()=>{c.removeEventListener($y,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 y2(n,a,l=!1){let s="http://localhost";n&&(s=n.location.origin!=="null"?n.location.origin:n.location.href),Dt(s,"No window.location.(origin|href) available to create URL");let c=typeof a=="string"?a:Zo(a);return c=c.replace(/ $/,"%20"),!l&&Wb.test(c)&&(c=s+c),new URL(c,s)}function e0(n,a,l="/"){return b2(n,a,l,!1)}function b2(n,a,l,s,c){let u=typeof a=="string"?Is(a):a,f=yr(u.pathname||"/",l);if(f==null)return null;let p=w2(n),g=null,v=O2(f);for(let x=0;g==null&&x<p.length;++x)g=D2(p[x],v,s);return g}function w2(n){let a=t0(n);return S2(a),a}function t0(n,a=[],l=[],s="",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(s)&&g)return;Dt(x.relativePath.startsWith(s),`Absolute route path "${x.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(s.length)}let y=Ea([s,x.relativePath]),b=l.concat(x);f.children&&f.children.length>0&&(Dt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),t0(f.children,a,b,y,g)),!(f.path==null&&!f.index)&&a.push({path:y,score:M2(y,f.index),routesMeta:b.map((w,E)=>{let[j,C]=r0(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 n0(f.path))u(f,p,!0,v)}),a}function n0(n){let a=n.split("/");if(a.length===0)return[];let[l,...s]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(s.length===0)return c?[u,""]:[u];let f=n0(s.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 S2(n){n.sort((a,l)=>a.score!==l.score?l.score-a.score:A2(a.routesMeta.map(s=>s.childrenIndex),l.routesMeta.map(s=>s.childrenIndex)))}var j2=/^:[\w-]+$/,C2=3,E2=2,R2=1,N2=10,T2=-2,Fy=n=>n==="*";function M2(n,a){let l=n.split("/"),s=l.length;return l.some(Fy)&&(s+=T2),a&&(s+=E2),l.filter(c=>!Fy(c)).reduce((c,u)=>c+(j2.test(u)?C2:u===""?R2:N2),s)}function A2(n,a){return n.length===a.length&&n.slice(0,-1).every((s,c)=>s===a[c])?n[n.length-1]-a[a.length-1]:0}function D2(n,a,l=!1){let{routesMeta:s}=n,c={},u="/",f=[];for(let p=0;p<s.length;++p){let g=s[p],v=p===s.length-1,x=u==="/"?a:a.slice(u.length)||"/",y={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},b=g.matcher&&g.compiledParams?a0(y,x,g.matcher,g.compiledParams):tu(y,x),w=g.route;if(!b&&v&&l&&!s[s.length-1].route.index&&(b=tu({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Ea([u,b.pathname]),pathnameBase:z2(Ea([u,b.pathnameBase])),route:w}),b.pathnameBase!=="/"&&(u=Ea([u,b.pathnameBase]))}return f}function tu(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[l,s]=r0(n.path,n.caseSensitive,n.end);return a0(n,a,l,s)}function a0(n,a,l,s){let c=a.match(l);if(!c)return null;let u=c[0],f=u.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:s.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 r0(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 s=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,g,v,x)=>{if(s.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("*")?(s.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),s]}function O2(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return ha(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function yr(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,s=n.charAt(l);return s&&s!=="/"?null:n.slice(l)||"/"}function _2(n,a="/"){let{pathname:l,search:s="",hash:c=""}=typeof n=="string"?Is(n):n,u;return l?(l=l0(l),l.startsWith("/")?u=Ky(l.substring(1),"/"):u=Ky(l,a)):u=a,{pathname:u,search:L2(s),hash:U2(c)}}function Ky(n,a){let l=nu(a).split("/");return n.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function mh(n,a,l,s){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(s)}]. 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 k2(n){return n.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Cm(n){let a=k2(n);return a.map((l,s)=>s===a.length-1?l.pathname:l.pathnameBase)}function gu(n,a,l,s=!1){let c;typeof n=="string"?c=Is(n):(c={...n},Dt(!c.pathname||!c.pathname.includes("?"),mh("?","pathname","search",c)),Dt(!c.pathname||!c.pathname.includes("#"),mh("#","pathname","hash",c)),Dt(!c.search||!c.search.includes("#"),mh("#","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(!s&&f.startsWith("..")){let b=f.split("/");for(;b[0]==="..";)b.shift(),y-=1;c.pathname=b.join("/")}p=y>=0?a[y]:"/"}let g=_2(c,p),v=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}var l0=n=>n.replace(/[\\/]{2,}/g,"/"),Ea=n=>l0(n.join("/")),nu=n=>n.replace(/\/+$/,""),z2=n=>nu(n).replace(/^\/*/,"/"),L2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,U2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,B2=class{constructor(n,a,l,s=!1){this.status=n,this.statusText=a||"",this.internal=s,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function H2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function I2(n){let a=n.map(l=>l.route.path).filter(Boolean);return Ea(a)||"/"}var s0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function o0(n,a){let l=n;if(typeof l!="string"||!jm.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let s=l,c=!1;if(s0)try{let u=new URL(window.location.href),f=Wb.test(l)?new URL(p2(l,u.protocol)):new URL(l),p=yr(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:s,isExternal:c,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var i0=["POST","PUT","PATCH","DELETE"];new Set(i0);var P2=["GET",...i0];new Set(P2);var q2=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function V2(n){try{return q2.includes(new URL(n).protocol)}catch{return!1}}var Ps=m.createContext(null);Ps.displayName="DataRouter";var vu=m.createContext(null);vu.displayName="DataRouterState";var c0=m.createContext(!1);function $2(){return m.useContext(c0)}var u0=m.createContext({isTransitioning:!1});u0.displayName="ViewTransition";var Y2=m.createContext(new Map);Y2.displayName="Fetchers";var G2=m.createContext(null);G2.displayName="Await";var Xn=m.createContext(null);Xn.displayName="Navigation";var si=m.createContext(null);si.displayName="Location";var $a=m.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var Em=m.createContext(null);Em.displayName="RouteError";var d0="REACT_ROUTER_ERROR",F2="REDIRECT",K2="ROUTE_ERROR_RESPONSE";function X2(n){if(n.startsWith(`${d0}:${F2}:{`))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 Q2(n){if(n.startsWith(`${d0}:${K2}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new B2(a.status,a.statusText,a.data)}catch{}}function Z2(n,{relative:a}={}){Dt(qs(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:s}=m.useContext(Xn),{hash:c,pathname:u,search:f}=ii(n,{relative:a}),p=u;return l!=="/"&&(p=u==="/"?l:Ea([l,u])),s.createHref({pathname:p,search:f,hash:c})}function qs(){return m.useContext(si)!=null}function Bn(){return Dt(qs(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(si).location}var f0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function h0(n){m.useContext(Xn).static||m.useLayoutEffect(n)}function oi(){let{isDataRoute:n}=m.useContext($a);return n?uE():J2()}function J2(){Dt(qs(),"useNavigate() may be used only in the context of a <Router> component.");let n=m.useContext(Ps),{basename:a,navigator:l}=m.useContext(Xn),{matches:s}=m.useContext($a),{pathname:c}=Bn(),u=JSON.stringify(Cm(s)),f=m.useRef(!1);return h0(()=>{f.current=!0}),m.useCallback((g,v={})=>{if(ha(f.current,f0),!f.current)return;if(typeof g=="number"){l.go(g);return}let x=gu(g,JSON.parse(u),c,v.relative==="path");n==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Ea([a,x.pathname])),(v.replace?l.replace:l.push)(x,v.state,v)},[a,l,u,c,n])}m.createContext(null);function ii(n,{relative:a}={}){let{matches:l}=m.useContext($a),{pathname:s}=Bn(),c=JSON.stringify(Cm(l));return m.useMemo(()=>gu(n,JSON.parse(c),s,a==="path"),[n,c,s,a])}function W2(n,a){return m0(n,a)}function m0(n,a,l){var C;Dt(qs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=m.useContext(Xn),{matches:c}=m.useContext($a),u=c[c.length-1],f=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",v=u&&u.route;{let R=v&&v.path||"";g0(p,!v||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let x=Bn(),y;if(a){let R=typeof a=="string"?Is(a):a;Dt(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})):e0(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=rE(E&&E.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Ea([g,s.encodeLocation?s.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?g:Ea([g,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),c,l);return a&&j?m.createElement(si.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},j):j}function eE(){let n=cE(),a=H2(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),l=n instanceof Error?n.stack:null,s="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},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 tE=m.createElement(eE,null),p0=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=Q2(n.digest);l&&(n=l)}let a=n!==void 0?m.createElement($a.Provider,{value:this.props.routeContext},m.createElement(Em.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?m.createElement(nE,{error:n},a):a}};p0.contextType=c0;var ph=new WeakMap;function nE({children:n,error:a}){let{basename:l}=m.useContext(Xn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let s=X2(a.digest);if(s){let c=ph.get(a);if(c)throw c;let u=o0(s.location,l),f=u.absoluteURL||u.to;if(V2(f))throw new Error("Invalid redirect location");if(s0&&!ph.get(a))if(u.isExternal||s.reloadDocument)window.location.href=f;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:s.replace}));throw ph.set(a,p),p}return m.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return n}function aE({routeContext:n,match:a,children:l}){let s=m.useContext(Ps);return s&&s.static&&s.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=a.route.id),m.createElement($a.Provider,{value:n},l)}function rE(n,a=[],l){let s=l==null?void 0:l.state;if(n==null){if(!s)return null;if(s.errors)n=s.matches;else if(a.length===0&&!s.initialized&&s.matches.length>0)n=s.matches;else return null}let c=n,u=s==null?void 0:s.errors;if(u!=null){let x=c.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);Dt(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&&s){f=s.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}=s,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=s&&g?(x,y)=>{var b,w;g(x,{location:s.location,params:((w=(b=s.matches)==null?void 0:b[0])==null?void 0:w.params)??{},pattern:I2(s.matches),errorInfo:y})}:void 0;return c.reduceRight((x,y,b)=>{let w,E=!1,j=null,C=null;s&&(w=u&&y.route.id?u[y.route.id]:void 0,j=y.route.errorElement||tE,f&&(p<0&&b===0?(g0("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(aE,{match:y,routeContext:{outlet:x,matches:R,isDataRoute:s!=null},children:T})};return s&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?m.createElement(p0,{location:s.location,revalidation:s.revalidation,component:j,error:w,children:M(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:v}):M()},null)}function Rm(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lE(n){let a=m.useContext(Ps);return Dt(a,Rm(n)),a}function sE(n){let a=m.useContext(vu);return Dt(a,Rm(n)),a}function oE(n){let a=m.useContext($a);return Dt(a,Rm(n)),a}function Nm(n){let a=oE(n),l=a.matches[a.matches.length-1];return Dt(l.route.id,`${n} can only be used on routes that contain a unique "id"`),l.route.id}function iE(){return Nm("useRouteId")}function cE(){var s;let n=m.useContext(Em),a=sE("useRouteError"),l=Nm("useRouteError");return n!==void 0?n:(s=a.errors)==null?void 0:s[l]}function uE(){let{router:n}=lE("useNavigate"),a=Nm("useNavigate"),l=m.useRef(!1);return h0(()=>{l.current=!0}),m.useCallback(async(c,u={})=>{ha(l.current,f0),l.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...u}))},[n,a])}var Xy={};function g0(n,a,l){!a&&!Xy[n]&&(Xy[n]=!0,ha(!1,l))}m.memo(dE);function dE({routes:n,manifest:a,future:l,state:s,isStatic:c,onError:u}){return m0(n,void 0,{manifest:a,state:s,isStatic:c,onError:u})}function Ih({to:n,replace:a,state:l,relative:s}){Dt(qs(),"<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($a),{pathname:f}=Bn(),p=oi(),g=gu(n,Cm(u),f,s==="path"),v=JSON.stringify(g);return m.useEffect(()=>{p(JSON.parse(v),{replace:a,state:l,relative:s})},[p,v,s,a,l]),null}function On(n){Dt(!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 fE({basename:n="/",children:a=null,location:l,navigationType:s="POP",navigator:c,static:u=!1,useTransitions:f}){Dt(!qs(),"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=Is(l));let{pathname:v="/",search:x="",hash:y="",state:b=null,key:w="default",mask:E}=l,j=m.useMemo(()=>{let C=yr(v,p);return C==null?null:{location:{pathname:C,search:x,hash:y,state:b,key:w,mask:E},navigationType:s}},[p,v,x,y,b,w,s,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(si.Provider,{children:a,value:j}))}function v0({children:n,location:a}){return W2(Ph(n),a)}function Ph(n,a=[]){let l=[];return m.Children.forEach(n,(s,c)=>{if(!m.isValidElement(s))return;let u=[...a,c];if(s.type===m.Fragment){l.push.apply(l,Ph(s.props.children,u));return}Dt(s.type===On,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Dt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let f={id:s.props.id||u.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(f.children=Ph(s.props.children,u)),l.push(f)}),l}var Fc="get",Kc="application/x-www-form-urlencoded";function xu(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function hE(n){return xu(n)&&n.tagName.toLowerCase()==="button"}function mE(n){return xu(n)&&n.tagName.toLowerCase()==="form"}function pE(n){return xu(n)&&n.tagName.toLowerCase()==="input"}function gE(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function vE(n,a){return n.button===0&&(!a||a==="_self")&&!gE(n)}function qh(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,l)=>{let s=n[l];return a.concat(Array.isArray(s)?s.map(c=>[l,c]):[[l,s]])},[]))}function xE(n,a){let l=qh(n);return a&&a.forEach((s,c)=>{l.has(c)||a.getAll(c).forEach(u=>{l.append(c,u)})}),l}var Dc=null;function yE(){if(Dc===null)try{new FormData(document.createElement("form"),0),Dc=!1}catch{Dc=!0}return Dc}var bE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function gh(n){return n!=null&&!bE.has(n)?(ha(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kc}"`),null):n}function wE(n,a){let l,s,c,u,f;if(mE(n)){let p=n.getAttribute("action");s=p?yr(p,a):null,l=n.getAttribute("method")||Fc,c=gh(n.getAttribute("enctype"))||Kc,u=new FormData(n)}else if(hE(n)||pE(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(s=g?yr(g,a):null,l=n.getAttribute("formmethod")||p.getAttribute("method")||Fc,c=gh(n.getAttribute("formenctype"))||gh(p.getAttribute("enctype"))||Kc,u=new FormData(p,n),!yE()){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(xu(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=Fc,s=null,c=Kc,f=n}return u&&c==="text/plain"&&(f=u,u=void 0),{action:s,method:l.toLowerCase(),encType:c,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Tm(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function x0(n,a,l,s){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}_.${s}`:c.pathname=`${c.pathname}.${s}`:c.pathname==="/"?c.pathname=`_root.${s}`:a&&yr(c.pathname,a)==="/"?c.pathname=`${nu(a)}/_root.${s}`:c.pathname=`${nu(c.pathname)}.${s}`,c}async function SE(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 jE(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 CE(n,a,l){let s=await Promise.all(n.map(async c=>{let u=a.routes[c.route.id];if(u){let f=await SE(u,l);return f.links?f.links():[]}return[]}));return TE(s.flat(1).filter(jE).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Qy(n,a,l,s,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=s.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 EE(n,a,{includeHydrateFallback:l}={}){return RE(n.map(s=>{let c=a.routes[s.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 RE(n){return[...new Set(n)]}function NE(n){let a={},l=Object.keys(n).sort();for(let s of l)a[s]=n[s];return a}function TE(n,a){let l=new Set;return new Set(a),n.reduce((s,c)=>{let u=JSON.stringify(NE(c));return l.has(u)||(l.add(u),s.push({key:u,link:c})),s},[])}function Mm(){let n=m.useContext(Ps);return Tm(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function ME(){let n=m.useContext(vu);return Tm(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Am=m.createContext(void 0);Am.displayName="FrameworkContext";function yu(){let n=m.useContext(Am);return Tm(n,"You must render this element inside a <HydratedRouter> element"),n}function AE(n,a){let l=m.useContext(Am),[s,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(s){let j=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(j)}}},[s]);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 DE({page:n,...a}){let l=$2(),{nonce:s}=yu(),{router:c}=Mm(),u=m.useMemo(()=>e0(c.routes,n,c.basename),[c.routes,n,c.basename]);return u?(a.nonce==null&&s&&(a={...a,nonce:s}),l?m.createElement(_E,{page:n,matches:u,...a}):m.createElement(kE,{page:n,matches:u,...a})):null}function OE(n){let{manifest:a,routeModules:l}=yu(),[s,c]=m.useState([]);return m.useEffect(()=>{let u=!1;return CE(n,a,l).then(f=>{u||c(f)}),()=>{u=!0}},[n,a,l]),s}function _E({page:n,matches:a,...l}){let s=Bn(),{future:c}=yu(),{basename:u}=Mm(),f=m.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let p=x0(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,s,a]);return m.createElement(m.Fragment,null,f.map(p=>m.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...l})))}function kE({page:n,matches:a,...l}){let s=Bn(),{future:c,manifest:u,routeModules:f}=yu(),{basename:p}=Mm(),{loaderData:g,matches:v}=ME(),x=m.useMemo(()=>Qy(n,a,v,u,s,"data"),[n,a,v,u,s]),y=m.useMemo(()=>Qy(n,a,v,u,s,"assets"),[n,a,v,u,s]),b=m.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let j=new Set,C=!1;if(a.forEach(M=>{var D;let T=u.routes[M.route.id];!T||!T.hasLoader||(!x.some(_=>_.route.id===M.route.id)&&M.route.id in g&&((D=f[M.route.id])!=null&&D.shouldRevalidate)||T.hasClientLoader?C=!0:j.add(M.route.id))}),j.size===0)return[];let R=x0(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,s,u,x,a,n,f]),w=m.useMemo(()=>EE(y,u),[y,u]),E=OE(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 zE(...n){return a=>{n.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var LE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{LE&&(window.__reactRouterVersion="7.18.2")}catch{}function UE({basename:n,children:a,useTransitions:l,window:s}){let c=m.useRef();c.current==null&&(c.current=g2({window:s,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(fE,{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:s="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"&&jm.test(x),D=o0(x,C);x=D.to;let _=Z2(x,{relative:c}),A=Bn(),U=null;if(p){let le=gu(p,[],A.mask?A.mask.pathname:"/",!0);C!=="/"&&(le.pathname=le.pathname==="/"?C:Ea([C,le.pathname])),U=R.createHref(le)}let[O,q,K]=AE(s,E),te=IE(x,{replace:f,mask:p,state:g,target:v,preventScrollReset:y,relative:c,viewTransition:b,defaultShouldRevalidate:w,useTransitions:M});function G(le){a&&a(le),le.defaultPrevented||te(le)}let ie=!(D.isExternal||u),ce=m.createElement("a",{...E,...K,href:(ie?U:void 0)||D.absoluteURL||_,onClick:ie?G:a,ref:zE(j,q),target:v,"data-discover":!T&&l==="render"?"true":void 0});return O&&!T?m.createElement(m.Fragment,null,ce,m.createElement(DE,{page:_})):ce});ia.displayName="Link";var y0=m.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:s="",end:c=!1,style:u,to:f,viewTransition:p,children:g,...v},x){let y=ii(f,{relative:v.relative}),b=Bn(),w=m.useContext(vu),{navigator:E,basename:j}=m.useContext(Xn),C=w!=null&&GE(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=yr(T,j)||T);const D=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let _=M===R||!c&&M.startsWith(R)&&M.charAt(D)==="/",A=T!=null&&(T===R||!c&&T.startsWith(R)&&T.charAt(R.length)==="/"),U={isActive:_,isPending:A,isTransitioning:C},O=_?a:void 0,q;typeof s=="function"?q=s(U):q=[s,_?"active":null,A?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let K=typeof u=="function"?u(U):u;return m.createElement(ia,{...v,"aria-current":O,className:q,ref:x,style:K,to:f,viewTransition:p},typeof g=="function"?g(U):g)});y0.displayName="NavLink";var BE=m.forwardRef(({discover:n="render",fetcherKey:a,navigate:l,reloadDocument:s,replace:c,state:u,method:f=Fc,action:p,onSubmit:g,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b,...w},E)=>{let{useTransitions:j}=m.useContext(Xn),C=$E(),R=YE(p,{relative:v}),M=f.toLowerCase()==="get"?"get":"post",T=typeof p=="string"&&jm.test(p),D=_=>{if(g&&g(_),_.defaultPrevented)return;_.preventDefault();let A=_.nativeEvent.submitter,U=(A==null?void 0:A.getAttribute("formmethod"))||f,O=()=>C(A||_.currentTarget,{fetcherKey:a,method:U,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:s?g:D,...w,"data-discover":!T&&n==="render"?"true":void 0})});BE.displayName="Form";function HE(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function b0(n){let a=m.useContext(Ps);return Dt(a,HE(n)),a}function IE(n,{target:a,replace:l,mask:s,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g,useTransitions:v}={}){let x=oi(),y=Bn(),b=ii(n,{relative:f});return m.useCallback(w=>{if(vE(w,a)){w.preventDefault();let E=l!==void 0?l:Zo(y)===Zo(b),j=()=>x(n,{replace:E,mask:s,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g});v?m.startTransition(()=>j()):j()}},[y,x,b,l,s,c,a,n,u,f,p,g,v])}function PE(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(qh(n)),l=m.useRef(!1),s=Bn(),c=m.useMemo(()=>xE(s.search,l.current?null:a.current),[s.search]),u=oi(),f=m.useCallback((p,g)=>{const v=qh(typeof p=="function"?p(new URLSearchParams(c)):p);l.current=!0,u("?"+v,g)},[u,c]);return[c,f]}var qE=0,VE=()=>`__${String(++qE)}__`;function $E(){let{router:n}=b0("useSubmit"),{basename:a}=m.useContext(Xn),l=iE(),s=n.fetch,c=n.navigate;return m.useCallback(async(u,f={})=>{let{action:p,method:g,encType:v,formData:x,body:y}=wE(u,a);if(f.navigate===!1){let b=f.fetcherKey||VE();await s(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})},[s,c,a,l])}function YE(n,{relative:a}={}){let{basename:l}=m.useContext(Xn),s=m.useContext($a);Dt(s,"useFormAction must be used inside a RouteContext");let[c]=s.matches.slice(-1),u={...ii(n||".",{relative:a})},f=Bn();if(n==null){u.search=f.search;let p=new URLSearchParams(u.search),g=p.getAll("index");if(g.some(x=>x==="")){p.delete("index"),g.filter(y=>y).forEach(y=>p.append("index",y));let x=p.toString();u.search=x?`?${x}`:""}}return(!n||n===".")&&c.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(u.pathname=u.pathname==="/"?l:Ea([l,u.pathname])),Zo(u)}function GE(n,{relative:a}={}){let l=m.useContext(u0);Dt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=b0("useViewTransitionState"),c=ii(n,{relative:a});if(!l.isTransitioning)return!1;let u=yr(l.currentLocation.pathname,s)||l.currentLocation.pathname,f=yr(l.nextLocation.pathname,s)||l.nextLocation.pathname;return tu(c.pathname,f)!=null||tu(c.pathname,u)!=null}var Ca=Jb();const FE=wm(Ca),bu="",au="x-csrf-token",Zy=new Set(["/api/admin/login","/api/admin/setup"]);let Dl=null,vh=null;async function Dm(){return Dl||(vh??(vh=fetch(`${bu}/api/admin/csrf`,{credentials:"include"}).then(async n=>{if(!n.ok)throw new Error("Unable to acquire CSRF token");return Dl=(await n.json()).csrfToken,Dl}).finally(()=>{vh=null})),vh)}class Om extends Error{constructor(a,l,s){var c;super(typeof s=="object"&&s&&"error"in s?String(((c=s.error)==null?void 0:c.message)??s):"Request failed"),this.status=a,this.type=l,this.body=s}}async function w0(n){var s;const a=await n.text();let l;try{l=a?JSON.parse(a):void 0}catch{l=a}if(!n.ok)throw new Om(n.status,typeof l=="object"&&l&&"error"in l?String(((s=l.error)==null?void 0:s.type)??"error"):"error",l);return l}async function As(n,a,l,s,c=!0){const u=l!==void 0,f={...s==null?void 0:s.headers};u&&!f["content-type"]&&(f["content-type"]="application/json"),n!=="GET"&&n!=="HEAD"&&!Zy.has(a)&&!f[au]&&(f[au]=await Dm());const p=await fetch(`${bu}${a}`,{...s,method:n,headers:f,body:u?JSON.stringify(l):void 0,credentials:"include"});try{return await w0(p)}catch(g){const v=g instanceof Om&&(g.status===401||g.status===403)&&(g.type==="authentication_error"||g.type==="csrf_error");if(c&&v&&n!=="GET"&&n!=="HEAD"&&!Zy.has(a))return Dl=null,As(n,a,l,s,!1);throw g}}async function S0(n,a,l=!0){const s=await fetch(`${bu}${n}`,{method:"POST",headers:{[au]:await Dm()},body:a,credentials:"include"});try{return await w0(s)}catch(c){const u=c instanceof Om&&(c.status===401||c.status===403)&&(c.type==="authentication_error"||c.type==="csrf_error");if(l&&u)return Dl=null,S0(n,a,!1);throw c}}async function _m(n,a,l=!0){const s={...a==null?void 0:a.headers,[au]:await Dm()},c=await fetch(`${bu}${n}`,{...a,headers:s,credentials:"include"});return l&&c.status===403?(Dl=null,_m(n,a,!1)):c}const Ce={get:(n,a)=>As("GET",n,void 0,a),post:(n,a,l)=>As("POST",n,a,l),upload:S0,patch:(n,a,l)=>As("PATCH",n,a,l),put:(n,a,l)=>As("PUT",n,a,l),del:(n,a)=>As("DELETE",n,void 0,a)},j0=m.createContext(void 0);function KE({children:n}){const[a,l]=m.useState(null),[s,c]=m.useState(!0),u=m.useCallback(async()=>{try{const g=await Ce.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 Ce.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 Ce.post("/api/admin/logout"),l(null)},[]);return o.jsx(j0.Provider,{value:{user:a,loading:s,login:f,logout:p,refresh:u},children:n})}function km(){const n=m.useContext(j0);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 XE=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),C0=(...n)=>n.filter((a,l,s)=>!!a&&a.trim()!==""&&s.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 QE={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 ZE=m.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:s,className:c="",children:u,iconNode:f,...p},g)=>m.createElement("svg",{ref:g,...QE,width:a,height:a,stroke:n,strokeWidth:s?Number(l)*24/Number(a):l,className:C0("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 _e=(n,a)=>{const l=m.forwardRef(({className:s,...c},u)=>m.createElement(ZE,{ref:u,iconNode:a,className:C0(`lucide-${XE(n)}`,s),...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 zm=_e("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 JE=_e("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 WE=_e("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 eR=_e("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 E0=_e("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 tR=_e("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 nR=_e("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 ci=_e("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 aR=_e("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 rR=_e("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 lR=_e("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 sR=_e("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 Xc=_e("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 oR=_e("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 iR=_e("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 R0=_e("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 cR=_e("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 uR=_e("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 dR=_e("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 N0=_e("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 fR=_e("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 T0=_e("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 M0=_e("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 _s=_e("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 hR=_e("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 mR=_e("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 pR=_e("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 A0=_e("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 gR=_e("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 D0=_e("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 wu=_e("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 vR=_e("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 xR=_e("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 O0=_e("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 yR=_e("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 bR=_e("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 wR=_e("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 SR=_e("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 Su=_e("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 jR=_e("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 _0=_e("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 CR=_e("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 ju=_e("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 ER=_e("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 k0(n){var a,l,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(a=0;a<c;a++)n[a]&&(l=k0(n[a]))&&(s&&(s+=" "),s+=l)}else for(l in n)n[l]&&(s&&(s+=" "),s+=l);return s}function z0(){for(var n,a,l=0,s="",c=arguments.length;l<c;l++)(n=arguments[l])&&(a=k0(n))&&(s&&(s+=" "),s+=a);return s}const Lm="-",RR=n=>{const a=TR(n),{conflictingClassGroups:l,conflictingClassGroupModifiers:s}=n;return{getClassGroupId:f=>{const p=f.split(Lm);return p[0]===""&&p.length!==1&&p.shift(),L0(p,a)||NR(f)},getConflictingClassGroupIds:(f,p)=>{const g=l[f]||[];return p&&s[f]?[...g,...s[f]]:g}}},L0=(n,a)=>{var f;if(n.length===0)return a.classGroupId;const l=n[0],s=a.nextPart.get(l),c=s?L0(n.slice(1),s):void 0;if(c)return c;if(a.validators.length===0)return;const u=n.join(Lm);return(f=a.validators.find(({validator:p})=>p(u)))==null?void 0:f.classGroupId},Jy=/^\[(.+)\]$/,NR=n=>{if(Jy.test(n)){const a=Jy.exec(n)[1],l=a==null?void 0:a.substring(0,a.indexOf(":"));if(l)return"arbitrary.."+l}},TR=n=>{const{theme:a,prefix:l}=n,s={nextPart:new Map,validators:[]};return AR(Object.entries(n.classGroups),l).forEach(([u,f])=>{Vh(f,s,u,a)}),s},Vh=(n,a,l,s)=>{n.forEach(c=>{if(typeof c=="string"){const u=c===""?a:Wy(a,c);u.classGroupId=l;return}if(typeof c=="function"){if(MR(c)){Vh(c(s),a,l,s);return}a.validators.push({validator:c,classGroupId:l});return}Object.entries(c).forEach(([u,f])=>{Vh(f,Wy(a,u),l,s)})})},Wy=(n,a)=>{let l=n;return a.split(Lm).forEach(s=>{l.nextPart.has(s)||l.nextPart.set(s,{nextPart:new Map,validators:[]}),l=l.nextPart.get(s)}),l},MR=n=>n.isThemeGetter,AR=(n,a)=>a?n.map(([l,s])=>{const c=s.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,DR=n=>{if(n<1)return{get:()=>{},set:()=>{}};let a=0,l=new Map,s=new Map;const c=(u,f)=>{l.set(u,f),a++,a>n&&(a=0,s=l,l=new Map)};return{get(u){let f=l.get(u);if(f!==void 0)return f;if((f=s.get(u))!==void 0)return c(u,f),f},set(u,f){l.has(u)?l.set(u,f):c(u,f)}}},U0="!",OR=n=>{const{separator:a,experimentalParseClassName:l}=n,s=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&&(s||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(U0),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},_R=n=>{if(n.length<=1)return n;const a=[];let l=[];return n.forEach(s=>{s[0]==="["?(a.push(...l.sort(),s),l=[]):l.push(s)}),a.push(...l.sort()),a},kR=n=>({cache:DR(n.cacheSize),parseClassName:OR(n),...RR(n)}),zR=/\s+/,LR=(n,a)=>{const{parseClassName:l,getClassGroupId:s,getConflictingClassGroupIds:c}=a,u=[],f=n.trim().split(zR);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=s(E?b.substring(0,w):b);if(!j){if(!E){p=v+(p.length>0?" "+p:p);continue}if(j=s(b),!j){p=v+(p.length>0?" "+p:p);continue}E=!1}const C=_R(x).join(":"),R=y?C+U0:C,M=R+j;if(u.includes(M))continue;u.push(M);const T=c(j,E);for(let D=0;D<T.length;++D){const _=T[D];u.push(R+_)}p=v+(p.length>0?" "+p:p)}return p};function UR(){let n=0,a,l,s="";for(;n<arguments.length;)(a=arguments[n++])&&(l=B0(a))&&(s&&(s+=" "),s+=l);return s}const B0=n=>{if(typeof n=="string")return n;let a,l="";for(let s=0;s<n.length;s++)n[s]&&(a=B0(n[s]))&&(l&&(l+=" "),l+=a);return l};function BR(n,...a){let l,s,c,u=f;function f(g){const v=a.reduce((x,y)=>y(x),n());return l=kR(v),s=l.cache.get,c=l.cache.set,u=p,p(g)}function p(g){const v=s(g);if(v)return v;const x=LR(g,l);return c(g,x),x}return function(){return u(UR.apply(null,arguments))}}const Tt=n=>{const a=l=>l[n]||[];return a.isThemeGetter=!0,a},H0=/^\[(?:([a-z-]+):)?(.+)\]$/i,HR=/^\d+\/\d+$/,IR=new Set(["px","full","screen"]),PR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qR=/\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$/,VR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$R=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,YR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hr=n=>ks(n)||IR.has(n)||HR.test(n),Wr=n=>Vs(n,"length",WR),ks=n=>!!n&&!Number.isNaN(Number(n)),xh=n=>Vs(n,"number",ks),Go=n=>!!n&&Number.isInteger(Number(n)),GR=n=>n.endsWith("%")&&ks(n.slice(0,-1)),Be=n=>H0.test(n),el=n=>PR.test(n),FR=new Set(["length","size","percentage"]),KR=n=>Vs(n,FR,I0),XR=n=>Vs(n,"position",I0),QR=new Set(["image","url"]),ZR=n=>Vs(n,QR,tN),JR=n=>Vs(n,"",eN),Fo=()=>!0,Vs=(n,a,l)=>{const s=H0.exec(n);return s?s[1]?typeof a=="string"?s[1]===a:a.has(s[1]):l(s[2]):!1},WR=n=>qR.test(n)&&!VR.test(n),I0=()=>!1,eN=n=>$R.test(n),tN=n=>YR.test(n),nN=()=>{const n=Tt("colors"),a=Tt("spacing"),l=Tt("blur"),s=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"),D=Tt("scale"),_=Tt("sepia"),A=Tt("skew"),U=Tt("space"),O=Tt("translate"),q=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",Be,a],G=()=>[Be,a],ie=()=>["",hr,Wr],ce=()=>["auto",ks,Be],le=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["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"],Q=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",Be],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[ks,Be];return{cacheSize:500,separator:":",theme:{colors:[Fo],spacing:[hr,Wr],blur:["none","",el,Be],brightness:z(),borderColor:[n],borderRadius:["none","","full",el,Be],borderSpacing:G(),borderWidth:ie(),contrast:z(),grayscale:J(),hueRotate:z(),invert:J(),gap:G(),gradientColorStops:[n],gradientColorStopPositions:[GR,Wr],inset:te(),margin:te(),opacity:z(),padding:G(),saturate:z(),scale:z(),sepia:J(),skew:z(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",Be]}],container:["container"],columns:[{columns:[el]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"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:[...le(),Be]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],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,Be]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Be]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",Go,Be]}],"grid-cols":[{"grid-cols":[Fo]}],"col-start-end":[{col:["auto",{span:["full",Go,Be]},Be]}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":[Fo]}],"row-start-end":[{row:["auto",{span:[Go,Be]},Be]}],"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",Be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Be]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"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":[U]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[U]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Be,a]}],"min-w":[{"min-w":[Be,a,"min","max","fit"]}],"max-w":[{"max-w":[Be,a,"none","full","min","max","fit","prose",{screen:[el]},el]}],h:[{h:[Be,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Be,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Be,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Be,a,"auto","min","max","fit"]}],"font-size":[{text:["base",el,Wr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",xh]}],"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",Be]}],"line-clamp":[{"line-clamp":["none",ks,xh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",hr,Be]}],"list-image":[{"list-image":["none",Be]}],"list-style-type":[{list:["none","disc","decimal",Be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",hr,Wr]}],"underline-offset":[{"underline-offset":["auto",hr,Be]}],"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",Be]}],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",Be]}],"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:[...le(),XR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",KR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ZR]}],"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:[...k(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[R]}],"divide-style":[{divide:k()}],"border-color":[{border:[c]}],"border-color-x":[{"border-x":[c]}],"border-color-y":[{"border-y":[c]}],"border-color-s":[{"border-s":[c]}],"border-color-e":[{"border-e":[c]}],"border-color-t":[{"border-t":[c]}],"border-color-r":[{"border-r":[c]}],"border-color-b":[{"border-b":[c]}],"border-color-l":[{"border-l":[c]}],"divide-color":[{divide:[c]}],"outline-style":[{outline:["",...k()]}],"outline-offset":[{"outline-offset":[hr,Be]}],"outline-w":[{outline:[hr,Wr]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[hr,Wr]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",el,JR]}],"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:[s]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",el,Be]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[T]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[l]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"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":[_]}],"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",Be]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",Be]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[D]}],"scale-x":[{"scale-x":[D]}],"scale-y":[{"scale-y":[D]}],rotate:[{rotate:[Go,Be]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Be]}],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",Be]}],"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",Be]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[hr,Wr,xh]}],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"]}}},aN=BR(nN);function Ee(...n){return aN(z0(n))}function Jt(n,a="—"){return n==null||Number.isNaN(n)?a:n.toLocaleString()}function Cu(n,a=1,l="—"){return n==null||Number.isNaN(n)?l:`${(n*100).toFixed(a)}%`}function Ol(n){return n?n<1e3?`${Math.round(n)} ms`:`${(n/1e3).toFixed(2)} s`:"—"}function Um(n){if(!n)return"—";try{return new Date(n).toLocaleString()}catch{return n}}function rN(n,a=8){return n?n.length>a?`${n.slice(0,a)}…`:n:"—"}function lN(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 s=Math.floor(l/60);if(s<60)return`${s}m ago`;const c=Math.floor(s/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const sN=[{to:"/",label:"Dashboard",icon:N0,end:!0},{to:"/providers",label:"Providers",icon:A0},{to:"/models",label:"Models",icon:eR},{to:"/combos",label:"Combos",icon:M0},{to:"/aliases",label:"Aliases",icon:lR},{to:"/api-keys",label:"API Keys",icon:T0},{to:"/requests",label:"Requests",icon:zm},{to:"/statistics",label:"Statistics",icon:uR},{to:"/audit",label:"Audit Logs",icon:xR},{to:"/settings",label:"Settings",icon:sR}];function oN(){const[n,a]=m.useState(null);return m.useEffect(()=>{let l=!1;return fetch("/api/admin/settings/system",{credentials:"include"}).then(s=>s.ok?s.json():null).then(s=>{!l&&(s!=null&&s.appVersion)&&a(s.appVersion)}).catch(()=>{}),()=>{l=!0}},[]),o.jsxs("aside",{className:"hidden w-60 shrink-0 border-r bg-sidebar text-sidebar-foreground md:flex md:flex-col",children:[o.jsxs("div",{className:"flex h-14 items-center gap-2 border-b px-4",children:[o.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-7 w-7 object-contain"}),o.jsx("div",{className:"font-semibold tracking-tight",children:"LateDev Router"})]}),o.jsx("nav",{className:"flex-1 space-y-0.5 p-2",children:sN.map(l=>o.jsxs(y0,{to:l.to,end:l.end,className:({isActive:s})=>Ee("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors",s?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[o.jsx(l.icon,{className:"h-4 w-4"}),l.label]},l.to))}),o.jsxs("div",{className:"border-t p-3 text-xs text-muted-foreground flex items-center gap-2",children:[o.jsx(yR,{className:"h-3.5 w-3.5 text-primary"})," ",n?`v${n}`:"v…"]})]})}var iN=Object.defineProperty,Bm=(n,a)=>iN(n,"name",{value:a,configurable:!0});function $h(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}Bm($h,"setRef");function P0(...n){return a=>{let l=!1;const s=n.map(c=>{const u=$h(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c<s.length;c++){const u=s[c];typeof u=="function"?u():$h(n[c],null)}}}}Bm(P0,"composeRefs");function Ke(...n){return m.useCallback(P0(...n),n)}Bm(Ke,"useComposedRefs");var cN=Object.defineProperty,Aa=(n,a)=>cN(n,"name",{value:a,configurable:!0});function Ia(n){const a=m.forwardRef((l,s)=>{let{children:c,...u}=l,f=null,p=!1;const g=[];Yh(c)&&typeof Oc=="function"&&(c=Oc(c._payload)),m.Children.forEach(c,b=>{var w;if(G0(b)){p=!0;const E=b;let j="child"in E.props?E.props.child:E.props.children;Yh(j)&&typeof Oc=="function"&&(j=Oc(j._payload)),f=dN(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?Y0(f):void 0,x=Ke(s,v);if(!f){if(c||c===0)throw new Error(p?mN(n):hN(n));return c}const y=$0(u,f.props??{});return f.type!==m.Fragment&&(y.ref=s?x:v),m.cloneElement(f,y)});return a.displayName=`${n}.Slot`,a}Aa(Ia,"createSlot");var uN=Ia("Slot"),q0=Symbol.for("radix.slottable");function V0(n){const a=Aa(l=>"child"in l?l.children(l.child):l.children,"Slottable");return a.displayName=`${n}.Slottable`,a.__radixId=q0,a}Aa(V0,"createSlottable");var dN=Aa((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 $0(n,a){const l={...a};for(const s in a){const c=n[s],u=a[s];/^on[A-Z]/.test(s)?c&&u?l[s]=(...p)=>{const g=u(...p);return c(...p),g}:c&&(l[s]=c):s==="style"?l[s]={...c,...u}:s==="className"&&(l[s]=[c,u].filter(Boolean).join(" "))}return{...n,...l}}Aa($0,"mergeProps");function Y0(n){var s,c;let a=(s=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:s.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)}Aa(Y0,"getElementRef");function G0(n){return m.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===q0}Aa(G0,"isSlottable");var fN=Symbol.for("react.lazy");function Yh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===fN&&"_payload"in n&&F0(n._payload)}Aa(Yh,"isLazyComponent");function F0(n){return typeof n=="object"&&n!==null&&"then"in n}Aa(F0,"isPromiseLike");var hN=Aa(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),mN=Aa(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Oc=Hs[" use ".trim().toString()];const eb=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,tb=z0,K0=(n,a)=>l=>{var s;if((a==null?void 0:a.variants)==null)return tb(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=eb(x)||eb(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||(s=a.compoundVariants)===null||s===void 0?void 0:s.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 tb(n,f,g,l==null?void 0:l.class,l==null?void 0:l.className)},pN=K0("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"}}),he=m.forwardRef(({className:n,variant:a,size:l,asChild:s=!1,...c},u)=>{const f=s?uN:"button";return o.jsx(f,{className:Ee(pN({variant:a,size:l,className:n})),ref:u,...c})});he.displayName="Button";const X0=m.createContext(void 0);function gN({children:n,defaultTheme:a="system",storageKey:l="latedev-theme"}){const[s,c]=m.useState(()=>localStorage.getItem(l)||a);m.useEffect(()=>{const f=window.document.documentElement;if(f.classList.remove("light","dark"),s==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(p);return}f.classList.add(s)},[s]);const u={theme:s,setTheme:f=>{localStorage.setItem(l,f),c(f)}};return o.jsx(X0.Provider,{value:u,children:n})}function vN(){const n=m.useContext(X0);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}var xN=Object.defineProperty,$s=(n,a)=>xN(n,"name",{value:a,configurable:!0}),Q0=!!(typeof window<"u"&&window.document&&window.document.createElement);function Te(n,a,{checkForDefaultPrevented:l=!0}={}){return $s(function(c){if(n==null||n(c),l===!1||!c||!c.defaultPrevented)return a==null?void 0:a(c)},"handleEvent")}$s(Te,"composeEventHandlers");function yN(n){var a;if(!Q0)throw new Error("Cannot access window outside of the DOM");return((a=n==null?void 0:n.ownerDocument)==null?void 0:a.defaultView)??window}$s(yN,"getOwnerWindow");function Gh(n){if(!Q0)throw new Error("Cannot access document outside of the DOM");return(n==null?void 0:n.ownerDocument)??document}$s(Gh,"getOwnerDocument");function Z0(n,a=!1){const{activeElement:l}=Gh(n);if(!(l!=null&&l.nodeName))return null;if(J0(l)&&l.contentDocument)return Z0(l.contentDocument.body,a);if(a){const s=l.getAttribute("aria-activedescendant");if(s){const c=Gh(l).getElementById(s);if(c)return c}}return l}$s(Z0,"getActiveElement");function J0(n){return n.tagName==="IFRAME"}$s(J0,"isFrame");var bN=Object.defineProperty,ua=(n,a)=>bN(n,"name",{value:a,configurable:!0});function wN(n,a){const l=m.createContext(a);l.displayName=n+"Context";const s=ua(u=>{const{children:f,...p}=u,g=m.useMemo(()=>p,Object.values(p));return o.jsx(l.Provider,{value:g,children:f})},"Provider");s.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"),[s,c]}ua(wN,"createContext");function Hn(n,a=[]){let l=[];function s(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 o.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(s,"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,[s,W0(c,...a)]}ua(Hn,"createContextScope");function W0(...n){const a=n[0];if(n.length===1)return a;const l=ua(()=>{const s=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return ua(function(u){const f=s.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(W0,"composeContextScopes");var Wt=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},SN=Object.defineProperty,jN=(n,a)=>SN(n,"name",{value:a,configurable:!0}),nb=Hs[" useEffectEvent ".trim().toString()],ab=Hs[" useInsertionEffect ".trim().toString()];function e1(n){if(typeof nb=="function")return nb(n);const a=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof ab=="function"?ab(()=>{a.current=n}):Wt(()=>{a.current=n}),m.useMemo(()=>((...l)=>{var s;return(s=a.current)==null?void 0:s.call(a,...l)}),[])}jN(e1,"useEffectEvent");var CN=Object.defineProperty,ui=(n,a)=>CN(n,"name",{value:a,configurable:!0}),EN=Hs[" useInsertionEffect ".trim().toString()]||Wt;function br({prop:n,defaultProp:a,onChange:l=ui(()=>{},"onChange"),caller:s}){const[c,u,f]=t1({defaultProp:a,onChange:l}),p=n!==void 0,g=p?n:c,v=m.useCallback(x=>{var y;if(p){const b=n1(x)?x(n):x;b!==n&&((y=f.current)==null||y.call(f,b))}else u(x)},[p,n,u,f]);return[g,v]}ui(br,"useControllableState");function t1({defaultProp:n,onChange:a}){const[l,s]=m.useState(n),c=m.useRef(l),u=m.useRef(a);return EN(()=>{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,s,u]}ui(t1,"useUncontrolledState");function n1(n){return typeof n=="function"}ui(n1,"isFunction");var rb=Symbol("RADIX:SYNC_STATE");function RN(n,a,l,s){const{prop:c,defaultProp:u,onChange:f,caller:p}=a,g=c!==void 0,v=e1(f),x=[{...l,state:u}];s&&x.push(s);const[y,b]=m.useReducer((C,R)=>{if(R.type===rb)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:rb,state:c})},[c,y.state,g]),[j,b]}ui(RN,"useControllableStateReducer");var NN=Object.defineProperty,TN=(n,a)=>NN(n,"name",{value:a,configurable:!0}),MN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=MN.reduce((n,a)=>{const l=Ia(`Primitive.${a}`),s=m.forwardRef((c,u)=>{const{asChild:f,...p}=c,g=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(g,{...p,ref:u})});return s.displayName=`Primitive.${a}`,{...n,[a]:s}},{});function Hm(n,a){n&&Ca.flushSync(()=>n.dispatchEvent(a))}TN(Hm,"dispatchDiscreteCustomEvent");var AN=Object.defineProperty,sn=(n,a)=>AN(n,"name",{value:a,configurable:!0});function Eu(n){const a=n+"CollectionProvider",[l,s]=Hn(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=sn(j=>{const{scope:C,children:R}=j,M=m.useRef(null),T=m.useRef(new Map).current;return o.jsx(c,{scope:C,itemMap:T,collectionRef:M,children:R})},"CollectionProvider");f.displayName=a;const p=n+"CollectionSlot",g=Ia(p),v=m.forwardRef((j,C)=>{const{scope:R,children:M}=j,T=u(p,R),D=Ke(C,T.collectionRef);return o.jsx(g,{ref:D,children:M})});v.displayName=p;const x=n+"CollectionItemSlot",y="data-radix-collection-item",b=Ia(x),w=m.forwardRef((j,C)=>{const{scope:R,children:M,...T}=j,D=m.useRef(null),_=Ke(C,D),A=u(x,R);return m.useEffect(()=>(A.itemMap.set(D,{ref:D,...T}),()=>void A.itemMap.delete(D))),o.jsx(b,{[y]:"",ref:_,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((A,U)=>T.indexOf(A.ref.current)-T.indexOf(U.ref.current))},[C.collectionRef,C.itemMap])}return sn(E,"useCollection"),[{Provider:f,Slot:v,ItemSlot:w},E,s]}sn(Eu,"createCollection");var lb=new WeakMap,Ft,Kn,yh=(Kn=class extends Map{constructor(l){super(l);_y(this,Ft);oh(this,Ft,[...super.keys()]),lb.set(this,!0)}set(l,s){return lb.get(this)&&(this.has(l)?pn(this,Ft)[pn(this,Ft).indexOf(l)]=l:pn(this,Ft).push(l)),super.set(l,s),this}insert(l,s,c){const u=this.has(s),f=pn(this,Ft).length,p=Im(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(s,c),this;const x=this.size+(u?0:1);p<0&&g++;const y=[...pn(this,Ft)];let b,w=!1;for(let E=g;E<x;E++)if(g===E){let j=y[E];y[E]===s&&(j=y[E+1]),u&&this.delete(s),b=this.get(j),this.set(s,c)}else{!w&&y[E-1]===s&&(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,s,c){const u=new Kn(this);return u.insert(l,s,c),u}before(l){const s=pn(this,Ft).indexOf(l)-1;if(!(s<0))return this.entryAt(s)}setBefore(l,s,c){const u=pn(this,Ft).indexOf(l);return u===-1?this:this.insert(u,s,c)}after(l){let s=pn(this,Ft).indexOf(l);if(s=s===-1||s===this.size-1?-1:s+1,s!==-1)return this.entryAt(s)}setAfter(l,s,c){const u=pn(this,Ft).indexOf(l);return u===-1?this:this.insert(u+1,s,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return oh(this,Ft,[]),super.clear()}delete(l){const s=super.delete(l);return s&&pn(this,Ft).splice(pn(this,Ft).indexOf(l),1),s}deleteAt(l){const s=this.keyAt(l);return s!==void 0?this.delete(s):!1}at(l){const s=Qc(pn(this,Ft),l);if(s!==void 0)return this.get(s)}entryAt(l){const s=Qc(pn(this,Ft),l);if(s!==void 0)return[s,this.get(s)]}indexOf(l){return pn(this,Ft).indexOf(l)}keyAt(l){return Qc(pn(this,Ft),l)}from(l,s){const c=this.indexOf(l);if(c===-1)return;let u=c+s;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.at(u)}keyFrom(l,s){const c=this.indexOf(l);if(c===-1)return;let u=c+s;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.keyAt(u)}find(l,s){let c=0;for(const u of this){if(Reflect.apply(l,s,[u,c,this]))return u;c++}}findIndex(l,s){let c=0;for(const u of this){if(Reflect.apply(l,s,[u,c,this]))return c;c++}return-1}filter(l,s){const c=[];let u=0;for(const f of this)Reflect.apply(l,s,[f,u,this])&&c.push(f),u++;return new Kn(c)}map(l,s){const c=[];let u=0;for(const f of this)c.push([f[0],Reflect.apply(l,s,[f,u,this])]),u++;return new Kn(c)}reduce(...l){const[s,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(s,this,[f,p,u,this]),u++;return f}reduceRight(...l){const[s,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(s,this,[u,p,f,this])}return u}toSorted(l){const s=[...this.entries()].sort(l);return new Kn(s)}toReversed(){const l=new Kn;for(let s=this.size-1;s>=0;s--){const c=this.keyAt(s),u=this.get(c);l.set(c,u)}return l}toSpliced(...l){const s=[...this.entries()];return s.splice(...l),new Kn(s)}slice(l,s){const c=new Kn;let u=this.size-1;if(l===void 0)return c;l<0&&(l=l+this.size),s!==void 0&&s>0&&(u=s-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,s){let c=0;for(const u of this){if(!Reflect.apply(l,s,[u,c,this]))return!1;c++}return!0}some(l,s){let c=0;for(const u of this){if(Reflect.apply(l,s,[u,c,this]))return!0;c++}return!1}},Ft=new WeakMap,sn(Kn,"OrderedDict"),Kn);function Qc(n,a){if("at"in Array.prototype)return Array.prototype.at.call(n,a);const l=a1(n,a);return l===-1?void 0:n[l]}sn(Qc,"at");function a1(n,a){const l=n.length,s=Im(a),c=s>=0?s:l+s;return c<0||c>=l?-1:c}sn(a1,"toSafeIndex");function Im(n){return n!==n||n===0?0:Math.trunc(n)}sn(Im,"toSafeInteger");function DN(n){const a=n+"CollectionProvider",[l,s]=Hn(a),[c,u]=l(a,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new yh,setItemMap:sn(()=>{},"setItemMap")}),f=sn(({state:T,...D})=>T?o.jsx(g,{...D,state:T}):o.jsx(p,{...D}),"CollectionProvider");f.displayName=a;const p=sn(T=>{const D=C();return o.jsx(g,{...T,state:D})},"CollectionInit");p.displayName=a+"Init";const g=sn(T=>{const{scope:D,children:_,state:A}=T,U=m.useRef(null),[O,q]=m.useState(null),K=Ke(U,q),[te,G]=A;return m.useEffect(()=>{if(!O)return;const ie=s1(()=>{});return ie.observe(O,{childList:!0,subtree:!0}),()=>{ie.disconnect()}},[O]),o.jsx(c,{scope:D,itemMap:te,setItemMap:G,collectionRef:K,collectionRefObject:U,collectionElement:O,children:_})},"CollectionProviderImpl");g.displayName=a+"Impl";const v=n+"CollectionSlot",x=Ia(v),y=m.forwardRef((T,D)=>{const{scope:_,children:A}=T,U=u(v,_),O=Ke(D,U.collectionRef);return o.jsx(x,{ref:O,children:A})});y.displayName=v;const b=n+"CollectionItemSlot",w="data-radix-collection-item",E=Ia(b),j=m.forwardRef((T,D)=>{const{scope:_,children:A,...U}=T,O=m.useRef(null),[q,K]=m.useState(null),te=Ke(D,O,K),G=u(b,_),{setItemMap:ie}=G,ce=m.useRef(U);r1(ce.current,U)||(ce.current=U);const le=ce.current;return m.useEffect(()=>{const k=le;return ie(H=>q?H.has(q)?H.set(q,{...k,element:q}).toSorted(Fh):(H.set(q,{...k,element:q}),H.toSorted(Fh)):H),()=>{ie(H=>!q||!H.has(q)?H:(H.delete(q),new yh(H)))}},[q,le,ie]),o.jsx(E,{[w]:"",ref:te,children:A})});j.displayName=b;function C(){return m.useState(new yh)}sn(C,"useInitCollection");function R(T){const{itemMap:D}=u(n+"CollectionConsumer",T);return D}return sn(R,"useCollection"),[{Provider:f,Slot:y,ItemSlot:j},{createCollectionScope:s,useCollection:R,useInitCollection:C}]}sn(DN,"createCollection");function r1(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),s=Object.keys(a);if(l.length!==s.length)return!1;for(const c of l)if(!Object.prototype.hasOwnProperty.call(a,c)||n[c]!==a[c])return!1;return!0}sn(r1,"shallowEqual");function l1(n,a){return!!(a.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}sn(l1,"isElementPreceding");function Fh(n,a){return!n[1].element||!a[1].element?0:l1(n[1].element,a[1].element)?-1:1}sn(Fh,"sortByDocumentPosition");function s1(n){return new MutationObserver(l=>{for(const s of l)if(s.type==="childList"){n();return}})}sn(s1,"getChildListObserver");var ON=Object.defineProperty,_N=(n,a)=>ON(n,"name",{value:a,configurable:!0}),kN=m.createContext(void 0);function di(n){const a=m.useContext(kN);return n||a||"ltr"}_N(di,"useDirection");var zN=Object.defineProperty,LN=(n,a)=>zN(n,"name",{value:a,configurable:!0});function ma(n){const a=m.useRef(n);return m.useEffect(()=>{a.current=n}),m.useMemo(()=>((...l)=>{var s;return(s=a.current)==null?void 0:s.call(a,...l)}),[])}LN(ma,"useCallbackRef");var UN=Object.defineProperty,ln=(n,a)=>UN(n,"name",{value:a,configurable:!0}),Kh="dismissableLayer.update",BN="dismissableLayer.pointerDownOutside",HN="dismissableLayer.focusOutside",sb,o1=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ru=m.forwardRef(ln(function(a,l){const{disableOutsidePointerEvents:s=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:g,onDismiss:v,...x}=a,y=m.useContext(o1),[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,D=b?R.indexOf(b):-1,_=y.layersWithOutsidePointerEventsDisabled.size>0,A=D>=T,U=m.useRef(!1),O=c1(G=>{f==null||f(G),g==null||g(G),G.defaultPrevented||v==null||v()},{ownerDocument:E,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:U,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(G=>{if(!(G instanceof Node))return!1;const ie=[...y.branches].some(ce=>ce.contains(G));return A&&!ie},[y.branches,A])}),q=u1(G=>{if(c&&U.current)return;const ie=G.target;[...y.branches].some(le=>le.contains(ie))||(p==null||p(G),g==null||g(G),G.defaultPrevented||v==null||v())},E),K=b?D===R.length-1:!1,te=ma(G=>{G.key==="Escape"&&(u==null||u(G),!G.defaultPrevented&&v&&(G.preventDefault(),v()))});return m.useEffect(()=>{if(K)return E.addEventListener("keydown",te,{capture:!0}),()=>E.removeEventListener("keydown",te,{capture:!0})},[E,K,te]),m.useEffect(()=>{if(b)return s&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(sb=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(b)),y.layers.add(b),Xh(),()=>{s&&(y.layersWithOutsidePointerEventsDisabled.delete(b),y.layersWithOutsidePointerEventsDisabled.size===0&&(E.body.style.pointerEvents=sb))}},[b,E,s,y]),m.useEffect(()=>()=>{b&&(y.layers.delete(b),y.layersWithOutsidePointerEventsDisabled.delete(b),Xh())},[b,y]),m.useEffect(()=>{const G=ln(()=>j({}),"handleUpdate");return document.addEventListener(Kh,G),()=>document.removeEventListener(Kh,G)},[]),o.jsx(Pe.div,{...x,ref:C,style:{pointerEvents:_?A?"auto":"none":void 0,...a.style},onFocusCapture:Te(a.onFocusCapture,q.onFocusCapture),onBlurCapture:Te(a.onBlurCapture,q.onBlurCapture),onPointerDownCapture:Te(a.onPointerDownCapture,O.onPointerDownCapture)})},"DismissableLayer"));function i1(){const n=m.useContext(o1),[a,l]=m.useState(null);return m.useEffect(()=>{if(a)return n.dismissableSurfaces.add(a),()=>{n.dismissableSurfaces.delete(a)}},[a,n.dismissableSurfaces]),l}ln(i1,"useDismissableLayerSurface");var IN=ln(()=>!0,"IS_TRUE");function c1(n,a){const{ownerDocument:l=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:s=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:u,shouldHandlePointerDownOutside:f=IN}=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()}ln(b,"resetOutsideInteraction");function w(){return Array.from(x.current.values()).some(Boolean)}ln(w,"isOutsideInteractionIntercepted");function E(T){if(!v.current)return;const D=T.target;D instanceof Node&&[...u].some(A=>A.contains(D))||x.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{v.current&&y.current()},0)}ln(E,"handleInteractionCapture");function j(T){v.current&&x.current.set(T.type,!1)}ln(j,"handleInteractionBubble");const C=ln(T=>{if(T.target&&!g.current){let D=function(){l.removeEventListener("click",y.current);const A=w();b(),A||Pm(BN,p,_,{discrete:!0})};if(ln(D,"handleAndDispatchPointerDownOutsideEvent"),!f(T.target)){l.removeEventListener("click",y.current),b(),g.current=!1;return}const _={originalEvent:T};v.current=!0,c.current=s&&T.button===0,x.current.clear(),!s||T.button!==0?D():(l.removeEventListener("click",y.current),y.current=D,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,s,c,u,f]),{onPointerDownCapture:ln(()=>g.current=!0,"onPointerDownCapture")}}ln(c1,"usePointerDownOutside");function u1(n,a=globalThis==null?void 0:globalThis.document){const l=ma(n),s=m.useRef(!1);return m.useEffect(()=>{const c=ln(u=>{u.target&&!s.current&&Pm(HN,l,{originalEvent:u},{discrete:!1})},"handleFocus");return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:ln(()=>s.current=!0,"onFocusCapture"),onBlurCapture:ln(()=>s.current=!1,"onBlurCapture")}}ln(u1,"useFocusOutside");function Xh(){const n=new CustomEvent(Kh);document.dispatchEvent(n)}ln(Xh,"dispatchUpdate");function Pm(n,a,l,{discrete:s}){const c=l.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(n,a,{once:!0}),s?Hm(c,u):c.dispatchEvent(u)}ln(Pm,"handleAndDispatchCustomEvent");var PN=Object.defineProperty,qm=(n,a)=>PN(n,"name",{value:a,configurable:!0}),_c=0,La=null;function qN(n){return fi(),n.children}qm(qN,"FocusGuards");function fi(){m.useEffect(()=>{La||(La={start:Qh(),end:Qh()});const{start:n,end:a}=La;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==a&&document.body.insertAdjacentElement("beforeend",a),_c++,()=>{_c===1&&(La==null||La.start.remove(),La==null||La.end.remove(),La=null),_c=Math.max(0,_c-1)}},[])}qm(fi,"useFocusGuards");function Qh(){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}qm(Qh,"createFocusGuard");var VN=Object.defineProperty,yn=(n,a)=>VN(n,"name",{value:a,configurable:!0}),bh="focusScope.autoFocusOnMount",wh="focusScope.autoFocusOnUnmount",ob={bubbles:!1,cancelable:!0},Vm=m.forwardRef(yn(function(a,l){const{loop:s=!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(D){if(E.paused||!g)return;const _=D.target;g.contains(_)?b.current=_:mr(b.current,{select:!0})},R=function(D){if(E.paused||!g)return;const _=D.relatedTarget;_!==null&&(g.contains(_)||mr(b.current,{select:!0}))},M=function(D){if(document.activeElement===document.body)for(const A of D)A.removedNodes.length>0&&mr(g)};yn(C,"handleFocusIn"),yn(R,"handleFocusOut"),yn(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){ib.add(E);const C=document.activeElement;if(!g.contains(C)){const M=new CustomEvent(bh,ob);g.addEventListener(bh,x),g.dispatchEvent(M),M.defaultPrevented||(d1(g1($m(g)),{select:!0}),document.activeElement===C&&mr(g))}return()=>{g.removeEventListener(bh,x),setTimeout(()=>{const M=new CustomEvent(wh,ob);g.addEventListener(wh,y),g.dispatchEvent(M),M.defaultPrevented||mr(C??document.body,{select:!0}),g.removeEventListener(wh,y),ib.remove(E)},0)}}},[g,x,y,E]);const j=m.useCallback(C=>{if(!s&&!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,[D,_]=f1(T);D&&_?!C.shiftKey&&M===_?(C.preventDefault(),s&&mr(D,{select:!0})):C.shiftKey&&M===D&&(C.preventDefault(),s&&mr(_,{select:!0})):M===T&&C.preventDefault()}},[s,c,E.paused]);return o.jsx(Pe.div,{tabIndex:-1,...p,ref:w,onKeyDown:j})},"FocusScope"));function d1(n,{select:a=!1}={}){const l=document.activeElement;for(const s of n)if(mr(s,{select:a}),document.activeElement!==l)return}yn(d1,"focusFirst");function f1(n){const a=$m(n),l=Zh(a,n),s=Zh(a.reverse(),n);return[l,s]}yn(f1,"getTabbableEdges");function $m(n){const a=[],l=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:yn(s=>{const c=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||c?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;l.nextNode();)a.push(l.currentNode);return a}yn($m,"getTabbableCandidates");function Zh(n,a){const l=typeof a.checkVisibility=="function"&&a.checkVisibility({checkVisibilityCSS:!0});for(const s of n)if(!(l?!s.checkVisibility({checkVisibilityCSS:!0}):h1(s,{upTo:a})))return s}yn(Zh,"findVisible");function h1(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}yn(h1,"isHidden");function m1(n){return n instanceof HTMLInputElement&&"select"in n}yn(m1,"isSelectableInput");function mr(n,{select:a=!1}={}){if(n&&n.focus){const l=document.activeElement;n.focus({preventScroll:!0}),n!==l&&m1(n)&&a&&n.select()}}yn(mr,"focus");var ib=p1();function p1(){let n=[];return{add(a){const l=n[0];a!==l&&(l==null||l.pause()),n=Jh(n,a),n.unshift(a)},remove(a){var l;n=Jh(n,a),(l=n[0])==null||l.resume()}}}yn(p1,"createFocusScopesStack");function Jh(n,a){const l=[...n],s=l.indexOf(a);return s!==-1&&l.splice(s,1),l}yn(Jh,"arrayRemove");function g1(n){return n.filter(a=>a.tagName!=="A")}yn(g1,"removeLinks");var $N=Object.defineProperty,YN=(n,a)=>$N(n,"name",{value:a,configurable:!0}),GN=Hs[" useId ".trim().toString()]||(()=>{}),FN=0;function Ha(n){const[a,l]=m.useState(GN());return Wt(()=>{n||l(s=>s??String(FN++))},[n]),n||(a?`radix-${a}`:"")}YN(Ha,"useId");const KN=["top","right","bottom","left"],ol=Math.min,gr=Math.max,ru=Math.round,kc=Math.floor,vr=n=>({x:n,y:n}),XN={left:"right",right:"left",bottom:"top",top:"bottom"};function v1(n,a,l){return gr(n,ol(a,l))}function wr(n,a){return typeof n=="function"?n(a):n}function il(n){return n.split("-")[0]}function Ys(n){return n.split("-")[1]}function Ym(n){return n==="x"?"y":"x"}function Gm(n){return n==="y"?"height":"width"}function Ba(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function Fm(n){return Ym(Ba(n))}function QN(n,a,l){l===void 0&&(l=!1);const s=Ys(n),c=Fm(n),u=Gm(c);let f=c==="x"?s===(l?"end":"start")?"right":"left":s==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=lu(f)),[f,lu(f)]}function ZN(n){const a=lu(n);return[Wh(n),a,Wh(a)]}function Wh(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const cb=["left","right"],ub=["right","left"],JN=["top","bottom"],WN=["bottom","top"];function eT(n,a,l){switch(n){case"top":case"bottom":return l?a?ub:cb:a?cb:ub;case"left":case"right":return a?JN:WN;default:return[]}}function tT(n,a,l,s){const c=Ys(n);let u=eT(il(n),l==="start",s);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(Wh)))),u}function lu(n){const a=il(n);return XN[a]+n.slice(a.length)}function nT(n){var a,l,s,c;return{top:(a=n.top)!=null?a:0,right:(l=n.right)!=null?l:0,bottom:(s=n.bottom)!=null?s:0,left:(c=n.left)!=null?c:0}}function x1(n){return typeof n!="number"?nT(n):{top:n,right:n,bottom:n,left:n}}function su(n){const{x:a,y:l,width:s,height:c}=n;return{width:s,height:c,top:l,left:a,right:a+s,bottom:l+c,x:a,y:l}}function db(n,a,l){let{reference:s,floating:c}=n;const u=Ba(a),f=Fm(a),p=Gm(f),g=il(a),v=u==="y",x=s.x+s.width/2-c.width/2,y=s.y+s.height/2-c.height/2,b=s[p]/2-c[p]/2;let w;switch(g){case"top":w={x,y:s.y-c.height};break;case"bottom":w={x,y:s.y+s.height};break;case"right":w={x:s.x+s.width,y};break;case"left":w={x:s.x-c.width,y};break;default:w={x:s.x,y:s.y}}const E=Ys(a);return E&&(w[f]+=b*(E==="end"?1:-1)*(l&&v?-1:1)),w}async function aT(n,a){var l;a===void 0&&(a={});const{x:s,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}=wr(a,n),E=x1(w),C=p[b?y==="floating"?"reference":"floating":y],R=su(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:s,y:c,width:f.floating.width,height:f.floating.height}:f.reference,T=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),D=await(u.isElement==null?void 0:u.isElement(T))&&await(u.getScale==null?void 0:u.getScale(T))||{x:1,y:1},_=su(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:M,offsetParent:T,strategy:g}):M);return{top:(R.top-_.top+E.top)/D.y,bottom:(_.bottom-R.bottom+E.bottom)/D.y,left:(R.left-_.left+E.left)/D.x,right:(_.right-R.right+E.right)/D.x}}const rT=50,lT=async(n,a,l)=>{const{placement:s="bottom",strategy:c="absolute",middleware:u=[],platform:f}=l,p=f.detectOverflow?f:{...f,detectOverflow:aT},g=await(f.isRTL==null?void 0:f.isRTL(a));let v=await f.getElementRects({reference:n,floating:a,strategy:c}),{x,y}=db(v,s,g),b=s,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:D,data:_,reset:A}=await M({x,y,initialPlacement:s,placement:b,strategy:c,middlewareData:E,rects:v,platform:p,elements:{reference:n,floating:a}});x=T??x,y=D??y,E[R]={...E[R],..._},A&&w<rT&&(w++,typeof A=="object"&&(A.placement&&(b=A.placement),A.rects&&(v=A.rects===!0?await f.getElementRects({reference:n,floating:a,strategy:c}):A.rects),{x,y}=db(v,b,g)),j=-1)}return{x,y,placement:b,strategy:c,middlewareData:E}},sT=n=>({name:"arrow",options:n,async fn(a){const{x:l,y:s,placement:c,rects:u,platform:f,elements:p,middlewareData:g}=a,{element:v,padding:x=0}=wr(n,a)||{};if(v==null)return{};const y=x1(x),b={x:l,y:s},w=Fm(c),E=Gm(w),j=await f.getDimensions(v),C=w==="y",R=C?"top":"left",M=C?"bottom":"right",T=C?"clientHeight":"clientWidth",D=u.reference[E]+u.reference[w]-b[w]-u.floating[E],_=b[w]-u.reference[w],A=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v));let U=A?A[T]:0;(!U||!await(f.isElement==null?void 0:f.isElement(A)))&&(U=p.floating[T]||u.floating[E]);const O=D/2-_/2,q=U/2-j[E]/2-1,K=ol(y[R],q),te=ol(y[M],q),G=U-j[E]-te,ie=U/2-j[E]/2+O,ce=v1(K,ie,G),le=!g.arrow&&Ys(c)!=null&&ie!==ce&&u.reference[E]/2-(ie<K?K:te)-j[E]/2<0,k=le?ie<K?ie-K:ie-G:0;return{[w]:b[w]+k,data:{[w]:ce,centerOffset:ie-ce-k,...le&&{alignmentOffset:k}},reset:le}}}),oT=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var l,s;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}=wr(n,a);if((l=u.arrow)!=null&&l.alignmentOffset)return{};const R=il(c),M=Ba(p),T=il(p)===p,D=await(g.isRTL==null?void 0:g.isRTL(v.floating)),_=b||(T||!j?[lu(p)]:ZN(p)),A=E!=="none";!b&&A&&_.push(...tT(p,j,E,D));const U=[p,..._],O=await g.detectOverflow(a,C),q=[];let K=((s=u.flip)==null?void 0:s.overflows)||[];if(x&&q.push(O[R]),y){const ce=QN(c,f,D);q.push(O[ce[0]],O[ce[1]])}if(K=[...K,{placement:c,overflows:q}],!q.every(ce=>ce<=0)){var te,G;const ce=(((te=u.flip)==null?void 0:te.index)||0)+1,le=U[ce];if(le&&(!(y==="alignment"?M!==Ba(le):!1)||K.every(Q=>Ba(Q.placement)===M?Q.overflows[0]>0:!0)))return{data:{index:ce,overflows:K},reset:{placement:le}};let k=(G=K.filter(H=>H.overflows[0]<=0).sort((H,Q)=>H.overflows[1]-Q.overflows[1])[0])==null?void 0:G.placement;if(!k)switch(w){case"bestFit":{var ie;const H=(ie=K.filter(Q=>{if(A){const J=Ba(Q.placement);return J===M||J==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(J=>J>0).reduce((J,ee)=>J+ee,0)]).sort((Q,J)=>Q[1]-J[1])[0])==null?void 0:ie[0];H&&(k=H);break}case"initialPlacement":k=p;break}if(c!==k)return{reset:{placement:k}}}return{}}}};function fb(n,a){return{top:n.top-a.height,right:n.right-a.width,bottom:n.bottom-a.height,left:n.left-a.width}}function hb(n){return KN.some(a=>n[a]>=0)}const iT=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(a){const{rects:l,platform:s}=a,{strategy:c="referenceHidden",...u}=wr(n,a);switch(c){case"referenceHidden":{const f=await s.detectOverflow(a,{...u,elementContext:"reference"}),p=fb(f,l.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:hb(p)}}}case"escaped":{const f=await s.detectOverflow(a,{...u,altBoundary:!0}),p=fb(f,l.floating);return{data:{escapedOffsets:p,escaped:hb(p)}}}default:return{}}}}},y1=new Set(["left","top"]);async function cT(n,a){const{placement:l,platform:s,elements:c}=n,u=await(s.isRTL==null?void 0:s.isRTL(c.floating)),f=il(l),p=Ys(l),g=Ba(l)==="y",v=y1.has(f)?-1:1,x=u&&g?-1:1,y=wr(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 uT=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var l,s;const{x:c,y:u,placement:f,middlewareData:p}=a,g=await cT(a,n);return f===((l=p.offset)==null?void 0:l.placement)&&(s=p.arrow)!=null&&s.alignmentOffset?{}:{x:c+g.x,y:u+g.y,data:{...g,placement:f}}}}},dT=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(a){const{x:l,y:s,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:g={fn:M=>{let{x:T,y:D}=M;return{x:T,y:D}}},...v}=wr(n,a),x={x:l,y:s},y=await u.detectOverflow(a,v),b=Ba(c),w=Ym(b);let E=x[w],j=x[b];const C=(M,T)=>v1(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-s,enabled:{[w]:f,[b]:p}}}}}},fT=function(n){return n===void 0&&(n={}),{options:n,fn(a){var l,s;const{x:c,y:u,placement:f,rects:p,middlewareData:g}=a,{offset:v=0,mainAxis:x=!0,crossAxis:y=!0}=wr(n,a),b={x:c,y:u},w=Ba(f),E=Ym(w);let j=b[E],C=b[w];const R=wr(v,a),M=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(l=R.mainAxis)!=null?l:0,crossAxis:(s=R.crossAxis)!=null?s:0};if(x){const _=E==="y"?"height":"width",A=p.reference[E]-p.floating[_]+M.mainAxis,U=p.reference[E]+p.reference[_]-M.mainAxis;j<A?j=A:j>U&&(j=U)}if(y){var T,D;const _=E==="y"?"width":"height",A=y1.has(il(f)),U=p.reference[w]-p.floating[_]+(A&&((T=g.offset)==null?void 0:T[w])||0)+(A?0:M.crossAxis),O=p.reference[w]+p.reference[_]+(A?0:((D=g.offset)==null?void 0:D[w])||0)-(A?M.crossAxis:0);C<U?C=U:C>O&&(C=O)}return{[E]:j,[w]:C}}}},hT=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(a){const{placement:l,rects:s,platform:c,elements:u}=a,{apply:f=()=>{},...p}=wr(n,a),g=await c.detectOverflow(a,p),v=il(l),x=Ys(l),y=Ba(l)==="y",{width:b,height:w}=s.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=ol(w-g[E],C),T=ol(b-g[j],R),D=a.middlewareData.shift,_=!D;let A=M,U=T;D!=null&&D.enabled.x&&(U=R),D!=null&&D.enabled.y&&(A=C),_&&!x&&(y?U=b-2*gr(g.left,g.right):A=w-2*gr(g.top,g.bottom)),await f({...a,availableWidth:U,availableHeight:A});const O=await c.getDimensions(u.floating);return b!==O.width||w!==O.height?{reset:{rects:!0}}:{}}}};function Nu(){return typeof window<"u"}function Gs(n){return b1(n)?(n.nodeName||"").toLowerCase():"#document"}function Un(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function Cr(n){var a;return(a=(b1(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function b1(n){return Nu()?n instanceof Node||n instanceof Un(n).Node:!1}function Pa(n){return Nu()?n instanceof Element||n instanceof Un(n).Element:!1}function ul(n){return Nu()?n instanceof HTMLElement||n instanceof Un(n).HTMLElement:!1}function mb(n){return!Nu()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Un(n).ShadowRoot}function Tu(n){const{overflow:a,overflowX:l,overflowY:s,display:c}=qa(n);return/auto|scroll|overlay|hidden|clip/.test(a+s+l)&&c!=="inline"&&c!=="contents"}function mT(n){return/^(table|td|th)$/.test(Gs(n))}function Mu(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const pT=/transform|translate|scale|rotate|perspective|filter/,gT=/paint|layout|strict|content/,Ml=n=>!!n&&n!=="none";let Sh;function Km(n){const a=Pa(n)?qa(n):n;return Ml(a.transform)||Ml(a.translate)||Ml(a.scale)||Ml(a.rotate)||Ml(a.perspective)||!Xm()&&(Ml(a.backdropFilter)||Ml(a.filter))||pT.test(a.willChange||"")||gT.test(a.contain||"")}function vT(n){let a=_l(n);for(;ul(a)&&!Jo(a);){if(Km(a))return a;if(Mu(a))return null;a=_l(a)}return null}function Xm(){return Sh==null&&(Sh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Sh}function Jo(n){return/^(html|body|#document)$/.test(Gs(n))}function qa(n){return Un(n).getComputedStyle(n)}function Au(n){return Pa(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function _l(n){if(Gs(n)==="html")return n;const a=n.assignedSlot||n.parentNode||mb(n)&&n.host||Cr(n);return mb(a)?a.host:a}function w1(n){const a=_l(n);return Jo(a)?(n.ownerDocument||n).body:ul(a)&&Tu(a)?a:w1(a)}function Wo(n,a,l){var s;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=w1(n),u=c===((s=n.ownerDocument)==null?void 0:s.body),f=Un(c);if(u){const p=em(f);return a.concat(f,f.visualViewport||[],Tu(c)?c:[],p&&l?Wo(p):[])}else return a.concat(c,Wo(c,[],l))}function em(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function S1(n){const a=qa(n);let l=parseFloat(a.width)||0,s=parseFloat(a.height)||0;const c=ul(n),u=c?n.offsetWidth:l,f=c?n.offsetHeight:s,p=ru(l)!==u||ru(s)!==f;return p&&(l=u,s=f),{width:l,height:s,$:p}}function Qm(n){return Pa(n)?n:n.contextElement}function zs(n){const a=Qm(n);if(!ul(a))return vr(1);const l=a.getBoundingClientRect(),{width:s,height:c,$:u}=S1(a);let f=(u?ru(l.width):l.width)/s,p=(u?ru(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const xT=vr(0);function j1(n){const a=Un(n);return!Xm()||!a.visualViewport?xT:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function yT(n,a,l){return a===void 0&&(a=!1),!!l&&a&&l===Un(n)}function kl(n,a,l,s){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),u=Qm(n);let f=vr(1);a&&(s?Pa(s)&&(f=zs(s)):f=zs(n));const p=yT(u,l,s)?j1(u):vr(0);let g=(c.left+p.x)/f.x,v=(c.top+p.y)/f.y,x=c.width/f.x,y=c.height/f.y;if(u&&s){const b=Un(u),w=Pa(s)?Un(s):s;let E=b,j=em(E);for(;j&&w!==E;){const C=zs(j),R=j.getBoundingClientRect(),M=qa(j),T=R.left+(j.clientLeft+parseFloat(M.paddingLeft))*C.x,D=R.top+(j.clientTop+parseFloat(M.paddingTop))*C.y;g*=C.x,v*=C.y,x*=C.x,y*=C.y,g+=T,v+=D,E=Un(j),j=em(E)}}return su({width:x,height:y,x:g,y:v})}function Du(n,a){const l=Au(n).scrollLeft;return a?a.left+l:kl(Cr(n)).left+l}function C1(n,a){const l=n.getBoundingClientRect(),s=l.left+a.scrollLeft-Du(n,l),c=l.top+a.scrollTop;return{x:s,y:c}}function bT(n){let{elements:a,rect:l,offsetParent:s,strategy:c}=n;const u=c==="fixed",f=Cr(s),p=a?Mu(a.floating):!1;if(s===f||p&&u)return l;let g={scrollLeft:0,scrollTop:0},v=vr(1);const x=vr(0),y=ul(s);if((y||!u)&&((Gs(s)!=="body"||Tu(f))&&(g=Au(s)),y)){const w=kl(s);v=zs(s),x.x=w.x+s.clientLeft,x.y=w.y+s.clientTop}const b=f&&!y&&!u?C1(f,g):vr(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 wT(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function ST(n){const a=Au(n),l=n.ownerDocument.body,s=gr(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),c=gr(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let u=-a.scrollLeft+Du(n);const f=-a.scrollTop;return qa(l).direction==="rtl"&&(u+=gr(n.clientWidth,l.clientWidth)-s),{width:s,height:c,x:u,y:f}}const jT=25;function CT(n,a,l){l===void 0&&(l="viewport");const s=l==="layoutViewport",c=Un(n),u=Cr(n),f=c.visualViewport;let p=u.clientWidth,g=u.clientHeight,v=0,x=0;if(f){const b=!Xm()||a==="fixed";s?b||(v=-f.offsetLeft,x=-f.offsetTop):(p=f.width,g=f.height,b&&(v=f.offsetLeft,x=f.offsetTop))}if(Du(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<=jT&&(p-=R)}return{width:p,height:g,x:v,y:x}}function ET(n,a){const l=kl(n,!0,a==="fixed"),s=l.top+n.clientTop,c=l.left+n.clientLeft,u=zs(n),f=n.clientWidth*u.x,p=n.clientHeight*u.y,g=c*u.x,v=s*u.y;return{width:f,height:p,x:g,y:v}}function pb(n,a,l){let s;if(a==="viewport"||a==="layoutViewport")s=CT(n,l,a);else if(a==="document")s=ST(Cr(n));else if(Pa(a))s=ET(a,l);else{const c=j1(n);s={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return su(s)}function RT(n,a){const l=a.get(n);if(l)return l;let s=Wo(n,[],!1).filter(p=>Pa(p)&&Gs(p)!=="body"),c=null;const u=qa(n).position==="fixed";let f=u?_l(n):n;for(;Pa(f)&&!Jo(f);){const p=qa(f),g=Km(f),v=c?c.position:u?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&p.position==="static")?s=s.filter(y=>y!==f):c=p,f=_l(f)}return a.set(n,s),s}function NT(n){let{element:a,boundary:l,rootBoundary:s,strategy:c}=n;const f=[...l==="clippingAncestors"?Mu(a)?[]:RT(a,this._c):[].concat(l),s],p=pb(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=pb(a,f[b],c);g=gr(w.top,g),v=ol(w.right,v),x=ol(w.bottom,x),y=gr(w.left,y)}return{width:v-y,height:x-g,x:y,y:g}}function TT(n){const{width:a,height:l}=S1(n);return{width:a,height:l}}function MT(n,a,l){const s=ul(a),c=Cr(a),u=l==="fixed",f=kl(n,!0,u,a);let p={scrollLeft:0,scrollTop:0};const g=vr(0);if((s||!u)&&((Gs(a)!=="body"||Tu(c))&&(p=Au(a)),s)){const b=kl(a,!0,u,a);g.x=b.x+a.clientLeft,g.y=b.y+a.clientTop}!s&&c&&(g.x=Du(c));const v=c&&!s&&!u?C1(c,p):vr(0),x=f.left+p.scrollLeft-g.x-v.x,y=f.top+p.scrollTop-g.y-v.y;return{x,y,width:f.width,height:f.height}}function jh(n){return qa(n).position==="static"}function gb(n,a){if(!ul(n)||qa(n).position==="fixed")return null;if(a)return a(n);let l=n.offsetParent;return Cr(n)===l&&(l=l.ownerDocument.body),l}function E1(n,a){const l=Un(n);if(Mu(n))return l;if(!ul(n)){let c=_l(n);for(;c&&!Jo(c);){if(Pa(c)&&!jh(c))return c;c=_l(c)}return l}let s=gb(n,a);for(;s&&mT(s)&&jh(s);)s=gb(s,a);return s&&Jo(s)&&jh(s)&&!Km(s)?l:s||vT(n)||l}const AT=async function(n){const a=this.getOffsetParent||E1,l=this.getDimensions,s=await l(n.floating);return{reference:MT(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function DT(n){return qa(n).direction==="rtl"}const OT={convertOffsetParentRelativeRectToViewportRelativeRect:bT,getDocumentElement:Cr,getClippingRect:NT,getOffsetParent:E1,getElementRects:AT,getClientRects:wT,getDimensions:TT,getScale:zs,isElement:Pa,isRTL:DT};function R1(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function _T(n,a,l){let s=null,c;const u=Cr(n);function f(){var x;clearTimeout(c),(x=s)==null||x.disconnect(),s=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=kc(E),M=kc(u.clientWidth-(w+j)),T=kc(u.clientHeight-(E+C)),D=kc(w),A={rootMargin:-R+"px "+-M+"px "+-T+"px "+-D+"px",threshold:gr(0,ol(1,y))||1};let U=!0;function O(q){const K=q[0].intersectionRatio;if(!R1(b,n.getBoundingClientRect()))return p();if(K!==y){if(!U)return p();K?p(!1,K):c=setTimeout(()=>{p(!1,1e-7)},1e3)}U=!1}try{s=new IntersectionObserver(O,{...A,root:u.ownerDocument})}catch{s=new IntersectionObserver(O,A)}s.observe(n)}const g=Un(n),v=()=>p(l);return g.addEventListener("resize",v),p(!0),()=>{g.removeEventListener("resize",v),f()}}function kT(n,a,l,s){s===void 0&&(s={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=s,v=Qm(n),x=c||u?[...v?Wo(v):[],...a?Wo(a):[]]:[];x.forEach(R=>{c&&R.addEventListener("scroll",l),u&&R.addEventListener("resize",l)});const y=v&&p?_T(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?kl(n):null;g&&C();function C(){const R=kl(n);j&&!R1(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 zT=uT,LT=dT,UT=oT,BT=hT,HT=iT,vb=sT,IT=fT,PT=(n,a,l)=>{const s=new Map,c=l??{},u={...OT,...c.platform,_c:s};return lT(n,a,{...c,platform:u})};var qT=typeof document<"u",VT=function(){},Zc=qT?m.useLayoutEffect:VT;function ou(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,s,c;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==a.length)return!1;for(s=l;s--!==0;)if(!ou(n[s],a[s]))return!1;return!0}if(c=Object.keys(n),l=c.length,l!==Object.keys(a).length)return!1;for(s=l;s--!==0;)if(!{}.hasOwnProperty.call(a,c[s]))return!1;for(s=l;s--!==0;){const u=c[s];if(!(u==="_owner"&&n.$$typeof)&&!ou(n[u],a[u]))return!1}return!0}return n!==n&&a!==a}function N1(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function xb(n,a){const l=N1(n);return Math.round(a*l)/l}function Ch(n){const a=m.useRef(n);return Zc(()=>{a.current=n}),a}function $T(n){n===void 0&&(n={});const{placement:a="bottom",strategy:l="absolute",middleware:s=[],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(s);ou(b,s)||w(s);const[E,j]=m.useState(null),[C,R]=m.useState(null),M=m.useCallback(Q=>{Q!==A.current&&(A.current=Q,j(Q))},[]),T=m.useCallback(Q=>{Q!==U.current&&(U.current=Q,R(Q))},[]),D=u||E,_=f||C,A=m.useRef(null),U=m.useRef(null),O=m.useRef(x),q=g!=null,K=Ch(g),te=Ch(c),G=Ch(v),ie=m.useCallback(()=>{if(!A.current||!U.current)return;const Q={placement:a,strategy:l,middleware:b};te.current&&(Q.platform=te.current),PT(A.current,U.current,Q).then(J=>{const ee={...J,isPositioned:G.current!==!1};ce.current&&!ou(O.current,ee)&&(O.current=ee,Ca.flushSync(()=>{y(ee)}))})},[b,a,l,te,G]);Zc(()=>{v===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,y(Q=>({...Q,isPositioned:!1})))},[v]);const ce=m.useRef(!1);Zc(()=>(ce.current=!0,()=>{ce.current=!1}),[]),Zc(()=>{if(D&&(A.current=D),_&&(U.current=_),D&&_){if(K.current)return K.current(D,_,ie);ie()}},[D,_,ie,K,q]);const le=m.useMemo(()=>({reference:A,floating:U,setReference:M,setFloating:T}),[M,T]),k=m.useMemo(()=>({reference:D,floating:_}),[D,_]),H=m.useMemo(()=>{const Q={position:l,left:0,top:0};if(!k.floating)return Q;const J=xb(k.floating,x.x),ee=xb(k.floating,x.y);return p?{...Q,transform:"translate("+J+"px, "+ee+"px)",...N1(k.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:J,top:ee}},[l,p,k.floating,x.x,x.y]);return m.useMemo(()=>({...x,update:ie,refs:le,elements:k,floatingStyles:H}),[x,ie,le,k,H])}const YT=n=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:s,padding:c}=typeof n=="function"?n(l):n;return s&&a(s)?s.current!=null?vb({element:s.current,padding:c}).fn(l):{}:s?vb({element:s,padding:c}).fn(l):{}}}},GT=(n,a)=>{const l=zT(n);return{name:l.name,fn:l.fn,options:[n,a]}},FT=(n,a)=>{const l=LT(n);return{name:l.name,fn:l.fn,options:[n,a]}},KT=(n,a)=>({fn:IT(n).fn,options:[n,a]}),XT=(n,a)=>{const l=UT(n);return{name:l.name,fn:l.fn,options:[n,a]}},QT=(n,a)=>{const l=BT(n);return{name:l.name,fn:l.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=YT(n);return{name:l.name,fn:l.fn,options:[n,a]}};var WT=Object.defineProperty,eM=(n,a)=>WT(n,"name",{value:a,configurable:!0});function Ou(n){const[a,l]=m.useState(void 0);return Wt(()=>{if(n){l({width:n.offsetWidth,height:n.offsetHeight});const s=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 s.observe(n,{box:"border-box"}),()=>s.unobserve(n)}else l(void 0)},[n]),a}eM(Ou,"useSize");var tM=Object.defineProperty,ll=(n,a)=>tM(n,"name",{value:a,configurable:!0}),T1="Popper",[M1,Fs]=Hn(T1),[nM,A1]=M1(T1),aM=ll(n=>{const{__scopePopper:a,children:l}=n,[s,c]=m.useState(null),[u,f]=m.useState(void 0);return o.jsx(nM,{scope:a,anchor:s,onAnchorChange:c,placementState:u,setPlacementState:f,children:l})},"Popper"),rM="PopperAnchor",lM=m.forwardRef(ll(function(a,l){const{__scopePopper:s,virtualRef:c,...u}=a,f=A1(rM,s),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&&_u(f.placementState),w=b==null?void 0:b[0],E=b==null?void 0:b[1];return c?null:o.jsx(Pe.div,{"data-radix-popper-side":w,"data-radix-popper-align":E,...u,ref:x})},"PopperAnchor")),D1="PopperContent",[sM,q4]=M1(D1),oM=m.forwardRef(ll(function(a,l){var de,me,xe,we,Me,Ye,Qe;const{__scopePopper:s,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=A1(D1,s),[M,T]=m.useState(null),D=Ke(l,T),[_,A]=m.useState(null),U=Ou(_),O=(U==null?void 0:U.width)??0,q=(U==null?void 0:U.height)??0,K=c+(f!=="center"?"-"+f:""),te=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},G=Array.isArray(x)?x:[x],ie=G.length>0,ce={padding:te,boundary:G.filter(O1),altBoundary:ie},{refs:le,floatingStyles:k,placement:H,isPositioned:Q,middlewareData:J}=$T({strategy:"fixed",placement:K,whileElementsMounted:ll((...st)=>kT(...st,{animationFrame:E==="always"}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[GT({mainAxis:u+q,alignmentAxis:p}),v&&FT({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?KT():void 0,...ce}),v&&XT({...ce}),QT({...ce,apply:ll(({elements:st,rects:Kt,availableWidth:ot,availableHeight:Lt})=>{const{width:Ot,height:It}=Kt.reference,en=st.floating.style;en.setProperty("--radix-popper-available-width",`${ot}px`),en.setProperty("--radix-popper-available-height",`${Lt}px`),en.setProperty("--radix-popper-anchor-width",`${Ot}px`),en.setProperty("--radix-popper-anchor-height",`${It}px`)},"apply")}),_&&JT({element:_,padding:g}),iM({arrowWidth:O,arrowHeight:q}),w&&ZT({strategy:"referenceHidden",...ce,boundary:ie?ce.boundary:void 0})]}),ee=R.setPlacementState;Wt(()=>(ee(H),()=>{ee(void 0)}),[H,ee]);const[z,I]=_u(H),X=ma(j);Wt(()=>{Q&&(X==null||X())},[Q,X]);const re=(de=J.arrow)==null?void 0:de.x,fe=(me=J.arrow)==null?void 0:me.y,ve=((xe=J.arrow)==null?void 0:xe.centerOffset)!==0,[V,oe]=m.useState();return Wt(()=>{M&&oe(window.getComputedStyle(M).zIndex)},[M]),o.jsx("div",{ref:le.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:Q?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[(we=J.transformOrigin)==null?void 0:we.x,(Me=J.transformOrigin)==null?void 0:Me.y].join(" "),...((Ye=J.hide)==null?void 0:Ye.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:o.jsx(sM,{scope:s,placedSide:z,placedAlign:I,onArrowChange:A,arrowX:re,arrowY:fe,shouldHideArrow:ve,children:o.jsx(Pe.div,{"data-side":z,"data-align":I,...C,ref:D,style:{...C.style,animation:Q?(Qe=C.style)==null?void 0:Qe.animation:"none"}})})})},"PopperContent"));function O1(n){return n!==null}ll(O1,"isNotNull");var iM=ll(n=>({name:"transformOrigin",options:n,fn(a){var C,R,M;const{placement:l,rects:s,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]=_u(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=`${s.floating.height+g}px`):v==="right"?(E=`${-g}px`,j=f?y:`${w}px`):v==="left"&&(E=`${s.floating.width+g}px`,j=f?y:`${w}px`),{data:{x:E,y:j}}}}),"transformOrigin");function _u(n){const[a,l="center"]=n.split("-");return[a,l]}ll(_u,"getSideAndAlignFromPlacement");var _1=aM,k1=lM,Zm=oM,cM=Object.defineProperty,uM=(n,a)=>cM(n,"name",{value:a,configurable:!0}),Jm=m.forwardRef(uM(function(a,l){var g;const{container:s,...c}=a,[u,f]=m.useState(!1);Wt(()=>f(!0),[]);const p=s||u&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?Ca.createPortal(o.jsx(Pe.div,{...c,ref:l}),p):null},"Portal")),dM=Object.defineProperty,Sr=(n,a)=>dM(n,"name",{value:a,configurable:!0});function z1(n,a){return m.useReducer((l,s)=>a[l][s]??l,n)}Sr(z1,"useStateMachine");var Er=Sr(n=>{const{present:a,children:l}=n,s=L1(a),c=typeof l=="function"?l({present:s.isPresent}):m.Children.only(l),u=U1(s.ref,B1(c));return typeof l=="function"||s.isPresent?m.cloneElement(c,{ref:u}):null},"Presence");function L1(n){const[a,l]=m.useState(),s=m.useRef(null),c=m.useRef(n),u=m.useRef("none"),f=m.useRef(void 0),p=n?"mounted":"unmounted",[g,v]=z1(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??Ds(s.current),f.current=void 0):u.current="none"},[g]),Wt(()=>{const x=s.current,y=c.current;if(y!==n){const w=u.current,E=Ds(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]),Wt(()=>{if(a){let x;const y=a.ownerDocument.defaultView??window,b=Sr(E=>{const C=Ds(s.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=Sr(E=>{E.target===a&&(u.current=Ds(s.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);s.current=y,f.current=Ds(y)}else s.current=null;l(x)},[])}}Sr(L1,"usePresence");function tm(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}Sr(tm,"setRef");function U1(...n){const a=m.useRef(n);return a.current=n,m.useCallback(l=>{const s=a.current;let c=!1;const u=s.map(f=>{const p=tm(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():tm(s[f],null)}}},[])}Sr(U1,"useStableComposedRefs");function Ds(n){return(n==null?void 0:n.animationName)||"none"}Sr(Ds,"getAnimationName");function B1(n){var s,c;let a=(s=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:s.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)}Sr(B1,"getElementRef");var fM=Object.defineProperty,Wm=(n,a)=>fM(n,"name",{value:a,configurable:!0}),Eh=!1;function H1(){const[n,a]=m.useState(Eh);return m.useEffect(()=>{Eh||(Eh=!0,a(!0))},[]),n}Wm(H1,"useIsHydrated");var I1=Hs[" useSyncExternalStore ".trim().toString()];function P1(){return()=>{}}Wm(P1,"subscribe");function q1(){return I1(P1,()=>!0,()=>!1)}Wm(q1,"useIsHydratedModern");var hM=typeof I1=="function"?q1:H1,mM=Object.defineProperty,Ll=(n,a)=>mM(n,"name",{value:a,configurable:!0}),Rh="rovingFocusGroup.onEntryFocus",pM={bubbles:!1,cancelable:!0},ku="RovingFocusGroup",[nm,V1,gM]=Eu(ku),[vM,zu]=Hn(ku,[gM]),[xM,yM]=vM(ku),bM=m.forwardRef(Ll(function(a,l){return o.jsx(nm.Provider,{scope:a.__scopeRovingFocusGroup,children:o.jsx(nm.Slot,{scope:a.__scopeRovingFocusGroup,children:o.jsx(wM,{...a,ref:l})})})},"RovingFocusGroup")),wM=m.forwardRef(Ll(function(a,l){const{__scopeRovingFocusGroup:s,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=di(f),[C,R]=br({prop:p,defaultProp:g??null,onChange:v,caller:ku}),[M,T]=m.useState(!1),D=ma(x),_=V1(s),A=m.useRef(!1),[U,O]=m.useState(0);return m.useEffect(()=>{const q=w.current;if(q)return q.addEventListener(Rh,D),()=>q.removeEventListener(Rh,D)},[D]),o.jsx(xM,{scope:s,orientation:c,dir:j,loop:u,currentTabStopId:C,onItemFocus:m.useCallback(q=>R(q),[R]),onItemShiftTab:m.useCallback(()=>T(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(q=>q+1),[]),onFocusableItemRemove:m.useCallback(()=>O(q=>q-1),[]),children:o.jsx(Pe.div,{tabIndex:M||U===0?-1:0,"data-orientation":c,...b,ref:E,style:{outline:"none",...a.style},onMouseDown:Te(a.onMouseDown,()=>{A.current=!0}),onFocus:Te(a.onFocus,q=>{const K=!A.current;if(q.target===q.currentTarget&&K&&!M){const te=new CustomEvent(Rh,pM);if(q.currentTarget.dispatchEvent(te),!te.defaultPrevented){const G=_().filter(H=>H.focusable),ie=G.find(H=>H.active),ce=G.find(H=>H.id===C),k=[ie,ce,...G].filter(Boolean).map(H=>H.ref.current);ep(k,y)}}A.current=!1}),onBlur:Te(a.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),SM="RovingFocusGroupItem",jM=m.forwardRef(Ll(function(a,l){const{__scopeRovingFocusGroup:s,focusable:c=!0,active:u=!1,tabStopId:f,children:p,...g}=a,v=Ha(),x=f||v,y=yM(SM,s),b=y.currentTabStopId===x,w=V1(s),{onFocusableItemAdd:E,onFocusableItemRemove:j,currentTabStopId:C}=y,R=hM();return Wt(()=>{if(!(!R||!c))return E(),()=>j()},[R,c,E,j]),m.useEffect(()=>{if(!(R||!c))return E(),()=>j()},[R,c,E,j]),o.jsx(nm.ItemSlot,{scope:s,id:x,focusable:c,active:u,children:o.jsx(Pe.span,{tabIndex:b?0:-1,"data-orientation":y.orientation,...g,ref:l,onMouseDown:Te(a.onMouseDown,M=>{c?y.onItemFocus(x):M.preventDefault()}),onFocus:Te(a.onFocus,()=>y.onItemFocus(x)),onKeyDown:Te(a.onKeyDown,M=>{if(M.key==="Tab"&&M.shiftKey){y.onItemShiftTab();return}if(M.target!==M.currentTarget)return;const T=Y1(M,y.orientation,y.dir);if(T!==void 0){if(M.metaKey||M.ctrlKey||M.altKey||M.shiftKey)return;M.preventDefault();let _=w().filter(A=>A.focusable).map(A=>A.ref.current);if(T==="last")_.reverse();else if(T==="prev"||T==="next"){T==="prev"&&_.reverse();const A=_.indexOf(M.currentTarget);_=y.loop?G1(_,A+1):_.slice(A+1)}setTimeout(()=>ep(_))}}),children:typeof p=="function"?p({isCurrentTabStop:b,hasTabStop:C!=null}):p})})},"RovingFocusGroupItem")),CM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $1(n,a){return a!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}Ll($1,"getDirectionAwareKey");function Y1(n,a,l){const s=$1(n.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return CM[s]}Ll(Y1,"getFocusIntent");function ep(n,a=!1){const l=document.activeElement;for(const s of n)if(s===l||(s.focus({preventScroll:a}),document.activeElement!==l))return}Ll(ep,"focusFirst");function G1(n,a){return n.map((l,s)=>n[(a+s)%n.length])}Ll(G1,"wrapArray");var F1=bM,K1=jM,EM=function(n){if(typeof document>"u")return null;var a=Array.isArray(n)?n[0]:n;return a.ownerDocument.body},Ns=new WeakMap,zc=new WeakMap,Lc={},Nh=0,X1=function(n){return n&&(n.host||X1(n.parentNode))},RM=function(n,a){return a.map(function(l){if(n.contains(l))return l;var s=X1(l);return s&&n.contains(s)?s:(console.error("aria-hidden",l,"in not contained inside",n,". Doing nothing"),null)}).filter(function(l){return!!l})},NM=function(n,a,l,s){var c=RM(a,Array.isArray(n)?n:[n]);Lc[l]||(Lc[l]=new WeakMap);var u=Lc[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(s),E=w!==null&&w!=="false",j=(Ns.get(b)||0)+1,C=(u.get(b)||0)+1;Ns.set(b,j),u.set(b,C),f.push(b),j===1&&E&&zc.set(b,!0),C===1&&b.setAttribute(l,"true"),E||b.setAttribute(s,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return x(a),p.clear(),Nh++,function(){f.forEach(function(y){var b=Ns.get(y)-1,w=u.get(y)-1;Ns.set(y,b),u.set(y,w),b||(zc.has(y)||y.removeAttribute(s),zc.delete(y)),w||y.removeAttribute(l)}),Nh--,Nh||(Ns=new WeakMap,Ns=new WeakMap,zc=new WeakMap,Lc={})}},tp=function(n,a,l){l===void 0&&(l="data-aria-hidden");var s=Array.from(Array.isArray(n)?n:[n]),c=EM(n);return c?(s.push.apply(s,Array.from(c.querySelectorAll("[aria-live], script"))),NM(s,c,l,"aria-hidden")):function(){return null}},Ua=function(){return Ua=Object.assign||function(a){for(var l,s=1,c=arguments.length;s<c;s++){l=arguments[s];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},Ua.apply(this,arguments)};function Q1(n,a){var l={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&a.indexOf(s)<0&&(l[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,s=Object.getOwnPropertySymbols(n);c<s.length;c++)a.indexOf(s[c])<0&&Object.prototype.propertyIsEnumerable.call(n,s[c])&&(l[s[c]]=n[s[c]]);return l}function TM(n,a,l){if(l||arguments.length===2)for(var s=0,c=a.length,u;s<c;s++)(u||!(s in a))&&(u||(u=Array.prototype.slice.call(a,0,s)),u[s]=a[s]);return n.concat(u||Array.prototype.slice.call(a))}var Jc="right-scroll-bar-position",Wc="width-before-scroll-bar",MM="with-scroll-bars-hidden",AM="--removed-body-scroll-bar-size";function Th(n,a){return typeof n=="function"?n(a):n&&(n.current=a),n}function DM(n,a){var l=m.useState(function(){return{value:n,callback:a,facade:{get current(){return l.value},set current(s){var c=l.value;c!==s&&(l.value=s,l.callback(s,c))}}}})[0];return l.callback=a,l.facade}var OM=typeof window<"u"?m.useLayoutEffect:m.useEffect,yb=new WeakMap;function _M(n,a){var l=DM(null,function(s){return n.forEach(function(c){return Th(c,s)})});return OM(function(){var s=yb.get(l);if(s){var c=new Set(s),u=new Set(n),f=l.current;c.forEach(function(p){u.has(p)||Th(p,null)}),u.forEach(function(p){c.has(p)||Th(p,f)})}yb.set(l,n)},[n]),l}function kM(n){return n}function zM(n,a){a===void 0&&(a=kM);var l=[],s=!1,c={read:function(){if(s)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,s);return l.push(f),function(){l=l.filter(function(p){return p!==f})}},assignSyncMedium:function(u){for(s=!0;l.length;){var f=l;l=[],f.forEach(u)}l={push:function(p){return u(p)},filter:function(){return l}}},assignMedium:function(u){s=!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 LM(n){n===void 0&&(n={});var a=zM(null);return a.options=Ua({async:!0,ssr:!1},n),a}var Z1=function(n){var a=n.sideCar,l=Q1(n,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=a.read();if(!s)throw new Error("Sidecar medium not found");return m.createElement(s,Ua({},l))};Z1.isSideCarExport=!0;function UM(n,a){return n.useMedium(a),Z1}var J1=LM(),Mh=function(){},Lu=m.forwardRef(function(n,a){var l=m.useRef(null),s=m.useState({onScrollCapture:Mh,onWheelCapture:Mh,onTouchMoveCapture:Mh}),c=s[0],u=s[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,D=Q1(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=b,A=_M([l,a]),U=Ua(Ua({},D),c);return m.createElement(m.Fragment,null,x&&m.createElement(_,{sideCar:J1,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),Ua(Ua({},U),{ref:A})):m.createElement(M,Ua({},U,{className:g,ref:A}),p))});Lu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lu.classNames={fullWidth:Wc,zeroRight:Jc};var BM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function HM(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var a=BM();return a&&n.setAttribute("nonce",a),n}function IM(n,a){n.styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a))}function PM(n){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(n)}var qM=function(){var n=0,a=null;return{add:function(l){n==0&&(a=HM())&&(IM(a,l),PM(a)),n++},remove:function(){n--,!n&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},VM=function(){var n=qM();return function(a,l){m.useEffect(function(){return n.add(a),function(){n.remove()}},[a&&l])}},W1=function(){var n=VM(),a=function(l){var s=l.styles,c=l.dynamic;return n(s,c),null};return a},$M={left:0,top:0,right:0,gap:0},Ah=function(n){return parseInt(n||"",10)||0},YM=function(n){var a=window.getComputedStyle(document.body),l=a[n==="padding"?"paddingLeft":"marginLeft"],s=a[n==="padding"?"paddingTop":"marginTop"],c=a[n==="padding"?"paddingRight":"marginRight"];return[Ah(l),Ah(s),Ah(c)]},GM=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return $M;var a=YM(n),l=document.documentElement.clientWidth,s=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,s-l+a[2]-a[0])}},FM=W1(),Ls="data-scroll-locked",KM=function(n,a,l,s){var c=n.left,u=n.top,f=n.right,p=n.gap;return l===void 0&&(l="margin"),`
301
+ .`.concat(MM,` {
302
+ overflow: hidden `).concat(s,`;
303
+ padding-right: `).concat(p,"px ").concat(s,`;
304
+ }
305
+ body[`).concat(Ls,`] {
306
+ overflow: hidden `).concat(s,`;
307
+ overscroll-behavior: contain;
308
+ `).concat([a&&"position: relative ".concat(s,";"),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(s,`;
315
+ `),l==="padding"&&"padding-right: ".concat(p,"px ").concat(s,";")].filter(Boolean).join(""),`
316
+ }
317
+
318
+ .`).concat(Jc,` {
319
+ right: `).concat(p,"px ").concat(s,`;
320
+ }
321
+
322
+ .`).concat(Wc,` {
323
+ margin-right: `).concat(p,"px ").concat(s,`;
324
+ }
325
+
326
+ .`).concat(Jc," .").concat(Jc,` {
327
+ right: 0 `).concat(s,`;
328
+ }
329
+
330
+ .`).concat(Wc," .").concat(Wc,` {
331
+ margin-right: 0 `).concat(s,`;
332
+ }
333
+
334
+ body[`).concat(Ls,`] {
335
+ `).concat(AM,": ").concat(p,`px;
336
+ }
337
+ `)},bb=function(){var n=parseInt(document.body.getAttribute(Ls)||"0",10);return isFinite(n)?n:0},XM=function(){m.useEffect(function(){return document.body.setAttribute(Ls,(bb()+1).toString()),function(){var n=bb()-1;n<=0?document.body.removeAttribute(Ls):document.body.setAttribute(Ls,n.toString())}},[])},QM=function(n){var a=n.noRelative,l=n.noImportant,s=n.gapMode,c=s===void 0?"margin":s;XM();var u=m.useMemo(function(){return GM(c)},[c]);return m.createElement(FM,{styles:KM(u,!a,c,l?"":"!important")})},am=!1;if(typeof window<"u")try{var Uc=Object.defineProperty({},"passive",{get:function(){return am=!0,!0}});window.addEventListener("test",Uc,Uc),window.removeEventListener("test",Uc,Uc)}catch{am=!1}var Ts=am?{passive:!1}:!1,ZM=function(n){return n.tagName==="TEXTAREA"},ew=function(n,a){if(!(n instanceof Element))return!1;var l=window.getComputedStyle(n);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!ZM(n)&&l[a]==="visible")},JM=function(n){return ew(n,"overflowY")},WM=function(n){return ew(n,"overflowX")},wb=function(n,a){var l=a.ownerDocument,s=a;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var c=tw(n,s);if(c){var u=nw(n,s),f=u[1],p=u[2];if(f>p)return!0}s=s.parentNode}while(s&&s!==l.body);return!1},eA=function(n){var a=n.scrollTop,l=n.scrollHeight,s=n.clientHeight;return[a,l,s]},tA=function(n){var a=n.scrollLeft,l=n.scrollWidth,s=n.clientWidth;return[a,l,s]},tw=function(n,a){return n==="v"?JM(a):WM(a)},nw=function(n,a){return n==="v"?eA(a):tA(a)},nA=function(n,a){return n==="h"&&a==="rtl"?-1:1},aA=function(n,a,l,s,c){var u=nA(n,window.getComputedStyle(a).direction),f=u*s,p=l.target,g=a.contains(p),v=!1,x=f>0,y=0,b=0;do{if(!p)break;var w=nw(n,p),E=w[0],j=w[1],C=w[2],R=j-C-u*E;(E||R)&&tw(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},Bc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Sb=function(n){return[n.deltaX,n.deltaY]},jb=function(n){return n&&"current"in n?n.current:n},rA=function(n,a){return n[0]===a[0]&&n[1]===a[1]},lA=function(n){return`
338
+ .block-interactivity-`.concat(n,` {pointer-events: none;}
339
+ .allow-interactivity-`).concat(n,` {pointer-events: all;}
340
+ `)},sA=0,Ms=[];function oA(n){var a=m.useRef([]),l=m.useRef([0,0]),s=m.useRef(),c=m.useState(sA++)[0],u=m.useState(W1)[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=TM([n.lockRef.current],(n.shards||[]).map(jb),!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=Bc(j),M=l.current,T="deltaX"in j?j.deltaX:M[0]-R[0],D="deltaY"in j?j.deltaY:M[1]-R[1],_,A=j.target,U=Math.abs(T)>Math.abs(D)?"h":"v";if("touches"in j&&U==="h"&&A.type==="range")return!1;var O=window.getSelection(),q=O&&O.anchorNode,K=q?q===A||q.contains(A):!1;if(K)return!1;var te=wb(U,A);if(!te)return!0;if(te?_=U:(_=U==="v"?"h":"v",te=wb(U,A)),!te)return!1;if(!s.current&&"changedTouches"in j&&(T||D)&&(s.current=_),!_)return!0;var G=s.current||_;return aA(G,C,j,G==="h"?T:D)},[]),g=m.useCallback(function(j){var C=j;if(!(!Ms.length||Ms[Ms.length-1]!==u)){var R="deltaY"in C?Sb(C):Bc(C),M=a.current.filter(function(_){return _.name===C.type&&(_.target===C.target||C.target===_.shadowParent)&&rA(_.delta,R)})[0];if(M&&M.should){C.cancelable&&C.preventDefault();return}if(!M){var T=(f.current.shards||[]).map(jb).filter(Boolean).filter(function(_){return _.contains(C.target)}),D=T.length>0?p(C,T[0]):!f.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),v=m.useCallback(function(j,C,R,M){var T={name:j,delta:C,target:R,should:M,shadowParent:iA(R)};a.current.push(T),setTimeout(function(){a.current=a.current.filter(function(D){return D!==T})},1)},[]),x=m.useCallback(function(j){l.current=Bc(j),s.current=void 0},[]),y=m.useCallback(function(j){v(j.type,Sb(j),j.target,p(j,n.lockRef.current))},[]),b=m.useCallback(function(j){v(j.type,Bc(j),j.target,p(j,n.lockRef.current))},[]);m.useEffect(function(){return Ms.push(u),n.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",g,Ts),document.addEventListener("touchmove",g,Ts),document.addEventListener("touchstart",x,Ts),function(){Ms=Ms.filter(function(j){return j!==u}),document.removeEventListener("wheel",g,Ts),document.removeEventListener("touchmove",g,Ts),document.removeEventListener("touchstart",x,Ts)}},[]);var w=n.removeScrollBar,E=n.inert;return m.createElement(m.Fragment,null,E?m.createElement(u,{styles:lA(c)}):null,w?m.createElement(QM,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function iA(n){for(var a=null;n!==null;)n instanceof ShadowRoot&&(a=n.host,n=n.host),n=n.parentNode;return a}const cA=UM(J1,oA);var Uu=m.forwardRef(function(n,a){return m.createElement(Lu,Ua({},n,{ref:a,sideCar:cA}))});Uu.classNames=Lu.classNames;var uA=Object.defineProperty,vt=(n,a)=>uA(n,"name",{value:a,configurable:!0}),dA=["Enter"," "],fA=["ArrowDown","PageUp","Home"],aw=["ArrowUp","PageDown","End"],hA=[...fA,...aw],Bu="Menu",[rm,mA,pA]=Eu(Bu),[Ul,rw]=Hn(Bu,[pA,Fs,zu]),np=Fs(),lw=zu(),[gA,hi]=Ul(Bu),[vA,ap]=Ul(Bu),xA=vt(n=>{const{__scopeMenu:a,open:l=!1,children:s,dir:c,onOpenChange:u,modal:f=!0}=n,p=np(a),[g,v]=m.useState(null),x=m.useRef(!1),y=ma(u),b=di(c);return m.useEffect(()=>{const w=vt(()=>{x.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},"handleKeyDown"),E=vt(()=>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=vt(()=>y(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[l,y]),o.jsx(_1,{...p,children:o.jsx(gA,{scope:a,open:l,onOpenChange:y,content:g,onContentChange:v,children:o.jsx(vA,{scope:a,onClose:m.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:x,dir:b,modal:f,children:s})})})},"Menu"),yA=m.forwardRef(vt(function(a,l){const{__scopeMenu:s,...c}=a,u=np(s);return o.jsx(k1,{...u,...c,ref:l})},"MenuAnchor")),sw="MenuPortal",[bA,wA]=Ul(sw,{forceMount:void 0}),SA=vt(n=>{const{__scopeMenu:a,forceMount:l,children:s,container:c}=n,u=hi(sw,a);return o.jsx(bA,{scope:a,forceMount:l,children:o.jsx(Er,{present:l||u.open,children:o.jsx(Jm,{asChild:!0,container:c,children:s})})})},"MenuPortal"),sl="MenuContent",[jA,ow]=Ul(sl),CA=m.forwardRef(vt(function(a,l){const s=wA(sl,a.__scopeMenu),{forceMount:c=s.forceMount,...u}=a,f=hi(sl,a.__scopeMenu),p=ap(sl,a.__scopeMenu);return o.jsx(rm.Provider,{scope:a.__scopeMenu,children:o.jsx(Er,{present:c||f.open,children:o.jsx(rm.Slot,{scope:a.__scopeMenu,children:p.modal?o.jsx(EA,{...u,ref:l}):o.jsx(RA,{...u,ref:l})})})})},"MenuContent")),EA=m.forwardRef(vt(function(a,l){const s=hi(sl,a.__scopeMenu),c=m.useRef(null),u=Ke(l,c);return m.useEffect(()=>{const f=c.current;if(f)return tp(f)},[]),o.jsx(iw,{...a,ref:u,trapFocus:s.open,disableOutsidePointerEvents:s.open,disableOutsideScroll:!0,onFocusOutside:Te(a.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>s.onOpenChange(!1)})},"MenuRootContentModal")),RA=m.forwardRef(vt(function(a,l){const s=hi(sl,a.__scopeMenu);return o.jsx(iw,{...a,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>s.onOpenChange(!1)})},"MenuRootContentNonModal")),NA=Ia("MenuContent.ScrollLock"),iw=m.forwardRef(vt(function(a,l){const{__scopeMenu:s,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=hi(sl,s),M=ap(sl,s),T=np(s),D=lw(s),_=mA(s),[A,U]=m.useState(null),O=m.useRef(null),q=Ke(l,O,R.onContentChange),K=m.useRef(0),te=m.useRef(""),G=m.useRef(0),ie=m.useRef(null),ce=m.useRef("right"),le=m.useRef(0),k=j?Uu:m.Fragment,H=j?{as:NA,allowPinchZoom:!0}:void 0,Q=vt(ee=>{var oe,de;const z=te.current+ee,I=_().filter(me=>!me.disabled),X=document.activeElement,re=(oe=I.find(me=>me.ref.current===X))==null?void 0:oe.textValue,fe=I.map(me=>me.textValue),ve=hw(fe,z,re),V=(de=I.find(me=>me.textValue===ve))==null?void 0:de.ref.current;vt((function me(xe){te.current=xe,window.clearTimeout(K.current),xe!==""&&(K.current=window.setTimeout(()=>me(""),1e3))}),"updateSearch")(z),V&&setTimeout(()=>V.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(K.current),[]),fi();const J=m.useCallback(ee=>{var I,X;return ce.current===((I=ie.current)==null?void 0:I.side)&&pw(ee,(X=ie.current)==null?void 0:X.area)},[]);return o.jsx(jA,{scope:s,searchRef:te,onItemEnter:m.useCallback(ee=>{J(ee)&&ee.preventDefault()},[J]),onItemLeave:m.useCallback(ee=>{var z;J(ee)||((z=O.current)==null||z.focus(),U(null))},[J]),onTriggerLeave:m.useCallback(ee=>{J(ee)&&ee.preventDefault()},[J]),pointerGraceTimerRef:G,onPointerGraceIntentChange:m.useCallback(ee=>{ie.current=ee},[]),children:o.jsx(k,{...H,children:o.jsx(Vm,{asChild:!0,trapped:u,onMountAutoFocus:Te(f,ee=>{var z;ee.preventDefault(),(z=O.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:o.jsx(Ru,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:E,children:o.jsx(F1,{asChild:!0,...D,dir:M.dir,orientation:"vertical",loop:c,currentTabStopId:A,onCurrentTabStopIdChange:U,onEntryFocus:Te(v,ee=>{M.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Zm,{role:"menu","aria-orientation":"vertical","data-state":cw(R.open),"data-radix-menu-content":"",dir:M.dir,...T,...C,ref:q,style:{outline:"none",...C.style},onKeyDown:Te(C.onKeyDown,ee=>{const I=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,X=ee.ctrlKey||ee.altKey||ee.metaKey,re=ee.key.length===1;I&&(ee.key==="Tab"&&ee.preventDefault(),!X&&re&&Q(ee.key));const fe=O.current;if(ee.target!==fe||!hA.includes(ee.key))return;ee.preventDefault();const V=_().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);aw.includes(ee.key)&&V.reverse(),dw(V)}),onBlur:Te(a.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(K.current),te.current="")}),onPointerMove:Te(a.onPointerMove,iu(ee=>{const z=ee.target,I=le.current!==ee.clientX;if(ee.currentTarget.contains(z)&&I){const X=ee.clientX>le.current?"right":"left";ce.current=X,le.current=ee.clientX}}))})})})})})})},"MenuContentImpl")),TA=m.forwardRef(vt(function(a,l){const{__scopeMenu:s,...c}=a;return o.jsx(Pe.div,{...c,ref:l})},"MenuLabel")),lm="MenuItem",Cb="menu.itemSelect",MA=m.forwardRef(vt(function(a,l){const{disabled:s=!1,onSelect:c,...u}=a,f=m.useRef(null),p=ap(lm,a.__scopeMenu),g=ow(lm,a.__scopeMenu),v=Ke(l,f),x=m.useRef(!1),y=vt(()=>{const b=f.current;if(!s&&b){const w=new CustomEvent(Cb,{bubbles:!0,cancelable:!0});b.addEventListener(Cb,E=>c==null?void 0:c(E),{once:!0}),Hm(b,w),w.defaultPrevented?x.current=!1:p.onClose()}},"handleSelect");return o.jsx(AA,{...u,ref:v,disabled:s,onClick:Te(a.onClick,y),onPointerDown:b=>{var w;(w=a.onPointerDown)==null||w.call(a,b),x.current=!0},onPointerUp:Te(a.onPointerUp,b=>{var w;x.current||(w=b.currentTarget)==null||w.click()}),onKeyDown:Te(a.onKeyDown,b=>{s||b.target!==b.currentTarget||g.searchRef.current!==""&&b.key===" "||dA.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),AA=m.forwardRef(vt(function(a,l){const{__scopeMenu:s,disabled:c=!1,textValue:u,...f}=a,p=ow(lm,s),g=lw(s),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]),o.jsx(rm.ItemSlot,{scope:s,disabled:c,textValue:u??w,children:o.jsx(K1,{asChild:!0,...g,focusable:!c,children:o.jsx(Pe.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...f,ref:x,onPointerMove:Te(a.onPointerMove,iu(j=>{c?p.onItemLeave(j):(p.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(a.onPointerLeave,iu(j=>p.onItemLeave(j))),onFocus:Te(a.onFocus,()=>b(!0)),onBlur:Te(a.onBlur,()=>b(!1))})})})},"MenuItemImpl")),DA="MenuRadioGroup",[V4,$4]=Ul(DA,{value:void 0,onValueChange:vt(()=>{},"onValueChange")}),OA="MenuItemIndicator",[Y4,G4]=Ul(OA,{checked:!1}),_A=m.forwardRef(vt(function(a,l){const{__scopeMenu:s,...c}=a;return o.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...c,ref:l})},"MenuSeparator")),kA="MenuSub",[F4,K4]=Ul(kA);function cw(n){return n?"open":"closed"}vt(cw,"getOpenState");function uw(n){return n==="indeterminate"}vt(uw,"isIndeterminate");function zA(n){return uw(n)?"indeterminate":n?"checked":"unchecked"}vt(zA,"getCheckedState");function dw(n){const a=document.activeElement;for(const l of n)if(l===a||(l.focus(),document.activeElement!==a))return}vt(dw,"focusFirst");function fw(n,a){return n.map((l,s)=>n[(a+s)%n.length])}vt(fw,"wrapArray");function hw(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=fw(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}vt(hw,"getNextMatch");function mw(n,a){const{x:l,y:s}=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>s!=b>s&&l<(y-v)*(s-x)/(b-x)+v&&(c=!c)}return c}vt(mw,"isPointInPolygon");function pw(n,a){if(!a)return!1;const l={x:n.clientX,y:n.clientY};return mw(l,a)}vt(pw,"isPointerInGraceArea");function iu(n){return a=>a.pointerType==="mouse"?n(a):void 0}vt(iu,"whenMouse");var LA=xA,UA=yA,BA=SA,HA=CA,IA=TA,PA=MA,qA=_A,VA=Object.defineProperty,Bl=(n,a)=>VA(n,"name",{value:a,configurable:!0}),rp="DropdownMenu",[$A,X4]=Hn(rp,[rw]),Hl=rw(),[YA,gw]=$A(rp),GA=Bl(n=>{const{__scopeDropdownMenu:a,children:l,dir:s,open:c,defaultOpen:u,onOpenChange:f,modal:p=!0}=n,g=Hl(a),v=m.useRef(null),[x,y]=br({prop:c,defaultProp:u??!1,onChange:f,caller:rp});return o.jsx(YA,{scope:a,triggerId:Ha(),triggerRef:v,contentId:Ha(),open:x,onOpenChange:y,onOpenToggle:m.useCallback(()=>y(b=>!b),[y]),modal:p,children:o.jsx(LA,{...g,open:x,onOpenChange:y,dir:s,modal:p,children:l})})},"DropdownMenu"),FA="DropdownMenuTrigger",KA=m.forwardRef(Bl(function(a,l){const{__scopeDropdownMenu:s,disabled:c=!1,...u}=a,f=gw(FA,s),p=Hl(s),g=Ke(l,f.triggerRef);return o.jsx(UA,{asChild:!0,...p,children:o.jsx(Pe.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:Te(a.onPointerDown,v=>{!c&&v.button===0&&v.ctrlKey===!1&&(f.onOpenToggle(),f.open||v.preventDefault())}),onKeyDown:Te(a.onKeyDown,v=>{c||(["Enter"," "].includes(v.key)&&f.onOpenToggle(),v.key==="ArrowDown"&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),XA=Bl(n=>{const{__scopeDropdownMenu:a,...l}=n,s=Hl(a);return o.jsx(BA,{...s,...l})},"DropdownMenuPortal"),QA="DropdownMenuContent",ZA=m.forwardRef(Bl(function(a,l){const{__scopeDropdownMenu:s,...c}=a,u=gw(QA,s),f=Hl(s),p=m.useRef(!1);return o.jsx(HA,{id:u.contentId,"aria-labelledby":u.triggerId,...f,...c,ref:l,onCloseAutoFocus:Te(a.onCloseAutoFocus,g=>{var v;p.current||(v=u.triggerRef.current)==null||v.focus(),p.current=!1,g.preventDefault()}),onInteractOutside:Te(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")),JA=m.forwardRef(Bl(function(a,l){const{__scopeDropdownMenu:s,...c}=a,u=Hl(s);return o.jsx(IA,{...u,...c,ref:l})},"DropdownMenuLabel")),WA=m.forwardRef(Bl(function(a,l){const{__scopeDropdownMenu:s,...c}=a,u=Hl(s);return o.jsx(PA,{...u,...c,ref:l})},"DropdownMenuItem")),eD=m.forwardRef(Bl(function(a,l){const{__scopeDropdownMenu:s,...c}=a,u=Hl(s);return o.jsx(qA,{...u,...c,ref:l})},"DropdownMenuSeparator")),tD=GA,nD=KA,aD=XA,vw=ZA,xw=JA,yw=WA,bw=eD;const rD=tD,lD=nD,ww=m.forwardRef(({className:n,sideOffset:a=4,...l},s)=>o.jsx(aD,{children:o.jsx(vw,{ref:s,sideOffset:a,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",n),...l})}));ww.displayName=vw.displayName;const Sw=m.forwardRef(({className:n,inset:a,...l},s)=>o.jsx(yw,{ref:s,className:Ee("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}));Sw.displayName=yw.displayName;const sD=m.forwardRef(({className:n,...a},l)=>o.jsx(xw,{ref:l,className:Ee("px-2 py-1.5 text-sm font-semibold",n),...a}));sD.displayName=xw.displayName;const oD=m.forwardRef(({className:n,...a},l)=>o.jsx(bw,{ref:l,className:Ee("-mx-1 my-1 h-px bg-muted",n),...a}));oD.displayName=bw.displayName;function iD(){const{theme:n,setTheme:a}=vN(),{user:l,logout:s}=km(),[c,u]=m.useState(!1),[f,p]=m.useState(null),g=oi(),v=n==="light"?SR:n==="dark"?pR:mR;return m.useEffect(()=>{Ce.get("/api/admin/update/check?force=1").then(x=>p(x)).catch(()=>{})},[]),o.jsxs("header",{className:"flex h-14 items-center justify-between border-b bg-background px-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Admin"}),o.jsxs("div",{className:"flex items-center gap-2",children:[(f==null?void 0:f.hasUpdate)&&o.jsxs(he,{variant:"ghost",size:"sm",title:`New version available: v${f.latestVersion} — go to Settings → System to update`,onClick:()=>g("/settings?tab=system"),children:[o.jsx(nR,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",f.latestVersion]}),o.jsx(he,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:o.jsx(v,{className:"h-4 w-4"})}),o.jsxs(rD,{open:c,onOpenChange:u,children:[o.jsx(lD,{asChild:!0,children:o.jsx(he,{variant:"ghost",children:(l==null?void 0:l.username)??"admin"})}),o.jsx(ww,{align:"end",children:o.jsxs(Sw,{onClick:()=>void s(),children:[o.jsx(hR,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const De=m.forwardRef(({className:n,type:a,...l},s)=>o.jsx("input",{type:a,className:Ee("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:s,...l}));De.displayName="Input";var cD=Object.defineProperty,uD=(n,a)=>cD(n,"name",{value:a,configurable:!0}),dD=m.forwardRef(uD(function(a,l){return o.jsx(Pe.label,{...a,ref:l,onMouseDown:s=>{var u;s.target.closest("button, input, select, textarea")||((u=a.onMouseDown)==null||u.call(a,s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}})},"Label")),jw=dD;const Se=m.forwardRef(({className:n,...a},l)=>o.jsx(jw,{ref:l,className:Ee("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...a}));Se.displayName=jw.displayName;const tt=m.forwardRef(({className:n,...a},l)=>o.jsx("div",{ref:l,className:Ee("rounded-lg border bg-card text-card-foreground shadow-sm",n),...a}));tt.displayName="Card";const nt=m.forwardRef(({className:n,...a},l)=>o.jsx("div",{ref:l,className:Ee("flex flex-col space-y-1.5 p-6",n),...a}));nt.displayName="CardHeader";const at=m.forwardRef(({className:n,...a},l)=>o.jsx("h3",{ref:l,className:Ee("text-lg font-semibold leading-none tracking-tight",n),...a}));at.displayName="CardTitle";const bn=m.forwardRef(({className:n,...a},l)=>o.jsx("p",{ref:l,className:Ee("text-sm text-muted-foreground",n),...a}));bn.displayName="CardDescription";const rt=m.forwardRef(({className:n,...a},l)=>o.jsx("div",{ref:l,className:Ee("p-6 pt-0",n),...a}));rt.displayName="CardContent";const Cw=m.forwardRef(({className:n,...a},l)=>o.jsx("div",{ref:l,className:Ee("flex items-center p-6 pt-0",n),...a}));Cw.displayName="CardFooter";var fD=n=>{switch(n){case"success":return pD;case"info":return vD;case"warning":return gD;case"error":return xD;default:return null}},hD=Array(12).fill(0),mD=({visible:n,className:a})=>ue.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":n},ue.createElement("div",{className:"sonner-spinner"},hD.map((l,s)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),pD=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"})),gD=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"})),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:"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"})),xD=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"})),yD=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"})),bD=()=>{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},sm=1,wD=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,...s}=n,c=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:sm++,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,...s,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 s=n instanceof Promise?n:n(),c=l!==void 0,u,f=s.then(async g=>{if(u=["resolve",g],ue.isValidElement(g))c=!1,this.create({id:l,type:"default",message:g});else if(jD(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)||sm++;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}},_n=new wD,SD=(n,a)=>{let l=(a==null?void 0:a.id)||sm++;return _n.addToast({title:n,...a,id:l}),l},jD=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",CD=SD,ED=()=>_n.toasts,RD=()=>_n.getActiveToasts(),ge=Object.assign(CD,{success:_n.success,info:_n.info,warning:_n.warning,error:_n.error,custom:_n.custom,message:_n.message,promise:_n.promise,dismiss:_n.dismiss,loading:_n.loading},{getHistory:ED,getToasts:RD});function ND(n,{insertAt:a}={}){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",a==="top"&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=n:s.appendChild(document.createTextNode(n))}ND(`: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 Hc(n){return n.label!==void 0}var TD=3,MD="32px",AD="16px",Eb=4e3,DD=356,OD=14,_D=20,kD=200;function Sa(...n){return n.filter(Boolean).join(" ")}function zD(n){let[a,l]=n.split("-"),s=[];return a&&s.push(a),l&&s.push(l),s}var LD=n=>{var a,l,s,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:D,expanded:_,removeToast:A,defaultRichColors:U,closeButton:O,style:q,cancelButtonStyle:K,actionButtonStyle:te,className:G="",descriptionClassName:ie="",duration:ce,position:le,gap:k,loadingIcon:H,expandByDefault:Q,classNames:J,icons:ee,closeButtonAriaLabel:z="Close toast",pauseWhenPageIsHidden:I}=n,[X,re]=ue.useState(null),[fe,ve]=ue.useState(null),[V,oe]=ue.useState(!1),[de,me]=ue.useState(!1),[xe,we]=ue.useState(!1),[Me,Ye]=ue.useState(!1),[Qe,st]=ue.useState(!1),[Kt,ot]=ue.useState(0),[Lt,Ot]=ue.useState(0),It=ue.useRef(w.duration||ce||Eb),en=ue.useRef(null),Pt=ue.useRef(null),xt=T===0,on=T+1<=R,St=w.type,jt=w.dismissible!==!1,tn=w.className||"",se=w.descriptionClassName||"",qe=ue.useMemo(()=>M.findIndex(Re=>Re.toastId===w.id)||0,[M,w.id]),it=ue.useMemo(()=>{var Re;return(Re=w.closeButton)!=null?Re:O},[w.closeButton,O]),Cn=ue.useMemo(()=>w.duration||ce||Eb,[w.duration,ce]),cn=ue.useRef(0),yt=ue.useRef(0),vn=ue.useRef(0),_t=ue.useRef(null),[Js,Pl]=le.split("-"),ql=ue.useMemo(()=>M.reduce((Re,ke,Le)=>Le>=qe?Re:Re+ke.height,0),[M,qe]),Ga=bD(),Tr=w.invert||b,Ct=St==="loading";yt.current=ue.useMemo(()=>qe*k+ql,[qe,ql]),ue.useEffect(()=>{It.current=Cn},[Cn]),ue.useEffect(()=>{oe(!0)},[]),ue.useEffect(()=>{let Re=Pt.current;if(Re){let ke=Re.getBoundingClientRect().height;return Ot(ke),C(Le=>[{toastId:w.id,height:ke,position:w.position},...Le]),()=>C(Le=>Le.filter(bt=>bt.toastId!==w.id))}},[C,w.id]),ue.useLayoutEffect(()=>{if(!V)return;let Re=Pt.current,ke=Re.style.height;Re.style.height="auto";let Le=Re.getBoundingClientRect().height;Re.style.height=ke,Ot(Le),C(bt=>bt.find(Mt=>Mt.toastId===w.id)?bt.map(Mt=>Mt.toastId===w.id?{...Mt,height:Le}:Mt):[{toastId:w.id,height:Le,position:w.position},...bt])},[V,w.title,w.description,C,w.id]);let lt=ue.useCallback(()=>{me(!0),ot(yt.current),C(Re=>Re.filter(ke=>ke.toastId!==w.id)),setTimeout(()=>{A(w)},kD)},[w,A,C,yt]);ue.useEffect(()=>{if(w.promise&&St==="loading"||w.duration===1/0||w.type==="loading")return;let Re;return _||j||I&&Ga?(()=>{if(vn.current<cn.current){let ke=new Date().getTime()-cn.current;It.current=It.current-ke}vn.current=new Date().getTime()})():It.current!==1/0&&(cn.current=new Date().getTime(),Re=setTimeout(()=>{var ke;(ke=w.onAutoClose)==null||ke.call(w,w),lt()},It.current)),()=>clearTimeout(Re)},[_,j,w,St,I,Ga,lt]),ue.useEffect(()=>{w.delete&&lt()},[lt,w.delete]);function qt(){var Re,ke,Le;return ee!=null&&ee.loading?ue.createElement("div",{className:Sa(J==null?void 0:J.loader,(Re=w==null?void 0:w.classNames)==null?void 0:Re.loader,"sonner-loader"),"data-visible":St==="loading"},ee.loading):H?ue.createElement("div",{className:Sa(J==null?void 0:J.loader,(ke=w==null?void 0:w.classNames)==null?void 0:ke.loader,"sonner-loader"),"data-visible":St==="loading"},H):ue.createElement(mD,{className:Sa(J==null?void 0:J.loader,(Le=w==null?void 0:w.classNames)==null?void 0:Le.loader),visible:St==="loading"})}return ue.createElement("li",{tabIndex:0,ref:Pt,className:Sa(G,tn,J==null?void 0:J.toast,(a=w==null?void 0:w.classNames)==null?void 0:a.toast,J==null?void 0:J.default,J==null?void 0:J[St],(l=w==null?void 0:w.classNames)==null?void 0:l[St]),"data-sonner-toast":"","data-rich-colors":(s=w.richColors)!=null?s:U,"data-styled":!(w.jsx||w.unstyled||E),"data-mounted":V,"data-promise":!!w.promise,"data-swiped":Qe,"data-removed":de,"data-visible":on,"data-y-position":Js,"data-x-position":Pl,"data-index":T,"data-front":xt,"data-swiping":xe,"data-dismissible":jt,"data-type":St,"data-invert":Tr,"data-swipe-out":Me,"data-swipe-direction":fe,"data-expanded":!!(_||Q&&V),style:{"--index":T,"--toasts-before":T,"--z-index":D.length-T,"--offset":`${de?Kt:yt.current}px`,"--initial-height":Q?"auto":`${Lt}px`,...q,...w.style},onDragEnd:()=>{we(!1),re(null),_t.current=null},onPointerDown:Re=>{Ct||!jt||(en.current=new Date,ot(yt.current),Re.target.setPointerCapture(Re.pointerId),Re.target.tagName!=="BUTTON"&&(we(!0),_t.current={x:Re.clientX,y:Re.clientY}))},onPointerUp:()=>{var Re,ke,Le,bt;if(Me||!jt)return;_t.current=null;let Mt=Number(((Re=Pt.current)==null?void 0:Re.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),dt=Number(((ke=Pt.current)==null?void 0:ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Xt=new Date().getTime()-((Le=en.current)==null?void 0:Le.getTime()),Et=X==="x"?Mt:dt,Ut=Math.abs(Et)/Xt;if(Math.abs(Et)>=_D||Ut>.11){ot(yt.current),(bt=w.onDismiss)==null||bt.call(w,w),ve(X==="x"?Mt>0?"right":"left":dt>0?"down":"up"),lt(),Ye(!0),st(!1);return}we(!1),re(null)},onPointerMove:Re=>{var ke,Le,bt,Mt;if(!_t.current||!jt||((ke=window.getSelection())==null?void 0:ke.toString().length)>0)return;let dt=Re.clientY-_t.current.y,Xt=Re.clientX-_t.current.x,Et=(Le=n.swipeDirections)!=null?Le:zD(le);!X&&(Math.abs(Xt)>1||Math.abs(dt)>1)&&re(Math.abs(Xt)>Math.abs(dt)?"x":"y");let Ut={x:0,y:0};X==="y"?(Et.includes("top")||Et.includes("bottom"))&&(Et.includes("top")&&dt<0||Et.includes("bottom")&&dt>0)&&(Ut.y=dt):X==="x"&&(Et.includes("left")||Et.includes("right"))&&(Et.includes("left")&&Xt<0||Et.includes("right")&&Xt>0)&&(Ut.x=Xt),(Math.abs(Ut.x)>0||Math.abs(Ut.y)>0)&&st(!0),(bt=Pt.current)==null||bt.style.setProperty("--swipe-amount-x",`${Ut.x}px`),(Mt=Pt.current)==null||Mt.style.setProperty("--swipe-amount-y",`${Ut.y}px`)}},it&&!w.jsx?ue.createElement("button",{"aria-label":z,"data-disabled":Ct,"data-close-button":!0,onClick:Ct||!jt?()=>{}:()=>{var Re;lt(),(Re=w.onDismiss)==null||Re.call(w,w)},className:Sa(J==null?void 0:J.closeButton,(c=w==null?void 0:w.classNames)==null?void 0:c.closeButton)},(u=ee==null?void 0:ee.close)!=null?u:yD):null,w.jsx||m.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ue.createElement(ue.Fragment,null,St||w.icon||w.promise?ue.createElement("div",{"data-icon":"",className:Sa(J==null?void 0:J.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||(ee==null?void 0:ee[St])||fD(St):null):null,ue.createElement("div",{"data-content":"",className:Sa(J==null?void 0:J.content,(p=w==null?void 0:w.classNames)==null?void 0:p.content)},ue.createElement("div",{"data-title":"",className:Sa(J==null?void 0:J.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:Sa(ie,se,J==null?void 0:J.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&&Hc(w.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||K,onClick:Re=>{var ke,Le;Hc(w.cancel)&&jt&&((Le=(ke=w.cancel).onClick)==null||Le.call(ke,Re),lt())},className:Sa(J==null?void 0:J.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&&Hc(w.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||te,onClick:Re=>{var ke,Le;Hc(w.action)&&((Le=(ke=w.action).onClick)==null||Le.call(ke,Re),!Re.defaultPrevented&&lt())},className:Sa(J==null?void 0:J.actionButton,(y=w==null?void 0:w.classNames)==null?void 0:y.actionButton)},w.action.label):null))};function Rb(){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 UD(n,a){let l={};return[n,a].forEach((s,c)=>{let u=c===1,f=u?"--mobile-offset":"--offset",p=u?AD:MD;function g(v){["top","right","bottom","left"].forEach(x=>{l[`${f}-${x}`]=typeof v=="number"?`${v}px`:v})}typeof s=="number"||typeof s=="string"?g(s):typeof s=="object"?["top","right","bottom","left"].forEach(v=>{s[v]===void 0?l[`${f}-${v}`]=p:l[`${f}-${v}`]=typeof s[v]=="number"?`${s[v]}px`:s[v]}):g(p)}),l}var BD=m.forwardRef(function(n,a){let{invert:l,position:s="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=TD,toastOptions:j,dir:C=Rb(),gap:R=OD,loadingIcon:M,icons:T,containerAriaLabel:D="Notifications",pauseWhenPageIsHidden:_}=n,[A,U]=ue.useState([]),O=ue.useMemo(()=>Array.from(new Set([s].concat(A.filter(I=>I.position).map(I=>I.position)))),[A,s]),[q,K]=ue.useState([]),[te,G]=ue.useState(!1),[ie,ce]=ue.useState(!1),[le,k]=ue.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=ue.useRef(null),Q=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),J=ue.useRef(null),ee=ue.useRef(!1),z=ue.useCallback(I=>{U(X=>{var re;return(re=X.find(fe=>fe.id===I.id))!=null&&re.delete||_n.dismiss(I.id),X.filter(({id:fe})=>fe!==I.id)})},[]);return ue.useEffect(()=>_n.subscribe(I=>{if(I.dismiss){U(X=>X.map(re=>re.id===I.id?{...re,delete:!0}:re));return}setTimeout(()=>{FE.flushSync(()=>{U(X=>{let re=X.findIndex(fe=>fe.id===I.id);return re!==-1?[...X.slice(0,re),{...X[re],...I},...X.slice(re+1)]:[I,...X]})})})}),[]),ue.useEffect(()=>{if(x!=="system"){k(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?k("dark"):k("light")),typeof window>"u")return;let I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:X})=>{k(X?"dark":"light")})}catch{I.addListener(({matches:re})=>{try{k(re?"dark":"light")}catch(fe){console.error(fe)}})}},[x]),ue.useEffect(()=>{A.length<=1&&G(!1)},[A]),ue.useEffect(()=>{let I=X=>{var re,fe;c.every(ve=>X[ve]||X.code===ve)&&(G(!0),(re=H.current)==null||re.focus()),X.code==="Escape"&&(document.activeElement===H.current||(fe=H.current)!=null&&fe.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[c]),ue.useEffect(()=>{if(H.current)return()=>{J.current&&(J.current.focus({preventScroll:!0}),J.current=null,ee.current=!1)}},[H.current]),ue.createElement("section",{ref:a,"aria-label":`${D} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((I,X)=>{var re;let[fe,ve]=I.split("-");return A.length?ue.createElement("ol",{key:I,dir:C==="auto"?Rb():C,tabIndex:-1,ref:H,className:p,"data-sonner-toaster":!0,"data-theme":le,"data-y-position":fe,"data-lifted":te&&A.length>1&&!u,"data-x-position":ve,style:{"--front-toast-height":`${((re=q[0])==null?void 0:re.height)||0}px`,"--width":`${DD}px`,"--gap":`${R}px`,...w,...UD(g,v)},onBlur:V=>{ee.current&&!V.currentTarget.contains(V.relatedTarget)&&(ee.current=!1,J.current&&(J.current.focus({preventScroll:!0}),J.current=null))},onFocus:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||ee.current||(ee.current=!0,J.current=V.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{ie||G(!1)},onDragEnd:()=>G(!1),onPointerDown:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||ce(!0)},onPointerUp:()=>ce(!1)},A.filter(V=>!V.position&&X===0||V.position===I).map((V,oe)=>{var de,me;return ue.createElement(LD,{key:V.id,icons:T,index:oe,toast:V,defaultRichColors:y,duration:(de=j==null?void 0:j.duration)!=null?de: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:ie,position:I,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:z,toasts:A.filter(xe=>xe.position==V.position),heights:q.filter(xe=>xe.position==V.position),setHeights:K,expandByDefault:u,gap:R,loadingIcon:M,expanded:te,pauseWhenPageIsHidden:_,swipeDirections:n.swipeDirections})})):null}))});function HD(){const{login:n}=km(),[a,l]=m.useState("admin"),[s,c]=m.useState(""),[u,f]=m.useState(""),[p,g]=m.useState(""),[v,x]=m.useState(!1),[y,b]=m.useState(!1),w=oi(),E=Bn();return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:o.jsxs(tt,{className:"w-full max-w-sm",children:[o.jsxs(nt,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain"}),o.jsx(at,{children:"Sign in"})]}),o.jsx(bn,{children:"Enter your admin credentials."})]}),o.jsxs(rt,{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(Se,{children:"Username"}),o.jsx(De,{value:a,onChange:j=>l(j.target.value),autoFocus:!0})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(Se,{children:"Password"}),o.jsx(De,{type:"password",value:s,onChange:j=>c(j.target.value)})]}),v&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(Se,{children:"2FA code (or recovery code)"}),o.jsx(De,{value:u,onChange:j=>f(j.target.value),placeholder:"123456",maxLength:6})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(Se,{children:"Recovery code (alternative)"}),o.jsx(De,{value:p,onChange:j=>g(j.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),o.jsx("div",{className:"px-6 pb-6",children:o.jsx(he,{className:"w-full",disabled:y,onClick:async()=>{var j,C;b(!0);try{if((await n(a,s,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 Ew({value:n,className:a,indicatorClassName:l}){const s=Math.max(0,Math.min(100,Number.isFinite(n)?n:0));return o.jsx("div",{role:"progressbar","aria-valuenow":Math.round(s),"aria-valuemin":0,"aria-valuemax":100,className:Ee("h-2 w-full overflow-hidden rounded-full bg-secondary",a),children:o.jsx("div",{className:Ee("h-full w-full flex-1 bg-primary transition-all",l),style:{transform:`translateX(-${100-s}%)`}})})}function Dh(){const n=new Error("Upload cancelled");return n.name="AbortError",n}function ID(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 PD(n){try{const a=JSON.parse(n);return{ok:a.ok!==!1,profile:a.profile,message:a.message}}catch{return{ok:!0}}}function Rw({file:n,passphrase:a,onProgress:l,signal:s,includeCsrf:c=!0}){return new Promise((u,f)=>{if(s!=null&&s.aborted){f(Dh());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,s==null||s.removeEventListener("abort",y),b())};function y(){x(()=>f(Dh())),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(PD(g.responseText))):x(()=>f(new Error(ID(g.responseText))))},g.onerror=()=>x(()=>f(new Error("Restore failed"))),g.onabort=()=>x(()=>f(Dh())),s==null||s.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 qD(){const[n,a]=m.useState("admin"),[l,s]=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),D=m.useRef(null);m.useEffect(()=>{Ce.get("/api/admin/setup/status").then(O=>v(!O.masterKeyConfigured)).catch(()=>v(!0))},[]);const _=!g||c.trim().length>=32,A=!f&&l.length>=12&&_,U=async()=>{if(!x)return;const O=new AbortController;D.current=O,j(!0),T({loaded:0,total:x.size,percent:0}),R("uploading");let q;try{await Rw({file:x,passphrase:b||void 0,signal:O.signal,includeCsrf:!1,onProgress:K=>{T(K),K.percent>=100&&(R("validating"),q=setTimeout(()=>R("restoring"),1500))}}),clearTimeout(q),ge.success("Database imported"),window.location.assign("/login")}catch(K){clearTimeout(q),K.name==="AbortError"?(ge.info("Import cancelled"),R("idle")):(ge.error(K.message),R("failed"))}finally{D.current=null,j(!1)}};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:o.jsxs(tt,{className:"w-full max-w-md",children:[o.jsxs(nt,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain rounded"}),o.jsx(at,{children:"Welcome to LateDev Router"})]}),o.jsx(bn,{children:"Set up the administrator account to get started."})]}),o.jsxs(rt,{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(Se,{children:"Username"}),o.jsx(De,{value:n,onChange:O=>a(O.target.value)})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(Se,{children:"Password (12+ chars)"}),o.jsx(De,{type:"password",value:l,onChange:O=>s(O.target.value)})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsxs(Se,{children:["Master encryption key ",g?"(required, 32+ chars)":"(already configured)"]}),o.jsx(De,{type:"password",value:c,onChange:O=>u(O.target.value),placeholder:"Paste or generate a 32+ character key"}),o.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:"," ",o.jsx("code",{className:"break-all",children:`node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"`})]})]})]}),o.jsxs(Cw,{className:"flex-col items-stretch gap-4",children:[o.jsx(he,{disabled:!A,onClick:async()=>{p(!0);try{await Ce.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"}),o.jsxs("div",{className:"border-t pt-4 space-y-2",children:[o.jsx(Se,{children:"Import existing database"}),o.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."}),o.jsx(De,{type:"file",accept:".ldb,.ldb.json,application/octet-stream,application/json",disabled:E,onChange:O=>{var q;return y(((q=O.target.files)==null?void 0:q[0])??null)}}),o.jsx(De,{inputMode:"numeric",maxLength:6,value:b,onChange:O=>w(O.target.value.replace(/\D/g,"")),placeholder:"Backup passphrase (6 digits)"}),o.jsx(he,{variant:"outline",disabled:!x||b.length!==6||E,onClick:U,children:"Import database"}),C!=="idle"&&o.jsxs("div",{className:"space-y-2 rounded border p-3","data-testid":"import-progress",children:[o.jsxs("div",{className:"flex items-center justify-between text-sm",children:[o.jsxs("span",{children:[C==="uploading"&&"Uploading…",C==="validating"&&"Validating…",C==="restoring"&&"Restoring…",C==="failed"&&"Failed"]}),C==="uploading"&&M&&o.jsxs("span",{className:"text-muted-foreground",children:[(M.loaded/1048576).toFixed(1)," / ",(M.total/1048576).toFixed(1)," MiB · ",M.percent,"%"]})]}),o.jsx(Ew,{value:C==="uploading"?(M==null?void 0:M.percent)??0:100,className:C!=="uploading"?"animate-pulse":void 0}),C==="uploading"&&o.jsx(he,{variant:"outline",size:"sm",onClick:()=>{var O;return(O=D.current)==null?void 0:O.abort()},children:"Cancel"})]})]})]})]})})}function Ya({title:n,description:a,actions:l,className:s}){return o.jsxs("div",{className:Ee("mb-6 flex items-start justify-between gap-4",s),children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:n}),a&&o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a})]}),l&&o.jsx("div",{className:"flex items-center gap-2",children:l})]})}const VD=K0("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 Xe({className:n,variant:a,...l}){return o.jsx("div",{className:Ee(VD({variant:a}),n),...l})}const Oh=n=>n==="ready"||n==="healthy"?"success":n==="disabled"?"secondary":"destructive";function $D(){const[n,a]=m.useState(null);return m.useEffect(()=>{Ce.get("/api/admin/dashboard").then(a).catch(()=>a(null))},[]),n?o.jsxs("div",{children:[o.jsx(Ya,{title:"Dashboard",description:"Operational summary for today",actions:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:o.jsxs(ia,{to:"/providers",children:[o.jsx(wu,{className:"mr-1 h-4 w-4"})," Provider"]})}),o.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:o.jsxs(ia,{to:"/combos",children:[o.jsx(M0,{className:"mr-1 h-4 w-4"})," Combo"]})}),o.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:o.jsxs(ia,{to:"/api-keys",children:[o.jsx(T0,{className:"mr-1 h-4 w-4"})," API Key"]})})]})}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[o.jsxs(tt,{children:[o.jsx(nt,{className:"pb-1",children:o.jsx(at,{className:"text-sm text-muted-foreground",children:"Requests today"})}),o.jsx(rt,{className:"text-2xl font-semibold",children:Jt(n.today.total)})]}),o.jsxs(tt,{children:[o.jsx(nt,{className:"pb-1",children:o.jsx(at,{className:"text-sm text-muted-foreground",children:"Success rate"})}),o.jsx(rt,{className:"text-2xl font-semibold",children:n.today.total?Cu(n.today.success/n.today.total):"—"})]}),o.jsxs(tt,{children:[o.jsx(nt,{className:"pb-1",children:o.jsx(at,{className:"text-sm text-muted-foreground",children:"Failed"})}),o.jsx(rt,{className:"text-2xl font-semibold",children:Jt(n.today.failed)})]}),o.jsxs(tt,{children:[o.jsx(nt,{className:"pb-1",children:o.jsx(at,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),o.jsx(rt,{className:"text-2xl font-semibold",children:Jt(n.today.totalTokens)})]})]}),o.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[o.jsxs(tt,{children:[o.jsxs(nt,{children:[o.jsx(at,{className:"text-base",children:"Provider health"}),o.jsxs(bn,{children:[n.providers.length," configured"]})]}),o.jsxs(rt,{className:"space-y-2",children:[n.providers.length===0&&o.jsxs("p",{className:"text-sm text-muted-foreground",children:["No providers yet. ",o.jsx(ia,{to:"/providers",className:"text-primary",children:"Add one"}),"."]}),n.providers.map(l=>o.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(A0,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),o.jsx(ia,{className:"truncate font-medium text-primary hover:underline",to:`/providers?providerId=${encodeURIComponent(l.id)}`,children:l.name}),o.jsx("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:l.slug}),o.jsx(Xe,{variant:"outline",className:"ml-2",children:l.type})]}),o.jsx(Xe,{variant:Oh(l.health),children:l.health})]},l.id))]})]}),o.jsxs(tt,{children:[o.jsxs(nt,{children:[o.jsx(at,{className:"text-base",children:"Recent failures"}),o.jsx(bn,{children:"Today"})]}),o.jsxs(rt,{className:"space-y-1 text-sm",children:[n.recentFailures.length===0&&o.jsx("p",{className:"text-muted-foreground",children:"No failures today."}),n.recentFailures.map(l=>{var s;return o.jsxs("div",{className:"flex items-center justify-between border-b py-1 last:border-0",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-mono text-xs",children:l.requestedModel}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.errorType??`HTTP ${l.httpStatus}`," — ",(s=l.errorMessage)==null?void 0:s.slice(0,60)]})]}),o.jsx("span",{className:"text-xs text-muted-foreground",children:Um(l.createdAt)})]},l.id)})]})]})]}),o.jsxs(tt,{className:"mt-6",children:[o.jsxs(nt,{children:[o.jsxs(at,{className:"flex items-center gap-2 text-base",children:[o.jsx(zm,{className:"h-4 w-4"})," Health center"]}),o.jsx(bn,{children:"Passive status from recent traffic; no active provider polling."})]}),o.jsxs(rt,{className:"grid gap-4 lg:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-sm font-medium",children:"Combos"}),o.jsx("div",{className:"space-y-2",children:n.combos.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"No combos configured."}):n.combos.map(l=>o.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx(ia,{className:"font-mono text-xs text-primary hover:underline",to:"/combos",children:l.publicModelId}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.readyMembers,"/",l.memberCount," members ready",l.reasons.length>0?` · ${l.reasons.join(", ")}`:""]})]}),o.jsx(Xe,{variant:Oh(l.state),children:l.state})]},l.id))})]}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-sm font-medium",children:"Models"}),o.jsx("div",{className:"max-h-64 space-y-2 overflow-auto",children:n.models.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"No models imported."}):n.models.map(l=>o.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx(ia,{className:"font-mono text-xs text-primary hover:underline",to:`/models?providerId=${encodeURIComponent(l.providerId)}`,children:l.publicModelId}),o.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:[l.providerName??"Unknown provider",l.lastFailureReason?` · last: ${l.lastFailureReason}`:""]})]}),o.jsx(Xe,{variant:Oh(l.state),children:l.state})]},l.id))})]})]})]})]}):o.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const pa=m.forwardRef(({className:n,...a},l)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:l,className:Ee("w-full caption-bottom text-sm",n),...a})}));pa.displayName="Table";const ga=m.forwardRef(({className:n,...a},l)=>o.jsx("thead",{ref:l,className:Ee("[&_tr]:border-b",n),...a}));ga.displayName="TableHeader";const va=m.forwardRef(({className:n,...a},l)=>o.jsx("tbody",{ref:l,className:Ee("[&_tr:last-child]:border-0",n),...a}));va.displayName="TableBody";const We=m.forwardRef(({className:n,...a},l)=>o.jsx("tr",{ref:l,className:Ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...a}));We.displayName="TableRow";const be=m.forwardRef(({className:n,...a},l)=>o.jsx("th",{ref:l,className:Ee("h-10 px-2 text-left align-middle font-medium text-muted-foreground",n),...a}));be.displayName="TableHead";const pe=m.forwardRef(({className:n,...a},l)=>o.jsx("td",{ref:l,className:Ee("p-2 align-middle",n),...a}));pe.displayName="TableCell";var YD=Object.defineProperty,Qn=(n,a)=>YD(n,"name",{value:a,configurable:!0}),lp="Dialog",[Nw,Tw]=Hn(lp),[GD,Da]=Nw(lp),Mw=Qn(n=>{const{__scopeDialog:a,children:l,open:s,defaultOpen:c,onOpenChange:u,modal:f=!0}=n,p=m.useRef(null),g=m.useRef(null),[v,x]=br({prop:s,defaultProp:c??!1,onChange:u,caller:lp}),[y,b]=m.useState(0),[w,E]=m.useState(0);return o.jsx(GD,{scope:a,triggerRef:p,contentRef:g,contentId:Ha(),titleId:Ha(),descriptionId:Ha(),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"),FD="DialogTrigger",Aw=m.forwardRef(Qn(function(a,l){const{__scopeDialog:s,...c}=a,u=Da(FD,s),f=Ke(l,u.triggerRef);return o.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":Hu(u.open),...c,ref:f,onClick:Te(a.onClick,u.onOpenToggle)})},"DialogTrigger")),Dw="DialogPortal",[KD,Ow]=Nw(Dw,{forceMount:void 0}),_w=Qn(n=>{const{__scopeDialog:a,forceMount:l,children:s,container:c}=n,u=Da(Dw,a);return o.jsx(KD,{scope:a,forceMount:l,children:m.Children.map(s,f=>o.jsx(Er,{present:l||u.open,children:o.jsx(Jm,{asChild:!0,container:c,children:f})}))})},"DialogPortal"),om="DialogOverlay",sp=m.forwardRef(Qn(function(a,l){const s=Ow(om,a.__scopeDialog),{forceMount:c=s.forceMount,...u}=a,f=Da(om,a.__scopeDialog);return f.modal?o.jsx(Er,{present:c||f.open,children:o.jsx(QD,{...u,ref:l})}):null},"DialogOverlay")),XD=Ia("DialogOverlay.RemoveScroll"),QD=m.forwardRef(Qn(function(a,l){const{__scopeDialog:s,...c}=a,u=Da(om,s),f=i1(),p=Ke(l,f);return o.jsx(Uu,{as:XD,allowPinchZoom:!0,shards:[u.contentRef],children:o.jsx(Pe.div,{"data-state":Hu(u.open),...c,ref:p,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),ei="DialogContent",op=m.forwardRef(Qn(function(a,l){const s=Ow(ei,a.__scopeDialog),{forceMount:c=s.forceMount,...u}=a,f=Da(ei,a.__scopeDialog);return o.jsx(Er,{present:c||f.open,children:f.modal?o.jsx(ZD,{...u,ref:l}):o.jsx(JD,{...u,ref:l})})},"DialogContent")),ZD=m.forwardRef(Qn(function(a,l){const s=Da(ei,a.__scopeDialog),c=m.useRef(null),u=Ke(l,s.contentRef,c);return m.useEffect(()=>{const f=c.current;if(f)return tp(f)},[]),o.jsx(kw,{...a,ref:u,trapFocus:s.open,disableOutsidePointerEvents:s.open,onCloseAutoFocus:Te(a.onCloseAutoFocus,f=>{var p;f.preventDefault(),(p=s.triggerRef.current)==null||p.focus()}),onPointerDownOutside:Te(a.onPointerDownOutside,f=>{const p=f.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&f.preventDefault()}),onFocusOutside:Te(a.onFocusOutside,f=>f.preventDefault())})},"DialogContentModal")),JD=m.forwardRef(Qn(function(a,l){const s=Da(ei,a.__scopeDialog),c=m.useRef(!1),u=m.useRef(!1);return o.jsx(kw,{...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=s.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=s.triggerRef.current)==null?void 0:x.contains(p))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&u.current&&f.preventDefault()}})},"DialogContentNonModal")),kw=m.forwardRef(Qn(function(a,l){const{__scopeDialog:s,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,...p}=a,g=Da(ei,s);return fi(),o.jsx(o.Fragment,{children:o.jsx(Vm,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:u,onUnmountAutoFocus:f,children:o.jsx(Ru,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Hu(g.open),...p,ref:l,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),WD="DialogTitle",ip=m.forwardRef(Qn(function(a,l){const{__scopeDialog:s,...c}=a,u=Da(WD,s),{setTitleCount:f}=u;return Wt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),o.jsx(Pe.h2,{id:u.titleId,...c,ref:l})},"DialogTitle")),eO="DialogDescription",cp=m.forwardRef(Qn(function(a,l){const{__scopeDialog:s,...c}=a,u=Da(eO,s),{setDescriptionCount:f}=u;return Wt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),o.jsx(Pe.p,{id:u.descriptionId,...c,ref:l})},"DialogDescription")),tO="DialogClose",up=m.forwardRef(Qn(function(a,l){const{__scopeDialog:s,...c}=a,u=Da(tO,s);return o.jsx(Pe.button,{type:"button",...c,ref:l,onClick:Te(a.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function Hu(n){return n?"open":"closed"}Qn(Hu,"getState");const kn=Mw,mi=Aw,nO=_w,zw=m.forwardRef(({className:n,...a},l)=>o.jsx(sp,{ref:l,className:Ee("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}));zw.displayName=sp.displayName;const wn=m.forwardRef(({className:n,children:a,...l},s)=>o.jsxs(nO,{children:[o.jsx(zw,{}),o.jsxs(op,{ref:s,className:Ee("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,o.jsxs(up,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[o.jsx(ju,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wn.displayName=op.displayName;const Sn=({className:n,...a})=>o.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",n),...a});Sn.displayName="DialogHeader";const zn=({className:n,...a})=>o.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a});zn.displayName="DialogFooter";const jn=m.forwardRef(({className:n,...a},l)=>o.jsx(ip,{ref:l,className:Ee("text-lg font-semibold leading-none tracking-tight",n),...a}));jn.displayName=ip.displayName;const cu=m.forwardRef(({className:n,...a},l)=>o.jsx(cp,{ref:l,className:Ee("text-sm text-muted-foreground",n),...a}));cu.displayName=cp.displayName;var aO=Object.defineProperty,Rr=(n,a)=>aO(n,"name",{value:a,configurable:!0}),rO="AlertDialog",[lO,Q4]=Hn(rO,[Tw]),Nr=Tw(),sO=Rr(n=>{const{__scopeAlertDialog:a,...l}=n,s=Nr(a);return o.jsx(Mw,{...s,...l,modal:!0})},"AlertDialog"),oO=m.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:s,...c}=a,u=Nr(s);return o.jsx(Aw,{...u,...c,ref:l})},"AlertDialogTrigger")),iO=Rr(n=>{const{__scopeAlertDialog:a,...l}=n,s=Nr(a);return o.jsx(_w,{...s,...l})},"AlertDialogPortal"),cO=m.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:s,...c}=a,u=Nr(s);return o.jsx(sp,{...u,...c,ref:l})},"AlertDialogOverlay")),uO="AlertDialogContent",[dO,fO]=lO(uO),hO=m.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:s,children:c,...u}=a,f=Nr(s),p=m.useRef(null),g=Ke(l,p),v=m.useRef(null);return o.jsx(dO,{scope:s,cancelRef:v,children:o.jsx(op,{role:"alertdialog",...f,...u,ref:g,onOpenAutoFocus:Te(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")),mO=m.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:s,...c}=a,u=Nr(s);return o.jsx(ip,{...u,...c,ref:l})},"AlertDialogTitle")),pO=m.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:s,...c}=a,u=Nr(s);return o.jsx(cp,{...u,...c,ref:l})},"AlertDialogDescription")),gO=m.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:s,...c}=a,u=Nr(s);return o.jsx(up,{...u,...c,ref:l})},"AlertDialogAction")),vO="AlertDialogCancel",xO=m.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:s,...c}=a,{cancelRef:u}=fO(vO,s),f=Nr(s),p=Ke(l,u);return o.jsx(up,{...f,...c,ref:p})},"AlertDialogCancel")),yO=sO,bO=oO,wO=iO,Lw=cO,Uw=hO,Bw=gO,Hw=xO,Iw=mO,Pw=pO;const dp=yO,SO=bO,jO=wO,qw=m.forwardRef(({className:n,...a},l)=>o.jsx(Lw,{ref:l,className:Ee("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}));qw.displayName=Lw.displayName;const Iu=m.forwardRef(({className:n,...a},l)=>o.jsxs(jO,{children:[o.jsx(qw,{}),o.jsx(Uw,{ref:l,className:Ee("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})]}));Iu.displayName=Uw.displayName;const fp=({className:n,...a})=>o.jsx("div",{className:Ee("flex flex-col space-y-2 text-center sm:text-left",n),...a}),hp=({className:n,...a})=>o.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a}),Pu=m.forwardRef(({className:n,...a},l)=>o.jsx(Iw,{ref:l,className:Ee("text-lg font-semibold",n),...a}));Pu.displayName=Iw.displayName;const qu=m.forwardRef(({className:n,...a},l)=>o.jsx(Pw,{ref:l,className:Ee("text-sm text-muted-foreground",n),...a}));qu.displayName=Pw.displayName;const Vu=m.forwardRef(({className:n,...a},l)=>o.jsx(Bw,{ref:l,className:Ee("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}));Vu.displayName=Bw.displayName;const $u=m.forwardRef(({className:n,...a},l)=>o.jsx(Hw,{ref:l,className:Ee("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}));$u.displayName=Hw.displayName;var CO=Object.defineProperty,EO=(n,a)=>CO(n,"name",{value:a,configurable:!0});function im(n,[a,l]){return Math.min(l,Math.max(a,n))}EO(im,"clamp");var RO=Object.defineProperty,NO=(n,a)=>RO(n,"name",{value:a,configurable:!0});function Vw(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])}NO(Vw,"usePrevious");var TO=Object.defineProperty,MO=(n,a)=>TO(n,"name",{value:a,configurable:!0}),$w=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"}),AO=m.forwardRef(MO(function(a,l){return o.jsx(Pe.span,{...a,ref:l,style:{...$w,...a.style}})},"VisuallyHidden")),DO=AO,OO=Object.defineProperty,pt=(n,a)=>OO(n,"name",{value:a,configurable:!0}),_O=[" ","Enter","ArrowUp","ArrowDown"],kO=[" ","Enter"],Bs="Select",[Yu,mp,zO]=Eu(Bs),[Il,Z4]=Hn(Bs,[zO,Fs]),pp=Fs(),[LO,dl]=Il(Bs),[UO,BO]=Il(Bs);function Yw(n){const{__scopeSelect:a,children:l,open:s,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=pp(a),[R,M]=m.useState(null),[T,D]=m.useState(null),[_,A]=m.useState(!1),U=di(v),[O,q]=br({prop:s,defaultProp:c??!1,onChange:u,caller:Bs}),[K,te]=br({prop:f,defaultProp:p,onChange:g,caller:Bs}),G=m.useRef(null),ie=m.useRef(K);m.useEffect(()=>{const I=E?R==null?void 0:R.ownerDocument.getElementById(E):R==null?void 0:R.form;if(I instanceof HTMLFormElement){const X=pt(()=>te(ie.current),"reset");return I.addEventListener("reset",X),()=>I.removeEventListener("reset",X)}},[E,R,te]);const ce=R?!!E||!!R.closest("form"):!0,[le,k]=m.useState(new Set),H=Ha(),Q=Array.from(le).map(I=>I.props.value).join(";"),J=m.useCallback(I=>{k(X=>new Set(X).add(I))},[]),ee=m.useCallback(I=>{k(X=>{const re=new Set(X);return re.delete(I),re})},[]),z={required:w,trigger:R,onTriggerChange:M,valueNode:T,onValueNodeChange:D,valueNodeHasChildren:_,onValueNodeHasChildrenChange:A,contentId:H,value:K,onValueChange:te,open:O,onOpenChange:q,dir:U,triggerPointerDownPosRef:G,disabled:b,name:x,autoComplete:y,form:E,nativeOptions:le,nativeSelectKey:Q,isFormControl:ce};return o.jsx(_1,{...C,children:o.jsx(LO,{scope:a,...z,children:o.jsx(Yu.Provider,{scope:a,children:o.jsx(UO,{scope:a,onNativeOptionAdd:J,onNativeOptionRemove:ee,children:Zw(j)?j(z):l})})})})}pt(Yw,"SelectProvider");var HO=pt(n=>{const{__scopeSelect:a,children:l,...s}=n;return o.jsx(Yw,{__scopeSelect:a,...s,internal_do_not_use_render:({isFormControl:c})=>o.jsxs(o.Fragment,{children:[l,c?o.jsx(o_,{__scopeSelect:a}):null]})})},"Select"),IO="SelectTrigger",Gw=m.forwardRef(pt(function(a,l){const{__scopeSelect:s,disabled:c=!1,...u}=a,f=pp(s),p=dl(IO,s),g=p.disabled||c,v=Ke(l,p.onTriggerChange),x=mp(s),y=m.useRef("touch"),[b,w,E]=gp(C=>{const R=x().filter(D=>!D.disabled),M=R.find(D=>D.value===p.value),T=vp(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 o.jsx(k1,{asChild:!0,...f,children:o.jsx(Pe.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":pi(p.value)?"":void 0,...u,ref:v,onClick:Te(u.onClick,C=>{C.currentTarget.focus(),y.current!=="mouse"&&j(C)}),onPointerDown:Te(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:Te(u.onKeyDown,C=>{const R=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&w(C.key),!(R&&C.key===" ")&&_O.includes(C.key)&&(j(),C.preventDefault())})})})},"SelectTrigger")),PO="SelectValue",qO=m.forwardRef(pt(function(a,l){const{__scopeSelect:s,className:c,style:u,children:f,placeholder:p="",...g}=a,v=dl(PO,s),{onValueNodeHasChildrenChange:x}=v,y=f!==void 0,b=Ke(l,v.onValueNodeChange);Wt(()=>{x(y)},[x,y]);const w=pi(v.value);return o.jsx(Pe.span,{...g,asChild:w?!1:g.asChild,ref:b,style:{pointerEvents:"none"},children:o.jsx(m.Fragment,{children:w?p:f},w?"placeholder":"value")})},"SelectValue")),VO=m.forwardRef(pt(function(a,l){const{__scopeSelect:s,children:c,...u}=a;return o.jsx(Pe.span,{"aria-hidden":!0,...u,ref:l,children:c||"▼"})},"SelectIcon")),$O="SelectPortal",[YO,GO]=Il($O,{forceMount:void 0}),FO=pt(n=>{const{__scopeSelect:a,forceMount:l,...s}=n;return o.jsx(YO,{scope:n.__scopeSelect,forceMount:l,children:o.jsx(Jm,{asChild:!0,...s})})},"SelectPortal"),zl="SelectContent",Fw=m.forwardRef(pt(function(a,l){const s=GO(zl,a.__scopeSelect),{forceMount:c=s.forceMount,...u}=a,f=dl(zl,a.__scopeSelect),[p,g]=m.useState();return Wt(()=>{g(new DocumentFragment)},[]),o.jsx(Er,{present:c||f.open,children:({present:v})=>v?o.jsx(QO,{...u,ref:l}):o.jsx(KO,{...u,fragment:p})})},"SelectContent")),KO=m.forwardRef(pt(function(a,l){const{__scopeSelect:s,children:c,fragment:u}=a;return u?Ca.createPortal(o.jsx(Kw,{scope:s,children:o.jsx(Yu.Slot,{scope:s,children:o.jsx("div",{ref:l,children:c})})}),u):null},"SelectContentFragment")),ja=10,[Kw,Gu]=Il(zl),XO=Ia("SelectContent.RemoveScroll"),QO=m.forwardRef(pt(function(a,l){const{__scopeSelect:s}=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=dl(zl,s),[D,_]=m.useState(null),[A,U]=m.useState(null),O=Ke(l,_),[q,K]=m.useState(null),[te,G]=m.useState(null),ie=mp(s),[ce,le]=m.useState(!1),k=m.useRef(!1);m.useEffect(()=>{if(D)return tp(D)},[D]),fi();const H=m.useCallback(oe=>{const[de,...me]=ie().map(Me=>Me.ref.current),[xe]=me.slice(-1),we=document.activeElement;for(const Me of oe)if(Me===we||(Me==null||Me.scrollIntoView({block:"nearest"}),Me===de&&A&&(A.scrollTop=0),Me===xe&&A&&(A.scrollTop=A.scrollHeight),Me==null||Me.focus(),document.activeElement!==we))return},[ie,A]),Q=m.useCallback(()=>H([q,D]),[H,q,D]);m.useEffect(()=>{ce&&Q()},[ce,Q]);const{onOpenChange:J,triggerPointerDownPosRef:ee}=T;m.useEffect(()=>{if(D){let oe={x:0,y:0};const de=pt(xe=>{var we,Me;oe={x:Math.abs(Math.round(xe.pageX)-(((we=ee.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(xe.pageY)-(((Me=ee.current)==null?void 0:Me.y)??0))}},"handlePointerMove"),me=pt(xe=>{oe.x<=10&&oe.y<=10?xe.preventDefault():xe.composedPath().includes(D)||J(!1),document.removeEventListener("pointermove",de),ee.current=null},"handlePointerUp");return ee.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",me,{capture:!0})}}},[D,J,ee]),m.useEffect(()=>{const oe=pt(()=>J(!1),"close");return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[J]);const[z,I]=gp(oe=>{const de=ie().filter(we=>!we.disabled),me=de.find(we=>we.ref.current===document.activeElement),xe=vp(de,oe,me);xe&&setTimeout(()=>{var we;return(we=xe.ref.current)==null?void 0:we.focus()})}),X=m.useCallback((oe,de,me)=>{const xe=!k.current&&!me;(T.value!==void 0&&T.value===de||xe)&&(K(oe),xe&&(k.current=!0))},[T.value]),re=m.useCallback(()=>D==null?void 0:D.focus(),[D]),fe=m.useCallback((oe,de,me)=>{const xe=!k.current&&!me;(T.value!==void 0&&T.value===de||xe)&&G(oe)},[T.value]),ve=c==="popper"?Nb:ZO,V=ve===Nb?{side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:E,sticky:j,hideWhenDetached:C,avoidCollisions:R}:{};return o.jsx(Kw,{scope:s,content:D,viewport:A,onViewportChange:U,itemRefCallback:X,selectedItem:q,onItemLeave:re,itemTextRefCallback:fe,focusSelectedItem:Q,selectedItemText:te,position:c,isPositioned:ce,searchRef:z,children:o.jsx(Uu,{as:XO,allowPinchZoom:!0,children:o.jsx(Vm,{asChild:!0,trapped:T.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:Te(u,oe=>{var de;(de=T.trigger)==null||de.focus({preventScroll:!0}),oe.preventDefault()}),children:o.jsx(Ru,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:o.jsx(ve,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:oe=>oe.preventDefault(),...M,...V,onPlaced:()=>le(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:Te(M.onKeyDown,oe=>{const de=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!de&&oe.key.length===1&&I(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let xe=ie().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const we=oe.target,Me=xe.indexOf(we);xe=xe.slice(Me+1)}setTimeout(()=>H(xe)),oe.preventDefault()}})})})})})})},"SelectContentImpl")),ZO=m.forwardRef(pt(function(a,l){const{__scopeSelect:s,onPlaced:c,...u}=a,f=dl(zl,s),p=Gu(zl,s),[g,v]=m.useState(null),[x,y]=m.useState(null),b=Ke(l,y),w=mp(s),E=m.useRef(!1),j=m.useRef(!0),{viewport:C,selectedItem:R,selectedItemText:M,focusSelectedItem:T}=p,D=m.useCallback(()=>{if(f.trigger&&f.valueNode&&g&&x&&C&&R&&M){const O=f.trigger.getBoundingClientRect(),q=x.getBoundingClientRect(),K=f.valueNode.getBoundingClientRect(),te=M.getBoundingClientRect();if(f.dir!=="rtl"){const we=te.left-q.left,Me=K.left-we,Ye=O.left-Me,Qe=O.width+Ye,st=Math.max(Qe,q.width),Kt=window.innerWidth-ja,ot=im(Me,[ja,Math.max(ja,Kt-st)]);g.style.minWidth=Qe+"px",g.style.left=ot+"px"}else{const we=q.right-te.right,Me=window.innerWidth-K.right-we,Ye=window.innerWidth-O.right-Me,Qe=O.width+Ye,st=Math.max(Qe,q.width),Kt=window.innerWidth-ja,ot=im(Me,[ja,Math.max(ja,Kt-st)]);g.style.minWidth=Qe+"px",g.style.right=ot+"px"}const G=w(),ie=window.innerHeight-ja*2,ce=C.scrollHeight,le=window.getComputedStyle(x),k=parseInt(le.borderTopWidth,10),H=parseInt(le.paddingTop,10),Q=parseInt(le.borderBottomWidth,10),J=parseInt(le.paddingBottom,10),ee=k+H+ce+J+Q,z=Math.min(R.offsetHeight*5,ee),I=window.getComputedStyle(C),X=parseInt(I.paddingTop,10),re=parseInt(I.paddingBottom,10),fe=O.top+O.height/2-ja,ve=ie-fe,V=R.offsetHeight/2,oe=R.offsetTop+V,de=k+H+oe,me=ee-de;if(de<=fe){const we=G.length>0&&R===G[G.length-1].ref.current;g.style.bottom="0px";const Me=x.clientHeight-C.offsetTop-C.offsetHeight,Ye=Math.max(ve,V+(we?re:0)+Me+Q),Qe=de+Ye;g.style.height=Qe+"px"}else{const we=G.length>0&&R===G[0].ref.current;g.style.top="0px";const Ye=Math.max(fe,k+C.offsetTop+(we?X:0)+V)+me;g.style.height=Ye+"px",C.scrollTop=de-fe+C.offsetTop}g.style.margin=`${ja}px 0`,g.style.minHeight=z+"px",g.style.maxHeight=ie+"px",c==null||c(),requestAnimationFrame(()=>E.current=!0)}},[w,f.trigger,f.valueNode,g,x,C,R,M,f.dir,c]);Wt(()=>D(),[D]);const[_,A]=m.useState();Wt(()=>{x&&A(window.getComputedStyle(x).zIndex)},[x]);const U=m.useCallback(O=>{O&&j.current===!0&&(D(),T==null||T(),j.current=!1)},[D,T]);return o.jsx(JO,{scope:s,contentWrapper:g,shouldExpandOnScrollRef:E,onScrollButtonChange:U,children:o.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:o.jsx(Pe.div,{...u,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...u.style}})})})},"SelectItemAlignedPosition")),Nb=m.forwardRef(pt(function(a,l){const{__scopeSelect:s,align:c="start",collisionPadding:u=ja,...f}=a,p=pp(s);return o.jsx(Zm,{...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")),[JO,WO]=Il(zl,{}),Tb="SelectViewport",e_=m.forwardRef(pt(function(a,l){const{__scopeSelect:s,nonce:c,...u}=a,f=Gu(Tb,s),p=WO(Tb,s),g=Ke(l,f.onViewportChange),v=m.useRef(0);return o.jsxs(o.Fragment,{children:[o.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}),o.jsx(Yu.Slot,{scope:s,children:o.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...u,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...u.style},onScroll:Te(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-ja*2,C=parseFloat(b.style.minHeight),R=parseFloat(b.style.height),M=Math.max(C,R);if(M<j){const T=M+E,D=Math.min(j,T),_=T-D;b.style.height=D+"px",b.style.bottom==="0px"&&(y.scrollTop=_>0?_:0,b.style.justifyContent="flex-end")}}}v.current=y.scrollTop})})})]})},"SelectViewport")),t_="SelectGroup",[J4,W4]=Il(t_),cm="SelectItem",[n_,Xw]=Il(cm),Qw=m.forwardRef(pt(function(a,l){const{__scopeSelect:s,value:c,disabled:u=!1,textValue:f,...p}=a,g=dl(cm,s),v=Gu(cm,s),x=g.value===c,[y,b]=m.useState(f??""),[w,E]=m.useState(!1),j=ma(D=>{var _;return(_=v.itemRefCallback)==null?void 0:_.call(v,D,c,u)}),C=Ke(l,j),R=Ha(),M=m.useRef("touch"),T=pt(()=>{u||(g.onValueChange(c),g.onOpenChange(!1))},"handleSelect");return o.jsx(n_,{scope:s,value:c,disabled:u,textId:R,isSelected:x,onItemTextChange:m.useCallback(D=>{b(_=>_||((D==null?void 0:D.textContent)??"").trim())},[]),children:o.jsx(Yu.ItemSlot,{scope:s,value:c,disabled:u,textValue:y,children:o.jsx(Pe.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:Te(p.onFocus,()=>E(!0)),onBlur:Te(p.onBlur,()=>E(!1)),onClick:Te(p.onClick,()=>{M.current!=="mouse"&&T()}),onPointerUp:Te(p.onPointerUp,()=>{M.current==="mouse"&&T()}),onPointerDown:Te(p.onPointerDown,D=>{M.current=D.pointerType}),onPointerMove:Te(p.onPointerMove,D=>{var _;M.current=D.pointerType,u?(_=v.onItemLeave)==null||_.call(v):M.current==="mouse"&&D.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(p.onPointerLeave,D=>{var _;D.currentTarget===document.activeElement&&((_=v.onItemLeave)==null||_.call(v))}),onKeyDown:Te(p.onKeyDown,D=>{var A;u||D.target!==D.currentTarget||((A=v.searchRef)==null?void 0:A.current)!==""&&D.key===" "||(kO.includes(D.key)&&T(),D.key===" "&&D.preventDefault())})})})})},"SelectItem")),Ic="SelectItemText",a_=m.forwardRef(pt(function(a,l){const{__scopeSelect:s,className:c,style:u,...f}=a,p=dl(Ic,s),g=Gu(Ic,s),v=Xw(Ic,s),x=BO(Ic,s),[y,b]=m.useState(null),w=ma(T=>{var D;return(D=g.itemTextRefCallback)==null?void 0:D.call(g,T,v.value,v.disabled)}),E=Ke(l,b,v.onItemTextChange,w),j=y==null?void 0:y.textContent,C=m.useMemo(()=>o.jsx("option",{value:v.value,disabled:v.disabled,children:j},v.value),[v.disabled,v.value,j]),{onNativeOptionAdd:R,onNativeOptionRemove:M}=x;return Wt(()=>(R(C),()=>M(C)),[R,M,C]),o.jsxs(o.Fragment,{children:[o.jsx(Pe.span,{id:v.textId,...f,ref:E}),v.isSelected&&p.valueNode&&!p.valueNodeHasChildren&&!pi(p.value)?Ca.createPortal(f.children,p.valueNode):null]})},"SelectItemText")),r_="SelectItemIndicator",l_=m.forwardRef(pt(function(a,l){const{__scopeSelect:s,...c}=a;return Xw(r_,s).isSelected?o.jsx(Pe.span,{"aria-hidden":!0,...c,ref:l}):null},"SelectItemIndicator")),s_="SelectBubbleInput",o_=m.forwardRef(pt(function({__scopeSelect:a,...l},s){const c=dl(s_,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(s,E),C=u??"",R=Vw(C),M=Array.from(b).some(T=>(T.props.value??"")==="");return m.useEffect(()=>{const T=E.current;if(!T)return;const D=window.HTMLSelectElement.prototype,A=Object.getOwnPropertyDescriptor(D,"value").set;if(R!==C&&A){const U=new Event("change",{bubbles:!0});A.call(T,C),T.dispatchEvent(U)}},[R,C]),o.jsxs(Pe.select,{"aria-hidden":!0,required:p,tabIndex:-1,name:v,autoComplete:x,disabled:g,form:y,onChange:T=>f(T.target.value),...l,style:{...$w,...l.style},ref:j,defaultValue:C,children:[pi(u)&&!M?o.jsx("option",{value:""}):null,Array.from(b)]},w)},"SelectBubbleInput"));function Zw(n){return typeof n=="function"}pt(Zw,"isFunction");function pi(n){return n===""||n===void 0}pt(pi,"shouldShowPlaceholder");function gp(n){const a=ma(n),l=m.useRef(""),s=m.useRef(0),c=m.useCallback(f=>{const p=l.current+f;a(p),pt((function g(v){l.current=v,window.clearTimeout(s.current),v!==""&&(s.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(p)},[a]),u=m.useCallback(()=>{l.current="",window.clearTimeout(s.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(s.current),[]),[l,c,u]}pt(gp,"useTypeaheadSearch");function vp(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=Jw(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(vp,"findNextItem");function Jw(n,a){return n.map((l,s)=>n[(a+s)%n.length])}pt(Jw,"wrapArray");const Ra=HO,Na=qO,da=m.forwardRef(({className:n,children:a,...l},s)=>o.jsxs(Gw,{ref:s,className:Ee("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,o.jsx(VO,{asChild:!0,children:o.jsx(tR,{className:"h-4 w-4 opacity-50"})})]}));da.displayName=Gw.displayName;const fa=m.forwardRef(({className:n,children:a,position:l="popper",...s},c)=>o.jsx(FO,{children:o.jsx(Fw,{ref:c,className:Ee("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",n),position:l,...s,children:o.jsx(e_,{className:Ee("p-1",l==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:a})})}));fa.displayName=Fw.displayName;const wt=m.forwardRef(({className:n,children:a,...l},s)=>o.jsxs(Qw,{ref:s,className:Ee("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:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(l_,{children:o.jsx(E0,{className:"h-4 w-4"})})}),o.jsx(a_,{children:a})]}));wt.displayName=Qw.displayName;var i_=Object.defineProperty,cl=(n,a)=>i_(n,"name",{value:a,configurable:!0}),xp="Switch",[c_,e5]=Hn(xp),[u_,yp]=c_(xp);function Ww(n){const{__scopeSwitch:a,checked:l,children:s,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=br({prop:l,defaultProp:c??!1,onChange:g,caller:xp}),[E,j]=m.useState(null),[C,R]=m.useState(null),M=m.useRef(!1),[T,D]=m.useReducer(U=>U+1,0),_=E?!!f||!!E.closest("form"):!0,A={checked:b,setChecked:w,disabled:u,control:E,setControl:j,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:M,userInteractionCount:T,onUserInteraction:D,required:v,defaultChecked:c,isFormControl:_,bubbleInput:C,setBubbleInput:R};return o.jsx(u_,{scope:a,...A,children:tS(y)?y(A):s})}cl(Ww,"SwitchProvider");var d_="SwitchTrigger",f_=m.forwardRef(cl(function({__scopeSwitch:a,onClick:l,...s},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}=yp(d_,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 D=cl(()=>b(M.current),"reset");return T.addEventListener("reset",D),()=>T.removeEventListener("reset",D)}},[u,f,b]),o.jsx(Pe.button,{type:"button",role:"switch","aria-checked":v,"aria-required":x,"data-state":bp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...s,ref:R,onClick:Te(l,T=>{E(),b(D=>!D),C&&j&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"SwitchTrigger")),eS=m.forwardRef(cl(function(a,l){const{__scopeSwitch:s,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return o.jsx(Ww,{__scopeSwitch:s,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>o.jsxs(o.Fragment,{children:[o.jsx(f_,{...b,ref:l,__scopeSwitch:s}),w&&o.jsx(g_,{__scopeSwitch:s})]})})},"Switch")),h_="SwitchThumb",m_=m.forwardRef(cl(function(a,l){const{__scopeSwitch:s,...c}=a,u=yp(h_,s);return o.jsx(Pe.span,{"data-state":bp(u.checked),"data-disabled":u.disabled?"":void 0,...c,ref:l})},"SwitchThumb")),p_="SwitchBubbleInput",g_=m.forwardRef(cl(function({__scopeSwitch:a,onClick:l,...s},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}=yp(p_,a),R=Ke(c,C),M=Ou(u),T=m.useRef(!1),D=m.useRef(g),_=m.useRef(p);m.useEffect(()=>{const U=j;if(!U)return;const O=window.HTMLInputElement.prototype,K=Object.getOwnPropertyDescriptor(O,"checked").set,te=p!==_.current;_.current=p;const G=D.current!==g;D.current=g;const ie=!(te&&f.current);if(G&&K){T.current=!te;const ce=new Event("click",{bubbles:ie});K.call(U,g),U.dispatchEvent(ce),T.current=!1}},[j,g,f,p]);const A=m.useRef(g);return o.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??A.current,required:x,disabled:y,name:b,value:w,form:E,...s,tabIndex:-1,ref:R,onClick:Te(l,U=>{T.current&&U.stopPropagation()}),style:{...s.style,...M,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function tS(n){return typeof n=="function"}cl(tS,"isFunction");function bp(n){return n?"checked":"unchecked"}cl(bp,"getState");const Ta=m.forwardRef(({className:n,...a},l)=>o.jsx(eS,{className:Ee("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:o.jsx(m_,{className:Ee("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")})}));Ta.displayName=eS.displayName;const Al={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0},v_={openai:"https://api.openai.com",anthropic:"https://api.anthropic.com"};function x_(){const[n,a]=m.useState([]),[l,s]=m.useState(!1),[c,u]=m.useState(Al),[f,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(null),[b,w]=m.useState(Al),[E,j]=m.useState(null),[C,R]=m.useState(!1),M=async()=>{try{const O=await Ce.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 Ce.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"),s(!1),u(Al),M()}catch(O){ge.error(O.message)}finally{p(!1)}},D=async O=>{v(O);try{const q=await Ce.post(`/api/admin/providers/${O}/test`);ge.success(q.ok?`Connection OK: ${q.detail}`:`Failed: ${q.detail}`),M()}catch(q){ge.error(q.message)}finally{v(null)}},_=O=>{y(O.id),w({...Al,name:O.name,slug:O.slug||"",type:O.type,baseUrl:O.baseUrl,apiKey:"",customHeaders:"",enabled:O.enabled})},A=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 Ce.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(Al),M()}catch(O){ge.error(O.message)}finally{p(!1)}}},U=async O=>{R(!0);try{await Ce.del(`/api/admin/providers/${O}`),ge.success("Provider removed"),M()}catch(q){ge.error(q.message)}finally{R(!1),j(null)}};return o.jsxs("div",{children:[o.jsx(Ya,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:o.jsx("div",{className:"flex gap-2",children:o.jsxs(kn,{open:l,onOpenChange:s,children:[o.jsx(mi,{asChild:!0,children:o.jsx(he,{children:"Add compatible provider"})}),o.jsxs(wn,{children:[o.jsxs(Sn,{children:[o.jsx(jn,{children:"New provider"}),o.jsx(cu,{children:"API-key or compatible endpoint."})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx(Se,{htmlFor:"provider-name",children:"Name"}),o.jsx(De,{id:"provider-name",value:c.name,onChange:O=>u({...c,name:O.target.value})})]}),o.jsxs("div",{children:[o.jsx(Se,{htmlFor:"provider-slug",children:"Slug (optional)"}),o.jsx(De,{id:"provider-slug",value:c.slug,onChange:O=>u({...c,slug:O.target.value})})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Type"}),o.jsxs(Ra,{value:c.type,onValueChange:O=>u(q=>({...q,type:O,baseUrl:v_[O]})),children:[o.jsx(da,{children:o.jsx(Na,{})}),o.jsxs(fa,{children:[o.jsx(wt,{value:"openai",children:"OpenAI-compatible"}),o.jsx(wt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),o.jsxs("div",{children:[o.jsx(Se,{htmlFor:"provider-base-url",children:"Base URL"}),o.jsx(De,{id:"provider-base-url",value:c.baseUrl,onChange:O=>u({...c,baseUrl:O.target.value})})]}),o.jsxs("div",{children:[o.jsx(Se,{htmlFor:"provider-api-key",children:"API key"}),o.jsx(De,{id:"provider-api-key",type:"password",value:c.apiKey,onChange:O=>u({...c,apiKey:O.target.value})})]}),o.jsxs("div",{children:[o.jsx(Se,{htmlFor:"provider-headers",children:"Custom headers (JSON)"}),o.jsx(De,{id:"provider-headers",value:c.customHeaders,onChange:O=>u({...c,customHeaders:O.target.value}),placeholder:'{"X-Org":"acme"}'})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ta,{checked:c.enabled,onCheckedChange:O=>u({...c,enabled:O})}),o.jsx(Se,{children:"Enabled"})]})]}),o.jsxs(zn,{children:[o.jsx(he,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),o.jsx(he,{disabled:f||!c.name||!c.apiKey,onClick:T,children:f?"Creating…":"Create"})]})]})]})})}),o.jsxs(tt,{children:[o.jsxs(nt,{children:[o.jsx(at,{className:"text-base",children:"All providers"}),o.jsxs(bn,{children:[n.length," total"]})]}),o.jsx(rt,{children:o.jsxs(pa,{children:[o.jsx(ga,{children:o.jsxs(We,{children:[o.jsx(be,{children:"Name"}),o.jsx(be,{children:"Type"}),o.jsx(be,{children:"Base URL"}),o.jsx(be,{children:"Models"}),o.jsx(be,{children:"Health"}),o.jsx(be,{children:"Enabled"}),o.jsx(be,{className:"text-right",children:"Actions"})]})}),o.jsxs(va,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),n.map(O=>o.jsxs(We,{children:[o.jsxs(pe,{className:"font-medium",children:[O.name," ",o.jsx("span",{className:"text-xs text-muted-foreground",children:O.slug})]}),o.jsx(pe,{children:o.jsx(Xe,{variant:"outline",children:O.type})}),o.jsx(pe,{className:"text-xs text-muted-foreground",children:O.baseUrl}),o.jsx(pe,{children:O.modelCount}),o.jsx(pe,{children:o.jsx(Xe,{variant:O.health==="healthy"?"success":O.health==="down"?"destructive":"secondary",children:O.health})}),o.jsx(pe,{children:O.enabled?"Yes":"No"}),o.jsx(pe,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-1",children:[o.jsx(he,{size:"sm",variant:"outline",disabled:g===O.id,onClick:()=>D(O.id),children:o.jsx(D0,{className:"h-3 w-3"})}),o.jsx(he,{size:"sm",variant:"outline",onClick:()=>_(O),children:"✎"}),o.jsx(he,{size:"sm",variant:"outline",onClick:()=>j(O.id),children:o.jsx(Su,{className:"h-3 w-3"})})]})})]},O.id))]})]})})]}),o.jsx(kn,{open:!!x,onOpenChange:O=>{O||(y(null),w(Al))},children:o.jsxs(wn,{children:[o.jsx(Sn,{children:o.jsx(jn,{children:"Edit provider"})}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx(Se,{children:"Name"}),o.jsx(De,{value:b.name,onChange:O=>w({...b,name:O.target.value})})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Slug (optional)"}),o.jsx(De,{value:b.slug,onChange:O=>w({...b,slug:O.target.value})})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Type"}),o.jsxs(Ra,{value:b.type,onValueChange:O=>w({...b,type:O}),children:[o.jsx(da,{children:o.jsx(Na,{})}),o.jsxs(fa,{children:[o.jsx(wt,{value:"openai",children:"OpenAI-compatible"}),o.jsx(wt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Base URL"}),o.jsx(De,{value:b.baseUrl,onChange:O=>w({...b,baseUrl:O.target.value})})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"API key (leave empty to keep current)"}),o.jsx(De,{type:"password",value:b.apiKey,onChange:O=>w({...b,apiKey:O.target.value})})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Custom headers (JSON)"}),o.jsx(De,{value:b.customHeaders,onChange:O=>w({...b,customHeaders:O.target.value}),placeholder:'{"X-Org":"acme"}'})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ta,{checked:b.enabled,onCheckedChange:O=>w({...b,enabled:O})}),o.jsx(Se,{children:"Enabled"})]})]}),o.jsxs(zn,{children:[o.jsx(he,{variant:"outline",onClick:()=>{y(null),w(Al)},children:"Cancel"}),o.jsx(he,{disabled:f||!b.name,onClick:A,children:"Save changes"})]})]})}),o.jsx(dp,{open:!!E,onOpenChange:O=>{O||j(null)},children:o.jsxs(Iu,{children:[o.jsxs(fp,{children:[o.jsx(Pu,{children:"Delete provider?"}),o.jsx(qu,{children:"This permanently removes the provider, its models, and dependent routing configuration."})]}),o.jsxs(hp,{children:[o.jsx($u,{children:"Cancel"}),o.jsx(Vu,{disabled:C,onClick:O=>{E&&(O.preventDefault(),U(E))},children:C?"Deleting…":"Delete"})]})]})})]})}var y_=Object.defineProperty,jr=(n,a)=>y_(n,"name",{value:a,configurable:!0}),wp="Checkbox",[b_,t5]=Hn(wp),[w_,Sp]=b_(wp);function nS(n){const{__scopeCheckbox:a,checked:l,children:s,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=br({prop:l,defaultProp:c??!1,onChange:g,caller:wp}),[E,j]=m.useState(null),[C,R]=m.useState(null),M=m.useRef(!1),[T,D]=m.useReducer(U=>U+1,0),_=E?!!f||!!E.closest("form"):!0,A={checked:b,disabled:u,setChecked:w,control:E,setControl:j,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:M,userInteractionCount:T,onUserInteraction:D,required:v,defaultChecked:xr(c)?!1:c,isFormControl:_,bubbleInput:C,setBubbleInput:R};return o.jsx(w_,{scope:a,...A,children:rS(y)?y(A):s})}jr(nS,"CheckboxProvider");var S_="CheckboxTrigger",j_=m.forwardRef(jr(function({__scopeCheckbox:a,onKeyDown:l,onClick:s,...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}=Sp(S_,a),R=Ke(u,y),M=m.useRef(v);return m.useEffect(()=>{const T=f==null?void 0:f.form;if(T){const D=jr(()=>b(M.current),"reset");return T.addEventListener("reset",D),()=>T.removeEventListener("reset",D)}},[f,b]),o.jsx(Pe.button,{type:"button",role:"checkbox","aria-checked":xr(v)?"mixed":v,"aria-required":x,"data-state":jp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...c,ref:R,onKeyDown:Te(l,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:Te(s,T=>{E(),b(D=>xr(D)?!0:!D),C&&j&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"CheckboxTrigger")),aS=m.forwardRef(jr(function(a,l){const{__scopeCheckbox:s,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return o.jsx(nS,{__scopeCheckbox:s,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>o.jsxs(o.Fragment,{children:[o.jsx(j_,{...b,ref:l,__scopeCheckbox:s}),w&&o.jsx(N_,{__scopeCheckbox:s})]})})},"Checkbox")),C_="CheckboxIndicator",E_=m.forwardRef(jr(function(a,l){const{__scopeCheckbox:s,forceMount:c,...u}=a,f=Sp(C_,s);return o.jsx(Er,{present:c||xr(f.checked)||f.checked===!0,children:o.jsx(Pe.span,{"data-state":jp(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:l,style:{pointerEvents:"none",...a.style}})})},"CheckboxIndicator")),R_="CheckboxBubbleInput",N_=m.forwardRef(jr(function({__scopeCheckbox:a,onClick:l,...s},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}=Sp(R_,a),R=Ke(c,C),M=Ou(u),T=m.useRef(!1),D=m.useRef(g),_=m.useRef(p);m.useEffect(()=>{const U=j;if(!U)return;const O=window.HTMLInputElement.prototype,K=Object.getOwnPropertyDescriptor(O,"checked").set,te=p!==_.current;_.current=p;const G=D.current!==g;D.current=g;const ie=!(te&&f.current);if(G&&K){T.current=!te;const ce=new Event("click",{bubbles:ie});U.indeterminate=xr(g),K.call(U,xr(g)?!1:g),U.dispatchEvent(ce),T.current=!1}},[j,g,f,p]);const A=m.useRef(xr(g)?!1:g);return o.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??A.current,required:x,disabled:y,name:b,value:w,form:E,...s,tabIndex:-1,ref:R,onClick:Te(l,U=>{T.current&&U.stopPropagation()}),style:{...s.style,...M,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function rS(n){return typeof n=="function"}jr(rS,"isFunction");function xr(n){return n==="indeterminate"}jr(xr,"isIndeterminate");function jp(n){return xr(n)?"indeterminate":n?"checked":"unchecked"}jr(jp,"getState");const Cp=m.forwardRef(({className:n,...a},l)=>o.jsx(aS,{ref:l,className:Ee("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:o.jsx(E_,{className:Ee("flex items-center justify-center text-current"),children:o.jsx(E0,{className:"h-3.5 w-3.5"})})}));Cp.displayName=aS.displayName;const um=["image_input","audio_input","tools","structured_output","reasoning","chat","streaming"],T_=["unknown","yes","no"];function M_(n,a){return n[a]===!0?"yes":n[a]===!1?"no":"unknown"}function A_(n){const a={};for(const l of um)a[l]=n[l]==="yes"?!0:n[l]==="no"?!1:null;return a}function D_(){const[n,a]=m.useState([]),[l,s]=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(""),[D,_]=m.useState(null),[A,U]=m.useState(!1),[O,q]=m.useState(null),[K,te]=m.useState(null),[G,ie]=m.useState(null),[ce,le]=m.useState({}),[k,H]=m.useState(!1),Q=V=>{const oe={};for(const de of um)oe[de]=M_(V.capabilities,de);le(oe),ie(V)},J=async()=>{if(G){H(!0);try{await Ce.patch("/api/admin/models",{id:G.id,capabilities:A_(ce)}),ge.success("Capabilities updated"),ie(null),ee()}catch(V){ge.error(V.message)}finally{H(!1)}}},ee=async()=>{const[V,oe]=await Promise.all([Ce.get("/api/admin/models"),Ce.get("/api/admin/providers")]);a(V.models),s(oe.providers)};m.useEffect(()=>{ee()},[]);const z=n.filter(V=>!(c!=="all"&&V.providerId!==c||C&&!V.publicModelId.toLowerCase().includes(C.toLowerCase()))),I=x.filter(V=>{if(!M)return!0;const oe=M.toLowerCase();return V.upstreamId.toLowerCase().includes(oe)||V.displayName.toLowerCase().includes(oe)}),X=async()=>{if(g){j(!0);try{const V=await Ce.post(`/api/admin/providers/${g}/discover`);y(V.models),w(new Set)}catch(V){ge.error(V.message)}finally{j(!1)}}},re=async()=>{if(b.size!==0)try{const V=await Ce.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(b)});ge.success(`Imported ${V.imported} of ${V.requested}`),p(!1),y([]),w(new Set),ee()}catch(V){ge.error(V.message)}},fe=async()=>{if(K)try{await Ce.del(`/api/admin/models/${K.id}`),ge.success("Model deleted"),te(null),ee()}catch(V){ge.error(V.message)}},ve=async V=>{var de,me,xe;_(V),U(!0);const oe=Date.now();q({phase:"streaming",startedAt:oe,text:"",progress:{}});try{const we=await _m(`/api/admin/models/${V}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!we.ok){const ot=await we.text().catch(()=>"");q({phase:"error",model:V,error:`HTTP ${we.status}: ${ot}`});return}const Me=(de=we.body)==null?void 0:de.getReader();if(!Me){q({phase:"error",model:V,error:"No response body"});return}const Ye=new TextDecoder;let Qe="",st="",Kt=!1;for(;!Kt;){const{value:ot,done:Lt}=await Me.read();Kt=Lt,ot&&(Qe+=Ye.decode(ot,{stream:!0}));let Ot;for(;(Ot=Qe.indexOf(`
342
+
343
+ `))>=0;){const It=Qe.slice(0,Ot);Qe=Qe.slice(Ot+2);const en=It.split(`
344
+ `);let Pt="",xt="";for(const on of en)on.startsWith("event: ")?Pt=on.slice(7):on.startsWith("data: ")&&(xt=on.slice(6));if(xt){if(Pt===""||Pt==="message")try{const St=(me=JSON.parse(xt).choices)==null?void 0:me[0];(xe=St==null?void 0:St.delta)!=null&&xe.content&&(st+=St.delta.content),q(jt=>{if(!jt||jt.phase!=="streaming")return jt;const tn=Date.now()-oe,se=jt.progress.ttftMs??tn;return{...jt,text:st,progress:{ttftMs:se,elapsedMs:tn}}})}catch{}if(Pt==="test_meta")try{const on=JSON.parse(xt);q({phase:"done",model:V,result:on,text:st})}catch{}if(Pt==="test_error")try{const on=JSON.parse(xt);q({phase:"error",model:V,error:on.message})}catch{}}}}q(ot=>!ot||ot.phase==="streaming"?{phase:"error",model:V,error:"Stream ended unexpectedly"}:ot)}catch(we){q({phase:"error",model:V,error:we.message})}finally{_(null)}};return o.jsxs("div",{children:[o.jsx(Ya,{title:"Models",description:"Physical models imported from providers",actions:o.jsxs(kn,{open:f,onOpenChange:p,children:[o.jsx(mi,{asChild:!0,children:o.jsxs(he,{variant:"outline",children:[o.jsx(R0,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),o.jsxs(wn,{className:"max-w-2xl",children:[o.jsx(Sn,{children:o.jsx(jn,{children:"Discover models"})}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsx("div",{className:"flex-1",children:o.jsxs(Ra,{value:g,onValueChange:v,children:[o.jsx(da,{children:o.jsx(Na,{placeholder:"Choose provider"})}),o.jsx(fa,{children:l.map(V=>o.jsx(wt,{value:V.id,children:V.name},V.id))})]})}),o.jsx(he,{onClick:X,disabled:!g||E,children:E?"Fetching…":"Fetch"})]}),x.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("div",{className:"flex items-center gap-2 flex-1",children:o.jsxs("div",{className:"relative flex-1",children:[o.jsx(O0,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(De,{className:"pl-8",placeholder:"Search models…",value:M,onChange:V=>T(V.target.value)}),M&&o.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>T(""),children:o.jsx(ju,{className:"h-4 w-4"})})]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"text-sm text-muted-foreground",children:[I.length," / ",x.length," · ",b.size," selected"]}),o.jsx(he,{variant:"outline",size:"sm",onClick:()=>w(new Set(I.filter(V=>!V.alreadyImported).map(V=>V.upstreamId))),children:"Select All (new)"}),o.jsx(he,{variant:"outline",size:"sm",onClick:()=>w(new Set),children:"Clear"})]})]}),o.jsx("div",{className:"max-h-80 space-y-1 overflow-auto rounded border p-2",children:I.length===0&&x.length>0?o.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):I.map(V=>o.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[o.jsx(Cp,{checked:b.has(V.upstreamId),onCheckedChange:oe=>{const de=new Set(b);oe?de.add(V.upstreamId):de.delete(V.upstreamId),w(de)}}),o.jsx("span",{className:"font-mono text-xs",children:V.upstreamId}),V.alreadyImported&&o.jsx(Xe,{variant:"secondary",children:"imported"})]},V.upstreamId))})]})]}),o.jsxs(zn,{children:[o.jsx(he,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),o.jsxs(he,{disabled:b.size===0,onClick:re,children:["Import ",b.size||""]})]})]})]})}),o.jsxs(tt,{children:[o.jsxs(nt,{children:[o.jsx(at,{className:"text-base",children:"All models"}),o.jsxs(bn,{children:[n.length," total"]})]}),o.jsxs(rt,{children:[o.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[o.jsxs(Ra,{value:c,onValueChange:u,children:[o.jsx(da,{className:"w-56",children:o.jsx(Na,{})}),o.jsxs(fa,{children:[o.jsx(wt,{value:"all",children:"All providers"}),l.map(V=>o.jsx(wt,{value:V.id,children:V.name},V.id))]})]}),o.jsx(De,{className:"max-w-xs",placeholder:"Search public ID",value:C,onChange:V=>R(V.target.value)})]}),o.jsxs(pa,{children:[o.jsx(ga,{children:o.jsxs(We,{children:[o.jsx(be,{children:"Public ID"}),o.jsx(be,{children:"Provider"}),o.jsx(be,{children:"Upstream ID"}),o.jsx(be,{children:"Capabilities"}),o.jsx(be,{children:"Available"}),o.jsx(be,{children:"Enabled"}),o.jsx(be,{})]})}),o.jsxs(va,{children:[z.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),z.map(V=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-mono text-xs",children:V.publicModelId}),o.jsx(pe,{children:V.providerSlug}),o.jsx(pe,{className:"text-xs text-muted-foreground",children:V.upstreamModelId}),o.jsx(pe,{className:"space-x-1",children:Object.entries(V.capabilities).filter(([,oe])=>oe===!0).slice(0,4).map(([oe])=>o.jsx(Xe,{variant:"outline",className:"mr-1",children:oe},oe))}),o.jsx(pe,{children:V.upstreamAvailable?o.jsx(Xe,{variant:"success",children:"up"}):o.jsx(Xe,{variant:"destructive",children:"down"})}),o.jsx(pe,{children:V.enabled?"Yes":"No"}),o.jsx(pe,{className:"text-right",children:o.jsxs("div",{className:"flex items-center justify-end gap-1",children:[o.jsxs(he,{size:"sm",variant:"outline",onClick:()=>Q(V),disabled:D!==null,children:[o.jsx(bR,{className:"h-3.5 w-3.5"})," Capabilities"]}),o.jsxs(he,{size:"sm",variant:"outline",onClick:()=>void ve(V.id),disabled:D!==null,children:[D===V.id?o.jsx(_s,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(dR,{className:"h-3.5 w-3.5"})," Test"]}),o.jsxs(he,{size:"sm",variant:"destructive",onClick:()=>te(V),disabled:D!==null,children:[o.jsx(Su,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},V.id))]})]})]})]}),o.jsx(kn,{open:!!K,onOpenChange:V=>{V||te(null)},children:o.jsxs(wn,{className:"max-w-md",children:[o.jsx(Sn,{children:o.jsx(jn,{children:"Xoá model"})}),o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsxs("p",{children:["Bạn có chắc muốn xoá model ",o.jsx("span",{className:"font-mono",children:K==null?void 0:K.publicModelId}),"?"]}),o.jsx("p",{className:"text-muted-foreground",children:"Model sẽ bị xoá khỏi combo, alias, permission và cache trước khi xoá hẳn."})]}),o.jsxs(zn,{children:[o.jsx(he,{variant:"outline",onClick:()=>te(null),children:"Huỷ"}),o.jsx(he,{variant:"destructive",onClick:fe,children:"Xoá"})]})]})}),o.jsx(kn,{open:G!==null,onOpenChange:V=>{V||ie(null)},children:o.jsxs(wn,{className:"max-w-lg",children:[o.jsx(Sn,{children:o.jsxs(jn,{children:["Capabilities — ",G==null?void 0:G.publicModelId]})}),o.jsxs("div",{className:"space-y-1",children:[o.jsxs("p",{className:"text-xs text-muted-foreground",children:[o.jsx("strong",{children:"Unknown"})," means the router has no verified answer and will attempt the request."," ",o.jsx("strong",{children:"No"})," blocks requests needing that capability (HTTP 400/502 before any upstream call)."]}),um.map(V=>{var de;const oe=(de=G==null?void 0:G.discoveredCapabilities)==null?void 0:de[V];return o.jsxs("div",{className:"flex items-center justify-between gap-3 rounded px-1 py-1 text-sm hover:bg-accent",children:[o.jsxs("span",{className:"flex items-baseline gap-2",children:[o.jsx("code",{className:"text-xs",children:V}),o.jsx("span",{className:"text-xs text-muted-foreground",children:oe===void 0?"discovered: unknown":`discovered: ${String(oe)}`})]}),o.jsx("div",{className:"flex gap-1",children:T_.map(me=>o.jsx(he,{size:"sm",variant:ce[V]===me?"default":"outline",onClick:()=>le(xe=>({...xe,[V]:me})),children:me==="unknown"?"Unknown":me==="yes"?"Yes":"No"},me))})]},V)})]}),o.jsxs(zn,{children:[o.jsx(he,{variant:"outline",onClick:()=>ie(null),children:"Huỷ"}),o.jsx(he,{onClick:J,disabled:k,children:k?"Saving…":"Lưu"})]})]})}),o.jsx(kn,{open:A,onOpenChange:U,children:o.jsxs(wn,{className:"max-w-2xl",children:[o.jsx(Sn,{children:o.jsx(jn,{children:"Kết quả test model"})}),O&&O.phase==="streaming"&&o.jsxs("div",{className:"space-y-3 text-sm",children:[o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(_s,{className:"h-4 w-4 animate-spin"})," Đang stream…",o.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["TTFT ",O.progress.ttftMs!=null?`${O.progress.ttftMs} ms`:"…"]}),o.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["· ",O.progress.elapsedMs!=null?`${O.progress.elapsedMs} ms`:"…"]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi (streaming)"}),o.jsxs("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:[O.text||o.jsx("span",{className:"text-muted-foreground/60 animate-pulse",children:"waiting for first token…"}),O.phase==="streaming"&&o.jsx("span",{className:"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-primary/70"})]})]})]}),O&&O.phase==="done"&&o.jsxs("div",{className:"space-y-3 text-sm",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx(Xe,{variant:O.result.success?"success":"destructive",children:O.result.success?"Thành công":"Thất bại"}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Thời gian phản hồi"}),o.jsxs("div",{className:"font-mono",children:[O.result.latencyMs," ms"]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"TTFT"}),o.jsx("div",{className:"font-mono",children:O.result.ttftMs!=null?`${O.result.ttftMs} ms`:"—"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Tokens (in / out)"}),o.jsxs("div",{className:"font-mono",children:[O.result.usage.input," / ",O.result.usage.output]})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi của model"}),o.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&&o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Attempts"}),o.jsx("div",{className:"space-y-1",children:O.result.attempts.map((V,oe)=>o.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[o.jsx(Xe,{variant:V.success?"success":"destructive",children:V.success?"OK":"FAIL"}),o.jsxs("span",{className:"font-mono",children:[V.providerName," / ",V.modelId]}),o.jsxs("span",{className:"text-muted-foreground",children:[V.latencyMs," ms"]}),V.failureReason&&o.jsx("span",{className:"text-destructive",children:V.failureReason})]},oe))})]})]}),O&&O.phase==="error"&&o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsx(Xe,{variant:"destructive",children:"Thất bại"}),o.jsx("p",{className:"text-destructive",children:O.error})]}),o.jsx(zn,{children:o.jsx(he,{variant:"outline",onClick:()=>U(!1),children:"Đóng"})})]})})]})}function O_(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return m.useMemo(()=>s=>{a.forEach(c=>c(s))},a)}const Fu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ks(n){const a=Object.prototype.toString.call(n);return a==="[object Window]"||a==="[object global]"}function Ep(n){return"nodeType"in n}function In(n){var a,l;return n?Ks(n)?n:Ep(n)&&(a=(l=n.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function Rp(n){const{Document:a}=In(n);return n instanceof a}function gi(n){return Ks(n)?!1:n instanceof In(n).HTMLElement}function lS(n){return n instanceof In(n).SVGElement}function Xs(n){return n?Ks(n)?n.document:Ep(n)?Rp(n)?n:gi(n)||lS(n)?n.ownerDocument:document:document:document}const Va=Fu?m.useLayoutEffect:m.useEffect;function Np(n){const a=m.useRef(n);return Va(()=>{a.current=n}),m.useCallback(function(){for(var l=arguments.length,s=new Array(l),c=0;c<l;c++)s[c]=arguments[c];return a.current==null?void 0:a.current(...s)},[])}function __(){const n=m.useRef(null),a=m.useCallback((s,c)=>{n.current=setInterval(s,c)},[]),l=m.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[a,l]}function ti(n,a){a===void 0&&(a=[n]);const l=m.useRef(n);return Va(()=>{l.current!==n&&(l.current=n)},a),l}function vi(n,a){const l=m.useRef();return m.useMemo(()=>{const s=n(l.current);return l.current=s,s},[...a])}function uu(n){const a=Np(n),l=m.useRef(null),s=m.useCallback(c=>{c!==l.current&&(a==null||a(c,l.current)),l.current=c},[]);return[l,s]}function dm(n){const a=m.useRef();return m.useEffect(()=>{a.current=n},[n]),a.current}let _h={};function xi(n,a){return m.useMemo(()=>{if(a)return a;const l=_h[n]==null?0:_h[n]+1;return _h[n]=l,n+"-"+l},[n,a])}function sS(n){return function(a){for(var l=arguments.length,s=new Array(l>1?l-1:0),c=1;c<l;c++)s[c-1]=arguments[c];return s.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 Us=sS(1),ni=sS(-1);function k_(n){return"clientX"in n&&"clientY"in n}function Tp(n){if(!n)return!1;const{KeyboardEvent:a}=In(n.target);return a&&n instanceof a}function z_(n){if(!n)return!1;const{TouchEvent:a}=In(n.target);return a&&n instanceof a}function fm(n){if(z_(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 k_(n)?{x:n.clientX,y:n.clientY}:null}const du=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[du.Translate.toString(n),du.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:a,duration:l,easing:s}=n;return a+" "+l+"ms "+s}}}),Mb="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function L_(n){return n.matches(Mb)?n:n.querySelector(Mb)}const U_={display:"none"};function B_(n){let{id:a,value:l}=n;return ue.createElement("div",{id:a,style:U_},l)}function H_(n){let{id:a,announcement:l,ariaLiveType:s="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":s,"aria-atomic":!0},l)}function I_(){const[n,a]=m.useState("");return{announce:m.useCallback(s=>{s!=null&&a(s)},[]),announcement:n}}const oS=m.createContext(null);function P_(n){const a=m.useContext(oS);m.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(n)},[n,a])}function q_(){const[n]=m.useState(()=>new Set),a=m.useCallback(s=>(n.add(s),()=>n.delete(s)),[n]);return[m.useCallback(s=>{let{type:c,event:u}=s;n.forEach(f=>{var p;return(p=f[c])==null?void 0:p.call(f,u)})},[n]),a]}const V_={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
+ `},$_={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 Y_(n){let{announcements:a=$_,container:l,hiddenTextDescribedById:s,screenReaderInstructions:c=V_}=n;const{announce:u,announcement:f}=I_(),p=xi("DndLiveRegion"),[g,v]=m.useState(!1);if(m.useEffect(()=>{v(!0)},[]),P_(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(B_,{id:s,value:c.draggable}),ue.createElement(H_,{id:p,announcement:f}));return l?Ca.createPortal(x,l):x}var Zt;(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"})(Zt||(Zt={}));function fu(){}function Ab(n,a){return m.useMemo(()=>({sensor:n,options:a??{}}),[n,a])}function G_(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return m.useMemo(()=>[...a].filter(s=>s!=null),[...a])}const Ma=Object.freeze({x:0,y:0});function iS(n,a){return Math.sqrt(Math.pow(n.x-a.x,2)+Math.pow(n.y-a.y,2))}function cS(n,a){let{data:{value:l}}=n,{data:{value:s}}=a;return l-s}function F_(n,a){let{data:{value:l}}=n,{data:{value:s}}=a;return s-l}function Db(n){let{left:a,top:l,height:s,width:c}=n;return[{x:a,y:l},{x:a+c,y:l},{x:a,y:l+s},{x:a+c,y:l+s}]}function uS(n,a){if(!n||n.length===0)return null;const[l]=n;return l[a]}function Ob(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 K_=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:s}=n;const c=Ob(a,a.left,a.top),u=[];for(const f of s){const{id:p}=f,g=l.get(p);if(g){const v=iS(Ob(g),c);u.push({id:p,data:{droppableContainer:f,value:v}})}}return u.sort(cS)},X_=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:s}=n;const c=Db(a),u=[];for(const f of s){const{id:p}=f,g=l.get(p);if(g){const v=Db(g),x=c.reduce((b,w,E)=>b+iS(v[E],w),0),y=Number((x/4).toFixed(4));u.push({id:p,data:{droppableContainer:f,value:y}})}}return u.sort(cS)};function Q_(n,a){const l=Math.max(a.top,n.top),s=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-s,p=u-l;if(s<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 Z_=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:s}=n;const c=[];for(const u of s){const{id:f}=u,p=l.get(f);if(p){const g=Q_(p,a);g>0&&c.push({id:f,data:{droppableContainer:u,value:g}})}}return c.sort(F_)};function J_(n,a,l){return{...n,scaleX:a&&l?a.width/l.width:1,scaleY:a&&l?a.height/l.height:1}}function dS(n,a){return n&&a?{x:n.left-a.left,y:n.top-a.top}:Ma}function W_(n){return function(l){for(var s=arguments.length,c=new Array(s>1?s-1:0),u=1;u<s;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 ek=W_(1);function tk(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 nk(n,a,l){const s=tk(a);if(!s)return n;const{scaleX:c,scaleY:u,x:f,y:p}=s,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 ak={ignoreTransform:!1};function Qs(n,a){a===void 0&&(a=ak);let l=n.getBoundingClientRect();if(a.ignoreTransform){const{transform:v,transformOrigin:x}=In(n).getComputedStyle(n);v&&(l=nk(l,v,x))}const{top:s,left:c,width:u,height:f,bottom:p,right:g}=l;return{top:s,left:c,width:u,height:f,bottom:p,right:g}}function _b(n){return Qs(n,{ignoreTransform:!0})}function rk(n){const a=n.innerWidth,l=n.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function lk(n,a){return a===void 0&&(a=In(n).getComputedStyle(n)),a.position==="fixed"}function sk(n,a){a===void 0&&(a=In(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 Ku(n,a){const l=[];function s(c){if(a!=null&&l.length>=a||!c)return l;if(Rp(c)&&c.scrollingElement!=null&&!l.includes(c.scrollingElement))return l.push(c.scrollingElement),l;if(!gi(c)||lS(c)||l.includes(c))return l;const u=In(n).getComputedStyle(c);return c!==n&&sk(c,u)&&l.push(c),lk(c,u)?l:s(c.parentNode)}return n?s(n):l}function fS(n){const[a]=Ku(n,1);return a??null}function kh(n){return!Fu||!n?null:Ks(n)?n:Ep(n)?Rp(n)||n===Xs(n).scrollingElement?window:gi(n)?n:null:null}function hS(n){return Ks(n)?n.scrollX:n.scrollLeft}function mS(n){return Ks(n)?n.scrollY:n.scrollTop}function hm(n){return{x:hS(n),y:mS(n)}}var rn;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(rn||(rn={}));function pS(n){return!Fu||!n?!1:n===document.scrollingElement}function gS(n){const a={x:0,y:0},l=pS(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},s={x:n.scrollWidth-l.width,y:n.scrollHeight-l.height},c=n.scrollTop<=a.y,u=n.scrollLeft<=a.x,f=n.scrollTop>=s.y,p=n.scrollLeft>=s.x;return{isTop:c,isLeft:u,isBottom:f,isRight:p,maxScroll:s,minScroll:a}}const ok={x:.2,y:.2};function ik(n,a,l,s,c){let{top:u,left:f,right:p,bottom:g}=l;s===void 0&&(s=10),c===void 0&&(c=ok);const{isTop:v,isBottom:x,isLeft:y,isRight:b}=gS(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=rn.Backward,E.y=s*Math.abs((a.top+j.height-u)/j.height)):!x&&g>=a.bottom-j.height&&(w.y=rn.Forward,E.y=s*Math.abs((a.bottom-j.height-g)/j.height)),!b&&p>=a.right-j.width?(w.x=rn.Forward,E.x=s*Math.abs((a.right-j.width-p)/j.width)):!y&&f<=a.left+j.width&&(w.x=rn.Backward,E.x=s*Math.abs((a.left+j.width-f)/j.width)),{direction:w,speed:E}}function ck(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:s,bottom:c}=n.getBoundingClientRect();return{top:a,left:l,right:s,bottom:c,width:n.clientWidth,height:n.clientHeight}}function vS(n){return n.reduce((a,l)=>Us(a,hm(l)),Ma)}function uk(n){return n.reduce((a,l)=>a+hS(l),0)}function dk(n){return n.reduce((a,l)=>a+mS(l),0)}function fk(n,a){if(a===void 0&&(a=Qs),!n)return;const{top:l,left:s,bottom:c,right:u}=a(n);fS(n)&&(c<=0||u<=0||l>=window.innerHeight||s>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const hk=[["x",["left","right"],uk],["y",["top","bottom"],dk]];class Mp{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 s=Ku(l),c=vS(s);this.rect={...a},this.width=a.width,this.height=a.height;for(const[u,f,p]of hk)for(const g of f)Object.defineProperty(this,g,{get:()=>{const v=p(s),x=c[u]-v;return this.rect[g]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ko{constructor(a){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(l=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...l)})},this.target=a}add(a,l,s){var c;(c=this.target)==null||c.addEventListener(a,l,s),this.listeners.push([a,l,s])}}function mk(n){const{EventTarget:a}=In(n);return n instanceof a?n:Xs(n)}function zh(n,a){const l=Math.abs(n.x),s=Math.abs(n.y);return typeof a=="number"?Math.sqrt(l**2+s**2)>a:"x"in a&&"y"in a?l>a.x&&s>a.y:"x"in a?l>a.x:"y"in a?s>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 kb(n){n.preventDefault()}function pk(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 xS={start:[Fe.Space,Fe.Enter],cancel:[Fe.Esc],end:[Fe.Space,Fe.Enter,Fe.Tab]},gk=(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 Ap{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 Ko(Xs(l)),this.windowListeners=new Ko(In(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,s=a.node.current;s&&fk(s),l(Ma)}handleKeyDown(a){if(Tp(a)){const{active:l,context:s,options:c}=this.props,{keyboardCodes:u=xS,coordinateGetter:f=gk,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}=s.current,x=v?{x:v.left,y:v.top}:Ma;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:l,context:s.current,currentCoordinates:x});if(y){const b=ni(y,x),w={x:0,y:0},{scrollableAncestors:E}=s.current;for(const j of E){const C=a.code,{isTop:R,isRight:M,isLeft:T,isBottom:D,maxScroll:_,minScroll:A}=gS(j),U=ck(j),O={x:Math.min(C===Fe.Right?U.right-U.width/2:U.right,Math.max(C===Fe.Right?U.left:U.left+U.width/2,y.x)),y:Math.min(C===Fe.Down?U.bottom-U.height/2:U.bottom,Math.max(C===Fe.Down?U.top:U.top+U.height/2,y.y))},q=C===Fe.Right&&!M||C===Fe.Left&&!T,K=C===Fe.Down&&!D||C===Fe.Up&&!R;if(q&&O.x!==y.x){const te=j.scrollLeft+b.x,G=C===Fe.Right&&te<=_.x||C===Fe.Left&&te>=A.x;if(G&&!b.y){j.scrollTo({left:te,behavior:p});return}G?w.x=j.scrollLeft-te:w.x=C===Fe.Right?j.scrollLeft-_.x:j.scrollLeft-A.x,w.x&&j.scrollBy({left:-w.x,behavior:p});break}else if(K&&O.y!==y.y){const te=j.scrollTop+b.y,G=C===Fe.Down&&te<=_.y||C===Fe.Up&&te>=A.y;if(G&&!b.x){j.scrollTo({top:te,behavior:p});return}G?w.y=j.scrollTop-te:w.y=C===Fe.Down?j.scrollTop-_.y:j.scrollTop-A.y,w.y&&j.scrollBy({top:-w.y,behavior:p});break}}this.handleMove(a,Us(ni(y,this.referenceCoordinates),w))}}}handleMove(a,l){const{onMove:s}=this.props;a.preventDefault(),s(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()}}Ap.activators=[{eventName:"onKeyDown",handler:(n,a,l)=>{let{keyboardCodes:s=xS,onActivation:c}=a,{active:u}=l;const{code:f}=n.nativeEvent;if(s.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 zb(n){return!!(n&&"distance"in n)}function Lb(n){return!!(n&&"delay"in n)}class Dp{constructor(a,l,s){var c;s===void 0&&(s=mk(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=Xs(f),this.documentListeners=new Ko(this.document),this.listeners=new Ko(s),this.windowListeners=new Ko(In(f)),this.initialCoordinates=(c=fm(u))!=null?c:Ma,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:s}}}=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,kb),this.windowListeners.add(ca.VisibilityChange,this.handleCancel),this.windowListeners.add(ca.ContextMenu,kb),this.documentListeners.add(ca.Keydown,this.handleKeydown),l){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Lb(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(zb(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:s,onPending:c}=this.props;c(s,a,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:a}=this,{onStart:l}=this.props;a&&(this.activated=!0,this.documentListeners.add(ca.Click,pk,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ca.SelectionChange,this.removeTextSelection),l(a))}handleMove(a){var l;const{activated:s,initialCoordinates:c,props:u}=this,{onMove:f,options:{activationConstraint:p}}=u;if(!c)return;const g=(l=fm(a))!=null?l:Ma,v=ni(c,g);if(!s&&p){if(zb(p)){if(p.tolerance!=null&&zh(v,p.tolerance))return this.handleCancel();if(zh(v,p.distance))return this.handleStart()}if(Lb(p)&&zh(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 vk={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Op extends Dp{constructor(a){const{event:l}=a,s=Xs(l.target);super(a,vk,s)}}Op.activators=[{eventName:"onPointerDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:s}=a;return!l.isPrimary||l.button!==0?!1:(s==null||s({event:l}),!0)}}];const xk={move:{name:"mousemove"},end:{name:"mouseup"}};var mm;(function(n){n[n.RightClick=2]="RightClick"})(mm||(mm={}));class yk extends Dp{constructor(a){super(a,xk,Xs(a.event.target))}}yk.activators=[{eventName:"onMouseDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:s}=a;return l.button===mm.RightClick?!1:(s==null||s({event:l}),!0)}}];const Lh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class bk extends Dp{constructor(a){super(a,Lh)}static setup(){return window.addEventListener(Lh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Lh.move.name,a)};function a(){}}}bk.activators=[{eventName:"onTouchStart",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:s}=a;const{touches:c}=l;return c.length>1?!1:(s==null||s({event:l}),!0)}}];var Xo;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Xo||(Xo={}));var hu;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(hu||(hu={}));function wk(n){let{acceleration:a,activator:l=Xo.Pointer,canScroll:s,draggingRect:c,enabled:u,interval:f=5,order:p=hu.TreeOrder,pointerCoordinates:g,scrollableAncestors:v,scrollableAncestorRects:x,delta:y,threshold:b}=n;const w=jk({delta:y,disabled:!u}),[E,j]=__(),C=m.useRef({x:0,y:0}),R=m.useRef({x:0,y:0}),M=m.useMemo(()=>{switch(l){case Xo.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case Xo.DraggableRect:return c}},[l,c,g]),T=m.useRef(null),D=m.useCallback(()=>{const A=T.current;if(!A)return;const U=C.current.x*R.current.x,O=C.current.y*R.current.y;A.scrollBy(U,O)},[]),_=m.useMemo(()=>p===hu.TreeOrder?[...v].reverse():v,[p,v]);m.useEffect(()=>{if(!u||!v.length||!M){j();return}for(const A of _){if((s==null?void 0:s(A))===!1)continue;const U=v.indexOf(A),O=x[U];if(!O)continue;const{direction:q,speed:K}=ik(A,O,M,a,b);for(const te of["x","y"])w[te][q[te]]||(K[te]=0,q[te]=0);if(K.x>0||K.y>0){j(),T.current=A,E(D,f),C.current=K,R.current=q;return}}C.current={x:0,y:0},R.current={x:0,y:0},j()},[a,D,s,j,u,f,JSON.stringify(M),JSON.stringify(w),E,v,_,x,JSON.stringify(b)])}const Sk={x:{[rn.Backward]:!1,[rn.Forward]:!1},y:{[rn.Backward]:!1,[rn.Forward]:!1}};function jk(n){let{delta:a,disabled:l}=n;const s=dm(a);return vi(c=>{if(l||!s||!c)return Sk;const u={x:Math.sign(a.x-s.x),y:Math.sign(a.y-s.y)};return{x:{[rn.Backward]:c.x[rn.Backward]||u.x===-1,[rn.Forward]:c.x[rn.Forward]||u.x===1},y:{[rn.Backward]:c.y[rn.Backward]||u.y===-1,[rn.Forward]:c.y[rn.Forward]||u.y===1}}},[l,a,s])}function Ck(n,a){const l=a!=null?n.get(a):void 0,s=l?l.node.current:null;return vi(c=>{var u;return a==null?null:(u=s??c)!=null?u:null},[s,a])}function Ek(n,a){return m.useMemo(()=>n.reduce((l,s)=>{const{sensor:c}=s,u=c.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,s)}));return[...l,...u]},[]),[n,a])}var ai;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(ai||(ai={}));var pm;(function(n){n.Optimized="optimized"})(pm||(pm={}));const Ub=new Map;function Rk(n,a){let{dragging:l,dependencies:s,config:c}=a;const[u,f]=m.useState(null),{frequency:p,measure:g,strategy:v}=c,x=m.useRef(n),y=C(),b=ti(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=vi(R=>{if(y&&!l)return Ub;if(!R||R===Ub||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 D=T.node.current,_=D?new Mp(g(D),D):null;T.rect.current=_,_&&M.set(T.id,_)}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,...s]),{droppableRects:j,measureDroppableContainers:w,measuringScheduled:u!=null};function C(){switch(v){case ai.Always:return!1;case ai.BeforeDragging:return l;default:return!l}}}function yS(n,a){return vi(l=>n?l||(typeof a=="function"?a(n):n):null,[a,n])}function Nk(n,a){return yS(n,a)}function Tk(n){let{callback:a,disabled:l}=n;const s=Np(a),c=m.useMemo(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(s)},[s,l]);return m.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function Xu(n){let{callback:a,disabled:l}=n;const s=Np(a),c=m.useMemo(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(s)},[l]);return m.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function Mk(n){return new Mp(Qs(n),n)}function Bb(n,a,l){a===void 0&&(a=Mk);const[s,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=Tk({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=Xu({callback:u});return Va(()=>{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]),s}function Ak(n){const a=yS(n);return dS(n,a)}const Hb=[];function Dk(n){const a=m.useRef(n),l=vi(s=>n?s&&s!==Hb&&n&&a.current&&n.parentNode===a.current.parentNode?s:Ku(n):Hb,[n]);return m.useEffect(()=>{a.current=n},[n]),l}function Ok(n){const[a,l]=m.useState(null),s=m.useRef(n),c=m.useCallback(u=>{const f=kh(u.target);f&&l(p=>p?(p.set(f,hm(f)),new Map(p)):null)},[]);return m.useEffect(()=>{const u=s.current;if(n!==u){f(u);const p=n.map(g=>{const v=kh(g);return v?(v.addEventListener("scroll",c,{passive:!0}),[v,hm(v)]):null}).filter(g=>g!=null);l(p.length?new Map(p):null),s.current=n}return()=>{f(n),f(u)};function f(p){p.forEach(g=>{const v=kh(g);v==null||v.removeEventListener("scroll",c)})}},[c,n]),m.useMemo(()=>n.length?a?Array.from(a.values()).reduce((u,f)=>Us(u,f),Ma):vS(n):Ma,[n,a])}function Ib(n,a){a===void 0&&(a=[]);const l=m.useRef(null);return m.useEffect(()=>{l.current=null},a),m.useEffect(()=>{const s=n!==Ma;s&&!l.current&&(l.current=n),!s&&l.current&&(l.current=null)},[n]),l.current?ni(n,l.current):Ma}function _k(n){m.useEffect(()=>{if(!Fu)return;const a=n.map(l=>{let{sensor:s}=l;return s.setup==null?void 0:s.setup()});return()=>{for(const l of a)l==null||l()}},n.map(a=>{let{sensor:l}=a;return l}))}function kk(n,a){return m.useMemo(()=>n.reduce((l,s)=>{let{eventName:c,handler:u}=s;return l[c]=f=>{u(f,a)},l},{}),[n,a])}function bS(n){return m.useMemo(()=>n?rk(n):null,[n])}const Pb=[];function zk(n,a){a===void 0&&(a=Qs);const[l]=n,s=bS(l?In(l):null),[c,u]=m.useState(Pb);function f(){u(()=>n.length?n.map(g=>pS(g)?s:new Mp(a(g),g)):Pb)}const p=Xu({callback:f});return Va(()=>{p==null||p.disconnect(),f(),n.forEach(g=>p==null?void 0:p.observe(g))},[n]),c}function Lk(n){if(!n)return null;if(n.children.length>1)return n;const a=n.children[0];return gi(a)?a:n}function Uk(n){let{measure:a}=n;const[l,s]=m.useState(null),c=m.useCallback(v=>{for(const{target:x}of v)if(gi(x)){s(y=>{const b=a(x);return y?{...y,width:b.width,height:b.height}:b});break}},[a]),u=Xu({callback:c}),f=m.useCallback(v=>{const x=Lk(v);u==null||u.disconnect(),x&&(u==null||u.observe(x)),s(x?a(x):null)},[a,u]),[p,g]=uu(f);return m.useMemo(()=>({nodeRef:p,rect:l,setRef:g}),[l,p,g])}const Bk=[{sensor:Op,options:{}},{sensor:Ap,options:{}}],Hk={current:{}},eu={draggable:{measure:_b},droppable:{measure:_b,strategy:ai.WhileDragging,frequency:pm.Optimized},dragOverlay:{measure:Qs}};class Qo 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,s;return(l=(s=this.get(a))==null?void 0:s.node.current)!=null?l:void 0}}const Ik={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Qo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eu,measureDroppableContainers:fu,windowRect:null,measuringScheduled:!1},Pk={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fu,draggableNodes:new Map,over:null,measureDroppableContainers:fu},Qu=m.createContext(Pk),wS=m.createContext(Ik);function qk(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Qo}}}function Vk(n,a){switch(a.type){case Zt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case Zt.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 Zt.DragEnd:case Zt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Zt.RegisterDroppable:{const{element:l}=a,{id:s}=l,c=new Qo(n.droppable.containers);return c.set(s,l),{...n,droppable:{...n.droppable,containers:c}}}case Zt.SetDroppableDisabled:{const{id:l,key:s,disabled:c}=a,u=n.droppable.containers.get(l);if(!u||s!==u.key)return n;const f=new Qo(n.droppable.containers);return f.set(l,{...u,disabled:c}),{...n,droppable:{...n.droppable,containers:f}}}case Zt.UnregisterDroppable:{const{id:l,key:s}=a,c=n.droppable.containers.get(l);if(!c||s!==c.key)return n;const u=new Qo(n.droppable.containers);return u.delete(l),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function $k(n){let{disabled:a}=n;const{active:l,activatorEvent:s,draggableNodes:c}=m.useContext(Qu),u=dm(s),f=dm(l==null?void 0:l.id);return m.useEffect(()=>{if(!a&&!s&&u&&f!=null){if(!Tp(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=L_(x);if(y){y.focus();break}}})}},[s,a,c,f,u]),null}function Yk(n,a){let{transform:l,...s}=a;return n!=null&&n.length?n.reduce((c,u)=>u({transform:c,...s}),l):l}function Gk(n){return m.useMemo(()=>({draggable:{...eu.draggable,...n==null?void 0:n.draggable},droppable:{...eu.droppable,...n==null?void 0:n.droppable},dragOverlay:{...eu.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 Fk(n){let{activeNode:a,measure:l,initialRect:s,config:c=!0}=n;const u=m.useRef(!1),{x:f,y:p}=typeof c=="boolean"?{x:c,y:c}:c;Va(()=>{if(!f&&!p||!a){u.current=!1;return}if(u.current||!s)return;const v=a==null?void 0:a.node.current;if(!v||v.isConnected===!1)return;const x=l(v),y=dS(x,s);if(f||(y.x=0),p||(y.y=0),u.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const b=fS(v);b&&b.scrollBy({top:y.y,left:y.x})}},[a,f,p,s,l])}const SS=m.createContext({...Ma,scaleX:1,scaleY:1});var rl;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(rl||(rl={}));const Kk=m.memo(function(a){var l,s,c,u;let{id:f,accessibility:p,autoScroll:g=!0,children:v,sensors:x=Bk,collisionDetection:y=Z_,measuring:b,modifiers:w,...E}=a;const j=m.useReducer(Vk,void 0,qk),[C,R]=j,[M,T]=q_(),[D,_]=m.useState(rl.Uninitialized),A=D===rl.Initialized,{draggable:{active:U,nodes:O,translate:q},droppable:{containers:K}}=C,te=U!=null?O.get(U):null,G=m.useRef({initial:null,translated:null}),ie=m.useMemo(()=>{var Ct;return U!=null?{id:U,data:(Ct=te==null?void 0:te.data)!=null?Ct:Hk,rect:G}:null},[U,te]),ce=m.useRef(null),[le,k]=m.useState(null),[H,Q]=m.useState(null),J=ti(E,Object.values(E)),ee=xi("DndDescribedBy",f),z=m.useMemo(()=>K.getEnabled(),[K]),I=Gk(b),{droppableRects:X,measureDroppableContainers:re,measuringScheduled:fe}=Rk(z,{dragging:A,dependencies:[q.x,q.y],config:I.droppable}),ve=Ck(O,U),V=m.useMemo(()=>H?fm(H):null,[H]),oe=Tr(),de=Nk(ve,I.draggable.measure);Fk({activeNode:U!=null?O.get(U):null,config:oe.layoutShiftCompensation,initialRect:de,measure:I.draggable.measure});const me=Bb(ve,I.draggable.measure,de),xe=Bb(ve?ve.parentElement:null),we=m.useRef({activatorEvent:null,active:null,activeNode:ve,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:O,draggingNode:null,draggingNodeRect:null,droppableContainers:K,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Me=K.getNodeFor((l=we.current.over)==null?void 0:l.id),Ye=Uk({measure:I.dragOverlay.measure}),Qe=(s=Ye.nodeRef.current)!=null?s:ve,st=A?(c=Ye.rect)!=null?c:me:null,Kt=!!(Ye.nodeRef.current&&Ye.rect),ot=Ak(Kt?null:me),Lt=bS(Qe?In(Qe):null),Ot=Dk(A?Me??ve:null),It=zk(Ot),en=Yk(w,{transform:{x:q.x-ot.x,y:q.y-ot.y,scaleX:1,scaleY:1},activatorEvent:H,active:ie,activeNodeRect:me,containerNodeRect:xe,draggingNodeRect:st,over:we.current.over,overlayNodeRect:Ye.rect,scrollableAncestors:Ot,scrollableAncestorRects:It,windowRect:Lt}),Pt=V?Us(V,q):null,xt=Ok(Ot),on=Ib(xt),St=Ib(xt,[me]),jt=Us(en,on),tn=st?ek(st,en):null,se=ie&&tn?y({active:ie,collisionRect:tn,droppableRects:X,droppableContainers:z,pointerCoordinates:Pt}):null,qe=uS(se,"id"),[it,Cn]=m.useState(null),cn=Kt?en:Us(en,St),yt=J_(cn,(u=it==null?void 0:it.rect)!=null?u:null,me),vn=m.useRef(null),_t=m.useCallback((Ct,lt)=>{let{sensor:qt,options:Re}=lt;if(ce.current==null)return;const ke=O.get(ce.current);if(!ke)return;const Le=Ct.nativeEvent,bt=new qt({active:ce.current,activeNode:ke,event:Le,options:Re,context:we,onAbort(dt){if(!O.get(dt))return;const{onDragAbort:Et}=J.current,Ut={id:dt};Et==null||Et(Ut),M({type:"onDragAbort",event:Ut})},onPending(dt,Xt,Et,Ut){if(!O.get(dt))return;const{onDragPending:Ka}=J.current,xa={id:dt,constraint:Xt,initialCoordinates:Et,offset:Ut};Ka==null||Ka(xa),M({type:"onDragPending",event:xa})},onStart(dt){const Xt=ce.current;if(Xt==null)return;const Et=O.get(Xt);if(!Et)return;const{onDragStart:Ut}=J.current,Fa={activatorEvent:Le,active:{id:Xt,data:Et.data,rect:G}};Ca.unstable_batchedUpdates(()=>{Ut==null||Ut(Fa),_(rl.Initializing),R({type:Zt.DragStart,initialCoordinates:dt,active:Xt}),M({type:"onDragStart",event:Fa}),k(vn.current),Q(Le)})},onMove(dt){R({type:Zt.DragMove,coordinates:dt})},onEnd:Mt(Zt.DragEnd),onCancel:Mt(Zt.DragCancel)});vn.current=bt;function Mt(dt){return async function(){const{active:Et,collisions:Ut,over:Fa,scrollAdjustedTranslate:Ka}=we.current;let xa=null;if(Et&&Ka){const{cancelDrop:Mr}=J.current;xa={activatorEvent:Le,active:Et,collisions:Ut,delta:Ka,over:Fa},dt===Zt.DragEnd&&typeof Mr=="function"&&await Promise.resolve(Mr(xa))&&(dt=Zt.DragCancel)}ce.current=null,Ca.unstable_batchedUpdates(()=>{R({type:dt}),_(rl.Uninitialized),Cn(null),k(null),Q(null),vn.current=null;const Mr=dt===Zt.DragEnd?"onDragEnd":"onDragCancel";if(xa){const Zn=J.current[Mr];Zn==null||Zn(xa),M({type:Mr,event:xa})}})}}},[O]),Js=m.useCallback((Ct,lt)=>(qt,Re)=>{const ke=qt.nativeEvent,Le=O.get(Re);if(ce.current!==null||!Le||ke.dndKit||ke.defaultPrevented)return;const bt={active:Le};Ct(qt,lt.options,bt)===!0&&(ke.dndKit={capturedBy:lt.sensor},ce.current=Re,_t(qt,lt))},[O,_t]),Pl=Ek(x,Js);_k(x),Va(()=>{me&&D===rl.Initializing&&_(rl.Initialized)},[me,D]),m.useEffect(()=>{const{onDragMove:Ct}=J.current,{active:lt,activatorEvent:qt,collisions:Re,over:ke}=we.current;if(!lt||!qt)return;const Le={active:lt,activatorEvent:qt,collisions:Re,delta:{x:jt.x,y:jt.y},over:ke};Ca.unstable_batchedUpdates(()=>{Ct==null||Ct(Le),M({type:"onDragMove",event:Le})})},[jt.x,jt.y]),m.useEffect(()=>{const{active:Ct,activatorEvent:lt,collisions:qt,droppableContainers:Re,scrollAdjustedTranslate:ke}=we.current;if(!Ct||ce.current==null||!lt||!ke)return;const{onDragOver:Le}=J.current,bt=Re.get(qe),Mt=bt&&bt.rect.current?{id:bt.id,rect:bt.rect.current,data:bt.data,disabled:bt.disabled}:null,dt={active:Ct,activatorEvent:lt,collisions:qt,delta:{x:ke.x,y:ke.y},over:Mt};Ca.unstable_batchedUpdates(()=>{Cn(Mt),Le==null||Le(dt),M({type:"onDragOver",event:dt})})},[qe]),Va(()=>{we.current={activatorEvent:H,active:ie,activeNode:ve,collisionRect:tn,collisions:se,droppableRects:X,draggableNodes:O,draggingNode:Qe,draggingNodeRect:st,droppableContainers:K,over:it,scrollableAncestors:Ot,scrollAdjustedTranslate:jt},G.current={initial:st,translated:tn}},[ie,ve,se,tn,O,Qe,st,X,K,it,Ot,jt]),wk({...oe,delta:q,draggingRect:tn,pointerCoordinates:Pt,scrollableAncestors:Ot,scrollableAncestorRects:It});const ql=m.useMemo(()=>({active:ie,activeNode:ve,activeNodeRect:me,activatorEvent:H,collisions:se,containerNodeRect:xe,dragOverlay:Ye,draggableNodes:O,droppableContainers:K,droppableRects:X,over:it,measureDroppableContainers:re,scrollableAncestors:Ot,scrollableAncestorRects:It,measuringConfiguration:I,measuringScheduled:fe,windowRect:Lt}),[ie,ve,me,H,se,xe,Ye,O,K,X,it,re,Ot,It,I,fe,Lt]),Ga=m.useMemo(()=>({activatorEvent:H,activators:Pl,active:ie,activeNodeRect:me,ariaDescribedById:{draggable:ee},dispatch:R,draggableNodes:O,over:it,measureDroppableContainers:re}),[H,Pl,ie,me,R,ee,O,it,re]);return ue.createElement(oS.Provider,{value:T},ue.createElement(Qu.Provider,{value:Ga},ue.createElement(wS.Provider,{value:ql},ue.createElement(SS.Provider,{value:yt},v)),ue.createElement($k,{disabled:(p==null?void 0:p.restoreFocus)===!1})),ue.createElement(Y_,{...p,hiddenTextDescribedById:ee}));function Tr(){const Ct=(le==null?void 0:le.autoScrollEnabled)===!1,lt=typeof g=="object"?g.enabled===!1:g===!1,qt=A&&!Ct&&!lt;return typeof g=="object"?{...g,enabled:qt}:{enabled:qt}}}),Xk=m.createContext(null),qb="button",Qk="Draggable";function Zk(n){let{id:a,data:l,disabled:s=!1,attributes:c}=n;const u=xi(Qk),{activators:f,activatorEvent:p,active:g,activeNodeRect:v,ariaDescribedById:x,draggableNodes:y,over:b}=m.useContext(Qu),{role:w=qb,roleDescription:E="draggable",tabIndex:j=0}=c??{},C=(g==null?void 0:g.id)===a,R=m.useContext(C?SS:Xk),[M,T]=uu(),[D,_]=uu(),A=kk(f,a),U=ti(l);Va(()=>(y.set(a,{id:a,key:u,node:M,activatorNode:D,data:U}),()=>{const q=y.get(a);q&&q.key===u&&y.delete(a)}),[y,a]);const O=m.useMemo(()=>({role:w,tabIndex:j,"aria-disabled":s,"aria-pressed":C&&w===qb?!0:void 0,"aria-roledescription":E,"aria-describedby":x.draggable}),[s,w,j,C,E,x.draggable]);return{active:g,activatorEvent:p,activeNodeRect:v,attributes:O,isDragging:C,listeners:s?void 0:A,node:M,over:b,setNodeRef:T,setActivatorNodeRef:_,transform:R}}function Jk(){return m.useContext(wS)}const Wk="Droppable",e3={timeout:25};function t3(n){let{data:a,disabled:l=!1,id:s,resizeObserverConfig:c}=n;const u=xi(Wk),{active:f,dispatch:p,over:g,measureDroppableContainers:v}=m.useContext(Qu),x=m.useRef({disabled:l}),y=m.useRef(!1),b=m.useRef(null),w=m.useRef(null),{disabled:E,updateMeasurementsFor:j,timeout:C}={...e3,...c},R=ti(j??s),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=Xu({callback:M,disabled:E||!f}),D=m.useCallback((O,q)=>{T&&(q&&(T.unobserve(q),y.current=!1),O&&T.observe(O))},[T]),[_,A]=uu(D),U=ti(a);return m.useEffect(()=>{!T||!_.current||(T.disconnect(),y.current=!1,T.observe(_.current))},[_,T]),m.useEffect(()=>(p({type:Zt.RegisterDroppable,element:{id:s,key:u,disabled:l,node:_,rect:b,data:U}}),()=>p({type:Zt.UnregisterDroppable,key:u,id:s})),[s]),m.useEffect(()=>{l!==x.current.disabled&&(p({type:Zt.SetDroppableDisabled,id:s,key:u,disabled:l}),x.current.disabled=l)},[s,u,l,p]),{active:f,rect:b,isOver:(g==null?void 0:g.id)===s,node:_,over:g,setNodeRef:A}}function n3(n,a,l){const s={...n};return a.top+n.y<=l.top?s.y=l.top-a.top:a.bottom+n.y>=l.top+l.height&&(s.y=l.top+l.height-a.bottom),a.left+n.x<=l.left?s.x=l.left-a.left:a.right+n.x>=l.left+l.width&&(s.x=l.left+l.width-a.right),s}const a3=n=>{let{containerNodeRect:a,draggingNodeRect:l,transform:s}=n;return!l||!a?s:n3(s,l,a)},r3=n=>{let{transform:a}=n;return{...a,x:0}};function _p(n,a,l){const s=n.slice();return s.splice(l<0?s.length+l:l,0,s.splice(a,1)[0]),s}function l3(n,a){return n.reduce((l,s,c)=>{const u=a.get(s);return u&&(l[c]=u),l},Array(n.length))}function Pc(n){return n!==null&&n>=0}function s3(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 o3(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const jS=n=>{let{rects:a,activeIndex:l,overIndex:s,index:c}=n;const u=_p(a,s,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}},qc={scaleX:1,scaleY:1},i3=n=>{var a;let{activeIndex:l,activeNodeRect:s,index:c,rects:u,overIndex:f}=n;const p=(a=u[l])!=null?a:s;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,...qc}:null}const g=c3(u,c,l);return c>l&&c<=f?{x:0,y:-p.height-g,...qc}:c<l&&c>=f?{x:0,y:p.height+g,...qc}:{x:0,y:0,...qc}};function c3(n,a,l){const s=n[a],c=n[a-1],u=n[a+1];return s?l<a?c?s.top-(c.top+c.height):u?u.top-(s.top+s.height):0:u?u.top-(s.top+s.height):c?s.top-(c.top+c.height):0:0}const CS="Sortable",ES=ue.createContext({activeIndex:-1,containerId:CS,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:jS,disabled:{draggable:!1,droppable:!1}});function u3(n){let{children:a,id:l,items:s,strategy:c=jS,disabled:u=!1}=n;const{active:f,dragOverlay:p,droppableRects:g,over:v,measureDroppableContainers:x}=Jk(),y=xi(CS,l),b=p.rect!==null,w=m.useMemo(()=>s.map(A=>typeof A=="object"&&"id"in A?A.id:A),[s]),E=f!=null,j=f?w.indexOf(f.id):-1,C=v?w.indexOf(v.id):-1,R=m.useRef(w),M=!s3(w,R.current),T=C!==-1&&j===-1||M,D=o3(u);Va(()=>{M&&E&&x(w)},[M,w,E,x]),m.useEffect(()=>{R.current=w},[w]);const _=m.useMemo(()=>({activeIndex:j,containerId:y,disabled:D,disableTransforms:T,items:w,overIndex:C,useDragOverlay:b,sortedRects:l3(w,g),strategy:c}),[j,y,D.draggable,D.droppable,T,w,C,g,b,c]);return ue.createElement(ES.Provider,{value:_},a)}const d3=n=>{let{id:a,items:l,activeIndex:s,overIndex:c}=n;return _p(l,s,c).indexOf(a)},f3=n=>{let{containerId:a,isSorting:l,wasDragging:s,index:c,items:u,newIndex:f,previousItems:p,previousContainerId:g,transition:v}=n;return!v||!s||p!==u&&c===f?!1:l?!0:f!==c&&a===g},h3={duration:200,easing:"ease"},RS="transform",m3=du.Transition.toString({property:RS,duration:0,easing:"linear"}),p3={roleDescription:"sortable"};function g3(n){let{disabled:a,index:l,node:s,rect:c}=n;const[u,f]=m.useState(null),p=m.useRef(l);return Va(()=>{if(!a&&l!==p.current&&s.current){const g=c.current;if(g){const v=Qs(s.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,s,c]),m.useEffect(()=>{u&&f(null)},[u]),u}function v3(n){let{animateLayoutChanges:a=f3,attributes:l,disabled:s,data:c,getNewIndex:u=d3,id:f,strategy:p,resizeObserverConfig:g,transition:v=h3}=n;const{items:x,containerId:y,activeIndex:b,disabled:w,disableTransforms:E,sortedRects:j,overIndex:C,useDragOverlay:R,strategy:M}=m.useContext(ES),T=x3(s,w),D=x.indexOf(f),_=m.useMemo(()=>({sortable:{containerId:y,index:D,items:x},...c}),[y,c,D,x]),A=m.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:U,node:O,isOver:q,setNodeRef:K}=t3({id:f,data:_,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...g}}),{active:te,activatorEvent:G,activeNodeRect:ie,attributes:ce,setNodeRef:le,listeners:k,isDragging:H,over:Q,setActivatorNodeRef:J,transform:ee}=Zk({id:f,data:_,attributes:{...p3,...l},disabled:T.draggable}),z=O_(K,le),I=!!te,X=I&&!E&&Pc(b)&&Pc(C),re=!R&&H,fe=re&&X?ee:null,V=X?fe??(p??M)({rects:j,activeNodeRect:ie,activeIndex:b,overIndex:C,index:D}):null,oe=Pc(b)&&Pc(C)?u({id:f,items:x,activeIndex:b,overIndex:C}):D,de=te==null?void 0:te.id,me=m.useRef({activeId:de,items:x,newIndex:oe,containerId:y}),xe=x!==me.current.items,we=a({active:te,containerId:y,isDragging:H,isSorting:I,id:f,index:D,items:x,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:v,wasDragging:me.current.activeId!=null}),Me=g3({disabled:!we,index:D,node:O,rect:U});return m.useEffect(()=>{I&&me.current.newIndex!==oe&&(me.current.newIndex=oe),y!==me.current.containerId&&(me.current.containerId=y),x!==me.current.items&&(me.current.items=x)},[I,oe,y,x]),m.useEffect(()=>{if(de===me.current.activeId)return;if(de!=null&&me.current.activeId==null){me.current.activeId=de;return}const Qe=setTimeout(()=>{me.current.activeId=de},50);return()=>clearTimeout(Qe)},[de]),{active:te,activeIndex:b,attributes:ce,data:_,rect:U,index:D,newIndex:oe,items:x,isOver:q,isSorting:I,isDragging:H,listeners:k,node:O,overIndex:C,over:Q,setNodeRef:z,setActivatorNodeRef:J,setDroppableNodeRef:K,setDraggableNodeRef:le,transform:Me??V,transition:Ye()};function Ye(){if(Me||xe&&me.current.newIndex===D)return m3;if(!(re&&!Tp(G)||!v)&&(I||we))return du.Transition.toString({...v,property:RS})}}function x3(n,a){var l,s;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(l=n==null?void 0:n.draggable)!=null?l:a.draggable,droppable:(s=n==null?void 0:n.droppable)!=null?s:a.droppable}}function mu(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 y3=[Fe.Down,Fe.Right,Fe.Up,Fe.Left],b3=(n,a)=>{let{context:{active:l,collisionRect:s,droppableRects:c,droppableContainers:u,over:f,scrollableAncestors:p}}=a;if(y3.includes(n.code)){if(n.preventDefault(),!l||!s)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:s.top<b.top&&g.push(y);break;case Fe.Up:s.top>b.top&&g.push(y);break;case Fe.Left:s.left>b.left&&g.push(y);break;case Fe.Right:s.left<b.left&&g.push(y);break}});const v=X_({collisionRect:s,droppableRects:c,droppableContainers:g});let x=uS(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=Ku(E).some((A,U)=>p[U]!==A),R=NS(y,b),M=w3(y,b),T=C||!R?{x:0,y:0}:{x:M?s.width-w.width:0,y:M?s.height-w.height:0},D={x:w.left,y:w.top};return T.x&&T.y?D:ni(D,T)}}}};function NS(n,a){return!mu(n)||!mu(a)?!1:n.data.current.sortable.containerId===a.data.current.sortable.containerId}function w3(n,a){return!mu(n)||!mu(a)||!NS(n,a)?!1:n.data.current.sortable.index<a.data.current.sortable.index}const Uh={maxTotalAttempts:3,fallbackOnConnection:!0,fallbackOnConnectTimeout:!0,fallbackOnFirstTokenTimeout:!0,fallbackOn408:!0,fallbackOn429:!0,fallbackOn5xx:!0},S3={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"},pu=n=>n.map((a,l)=>({...a,position:l}));function j3(){const[n,a]=m.useState([]),[l,s]=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,...Uh,members:[]}),[D,_]=m.useState({name:"",slug:"",enabled:!0,...Uh,members:[]}),[A,U]=m.useState(null),O=async()=>{const[k,H]=await Promise.all([Ce.get("/api/admin/combos"),Ce.get("/api/admin/models")]);a(k.combos),s(H.models)};m.useEffect(()=>{O()},[]);const q=async k=>{j(k.id);try{R(await Ce.post("/api/admin/combos/"+k.id+"/test"))}catch(H){ge.error(H.message)}finally{j(null)}},K=async()=>{if(M.members.length===0){ge.error("Add at least one member");return}y(!0);try{await Ce.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,...Uh,members:[]}),O()}catch(k){ge.error(k.message)}finally{y(!1)}},te=async k=>{try{const Q=(await Ce.get(`/api/admin/combos/${k.id}`)).combo;v(Q.id),_({name:Q.name,slug:Q.publicModelId.startsWith("combo/")?Q.slug:"",enabled:Q.enabled,maxTotalAttempts:Q.maxTotalAttempts,fallbackOnConnection:Q.fallbackOnConnection,fallbackOnConnectTimeout:Q.fallbackOnConnectTimeout,fallbackOnFirstTokenTimeout:Q.fallbackOnFirstTokenTimeout,fallbackOn408:Q.fallbackOn408,fallbackOn429:Q.fallbackOn429,fallbackOn5xx:Q.fallbackOn5xx,members:Q.members.map(J=>({modelId:J.modelId,position:J.position,enabled:J.enabled}))}),p(!0)}catch(H){ge.error(H.message)}},G=async()=>{if(g){if(D.members.length===0){ge.error("Add at least one member");return}w(!0);try{await Ce.patch("/api/admin/combos",{id:g,name:D.name,slug:D.slug.trim()||void 0,enabled:D.enabled,...D,members:D.members}),ge.success("Combo updated"),p(!1),v(null),O()}catch(k){ge.error(k.message)}finally{w(!1)}}},ie=k=>{T(H=>({...H,members:pu([...H.members,{modelId:k,position:H.members.length,enabled:!0}])}))},ce=k=>{_(H=>({...H,members:pu([...H.members,{modelId:k,position:H.members.length,enabled:!0}])}))},le=async k=>{try{await Ce.del(`/api/admin/combos/${k}`),ge.success("Combo removed"),U(null),O()}catch(H){ge.error(H.message)}};return o.jsxs("div",{children:[o.jsx(Ya,{title:"Combos",description:"Virtual models combining physical models",actions:o.jsxs(kn,{open:c,onOpenChange:u,children:[o.jsx(mi,{asChild:!0,children:o.jsxs(he,{children:[o.jsx(wu,{className:"mr-1 h-4 w-4"})," New combo"]})}),o.jsxs(wn,{className:"max-h-[calc(100vh-2rem)] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[o.jsx(Sn,{children:o.jsx(jn,{children:"New combo"})}),o.jsxs("div",{className:"min-h-0 space-y-3 overflow-y-auto pr-1",children:[o.jsxs("div",{children:[o.jsx(Se,{children:"Name"}),o.jsx(De,{value:M.name,onChange:k=>T({...M,name:k.target.value})})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Slug (optional — empty uses the name as the model ID)"}),o.jsx(De,{value:M.slug,onChange:k=>T({...M,slug:k.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ta,{checked:M.enabled,onCheckedChange:k=>T({...M,enabled:k})}),o.jsx(Se,{children:"Enabled"})]}),o.jsx(Vb,{value:M,onChange:k=>T(H=>({...H,...k}))}),o.jsxs("div",{children:[o.jsx(Se,{children:"Members — priority order · drag to reorder"}),o.jsx(Gb,{models:l,addedIds:M.members.map(k=>k.modelId),onAdd:ie}),o.jsx($b,{members:M.members,modelFor:k=>l.find(H=>H.id===k.modelId)??null}),o.jsx(Yb,{className:"mt-2",members:M.members,label:k=>{var H;return((H=l.find(Q=>Q.id===k.modelId))==null?void 0:H.publicModelId)??k.modelId},modelFor:k=>l.find(H=>H.id===k.modelId)??null,onChange:k=>T(H=>({...H,members:k}))})]})]}),o.jsxs(zn,{children:[o.jsx(he,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),o.jsx(he,{disabled:!M.name||x,onClick:K,children:x?"Creating…":"Create"})]})]})]})}),o.jsxs(tt,{children:[o.jsxs(nt,{children:[o.jsx(at,{className:"text-base",children:"All combos"}),o.jsxs(bn,{children:[n.length," total"]})]}),o.jsx(rt,{children:o.jsxs(pa,{children:[o.jsx(ga,{children:o.jsxs(We,{children:[o.jsx(be,{children:"Public ID"}),o.jsx(be,{children:"Members"}),o.jsx(be,{children:"Status"}),o.jsx(be,{children:"Enabled"}),o.jsx(be,{})]})}),o.jsxs(va,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:5,className:"text-center text-muted-foreground",children:"No combos yet."})}),n.map(k=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-mono text-xs",children:k.publicModelId}),o.jsx(pe,{children:k.memberCount}),o.jsxs(pe,{children:[o.jsxs(Xe,{variant:k.status==="ready"?"success":k.status==="disabled"?"secondary":"destructive",children:[k.healthyMemberCount,"/",k.memberCount," ready"]}),k.capabilityWarnings.length>0&&o.jsx("div",{className:"text-xs text-amber-600",children:"Capability metadata differs"}),k.status==="unavailable"&&k.unavailableReasons.length>0&&o.jsx("div",{className:"text-xs text-muted-foreground",children:k.unavailableReasons.map(H=>S3[H]??H).join(", ")})]}),o.jsx(pe,{children:k.enabled?"Yes":"No"}),o.jsx(pe,{className:"text-right",children:o.jsxs("div",{className:"flex items-center justify-end gap-1",children:[o.jsxs(he,{size:"sm",variant:"outline",title:"Sends a real non-streaming inference request",onClick:()=>void q(k),disabled:E===k.id,children:[E===k.id?o.jsx(_s,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):o.jsx(D0,{className:"mr-1 h-3.5 w-3.5"})," Test"]}),o.jsxs(he,{size:"sm",variant:"outline",onClick:()=>void te(k),children:[o.jsx(wR,{className:"h-3.5 w-3.5"})," Sửa"]}),o.jsxs(he,{size:"sm",variant:"destructive",onClick:()=>U(k),children:[o.jsx(Su,{className:"h-3.5 w-3.5"})," Delete"]})]})})]},k.id))]})]})})]}),o.jsx(kn,{open:f,onOpenChange:p,children:o.jsxs(wn,{className:"max-h-[calc(100vh-2rem)] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[o.jsx(Sn,{children:o.jsx(jn,{children:"Edit combo"})}),o.jsxs("div",{className:"min-h-0 space-y-3 overflow-y-auto pr-1",children:[o.jsxs("div",{children:[o.jsx(Se,{children:"Name"}),o.jsx(De,{value:D.name,onChange:k=>_({...D,name:k.target.value})})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Slug (optional — leave empty to use the name as the model ID)"}),o.jsx(De,{value:D.slug,onChange:k=>_({...D,slug:k.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ta,{checked:D.enabled,onCheckedChange:k=>_({...D,enabled:k})}),o.jsx(Se,{children:"Enabled"})]}),o.jsx(Vb,{value:D,onChange:k=>_(H=>({...H,...k}))}),o.jsxs("div",{children:[o.jsx(Se,{children:"Members — priority order · drag to reorder"}),o.jsx(Gb,{models:l,addedIds:D.members.map(k=>k.modelId),onAdd:ce}),o.jsx($b,{members:D.members,modelFor:k=>l.find(H=>H.id===k.modelId)??null}),o.jsx(Yb,{className:"mt-2",members:D.members,label:k=>{var H;return((H=l.find(Q=>Q.id===k.modelId))==null?void 0:H.publicModelId)??k.modelId},modelFor:k=>l.find(H=>H.id===k.modelId)??null,onChange:k=>_(H=>({...H,members:k}))})]})]}),o.jsxs(zn,{children:[o.jsx(he,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),o.jsx(he,{disabled:!D.name||b,onClick:G,children:b?"Saving…":"Save"})]})]})}),o.jsx(kn,{open:C!==null,onOpenChange:k=>{k||R(null)},children:o.jsxs(wn,{className:"max-w-2xl",children:[o.jsxs(Sn,{children:[o.jsx(jn,{children:"Combo test result"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Test sends a real non-streaming inference request through this combo."})]}),C&&o.jsx(C3,{result:C}),o.jsx(zn,{children:o.jsx(he,{onClick:()=>R(null),children:"Close"})})]})}),o.jsx(dp,{open:A!==null,onOpenChange:k=>{k||U(null)},children:o.jsxs(Iu,{children:[o.jsxs(fp,{children:[o.jsx(Pu,{children:"Delete combo?"}),o.jsx(qu,{children:"This removes the virtual model and its ordered fallback configuration. Request history is preserved."})]}),o.jsxs(hp,{children:[o.jsx($u,{children:"Cancel"}),o.jsx(Vu,{onClick:()=>A&&void le(A.id),children:"Delete"})]})]})})]})}function Vb({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 o.jsxs("div",{className:"rounded border bg-muted/20 p-3",children:[o.jsx("div",{className:"mb-2 text-sm font-medium",children:"Fallback policy"}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-[10rem_1fr]",children:[o.jsxs("div",{children:[o.jsx(Se,{children:"Max total attempts"}),o.jsx(De,{type:"number",min:1,max:8,value:n.maxTotalAttempts,onChange:s=>a({maxTotalAttempts:Math.min(8,Math.max(1,Number(s.target.value)||1))})})]}),o.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:l.map(([s,c])=>o.jsxs("label",{className:"flex items-center gap-2 text-xs",children:[o.jsx(Ta,{checked:!!n[s],onCheckedChange:u=>a({[s]:u})}),o.jsx("span",{children:c})]},s))})]})]})}function $b({members:n,modelFor:a}){if(n.length===0)return null;const l=n.map(a).filter(c=>!!c),s=["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 o.jsxs("div",{className:"rounded border bg-muted/20 p-2 text-xs",children:[o.jsxs("div",{className:"mb-1 font-medium",children:["Route preview ",o.jsx("span",{className:"font-normal text-muted-foreground",children:"(first available member wins)"})]}),s.length>0&&o.jsxs("div",{className:"mb-2 flex items-center gap-1 text-amber-600",children:[o.jsx(_0,{className:"h-3.5 w-3.5"})," Members differ on: ",s.join(", ")]}),o.jsx("div",{className:"space-y-1",children:n.map((c,u)=>{const f=a(c);return o.jsxs("div",{className:"flex items-center gap-2 font-mono",children:[o.jsxs("span",{className:"w-4 text-muted-foreground",children:[u+1,"."]}),o.jsx("span",{children:(f==null?void 0:f.publicModelId)??c.modelId}),o.jsxs("span",{className:"text-muted-foreground",children:["→ ",(f==null?void 0:f.upstreamModelId)??"upstream model unknown"]})]},c.id??c.modelId)})})]})}function C3({result:n}){return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between rounded border p-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[n.success?o.jsx(ci,{className:"h-4 w-4 text-emerald-600"}):o.jsx(_0,{className:"h-4 w-4 text-amber-600"}),o.jsx(Xe,{variant:n.success?"success":"warning",children:n.success?"Success":"Failed"})]}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.latencyMs," ms total"]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-sm font-medium",children:"Selected upstream"}),n.selectedModel?o.jsxs("div",{className:"rounded border bg-muted/20 p-2 font-mono text-xs",children:[n.selectedModel.publicModelId," → ",n.selectedModel.upstreamModelId,o.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",n.selectedModel.providerSlug,")"]})]}):o.jsx("p",{className:"text-sm text-muted-foreground",children:"No member completed successfully."})]}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-sm font-medium",children:"Attempts"}),o.jsx("div",{className:"space-y-1",children:n.attempts.map((a,l)=>o.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[o.jsxs("span",{className:"w-4 text-muted-foreground",children:[l+1,"."]}),o.jsxs("span",{className:"min-w-0 flex-1 font-mono",children:[a.publicModelId," → ",a.upstreamModelId]}),o.jsxs("span",{className:"text-muted-foreground",children:[a.latencyMs," ms"]}),o.jsx(Xe,{variant:a.success?"success":"warning",children:a.success?"Used":a.failureReason??"Skipped"})]},a.publicModelId+"-"+l))})]}),n.text&&o.jsx("pre",{className:"max-h-32 overflow-auto whitespace-pre-wrap rounded border bg-muted/20 p-2 text-xs",children:n.text})]})}function Yb({members:n,label:a,modelFor:l,onChange:s,className:c}){const u=G_(Ab(Op,{activationConstraint:{distance:4}}),Ab(Ap,{coordinateGetter:b3}));if(n.length===0)return o.jsx("p",{className:Ee("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||s(pu(_p(n,Number(p.id),Number(g.id))))};return o.jsx(Kk,{sensors:u,collisionDetection:K_,modifiers:[r3,a3],onDragEnd:f,children:o.jsx(u3,{items:n.map((p,g)=>g),strategy:i3,children:o.jsx("div",{className:Ee("space-y-1",c),children:n.map((p,g)=>o.jsx(E3,{index:g,label:a(p),model:l(p),onRemove:()=>s(pu(n.filter((v,x)=>x!==g)))},p.id??p.modelId))})})})}function E3({index:n,label:a,model:l,onRemove:s}){const{attributes:c,listeners:u,setNodeRef:f,transform:p,transition:g,isDragging:v}=v3({id:n});return o.jsxs("div",{ref:f,style:{transform:p?`translate3d(${p.x}px, ${p.y}px, 0)`:void 0,transition:g},className:Ee("flex items-center gap-2 rounded border p-2 text-sm",v&&"relative z-10 bg-muted/60 shadow-sm"),children:[o.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:o.jsx(fR,{className:"h-4 w-4"})}),o.jsx("span",{className:"w-5 text-xs tabular-nums text-muted-foreground",children:n+1}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("div",{className:"truncate font-mono text-xs",children:a}),o.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"]})]}),o.jsx(Xe,{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"}),o.jsx(he,{size:"sm",variant:"outline",onClick:s,children:"Remove"})]})}function Gb({models:n,addedIds:a,onAdd:l}){const[s,c]=m.useState(""),f=(s?n.filter(p=>{const g=s.toLowerCase();return p.publicModelId.toLowerCase().includes(g)||p.displayName.toLowerCase().includes(g)}):n).filter(p=>!a.includes(p.id));return o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"relative",children:[o.jsx(O0,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(De,{className:"pl-8",placeholder:"Search models…",value:s,onChange:p=>c(p.target.value)}),s&&o.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>c(""),children:o.jsx(ju,{className:"h-4 w-4"})})]}),f.length===0?o.jsx("p",{className:"text-xs text-muted-foreground",children:"No models match."}):o.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded border p-1",children:f.map(p=>o.jsxs("div",{className:"flex items-center justify-between rounded p-1 text-sm hover:bg-accent",children:[o.jsx("span",{className:"font-mono text-xs",children:p.publicModelId}),o.jsx(he,{size:"sm",variant:"ghost",onClick:()=>l(p.id),children:"+ Add"})]},p.id))})]})}function R3(){const[n,a]=m.useState([]),[l,s]=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([Ce.get("/api/admin/aliases"),Ce.get("/api/admin/models"),Ce.get("/api/admin/combos")]);a(b.aliases),s(w.models),u(E.combos)};m.useEffect(()=>{x()},[]);const y=async()=>{try{await Ce.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 o.jsxs("div",{children:[o.jsx(Ya,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:o.jsxs(kn,{open:f,onOpenChange:p,children:[o.jsx(mi,{asChild:!0,children:o.jsxs(he,{children:[o.jsx(wu,{className:"mr-1 h-4 w-4"})," New alias"]})}),o.jsxs(wn,{children:[o.jsx(Sn,{children:o.jsx(jn,{children:"New alias"})}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx(Se,{children:"Alias"}),o.jsx(De,{value:g.alias,onChange:b=>v({...g,alias:b.target.value}),placeholder:"coding"})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Target type"}),o.jsxs(Ra,{value:g.targetKind,onValueChange:b=>v({...g,targetKind:b}),children:[o.jsx(da,{children:o.jsx(Na,{})}),o.jsxs(fa,{children:[o.jsx(wt,{value:"model",children:"Model"}),o.jsx(wt,{value:"combo",children:"Combo"})]})]})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Target"}),o.jsxs(Ra,{value:g.targetId,onValueChange:b=>v({...g,targetId:b}),children:[o.jsx(da,{children:o.jsx(Na,{placeholder:"Choose target"})}),o.jsx(fa,{children:(g.targetKind==="model"?l:c).map(b=>o.jsx(wt,{value:b.id,children:b.publicModelId},b.id))})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ta,{checked:g.enabled,onCheckedChange:b=>v({...g,enabled:b})}),o.jsx(Se,{children:"Enabled"})]})]}),o.jsxs(zn,{children:[o.jsx(he,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),o.jsx(he,{disabled:!g.alias||!g.targetId,onClick:y,children:"Create"})]})]})]})}),o.jsxs(tt,{children:[o.jsxs(nt,{children:[o.jsx(at,{className:"text-base",children:"All aliases"}),o.jsxs(bn,{children:[n.length," total"]})]}),o.jsx(rt,{children:o.jsxs(pa,{children:[o.jsx(ga,{children:o.jsxs(We,{children:[o.jsx(be,{children:"Alias"}),o.jsx(be,{children:"Target"}),o.jsx(be,{children:"Type"}),o.jsx(be,{children:"Enabled"}),o.jsx(be,{})]})}),o.jsxs(va,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),n.map(b=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-mono text-xs",children:b.alias}),o.jsx(pe,{className:"font-mono text-xs",children:b.targetName??b.targetId}),o.jsx(pe,{children:o.jsx(Xe,{variant:"outline",children:b.targetKind})}),o.jsx(pe,{children:b.enabled?"Yes":"No"}),o.jsx(pe,{className:"text-right",children:o.jsx(he,{size:"sm",variant:"outline",onClick:async()=>{await Ce.del(`/api/admin/aliases/${b.id}`),ge.success("Removed"),x()},children:"Delete"})})]},b.id))]})]})})]})]})}function N3(){const[n,a]=m.useState([]),[l,s]=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[A,U,O]=await Promise.all([Ce.get("/api/admin/api-keys"),Ce.get("/api/admin/models"),Ce.get("/api/admin/combos")]);a(A.apiKeys),s(U.models),u(O.combos)};m.useEffect(()=>{C()},[]);const R=async()=>{try{if(g){await Ce.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 A=await Ce.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:A.secret,name:A.name}),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C()}catch(A){ge.error(A.message)}},M=async A=>{try{const O=((await Ce.get(`/api/admin/api-keys/${A.id}`)).apiKey.permissions??[]).filter(q=>q.targetKind==="model"||q.targetKind==="combo");v(A.id),j({name:A.name,expiresAt:A.expiresAt?A.expiresAt.slice(0,16):"",allowAll:A.allowAllModels,permissions:O,rpmLimit:A.rpmLimit!=null?String(A.rpmLimit):"",tpmLimit:A.tpmLimit!=null?String(A.tpmLimit):"",concurrency:A.concurrencyLimit!=null?String(A.concurrencyLimit):"",customSecret:""}),p(!0)}catch(U){ge.error(U.message)}},T=()=>{p(!1),v(null),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""})},D=async(A,U)=>{try{await Ce.patch("/api/admin/api-keys",{id:A,enabled:!U}),ge.success(U?"Key disabled":"Key enabled"),C()}catch(O){ge.error(O.message)}},_=async A=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await Ce.del(`/api/admin/api-keys/${A}`),ge.success("Key deleted"),C()}catch(U){ge.error(U.message)}};return o.jsxs("div",{children:[o.jsx(Ya,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:o.jsxs(kn,{open:f,onOpenChange:A=>{A?p(!0):T()},children:[o.jsx(mi,{asChild:!0,children:o.jsxs(he,{children:[o.jsx(wu,{className:"mr-1 h-4 w-4"})," New key"]})}),o.jsxs(wn,{className:"max-w-2xl",children:[o.jsx(Sn,{children:o.jsx(jn,{children:g?"Edit API key":"New API key"})}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx(Se,{children:"Name"}),o.jsx(De,{value:E.name,onChange:A=>j({...E,name:A.target.value})})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Expires (optional)"}),o.jsx(De,{type:"datetime-local",value:E.expiresAt,onChange:A=>j({...E,expiresAt:A.target.value})})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[o.jsxs("div",{children:[o.jsx(Se,{children:"RPM limit"}),o.jsx(De,{value:E.rpmLimit,onChange:A=>j({...E,rpmLimit:A.target.value}),type:"number"})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"TPM limit"}),o.jsx(De,{value:E.tpmLimit,onChange:A=>j({...E,tpmLimit:A.target.value}),type:"number"})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Concurrency"}),o.jsx(De,{value:E.concurrency,onChange:A=>j({...E,concurrency:A.target.value}),type:"number"})]})]}),!g&&o.jsxs("div",{children:[o.jsx(Se,{children:"Key value (optional)"}),o.jsx(De,{value:E.customSecret,onChange:A=>j({...E,customSecret:A.target.value}),placeholder:"Leave empty to auto-generate ld-…"}),o.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."})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ta,{checked:E.allowAll,onCheckedChange:A=>j({...E,allowAll:A})}),o.jsx(Se,{children:"Allow all current and future models"})]}),!E.allowAll&&o.jsxs("div",{children:[o.jsx(Se,{children:"Scope"}),o.jsx("div",{className:"max-h-48 space-y-1 overflow-auto rounded border p-2",children:[...l.map(A=>({targetKind:"model",targetId:A.id,label:A.publicModelId})),...c.map(A=>({targetKind:"combo",targetId:A.id,label:A.publicModelId}))].map(A=>{const U=E.permissions.some(O=>O.targetKind===A.targetKind&&O.targetId===A.targetId);return o.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[o.jsx(Cp,{checked:U,onCheckedChange:O=>{j(q=>({...q,permissions:O?[...q.permissions,{targetKind:A.targetKind,targetId:A.targetId}]:q.permissions.filter(K=>!(K.targetKind===A.targetKind&&K.targetId===A.targetId))}))}}),o.jsx("span",{className:"font-mono text-xs",children:A.label}),o.jsx(Xe,{variant:"outline",className:"ml-1",children:A.targetKind})]},`${A.targetKind}:${A.targetId}`)})})]})]}),o.jsxs(zn,{children:[o.jsx(he,{variant:"outline",onClick:T,children:"Cancel"}),o.jsx(he,{disabled:!E.name,onClick:R,children:g?"Save changes":"Create"})]})]})]})}),o.jsxs(tt,{children:[o.jsxs(nt,{children:[o.jsx(at,{className:"text-base",children:"All keys"}),o.jsxs(bn,{children:[n.length," total"]})]}),o.jsx(rt,{children:o.jsxs(pa,{children:[o.jsx(ga,{children:o.jsxs(We,{children:[o.jsx(be,{children:"Name"}),o.jsx(be,{children:"Prefix"}),o.jsx(be,{children:"Status"}),o.jsx(be,{children:"Scope"}),o.jsx(be,{children:"RPM/TPM/Conc"}),o.jsx(be,{})]})}),o.jsxs(va,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),n.map(A=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-medium",children:A.name}),o.jsxs(pe,{className:"font-mono text-xs",children:[A.keyPrefix,"…"]}),o.jsx(pe,{children:A.enabled?o.jsx(Xe,{variant:"success",children:"enabled"}):o.jsx(Xe,{variant:"destructive",children:"disabled"})}),o.jsx(pe,{children:A.allowAllModels?"all":`${A.modelScopeCount} scoped`}),o.jsx(pe,{className:"text-xs",children:[A.rpmLimit,A.tpmLimit,A.concurrencyLimit].map((U,O)=>U?["","RPM","TPM","Conc"][O+1]:null).filter(Boolean).join(" / ")||"—"}),o.jsx(pe,{className:"text-right",children:o.jsxs("div",{className:"flex items-center justify-end gap-1",children:[A.secret&&o.jsxs(o.Fragment,{children:[o.jsx(he,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(A.secret),ge.success("Copied")},children:o.jsx(Xc,{className:"h-3.5 w-3.5"})}),o.jsx(he,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>w({secret:A.secret,name:A.name}),children:o.jsx(cR,{className:"h-3.5 w-3.5"})})]}),o.jsx(he,{size:"sm",variant:"ghost",title:"Edit",onClick:()=>void M(A),children:o.jsx(gR,{className:"h-3.5 w-3.5"})}),o.jsxs(he,{size:"sm",variant:"outline",onClick:()=>D(A.id,A.enabled),children:[A.enabled?o.jsx(JE,{className:"mr-1 h-3.5 w-3.5"}):o.jsx(ci,{className:"mr-1 h-3.5 w-3.5"}),A.enabled?"Disable":"Enable"]}),o.jsx(he,{size:"sm",variant:"destructive",onClick:()=>_(A.id),children:o.jsx(Su,{className:"h-3.5 w-3.5"})})]})})]},A.id))]})]})})]}),o.jsx(kn,{open:!!x,onOpenChange:A=>{A||y(null)},children:o.jsxs(wn,{children:[o.jsxs(Sn,{children:[o.jsx(jn,{children:"API key created"}),o.jsx(cu,{children:"Copy now — this secret will not be shown again."})]}),o.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:x==null?void 0:x.secret}),o.jsxs(zn,{children:[o.jsxs(he,{onClick:()=>{x&&(navigator.clipboard.writeText(x.secret),ge.success("Copied"))},children:[o.jsx(Xc,{className:"mr-1 h-4 w-4"})," Copy"]}),o.jsx(he,{variant:"outline",onClick:()=>y(null),children:"I have saved it"})]})]})}),o.jsx(kn,{open:!!b,onOpenChange:A=>{A||w(null)},children:o.jsxs(wn,{children:[o.jsxs(Sn,{children:[o.jsxs(jn,{children:["API key: ",b==null?void 0:b.name]}),o.jsx(cu,{children:"Full secret for this key, readable any time."})]}),o.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:b==null?void 0:b.secret}),o.jsxs(zn,{children:[o.jsxs(he,{onClick:()=>{b&&(navigator.clipboard.writeText(b.secret),ge.success("Copied"))},children:[o.jsx(Xc,{className:"mr-1 h-4 w-4"})," Copy"]}),o.jsx(he,{variant:"outline",onClick:()=>w(null),children:"Close"})]})]})})]})}const T3=3e3;function M3(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 A3(){const[n,a]=m.useState([]),[l,s]=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(0),E=50,j=m.useRef(Date.now()),C=m.useRef(new Set),R=m.useRef(f);R.current=f;const M=m.useRef(c);M.current=c;const T=m.useCallback(async()=>{const _=new URLSearchParams;_.set("limit",String(E)),_.set("offset",String(c)),f.success!=="all"&&_.set("success",f.success),f.protocol!=="all"&&_.set("protocol",f.protocol),f.streaming!=="all"&&_.set("streaming",f.streaming),f.model&&_.set("requestedModel",f.model);const A=await Ce.get(`/api/admin/requests?${_.toString()}`);a(A.requests),s(A.total);for(const U of A.requests)C.current.add(U.id)},[c,f]);m.useEffect(()=>{T()},[T]),m.useEffect(()=>{w(0)},[c,f]),m.useEffect(()=>{let _=!1,A=null;const U=new Set,O=()=>{_||(A=new EventSource(`/api/admin/requests/stream?since=${j.current}`),A.addEventListener("request",q=>{if(!_)try{const K=JSON.parse(q.data),te=new Date(K.createdAt).getTime();if(Number.isFinite(te)&&(j.current=Math.max(j.current,te)),C.current.has(K.id))return;C.current.add(K.id),w(G=>G+1),M.current===0&&M3(K,R.current)&&(a(G=>G.some(ie=>ie.id===K.id)?G:[K,...G].slice(0,E)),s(G=>G+1))}catch{}}),A.onerror=()=>{A==null||A.close(),A=null,_||U.add(setTimeout(O,T3))})};return O(),()=>{_=!0,A==null||A.close();for(const q of U)clearTimeout(q);U.clear()}},[]);const D=async _=>{v(_);const A=await Ce.get(`/api/admin/requests/${_}`);y(A)};return o.jsxs("div",{children:[o.jsx(Ya,{title:"Requests",description:`${l} matching · live updates`}),o.jsxs(tt,{children:[o.jsxs(nt,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs(Ra,{value:f.success,onValueChange:_=>{u(0),p({...f,success:_})},children:[o.jsx(da,{className:"w-36",children:o.jsx(Na,{})}),o.jsxs(fa,{children:[o.jsx(wt,{value:"all",children:"All"}),o.jsx(wt,{value:"true",children:"Success"}),o.jsx(wt,{value:"false",children:"Failed"})]})]}),o.jsxs(Ra,{value:f.protocol,onValueChange:_=>{u(0),p({...f,protocol:_})},children:[o.jsx(da,{className:"w-32",children:o.jsx(Na,{})}),o.jsxs(fa,{children:[o.jsx(wt,{value:"all",children:"Any protocol"}),o.jsx(wt,{value:"openai",children:"OpenAI"}),o.jsx(wt,{value:"anthropic",children:"Anthropic"})]})]}),o.jsxs(Ra,{value:f.streaming,onValueChange:_=>{u(0),p({...f,streaming:_})},children:[o.jsx(da,{className:"w-32",children:o.jsx(Na,{})}),o.jsxs(fa,{children:[o.jsx(wt,{value:"all",children:"Any"}),o.jsx(wt,{value:"true",children:"Streaming"}),o.jsx(wt,{value:"false",children:"Non-stream"})]})]}),o.jsx(De,{className:"max-w-xs",placeholder:"Model contains…",value:f.model,onChange:_=>{u(0),p({...f,model:_.target.value})}}),b>0&&o.jsxs(he,{size:"sm",variant:"secondary",onClick:()=>{w(0),T()},children:[b," new request",b>1?"s":""," — refresh"]})]}),o.jsx(at,{className:"mt-3 text-base",children:"Results"})]}),o.jsxs(rt,{children:[o.jsxs(pa,{children:[o.jsx(ga,{children:o.jsxs(We,{children:[o.jsx(be,{children:"Time"}),o.jsx(be,{children:"Status"}),o.jsx(be,{children:"Requested"}),o.jsx(be,{children:"Final"}),o.jsx(be,{children:"Tokens"}),o.jsx(be,{children:"Latency"}),o.jsx(be,{children:"Attempts"}),o.jsx(be,{children:"Key"}),o.jsx(be,{children:"IP"}),o.jsx(be,{})]})}),o.jsxs(va,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),n.map(_=>o.jsxs(We,{className:"cursor-pointer",onClick:()=>D(_.id),children:[o.jsx(pe,{className:"text-xs",children:Um(_.createdAt)}),o.jsx(pe,{children:_.success?o.jsx(Xe,{variant:"success",children:_.httpStatus}):o.jsx(Xe,{variant:"destructive",children:_.httpStatus})}),o.jsx(pe,{className:"font-mono text-xs",children:_.requestedModel}),o.jsx(pe,{className:"font-mono text-xs text-muted-foreground",children:_.finalModelPublicId??"—"}),o.jsxs(pe,{className:"text-xs",children:[Jt(_.inputTokens+_.outputTokens)," ",_.cacheReadTokens?o.jsxs("span",{className:"text-amber-600",children:["(+",_.cacheReadTokens," cache)"]}):null]}),o.jsxs(pe,{className:"text-xs",children:[Ol(_.totalLatencyMs),_.ttftMs?o.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",_.ttftMs,"ms"]}):null]}),o.jsxs(pe,{className:"text-xs",children:[_.attemptsCount,_.gatewayCacheHit?o.jsx(Xe,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),o.jsx(pe,{className:"text-xs",children:_.apiKeyName??"—"}),o.jsx(pe,{className:"text-xs",children:_.clientIp}),o.jsx(pe,{className:"text-right",children:o.jsx(he,{size:"sm",variant:"ghost",children:"View"})})]},_.id))]})]}),o.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Showing ",c+1,"–",Math.min(c+E,l)," of ",l]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(he,{size:"sm",variant:"outline",disabled:c===0,onClick:()=>u(Math.max(0,c-E)),children:"Prev"}),o.jsx(he,{size:"sm",variant:"outline",disabled:c+E>=l,onClick:()=>u(c+E),children:"Next"})]})]})]})]}),o.jsx(kn,{open:!!g,onOpenChange:_=>{_||(v(null),y(null))},children:o.jsxs(wn,{className:"max-w-3xl",children:[o.jsx(Sn,{children:o.jsxs(jn,{children:["Request ",rN(g,16)]})}),x?o.jsxs("div",{className:"space-y-3 text-sm",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Requested model"}),o.jsx("span",{className:"font-mono text-xs",children:x.request.requestedModel})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Upstream model"}),o.jsx("span",{className:"font-mono text-xs",children:x.request.finalModelUpstreamId??"—"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Provider"}),x.request.providerId?o.jsx(ia,{className:"text-primary underline",to:`/providers?providerId=${encodeURIComponent(x.request.providerId)}`,children:x.request.providerName??x.request.providerSlug??x.request.providerId}):"—"]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Route"}),x.request.resolvedTargetId?o.jsx(ia,{className:"text-primary underline",to:x.request.resolvedTargetKind==="combo"?"/combos":"/models",children:x.request.resolvedTargetKind??"target"}):"—"]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Status"}),x.request.success?o.jsx(Xe,{variant:"success",children:x.request.httpStatus}):o.jsx(Xe,{variant:"destructive",children:x.request.httpStatus})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),Ol(x.request.totalLatencyMs)]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Jt(x.request.inputTokens)," · out ",Jt(x.request.outputTokens)," · cache ",Jt(x.request.cacheReadTokens)]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Attempts"}),x.request.attemptsCount]})]}),x.request.errorType&&o.jsxs("div",{className:"rounded border border-destructive/40 bg-destructive/10 p-2",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Error"}),o.jsxs("div",{className:"font-mono text-xs",children:[x.request.errorType,": ",x.request.errorMessage]})]}),x.request.fallbackReasons.length>0&&o.jsxs("div",{className:"rounded border border-amber-500/40 bg-amber-500/10 p-2",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Fallback reasons"}),o.jsx("div",{className:"text-xs",children:x.request.fallbackReasons.join(", ")})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"Safe replay curl"}),o.jsxs(he,{size:"sm",variant:"ghost",onClick:()=>{navigator.clipboard.writeText(x.request.reproductionCurl).then(()=>ge.success("Curl copied"))},children:[o.jsx(Xc,{className:"mr-1 h-3.5 w-3.5"})," Copy"]})]}),o.jsx("pre",{className:"max-h-36 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 font-mono text-xs",children:x.request.reproductionCurl}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Replace the placeholder key before running. No stored secret is included."})]}),x.request.requestPayload&&o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Request content"}),o.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.requestPayload})]}),x.request.responsePayload&&o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Response content"}),o.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.responsePayload})]}),x.attempts.length>0&&o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Attempts"}),o.jsxs(pa,{children:[o.jsx(ga,{children:o.jsxs(We,{children:[o.jsx(be,{children:"#"}),o.jsx(be,{children:"Provider"}),o.jsx(be,{children:"Model"}),o.jsx(be,{children:"Status"}),o.jsx(be,{children:"Latency"}),o.jsx(be,{children:"Reason"})]})}),o.jsx(va,{children:x.attempts.map(_=>o.jsxs(We,{children:[o.jsx(pe,{children:_.attemptNumber}),o.jsx(pe,{children:_.providerName}),o.jsxs(pe,{children:[o.jsx("div",{className:"font-mono text-xs",children:_.modelPublicId}),o.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["upstream: ",_.upstreamModelId]})]}),o.jsx(pe,{children:_.success?o.jsx(Xe,{variant:"success",children:String(_.statusCode??"OK")}):o.jsx(Xe,{variant:"destructive",children:String(_.statusCode??"err")})}),o.jsx(pe,{className:"text-xs",children:Ol(_.latencyMs)}),o.jsx(pe,{className:"text-xs",children:_.failureReason??_.selectionReason})]},_.id))})]})]})]}):o.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}var D3=Object.defineProperty,Zs=(n,a)=>D3(n,"name",{value:a,configurable:!0}),kp="Tabs",[O3,n5]=Hn(kp,[zu]),TS=zu(),[_3,zp]=O3(kp),k3=m.forwardRef(Zs(function(a,l){const{__scopeTabs:s,value:c,onValueChange:u,defaultValue:f,orientation:p="horizontal",dir:g,activationMode:v="automatic",...x}=a,y=di(g),[b,w]=br({prop:c,onChange:u,defaultProp:f??"",caller:kp});return o.jsx(_3,{scope:s,baseId:Ha(),value:b,onValueChange:w,orientation:p,dir:y,activationMode:v,children:o.jsx(Pe.div,{dir:y,"data-orientation":p,...x,ref:l})})},"Tabs")),z3="TabsList",L3=m.forwardRef(Zs(function(a,l){const{__scopeTabs:s,loop:c=!0,...u}=a,f=zp(z3,s),p=TS(s);return o.jsx(F1,{asChild:!0,...p,orientation:f.orientation,dir:f.dir,loop:c,children:o.jsx(Pe.div,{role:"tablist","aria-orientation":f.orientation,...u,ref:l})})},"TabsList")),U3="TabsTrigger",B3=m.forwardRef(Zs(function(a,l){const{__scopeTabs:s,value:c,disabled:u=!1,...f}=a,p=zp(U3,s),g=TS(s),v=Lp(p.baseId,c),x=Up(p.baseId,c),y=c===p.value;return o.jsx(K1,{asChild:!0,...g,focusable:!u,active:y,children:o.jsx(Pe.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:Te(a.onMouseDown,b=>{!u&&b.button===0&&b.ctrlKey===!1?p.onValueChange(c):b.preventDefault()}),onKeyDown:Te(a.onKeyDown,b=>{u||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&p.onValueChange(c)}),onFocus:Te(a.onFocus,()=>{const b=p.activationMode!=="manual";!y&&!u&&b&&p.onValueChange(c)})})})},"TabsTrigger")),H3="TabsContent",I3=m.forwardRef(Zs(function(a,l){const{__scopeTabs:s,value:c,forceMount:u,children:f,...p}=a,g=zp(H3,s),v=Lp(g.baseId,c),x=Up(g.baseId,c),y=c===g.value,b=m.useRef(y);return m.useEffect(()=>{const w=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(w)},[]),o.jsx(Er,{present:u||y,children:({present:w})=>o.jsx(Pe.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 Lp(n,a){return`${n}-trigger-${a}`}Zs(Lp,"makeTriggerId");function Up(n,a){return`${n}-content-${a}`}Zs(Up,"makeContentId");var P3=k3,MS=L3,AS=B3,DS=I3;const OS=P3,Bp=m.forwardRef(({className:n,...a},l)=>o.jsx(MS,{ref:l,className:Ee("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...a}));Bp.displayName=MS.displayName;const pr=m.forwardRef(({className:n,...a},l)=>o.jsx(AS,{ref:l,className:Ee("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}));pr.displayName=AS.displayName;const Os=m.forwardRef(({className:n,...a},l)=>o.jsx(DS,{ref:l,className:Ee("mt-2 ring-offset-background focus-visible:outline-none",n),...a}));Os.displayName=DS.displayName;const q3=3e3,V3=1600,$3=10,Y3=3,G3=12,F3=10*6e4,K3={cacheReadTokens:0,promptTokens:0,gatewayCacheHits:0,fallbacks:0};function _S(n,a,l){return l==="anthropic"?n+a:n}function X3(n){return n.promptTokens>0?n.cacheReadTokens/n.promptTokens:0}function Q3(n,a){return a>0?n.fallbacks/a:0}function Z3(n,a){return a>0?n.gatewayCacheHits/a:0}function J3(n,a,l){const s=n.totalRequests+1,c=n.successfulRequests+(l.success?1:0),u={cacheReadTokens:a.cacheReadTokens+l.cacheReadTokens,promptTokens:a.promptTokens+_S(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:s,successfulRequests:c,failedRequests:n.failedRequests+(l.success?0:1),successRate:c/s,inputTokens:n.inputTokens+l.inputTokens,outputTokens:n.outputTokens+l.outputTokens,totalTokens:n.totalTokens+l.inputTokens+l.outputTokens,cacheHitRate:X3(u),gatewayCacheHitRate:Z3(u,s),fallbackRate:Q3(u,s),averageLatencyMs:(n.averageLatencyMs*n.totalRequests+l.totalLatencyMs)/s}}function W3(n){const[a,l]=m.useState(null),[s,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(K3),D=m.useRef(new Set),_=m.useRef(Date.now()),A=m.useRef(0),U=m.useRef([]),O=m.useRef([]);return m.useEffect(()=>{let q=!1;return E(!0),C(null),D.current=new Set,_.current=Date.now(),Ce.get(`/api/admin/stats?preset=${n}`).then(K=>{if(!q){l(K),c(K.summary),M.current=K.summary,T.current={cacheReadTokens:K.summary.cacheReadTokens,promptTokens:K.summary.cacheHitRate!==null&&K.summary.cacheHitRate>0?Math.round(K.summary.cacheReadTokens/K.summary.cacheHitRate):K.summary.inputTokens,gatewayCacheHits:Math.round(K.summary.gatewayCacheHitRate*K.summary.totalRequests),fallbacks:Math.round(K.summary.fallbackRate*K.summary.totalRequests)},f(K.recent),g(K.providers),R.current=K.providers;for(const te of K.recent)D.current.add(te.id);E(!1)}}).catch(K=>{q||(C(K.message),E(!1))}),()=>{q=!0}},[n]),m.useEffect(()=>{let q=!1,K=null;const te=new Set,G=()=>{q||(K=new EventSource(`/api/admin/requests/stream?since=${_.current}`),K.addEventListener("request",ce=>{if(!q)try{const le=JSON.parse(ce.data),k=new Date(le.createdAt).getTime();if(Number.isFinite(k)&&(_.current=Math.max(_.current,k)),D.current.has(le.id))return;D.current.add(le.id);const H={cacheReadTokens:T.current.cacheReadTokens+le.cacheReadTokens,promptTokens:T.current.promptTokens+_S(le.inputTokens,le.cacheReadTokens,le.providerType),gatewayCacheHits:T.current.gatewayCacheHits+(le.gatewayCacheHit?1:0),fallbacks:T.current.fallbacks+(le.attemptsCount>1?1:0)};if(T.current=H,M.current&&c(J3(M.current,H,le)),f(Q=>Q.some(J=>J.id===le.id)?Q:[le,...Q].slice(0,$3)),le.providerId){R.current=R.current.map(z=>z.id===le.providerId?{...z,requests:z.requests+1,errorRate:z.requests+1?(z.errorRate*z.requests+(le.success?0:1))/(z.requests+1):0}:z),g(R.current);const Q=`p${++A.current}`,J={id:Q,providerId:le.providerId,success:le.success};U.current=[...U.current.slice(-(Y3*4)),J],x(U.current);const ee=setTimeout(()=>{U.current=U.current.filter(z=>z.id!==Q),x(U.current)},V3);te.add(ee)}O.current.some(Q=>Q.id===le.id)&&(O.current=O.current.filter(Q=>Q.id!==le.id),b(O.current))}catch{}}),K.addEventListener("request_started",ce=>{if(!q)try{const le=JSON.parse(ce.data);if(!le.providerId||le.providerId==="")return;O.current=[...O.current.filter(k=>k.id!==le.requestId).slice(-(G3-1)),{id:le.requestId,providerId:le.providerId,startedAt:Date.now(),ttftMs:le.ttftMs??0}],b(O.current)}catch{}}),K.onerror=()=>{K==null||K.close(),K=null,q||te.add(setTimeout(G,q3))})};G();const ie=setInterval(()=>{const ce=Date.now()-F3;O.current.some(le=>le.startedAt<ce)&&(O.current=O.current.filter(le=>le.startedAt>=ce),b(O.current))},3e4);return()=>{q=!0,K==null||K.close();for(const ce of te)clearTimeout(ce);te.clear(),clearInterval(ie)}},[]),m.useEffect(()=>{const q=setInterval(()=>{Ce.get("/api/admin/providers").then(K=>{const te=new Map(K.providers.map(G=>[G.id,G]));R.current=R.current.map(G=>{const ie=te.get(G.id);return ie?{...G,health:ie.health,enabled:ie.enabled}:G}),g(R.current)}).catch(()=>{})},3e4);return()=>clearInterval(q)},[]),{snapshot:a,live:s??(a==null?void 0:a.summary)??e4,recent:u,providers:p,pulses:v,activeRoutes:y,loading:w,error:j}}const e4={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 kS({data:n,className:a,strokeClass:l="stroke-primary",fillClass:s}){if(n.length===0)return o.jsx("svg",{className:Ee("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 o.jsxs("svg",{className:Ee("h-6 w-20",a),viewBox:"0 0 80 24",preserveAspectRatio:"none",children:[s&&o.jsx("polygon",{points:`1,23 ${x} 79,23`,className:s}),o.jsx("polyline",{points:x,fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:l})]})}function t4(n,a,l){const s=performance.now();let c=0;const u=f=>{const p=Math.min((f-s)/a,1),g=Math.round(n*p);g!==c&&(c=g,l(g)),p<1&&requestAnimationFrame(u)};requestAnimationFrame(u)}function n4({delta:n,inverse:a}){if(Math.abs(n)<.005)return null;const l=n>0,s=a?!l:l,c=`${(Math.abs(n)*100).toFixed(1)}%`;return o.jsxs("span",{className:Ee("ml-1.5 inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold leading-none",s?"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:[o.jsx("span",{className:"mr-0.5",children:l?"▲":"▼"}),c]})}function tl({icon:n,label:a,value:l,format:s="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&&t4(Math.abs(w-b),600,E=>v(b+(w>b?E:-E))))},[l]);const y=l===null?"Unavailable":s==="percent"?Cu(g):s==="latency"?Ol(g):Jt(Math.round(g));return o.jsxs(tt,{children:[o.jsxs(nt,{className:"flex flex-row items-center justify-between pb-1",children:[o.jsxs(at,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[o.jsx(n,{className:"h-4 w-4"}),a]}),c!==void 0&&o.jsx(n4,{delta:c,inverse:u})]}),o.jsxs(rt,{className:"flex items-end justify-between",children:[o.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:y}),f&&f.length>1&&o.jsx(kS,{data:f,strokeClass:p??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const zS=1e3,Fb=380,Vc=60,nl=zS/2,al=720,Bh=62,a4=260;function r4(n){return n==="healthy"?"fill-emerald-400":n==="degraded"?"fill-amber-400":"fill-red-400"}function $c(n,a,l,s){const c=n+(l-n)*.45,u=n+(l-n)*.55;return`M${n},${a} C${c},${a} ${u},${s} ${l},${s}`}function l4({liveRequests:n,successRate:a,providers:l,pulses:s,activeRoutes:c}){const u=Fb/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 o.jsxs(tt,{children:[o.jsx(nt,{className:"pb-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(at,{className:"text-base",children:"Real-time Request Routing"}),o.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-emerald-400"})," healthy"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-400"})," degraded"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-red-400"})," down"]})]})]})}),o.jsx(rt,{className:"pt-0",children:o.jsx("div",{className:"relative w-full",children:o.jsxs("svg",{viewBox:`0 0 ${zS} ${Fb}`,className:"w-full h-auto",preserveAspectRatio:"xMidYMid meet",children:[o.jsx("defs",{children:o.jsxs("filter",{id:"glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[o.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),o.jsxs("feMerge",{children:[o.jsx("feMergeNode",{in:"blur"}),o.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),l.map(x=>{const b=60+l.indexOf(x)*Bh,w=x.requests/p,E=Math.max(1.5,Math.min(6,2+w*8)),j=g.has(x.id);return o.jsxs("g",{children:[j&&o.jsx("path",{d:$c(nl,u,al-20,b),fill:"none",stroke:"hsl(var(--primary) / 0.25)",strokeWidth:E+6,strokeLinecap:"round"}),o.jsx("path",{d:$c(nl,u,al-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)}),o.jsx("path",{d:$c(Vc+30,f,nl-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}),s.map(x=>{const y=l.findIndex(j=>j.id===x.providerId);if(y===-1)return null;const b=60+y*Bh,w=$c(nl,u,al-20,b),E=x.success?"var(--primary)":"#f87171";return o.jsxs("g",{filter:"url(#glow)",children:[o.jsx("circle",{r:5,fill:E,opacity:.9,children:o.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})}),o.jsx("circle",{r:9,fill:E,opacity:.25,children:o.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})})]},x.id)}),o.jsx("circle",{cx:Vc,cy:f,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),o.jsx("text",{x:Vc,y:f-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:Kb(n)}),o.jsx("text",{x:Vc,y:f+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),o.jsx("circle",{cx:nl,cy:u,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),o.jsx("image",{x:nl-12,y:u-16,width:24,height:24,href:"/logo.png"}),o.jsx("text",{x:nl,y:u+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),o.jsxs("text",{x:nl,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*Bh,w=x.requests/p,E=!x.enabled||x.requests===0;return o.jsxs("g",{opacity:E?.4:1,children:[o.jsx("rect",{x:al-20,y:b-14,width:a4,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),o.jsx("circle",{cx:al-6,cy:b+10,r:4,className:r4(x.health)}),o.jsx("text",{x:al+6,y:b-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:x.name}),o.jsxs("text",{x:al+6,y:b+12,className:"fill-muted-foreground",fontSize:10,children:[x.modelCount," model",x.modelCount!==1?"s":""," · ",Kb(x.requests)," req"]}),o.jsxs("text",{x:al+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&&o.jsxs("tspan",{className:"fill-red-500",children:[" · ",(x.errorRate*100).toFixed(0),"% err"]})]})]},x.id)})]})})})]})}function Kb(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}function s4({rows:n}){return o.jsxs(tt,{children:[o.jsx(nt,{className:"pb-2",children:o.jsx(at,{className:"text-base",children:"Recent Requests"})}),o.jsx(rt,{children:n.length===0?o.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No requests yet — traffic will appear here live."}):o.jsxs(pa,{children:[o.jsx(ga,{children:o.jsxs(We,{children:[o.jsx(be,{children:"Model"}),o.jsx(be,{children:"Provider"}),o.jsx(be,{children:"Tokens"}),o.jsx(be,{children:"Status"}),o.jsx(be,{children:"Time"})]})}),o.jsx(va,{children:n.map(a=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-mono text-xs",children:a.requestedModel}),o.jsx(pe,{className:"text-xs text-muted-foreground",children:a.providerName??"—"}),o.jsxs(pe,{className:"text-xs",children:[o.jsxs("span",{className:"font-mono",children:["in ",Jt(a.inputTokens)," · out ",Jt(a.outputTokens)]}),a.cacheReadTokens>0&&o.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",Jt(a.cacheReadTokens)," cache)"]})]}),o.jsx(pe,{children:o.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[o.jsx("span",{className:a.success?"h-2 w-2 rounded-full bg-emerald-400":"h-2 w-2 rounded-full bg-red-400"}),o.jsx("span",{className:"text-xs",children:a.success?a.httpStatus:`${a.httpStatus} err`})]})}),o.jsx(pe,{className:"text-xs text-muted-foreground",children:lN(a.createdAt)})]},a.id))})]})})]})}const gm=34,Xb=2*Math.PI*gm;function o4(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 i4({successRate:n,averageLatencyMs:a,latencySpark:l}){const{stroke:s,text:c}=o4(n),u=Math.min(1,Math.max(0,n)),f=Xb*(1-u);return o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsxs(tt,{children:[o.jsx(nt,{className:"pb-2",children:o.jsx(at,{className:"text-base",children:"Success Rate"})}),o.jsxs(rt,{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"relative h-20 w-20",children:[o.jsxs("svg",{viewBox:"0 0 80 80",className:"h-20 w-20 -rotate-90",children:[o.jsx("circle",{cx:"40",cy:"40",r:gm,fill:"none",stroke:"hsl(var(--border))",strokeWidth:7}),o.jsx("circle",{cx:"40",cy:"40",r:gm,fill:"none",stroke:s,strokeWidth:7,strokeLinecap:"round",strokeDasharray:Xb,strokeDashoffset:f,style:{transition:"stroke-dashoffset 0.6s ease, stroke 0.4s ease"}})]}),o.jsx("span",{className:`absolute inset-0 flex items-center justify-center text-sm font-semibold tabular-nums ${c}`,children:Cu(n)})]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Share of requests that completed successfully over the selected window. Updated in real time."})]})]}),o.jsxs(tt,{children:[o.jsx(nt,{className:"pb-2",children:o.jsx(at,{className:"text-base",children:"Average Latency"})}),o.jsxs(rt,{className:"flex items-end justify-between",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:Ol(a)}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Live average across the selected window"})]}),o.jsx(kS,{data:l,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function c4(){const[n,a]=m.useState("7d"),{snapshot:l,live:s,recent:c,providers:u,pulses:f,activeRoutes:p,loading:g,error:v}=W3(n);if(g)return o.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(v||!l)return o.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",v??"unknown error"]});const x=s,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 o.jsxs("div",{children:[o.jsx(Ya,{title:"Statistics",description:"Real-time monitoring dashboard",actions:o.jsx(OS,{value:n,onValueChange:C=>void a(C),children:o.jsxs(Bp,{children:[o.jsx(pr,{value:"today",children:"Today"}),o.jsx(pr,{value:"7d",children:"7 days"}),o.jsx(pr,{value:"30d",children:"30 days"})]})})}),!l.percentilesAvailable&&o.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."}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[o.jsx(tl,{icon:zm,label:"Requests",value:x.totalRequests,delta:w(x.totalRequests,y.totalRequests),sparkData:E}),o.jsx(tl,{icon:ci,label:"Success rate",format:"percent",value:x.successRate,delta:w(x.successRate,y.successRate),sparkData:E,sparkStroke:"stroke-emerald-500"}),o.jsx(tl,{icon:oR,label:"Total tokens",value:x.totalTokens,delta:w(x.totalTokens,y.totalTokens),sparkData:b.map(C=>C.inputTokens+C.outputTokens)}),o.jsx(tl,{icon:iR,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)}),o.jsx(tl,{icon:rR,label:"Avg latency",format:"latency",value:x.averageLatencyMs,delta:w(x.averageLatencyMs,y.averageLatencyMs),deltaInverse:!0,sparkData:j,sparkStroke:"stroke-amber-500"}),o.jsx(tl,{icon:N0,label:"p95 latency",format:"latency",value:x.p95LatencyMs}),o.jsx(tl,{icon:jR,label:"Avg TTFT",format:"latency",value:x.averageTtftMs}),o.jsx(tl,{icon:vR,label:"Fallback rate",format:"percent",value:x.fallbackRate,delta:w(x.fallbackRate,y.fallbackRate),deltaInverse:!0})]}),o.jsx("div",{className:"mt-6",children:o.jsx(l4,{liveRequests:x.totalRequests,successRate:x.successRate,providers:u,pulses:f,activeRoutes:p})}),o.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-3",children:[o.jsx("div",{className:"lg:col-span-2",children:o.jsx(s4,{rows:c})}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs(tt,{children:[o.jsx(nt,{className:"pb-2",children:o.jsx(at,{className:"text-base",children:"Top Models"})}),o.jsx(rt,{children:o.jsxs(pa,{children:[o.jsx(ga,{children:o.jsxs(We,{children:[o.jsx(be,{children:"Model"}),o.jsx(be,{children:"Req"}),o.jsx(be,{children:"Errors"}),o.jsx(be,{children:"Tokens"})]})}),o.jsxs(va,{children:[l.topModels.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),l.topModels.map(C=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-mono text-xs",children:C.publicId}),o.jsx(pe,{className:"text-xs",children:Jt(C.requests)}),o.jsx(pe,{className:"text-xs",children:o.jsx("span",{className:C.errorRate>.1?"text-destructive":"text-muted-foreground",children:Cu(C.errorRate)})}),o.jsx(pe,{className:"text-xs",children:Jt(C.totalTokens)})]},C.publicId))]})]})})]}),o.jsxs(tt,{children:[o.jsx(nt,{className:"pb-2",children:o.jsx(at,{className:"text-base",children:"Top API Keys"})}),o.jsx(rt,{children:o.jsxs(pa,{children:[o.jsx(ga,{children:o.jsxs(We,{children:[o.jsx(be,{children:"Key"}),o.jsx(be,{children:"Requests"}),o.jsx(be,{children:"Tokens"})]})}),o.jsxs(va,{children:[l.topApiKeys.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),l.topApiKeys.map((C,R)=>o.jsxs(We,{children:[o.jsx(pe,{className:"text-xs",children:C.name}),o.jsx(pe,{className:"text-xs",children:Jt(C.requests)}),o.jsx(pe,{className:"text-xs",children:Jt(C.totalTokens)})]},R))]})]})})]})]})]}),o.jsx("div",{className:"mt-6",children:o.jsx(i4,{successRate:x.successRate,averageLatencyMs:x.averageLatencyMs,latencySpark:j})})]})}function u4(){const[n,a]=m.useState([]),[l,s]=m.useState(0);return m.useEffect(()=>{Ce.get("/api/admin/audit?limit=200").then(c=>{a(c.rows),s(c.total)})},[]),o.jsxs("div",{children:[o.jsx(Ya,{title:"Audit Logs",description:`${l} entries · immutable`}),o.jsxs(tt,{children:[o.jsx(nt,{children:o.jsx(at,{className:"text-base",children:"All entries"})}),o.jsx(rt,{children:o.jsxs(pa,{children:[o.jsx(ga,{children:o.jsxs(We,{children:[o.jsx(be,{children:"Time"}),o.jsx(be,{children:"Action"}),o.jsx(be,{children:"Status"}),o.jsx(be,{children:"Target"}),o.jsx(be,{children:"IP"}),o.jsx(be,{children:"Actor"})]})}),o.jsxs(va,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),n.map(c=>o.jsxs(We,{children:[o.jsx(pe,{className:"text-xs",children:Um(c.createdAt)}),o.jsx(pe,{className:"font-mono text-xs",children:c.action}),o.jsx(pe,{children:c.success?o.jsx(Xe,{variant:"success",children:"ok"}):o.jsx(Xe,{variant:"destructive",children:"fail"})}),o.jsx(pe,{className:"text-xs",children:c.targetName??c.targetId??"—"}),o.jsx(pe,{className:"text-xs",children:c.ip}),o.jsx(pe,{className:"text-xs",children:c.actor})]},c.id))]})]})})]})]})}const vm={enabled:!0,sound:!0};let ri=vm,xm=!1,Yc=null;const ym=new Set;function LS(){for(const n of ym)n()}function US(n=!1){return xm&&!n?Promise.resolve():(!n&&Yc||(Yc=(async()=>{try{const a=await Ce.get("/api/admin/settings");ri={enabled:a.settings.notificationsEnabled??vm.enabled,sound:a.settings.notificationSoundEnabled??vm.sound},xm=!0,LS()}catch{}})()),Yc)}async function Qb(n){const a={};n.enabled!==void 0&&(a.notificationsEnabled=n.enabled),n.sound!==void 0&&(a.notificationSoundEnabled=n.sound),await Ce.patch("/api/admin/settings",a),ri={...ri,...n},xm=!0,LS()}function d4(n){return ym.add(n),()=>ym.delete(n)}function BS(){return m.useSyncExternalStore(d4,()=>ri,()=>ri)}const bm=m.forwardRef(({className:n,...a},l)=>o.jsx("textarea",{ref:l,className:Ee("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}));bm.displayName="Textarea";function f4(){const[n]=PE(),[a,l]=m.useState(null),[s,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("idle"),[R,M]=m.useState(null),T=async(se=!1)=>{C("checking"),M(null);try{const qe=await Ce.get(`/api/admin/update/check${se?"?force=1":""}`);b(qe),C("idle")}catch(qe){M(qe.message),C("error")}},D=async()=>{E(!0),C("installing"),M(null);try{const se=await Ce.post("/api/admin/update/run");C("restarting"),ge.success(se.message||"Update started — the gateway will restart shortly.");const qe=setInterval(()=>{fetch("/health").then(it=>{it.ok&&(clearInterval(qe),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(qe),12e4)}catch(se){ge.error(se.message),M(se.message),C("error")}finally{E(!1)}},[_,A]=m.useState("disabled"),[U,O]=m.useState(""),[q,K]=m.useState(""),[te,G]=m.useState(""),[ie,ce]=m.useState([]),[le,k]=m.useState(""),[H,Q]=m.useState(""),[J,ee]=m.useState(!1),[z,I]=m.useState(null),[X,re]=m.useState(""),[fe,ve]=m.useState(""),[V,oe]=m.useState(""),[de,me]=m.useState("compact"),[xe,we]=m.useState("idle"),[Me,Ye]=m.useState(null),Qe=m.useRef(null),[st,Kt]=m.useState(null),ot=async()=>{const se=await Ce.get("/api/admin/settings");l(se.settings),g(se.settings.adminIpAllow??""),x(se.settings.adminIpBlock??"");const qe=await Ce.get("/api/admin/settings/system");c(qe);try{const it=await Ce.get("/api/admin/me");A(it.totpEnabled?"enabled":"disabled")}catch{}};if(m.useEffect(()=>{US(!0)},[]),m.useEffect(()=>{ot(),T(!0)},[]),m.useEffect(()=>{Ce.get("/api/admin/backup/capabilities").then(se=>Kt(se.maxUploadBytes)).catch(()=>Kt(null))},[]),!a)return o.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const Lt=async se=>{try{await Ce.patch("/api/admin/settings",se),ge.success("Saved"),ot()}catch(qe){ge.error(qe.message)}},Ot=async()=>{try{const se=await Ce.post("/api/admin/account/totp/begin");O(se.secret),K(se.qr),A("setup"),ge.info("Scan the QR code with your authenticator app")}catch(se){ge.error(se.message)}},It=async()=>{if(!te||te.length!==6){ge.error("Enter a 6-digit code");return}try{const se=await Ce.post("/api/admin/account/totp/verify",{code:te});ce(se.recoveryCodes),A("showingRecovery"),ge.success("TOTP enabled successfully")}catch(se){ge.error(se.message)}},en=async()=>{if(!le){ge.error("Enter your password");return}if(!H){ge.error("Enter a TOTP code or recovery code");return}try{await Ce.post("/api/admin/account/totp/disable",{password:le,totp:H}),A("disabled"),k(""),Q(""),ge.success("TOTP disabled"),ot()}catch(se){ge.error(se.message)}},Pt=async()=>{ee(!0);try{const se=await Ce.post("/api/admin/account/totp/recovery/regenerate",{password:le,totp:H});ce(se.recoveryCodes),A("showingRecovery"),ge.success("Recovery codes regenerated")}catch(se){ge.error(se.message)}ee(!1)},xt=async()=>{var se,qe;try{const it=await _m("/api/admin/backup/create",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({passphrase:X,profile:de})});if(!it.ok)throw new Error(((qe=(se=await it.json().catch(()=>null))==null?void 0:se.error)==null?void 0:qe.message)??"Backup failed");const Cn=await it.blob(),cn=URL.createObjectURL(Cn),yt=document.createElement("a");yt.href=cn,yt.download=`latedev-backup-${new Date().toISOString().replace(/[:.]/g,"-")}.ldb`,yt.click(),URL.revokeObjectURL(cn),ge.success("Backup downloaded"),re(""),ve("")}catch(it){ge.error(it.message)}},on=async()=>{const se=z;if(!se)return;const qe=new AbortController;Qe.current=qe,Ye({loaded:0,total:se.size,percent:0}),we("uploading");let it;try{const Cn=await Rw({file:se,passphrase:V||void 0,signal:qe.signal,onProgress:cn=>{Ye(cn),cn.percent>=100&&(we("validating"),it=setTimeout(()=>we("restoring"),1500))}});clearTimeout(it),we("complete"),ge.success(Cn.message||"Restored. Reloading…"),I(null),setTimeout(()=>location.reload(),600)}catch(Cn){clearTimeout(it),Cn.name==="AbortError"?(ge.info("Restore cancelled"),we("idle")):(ge.error(Cn.message),we("failed"))}finally{Qe.current=null}},St=xe==="uploading"||xe==="validating"||xe==="restoring",jt=st!==null&&z!==null&&z.size>st,tn=n.get("tab")||"logging";return o.jsxs("div",{children:[o.jsx(Ya,{title:"Settings",description:"Logging, security, backup, and system info"}),o.jsxs(OS,{defaultValue:tn,children:[o.jsxs(Bp,{children:[o.jsx(pr,{value:"logging",children:"Logging"}),o.jsx(pr,{value:"access",children:"Access Control"}),o.jsx(pr,{value:"security",children:"Security"}),o.jsx(pr,{value:"backup",children:"Backup"}),o.jsx(pr,{value:"system",children:"System"})]}),o.jsx(Os,{value:"logging",children:o.jsxs(tt,{children:[o.jsx(nt,{children:o.jsx(at,{className:"text-base",children:"Logging policy"})}),o.jsxs(rt,{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(Se,{children:"Request-content logging"}),o.jsxs(Ra,{value:a.contentLogMode,onValueChange:se=>Lt({contentLogMode:se}),children:[o.jsx(da,{children:o.jsx(Na,{})}),o.jsxs(fa,{children:[o.jsx(wt,{value:"off",children:"Off"}),o.jsx(wt,{value:"metadata",children:"Metadata only (default)"}),o.jsx(wt,{value:"prompt",children:"Prompt (sanitized)"}),o.jsx(wt,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(Se,{children:"Retention (days)"}),o.jsx(De,{type:"number",min:1,max:3650,value:a.retentionDays,onChange:se=>Lt({retentionDays:Number(se.target.value)})})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(Se,{children:"Database size limit (MB)"}),o.jsx(De,{type:"number",min:64,value:a.dbSizeLimitMb,onChange:se=>Lt({dbSizeLimitMb:Number(se.target.value)})})]}),o.jsx("div",{className:"flex items-center gap-2 pt-2",children:o.jsx(he,{onClick:async()=>{const se=await Ce.post("/api/admin/settings/cleanup");ge.success(`Deleted ${se.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),o.jsx(Os,{value:"access",children:o.jsxs(tt,{children:[o.jsxs(nt,{children:[o.jsx(at,{className:"text-base",children:"IP access control"}),o.jsx(bn,{children:"Allowlist / Blocklist for this admin website (not model traffic)"})]}),o.jsxs(rt,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Se,{children:"Allow only these IPs"}),o.jsx(bm,{placeholder:`192.168.1.0/24
349
+ 10.0.0.1`,value:p,onChange:se=>g(se.target.value)}),o.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."})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Se,{children:"Block these IPs"}),o.jsx(bm,{placeholder:"192.168.1.100",value:v,onChange:se=>x(se.target.value)}),o.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.'})]}),o.jsx(he,{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),Ce.patch("/api/admin/settings",se).then(qe=>{ge.success("Saved"+(qe.addedIp?` — added your IP: ${qe.addedIp}`:"")),ot(),g(""),x("")}).catch(qe=>ge.error(qe.message))},children:"Save access control"}),o.jsxs("div",{className:"rounded bg-amber-50 border border-amber-200 p-3 dark:bg-amber-950/20 dark:border-amber-800",children:[o.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."}),o.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."})]})]})]})}),o.jsx(Os,{value:"security",children:o.jsxs(tt,{children:[o.jsxs(nt,{children:[o.jsx(at,{className:"text-base",children:"Security"}),o.jsx(bn,{children:"Change password, 2FA, and trusted proxy configuration"})]}),o.jsxs(rt,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Se,{children:"Trusted proxy hops"}),o.jsx(De,{type:"number",min:0,max:8,value:a.trustProxyHops,onChange:se=>Lt({trustProxyHops:Number(se.target.value)})}),o.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."})]}),o.jsxs("div",{className:"space-y-2 border-t pt-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Se,{className:"text-base",children:"TOTP 2FA"}),_==="enabled"?o.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,_==="disabled"?o.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:"Disabled"}):null]}),_==="disabled"&&o.jsx(he,{variant:"outline",onClick:Ot,children:"Enable TOTP"}),_==="setup"&&o.jsxs("div",{className:"space-y-3 rounded border p-3",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan this QR code with your authenticator app, or enter the secret manually."}),q&&o.jsx("img",{src:q,alt:"TOTP QR code",className:"h-40 w-40"}),o.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",U]}),o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsxs("div",{className:"flex-1",children:[o.jsx(Se,{children:"Verify code"}),o.jsx(De,{value:te,onChange:se=>G(se.target.value),placeholder:"123456",maxLength:6})]}),o.jsx(he,{disabled:te.length<6,onClick:It,children:"Verify & enable"})]})]}),_==="showingRecovery"&&o.jsxs("div",{className:"space-y-3 rounded border border-amber-500/40 bg-amber-50 p-3 dark:bg-amber-950/20",children:[o.jsx("p",{className:"text-sm font-medium",children:"Recovery codes — save these now!"}),o.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."}),o.jsx("div",{className:"space-y-1",children:ie.map((se,qe)=>o.jsx("div",{className:"font-mono text-xs",children:se},qe))}),o.jsx(he,{onClick:()=>{A("enabled"),ge.success("Recovery codes saved")},children:"I have saved them"})]}),_==="enabled"&&o.jsxs("div",{className:"space-y-3 rounded border p-3",children:[o.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(Se,{children:"Password"}),o.jsx(De,{type:"password",value:le,onChange:se=>k(se.target.value),placeholder:"Current password"})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"TOTP code"}),o.jsx(De,{value:H,onChange:se=>Q(se.target.value),placeholder:"123456",maxLength:6})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(he,{variant:"outline",size:"sm",disabled:J||!le||H.length<6,onClick:Pt,children:"Regenerate recovery codes"}),o.jsx(he,{variant:"destructive",size:"sm",disabled:!le||H.length<6,onClick:en,children:"Disable TOTP"})]})]})]}),o.jsxs("div",{className:"space-y-2 border-t pt-4",children:[o.jsx(Se,{children:"Change password"}),o.jsx(De,{type:"password",placeholder:"Current password",value:u.current,onChange:se=>f({...u,current:se.target.value})}),o.jsx(De,{type:"password",placeholder:"New password (12+ chars)",value:u.next,onChange:se=>f({...u,next:se.target.value})}),o.jsx(he,{disabled:!u.current||u.next.length<12,onClick:async()=>{try{await Ce.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"})]})]})]})}),o.jsx(Os,{value:"backup",children:o.jsxs(tt,{children:[o.jsxs(nt,{children:[o.jsx(at,{className:"text-base",children:"Backup & restore"}),o.jsx(bn,{children:"Download a snapshot or restore from a previous backup"})]}),o.jsxs(rt,{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-2 rounded border p-3",children:[o.jsx(Se,{children:"Backup profile"}),o.jsxs(Ra,{value:de,onValueChange:se=>me(se),children:[o.jsx(da,{"data-testid":"backup-profile",children:o.jsx(Na,{})}),o.jsxs(fa,{children:[o.jsx(wt,{value:"compact",children:"Compact (default)"}),o.jsx(wt,{value:"full",children:"Full forensic"})]})]}),o.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"&&o.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."})]}),o.jsxs("div",{className:"space-y-2 rounded border p-3",children:[o.jsx(Se,{children:"Backup passphrase (6 digits)"}),o.jsx(De,{inputMode:"numeric",maxLength:6,value:X,onChange:se=>re(se.target.value.replace(/\D/g,"")),placeholder:"123456"}),o.jsx(De,{inputMode:"numeric",maxLength:6,value:fe,onChange:se=>ve(se.target.value.replace(/\D/g,"")),placeholder:"Repeat passphrase"}),o.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."})]}),o.jsx(he,{disabled:X.length!==6||X!==fe,onClick:xt,children:"Download backup"}),o.jsxs("div",{className:"space-y-2 rounded border p-3",children:[o.jsx(Se,{children:"Backup passphrase for restore"}),o.jsx(De,{inputMode:"numeric",maxLength:6,value:V,onChange:se=>oe(se.target.value.replace(/\D/g,"")),placeholder:"123456"}),o.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."})]}),o.jsxs(dp,{open:z!==null&&!St,onOpenChange:se=>{se||I(null)},children:[o.jsx(SO,{asChild:!0,children:o.jsxs("div",{children:[o.jsx(Se,{children:"Restore from backup file"}),o.jsx(De,{type:"file",accept:".ldb,.ldb.json,application/octet-stream,application/json","data-testid":"restore-file",disabled:St,onChange:se=>{var it;const qe=(it=se.target.files)==null?void 0:it[0];I(qe??null)}})]})}),o.jsxs(Iu,{children:[o.jsxs(fp,{children:[o.jsx(Pu,{children:"Restore backup?"}),o.jsxs(qu,{children:["Restoring will replace the entire current database with the selected backup (",(z==null?void 0:z.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),o.jsxs(hp,{children:[o.jsx($u,{children:"Cancel"}),o.jsx(Vu,{disabled:jt,onClick:on,children:"Restore"})]})]})]}),jt&&o.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 ",(((z==null?void 0:z.size)??0)/1048576).toFixed(1)," MiB, over the server limit of ",(st/1048576).toFixed(0)," MiB. The upload will be rejected — choose a smaller backup."]}),xe!=="idle"&&o.jsxs("div",{className:"space-y-2 rounded border p-3","data-testid":"restore-progress",children:[o.jsxs("div",{className:"flex items-center justify-between text-sm",children:[o.jsxs("span",{children:[xe==="uploading"&&"Uploading…",xe==="validating"&&"Validating…",xe==="restoring"&&"Restoring…",xe==="complete"&&"Complete",xe==="failed"&&"Failed"]}),xe==="uploading"&&Me&&o.jsxs("span",{className:"text-muted-foreground",children:[(Me.loaded/1048576).toFixed(1)," / ",(Me.total/1048576).toFixed(1)," MiB · ",Me.percent,"%"]})]}),o.jsx(Ew,{value:xe==="uploading"?(Me==null?void 0:Me.percent)??0:100,className:xe!=="uploading"?"animate-pulse":void 0}),o.jsxs("div",{className:"flex items-center gap-2",children:[xe==="uploading"&&o.jsx(he,{variant:"outline",size:"sm",onClick:()=>{var se;return(se=Qe.current)==null?void 0:se.abort()},children:"Cancel"}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"Uploads are not resumable — cancelling restarts from the beginning."})]})]})]})]})}),o.jsxs(Os,{value:"system",children:[o.jsxs(tt,{children:[o.jsx(nt,{children:o.jsx(at,{className:"text-base",children:"System"})}),o.jsxs(rt,{className:"space-y-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"App version:"})," ",s==null?void 0:s.appVersion]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Data directory:"})," ",o.jsx("span",{className:"font-mono",children:s==null?void 0:s.dataDir})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Encryption:"})," ",s!=null&&s.masterKeyConfigured?"Configured":"Not configured"," (v",s==null?void 0:s.masterKeyVersion,")"]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Environment:"})," ",s==null?void 0:s.environment]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[o.jsx(Ta,{checked:a.gatewayCacheEnabled,onCheckedChange:se=>Lt({gatewayCacheEnabled:se})}),o.jsx(Se,{children:"Gateway response cache (disabled by default)"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx(Se,{children:"Cache TTL (s)"}),o.jsx(De,{type:"number",min:1,value:a.gatewayCacheDefaultTtlSeconds,onChange:se=>Lt({gatewayCacheDefaultTtlSeconds:Number(se.target.value)})})]}),o.jsxs("div",{children:[o.jsx(Se,{children:"Cache max size (MB)"}),o.jsx(De,{type:"number",min:1,value:a.gatewayCacheMaxSizeMb,onChange:se=>Lt({gatewayCacheMaxSizeMb:Number(se.target.value)})})]})]}),o.jsx(he,{variant:"outline",onClick:async()=>{const se=await Ce.post("/api/admin/settings/cache/clear");ge.success(`Cleared ${se.deleted} entries`)},children:"Clear gateway cache"})]})]}),o.jsx(h4,{}),o.jsxs(tt,{className:"mt-4",children:[o.jsxs(nt,{children:[o.jsx(at,{className:"text-base",children:"Updates"}),o.jsx(bn,{children:"Automatic updates from the npm registry"})]}),o.jsxs(rt,{className:"space-y-3 text-sm",children:[j==="checking"&&!y&&o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(_s,{className:"h-4 w-4 animate-spin"})," Checking for updates…"]}),y&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Current version"}),o.jsxs("div",{className:"font-mono",children:["v",y.currentVersion]})]}),o.jsx("span",{className:"text-muted-foreground",children:"→"}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Latest version"}),o.jsx("div",{className:"font-mono",children:y.latestVersion?`v${y.latestVersion}`:"—"})]}),y.status.docker?o.jsx(Xe,{variant:"secondary",children:y.status.watchtower?"Docker + Watchtower":"Docker"}):y.latestVersion===null?o.jsx(Xe,{variant:"secondary",children:"Registry unreachable"}):y.hasUpdate?o.jsx(Xe,{variant:"success",children:"Update available"}):o.jsxs(Xe,{variant:"outline",children:[o.jsx(ci,{className:"mr-1 h-3 w-3"})," Up to date"]})]}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable&&o.jsx("p",{className:"text-muted-foreground",children:"Watchtower pulls new images automatically every hour — or use Update now for an instant update."}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable===!1&&o.jsxs("p",{className:"text-muted-foreground",children:["The Watchtower sidecar is configured but not running — start it with ",o.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"docker compose --profile updater up -d"}),"."]}),y.status.docker&&!y.status.watchtower&&o.jsx("p",{className:"text-muted-foreground",children:y.status.reason??"This instance runs in Docker — update by pulling the new image tag."}),!y.status.docker&&y.latestVersion===null&&o.jsxs("p",{className:"text-muted-foreground",children:["Could not reach the npm registry (offline or blocked). ",R&&o.jsx("span",{className:"text-destructive",children:R})]}),j==="installing"&&o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(_s,{className:"h-4 w-4 animate-spin"})," Applying the update… this can take a minute."]}),j==="restarting"&&o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(_s,{className:"h-4 w-4 animate-spin"})," Update applied — the gateway is restarting on the new version. This page reloads automatically."]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y.hasUpdate&&j==="idle"&&(!y.status.docker||y.status.watchtower&&y.watchtowerReachable!==!1)&&o.jsxs(he,{disabled:w||y.status.docker&&y.watchtowerReachable===!1,onClick:D,children:[o.jsx(R0,{className:"mr-1 h-4 w-4"})," Update now"]}),y.hasUpdate&&y.changelogUrl&&o.jsx(he,{variant:"outline",asChild:!0,children:o.jsx("a",{href:y.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),j==="idle"&&o.jsx(he,{variant:"ghost",disabled:w,onClick:()=>T(!0),children:"Check again"})]})]})]})]})]})]})]})}function h4(){const n=BS();return o.jsxs(tt,{className:"mt-4",children:[o.jsx(nt,{children:o.jsxs(at,{className:"text-base flex items-center gap-2",children:[o.jsx(WE,{className:"h-4 w-4"})," Notifications"]})}),o.jsxs(rt,{className:"space-y-3 text-sm",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{children:"Show request notifications"}),o.jsx(Ta,{checked:n.enabled,onCheckedChange:a=>void Qb({enabled:a})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(CR,{className:"h-3 w-3"})," Play notification sound"]}),o.jsx(Ta,{checked:n.sound,onCheckedChange:a=>void Qb({sound:a})})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function m4({items:n,onDismiss:a}){return n.length?o.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 s=!l.success,c=l.success&&l.totalLatencyMs>15e3,u=Ee("rounded-md border shadow-lg transition-all",s&&"bg-destructive text-destructive-foreground border-destructive",c&&"bg-amber-500/90 text-amber-950 border-amber-600/50",!s&&!c&&"bg-card text-card-foreground border-border");return o.jsxs(ia,{to:"/requests",className:Ee("block shrink-0 p-3 hover:opacity-95",u),children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s?o.jsx(aR,{className:"h-4 w-4 shrink-0"}):l.success?o.jsx(ci,{className:"h-4 w-4 shrink-0"}):o.jsx(ER,{className:"h-4 w-4 shrink-0 opacity-70"}),o.jsx("div",{className:"min-w-0 truncate text-sm font-medium",title:l.requestedModel,children:l.requestedModel})]}),o.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:o.jsx(ju,{className:"h-3.5 w-3.5"})})]}),o.jsxs("div",{className:"mt-1 text-xs",children:[l.success?"Thành công":"Thất bại",!l.success&&l.errorType&&o.jsx("span",{className:"ml-1 inline-block rounded bg-black/15 px-1 py-0.5 align-text-bottom text-[10px]",children:l.errorType})]}),o.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:["in ",Jt(l.inputTokens)," · out ",Jt(l.outputTokens),(l.cacheReadTokens>0||l.cacheWriteTokens>0)&&o.jsxs(o.Fragment,{children:[" · cache ",l.cacheReadTokens>0&&o.jsxs("span",{children:["r",Jt(l.cacheReadTokens)]}),l.cacheReadTokens>0&&l.cacheWriteTokens>0&&"/",l.cacheWriteTokens>0&&o.jsxs("span",{children:["w",Jt(l.cacheWriteTokens)]})]})]}),o.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[Ol(l.totalLatencyMs),l.ttftMs!=null&&l.ttftMs>=0&&o.jsxs("span",{children:[" · TTFT ",Ol(l.ttftMs)]})]})]},l.id)})}):null}const p4=5e3,g4=8,v4=3e3;let Gc=null;function x4(){try{Gc||(Gc=new Audio("/notification.mp3")),Gc.currentTime=0,Gc.play().catch(()=>{})}catch{}}function y4(){const[n,a]=m.useState([]),l=m.useRef(null),s=m.useRef(new Map),c=m.useRef(Date.now()),u=m.useRef(new Set),f=BS(),p=m.useRef(f.sound);p.current=f.sound,m.useEffect(()=>{US()},[]);const g=f.enabled;return m.useEffect(()=>{var w;if(!g){(w=l.current)==null||w.close(),l.current=null;const E=s.current;for(const j of E.values())clearTimeout(j);E.clear(),a([]);return}let x=!1;const y=s.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(D=>D.id===C.id)?T:[C,...T].slice(0,g4));const M=setTimeout(()=>{a(T=>T.filter(D=>D.id!==C.id)),y.delete(C.id)},p4);y.set(C.id,M),p.current&&x4()}catch{}}),E.onerror=()=>{E.close(),l.current=null,x||setTimeout(b,v4)}};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=s.current.get(x);y&&(clearTimeout(y),s.current.delete(x)),a(b=>b.filter(w=>w.id!==x))}}}function b4({children:n}){const{user:a,loading:l}=km(),s=Bn();return l?o.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):a?o.jsx(o.Fragment,{children:n}):o.jsx(Ih,{to:"/login",state:{from:s},replace:!0})}function w4(){const{items:n,dismiss:a}=y4();return o.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[o.jsx(oN,{}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.jsx(iD,{}),o.jsx("main",{className:"flex-1 overflow-auto p-6",children:o.jsxs(v0,{children:[o.jsx(On,{index:!0,element:o.jsx($D,{})}),o.jsx(On,{path:"/providers",element:o.jsx(x_,{})}),o.jsx(On,{path:"/models",element:o.jsx(D_,{})}),o.jsx(On,{path:"/combos",element:o.jsx(j3,{})}),o.jsx(On,{path:"/aliases",element:o.jsx(R3,{})}),o.jsx(On,{path:"/api-keys",element:o.jsx(N3,{})}),o.jsx(On,{path:"/requests",element:o.jsx(A3,{})}),o.jsx(On,{path:"/statistics",element:o.jsx(c4,{})}),o.jsx(On,{path:"/audit",element:o.jsx(u4,{})}),o.jsx(On,{path:"/settings/*",element:o.jsx(f4,{})})]})})]}),o.jsx(m4,{items:n,onDismiss:a})]})}function S4({children:n}){const[a,l]=m.useState(null),s=Bn();return m.useEffect(()=>{Ce.get("/api/admin/setup/status").then(c=>l(c.setupComplete)).catch(()=>l(!0))},[]),a===null?o.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):!a&&s.pathname!=="/setup"?o.jsx(Ih,{to:"/setup",replace:!0}):a&&s.pathname==="/setup"?o.jsx(Ih,{to:"/",replace:!0}):o.jsx(o.Fragment,{children:n})}function j4(){return o.jsx(KE,{children:o.jsx(S4,{children:o.jsxs(v0,{children:[o.jsx(On,{path:"/setup",element:o.jsx(qD,{})}),o.jsx(On,{path:"/login",element:o.jsx(HD,{})}),o.jsx(On,{path:"/*",element:o.jsx(b4,{children:o.jsx(w4,{})})})]})})})}const C4=BD;var E4=Object.defineProperty,Ln=(n,a)=>E4(n,"name",{value:a,configurable:!0}),[Hp,a5]=Hn("Tooltip",[Fs]),R4=Fs(),N4="TooltipProvider",T4=700,Zb="tooltip.open",[M4,A4]=Hp(N4),D4=Ln(n=>{const{__scopeTooltip:a,delayDuration:l=T4,skipDelayDuration:s=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)},[]),o.jsx(M4,{scope:a,isOpenDelayedRef:f,delayDuration:l,onOpen:m.useCallback(()=>{s<=0||(window.clearTimeout(g.current),f.current=!1)},[s]),onClose:m.useCallback(()=>{s<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,s))},[s]),isPointerInTransitRef:p,onPointerInTransitChange:m.useCallback(v=>{p.current=v},[]),disableHoverableContent:c,children:u})},"TooltipProvider"),O4="Tooltip",[r5,Ip]=Hp(O4),_4="TooltipPortal",[l5,k4]=Hp(_4,{forceMount:void 0}),li="TooltipContent",z4=m.forwardRef(Ln(function(a,l){const s=k4(li,a.__scopeTooltip),{forceMount:c=s.forceMount,side:u="top",...f}=a,p=Ip(li,a.__scopeTooltip);return o.jsx(Er,{present:c||p.open,children:p.disableHoverableContent?o.jsx(HS,{side:u,...f,ref:l}):o.jsx(L4,{side:u,...f,ref:l})})},"TooltipContent")),L4=m.forwardRef(Ln(function(a,l){const s=Ip(li,a.__scopeTooltip),c=A4(li,a.__scopeTooltip),u=m.useRef(null),f=Ke(l,u),[p,g]=m.useState(null),{trigger:v,onClose:x}=s,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=IS(M,R.getBoundingClientRect()),D=PS(M,T),_=qS(C.getBoundingClientRect()),A=$S([...D,..._]);g(A),b(!0)},[b]);return m.useEffect(()=>()=>w(),[w]),m.useEffect(()=>{if(v&&y){const j=Ln(R=>E(R,y),"handleTriggerLeave"),C=Ln(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=Ln(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)),D=!VS(M,p);T?w():D&&(w(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[v,y,p,x,w]),o.jsx(HS,{...a,ref:f})},"TooltipContentHoverable")),U4=V0("TooltipContent"),HS=m.forwardRef(Ln(function(a,l){const{__scopeTooltip:s,children:c,"aria-label":u,id:f,onEscapeKeyDown:p,onPointerDownOutside:g,...v}=a,x=Ip(li,s),y=R4(s),{onClose:b}=x;m.useEffect(()=>(document.addEventListener(Zb,b),()=>document.removeEventListener(Zb,b)),[b]),m.useEffect(()=>{if(x.trigger){const E=Ln(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 Wt(()=>(w(f),()=>{w(void 0)}),[f,w]),o.jsx(Ru,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:E=>E.preventDefault(),onDismiss:b,children:o.jsxs(Zm,{"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:[o.jsx(U4,{children:c}),u?o.jsx(DO,{id:x.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl"));function IS(n,a){const l=Math.abs(a.top-n.y),s=Math.abs(a.bottom-n.y),c=Math.abs(a.right-n.x),u=Math.abs(a.left-n.x);switch(Math.min(l,s,c,u)){case u:return"left";case c:return"right";case l:return"top";case s:return"bottom";default:throw new Error("unreachable")}}Ln(IS,"getExitSideFromRect");function PS(n,a,l=5){const s=[];switch(a){case"top":s.push({x:n.x-l,y:n.y+l},{x:n.x+l,y:n.y+l});break;case"bottom":s.push({x:n.x-l,y:n.y-l},{x:n.x+l,y:n.y-l});break;case"left":s.push({x:n.x+l,y:n.y-l},{x:n.x+l,y:n.y+l});break;case"right":s.push({x:n.x-l,y:n.y-l},{x:n.x-l,y:n.y+l});break}return s}Ln(PS,"getPaddedExitPoints");function qS(n){const{top:a,right:l,bottom:s,left:c}=n;return[{x:c,y:a},{x:l,y:a},{x:l,y:s},{x:c,y:s}]}Ln(qS,"getPointsFromRect");function VS(n,a){const{x:l,y:s}=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>s!=b>s&&l<(y-v)*(s-x)/(b-x)+v&&(c=!c)}return c}Ln(VS,"isPointInPolygon");function $S(n){const a=n.slice();return a.sort((l,s)=>l.x<s.x?-1:l.x>s.x?1:l.y<s.y?-1:l.y>s.y?1:0),YS(a)}Ln($S,"getHull");function YS(n){if(n.length<=1)return n.slice();const a=[];for(let s=0;s<n.length;s++){const c=n[s];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 s=n.length-1;s>=0;s--){const c=n[s];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)}Ln(YS,"getHullPresorted");var B4=D4,GS=z4;const H4=B4,I4=m.forwardRef(({className:n,sideOffset:a=4,...l},s)=>o.jsx(GS,{ref:s,sideOffset:a,className:Ee("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}));I4.displayName=GS.displayName;m2.createRoot(document.getElementById("root")).render(o.jsx(ue.StrictMode,{children:o.jsx(gN,{defaultTheme:"dark",storageKey:"latedev-theme",children:o.jsxs(H4,{children:[o.jsx(UE,{children:o.jsx(j4,{})}),o.jsx(C4,{position:"top-right"})]})})}));