ldrouter 1.17.4 → 1.17.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/server/gateway/runner.js +67 -1
- package/dist/server/providers/codex-refresh.js +59 -22
- package/dist/server/providers/codex.js +12 -1
- package/dist/server/providers/qoder/client.js +23 -0
- package/dist/server/providers/qoder/sse.js +66 -7
- package/dist/server/routes/admin/requests.js +1 -0
- package/dist/server/routes/admin/stats.js +32 -2
- package/dist/web/assets/{index-DQd2y4FN.css → index-CbKRlw3a.css} +1 -1
- package/dist/web/assets/index-D-rviQ3G.js +391 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-f8A3f3uE.js +0 -391
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
var Zy=n=>{throw TypeError(n)};var Jy=(n,a,l)=>a.has(n)||Zy("Cannot "+l);var gn=(n,a,l)=>(Jy(n,a,"read from private field"),l?l.call(n):a.get(n)),Wy=(n,a,l)=>a.has(n)?Zy("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,l),hh=(n,a,l,o)=>(Jy(n,a,"write to private field"),o?o.call(n,l):a.set(n,l),l);function b2(n,a){for(var l=0;l<a.length;l++){const o=a[l];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in n)){const u=Object.getOwnPropertyDescriptor(o,c);u&&Object.defineProperty(n,c,u.get?u:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(c){if(c.ep)return;c.ep=!0;const u=l(c);fetch(c.href,u)}})();function Rm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var mh={exports:{}},Zo={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var eb;function w2(){if(eb)return Zo;eb=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(o,c,u){var f=null;if(u!==void 0&&(f=""+u),c.key!==void 0&&(f=""+c.key),"key"in c){u={};for(var p in c)p!=="key"&&(u[p]=c[p])}else u=c;return c=u.ref,{$$typeof:n,type:o,key:f,ref:c!==void 0?c:null,props:u}}return Zo.Fragment=a,Zo.jsx=l,Zo.jsxs=l,Zo}var tb;function j2(){return tb||(tb=1,mh.exports=w2()),mh.exports}var s=j2(),ph={exports:{}},ke={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var nb;function S2(){if(nb)return ke;nb=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function w(L){return L===null||typeof L!="object"?null:(L=b&&L[b]||L["@@iterator"],typeof L=="function"?L:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function R(L,U,Y){this.props=L,this.context=U,this.refs=C,this.updater=Y||N}R.prototype.isReactComponent={},R.prototype.setState=function(L,U){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,U,"setState")},R.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function D(){}D.prototype=R.prototype;function A(L,U,Y){this.props=L,this.context=U,this.refs=C,this.updater=Y||N}var M=A.prototype=new D;M.constructor=A,S(M,R.prototype),M.isPureReactComponent=!0;var O=Array.isArray;function E(){}var z={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function P(L,U,Y){var ae=Y.ref;return{$$typeof:n,type:L,key:U,ref:ae!==void 0?ae:null,props:Y}}function Z(L,U){return P(L.type,U,L.props)}function ee(L){return typeof L=="object"&&L!==null&&L.$$typeof===n}function V(L){var U={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(Y){return U[Y]})}var ce=/\/+/g;function se(L,U){return typeof L=="object"&&L!==null&&L.key!=null?V(""+L.key):U.toString(36)}function H(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(E,E):(L.status="pending",L.then(function(U){L.status==="pending"&&(L.status="fulfilled",L.value=U)},function(U){L.status==="pending"&&(L.status="rejected",L.reason=U)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function _(L,U,Y,ae,ge){var ye=typeof L;(ye==="undefined"||ye==="boolean")&&(L=null);var G=!1;if(L===null)G=!0;else switch(ye){case"bigint":case"string":case"number":G=!0;break;case"object":switch(L.$$typeof){case n:case a:G=!0;break;case x:return G=L._init,_(G(L._payload),U,Y,ae,ge)}}if(G)return ge=ge(L),G=ae===""?"."+se(L,0):ae,O(ge)?(Y="",G!=null&&(Y=G.replace(ce,"$&/")+"/"),_(ge,U,Y,"",function(xe){return xe})):ge!=null&&(ee(ge)&&(ge=Z(ge,Y+(ge.key==null||L&&L.key===ge.key?"":(""+ge.key).replace(ce,"$&/")+"/")+G)),U.push(ge)),1;G=0;var ue=ae===""?".":ae+":";if(O(L))for(var he=0;he<L.length;he++)ae=L[he],ye=ue+se(ae,he),G+=_(ae,U,Y,ye,ge);else if(he=w(L),typeof he=="function")for(L=he.call(L),he=0;!(ae=L.next()).done;)ae=ae.value,ye=ue+se(ae,he++),G+=_(ae,U,Y,ye,ge);else if(ye==="object"){if(typeof L.then=="function")return _(H(L),U,Y,ae,ge);throw U=String(L),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return G}function q(L,U,Y){if(L==null)return L;var ae=[],ge=0;return _(L,ae,"","",function(ye){return U.call(Y,ye,ge++)}),ae}function W(L){if(L._status===-1){var U=L._result;U=U(),U.then(function(Y){(L._status===0||L._status===-1)&&(L._status=1,L._result=Y)},function(Y){(L._status===0||L._status===-1)&&(L._status=2,L._result=Y)}),L._status===-1&&(L._status=0,L._result=U)}if(L._status===1)return L._result.default;throw L._result}var Q=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},te={map:q,forEach:function(L,U,Y){q(L,function(){U.apply(this,arguments)},Y)},count:function(L){var U=0;return q(L,function(){U++}),U},toArray:function(L){return q(L,function(U){return U})||[]},only:function(L){if(!ee(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return ke.Activity=y,ke.Children=te,ke.Component=R,ke.Fragment=l,ke.Profiler=c,ke.PureComponent=A,ke.StrictMode=o,ke.Suspense=g,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,ke.__COMPILER_RUNTIME={__proto__:null,c:function(L){return z.H.useMemoCache(L)}},ke.cache=function(L){return function(){return L.apply(null,arguments)}},ke.cacheSignal=function(){return null},ke.cloneElement=function(L,U,Y){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ae=S({},L.props),ge=L.key;if(U!=null)for(ye in U.key!==void 0&&(ge=""+U.key),U)!k.call(U,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&U.ref===void 0||(ae[ye]=U[ye]);var ye=arguments.length-2;if(ye===1)ae.children=Y;else if(1<ye){for(var G=Array(ye),ue=0;ue<ye;ue++)G[ue]=arguments[ue+2];ae.children=G}return P(L.type,ge,ae)},ke.createContext=function(L){return L={$$typeof:f,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:u,_context:L},L},ke.createElement=function(L,U,Y){var ae,ge={},ye=null;if(U!=null)for(ae in U.key!==void 0&&(ye=""+U.key),U)k.call(U,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ge[ae]=U[ae]);var G=arguments.length-2;if(G===1)ge.children=Y;else if(1<G){for(var ue=Array(G),he=0;he<G;he++)ue[he]=arguments[he+2];ge.children=ue}if(L&&L.defaultProps)for(ae in G=L.defaultProps,G)ge[ae]===void 0&&(ge[ae]=G[ae]);return P(L,ye,ge)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(L){return{$$typeof:p,render:L}},ke.isValidElement=ee,ke.lazy=function(L){return{$$typeof:x,_payload:{_status:-1,_result:L},_init:W}},ke.memo=function(L,U){return{$$typeof:v,type:L,compare:U===void 0?null:U}},ke.startTransition=function(L){var U=z.T,Y={};z.T=Y;try{var ae=L(),ge=z.S;ge!==null&&ge(Y,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(E,Q)}catch(ye){Q(ye)}finally{U!==null&&Y.types!==null&&(U.types=Y.types),z.T=U}},ke.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},ke.use=function(L){return z.H.use(L)},ke.useActionState=function(L,U,Y){return z.H.useActionState(L,U,Y)},ke.useCallback=function(L,U){return z.H.useCallback(L,U)},ke.useContext=function(L){return z.H.useContext(L)},ke.useDebugValue=function(){},ke.useDeferredValue=function(L,U){return z.H.useDeferredValue(L,U)},ke.useEffect=function(L,U){return z.H.useEffect(L,U)},ke.useEffectEvent=function(L){return z.H.useEffectEvent(L)},ke.useId=function(){return z.H.useId()},ke.useImperativeHandle=function(L,U,Y){return z.H.useImperativeHandle(L,U,Y)},ke.useInsertionEffect=function(L,U){return z.H.useInsertionEffect(L,U)},ke.useLayoutEffect=function(L,U){return z.H.useLayoutEffect(L,U)},ke.useMemo=function(L,U){return z.H.useMemo(L,U)},ke.useOptimistic=function(L,U){return z.H.useOptimistic(L,U)},ke.useReducer=function(L,U,Y){return z.H.useReducer(L,U,Y)},ke.useRef=function(L){return z.H.useRef(L)},ke.useState=function(L){return z.H.useState(L)},ke.useSyncExternalStore=function(L,U,Y){return z.H.useSyncExternalStore(L,U,Y)},ke.useTransition=function(){return z.H.useTransition()},ke.version="19.2.8",ke}var ab;function Tm(){return ab||(ab=1,ph.exports=S2()),ph.exports}var h=Tm();const me=Rm(h),Gl=b2({__proto__:null,default:me},[h]);var gh={exports:{}},Jo={},vh={exports:{}},xh={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var rb;function C2(){return rb||(rb=1,(function(n){function a(_,q){var W=_.length;_.push(q);e:for(;0<W;){var Q=W-1>>>1,te=_[Q];if(0<c(te,q))_[Q]=q,_[W]=te,W=Q;else break e}}function l(_){return _.length===0?null:_[0]}function o(_){if(_.length===0)return null;var q=_[0],W=_.pop();if(W!==q){_[0]=W;e:for(var Q=0,te=_.length,L=te>>>1;Q<L;){var U=2*(Q+1)-1,Y=_[U],ae=U+1,ge=_[ae];if(0>c(Y,W))ae<te&&0>c(ge,Y)?(_[Q]=ge,_[ae]=W,Q=ae):(_[Q]=Y,_[U]=W,Q=U);else if(ae<te&&0>c(ge,W))_[Q]=ge,_[ae]=W,Q=ae;else break e}}return q}function c(_,q){var W=_.sortIndex-q.sortIndex;return W!==0?W:_.id-q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var g=[],v=[],x=1,y=null,b=3,w=!1,N=!1,S=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function M(_){for(var q=l(v);q!==null;){if(q.callback===null)o(v);else if(q.startTime<=_)o(v),q.sortIndex=q.expirationTime,a(g,q);else break;q=l(v)}}function O(_){if(S=!1,M(_),!N)if(l(g)!==null)N=!0,E||(E=!0,V());else{var q=l(v);q!==null&&H(O,q.startTime-_)}}var E=!1,z=-1,k=5,P=-1;function Z(){return C?!0:!(n.unstable_now()-P<k)}function ee(){if(C=!1,E){var _=n.unstable_now();P=_;var q=!0;try{e:{N=!1,S&&(S=!1,D(z),z=-1),w=!0;var W=b;try{t:{for(M(_),y=l(g);y!==null&&!(y.expirationTime>_&&Z());){var Q=y.callback;if(typeof Q=="function"){y.callback=null,b=y.priorityLevel;var te=Q(y.expirationTime<=_);if(_=n.unstable_now(),typeof te=="function"){y.callback=te,M(_),q=!0;break t}y===l(g)&&o(g),M(_)}else o(g);y=l(g)}if(y!==null)q=!0;else{var L=l(v);L!==null&&H(O,L.startTime-_),q=!1}}break e}finally{y=null,b=W,w=!1}q=void 0}}finally{q?V():E=!1}}}var V;if(typeof A=="function")V=function(){A(ee)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,se=ce.port2;ce.port1.onmessage=ee,V=function(){se.postMessage(null)}}else V=function(){R(ee,0)};function H(_,q){z=R(function(){_(n.unstable_now())},q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(_){_.callback=null},n.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<_?Math.floor(1e3/_):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(_){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var W=b;b=q;try{return _()}finally{b=W}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(_,q){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var W=b;b=_;try{return q()}finally{b=W}},n.unstable_scheduleCallback=function(_,q,W){var Q=n.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Q+W:Q):W=Q,_){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=W+te,_={id:x++,callback:q,priorityLevel:_,startTime:W,expirationTime:te,sortIndex:-1},W>Q?(_.sortIndex=W,a(v,_),l(g)===null&&_===l(v)&&(S?(D(z),z=-1):S=!0,H(O,W-Q))):(_.sortIndex=te,a(g,_),N||w||(N=!0,E||(E=!0,V()))),_},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(_){var q=b;return function(){var W=b;b=q;try{return _.apply(this,arguments)}finally{b=W}}}})(xh)),xh}var sb;function N2(){return sb||(sb=1,vh.exports=C2()),vh.exports}var yh={exports:{}},vn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var lb;function E2(){if(lb)return vn;lb=1;var n=Tm();function a(g){var v="https://react.dev/errors/"+g;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)v+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+g+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var o={d:{f:l,r:function(){throw Error(a(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},c=Symbol.for("react.portal");function u(g,v,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:y==null?null:""+y,children:g,containerInfo:v,implementation:x}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return vn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,vn.createPortal=function(g,v){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(a(299));return u(g,v,null,x)},vn.flushSync=function(g){var v=f.T,x=o.p;try{if(f.T=null,o.p=2,g)return g()}finally{f.T=v,o.p=x,o.d.f()}},vn.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,o.d.C(g,v))},vn.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},vn.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin),b=typeof v.integrity=="string"?v.integrity:void 0,w=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;x==="style"?o.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:w}):x==="script"&&o.d.X(g,{crossOrigin:y,integrity:b,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},vn.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var x=p(v.as,v.crossOrigin);o.d.M(g,{crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&o.d.M(g)},vn.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin);o.d.L(g,x,{crossOrigin:y,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},vn.preloadModule=function(g,v){if(typeof g=="string")if(v){var x=p(v.as,v.crossOrigin);o.d.m(g,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else o.d.m(g)},vn.requestFormReset=function(g){o.d.r(g)},vn.unstable_batchedUpdates=function(g,v){return g(v)},vn.useFormState=function(g,v,x){return f.H.useFormState(g,v,x)},vn.useFormStatus=function(){return f.H.useHostTransitionStatus()},vn.version="19.2.8",vn}var ob;function g0(){if(ob)return yh.exports;ob=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),yh.exports=E2(),yh.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var ib;function R2(){if(ib)return Jo;ib=1;var n=N2(),a=Tm(),l=g0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(o(188))}function v(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(o(188));return t!==e?null:e}for(var r=e,i=t;;){var d=r.return;if(d===null)break;var m=d.alternate;if(m===null){if(i=d.return,i!==null){r=i;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===r)return g(d),e;if(m===i)return g(d),t;m=m.sibling}throw Error(o(188))}if(r.return!==i.return)r=d,i=m;else{for(var j=!1,T=d.child;T;){if(T===r){j=!0,r=d,i=m;break}if(T===i){j=!0,i=d,r=m;break}T=T.sibling}if(!j){for(T=m.child;T;){if(T===r){j=!0,r=m,i=d;break}if(T===i){j=!0,i=m,r=d;break}T=T.sibling}if(!j)throw Error(o(189))}}if(r.alternate!==i)throw Error(o(190))}if(r.tag!==3)throw Error(o(188));return r.stateNode.current===r?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),A=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function V(e){return e===null||typeof e!="object"?null:(e=ee&&e[ee]||e["@@iterator"],typeof e=="function"?e:null)}var ce=Symbol.for("react.client.reference");function se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case R:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case E:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case A:return e.displayName||"Context";case D:return(e._context.displayName||"Context")+".Consumer";case M:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:se(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var H=Array.isArray,_=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},Q=[],te=-1;function L(e){return{current:e}}function U(e){0>te||(e.current=Q[te],Q[te]=null,te--)}function Y(e,t){te++,Q[te]=e.current,e.current=t}var ae=L(null),ge=L(null),ye=L(null),G=L(null);function ue(e,t){switch(Y(ye,t),Y(ge,e),Y(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?by(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=by(t),e=wy(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(ae),Y(ae,e)}function he(){U(ae),U(ge),U(ye)}function xe(e){e.memoizedState!==null&&Y(G,e);var t=ae.current,r=wy(t,e.type);t!==r&&(Y(ge,e),Y(ae,r))}function Ae(e){ge.current===e&&(U(ae),U(ge)),G.current===e&&(U(G),Fo._currentValue=W)}var Ne,Oe;function Qe(e){if(Ne===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||"",Oe=-1<r.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ne+e+Oe}var et=!1;function ie(e,t){if(!e||et)return"";et=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(J){var K=J}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(J){K=J}e.call(oe.prototype)}}else{try{throw Error()}catch(J){K=J}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(J){if(J&&K&&typeof J.stack=="string")return[J.stack,K.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=i.DetermineComponentFrameRoot(),j=m[0],T=m[1];if(j&&T){var I=j.split(`
|
|
44
|
-
`),X=T.split(`
|
|
45
|
-
`);for(d=i=0;i<I.length&&!I[i].includes("DetermineComponentFrameRoot");)i++;for(;d<X.length&&!X[d].includes("DetermineComponentFrameRoot");)d++;if(i===I.length||d===X.length)for(i=I.length-1,d=X.length-1;1<=i&&0<=d&&I[i]!==X[d];)d--;for(;1<=i&&0<=d;i--,d--)if(I[i]!==X[d]){if(i!==1||d!==1)do if(i--,d--,0>d||I[i]!==X[d]){var ne=`
|
|
46
|
-
`+I[i].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=i&&0<=d);break}}}finally{et=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Qe(r):""}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return Qe(e.type);case 16:return Qe("Lazy");case 13:return e.child!==t&&t!==null?Qe("Suspense Fallback"):Qe("Suspense");case 19:return Qe("SuspenseList");case 0:case 15:return ie(e.type,!1);case 11:return ie(e.type.render,!1);case 1:return ie(e.type,!0);case 31:return Qe("Activity");default:return""}}function qe(e){try{var t="",r=null;do t+=Le(e,r),r=e,e=e.return;while(e);return t}catch(i){return`
|
|
47
|
-
Error generating stack: `+i.message+`
|
|
48
|
-
`+i.stack}}var _t=Object.prototype.hasOwnProperty,St=n.unstable_scheduleCallback,Wt=n.unstable_cancelCallback,mn=n.unstable_shouldYield,en=n.unstable_requestPaint,Ct=n.unstable_now,xn=n.unstable_getCurrentPriorityLevel,At=n.unstable_ImmediatePriority,Mt=n.unstable_UserBlockingPriority,pn=n.unstable_NormalPriority,pa=n.unstable_LowPriority,Aa=n.unstable_IdlePriority,Wn=n.log,ms=n.unstable_setDisableYieldValue,ga=null,Dt=null;function yn(e){if(typeof Wn=="function"&&ms(e),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(ga,e)}catch{}}var Tt=Math.clz32?Math.clz32:Xs,lo=Math.log,Fs=Math.LN2;function Xs(e){return e>>>=0,e===0?32:31-(lo(e)/Fs|0)|0}var Ga=256,Ar=262144,xt=4194304;function at(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function It(e,t,r){var i=e.pendingLanes;if(i===0)return 0;var d=0,m=e.suspendedLanes,j=e.pingedLanes;e=e.warmLanes;var T=i&134217727;return T!==0?(i=T&~m,i!==0?d=at(i):(j&=T,j!==0?d=at(j):r||(r=T&~e,r!==0&&(d=at(r))))):(T=i&~m,T!==0?d=at(T):j!==0?d=at(j):r||(r=i&~e,r!==0&&(d=at(r)))),d===0?0:t!==0&&t!==d&&(t&m)===0&&(m=d&-d,r=t&-t,m>=r||m===32&&(r&4194048)!==0)?t:d}function Re(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _e(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(){var e=xt;return xt<<=1,(xt&62914560)===0&&(xt=4194304),e}function vt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(e,t,r,i,d,m){var j=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var T=e.entanglements,I=e.expirationTimes,X=e.hiddenUpdates;for(r=j&~r;0<r;){var ne=31-Tt(r),oe=1<<ne;T[ne]=0,I[ne]=-1;var K=X[ne];if(K!==null)for(X[ne]=null,ne=0;ne<K.length;ne++){var J=K[ne];J!==null&&(J.lane&=-536870913)}r&=~oe}i!==0&&Gt(e,i,0),m!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=m&~(j&~t))}function Gt(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Tt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|r&261930}function yt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Tt(r),d=1<<i;d&t|e[i]&t&&(e[i]|=t),r&=~d}}function zt(e,t){var r=t&-t;return r=(r&42)!==0?1:Ya(r),(r&(e.suspendedLanes|t))!==0?0:r}function Ya(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Fa(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function va(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:Vy(e.type))}function Mr(e,t){var r=q.p;try{return q.p=e,t()}finally{q.p=r}}var ea=Math.random().toString(36).slice(2),on="__reactFiber$"+ea,Cn="__reactProps$"+ea,Ks="__reactContainer$"+ea,ad="__reactEvents$"+ea,cS="__reactListeners$"+ea,uS="__reactHandles$"+ea,og="__reactResources$"+ea,oo="__reactMarker$"+ea;function rd(e){delete e[on],delete e[Cn],delete e[ad],delete e[cS],delete e[uS]}function Qs(e){var t=e[on];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ks]||r[on]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ty(e);e!==null;){if(r=e[on])return r;e=Ty(e)}return t}e=r,r=e.parentNode}return null}function Zs(e){if(e=e[on]||e[Ks]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function io(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Js(e){var t=e[og];return t||(t=e[og]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function tn(e){e[oo]=!0}var ig=new Set,cg={};function ps(e,t){Ws(e,t),Ws(e+"Capture",t)}function Ws(e,t){for(cg[e]=t,e=0;e<t.length;e++)ig.add(t[e])}var dS=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ug={},dg={};function fS(e){return _t.call(dg,e)?!0:_t.call(ug,e)?!1:dS.test(e)?dg[e]=!0:(ug[e]=!0,!1)}function Di(e,t,r){if(fS(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function Oi(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function Xa(e,t,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+i)}}function ta(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hS(e,t,r){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,m=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(j){r=""+j,m.call(this,j)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(j){r=""+j},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sd(e){if(!e._valueTracker){var t=fg(e)?"checked":"value";e._valueTracker=hS(e,t,""+e[t])}}function hg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=fg(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function ki(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var mS=/[\n"\\]/g;function na(e){return e.replace(mS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ld(e,t,r,i,d,m,j,T){e.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.type=j:e.removeAttribute("type"),t!=null?j==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ta(t)):e.value!==""+ta(t)&&(e.value=""+ta(t)):j!=="submit"&&j!=="reset"||e.removeAttribute("value"),t!=null?od(e,j,ta(t)):r!=null?od(e,j,ta(r)):i!=null&&e.removeAttribute("value"),d==null&&m!=null&&(e.defaultChecked=!!m),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+ta(T):e.removeAttribute("name")}function mg(e,t,r,i,d,m,j,T){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),t!=null||r!=null){if(!(m!=="submit"&&m!=="reset"||t!=null)){sd(e);return}r=r!=null?""+ta(r):"",t=t!=null?""+ta(t):r,T||t===e.value||(e.value=t),e.defaultValue=t}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=T?e.checked:!!i,e.defaultChecked=!!i,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(e.name=j),sd(e)}function od(e,t,r){t==="number"&&ki(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function el(e,t,r,i){if(e=e.options,t){t={};for(var d=0;d<r.length;d++)t["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=t.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&i&&(e[r].defaultSelected=!0)}else{for(r=""+ta(r),t=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function pg(e,t,r){if(t!=null&&(t=""+ta(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+ta(r):""}function gg(e,t,r,i){if(t==null){if(i!=null){if(r!=null)throw Error(o(92));if(H(i)){if(1<i.length)throw Error(o(93));i=i[0]}r=i}r==null&&(r=""),t=r}r=ta(t),e.defaultValue=r,i=e.textContent,i===r&&i!==""&&i!==null&&(e.value=i),sd(e)}function tl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var pS=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function vg(e,t,r){var i=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,r):typeof r!="number"||r===0||pS.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function xg(e,t,r){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,r!=null){for(var i in r)!r.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var d in t)i=t[d],t.hasOwnProperty(d)&&r[d]!==i&&vg(e,d,i)}else for(var m in t)t.hasOwnProperty(m)&&vg(e,m,t[m])}function id(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 gS=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"]]),vS=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function _i(e){return vS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ka(){}var cd=null;function ud(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nl=null,al=null;function yg(e){var t=Zs(e);if(t&&(e=t.stateNode)){var r=e[Cn]||null;e:switch(e=t.stateNode,t.type){case"input":if(ld(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+na(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var d=i[Cn]||null;if(!d)throw Error(o(90));ld(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<r.length;t++)i=r[t],i.form===e.form&&hg(i)}break e;case"textarea":pg(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&el(e,!!r.multiple,t,!1)}}}var dd=!1;function bg(e,t,r){if(dd)return e(t,r);dd=!0;try{var i=e(t);return i}finally{if(dd=!1,(nl!==null||al!==null)&&(wc(),nl&&(t=nl,e=al,al=nl=null,yg(t),e)))for(t=0;t<e.length;t++)yg(e[t])}}function co(e,t){var r=e.stateNode;if(r===null)return null;var i=r[Cn]||null;if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(o(231,t,typeof r));return r}var Qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fd=!1;if(Qa)try{var uo={};Object.defineProperty(uo,"passive",{get:function(){fd=!0}}),window.addEventListener("test",uo,uo),window.removeEventListener("test",uo,uo)}catch{fd=!1}var Dr=null,hd=null,zi=null;function wg(){if(zi)return zi;var e,t=hd,r=t.length,i,d="value"in Dr?Dr.value:Dr.textContent,m=d.length;for(e=0;e<r&&t[e]===d[e];e++);var j=r-e;for(i=1;i<=j&&t[r-i]===d[m-i];i++);return zi=d.slice(e,1<i?1-i:void 0)}function Li(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ui(){return!0}function jg(){return!1}function Nn(e){function t(r,i,d,m,j){this._reactName=r,this._targetInst=d,this.type=i,this.nativeEvent=m,this.target=j,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(r=e[T],this[T]=r?r(m):m[T]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Ui:jg,this.isPropagationStopped=jg,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ui)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ui)},persist:function(){},isPersistent:Ui}),t}var gs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ii=Nn(gs),fo=y({},gs,{view:0,detail:0}),xS=Nn(fo),md,pd,ho,Pi=y({},fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ho&&(ho&&e.type==="mousemove"?(md=e.screenX-ho.screenX,pd=e.screenY-ho.screenY):pd=md=0,ho=e),md)},movementY:function(e){return"movementY"in e?e.movementY:pd}}),Sg=Nn(Pi),yS=y({},Pi,{dataTransfer:0}),bS=Nn(yS),wS=y({},fo,{relatedTarget:0}),gd=Nn(wS),jS=y({},gs,{animationName:0,elapsedTime:0,pseudoElement:0}),SS=Nn(jS),CS=y({},gs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),NS=Nn(CS),ES=y({},gs,{data:0}),Cg=Nn(ES),RS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TS={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"},AS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function MS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=AS[e])?!!t[e]:!1}function vd(){return MS}var DS=y({},fo,{key:function(e){if(e.key){var t=RS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Li(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?TS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vd,charCode:function(e){return e.type==="keypress"?Li(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Li(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),OS=Nn(DS),kS=y({},Pi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ng=Nn(kS),_S=y({},fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vd}),zS=Nn(_S),LS=y({},gs,{propertyName:0,elapsedTime:0,pseudoElement:0}),US=Nn(LS),IS=y({},Pi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),PS=Nn(IS),BS=y({},gs,{newState:0,oldState:0}),HS=Nn(BS),qS=[9,13,27,32],xd=Qa&&"CompositionEvent"in window,mo=null;Qa&&"documentMode"in document&&(mo=document.documentMode);var $S=Qa&&"TextEvent"in window&&!mo,Eg=Qa&&(!xd||mo&&8<mo&&11>=mo),Rg=" ",Tg=!1;function Ag(e,t){switch(e){case"keyup":return qS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rl=!1;function VS(e,t){switch(e){case"compositionend":return Mg(t);case"keypress":return t.which!==32?null:(Tg=!0,Rg);case"textInput":return e=t.data,e===Rg&&Tg?null:e;default:return null}}function GS(e,t){if(rl)return e==="compositionend"||!xd&&Ag(e,t)?(e=wg(),zi=hd=Dr=null,rl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Eg&&t.locale!=="ko"?null:t.data;default:return null}}var YS={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"?!!YS[e.type]:t==="textarea"}function Og(e,t,r,i){nl?al?al.push(i):al=[i]:nl=i,t=Tc(t,"onChange"),0<t.length&&(r=new Ii("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var po=null,go=null;function FS(e){my(e,0)}function Bi(e){var t=io(e);if(hg(t))return e}function kg(e,t){if(e==="change")return t}var _g=!1;if(Qa){var yd;if(Qa){var bd="oninput"in document;if(!bd){var zg=document.createElement("div");zg.setAttribute("oninput","return;"),bd=typeof zg.oninput=="function"}yd=bd}else yd=!1;_g=yd&&(!document.documentMode||9<document.documentMode)}function Lg(){po&&(po.detachEvent("onpropertychange",Ug),go=po=null)}function Ug(e){if(e.propertyName==="value"&&Bi(go)){var t=[];Og(t,go,e,ud(e)),bg(FS,t)}}function XS(e,t,r){e==="focusin"?(Lg(),po=t,go=r,po.attachEvent("onpropertychange",Ug)):e==="focusout"&&Lg()}function KS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bi(go)}function QS(e,t){if(e==="click")return Bi(t)}function ZS(e,t){if(e==="input"||e==="change")return Bi(t)}function JS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $n=typeof Object.is=="function"?Object.is:JS;function vo(e,t){if($n(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var d=r[i];if(!_t.call(t,d)||!$n(e[d],t[d]))return!1}return!0}function Ig(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pg(e,t){var r=Ig(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ig(r)}}function Bg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ki(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ki(e.document)}return t}function wd(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 WS=Qa&&"documentMode"in document&&11>=document.documentMode,sl=null,jd=null,xo=null,Sd=!1;function qg(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sd||sl==null||sl!==ki(i)||(i=sl,"selectionStart"in i&&wd(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),xo&&vo(xo,i)||(xo=i,i=Tc(jd,"onSelect"),0<i.length&&(t=new Ii("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=sl)))}function vs(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ll={animationend:vs("Animation","AnimationEnd"),animationiteration:vs("Animation","AnimationIteration"),animationstart:vs("Animation","AnimationStart"),transitionrun:vs("Transition","TransitionRun"),transitionstart:vs("Transition","TransitionStart"),transitioncancel:vs("Transition","TransitionCancel"),transitionend:vs("Transition","TransitionEnd")},Cd={},$g={};Qa&&($g=document.createElement("div").style,"AnimationEvent"in window||(delete ll.animationend.animation,delete ll.animationiteration.animation,delete ll.animationstart.animation),"TransitionEvent"in window||delete ll.transitionend.transition);function xs(e){if(Cd[e])return Cd[e];if(!ll[e])return e;var t=ll[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in $g)return Cd[e]=t[r];return e}var Vg=xs("animationend"),Gg=xs("animationiteration"),Yg=xs("animationstart"),eC=xs("transitionrun"),tC=xs("transitionstart"),nC=xs("transitioncancel"),Fg=xs("transitionend"),Xg=new Map,Nd="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(" ");Nd.push("scrollEnd");function xa(e,t){Xg.set(e,t),ps(t,[e])}var Hi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},aa=[],ol=0,Ed=0;function qi(){for(var e=ol,t=Ed=ol=0;t<e;){var r=aa[t];aa[t++]=null;var i=aa[t];aa[t++]=null;var d=aa[t];aa[t++]=null;var m=aa[t];if(aa[t++]=null,i!==null&&d!==null){var j=i.pending;j===null?d.next=d:(d.next=j.next,j.next=d),i.pending=d}m!==0&&Kg(r,d,m)}}function $i(e,t,r,i){aa[ol++]=e,aa[ol++]=t,aa[ol++]=r,aa[ol++]=i,Ed|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Rd(e,t,r,i){return $i(e,t,r,i),Vi(e)}function ys(e,t){return $i(e,null,null,t),Vi(e)}function Kg(e,t,r){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r);for(var d=!1,m=e.return;m!==null;)m.childLanes|=r,i=m.alternate,i!==null&&(i.childLanes|=r),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(d=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,d&&t!==null&&(d=31-Tt(r),e=m.hiddenUpdates,i=e[d],i===null?e[d]=[t]:i.push(t),t.lane=r|536870912),m):null}function Vi(e){if(50<Bo)throw Bo=0,Uf=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var il={};function aC(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vn(e,t,r,i){return new aC(e,t,r,i)}function Td(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Za(e,t){var r=e.alternate;return r===null?(r=Vn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Qg(e,t){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Gi(e,t,r,i,d,m){var j=0;if(i=e,typeof e=="function")Td(e)&&(j=1);else if(typeof e=="string")j=i2(e,r,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=Vn(31,r,t,d),e.elementType=P,e.lanes=m,e;case S:return bs(r.children,d,m,t);case C:j=8,d|=24;break;case R:return e=Vn(12,r,t,d|2),e.elementType=R,e.lanes=m,e;case O:return e=Vn(13,r,t,d),e.elementType=O,e.lanes=m,e;case E:return e=Vn(19,r,t,d),e.elementType=E,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:j=10;break e;case D:j=9;break e;case M:j=11;break e;case z:j=14;break e;case k:j=16,i=null;break e}j=29,r=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=Vn(j,r,t,d),t.elementType=e,t.type=i,t.lanes=m,t}function bs(e,t,r,i){return e=Vn(7,e,i,t),e.lanes=r,e}function Ad(e,t,r){return e=Vn(6,e,null,t),e.lanes=r,e}function Zg(e){var t=Vn(18,null,null,0);return t.stateNode=e,t}function Md(e,t,r){return t=Vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Jg=new WeakMap;function ra(e,t){if(typeof e=="object"&&e!==null){var r=Jg.get(e);return r!==void 0?r:(t={value:e,source:t,stack:qe(t)},Jg.set(e,t),t)}return{value:e,source:t,stack:qe(t)}}var cl=[],ul=0,Yi=null,yo=0,sa=[],la=0,Or=null,Ma=1,Da="";function Ja(e,t){cl[ul++]=yo,cl[ul++]=Yi,Yi=e,yo=t}function Wg(e,t,r){sa[la++]=Ma,sa[la++]=Da,sa[la++]=Or,Or=e;var i=Ma;e=Da;var d=32-Tt(i)-1;i&=~(1<<d),r+=1;var m=32-Tt(t)+d;if(30<m){var j=d-d%5;m=(i&(1<<j)-1).toString(32),i>>=j,d-=j,Ma=1<<32-Tt(t)+d|r<<d|i,Da=m+e}else Ma=1<<m|r<<d|i,Da=e}function Dd(e){e.return!==null&&(Ja(e,1),Wg(e,1,0))}function Od(e){for(;e===Yi;)Yi=cl[--ul],cl[ul]=null,yo=cl[--ul],cl[ul]=null;for(;e===Or;)Or=sa[--la],sa[la]=null,Da=sa[--la],sa[la]=null,Ma=sa[--la],sa[la]=null}function ev(e,t){sa[la++]=Ma,sa[la++]=Da,sa[la++]=Or,Ma=t.id,Da=t.overflow,Or=e}var cn=null,bt=null,Xe=!1,kr=null,oa=!1,kd=Error(o(519));function _r(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bo(ra(t,e)),kd}function tv(e){var t=e.stateNode,r=e.type,i=e.memoizedProps;switch(t[on]=e,t[Cn]=i,r){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(r=0;r<qo.length;r++)Ve(qo[r],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),mg(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),gg(t,i.value,i.defaultValue,i.children)}r=i.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||i.suppressHydrationWarning===!0||xy(t.textContent,r)?(i.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),i.onScroll!=null&&Ve("scroll",t),i.onScrollEnd!=null&&Ve("scrollend",t),i.onClick!=null&&(t.onclick=Ka),t=!0):t=!1,t||_r(e,!0)}function nv(e){for(cn=e.return;cn;)switch(cn.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:cn=cn.return}}function dl(e){if(e!==cn)return!1;if(!Xe)return nv(e),Xe=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Jf(e.type,e.memoizedProps)),r=!r),r&&bt&&_r(e),nv(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));bt=Ry(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));bt=Ry(e)}else t===27?(t=bt,Xr(e.type)?(e=ah,ah=null,bt=e):bt=t):bt=cn?ca(e.stateNode.nextSibling):null;return!0}function ws(){bt=cn=null,Xe=!1}function _d(){var e=kr;return e!==null&&(An===null?An=e:An.push.apply(An,e),kr=null),e}function bo(e){kr===null?kr=[e]:kr.push(e)}var zd=L(null),js=null,Wa=null;function zr(e,t,r){Y(zd,t._currentValue),t._currentValue=r}function er(e){e._currentValue=zd.current,U(zd)}function Ld(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 Ud(e,t,r,i){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var m=d.dependencies;if(m!==null){var j=d.child;m=m.firstContext;e:for(;m!==null;){var T=m;m=d;for(var I=0;I<t.length;I++)if(T.context===t[I]){m.lanes|=r,T=m.alternate,T!==null&&(T.lanes|=r),Ld(m.return,r,e),i||(j=null);break e}m=T.next}}else if(d.tag===18){if(j=d.return,j===null)throw Error(o(341));j.lanes|=r,m=j.alternate,m!==null&&(m.lanes|=r),Ld(j,r,e),j=null}else j=d.child;if(j!==null)j.return=d;else for(j=d;j!==null;){if(j===e){j=null;break}if(d=j.sibling,d!==null){d.return=j.return,j=d;break}j=j.return}d=j}}function fl(e,t,r,i){e=null;for(var d=t,m=!1;d!==null;){if(!m){if((d.flags&524288)!==0)m=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var j=d.alternate;if(j===null)throw Error(o(387));if(j=j.memoizedProps,j!==null){var T=d.type;$n(d.pendingProps.value,j.value)||(e!==null?e.push(T):e=[T])}}else if(d===G.current){if(j=d.alternate,j===null)throw Error(o(387));j.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Fo):e=[Fo])}d=d.return}e!==null&&Ud(t,e,r,i),t.flags|=262144}function Fi(e){for(e=e.firstContext;e!==null;){if(!$n(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ss(e){js=e,Wa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function un(e){return av(js,e)}function Xi(e,t){return js===null&&Ss(e),av(e,t)}function av(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},Wa===null){if(e===null)throw Error(o(308));Wa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wa=Wa.next=t;return r}var rC=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()})}},sC=n.unstable_scheduleCallback,lC=n.unstable_NormalPriority,Pt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Id(){return{controller:new rC,data:new Map,refCount:0}}function wo(e){e.refCount--,e.refCount===0&&sC(lC,function(){e.controller.abort()})}var jo=null,Pd=0,hl=0,ml=null;function oC(e,t){if(jo===null){var r=jo=[];Pd=0,hl=$f(),ml={status:"pending",value:void 0,then:function(i){r.push(i)}}}return Pd++,t.then(rv,rv),t}function rv(){if(--Pd===0&&jo!==null){ml!==null&&(ml.status="fulfilled");var e=jo;jo=null,hl=0,ml=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function iC(e,t){var r=[],i={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var d=0;d<r.length;d++)(0,r[d])(t)},function(d){for(i.status="rejected",i.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),i}var sv=_.S;_.S=function(e,t){qx=Ct(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&oC(e,t),sv!==null&&sv(e,t)};var Cs=L(null);function Bd(){var e=Cs.current;return e!==null?e:pt.pooledCache}function Ki(e,t){t===null?Y(Cs,Cs.current):Y(Cs,t.pool)}function lv(){var e=Bd();return e===null?null:{parent:Pt._currentValue,pool:e}}var pl=Error(o(460)),Hd=Error(o(474)),Qi=Error(o(542)),Zi={then:function(){}};function ov(e){return e=e.status,e==="fulfilled"||e==="rejected"}function iv(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(Ka,Ka),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uv(e),e;default:if(typeof t.status=="string")t.then(Ka,Ka);else{if(e=pt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=i}},function(i){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uv(e),e}throw Es=t,pl}}function Ns(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Es=r,pl):r}}var Es=null;function cv(){if(Es===null)throw Error(o(459));var e=Es;return Es=null,e}function uv(e){if(e===pl||e===Qi)throw Error(o(483))}var gl=null,So=0;function Ji(e){var t=So;return So+=1,gl===null&&(gl=[]),iv(gl,e,t)}function Co(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Wi(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function dv(e){function t($,B){if(e){var F=$.deletions;F===null?($.deletions=[B],$.flags|=16):F.push(B)}}function r($,B){if(!e)return null;for(;B!==null;)t($,B),B=B.sibling;return null}function i($){for(var B=new Map;$!==null;)$.key!==null?B.set($.key,$):B.set($.index,$),$=$.sibling;return B}function d($,B){return $=Za($,B),$.index=0,$.sibling=null,$}function m($,B,F){return $.index=F,e?(F=$.alternate,F!==null?(F=F.index,F<B?($.flags|=67108866,B):F):($.flags|=67108866,B)):($.flags|=1048576,B)}function j($){return e&&$.alternate===null&&($.flags|=67108866),$}function T($,B,F,re){return B===null||B.tag!==6?(B=Ad(F,$.mode,re),B.return=$,B):(B=d(B,F),B.return=$,B)}function I($,B,F,re){var Te=F.type;return Te===S?ne($,B,F.props.children,re,F.key):B!==null&&(B.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===k&&Ns(Te)===B.type)?(B=d(B,F.props),Co(B,F),B.return=$,B):(B=Gi(F.type,F.key,F.props,null,$.mode,re),Co(B,F),B.return=$,B)}function X($,B,F,re){return B===null||B.tag!==4||B.stateNode.containerInfo!==F.containerInfo||B.stateNode.implementation!==F.implementation?(B=Md(F,$.mode,re),B.return=$,B):(B=d(B,F.children||[]),B.return=$,B)}function ne($,B,F,re,Te){return B===null||B.tag!==7?(B=bs(F,$.mode,re,Te),B.return=$,B):(B=d(B,F),B.return=$,B)}function oe($,B,F){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Ad(""+B,$.mode,F),B.return=$,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return F=Gi(B.type,B.key,B.props,null,$.mode,F),Co(F,B),F.return=$,F;case N:return B=Md(B,$.mode,F),B.return=$,B;case k:return B=Ns(B),oe($,B,F)}if(H(B)||V(B))return B=bs(B,$.mode,F,null),B.return=$,B;if(typeof B.then=="function")return oe($,Ji(B),F);if(B.$$typeof===A)return oe($,Xi($,B),F);Wi($,B)}return null}function K($,B,F,re){var Te=B!==null?B.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Te!==null?null:T($,B,""+F,re);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case w:return F.key===Te?I($,B,F,re):null;case N:return F.key===Te?X($,B,F,re):null;case k:return F=Ns(F),K($,B,F,re)}if(H(F)||V(F))return Te!==null?null:ne($,B,F,re,null);if(typeof F.then=="function")return K($,B,Ji(F),re);if(F.$$typeof===A)return K($,B,Xi($,F),re);Wi($,F)}return null}function J($,B,F,re,Te){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return $=$.get(F)||null,T(B,$,""+re,Te);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case w:return $=$.get(re.key===null?F:re.key)||null,I(B,$,re,Te);case N:return $=$.get(re.key===null?F:re.key)||null,X(B,$,re,Te);case k:return re=Ns(re),J($,B,F,re,Te)}if(H(re)||V(re))return $=$.get(F)||null,ne(B,$,re,Te,null);if(typeof re.then=="function")return J($,B,F,Ji(re),Te);if(re.$$typeof===A)return J($,B,F,Xi(B,re),Te);Wi(B,re)}return null}function we($,B,F,re){for(var Te=null,Ze=null,je=B,Ie=B=0,Ye=null;je!==null&&Ie<F.length;Ie++){je.index>Ie?(Ye=je,je=null):Ye=je.sibling;var Je=K($,je,F[Ie],re);if(Je===null){je===null&&(je=Ye);break}e&&je&&Je.alternate===null&&t($,je),B=m(Je,B,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je,je=Ye}if(Ie===F.length)return r($,je),Xe&&Ja($,Ie),Te;if(je===null){for(;Ie<F.length;Ie++)je=oe($,F[Ie],re),je!==null&&(B=m(je,B,Ie),Ze===null?Te=je:Ze.sibling=je,Ze=je);return Xe&&Ja($,Ie),Te}for(je=i(je);Ie<F.length;Ie++)Ye=J(je,$,Ie,F[Ie],re),Ye!==null&&(e&&Ye.alternate!==null&&je.delete(Ye.key===null?Ie:Ye.key),B=m(Ye,B,Ie),Ze===null?Te=Ye:Ze.sibling=Ye,Ze=Ye);return e&&je.forEach(function(Wr){return t($,Wr)}),Xe&&Ja($,Ie),Te}function De($,B,F,re){if(F==null)throw Error(o(151));for(var Te=null,Ze=null,je=B,Ie=B=0,Ye=null,Je=F.next();je!==null&&!Je.done;Ie++,Je=F.next()){je.index>Ie?(Ye=je,je=null):Ye=je.sibling;var Wr=K($,je,Je.value,re);if(Wr===null){je===null&&(je=Ye);break}e&&je&&Wr.alternate===null&&t($,je),B=m(Wr,B,Ie),Ze===null?Te=Wr:Ze.sibling=Wr,Ze=Wr,je=Ye}if(Je.done)return r($,je),Xe&&Ja($,Ie),Te;if(je===null){for(;!Je.done;Ie++,Je=F.next())Je=oe($,Je.value,re),Je!==null&&(B=m(Je,B,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je);return Xe&&Ja($,Ie),Te}for(je=i(je);!Je.done;Ie++,Je=F.next())Je=J(je,$,Ie,Je.value,re),Je!==null&&(e&&Je.alternate!==null&&je.delete(Je.key===null?Ie:Je.key),B=m(Je,B,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je);return e&&je.forEach(function(y2){return t($,y2)}),Xe&&Ja($,Ie),Te}function ht($,B,F,re){if(typeof F=="object"&&F!==null&&F.type===S&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case w:e:{for(var Te=F.key;B!==null;){if(B.key===Te){if(Te=F.type,Te===S){if(B.tag===7){r($,B.sibling),re=d(B,F.props.children),re.return=$,$=re;break e}}else if(B.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===k&&Ns(Te)===B.type){r($,B.sibling),re=d(B,F.props),Co(re,F),re.return=$,$=re;break e}r($,B);break}else t($,B);B=B.sibling}F.type===S?(re=bs(F.props.children,$.mode,re,F.key),re.return=$,$=re):(re=Gi(F.type,F.key,F.props,null,$.mode,re),Co(re,F),re.return=$,$=re)}return j($);case N:e:{for(Te=F.key;B!==null;){if(B.key===Te)if(B.tag===4&&B.stateNode.containerInfo===F.containerInfo&&B.stateNode.implementation===F.implementation){r($,B.sibling),re=d(B,F.children||[]),re.return=$,$=re;break e}else{r($,B);break}else t($,B);B=B.sibling}re=Md(F,$.mode,re),re.return=$,$=re}return j($);case k:return F=Ns(F),ht($,B,F,re)}if(H(F))return we($,B,F,re);if(V(F)){if(Te=V(F),typeof Te!="function")throw Error(o(150));return F=Te.call(F),De($,B,F,re)}if(typeof F.then=="function")return ht($,B,Ji(F),re);if(F.$$typeof===A)return ht($,B,Xi($,F),re);Wi($,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,B!==null&&B.tag===6?(r($,B.sibling),re=d(B,F),re.return=$,$=re):(r($,B),re=Ad(F,$.mode,re),re.return=$,$=re),j($)):r($,B)}return function($,B,F,re){try{So=0;var Te=ht($,B,F,re);return gl=null,Te}catch(je){if(je===pl||je===Qi)throw je;var Ze=Vn(29,je,null,$.mode);return Ze.lanes=re,Ze.return=$,Ze}finally{}}}var Rs=dv(!0),fv=dv(!1),Lr=!1;function qd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $d(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ur(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ir(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(tt&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,t=Vi(e),Kg(e,null,r),t}return $i(e,i,t,r),Vi(e)}function No(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,yt(e,r)}}function Vd(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var d=null,m=null;if(r=r.firstBaseUpdate,r!==null){do{var j={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};m===null?d=m=j:m=m.next=j,r=r.next}while(r!==null);m===null?d=m=t:m=m.next=t}else d=m=t;r={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:i.shared,callbacks:i.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Gd=!1;function Eo(){if(Gd){var e=ml;if(e!==null)throw e}}function Ro(e,t,r,i){Gd=!1;var d=e.updateQueue;Lr=!1;var m=d.firstBaseUpdate,j=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var I=T,X=I.next;I.next=null,j===null?m=X:j.next=X,j=I;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,T=ne.lastBaseUpdate,T!==j&&(T===null?ne.firstBaseUpdate=X:T.next=X,ne.lastBaseUpdate=I))}if(m!==null){var oe=d.baseState;j=0,ne=X=I=null,T=m;do{var K=T.lane&-536870913,J=K!==T.lane;if(J?(Ge&K)===K:(i&K)===K){K!==0&&K===hl&&(Gd=!0),ne!==null&&(ne=ne.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var we=e,De=T;K=t;var ht=r;switch(De.tag){case 1:if(we=De.payload,typeof we=="function"){oe=we.call(ht,oe,K);break e}oe=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=De.payload,K=typeof we=="function"?we.call(ht,oe,K):we,K==null)break e;oe=y({},oe,K);break e;case 2:Lr=!0}}K=T.callback,K!==null&&(e.flags|=64,J&&(e.flags|=8192),J=d.callbacks,J===null?d.callbacks=[K]:J.push(K))}else J={lane:K,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ne===null?(X=ne=J,I=oe):ne=ne.next=J,j|=K;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;J=T,T=J.next,J.next=null,d.lastBaseUpdate=J,d.shared.pending=null}}while(!0);ne===null&&(I=oe),d.baseState=I,d.firstBaseUpdate=X,d.lastBaseUpdate=ne,m===null&&(d.shared.lanes=0),$r|=j,e.lanes=j,e.memoizedState=oe}}function hv(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function mv(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)hv(r[e],t)}var vl=L(null),ec=L(0);function pv(e,t){e=cr,Y(ec,e),Y(vl,t),cr=e|t.baseLanes}function Yd(){Y(ec,cr),Y(vl,vl.current)}function Fd(){cr=ec.current,U(vl),U(ec)}var Gn=L(null),ia=null;function Pr(e){var t=e.alternate;Y(Lt,Lt.current&1),Y(Gn,e),ia===null&&(t===null||vl.current!==null||t.memoizedState!==null)&&(ia=e)}function Xd(e){Y(Lt,Lt.current),Y(Gn,e),ia===null&&(ia=e)}function gv(e){e.tag===22?(Y(Lt,Lt.current),Y(Gn,e),ia===null&&(ia=e)):Br()}function Br(){Y(Lt,Lt.current),Y(Gn,Gn.current)}function Yn(e){U(Gn),ia===e&&(ia=null),U(Lt)}var Lt=L(0);function tc(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||th(r)||nh(r)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var tr=0,ze=null,dt=null,Bt=null,nc=!1,xl=!1,Ts=!1,ac=0,To=0,yl=null,cC=0;function Ot(){throw Error(o(321))}function Kd(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!$n(e[r],t[r]))return!1;return!0}function Qd(e,t,r,i,d,m){return tr=m,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_.H=e===null||e.memoizedState===null?Wv:ff,Ts=!1,m=r(i,d),Ts=!1,xl&&(m=xv(t,r,i,d)),vv(e),m}function vv(e){_.H=Do;var t=dt!==null&&dt.next!==null;if(tr=0,Bt=dt=ze=null,nc=!1,To=0,yl=null,t)throw Error(o(300));e===null||Ht||(e=e.dependencies,e!==null&&Fi(e)&&(Ht=!0))}function xv(e,t,r,i){ze=e;var d=0;do{if(xl&&(yl=null),To=0,xl=!1,25<=d)throw Error(o(301));if(d+=1,Bt=dt=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}_.H=ex,m=t(r,i)}while(xl);return m}function uC(){var e=_.H,t=e.useState()[0];return t=typeof t.then=="function"?Ao(t):t,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(ze.flags|=1024),t}function Zd(){var e=ac!==0;return ac=0,e}function Jd(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function Wd(e){if(nc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nc=!1}tr=0,Bt=dt=ze=null,xl=!1,To=ac=0,yl=null}function bn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?ze.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function Ut(){if(dt===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=Bt===null?ze.memoizedState:Bt.next;if(t!==null)Bt=t,dt=e;else{if(e===null)throw ze.alternate===null?Error(o(467)):Error(o(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Bt===null?ze.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function rc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=To;return To+=1,yl===null&&(yl=[]),e=iv(yl,e,t),t=ze,(Bt===null?t.memoizedState:Bt.next)===null&&(t=t.alternate,_.H=t===null||t.memoizedState===null?Wv:ff),e}function sc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ao(e);if(e.$$typeof===A)return un(e)}throw Error(o(438,String(e)))}function ef(e){var t=null,r=ze.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=rc(),ze.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),i=0;i<e;i++)r[i]=Z;return t.index++,r}function nr(e,t){return typeof t=="function"?t(e):t}function lc(e){var t=Ut();return tf(t,dt,e)}function tf(e,t,r){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=r;var d=e.baseQueue,m=i.pending;if(m!==null){if(d!==null){var j=d.next;d.next=m.next,m.next=j}t.baseQueue=d=m,i.pending=null}if(m=e.baseState,d===null)e.memoizedState=m;else{t=d.next;var T=j=null,I=null,X=t,ne=!1;do{var oe=X.lane&-536870913;if(oe!==X.lane?(Ge&oe)===oe:(tr&oe)===oe){var K=X.revertLane;if(K===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),oe===hl&&(ne=!0);else if((tr&K)===K){X=X.next,K===hl&&(ne=!0);continue}else oe={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},I===null?(T=I=oe,j=m):I=I.next=oe,ze.lanes|=K,$r|=K;oe=X.action,Ts&&r(m,oe),m=X.hasEagerState?X.eagerState:r(m,oe)}else K={lane:oe,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},I===null?(T=I=K,j=m):I=I.next=K,ze.lanes|=oe,$r|=oe;X=X.next}while(X!==null&&X!==t);if(I===null?j=m:I.next=T,!$n(m,e.memoizedState)&&(Ht=!0,ne&&(r=ml,r!==null)))throw r;e.memoizedState=m,e.baseState=j,e.baseQueue=I,i.lastRenderedState=m}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function nf(e){var t=Ut(),r=t.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=e;var i=r.dispatch,d=r.pending,m=t.memoizedState;if(d!==null){r.pending=null;var j=d=d.next;do m=e(m,j.action),j=j.next;while(j!==d);$n(m,t.memoizedState)||(Ht=!0),t.memoizedState=m,t.baseQueue===null&&(t.baseState=m),r.lastRenderedState=m}return[m,i]}function yv(e,t,r){var i=ze,d=Ut(),m=Xe;if(m){if(r===void 0)throw Error(o(407));r=r()}else r=t();var j=!$n((dt||d).memoizedState,r);if(j&&(d.memoizedState=r,Ht=!0),d=d.queue,sf(jv.bind(null,i,d,e),[e]),d.getSnapshot!==t||j||Bt!==null&&Bt.memoizedState.tag&1){if(i.flags|=2048,bl(9,{destroy:void 0},wv.bind(null,i,d,r,t),null),pt===null)throw Error(o(349));m||(tr&127)!==0||bv(i,t,r)}return r}function bv(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ze.updateQueue,t===null?(t=rc(),ze.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function wv(e,t,r,i){t.value=r,t.getSnapshot=i,Sv(t)&&Cv(e)}function jv(e,t,r){return r(function(){Sv(t)&&Cv(e)})}function Sv(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!$n(e,r)}catch{return!0}}function Cv(e){var t=ys(e,2);t!==null&&Mn(t,e,2)}function af(e){var t=bn();if(typeof e=="function"){var r=e;if(e=r(),Ts){yn(!0);try{r()}finally{yn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:e},t}function Nv(e,t,r,i){return e.baseState=r,tf(e,dt,typeof i=="function"?i:nr)}function dC(e,t,r,i,d){if(cc(e))throw Error(o(485));if(e=t.action,e!==null){var m={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){m.listeners.push(j)}};_.T!==null?r(!0):m.isTransition=!1,i(m),r=t.pending,r===null?(m.next=t.pending=m,Ev(t,m)):(m.next=r.next,t.pending=r.next=m)}}function Ev(e,t){var r=t.action,i=t.payload,d=e.state;if(t.isTransition){var m=_.T,j={};_.T=j;try{var T=r(d,i),I=_.S;I!==null&&I(j,T),Rv(e,t,T)}catch(X){rf(e,t,X)}finally{m!==null&&j.types!==null&&(m.types=j.types),_.T=m}}else try{m=r(d,i),Rv(e,t,m)}catch(X){rf(e,t,X)}}function Rv(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){Tv(e,t,i)},function(i){return rf(e,t,i)}):Tv(e,t,r)}function Tv(e,t,r){t.status="fulfilled",t.value=r,Av(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,Ev(e,r)))}function rf(e,t,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=r,Av(t),t=t.next;while(t!==i)}e.action=null}function Av(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Mv(e,t){return t}function Dv(e,t){if(Xe){var r=pt.formState;if(r!==null){e:{var i=ze;if(Xe){if(bt){t:{for(var d=bt,m=oa;d.nodeType!==8;){if(!m){d=null;break t}if(d=ca(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){bt=ca(d.nextSibling),i=d.data==="F!";break e}}_r(i)}i=!1}i&&(t=r[0])}}return r=bn(),r.memoizedState=r.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mv,lastRenderedState:t},r.queue=i,r=Qv.bind(null,ze,i),i.dispatch=r,i=af(!1),m=df.bind(null,ze,!1,i.queue),i=bn(),d={state:t,dispatch:null,action:e,pending:null},i.queue=d,r=dC.bind(null,ze,d,m,r),d.dispatch=r,i.memoizedState=e,[t,r,!1]}function Ov(e){var t=Ut();return kv(t,dt,e)}function kv(e,t,r){if(t=tf(e,t,Mv)[0],e=lc(nr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Ao(t)}catch(j){throw j===pl?Qi:j}else i=t;t=Ut();var d=t.queue,m=d.dispatch;return r!==t.memoizedState&&(ze.flags|=2048,bl(9,{destroy:void 0},fC.bind(null,d,r),null)),[i,m,e]}function fC(e,t){e.action=t}function _v(e){var t=Ut(),r=dt;if(r!==null)return kv(t,r,e);Ut(),t=t.memoizedState,r=Ut();var i=r.queue.dispatch;return r.memoizedState=e,[t,i,!1]}function bl(e,t,r,i){return e={tag:e,create:r,deps:i,inst:t,next:null},t=ze.updateQueue,t===null&&(t=rc(),ze.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e),e}function zv(){return Ut().memoizedState}function oc(e,t,r,i){var d=bn();ze.flags|=e,d.memoizedState=bl(1|t,{destroy:void 0},r,i===void 0?null:i)}function ic(e,t,r,i){var d=Ut();i=i===void 0?null:i;var m=d.memoizedState.inst;dt!==null&&i!==null&&Kd(i,dt.memoizedState.deps)?d.memoizedState=bl(t,m,r,i):(ze.flags|=e,d.memoizedState=bl(1|t,m,r,i))}function Lv(e,t){oc(8390656,8,e,t)}function sf(e,t){ic(2048,8,e,t)}function hC(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=rc(),ze.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function Uv(e){var t=Ut().memoizedState;return hC({ref:t,nextImpl:e}),function(){if((tt&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Iv(e,t){return ic(4,2,e,t)}function Pv(e,t){return ic(4,4,e,t)}function Bv(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hv(e,t,r){r=r!=null?r.concat([e]):null,ic(4,4,Bv.bind(null,t,e),r)}function lf(){}function qv(e,t){var r=Ut();t=t===void 0?null:t;var i=r.memoizedState;return t!==null&&Kd(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function $v(e,t){var r=Ut();t=t===void 0?null:t;var i=r.memoizedState;if(t!==null&&Kd(t,i[1]))return i[0];if(i=e(),Ts){yn(!0);try{e()}finally{yn(!1)}}return r.memoizedState=[i,t],i}function of(e,t,r){return r===void 0||(tr&1073741824)!==0&&(Ge&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=Vx(),ze.lanes|=e,$r|=e,r)}function Vv(e,t,r,i){return $n(r,t)?r:vl.current!==null?(e=of(e,r,i),$n(e,t)||(Ht=!0),e):(tr&42)===0||(tr&1073741824)!==0&&(Ge&261930)===0?(Ht=!0,e.memoizedState=r):(e=Vx(),ze.lanes|=e,$r|=e,t)}function Gv(e,t,r,i,d){var m=q.p;q.p=m!==0&&8>m?m:8;var j=_.T,T={};_.T=T,df(e,!1,t,r);try{var I=d(),X=_.S;if(X!==null&&X(T,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ne=iC(I,i);Mo(e,t,ne,Kn(e))}else Mo(e,t,i,Kn(e))}catch(oe){Mo(e,t,{then:function(){},status:"rejected",reason:oe},Kn())}finally{q.p=m,j!==null&&T.types!==null&&(j.types=T.types),_.T=j}}function mC(){}function cf(e,t,r,i){if(e.tag!==5)throw Error(o(476));var d=Yv(e).queue;Gv(e,d,t,W,r===null?mC:function(){return Fv(e),r(i)})}function Yv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:W},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Fv(e){var t=Yv(e);t.next===null&&(t=e.alternate.memoizedState),Mo(e,t.next.queue,{},Kn())}function uf(){return un(Fo)}function Xv(){return Ut().memoizedState}function Kv(){return Ut().memoizedState}function pC(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=Kn();e=Ur(r);var i=Ir(t,e,r);i!==null&&(Mn(i,t,r),No(i,t,r)),t={cache:Id()},e.payload=t;return}t=t.return}}function gC(e,t,r){var i=Kn();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},cc(e)?Zv(t,r):(r=Rd(e,t,r,i),r!==null&&(Mn(r,e,i),Jv(r,t,i)))}function Qv(e,t,r){var i=Kn();Mo(e,t,r,i)}function Mo(e,t,r,i){var d={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(cc(e))Zv(t,d);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=t.lastRenderedReducer,m!==null))try{var j=t.lastRenderedState,T=m(j,r);if(d.hasEagerState=!0,d.eagerState=T,$n(T,j))return $i(e,t,d,0),pt===null&&qi(),!1}catch{}finally{}if(r=Rd(e,t,d,i),r!==null)return Mn(r,e,i),Jv(r,t,i),!0}return!1}function df(e,t,r,i){if(i={lane:2,revertLane:$f(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},cc(e)){if(t)throw Error(o(479))}else t=Rd(e,r,i,2),t!==null&&Mn(t,e,2)}function cc(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Zv(e,t){xl=nc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Jv(e,t,r){if((r&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,yt(e,r)}}var Do={readContext:un,use:sc,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useLayoutEffect:Ot,useInsertionEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useSyncExternalStore:Ot,useId:Ot,useHostTransitionStatus:Ot,useFormState:Ot,useActionState:Ot,useOptimistic:Ot,useMemoCache:Ot,useCacheRefresh:Ot};Do.useEffectEvent=Ot;var Wv={readContext:un,use:sc,useCallback:function(e,t){return bn().memoizedState=[e,t===void 0?null:t],e},useContext:un,useEffect:Lv,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,oc(4194308,4,Bv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return oc(4194308,4,e,t)},useInsertionEffect:function(e,t){oc(4,2,e,t)},useMemo:function(e,t){var r=bn();t=t===void 0?null:t;var i=e();if(Ts){yn(!0);try{e()}finally{yn(!1)}}return r.memoizedState=[i,t],i},useReducer:function(e,t,r){var i=bn();if(r!==void 0){var d=r(t);if(Ts){yn(!0);try{r(t)}finally{yn(!1)}}}else d=t;return i.memoizedState=i.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},i.queue=e,e=e.dispatch=gC.bind(null,ze,e),[i.memoizedState,e]},useRef:function(e){var t=bn();return e={current:e},t.memoizedState=e},useState:function(e){e=af(e);var t=e.queue,r=Qv.bind(null,ze,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:lf,useDeferredValue:function(e,t){var r=bn();return of(r,e,t)},useTransition:function(){var e=af(!1);return e=Gv.bind(null,ze,e.queue,!0,!1),bn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var i=ze,d=bn();if(Xe){if(r===void 0)throw Error(o(407));r=r()}else{if(r=t(),pt===null)throw Error(o(349));(Ge&127)!==0||bv(i,t,r)}d.memoizedState=r;var m={value:r,getSnapshot:t};return d.queue=m,Lv(jv.bind(null,i,m,e),[e]),i.flags|=2048,bl(9,{destroy:void 0},wv.bind(null,i,m,r,t),null),r},useId:function(){var e=bn(),t=pt.identifierPrefix;if(Xe){var r=Da,i=Ma;r=(i&~(1<<32-Tt(i)-1)).toString(32)+r,t="_"+t+"R_"+r,r=ac++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=cC++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:uf,useFormState:Dv,useActionState:Dv,useOptimistic:function(e){var t=bn();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=df.bind(null,ze,!0,r),r.dispatch=t,[e,t]},useMemoCache:ef,useCacheRefresh:function(){return bn().memoizedState=pC.bind(null,ze)},useEffectEvent:function(e){var t=bn(),r={impl:e};return t.memoizedState=r,function(){if((tt&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}},ff={readContext:un,use:sc,useCallback:qv,useContext:un,useEffect:sf,useImperativeHandle:Hv,useInsertionEffect:Iv,useLayoutEffect:Pv,useMemo:$v,useReducer:lc,useRef:zv,useState:function(){return lc(nr)},useDebugValue:lf,useDeferredValue:function(e,t){var r=Ut();return Vv(r,dt.memoizedState,e,t)},useTransition:function(){var e=lc(nr)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:Ao(e),t]},useSyncExternalStore:yv,useId:Xv,useHostTransitionStatus:uf,useFormState:Ov,useActionState:Ov,useOptimistic:function(e,t){var r=Ut();return Nv(r,dt,e,t)},useMemoCache:ef,useCacheRefresh:Kv};ff.useEffectEvent=Uv;var ex={readContext:un,use:sc,useCallback:qv,useContext:un,useEffect:sf,useImperativeHandle:Hv,useInsertionEffect:Iv,useLayoutEffect:Pv,useMemo:$v,useReducer:nf,useRef:zv,useState:function(){return nf(nr)},useDebugValue:lf,useDeferredValue:function(e,t){var r=Ut();return dt===null?of(r,e,t):Vv(r,dt.memoizedState,e,t)},useTransition:function(){var e=nf(nr)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:Ao(e),t]},useSyncExternalStore:yv,useId:Xv,useHostTransitionStatus:uf,useFormState:_v,useActionState:_v,useOptimistic:function(e,t){var r=Ut();return dt!==null?Nv(r,dt,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:ef,useCacheRefresh:Kv};ex.useEffectEvent=Uv;function hf(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 mf={enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Kn(),d=Ur(i);d.payload=t,r!=null&&(d.callback=r),t=Ir(e,d,i),t!==null&&(Mn(t,e,i),No(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Kn(),d=Ur(i);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=Ir(e,d,i),t!==null&&(Mn(t,e,i),No(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Kn(),i=Ur(r);i.tag=2,t!=null&&(i.callback=t),t=Ir(e,i,r),t!==null&&(Mn(t,e,r),No(t,e,r))}};function tx(e,t,r,i,d,m,j){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,m,j):t.prototype&&t.prototype.isPureReactComponent?!vo(r,i)||!vo(d,m):!0}function nx(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&mf.enqueueReplaceState(t,t.state,null)}function As(e,t){var r=t;if("ref"in t){r={};for(var i in t)i!=="ref"&&(r[i]=t[i])}if(e=e.defaultProps){r===t&&(r=y({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function ax(e){Hi(e)}function rx(e){console.error(e)}function sx(e){Hi(e)}function uc(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function lx(e,t,r){try{var i=e.onCaughtError;i(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function pf(e,t,r){return r=Ur(r),r.tag=3,r.payload={element:null},r.callback=function(){uc(e,t)},r}function ox(e){return e=Ur(e),e.tag=3,e}function ix(e,t,r,i){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var m=i.value;e.payload=function(){return d(m)},e.callback=function(){lx(t,r,i)}}var j=r.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(e.callback=function(){lx(t,r,i),typeof d!="function"&&(Vr===null?Vr=new Set([this]):Vr.add(this));var T=i.stack;this.componentDidCatch(i.value,{componentStack:T!==null?T:""})})}function vC(e,t,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=r.alternate,t!==null&&fl(t,r,d,!0),r=Gn.current,r!==null){switch(r.tag){case 31:case 13:return ia===null?jc():r.alternate===null&&kt===0&&(kt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===Zi?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([i]):t.add(i),Bf(e,i,d)),!1;case 22:return r.flags|=65536,i===Zi?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([i]):r.add(i)),Bf(e,i,d)),!1}throw Error(o(435,r.tag))}return Bf(e,i,d),jc(),!1}if(Xe)return t=Gn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,i!==kd&&(e=Error(o(422),{cause:i}),bo(ra(e,r)))):(i!==kd&&(t=Error(o(423),{cause:i}),bo(ra(t,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=ra(i,r),d=pf(e.stateNode,i,d),Vd(e,d),kt!==4&&(kt=2)),!1;var m=Error(o(520),{cause:i});if(m=ra(m,r),Po===null?Po=[m]:Po.push(m),kt!==4&&(kt=2),t===null)return!0;i=ra(i,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=pf(r.stateNode,i,e),Vd(r,e),!1;case 1:if(t=r.type,m=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Vr===null||!Vr.has(m))))return r.flags|=65536,d&=-d,r.lanes|=d,d=ox(d),ix(d,e,r,i),Vd(r,d),!1}r=r.return}while(r!==null);return!1}var gf=Error(o(461)),Ht=!1;function dn(e,t,r,i){t.child=e===null?fv(t,null,r,i):Rs(t,e.child,r,i)}function cx(e,t,r,i,d){r=r.render;var m=t.ref;if("ref"in i){var j={};for(var T in i)T!=="ref"&&(j[T]=i[T])}else j=i;return Ss(t),i=Qd(e,t,r,j,m,d),T=Zd(),e!==null&&!Ht?(Jd(e,t,d),ar(e,t,d)):(Xe&&T&&Dd(t),t.flags|=1,dn(e,t,i,d),t.child)}function ux(e,t,r,i,d){if(e===null){var m=r.type;return typeof m=="function"&&!Td(m)&&m.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=m,dx(e,t,m,i,d)):(e=Gi(r.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,!Cf(e,d)){var j=m.memoizedProps;if(r=r.compare,r=r!==null?r:vo,r(j,i)&&e.ref===t.ref)return ar(e,t,d)}return t.flags|=1,e=Za(m,i),e.ref=t.ref,e.return=t,t.child=e}function dx(e,t,r,i,d){if(e!==null){var m=e.memoizedProps;if(vo(m,i)&&e.ref===t.ref)if(Ht=!1,t.pendingProps=i=m,Cf(e,d))(e.flags&131072)!==0&&(Ht=!0);else return t.lanes=e.lanes,ar(e,t,d)}return vf(e,t,r,i,d)}function fx(e,t,r,i){var d=i.children,m=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(m=m!==null?m.baseLanes|r:r,e!==null){for(i=t.child=e.child,d=0;i!==null;)d=d|i.lanes|i.childLanes,i=i.sibling;i=d&~m}else i=0,t.child=null;return hx(e,t,m,r,i)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ki(t,m!==null?m.cachePool:null),m!==null?pv(t,m):Yd(),gv(t);else return i=t.lanes=536870912,hx(e,t,m!==null?m.baseLanes|r:r,r,i)}else m!==null?(Ki(t,m.cachePool),pv(t,m),Br(),t.memoizedState=null):(e!==null&&Ki(t,null),Yd(),Br());return dn(e,t,d,r),t.child}function Oo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function hx(e,t,r,i,d){var m=Bd();return m=m===null?null:{parent:Pt._currentValue,pool:m},t.memoizedState={baseLanes:r,cachePool:m},e!==null&&Ki(t,null),Yd(),gv(t),e!==null&&fl(e,t,i,!0),t.childLanes=d,null}function dc(e,t){return t=hc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mx(e,t,r){return Rs(t,e.child,null,r),e=dc(t,t.pendingProps),e.flags|=2,Yn(t),t.memoizedState=null,e}function xC(e,t,r){var i=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Xe){if(i.mode==="hidden")return e=dc(t,i),t.lanes=536870912,Oo(null,e);if(Xd(t),(e=bt)?(e=Ey(e,oa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Or!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},r=Zg(e),r.return=t,t.child=r,cn=t,bt=null)):e=null,e===null)throw _r(t);return t.lanes=536870912,null}return dc(t,i)}var m=e.memoizedState;if(m!==null){var j=m.dehydrated;if(Xd(t),d)if(t.flags&256)t.flags&=-257,t=mx(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ht||fl(e,t,r,!1),d=(r&e.childLanes)!==0,Ht||d){if(i=pt,i!==null&&(j=zt(i,r),j!==0&&j!==m.retryLane))throw m.retryLane=j,ys(e,j),Mn(i,e,j),gf;jc(),t=mx(e,t,r)}else e=m.treeContext,bt=ca(j.nextSibling),cn=t,Xe=!0,kr=null,oa=!1,e!==null&&ev(t,e),t=dc(t,i),t.flags|=4096;return t}return e=Za(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(o(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function vf(e,t,r,i,d){return Ss(t),r=Qd(e,t,r,i,void 0,d),i=Zd(),e!==null&&!Ht?(Jd(e,t,d),ar(e,t,d)):(Xe&&i&&Dd(t),t.flags|=1,dn(e,t,r,d),t.child)}function px(e,t,r,i,d,m){return Ss(t),t.updateQueue=null,r=xv(t,i,r,d),vv(e),i=Zd(),e!==null&&!Ht?(Jd(e,t,m),ar(e,t,m)):(Xe&&i&&Dd(t),t.flags|=1,dn(e,t,r,m),t.child)}function gx(e,t,r,i,d){if(Ss(t),t.stateNode===null){var m=il,j=r.contextType;typeof j=="object"&&j!==null&&(m=un(j)),m=new r(i,m),t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=mf,t.stateNode=m,m._reactInternals=t,m=t.stateNode,m.props=i,m.state=t.memoizedState,m.refs={},qd(t),j=r.contextType,m.context=typeof j=="object"&&j!==null?un(j):il,m.state=t.memoizedState,j=r.getDerivedStateFromProps,typeof j=="function"&&(hf(t,r,j,i),m.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(j=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),j!==m.state&&mf.enqueueReplaceState(m,m.state,null),Ro(t,i,m,d),Eo(),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){m=t.stateNode;var T=t.memoizedProps,I=As(r,T);m.props=I;var X=m.context,ne=r.contextType;j=il,typeof ne=="object"&&ne!==null&&(j=un(ne));var oe=r.getDerivedStateFromProps;ne=typeof oe=="function"||typeof m.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,ne||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(T||X!==j)&&nx(t,m,i,j),Lr=!1;var K=t.memoizedState;m.state=K,Ro(t,i,m,d),Eo(),X=t.memoizedState,T||K!==X||Lr?(typeof oe=="function"&&(hf(t,r,oe,i),X=t.memoizedState),(I=Lr||tx(t,r,I,i,K,X,j))?(ne||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=X),m.props=i,m.state=X,m.context=j,i=I):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{m=t.stateNode,$d(e,t),j=t.memoizedProps,ne=As(r,j),m.props=ne,oe=t.pendingProps,K=m.context,X=r.contextType,I=il,typeof X=="object"&&X!==null&&(I=un(X)),T=r.getDerivedStateFromProps,(X=typeof T=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(j!==oe||K!==I)&&nx(t,m,i,I),Lr=!1,K=t.memoizedState,m.state=K,Ro(t,i,m,d),Eo();var J=t.memoizedState;j!==oe||K!==J||Lr||e!==null&&e.dependencies!==null&&Fi(e.dependencies)?(typeof T=="function"&&(hf(t,r,T,i),J=t.memoizedState),(ne=Lr||tx(t,r,ne,i,K,J,I)||e!==null&&e.dependencies!==null&&Fi(e.dependencies))?(X||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,J,I),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,J,I)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||j===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=J),m.props=i,m.state=J,m.context=I,i=ne):(typeof m.componentDidUpdate!="function"||j===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),i=!1)}return m=i,fc(e,t),i=(t.flags&128)!==0,m||i?(m=t.stateNode,r=i&&typeof r.getDerivedStateFromError!="function"?null:m.render(),t.flags|=1,e!==null&&i?(t.child=Rs(t,e.child,null,d),t.child=Rs(t,null,r,d)):dn(e,t,r,d),t.memoizedState=m.state,e=t.child):e=ar(e,t,d),e}function vx(e,t,r,i){return ws(),t.flags|=256,dn(e,t,r,i),t.child}var xf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yf(e){return{baseLanes:e,cachePool:lv()}}function bf(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=Xn),e}function xx(e,t,r){var i=t.pendingProps,d=!1,m=(t.flags&128)!==0,j;if((j=m)||(j=e!==null&&e.memoizedState===null?!1:(Lt.current&2)!==0),j&&(d=!0,t.flags&=-129),j=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(d?Pr(t):Br(),(e=bt)?(e=Ey(e,oa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Or!==null?{id:Ma,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},r=Zg(e),r.return=t,t.child=r,cn=t,bt=null)):e=null,e===null)throw _r(t);return nh(e)?t.lanes=32:t.lanes=536870912,null}var T=i.children;return i=i.fallback,d?(Br(),d=t.mode,T=hc({mode:"hidden",children:T},d),i=bs(i,d,r,null),T.return=t,i.return=t,T.sibling=i,t.child=T,i=t.child,i.memoizedState=yf(r),i.childLanes=bf(e,j,r),t.memoizedState=xf,Oo(null,i)):(Pr(t),wf(t,T))}var I=e.memoizedState;if(I!==null&&(T=I.dehydrated,T!==null)){if(m)t.flags&256?(Pr(t),t.flags&=-257,t=jf(e,t,r)):t.memoizedState!==null?(Br(),t.child=e.child,t.flags|=128,t=null):(Br(),T=i.fallback,d=t.mode,i=hc({mode:"visible",children:i.children},d),T=bs(T,d,r,null),T.flags|=2,i.return=t,T.return=t,i.sibling=T,t.child=i,Rs(t,e.child,null,r),i=t.child,i.memoizedState=yf(r),i.childLanes=bf(e,j,r),t.memoizedState=xf,t=Oo(null,i));else if(Pr(t),nh(T)){if(j=T.nextSibling&&T.nextSibling.dataset,j)var X=j.dgst;j=X,i=Error(o(419)),i.stack="",i.digest=j,bo({value:i,source:null,stack:null}),t=jf(e,t,r)}else if(Ht||fl(e,t,r,!1),j=(r&e.childLanes)!==0,Ht||j){if(j=pt,j!==null&&(i=zt(j,r),i!==0&&i!==I.retryLane))throw I.retryLane=i,ys(e,i),Mn(j,e,i),gf;th(T)||jc(),t=jf(e,t,r)}else th(T)?(t.flags|=192,t.child=e.child,t=null):(e=I.treeContext,bt=ca(T.nextSibling),cn=t,Xe=!0,kr=null,oa=!1,e!==null&&ev(t,e),t=wf(t,i.children),t.flags|=4096);return t}return d?(Br(),T=i.fallback,d=t.mode,I=e.child,X=I.sibling,i=Za(I,{mode:"hidden",children:i.children}),i.subtreeFlags=I.subtreeFlags&65011712,X!==null?T=Za(X,T):(T=bs(T,d,r,null),T.flags|=2),T.return=t,i.return=t,i.sibling=T,t.child=i,Oo(null,i),i=t.child,T=e.child.memoizedState,T===null?T=yf(r):(d=T.cachePool,d!==null?(I=Pt._currentValue,d=d.parent!==I?{parent:I,pool:I}:d):d=lv(),T={baseLanes:T.baseLanes|r,cachePool:d}),i.memoizedState=T,i.childLanes=bf(e,j,r),t.memoizedState=xf,Oo(e.child,i)):(Pr(t),r=e.child,e=r.sibling,r=Za(r,{mode:"visible",children:i.children}),r.return=t,r.sibling=null,e!==null&&(j=t.deletions,j===null?(t.deletions=[e],t.flags|=16):j.push(e)),t.child=r,t.memoizedState=null,r)}function wf(e,t){return t=hc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function hc(e,t){return e=Vn(22,e,null,t),e.lanes=0,e}function jf(e,t,r){return Rs(t,e.child,null,r),e=wf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yx(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Ld(e.return,t,r)}function Sf(e,t,r,i,d,m){var j=e.memoizedState;j===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:d,treeForkCount:m}:(j.isBackwards=t,j.rendering=null,j.renderingStartTime=0,j.last=i,j.tail=r,j.tailMode=d,j.treeForkCount=m)}function bx(e,t,r){var i=t.pendingProps,d=i.revealOrder,m=i.tail;i=i.children;var j=Lt.current,T=(j&2)!==0;if(T?(j=j&1|2,t.flags|=128):j&=1,Y(Lt,j),dn(e,t,i,r),i=Xe?yo:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yx(e,r,t);else if(e.tag===19)yx(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(r=t.child,d=null;r!==null;)e=r.alternate,e!==null&&tc(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=t.child,t.child=null):(d=r.sibling,r.sibling=null),Sf(t,!1,d,r,m,i);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&tc(e)===null){t.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}Sf(t,!0,r,null,m,i);break;case"together":Sf(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function ar(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),$r|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(fl(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,r=Za(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Za(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Cf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fi(e)))}function yC(e,t,r){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),zr(t,Pt,e.memoizedState.cache),ws();break;case 27:case 5:xe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:zr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Xd(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Pr(t),t.flags|=128,null):(r&t.child.childLanes)!==0?xx(e,t,r):(Pr(t),e=ar(e,t,r),e!==null?e.sibling:null);Pr(t);break;case 19:var d=(e.flags&128)!==0;if(i=(r&t.childLanes)!==0,i||(fl(e,t,r,!1),i=(r&t.childLanes)!==0),d){if(i)return bx(e,t,r);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Y(Lt,Lt.current),i)break;return null;case 22:return t.lanes=0,fx(e,t,r,t.pendingProps);case 24:zr(t,Pt,e.memoizedState.cache)}return ar(e,t,r)}function wx(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ht=!0;else{if(!Cf(e,r)&&(t.flags&128)===0)return Ht=!1,yC(e,t,r);Ht=(e.flags&131072)!==0}else Ht=!1,Xe&&(t.flags&1048576)!==0&&Wg(t,yo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ns(t.elementType),t.type=e,typeof e=="function")Td(e)?(i=As(e,i),t.tag=1,t=gx(null,t,e,i,r)):(t.tag=0,t=vf(null,t,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===M){t.tag=11,t=cx(null,t,e,i,r);break e}else if(d===z){t.tag=14,t=ux(null,t,e,i,r);break e}}throw t=se(e)||e,Error(o(306,t,""))}}return t;case 0:return vf(e,t,t.type,t.pendingProps,r);case 1:return i=t.type,d=As(i,t.pendingProps),gx(e,t,i,d,r);case 3:e:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var m=t.memoizedState;d=m.element,$d(e,t),Ro(t,i,null,r);var j=t.memoizedState;if(i=j.cache,zr(t,Pt,i),i!==m.cache&&Ud(t,[Pt],r,!0),Eo(),i=j.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:j.cache},t.updateQueue.baseState=m,t.memoizedState=m,t.flags&256){t=vx(e,t,i,r);break e}else if(i!==d){d=ra(Error(o(424)),t),bo(d),t=vx(e,t,i,r);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(bt=ca(e.firstChild),cn=t,Xe=!0,kr=null,oa=!0,r=fv(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ws(),i===d){t=ar(e,t,r);break e}dn(e,t,i,r)}t=t.child}return t;case 26:return fc(e,t),e===null?(r=Oy(t.type,null,t.pendingProps,null))?t.memoizedState=r:Xe||(r=t.type,e=t.pendingProps,i=Ac(ye.current).createElement(r),i[on]=t,i[Cn]=e,fn(i,r,e),tn(i),t.stateNode=i):t.memoizedState=Oy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return xe(t),e===null&&Xe&&(i=t.stateNode=Ay(t.type,t.pendingProps,ye.current),cn=t,oa=!0,d=bt,Xr(t.type)?(ah=d,bt=ca(i.firstChild)):bt=d),dn(e,t,t.pendingProps.children,r),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((d=i=bt)&&(i=KC(i,t.type,t.pendingProps,oa),i!==null?(t.stateNode=i,cn=t,bt=ca(i.firstChild),oa=!1,d=!0):d=!1),d||_r(t)),xe(t),d=t.type,m=t.pendingProps,j=e!==null?e.memoizedProps:null,i=m.children,Jf(d,m)?i=null:j!==null&&Jf(d,j)&&(t.flags|=32),t.memoizedState!==null&&(d=Qd(e,t,uC,null,null,r),Fo._currentValue=d),fc(e,t),dn(e,t,i,r),t.child;case 6:return e===null&&Xe&&((e=r=bt)&&(r=QC(r,t.pendingProps,oa),r!==null?(t.stateNode=r,cn=t,bt=null,e=!0):e=!1),e||_r(t)),null;case 13:return xx(e,t,r);case 4:return ue(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Rs(t,null,i,r):dn(e,t,i,r),t.child;case 11:return cx(e,t,t.type,t.pendingProps,r);case 7:return dn(e,t,t.pendingProps,r),t.child;case 8:return dn(e,t,t.pendingProps.children,r),t.child;case 12:return dn(e,t,t.pendingProps.children,r),t.child;case 10:return i=t.pendingProps,zr(t,t.type,i.value),dn(e,t,i.children,r),t.child;case 9:return d=t.type._context,i=t.pendingProps.children,Ss(t),d=un(d),i=i(d),t.flags|=1,dn(e,t,i,r),t.child;case 14:return ux(e,t,t.type,t.pendingProps,r);case 15:return dx(e,t,t.type,t.pendingProps,r);case 19:return bx(e,t,r);case 31:return xC(e,t,r);case 22:return fx(e,t,r,t.pendingProps);case 24:return Ss(t),i=un(Pt),e===null?(d=Bd(),d===null&&(d=pt,m=Id(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=r),d=m),t.memoizedState={parent:i,cache:d},qd(t),zr(t,Pt,d)):((e.lanes&r)!==0&&($d(e,t),Ro(t,null,null,r),Eo()),d=e.memoizedState,m=t.memoizedState,d.parent!==i?(d={parent:i,cache:i},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),zr(t,Pt,i)):(i=m.cache,zr(t,Pt,i),i!==d.cache&&Ud(t,[Pt],r,!0))),dn(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function rr(e){e.flags|=4}function Nf(e,t,r,i,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Xx())e.flags|=8192;else throw Es=Zi,Hd}else e.flags&=-16777217}function jx(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Uy(t))if(Xx())e.flags|=8192;else throw Es=Zi,Hd}function mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ue():536870912,e.lanes|=t,Cl|=t)}function ko(e,t){if(!Xe)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var d=e.child;d!==null;)r|=d.lanes|d.childLanes,i|=d.subtreeFlags&65011712,i|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)r|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function bC(e,t,r){var i=t.pendingProps;switch(Od(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(t),null;case 1:return wt(t),null;case 3:return r=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),er(Pt),he(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(dl(t)?rr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,_d())),wt(t),null;case 26:var d=t.type,m=t.memoizedState;return e===null?(rr(t),m!==null?(wt(t),jx(t,m)):(wt(t),Nf(t,d,null,i,r))):m?m!==e.memoizedState?(rr(t),wt(t),jx(t,m)):(wt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&rr(t),wt(t),Nf(t,d,e,i,r)),null;case 27:if(Ae(t),r=ye.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&rr(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return wt(t),null}e=ae.current,dl(t)?tv(t):(e=Ay(d,i,r),t.stateNode=e,rr(t))}return wt(t),null;case 5:if(Ae(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&rr(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return wt(t),null}if(m=ae.current,dl(t))tv(t);else{var j=Ac(ye.current);switch(m){case 1:m=j.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=j.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=j.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=j.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=j.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof i.is=="string"?j.createElement("select",{is:i.is}):j.createElement("select"),i.multiple?m.multiple=!0:i.size&&(m.size=i.size);break;default:m=typeof i.is=="string"?j.createElement(d,{is:i.is}):j.createElement(d)}}m[on]=t,m[Cn]=i;e:for(j=t.child;j!==null;){if(j.tag===5||j.tag===6)m.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===t)break e;for(;j.sibling===null;){if(j.return===null||j.return===t)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}t.stateNode=m;e:switch(fn(m,d,i),d){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&rr(t)}}return wt(t),Nf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&rr(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=ye.current,dl(t)){if(e=t.stateNode,r=t.memoizedProps,i=null,d=cn,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[on]=t,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||xy(e.nodeValue,r)),e||_r(t,!0)}else e=Ac(e).createTextNode(i),e[on]=t,t.stateNode=e}return wt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(i=dl(t),r!==null){if(e===null){if(!i)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[on]=t}else ws(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;wt(t),e=!1}else r=_d(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(Yn(t),t):(Yn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return wt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=dl(t),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(o(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));d[on]=t}else ws(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;wt(t),d=!1}else d=_d(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(Yn(t),t):(Yn(t),null)}return Yn(t),(t.flags&128)!==0?(t.lanes=r,t):(r=i!==null,e=e!==null&&e.memoizedState!==null,r&&(i=t.child,d=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(d=i.alternate.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==d&&(i.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),mc(t,t.updateQueue),wt(t),null);case 4:return he(),e===null&&Ff(t.stateNode.containerInfo),wt(t),null;case 10:return er(t.type),wt(t),null;case 19:if(U(Lt),i=t.memoizedState,i===null)return wt(t),null;if(d=(t.flags&128)!==0,m=i.rendering,m===null)if(d)ko(i,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=tc(e),m!==null){for(t.flags|=128,ko(i,!1),e=m.updateQueue,t.updateQueue=e,mc(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Qg(r,e),r=r.sibling;return Y(Lt,Lt.current&1|2),Xe&&Ja(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Ct()>yc&&(t.flags|=128,d=!0,ko(i,!1),t.lanes=4194304)}else{if(!d)if(e=tc(m),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,mc(t,e),ko(i,!0),i.tail===null&&i.tailMode==="hidden"&&!m.alternate&&!Xe)return wt(t),null}else 2*Ct()-i.renderingStartTime>yc&&r!==536870912&&(t.flags|=128,d=!0,ko(i,!1),t.lanes=4194304);i.isBackwards?(m.sibling=t.child,t.child=m):(e=i.last,e!==null?e.sibling=m:t.child=m,i.last=m)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ct(),e.sibling=null,r=Lt.current,Y(Lt,d?r&1|2:r&1),Xe&&Ja(t,i.treeForkCount),e):(wt(t),null);case 22:case 23:return Yn(t),Fd(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(r&536870912)!==0&&(t.flags&128)===0&&(wt(t),t.subtreeFlags&6&&(t.flags|=8192)):wt(t),r=t.updateQueue,r!==null&&mc(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==r&&(t.flags|=2048),e!==null&&U(Cs),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),er(Pt),wt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function wC(e,t){switch(Od(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return er(Pt),he(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Yn(t),t.alternate===null)throw Error(o(340));ws()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Yn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ws()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Lt),null;case 4:return he(),null;case 10:return er(t.type),null;case 22:case 23:return Yn(t),Fd(),e!==null&&U(Cs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return er(Pt),null;case 25:return null;default:return null}}function Sx(e,t){switch(Od(t),t.tag){case 3:er(Pt),he();break;case 26:case 27:case 5:Ae(t);break;case 4:he();break;case 31:t.memoizedState!==null&&Yn(t);break;case 13:Yn(t);break;case 19:U(Lt);break;case 10:er(t.type);break;case 22:case 23:Yn(t),Fd(),e!==null&&U(Cs);break;case 24:er(Pt)}}function _o(e,t){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var d=i.next;r=d;do{if((r.tag&e)===e){i=void 0;var m=r.create,j=r.inst;i=m(),j.destroy=i}r=r.next}while(r!==d)}}catch(T){ct(t,t.return,T)}}function Hr(e,t,r){try{var i=t.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var m=d.next;i=m;do{if((i.tag&e)===e){var j=i.inst,T=j.destroy;if(T!==void 0){j.destroy=void 0,d=t;var I=r,X=T;try{X()}catch(ne){ct(d,I,ne)}}}i=i.next}while(i!==m)}}catch(ne){ct(t,t.return,ne)}}function Cx(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{mv(t,r)}catch(i){ct(e,e.return,i)}}}function Nx(e,t,r){r.props=As(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){ct(e,t,i)}}function zo(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof r=="function"?e.refCleanup=r(i):r.current=i}}catch(d){ct(e,t,d)}}function Oa(e,t){var r=e.ref,i=e.refCleanup;if(r!==null)if(typeof i=="function")try{i()}catch(d){ct(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(d){ct(e,t,d)}else r.current=null}function Ex(e){var t=e.type,r=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&i.focus();break e;case"img":r.src?i.src=r.src:r.srcSet&&(i.srcset=r.srcSet)}}catch(d){ct(e,e.return,d)}}function Ef(e,t,r){try{var i=e.stateNode;$C(i,e.type,r,t),i[Cn]=t}catch(d){ct(e,e.return,d)}}function Rx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xr(e.type)||e.tag===4}function Rf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Xr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tf(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ka));else if(i!==4&&(i===27&&Xr(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(Tf(e,t,r),e=e.sibling;e!==null;)Tf(e,t,r),e=e.sibling}function pc(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(i===27&&Xr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(pc(e,t,r),e=e.sibling;e!==null;)pc(e,t,r),e=e.sibling}function Tx(e){var t=e.stateNode,r=e.memoizedProps;try{for(var i=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);fn(t,i,r),t[on]=e,t[Cn]=r}catch(m){ct(e,e.return,m)}}var sr=!1,qt=!1,Af=!1,Ax=typeof WeakSet=="function"?WeakSet:Set,nn=null;function jC(e,t){if(e=e.containerInfo,Qf=Lc,e=Hg(e),wd(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var d=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{r.nodeType,m.nodeType}catch{r=null;break e}var j=0,T=-1,I=-1,X=0,ne=0,oe=e,K=null;t:for(;;){for(var J;oe!==r||d!==0&&oe.nodeType!==3||(T=j+d),oe!==m||i!==0&&oe.nodeType!==3||(I=j+i),oe.nodeType===3&&(j+=oe.nodeValue.length),(J=oe.firstChild)!==null;)K=oe,oe=J;for(;;){if(oe===e)break t;if(K===r&&++X===d&&(T=j),K===m&&++ne===i&&(I=j),(J=oe.nextSibling)!==null)break;oe=K,K=oe.parentNode}oe=J}r=T===-1||I===-1?null:{start:T,end:I}}else r=null}r=r||{start:0,end:0}}else r=null;for(Zf={focusedElem:e,selectionRange:r},Lc=!1,nn=t;nn!==null;)if(t=nn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,nn=e;else for(;nn!==null;){switch(t=nn,m=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,r=t,d=m.memoizedProps,m=m.memoizedState,i=r.stateNode;try{var we=As(r.type,d);e=i.getSnapshotBeforeUpdate(we,m),i.__reactInternalSnapshotBeforeUpdate=e}catch(De){ct(r,r.return,De)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)eh(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":eh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,nn=e;break}nn=t.return}}function Mx(e,t,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:or(e,r),i&4&&_o(5,r);break;case 1:if(or(e,r),i&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(j){ct(r,r.return,j)}else{var d=As(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(j){ct(r,r.return,j)}}i&64&&Cx(r),i&512&&zo(r,r.return);break;case 3:if(or(e,r),i&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{mv(e,t)}catch(j){ct(r,r.return,j)}}break;case 27:t===null&&i&4&&Tx(r);case 26:case 5:or(e,r),t===null&&i&4&&Ex(r),i&512&&zo(r,r.return);break;case 12:or(e,r);break;case 31:or(e,r),i&4&&kx(e,r);break;case 13:or(e,r),i&4&&_x(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=DC.bind(null,r),ZC(e,r))));break;case 22:if(i=r.memoizedState!==null||sr,!i){t=t!==null&&t.memoizedState!==null||qt,d=sr;var m=qt;sr=i,(qt=t)&&!m?ir(e,r,(r.subtreeFlags&8772)!==0):or(e,r),sr=d,qt=m}break;case 30:break;default:or(e,r)}}function Dx(e){var t=e.alternate;t!==null&&(e.alternate=null,Dx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&rd(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Et=null,En=!1;function lr(e,t,r){for(r=r.child;r!==null;)Ox(e,t,r),r=r.sibling}function Ox(e,t,r){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(ga,r)}catch{}switch(r.tag){case 26:qt||Oa(r,t),lr(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:qt||Oa(r,t);var i=Et,d=En;Xr(r.type)&&(Et=r.stateNode,En=!1),lr(e,t,r),Vo(r.stateNode),Et=i,En=d;break;case 5:qt||Oa(r,t);case 6:if(i=Et,d=En,Et=null,lr(e,t,r),Et=i,En=d,Et!==null)if(En)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(r.stateNode)}catch(m){ct(r,t,m)}else try{Et.removeChild(r.stateNode)}catch(m){ct(r,t,m)}break;case 18:Et!==null&&(En?(e=Et,Cy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Ol(e)):Cy(Et,r.stateNode));break;case 4:i=Et,d=En,Et=r.stateNode.containerInfo,En=!0,lr(e,t,r),Et=i,En=d;break;case 0:case 11:case 14:case 15:Hr(2,r,t),qt||Hr(4,r,t),lr(e,t,r);break;case 1:qt||(Oa(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"&&Nx(r,t,i)),lr(e,t,r);break;case 21:lr(e,t,r);break;case 22:qt=(i=qt)||r.memoizedState!==null,lr(e,t,r),qt=i;break;default:lr(e,t,r)}}function kx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ol(e)}catch(r){ct(t,t.return,r)}}}function _x(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ol(e)}catch(r){ct(t,t.return,r)}}function SC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ax),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ax),t;default:throw Error(o(435,e.tag))}}function gc(e,t){var r=SC(e);t.forEach(function(i){if(!r.has(i)){r.add(i);var d=OC.bind(null,e,i);i.then(d,d)}})}function Rn(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var d=r[i],m=e,j=t,T=j;e:for(;T!==null;){switch(T.tag){case 27:if(Xr(T.type)){Et=T.stateNode,En=!1;break e}break;case 5:Et=T.stateNode,En=!1;break e;case 3:case 4:Et=T.stateNode.containerInfo,En=!0;break e}T=T.return}if(Et===null)throw Error(o(160));Ox(m,j,d),Et=null,En=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)zx(t,e),t=t.sibling}var ya=null;function zx(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rn(t,e),Tn(e),i&4&&(Hr(3,e,e.return),_o(3,e),Hr(5,e,e.return));break;case 1:Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),i&64&&sr&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?i:r.concat(i))));break;case 26:var d=ya;if(Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),i&4){var m=r!==null?r.memoizedState:null;if(i=e.memoizedState,r===null)if(i===null)if(e.stateNode===null){e:{i=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":m=d.getElementsByTagName("title")[0],(!m||m[oo]||m[on]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(i),d.head.insertBefore(m,d.querySelector("head > title"))),fn(m,i,r),m[on]=e,tn(m),i=m;break e;case"link":var j=zy("link","href",d).get(i+(r.href||""));if(j){for(var T=0;T<j.length;T++)if(m=j[T],m.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&m.getAttribute("rel")===(r.rel==null?null:r.rel)&&m.getAttribute("title")===(r.title==null?null:r.title)&&m.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){j.splice(T,1);break t}}m=d.createElement(i),fn(m,i,r),d.head.appendChild(m);break;case"meta":if(j=zy("meta","content",d).get(i+(r.content||""))){for(T=0;T<j.length;T++)if(m=j[T],m.getAttribute("content")===(r.content==null?null:""+r.content)&&m.getAttribute("name")===(r.name==null?null:r.name)&&m.getAttribute("property")===(r.property==null?null:r.property)&&m.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&m.getAttribute("charset")===(r.charSet==null?null:r.charSet)){j.splice(T,1);break t}}m=d.createElement(i),fn(m,i,r),d.head.appendChild(m);break;default:throw Error(o(468,i))}m[on]=e,tn(m),i=m}e.stateNode=i}else Ly(d,e.type,e.stateNode);else e.stateNode=_y(d,i,e.memoizedProps);else m!==i?(m===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):m.count--,i===null?Ly(d,e.type,e.stateNode):_y(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Ef(e,e.memoizedProps,r.memoizedProps)}break;case 27:Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),r!==null&&i&4&&Ef(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Rn(t,e),Tn(e),i&512&&(qt||r===null||Oa(r,r.return)),e.flags&32){d=e.stateNode;try{tl(d,"")}catch(we){ct(e,e.return,we)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,Ef(e,d,r!==null?r.memoizedProps:d)),i&1024&&(Af=!0);break;case 6:if(Rn(t,e),Tn(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,r=e.stateNode;try{r.nodeValue=i}catch(we){ct(e,e.return,we)}}break;case 3:if(Oc=null,d=ya,ya=Mc(t.containerInfo),Rn(t,e),ya=d,Tn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Ol(t.containerInfo)}catch(we){ct(e,e.return,we)}Af&&(Af=!1,Lx(e));break;case 4:i=ya,ya=Mc(e.stateNode.containerInfo),Rn(t,e),Tn(e),ya=i;break;case 12:Rn(t,e),Tn(e);break;case 31:Rn(t,e),Tn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,gc(e,i)));break;case 13:Rn(t,e),Tn(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(xc=Ct()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,gc(e,i)));break;case 22:d=e.memoizedState!==null;var I=r!==null&&r.memoizedState!==null,X=sr,ne=qt;if(sr=X||d,qt=ne||I,Rn(t,e),qt=ne,sr=X,Tn(e),i&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(r===null||I||sr||qt||Ms(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){I=r=t;try{if(m=I.stateNode,d)j=m.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{T=I.stateNode;var oe=I.memoizedProps.style,K=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;T.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(we){ct(I,I.return,we)}}}else if(t.tag===6){if(r===null){I=t;try{I.stateNode.nodeValue=d?"":I.memoizedProps}catch(we){ct(I,I.return,we)}}}else if(t.tag===18){if(r===null){I=t;try{var J=I.stateNode;d?Ny(J,!0):Ny(I.stateNode,!1)}catch(we){ct(I,I.return,we)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(r=i.retryQueue,r!==null&&(i.retryQueue=null,gc(e,r))));break;case 19:Rn(t,e),Tn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,gc(e,i)));break;case 30:break;case 21:break;default:Rn(t,e),Tn(e)}}function Tn(e){var t=e.flags;if(t&2){try{for(var r,i=e.return;i!==null;){if(Rx(i)){r=i;break}i=i.return}if(r==null)throw Error(o(160));switch(r.tag){case 27:var d=r.stateNode,m=Rf(e);pc(e,m,d);break;case 5:var j=r.stateNode;r.flags&32&&(tl(j,""),r.flags&=-33);var T=Rf(e);pc(e,T,j);break;case 3:case 4:var I=r.stateNode.containerInfo,X=Rf(e);Tf(e,X,I);break;default:throw Error(o(161))}}catch(ne){ct(e,e.return,ne)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Lx(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function or(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Mx(e,t.alternate,t),t=t.sibling}function Ms(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hr(4,t,t.return),Ms(t);break;case 1:Oa(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&Nx(t,t.return,r),Ms(t);break;case 27:Vo(t.stateNode);case 26:case 5:Oa(t,t.return),Ms(t);break;case 22:t.memoizedState===null&&Ms(t);break;case 30:Ms(t);break;default:Ms(t)}e=e.sibling}}function ir(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,d=e,m=t,j=m.flags;switch(m.tag){case 0:case 11:case 15:ir(d,m,r),_o(4,m);break;case 1:if(ir(d,m,r),i=m,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(X){ct(i,i.return,X)}if(i=m,d=i.updateQueue,d!==null){var T=i.stateNode;try{var I=d.shared.hiddenCallbacks;if(I!==null)for(d.shared.hiddenCallbacks=null,d=0;d<I.length;d++)hv(I[d],T)}catch(X){ct(i,i.return,X)}}r&&j&64&&Cx(m),zo(m,m.return);break;case 27:Tx(m);case 26:case 5:ir(d,m,r),r&&i===null&&j&4&&Ex(m),zo(m,m.return);break;case 12:ir(d,m,r);break;case 31:ir(d,m,r),r&&j&4&&kx(d,m);break;case 13:ir(d,m,r),r&&j&4&&_x(d,m);break;case 22:m.memoizedState===null&&ir(d,m,r),zo(m,m.return);break;case 30:break;default:ir(d,m,r)}t=t.sibling}}function Mf(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&wo(r))}function Df(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wo(e))}function ba(e,t,r,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ux(e,t,r,i),t=t.sibling}function Ux(e,t,r,i){var d=t.flags;switch(t.tag){case 0:case 11:case 15:ba(e,t,r,i),d&2048&&_o(9,t);break;case 1:ba(e,t,r,i);break;case 3:ba(e,t,r,i),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&wo(e)));break;case 12:if(d&2048){ba(e,t,r,i),e=t.stateNode;try{var m=t.memoizedProps,j=m.id,T=m.onPostCommit;typeof T=="function"&&T(j,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(I){ct(t,t.return,I)}}else ba(e,t,r,i);break;case 31:ba(e,t,r,i);break;case 13:ba(e,t,r,i);break;case 23:break;case 22:m=t.stateNode,j=t.alternate,t.memoizedState!==null?m._visibility&2?ba(e,t,r,i):Lo(e,t):m._visibility&2?ba(e,t,r,i):(m._visibility|=2,wl(e,t,r,i,(t.subtreeFlags&10256)!==0||!1)),d&2048&&Mf(j,t);break;case 24:ba(e,t,r,i),d&2048&&Df(t.alternate,t);break;default:ba(e,t,r,i)}}function wl(e,t,r,i,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var m=e,j=t,T=r,I=i,X=j.flags;switch(j.tag){case 0:case 11:case 15:wl(m,j,T,I,d),_o(8,j);break;case 23:break;case 22:var ne=j.stateNode;j.memoizedState!==null?ne._visibility&2?wl(m,j,T,I,d):Lo(m,j):(ne._visibility|=2,wl(m,j,T,I,d)),d&&X&2048&&Mf(j.alternate,j);break;case 24:wl(m,j,T,I,d),d&&X&2048&&Df(j.alternate,j);break;default:wl(m,j,T,I,d)}t=t.sibling}}function Lo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,i=t,d=i.flags;switch(i.tag){case 22:Lo(r,i),d&2048&&Mf(i.alternate,i);break;case 24:Lo(r,i),d&2048&&Df(i.alternate,i);break;default:Lo(r,i)}t=t.sibling}}var Uo=8192;function jl(e,t,r){if(e.subtreeFlags&Uo)for(e=e.child;e!==null;)Ix(e,t,r),e=e.sibling}function Ix(e,t,r){switch(e.tag){case 26:jl(e,t,r),e.flags&Uo&&e.memoizedState!==null&&c2(r,ya,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,r);break;case 3:case 4:var i=ya;ya=Mc(e.stateNode.containerInfo),jl(e,t,r),ya=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Uo,Uo=16777216,jl(e,t,r),Uo=i):jl(e,t,r));break;default:jl(e,t,r)}}function Px(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Io(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];nn=i,Hx(i,e)}Px(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bx(e),e=e.sibling}function Bx(e){switch(e.tag){case 0:case 11:case 15:Io(e),e.flags&2048&&Hr(9,e,e.return);break;case 3:Io(e);break;case 12:Io(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,vc(e)):Io(e);break;default:Io(e)}}function vc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];nn=i,Hx(i,e)}Px(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hr(8,t,t.return),vc(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,vc(t));break;default:vc(t)}e=e.sibling}}function Hx(e,t){for(;nn!==null;){var r=nn;switch(r.tag){case 0:case 11:case 15:Hr(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var i=r.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:wo(r.memoizedState.cache)}if(i=r.child,i!==null)i.return=r,nn=i;else e:for(r=e;nn!==null;){i=nn;var d=i.sibling,m=i.return;if(Dx(i),i===r){nn=null;break e}if(d!==null){d.return=m,nn=d;break e}nn=m}}}var CC={getCacheForType:function(e){var t=un(Pt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return un(Pt).controller.signal}},NC=typeof WeakMap=="function"?WeakMap:Map,tt=0,pt=null,$e=null,Ge=0,it=0,Fn=null,qr=!1,Sl=!1,Of=!1,cr=0,kt=0,$r=0,Ds=0,kf=0,Xn=0,Cl=0,Po=null,An=null,_f=!1,xc=0,qx=0,yc=1/0,bc=null,Vr=null,Yt=0,Gr=null,Nl=null,ur=0,zf=0,Lf=null,$x=null,Bo=0,Uf=null;function Kn(){return(tt&2)!==0&&Ge!==0?Ge&-Ge:_.T!==null?$f():va()}function Vx(){if(Xn===0)if((Ge&536870912)===0||Xe){var e=Ar;Ar<<=1,(Ar&3932160)===0&&(Ar=262144),Xn=e}else Xn=536870912;return e=Gn.current,e!==null&&(e.flags|=32),Xn}function Mn(e,t,r){(e===pt&&(it===2||it===9)||e.cancelPendingCommit!==null)&&(El(e,0),Yr(e,Ge,Xn,!1)),Nt(e,r),((tt&2)===0||e!==pt)&&(e===pt&&((tt&2)===0&&(Ds|=r),kt===4&&Yr(e,Ge,Xn,!1)),ka(e))}function Gx(e,t,r){if((tt&6)!==0)throw Error(o(327));var i=!r&&(t&127)===0&&(t&e.expiredLanes)===0||Re(e,t),d=i?TC(e,t):Pf(e,t,!0),m=i;do{if(d===0){Sl&&!i&&Yr(e,t,0,!1);break}else{if(r=e.current.alternate,m&&!EC(r)){d=Pf(e,t,!1),m=!1;continue}if(d===2){if(m=t,e.errorRecoveryDisabledLanes&m)var j=0;else j=e.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){t=j;e:{var T=e;d=Po;var I=T.current.memoizedState.isDehydrated;if(I&&(El(T,j).flags|=256),j=Pf(T,j,!1),j!==2){if(Of&&!I){T.errorRecoveryDisabledLanes|=m,Ds|=m,d=4;break e}m=An,An=d,m!==null&&(An===null?An=m:An.push.apply(An,m))}d=j}if(m=!1,d!==2)continue}}if(d===1){El(e,0),Yr(e,t,0,!0);break}e:{switch(i=e,m=d,m){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Yr(i,t,Xn,!qr);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(d=xc+300-Ct(),10<d)){if(Yr(i,t,Xn,!qr),It(i,0,!0)!==0)break e;ur=t,i.timeoutHandle=jy(Yx.bind(null,i,r,An,bc,_f,t,Xn,Ds,Cl,qr,m,"Throttled",-0,0),d);break e}Yx(i,r,An,bc,_f,t,Xn,Ds,Cl,qr,m,null,-0,0)}}break}while(!0);ka(e)}function Yx(e,t,r,i,d,m,j,T,I,X,ne,oe,K,J){if(e.timeoutHandle=-1,oe=t.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ka},Ix(t,m,oe);var we=(m&62914560)===m?xc-Ct():(m&4194048)===m?qx-Ct():0;if(we=u2(oe,we),we!==null){ur=m,e.cancelPendingCommit=we(ey.bind(null,e,t,m,r,i,d,j,T,I,ne,oe,null,K,J)),Yr(e,m,j,!X);return}}ey(e,t,m,r,i,d,j,T,I)}function EC(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var i=0;i<r.length;i++){var d=r[i],m=d.getSnapshot;d=d.value;try{if(!$n(m(),d))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Yr(e,t,r,i){t&=~kf,t&=~Ds,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var d=t;0<d;){var m=31-Tt(d),j=1<<m;i[m]=-1,d&=~j}r!==0&&Gt(e,r,t)}function wc(){return(tt&6)===0?(Ho(0),!1):!0}function If(){if($e!==null){if(it===0)var e=$e.return;else e=$e,Wa=js=null,Wd(e),gl=null,So=0,e=$e;for(;e!==null;)Sx(e.alternate,e),e=e.return;$e=null}}function El(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,YC(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),ur=0,If(),pt=e,$e=r=Za(e.current,null),Ge=t,it=0,Fn=null,qr=!1,Sl=Re(e,t),Of=!1,Cl=Xn=kf=Ds=$r=kt=0,An=Po=null,_f=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var d=31-Tt(i),m=1<<d;t|=e[d],i&=~m}return cr=t,qi(),r}function Fx(e,t){ze=null,_.H=Do,t===pl||t===Qi?(t=cv(),it=3):t===Hd?(t=cv(),it=4):it=t===gf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Fn=t,$e===null&&(kt=1,uc(e,ra(t,e.current)))}function Xx(){var e=Gn.current;return e===null?!0:(Ge&4194048)===Ge?ia===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?e===ia:!1}function Kx(){var e=_.H;return _.H=Do,e===null?Do:e}function Qx(){var e=_.A;return _.A=CC,e}function jc(){kt=4,qr||(Ge&4194048)!==Ge&&Gn.current!==null||(Sl=!0),($r&134217727)===0&&(Ds&134217727)===0||pt===null||Yr(pt,Ge,Xn,!1)}function Pf(e,t,r){var i=tt;tt|=2;var d=Kx(),m=Qx();(pt!==e||Ge!==t)&&(bc=null,El(e,t)),t=!1;var j=kt;e:do try{if(it!==0&&$e!==null){var T=$e,I=Fn;switch(it){case 8:If(),j=6;break e;case 3:case 2:case 9:case 6:Gn.current===null&&(t=!0);var X=it;if(it=0,Fn=null,Rl(e,T,I,X),r&&Sl){j=0;break e}break;default:X=it,it=0,Fn=null,Rl(e,T,I,X)}}RC(),j=kt;break}catch(ne){Fx(e,ne)}while(!0);return t&&e.shellSuspendCounter++,Wa=js=null,tt=i,_.H=d,_.A=m,$e===null&&(pt=null,Ge=0,qi()),j}function RC(){for(;$e!==null;)Zx($e)}function TC(e,t){var r=tt;tt|=2;var i=Kx(),d=Qx();pt!==e||Ge!==t?(bc=null,yc=Ct()+500,El(e,t)):Sl=Re(e,t);e:do try{if(it!==0&&$e!==null){t=$e;var m=Fn;t:switch(it){case 1:it=0,Fn=null,Rl(e,t,m,1);break;case 2:case 9:if(ov(m)){it=0,Fn=null,Jx(t);break}t=function(){it!==2&&it!==9||pt!==e||(it=7),ka(e)},m.then(t,t);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:ov(m)?(it=0,Fn=null,Jx(t)):(it=0,Fn=null,Rl(e,t,m,7));break;case 5:var j=null;switch($e.tag){case 26:j=$e.memoizedState;case 5:case 27:var T=$e;if(j?Uy(j):T.stateNode.complete){it=0,Fn=null;var I=T.sibling;if(I!==null)$e=I;else{var X=T.return;X!==null?($e=X,Sc(X)):$e=null}break t}}it=0,Fn=null,Rl(e,t,m,5);break;case 6:it=0,Fn=null,Rl(e,t,m,6);break;case 8:If(),kt=6;break e;default:throw Error(o(462))}}AC();break}catch(ne){Fx(e,ne)}while(!0);return Wa=js=null,_.H=i,_.A=d,tt=r,$e!==null?0:(pt=null,Ge=0,qi(),kt)}function AC(){for(;$e!==null&&!mn();)Zx($e)}function Zx(e){var t=wx(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?Sc(e):$e=t}function Jx(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=px(r,t,t.pendingProps,t.type,void 0,Ge);break;case 11:t=px(r,t,t.pendingProps,t.type.render,t.ref,Ge);break;case 5:Wd(t);default:Sx(r,t),t=$e=Qg(t,cr),t=wx(r,t,cr)}e.memoizedProps=e.pendingProps,t===null?Sc(e):$e=t}function Rl(e,t,r,i){Wa=js=null,Wd(t),gl=null,So=0;var d=t.return;try{if(vC(e,d,t,r,Ge)){kt=1,uc(e,ra(r,e.current)),$e=null;return}}catch(m){if(d!==null)throw $e=d,m;kt=1,uc(e,ra(r,e.current)),$e=null;return}t.flags&32768?(Xe||i===1?e=!0:Sl||(Ge&536870912)!==0?e=!1:(qr=e=!0,(i===2||i===9||i===3||i===6)&&(i=Gn.current,i!==null&&i.tag===13&&(i.flags|=16384))),Wx(t,e)):Sc(t)}function Sc(e){var t=e;do{if((t.flags&32768)!==0){Wx(t,qr);return}e=t.return;var r=bC(t.alternate,t,cr);if(r!==null){$e=r;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);kt===0&&(kt=5)}function Wx(e,t){do{var r=wC(e.alternate,e);if(r!==null){r.flags&=32767,$e=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){$e=e;return}$e=e=r}while(e!==null);kt=6,$e=null}function ey(e,t,r,i,d,m,j,T,I){e.cancelPendingCommit=null;do Cc();while(Yt!==0);if((tt&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(m=t.lanes|t.childLanes,m|=Ed,ut(e,r,m,j,T,I),e===pt&&($e=pt=null,Ge=0),Nl=t,Gr=e,ur=r,zf=m,Lf=d,$x=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,kC(pn,function(){return sy(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=_.T,_.T=null,d=q.p,q.p=2,j=tt,tt|=4;try{jC(e,t,r)}finally{tt=j,q.p=d,_.T=i}}Yt=1,ty(),ny(),ay()}}function ty(){if(Yt===1){Yt=0;var e=Gr,t=Nl,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=_.T,_.T=null;var i=q.p;q.p=2;var d=tt;tt|=4;try{zx(t,e);var m=Zf,j=Hg(e.containerInfo),T=m.focusedElem,I=m.selectionRange;if(j!==T&&T&&T.ownerDocument&&Bg(T.ownerDocument.documentElement,T)){if(I!==null&&wd(T)){var X=I.start,ne=I.end;if(ne===void 0&&(ne=X),"selectionStart"in T)T.selectionStart=X,T.selectionEnd=Math.min(ne,T.value.length);else{var oe=T.ownerDocument||document,K=oe&&oe.defaultView||window;if(K.getSelection){var J=K.getSelection(),we=T.textContent.length,De=Math.min(I.start,we),ht=I.end===void 0?De:Math.min(I.end,we);!J.extend&&De>ht&&(j=ht,ht=De,De=j);var $=Pg(T,De),B=Pg(T,ht);if($&&B&&(J.rangeCount!==1||J.anchorNode!==$.node||J.anchorOffset!==$.offset||J.focusNode!==B.node||J.focusOffset!==B.offset)){var F=oe.createRange();F.setStart($.node,$.offset),J.removeAllRanges(),De>ht?(J.addRange(F),J.extend(B.node,B.offset)):(F.setEnd(B.node,B.offset),J.addRange(F))}}}}for(oe=[],J=T;J=J.parentNode;)J.nodeType===1&&oe.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<oe.length;T++){var re=oe[T];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}Lc=!!Qf,Zf=Qf=null}finally{tt=d,q.p=i,_.T=r}}e.current=t,Yt=2}}function ny(){if(Yt===2){Yt=0;var e=Gr,t=Nl,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=_.T,_.T=null;var i=q.p;q.p=2;var d=tt;tt|=4;try{Mx(e,t.alternate,t)}finally{tt=d,q.p=i,_.T=r}}Yt=3}}function ay(){if(Yt===4||Yt===3){Yt=0,en();var e=Gr,t=Nl,r=ur,i=$x;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Yt=5:(Yt=0,Nl=Gr=null,ry(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Vr=null),Fa(r),t=t.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(ga,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=_.T,d=q.p,q.p=2,_.T=null;try{for(var m=e.onRecoverableError,j=0;j<i.length;j++){var T=i[j];m(T.value,{componentStack:T.stack})}}finally{_.T=t,q.p=d}}(ur&3)!==0&&Cc(),ka(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===Uf?Bo++:(Bo=0,Uf=e):Bo=0,Ho(0)}}function ry(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,wo(t)))}function Cc(){return ty(),ny(),ay(),sy()}function sy(){if(Yt!==5)return!1;var e=Gr,t=zf;zf=0;var r=Fa(ur),i=_.T,d=q.p;try{q.p=32>r?32:r,_.T=null,r=Lf,Lf=null;var m=Gr,j=ur;if(Yt=0,Nl=Gr=null,ur=0,(tt&6)!==0)throw Error(o(331));var T=tt;if(tt|=4,Bx(m.current),Ux(m,m.current,j,r),tt=T,Ho(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(ga,m)}catch{}return!0}finally{q.p=d,_.T=i,ry(e,t)}}function ly(e,t,r){t=ra(r,t),t=pf(e.stateNode,t,2),e=Ir(e,t,2),e!==null&&(Nt(e,2),ka(e))}function ct(e,t,r){if(e.tag===3)ly(e,e,r);else for(;t!==null;){if(t.tag===3){ly(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Vr===null||!Vr.has(i))){e=ra(r,e),r=ox(2),i=Ir(t,r,2),i!==null&&(ix(r,i,t,e),Nt(i,2),ka(i));break}}t=t.return}}function Bf(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new NC;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)||(Of=!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,pt===e&&(Ge&r)===r&&(kt===4||kt===3&&(Ge&62914560)===Ge&&300>Ct()-xc?(tt&2)===0&&El(e,0):kf|=r,Cl===Ge&&(Cl=0)),ka(e)}function oy(e,t){t===0&&(t=Ue()),e=ys(e,t),e!==null&&(Nt(e,t),ka(e))}function DC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),oy(e,r)}function OC(e,t){var r=0;switch(e.tag){case 31:case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(r=d.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(o(314))}i!==null&&i.delete(t),oy(e,r)}function kC(e,t){return St(e,t)}var Nc=null,Tl=null,Hf=!1,Ec=!1,qf=!1,Fr=0;function ka(e){e!==Tl&&e.next===null&&(Tl===null?Nc=Tl=e:Tl=Tl.next=e),Ec=!0,Hf||(Hf=!0,zC())}function Ho(e,t){if(!qf&&Ec){qf=!0;do for(var r=!1,i=Nc;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var m=0;else{var j=i.suspendedLanes,T=i.pingedLanes;m=(1<<31-Tt(42|e)+1)-1,m&=d&~(j&~T),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(r=!0,dy(i,m))}else m=Ge,m=It(i,i===pt?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(m&3)===0||Re(i,m)||(r=!0,dy(i,m));i=i.next}while(r);qf=!1}}function _C(){iy()}function iy(){Ec=Hf=!1;var e=0;Fr!==0&&GC()&&(e=Fr);for(var t=Ct(),r=null,i=Nc;i!==null;){var d=i.next,m=cy(i,t);m===0?(i.next=null,r===null?Nc=d:r.next=d,d===null&&(Tl=r)):(r=i,(e!==0||(m&3)!==0)&&(Ec=!0)),i=d}Yt!==0&&Yt!==5||Ho(e),Fr!==0&&(Fr=0)}function cy(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var j=31-Tt(m),T=1<<j,I=d[j];I===-1?((T&r)===0||(T&i)!==0)&&(d[j]=_e(T,t)):I<=t&&(e.expiredLanes|=T),m&=~T}if(t=pt,r=Ge,r=It(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,r===0||e===t&&(it===2||it===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Wt(i),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Re(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(i!==null&&Wt(i),Fa(r)){case 2:case 8:r=Mt;break;case 32:r=pn;break;case 268435456:r=Aa;break;default:r=pn}return i=uy.bind(null,e),r=St(r,i),e.callbackPriority=t,e.callbackNode=r,t}return i!==null&&i!==null&&Wt(i),e.callbackPriority=2,e.callbackNode=null,2}function uy(e,t){if(Yt!==0&&Yt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Cc()&&e.callbackNode!==r)return null;var i=Ge;return i=It(e,e===pt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Gx(e,i,t),cy(e,Ct()),e.callbackNode!=null&&e.callbackNode===r?uy.bind(null,e):null)}function dy(e,t){if(Cc())return null;Gx(e,t,!0)}function zC(){FC(function(){(tt&6)!==0?St(At,_C):iy()})}function $f(){if(Fr===0){var e=hl;e===0&&(e=Ga,Ga<<=1,(Ga&261888)===0&&(Ga=256)),Fr=e}return Fr}function fy(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_i(""+e)}function hy(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function LC(e,t,r,i,d){if(t==="submit"&&r&&r.stateNode===d){var m=fy((d[Cn]||null).action),j=i.submitter;j&&(t=(t=j[Cn]||null)?fy(t.formAction):j.getAttribute("formAction"),t!==null&&(m=t,j=null));var T=new Ii("action","action",null,i,d);e.push({event:T,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Fr!==0){var I=j?hy(d,j):new FormData(d);cf(r,{pending:!0,data:I,method:d.method,action:m},null,I)}}else typeof m=="function"&&(T.preventDefault(),I=j?hy(d,j):new FormData(d),cf(r,{pending:!0,data:I,method:d.method,action:m},m,I))},currentTarget:d}]})}}for(var Vf=0;Vf<Nd.length;Vf++){var Gf=Nd[Vf],UC=Gf.toLowerCase(),IC=Gf[0].toUpperCase()+Gf.slice(1);xa(UC,"on"+IC)}xa(Vg,"onAnimationEnd"),xa(Gg,"onAnimationIteration"),xa(Yg,"onAnimationStart"),xa("dblclick","onDoubleClick"),xa("focusin","onFocus"),xa("focusout","onBlur"),xa(eC,"onTransitionRun"),xa(tC,"onTransitionStart"),xa(nC,"onTransitionCancel"),xa(Fg,"onTransitionEnd"),Ws("onMouseEnter",["mouseout","mouseover"]),Ws("onMouseLeave",["mouseout","mouseover"]),Ws("onPointerEnter",["pointerout","pointerover"]),Ws("onPointerLeave",["pointerout","pointerover"]),ps("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ps("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ps("onBeforeInput",["compositionend","keypress","textInput","paste"]),ps("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ps("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ps("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),PC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qo));function my(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],d=i.event;i=i.listeners;e:{var m=void 0;if(t)for(var j=i.length-1;0<=j;j--){var T=i[j],I=T.instance,X=T.currentTarget;if(T=T.listener,I!==m&&d.isPropagationStopped())break e;m=T,d.currentTarget=X;try{m(d)}catch(ne){Hi(ne)}d.currentTarget=null,m=I}else for(j=0;j<i.length;j++){if(T=i[j],I=T.instance,X=T.currentTarget,T=T.listener,I!==m&&d.isPropagationStopped())break e;m=T,d.currentTarget=X;try{m(d)}catch(ne){Hi(ne)}d.currentTarget=null,m=I}}}}function Ve(e,t){var r=t[ad];r===void 0&&(r=t[ad]=new Set);var i=e+"__bubble";r.has(i)||(py(t,e,2,!1),r.add(i))}function Yf(e,t,r){var i=0;t&&(i|=4),py(r,e,i,t)}var Rc="_reactListening"+Math.random().toString(36).slice(2);function Ff(e){if(!e[Rc]){e[Rc]=!0,ig.forEach(function(r){r!=="selectionchange"&&(PC.has(r)||Yf(r,!1,e),Yf(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Rc]||(t[Rc]=!0,Yf("selectionchange",!1,t))}}function py(e,t,r,i){switch(Vy(t)){case 2:var d=h2;break;case 8:d=m2;break;default:d=ih}r=d.bind(null,t,r,e),d=void 0,!fd||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 Xf(e,t,r,i,d){var m=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var j=i.tag;if(j===3||j===4){var T=i.stateNode.containerInfo;if(T===d)break;if(j===4)for(j=i.return;j!==null;){var I=j.tag;if((I===3||I===4)&&j.stateNode.containerInfo===d)return;j=j.return}for(;T!==null;){if(j=Qs(T),j===null)return;if(I=j.tag,I===5||I===6||I===26||I===27){i=m=j;continue e}T=T.parentNode}}i=i.return}bg(function(){var X=m,ne=ud(r),oe=[];e:{var K=Xg.get(e);if(K!==void 0){var J=Ii,we=e;switch(e){case"keypress":if(Li(r)===0)break e;case"keydown":case"keyup":J=OS;break;case"focusin":we="focus",J=gd;break;case"focusout":we="blur",J=gd;break;case"beforeblur":case"afterblur":J=gd;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":J=Sg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=bS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=zS;break;case Vg:case Gg:case Yg:J=SS;break;case Fg:J=US;break;case"scroll":case"scrollend":J=xS;break;case"wheel":J=PS;break;case"copy":case"cut":case"paste":J=NS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=Ng;break;case"toggle":case"beforetoggle":J=HS}var De=(t&4)!==0,ht=!De&&(e==="scroll"||e==="scrollend"),$=De?K!==null?K+"Capture":null:K;De=[];for(var B=X,F;B!==null;){var re=B;if(F=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||F===null||$===null||(re=co(B,$),re!=null&&De.push($o(B,re,F))),ht)break;B=B.return}0<De.length&&(K=new J(K,we,null,r,ne),oe.push({event:K,listeners:De}))}}if((t&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",K&&r!==cd&&(we=r.relatedTarget||r.fromElement)&&(Qs(we)||we[Ks]))break e;if((J||K)&&(K=ne.window===ne?ne:(K=ne.ownerDocument)?K.defaultView||K.parentWindow:window,J?(we=r.relatedTarget||r.toElement,J=X,we=we?Qs(we):null,we!==null&&(ht=u(we),De=we.tag,we!==ht||De!==5&&De!==27&&De!==6)&&(we=null)):(J=null,we=X),J!==we)){if(De=Sg,re="onMouseLeave",$="onMouseEnter",B="mouse",(e==="pointerout"||e==="pointerover")&&(De=Ng,re="onPointerLeave",$="onPointerEnter",B="pointer"),ht=J==null?K:io(J),F=we==null?K:io(we),K=new De(re,B+"leave",J,r,ne),K.target=ht,K.relatedTarget=F,re=null,Qs(ne)===X&&(De=new De($,B+"enter",we,r,ne),De.target=F,De.relatedTarget=ht,re=De),ht=re,J&&we)t:{for(De=BC,$=J,B=we,F=0,re=$;re;re=De(re))F++;re=0;for(var Te=B;Te;Te=De(Te))re++;for(;0<F-re;)$=De($),F--;for(;0<re-F;)B=De(B),re--;for(;F--;){if($===B||B!==null&&$===B.alternate){De=$;break t}$=De($),B=De(B)}De=null}else De=null;J!==null&&gy(oe,K,J,De,!1),we!==null&&ht!==null&&gy(oe,ht,we,De,!0)}}e:{if(K=X?io(X):window,J=K.nodeName&&K.nodeName.toLowerCase(),J==="select"||J==="input"&&K.type==="file")var Ze=kg;else if(Dg(K))if(_g)Ze=ZS;else{Ze=KS;var je=XS}else J=K.nodeName,!J||J.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?X&&id(X.elementType)&&(Ze=kg):Ze=QS;if(Ze&&(Ze=Ze(e,X))){Og(oe,Ze,r,ne);break e}je&&je(e,K,X),e==="focusout"&&X&&K.type==="number"&&X.memoizedProps.value!=null&&od(K,"number",K.value)}switch(je=X?io(X):window,e){case"focusin":(Dg(je)||je.contentEditable==="true")&&(sl=je,jd=X,xo=null);break;case"focusout":xo=jd=sl=null;break;case"mousedown":Sd=!0;break;case"contextmenu":case"mouseup":case"dragend":Sd=!1,qg(oe,r,ne);break;case"selectionchange":if(WS)break;case"keydown":case"keyup":qg(oe,r,ne)}var Ie;if(xd)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else rl?Ag(e,r)&&(Ye="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ye="onCompositionStart");Ye&&(Eg&&r.locale!=="ko"&&(rl||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&rl&&(Ie=wg()):(Dr=ne,hd="value"in Dr?Dr.value:Dr.textContent,rl=!0)),je=Tc(X,Ye),0<je.length&&(Ye=new Cg(Ye,e,null,r,ne),oe.push({event:Ye,listeners:je}),Ie?Ye.data=Ie:(Ie=Mg(r),Ie!==null&&(Ye.data=Ie)))),(Ie=$S?VS(e,r):GS(e,r))&&(Ye=Tc(X,"onBeforeInput"),0<Ye.length&&(je=new Cg("onBeforeInput","beforeinput",null,r,ne),oe.push({event:je,listeners:Ye}),je.data=Ie)),LC(oe,e,X,r,ne)}my(oe,t)})}function $o(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Tc(e,t){for(var r=t+"Capture",i=[];e!==null;){var d=e,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=co(e,r),d!=null&&i.unshift($o(e,d,m)),d=co(e,t),d!=null&&i.push($o(e,d,m))),e.tag===3)return i;e=e.return}return[]}function BC(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function gy(e,t,r,i,d){for(var m=t._reactName,j=[];r!==null&&r!==i;){var T=r,I=T.alternate,X=T.stateNode;if(T=T.tag,I!==null&&I===i)break;T!==5&&T!==26&&T!==27||X===null||(I=X,d?(X=co(r,m),X!=null&&j.unshift($o(r,X,I))):d||(X=co(r,m),X!=null&&j.push($o(r,X,I)))),r=r.return}j.length!==0&&e.push({event:t,listeners:j})}var HC=/\r\n?/g,qC=/\u0000|\uFFFD/g;function vy(e){return(typeof e=="string"?e:""+e).replace(HC,`
|
|
49
|
-
`).replace(qC,"")}function xy(e,t){return t=vy(t),vy(e)===t}function ft(e,t,r,i,d,m){switch(r){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||tl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&tl(e,""+i);break;case"className":Oi(e,"class",i);break;case"tabIndex":Oi(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Oi(e,r,i);break;case"style":xg(e,i,m);break;case"data":if(t!=="object"){Oi(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=_i(""+i),e.setAttribute(r,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(r==="formAction"?(t!=="input"&&ft(e,t,"name",d.name,d,null),ft(e,t,"formEncType",d.formEncType,d,null),ft(e,t,"formMethod",d.formMethod,d,null),ft(e,t,"formTarget",d.formTarget,d,null)):(ft(e,t,"encType",d.encType,d,null),ft(e,t,"method",d.method,d,null),ft(e,t,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=_i(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=Ka);break;case"onScroll":i!=null&&Ve("scroll",e);break;case"onScrollEnd":i!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}r=_i(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""+i):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":i===!0?e.setAttribute(r,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,i):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(r,i):e.removeAttribute(r);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(r):e.setAttribute(r,i);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),Di(e,"popover",i);break;case"xlinkActuate":Xa(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Xa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Xa(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Xa(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Xa(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Xa(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Di(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=gS.get(r)||r,Di(e,r,i))}}function Kf(e,t,r,i,d,m){switch(r){case"style":xg(e,i,m);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"children":typeof i=="string"?tl(e,i):(typeof i=="number"||typeof i=="bigint")&&tl(e,""+i);break;case"onScroll":i!=null&&Ve("scroll",e);break;case"onScrollEnd":i!=null&&Ve("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Ka);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!cg.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),t=r.slice(2,d?r.length-7:void 0),m=e[Cn]||null,m=m!=null?m[r]:null,typeof m=="function"&&e.removeEventListener(t,m,d),typeof i=="function")){typeof m!="function"&&m!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,i,d);break e}r in e?e[r]=i:i===!0?e.setAttribute(r,""):Di(e,r,i)}}}function fn(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var i=!1,d=!1,m;for(m in r)if(r.hasOwnProperty(m)){var j=r[m];if(j!=null)switch(m){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ft(e,t,m,j,r,null)}}d&&ft(e,t,"srcSet",r.srcSet,r,null),i&&ft(e,t,"src",r.src,r,null);return;case"input":Ve("invalid",e);var T=m=j=d=null,I=null,X=null;for(i in r)if(r.hasOwnProperty(i)){var ne=r[i];if(ne!=null)switch(i){case"name":d=ne;break;case"type":j=ne;break;case"checked":I=ne;break;case"defaultChecked":X=ne;break;case"value":m=ne;break;case"defaultValue":T=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,t));break;default:ft(e,t,i,ne,r,null)}}mg(e,m,T,I,X,j,d,!1);return;case"select":Ve("invalid",e),i=j=m=null;for(d in r)if(r.hasOwnProperty(d)&&(T=r[d],T!=null))switch(d){case"value":m=T;break;case"defaultValue":j=T;break;case"multiple":i=T;default:ft(e,t,d,T,r,null)}t=m,r=j,e.multiple=!!i,t!=null?el(e,!!i,t,!1):r!=null&&el(e,!!i,r,!0);return;case"textarea":Ve("invalid",e),m=d=i=null;for(j in r)if(r.hasOwnProperty(j)&&(T=r[j],T!=null))switch(j){case"value":i=T;break;case"defaultValue":d=T;break;case"children":m=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(91));break;default:ft(e,t,j,T,r,null)}gg(e,i,d,m);return;case"option":for(I in r)if(r.hasOwnProperty(I)&&(i=r[I],i!=null))switch(I){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:ft(e,t,I,i,r,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(i=0;i<qo.length;i++)Ve(qo[i],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in r)if(r.hasOwnProperty(X)&&(i=r[X],i!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ft(e,t,X,i,r,null)}return;default:if(id(t)){for(ne in r)r.hasOwnProperty(ne)&&(i=r[ne],i!==void 0&&Kf(e,t,ne,i,r,void 0));return}}for(T in r)r.hasOwnProperty(T)&&(i=r[T],i!=null&&ft(e,t,T,i,r,null))}function $C(e,t,r,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,j=null,T=null,I=null,X=null,ne=null;for(J in r){var oe=r[J];if(r.hasOwnProperty(J)&&oe!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":I=oe;default:i.hasOwnProperty(J)||ft(e,t,J,null,i,oe)}}for(var K in i){var J=i[K];if(oe=r[K],i.hasOwnProperty(K)&&(J!=null||oe!=null))switch(K){case"type":m=J;break;case"name":d=J;break;case"checked":X=J;break;case"defaultChecked":ne=J;break;case"value":j=J;break;case"defaultValue":T=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(o(137,t));break;default:J!==oe&&ft(e,t,K,J,i,oe)}}ld(e,j,T,I,X,ne,m,d);return;case"select":J=j=T=K=null;for(m in r)if(I=r[m],r.hasOwnProperty(m)&&I!=null)switch(m){case"value":break;case"multiple":J=I;default:i.hasOwnProperty(m)||ft(e,t,m,null,i,I)}for(d in i)if(m=i[d],I=r[d],i.hasOwnProperty(d)&&(m!=null||I!=null))switch(d){case"value":K=m;break;case"defaultValue":T=m;break;case"multiple":j=m;default:m!==I&&ft(e,t,d,m,i,I)}t=T,r=j,i=J,K!=null?el(e,!!r,K,!1):!!i!=!!r&&(t!=null?el(e,!!r,t,!0):el(e,!!r,r?[]:"",!1));return;case"textarea":J=K=null;for(T in r)if(d=r[T],r.hasOwnProperty(T)&&d!=null&&!i.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:ft(e,t,T,null,i,d)}for(j in i)if(d=i[j],m=r[j],i.hasOwnProperty(j)&&(d!=null||m!=null))switch(j){case"value":K=d;break;case"defaultValue":J=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==m&&ft(e,t,j,d,i,m)}pg(e,K,J);return;case"option":for(var we in r)if(K=r[we],r.hasOwnProperty(we)&&K!=null&&!i.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:ft(e,t,we,null,i,K)}for(I in i)if(K=i[I],J=r[I],i.hasOwnProperty(I)&&K!==J&&(K!=null||J!=null))switch(I){case"selected":e.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:ft(e,t,I,K,i,J)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var De in r)K=r[De],r.hasOwnProperty(De)&&K!=null&&!i.hasOwnProperty(De)&&ft(e,t,De,null,i,K);for(X in i)if(K=i[X],J=r[X],i.hasOwnProperty(X)&&K!==J&&(K!=null||J!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(o(137,t));break;default:ft(e,t,X,K,i,J)}return;default:if(id(t)){for(var ht in r)K=r[ht],r.hasOwnProperty(ht)&&K!==void 0&&!i.hasOwnProperty(ht)&&Kf(e,t,ht,void 0,i,K);for(ne in i)K=i[ne],J=r[ne],!i.hasOwnProperty(ne)||K===J||K===void 0&&J===void 0||Kf(e,t,ne,K,i,J);return}}for(var $ in r)K=r[$],r.hasOwnProperty($)&&K!=null&&!i.hasOwnProperty($)&&ft(e,t,$,null,i,K);for(oe in i)K=i[oe],J=r[oe],!i.hasOwnProperty(oe)||K===J||K==null&&J==null||ft(e,t,oe,K,i,J)}function yy(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function VC(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,r=performance.getEntriesByType("resource"),i=0;i<r.length;i++){var d=r[i],m=d.transferSize,j=d.initiatorType,T=d.duration;if(m&&T&&yy(j)){for(j=0,T=d.responseEnd,i+=1;i<r.length;i++){var I=r[i],X=I.startTime;if(X>T)break;var ne=I.transferSize,oe=I.initiatorType;ne&&yy(oe)&&(I=I.responseEnd,j+=ne*(I<T?1:(T-X)/(I-X)))}if(--i,t+=8*(m+j)/(d.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Qf=null,Zf=null;function Ac(e){return e.nodeType===9?e:e.ownerDocument}function by(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function wy(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Jf(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 Wf=null;function GC(){var e=window.event;return e&&e.type==="popstate"?e===Wf?!1:(Wf=e,!0):(Wf=null,!1)}var jy=typeof setTimeout=="function"?setTimeout:void 0,YC=typeof clearTimeout=="function"?clearTimeout:void 0,Sy=typeof Promise=="function"?Promise:void 0,FC=typeof queueMicrotask=="function"?queueMicrotask:typeof Sy<"u"?function(e){return Sy.resolve(null).then(e).catch(XC)}:jy;function XC(e){setTimeout(function(){throw e})}function Xr(e){return e==="head"}function Cy(e,t){var r=t,i=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(i===0){e.removeChild(d),Ol(t);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")Vo(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Vo(r);for(var m=r.firstChild;m;){var j=m.nextSibling,T=m.nodeName;m[oo]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&m.rel.toLowerCase()==="stylesheet"||r.removeChild(m),m=j}}else r==="body"&&Vo(e.ownerDocument.body);r=d}while(r);Ol(t)}function Ny(e,t){var r=e;e=0;do{var i=r.nextSibling;if(r.nodeType===1?t?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(t?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=i}while(r)}function eh(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":eh(r),rd(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function KC(e,t,r,i){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[oo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=ca(e.nextSibling),e===null)break}return null}function QC(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=ca(e.nextSibling),e===null))return null;return e}function Ey(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ca(e.nextSibling),e===null))return null;return e}function th(e){return e.data==="$?"||e.data==="$~"}function nh(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 ca(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ah=null;function Ry(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return ca(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function Ty(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(t===0)return e;t--}else r!=="/$"&&r!=="/&"||t++}e=e.previousSibling}return null}function Ay(e,t,r){switch(t=Ac(r),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Vo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);rd(e)}var ua=new Map,My=new Set;function Mc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var dr=q.d;q.d={f:JC,r:WC,D:e2,C:t2,L:n2,m:a2,X:s2,S:r2,M:l2};function JC(){var e=dr.f(),t=wc();return e||t}function WC(e){var t=Zs(e);t!==null&&t.tag===5&&t.type==="form"?Fv(t):dr.r(e)}var Al=typeof document>"u"?null:document;function Dy(e,t,r){var i=Al;if(i&&typeof t=="string"&&t){var d=na(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),My.has(d)||(My.add(d),e={rel:e,crossOrigin:r,href:t},i.querySelector(d)===null&&(t=i.createElement("link"),fn(t,"link",e),tn(t),i.head.appendChild(t)))}}function e2(e){dr.D(e),Dy("dns-prefetch",e,null)}function t2(e,t){dr.C(e,t),Dy("preconnect",e,t)}function n2(e,t,r){dr.L(e,t,r);var i=Al;if(i&&e&&t){var d='link[rel="preload"][as="'+na(t)+'"]';t==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+na(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+na(r.imageSizes)+'"]')):d+='[href="'+na(e)+'"]';var m=d;switch(t){case"style":m=Ml(e);break;case"script":m=Dl(e)}ua.has(m)||(e=y({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),ua.set(m,e),i.querySelector(d)!==null||t==="style"&&i.querySelector(Go(m))||t==="script"&&i.querySelector(Yo(m))||(t=i.createElement("link"),fn(t,"link",e),tn(t),i.head.appendChild(t)))}}function a2(e,t){dr.m(e,t);var r=Al;if(r&&e){var i=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+na(i)+'"][href="'+na(e)+'"]',m=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Dl(e)}if(!ua.has(m)&&(e=y({rel:"modulepreload",href:e},t),ua.set(m,e),r.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Yo(m)))return}i=r.createElement("link"),fn(i,"link",e),tn(i),r.head.appendChild(i)}}}function r2(e,t,r){dr.S(e,t,r);var i=Al;if(i&&e){var d=Js(i).hoistableStyles,m=Ml(e);t=t||"default";var j=d.get(m);if(!j){var T={loading:0,preload:null};if(j=i.querySelector(Go(m)))T.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},r),(r=ua.get(m))&&rh(e,r);var I=j=i.createElement("link");tn(I),fn(I,"link",e),I._p=new Promise(function(X,ne){I.onload=X,I.onerror=ne}),I.addEventListener("load",function(){T.loading|=1}),I.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Dc(j,t,i)}j={type:"stylesheet",instance:j,count:1,state:T},d.set(m,j)}}}function s2(e,t){dr.X(e,t);var r=Al;if(r&&e){var i=Js(r).hoistableScripts,d=Dl(e),m=i.get(d);m||(m=r.querySelector(Yo(d)),m||(e=y({src:e,async:!0},t),(t=ua.get(d))&&sh(e,t),m=r.createElement("script"),tn(m),fn(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function l2(e,t){dr.M(e,t);var r=Al;if(r&&e){var i=Js(r).hoistableScripts,d=Dl(e),m=i.get(d);m||(m=r.querySelector(Yo(d)),m||(e=y({src:e,async:!0,type:"module"},t),(t=ua.get(d))&&sh(e,t),m=r.createElement("script"),tn(m),fn(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function Oy(e,t,r,i){var d=(d=ye.current)?Mc(d):null;if(!d)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=Ml(r.href),r=Js(d).hoistableStyles,i=r.get(t),i||(i={type:"style",instance:null,count:0,state:null},r.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Ml(r.href);var m=Js(d).hoistableStyles,j=m.get(e);if(j||(d=d.ownerDocument||d,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,j),(m=d.querySelector(Go(e)))&&!m._p&&(j.instance=m,j.state.loading=5),ua.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},ua.set(e,r),m||o2(d,e,r,j.state))),t&&i===null)throw Error(o(528,""));return j}if(t&&i!==null)throw Error(o(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Dl(r),r=Js(d).hoistableScripts,i=r.get(t),i||(i={type:"script",instance:null,count:0,state:null},r.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ml(e){return'href="'+na(e)+'"'}function Go(e){return'link[rel="stylesheet"]['+e+"]"}function ky(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function o2(e,t,r,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),fn(t,"link",r),tn(t),e.head.appendChild(t))}function Dl(e){return'[src="'+na(e)+'"]'}function Yo(e){return"script[async]"+e}function _y(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+na(r.href)+'"]');if(i)return t.instance=i,tn(i),i;var d=y({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),tn(i),fn(i,"style",d),Dc(i,r.precedence,e),t.instance=i;case"stylesheet":d=Ml(r.href);var m=e.querySelector(Go(d));if(m)return t.state.loading|=4,t.instance=m,tn(m),m;i=ky(r),(d=ua.get(d))&&rh(i,d),m=(e.ownerDocument||e).createElement("link"),tn(m);var j=m;return j._p=new Promise(function(T,I){j.onload=T,j.onerror=I}),fn(m,"link",i),t.state.loading|=4,Dc(m,r.precedence,e),t.instance=m;case"script":return m=Dl(r.src),(d=e.querySelector(Yo(m)))?(t.instance=d,tn(d),d):(i=r,(d=ua.get(m))&&(i=y({},r),sh(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),tn(d),fn(d,"link",i),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Dc(i,r.precedence,e));return t.instance}function Dc(e,t,r){for(var i=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,m=d,j=0;j<i.length;j++){var T=i[j];if(T.dataset.precedence===t)m=T;else if(m!==d)break}m?m.parentNode.insertBefore(e,m.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function rh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function sh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Oc=null;function zy(e,t,r){if(Oc===null){var i=new Map,d=Oc=new Map;d.set(r,i)}else d=Oc,i=d.get(r),i||(i=new Map,d.set(r,i));if(i.has(e))return i;for(i.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var m=r[d];if(!(m[oo]||m[on]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var j=m.getAttribute(t)||"";j=e+j;var T=i.get(j);T?T.push(m):i.set(j,[m])}}return i}function Ly(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function i2(e,t,r){if(r===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Uy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function c2(e,t,r,i){if(r.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=Ml(i.href),m=t.querySelector(Go(d));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=kc.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=m,tn(m);return}m=t.ownerDocument||t,i=ky(i),(d=ua.get(d))&&rh(i,d),m=m.createElement("link"),tn(m);var j=m;j._p=new Promise(function(T,I){j.onload=T,j.onerror=I}),fn(m,"link",i),r.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=kc.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var lh=0;function u2(e,t){return e.stylesheets&&e.count===0&&zc(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&zc(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+t);0<e.imgBytes&&lh===0&&(lh=62500*VC());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&zc(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>lh?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function kc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _c=null;function zc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_c=new Map,t.forEach(d2,e),_c=null,kc.call(e))}function d2(e,t){if(!(t.state.loading&4)){var r=_c.get(e);if(r)var i=r.get(null);else{r=new Map,_c.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var j=d[m];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(r.set(j.dataset.precedence,j),i=j)}i&&r.set(null,i)}d=t.instance,j=d.getAttribute("data-precedence"),m=r.get(j)||i,m===i&&r.set(null,d),r.set(j,d),this.count++,i=kc.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),m?m.parentNode.insertBefore(d,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Fo={$$typeof:A,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function f2(e,t,r,i,d,m,j,T,I){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function Iy(e,t,r,i,d,m,j,T,I,X,ne,oe){return e=new f2(e,t,r,j,I,X,ne,oe,T),t=1,m===!0&&(t|=24),m=Vn(3,null,null,t),e.current=m,m.stateNode=e,t=Id(),t.refCount++,e.pooledCache=t,t.refCount++,m.memoizedState={element:i,isDehydrated:r,cache:t},qd(m),e}function Py(e){return e?(e=il,e):il}function By(e,t,r,i,d,m){d=Py(d),i.context===null?i.context=d:i.pendingContext=d,i=Ur(t),i.payload={element:r},m=m===void 0?null:m,m!==null&&(i.callback=m),r=Ir(e,i,t),r!==null&&(Mn(r,e,t),No(r,e,t))}function Hy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function oh(e,t){Hy(e,t),(e=e.alternate)&&Hy(e,t)}function qy(e){if(e.tag===13||e.tag===31){var t=ys(e,67108864);t!==null&&Mn(t,e,67108864),oh(e,67108864)}}function $y(e){if(e.tag===13||e.tag===31){var t=Kn();t=Ya(t);var r=ys(e,t);r!==null&&Mn(r,e,t),oh(e,t)}}var Lc=!0;function h2(e,t,r,i){var d=_.T;_.T=null;var m=q.p;try{q.p=2,ih(e,t,r,i)}finally{q.p=m,_.T=d}}function m2(e,t,r,i){var d=_.T;_.T=null;var m=q.p;try{q.p=8,ih(e,t,r,i)}finally{q.p=m,_.T=d}}function ih(e,t,r,i){if(Lc){var d=ch(i);if(d===null)Xf(e,t,i,Uc,r),Gy(e,i);else if(g2(d,e,t,r,i))i.stopPropagation();else if(Gy(e,i),t&4&&-1<p2.indexOf(e)){for(;d!==null;){var m=Zs(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var j=at(m.pendingLanes);if(j!==0){var T=m;for(T.pendingLanes|=2,T.entangledLanes|=2;j;){var I=1<<31-Tt(j);T.entanglements[1]|=I,j&=~I}ka(m),(tt&6)===0&&(yc=Ct()+500,Ho(0))}}break;case 31:case 13:T=ys(m,2),T!==null&&Mn(T,m,2),wc(),oh(m,2)}if(m=ch(i),m===null&&Xf(e,t,i,Uc,r),m===d)break;d=m}d!==null&&i.stopPropagation()}else Xf(e,t,i,null,r)}}function ch(e){return e=ud(e),uh(e)}var Uc=null;function uh(e){if(Uc=null,e=Qs(e),e!==null){var t=u(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=f(t),e!==null)return e;e=null}else if(r===31){if(e=p(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Uc=e,null}function Vy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(xn()){case At:return 2;case Mt:return 8;case pn:case pa:return 32;case Aa:return 268435456;default:return 32}default:return 32}}var dh=!1,Kr=null,Qr=null,Zr=null,Xo=new Map,Ko=new Map,Jr=[],p2="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 Gy(e,t){switch(e){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Qr=null;break;case"mouseover":case"mouseout":Zr=null;break;case"pointerover":case"pointerout":Xo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ko.delete(t.pointerId)}}function Qo(e,t,r,i,d,m){return e===null||e.nativeEvent!==m?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:m,targetContainers:[d]},t!==null&&(t=Zs(t),t!==null&&qy(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function g2(e,t,r,i,d){switch(t){case"focusin":return Kr=Qo(Kr,e,t,r,i,d),!0;case"dragenter":return Qr=Qo(Qr,e,t,r,i,d),!0;case"mouseover":return Zr=Qo(Zr,e,t,r,i,d),!0;case"pointerover":var m=d.pointerId;return Xo.set(m,Qo(Xo.get(m)||null,e,t,r,i,d)),!0;case"gotpointercapture":return m=d.pointerId,Ko.set(m,Qo(Ko.get(m)||null,e,t,r,i,d)),!0}return!1}function Yy(e){var t=Qs(e.target);if(t!==null){var r=u(t);if(r!==null){if(t=r.tag,t===13){if(t=f(r),t!==null){e.blockedOn=t,Mr(e.priority,function(){$y(r)});return}}else if(t===31){if(t=p(r),t!==null){e.blockedOn=t,Mr(e.priority,function(){$y(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ic(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ch(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);cd=i,r.target.dispatchEvent(i),cd=null}else return t=Zs(r),t!==null&&qy(t),e.blockedOn=r,!1;t.shift()}return!0}function Fy(e,t,r){Ic(e)&&r.delete(t)}function v2(){dh=!1,Kr!==null&&Ic(Kr)&&(Kr=null),Qr!==null&&Ic(Qr)&&(Qr=null),Zr!==null&&Ic(Zr)&&(Zr=null),Xo.forEach(Fy),Ko.forEach(Fy)}function Pc(e,t){e.blockedOn===t&&(e.blockedOn=null,dh||(dh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,v2)))}var Bc=null;function Xy(e){Bc!==e&&(Bc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Bc===e&&(Bc=null);for(var t=0;t<e.length;t+=3){var r=e[t],i=e[t+1],d=e[t+2];if(typeof i!="function"){if(uh(i||r)===null)continue;break}var m=Zs(r);m!==null&&(e.splice(t,3),t-=3,cf(m,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function Ol(e){function t(I){return Pc(I,e)}Kr!==null&&Pc(Kr,e),Qr!==null&&Pc(Qr,e),Zr!==null&&Pc(Zr,e),Xo.forEach(t),Ko.forEach(t);for(var r=0;r<Jr.length;r++){var i=Jr[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Jr.length&&(r=Jr[0],r.blockedOn===null);)Yy(r),r.blockedOn===null&&Jr.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(i=0;i<r.length;i+=3){var d=r[i],m=r[i+1],j=d[Cn]||null;if(typeof m=="function")j||Xy(r);else if(j){var T=null;if(m&&m.hasAttribute("formAction")){if(d=m,j=m[Cn]||null)T=j.formAction;else if(uh(d)!==null)continue}else T=j.action;typeof T=="function"?r[i+1]=T:(r.splice(i,3),i-=3),Xy(r)}}}function Ky(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(j){return d=j})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),i||setTimeout(r,20)}function r(){if(!i&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(r,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function fh(e){this._internalRoot=e}Hc.prototype.render=fh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var r=t.current,i=Kn();By(r,i,e,t,null,null)},Hc.prototype.unmount=fh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;By(e.current,2,null,e,null,null),wc(),t[Ks]=null}};function Hc(e){this._internalRoot=e}Hc.prototype.unstable_scheduleHydration=function(e){if(e){var t=va();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Jr.length&&t!==0&&t<Jr[r].priority;r++);Jr.splice(r,0,e),r===0&&Yy(e)}};var Qy=a.version;if(Qy!=="19.2.8")throw Error(o(527,Qy,"19.2.8"));q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var x2={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qc.isDisabled&&qc.supportsFiber)try{ga=qc.inject(x2),Dt=qc}catch{}}return Jo.createRoot=function(e,t){if(!c(e))throw Error(o(299));var r=!1,i="",d=ax,m=rx,j=sx;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(m=t.onCaughtError),t.onRecoverableError!==void 0&&(j=t.onRecoverableError)),t=Iy(e,1,!1,null,null,r,i,null,d,m,j,Ky),e[Ks]=t.current,Ff(e),new fh(t)},Jo.hydrateRoot=function(e,t,r){if(!c(e))throw Error(o(299));var i=!1,d="",m=ax,j=rx,T=sx,I=null;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(m=r.onUncaughtError),r.onCaughtError!==void 0&&(j=r.onCaughtError),r.onRecoverableError!==void 0&&(T=r.onRecoverableError),r.formState!==void 0&&(I=r.formState)),t=Iy(e,1,!0,t,r??null,i,d,I,m,j,T,Ky),t.context=Py(null),r=t.current,i=Kn(),i=Ya(i),d=Ur(i),d.callback=null,Ir(r,d,i),r=i,t.current.lanes=r,Nt(t,r),ka(t),e[Ks]=t.current,Ff(e),new Hc(t)},Jo.version="19.2.8",Jo}var cb;function T2(){if(cb)return gh.exports;cb=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),gh.exports=R2(),gh.exports}var A2=T2();const M2=Rm(A2);/**
|
|
50
|
-
* react-router v7.18.2
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var Am=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,v0=/^[\\/]{2}/;function D2(n,a){return a+n.replace(/\\/g,"/")}var ub="popstate";function db(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function O2(n={}){function a(o,c){var v;let u=(v=c.state)==null?void 0:v.masked,{pathname:f,search:p,hash:g}=u||o.location;return qh("",{pathname:f,search:p,hash:g},c.state&&c.state.usr||null,c.state&&c.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function l(o,c){return typeof c=="string"?c:si(c)}return _2(a,l,null,n)}function Rt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function ha(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function k2(){return Math.random().toString(36).substring(2,10)}function fb(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function qh(n,a,l=null,o,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Yl(a):a,state:l,key:a&&a.key||o||k2(),mask:c}}function si({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 Yl(n){let a={};if(n){let l=n.indexOf("#");l>=0&&(a.hash=n.substring(l),n=n.substring(0,l));let o=n.indexOf("?");o>=0&&(a.search=n.substring(o),n=n.substring(0,o)),n&&(a.pathname=n)}return a}function _2(n,a,l,o={}){let{window:c=document.defaultView,v5Compat:u=!1}=o,f=c.history,p="POP",g=null,v=x();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function x(){return(f.state||{idx:null}).idx}function y(){p="POP";let C=x(),R=C==null?null:C-v;v=C,g&&g({action:p,location:S.location,delta:R})}function b(C,R){p="PUSH";let D=db(C)?C:qh(S.location,C,R);v=x()+1;let A=fb(D,v),M=S.createHref(D.mask||D);try{f.pushState(A,"",M)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;c.location.assign(M)}u&&g&&g({action:p,location:S.location,delta:1})}function w(C,R){p="REPLACE";let D=db(C)?C:qh(S.location,C,R);v=x();let A=fb(D,v),M=S.createHref(D.mask||D);f.replaceState(A,"",M),u&&g&&g({action:p,location:S.location,delta:0})}function N(C){return z2(c,C)}let S={get action(){return p},get location(){return n(c,f)},listen(C){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(ub,y),g=C,()=>{c.removeEventListener(ub,y),g=null}},createHref(C){return a(c,C)},createURL:N,encodeLocation(C){let R=N(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:b,replace:w,go(C){return f.go(C)}};return S}function z2(n,a,l=!1){let o="http://localhost";n&&(o=n.location.origin!=="null"?n.location.origin:n.location.href),Rt(o,"No window.location.(origin|href) available to create URL");let c=typeof a=="string"?a:si(a);return c=c.replace(/ $/,"%20"),!l&&v0.test(c)&&(c=o+c),new URL(c,o)}function x0(n,a,l="/"){return L2(n,a,l,!1)}function L2(n,a,l,o,c){let u=typeof a=="string"?Yl(a):a,f=yr(u.pathname||"/",l);if(f==null)return null;let p=U2(n),g=null,v=X2(f);for(let x=0;g==null&&x<p.length;++x)g=F2(p[x],v,o);return g}function U2(n){let a=y0(n);return I2(a),a}function y0(n,a=[],l=[],o="",c=!1){let u=(f,p,g=c,v)=>{let x={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(o)&&g)return;Rt(x.relativePath.startsWith(o),`Absolute route path "${x.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(o.length)}let y=Ca([o,x.relativePath]),b=l.concat(x);f.children&&f.children.length>0&&(Rt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),y0(f.children,a,b,y,g)),!(f.path==null&&!f.index)&&a.push({path:y,score:G2(y,f.index),routesMeta:b.map((w,N)=>{let[S,C]=j0(w.relativePath,w.caseSensitive,N===b.length-1);return{...w,matcher:S,compiledParams:C}})})};return n.forEach((f,p)=>{var g;if(f.path===""||!((g=f.path)!=null&&g.includes("?")))u(f,p);else for(let v of b0(f.path))u(f,p,!0,v)}),a}function b0(n){let a=n.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let f=b0(o.join("/")),p=[];return p.push(...f.map(g=>g===""?u:[u,g].join("/"))),c&&p.push(...f),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function I2(n){n.sort((a,l)=>a.score!==l.score?l.score-a.score:Y2(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}var P2=/^:[\w-]+$/,B2=3,H2=2,q2=1,$2=10,V2=-2,hb=n=>n==="*";function G2(n,a){let l=n.split("/"),o=l.length;return l.some(hb)&&(o+=V2),a&&(o+=H2),l.filter(c=>!hb(c)).reduce((c,u)=>c+(P2.test(u)?B2:u===""?q2:$2),o)}function Y2(n,a){return n.length===a.length&&n.slice(0,-1).every((o,c)=>o===a[c])?n[n.length-1]-a[a.length-1]:0}function F2(n,a,l=!1){let{routesMeta:o}=n,c={},u="/",f=[];for(let p=0;p<o.length;++p){let g=o[p],v=p===o.length-1,x=u==="/"?a:a.slice(u.length)||"/",y={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},b=g.matcher&&g.compiledParams?w0(y,x,g.matcher,g.compiledParams):hu(y,x),w=g.route;if(!b&&v&&l&&!o[o.length-1].route.index&&(b=hu({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Ca([u,b.pathname]),pathnameBase:Z2(Ca([u,b.pathnameBase])),route:w}),b.pathnameBase!=="/"&&(u=Ca([u,b.pathnameBase]))}return f}function hu(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[l,o]=j0(n.path,n.caseSensitive,n.end);return w0(n,a,l,o)}function w0(n,a,l,o){let c=a.match(l);if(!c)return null;let u=c[0],f=u.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:o.reduce((v,{paramName:x,isOptional:y},b)=>{if(x==="*"){let N=p[b]||"";f=u.slice(0,u.length-N.length).replace(/(.)\/+$/,"$1")}const w=p[b];return y&&!w?v[x]=void 0:v[x]=(w||"").replace(/%2F/g,"/"),v},{}),pathname:u,pathnameBase:f,pattern:n}}function j0(n,a=!1,l=!0){ha(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let o=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,g,v,x)=>{if(o.push({paramName:p,isOptional:g!=null}),g){let y=x.charAt(v+f.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function X2(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,o=n.charAt(l);return o&&o!=="/"?null:n.slice(l)||"/"}function K2(n,a="/"){let{pathname:l,search:o="",hash:c=""}=typeof n=="string"?Yl(n):n,u;return l?(l=S0(l),l.startsWith("/")?u=mb(l.substring(1),"/"):u=mb(l,a)):u=a,{pathname:u,search:J2(o),hash:W2(c)}}function mb(n,a){let l=mu(a).split("/");return n.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function bh(n,a,l,o){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Q2(n){return n.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Mm(n){let a=Q2(n);return a.map((l,o)=>o===a.length-1?l.pathname:l.pathnameBase)}function Ru(n,a,l,o=!1){let c;typeof n=="string"?c=Yl(n):(c={...n},Rt(!c.pathname||!c.pathname.includes("?"),bh("?","pathname","search",c)),Rt(!c.pathname||!c.pathname.includes("#"),bh("#","pathname","hash",c)),Rt(!c.search||!c.search.includes("#"),bh("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=l;else{let y=a.length-1;if(!o&&f.startsWith("..")){let b=f.split("/");for(;b[0]==="..";)b.shift(),y-=1;c.pathname=b.join("/")}p=y>=0?a[y]:"/"}let g=K2(c,p),v=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}var S0=n=>n.replace(/[\\/]{2,}/g,"/"),Ca=n=>S0(n.join("/")),mu=n=>n.replace(/\/+$/,""),Z2=n=>mu(n).replace(/^\/*/,"/"),J2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,W2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,eN=class{constructor(n,a,l,o=!1){this.status=n,this.statusText=a||"",this.internal=o,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function tN(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function nN(n){let a=n.map(l=>l.route.path).filter(Boolean);return Ca(a)||"/"}var C0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function N0(n,a){let l=n;if(typeof l!="string"||!Am.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let o=l,c=!1;if(C0)try{let u=new URL(window.location.href),f=v0.test(l)?new URL(D2(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:o,isExternal:c,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var E0=["POST","PUT","PATCH","DELETE"];new Set(E0);var aN=["GET",...E0];new Set(aN);var rN=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function sN(n){try{return rN.includes(new URL(n).protocol)}catch{return!1}}var Fl=h.createContext(null);Fl.displayName="DataRouter";var Tu=h.createContext(null);Tu.displayName="DataRouterState";var R0=h.createContext(!1);function lN(){return h.useContext(R0)}var T0=h.createContext({isTransitioning:!1});T0.displayName="ViewTransition";var oN=h.createContext(new Map);oN.displayName="Fetchers";var iN=h.createContext(null);iN.displayName="Await";var Zn=h.createContext(null);Zn.displayName="Navigation";var gi=h.createContext(null);gi.displayName="Location";var $a=h.createContext({outlet:null,matches:[],isDataRoute:!1});$a.displayName="Route";var Dm=h.createContext(null);Dm.displayName="RouteError";var A0="REACT_ROUTER_ERROR",cN="REDIRECT",uN="ROUTE_ERROR_RESPONSE";function dN(n){if(n.startsWith(`${A0}:${cN}:{`))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 fN(n){if(n.startsWith(`${A0}:${uN}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new eN(a.status,a.statusText,a.data)}catch{}}function hN(n,{relative:a}={}){Rt(Xl(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:o}=h.useContext(Zn),{hash:c,pathname:u,search:f}=xi(n,{relative:a}),p=u;return l!=="/"&&(p=u==="/"?l:Ca([l,u])),o.createHref({pathname:p,search:f,hash:c})}function Xl(){return h.useContext(gi)!=null}function Bn(){return Rt(Xl(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(gi).location}var M0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function D0(n){h.useContext(Zn).static||h.useLayoutEffect(n)}function vi(){let{isDataRoute:n}=h.useContext($a);return n?EN():mN()}function mN(){Rt(Xl(),"useNavigate() may be used only in the context of a <Router> component.");let n=h.useContext(Fl),{basename:a,navigator:l}=h.useContext(Zn),{matches:o}=h.useContext($a),{pathname:c}=Bn(),u=JSON.stringify(Mm(o)),f=h.useRef(!1);return D0(()=>{f.current=!0}),h.useCallback((g,v={})=>{if(ha(f.current,M0),!f.current)return;if(typeof g=="number"){l.go(g);return}let x=Ru(g,JSON.parse(u),c,v.relative==="path");n==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Ca([a,x.pathname])),(v.replace?l.replace:l.push)(x,v.state,v)},[a,l,u,c,n])}h.createContext(null);function xi(n,{relative:a}={}){let{matches:l}=h.useContext($a),{pathname:o}=Bn(),c=JSON.stringify(Mm(l));return h.useMemo(()=>Ru(n,JSON.parse(c),o,a==="path"),[n,c,o,a])}function pN(n,a){return O0(n,a)}function O0(n,a,l){var C;Rt(Xl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=h.useContext(Zn),{matches:c}=h.useContext($a),u=c[c.length-1],f=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",v=u&&u.route;{let R=v&&v.path||"";_0(p,!v||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let x=Bn(),y;if(a){let R=typeof a=="string"?Yl(a):a;Rt(g==="/"||((C=R.pathname)==null?void 0:C.startsWith(g)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${R.pathname}" was given in the \`location\` prop.`),y=R}else y=x;let b=y.pathname||"/",w=b;if(g!=="/"){let R=g.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(R.length).join("/")}let N=l&&l.state.matches.length?l.state.matches.map(R=>Object.assign(R,{route:l.manifest[R.route.id]||R.route})):x0(n,{pathname:w});ha(v||N!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),ha(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=bN(N&&N.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Ca([g,o.encodeLocation?o.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?g:Ca([g,o.encodeLocation?o.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),c,l);return a&&S?h.createElement(gi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},S):S}function gN(){let n=NN(),a=tN(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),l=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:u},"ErrorBoundary")," or"," ",h.createElement("code",{style:u},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},a),l?h.createElement("pre",{style:c},l):null,f)}var vN=h.createElement(gN,null),k0=class extends h.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const l=fN(n.digest);l&&(n=l)}let a=n!==void 0?h.createElement($a.Provider,{value:this.props.routeContext},h.createElement(Dm.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?h.createElement(xN,{error:n},a):a}};k0.contextType=R0;var wh=new WeakMap;function xN({children:n,error:a}){let{basename:l}=h.useContext(Zn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=dN(a.digest);if(o){let c=wh.get(a);if(c)throw c;let u=N0(o.location,l),f=u.absoluteURL||u.to;if(sN(f))throw new Error("Invalid redirect location");if(C0&&!wh.get(a))if(u.isExternal||o.reloadDocument)window.location.href=f;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw wh.set(a,p),p}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return n}function yN({routeContext:n,match:a,children:l}){let o=h.useContext(Fl);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),h.createElement($a.Provider,{value:n},l)}function bN(n,a=[],l){let o=l==null?void 0:l.state;if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let c=n,u=o==null?void 0:o.errors;if(u!=null){let x=c.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);Rt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let f=!1,p=-1;if(l&&o){f=o.renderFallback;for(let x=0;x<c.length;x++){let y=c[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=x),y.route.id){let{loaderData:b,errors:w}=o,N=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||N){l.isStatic&&(f=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let g=l==null?void 0:l.onError,v=o&&g?(x,y)=>{var b,w;g(x,{location:o.location,params:((w=(b=o.matches)==null?void 0:b[0])==null?void 0:w.params)??{},pattern:nN(o.matches),errorInfo:y})}:void 0;return c.reduceRight((x,y,b)=>{let w,N=!1,S=null,C=null;o&&(w=u&&y.route.id?u[y.route.id]:void 0,S=y.route.errorElement||vN,f&&(p<0&&b===0?(_0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,C=null):p===b&&(N=!0,C=y.route.hydrateFallbackElement||null)));let R=a.concat(c.slice(0,b+1)),D=()=>{let A;return w?A=S:N?A=C:y.route.Component?A=h.createElement(y.route.Component,null):y.route.element?A=y.route.element:A=x,h.createElement(yN,{match:y,routeContext:{outlet:x,matches:R,isDataRoute:o!=null},children:A})};return o&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?h.createElement(k0,{location:o.location,revalidation:o.revalidation,component:S,error:w,children:D(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:v}):D()},null)}function Om(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wN(n){let a=h.useContext(Fl);return Rt(a,Om(n)),a}function jN(n){let a=h.useContext(Tu);return Rt(a,Om(n)),a}function SN(n){let a=h.useContext($a);return Rt(a,Om(n)),a}function km(n){let a=SN(n),l=a.matches[a.matches.length-1];return Rt(l.route.id,`${n} can only be used on routes that contain a unique "id"`),l.route.id}function CN(){return km("useRouteId")}function NN(){var o;let n=h.useContext(Dm),a=jN("useRouteError"),l=km("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[l]}function EN(){let{router:n}=wN("useNavigate"),a=km("useNavigate"),l=h.useRef(!1);return D0(()=>{l.current=!0}),h.useCallback(async(c,u={})=>{ha(l.current,M0),l.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...u}))},[n,a])}var pb={};function _0(n,a,l){!a&&!pb[n]&&(pb[n]=!0,ha(!1,l))}h.memo(RN);function RN({routes:n,manifest:a,future:l,state:o,isStatic:c,onError:u}){return O0(n,void 0,{manifest:a,state:o,isStatic:c,onError:u})}function $h({to:n,replace:a,state:l,relative:o}){Rt(Xl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=h.useContext(Zn);ha(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=h.useContext($a),{pathname:f}=Bn(),p=vi(),g=Ru(n,Mm(u),f,o==="path"),v=JSON.stringify(g);return h.useEffect(()=>{p(JSON.parse(v),{replace:a,state:l,relative:o})},[p,v,o,a,l]),null}function Dn(n){Rt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function TN({basename:n="/",children:a=null,location:l,navigationType:o="POP",navigator:c,static:u=!1,useTransitions:f}){Rt(!Xl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=h.useMemo(()=>({basename:p,navigator:c,static:u,useTransitions:f,future:{}}),[p,c,u,f]);typeof l=="string"&&(l=Yl(l));let{pathname:v="/",search:x="",hash:y="",state:b=null,key:w="default",mask:N}=l,S=h.useMemo(()=>{let C=yr(v,p);return C==null?null:{location:{pathname:C,search:x,hash:y,state:b,key:w,mask:N},navigationType:o}},[p,v,x,y,b,w,o,N]);return ha(S!=null,`<Router basename="${p}"> is not able to match the URL "${v}${x}${y}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:h.createElement(Zn.Provider,{value:g},h.createElement(gi.Provider,{children:a,value:S}))}function z0({children:n,location:a}){return pN(Vh(n),a)}function Vh(n,a=[]){let l=[];return h.Children.forEach(n,(o,c)=>{if(!h.isValidElement(o))return;let u=[...a,c];if(o.type===h.Fragment){l.push.apply(l,Vh(o.props.children,u));return}Rt(o.type===Dn,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Rt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let f={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(f.children=Vh(o.props.children,u)),l.push(f)}),l}var su="get",lu="application/x-www-form-urlencoded";function Au(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function AN(n){return Au(n)&&n.tagName.toLowerCase()==="button"}function MN(n){return Au(n)&&n.tagName.toLowerCase()==="form"}function DN(n){return Au(n)&&n.tagName.toLowerCase()==="input"}function ON(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function kN(n,a){return n.button===0&&(!a||a==="_self")&&!ON(n)}function Gh(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,l)=>{let o=n[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function _N(n,a){let l=Gh(n);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(u=>{l.append(c,u)})}),l}var $c=null;function zN(){if($c===null)try{new FormData(document.createElement("form"),0),$c=!1}catch{$c=!0}return $c}var LN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function jh(n){return n!=null&&!LN.has(n)?(ha(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${lu}"`),null):n}function UN(n,a){let l,o,c,u,f;if(MN(n)){let p=n.getAttribute("action");o=p?yr(p,a):null,l=n.getAttribute("method")||su,c=jh(n.getAttribute("enctype"))||lu,u=new FormData(n)}else if(AN(n)||DN(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||p.getAttribute("action");if(o=g?yr(g,a):null,l=n.getAttribute("formmethod")||p.getAttribute("method")||su,c=jh(n.getAttribute("formenctype"))||jh(p.getAttribute("enctype"))||lu,u=new FormData(p,n),!zN()){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(Au(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=su,o=null,c=lu,f=n}return u&&c==="text/plain"&&(f=u,u=void 0),{action:o,method:l.toLowerCase(),encType:c,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _m(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function L0(n,a,l,o){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return l?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:a&&yr(c.pathname,a)==="/"?c.pathname=`${mu(a)}/_root.${o}`:c.pathname=`${mu(c.pathname)}.${o}`,c}async function IN(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 PN(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 BN(n,a,l){let o=await Promise.all(n.map(async c=>{let u=a.routes[c.route.id];if(u){let f=await IN(u,l);return f.links?f.links():[]}return[]}));return VN(o.flat(1).filter(PN).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function gb(n,a,l,o,c,u){let f=(g,v)=>l[v]?g.route.id!==l[v].route.id:!0,p=(g,v)=>{var x;return l[v].pathname!==g.pathname||((x=l[v].route.path)==null?void 0:x.endsWith("*"))&&l[v].params["*"]!==g.params["*"]};return u==="assets"?a.filter((g,v)=>f(g,v)||p(g,v)):u==="data"?a.filter((g,v)=>{var y;let x=o.routes[g.route.id];if(!x||!x.hasLoader)return!1;if(f(g,v)||p(g,v))return!0;if(g.route.shouldRevalidate){let b=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((y=l[0])==null?void 0:y.params)||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function HN(n,a,{includeHydrateFallback:l}={}){return qN(n.map(o=>{let c=a.routes[o.route.id];if(!c)return[];let u=[c.module];return c.clientActionModule&&(u=u.concat(c.clientActionModule)),c.clientLoaderModule&&(u=u.concat(c.clientLoaderModule)),l&&c.hydrateFallbackModule&&(u=u.concat(c.hydrateFallbackModule)),c.imports&&(u=u.concat(c.imports)),u}).flat(1))}function qN(n){return[...new Set(n)]}function $N(n){let a={},l=Object.keys(n).sort();for(let o of l)a[o]=n[o];return a}function VN(n,a){let l=new Set;return new Set(a),n.reduce((o,c)=>{let u=JSON.stringify($N(c));return l.has(u)||(l.add(u),o.push({key:u,link:c})),o},[])}function zm(){let n=h.useContext(Fl);return _m(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function GN(){let n=h.useContext(Tu);return _m(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Lm=h.createContext(void 0);Lm.displayName="FrameworkContext";function Mu(){let n=h.useContext(Lm);return _m(n,"You must render this element inside a <HydratedRouter> element"),n}function YN(n,a){let l=h.useContext(Lm),[o,c]=h.useState(!1),[u,f]=h.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:v,onMouseLeave:x,onTouchStart:y}=a,b=h.useRef(null);h.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let S=R=>{R.forEach(D=>{f(D.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[n]),h.useEffect(()=>{if(o){let S=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(S)}}},[o]);let w=()=>{c(!0)},N=()=>{c(!1),f(!1)};return l?n!=="intent"?[u,b,{}]:[u,b,{onFocus:Wo(p,w),onBlur:Wo(g,N),onMouseEnter:Wo(v,w),onMouseLeave:Wo(x,N),onTouchStart:Wo(y,w)}]:[!1,b,{}]}function Wo(n,a){return l=>{n&&n(l),l.defaultPrevented||a(l)}}function FN({page:n,...a}){let l=lN(),{nonce:o}=Mu(),{router:c}=zm(),u=h.useMemo(()=>x0(c.routes,n,c.basename),[c.routes,n,c.basename]);return u?(a.nonce==null&&o&&(a={...a,nonce:o}),l?h.createElement(KN,{page:n,matches:u,...a}):h.createElement(QN,{page:n,matches:u,...a})):null}function XN(n){let{manifest:a,routeModules:l}=Mu(),[o,c]=h.useState([]);return h.useEffect(()=>{let u=!1;return BN(n,a,l).then(f=>{u||c(f)}),()=>{u=!0}},[n,a,l]),o}function KN({page:n,matches:a,...l}){let o=Bn(),{future:c}=Mu(),{basename:u}=zm(),f=h.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let p=L0(n,u,c.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let x of a)typeof x.route.shouldRevalidate=="function"?g=!0:v.push(x.route.id);return g&&v.length>0&&p.searchParams.set("_routes",v.join(",")),[p.pathname+p.search]},[u,c.v8_trailingSlashAwareDataRequests,n,o,a]);return h.createElement(h.Fragment,null,f.map(p=>h.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...l})))}function QN({page:n,matches:a,...l}){let o=Bn(),{future:c,manifest:u,routeModules:f}=Mu(),{basename:p}=zm(),{loaderData:g,matches:v}=GN(),x=h.useMemo(()=>gb(n,a,v,u,o,"data"),[n,a,v,u,o]),y=h.useMemo(()=>gb(n,a,v,u,o,"assets"),[n,a,v,u,o]),b=h.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let S=new Set,C=!1;if(a.forEach(D=>{var M;let A=u.routes[D.route.id];!A||!A.hasLoader||(!x.some(O=>O.route.id===D.route.id)&&D.route.id in g&&((M=f[D.route.id])!=null&&M.shouldRevalidate)||A.hasClientLoader?C=!0:S.add(D.route.id))}),S.size===0)return[];let R=L0(n,p,c.v8_trailingSlashAwareDataRequests,"data");return C&&S.size>0&&R.searchParams.set("_routes",a.filter(D=>S.has(D.route.id)).map(D=>D.route.id).join(",")),[R.pathname+R.search]},[p,c.v8_trailingSlashAwareDataRequests,g,o,u,x,a,n,f]),w=h.useMemo(()=>HN(y,u),[y,u]),N=XN(y);return h.createElement(h.Fragment,null,b.map(S=>h.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...l})),w.map(S=>h.createElement("link",{key:S,rel:"modulepreload",href:S,...l})),N.map(({key:S,link:C})=>h.createElement("link",{key:S,nonce:l.nonce,...C,crossOrigin:C.crossOrigin??l.crossOrigin})))}function ZN(...n){return a=>{n.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var JN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{JN&&(window.__reactRouterVersion="7.18.2")}catch{}function WN({basename:n,children:a,useTransitions:l,window:o}){let c=h.useRef();c.current==null&&(c.current=O2({window:o,v5Compat:!0}));let u=c.current,[f,p]=h.useState({action:u.action,location:u.location}),g=h.useCallback(v=>{l===!1?p(v):h.startTransition(()=>p(v))},[l]);return h.useLayoutEffect(()=>u.listen(g),[u,g]),h.createElement(TN,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:u,useTransitions:l})}var Ls=h.forwardRef(function({onClick:a,discover:l="render",prefetch:o="none",relative:c,reloadDocument:u,replace:f,mask:p,state:g,target:v,to:x,preventScrollReset:y,viewTransition:b,defaultShouldRevalidate:w,...N},S){let{basename:C,navigator:R,useTransitions:D}=h.useContext(Zn),A=typeof x=="string"&&Am.test(x),M=N0(x,C);x=M.to;let O=hN(x,{relative:c}),E=Bn(),z=null;if(p){let H=Ru(p,[],E.mask?E.mask.pathname:"/",!0);C!=="/"&&(H.pathname=H.pathname==="/"?C:Ca([C,H.pathname])),z=R.createHref(H)}let[k,P,Z]=YN(o,N),ee=nE(x,{replace:f,mask:p,state:g,target:v,preventScrollReset:y,relative:c,viewTransition:b,defaultShouldRevalidate:w,useTransitions:D});function V(H){a&&a(H),H.defaultPrevented||ee(H)}let ce=!(M.isExternal||u),se=h.createElement("a",{...N,...Z,href:(ce?z:void 0)||M.absoluteURL||O,onClick:ce?V:a,ref:ZN(S,P),target:v,"data-discover":!A&&l==="render"?"true":void 0});return k&&!A?h.createElement(h.Fragment,null,se,h.createElement(FN,{page:O})):se});Ls.displayName="Link";var U0=h.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:o="",end:c=!1,style:u,to:f,viewTransition:p,children:g,...v},x){let y=xi(f,{relative:v.relative}),b=Bn(),w=h.useContext(Tu),{navigator:N,basename:S}=h.useContext(Zn),C=w!=null&&iE(y)&&p===!0,R=N.encodeLocation?N.encodeLocation(y).pathname:y.pathname,D=b.pathname,A=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;l||(D=D.toLowerCase(),A=A?A.toLowerCase():null,R=R.toLowerCase()),A&&S&&(A=yr(A,S)||A);const M=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let O=D===R||!c&&D.startsWith(R)&&D.charAt(M)==="/",E=A!=null&&(A===R||!c&&A.startsWith(R)&&A.charAt(R.length)==="/"),z={isActive:O,isPending:E,isTransitioning:C},k=O?a:void 0,P;typeof o=="function"?P=o(z):P=[o,O?"active":null,E?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let Z=typeof u=="function"?u(z):u;return h.createElement(Ls,{...v,"aria-current":k,className:P,ref:x,style:Z,to:f,viewTransition:p},typeof g=="function"?g(z):g)});U0.displayName="NavLink";var eE=h.forwardRef(({discover:n="render",fetcherKey:a,navigate:l,reloadDocument:o,replace:c,state:u,method:f=su,action:p,onSubmit:g,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b,...w},N)=>{let{useTransitions:S}=h.useContext(Zn),C=lE(),R=oE(p,{relative:v}),D=f.toLowerCase()==="get"?"get":"post",A=typeof p=="string"&&Am.test(p),M=O=>{if(g&&g(O),O.defaultPrevented)return;O.preventDefault();let E=O.nativeEvent.submitter,z=(E==null?void 0:E.getAttribute("formmethod"))||f,k=()=>C(E||O.currentTarget,{fetcherKey:a,method:z,navigate:l,replace:c,state:u,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b});S&&l!==!1?h.startTransition(()=>k()):k()};return h.createElement("form",{ref:N,method:D,action:R,onSubmit:o?g:M,...w,"data-discover":!A&&n==="render"?"true":void 0})});eE.displayName="Form";function tE(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function I0(n){let a=h.useContext(Fl);return Rt(a,tE(n)),a}function nE(n,{target:a,replace:l,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g,useTransitions:v}={}){let x=vi(),y=Bn(),b=xi(n,{relative:f});return h.useCallback(w=>{if(kN(w,a)){w.preventDefault();let N=l!==void 0?l:si(y)===si(b),S=()=>x(n,{replace:N,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g});v?h.startTransition(()=>S()):S()}},[y,x,b,l,o,c,a,n,u,f,p,g,v])}function aE(n){ha(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=h.useRef(Gh(n)),l=h.useRef(!1),o=Bn(),c=h.useMemo(()=>_N(o.search,l.current?null:a.current),[o.search]),u=vi(),f=h.useCallback((p,g)=>{const v=Gh(typeof p=="function"?p(new URLSearchParams(c)):p);l.current=!0,u("?"+v,g)},[u,c]);return[c,f]}var rE=0,sE=()=>`__${String(++rE)}__`;function lE(){let{router:n}=I0("useSubmit"),{basename:a}=h.useContext(Zn),l=CN(),o=n.fetch,c=n.navigate;return h.useCallback(async(u,f={})=>{let{action:p,method:g,encType:v,formData:x,body:y}=UN(u,a);if(f.navigate===!1){let b=f.fetcherKey||sE();await o(b,l,f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||g,formEncType:f.encType||v,flushSync:f.flushSync})}else await c(f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||g,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:l,flushSync:f.flushSync,viewTransition:f.viewTransition})},[o,c,a,l])}function oE(n,{relative:a}={}){let{basename:l}=h.useContext(Zn),o=h.useContext($a);Rt(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),u={...xi(n||".",{relative:a})},f=Bn();if(n==null){u.search=f.search;let p=new URLSearchParams(u.search),g=p.getAll("index");if(g.some(x=>x==="")){p.delete("index"),g.filter(y=>y).forEach(y=>p.append("index",y));let x=p.toString();u.search=x?`?${x}`:""}}return(!n||n===".")&&c.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(u.pathname=u.pathname==="/"?l:Ca([l,u.pathname])),si(u)}function iE(n,{relative:a}={}){let l=h.useContext(T0);Rt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=I0("useViewTransitionState"),c=xi(n,{relative:a});if(!l.isTransitioning)return!1;let u=yr(l.currentLocation.pathname,o)||l.currentLocation.pathname,f=yr(l.nextLocation.pathname,o)||l.nextLocation.pathname;return hu(c.pathname,f)!=null||hu(c.pathname,u)!=null}var Sa=g0();const cE=Rm(Sa),Du="",pu="x-csrf-token",vb=new Set(["/api/admin/login","/api/admin/setup"]);let Us=null,Sh=null;async function Um(){return Us||(Sh??(Sh=fetch(`${Du}/api/admin/csrf`,{credentials:"include"}).then(async n=>{if(!n.ok)throw new Error("Unable to acquire CSRF token");return Us=(await n.json()).csrfToken,Us}).finally(()=>{Sh=null})),Sh)}class Im extends Error{constructor(a,l,o){var c;super(typeof o=="object"&&o&&"error"in o?String(((c=o.error)==null?void 0:c.message)??o):"Request failed"),this.status=a,this.type=l,this.body=o}}async function P0(n){var o;const a=await n.text();let l;try{l=a?JSON.parse(a):void 0}catch{l=a}if(!n.ok)throw new Im(n.status,typeof l=="object"&&l&&"error"in l?String(((o=l.error)==null?void 0:o.type)??"error"):"error",l);return l}async function Ll(n,a,l,o,c=!0){const u=l!==void 0,f={...o==null?void 0:o.headers};u&&!f["content-type"]&&(f["content-type"]="application/json"),n!=="GET"&&n!=="HEAD"&&!vb.has(a)&&!f[pu]&&(f[pu]=await Um());const p=await fetch(`${Du}${a}`,{...o,method:n,headers:f,body:u?JSON.stringify(l):void 0,credentials:"include"});try{return await P0(p)}catch(g){const v=g instanceof Im&&(g.status===401||g.status===403)&&(g.type==="authentication_error"||g.type==="csrf_error");if(c&&v&&n!=="GET"&&n!=="HEAD"&&!vb.has(a))return Us=null,Ll(n,a,l,o,!1);throw g}}async function B0(n,a,l=!0){const o=await fetch(`${Du}${n}`,{method:"POST",headers:{[pu]:await Um()},body:a,credentials:"include"});try{return await P0(o)}catch(c){const u=c instanceof Im&&(c.status===401||c.status===403)&&(c.type==="authentication_error"||c.type==="csrf_error");if(l&&u)return Us=null,B0(n,a,!1);throw c}}async function gu(n,a,l=!0){const o={...a==null?void 0:a.headers,[pu]:await Um()},c=await fetch(`${Du}${n}`,{...a,headers:o,credentials:"include"});return l&&c.status===403?(Us=null,gu(n,a,!1)):c}const pe={get:(n,a)=>Ll("GET",n,void 0,a),post:(n,a,l)=>Ll("POST",n,a,l),upload:B0,patch:(n,a,l)=>Ll("PATCH",n,a,l),put:(n,a,l)=>Ll("PUT",n,a,l),del:(n,a)=>Ll("DELETE",n,void 0,a)},H0=h.createContext(void 0);function uE({children:n}){const[a,l]=h.useState(null),[o,c]=h.useState(!0),u=h.useCallback(async()=>{try{const g=await pe.get("/api/admin/me");l(g)}catch{l(null)}finally{c(!1)}},[]);h.useEffect(()=>{u()},[u]);const f=h.useCallback(async(g,v,x,y)=>{const b={username:g,password:v};x&&(b.totp=x),y&&(b.recoveryCode=y);try{const w=await pe.post("/api/admin/login",b);return l({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const N=w.status,S=w.type;if(N===401&&S==="totp_required")return{totpRequired:!0};throw w}},[]),p=h.useCallback(async()=>{await pe.post("/api/admin/logout"),l(null)},[]);return s.jsx(H0.Provider,{value:{user:a,loading:o,login:f,logout:p,refresh:u},children:n})}function Pm(){const n=h.useContext(H0);if(!n)throw new Error("useAuth must be inside AuthProvider");return n}/**
|
|
61
|
-
* @license lucide-react v0.469.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const dE=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),q0=(...n)=>n.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim();/**
|
|
66
|
-
* @license lucide-react v0.469.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/var fE={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 hE=h.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:f,...p},g)=>h.createElement("svg",{ref:g,...fE,width:a,height:a,stroke:n,strokeWidth:o?Number(l)*24/Number(a):l,className:q0("lucide",c),...p},[...f.map(([v,x])=>h.createElement(v,x)),...Array.isArray(u)?u:[u]]));/**
|
|
76
|
-
* @license lucide-react v0.469.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const Me=(n,a)=>{const l=h.forwardRef(({className:o,...c},u)=>h.createElement(hE,{ref:u,iconNode:a,className:q0(`lucide-${dE(n)}`,o),...c}));return l.displayName=`${n}`,l};/**
|
|
81
|
-
* @license lucide-react v0.469.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/const $0=Me("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
86
|
-
* @license lucide-react v0.469.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const mE=Me("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
91
|
-
* @license lucide-react v0.469.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const pE=Me("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
|
96
|
-
* @license lucide-react v0.469.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const gE=Me("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
|
|
101
|
-
* @license lucide-react v0.469.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const Bm=Me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
106
|
-
* @license lucide-react v0.469.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const V0=Me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
111
|
-
* @license lucide-react v0.469.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const G0=Me("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
116
|
-
* @license lucide-react v0.469.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const Hm=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
121
|
-
* @license lucide-react v0.469.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const vE=Me("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
|
|
126
|
-
* @license lucide-react v0.469.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const Ou=Me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
131
|
-
* @license lucide-react v0.469.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const xE=Me("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
136
|
-
* @license lucide-react v0.469.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const yE=Me("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
141
|
-
* @license lucide-react v0.469.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const bE=Me("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
146
|
-
* @license lucide-react v0.469.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const wE=Me("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
|
|
151
|
-
* @license lucide-react v0.469.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const ou=Me("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
156
|
-
* @license lucide-react v0.469.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const jE=Me("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
161
|
-
* @license lucide-react v0.469.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const SE=Me("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
166
|
-
* @license lucide-react v0.469.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const qm=Me("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
171
|
-
* @license lucide-react v0.469.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const CE=Me("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
176
|
-
* @license lucide-react v0.469.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const NE=Me("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
181
|
-
* @license lucide-react v0.469.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const EE=Me("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
186
|
-
* @license lucide-react v0.469.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const RE=Me("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
|
|
191
|
-
* @license lucide-react v0.469.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const Y0=Me("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
196
|
-
* @license lucide-react v0.469.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const $m=Me("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
201
|
-
* @license lucide-react v0.469.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const F0=Me("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
206
|
-
* @license lucide-react v0.469.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const X0=Me("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
211
|
-
* @license lucide-react v0.469.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const TE=Me("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
216
|
-
* @license lucide-react v0.469.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const pr=Me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
221
|
-
* @license lucide-react v0.469.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const AE=Me("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
226
|
-
* @license lucide-react v0.469.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const ME=Me("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
231
|
-
* @license lucide-react v0.469.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const DE=Me("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
236
|
-
* @license lucide-react v0.469.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const K0=Me("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
241
|
-
* @license lucide-react v0.469.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const OE=Me("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
246
|
-
* @license lucide-react v0.469.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const kE=Me("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
251
|
-
* @license lucide-react v0.469.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const Kl=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
256
|
-
* @license lucide-react v0.469.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const li=Me("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
261
|
-
* @license lucide-react v0.469.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const _E=Me("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
266
|
-
* @license lucide-react v0.469.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const zE=Me("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/**
|
|
271
|
-
* @license lucide-react v0.469.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const LE=Me("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
|
|
276
|
-
* @license lucide-react v0.469.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const Vm=Me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
281
|
-
* @license lucide-react v0.469.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const UE=Me("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
286
|
-
* @license lucide-react v0.469.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const IE=Me("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
291
|
-
* @license lucide-react v0.469.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const PE=Me("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
296
|
-
* @license lucide-react v0.469.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const BE=Me("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
301
|
-
* @license lucide-react v0.469.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const HE=Me("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
306
|
-
* @license lucide-react v0.469.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const Ql=Me("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
311
|
-
* @license lucide-react v0.469.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const qE=Me("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
316
|
-
* @license lucide-react v0.469.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const Q0=Me("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
321
|
-
* @license lucide-react v0.469.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const $E=Me("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
326
|
-
* @license lucide-react v0.469.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const VE=Me("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
331
|
-
* @license lucide-react v0.469.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const ku=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
336
|
-
* @license lucide-react v0.469.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const GE=Me("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Z0(n){var a,l,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(a=0;a<c;a++)n[a]&&(l=Z0(n[a]))&&(o&&(o+=" "),o+=l)}else for(l in n)n[l]&&(o&&(o+=" "),o+=l);return o}function J0(){for(var n,a,l=0,o="",c=arguments.length;l<c;l++)(n=arguments[l])&&(a=Z0(n))&&(o&&(o+=" "),o+=a);return o}const Gm="-",YE=n=>{const a=XE(n),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:f=>{const p=f.split(Gm);return p[0]===""&&p.length!==1&&p.shift(),W0(p,a)||FE(f)},getConflictingClassGroupIds:(f,p)=>{const g=l[f]||[];return p&&o[f]?[...g,...o[f]]:g}}},W0=(n,a)=>{var f;if(n.length===0)return a.classGroupId;const l=n[0],o=a.nextPart.get(l),c=o?W0(n.slice(1),o):void 0;if(c)return c;if(a.validators.length===0)return;const u=n.join(Gm);return(f=a.validators.find(({validator:p})=>p(u)))==null?void 0:f.classGroupId},xb=/^\[(.+)\]$/,FE=n=>{if(xb.test(n)){const a=xb.exec(n)[1],l=a==null?void 0:a.substring(0,a.indexOf(":"));if(l)return"arbitrary.."+l}},XE=n=>{const{theme:a,prefix:l}=n,o={nextPart:new Map,validators:[]};return QE(Object.entries(n.classGroups),l).forEach(([u,f])=>{Yh(f,o,u,a)}),o},Yh=(n,a,l,o)=>{n.forEach(c=>{if(typeof c=="string"){const u=c===""?a:yb(a,c);u.classGroupId=l;return}if(typeof c=="function"){if(KE(c)){Yh(c(o),a,l,o);return}a.validators.push({validator:c,classGroupId:l});return}Object.entries(c).forEach(([u,f])=>{Yh(f,yb(a,u),l,o)})})},yb=(n,a)=>{let l=n;return a.split(Gm).forEach(o=>{l.nextPart.has(o)||l.nextPart.set(o,{nextPart:new Map,validators:[]}),l=l.nextPart.get(o)}),l},KE=n=>n.isThemeGetter,QE=(n,a)=>a?n.map(([l,o])=>{const c=o.map(u=>typeof u=="string"?a+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([f,p])=>[a+f,p])):u);return[l,c]}):n,ZE=n=>{if(n<1)return{get:()=>{},set:()=>{}};let a=0,l=new Map,o=new Map;const c=(u,f)=>{l.set(u,f),a++,a>n&&(a=0,o=l,l=new Map)};return{get(u){let f=l.get(u);if(f!==void 0)return f;if((f=o.get(u))!==void 0)return c(u,f),f},set(u,f){l.has(u)?l.set(u,f):c(u,f)}}},e1="!",JE=n=>{const{separator:a,experimentalParseClassName:l}=n,o=a.length===1,c=a[0],u=a.length,f=p=>{const g=[];let v=0,x=0,y;for(let C=0;C<p.length;C++){let R=p[C];if(v===0){if(R===c&&(o||p.slice(C,C+u)===a)){g.push(p.slice(x,C)),x=C+u;continue}if(R==="/"){y=C;continue}}R==="["?v++:R==="]"&&v--}const b=g.length===0?p:p.substring(x),w=b.startsWith(e1),N=w?b.substring(1):b,S=y&&y>x?y-x:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:N,maybePostfixModifierPosition:S}};return l?p=>l({className:p,parseClassName:f}):f},WE=n=>{if(n.length<=1)return n;const a=[];let l=[];return n.forEach(o=>{o[0]==="["?(a.push(...l.sort(),o),l=[]):l.push(o)}),a.push(...l.sort()),a},eR=n=>({cache:ZE(n.cacheSize),parseClassName:JE(n),...YE(n)}),tR=/\s+/,nR=(n,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c}=a,u=[],f=n.trim().split(tR);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 N=!!w,S=o(N?b.substring(0,w):b);if(!S){if(!N){p=v+(p.length>0?" "+p:p);continue}if(S=o(b),!S){p=v+(p.length>0?" "+p:p);continue}N=!1}const C=WE(x).join(":"),R=y?C+e1:C,D=R+S;if(u.includes(D))continue;u.push(D);const A=c(S,N);for(let M=0;M<A.length;++M){const O=A[M];u.push(R+O)}p=v+(p.length>0?" "+p:p)}return p};function aR(){let n=0,a,l,o="";for(;n<arguments.length;)(a=arguments[n++])&&(l=t1(a))&&(o&&(o+=" "),o+=l);return o}const t1=n=>{if(typeof n=="string")return n;let a,l="";for(let o=0;o<n.length;o++)n[o]&&(a=t1(n[o]))&&(l&&(l+=" "),l+=a);return l};function rR(n,...a){let l,o,c,u=f;function f(g){const v=a.reduce((x,y)=>y(x),n());return l=eR(v),o=l.cache.get,c=l.cache.set,u=p,p(g)}function p(g){const v=o(g);if(v)return v;const x=nR(g,l);return c(g,x),x}return function(){return u(aR.apply(null,arguments))}}const jt=n=>{const a=l=>l[n]||[];return a.isThemeGetter=!0,a},n1=/^\[(?:([a-z-]+):)?(.+)\]$/i,sR=/^\d+\/\d+$/,lR=new Set(["px","full","screen"]),oR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iR=/\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$/,cR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,uR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fr=n=>Pl(n)||lR.has(n)||sR.test(n),es=n=>Zl(n,"length",yR),Pl=n=>!!n&&!Number.isNaN(Number(n)),Ch=n=>Zl(n,"number",Pl),ei=n=>!!n&&Number.isInteger(Number(n)),fR=n=>n.endsWith("%")&&Pl(n.slice(0,-1)),Pe=n=>n1.test(n),ts=n=>oR.test(n),hR=new Set(["length","size","percentage"]),mR=n=>Zl(n,hR,a1),pR=n=>Zl(n,"position",a1),gR=new Set(["image","url"]),vR=n=>Zl(n,gR,wR),xR=n=>Zl(n,"",bR),ti=()=>!0,Zl=(n,a,l)=>{const o=n1.exec(n);return o?o[1]?typeof a=="string"?o[1]===a:a.has(o[1]):l(o[2]):!1},yR=n=>iR.test(n)&&!cR.test(n),a1=()=>!1,bR=n=>uR.test(n),wR=n=>dR.test(n),jR=()=>{const n=jt("colors"),a=jt("spacing"),l=jt("blur"),o=jt("brightness"),c=jt("borderColor"),u=jt("borderRadius"),f=jt("borderSpacing"),p=jt("borderWidth"),g=jt("contrast"),v=jt("grayscale"),x=jt("hueRotate"),y=jt("invert"),b=jt("gap"),w=jt("gradientColorStops"),N=jt("gradientColorStopPositions"),S=jt("inset"),C=jt("margin"),R=jt("opacity"),D=jt("padding"),A=jt("saturate"),M=jt("scale"),O=jt("sepia"),E=jt("skew"),z=jt("space"),k=jt("translate"),P=()=>["auto","contain","none"],Z=()=>["auto","hidden","clip","visible","scroll"],ee=()=>["auto",Pe,a],V=()=>[Pe,a],ce=()=>["",fr,es],se=()=>["auto",Pl,Pe],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",Pe],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[Pl,Pe];return{cacheSize:500,separator:":",theme:{colors:[ti],spacing:[fr,es],blur:["none","",ts,Pe],brightness:L(),borderColor:[n],borderRadius:["none","","full",ts,Pe],borderSpacing:V(),borderWidth:ce(),contrast:L(),grayscale:Q(),hueRotate:L(),invert:Q(),gap:V(),gradientColorStops:[n],gradientColorStopPositions:[fR,es],inset:ee(),margin:ee(),opacity:L(),padding:V(),saturate:L(),scale:L(),sepia:Q(),skew:L(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",Pe]}],container:["container"],columns:[{columns:[ts]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),Pe]}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ei,Pe]}],basis:[{basis:ee()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pe]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",ei,Pe]}],"grid-cols":[{"grid-cols":[ti]}],"col-start-end":[{col:["auto",{span:["full",ei,Pe]},Pe]}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":[ti]}],"row-start-end":[{row:["auto",{span:[ei,Pe]},Pe]}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pe]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...W()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...W(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...W(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[D]}],px:[{px:[D]}],py:[{py:[D]}],ps:[{ps:[D]}],pe:[{pe:[D]}],pt:[{pt:[D]}],pr:[{pr:[D]}],pb:[{pb:[D]}],pl:[{pl:[D]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[z]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[z]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pe,a]}],"min-w":[{"min-w":[Pe,a,"min","max","fit"]}],"max-w":[{"max-w":[Pe,a,"none","full","min","max","fit","prose",{screen:[ts]},ts]}],h:[{h:[Pe,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pe,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pe,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pe,a,"auto","min","max","fit"]}],"font-size":[{text:["base",ts,es]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ch]}],"font-family":[{font:[ti]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Pe]}],"line-clamp":[{"line-clamp":["none",Pl,Ch]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",fr,Pe]}],"list-image":[{"list-image":["none",Pe]}],"list-style-type":[{list:["none","disc","decimal",Pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",fr,es]}],"underline-offset":[{"underline-offset":["auto",fr,Pe]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),pR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",mR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vR]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"border-w":[{border:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[R]}],"border-style":[{border:[..._(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[R]}],"divide-style":[{divide:_()}],"border-color":[{border:[c]}],"border-color-x":[{"border-x":[c]}],"border-color-y":[{"border-y":[c]}],"border-color-s":[{"border-s":[c]}],"border-color-e":[{"border-e":[c]}],"border-color-t":[{"border-t":[c]}],"border-color-r":[{"border-r":[c]}],"border-color-b":[{"border-b":[c]}],"border-color-l":[{"border-l":[c]}],"divide-color":[{divide:[c]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[fr,Pe]}],"outline-w":[{outline:[fr,es]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[fr,es]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",ts,xR]}],"shadow-color":[{shadow:[ti]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[l]}],brightness:[{brightness:[o]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",ts,Pe]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[A]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[l]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pe]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",Pe]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[ei,Pe]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pe]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pe]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pe]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[fr,es,Ch]}],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"]}}},SR=rR(jR);function Ce(...n){return SR(J0(n))}function Xt(n,a="—"){return n==null||Number.isNaN(n)?a:n.toLocaleString()}function _u(n,a=1,l="—"){return n==null||Number.isNaN(n)?l:`${(n*100).toFixed(a)}%`}function Is(n){return n?n<1e3?`${Math.round(n)} ms`:`${(n/1e3).toFixed(2)} s`:"—"}function Ym(n){if(!n)return"—";try{return new Date(n).toLocaleString()}catch{return n}}function CR(n,a=8){return n?n.length>a?`${n.slice(0,a)}…`:n:"—"}function NR(n){if(!n)return"—";const a=Date.now()-new Date(n).getTime();if(!Number.isFinite(a)||a<0)return"—";const l=Math.floor(a/1e3);if(l<60)return`${l}s ago`;const o=Math.floor(l/60);if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const ER=[{to:"/",label:"Dashboard",icon:Y0,end:!0},{to:"/providers",label:"Providers",icon:K0},{to:"/models",label:"Models",icon:gE},{to:"/combos",label:"Combos",icon:X0},{to:"/aliases",label:"Aliases",icon:bE},{to:"/api-keys",label:"API Keys",icon:F0},{to:"/requests",label:"Requests",icon:$0},{to:"/statistics",label:"Statistics",icon:EE},{to:"/audit",label:"Audit Logs",icon:LE},{to:"/settings",label:"Settings",icon:wE}];function RR(){const[n,a]=h.useState(null);return h.useEffect(()=>{let l=!1;return fetch("/api/admin/settings/system",{credentials:"include"}).then(o=>o.ok?o.json():null).then(o=>{!l&&(o!=null&&o.appVersion)&&a(o.appVersion)}).catch(()=>{}),()=>{l=!0}},[]),s.jsxs("aside",{className:"hidden w-60 shrink-0 border-r bg-sidebar text-sidebar-foreground md:flex md:flex-col",children:[s.jsxs("div",{className:"flex h-14 items-center gap-2 border-b px-4",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-7 w-7 object-contain"}),s.jsx("div",{className:"font-semibold tracking-tight",children:"LateDev Router"})]}),s.jsx("nav",{className:"flex-1 space-y-0.5 p-2",children:ER.map(l=>s.jsxs(U0,{to:l.to,end:l.end,className:({isActive:o})=>Ce("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors",o?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[s.jsx(l.icon,{className:"h-4 w-4"}),l.label]},l.to))}),s.jsxs("div",{className:"border-t p-3 text-xs text-muted-foreground flex items-center gap-2",children:[s.jsx(IE,{className:"h-3.5 w-3.5 text-primary"})," ",n?`v${n}`:"v…"]})]})}var TR=Object.defineProperty,Fm=(n,a)=>TR(n,"name",{value:a,configurable:!0});function Fh(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}Fm(Fh,"setRef");function r1(...n){return a=>{let l=!1;const o=n.map(c=>{const u=Fh(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c<o.length;c++){const u=o[c];typeof u=="function"?u():Fh(n[c],null)}}}}Fm(r1,"composeRefs");function Fe(...n){return h.useCallback(r1(...n),n)}Fm(Fe,"useComposedRefs");var AR=Object.defineProperty,Ra=(n,a)=>AR(n,"name",{value:a,configurable:!0});function Ua(n){const a=h.forwardRef((l,o)=>{let{children:c,...u}=l,f=null,p=!1;const g=[];Xh(c)&&typeof Vc=="function"&&(c=Vc(c._payload)),h.Children.forEach(c,b=>{var w;if(c1(b)){p=!0;const N=b;let S="child"in N.props?N.props.child:N.props.children;Xh(S)&&typeof Vc=="function"&&(S=Vc(S._payload)),f=DR(N,S),g.push((w=f==null?void 0:f.props)==null?void 0:w.children)}else g.push(b)}),f?f=h.cloneElement(f,void 0,g):!p&&h.Children.count(c)===1&&h.isValidElement(c)&&(f=c);const v=f?i1(f):void 0,x=Fe(o,v);if(!f){if(c||c===0)throw new Error(p?_R(n):kR(n));return c}const y=o1(u,f.props??{});return f.type!==h.Fragment&&(y.ref=o?x:v),h.cloneElement(f,y)});return a.displayName=`${n}.Slot`,a}Ra(Ua,"createSlot");var MR=Ua("Slot"),s1=Symbol.for("radix.slottable");function l1(n){const a=Ra(l=>"child"in l?l.children(l.child):l.children,"Slottable");return a.displayName=`${n}.Slottable`,a.__radixId=s1,a}Ra(l1,"createSlottable");var DR=Ra((n,a)=>{if("child"in n.props){const l=n.props.child;return h.isValidElement(l)?h.cloneElement(l,void 0,n.props.children(l.props.children)):null}return h.isValidElement(a)?a:null},"getSlottableElementFromSlottable");function o1(n,a){const l={...a};for(const o in a){const c=n[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...p)=>{const g=u(...p);return c(...p),g}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...n,...l}}Ra(o1,"mergeProps");function i1(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}Ra(i1,"getElementRef");function c1(n){return h.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===s1}Ra(c1,"isSlottable");var OR=Symbol.for("react.lazy");function Xh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===OR&&"_payload"in n&&u1(n._payload)}Ra(Xh,"isLazyComponent");function u1(n){return typeof n=="object"&&n!==null&&"then"in n}Ra(u1,"isPromiseLike");var kR=Ra(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),_R=Ra(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Vc=Gl[" use ".trim().toString()];const bb=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,wb=J0,d1=(n,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return wb(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=bb(x)||bb(y);return c[v][b]}),p=l&&Object.entries(l).reduce((v,x)=>{let[y,b]=x;return b===void 0||(v[y]=b),v},{}),g=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((v,x)=>{let{class:y,className:b,...w}=x;return Object.entries(w).every(N=>{let[S,C]=N;return Array.isArray(C)?C.includes({...u,...p}[S]):{...u,...p}[S]===C})?[...v,y,b]:v},[]);return wb(n,f,g,l==null?void 0:l.class,l==null?void 0:l.className)},zR=d1("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-6",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),le=h.forwardRef(({className:n,variant:a,size:l,asChild:o=!1,...c},u)=>{const f=o?MR:"button";return s.jsx(f,{className:Ce(zR({variant:a,size:l,className:n})),ref:u,...c})});le.displayName="Button";const f1=h.createContext(void 0);function LR({children:n,defaultTheme:a="system",storageKey:l="latedev-theme"}){const[o,c]=h.useState(()=>localStorage.getItem(l)||a);h.useEffect(()=>{const f=window.document.documentElement;if(f.classList.remove("light","dark"),o==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(p);return}f.classList.add(o)},[o]);const u={theme:o,setTheme:f=>{localStorage.setItem(l,f),c(f)}};return s.jsx(f1.Provider,{value:u,children:n})}function UR(){const n=h.useContext(f1);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}var IR=Object.defineProperty,Jl=(n,a)=>IR(n,"name",{value:a,configurable:!0}),h1=!!(typeof window<"u"&&window.document&&window.document.createElement);function Se(n,a,{checkForDefaultPrevented:l=!0}={}){return Jl(function(c){if(n==null||n(c),l===!1||!c||!c.defaultPrevented)return a==null?void 0:a(c)},"handleEvent")}Jl(Se,"composeEventHandlers");function PR(n){var a;if(!h1)throw new Error("Cannot access window outside of the DOM");return((a=n==null?void 0:n.ownerDocument)==null?void 0:a.defaultView)??window}Jl(PR,"getOwnerWindow");function Kh(n){if(!h1)throw new Error("Cannot access document outside of the DOM");return(n==null?void 0:n.ownerDocument)??document}Jl(Kh,"getOwnerDocument");function m1(n,a=!1){const{activeElement:l}=Kh(n);if(!(l!=null&&l.nodeName))return null;if(p1(l)&&l.contentDocument)return m1(l.contentDocument.body,a);if(a){const o=l.getAttribute("aria-activedescendant");if(o){const c=Kh(l).getElementById(o);if(c)return c}}return l}Jl(m1,"getActiveElement");function p1(n){return n.tagName==="IFRAME"}Jl(p1,"isFrame");var BR=Object.defineProperty,fa=(n,a)=>BR(n,"name",{value:a,configurable:!0});function HR(n,a){const l=h.createContext(a);l.displayName=n+"Context";const o=fa(u=>{const{children:f,...p}=u,g=h.useMemo(()=>p,Object.values(p));return s.jsx(l.Provider,{value:g,children:f})},"Provider");o.displayName=n+"Provider";function c(u,f={}){const{optional:p=!1}=f,g=h.useContext(l);if(g)return g;if(a!==void 0)return a;if(!p)throw new Error(`\`${u}\` must be used within \`${n}\``)}return fa(c,"useContext"),[o,c]}fa(HR,"createContext");function Hn(n,a=[]){let l=[];function o(u,f){const p=h.createContext(f);p.displayName=u+"Context";const g=l.length;l=[...l,f];const v=fa(y=>{var R;const{scope:b,children:w,...N}=y,S=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=h.useMemo(()=>N,Object.values(N));return s.jsx(S.Provider,{value:C,children:w})},"Provider");v.displayName=u+"Provider";function x(y,b,w={}){var R;const{optional:N=!1}=w,S=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=h.useContext(S);if(C)return C;if(f!==void 0)return f;if(!N)throw new Error(`\`${y}\` must be used within \`${u}\``)}return fa(x,"useContext"),[v,x]}fa(o,"createContext");const c=fa(()=>{const u=l.map(f=>h.createContext(f));return fa(function(p){const g=(p==null?void 0:p[n])||u;return h.useMemo(()=>({[`__scope${n}`]:{...p,[n]:g}}),[p,g])},"useScope")},"createScope");return c.scopeName=n,[o,g1(c,...a)]}fa(Hn,"createContextScope");function g1(...n){const a=n[0];if(n.length===1)return a;const l=fa(()=>{const o=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return fa(function(u){const f=o.reduce((p,{useScope:g,scopeName:v})=>{const y=g(u)[`__scope${v}`];return{...p,...y}},{});return h.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])},"useComposedScopes")},"createScope");return l.scopeName=a.scopeName,l}fa(g1,"composeContextScopes");var Jt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},qR=Object.defineProperty,$R=(n,a)=>qR(n,"name",{value:a,configurable:!0}),jb=Gl[" useEffectEvent ".trim().toString()],Sb=Gl[" useInsertionEffect ".trim().toString()];function v1(n){if(typeof jb=="function")return jb(n);const a=h.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Sb=="function"?Sb(()=>{a.current=n}):Jt(()=>{a.current=n}),h.useMemo(()=>((...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)}),[])}$R(v1,"useEffectEvent");var VR=Object.defineProperty,yi=(n,a)=>VR(n,"name",{value:a,configurable:!0}),GR=Gl[" useInsertionEffect ".trim().toString()]||Jt;function Ia({prop:n,defaultProp:a,onChange:l=yi(()=>{},"onChange"),caller:o}){const[c,u,f]=x1({defaultProp:a,onChange:l}),p=n!==void 0,g=p?n:c,v=h.useCallback(x=>{var y;if(p){const b=y1(x)?x(n):x;b!==n&&((y=f.current)==null||y.call(f,b))}else u(x)},[p,n,u,f]);return[g,v]}yi(Ia,"useControllableState");function x1({defaultProp:n,onChange:a}){const[l,o]=h.useState(n),c=h.useRef(l),u=h.useRef(a);return GR(()=>{u.current=a},[a]),h.useEffect(()=>{var f;c.current!==l&&((f=u.current)==null||f.call(u,l),c.current=l)},[l,c]),[l,o,u]}yi(x1,"useUncontrolledState");function y1(n){return typeof n=="function"}yi(y1,"isFunction");var Cb=Symbol("RADIX:SYNC_STATE");function YR(n,a,l,o){const{prop:c,defaultProp:u,onChange:f,caller:p}=a,g=c!==void 0,v=v1(f),x=[{...l,state:u}];o&&x.push(o);const[y,b]=h.useReducer((C,R)=>{if(R.type===Cb)return{...C,state:R.state};const D=n(C,R);return g&&!Object.is(D.state,C.state)&&v(D.state),D},...x),w=y.state,N=h.useRef(w);h.useEffect(()=>{N.current!==w&&(N.current=w,g||v(w))},[w,N,g]);const S=h.useMemo(()=>c!==void 0?{...y,state:c}:y,[y,c]);return h.useEffect(()=>{g&&!Object.is(c,y.state)&&b({type:Cb,state:c})},[c,y.state,g]),[S,b]}yi(YR,"useControllableStateReducer");var FR=Object.defineProperty,XR=(n,a)=>FR(n,"name",{value:a,configurable:!0}),KR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],He=KR.reduce((n,a)=>{const l=Ua(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:f,...p}=c,g=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(g,{...p,ref:u})});return o.displayName=`Primitive.${a}`,{...n,[a]:o}},{});function Xm(n,a){n&&Sa.flushSync(()=>n.dispatchEvent(a))}XR(Xm,"dispatchDiscreteCustomEvent");var QR=Object.defineProperty,sn=(n,a)=>QR(n,"name",{value:a,configurable:!0});function zu(n){const a=n+"CollectionProvider",[l,o]=Hn(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=sn(S=>{const{scope:C,children:R}=S,D=h.useRef(null),A=h.useRef(new Map).current;return s.jsx(c,{scope:C,itemMap:A,collectionRef:D,children:R})},"CollectionProvider");f.displayName=a;const p=n+"CollectionSlot",g=Ua(p),v=h.forwardRef((S,C)=>{const{scope:R,children:D}=S,A=u(p,R),M=Fe(C,A.collectionRef);return s.jsx(g,{ref:M,children:D})});v.displayName=p;const x=n+"CollectionItemSlot",y="data-radix-collection-item",b=Ua(x),w=h.forwardRef((S,C)=>{const{scope:R,children:D,...A}=S,M=h.useRef(null),O=Fe(C,M),E=u(x,R);return h.useEffect(()=>(E.itemMap.set(M,{ref:M,...A}),()=>void E.itemMap.delete(M))),s.jsx(b,{[y]:"",ref:O,children:D})});w.displayName=x;function N(S){const C=u(n+"CollectionConsumer",S);return h.useCallback(()=>{const D=C.collectionRef.current;if(!D)return[];const A=Array.from(D.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((E,z)=>A.indexOf(E.ref.current)-A.indexOf(z.ref.current))},[C.collectionRef,C.itemMap])}return sn(N,"useCollection"),[{Provider:f,Slot:v,ItemSlot:w},N,o]}sn(zu,"createCollection");var Nb=new WeakMap,$t,Qn,Nh=(Qn=class extends Map{constructor(l){super(l);Wy(this,$t);hh(this,$t,[...super.keys()]),Nb.set(this,!0)}set(l,o){return Nb.get(this)&&(this.has(l)?gn(this,$t)[gn(this,$t).indexOf(l)]=l:gn(this,$t).push(l)),super.set(l,o),this}insert(l,o,c){const u=this.has(o),f=gn(this,$t).length,p=Km(l);let g=p>=0?p:f+p;const v=g<0||g>=f?-1:g;if(v===this.size||u&&v===this.size-1||v===-1)return this.set(o,c),this;const x=this.size+(u?0:1);p<0&&g++;const y=[...gn(this,$t)];let b,w=!1;for(let N=g;N<x;N++)if(g===N){let S=y[N];y[N]===o&&(S=y[N+1]),u&&this.delete(o),b=this.get(S),this.set(o,c)}else{!w&&y[N-1]===o&&(w=!0);const S=y[w?N:N-1],C=b;b=this.get(S),this.delete(S),this.set(S,C)}return this}with(l,o,c){const u=new Qn(this);return u.insert(l,o,c),u}before(l){const o=gn(this,$t).indexOf(l)-1;if(!(o<0))return this.entryAt(o)}setBefore(l,o,c){const u=gn(this,$t).indexOf(l);return u===-1?this:this.insert(u,o,c)}after(l){let o=gn(this,$t).indexOf(l);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(l,o,c){const u=gn(this,$t).indexOf(l);return u===-1?this:this.insert(u+1,o,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return hh(this,$t,[]),super.clear()}delete(l){const o=super.delete(l);return o&&gn(this,$t).splice(gn(this,$t).indexOf(l),1),o}deleteAt(l){const o=this.keyAt(l);return o!==void 0?this.delete(o):!1}at(l){const o=iu(gn(this,$t),l);if(o!==void 0)return this.get(o)}entryAt(l){const o=iu(gn(this,$t),l);if(o!==void 0)return[o,this.get(o)]}indexOf(l){return gn(this,$t).indexOf(l)}keyAt(l){return iu(gn(this,$t),l)}from(l,o){const c=this.indexOf(l);if(c===-1)return;let u=c+o;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.at(u)}keyFrom(l,o){const c=this.indexOf(l);if(c===-1)return;let u=c+o;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.keyAt(u)}find(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return u;c++}}findIndex(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return c;c++}return-1}filter(l,o){const c=[];let u=0;for(const f of this)Reflect.apply(l,o,[f,u,this])&&c.push(f),u++;return new Qn(c)}map(l,o){const c=[];let u=0;for(const f of this)c.push([f[0],Reflect.apply(l,o,[f,u,this])]),u++;return new Qn(c)}reduce(...l){const[o,c]=l;let u=0,f=c??this.at(0);for(const p of this)u===0&&l.length===1?f=p:f=Reflect.apply(o,this,[f,p,u,this]),u++;return f}reduceRight(...l){const[o,c]=l;let u=c??this.at(-1);for(let f=this.size-1;f>=0;f--){const p=this.at(f);f===this.size-1&&l.length===1?u=p:u=Reflect.apply(o,this,[u,p,f,this])}return u}toSorted(l){const o=[...this.entries()].sort(l);return new Qn(o)}toReversed(){const l=new Qn;for(let o=this.size-1;o>=0;o--){const c=this.keyAt(o),u=this.get(c);l.set(c,u)}return l}toSpliced(...l){const o=[...this.entries()];return o.splice(...l),new Qn(o)}slice(l,o){const c=new Qn;let u=this.size-1;if(l===void 0)return c;l<0&&(l=l+this.size),o!==void 0&&o>0&&(u=o-1);for(let f=l;f<=u;f++){const p=this.keyAt(f),g=this.get(p);c.set(p,g)}return c}every(l,o){let c=0;for(const u of this){if(!Reflect.apply(l,o,[u,c,this]))return!1;c++}return!0}some(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return!0;c++}return!1}},$t=new WeakMap,sn(Qn,"OrderedDict"),Qn);function iu(n,a){if("at"in Array.prototype)return Array.prototype.at.call(n,a);const l=b1(n,a);return l===-1?void 0:n[l]}sn(iu,"at");function b1(n,a){const l=n.length,o=Km(a),c=o>=0?o:l+o;return c<0||c>=l?-1:c}sn(b1,"toSafeIndex");function Km(n){return n!==n||n===0?0:Math.trunc(n)}sn(Km,"toSafeInteger");function ZR(n){const a=n+"CollectionProvider",[l,o]=Hn(a),[c,u]=l(a,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Nh,setItemMap:sn(()=>{},"setItemMap")}),f=sn(({state:A,...M})=>A?s.jsx(g,{...M,state:A}):s.jsx(p,{...M}),"CollectionProvider");f.displayName=a;const p=sn(A=>{const M=C();return s.jsx(g,{...A,state:M})},"CollectionInit");p.displayName=a+"Init";const g=sn(A=>{const{scope:M,children:O,state:E}=A,z=h.useRef(null),[k,P]=h.useState(null),Z=Fe(z,P),[ee,V]=E;return h.useEffect(()=>{if(!k)return;const ce=S1(()=>{});return ce.observe(k,{childList:!0,subtree:!0}),()=>{ce.disconnect()}},[k]),s.jsx(c,{scope:M,itemMap:ee,setItemMap:V,collectionRef:Z,collectionRefObject:z,collectionElement:k,children:O})},"CollectionProviderImpl");g.displayName=a+"Impl";const v=n+"CollectionSlot",x=Ua(v),y=h.forwardRef((A,M)=>{const{scope:O,children:E}=A,z=u(v,O),k=Fe(M,z.collectionRef);return s.jsx(x,{ref:k,children:E})});y.displayName=v;const b=n+"CollectionItemSlot",w="data-radix-collection-item",N=Ua(b),S=h.forwardRef((A,M)=>{const{scope:O,children:E,...z}=A,k=h.useRef(null),[P,Z]=h.useState(null),ee=Fe(M,k,Z),V=u(b,O),{setItemMap:ce}=V,se=h.useRef(z);w1(se.current,z)||(se.current=z);const H=se.current;return h.useEffect(()=>{const _=H;return ce(q=>P?q.has(P)?q.set(P,{..._,element:P}).toSorted(Qh):(q.set(P,{..._,element:P}),q.toSorted(Qh)):q),()=>{ce(q=>!P||!q.has(P)?q:(q.delete(P),new Nh(q)))}},[P,H,ce]),s.jsx(N,{[w]:"",ref:ee,children:E})});S.displayName=b;function C(){return h.useState(new Nh)}sn(C,"useInitCollection");function R(A){const{itemMap:M}=u(n+"CollectionConsumer",A);return M}return sn(R,"useCollection"),[{Provider:f,Slot:y,ItemSlot:S},{createCollectionScope:o,useCollection:R,useInitCollection:C}]}sn(ZR,"createCollection");function w1(n,a){if(n===a)return!0;if(typeof n!="object"||typeof a!="object"||n==null||a==null)return!1;const l=Object.keys(n),o=Object.keys(a);if(l.length!==o.length)return!1;for(const c of l)if(!Object.prototype.hasOwnProperty.call(a,c)||n[c]!==a[c])return!1;return!0}sn(w1,"shallowEqual");function j1(n,a){return!!(a.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}sn(j1,"isElementPreceding");function Qh(n,a){return!n[1].element||!a[1].element?0:j1(n[1].element,a[1].element)?-1:1}sn(Qh,"sortByDocumentPosition");function S1(n){return new MutationObserver(l=>{for(const o of l)if(o.type==="childList"){n();return}})}sn(S1,"getChildListObserver");var JR=Object.defineProperty,WR=(n,a)=>JR(n,"name",{value:a,configurable:!0}),eT=h.createContext(void 0);function bi(n){const a=h.useContext(eT);return n||a||"ltr"}WR(bi,"useDirection");var tT=Object.defineProperty,nT=(n,a)=>tT(n,"name",{value:a,configurable:!0});function ma(n){const a=h.useRef(n);return h.useEffect(()=>{a.current=n}),h.useMemo(()=>((...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)}),[])}nT(ma,"useCallbackRef");var aT=Object.defineProperty,rn=(n,a)=>aT(n,"name",{value:a,configurable:!0}),Zh="dismissableLayer.update",rT="dismissableLayer.pointerDownOutside",sT="dismissableLayer.focusOutside",Eb,C1=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Lu=h.forwardRef(rn(function(a,l){const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:g,onDismiss:v,...x}=a,y=h.useContext(C1),[b,w]=h.useState(null),N=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=h.useState({}),C=Fe(l,w),R=Array.from(y.layers),[D]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),A=D?R.indexOf(D):-1,M=b?R.indexOf(b):-1,O=y.layersWithOutsidePointerEventsDisabled.size>0,E=M>=A,z=h.useRef(!1),k=E1(V=>{f==null||f(V),g==null||g(V),V.defaultPrevented||v==null||v()},{ownerDocument:N,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:z,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(V=>{if(!(V instanceof Node))return!1;const ce=[...y.branches].some(se=>se.contains(V));return E&&!ce},[y.branches,E])}),P=R1(V=>{if(c&&z.current)return;const ce=V.target;[...y.branches].some(H=>H.contains(ce))||(p==null||p(V),g==null||g(V),V.defaultPrevented||v==null||v())},N),Z=b?M===R.length-1:!1,ee=ma(V=>{V.key==="Escape"&&(u==null||u(V),!V.defaultPrevented&&v&&(V.preventDefault(),v()))});return h.useEffect(()=>{if(Z)return N.addEventListener("keydown",ee,{capture:!0}),()=>N.removeEventListener("keydown",ee,{capture:!0})},[N,Z,ee]),h.useEffect(()=>{if(b)return o&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Eb=N.body.style.pointerEvents,N.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(b)),y.layers.add(b),Jh(),()=>{o&&(y.layersWithOutsidePointerEventsDisabled.delete(b),y.layersWithOutsidePointerEventsDisabled.size===0&&(N.body.style.pointerEvents=Eb))}},[b,N,o,y]),h.useEffect(()=>()=>{b&&(y.layers.delete(b),y.layersWithOutsidePointerEventsDisabled.delete(b),Jh())},[b,y]),h.useEffect(()=>{const V=rn(()=>S({}),"handleUpdate");return document.addEventListener(Zh,V),()=>document.removeEventListener(Zh,V)},[]),s.jsx(He.div,{...x,ref:C,style:{pointerEvents:O?E?"auto":"none":void 0,...a.style},onFocusCapture:Se(a.onFocusCapture,P.onFocusCapture),onBlurCapture:Se(a.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Se(a.onPointerDownCapture,k.onPointerDownCapture)})},"DismissableLayer"));function N1(){const n=h.useContext(C1),[a,l]=h.useState(null);return h.useEffect(()=>{if(a)return n.dismissableSurfaces.add(a),()=>{n.dismissableSurfaces.delete(a)}},[a,n.dismissableSurfaces]),l}rn(N1,"useDismissableLayerSurface");var lT=rn(()=>!0,"IS_TRUE");function E1(n,a){const{ownerDocument:l=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:u,shouldHandlePointerDownOutside:f=lT}=a,p=ma(n),g=h.useRef(!1),v=h.useRef(!1),x=h.useRef(new Map),y=h.useRef(()=>{});return h.useEffect(()=>{function b(){v.current=!1,c.current=!1,x.current.clear()}rn(b,"resetOutsideInteraction");function w(){return Array.from(x.current.values()).some(Boolean)}rn(w,"isOutsideInteractionIntercepted");function N(A){if(!v.current)return;const M=A.target;M instanceof Node&&[...u].some(E=>E.contains(M))||x.current.set(A.type,!0),A.type==="click"&&window.setTimeout(()=>{v.current&&y.current()},0)}rn(N,"handleInteractionCapture");function S(A){v.current&&x.current.set(A.type,!1)}rn(S,"handleInteractionBubble");const C=rn(A=>{if(A.target&&!g.current){let M=function(){l.removeEventListener("click",y.current);const E=w();b(),E||Qm(rT,p,O,{discrete:!0})};if(rn(M,"handleAndDispatchPointerDownOutsideEvent"),!f(A.target)){l.removeEventListener("click",y.current),b(),g.current=!1;return}const O={originalEvent:A};v.current=!0,c.current=o&&A.button===0,x.current.clear(),!o||A.button!==0?M():(l.removeEventListener("click",y.current),y.current=M,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 A of R)l.addEventListener(A,N,!0),l.addEventListener(A,S);const D=window.setTimeout(()=>{l.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(D),l.removeEventListener("pointerdown",C),l.removeEventListener("click",y.current);for(const A of R)l.removeEventListener(A,N,!0),l.removeEventListener(A,S)}},[l,p,o,c,u,f]),{onPointerDownCapture:rn(()=>g.current=!0,"onPointerDownCapture")}}rn(E1,"usePointerDownOutside");function R1(n,a=globalThis==null?void 0:globalThis.document){const l=ma(n),o=h.useRef(!1);return h.useEffect(()=>{const c=rn(u=>{u.target&&!o.current&&Qm(sT,l,{originalEvent:u},{discrete:!1})},"handleFocus");return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:rn(()=>o.current=!0,"onFocusCapture"),onBlurCapture:rn(()=>o.current=!1,"onBlurCapture")}}rn(R1,"useFocusOutside");function Jh(){const n=new CustomEvent(Zh);document.dispatchEvent(n)}rn(Jh,"dispatchUpdate");function Qm(n,a,l,{discrete:o}){const c=l.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(n,a,{once:!0}),o?Xm(c,u):c.dispatchEvent(u)}rn(Qm,"handleAndDispatchCustomEvent");var oT=Object.defineProperty,Zm=(n,a)=>oT(n,"name",{value:a,configurable:!0}),Gc=0,_a=null;function iT(n){return wi(),n.children}Zm(iT,"FocusGuards");function wi(){h.useEffect(()=>{_a||(_a={start:Wh(),end:Wh()});const{start:n,end:a}=_a;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==a&&document.body.insertAdjacentElement("beforeend",a),Gc++,()=>{Gc===1&&(_a==null||_a.start.remove(),_a==null||_a.end.remove(),_a=null),Gc=Math.max(0,Gc-1)}},[])}Zm(wi,"useFocusGuards");function Wh(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}Zm(Wh,"createFocusGuard");var cT=Object.defineProperty,wn=(n,a)=>cT(n,"name",{value:a,configurable:!0}),Eh="focusScope.autoFocusOnMount",Rh="focusScope.autoFocusOnUnmount",Rb={bubbles:!1,cancelable:!0},Jm=h.forwardRef(wn(function(a,l){const{loop:o=!1,trapped:c=!1,onMountAutoFocus:u,onUnmountAutoFocus:f,...p}=a,[g,v]=h.useState(null),x=ma(u),y=ma(f),b=h.useRef(null),w=Fe(l,v),N=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(c){let C=function(M){if(N.paused||!g)return;const O=M.target;g.contains(O)?b.current=O:hr(b.current,{select:!0})},R=function(M){if(N.paused||!g)return;const O=M.relatedTarget;O!==null&&(g.contains(O)||hr(b.current,{select:!0}))},D=function(M){if(document.activeElement===document.body)for(const E of M)E.removedNodes.length>0&&hr(g)};wn(C,"handleFocusIn"),wn(R,"handleFocusOut"),wn(D,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",R);const A=new MutationObserver(D);return g&&A.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",R),A.disconnect()}}},[c,g,N.paused]),h.useEffect(()=>{if(g){Tb.add(N);const C=document.activeElement;if(!g.contains(C)){const D=new CustomEvent(Eh,Rb);g.addEventListener(Eh,x),g.dispatchEvent(D),D.defaultPrevented||(T1(k1(Wm(g)),{select:!0}),document.activeElement===C&&hr(g))}return()=>{g.removeEventListener(Eh,x),setTimeout(()=>{const D=new CustomEvent(Rh,Rb);g.addEventListener(Rh,y),g.dispatchEvent(D),D.defaultPrevented||hr(C??document.body,{select:!0}),g.removeEventListener(Rh,y),Tb.remove(N)},0)}}},[g,x,y,N]);const S=h.useCallback(C=>{if(!o&&!c||N.paused)return;const R=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,D=document.activeElement;if(R&&D){const A=C.currentTarget,[M,O]=A1(A);M&&O?!C.shiftKey&&D===O?(C.preventDefault(),o&&hr(M,{select:!0})):C.shiftKey&&D===M&&(C.preventDefault(),o&&hr(O,{select:!0})):D===A&&C.preventDefault()}},[o,c,N.paused]);return s.jsx(He.div,{tabIndex:-1,...p,ref:w,onKeyDown:S})},"FocusScope"));function T1(n,{select:a=!1}={}){const l=document.activeElement;for(const o of n)if(hr(o,{select:a}),document.activeElement!==l)return}wn(T1,"focusFirst");function A1(n){const a=Wm(n),l=em(a,n),o=em(a.reverse(),n);return[l,o]}wn(A1,"getTabbableEdges");function Wm(n){const a=[],l=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:wn(o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;l.nextNode();)a.push(l.currentNode);return a}wn(Wm,"getTabbableCandidates");function em(n,a){const l=typeof a.checkVisibility=="function"&&a.checkVisibility({checkVisibilityCSS:!0});for(const o of n)if(!(l?!o.checkVisibility({checkVisibilityCSS:!0}):M1(o,{upTo:a})))return o}wn(em,"findVisible");function M1(n,{upTo:a}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(a!==void 0&&n===a)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}wn(M1,"isHidden");function D1(n){return n instanceof HTMLInputElement&&"select"in n}wn(D1,"isSelectableInput");function hr(n,{select:a=!1}={}){if(n&&n.focus){const l=document.activeElement;n.focus({preventScroll:!0}),n!==l&&D1(n)&&a&&n.select()}}wn(hr,"focus");var Tb=O1();function O1(){let n=[];return{add(a){const l=n[0];a!==l&&(l==null||l.pause()),n=tm(n,a),n.unshift(a)},remove(a){var l;n=tm(n,a),(l=n[0])==null||l.resume()}}}wn(O1,"createFocusScopesStack");function tm(n,a){const l=[...n],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}wn(tm,"arrayRemove");function k1(n){return n.filter(a=>a.tagName!=="A")}wn(k1,"removeLinks");var uT=Object.defineProperty,dT=(n,a)=>uT(n,"name",{value:a,configurable:!0}),fT=Gl[" useId ".trim().toString()]||(()=>{}),hT=0;function Na(n){const[a,l]=h.useState(fT());return Jt(()=>{n||l(o=>o??String(hT++))},[n]),n||(a?`radix-${a}`:"")}dT(Na,"useId");const mT=["top","right","bottom","left"],cs=Math.min,gr=Math.max,vu=Math.round,Yc=Math.floor,vr=n=>({x:n,y:n}),pT={left:"right",right:"left",bottom:"top",top:"bottom"};function _1(n,a,l){return gr(n,cs(a,l))}function br(n,a){return typeof n=="function"?n(a):n}function us(n){return n.split("-")[0]}function Wl(n){return n.split("-")[1]}function ep(n){return n==="x"?"y":"x"}function tp(n){return n==="y"?"height":"width"}function La(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function np(n){return ep(La(n))}function gT(n,a,l){l===void 0&&(l=!1);const o=Wl(n),c=np(n),u=tp(c);let f=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=xu(f)),[f,xu(f)]}function vT(n){const a=xu(n);return[nm(n),a,nm(a)]}function nm(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Ab=["left","right"],Mb=["right","left"],xT=["top","bottom"],yT=["bottom","top"];function bT(n,a,l){switch(n){case"top":case"bottom":return l?a?Mb:Ab:a?Ab:Mb;case"left":case"right":return a?xT:yT;default:return[]}}function wT(n,a,l,o){const c=Wl(n);let u=bT(us(n),l==="start",o);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(nm)))),u}function xu(n){const a=us(n);return pT[a]+n.slice(a.length)}function jT(n){var a,l,o,c;return{top:(a=n.top)!=null?a:0,right:(l=n.right)!=null?l:0,bottom:(o=n.bottom)!=null?o:0,left:(c=n.left)!=null?c:0}}function z1(n){return typeof n!="number"?jT(n):{top:n,right:n,bottom:n,left:n}}function yu(n){const{x:a,y:l,width:o,height:c}=n;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function Db(n,a,l){let{reference:o,floating:c}=n;const u=La(a),f=np(a),p=tp(f),g=us(a),v=u==="y",x=o.x+o.width/2-c.width/2,y=o.y+o.height/2-c.height/2,b=o[p]/2-c[p]/2;let w;switch(g){case"top":w={x,y:o.y-c.height};break;case"bottom":w={x,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y};break;case"left":w={x:o.x-c.width,y};break;default:w={x:o.x,y:o.y}}const N=Wl(a);return N&&(w[f]+=b*(N==="end"?1:-1)*(l&&v?-1:1)),w}async function ST(n,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:u,rects:f,elements:p,strategy:g}=n,{boundary:v="clippingAncestors",rootBoundary:x="viewport",elementContext:y="floating",altBoundary:b=!1,padding:w=0}=br(a,n),N=z1(w),C=p[b?y==="floating"?"reference":"floating":y],R=yu(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})),D=y==="floating"?{x:o,y:c,width:f.floating.width,height:f.floating.height}:f.reference,A=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),M=await(u.isElement==null?void 0:u.isElement(A))&&await(u.getScale==null?void 0:u.getScale(A))||{x:1,y:1},O=yu(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:D,offsetParent:A,strategy:g}):D);return{top:(R.top-O.top+N.top)/M.y,bottom:(O.bottom-R.bottom+N.bottom)/M.y,left:(R.left-O.left+N.left)/M.x,right:(O.right-R.right+N.right)/M.x}}const CT=50,NT=async(n,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:f}=l,p=f.detectOverflow?f:{...f,detectOverflow:ST},g=await(f.isRTL==null?void 0:f.isRTL(a));let v=await f.getElementRects({reference:n,floating:a,strategy:c}),{x,y}=Db(v,o,g),b=o,w=0;const N={};for(let S=0;S<u.length;S++){const C=u[S];if(!C)continue;const{name:R,fn:D}=C,{x:A,y:M,data:O,reset:E}=await D({x,y,initialPlacement:o,placement:b,strategy:c,middlewareData:N,rects:v,platform:p,elements:{reference:n,floating:a}});x=A??x,y=M??y,N[R]={...N[R],...O},E&&w<CT&&(w++,typeof E=="object"&&(E.placement&&(b=E.placement),E.rects&&(v=E.rects===!0?await f.getElementRects({reference:n,floating:a,strategy:c}):E.rects),{x,y}=Db(v,b,g)),S=-1)}return{x,y,placement:b,strategy:c,middlewareData:N}},ET=n=>({name:"arrow",options:n,async fn(a){const{x:l,y:o,placement:c,rects:u,platform:f,elements:p,middlewareData:g}=a,{element:v,padding:x=0}=br(n,a)||{};if(v==null)return{};const y=z1(x),b={x:l,y:o},w=np(c),N=tp(w),S=await f.getDimensions(v),C=w==="y",R=C?"top":"left",D=C?"bottom":"right",A=C?"clientHeight":"clientWidth",M=u.reference[N]+u.reference[w]-b[w]-u.floating[N],O=b[w]-u.reference[w],E=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v));let z=E?E[A]:0;(!z||!await(f.isElement==null?void 0:f.isElement(E)))&&(z=p.floating[A]||u.floating[N]);const k=M/2-O/2,P=z/2-S[N]/2-1,Z=cs(y[R],P),ee=cs(y[D],P),V=z-S[N]-ee,ce=z/2-S[N]/2+k,se=_1(Z,ce,V),H=!g.arrow&&Wl(c)!=null&&ce!==se&&u.reference[N]/2-(ce<Z?Z:ee)-S[N]/2<0,_=H?ce<Z?ce-Z:ce-V:0;return{[w]:b[w]+_,data:{[w]:se,centerOffset:ce-se-_,...H&&{alignmentOffset:_}},reset:H}}}),RT=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var l,o;const{placement:c,middlewareData:u,rects:f,initialPlacement:p,platform:g,elements:v}=a,{mainAxis:x=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:S=!0,...C}=br(n,a);if((l=u.arrow)!=null&&l.alignmentOffset)return{};const R=us(c),D=La(p),A=us(p)===p,M=await(g.isRTL==null?void 0:g.isRTL(v.floating)),O=b||(A||!S?[xu(p)]:vT(p)),E=N!=="none";!b&&E&&O.push(...wT(p,S,N,M));const z=[p,...O],k=await g.detectOverflow(a,C),P=[];let Z=((o=u.flip)==null?void 0:o.overflows)||[];if(x&&P.push(k[R]),y){const se=gT(c,f,M);P.push(k[se[0]],k[se[1]])}if(Z=[...Z,{placement:c,overflows:P}],!P.every(se=>se<=0)){var ee,V;const se=(((ee=u.flip)==null?void 0:ee.index)||0)+1,H=z[se];if(H&&(!(y==="alignment"?D!==La(H):!1)||Z.every(W=>La(W.placement)===D?W.overflows[0]>0:!0)))return{data:{index:se,overflows:Z},reset:{placement:H}};let _=(V=Z.filter(q=>q.overflows[0]<=0).sort((q,W)=>q.overflows[1]-W.overflows[1])[0])==null?void 0:V.placement;if(!_)switch(w){case"bestFit":{var ce;const q=(ce=Z.filter(W=>{if(E){const Q=La(W.placement);return Q===D||Q==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(Q=>Q>0).reduce((Q,te)=>Q+te,0)]).sort((W,Q)=>W[1]-Q[1])[0])==null?void 0:ce[0];q&&(_=q);break}case"initialPlacement":_=p;break}if(c!==_)return{reset:{placement:_}}}return{}}}};function Ob(n,a){return{top:n.top-a.height,right:n.right-a.width,bottom:n.bottom-a.height,left:n.left-a.width}}function kb(n){return mT.some(a=>n[a]>=0)}const TT=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...u}=br(n,a);switch(c){case"referenceHidden":{const f=await o.detectOverflow(a,{...u,elementContext:"reference"}),p=Ob(f,l.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:kb(p)}}}case"escaped":{const f=await o.detectOverflow(a,{...u,altBoundary:!0}),p=Ob(f,l.floating);return{data:{escapedOffsets:p,escaped:kb(p)}}}default:return{}}}}},L1=new Set(["left","top"]);async function AT(n,a){const{placement:l,platform:o,elements:c}=n,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),f=us(l),p=Wl(l),g=La(l)==="y",v=L1.has(f)?-1:1,x=u&&g?-1:1,y=br(a,n);let{mainAxis:b,crossAxis:w,alignmentAxis:N}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof N=="number"&&(w=p==="end"?N*-1:N),g?{x:w*x,y:b*v}:{x:b*v,y:w*x}}const MT=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var l,o;const{x:c,y:u,placement:f,middlewareData:p}=a,g=await AT(a,n);return f===((l=p.offset)==null?void 0:l.placement)&&(o=p.arrow)!=null&&o.alignmentOffset?{}:{x:c+g.x,y:u+g.y,data:{...g,placement:f}}}}},DT=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(a){const{x:l,y:o,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:g={fn:D=>{let{x:A,y:M}=D;return{x:A,y:M}}},...v}=br(n,a),x={x:l,y:o},y=await u.detectOverflow(a,v),b=La(c),w=ep(b);let N=x[w],S=x[b];const C=(D,A)=>_1(A+y[D==="y"?"top":"left"],A,A-y[D==="y"?"bottom":"right"]);f&&(N=C(w,N)),p&&(S=C(b,S));const R=g.fn({...a,[w]:N,[b]:S});return{...R,data:{x:R.x-l,y:R.y-o,enabled:{[w]:f,[b]:p}}}}}},OT=function(n){return n===void 0&&(n={}),{options:n,fn(a){var l,o;const{x:c,y:u,placement:f,rects:p,middlewareData:g}=a,{offset:v=0,mainAxis:x=!0,crossAxis:y=!0}=br(n,a),b={x:c,y:u},w=La(f),N=ep(w);let S=b[N],C=b[w];const R=br(v,a),D=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(l=R.mainAxis)!=null?l:0,crossAxis:(o=R.crossAxis)!=null?o:0};if(x){const O=N==="y"?"height":"width",E=p.reference[N]-p.floating[O]+D.mainAxis,z=p.reference[N]+p.reference[O]-D.mainAxis;S<E?S=E:S>z&&(S=z)}if(y){var A,M;const O=N==="y"?"width":"height",E=L1.has(us(f)),z=p.reference[w]-p.floating[O]+(E&&((A=g.offset)==null?void 0:A[w])||0)+(E?0:D.crossAxis),k=p.reference[w]+p.reference[O]+(E?0:((M=g.offset)==null?void 0:M[w])||0)-(E?D.crossAxis:0);C<z?C=z:C>k&&(C=k)}return{[N]:S,[w]:C}}}},kT=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(a){const{placement:l,rects:o,platform:c,elements:u}=a,{apply:f=()=>{},...p}=br(n,a),g=await c.detectOverflow(a,p),v=us(l),x=Wl(l),y=La(l)==="y",{width:b,height:w}=o.floating;let N,S;v==="top"||v==="bottom"?(N=v,S=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(S=v,N=x==="end"?"top":"bottom");const C=w-g.top-g.bottom,R=b-g.left-g.right,D=cs(w-g[N],C),A=cs(b-g[S],R),M=a.middlewareData.shift,O=!M;let E=D,z=A;M!=null&&M.enabled.x&&(z=R),M!=null&&M.enabled.y&&(E=C),O&&!x&&(y?z=b-2*gr(g.left,g.right):E=w-2*gr(g.top,g.bottom)),await f({...a,availableWidth:z,availableHeight:E});const k=await c.getDimensions(u.floating);return b!==k.width||w!==k.height?{reset:{rects:!0}}:{}}}};function Uu(){return typeof window<"u"}function eo(n){return U1(n)?(n.nodeName||"").toLowerCase():"#document"}function _n(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function Nr(n){var a;return(a=(U1(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function U1(n){return Uu()?n instanceof Node||n instanceof _n(n).Node:!1}function Pa(n){return Uu()?n instanceof Element||n instanceof _n(n).Element:!1}function fs(n){return Uu()?n instanceof HTMLElement||n instanceof _n(n).HTMLElement:!1}function _b(n){return!Uu()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof _n(n).ShadowRoot}function Iu(n){const{overflow:a,overflowX:l,overflowY:o,display:c}=Ba(n);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&c!=="inline"&&c!=="contents"}function _T(n){return/^(table|td|th)$/.test(eo(n))}function Pu(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const zT=/transform|translate|scale|rotate|perspective|filter/,LT=/paint|layout|strict|content/,Os=n=>!!n&&n!=="none";let Th;function ap(n){const a=Pa(n)?Ba(n):n;return Os(a.transform)||Os(a.translate)||Os(a.scale)||Os(a.rotate)||Os(a.perspective)||!rp()&&(Os(a.backdropFilter)||Os(a.filter))||zT.test(a.willChange||"")||LT.test(a.contain||"")}function UT(n){let a=Ps(n);for(;fs(a)&&!oi(a);){if(ap(a))return a;if(Pu(a))return null;a=Ps(a)}return null}function rp(){return Th==null&&(Th=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Th}function oi(n){return/^(html|body|#document)$/.test(eo(n))}function Ba(n){return _n(n).getComputedStyle(n)}function Bu(n){return Pa(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Ps(n){if(eo(n)==="html")return n;const a=n.assignedSlot||n.parentNode||_b(n)&&n.host||Nr(n);return _b(a)?a.host:a}function I1(n){const a=Ps(n);return oi(a)?(n.ownerDocument||n).body:fs(a)&&Iu(a)?a:I1(a)}function ii(n,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=I1(n),u=c===((o=n.ownerDocument)==null?void 0:o.body),f=_n(c);if(u){const p=am(f);return a.concat(f,f.visualViewport||[],Iu(c)?c:[],p&&l?ii(p):[])}else return a.concat(c,ii(c,[],l))}function am(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function P1(n){const a=Ba(n);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=fs(n),u=c?n.offsetWidth:l,f=c?n.offsetHeight:o,p=vu(l)!==u||vu(o)!==f;return p&&(l=u,o=f),{width:l,height:o,$:p}}function sp(n){return Pa(n)?n:n.contextElement}function Bl(n){const a=sp(n);if(!fs(a))return vr(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=P1(a);let f=(u?vu(l.width):l.width)/o,p=(u?vu(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const IT=vr(0);function B1(n){const a=_n(n);return!rp()||!a.visualViewport?IT:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function PT(n,a,l){return a===void 0&&(a=!1),!!l&&a&&l===_n(n)}function Bs(n,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),u=sp(n);let f=vr(1);a&&(o?Pa(o)&&(f=Bl(o)):f=Bl(n));const p=PT(u,l,o)?B1(u):vr(0);let g=(c.left+p.x)/f.x,v=(c.top+p.y)/f.y,x=c.width/f.x,y=c.height/f.y;if(u&&o){const b=_n(u),w=Pa(o)?_n(o):o;let N=b,S=am(N);for(;S&&w!==N;){const C=Bl(S),R=S.getBoundingClientRect(),D=Ba(S),A=R.left+(S.clientLeft+parseFloat(D.paddingLeft))*C.x,M=R.top+(S.clientTop+parseFloat(D.paddingTop))*C.y;g*=C.x,v*=C.y,x*=C.x,y*=C.y,g+=A,v+=M,N=_n(S),S=am(N)}}return yu({width:x,height:y,x:g,y:v})}function Hu(n,a){const l=Bu(n).scrollLeft;return a?a.left+l:Bs(Nr(n)).left+l}function H1(n,a){const l=n.getBoundingClientRect(),o=l.left+a.scrollLeft-Hu(n,l),c=l.top+a.scrollTop;return{x:o,y:c}}function BT(n){let{elements:a,rect:l,offsetParent:o,strategy:c}=n;const u=c==="fixed",f=Nr(o),p=a?Pu(a.floating):!1;if(o===f||p&&u)return l;let g={scrollLeft:0,scrollTop:0},v=vr(1);const x=vr(0),y=fs(o);if((y||!u)&&((eo(o)!=="body"||Iu(f))&&(g=Bu(o)),y)){const w=Bs(o);v=Bl(o),x.x=w.x+o.clientLeft,x.y=w.y+o.clientTop}const b=f&&!y&&!u?H1(f,g):vr(0);return{width: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 HT(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function qT(n){const a=Bu(n),l=n.ownerDocument.body,o=gr(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),c=gr(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let u=-a.scrollLeft+Hu(n);const f=-a.scrollTop;return Ba(l).direction==="rtl"&&(u+=gr(n.clientWidth,l.clientWidth)-o),{width:o,height:c,x:u,y:f}}const $T=25;function VT(n,a,l){l===void 0&&(l="viewport");const o=l==="layoutViewport",c=_n(n),u=Nr(n),f=c.visualViewport;let p=u.clientWidth,g=u.clientHeight,v=0,x=0;if(f){const b=!rp()||a==="fixed";o?b||(v=-f.offsetLeft,x=-f.offsetTop):(p=f.width,g=f.height,b&&(v=f.offsetLeft,x=f.offsetTop))}if(Hu(u)<=0){const b=u.ownerDocument,w=b.body,N=getComputedStyle(w),S=b.compatMode==="CSS1Compat"&&parseFloat(N.marginLeft)+parseFloat(N.marginRight)||0,C=Math.abs(u.clientWidth-w.clientWidth-S),R=getComputedStyle(u).scrollbarGutter==="stable both-edges"?C/2:C;R<=$T&&(p-=R)}return{width:p,height:g,x:v,y:x}}function GT(n,a){const l=Bs(n,!0,a==="fixed"),o=l.top+n.clientTop,c=l.left+n.clientLeft,u=Bl(n),f=n.clientWidth*u.x,p=n.clientHeight*u.y,g=c*u.x,v=o*u.y;return{width:f,height:p,x:g,y:v}}function zb(n,a,l){let o;if(a==="viewport"||a==="layoutViewport")o=VT(n,l,a);else if(a==="document")o=qT(Nr(n));else if(Pa(a))o=GT(a,l);else{const c=B1(n);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return yu(o)}function YT(n,a){const l=a.get(n);if(l)return l;let o=ii(n,[],!1).filter(p=>Pa(p)&&eo(p)!=="body"),c=null;const u=Ba(n).position==="fixed";let f=u?Ps(n):n;for(;Pa(f)&&!oi(f);){const p=Ba(f),g=ap(f),v=c?c.position:u?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&p.position==="static")?o=o.filter(y=>y!==f):c=p,f=Ps(f)}return a.set(n,o),o}function FT(n){let{element:a,boundary:l,rootBoundary:o,strategy:c}=n;const f=[...l==="clippingAncestors"?Pu(a)?[]:YT(a,this._c):[].concat(l),o],p=zb(a,f[0],c);let g=p.top,v=p.right,x=p.bottom,y=p.left;for(let b=1;b<f.length;b++){const w=zb(a,f[b],c);g=gr(w.top,g),v=cs(w.right,v),x=cs(w.bottom,x),y=gr(w.left,y)}return{width:v-y,height:x-g,x:y,y:g}}function XT(n){const{width:a,height:l}=P1(n);return{width:a,height:l}}function KT(n,a,l){const o=fs(a),c=Nr(a),u=l==="fixed",f=Bs(n,!0,u,a);let p={scrollLeft:0,scrollTop:0};const g=vr(0);if((o||!u)&&((eo(a)!=="body"||Iu(c))&&(p=Bu(a)),o)){const b=Bs(a,!0,u,a);g.x=b.x+a.clientLeft,g.y=b.y+a.clientTop}!o&&c&&(g.x=Hu(c));const v=c&&!o&&!u?H1(c,p):vr(0),x=f.left+p.scrollLeft-g.x-v.x,y=f.top+p.scrollTop-g.y-v.y;return{x,y,width:f.width,height:f.height}}function Ah(n){return Ba(n).position==="static"}function Lb(n,a){if(!fs(n)||Ba(n).position==="fixed")return null;if(a)return a(n);let l=n.offsetParent;return Nr(n)===l&&(l=l.ownerDocument.body),l}function q1(n,a){const l=_n(n);if(Pu(n))return l;if(!fs(n)){let c=Ps(n);for(;c&&!oi(c);){if(Pa(c)&&!Ah(c))return c;c=Ps(c)}return l}let o=Lb(n,a);for(;o&&_T(o)&&Ah(o);)o=Lb(o,a);return o&&oi(o)&&Ah(o)&&!ap(o)?l:o||UT(n)||l}const QT=async function(n){const a=this.getOffsetParent||q1,l=this.getDimensions,o=await l(n.floating);return{reference:KT(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ZT(n){return Ba(n).direction==="rtl"}const JT={convertOffsetParentRelativeRectToViewportRelativeRect:BT,getDocumentElement:Nr,getClippingRect:FT,getOffsetParent:q1,getElementRects:QT,getClientRects:HT,getDimensions:XT,getScale:Bl,isElement:Pa,isRTL:ZT};function $1(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function WT(n,a,l){let o=null,c;const u=Nr(n);function f(){var x;clearTimeout(c),(x=o)==null||x.disconnect(),o=null}function p(x,y){x===void 0&&(x=!1),y===void 0&&(y=1),f();const b=n.getBoundingClientRect(),{left:w,top:N,width:S,height:C}=b;if(x||a(),!S||!C)return;const R=Yc(N),D=Yc(u.clientWidth-(w+S)),A=Yc(u.clientHeight-(N+C)),M=Yc(w),E={rootMargin:-R+"px "+-D+"px "+-A+"px "+-M+"px",threshold:gr(0,cs(1,y))||1};let z=!0;function k(P){const Z=P[0].intersectionRatio;if(!$1(b,n.getBoundingClientRect()))return p();if(Z!==y){if(!z)return p();Z?p(!1,Z):c=setTimeout(()=>{p(!1,1e-7)},1e3)}z=!1}try{o=new IntersectionObserver(k,{...E,root:u.ownerDocument})}catch{o=new IntersectionObserver(k,E)}o.observe(n)}const g=_n(n),v=()=>p(l);return g.addEventListener("resize",v),p(!0),()=>{g.removeEventListener("resize",v),f()}}function eA(n,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,v=sp(n),x=c||u?[...v?ii(v):[],...a?ii(a):[]]:[];x.forEach(R=>{c&&R.addEventListener("scroll",l),u&&R.addEventListener("resize",l)});const y=v&&p?WT(v,l,u):null;let b=-1,w=null;f&&(w=new ResizeObserver(R=>{let[D]=R;D&&D.target===v&&w&&a&&(w.unobserve(a),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=w)==null||A.observe(a)})),l()}),v&&!g&&w.observe(v),a&&w.observe(a));let N,S=g?Bs(n):null;g&&C();function C(){const R=Bs(n);S&&!$1(S,R)&&l(),S=R,N=requestAnimationFrame(C)}return l(),()=>{var R;x.forEach(D=>{c&&D.removeEventListener("scroll",l),u&&D.removeEventListener("resize",l)}),y==null||y(),(R=w)==null||R.disconnect(),w=null,g&&cancelAnimationFrame(N)}}const tA=MT,nA=DT,aA=RT,rA=kT,sA=TT,Ub=ET,lA=OT,oA=(n,a,l)=>{const o=new Map,c=l??{},u={...JT,...c.platform,_c:o};return NT(n,a,{...c,platform:u})};var iA=typeof document<"u",cA=function(){},cu=iA?h.useLayoutEffect:cA;function bu(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(typeof n=="function"&&n.toString()===a.toString())return!0;let l,o,c;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!bu(n[o],a[o]))return!1;return!0}if(c=Object.keys(n),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const u=c[o];if(!(u==="_owner"&&n.$$typeof)&&!bu(n[u],a[u]))return!1}return!0}return n!==n&&a!==a}function V1(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ib(n,a){const l=V1(n);return Math.round(a*l)/l}function Mh(n){const a=h.useRef(n);return cu(()=>{a.current=n}),a}function uA(n){n===void 0&&(n={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:f}={},transform:p=!0,whileElementsMounted:g,open:v}=n,[x,y]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[b,w]=h.useState(o);bu(b,o)||w(o);const[N,S]=h.useState(null),[C,R]=h.useState(null),D=h.useCallback(W=>{W!==E.current&&(E.current=W,S(W))},[]),A=h.useCallback(W=>{W!==z.current&&(z.current=W,R(W))},[]),M=u||N,O=f||C,E=h.useRef(null),z=h.useRef(null),k=h.useRef(x),P=g!=null,Z=Mh(g),ee=Mh(c),V=Mh(v),ce=h.useCallback(()=>{if(!E.current||!z.current)return;const W={placement:a,strategy:l,middleware:b};ee.current&&(W.platform=ee.current),oA(E.current,z.current,W).then(Q=>{const te={...Q,isPositioned:V.current!==!1};se.current&&!bu(k.current,te)&&(k.current=te,Sa.flushSync(()=>{y(te)}))})},[b,a,l,ee,V]);cu(()=>{v===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,y(W=>({...W,isPositioned:!1})))},[v]);const se=h.useRef(!1);cu(()=>(se.current=!0,()=>{se.current=!1}),[]),cu(()=>{if(M&&(E.current=M),O&&(z.current=O),M&&O){if(Z.current)return Z.current(M,O,ce);ce()}},[M,O,ce,Z,P]);const H=h.useMemo(()=>({reference:E,floating:z,setReference:D,setFloating:A}),[D,A]),_=h.useMemo(()=>({reference:M,floating:O}),[M,O]),q=h.useMemo(()=>{const W={position:l,left:0,top:0};if(!_.floating)return W;const Q=Ib(_.floating,x.x),te=Ib(_.floating,x.y);return p?{...W,transform:"translate("+Q+"px, "+te+"px)",...V1(_.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:Q,top:te}},[l,p,_.floating,x.x,x.y]);return h.useMemo(()=>({...x,update:ce,refs:H,elements:_,floatingStyles:q}),[x,ce,H,_,q])}const dA=n=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:o,padding:c}=typeof n=="function"?n(l):n;return o&&a(o)?o.current!=null?Ub({element:o.current,padding:c}).fn(l):{}:o?Ub({element:o,padding:c}).fn(l):{}}}},fA=(n,a)=>{const l=tA(n);return{name:l.name,fn:l.fn,options:[n,a]}},hA=(n,a)=>{const l=nA(n);return{name:l.name,fn:l.fn,options:[n,a]}},mA=(n,a)=>({fn:lA(n).fn,options:[n,a]}),pA=(n,a)=>{const l=aA(n);return{name:l.name,fn:l.fn,options:[n,a]}},gA=(n,a)=>{const l=rA(n);return{name:l.name,fn:l.fn,options:[n,a]}},vA=(n,a)=>{const l=sA(n);return{name:l.name,fn:l.fn,options:[n,a]}},xA=(n,a)=>{const l=dA(n);return{name:l.name,fn:l.fn,options:[n,a]}};var yA=Object.defineProperty,bA=(n,a)=>yA(n,"name",{value:a,configurable:!0});function qu(n){const[a,l]=h.useState(void 0);return Jt(()=>{if(n){l({width:n.offsetWidth,height:n.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let f,p;if("borderBoxSize"in u){const g=u.borderBoxSize,v=Array.isArray(g)?g[0]:g;f=v.inlineSize,p=v.blockSize}else f=n.offsetWidth,p=n.offsetHeight;l({width:f,height:p})});return o.observe(n,{box:"border-box"}),()=>o.unobserve(n)}else l(void 0)},[n]),a}bA(qu,"useSize");var wA=Object.defineProperty,os=(n,a)=>wA(n,"name",{value:a,configurable:!0}),G1="Popper",[Y1,to]=Hn(G1),[jA,F1]=Y1(G1),SA=os(n=>{const{__scopePopper:a,children:l}=n,[o,c]=h.useState(null),[u,f]=h.useState(void 0);return s.jsx(jA,{scope:a,anchor:o,onAnchorChange:c,placementState:u,setPlacementState:f,children:l})},"Popper"),CA="PopperAnchor",NA=h.forwardRef(os(function(a,l){const{__scopePopper:o,virtualRef:c,...u}=a,f=F1(CA,o),p=h.useRef(null),g=f.onAnchorChange,v=h.useCallback(S=>{p.current=S,S&&g(S)},[g]),x=Fe(l,v),y=h.useRef(null);h.useEffect(()=>{if(!c)return;const S=y.current;y.current=c.current,S!==y.current&&g(y.current)});const b=f.placementState&&$u(f.placementState),w=b==null?void 0:b[0],N=b==null?void 0:b[1];return c?null:s.jsx(He.div,{"data-radix-popper-side":w,"data-radix-popper-align":N,...u,ref:x})},"PopperAnchor")),X1="PopperContent",[EA,u5]=Y1(X1),RA=h.forwardRef(os(function(a,l){var he,xe,Ae,Ne,Oe,Qe,et;const{__scopePopper:o,side:c="bottom",sideOffset:u=0,align:f="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:w=!1,updatePositionStrategy:N="optimized",onPlaced:S,...C}=a,R=F1(X1,o),[D,A]=h.useState(null),M=Fe(l,A),[O,E]=h.useState(null),z=qu(O),k=(z==null?void 0:z.width)??0,P=(z==null?void 0:z.height)??0,Z=c+(f!=="center"?"-"+f:""),ee=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},V=Array.isArray(x)?x:[x],ce=V.length>0,se={padding:ee,boundary:V.filter(K1),altBoundary:ce},{refs:H,floatingStyles:_,placement:q,isPositioned:W,middlewareData:Q}=uA({strategy:"fixed",placement:Z,whileElementsMounted:os((...ie)=>eA(...ie,{animationFrame:N==="always"}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[fA({mainAxis:u+P,alignmentAxis:p}),v&&hA({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?mA():void 0,...se}),v&&pA({...se}),gA({...se,apply:os(({elements:ie,rects:Le,availableWidth:qe,availableHeight:_t})=>{const{width:St,height:Wt}=Le.reference,mn=ie.floating.style;mn.setProperty("--radix-popper-available-width",`${qe}px`),mn.setProperty("--radix-popper-available-height",`${_t}px`),mn.setProperty("--radix-popper-anchor-width",`${St}px`),mn.setProperty("--radix-popper-anchor-height",`${Wt}px`)},"apply")}),O&&xA({element:O,padding:g}),TA({arrowWidth:k,arrowHeight:P}),w&&vA({strategy:"referenceHidden",...se,boundary:ce?se.boundary:void 0})]}),te=R.setPlacementState;Jt(()=>(te(q),()=>{te(void 0)}),[q,te]);const[L,U]=$u(q),Y=ma(S);Jt(()=>{W&&(Y==null||Y())},[W,Y]);const ae=(he=Q.arrow)==null?void 0:he.x,ge=(xe=Q.arrow)==null?void 0:xe.y,ye=((Ae=Q.arrow)==null?void 0:Ae.centerOffset)!==0,[G,ue]=h.useState();return Jt(()=>{D&&ue(window.getComputedStyle(D).zIndex)},[D]),s.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:W?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(Ne=Q.transformOrigin)==null?void 0:Ne.x,(Oe=Q.transformOrigin)==null?void 0:Oe.y].join(" "),...((Qe=Q.hide)==null?void 0:Qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:s.jsx(EA,{scope:o,placedSide:L,placedAlign:U,onArrowChange:E,arrowX:ae,arrowY:ge,shouldHideArrow:ye,children:s.jsx(He.div,{"data-side":L,"data-align":U,...C,ref:M,style:{...C.style,animation:W?(et=C.style)==null?void 0:et.animation:"none"}})})})},"PopperContent"));function K1(n){return n!==null}os(K1,"isNotNull");var TA=os(n=>({name:"transformOrigin",options:n,fn(a){var C,R,D;const{placement:l,rects:o,middlewareData:c}=a,f=((C=c.arrow)==null?void 0:C.centerOffset)!==0,p=f?0:n.arrowWidth,g=f?0:n.arrowHeight,[v,x]=$u(l),y={start:"0%",center:"50%",end:"100%"}[x],b=(((R=c.arrow)==null?void 0:R.x)??0)+p/2,w=(((D=c.arrow)==null?void 0:D.y)??0)+g/2;let N="",S="";return v==="bottom"?(N=f?y:`${b}px`,S=`${-g}px`):v==="top"?(N=f?y:`${b}px`,S=`${o.floating.height+g}px`):v==="right"?(N=`${-g}px`,S=f?y:`${w}px`):v==="left"&&(N=`${o.floating.width+g}px`,S=f?y:`${w}px`),{data:{x:N,y:S}}}}),"transformOrigin");function $u(n){const[a,l="center"]=n.split("-");return[a,l]}os($u,"getSideAndAlignFromPlacement");var lp=SA,op=NA,ip=RA,AA=Object.defineProperty,MA=(n,a)=>AA(n,"name",{value:a,configurable:!0}),cp=h.forwardRef(MA(function(a,l){var g;const{container:o,...c}=a,[u,f]=h.useState(!1);Jt(()=>f(!0),[]);const p=o||u&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?Sa.createPortal(s.jsx(He.div,{...c,ref:l}),p):null},"Portal")),DA=Object.defineProperty,wr=(n,a)=>DA(n,"name",{value:a,configurable:!0});function Q1(n,a){return h.useReducer((l,o)=>a[l][o]??l,n)}wr(Q1,"useStateMachine");var Er=wr(n=>{const{present:a,children:l}=n,o=Z1(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),u=J1(o.ref,W1(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:u}):null},"Presence");function Z1(n){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(n),u=h.useRef("none"),f=h.useRef(void 0),p=n?"mounted":"unmounted",[g,v]=Q1(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{g==="mounted"?(u.current=f.current??Ul(o.current),f.current=void 0):u.current="none"},[g]),Jt(()=>{const x=o.current,y=c.current;if(y!==n){const w=u.current,N=Ul(x);n?(f.current=N,v("MOUNT")):N==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(y&&w!==N?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,v]),Jt(()=>{if(a){let x;const y=a.ownerDocument.defaultView??window,b=wr(N=>{const C=Ul(o.current).includes(CSS.escape(N.animationName));if(N.target===a&&C&&(v("ANIMATION_END"),!c.current)){const R=a.style.animationFillMode;a.style.animationFillMode="forwards",x=y.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=R)})}},"handleAnimationEnd"),w=wr(N=>{N.target===a&&(u.current=Ul(o.current))},"handleAnimationStart");return a.addEventListener("animationstart",w),a.addEventListener("animationcancel",b),a.addEventListener("animationend",b),()=>{y.clearTimeout(x),a.removeEventListener("animationstart",w),a.removeEventListener("animationcancel",b),a.removeEventListener("animationend",b)}}else v("ANIMATION_END")},[a,v]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:h.useCallback(x=>{if(x){const y=getComputedStyle(x);o.current=y,f.current=Ul(y)}else o.current=null;l(x)},[])}}wr(Z1,"usePresence");function rm(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}wr(rm,"setRef");function J1(...n){const a=h.useRef(n);return a.current=n,h.useCallback(l=>{const o=a.current;let c=!1;const u=o.map(f=>{const p=rm(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():rm(o[f],null)}}},[])}wr(J1,"useStableComposedRefs");function Ul(n){return(n==null?void 0:n.animationName)||"none"}wr(Ul,"getAnimationName");function W1(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,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)}wr(W1,"getElementRef");var OA=Object.defineProperty,up=(n,a)=>OA(n,"name",{value:a,configurable:!0}),Dh=!1;function ew(){const[n,a]=h.useState(Dh);return h.useEffect(()=>{Dh||(Dh=!0,a(!0))},[]),n}up(ew,"useIsHydrated");var tw=Gl[" useSyncExternalStore ".trim().toString()];function nw(){return()=>{}}up(nw,"subscribe");function aw(){return tw(nw,()=>!0,()=>!1)}up(aw,"useIsHydratedModern");var kA=typeof tw=="function"?aw:ew,_A=Object.defineProperty,qs=(n,a)=>_A(n,"name",{value:a,configurable:!0}),Oh="rovingFocusGroup.onEntryFocus",zA={bubbles:!1,cancelable:!0},Vu="RovingFocusGroup",[sm,rw,LA]=zu(Vu),[UA,Gu]=Hn(Vu,[LA]),[IA,PA]=UA(Vu),BA=h.forwardRef(qs(function(a,l){return s.jsx(sm.Provider,{scope:a.__scopeRovingFocusGroup,children:s.jsx(sm.Slot,{scope:a.__scopeRovingFocusGroup,children:s.jsx(HA,{...a,ref:l})})})},"RovingFocusGroup")),HA=h.forwardRef(qs(function(a,l){const{__scopeRovingFocusGroup:o,orientation:c,loop:u=!1,dir:f,currentTabStopId:p,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:x,preventScrollOnEntryFocus:y=!1,...b}=a,w=h.useRef(null),N=Fe(l,w),S=bi(f),[C,R]=Ia({prop:p,defaultProp:g??null,onChange:v,caller:Vu}),[D,A]=h.useState(!1),M=ma(x),O=rw(o),E=h.useRef(!1),[z,k]=h.useState(0);return h.useEffect(()=>{const P=w.current;if(P)return P.addEventListener(Oh,M),()=>P.removeEventListener(Oh,M)},[M]),s.jsx(IA,{scope:o,orientation:c,dir:S,loop:u,currentTabStopId:C,onItemFocus:h.useCallback(P=>R(P),[R]),onItemShiftTab:h.useCallback(()=>A(!0),[]),onFocusableItemAdd:h.useCallback(()=>k(P=>P+1),[]),onFocusableItemRemove:h.useCallback(()=>k(P=>P-1),[]),children:s.jsx(He.div,{tabIndex:D||z===0?-1:0,"data-orientation":c,...b,ref:N,style:{outline:"none",...a.style},onMouseDown:Se(a.onMouseDown,()=>{E.current=!0}),onFocus:Se(a.onFocus,P=>{const Z=!E.current;if(P.target===P.currentTarget&&Z&&!D){const ee=new CustomEvent(Oh,zA);if(P.currentTarget.dispatchEvent(ee),!ee.defaultPrevented){const V=O().filter(q=>q.focusable),ce=V.find(q=>q.active),se=V.find(q=>q.id===C),_=[ce,se,...V].filter(Boolean).map(q=>q.ref.current);dp(_,y)}}E.current=!1}),onBlur:Se(a.onBlur,()=>A(!1))})})},"RovingFocusGroupImpl")),qA="RovingFocusGroupItem",$A=h.forwardRef(qs(function(a,l){const{__scopeRovingFocusGroup:o,focusable:c=!0,active:u=!1,tabStopId:f,children:p,...g}=a,v=Na(),x=f||v,y=PA(qA,o),b=y.currentTabStopId===x,w=rw(o),{onFocusableItemAdd:N,onFocusableItemRemove:S,currentTabStopId:C}=y,R=kA();return Jt(()=>{if(!(!R||!c))return N(),()=>S()},[R,c,N,S]),h.useEffect(()=>{if(!(R||!c))return N(),()=>S()},[R,c,N,S]),s.jsx(sm.ItemSlot,{scope:o,id:x,focusable:c,active:u,children:s.jsx(He.span,{tabIndex:b?0:-1,"data-orientation":y.orientation,...g,ref:l,onMouseDown:Se(a.onMouseDown,D=>{c?y.onItemFocus(x):D.preventDefault()}),onFocus:Se(a.onFocus,()=>y.onItemFocus(x)),onKeyDown:Se(a.onKeyDown,D=>{if(D.key==="Tab"&&D.shiftKey){y.onItemShiftTab();return}if(D.target!==D.currentTarget)return;const A=lw(D,y.orientation,y.dir);if(A!==void 0){if(D.metaKey||D.ctrlKey||D.altKey||D.shiftKey)return;D.preventDefault();let O=w().filter(E=>E.focusable).map(E=>E.ref.current);if(A==="last")O.reverse();else if(A==="prev"||A==="next"){A==="prev"&&O.reverse();const E=O.indexOf(D.currentTarget);O=y.loop?ow(O,E+1):O.slice(E+1)}setTimeout(()=>dp(O))}}),children:typeof p=="function"?p({isCurrentTabStop:b,hasTabStop:C!=null}):p})})},"RovingFocusGroupItem")),VA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sw(n,a){return a!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}qs(sw,"getDirectionAwareKey");function lw(n,a,l){const o=sw(n.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return VA[o]}qs(lw,"getFocusIntent");function dp(n,a=!1){const l=document.activeElement;for(const o of n)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}qs(dp,"focusFirst");function ow(n,a){return n.map((l,o)=>n[(a+o)%n.length])}qs(ow,"wrapArray");var iw=BA,cw=$A,GA=function(n){if(typeof document>"u")return null;var a=Array.isArray(n)?n[0]:n;return a.ownerDocument.body},kl=new WeakMap,Fc=new WeakMap,Xc={},kh=0,uw=function(n){return n&&(n.host||uw(n.parentNode))},YA=function(n,a){return a.map(function(l){if(n.contains(l))return l;var o=uw(l);return o&&n.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",n,". Doing nothing"),null)}).filter(function(l){return!!l})},FA=function(n,a,l,o){var c=YA(a,Array.isArray(n)?n:[n]);Xc[l]||(Xc[l]=new WeakMap);var u=Xc[l],f=[],p=new Set,g=new Set(c),v=function(y){!y||p.has(y)||(p.add(y),v(y.parentNode))};c.forEach(v);var x=function(y){!y||g.has(y)||Array.prototype.forEach.call(y.children,function(b){if(p.has(b))x(b);else try{var w=b.getAttribute(o),N=w!==null&&w!=="false",S=(kl.get(b)||0)+1,C=(u.get(b)||0)+1;kl.set(b,S),u.set(b,C),f.push(b),S===1&&N&&Fc.set(b,!0),C===1&&b.setAttribute(l,"true"),N||b.setAttribute(o,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return x(a),p.clear(),kh++,function(){f.forEach(function(y){var b=kl.get(y)-1,w=u.get(y)-1;kl.set(y,b),u.set(y,w),b||(Fc.has(y)||y.removeAttribute(o),Fc.delete(y)),w||y.removeAttribute(l)}),kh--,kh||(kl=new WeakMap,kl=new WeakMap,Fc=new WeakMap,Xc={})}},fp=function(n,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(n)?n:[n]),c=GA(n);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),FA(o,c,l,"aria-hidden")):function(){return null}},za=function(){return za=Object.assign||function(a){for(var l,o=1,c=arguments.length;o<c;o++){l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},za.apply(this,arguments)};function dw(n,a){var l={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&a.indexOf(o)<0&&(l[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(n);c<o.length;c++)a.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(n,o[c])&&(l[o[c]]=n[o[c]]);return l}function XA(n,a,l){if(l||arguments.length===2)for(var o=0,c=a.length,u;o<c;o++)(u||!(o in a))&&(u||(u=Array.prototype.slice.call(a,0,o)),u[o]=a[o]);return n.concat(u||Array.prototype.slice.call(a))}var uu="right-scroll-bar-position",du="width-before-scroll-bar",KA="with-scroll-bars-hidden",QA="--removed-body-scroll-bar-size";function _h(n,a){return typeof n=="function"?n(a):n&&(n.current=a),n}function ZA(n,a){var l=h.useState(function(){return{value:n,callback:a,facade:{get current(){return l.value},set current(o){var c=l.value;c!==o&&(l.value=o,l.callback(o,c))}}}})[0];return l.callback=a,l.facade}var JA=typeof window<"u"?h.useLayoutEffect:h.useEffect,Pb=new WeakMap;function WA(n,a){var l=ZA(null,function(o){return n.forEach(function(c){return _h(c,o)})});return JA(function(){var o=Pb.get(l);if(o){var c=new Set(o),u=new Set(n),f=l.current;c.forEach(function(p){u.has(p)||_h(p,null)}),u.forEach(function(p){c.has(p)||_h(p,f)})}Pb.set(l,n)},[n]),l}function eM(n){return n}function tM(n,a){a===void 0&&(a=eM);var l=[],o=!1,c={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:n},useMedium:function(u){var f=a(u,o);return l.push(f),function(){l=l.filter(function(p){return p!==f})}},assignSyncMedium:function(u){for(o=!0;l.length;){var f=l;l=[],f.forEach(u)}l={push:function(p){return u(p)},filter:function(){return l}}},assignMedium:function(u){o=!0;var f=[];if(l.length){var p=l;l=[],p.forEach(u),f=l}var g=function(){var x=f;f=[],x.forEach(u)},v=function(){return Promise.resolve().then(g)};v(),l={push:function(x){f.push(x),v()},filter:function(x){return f=f.filter(x),l}}}};return c}function nM(n){n===void 0&&(n={});var a=tM(null);return a.options=za({async:!0,ssr:!1},n),a}var fw=function(n){var a=n.sideCar,l=dw(n,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=a.read();if(!o)throw new Error("Sidecar medium not found");return h.createElement(o,za({},l))};fw.isSideCarExport=!0;function aM(n,a){return n.useMedium(a),fw}var hw=nM(),zh=function(){},Yu=h.forwardRef(function(n,a){var l=h.useRef(null),o=h.useState({onScrollCapture:zh,onWheelCapture:zh,onTouchMoveCapture:zh}),c=o[0],u=o[1],f=n.forwardProps,p=n.children,g=n.className,v=n.removeScrollBar,x=n.enabled,y=n.shards,b=n.sideCar,w=n.noRelative,N=n.noIsolation,S=n.inert,C=n.allowPinchZoom,R=n.as,D=R===void 0?"div":R,A=n.gapMode,M=dw(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=b,E=WA([l,a]),z=za(za({},M),c);return h.createElement(h.Fragment,null,x&&h.createElement(O,{sideCar:hw,removeScrollBar:v,shards:y,noRelative:w,noIsolation:N,inert:S,setCallbacks:u,allowPinchZoom:!!C,lockRef:l,gapMode:A}),f?h.cloneElement(h.Children.only(p),za(za({},z),{ref:E})):h.createElement(D,za({},z,{className:g,ref:E}),p))});Yu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Yu.classNames={fullWidth:du,zeroRight:uu};var rM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sM(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var a=rM();return a&&n.setAttribute("nonce",a),n}function lM(n,a){n.styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a))}function oM(n){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(n)}var iM=function(){var n=0,a=null;return{add:function(l){n==0&&(a=sM())&&(lM(a,l),oM(a)),n++},remove:function(){n--,!n&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},cM=function(){var n=iM();return function(a,l){h.useEffect(function(){return n.add(a),function(){n.remove()}},[a&&l])}},mw=function(){var n=cM(),a=function(l){var o=l.styles,c=l.dynamic;return n(o,c),null};return a},uM={left:0,top:0,right:0,gap:0},Lh=function(n){return parseInt(n||"",10)||0},dM=function(n){var a=window.getComputedStyle(document.body),l=a[n==="padding"?"paddingLeft":"marginLeft"],o=a[n==="padding"?"paddingTop":"marginTop"],c=a[n==="padding"?"paddingRight":"marginRight"];return[Lh(l),Lh(o),Lh(c)]},fM=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return uM;var a=dM(n),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},hM=mw(),Hl="data-scroll-locked",mM=function(n,a,l,o){var c=n.left,u=n.top,f=n.right,p=n.gap;return l===void 0&&(l="margin"),`
|
|
341
|
-
.`.concat(KA,` {
|
|
342
|
-
overflow: hidden `).concat(o,`;
|
|
343
|
-
padding-right: `).concat(p,"px ").concat(o,`;
|
|
344
|
-
}
|
|
345
|
-
body[`).concat(Hl,`] {
|
|
346
|
-
overflow: hidden `).concat(o,`;
|
|
347
|
-
overscroll-behavior: contain;
|
|
348
|
-
`).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&`
|
|
349
|
-
padding-left: `.concat(c,`px;
|
|
350
|
-
padding-top: `).concat(u,`px;
|
|
351
|
-
padding-right: `).concat(f,`px;
|
|
352
|
-
margin-left:0;
|
|
353
|
-
margin-top:0;
|
|
354
|
-
margin-right: `).concat(p,"px ").concat(o,`;
|
|
355
|
-
`),l==="padding"&&"padding-right: ".concat(p,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.`).concat(uu,` {
|
|
359
|
-
right: `).concat(p,"px ").concat(o,`;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
.`).concat(du,` {
|
|
363
|
-
margin-right: `).concat(p,"px ").concat(o,`;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.`).concat(uu," .").concat(uu,` {
|
|
367
|
-
right: 0 `).concat(o,`;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.`).concat(du," .").concat(du,` {
|
|
371
|
-
margin-right: 0 `).concat(o,`;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
body[`).concat(Hl,`] {
|
|
375
|
-
`).concat(QA,": ").concat(p,`px;
|
|
376
|
-
}
|
|
377
|
-
`)},Bb=function(){var n=parseInt(document.body.getAttribute(Hl)||"0",10);return isFinite(n)?n:0},pM=function(){h.useEffect(function(){return document.body.setAttribute(Hl,(Bb()+1).toString()),function(){var n=Bb()-1;n<=0?document.body.removeAttribute(Hl):document.body.setAttribute(Hl,n.toString())}},[])},gM=function(n){var a=n.noRelative,l=n.noImportant,o=n.gapMode,c=o===void 0?"margin":o;pM();var u=h.useMemo(function(){return fM(c)},[c]);return h.createElement(hM,{styles:mM(u,!a,c,l?"":"!important")})},lm=!1;if(typeof window<"u")try{var Kc=Object.defineProperty({},"passive",{get:function(){return lm=!0,!0}});window.addEventListener("test",Kc,Kc),window.removeEventListener("test",Kc,Kc)}catch{lm=!1}var _l=lm?{passive:!1}:!1,vM=function(n){return n.tagName==="TEXTAREA"},pw=function(n,a){if(!(n instanceof Element))return!1;var l=window.getComputedStyle(n);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!vM(n)&&l[a]==="visible")},xM=function(n){return pw(n,"overflowY")},yM=function(n){return pw(n,"overflowX")},Hb=function(n,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=gw(n,o);if(c){var u=vw(n,o),f=u[1],p=u[2];if(f>p)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},bM=function(n){var a=n.scrollTop,l=n.scrollHeight,o=n.clientHeight;return[a,l,o]},wM=function(n){var a=n.scrollLeft,l=n.scrollWidth,o=n.clientWidth;return[a,l,o]},gw=function(n,a){return n==="v"?xM(a):yM(a)},vw=function(n,a){return n==="v"?bM(a):wM(a)},jM=function(n,a){return n==="h"&&a==="rtl"?-1:1},SM=function(n,a,l,o,c){var u=jM(n,window.getComputedStyle(a).direction),f=u*o,p=l.target,g=a.contains(p),v=!1,x=f>0,y=0,b=0;do{if(!p)break;var w=vw(n,p),N=w[0],S=w[1],C=w[2],R=S-C-u*N;(N||R)&&gw(n,p)&&(y+=R,b+=N);var D=p.parentNode;p=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!g&&p!==document.body||g&&(a.contains(p)||a===p));return(x&&Math.abs(y)<1||!x&&Math.abs(b)<1)&&(v=!0),v},Qc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},qb=function(n){return[n.deltaX,n.deltaY]},$b=function(n){return n&&"current"in n?n.current:n},CM=function(n,a){return n[0]===a[0]&&n[1]===a[1]},NM=function(n){return`
|
|
378
|
-
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
|
379
|
-
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
|
380
|
-
`)},EM=0,zl=[];function RM(n){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState(EM++)[0],u=h.useState(mw)[0],f=h.useRef(n);h.useEffect(function(){f.current=n},[n]),h.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var S=XA([n.lockRef.current],(n.shards||[]).map($b),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var p=h.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!f.current.allowPinchZoom;var R=Qc(S),D=l.current,A="deltaX"in S?S.deltaX:D[0]-R[0],M="deltaY"in S?S.deltaY:D[1]-R[1],O,E=S.target,z=Math.abs(A)>Math.abs(M)?"h":"v";if("touches"in S&&z==="h"&&E.type==="range")return!1;var k=window.getSelection(),P=k&&k.anchorNode,Z=P?P===E||P.contains(E):!1;if(Z)return!1;var ee=Hb(z,E);if(!ee)return!0;if(ee?O=z:(O=z==="v"?"h":"v",ee=Hb(z,E)),!ee)return!1;if(!o.current&&"changedTouches"in S&&(A||M)&&(o.current=O),!O)return!0;var V=o.current||O;return SM(V,C,S,V==="h"?A:M)},[]),g=h.useCallback(function(S){var C=S;if(!(!zl.length||zl[zl.length-1]!==u)){var R="deltaY"in C?qb(C):Qc(C),D=a.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&CM(O.delta,R)})[0];if(D&&D.should){C.cancelable&&C.preventDefault();return}if(!D){var A=(f.current.shards||[]).map($b).filter(Boolean).filter(function(O){return O.contains(C.target)}),M=A.length>0?p(C,A[0]):!f.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),v=h.useCallback(function(S,C,R,D){var A={name:S,delta:C,target:R,should:D,shadowParent:TM(R)};a.current.push(A),setTimeout(function(){a.current=a.current.filter(function(M){return M!==A})},1)},[]),x=h.useCallback(function(S){l.current=Qc(S),o.current=void 0},[]),y=h.useCallback(function(S){v(S.type,qb(S),S.target,p(S,n.lockRef.current))},[]),b=h.useCallback(function(S){v(S.type,Qc(S),S.target,p(S,n.lockRef.current))},[]);h.useEffect(function(){return zl.push(u),n.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",g,_l),document.addEventListener("touchmove",g,_l),document.addEventListener("touchstart",x,_l),function(){zl=zl.filter(function(S){return S!==u}),document.removeEventListener("wheel",g,_l),document.removeEventListener("touchmove",g,_l),document.removeEventListener("touchstart",x,_l)}},[]);var w=n.removeScrollBar,N=n.inert;return h.createElement(h.Fragment,null,N?h.createElement(u,{styles:NM(c)}):null,w?h.createElement(gM,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function TM(n){for(var a=null;n!==null;)n instanceof ShadowRoot&&(a=n.host,n=n.host),n=n.parentNode;return a}const AM=aM(hw,RM);var Fu=h.forwardRef(function(n,a){return h.createElement(Yu,za({},n,{ref:a,sideCar:AM}))});Fu.classNames=Yu.classNames;var MM=Object.defineProperty,gt=(n,a)=>MM(n,"name",{value:a,configurable:!0}),DM=["Enter"," "],OM=["ArrowDown","PageUp","Home"],xw=["ArrowUp","PageDown","End"],kM=[...OM,...xw],Xu="Menu",[om,_M,zM]=zu(Xu),[$s,yw]=Hn(Xu,[zM,to,Gu]),hp=to(),bw=Gu(),[LM,ji]=$s(Xu),[UM,mp]=$s(Xu),IM=gt(n=>{const{__scopeMenu:a,open:l=!1,children:o,dir:c,onOpenChange:u,modal:f=!0}=n,p=hp(a),[g,v]=h.useState(null),x=h.useRef(!1),y=ma(u),b=bi(c);return h.useEffect(()=>{const w=gt(()=>{x.current=!0,document.addEventListener("pointerdown",N,{capture:!0,once:!0}),document.addEventListener("pointermove",N,{capture:!0,once:!0})},"handleKeyDown"),N=gt(()=>x.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",N,{capture:!0}),document.removeEventListener("pointermove",N,{capture:!0})}},[]),h.useEffect(()=>{if(!l)return;const w=gt(()=>y(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[l,y]),s.jsx(lp,{...p,children:s.jsx(LM,{scope:a,open:l,onOpenChange:y,content:g,onContentChange:v,children:s.jsx(UM,{scope:a,onClose:h.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:x,dir:b,modal:f,children:o})})})},"Menu"),PM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a,u=hp(o);return s.jsx(op,{...u,...c,ref:l})},"MenuAnchor")),ww="MenuPortal",[BM,HM]=$s(ww,{forceMount:void 0}),qM=gt(n=>{const{__scopeMenu:a,forceMount:l,children:o,container:c}=n,u=ji(ww,a);return s.jsx(BM,{scope:a,forceMount:l,children:s.jsx(Er,{present:l||u.open,children:s.jsx(cp,{asChild:!0,container:c,children:o})})})},"MenuPortal"),is="MenuContent",[$M,jw]=$s(is),VM=h.forwardRef(gt(function(a,l){const o=HM(is,a.__scopeMenu),{forceMount:c=o.forceMount,...u}=a,f=ji(is,a.__scopeMenu),p=mp(is,a.__scopeMenu);return s.jsx(om.Provider,{scope:a.__scopeMenu,children:s.jsx(Er,{present:c||f.open,children:s.jsx(om.Slot,{scope:a.__scopeMenu,children:p.modal?s.jsx(GM,{...u,ref:l}):s.jsx(YM,{...u,ref:l})})})})},"MenuContent")),GM=h.forwardRef(gt(function(a,l){const o=ji(is,a.__scopeMenu),c=h.useRef(null),u=Fe(l,c);return h.useEffect(()=>{const f=c.current;if(f)return fp(f)},[]),s.jsx(Sw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:Se(a.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),YM=h.forwardRef(gt(function(a,l){const o=ji(is,a.__scopeMenu);return s.jsx(Sw,{...a,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),FM=Ua("MenuContent.ScrollLock"),Sw=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,loop:c=!1,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:p,disableOutsidePointerEvents:g,onEntryFocus:v,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:N,disableOutsideScroll:S,...C}=a,R=ji(is,o),D=mp(is,o),A=hp(o),M=bw(o),O=_M(o),[E,z]=h.useState(null),k=h.useRef(null),P=Fe(l,k,R.onContentChange),Z=h.useRef(0),ee=h.useRef(""),V=h.useRef(0),ce=h.useRef(null),se=h.useRef("right"),H=h.useRef(0),_=S?Fu:h.Fragment,q=S?{as:FM,allowPinchZoom:!0}:void 0,W=gt(te=>{var ue,he;const L=ee.current+te,U=O().filter(xe=>!xe.disabled),Y=document.activeElement,ae=(ue=U.find(xe=>xe.ref.current===Y))==null?void 0:ue.textValue,ge=U.map(xe=>xe.textValue),ye=Tw(ge,L,ae),G=(he=U.find(xe=>xe.textValue===ye))==null?void 0:he.ref.current;gt((function xe(Ae){ee.current=Ae,window.clearTimeout(Z.current),Ae!==""&&(Z.current=window.setTimeout(()=>xe(""),1e3))}),"updateSearch")(L),G&&setTimeout(()=>G.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(Z.current),[]),wi();const Q=h.useCallback(te=>{var U,Y;return se.current===((U=ce.current)==null?void 0:U.side)&&Mw(te,(Y=ce.current)==null?void 0:Y.area)},[]);return s.jsx($M,{scope:o,searchRef:ee,onItemEnter:h.useCallback(te=>{Q(te)&&te.preventDefault()},[Q]),onItemLeave:h.useCallback(te=>{var L;Q(te)||((L=k.current)==null||L.focus(),z(null))},[Q]),onTriggerLeave:h.useCallback(te=>{Q(te)&&te.preventDefault()},[Q]),pointerGraceTimerRef:V,onPointerGraceIntentChange:h.useCallback(te=>{ce.current=te},[]),children:s.jsx(_,{...q,children:s.jsx(Jm,{asChild:!0,trapped:u,onMountAutoFocus:Se(f,te=>{var L;te.preventDefault(),(L=k.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:s.jsx(Lu,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:N,children:s.jsx(iw,{asChild:!0,...M,dir:D.dir,orientation:"vertical",loop:c,currentTabStopId:E,onCurrentTabStopIdChange:z,onEntryFocus:Se(v,te=>{D.isUsingKeyboardRef.current||te.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(ip,{role:"menu","aria-orientation":"vertical","data-state":Cw(R.open),"data-radix-menu-content":"",dir:D.dir,...A,...C,ref:P,style:{outline:"none",...C.style},onKeyDown:Se(C.onKeyDown,te=>{const U=te.target.closest("[data-radix-menu-content]")===te.currentTarget,Y=te.ctrlKey||te.altKey||te.metaKey,ae=te.key.length===1;U&&(te.key==="Tab"&&te.preventDefault(),!Y&&ae&&W(te.key));const ge=k.current;if(te.target!==ge||!kM.includes(te.key))return;te.preventDefault();const G=O().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);xw.includes(te.key)&&G.reverse(),Ew(G)}),onBlur:Se(a.onBlur,te=>{te.currentTarget.contains(te.target)||(window.clearTimeout(Z.current),ee.current="")}),onPointerMove:Se(a.onPointerMove,wu(te=>{const L=te.target,U=H.current!==te.clientX;if(te.currentTarget.contains(L)&&U){const Y=te.clientX>H.current?"right":"left";se.current=Y,H.current=te.clientX}}))})})})})})})},"MenuContentImpl")),XM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a;return s.jsx(He.div,{...c,ref:l})},"MenuLabel")),im="MenuItem",Vb="menu.itemSelect",KM=h.forwardRef(gt(function(a,l){const{disabled:o=!1,onSelect:c,...u}=a,f=h.useRef(null),p=mp(im,a.__scopeMenu),g=jw(im,a.__scopeMenu),v=Fe(l,f),x=h.useRef(!1),y=gt(()=>{const b=f.current;if(!o&&b){const w=new CustomEvent(Vb,{bubbles:!0,cancelable:!0});b.addEventListener(Vb,N=>c==null?void 0:c(N),{once:!0}),Xm(b,w),w.defaultPrevented?x.current=!1:p.onClose()}},"handleSelect");return s.jsx(QM,{...u,ref:v,disabled:o,onClick:Se(a.onClick,y),onPointerDown:b=>{var w;(w=a.onPointerDown)==null||w.call(a,b),x.current=!0},onPointerUp:Se(a.onPointerUp,b=>{var w;x.current||(w=b.currentTarget)==null||w.click()}),onKeyDown:Se(a.onKeyDown,b=>{o||b.target!==b.currentTarget||g.searchRef.current!==""&&b.key===" "||DM.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),QM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,disabled:c=!1,textValue:u,...f}=a,p=jw(im,o),g=bw(o),v=h.useRef(null),x=Fe(l,v),[y,b]=h.useState(!1),[w,N]=h.useState("");return h.useEffect(()=>{const S=v.current;S&&N((S.textContent??"").trim())},[f.children]),s.jsx(om.ItemSlot,{scope:o,disabled:c,textValue:u??w,children:s.jsx(cw,{asChild:!0,...g,focusable:!c,children:s.jsx(He.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...f,ref:x,onPointerMove:Se(a.onPointerMove,wu(S=>{c?p.onItemLeave(S):(p.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(a.onPointerLeave,wu(S=>p.onItemLeave(S))),onFocus:Se(a.onFocus,()=>b(!0)),onBlur:Se(a.onBlur,()=>b(!1))})})})},"MenuItemImpl")),ZM="MenuRadioGroup",[d5,f5]=$s(ZM,{value:void 0,onValueChange:gt(()=>{},"onValueChange")}),JM="MenuItemIndicator",[h5,m5]=$s(JM,{checked:!1}),WM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a;return s.jsx(He.div,{role:"separator","aria-orientation":"horizontal",...c,ref:l})},"MenuSeparator")),eD="MenuSub",[p5,g5]=$s(eD);function Cw(n){return n?"open":"closed"}gt(Cw,"getOpenState");function Nw(n){return n==="indeterminate"}gt(Nw,"isIndeterminate");function tD(n){return Nw(n)?"indeterminate":n?"checked":"unchecked"}gt(tD,"getCheckedState");function Ew(n){const a=document.activeElement;for(const l of n)if(l===a||(l.focus(),document.activeElement!==a))return}gt(Ew,"focusFirst");function Rw(n,a){return n.map((l,o)=>n[(a+o)%n.length])}gt(Rw,"wrapArray");function Tw(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=Rw(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}gt(Tw,"getNextMatch");function Aw(n,a){const{x:l,y:o}=n;let c=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],v=p.x,x=p.y,y=g.x,b=g.y;x>o!=b>o&&l<(y-v)*(o-x)/(b-x)+v&&(c=!c)}return c}gt(Aw,"isPointInPolygon");function Mw(n,a){if(!a)return!1;const l={x:n.clientX,y:n.clientY};return Aw(l,a)}gt(Mw,"isPointerInGraceArea");function wu(n){return a=>a.pointerType==="mouse"?n(a):void 0}gt(wu,"whenMouse");var nD=IM,aD=PM,rD=qM,sD=VM,lD=XM,oD=KM,iD=WM,cD=Object.defineProperty,Vs=(n,a)=>cD(n,"name",{value:a,configurable:!0}),pp="DropdownMenu",[uD,v5]=Hn(pp,[yw]),Gs=yw(),[dD,Dw]=uD(pp),fD=Vs(n=>{const{__scopeDropdownMenu:a,children:l,dir:o,open:c,defaultOpen:u,onOpenChange:f,modal:p=!0}=n,g=Gs(a),v=h.useRef(null),[x,y]=Ia({prop:c,defaultProp:u??!1,onChange:f,caller:pp});return s.jsx(dD,{scope:a,triggerId:Na(),triggerRef:v,contentId:Na(),open:x,onOpenChange:y,onOpenToggle:h.useCallback(()=>y(b=>!b),[y]),modal:p,children:s.jsx(nD,{...g,open:x,onOpenChange:y,dir:o,modal:p,children:l})})},"DropdownMenu"),hD="DropdownMenuTrigger",mD=h.forwardRef(Vs(function(a,l){const{__scopeDropdownMenu:o,disabled:c=!1,...u}=a,f=Dw(hD,o),p=Gs(o),g=Fe(l,f.triggerRef);return s.jsx(aD,{asChild:!0,...p,children:s.jsx(He.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...u,ref:g,onPointerDown:Se(a.onPointerDown,v=>{!c&&v.button===0&&v.ctrlKey===!1&&(f.onOpenToggle(),f.open||v.preventDefault())}),onKeyDown:Se(a.onKeyDown,v=>{c||(["Enter"," "].includes(v.key)&&f.onOpenToggle(),v.key==="ArrowDown"&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),pD=Vs(n=>{const{__scopeDropdownMenu:a,...l}=n,o=Gs(a);return s.jsx(rD,{...o,...l})},"DropdownMenuPortal"),gD="DropdownMenuContent",vD=h.forwardRef(Vs(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=Dw(gD,o),f=Gs(o),p=h.useRef(!1);return s.jsx(sD,{id:u.contentId,"aria-labelledby":u.triggerId,...f,...c,ref:l,onCloseAutoFocus:Se(a.onCloseAutoFocus,g=>{var v;p.current||(v=u.triggerRef.current)==null||v.focus(),p.current=!1,g.preventDefault()}),onInteractOutside:Se(a.onInteractOutside,g=>{const v=g.detail.originalEvent,x=v.button===0&&v.ctrlKey===!0,y=v.button===2||x;(!u.modal||y)&&(p.current=!0)}),style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),xD=h.forwardRef(Vs(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=Gs(o);return s.jsx(lD,{...u,...c,ref:l})},"DropdownMenuLabel")),yD=h.forwardRef(Vs(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=Gs(o);return s.jsx(oD,{...u,...c,ref:l})},"DropdownMenuItem")),bD=h.forwardRef(Vs(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=Gs(o);return s.jsx(iD,{...u,...c,ref:l})},"DropdownMenuSeparator")),wD=fD,jD=mD,SD=pD,Ow=vD,kw=xD,_w=yD,zw=bD;const CD=wD,ND=jD,Lw=h.forwardRef(({className:n,sideOffset:a=4,...l},o)=>s.jsx(SD,{children:s.jsx(Ow,{ref:o,sideOffset:a,className:Ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",n),...l})}));Lw.displayName=Ow.displayName;const Uw=h.forwardRef(({className:n,inset:a,...l},o)=>s.jsx(_w,{ref:o,className:Ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",n),...l}));Uw.displayName=_w.displayName;const ED=h.forwardRef(({className:n,...a},l)=>s.jsx(kw,{ref:l,className:Ce("px-2 py-1.5 text-sm font-semibold",n),...a}));ED.displayName=kw.displayName;const RD=h.forwardRef(({className:n,...a},l)=>s.jsx(zw,{ref:l,className:Ce("-mx-1 my-1 h-px bg-muted",n),...a}));RD.displayName=zw.displayName;function TD(){const{theme:n,setTheme:a}=UR(),{user:l,logout:o}=Pm(),[c,u]=h.useState(!1),[f,p]=h.useState(null),g=vi(),v=n==="light"?HE:n==="dark"?DE:ME;return h.useEffect(()=>{pe.get("/api/admin/update/check?force=1").then(x=>p(x)).catch(()=>{})},[]),s.jsxs("header",{className:"flex h-14 items-center justify-between border-b bg-background px-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"Admin"}),s.jsxs("div",{className:"flex items-center gap-2",children:[(f==null?void 0:f.hasUpdate)&&s.jsxs(le,{variant:"ghost",size:"sm",title:`New version available: v${f.latestVersion} — go to Settings → System to update`,onClick:()=>g("/settings?tab=system"),children:[s.jsx(vE,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",f.latestVersion]}),s.jsx(le,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:s.jsx(v,{className:"h-4 w-4"})}),s.jsxs(CD,{open:c,onOpenChange:u,children:[s.jsx(ND,{asChild:!0,children:s.jsx(le,{variant:"ghost",children:(l==null?void 0:l.username)??"admin"})}),s.jsx(Lw,{align:"end",children:s.jsxs(Uw,{onClick:()=>void o(),children:[s.jsx(AE,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Ee=h.forwardRef(({className:n,type:a,...l},o)=>s.jsx("input",{type:a,className:Ce("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n),ref:o,...l}));Ee.displayName="Input";var AD=Object.defineProperty,MD=(n,a)=>AD(n,"name",{value:a,configurable:!0}),DD=h.forwardRef(MD(function(a,l){return s.jsx(He.label,{...a,ref:l,onMouseDown:o=>{var u;o.target.closest("button, input, select, textarea")||((u=a.onMouseDown)==null||u.call(a,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}})},"Label")),Iw=DD;const be=h.forwardRef(({className:n,...a},l)=>s.jsx(Iw,{ref:l,className:Ce("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...a}));be.displayName=Iw.displayName;const rt=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ce("rounded-lg border bg-card text-card-foreground shadow-sm",n),...a}));rt.displayName="Card";const st=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ce("flex flex-col space-y-1.5 p-6",n),...a}));st.displayName="CardHeader";const lt=h.forwardRef(({className:n,...a},l)=>s.jsx("h3",{ref:l,className:Ce("text-lg font-semibold leading-none tracking-tight",n),...a}));lt.displayName="CardTitle";const kn=h.forwardRef(({className:n,...a},l)=>s.jsx("p",{ref:l,className:Ce("text-sm text-muted-foreground",n),...a}));kn.displayName="CardDescription";const ot=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ce("p-6 pt-0",n),...a}));ot.displayName="CardContent";const Pw=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ce("flex items-center p-6 pt-0",n),...a}));Pw.displayName="CardFooter";var OD=n=>{switch(n){case"success":return zD;case"info":return UD;case"warning":return LD;case"error":return ID;default:return null}},kD=Array(12).fill(0),_D=({visible:n,className:a})=>me.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":n},me.createElement("div",{className:"sonner-spinner"},kD.map((l,o)=>me.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),zD=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),LD=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),UD=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ID=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},me.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-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"})),PD=me.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},me.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),me.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),BD=()=>{let[n,a]=me.useState(document.hidden);return me.useEffect(()=>{let l=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",l),()=>window.removeEventListener("visibilitychange",l)},[]),n},cm=1,HD=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;let{message:l,...o}=n,c=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:cm++,u=this.toasts.find(p=>p.id===c),f=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),u?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...n,id:c,title:l}),{...p,...n,id:c,dismissible:f,title:l}):p):this.addToast({title:l,...o,dismissible:f,id:c}),c},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(a=>{this.subscribers.forEach(l=>l({id:a.id,dismiss:!0}))}),this.subscribers.forEach(a=>a({id:n,dismiss:!0})),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let l;a.loading!==void 0&&(l=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));let o=n instanceof Promise?n:n(),c=l!==void 0,u,f=o.then(async g=>{if(u=["resolve",g],me.isValidElement(g))c=!1,this.create({id:l,type:"default",message:g});else if($D(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)||cm++;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}},On=new HD,qD=(n,a)=>{let l=(a==null?void 0:a.id)||cm++;return On.addToast({title:n,...a,id:l}),l},$D=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",VD=qD,GD=()=>On.toasts,YD=()=>On.getActiveToasts(),de=Object.assign(VD,{success:On.success,info:On.info,warning:On.warning,error:On.error,custom:On.custom,message:On.message,promise:On.promise,dismiss:On.dismiss,loading:On.loading},{getHistory:GD,getToasts:YD});function FD(n,{insertAt:a}={}){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",a==="top"&&l.firstChild?l.insertBefore(o,l.firstChild):l.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}FD(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
381
|
-
`);function Zc(n){return n.label!==void 0}var XD=3,KD="32px",QD="16px",Gb=4e3,ZD=356,JD=14,WD=20,eO=200;function wa(...n){return n.filter(Boolean).join(" ")}function tO(n){let[a,l]=n.split("-"),o=[];return a&&o.push(a),l&&o.push(l),o}var nO=n=>{var a,l,o,c,u,f,p,g,v,x,y;let{invert:b,toast:w,unstyled:N,interacting:S,setHeights:C,visibleToasts:R,heights:D,index:A,toasts:M,expanded:O,removeToast:E,defaultRichColors:z,closeButton:k,style:P,cancelButtonStyle:Z,actionButtonStyle:ee,className:V="",descriptionClassName:ce="",duration:se,position:H,gap:_,loadingIcon:q,expandByDefault:W,classNames:Q,icons:te,closeButtonAriaLabel:L="Close toast",pauseWhenPageIsHidden:U}=n,[Y,ae]=me.useState(null),[ge,ye]=me.useState(null),[G,ue]=me.useState(!1),[he,xe]=me.useState(!1),[Ae,Ne]=me.useState(!1),[Oe,Qe]=me.useState(!1),[et,ie]=me.useState(!1),[Le,qe]=me.useState(0),[_t,St]=me.useState(0),Wt=me.useRef(w.duration||se||Gb),mn=me.useRef(null),en=me.useRef(null),Ct=A===0,xn=A+1<=R,At=w.type,Mt=w.dismissible!==!1,pn=w.className||"",pa=w.descriptionClassName||"",Aa=me.useMemo(()=>D.findIndex(Re=>Re.toastId===w.id)||0,[D,w.id]),Wn=me.useMemo(()=>{var Re;return(Re=w.closeButton)!=null?Re:k},[w.closeButton,k]),ms=me.useMemo(()=>w.duration||se||Gb,[w.duration,se]),ga=me.useRef(0),Dt=me.useRef(0),yn=me.useRef(0),Tt=me.useRef(null),[lo,Fs]=H.split("-"),Xs=me.useMemo(()=>D.reduce((Re,_e,Ue)=>Ue>=Aa?Re:Re+_e.height,0),[D,Aa]),Ga=BD(),Ar=w.invert||b,xt=At==="loading";Dt.current=me.useMemo(()=>Aa*_+Xs,[Aa,Xs]),me.useEffect(()=>{Wt.current=ms},[ms]),me.useEffect(()=>{ue(!0)},[]),me.useEffect(()=>{let Re=en.current;if(Re){let _e=Re.getBoundingClientRect().height;return St(_e),C(Ue=>[{toastId:w.id,height:_e,position:w.position},...Ue]),()=>C(Ue=>Ue.filter(vt=>vt.toastId!==w.id))}},[C,w.id]),me.useLayoutEffect(()=>{if(!G)return;let Re=en.current,_e=Re.style.height;Re.style.height="auto";let Ue=Re.getBoundingClientRect().height;Re.style.height=_e,St(Ue),C(vt=>vt.find(Nt=>Nt.toastId===w.id)?vt.map(Nt=>Nt.toastId===w.id?{...Nt,height:Ue}:Nt):[{toastId:w.id,height:Ue,position:w.position},...vt])},[G,w.title,w.description,C,w.id]);let at=me.useCallback(()=>{xe(!0),qe(Dt.current),C(Re=>Re.filter(_e=>_e.toastId!==w.id)),setTimeout(()=>{E(w)},eO)},[w,E,C,Dt]);me.useEffect(()=>{if(w.promise&&At==="loading"||w.duration===1/0||w.type==="loading")return;let Re;return O||S||U&&Ga?(()=>{if(yn.current<ga.current){let _e=new Date().getTime()-ga.current;Wt.current=Wt.current-_e}yn.current=new Date().getTime()})():Wt.current!==1/0&&(ga.current=new Date().getTime(),Re=setTimeout(()=>{var _e;(_e=w.onAutoClose)==null||_e.call(w,w),at()},Wt.current)),()=>clearTimeout(Re)},[O,S,w,At,U,Ga,at]),me.useEffect(()=>{w.delete&&at()},[at,w.delete]);function It(){var Re,_e,Ue;return te!=null&&te.loading?me.createElement("div",{className:wa(Q==null?void 0:Q.loader,(Re=w==null?void 0:w.classNames)==null?void 0:Re.loader,"sonner-loader"),"data-visible":At==="loading"},te.loading):q?me.createElement("div",{className:wa(Q==null?void 0:Q.loader,(_e=w==null?void 0:w.classNames)==null?void 0:_e.loader,"sonner-loader"),"data-visible":At==="loading"},q):me.createElement(_D,{className:wa(Q==null?void 0:Q.loader,(Ue=w==null?void 0:w.classNames)==null?void 0:Ue.loader),visible:At==="loading"})}return me.createElement("li",{tabIndex:0,ref:en,className:wa(V,pn,Q==null?void 0:Q.toast,(a=w==null?void 0:w.classNames)==null?void 0:a.toast,Q==null?void 0:Q.default,Q==null?void 0:Q[At],(l=w==null?void 0:w.classNames)==null?void 0:l[At]),"data-sonner-toast":"","data-rich-colors":(o=w.richColors)!=null?o:z,"data-styled":!(w.jsx||w.unstyled||N),"data-mounted":G,"data-promise":!!w.promise,"data-swiped":et,"data-removed":he,"data-visible":xn,"data-y-position":lo,"data-x-position":Fs,"data-index":A,"data-front":Ct,"data-swiping":Ae,"data-dismissible":Mt,"data-type":At,"data-invert":Ar,"data-swipe-out":Oe,"data-swipe-direction":ge,"data-expanded":!!(O||W&&G),style:{"--index":A,"--toasts-before":A,"--z-index":M.length-A,"--offset":`${he?Le:Dt.current}px`,"--initial-height":W?"auto":`${_t}px`,...P,...w.style},onDragEnd:()=>{Ne(!1),ae(null),Tt.current=null},onPointerDown:Re=>{xt||!Mt||(mn.current=new Date,qe(Dt.current),Re.target.setPointerCapture(Re.pointerId),Re.target.tagName!=="BUTTON"&&(Ne(!0),Tt.current={x:Re.clientX,y:Re.clientY}))},onPointerUp:()=>{var Re,_e,Ue,vt;if(Oe||!Mt)return;Tt.current=null;let Nt=Number(((Re=en.current)==null?void 0:Re.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ut=Number(((_e=en.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Gt=new Date().getTime()-((Ue=mn.current)==null?void 0:Ue.getTime()),yt=Y==="x"?Nt:ut,zt=Math.abs(yt)/Gt;if(Math.abs(yt)>=WD||zt>.11){qe(Dt.current),(vt=w.onDismiss)==null||vt.call(w,w),ye(Y==="x"?Nt>0?"right":"left":ut>0?"down":"up"),at(),Qe(!0),ie(!1);return}Ne(!1),ae(null)},onPointerMove:Re=>{var _e,Ue,vt,Nt;if(!Tt.current||!Mt||((_e=window.getSelection())==null?void 0:_e.toString().length)>0)return;let ut=Re.clientY-Tt.current.y,Gt=Re.clientX-Tt.current.x,yt=(Ue=n.swipeDirections)!=null?Ue:tO(H);!Y&&(Math.abs(Gt)>1||Math.abs(ut)>1)&&ae(Math.abs(Gt)>Math.abs(ut)?"x":"y");let zt={x:0,y:0};Y==="y"?(yt.includes("top")||yt.includes("bottom"))&&(yt.includes("top")&&ut<0||yt.includes("bottom")&&ut>0)&&(zt.y=ut):Y==="x"&&(yt.includes("left")||yt.includes("right"))&&(yt.includes("left")&&Gt<0||yt.includes("right")&&Gt>0)&&(zt.x=Gt),(Math.abs(zt.x)>0||Math.abs(zt.y)>0)&&ie(!0),(vt=en.current)==null||vt.style.setProperty("--swipe-amount-x",`${zt.x}px`),(Nt=en.current)==null||Nt.style.setProperty("--swipe-amount-y",`${zt.y}px`)}},Wn&&!w.jsx?me.createElement("button",{"aria-label":L,"data-disabled":xt,"data-close-button":!0,onClick:xt||!Mt?()=>{}:()=>{var Re;at(),(Re=w.onDismiss)==null||Re.call(w,w)},className:wa(Q==null?void 0:Q.closeButton,(c=w==null?void 0:w.classNames)==null?void 0:c.closeButton)},(u=te==null?void 0:te.close)!=null?u:PD):null,w.jsx||h.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:me.createElement(me.Fragment,null,At||w.icon||w.promise?me.createElement("div",{"data-icon":"",className:wa(Q==null?void 0:Q.icon,(f=w==null?void 0:w.classNames)==null?void 0:f.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||It():null,w.type!=="loading"?w.icon||(te==null?void 0:te[At])||OD(At):null):null,me.createElement("div",{"data-content":"",className:wa(Q==null?void 0:Q.content,(p=w==null?void 0:w.classNames)==null?void 0:p.content)},me.createElement("div",{"data-title":"",className:wa(Q==null?void 0:Q.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?me.createElement("div",{"data-description":"",className:wa(ce,pa,Q==null?void 0:Q.description,(v=w==null?void 0:w.classNames)==null?void 0:v.description)},typeof w.description=="function"?w.description():w.description):null),h.isValidElement(w.cancel)?w.cancel:w.cancel&&Zc(w.cancel)?me.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||Z,onClick:Re=>{var _e,Ue;Zc(w.cancel)&&Mt&&((Ue=(_e=w.cancel).onClick)==null||Ue.call(_e,Re),at())},className:wa(Q==null?void 0:Q.cancelButton,(x=w==null?void 0:w.classNames)==null?void 0:x.cancelButton)},w.cancel.label):null,h.isValidElement(w.action)?w.action:w.action&&Zc(w.action)?me.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||ee,onClick:Re=>{var _e,Ue;Zc(w.action)&&((Ue=(_e=w.action).onClick)==null||Ue.call(_e,Re),!Re.defaultPrevented&&at())},className:wa(Q==null?void 0:Q.actionButton,(y=w==null?void 0:w.classNames)==null?void 0:y.actionButton)},w.action.label):null))};function Yb(){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 aO(n,a){let l={};return[n,a].forEach((o,c)=>{let u=c===1,f=u?"--mobile-offset":"--offset",p=u?QD:KD;function g(v){["top","right","bottom","left"].forEach(x=>{l[`${f}-${x}`]=typeof v=="number"?`${v}px`:v})}typeof o=="number"||typeof o=="string"?g(o):typeof o=="object"?["top","right","bottom","left"].forEach(v=>{o[v]===void 0?l[`${f}-${v}`]=p:l[`${f}-${v}`]=typeof o[v]=="number"?`${o[v]}px`:o[v]}):g(p)}),l}var rO=h.forwardRef(function(n,a){let{invert:l,position:o="bottom-right",hotkey:c=["altKey","KeyT"],expand:u,closeButton:f,className:p,offset:g,mobileOffset:v,theme:x="light",richColors:y,duration:b,style:w,visibleToasts:N=XD,toastOptions:S,dir:C=Yb(),gap:R=JD,loadingIcon:D,icons:A,containerAriaLabel:M="Notifications",pauseWhenPageIsHidden:O}=n,[E,z]=me.useState([]),k=me.useMemo(()=>Array.from(new Set([o].concat(E.filter(U=>U.position).map(U=>U.position)))),[E,o]),[P,Z]=me.useState([]),[ee,V]=me.useState(!1),[ce,se]=me.useState(!1),[H,_]=me.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=me.useRef(null),W=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),Q=me.useRef(null),te=me.useRef(!1),L=me.useCallback(U=>{z(Y=>{var ae;return(ae=Y.find(ge=>ge.id===U.id))!=null&&ae.delete||On.dismiss(U.id),Y.filter(({id:ge})=>ge!==U.id)})},[]);return me.useEffect(()=>On.subscribe(U=>{if(U.dismiss){z(Y=>Y.map(ae=>ae.id===U.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{cE.flushSync(()=>{z(Y=>{let ae=Y.findIndex(ge=>ge.id===U.id);return ae!==-1?[...Y.slice(0,ae),{...Y[ae],...U},...Y.slice(ae+1)]:[U,...Y]})})})}),[]),me.useEffect(()=>{if(x!=="system"){_(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?_("dark"):_("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:Y})=>{_(Y?"dark":"light")})}catch{U.addListener(({matches:ae})=>{try{_(ae?"dark":"light")}catch(ge){console.error(ge)}})}},[x]),me.useEffect(()=>{E.length<=1&&V(!1)},[E]),me.useEffect(()=>{let U=Y=>{var ae,ge;c.every(ye=>Y[ye]||Y.code===ye)&&(V(!0),(ae=q.current)==null||ae.focus()),Y.code==="Escape"&&(document.activeElement===q.current||(ge=q.current)!=null&&ge.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[c]),me.useEffect(()=>{if(q.current)return()=>{Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null,te.current=!1)}},[q.current]),me.createElement("section",{ref:a,"aria-label":`${M} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((U,Y)=>{var ae;let[ge,ye]=U.split("-");return E.length?me.createElement("ol",{key:U,dir:C==="auto"?Yb():C,tabIndex:-1,ref:q,className:p,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":ge,"data-lifted":ee&&E.length>1&&!u,"data-x-position":ye,style:{"--front-toast-height":`${((ae=P[0])==null?void 0:ae.height)||0}px`,"--width":`${ZD}px`,"--gap":`${R}px`,...w,...aO(g,v)},onBlur:G=>{te.current&&!G.currentTarget.contains(G.relatedTarget)&&(te.current=!1,Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||te.current||(te.current=!0,Q.current=G.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{ce||V(!1)},onDragEnd:()=>V(!1),onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||se(!0)},onPointerUp:()=>se(!1)},E.filter(G=>!G.position&&Y===0||G.position===U).map((G,ue)=>{var he,xe;return me.createElement(nO,{key:G.id,icons:A,index:ue,toast:G,defaultRichColors:y,duration:(he=S==null?void 0:S.duration)!=null?he:b,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:l,visibleToasts:N,closeButton:(xe=S==null?void 0:S.closeButton)!=null?xe:f,interacting:ce,position:U,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,removeToast:L,toasts:E.filter(Ae=>Ae.position==G.position),heights:P.filter(Ae=>Ae.position==G.position),setHeights:Z,expandByDefault:u,gap:R,loadingIcon:D,expanded:ee,pauseWhenPageIsHidden:O,swipeDirections:n.swipeDirections})})):null}))});function sO(){const{login:n}=Pm(),[a,l]=h.useState("admin"),[o,c]=h.useState(""),[u,f]=h.useState(""),[p,g]=h.useState(""),[v,x]=h.useState(!1),[y,b]=h.useState(!1),w=vi(),N=Bn();return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(rt,{className:"w-full max-w-sm",children:[s.jsxs(st,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain"}),s.jsx(lt,{children:"Sign in"})]}),s.jsx(kn,{children:"Enter your admin credentials."})]}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Username"}),s.jsx(Ee,{value:a,onChange:S=>l(S.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Password"}),s.jsx(Ee,{type:"password",value:o,onChange:S=>c(S.target.value)})]}),v&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"2FA code (or recovery code)"}),s.jsx(Ee,{value:u,onChange:S=>f(S.target.value),placeholder:"123456",maxLength:6})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Recovery code (alternative)"}),s.jsx(Ee,{value:p,onChange:S=>g(S.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),s.jsx("div",{className:"px-6 pb-6",children:s.jsx(le,{className:"w-full",disabled:y,onClick:async()=>{var S,C;b(!0);try{if((await n(a,o,u||void 0,p||void 0)).totpRequired){x(!0);return}const D=((C=(S=N.state)==null?void 0:S.from)==null?void 0:C.pathname)??"/";w(D,{replace:!0})}catch(R){de.error(R.message)}finally{b(!1)}},children:"Sign in"})})]})})}function lO(){const[n,a]=h.useState("admin"),[l,o]=h.useState(""),[c,u]=h.useState(""),[f,p]=h.useState(!1),[g,v]=h.useState(!0),[x,y]=h.useState(null),[b,w]=h.useState(""),[N,S]=h.useState(!1);h.useEffect(()=>{pe.get("/api/admin/setup/status").then(D=>v(!D.masterKeyConfigured)).catch(()=>v(!0))},[]);const C=!g||c.trim().length>=32,R=!f&&l.length>=12&&C;return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(rt,{className:"w-full max-w-md",children:[s.jsxs(st,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain rounded"}),s.jsx(lt,{children:"Welcome to LateDev Router"})]}),s.jsx(kn,{children:"Set up the administrator account to get started."})]}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Username"}),s.jsx(Ee,{value:n,onChange:D=>a(D.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Password (12+ chars)"}),s.jsx(Ee,{type:"password",value:l,onChange:D=>o(D.target.value)})]}),g&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Master encryption key (required, 32+ chars)"}),s.jsx(Ee,{type:"password",value:c,onChange:D=>u(D.target.value),placeholder:"Paste or generate a 32+ character key"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Provider API keys are encrypted with this key (AES-256-GCM). Store it somewhere safe — if it is lost, stored provider credentials cannot be recovered. Generate one with:"," ",s.jsx("code",{className:"break-all",children:`node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"`})]})]})]}),s.jsxs(Pw,{className:"flex-col items-stretch gap-4",children:[s.jsx(le,{disabled:!R,onClick:async()=>{p(!0);try{await pe.post("/api/admin/setup",{username:n,password:l,setupMasterKey:g?c.trim():void 0}),de.success("Admin account created"),window.location.assign("/login")}catch(D){de.error(D.message)}finally{p(!1)}},children:"Create admin"}),s.jsxs("div",{className:"border-t pt-4 space-y-2",children:[s.jsx(be,{children:"Import existing database"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use this to restore the administrator account, password, TOTP settings, providers, models, and master key from a backup without setting up again. Enter the same 6-digit backup passphrase used when the file was created."}),s.jsx(Ee,{type:"file",accept:".json,application/json",onChange:D=>{var A;return y(((A=D.target.files)==null?void 0:A[0])??null)}}),s.jsx(Ee,{inputMode:"numeric",maxLength:6,value:b,onChange:D=>w(D.target.value.replace(/\D/g,"")),placeholder:"Backup passphrase (6 digits)"}),s.jsx(le,{variant:"outline",disabled:!x||b.length!==6||N,onClick:async()=>{var D,A;if(x){S(!0);try{const M=JSON.parse(await x.text()),O=await fetch("/api/admin/backup/restore",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({backup:M,passphrase:b})});if(!O.ok)throw new Error(((A=(D=await O.json())==null?void 0:D.error)==null?void 0:A.message)??"Import failed");de.success("Database imported"),window.location.assign("/login")}catch(M){de.error(M.message)}finally{S(!1)}}},children:"Import database"})]})]})]})})}function Va({title:n,description:a,actions:l,className:o}){return s.jsxs("div",{className:Ce("mb-6 flex items-start justify-between gap-4",o),children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:n}),a&&s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a})]}),l&&s.jsx("div",{className:"flex items-center gap-2",children:l})]})}const oO=d1("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",success:"border-transparent bg-emerald-600 text-white",warning:"border-transparent bg-amber-500 text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function We({className:n,variant:a,...l}){return s.jsx("div",{className:Ce(oO({variant:a}),n),...l})}function iO(){const[n,a]=h.useState(null);return h.useEffect(()=>{pe.get("/api/admin/dashboard").then(a).catch(()=>a(null))},[]),n?s.jsxs("div",{children:[s.jsx(Va,{title:"Dashboard",description:"Operational summary for today",actions:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(le,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(Ls,{to:"/providers",children:[s.jsx(Kl,{className:"mr-1 h-4 w-4"})," Provider"]})}),s.jsx(le,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(Ls,{to:"/combos",children:[s.jsx(X0,{className:"mr-1 h-4 w-4"})," Combo"]})}),s.jsx(le,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(Ls,{to:"/api-keys",children:[s.jsx(F0,{className:"mr-1 h-4 w-4"})," API Key"]})})]})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs(rt,{children:[s.jsx(st,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Requests today"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Xt(n.today.total)})]}),s.jsxs(rt,{children:[s.jsx(st,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Success rate"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:n.today.total?_u(n.today.success/n.today.total):"—"})]}),s.jsxs(rt,{children:[s.jsx(st,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Failed"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Xt(n.today.failed)})]}),s.jsxs(rt,{children:[s.jsx(st,{className:"pb-1",children:s.jsx(lt,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Xt(n.today.totalTokens)})]})]}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"Provider health"}),s.jsxs(kn,{children:[n.providers.length," configured"]})]}),s.jsxs(ot,{className:"space-y-2",children:[n.providers.length===0&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["No providers yet. ",s.jsx(Ls,{to:"/providers",className:"text-primary",children:"Add one"}),"."]}),n.providers.map(l=>s.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(K0,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"font-medium",children:l.name}),s.jsx("span",{className:"text-xs text-muted-foreground",children:l.slug}),s.jsx(We,{variant:"outline",className:"ml-2",children:l.type})]}),s.jsx(We,{variant:l.health==="healthy"?"success":l.health==="down"?"destructive":"secondary",children:l.health})]},l.id))]})]}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"Recent failures"}),s.jsx(kn,{children:"Today"})]}),s.jsxs(ot,{className:"space-y-1 text-sm",children:[n.recentFailures.length===0&&s.jsx("p",{className:"text-muted-foreground",children:"No failures today."}),n.recentFailures.map(l=>{var o;return s.jsxs("div",{className:"flex items-center justify-between border-b py-1 last:border-0",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-mono text-xs",children:l.requestedModel}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.errorType??`HTTP ${l.httpStatus}`," — ",(o=l.errorMessage)==null?void 0:o.slice(0,60)]})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:Ym(l.createdAt)})]},l.id)})]})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const Un=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:l,className:Ce("w-full caption-bottom text-sm",n),...a})}));Un.displayName="Table";const In=h.forwardRef(({className:n,...a},l)=>s.jsx("thead",{ref:l,className:Ce("[&_tr]:border-b",n),...a}));In.displayName="TableHeader";const Pn=h.forwardRef(({className:n,...a},l)=>s.jsx("tbody",{ref:l,className:Ce("[&_tr:last-child]:border-0",n),...a}));Pn.displayName="TableBody";const Be=h.forwardRef(({className:n,...a},l)=>s.jsx("tr",{ref:l,className:Ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...a}));Be.displayName="TableRow";const ve=h.forwardRef(({className:n,...a},l)=>s.jsx("th",{ref:l,className:Ce("h-10 px-2 text-left align-middle font-medium text-muted-foreground",n),...a}));ve.displayName="TableHead";const fe=h.forwardRef(({className:n,...a},l)=>s.jsx("td",{ref:l,className:Ce("p-2 align-middle",n),...a}));fe.displayName="TableCell";var cO=Object.defineProperty,Jn=(n,a)=>cO(n,"name",{value:a,configurable:!0}),gp="Dialog",[Bw,Hw]=Hn(gp),[uO,Ta]=Bw(gp),qw=Jn(n=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:u,modal:f=!0}=n,p=h.useRef(null),g=h.useRef(null),[v,x]=Ia({prop:o,defaultProp:c??!1,onChange:u,caller:gp}),[y,b]=h.useState(0),[w,N]=h.useState(0);return s.jsx(uO,{scope:a,triggerRef:p,contentRef:g,contentId:Na(),titleId:Na(),descriptionId:Na(),titlePresent:y>0,descriptionPresent:w>0,setTitleCount:b,setDescriptionCount:N,open:v,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(S=>!S),[x]),modal:f,children:l})},"Dialog"),dO="DialogTrigger",$w=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(dO,o),f=Fe(l,u.triggerRef);return s.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":Ku(u.open),...c,ref:f,onClick:Se(a.onClick,u.onOpenToggle)})},"DialogTrigger")),Vw="DialogPortal",[fO,Gw]=Bw(Vw,{forceMount:void 0}),Yw=Jn(n=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=n,u=Ta(Vw,a);return s.jsx(fO,{scope:a,forceMount:l,children:h.Children.map(o,f=>s.jsx(Er,{present:l||u.open,children:s.jsx(cp,{asChild:!0,container:c,children:f})}))})},"DialogPortal"),um="DialogOverlay",vp=h.forwardRef(Jn(function(a,l){const o=Gw(um,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=Ta(um,a.__scopeDialog);return f.modal?s.jsx(Er,{present:c||f.open,children:s.jsx(mO,{...u,ref:l})}):null},"DialogOverlay")),hO=Ua("DialogOverlay.RemoveScroll"),mO=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(um,o),f=N1(),p=Fe(l,f);return s.jsx(Fu,{as:hO,allowPinchZoom:!0,shards:[u.contentRef],children:s.jsx(He.div,{"data-state":Ku(u.open),...c,ref:p,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),ci="DialogContent",xp=h.forwardRef(Jn(function(a,l){const o=Gw(ci,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=Ta(ci,a.__scopeDialog);return s.jsx(Er,{present:c||f.open,children:f.modal?s.jsx(pO,{...u,ref:l}):s.jsx(gO,{...u,ref:l})})},"DialogContent")),pO=h.forwardRef(Jn(function(a,l){const o=Ta(ci,a.__scopeDialog),c=h.useRef(null),u=Fe(l,o.contentRef,c);return h.useEffect(()=>{const f=c.current;if(f)return fp(f)},[]),s.jsx(Fw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:Se(a.onCloseAutoFocus,f=>{var p;f.preventDefault(),(p=o.triggerRef.current)==null||p.focus()}),onPointerDownOutside:Se(a.onPointerDownOutside,f=>{const p=f.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&f.preventDefault()}),onFocusOutside:Se(a.onFocusOutside,f=>f.preventDefault())})},"DialogContentModal")),gO=h.forwardRef(Jn(function(a,l){const o=Ta(ci,a.__scopeDialog),c=h.useRef(!1),u=h.useRef(!1);return s.jsx(Fw,{...a,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:f=>{var p,g;(p=a.onCloseAutoFocus)==null||p.call(a,f),f.defaultPrevented||(c.current||(g=o.triggerRef.current)==null||g.focus(),f.preventDefault()),c.current=!1,u.current=!1},onInteractOutside:f=>{var v,x;(v=a.onInteractOutside)==null||v.call(a,f),f.defaultPrevented||(c.current=!0,f.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const p=f.target;((x=o.triggerRef.current)==null?void 0:x.contains(p))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&u.current&&f.preventDefault()}})},"DialogContentNonModal")),Fw=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,...p}=a,g=Ta(ci,o);return wi(),s.jsx(s.Fragment,{children:s.jsx(Jm,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:u,onUnmountAutoFocus:f,children:s.jsx(Lu,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Ku(g.open),...p,ref:l,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),vO="DialogTitle",yp=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(vO,o),{setTitleCount:f}=u;return Jt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),s.jsx(He.h2,{id:u.titleId,...c,ref:l})},"DialogTitle")),xO="DialogDescription",bp=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(xO,o),{setDescriptionCount:f}=u;return Jt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),s.jsx(He.p,{id:u.descriptionId,...c,ref:l})},"DialogDescription")),yO="DialogClose",wp=h.forwardRef(Jn(function(a,l){const{__scopeDialog:o,...c}=a,u=Ta(yO,o);return s.jsx(He.button,{type:"button",...c,ref:l,onClick:Se(a.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function Ku(n){return n?"open":"closed"}Jn(Ku,"getState");const ln=qw,Si=$w,bO=Yw,Xw=h.forwardRef(({className:n,...a},l)=>s.jsx(vp,{ref:l,className:Ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...a}));Xw.displayName=vp.displayName;const Kt=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(bO,{children:[s.jsx(Xw,{}),s.jsxs(xp,{ref:o,className:Ce("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 sm:rounded-lg",n),...l,children:[a,s.jsxs(wp,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[s.jsx(ku,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Kt.displayName=xp.displayName;const Qt=({className:n,...a})=>s.jsx("div",{className:Ce("flex flex-col space-y-1.5 text-center sm:text-left",n),...a});Qt.displayName="DialogHeader";const Vt=({className:n,...a})=>s.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a});Vt.displayName="DialogFooter";const Zt=h.forwardRef(({className:n,...a},l)=>s.jsx(yp,{ref:l,className:Ce("text-lg font-semibold leading-none tracking-tight",n),...a}));Zt.displayName=yp.displayName;const jr=h.forwardRef(({className:n,...a},l)=>s.jsx(bp,{ref:l,className:Ce("text-sm text-muted-foreground",n),...a}));jr.displayName=bp.displayName;var wO=Object.defineProperty,Rr=(n,a)=>wO(n,"name",{value:a,configurable:!0}),jO="AlertDialog",[SO,x5]=Hn(jO,[Hw]),Tr=Hw(),CO=Rr(n=>{const{__scopeAlertDialog:a,...l}=n,o=Tr(a);return s.jsx(qw,{...o,...l,modal:!0})},"AlertDialog"),NO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return s.jsx($w,{...u,...c,ref:l})},"AlertDialogTrigger")),EO=Rr(n=>{const{__scopeAlertDialog:a,...l}=n,o=Tr(a);return s.jsx(Yw,{...o,...l})},"AlertDialogPortal"),RO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return s.jsx(vp,{...u,...c,ref:l})},"AlertDialogOverlay")),TO="AlertDialogContent",[AO,MO]=SO(TO),DO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,children:c,...u}=a,f=Tr(o),p=h.useRef(null),g=Fe(l,p),v=h.useRef(null);return s.jsx(AO,{scope:o,cancelRef:v,children:s.jsx(xp,{role:"alertdialog",...f,...u,ref:g,onOpenAutoFocus:Se(u.onOpenAutoFocus,x=>{var y;x.preventDefault(),(y=v.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),children:c})})},"AlertDialogContent")),OO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return s.jsx(yp,{...u,...c,ref:l})},"AlertDialogTitle")),kO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return s.jsx(bp,{...u,...c,ref:l})},"AlertDialogDescription")),_O=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Tr(o);return s.jsx(wp,{...u,...c,ref:l})},"AlertDialogAction")),zO="AlertDialogCancel",LO=h.forwardRef(Rr(function(a,l){const{__scopeAlertDialog:o,...c}=a,{cancelRef:u}=MO(zO,o),f=Tr(o),p=Fe(l,u);return s.jsx(wp,{...f,...c,ref:p})},"AlertDialogCancel")),UO=CO,IO=NO,PO=EO,Kw=RO,Qw=DO,Zw=_O,Jw=LO,Ww=OO,ej=kO;const tj=UO,BO=IO,HO=PO,nj=h.forwardRef(({className:n,...a},l)=>s.jsx(Kw,{ref:l,className:Ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...a}));nj.displayName=Kw.displayName;const jp=h.forwardRef(({className:n,...a},l)=>s.jsxs(HO,{children:[s.jsx(nj,{}),s.jsx(Qw,{ref:l,className:Ce("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:max-w-[425px]",n),...a})]}));jp.displayName=Qw.displayName;const aj=({className:n,...a})=>s.jsx("div",{className:Ce("flex flex-col space-y-2 text-center sm:text-left",n),...a}),rj=({className:n,...a})=>s.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a}),Sp=h.forwardRef(({className:n,...a},l)=>s.jsx(Ww,{ref:l,className:Ce("text-lg font-semibold",n),...a}));Sp.displayName=Ww.displayName;const Cp=h.forwardRef(({className:n,...a},l)=>s.jsx(ej,{ref:l,className:Ce("text-sm text-muted-foreground",n),...a}));Cp.displayName=ej.displayName;const Np=h.forwardRef(({className:n,...a},l)=>s.jsx(Zw,{ref:l,className:Ce("inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",n),...a}));Np.displayName=Zw.displayName;const Ep=h.forwardRef(({className:n,...a},l)=>s.jsx(Jw,{ref:l,className:Ce("inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium hover:bg-accent",n),...a}));Ep.displayName=Jw.displayName;var qO=Object.defineProperty,$O=(n,a)=>qO(n,"name",{value:a,configurable:!0});function dm(n,[a,l]){return Math.min(l,Math.max(a,n))}$O(dm,"clamp");var VO=Object.defineProperty,GO=(n,a)=>VO(n,"name",{value:a,configurable:!0});function sj(n){const a=h.useRef({value:n,previous:n});return h.useMemo(()=>(a.current.value!==n&&(a.current.previous=a.current.value,a.current.value=n),a.current.previous),[n])}GO(sj,"usePrevious");var YO=Object.defineProperty,FO=(n,a)=>YO(n,"name",{value:a,configurable:!0}),lj=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),XO=h.forwardRef(FO(function(a,l){return s.jsx(He.span,{...a,ref:l,style:{...lj,...a.style}})},"VisuallyHidden")),KO=XO,QO=Object.defineProperty,mt=(n,a)=>QO(n,"name",{value:a,configurable:!0}),ZO=[" ","Enter","ArrowUp","ArrowDown"],JO=[" ","Enter"],$l="Select",[Qu,Rp,WO]=zu($l),[Ys,y5]=Hn($l,[WO,to]),Tp=to(),[ek,hs]=Ys($l),[tk,nk]=Ys($l);function oj(n){const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:u,value:f,defaultValue:p,onValueChange:g,dir:v,name:x,autoComplete:y,disabled:b,required:w,form:N,internal_do_not_use_render:S}=n,C=Tp(a),[R,D]=h.useState(null),[A,M]=h.useState(null),[O,E]=h.useState(!1),z=bi(v),[k,P]=Ia({prop:o,defaultProp:c??!1,onChange:u,caller:$l}),[Z,ee]=Ia({prop:f,defaultProp:p,onChange:g,caller:$l}),V=h.useRef(null),ce=h.useRef(Z);h.useEffect(()=>{const U=N?R==null?void 0:R.ownerDocument.getElementById(N):R==null?void 0:R.form;if(U instanceof HTMLFormElement){const Y=mt(()=>ee(ce.current),"reset");return U.addEventListener("reset",Y),()=>U.removeEventListener("reset",Y)}},[N,R,ee]);const se=R?!!N||!!R.closest("form"):!0,[H,_]=h.useState(new Set),q=Na(),W=Array.from(H).map(U=>U.props.value).join(";"),Q=h.useCallback(U=>{_(Y=>new Set(Y).add(U))},[]),te=h.useCallback(U=>{_(Y=>{const ae=new Set(Y);return ae.delete(U),ae})},[]),L={required:w,trigger:R,onTriggerChange:D,valueNode:A,onValueNodeChange:M,valueNodeHasChildren:O,onValueNodeHasChildrenChange:E,contentId:q,value:Z,onValueChange:ee,open:k,onOpenChange:P,dir:z,triggerPointerDownPosRef:V,disabled:b,name:x,autoComplete:y,form:N,nativeOptions:H,nativeSelectKey:W,isFormControl:se};return s.jsx(lp,{...C,children:s.jsx(ek,{scope:a,...L,children:s.jsx(Qu.Provider,{scope:a,children:s.jsx(tk,{scope:a,onNativeOptionAdd:Q,onNativeOptionRemove:te,children:hj(S)?S(L):l})})})})}mt(oj,"SelectProvider");var ak=mt(n=>{const{__scopeSelect:a,children:l,...o}=n;return s.jsx(oj,{__scopeSelect:a,...o,internal_do_not_use_render:({isFormControl:c})=>s.jsxs(s.Fragment,{children:[l,c?s.jsx(Nk,{__scopeSelect:a}):null]})})},"Select"),rk="SelectTrigger",ij=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,disabled:c=!1,...u}=a,f=Tp(o),p=hs(rk,o),g=p.disabled||c,v=Fe(l,p.onTriggerChange),x=Rp(o),y=h.useRef("touch"),[b,w,N]=Ap(C=>{const R=x().filter(M=>!M.disabled),D=R.find(M=>M.value===p.value),A=Mp(R,C,D);A!==void 0&&p.onValueChange(A.value)}),S=mt(C=>{g||(p.onOpenChange(!0),N()),C&&(p.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return s.jsx(op,{asChild:!0,...f,children:s.jsx(He.button,{type:"button",role:"combobox","aria-controls":p.open?p.contentId:void 0,"aria-expanded":p.open,"aria-required":p.required,"aria-autocomplete":"none",dir:p.dir,"data-state":p.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":Ci(p.value)?"":void 0,...u,ref:v,onClick:Se(u.onClick,C=>{C.currentTarget.focus(),y.current!=="mouse"&&S(C)}),onPointerDown:Se(u.onPointerDown,C=>{y.current=C.pointerType;const R=C.target;R.hasPointerCapture(C.pointerId)&&R.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(S(C),C.preventDefault())}),onKeyDown:Se(u.onKeyDown,C=>{const R=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&w(C.key),!(R&&C.key===" ")&&ZO.includes(C.key)&&(S(),C.preventDefault())})})})},"SelectTrigger")),sk="SelectValue",lk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,className:c,style:u,children:f,placeholder:p="",...g}=a,v=hs(sk,o),{onValueNodeHasChildrenChange:x}=v,y=f!==void 0,b=Fe(l,v.onValueNodeChange);Jt(()=>{x(y)},[x,y]);const w=Ci(v.value);return s.jsx(He.span,{...g,asChild:w?!1:g.asChild,ref:b,style:{pointerEvents:"none"},children:s.jsx(h.Fragment,{children:w?p:f},w?"placeholder":"value")})},"SelectValue")),ok=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,children:c,...u}=a;return s.jsx(He.span,{"aria-hidden":!0,...u,ref:l,children:c||"▼"})},"SelectIcon")),ik="SelectPortal",[ck,uk]=Ys(ik,{forceMount:void 0}),dk=mt(n=>{const{__scopeSelect:a,forceMount:l,...o}=n;return s.jsx(ck,{scope:n.__scopeSelect,forceMount:l,children:s.jsx(cp,{asChild:!0,...o})})},"SelectPortal"),Hs="SelectContent",cj=h.forwardRef(mt(function(a,l){const o=uk(Hs,a.__scopeSelect),{forceMount:c=o.forceMount,...u}=a,f=hs(Hs,a.__scopeSelect),[p,g]=h.useState();return Jt(()=>{g(new DocumentFragment)},[]),s.jsx(Er,{present:c||f.open,children:({present:v})=>v?s.jsx(mk,{...u,ref:l}):s.jsx(fk,{...u,fragment:p})})},"SelectContent")),fk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,children:c,fragment:u}=a;return u?Sa.createPortal(s.jsx(uj,{scope:o,children:s.jsx(Qu.Slot,{scope:o,children:s.jsx("div",{ref:l,children:c})})}),u):null},"SelectContentFragment")),ja=10,[uj,Zu]=Ys(Hs),hk=Ua("SelectContent.RemoveScroll"),mk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o}=a,{position:c="item-aligned",onCloseAutoFocus:u,onEscapeKeyDown:f,onPointerDownOutside:p,side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:N,sticky:S,hideWhenDetached:C,avoidCollisions:R,...D}=a,A=hs(Hs,o),[M,O]=h.useState(null),[E,z]=h.useState(null),k=Fe(l,O),[P,Z]=h.useState(null),[ee,V]=h.useState(null),ce=Rp(o),[se,H]=h.useState(!1),_=h.useRef(!1);h.useEffect(()=>{if(M)return fp(M)},[M]),wi();const q=h.useCallback(ue=>{const[he,...xe]=ce().map(Oe=>Oe.ref.current),[Ae]=xe.slice(-1),Ne=document.activeElement;for(const Oe of ue)if(Oe===Ne||(Oe==null||Oe.scrollIntoView({block:"nearest"}),Oe===he&&E&&(E.scrollTop=0),Oe===Ae&&E&&(E.scrollTop=E.scrollHeight),Oe==null||Oe.focus(),document.activeElement!==Ne))return},[ce,E]),W=h.useCallback(()=>q([P,M]),[q,P,M]);h.useEffect(()=>{se&&W()},[se,W]);const{onOpenChange:Q,triggerPointerDownPosRef:te}=A;h.useEffect(()=>{if(M){let ue={x:0,y:0};const he=mt(Ae=>{var Ne,Oe;ue={x:Math.abs(Math.round(Ae.pageX)-(((Ne=te.current)==null?void 0:Ne.x)??0)),y:Math.abs(Math.round(Ae.pageY)-(((Oe=te.current)==null?void 0:Oe.y)??0))}},"handlePointerMove"),xe=mt(Ae=>{ue.x<=10&&ue.y<=10?Ae.preventDefault():Ae.composedPath().includes(M)||Q(!1),document.removeEventListener("pointermove",he),te.current=null},"handlePointerUp");return te.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",xe,{capture:!0})}}},[M,Q,te]),h.useEffect(()=>{const ue=mt(()=>Q(!1),"close");return window.addEventListener("blur",ue),window.addEventListener("resize",ue),()=>{window.removeEventListener("blur",ue),window.removeEventListener("resize",ue)}},[Q]);const[L,U]=Ap(ue=>{const he=ce().filter(Ne=>!Ne.disabled),xe=he.find(Ne=>Ne.ref.current===document.activeElement),Ae=Mp(he,ue,xe);Ae&&setTimeout(()=>{var Ne;return(Ne=Ae.ref.current)==null?void 0:Ne.focus()})}),Y=h.useCallback((ue,he,xe)=>{const Ae=!_.current&&!xe;(A.value!==void 0&&A.value===he||Ae)&&(Z(ue),Ae&&(_.current=!0))},[A.value]),ae=h.useCallback(()=>M==null?void 0:M.focus(),[M]),ge=h.useCallback((ue,he,xe)=>{const Ae=!_.current&&!xe;(A.value!==void 0&&A.value===he||Ae)&&V(ue)},[A.value]),ye=c==="popper"?Fb:pk,G=ye===Fb?{side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:N,sticky:S,hideWhenDetached:C,avoidCollisions:R}:{};return s.jsx(uj,{scope:o,content:M,viewport:E,onViewportChange:z,itemRefCallback:Y,selectedItem:P,onItemLeave:ae,itemTextRefCallback:ge,focusSelectedItem:W,selectedItemText:ee,position:c,isPositioned:se,searchRef:L,children:s.jsx(Fu,{as:hk,allowPinchZoom:!0,children:s.jsx(Jm,{asChild:!0,trapped:A.open,onMountAutoFocus:ue=>{ue.preventDefault()},onUnmountAutoFocus:Se(u,ue=>{var he;(he=A.trigger)==null||he.focus({preventScroll:!0}),ue.preventDefault()}),children:s.jsx(Lu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:ue=>ue.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:s.jsx(ye,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:ue=>ue.preventDefault(),...D,...G,onPlaced:()=>H(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...D.style},onKeyDown:Se(D.onKeyDown,ue=>{const he=ue.ctrlKey||ue.altKey||ue.metaKey;if(ue.key==="Tab"&&ue.preventDefault(),!he&&ue.key.length===1&&U(ue.key),["ArrowUp","ArrowDown","Home","End"].includes(ue.key)){let Ae=ce().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(ue.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(ue.key)){const Ne=ue.target,Oe=Ae.indexOf(Ne);Ae=Ae.slice(Oe+1)}setTimeout(()=>q(Ae)),ue.preventDefault()}})})})})})})},"SelectContentImpl")),pk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,onPlaced:c,...u}=a,f=hs(Hs,o),p=Zu(Hs,o),[g,v]=h.useState(null),[x,y]=h.useState(null),b=Fe(l,y),w=Rp(o),N=h.useRef(!1),S=h.useRef(!0),{viewport:C,selectedItem:R,selectedItemText:D,focusSelectedItem:A}=p,M=h.useCallback(()=>{if(f.trigger&&f.valueNode&&g&&x&&C&&R&&D){const k=f.trigger.getBoundingClientRect(),P=x.getBoundingClientRect(),Z=f.valueNode.getBoundingClientRect(),ee=D.getBoundingClientRect();if(f.dir!=="rtl"){const Ne=ee.left-P.left,Oe=Z.left-Ne,Qe=k.left-Oe,et=k.width+Qe,ie=Math.max(et,P.width),Le=window.innerWidth-ja,qe=dm(Oe,[ja,Math.max(ja,Le-ie)]);g.style.minWidth=et+"px",g.style.left=qe+"px"}else{const Ne=P.right-ee.right,Oe=window.innerWidth-Z.right-Ne,Qe=window.innerWidth-k.right-Oe,et=k.width+Qe,ie=Math.max(et,P.width),Le=window.innerWidth-ja,qe=dm(Oe,[ja,Math.max(ja,Le-ie)]);g.style.minWidth=et+"px",g.style.right=qe+"px"}const V=w(),ce=window.innerHeight-ja*2,se=C.scrollHeight,H=window.getComputedStyle(x),_=parseInt(H.borderTopWidth,10),q=parseInt(H.paddingTop,10),W=parseInt(H.borderBottomWidth,10),Q=parseInt(H.paddingBottom,10),te=_+q+se+Q+W,L=Math.min(R.offsetHeight*5,te),U=window.getComputedStyle(C),Y=parseInt(U.paddingTop,10),ae=parseInt(U.paddingBottom,10),ge=k.top+k.height/2-ja,ye=ce-ge,G=R.offsetHeight/2,ue=R.offsetTop+G,he=_+q+ue,xe=te-he;if(he<=ge){const Ne=V.length>0&&R===V[V.length-1].ref.current;g.style.bottom="0px";const Oe=x.clientHeight-C.offsetTop-C.offsetHeight,Qe=Math.max(ye,G+(Ne?ae:0)+Oe+W),et=he+Qe;g.style.height=et+"px"}else{const Ne=V.length>0&&R===V[0].ref.current;g.style.top="0px";const Qe=Math.max(ge,_+C.offsetTop+(Ne?Y:0)+G)+xe;g.style.height=Qe+"px",C.scrollTop=he-ge+C.offsetTop}g.style.margin=`${ja}px 0`,g.style.minHeight=L+"px",g.style.maxHeight=ce+"px",c==null||c(),requestAnimationFrame(()=>N.current=!0)}},[w,f.trigger,f.valueNode,g,x,C,R,D,f.dir,c]);Jt(()=>M(),[M]);const[O,E]=h.useState();Jt(()=>{x&&E(window.getComputedStyle(x).zIndex)},[x]);const z=h.useCallback(k=>{k&&S.current===!0&&(M(),A==null||A(),S.current=!1)},[M,A]);return s.jsx(gk,{scope:o,contentWrapper:g,shouldExpandOnScrollRef:N,onScrollButtonChange:z,children:s.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:s.jsx(He.div,{...u,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...u.style}})})})},"SelectItemAlignedPosition")),Fb=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,align:c="start",collisionPadding:u=ja,...f}=a,p=Tp(o);return s.jsx(ip,{...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")),[gk,vk]=Ys(Hs,{}),Xb="SelectViewport",xk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,nonce:c,...u}=a,f=Zu(Xb,o),p=vk(Xb,o),g=Fe(l,f.onViewportChange),v=h.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),s.jsx(Qu.Slot,{scope:o,children:s.jsx(He.div,{"data-radix-select-viewport":"",role:"presentation",...u,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...u.style},onScroll:Se(u.onScroll,x=>{const y=x.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:w}=p;if(w!=null&&w.current&&b){const N=Math.abs(v.current-y.scrollTop);if(N>0){const S=window.innerHeight-ja*2,C=parseFloat(b.style.minHeight),R=parseFloat(b.style.height),D=Math.max(C,R);if(D<S){const A=D+N,M=Math.min(S,A),O=A-M;b.style.height=M+"px",b.style.bottom==="0px"&&(y.scrollTop=O>0?O:0,b.style.justifyContent="flex-end")}}}v.current=y.scrollTop})})})]})},"SelectViewport")),yk="SelectGroup",[b5,w5]=Ys(yk),fm="SelectItem",[bk,dj]=Ys(fm),fj=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,value:c,disabled:u=!1,textValue:f,...p}=a,g=hs(fm,o),v=Zu(fm,o),x=g.value===c,[y,b]=h.useState(f??""),[w,N]=h.useState(!1),S=ma(M=>{var O;return(O=v.itemRefCallback)==null?void 0:O.call(v,M,c,u)}),C=Fe(l,S),R=Na(),D=h.useRef("touch"),A=mt(()=>{u||(g.onValueChange(c),g.onOpenChange(!1))},"handleSelect");return s.jsx(bk,{scope:o,value:c,disabled:u,textId:R,isSelected:x,onItemTextChange:h.useCallback(M=>{b(O=>O||((M==null?void 0:M.textContent)??"").trim())},[]),children:s.jsx(Qu.ItemSlot,{scope:o,value:c,disabled:u,textValue:y,children:s.jsx(He.div,{role:"option","aria-labelledby":R,"data-highlighted":w?"":void 0,"aria-selected":x&&w,"data-state":x?"checked":"unchecked","aria-disabled":u||void 0,"data-disabled":u?"":void 0,tabIndex:u?void 0:-1,...p,ref:C,onFocus:Se(p.onFocus,()=>N(!0)),onBlur:Se(p.onBlur,()=>N(!1)),onClick:Se(p.onClick,()=>{D.current!=="mouse"&&A()}),onPointerUp:Se(p.onPointerUp,()=>{D.current==="mouse"&&A()}),onPointerDown:Se(p.onPointerDown,M=>{D.current=M.pointerType}),onPointerMove:Se(p.onPointerMove,M=>{var O;D.current=M.pointerType,u?(O=v.onItemLeave)==null||O.call(v):D.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(p.onPointerLeave,M=>{var O;M.currentTarget===document.activeElement&&((O=v.onItemLeave)==null||O.call(v))}),onKeyDown:Se(p.onKeyDown,M=>{var E;u||M.target!==M.currentTarget||((E=v.searchRef)==null?void 0:E.current)!==""&&M.key===" "||(JO.includes(M.key)&&A(),M.key===" "&&M.preventDefault())})})})})},"SelectItem")),Jc="SelectItemText",wk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,className:c,style:u,...f}=a,p=hs(Jc,o),g=Zu(Jc,o),v=dj(Jc,o),x=nk(Jc,o),[y,b]=h.useState(null),w=ma(A=>{var M;return(M=g.itemTextRefCallback)==null?void 0:M.call(g,A,v.value,v.disabled)}),N=Fe(l,b,v.onItemTextChange,w),S=y==null?void 0:y.textContent,C=h.useMemo(()=>s.jsx("option",{value:v.value,disabled:v.disabled,children:S},v.value),[v.disabled,v.value,S]),{onNativeOptionAdd:R,onNativeOptionRemove:D}=x;return Jt(()=>(R(C),()=>D(C)),[R,D,C]),s.jsxs(s.Fragment,{children:[s.jsx(He.span,{id:v.textId,...f,ref:N}),v.isSelected&&p.valueNode&&!p.valueNodeHasChildren&&!Ci(p.value)?Sa.createPortal(f.children,p.valueNode):null]})},"SelectItemText")),jk="SelectItemIndicator",Sk=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,...c}=a;return dj(jk,o).isSelected?s.jsx(He.span,{"aria-hidden":!0,...c,ref:l}):null},"SelectItemIndicator")),Ck="SelectBubbleInput",Nk=h.forwardRef(mt(function({__scopeSelect:a,...l},o){const c=hs(Ck,a),{value:u,onValueChange:f,required:p,disabled:g,name:v,autoComplete:x,form:y}=c,{nativeOptions:b,nativeSelectKey:w}=c,N=h.useRef(null),S=Fe(o,N),C=u??"",R=sj(C),D=Array.from(b).some(A=>(A.props.value??"")==="");return h.useEffect(()=>{const A=N.current;if(!A)return;const M=window.HTMLSelectElement.prototype,E=Object.getOwnPropertyDescriptor(M,"value").set;if(R!==C&&E){const z=new Event("change",{bubbles:!0});E.call(A,C),A.dispatchEvent(z)}},[R,C]),s.jsxs(He.select,{"aria-hidden":!0,required:p,tabIndex:-1,name:v,autoComplete:x,disabled:g,form:y,onChange:A=>f(A.target.value),...l,style:{...lj,...l.style},ref:S,defaultValue:C,children:[Ci(u)&&!D?s.jsx("option",{value:""}):null,Array.from(b)]},w)},"SelectBubbleInput"));function hj(n){return typeof n=="function"}mt(hj,"isFunction");function Ci(n){return n===""||n===void 0}mt(Ci,"shouldShowPlaceholder");function Ap(n){const a=ma(n),l=h.useRef(""),o=h.useRef(0),c=h.useCallback(f=>{const p=l.current+f;a(p),mt((function g(v){l.current=v,window.clearTimeout(o.current),v!==""&&(o.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(p)},[a]),u=h.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,u]}mt(Ap,"useTypeaheadSearch");function Mp(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=mj(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}mt(Mp,"findNextItem");function mj(n,a){return n.map((l,o)=>n[(a+o)%n.length])}mt(mj,"wrapArray");const zn=ak,Ln=lk,jn=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(ij,{ref:o,className:Ce("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n),...l,children:[a,s.jsx(ok,{asChild:!0,children:s.jsx(V0,{className:"h-4 w-4 opacity-50"})})]}));jn.displayName=ij.displayName;const Sn=h.forwardRef(({className:n,children:a,position:l="popper",...o},c)=>s.jsx(dk,{children:s.jsx(cj,{ref:c,className:Ce("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",n),position:l,...o,children:s.jsx(xk,{className:Ce("p-1",l==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:a})})}));Sn.displayName=cj.displayName;const nt=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(fj,{ref:o,className:Ce("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...l,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Sk,{children:s.jsx(Bm,{className:"h-4 w-4"})})}),s.jsx(wk,{children:a})]}));nt.displayName=fj.displayName;var Ek=Object.defineProperty,ds=(n,a)=>Ek(n,"name",{value:a,configurable:!0}),Dp="Switch",[Rk,j5]=Hn(Dp),[Tk,Op]=Rk(Dp);function pj(n){const{__scopeSwitch:a,checked:l,children:o,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=Ia({prop:l,defaultProp:c??!1,onChange:g,caller:Dp}),[N,S]=h.useState(null),[C,R]=h.useState(null),D=h.useRef(!1),[A,M]=h.useReducer(z=>z+1,0),O=N?!!f||!!N.closest("form"):!0,E={checked:b,setChecked:w,disabled:u,control:N,setControl:S,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:D,userInteractionCount:A,onUserInteraction:M,required:v,defaultChecked:c,isFormControl:O,bubbleInput:C,setBubbleInput:R};return s.jsx(Tk,{scope:a,...E,children:vj(y)?y(E):o})}ds(pj,"SwitchProvider");var Ak="SwitchTrigger",Mk=h.forwardRef(ds(function({__scopeSwitch:a,onClick:l,...o},c){const{control:u,form:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:N,isFormControl:S,bubbleInput:C}=Op(Ak,a),R=Fe(c,y),D=h.useRef(v);return h.useEffect(()=>{const A=f?u==null?void 0:u.ownerDocument.getElementById(f):u==null?void 0:u.form;if(A instanceof HTMLFormElement){const M=ds(()=>b(D.current),"reset");return A.addEventListener("reset",M),()=>A.removeEventListener("reset",M)}},[u,f,b]),s.jsx(He.button,{type:"button",role:"switch","aria-checked":v,"aria-required":x,"data-state":kp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...o,ref:R,onClick:Se(l,A=>{N(),b(M=>!M),C&&S&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"SwitchTrigger")),gj=h.forwardRef(ds(function(a,l){const{__scopeSwitch:o,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return s.jsx(pj,{__scopeSwitch:o,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(Mk,{...b,ref:l,__scopeSwitch:o}),w&&s.jsx(_k,{__scopeSwitch:o})]})})},"Switch")),Dk="SwitchThumb",Ok=h.forwardRef(ds(function(a,l){const{__scopeSwitch:o,...c}=a,u=Op(Dk,o);return s.jsx(He.span,{"data-state":kp(u.checked),"data-disabled":u.disabled?"":void 0,...c,ref:l})},"SwitchThumb")),kk="SwitchBubbleInput",_k=h.forwardRef(ds(function({__scopeSwitch:a,onClick:l,...o},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:N,bubbleInput:S,setBubbleInput:C}=Op(kk,a),R=Fe(c,C),D=qu(u),A=h.useRef(!1),M=h.useRef(g),O=h.useRef(p);h.useEffect(()=>{const z=S;if(!z)return;const k=window.HTMLInputElement.prototype,Z=Object.getOwnPropertyDescriptor(k,"checked").set,ee=p!==O.current;O.current=p;const V=M.current!==g;M.current=g;const ce=!(ee&&f.current);if(V&&Z){A.current=!ee;const se=new Event("click",{bubbles:ce});Z.call(z,g),z.dispatchEvent(se),A.current=!1}},[S,g,f,p]);const E=h.useRef(g);return s.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??E.current,required:x,disabled:y,name:b,value:w,form:N,...o,tabIndex:-1,ref:R,onClick:Se(l,z=>{A.current&&z.stopPropagation()}),style:{...o.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function vj(n){return typeof n=="function"}ds(vj,"isFunction");function kp(n){return n?"checked":"unchecked"}ds(kp,"getState");const Ha=h.forwardRef(({className:n,...a},l)=>s.jsx(gj,{className:Ce("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",n),...a,ref:l,children:s.jsx(Ok,{className:Ce("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Ha.displayName=gj.displayName;function zk(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return h.useMemo(()=>o=>{a.forEach(c=>c(o))},a)}const Ju=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function no(n){const a=Object.prototype.toString.call(n);return a==="[object Window]"||a==="[object global]"}function _p(n){return"nodeType"in n}function qn(n){var a,l;return n?no(n)?n:_p(n)&&(a=(l=n.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function zp(n){const{Document:a}=qn(n);return n instanceof a}function Ni(n){return no(n)?!1:n instanceof qn(n).HTMLElement}function xj(n){return n instanceof qn(n).SVGElement}function ao(n){return n?no(n)?n.document:_p(n)?zp(n)?n:Ni(n)||xj(n)?n.ownerDocument:document:document:document}const qa=Ju?h.useLayoutEffect:h.useEffect;function Lp(n){const a=h.useRef(n);return qa(()=>{a.current=n}),h.useCallback(function(){for(var l=arguments.length,o=new Array(l),c=0;c<l;c++)o[c]=arguments[c];return a.current==null?void 0:a.current(...o)},[])}function Lk(){const n=h.useRef(null),a=h.useCallback((o,c)=>{n.current=setInterval(o,c)},[]),l=h.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[a,l]}function ui(n,a){a===void 0&&(a=[n]);const l=h.useRef(n);return qa(()=>{l.current!==n&&(l.current=n)},a),l}function Ei(n,a){const l=h.useRef();return h.useMemo(()=>{const o=n(l.current);return l.current=o,o},[...a])}function ju(n){const a=Lp(n),l=h.useRef(null),o=h.useCallback(c=>{c!==l.current&&(a==null||a(c,l.current)),l.current=c},[]);return[l,o]}function hm(n){const a=h.useRef();return h.useEffect(()=>{a.current=n},[n]),a.current}let Uh={};function Ri(n,a){return h.useMemo(()=>{if(a)return a;const l=Uh[n]==null?0:Uh[n]+1;return Uh[n]=l,n+"-"+l},[n,a])}function yj(n){return function(a){for(var l=arguments.length,o=new Array(l>1?l-1:0),c=1;c<l;c++)o[c-1]=arguments[c];return o.reduce((u,f)=>{const p=Object.entries(f);for(const[g,v]of p){const x=u[g];x!=null&&(u[g]=x+n*v)}return u},{...a})}}const ql=yj(1),di=yj(-1);function Uk(n){return"clientX"in n&&"clientY"in n}function Up(n){if(!n)return!1;const{KeyboardEvent:a}=qn(n.target);return a&&n instanceof a}function Ik(n){if(!n)return!1;const{TouchEvent:a}=qn(n.target);return a&&n instanceof a}function mm(n){if(Ik(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 Uk(n)?{x:n.clientX,y:n.clientY}:null}const Su=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[Su.Translate.toString(n),Su.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:a,duration:l,easing:o}=n;return a+" "+l+"ms "+o}}}),Kb="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Pk(n){return n.matches(Kb)?n:n.querySelector(Kb)}const Bk={display:"none"};function Hk(n){let{id:a,value:l}=n;return me.createElement("div",{id:a,style:Bk},l)}function qk(n){let{id:a,announcement:l,ariaLiveType:o="assertive"}=n;const c={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return me.createElement("div",{id:a,style:c,role:"status","aria-live":o,"aria-atomic":!0},l)}function $k(){const[n,a]=h.useState("");return{announce:h.useCallback(o=>{o!=null&&a(o)},[]),announcement:n}}const bj=h.createContext(null);function Vk(n){const a=h.useContext(bj);h.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(n)},[n,a])}function Gk(){const[n]=h.useState(()=>new Set),a=h.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[h.useCallback(o=>{let{type:c,event:u}=o;n.forEach(f=>{var p;return(p=f[c])==null?void 0:p.call(f,u)})},[n]),a]}const Yk={draggable:`
|
|
382
|
-
To pick up a draggable item, press the space bar.
|
|
383
|
-
While dragging, use the arrow keys to move the item.
|
|
384
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
385
|
-
`},Fk={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 Xk(n){let{announcements:a=Fk,container:l,hiddenTextDescribedById:o,screenReaderInstructions:c=Yk}=n;const{announce:u,announcement:f}=$k(),p=Ri("DndLiveRegion"),[g,v]=h.useState(!1);if(h.useEffect(()=>{v(!0)},[]),Vk(h.useMemo(()=>({onDragStart(y){let{active:b}=y;u(a.onDragStart({active:b}))},onDragMove(y){let{active:b,over:w}=y;a.onDragMove&&u(a.onDragMove({active:b,over:w}))},onDragOver(y){let{active:b,over:w}=y;u(a.onDragOver({active:b,over:w}))},onDragEnd(y){let{active:b,over:w}=y;u(a.onDragEnd({active:b,over:w}))},onDragCancel(y){let{active:b,over:w}=y;u(a.onDragCancel({active:b,over:w}))}}),[u,a])),!g)return null;const x=me.createElement(me.Fragment,null,me.createElement(Hk,{id:o,value:c.draggable}),me.createElement(qk,{id:p,announcement:f}));return l?Sa.createPortal(x,l):x}var Ft;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(Ft||(Ft={}));function Cu(){}function Vl(n,a){return h.useMemo(()=>({sensor:n,options:a??{}}),[n,a])}function Ip(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return h.useMemo(()=>[...a].filter(o=>o!=null),[...a])}const Ea=Object.freeze({x:0,y:0});function wj(n,a){return Math.sqrt(Math.pow(n.x-a.x,2)+Math.pow(n.y-a.y,2))}function jj(n,a){let{data:{value:l}}=n,{data:{value:o}}=a;return l-o}function Kk(n,a){let{data:{value:l}}=n,{data:{value:o}}=a;return o-l}function Qb(n){let{left:a,top:l,height:o,width:c}=n;return[{x:a,y:l},{x:a+c,y:l},{x:a,y:l+o},{x:a+c,y:l+o}]}function Sj(n,a){if(!n||n.length===0)return null;const[l]=n;return l[a]}function Zb(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 Pp=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=Zb(a,a.left,a.top),u=[];for(const f of o){const{id:p}=f,g=l.get(p);if(g){const v=wj(Zb(g),c);u.push({id:p,data:{droppableContainer:f,value:v}})}}return u.sort(jj)},Qk=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=Qb(a),u=[];for(const f of o){const{id:p}=f,g=l.get(p);if(g){const v=Qb(g),x=c.reduce((b,w,N)=>b+wj(v[N],w),0),y=Number((x/4).toFixed(4));u.push({id:p,data:{droppableContainer:f,value:y}})}}return u.sort(jj)};function Zk(n,a){const l=Math.max(a.top,n.top),o=Math.max(a.left,n.left),c=Math.min(a.left+a.width,n.left+n.width),u=Math.min(a.top+a.height,n.top+n.height),f=c-o,p=u-l;if(o<c&&l<u){const g=a.width*a.height,v=n.width*n.height,x=f*p,y=x/(g+v-x);return Number(y.toFixed(4))}return 0}const Jk=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=[];for(const u of o){const{id:f}=u,p=l.get(f);if(p){const g=Zk(p,a);g>0&&c.push({id:f,data:{droppableContainer:u,value:g}})}}return c.sort(Kk)};function Wk(n,a,l){return{...n,scaleX:a&&l?a.width/l.width:1,scaleY:a&&l?a.height/l.height:1}}function Cj(n,a){return n&&a?{x:n.left-a.left,y:n.top-a.top}:Ea}function e3(n){return function(l){for(var o=arguments.length,c=new Array(o>1?o-1:0),u=1;u<o;u++)c[u-1]=arguments[u];return c.reduce((f,p)=>({...f,top:f.top+n*p.y,bottom:f.bottom+n*p.y,left:f.left+n*p.x,right:f.right+n*p.x}),{...l})}}const t3=e3(1);function n3(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 a3(n,a,l){const o=n3(a);if(!o)return n;const{scaleX:c,scaleY:u,x:f,y:p}=o,g=n.left-f-(1-c)*parseFloat(l),v=n.top-p-(1-u)*parseFloat(l.slice(l.indexOf(" ")+1)),x=c?n.width/c:n.width,y=u?n.height/u:n.height;return{width:x,height:y,top:v,right:g+x,bottom:v+y,left:g}}const r3={ignoreTransform:!1};function ro(n,a){a===void 0&&(a=r3);let l=n.getBoundingClientRect();if(a.ignoreTransform){const{transform:v,transformOrigin:x}=qn(n).getComputedStyle(n);v&&(l=a3(l,v,x))}const{top:o,left:c,width:u,height:f,bottom:p,right:g}=l;return{top:o,left:c,width:u,height:f,bottom:p,right:g}}function Jb(n){return ro(n,{ignoreTransform:!0})}function s3(n){const a=n.innerWidth,l=n.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function l3(n,a){return a===void 0&&(a=qn(n).getComputedStyle(n)),a.position==="fixed"}function o3(n,a){a===void 0&&(a=qn(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 Wu(n,a){const l=[];function o(c){if(a!=null&&l.length>=a||!c)return l;if(zp(c)&&c.scrollingElement!=null&&!l.includes(c.scrollingElement))return l.push(c.scrollingElement),l;if(!Ni(c)||xj(c)||l.includes(c))return l;const u=qn(n).getComputedStyle(c);return c!==n&&o3(c,u)&&l.push(c),l3(c,u)?l:o(c.parentNode)}return n?o(n):l}function Nj(n){const[a]=Wu(n,1);return a??null}function Ih(n){return!Ju||!n?null:no(n)?n:_p(n)?zp(n)||n===ao(n).scrollingElement?window:Ni(n)?n:null:null}function Ej(n){return no(n)?n.scrollX:n.scrollLeft}function Rj(n){return no(n)?n.scrollY:n.scrollTop}function pm(n){return{x:Ej(n),y:Rj(n)}}var an;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(an||(an={}));function Tj(n){return!Ju||!n?!1:n===document.scrollingElement}function Aj(n){const a={x:0,y:0},l=Tj(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-l.width,y:n.scrollHeight-l.height},c=n.scrollTop<=a.y,u=n.scrollLeft<=a.x,f=n.scrollTop>=o.y,p=n.scrollLeft>=o.x;return{isTop:c,isLeft:u,isBottom:f,isRight:p,maxScroll:o,minScroll:a}}const i3={x:.2,y:.2};function c3(n,a,l,o,c){let{top:u,left:f,right:p,bottom:g}=l;o===void 0&&(o=10),c===void 0&&(c=i3);const{isTop:v,isBottom:x,isLeft:y,isRight:b}=Aj(n),w={x:0,y:0},N={x:0,y:0},S={height:a.height*c.y,width:a.width*c.x};return!v&&u<=a.top+S.height?(w.y=an.Backward,N.y=o*Math.abs((a.top+S.height-u)/S.height)):!x&&g>=a.bottom-S.height&&(w.y=an.Forward,N.y=o*Math.abs((a.bottom-S.height-g)/S.height)),!b&&p>=a.right-S.width?(w.x=an.Forward,N.x=o*Math.abs((a.right-S.width-p)/S.width)):!y&&f<=a.left+S.width&&(w.x=an.Backward,N.x=o*Math.abs((a.left+S.width-f)/S.width)),{direction:w,speed:N}}function u3(n){if(n===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:a,left:l,right:o,bottom:c}=n.getBoundingClientRect();return{top:a,left:l,right:o,bottom:c,width:n.clientWidth,height:n.clientHeight}}function Mj(n){return n.reduce((a,l)=>ql(a,pm(l)),Ea)}function d3(n){return n.reduce((a,l)=>a+Ej(l),0)}function f3(n){return n.reduce((a,l)=>a+Rj(l),0)}function h3(n,a){if(a===void 0&&(a=ro),!n)return;const{top:l,left:o,bottom:c,right:u}=a(n);Nj(n)&&(c<=0||u<=0||l>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const m3=[["x",["left","right"],d3],["y",["top","bottom"],f3]];class Bp{constructor(a,l){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Wu(l),c=Mj(o);this.rect={...a},this.width=a.width,this.height=a.height;for(const[u,f,p]of m3)for(const g of f)Object.defineProperty(this,g,{get:()=>{const v=p(o),x=c[u]-v;return this.rect[g]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ni{constructor(a){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(l=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...l)})},this.target=a}add(a,l,o){var c;(c=this.target)==null||c.addEventListener(a,l,o),this.listeners.push([a,l,o])}}function p3(n){const{EventTarget:a}=qn(n);return n instanceof a?n:ao(n)}function Ph(n,a){const l=Math.abs(n.x),o=Math.abs(n.y);return typeof a=="number"?Math.sqrt(l**2+o**2)>a:"x"in a&&"y"in a?l>a.x&&o>a.y:"x"in a?l>a.x:"y"in a?o>a.y:!1}var da;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(da||(da={}));function Wb(n){n.preventDefault()}function g3(n){n.stopPropagation()}var Ke;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(Ke||(Ke={}));const Dj={start:[Ke.Space,Ke.Enter],cancel:[Ke.Esc],end:[Ke.Space,Ke.Enter,Ke.Tab]},v3=(n,a)=>{let{currentCoordinates:l}=a;switch(n.code){case Ke.Right:return{...l,x:l.x+25};case Ke.Left:return{...l,x:l.x-25};case Ke.Down:return{...l,y:l.y+25};case Ke.Up:return{...l,y:l.y-25}}};class Ti{constructor(a){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=a;const{event:{target:l}}=a;this.props=a,this.listeners=new ni(ao(l)),this.windowListeners=new ni(qn(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(da.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:l}=this.props,o=a.node.current;o&&h3(o),l(Ea)}handleKeyDown(a){if(Up(a)){const{active:l,context:o,options:c}=this.props,{keyboardCodes:u=Dj,coordinateGetter:f=v3,scrollBehavior:p="smooth"}=c,{code:g}=a;if(u.end.includes(g)){this.handleEnd(a);return}if(u.cancel.includes(g)){this.handleCancel(a);return}const{collisionRect:v}=o.current,x=v?{x:v.left,y:v.top}:Ea;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:l,context:o.current,currentCoordinates:x});if(y){const b=di(y,x),w={x:0,y:0},{scrollableAncestors:N}=o.current;for(const S of N){const C=a.code,{isTop:R,isRight:D,isLeft:A,isBottom:M,maxScroll:O,minScroll:E}=Aj(S),z=u3(S),k={x:Math.min(C===Ke.Right?z.right-z.width/2:z.right,Math.max(C===Ke.Right?z.left:z.left+z.width/2,y.x)),y:Math.min(C===Ke.Down?z.bottom-z.height/2:z.bottom,Math.max(C===Ke.Down?z.top:z.top+z.height/2,y.y))},P=C===Ke.Right&&!D||C===Ke.Left&&!A,Z=C===Ke.Down&&!M||C===Ke.Up&&!R;if(P&&k.x!==y.x){const ee=S.scrollLeft+b.x,V=C===Ke.Right&&ee<=O.x||C===Ke.Left&&ee>=E.x;if(V&&!b.y){S.scrollTo({left:ee,behavior:p});return}V?w.x=S.scrollLeft-ee:w.x=C===Ke.Right?S.scrollLeft-O.x:S.scrollLeft-E.x,w.x&&S.scrollBy({left:-w.x,behavior:p});break}else if(Z&&k.y!==y.y){const ee=S.scrollTop+b.y,V=C===Ke.Down&&ee<=O.y||C===Ke.Up&&ee>=E.y;if(V&&!b.x){S.scrollTo({top:ee,behavior:p});return}V?w.y=S.scrollTop-ee:w.y=C===Ke.Down?S.scrollTop-O.y:S.scrollTop-E.y,w.y&&S.scrollBy({top:-w.y,behavior:p});break}}this.handleMove(a,ql(di(y,this.referenceCoordinates),w))}}}handleMove(a,l){const{onMove:o}=this.props;a.preventDefault(),o(l)}handleEnd(a){const{onEnd:l}=this.props;a.preventDefault(),this.detach(),l()}handleCancel(a){const{onCancel:l}=this.props;a.preventDefault(),this.detach(),l()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ti.activators=[{eventName:"onKeyDown",handler:(n,a,l)=>{let{keyboardCodes:o=Dj,onActivation:c}=a,{active:u}=l;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const p=u.activatorNode.current;return p&&n.target!==p?!1:(n.preventDefault(),c==null||c({event:n.nativeEvent}),!0)}return!1}}];function e0(n){return!!(n&&"distance"in n)}function t0(n){return!!(n&&"delay"in n)}class Hp{constructor(a,l,o){var c;o===void 0&&(o=p3(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=ao(f),this.documentListeners=new ni(this.document),this.listeners=new ni(o),this.windowListeners=new ni(qn(f)),this.initialCoordinates=(c=mm(u))!=null?c:Ea,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:a,props:{options:{activationConstraint:l,bypassActivationConstraint:o}}}=this;if(this.listeners.add(a.move.name,this.handleMove,{passive:!1}),this.listeners.add(a.end.name,this.handleEnd),a.cancel&&this.listeners.add(a.cancel.name,this.handleCancel),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.DragStart,Wb),this.windowListeners.add(da.VisibilityChange,this.handleCancel),this.windowListeners.add(da.ContextMenu,Wb),this.documentListeners.add(da.Keydown,this.handleKeydown),l){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(t0(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(e0(l)){this.handlePending(l);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(a,l){const{active:o,onPending:c}=this.props;c(o,a,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:a}=this,{onStart:l}=this.props;a&&(this.activated=!0,this.documentListeners.add(da.Click,g3,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(da.SelectionChange,this.removeTextSelection),l(a))}handleMove(a){var l;const{activated:o,initialCoordinates:c,props:u}=this,{onMove:f,options:{activationConstraint:p}}=u;if(!c)return;const g=(l=mm(a))!=null?l:Ea,v=di(c,g);if(!o&&p){if(e0(p)){if(p.tolerance!=null&&Ph(v,p.tolerance))return this.handleCancel();if(Ph(v,p.distance))return this.handleStart()}if(t0(p)&&Ph(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===Ke.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const x3={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ai extends Hp{constructor(a){const{event:l}=a,o=ao(l.target);super(a,x3,o)}}Ai.activators=[{eventName:"onPointerDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;return!l.isPrimary||l.button!==0?!1:(o==null||o({event:l}),!0)}}];const y3={move:{name:"mousemove"},end:{name:"mouseup"}};var gm;(function(n){n[n.RightClick=2]="RightClick"})(gm||(gm={}));class b3 extends Hp{constructor(a){super(a,y3,ao(a.event.target))}}b3.activators=[{eventName:"onMouseDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;return l.button===gm.RightClick?!1:(o==null||o({event:l}),!0)}}];const Bh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class w3 extends Hp{constructor(a){super(a,Bh)}static setup(){return window.addEventListener(Bh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Bh.move.name,a)};function a(){}}}w3.activators=[{eventName:"onTouchStart",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;const{touches:c}=l;return c.length>1?!1:(o==null||o({event:l}),!0)}}];var ai;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(ai||(ai={}));var Nu;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Nu||(Nu={}));function j3(n){let{acceleration:a,activator:l=ai.Pointer,canScroll:o,draggingRect:c,enabled:u,interval:f=5,order:p=Nu.TreeOrder,pointerCoordinates:g,scrollableAncestors:v,scrollableAncestorRects:x,delta:y,threshold:b}=n;const w=C3({delta:y,disabled:!u}),[N,S]=Lk(),C=h.useRef({x:0,y:0}),R=h.useRef({x:0,y:0}),D=h.useMemo(()=>{switch(l){case ai.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case ai.DraggableRect:return c}},[l,c,g]),A=h.useRef(null),M=h.useCallback(()=>{const E=A.current;if(!E)return;const z=C.current.x*R.current.x,k=C.current.y*R.current.y;E.scrollBy(z,k)},[]),O=h.useMemo(()=>p===Nu.TreeOrder?[...v].reverse():v,[p,v]);h.useEffect(()=>{if(!u||!v.length||!D){S();return}for(const E of O){if((o==null?void 0:o(E))===!1)continue;const z=v.indexOf(E),k=x[z];if(!k)continue;const{direction:P,speed:Z}=c3(E,k,D,a,b);for(const ee of["x","y"])w[ee][P[ee]]||(Z[ee]=0,P[ee]=0);if(Z.x>0||Z.y>0){S(),A.current=E,N(M,f),C.current=Z,R.current=P;return}}C.current={x:0,y:0},R.current={x:0,y:0},S()},[a,M,o,S,u,f,JSON.stringify(D),JSON.stringify(w),N,v,O,x,JSON.stringify(b)])}const S3={x:{[an.Backward]:!1,[an.Forward]:!1},y:{[an.Backward]:!1,[an.Forward]:!1}};function C3(n){let{delta:a,disabled:l}=n;const o=hm(a);return Ei(c=>{if(l||!o||!c)return S3;const u={x:Math.sign(a.x-o.x),y:Math.sign(a.y-o.y)};return{x:{[an.Backward]:c.x[an.Backward]||u.x===-1,[an.Forward]:c.x[an.Forward]||u.x===1},y:{[an.Backward]:c.y[an.Backward]||u.y===-1,[an.Forward]:c.y[an.Forward]||u.y===1}}},[l,a,o])}function N3(n,a){const l=a!=null?n.get(a):void 0,o=l?l.node.current:null;return Ei(c=>{var u;return a==null?null:(u=o??c)!=null?u:null},[o,a])}function E3(n,a){return h.useMemo(()=>n.reduce((l,o)=>{const{sensor:c}=o,u=c.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,o)}));return[...l,...u]},[]),[n,a])}var fi;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(fi||(fi={}));var vm;(function(n){n.Optimized="optimized"})(vm||(vm={}));const n0=new Map;function R3(n,a){let{dragging:l,dependencies:o,config:c}=a;const[u,f]=h.useState(null),{frequency:p,measure:g,strategy:v}=c,x=h.useRef(n),y=C(),b=ui(y),w=h.useCallback(function(R){R===void 0&&(R=[]),!b.current&&f(D=>D===null?R:D.concat(R.filter(A=>!D.includes(A))))},[b]),N=h.useRef(null),S=Ei(R=>{if(y&&!l)return n0;if(!R||R===n0||x.current!==n||u!=null){const D=new Map;for(let A of n){if(!A)continue;if(u&&u.length>0&&!u.includes(A.id)&&A.rect.current){D.set(A.id,A.rect.current);continue}const M=A.node.current,O=M?new Bp(g(M),M):null;A.rect.current=O,O&&D.set(A.id,O)}return D}return R},[n,u,l,y,g]);return h.useEffect(()=>{x.current=n},[n]),h.useEffect(()=>{y||w()},[l,y]),h.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),h.useEffect(()=>{y||typeof p!="number"||N.current!==null||(N.current=setTimeout(()=>{w(),N.current=null},p))},[p,y,w,...o]),{droppableRects:S,measureDroppableContainers:w,measuringScheduled:u!=null};function C(){switch(v){case fi.Always:return!1;case fi.BeforeDragging:return l;default:return!l}}}function Oj(n,a){return Ei(l=>n?l||(typeof a=="function"?a(n):n):null,[a,n])}function T3(n,a){return Oj(n,a)}function A3(n){let{callback:a,disabled:l}=n;const o=Lp(a),c=h.useMemo(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,l]);return h.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function ed(n){let{callback:a,disabled:l}=n;const o=Lp(a),c=h.useMemo(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[l]);return h.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function M3(n){return new Bp(ro(n),n)}function a0(n,a,l){a===void 0&&(a=M3);const[o,c]=h.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=A3({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=ed({callback:u});return qa(()=>{u(),n?(p==null||p.observe(n),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(p==null||p.disconnect(),f==null||f.disconnect())},[n]),o}function D3(n){const a=Oj(n);return Cj(n,a)}const r0=[];function O3(n){const a=h.useRef(n),l=Ei(o=>n?o&&o!==r0&&n&&a.current&&n.parentNode===a.current.parentNode?o:Wu(n):r0,[n]);return h.useEffect(()=>{a.current=n},[n]),l}function k3(n){const[a,l]=h.useState(null),o=h.useRef(n),c=h.useCallback(u=>{const f=Ih(u.target);f&&l(p=>p?(p.set(f,pm(f)),new Map(p)):null)},[]);return h.useEffect(()=>{const u=o.current;if(n!==u){f(u);const p=n.map(g=>{const v=Ih(g);return v?(v.addEventListener("scroll",c,{passive:!0}),[v,pm(v)]):null}).filter(g=>g!=null);l(p.length?new Map(p):null),o.current=n}return()=>{f(n),f(u)};function f(p){p.forEach(g=>{const v=Ih(g);v==null||v.removeEventListener("scroll",c)})}},[c,n]),h.useMemo(()=>n.length?a?Array.from(a.values()).reduce((u,f)=>ql(u,f),Ea):Mj(n):Ea,[n,a])}function s0(n,a){a===void 0&&(a=[]);const l=h.useRef(null);return h.useEffect(()=>{l.current=null},a),h.useEffect(()=>{const o=n!==Ea;o&&!l.current&&(l.current=n),!o&&l.current&&(l.current=null)},[n]),l.current?di(n,l.current):Ea}function _3(n){h.useEffect(()=>{if(!Ju)return;const a=n.map(l=>{let{sensor:o}=l;return o.setup==null?void 0:o.setup()});return()=>{for(const l of a)l==null||l()}},n.map(a=>{let{sensor:l}=a;return l}))}function z3(n,a){return h.useMemo(()=>n.reduce((l,o)=>{let{eventName:c,handler:u}=o;return l[c]=f=>{u(f,a)},l},{}),[n,a])}function kj(n){return h.useMemo(()=>n?s3(n):null,[n])}const l0=[];function L3(n,a){a===void 0&&(a=ro);const[l]=n,o=kj(l?qn(l):null),[c,u]=h.useState(l0);function f(){u(()=>n.length?n.map(g=>Tj(g)?o:new Bp(a(g),g)):l0)}const p=ed({callback:f});return qa(()=>{p==null||p.disconnect(),f(),n.forEach(g=>p==null?void 0:p.observe(g))},[n]),c}function U3(n){if(!n)return null;if(n.children.length>1)return n;const a=n.children[0];return Ni(a)?a:n}function I3(n){let{measure:a}=n;const[l,o]=h.useState(null),c=h.useCallback(v=>{for(const{target:x}of v)if(Ni(x)){o(y=>{const b=a(x);return y?{...y,width:b.width,height:b.height}:b});break}},[a]),u=ed({callback:c}),f=h.useCallback(v=>{const x=U3(v);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?a(x):null)},[a,u]),[p,g]=ju(f);return h.useMemo(()=>({nodeRef:p,rect:l,setRef:g}),[l,p,g])}const P3=[{sensor:Ai,options:{}},{sensor:Ti,options:{}}],B3={current:{}},fu={draggable:{measure:Jb},droppable:{measure:Jb,strategy:fi.WhileDragging,frequency:vm.Optimized},dragOverlay:{measure:ro}};class ri extends Map{get(a){var l;return a!=null&&(l=super.get(a))!=null?l:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(a=>{let{disabled:l}=a;return!l})}getNodeFor(a){var l,o;return(l=(o=this.get(a))==null?void 0:o.node.current)!=null?l:void 0}}const H3={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ri,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Cu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fu,measureDroppableContainers:Cu,windowRect:null,measuringScheduled:!1},q3={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Cu,draggableNodes:new Map,over:null,measureDroppableContainers:Cu},td=h.createContext(q3),_j=h.createContext(H3);function $3(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ri}}}function V3(n,a){switch(a.type){case Ft.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case Ft.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:a.coordinates.x-n.draggable.initialCoordinates.x,y:a.coordinates.y-n.draggable.initialCoordinates.y}}};case Ft.DragEnd:case Ft.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ft.RegisterDroppable:{const{element:l}=a,{id:o}=l,c=new ri(n.droppable.containers);return c.set(o,l),{...n,droppable:{...n.droppable,containers:c}}}case Ft.SetDroppableDisabled:{const{id:l,key:o,disabled:c}=a,u=n.droppable.containers.get(l);if(!u||o!==u.key)return n;const f=new ri(n.droppable.containers);return f.set(l,{...u,disabled:c}),{...n,droppable:{...n.droppable,containers:f}}}case Ft.UnregisterDroppable:{const{id:l,key:o}=a,c=n.droppable.containers.get(l);if(!c||o!==c.key)return n;const u=new ri(n.droppable.containers);return u.delete(l),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function G3(n){let{disabled:a}=n;const{active:l,activatorEvent:o,draggableNodes:c}=h.useContext(td),u=hm(o),f=hm(l==null?void 0:l.id);return h.useEffect(()=>{if(!a&&!o&&u&&f!=null){if(!Up(u)||document.activeElement===u.target)return;const p=c.get(f);if(!p)return;const{activatorNode:g,node:v}=p;if(!g.current&&!v.current)return;requestAnimationFrame(()=>{for(const x of[g.current,v.current]){if(!x)continue;const y=Pk(x);if(y){y.focus();break}}})}},[o,a,c,f,u]),null}function Y3(n,a){let{transform:l,...o}=a;return n!=null&&n.length?n.reduce((c,u)=>u({transform:c,...o}),l):l}function F3(n){return h.useMemo(()=>({draggable:{...fu.draggable,...n==null?void 0:n.draggable},droppable:{...fu.droppable,...n==null?void 0:n.droppable},dragOverlay:{...fu.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function X3(n){let{activeNode:a,measure:l,initialRect:o,config:c=!0}=n;const u=h.useRef(!1),{x:f,y:p}=typeof c=="boolean"?{x:c,y:c}:c;qa(()=>{if(!f&&!p||!a){u.current=!1;return}if(u.current||!o)return;const v=a==null?void 0:a.node.current;if(!v||v.isConnected===!1)return;const x=l(v),y=Cj(x,o);if(f||(y.x=0),p||(y.y=0),u.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const b=Nj(v);b&&b.scrollBy({top:y.y,left:y.x})}},[a,f,p,o,l])}const zj=h.createContext({...Ea,scaleX:1,scaleY:1});var ss;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(ss||(ss={}));const qp=h.memo(function(a){var l,o,c,u;let{id:f,accessibility:p,autoScroll:g=!0,children:v,sensors:x=P3,collisionDetection:y=Jk,measuring:b,modifiers:w,...N}=a;const S=h.useReducer(V3,void 0,$3),[C,R]=S,[D,A]=Gk(),[M,O]=h.useState(ss.Uninitialized),E=M===ss.Initialized,{draggable:{active:z,nodes:k,translate:P},droppable:{containers:Z}}=C,ee=z!=null?k.get(z):null,V=h.useRef({initial:null,translated:null}),ce=h.useMemo(()=>{var xt;return z!=null?{id:z,data:(xt=ee==null?void 0:ee.data)!=null?xt:B3,rect:V}:null},[z,ee]),se=h.useRef(null),[H,_]=h.useState(null),[q,W]=h.useState(null),Q=ui(N,Object.values(N)),te=Ri("DndDescribedBy",f),L=h.useMemo(()=>Z.getEnabled(),[Z]),U=F3(b),{droppableRects:Y,measureDroppableContainers:ae,measuringScheduled:ge}=R3(L,{dragging:E,dependencies:[P.x,P.y],config:U.droppable}),ye=N3(k,z),G=h.useMemo(()=>q?mm(q):null,[q]),ue=Ar(),he=T3(ye,U.draggable.measure);X3({activeNode:z!=null?k.get(z):null,config:ue.layoutShiftCompensation,initialRect:he,measure:U.draggable.measure});const xe=a0(ye,U.draggable.measure,he),Ae=a0(ye?ye.parentElement:null),Ne=h.useRef({activatorEvent:null,active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:Z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Oe=Z.getNodeFor((l=Ne.current.over)==null?void 0:l.id),Qe=I3({measure:U.dragOverlay.measure}),et=(o=Qe.nodeRef.current)!=null?o:ye,ie=E?(c=Qe.rect)!=null?c:xe:null,Le=!!(Qe.nodeRef.current&&Qe.rect),qe=D3(Le?null:xe),_t=kj(et?qn(et):null),St=O3(E?Oe??ye:null),Wt=L3(St),mn=Y3(w,{transform:{x:P.x-qe.x,y:P.y-qe.y,scaleX:1,scaleY:1},activatorEvent:q,active:ce,activeNodeRect:xe,containerNodeRect:Ae,draggingNodeRect:ie,over:Ne.current.over,overlayNodeRect:Qe.rect,scrollableAncestors:St,scrollableAncestorRects:Wt,windowRect:_t}),en=G?ql(G,P):null,Ct=k3(St),xn=s0(Ct),At=s0(Ct,[xe]),Mt=ql(mn,xn),pn=ie?t3(ie,mn):null,pa=ce&&pn?y({active:ce,collisionRect:pn,droppableRects:Y,droppableContainers:L,pointerCoordinates:en}):null,Aa=Sj(pa,"id"),[Wn,ms]=h.useState(null),ga=Le?mn:ql(mn,At),Dt=Wk(ga,(u=Wn==null?void 0:Wn.rect)!=null?u:null,xe),yn=h.useRef(null),Tt=h.useCallback((xt,at)=>{let{sensor:It,options:Re}=at;if(se.current==null)return;const _e=k.get(se.current);if(!_e)return;const Ue=xt.nativeEvent,vt=new It({active:se.current,activeNode:_e,event:Ue,options:Re,context:Ne,onAbort(ut){if(!k.get(ut))return;const{onDragAbort:yt}=Q.current,zt={id:ut};yt==null||yt(zt),D({type:"onDragAbort",event:zt})},onPending(ut,Gt,yt,zt){if(!k.get(ut))return;const{onDragPending:Fa}=Q.current,va={id:ut,constraint:Gt,initialCoordinates:yt,offset:zt};Fa==null||Fa(va),D({type:"onDragPending",event:va})},onStart(ut){const Gt=se.current;if(Gt==null)return;const yt=k.get(Gt);if(!yt)return;const{onDragStart:zt}=Q.current,Ya={activatorEvent:Ue,active:{id:Gt,data:yt.data,rect:V}};Sa.unstable_batchedUpdates(()=>{zt==null||zt(Ya),O(ss.Initializing),R({type:Ft.DragStart,initialCoordinates:ut,active:Gt}),D({type:"onDragStart",event:Ya}),_(yn.current),W(Ue)})},onMove(ut){R({type:Ft.DragMove,coordinates:ut})},onEnd:Nt(Ft.DragEnd),onCancel:Nt(Ft.DragCancel)});yn.current=vt;function Nt(ut){return async function(){const{active:yt,collisions:zt,over:Ya,scrollAdjustedTranslate:Fa}=Ne.current;let va=null;if(yt&&Fa){const{cancelDrop:Mr}=Q.current;va={activatorEvent:Ue,active:yt,collisions:zt,delta:Fa,over:Ya},ut===Ft.DragEnd&&typeof Mr=="function"&&await Promise.resolve(Mr(va))&&(ut=Ft.DragCancel)}se.current=null,Sa.unstable_batchedUpdates(()=>{R({type:ut}),O(ss.Uninitialized),ms(null),_(null),W(null),yn.current=null;const Mr=ut===Ft.DragEnd?"onDragEnd":"onDragCancel";if(va){const ea=Q.current[Mr];ea==null||ea(va),D({type:Mr,event:va})}})}}},[k]),lo=h.useCallback((xt,at)=>(It,Re)=>{const _e=It.nativeEvent,Ue=k.get(Re);if(se.current!==null||!Ue||_e.dndKit||_e.defaultPrevented)return;const vt={active:Ue};xt(It,at.options,vt)===!0&&(_e.dndKit={capturedBy:at.sensor},se.current=Re,Tt(It,at))},[k,Tt]),Fs=E3(x,lo);_3(x),qa(()=>{xe&&M===ss.Initializing&&O(ss.Initialized)},[xe,M]),h.useEffect(()=>{const{onDragMove:xt}=Q.current,{active:at,activatorEvent:It,collisions:Re,over:_e}=Ne.current;if(!at||!It)return;const Ue={active:at,activatorEvent:It,collisions:Re,delta:{x:Mt.x,y:Mt.y},over:_e};Sa.unstable_batchedUpdates(()=>{xt==null||xt(Ue),D({type:"onDragMove",event:Ue})})},[Mt.x,Mt.y]),h.useEffect(()=>{const{active:xt,activatorEvent:at,collisions:It,droppableContainers:Re,scrollAdjustedTranslate:_e}=Ne.current;if(!xt||se.current==null||!at||!_e)return;const{onDragOver:Ue}=Q.current,vt=Re.get(Aa),Nt=vt&&vt.rect.current?{id:vt.id,rect:vt.rect.current,data:vt.data,disabled:vt.disabled}:null,ut={active:xt,activatorEvent:at,collisions:It,delta:{x:_e.x,y:_e.y},over:Nt};Sa.unstable_batchedUpdates(()=>{ms(Nt),Ue==null||Ue(ut),D({type:"onDragOver",event:ut})})},[Aa]),qa(()=>{Ne.current={activatorEvent:q,active:ce,activeNode:ye,collisionRect:pn,collisions:pa,droppableRects:Y,draggableNodes:k,draggingNode:et,draggingNodeRect:ie,droppableContainers:Z,over:Wn,scrollableAncestors:St,scrollAdjustedTranslate:Mt},V.current={initial:ie,translated:pn}},[ce,ye,pa,pn,k,et,ie,Y,Z,Wn,St,Mt]),j3({...ue,delta:P,draggingRect:pn,pointerCoordinates:en,scrollableAncestors:St,scrollableAncestorRects:Wt});const Xs=h.useMemo(()=>({active:ce,activeNode:ye,activeNodeRect:xe,activatorEvent:q,collisions:pa,containerNodeRect:Ae,dragOverlay:Qe,draggableNodes:k,droppableContainers:Z,droppableRects:Y,over:Wn,measureDroppableContainers:ae,scrollableAncestors:St,scrollableAncestorRects:Wt,measuringConfiguration:U,measuringScheduled:ge,windowRect:_t}),[ce,ye,xe,q,pa,Ae,Qe,k,Z,Y,Wn,ae,St,Wt,U,ge,_t]),Ga=h.useMemo(()=>({activatorEvent:q,activators:Fs,active:ce,activeNodeRect:xe,ariaDescribedById:{draggable:te},dispatch:R,draggableNodes:k,over:Wn,measureDroppableContainers:ae}),[q,Fs,ce,xe,R,te,k,Wn,ae]);return me.createElement(bj.Provider,{value:A},me.createElement(td.Provider,{value:Ga},me.createElement(_j.Provider,{value:Xs},me.createElement(zj.Provider,{value:Dt},v)),me.createElement(G3,{disabled:(p==null?void 0:p.restoreFocus)===!1})),me.createElement(Xk,{...p,hiddenTextDescribedById:te}));function Ar(){const xt=(H==null?void 0:H.autoScrollEnabled)===!1,at=typeof g=="object"?g.enabled===!1:g===!1,It=E&&!xt&&!at;return typeof g=="object"?{...g,enabled:It}:{enabled:It}}}),K3=h.createContext(null),o0="button",Q3="Draggable";function Z3(n){let{id:a,data:l,disabled:o=!1,attributes:c}=n;const u=Ri(Q3),{activators:f,activatorEvent:p,active:g,activeNodeRect:v,ariaDescribedById:x,draggableNodes:y,over:b}=h.useContext(td),{role:w=o0,roleDescription:N="draggable",tabIndex:S=0}=c??{},C=(g==null?void 0:g.id)===a,R=h.useContext(C?zj:K3),[D,A]=ju(),[M,O]=ju(),E=z3(f,a),z=ui(l);qa(()=>(y.set(a,{id:a,key:u,node:D,activatorNode:M,data:z}),()=>{const P=y.get(a);P&&P.key===u&&y.delete(a)}),[y,a]);const k=h.useMemo(()=>({role:w,tabIndex:S,"aria-disabled":o,"aria-pressed":C&&w===o0?!0:void 0,"aria-roledescription":N,"aria-describedby":x.draggable}),[o,w,S,C,N,x.draggable]);return{active:g,activatorEvent:p,activeNodeRect:v,attributes:k,isDragging:C,listeners:o?void 0:E,node:D,over:b,setNodeRef:A,setActivatorNodeRef:O,transform:R}}function J3(){return h.useContext(_j)}const W3="Droppable",e_={timeout:25};function t_(n){let{data:a,disabled:l=!1,id:o,resizeObserverConfig:c}=n;const u=Ri(W3),{active:f,dispatch:p,over:g,measureDroppableContainers:v}=h.useContext(td),x=h.useRef({disabled:l}),y=h.useRef(!1),b=h.useRef(null),w=h.useRef(null),{disabled:N,updateMeasurementsFor:S,timeout:C}={...e_,...c},R=ui(S??o),D=h.useCallback(()=>{if(!y.current){y.current=!0;return}w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{v(Array.isArray(R.current)?R.current:[R.current]),w.current=null},C)},[C]),A=ed({callback:D,disabled:N||!f}),M=h.useCallback((k,P)=>{A&&(P&&(A.unobserve(P),y.current=!1),k&&A.observe(k))},[A]),[O,E]=ju(M),z=ui(a);return h.useEffect(()=>{!A||!O.current||(A.disconnect(),y.current=!1,A.observe(O.current))},[O,A]),h.useEffect(()=>(p({type:Ft.RegisterDroppable,element:{id:o,key:u,disabled:l,node:O,rect:b,data:z}}),()=>p({type:Ft.UnregisterDroppable,key:u,id:o})),[o]),h.useEffect(()=>{l!==x.current.disabled&&(p({type:Ft.SetDroppableDisabled,id:o,key:u,disabled:l}),x.current.disabled=l)},[o,u,l,p]),{active:f,rect:b,isOver:(g==null?void 0:g.id)===o,node:O,over:g,setNodeRef:E}}function n_(n,a,l){const o={...n};return a.top+n.y<=l.top?o.y=l.top-a.top:a.bottom+n.y>=l.top+l.height&&(o.y=l.top+l.height-a.bottom),a.left+n.x<=l.left?o.x=l.left-a.left:a.right+n.x>=l.left+l.width&&(o.x=l.left+l.width-a.right),o}const $p=n=>{let{containerNodeRect:a,draggingNodeRect:l,transform:o}=n;return!l||!a?o:n_(o,l,a)},Vp=n=>{let{transform:a}=n;return{...a,x:0}};function Mi(n,a,l){const o=n.slice();return o.splice(l<0?o.length+l:l,0,o.splice(a,1)[0]),o}function a_(n,a){return n.reduce((l,o,c)=>{const u=a.get(o);return u&&(l[c]=u),l},Array(n.length))}function Wc(n){return n!==null&&n>=0}function r_(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 s_(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Lj=n=>{let{rects:a,activeIndex:l,overIndex:o,index:c}=n;const u=Mi(a,o,l),f=a[c],p=u[c];return!p||!f?null:{x:p.left-f.left,y:p.top-f.top,scaleX:p.width/f.width,scaleY:p.height/f.height}},eu={scaleX:1,scaleY:1},Gp=n=>{var a;let{activeIndex:l,activeNodeRect:o,index:c,rects:u,overIndex:f}=n;const p=(a=u[l])!=null?a:o;if(!p)return null;if(c===l){const v=u[f];return v?{x:0,y:l<f?v.top+v.height-(p.top+p.height):v.top-p.top,...eu}:null}const g=l_(u,c,l);return c>l&&c<=f?{x:0,y:-p.height-g,...eu}:c<l&&c>=f?{x:0,y:p.height+g,...eu}:{x:0,y:0,...eu}};function l_(n,a,l){const o=n[a],c=n[a-1],u=n[a+1];return o?l<a?c?o.top-(c.top+c.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):c?o.top-(c.top+c.height):0:0}const Uj="Sortable",Ij=me.createContext({activeIndex:-1,containerId:Uj,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Lj,disabled:{draggable:!1,droppable:!1}});function Yp(n){let{children:a,id:l,items:o,strategy:c=Lj,disabled:u=!1}=n;const{active:f,dragOverlay:p,droppableRects:g,over:v,measureDroppableContainers:x}=J3(),y=Ri(Uj,l),b=p.rect!==null,w=h.useMemo(()=>o.map(E=>typeof E=="object"&&"id"in E?E.id:E),[o]),N=f!=null,S=f?w.indexOf(f.id):-1,C=v?w.indexOf(v.id):-1,R=h.useRef(w),D=!r_(w,R.current),A=C!==-1&&S===-1||D,M=s_(u);qa(()=>{D&&N&&x(w)},[D,w,N,x]),h.useEffect(()=>{R.current=w},[w]);const O=h.useMemo(()=>({activeIndex:S,containerId:y,disabled:M,disableTransforms:A,items:w,overIndex:C,useDragOverlay:b,sortedRects:a_(w,g),strategy:c}),[S,y,M.draggable,M.droppable,A,w,C,g,b,c]);return me.createElement(Ij.Provider,{value:O},a)}const o_=n=>{let{id:a,items:l,activeIndex:o,overIndex:c}=n;return Mi(l,o,c).indexOf(a)},i_=n=>{let{containerId:a,isSorting:l,wasDragging:o,index:c,items:u,newIndex:f,previousItems:p,previousContainerId:g,transition:v}=n;return!v||!o||p!==u&&c===f?!1:l?!0:f!==c&&a===g},c_={duration:200,easing:"ease"},Pj="transform",u_=Su.Transition.toString({property:Pj,duration:0,easing:"linear"}),d_={roleDescription:"sortable"};function f_(n){let{disabled:a,index:l,node:o,rect:c}=n;const[u,f]=h.useState(null),p=h.useRef(l);return qa(()=>{if(!a&&l!==p.current&&o.current){const g=c.current;if(g){const v=ro(o.current,{ignoreTransform:!0}),x={x:g.left-v.left,y:g.top-v.top,scaleX:g.width/v.width,scaleY:g.height/v.height};(x.x||x.y)&&f(x)}}l!==p.current&&(p.current=l)},[a,l,o,c]),h.useEffect(()=>{u&&f(null)},[u]),u}function Fp(n){let{animateLayoutChanges:a=i_,attributes:l,disabled:o,data:c,getNewIndex:u=o_,id:f,strategy:p,resizeObserverConfig:g,transition:v=c_}=n;const{items:x,containerId:y,activeIndex:b,disabled:w,disableTransforms:N,sortedRects:S,overIndex:C,useDragOverlay:R,strategy:D}=h.useContext(Ij),A=h_(o,w),M=x.indexOf(f),O=h.useMemo(()=>({sortable:{containerId:y,index:M,items:x},...c}),[y,c,M,x]),E=h.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:z,node:k,isOver:P,setNodeRef:Z}=t_({id:f,data:O,disabled:A.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...g}}),{active:ee,activatorEvent:V,activeNodeRect:ce,attributes:se,setNodeRef:H,listeners:_,isDragging:q,over:W,setActivatorNodeRef:Q,transform:te}=Z3({id:f,data:O,attributes:{...d_,...l},disabled:A.draggable}),L=zk(Z,H),U=!!ee,Y=U&&!N&&Wc(b)&&Wc(C),ae=!R&&q,ge=ae&&Y?te:null,G=Y?ge??(p??D)({rects:S,activeNodeRect:ce,activeIndex:b,overIndex:C,index:M}):null,ue=Wc(b)&&Wc(C)?u({id:f,items:x,activeIndex:b,overIndex:C}):M,he=ee==null?void 0:ee.id,xe=h.useRef({activeId:he,items:x,newIndex:ue,containerId:y}),Ae=x!==xe.current.items,Ne=a({active:ee,containerId:y,isDragging:q,isSorting:U,id:f,index:M,items:x,newIndex:xe.current.newIndex,previousItems:xe.current.items,previousContainerId:xe.current.containerId,transition:v,wasDragging:xe.current.activeId!=null}),Oe=f_({disabled:!Ne,index:M,node:k,rect:z});return h.useEffect(()=>{U&&xe.current.newIndex!==ue&&(xe.current.newIndex=ue),y!==xe.current.containerId&&(xe.current.containerId=y),x!==xe.current.items&&(xe.current.items=x)},[U,ue,y,x]),h.useEffect(()=>{if(he===xe.current.activeId)return;if(he!=null&&xe.current.activeId==null){xe.current.activeId=he;return}const et=setTimeout(()=>{xe.current.activeId=he},50);return()=>clearTimeout(et)},[he]),{active:ee,activeIndex:b,attributes:se,data:O,rect:z,index:M,newIndex:ue,items:x,isOver:P,isSorting:U,isDragging:q,listeners:_,node:k,overIndex:C,over:W,setNodeRef:L,setActivatorNodeRef:Q,setDroppableNodeRef:Z,setDraggableNodeRef:H,transform:Oe??G,transition:Qe()};function Qe(){if(Oe||Ae&&xe.current.newIndex===M)return u_;if(!(ae&&!Up(V)||!v)&&(U||Ne))return Su.Transition.toString({...v,property:Pj})}}function h_(n,a){var l,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(l=n==null?void 0:n.draggable)!=null?l:a.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:a.droppable}}function Eu(n){if(!n)return!1;const a=n.data.current;return!!(a&&"sortable"in a&&typeof a.sortable=="object"&&"containerId"in a.sortable&&"items"in a.sortable&&"index"in a.sortable)}const m_=[Ke.Down,Ke.Right,Ke.Up,Ke.Left],Xp=(n,a)=>{let{context:{active:l,collisionRect:o,droppableRects:c,droppableContainers:u,over:f,scrollableAncestors:p}}=a;if(m_.includes(n.code)){if(n.preventDefault(),!l||!o)return;const g=[];u.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const b=c.get(y.id);if(b)switch(n.code){case Ke.Down:o.top<b.top&&g.push(y);break;case Ke.Up:o.top>b.top&&g.push(y);break;case Ke.Left:o.left>b.left&&g.push(y);break;case Ke.Right:o.left<b.left&&g.push(y);break}});const v=Qk({collisionRect:o,droppableRects:c,droppableContainers:g});let x=Sj(v,"id");if(x===(f==null?void 0:f.id)&&v.length>1&&(x=v[1].id),x!=null){const y=u.get(l.id),b=u.get(x),w=b?c.get(b.id):null,N=b==null?void 0:b.node.current;if(N&&w&&y&&b){const C=Wu(N).some((E,z)=>p[z]!==E),R=Bj(y,b),D=p_(y,b),A=C||!R?{x:0,y:0}:{x:D?o.width-w.width:0,y:D?o.height-w.height:0},M={x:w.left,y:w.top};return A.x&&A.y?M:di(M,A)}}}};function Bj(n,a){return!Eu(n)||!Eu(a)?!1:n.data.current.sortable.containerId===a.data.current.sortable.containerId}function p_(n,a){return!Eu(n)||!Eu(a)||!Bj(n,a)?!1:n.data.current.sortable.index<a.data.current.sortable.index}var g_=Object.defineProperty,Sr=(n,a)=>g_(n,"name",{value:a,configurable:!0}),Kp="Checkbox",[v_,S5]=Hn(Kp),[x_,Qp]=v_(Kp);function Hj(n){const{__scopeCheckbox:a,checked:l,children:o,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=Ia({prop:l,defaultProp:c??!1,onChange:g,caller:Kp}),[N,S]=h.useState(null),[C,R]=h.useState(null),D=h.useRef(!1),[A,M]=h.useReducer(z=>z+1,0),O=N?!!f||!!N.closest("form"):!0,E={checked:b,disabled:u,setChecked:w,control:N,setControl:S,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:D,userInteractionCount:A,onUserInteraction:M,required:v,defaultChecked:xr(c)?!1:c,isFormControl:O,bubbleInput:C,setBubbleInput:R};return s.jsx(x_,{scope:a,...E,children:$j(y)?y(E):o})}Sr(Hj,"CheckboxProvider");var y_="CheckboxTrigger",b_=h.forwardRef(Sr(function({__scopeCheckbox:a,onKeyDown:l,onClick:o,...c},u){const{control:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:N,isFormControl:S,bubbleInput:C}=Qp(y_,a),R=Fe(u,y),D=h.useRef(v);return h.useEffect(()=>{const A=f==null?void 0:f.form;if(A){const M=Sr(()=>b(D.current),"reset");return A.addEventListener("reset",M),()=>A.removeEventListener("reset",M)}},[f,b]),s.jsx(He.button,{type:"button",role:"checkbox","aria-checked":xr(v)?"mixed":v,"aria-required":x,"data-state":Zp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...c,ref:R,onKeyDown:Se(l,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:Se(o,A=>{N(),b(M=>xr(M)?!0:!M),C&&S&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"CheckboxTrigger")),qj=h.forwardRef(Sr(function(a,l){const{__scopeCheckbox:o,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return s.jsx(Hj,{__scopeCheckbox:o,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(b_,{...b,ref:l,__scopeCheckbox:o}),w&&s.jsx(C_,{__scopeCheckbox:o})]})})},"Checkbox")),w_="CheckboxIndicator",j_=h.forwardRef(Sr(function(a,l){const{__scopeCheckbox:o,forceMount:c,...u}=a,f=Qp(w_,o);return s.jsx(Er,{present:c||xr(f.checked)||f.checked===!0,children:s.jsx(He.span,{"data-state":Zp(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:l,style:{pointerEvents:"none",...a.style}})})},"CheckboxIndicator")),S_="CheckboxBubbleInput",C_=h.forwardRef(Sr(function({__scopeCheckbox:a,onClick:l,...o},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:N,bubbleInput:S,setBubbleInput:C}=Qp(S_,a),R=Fe(c,C),D=qu(u),A=h.useRef(!1),M=h.useRef(g),O=h.useRef(p);h.useEffect(()=>{const z=S;if(!z)return;const k=window.HTMLInputElement.prototype,Z=Object.getOwnPropertyDescriptor(k,"checked").set,ee=p!==O.current;O.current=p;const V=M.current!==g;M.current=g;const ce=!(ee&&f.current);if(V&&Z){A.current=!ee;const se=new Event("click",{bubbles:ce});z.indeterminate=xr(g),Z.call(z,xr(g)?!1:g),z.dispatchEvent(se),A.current=!1}},[S,g,f,p]);const E=h.useRef(xr(g)?!1:g);return s.jsx(He.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??E.current,required:x,disabled:y,name:b,value:w,form:N,...o,tabIndex:-1,ref:R,onClick:Se(l,z=>{A.current&&z.stopPropagation()}),style:{...o.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function $j(n){return typeof n=="function"}Sr($j,"isFunction");function xr(n){return n==="indeterminate"}Sr(xr,"isIndeterminate");function Zp(n){return xr(n)?"indeterminate":n?"checked":"unchecked"}Sr(Zp,"getState");const Cr=h.forwardRef(({className:n,...a},l)=>s.jsx(qj,{ref:l,className:Ce("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n),...a,children:s.jsx(j_,{className:Ce("flex items-center justify-center text-current"),children:s.jsx(Bm,{className:"h-3.5 w-3.5"})})}));Cr.displayName=qj.displayName;function Vj({value:n,className:a,indicatorClassName:l}){const o=Math.max(0,Math.min(100,Number.isFinite(n)?n:0));return s.jsx("div",{role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,className:Ce("h-2 w-full overflow-hidden rounded-full bg-secondary",a),children:s.jsx("div",{className:Ce("h-full w-full flex-1 bg-primary transition-all",l),style:{transform:`translateX(-${100-o}%)`}})})}var N_=Object.defineProperty,hn=(n,a)=>N_(n,"name",{value:a,configurable:!0}),[Jp,C5]=Hn("Tooltip",[to]),Wp=to(),E_="TooltipProvider",R_=700,xm="tooltip.open",[T_,eg]=Jp(E_),A_=hn(n=>{const{__scopeTooltip:a,delayDuration:l=R_,skipDelayDuration:o=300,disableHoverableContent:c=!1,children:u}=n,f=h.useRef(!0),p=h.useRef(!1),g=h.useRef(0);return h.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),s.jsx(T_,{scope:a,isOpenDelayedRef:f,delayDuration:l,onOpen:h.useCallback(()=>{o<=0||(window.clearTimeout(g.current),f.current=!1)},[o]),onClose:h.useCallback(()=>{o<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,o))},[o]),isPointerInTransitRef:p,onPointerInTransitChange:h.useCallback(v=>{p.current=v},[]),disableHoverableContent:c,children:u})},"TooltipProvider"),ym="Tooltip",[M_,nd]=Jp(ym),D_=hn(n=>{const{__scopeTooltip:a,children:l,open:o,defaultOpen:c,onOpenChange:u,disableHoverableContent:f,delayDuration:p}=n,g=eg(ym,n.__scopeTooltip),v=Wp(a),[x,y]=h.useState(null),[b,w]=h.useState(void 0),N=Na(),S=h.useRef(0),C=f??g.disableHoverableContent,R=p??g.delayDuration,D=h.useRef(!1),[A,M]=Ia({prop:o,defaultProp:c??!1,onChange:hn(Z=>{Z?(g.onOpen(),document.dispatchEvent(new CustomEvent(xm))):g.onClose(),u==null||u(Z)},"onChange"),caller:ym}),O=h.useMemo(()=>A?D.current?"delayed-open":"instant-open":"closed",[A]),E=h.useCallback(()=>{window.clearTimeout(S.current),S.current=0,D.current=!1,M(!0)},[M]),z=h.useCallback(()=>{window.clearTimeout(S.current),S.current=0,M(!1)},[M]),k=h.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{D.current=!0,M(!0),S.current=0},R)},[R,M]);h.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const P=b??N;return s.jsx(lp,{...v,children:s.jsx(M_,{scope:a,contentId:P,setContentId:w,open:A,stateAttribute:O,trigger:x,onTriggerChange:y,onTriggerEnter:h.useCallback(()=>{g.isOpenDelayedRef.current?k():E()},[g.isOpenDelayedRef,k,E]),onTriggerLeave:h.useCallback(()=>{C?z():(window.clearTimeout(S.current),S.current=0)},[z,C]),onOpen:E,onClose:z,disableHoverableContent:C,children:l})})},"Tooltip"),i0="TooltipTrigger",O_=h.forwardRef(hn(function(a,l){const{__scopeTooltip:o,...c}=a,u=nd(i0,o),f=eg(i0,o),p=Wp(o),g=h.useRef(null),v=Fe(l,g,u.onTriggerChange),x=h.useRef(!1),y=h.useRef(!1),b=h.useCallback(()=>x.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),s.jsx(op,{asChild:!0,...p,children:s.jsx(He.button,{"aria-describedby":u.open?u.contentId:void 0,"data-state":u.stateAttribute,...c,ref:v,onPointerMove:Se(a.onPointerMove,w=>{w.pointerType!=="touch"&&!y.current&&!f.isPointerInTransitRef.current&&(u.onTriggerEnter(),y.current=!0)}),onPointerLeave:Se(a.onPointerLeave,()=>{u.onTriggerLeave(),y.current=!1}),onPointerDown:Se(a.onPointerDown,()=>{u.open&&u.onClose(),x.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:Se(a.onFocus,()=>{x.current||u.onOpen()}),onBlur:Se(a.onBlur,u.onClose),onClick:Se(a.onClick,u.onClose)})})},"TooltipTrigger")),k_="TooltipPortal",[N5,__]=Jp(k_,{forceMount:void 0}),hi="TooltipContent",z_=h.forwardRef(hn(function(a,l){const o=__(hi,a.__scopeTooltip),{forceMount:c=o.forceMount,side:u="top",...f}=a,p=nd(hi,a.__scopeTooltip);return s.jsx(Er,{present:c||p.open,children:p.disableHoverableContent?s.jsx(Gj,{side:u,...f,ref:l}):s.jsx(L_,{side:u,...f,ref:l})})},"TooltipContent")),L_=h.forwardRef(hn(function(a,l){const o=nd(hi,a.__scopeTooltip),c=eg(hi,a.__scopeTooltip),u=h.useRef(null),f=Fe(l,u),[p,g]=h.useState(null),{trigger:v,onClose:x}=o,y=u.current,{onPointerInTransitChange:b}=c,w=h.useCallback(()=>{g(null),b(!1)},[b]),N=h.useCallback((S,C)=>{const R=S.currentTarget,D={x:S.clientX,y:S.clientY},A=Yj(D,R.getBoundingClientRect()),M=Fj(D,A),O=Xj(C.getBoundingClientRect()),E=Qj([...M,...O]);g(E),b(!0)},[b]);return h.useEffect(()=>()=>w(),[w]),h.useEffect(()=>{if(v&&y){const S=hn(R=>N(R,y),"handleTriggerLeave"),C=hn(R=>N(R,v),"handleContentLeave");return v.addEventListener("pointerleave",S),y.addEventListener("pointerleave",C),()=>{v.removeEventListener("pointerleave",S),y.removeEventListener("pointerleave",C)}}},[v,y,N,w]),h.useEffect(()=>{if(p){const S=hn(C=>{const R=C.target,D={x:C.clientX,y:C.clientY},A=(v==null?void 0:v.contains(R))||(y==null?void 0:y.contains(R)),M=!Kj(D,p);A?w():M&&(w(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[v,y,p,x,w]),s.jsx(Gj,{...a,ref:f})},"TooltipContentHoverable")),U_=l1("TooltipContent"),Gj=h.forwardRef(hn(function(a,l){const{__scopeTooltip:o,children:c,"aria-label":u,id:f,onEscapeKeyDown:p,onPointerDownOutside:g,...v}=a,x=nd(hi,o),y=Wp(o),{onClose:b}=x;h.useEffect(()=>(document.addEventListener(xm,b),()=>document.removeEventListener(xm,b)),[b]),h.useEffect(()=>{if(x.trigger){const N=hn(S=>{S.target instanceof Node&&S.target.contains(x.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",N,{capture:!0}),()=>window.removeEventListener("scroll",N,{capture:!0})}},[x.trigger,b]);const{setContentId:w}=x;return Jt(()=>(w(f),()=>{w(void 0)}),[f,w]),s.jsx(Lu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:N=>N.preventDefault(),onDismiss:b,children:s.jsxs(ip,{"data-state":x.stateAttribute,role:u?void 0:"tooltip",id:u?void 0:x.contentId,...y,...v,ref:l,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(U_,{children:c}),u?s.jsx(KO,{id:x.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl"));function Yj(n,a){const l=Math.abs(a.top-n.y),o=Math.abs(a.bottom-n.y),c=Math.abs(a.right-n.x),u=Math.abs(a.left-n.x);switch(Math.min(l,o,c,u)){case u:return"left";case c:return"right";case l:return"top";case o:return"bottom";default:throw new Error("unreachable")}}hn(Yj,"getExitSideFromRect");function Fj(n,a,l=5){const o=[];switch(a){case"top":o.push({x:n.x-l,y:n.y+l},{x:n.x+l,y:n.y+l});break;case"bottom":o.push({x:n.x-l,y:n.y-l},{x:n.x+l,y:n.y-l});break;case"left":o.push({x:n.x+l,y:n.y-l},{x:n.x+l,y:n.y+l});break;case"right":o.push({x:n.x-l,y:n.y-l},{x:n.x-l,y:n.y+l});break}return o}hn(Fj,"getPaddedExitPoints");function Xj(n){const{top:a,right:l,bottom:o,left:c}=n;return[{x:c,y:a},{x:l,y:a},{x:l,y:o},{x:c,y:o}]}hn(Xj,"getPointsFromRect");function Kj(n,a){const{x:l,y:o}=n;let c=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],v=p.x,x=p.y,y=g.x,b=g.y;x>o!=b>o&&l<(y-v)*(o-x)/(b-x)+v&&(c=!c)}return c}hn(Kj,"isPointInPolygon");function Qj(n){const a=n.slice();return a.sort((l,o)=>l.x<o.x?-1:l.x>o.x?1:l.y<o.y?-1:l.y>o.y?1:0),Zj(a)}hn(Qj,"getHull");function Zj(n){if(n.length<=1)return n.slice();const a=[];for(let o=0;o<n.length;o++){const c=n[o];for(;a.length>=2;){const u=a[a.length-1],f=a[a.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))a.pop();else break}a.push(c)}a.pop();const l=[];for(let o=n.length-1;o>=0;o--){const c=n[o];for(;l.length>=2;){const u=l[l.length-1],f=l[l.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))l.pop();else break}l.push(c)}return l.pop(),a.length===1&&l.length===1&&a[0].x===l[0].x&&a[0].y===l[0].y?a:a.concat(l)}hn(Zj,"getHullPresorted");var I_=A_,P_=D_,B_=O_,Jj=z_;const tg=I_,_s=P_,zs=B_,ls=h.forwardRef(({className:n,sideOffset:a=4,...l},o)=>s.jsx(Jj,{ref:o,sideOffset:a,className:Ce("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95",n),...l}));ls.displayName=Jj.displayName;const mi=h.forwardRef(({className:n,...a},l)=>s.jsx("textarea",{ref:l,className:Ce("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n),...a}));mi.displayName="Textarea";function H_({providerId:n,open:a,onOpenChange:l,onImported:o}){const[c,u]=h.useState([]),[f,p]=h.useState(""),[g,v]=h.useState(null),[x,y]=h.useState([]),[b,w]=h.useState(!1),[N,S]=h.useState(""),C=E=>{const z=new FormData;return z.append("providerId",n),E&&z.append("selectedIndexes",JSON.stringify(E)),c.forEach(k=>z.append("file",k)),f.trim()&&z.append("text",f),z},R=async()=>{w(!0),S("");try{const E=await pe.upload("/api/admin/codex/accounts/preview",C());v(E),y(E.records.filter(z=>z.valid&&!z.duplicateOf).map(z=>z.index))}catch(E){S(E.message||"Unable to preview import")}finally{w(!1)}},D=async()=>{w(!0),S("");try{const E=await pe.upload("/api/admin/codex/accounts/import",C(x));l(!1),o(),u([]),p(""),v(null),y([]),de.success(`${E.added} added, ${E.updated} updated, ${E.failed} failed`)}catch(E){S(E.message||"Unable to import accounts")}finally{w(!1)}},A=(E,z)=>y(k=>z===!0?[...new Set([...k,E])]:k.filter(P=>P!==E)),M=(g==null?void 0:g.records.filter(E=>E.valid&&!E.duplicateOf).map(E=>E.index))??[],O=M.length>0&&M.every(E=>x.includes(E));return s.jsx(ln,{open:a,onOpenChange:l,children:s.jsxs(Kt,{className:"max-w-3xl",children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"Import Codex accounts"}),s.jsx(jr,{children:"Select JSON or JSONL files, or paste records. Secrets are submitted without being displayed in the preview."})]}),g?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3 text-sm",children:[s.jsxs("span",{children:[g.validCount," valid, ",g.invalidCount," invalid"]}),s.jsxs("label",{className:"flex items-center gap-2",children:[s.jsx(Cr,{checked:O,onCheckedChange:E=>y(E===!0?M:[]),"aria-label":"Select all valid accounts"})," Select all valid"]})]}),s.jsx("div",{className:"max-h-80 overflow-auto rounded-md border",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b text-left",children:[s.jsx("th",{className:"p-2",children:"Select"}),s.jsx("th",{className:"p-2",children:"Account"}),s.jsx("th",{className:"p-2",children:"Plan"}),s.jsx("th",{className:"p-2",children:"Expiry"}),s.jsx("th",{className:"p-2",children:"Result"})]})}),s.jsx("tbody",{children:g.records.map(E=>s.jsxs("tr",{className:"border-b last:border-0",children:[s.jsx("td",{className:"p-2",children:s.jsx(Cr,{checked:x.includes(E.index),disabled:!E.valid||!!E.duplicateOf,onCheckedChange:z=>A(E.index,z),"aria-label":`Select record ${E.index+1}`})}),s.jsxs("td",{className:"p-2",children:[s.jsx("div",{children:E.email||"Unknown email"}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[E.accountIdMasked||"No account ID",E.workspaceIdMasked?` · ${E.workspaceIdMasked}`:""]})]}),s.jsx("td",{className:"p-2",children:E.planType||"—"}),s.jsx("td",{className:"p-2",children:E.expiresAt?new Date(E.expiresAt).toLocaleDateString():"—"}),s.jsx("td",{className:"p-2",children:E.valid?E.duplicateOf?s.jsx("span",{className:"text-amber-600",children:"Duplicate"}):s.jsx("span",{className:"text-emerald-600",children:"Ready"}):s.jsx("span",{className:"text-destructive",children:E.error||"Invalid record"})})]},`${E.index}-${E.source??""}`))})]})}),N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>v(null),children:"Back"}),s.jsx(le,{disabled:b||x.length===0,onClick:()=>void D(),children:b?"Importing…":`Import ${x.length} account${x.length===1?"":"s"}`})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"codex-files",children:"JSON / JSONL files"}),s.jsx(Ee,{id:"codex-files",type:"file",accept:".json,.jsonl,application/json",multiple:!0,onChange:E=>u(Array.from(E.target.files??[]))})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"codex-paste",children:"Paste JSON / JSONL (optional)"}),s.jsx(mi,{id:"codex-paste",value:f,onChange:E=>p(E.target.value),placeholder:"Paste Codex export records here",className:"min-h-32 font-mono text-xs"})]}),N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),s.jsx(le,{disabled:b||c.length===0&&!f.trim(),onClick:()=>void R(),children:b?"Reading…":"Preview import"})]})]})]})})}const q_="http://localhost:1455/auth/callback",$_="1455",V_="http://localhost:8791/oauth/codex/callback";function G_({providerId:n,providerName:a,open:l,onOpenChange:o,onConnected:c}){const[u,f]=h.useState(""),[p,g]=h.useState(""),[v,x]=h.useState(""),[y,b]=h.useState(!0),[w,N]=h.useState(!1),[S,C]=h.useState(""),[R,D]=h.useState(!1),[A,M]=h.useState(!1),O=h.useCallback(async()=>{b(!0),C(""),x("");try{const k=await pe.post("/api/admin/codex/oauth/start",{providerId:n});f(k.state),g(k.authorizeUrl)}catch(k){C(k.message||"Unable to start the Codex authorization flow")}finally{b(!1)}},[n]);h.useEffect(()=>{O()},[O]),h.useEffect(()=>{if(!u)return;const k=setInterval(()=>{pe.get(`/api/admin/codex/oauth/${u}`).then(P=>M(!(P!=null&&P.callbackReceived))).catch(()=>M(!0))},5e3);return()=>clearInterval(k)},[u]);const E=async()=>{N(!0),C("");try{const k=await pe.post("/api/admin/codex/oauth/complete",{providerId:n,state:u,callbackUrl:v});de.success(`Codex account ${k.status==="added"?"connected":"updated"}`),o(!1),c()}catch(k){C(k.message||"Unable to complete the Codex authorization")}finally{N(!1)}},z=async()=>{try{await navigator.clipboard.writeText(p),D(!0),setTimeout(()=>D(!1),2e3)}catch{C("Clipboard is unavailable — select the URL and copy it manually.")}};return s.jsx(ln,{open:l,onOpenChange:o,children:s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"Connect OpenAI Codex"}),s.jsxs(jr,{children:["Authorize a ChatGPT account for ",a,". The callback is captured on localhost:",$_," — nothing is sent anywhere else."]})]}),y?s.jsxs("p",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[s.jsx(pr,{className:"h-4 w-4 animate-spin"})," Starting authorization…"]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(pr,{className:"h-3.5 w-3.5 animate-spin"})," Waiting for popup authorization…"]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["The browser will try to hand the callback to ",s.jsx("code",{className:"font-mono",children:V_}),". Most browsers block that from a public origin — if the page fails to load, copy the address bar and paste it in step 2."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Step 1: Open this URL in your browser"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ee,{readOnly:!0,className:"font-mono text-xs",value:p,onFocus:k=>k.currentTarget.select()}),s.jsx(le,{type:"button",variant:"outline","aria-label":"Copy authorization URL",onClick:()=>void z(),children:R?s.jsx(Bm,{className:"h-4 w-4"}):s.jsx(ou,{className:"h-4 w-4"})}),s.jsx(le,{type:"button",variant:"outline","aria-label":"Open authorization URL",asChild:!0,children:s.jsx("a",{href:p,target:"_blank",rel:"noreferrer",children:s.jsx(CE,{className:"h-4 w-4"})})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{htmlFor:"codex-callback",children:"Step 2: Paste the callback URL here"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"After authorization, copy the full URL from your browser — or just the authorization code."}),s.jsx(Ee,{id:"codex-callback",value:v,onChange:k=>x(k.target.value),placeholder:`${q_}?code=…`}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Or paste callback URL manually"})]}),S&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),s.jsx(le,{disabled:w||y||A&&!v.trim(),onClick:()=>void E(),children:w?s.jsxs(s.Fragment,{children:[s.jsx(pr,{className:"mr-1 h-4 w-4 animate-spin"})," Connecting…"]}):"Connect"})]})]})})}const Y_=["10","25","50"];function F_(n,a){if(!n)return"—";const l=Date.parse(n)-a;if(!Number.isFinite(l))return"—";if(l<=0)return"reset ready";const o=Math.floor(l/6e4);if(o<60)return`${o}m`;const c=Math.floor(o/60),u=o%60;return c<24?`${c}h ${u}m`:`${Math.floor(c/24)}d ${c%24}h`}function c0(n,a,l){if(!n)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const o=n.remaining<=0;return s.jsxs("div",{className:"min-w-[9rem] space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[s.jsxs("span",{className:o?"font-medium text-destructive":"text-muted-foreground",children:[l," ",Math.round(n.remaining),"% left"]}),s.jsx("span",{className:"tabular-nums text-muted-foreground",children:F_(n.resetAt,a)})]}),s.jsx(Vj,{value:n.used,indicatorClassName:o?"bg-destructive":n.remaining<30?"bg-amber-500":"bg-emerald-500"})]})}function X_({providerId:n,providerName:a}){const[l,o]=h.useState([]),[c,u]=h.useState(null),[f,p]=h.useState(!0),[g,v]=h.useState(!1),[x,y]=h.useState(!1),[b,w]=h.useState(1),[N,S]=h.useState("10"),[C,R]=h.useState(""),[D,A]=h.useState(()=>Date.now());h.useEffect(()=>{const _=setInterval(()=>A(Date.now()),3e4);return()=>clearInterval(_)},[]);const M=h.useCallback(async()=>{try{const _=await pe.get(`/api/admin/codex/accounts?providerId=${encodeURIComponent(n)}`);o(_.accounts)}catch(_){de.error(_.message||"Unable to load Codex accounts")}finally{p(!1)}},[n]);h.useEffect(()=>{M()},[M]);const O=async(_,q,W)=>{u(_.id);try{await W(),de.success(`${q}: ${_.email||_.accountIdMasked||_.id}`)}catch(Q){de.error(Q.message||`${q} failed`)}finally{u(null)}},E=(_,q)=>o(W=>W.map(Q=>Q.id===_?q:Q)),z=(_,q)=>O(l.find(W=>W.id===_),"Updated",async()=>{E(_,(await pe.patch(`/api/admin/codex/accounts/${_}`,q)).account)}),k=l.filter(_=>{if(!C)return!0;const q=C.toLowerCase();return[_.email,_.accountIdMasked,_.workspaceIdMasked,_.planType].some(W=>W==null?void 0:W.toLowerCase().includes(q))}),P=Number(N),Z=Math.max(1,Math.ceil(k.length/P)),ee=Math.min(b,Z),V=k.slice((ee-1)*P,ee*P),ce=async()=>{u("all");try{await Promise.allSettled(l.map(_=>pe.post(`/api/admin/codex/accounts/${_.id}/usage`))),await M(),de.success("Usage refreshed for all accounts")}finally{u(null)}},se=Ip(Vl(Ai,{activationConstraint:{distance:4}}),Vl(Ti,{coordinateGetter:Xp})),H=async _=>{const{active:q,over:W}=_;if(!W||q.id===W.id)return;const Q=l.findIndex(Y=>Y.id===q.id),te=l.findIndex(Y=>Y.id===W.id);if(Q<0||te<0)return;const L=l,U=Mi(l,Q,te);o(U);try{await pe.post("/api/admin/codex/accounts/reorder",{providerId:n,ids:U.map(Y=>Y.id)}),de.success("Routing order updated")}catch(Y){o(L),de.error(Y.message||"Unable to save the routing order")}};return s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"Codex accounts"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.length," account",l.length===1?"":"s"," · drag a row to set routing order · quotas come from the ChatGPT usage API"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ee,{className:"h-8 w-40",placeholder:"Filter accounts…",value:C,onChange:_=>{R(_.target.value),w(1)}}),s.jsxs(le,{size:"sm",variant:"outline",disabled:c!==null||l.length===0,onClick:()=>void ce(),children:[s.jsx(li,{className:"mr-1 h-3 w-3"})," Refresh all"]}),s.jsxs(le,{size:"sm",variant:"outline",onClick:()=>y(!0),children:[s.jsx(TE,{className:"mr-1 h-4 w-4"})," Connect Codex"]}),s.jsxs(le,{size:"sm",onClick:()=>v(!0),children:[s.jsx(Q0,{className:"mr-1 h-4 w-4"})," Import accounts"]})]})]}),f?s.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"Loading Codex accounts…"}):l.length===0?s.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"No Codex accounts yet. Use Connect Codex to authorize one, or import existing account JSON."}):k.length===0?s.jsxs("p",{className:"py-3 text-sm text-muted-foreground",children:["No account matches “",C,"”."]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsx(tg,{delayDuration:200,children:s.jsx(qp,{sensors:se,collisionDetection:Pp,onDragEnd:_=>void H(_),modifiers:[Vp,$p],children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{className:"w-8"}),s.jsx(ve,{className:"text-xs",children:"Account"}),s.jsx(ve,{className:"text-xs",children:"Plan"}),s.jsx(ve,{className:"text-xs",children:"5h window"}),s.jsx(ve,{className:"text-xs",children:"Weekly"}),s.jsx(ve,{className:"text-xs",children:"Reset credits"}),s.jsx(ve,{className:"text-xs",children:"Auto-start 5h"}),s.jsx(ve,{className:"text-xs",children:"Token expiry"}),s.jsx(ve,{className:"text-xs",children:"Health"}),s.jsx(ve,{className:"text-right text-xs",children:"Actions"})]})}),s.jsx(Yp,{items:V.map(_=>_.id),strategy:Gp,children:s.jsx(Pn,{children:V.map(_=>s.jsx(K_,{account:_,now:D,busy:c===_.id,onPatch:q=>void z(_.id,q),onUsage:q=>E(_.id,q),onDelete:()=>void O(_,"Deleted",()=>pe.del(`/api/admin/codex/accounts/${_.id}`)).then(()=>M())},_.id))})})]})})})}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:"Rows per page"}),s.jsxs(zn,{value:N,onValueChange:_=>{S(_),w(1)},children:[s.jsx(jn,{className:"h-7 w-16",children:s.jsx(Ln,{})}),s.jsx(Sn,{children:Y_.map(_=>s.jsx(nt,{value:_,children:_},_))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{children:["Page ",ee," of ",Z]}),s.jsx(le,{size:"sm",variant:"outline","aria-label":"Previous page",disabled:ee<=1,onClick:()=>w(ee-1),children:s.jsx(G0,{className:"h-3 w-3"})}),s.jsx(le,{size:"sm",variant:"outline","aria-label":"Next page",disabled:ee>=Z,onClick:()=>w(ee+1),children:s.jsx(Hm,{className:"h-3 w-3"})})]})]})]}),g&&s.jsx(H_,{providerId:n,open:!0,onOpenChange:_=>{_||v(!1)},onImported:()=>void M()}),x&&s.jsx(G_,{providerId:n,providerName:a||"this Codex provider",open:!0,onOpenChange:_=>{_||y(!1)},onConnected:()=>void M()})]})}function K_({account:n,now:a,busy:l,onPatch:o,onUsage:c,onDelete:u}){var A,M,O,E,z,k;const{attributes:f,listeners:p,setNodeRef:g,transform:v,transition:x,isDragging:y}=Fp({id:n.id,disabled:l}),b=(M=(A=n.usage)==null?void 0:A.quotas)==null?void 0:M.session,w=(E=(O=n.usage)==null?void 0:O.quotas)==null?void 0:E.blocking,N=((z=n.usage)==null?void 0:z.resetCredits)??0,S=n.email||n.accountIdMasked||n.id,C=()=>void(async()=>{try{c((await pe.post(`/api/admin/codex/accounts/${n.id}/usage`)).account),de.success(`Usage refreshed: ${S}`)}catch(P){de.error(P.message||"Usage refresh failed")}})(),R=()=>{window.confirm(`Spend 1 weekly reset credit to restart the 5h window for ${S}?`)&&(async()=>{try{c((await pe.post(`/api/admin/codex/accounts/${n.id}/reset-quota`)).account),de.success(`Quota reset: ${S}`)}catch(P){de.error(P.message||"Quota reset failed")}})()},D=()=>void Q_(`Test passed: ${S}`,()=>pe.post(`/api/admin/codex/accounts/${n.id}/test`));return s.jsxs(Be,{ref:g,style:{transform:v?`translate3d(${v.x}px, ${v.y}px, 0)`:void 0,transition:x},className:Ce(n.enabled?void 0:"opacity-60",y&&"relative z-10 bg-muted/60 shadow-sm"),children:[s.jsx(fe,{className:"w-8 pr-0",children:s.jsx("button",{type:"button",...f,...p,"aria-label":`Reorder ${S}`,title:"Drag to change routing order",disabled:l,className:"cursor-grab touch-none rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40 active:cursor-grabbing",children:s.jsx($m,{className:"h-4 w-4"})})}),s.jsxs(fe,{children:[s.jsx("div",{className:"text-sm",children:n.email||"Unknown email"}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[n.accountIdMasked||"—",n.workspaceIdMasked?` · ${n.workspaceIdMasked}`:"",n.usageError?` · usage: ${n.usageError}`:""]})]}),s.jsx(fe,{className:"text-sm",children:((k=n.usage)==null?void 0:k.plan)||n.planType||"—"}),s.jsx(fe,{children:c0(b,a,"5h")}),s.jsx(fe,{children:c0(w,a,"Week")}),s.jsx(fe,{children:s.jsx("span",{className:`text-sm tabular-nums ${N>0?"font-medium":"text-muted-foreground"}`,children:N})}),s.jsx(fe,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Z_,{checked:n.autostart,disabled:l,onCheckedChange:P=>o({autostart:P}),label:`Auto-start 5h window for ${S}`}),s.jsxs(_s,{children:[s.jsx(zs,{asChild:!0,children:s.jsx("span",{className:"text-xs text-muted-foreground",children:n.lastPingAt?`pinged ${new Date(n.lastPingAt).toLocaleTimeString()}`:"never pinged"})}),s.jsx(ls,{className:"max-w-64",children:"Sends a tiny gpt-5.5 request right after the 5h window resets so the next window starts immediately. Consumes a small amount of quota."})]})]})}),s.jsx(fe,{className:"text-xs",children:new Date(n.tokenExpiresAt).toLocaleString()}),s.jsx(fe,{children:s.jsx(We,{variant:n.healthState==="healthy"?"success":n.healthState==="down"?"destructive":"secondary",children:n.healthState})}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsxs(_s,{children:[s.jsx(zs,{asChild:!0,children:s.jsx(le,{size:"sm",variant:"outline","aria-label":`Refresh usage for ${S}`,disabled:l,onClick:C,children:s.jsx(li,{className:"h-3 w-3"})})}),s.jsx(ls,{children:"Refresh usage"})]}),s.jsxs(_s,{children:[s.jsx(zs,{asChild:!0,children:s.jsx(le,{size:"sm",variant:"outline","aria-label":`Reset quota for ${S}`,disabled:l||N===0,onClick:R,children:s.jsx(_E,{className:"h-3 w-3"})})}),s.jsx(ls,{children:N===0?"No weekly reset credits available":"Reset quota (uses 1 credit)"})]}),s.jsxs(_s,{children:[s.jsx(zs,{asChild:!0,children:s.jsx(le,{size:"sm",variant:"outline","aria-label":`Test Codex account ${S}`,disabled:l,onClick:D,children:s.jsx(UE,{className:"h-3 w-3"})})}),s.jsx(ls,{children:"Test connection"})]}),s.jsxs(_s,{children:[s.jsx(zs,{asChild:!0,children:s.jsx(le,{size:"sm",variant:"outline","aria-pressed":!n.enabled,disabled:l,onClick:()=>o({enabled:!n.enabled}),children:n.enabled?"Disable":"Enable"})}),s.jsx(ls,{children:n.enabled?"Exclude from routing (keeps the account)":"Include in routing"})]}),s.jsxs(_s,{children:[s.jsx(zs,{asChild:!0,children:s.jsx(le,{size:"sm",variant:"destructive","aria-label":`Delete Codex account ${S}`,disabled:l,onClick:()=>{window.confirm(`Permanently delete ${S}?
|
|
386
|
-
|
|
387
|
-
Stored Codex credentials are erased. Past request logs are kept, but lose the account reference.`)&&u()},children:s.jsx(Ql,{className:"h-3 w-3"})})}),s.jsx(ls,{children:"Delete account (permanent)"})]})]})})]})}async function Q_(n,a){try{await a(),de.success(n)}catch(l){de.error(l.message||"Action failed")}}function Z_({checked:n,disabled:a,onCheckedChange:l,label:o}){return s.jsx(Cr,{role:"switch","aria-label":o,"aria-checked":n,checked:n,disabled:a,onCheckedChange:c=>l(c===!0)})}function J_({providerId:n,open:a,onOpenChange:l,onImported:o}){const[c,u]=h.useState([]),[f,p]=h.useState(""),[g,v]=h.useState(null),[x,y]=h.useState([]),[b,w]=h.useState(!1),[N,S]=h.useState(""),C=E=>{const z=new FormData;return z.append("providerId",n),E&&z.append("selectedIndexes",JSON.stringify(E)),c.forEach(k=>z.append("file",k)),f.trim()&&z.append("text",f),z},R=async()=>{w(!0),S("");try{const E=await pe.upload("/api/admin/qoder/accounts/preview",C());v(E),y(E.records.filter(z=>z.valid&&!z.duplicateOf).map(z=>z.index))}catch(E){S(E.message||"Unable to preview import")}finally{w(!1)}},D=async()=>{w(!0),S("");try{const E=await pe.upload("/api/admin/qoder/accounts/import",C(x));l(!1),o(),u([]),p(""),v(null),y([]),de.success(`${E.added} added, ${E.updated} updated, ${E.failed} failed`)}catch(E){S(E.message||"Unable to import tokens")}finally{w(!1)}},A=(E,z)=>y(k=>z===!0?[...new Set([...k,E])]:k.filter(P=>P!==E)),M=(g==null?void 0:g.records.filter(E=>E.valid&&!E.duplicateOf).map(E=>E.index))??[],O=M.length>0&&M.every(E=>x.includes(E));return s.jsx(ln,{open:a,onOpenChange:l,children:s.jsxs(Kt,{className:"max-w-3xl",children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"Import Qoder personal access tokens"}),s.jsx(jr,{children:"One token per line, or a .txt/.json file. Tokens are submitted without being displayed back."})]}),g?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3 text-sm",children:[s.jsxs("span",{children:[g.validCount," valid, ",g.invalidCount," invalid"]}),s.jsxs("label",{className:"flex items-center gap-2",children:[s.jsx(Cr,{checked:O,onCheckedChange:E=>y(E===!0?M:[]),"aria-label":"Select all valid tokens"})," Select all valid"]})]}),s.jsx("div",{className:"max-h-80 overflow-auto rounded-md border",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b text-left",children:[s.jsx("th",{className:"p-2",children:"Select"}),s.jsx("th",{className:"p-2",children:"Token"}),s.jsx("th",{className:"p-2",children:"Label"}),s.jsx("th",{className:"p-2",children:"Result"})]})}),s.jsx("tbody",{children:g.records.map(E=>s.jsxs("tr",{className:"border-b last:border-0",children:[s.jsx("td",{className:"p-2",children:s.jsx(Cr,{checked:x.includes(E.index),disabled:!E.valid||!!E.duplicateOf,onCheckedChange:z=>A(E.index,z),"aria-label":`Select record ${E.index+1}`})}),s.jsx("td",{className:"p-2 font-mono text-xs",children:E.personalTokenMasked||"—"}),s.jsx("td",{className:"p-2",children:E.label||"—"}),s.jsx("td",{className:"p-2",children:E.valid?E.duplicateOf?s.jsx("span",{className:"text-amber-600",children:"Already added"}):s.jsx("span",{className:"text-emerald-600",children:"Ready"}):s.jsx("span",{className:"text-destructive",children:E.error||"Invalid token"})})]},`${E.index}-${E.source??""}`))})]})}),N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>v(null),children:"Back"}),s.jsx(le,{disabled:b||x.length===0,onClick:()=>void D(),children:b?"Importing…":`Import ${x.length} token${x.length===1?"":"s"}`})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"qoder-files",children:"Token files (.txt / .json)"}),s.jsx(Ee,{id:"qoder-files",type:"file",accept:".txt,.json,.jsonl,text/plain,application/json",multiple:!0,onChange:E=>u(Array.from(E.target.files??[]))})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"qoder-paste",children:"Paste tokens (optional)"}),s.jsx(mi,{id:"qoder-paste",value:f,onChange:E=>p(E.target.value),placeholder:"pt-…",className:"min-h-32 font-mono text-xs"})]}),N&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),s.jsx(le,{disabled:b||c.length===0&&!f.trim(),onClick:()=>void R(),children:b?"Reading…":"Preview import"})]})]})]})})}const W_=["10","25","50"];function bm(n,a){if(!n)return"—";const l=Date.parse(n)-a;if(!Number.isFinite(l))return"—";if(l<=0)return"expired";const o=Math.floor(l/6e4);if(o<60)return`${o}m`;const c=Math.floor(o/60);return c<24?`${c}h ${o%60}m`:`${Math.floor(c/24)}d ${c%24}h`}function e4(n){const a=n==="healthy"?"default":n==="degraded"?"secondary":n==="down"?"destructive":"outline";return s.jsx(We,{variant:a,children:n})}function t4(n,a){const{credits:l,creditsError:o}=n;if(!l)return o?s.jsx("span",{className:"text-xs text-destructive",children:o}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const c=l.buckets[0],u=l.totalUsedPercent,f=l.freeModels,p=f.length>2?`${f.slice(0,2).join(", ")} +${f.length-2}`:f.join(", ");return s.jsxs("div",{className:"min-w-[10rem] space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[s.jsx("span",{className:l.exhausted?"font-medium text-destructive":"text-muted-foreground",children:c?`${c.used.toFixed(0)} / ${c.total.toFixed(0)} ${c.unit}`:l.exhausted?"No plan credits":`${u.toFixed(0)}% used`}),s.jsx("span",{className:"tabular-nums text-muted-foreground",children:bm(l.expiresAt,a)})]}),s.jsx(Vj,{value:u,indicatorClassName:l.exhausted?"bg-destructive":u>70?"bg-amber-500":"bg-emerald-500"}),f.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Free now: ",p]}),o&&s.jsxs("p",{className:"text-xs text-destructive",children:["last read failed: ",o]})]})}function n4({providerId:n,providerName:a}){const[l,o]=h.useState([]),[c,u]=h.useState(null),[f,p]=h.useState(!0),[g,v]=h.useState(!1),[x,y]=h.useState(!1),[b,w]=h.useState(""),[N,S]=h.useState(""),[C,R]=h.useState(!1),[D,A]=h.useState(""),[M,O]=h.useState(1),[E,z]=h.useState("10"),[k,P]=h.useState(""),[Z,ee]=h.useState(()=>Date.now());h.useEffect(()=>{const U=setInterval(()=>ee(Date.now()),3e4);return()=>clearInterval(U)},[]);const V=h.useCallback(async()=>{try{const U=await pe.get(`/api/admin/qoder/accounts?providerId=${encodeURIComponent(n)}`);o(U.accounts)}catch(U){de.error(U.message||"Unable to load Qoder accounts")}finally{p(!1)}},[n]);h.useEffect(()=>{V()},[V]);const ce=async(U,Y,ae)=>{u(U.id);try{await ae(),de.success(`${Y}: ${U.label||U.qoderUserIdMasked||U.id}`)}catch(ge){de.error(ge.message||`${Y} failed`)}finally{u(null)}},se=async()=>{R(!0),A("");try{const U=await pe.post("/api/admin/qoder/accounts",{providerId:n,personalToken:b,label:N.trim()||void 0});de.success(U.catalogError?"Account added, but the model catalog could not be fetched":"Account added"),y(!1),w(""),S(""),await V()}catch(U){A(U.message||"Unable to add the token")}finally{R(!1)}},H=l.filter(U=>{if(!k)return!0;const Y=k.toLowerCase();return[U.label,U.email,U.qoderUserIdMasked].some(ae=>ae==null?void 0:ae.toLowerCase().includes(Y))}),_=Number(E),q=Math.max(1,Math.ceil(H.length/_)),W=Math.min(M,q),Q=H.slice((W-1)*_,W*_),te=Ip(Vl(Ai,{activationConstraint:{distance:4}}),Vl(Ti,{coordinateGetter:Xp})),L=async U=>{const{active:Y,over:ae}=U;if(!ae||Y.id===ae.id)return;const ge=l.findIndex(he=>he.id===Y.id),ye=l.findIndex(he=>he.id===ae.id);if(ge<0||ye<0)return;const G=l,ue=Mi(l,ge,ye);o(ue);try{await pe.post("/api/admin/qoder/accounts/reorder",{providerId:n,ids:ue.map(he=>he.id)}),de.success("Routing order updated")}catch(he){o(G),de.error(he.message||"Unable to save the routing order")}};return s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"Qoder accounts"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.length," account",l.length===1?"":"s"," · drag a row to set routing order · each account is one personal access token"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ee,{className:"h-8 w-40",placeholder:"Filter accounts…",value:k,onChange:U=>{P(U.target.value),O(1)}}),s.jsxs(le,{size:"sm",variant:"outline",disabled:c!==null||l.length===0,onClick:()=>void(async()=>{u("all");try{await Promise.allSettled(l.map(U=>pe.post(`/api/admin/qoder/accounts/${U.id}/catalog`))),await V(),de.success("Model catalogs refreshed")}finally{u(null)}})(),children:[s.jsx(li,{className:"mr-1 h-3 w-3"})," Refresh catalogs"]}),s.jsxs(le,{size:"sm",variant:"outline",disabled:c!==null||l.length===0,onClick:()=>void(async()=>{u("all");try{await Promise.allSettled(l.map(U=>pe.post(`/api/admin/qoder/accounts/${U.id}/credits`))),await V(),de.success("Credits refreshed")}finally{u(null)}})(),children:[s.jsx(li,{className:"mr-1 h-3 w-3"})," Refresh credits"]}),s.jsxs(le,{size:"sm",variant:"outline",onClick:()=>v(!0),children:[s.jsx(Q0,{className:"mr-1 h-4 w-4"})," Import tokens"]}),s.jsxs(le,{size:"sm",onClick:()=>y(!0),children:[s.jsx(Kl,{className:"mr-1 h-4 w-4"})," Add token"]})]})]}),f?s.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"Loading Qoder accounts…"}):l.length===0?s.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"No Qoder accounts yet. Add a personal access token or import a list."}):H.length===0?s.jsxs("p",{className:"py-3 text-sm text-muted-foreground",children:["No account matches “",k,"”."]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsx(qp,{sensors:te,collisionDetection:Pp,onDragEnd:U=>void L(U),modifiers:[Vp,$p],children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{className:"w-8"}),s.jsx(ve,{className:"text-xs",children:"Account"}),s.jsx(ve,{className:"text-xs",children:"User"}),s.jsx(ve,{className:"text-xs",children:"Job token"}),s.jsx(ve,{className:"text-xs",children:"Catalog"}),s.jsx(ve,{className:"text-xs",children:"Credits"}),s.jsx(ve,{className:"text-xs",children:"Health"}),s.jsx(ve,{className:"text-xs",children:"Enabled"}),s.jsx(ve,{className:"text-right text-xs",children:"Actions"})]})}),s.jsx(Yp,{items:Q.map(U=>U.id),strategy:Gp,children:s.jsx(Pn,{children:Q.map(U=>s.jsx(a4,{account:U,now:Z,busy:c===U.id,onToggle:Y=>void ce(U,Y?"Enabled":"Disabled",()=>pe.patch(`/api/admin/qoder/accounts/${U.id}`,{enabled:Y})).then(()=>V()),onDelete:()=>void ce(U,"Deleted",()=>pe.del(`/api/admin/qoder/accounts/${U.id}`)).then(()=>V()),onChanged:()=>void V()},U.id))})})]})})}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:"Rows per page"}),s.jsxs(zn,{value:E,onValueChange:U=>{z(U),O(1)},children:[s.jsx(jn,{className:"h-7 w-16",children:s.jsx(Ln,{})}),s.jsx(Sn,{children:W_.map(U=>s.jsx(nt,{value:U,children:U},U))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{children:["Page ",W," of ",q]}),s.jsx(le,{size:"sm",variant:"outline","aria-label":"Previous page",disabled:W<=1,onClick:()=>O(W-1),children:s.jsx(G0,{className:"h-3 w-3"})}),s.jsx(le,{size:"sm",variant:"outline","aria-label":"Next page",disabled:W>=q,onClick:()=>O(W+1),children:s.jsx(Hm,{className:"h-3 w-3"})})]})]})]}),s.jsx(ln,{open:x,onOpenChange:y,children:s.jsxs(Kt,{children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"Add a Qoder token"}),s.jsxs(jr,{children:["Paste a personal access token for ",a||"this provider",". It is exchanged immediately and stored encrypted."]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"qoder-token",children:"Personal access token"}),s.jsx(Ee,{id:"qoder-token",type:"password",value:b,onChange:U=>w(U.target.value),placeholder:"pt-…",className:"font-mono"})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"qoder-label",children:"Label (optional)"}),s.jsx(Ee,{id:"qoder-label",value:N,onChange:U=>S(U.target.value),placeholder:"Work account"})]}),D&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:D})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>y(!1),children:"Cancel"}),s.jsx(le,{disabled:C||!b.trim(),onClick:()=>void se(),children:C?"Verifying…":"Add token"})]})]})}),g&&s.jsx(J_,{providerId:n,open:!0,onOpenChange:U=>{U||v(!1)},onImported:()=>void V()})]})}function a4({account:n,now:a,busy:l,onToggle:o,onDelete:c,onChanged:u}){const{attributes:f,listeners:p,setNodeRef:g,transform:v,transition:x,isDragging:y}=Fp({id:n.id,disabled:l}),b=n.label||n.email||n.qoderUserIdMasked||n.id;return s.jsxs(Be,{ref:g,style:{transform:v?`translate3d(${v.x}px, ${v.y}px, 0)`:void 0,transition:x},className:Ce(n.enabled?void 0:"opacity-60",y&&"relative z-10 bg-muted/60 shadow-sm"),children:[s.jsx(fe,{className:"w-8 pr-0",children:s.jsx("button",{className:"cursor-grab text-muted-foreground disabled:cursor-not-allowed","aria-label":`Reorder ${b}`,disabled:l,...f,...p,children:s.jsx($m,{className:"h-4 w-4"})})}),s.jsxs(fe,{children:[s.jsx("div",{className:"text-sm",children:b}),n.email&&n.label&&s.jsx("div",{className:"text-xs text-muted-foreground",children:n.email}),n.lastError&&s.jsx("div",{className:"text-xs text-destructive",children:n.lastError})]}),s.jsx(fe,{className:"font-mono text-xs",children:n.qoderUserIdMasked||"—"}),s.jsx(fe,{className:"text-xs tabular-nums",children:bm(n.jobTokenExpiresAt,a)}),s.jsx(fe,{className:"text-xs tabular-nums",children:n.catalogFetchedAt?`${bm(n.catalogFetchedAt,a)} ago`:"never"}),s.jsx(fe,{children:t4(n,a)}),s.jsx(fe,{children:e4(n.healthState)}),s.jsx(fe,{children:s.jsx(le,{size:"sm",variant:n.enabled?"secondary":"outline",disabled:l,onClick:()=>o(!n.enabled),children:n.enabled?"Enabled":"Disabled"})}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(le,{size:"sm",variant:"outline",disabled:l,onClick:()=>void(async()=>{try{const w=await pe.post(`/api/admin/qoder/accounts/${n.id}/test`);de[w.ok?"success":"error"](`${b}: ${w.detail}${w.modelCount===null?"":` (${w.modelCount} models)`}`),u()}catch(w){de.error(w.message||"Test failed")}})(),children:"Test"}),s.jsx(le,{size:"sm",variant:"outline",disabled:l,onClick:()=>void(async()=>{try{const w=await pe.post(`/api/admin/qoder/accounts/${n.id}/catalog`);de.success(`${b}: ${w.modelCount} models`),u()}catch(w){de.error(w.message||"Catalog refresh failed")}})(),children:"Catalog"}),s.jsx(tg,{children:s.jsxs(_s,{children:[s.jsx(zs,{asChild:!0,children:s.jsx(le,{size:"sm",variant:"outline","aria-label":`Refresh credits for ${b}`,disabled:l,onClick:()=>void(async()=>{try{await pe.post(`/api/admin/qoder/accounts/${n.id}/credits`),de.success(`Credits refreshed: ${b}`),u()}catch(w){de.error(w.message||"Credits refresh failed")}})(),children:s.jsx(li,{className:"h-3 w-3"})})}),s.jsx(ls,{children:"Refresh credits"})]})}),s.jsx(le,{size:"sm",variant:"ghost","aria-label":`Delete ${b}`,disabled:l,onClick:()=>{window.confirm(`Delete the Qoder account ${b}? The stored token is removed permanently.`)&&c()},children:s.jsx(Ql,{className:"h-3 w-3"})})]})})]})}function r4({providerId:n,providerName:a,open:l,onOpenChange:o,onImported:c}){const[u,f]=h.useState([]),[p,g]=h.useState(new Set),[v,x]=h.useState(""),[y,b]=h.useState(!0),[w,N]=h.useState(!1),[S,C]=h.useState(""),R=h.useCallback(async()=>{b(!0),C("");try{const M=await pe.post(`/api/admin/providers/${n}/discover`);f(M.models),g(new Set(M.models.filter(O=>!O.alreadyImported).map(O=>O.upstreamId)))}catch(M){C(M.message||"Unable to fetch Codex models")}finally{b(!1)}},[n]);h.useEffect(()=>{R()},[R]);const D=u.filter(M=>!v||M.upstreamId.toLowerCase().includes(v.toLowerCase())||M.displayName.toLowerCase().includes(v.toLowerCase())),A=async()=>{N(!0),C("");try{const M=await pe.post("/api/admin/models/import",{providerId:n,modelIds:Array.from(p)});de.success(`Imported ${M.imported} of ${M.requested} Codex models`),o(!1),c()}catch(M){C(M.message||"Unable to import models")}finally{N(!1)}};return s.jsx(ln,{open:l,onOpenChange:o,children:s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsxs(Qt,{children:[s.jsxs(Zt,{children:["Import models from ",a]}),s.jsx(jr,{children:"Models are read from the Codex account pool. Nothing is added until you confirm."})]}),y?s.jsxs("p",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[s.jsx(pr,{className:"h-4 w-4 animate-spin"})," Fetching models…"]}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Vm,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ee,{className:"pl-8",placeholder:"Search models…",value:v,onChange:M=>x(M.target.value)})]}),s.jsxs("span",{className:"shrink-0 text-sm text-muted-foreground",children:[D.length," / ",u.length," · ",p.size," selected"]}),s.jsx(le,{variant:"outline",size:"sm",onClick:()=>g(new Set(D.filter(M=>!M.alreadyImported).map(M=>M.upstreamId))),children:"Select All (new)"})]}),s.jsx("div",{className:"max-h-80 overflow-auto rounded-md border",children:D.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:u.length===0?"The Codex account returned no models.":"No model matches your search."}):D.map(M=>s.jsxs("label",{className:"flex cursor-pointer items-center gap-3 border-b px-3 py-2 last:border-0 hover:bg-accent",children:[s.jsx(Cr,{checked:p.has(M.upstreamId),disabled:M.alreadyImported,onCheckedChange:O=>g(E=>{const z=new Set(E);return O===!0?z.add(M.upstreamId):z.delete(M.upstreamId),z})}),s.jsx("span",{className:"flex-1 text-sm",children:M.displayName}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:M.upstreamId}),M.alreadyImported&&s.jsx(We,{variant:"secondary",children:"imported"})]},M.upstreamId))}),S&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>void R(),disabled:y,children:"Refetch"}),s.jsxs(le,{disabled:w||p.size===0,onClick:()=>void A(),children:["Import ",p.size||""]})]})]})})}const ks={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0},s4={openai:"https://api.openai.com",anthropic:"https://api.anthropic.com"},l4=[{type:"codex",label:"Add Codex",hint:"Codex always talks to https://chatgpt.com — the OAuth backend does not exist on api.openai.com."},{type:"qoder",label:"Add Qoder",hint:"Qoder accounts authenticate with a PAT (pt-…) that you add after the provider exists."}];function o4(){const[n,a]=h.useState([]),[l,o]=h.useState(!1),[c,u]=h.useState(ks),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(ks),[N,S]=h.useState(null),[C,R]=h.useState(!1),[D,A]=h.useState(null),[M,O]=h.useState({}),[E,z]=h.useState(null),k=async()=>{try{const H=await pe.get("/api/admin/providers");a(H.providers)}catch(H){de.error(H.message||"Unable to load providers")}};h.useEffect(()=>{k()},[]);const P=async()=>{p(!0);try{let H;if(c.customHeaders.trim())try{H=JSON.parse(c.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await pe.post("/api/admin/providers",{name:c.name,slug:c.slug||void 0,type:c.type,baseUrl:c.baseUrl,apiKey:c.apiKey,customHeaders:H,enabled:c.enabled}),de.success("Provider created"),o(!1),u(ks),k()}catch(H){de.error(H.message)}finally{p(!1)}},Z=async H=>{z(H);try{await pe.post("/api/admin/providers",{type:H}),de.success(`${H==="codex"?"Codex":"Qoder"} provider created — add accounts next`);const _=await pe.get("/api/admin/providers");a(_.providers);const q=_.providers.find(W=>W.type===H);q&&O(W=>({...W,[q.id]:!0}))}catch(_){de.error(_.message)}finally{z(null)}},ee=async H=>{v(H);try{const _=await pe.post(`/api/admin/providers/${H}/test`);de.success(_.ok?`Connection OK: ${_.detail}`:`Failed: ${_.detail}`),k()}catch(_){de.error(_.message)}finally{v(null)}},V=H=>{y(H.id),w({...ks,name:H.name,slug:H.slug||"",type:H.type,baseUrl:H.baseUrl,apiKey:"",customHeaders:"",enabled:H.enabled})},ce=async()=>{if(x){p(!0);try{let H;if(b.customHeaders.trim())try{H=JSON.parse(b.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await pe.patch("/api/admin/providers",{id:x,name:b.name,slug:b.slug||void 0,type:b.type,baseUrl:b.baseUrl,apiKey:b.apiKey||void 0,customHeaders:H,enabled:b.enabled}),de.success("Provider updated"),y(null),w(ks),k()}catch(H){de.error(H.message)}finally{p(!1)}}},se=async H=>{R(!0);try{await pe.del(`/api/admin/providers/${H}`),de.success("Provider removed"),k()}catch(_){de.error(_.message)}finally{R(!1),S(null)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:s.jsxs("div",{className:"flex gap-2",children:[l4.map(H=>{const _=n.find(q=>q.type===H.type);return s.jsxs(le,{variant:"outline",disabled:!!_||E===H.type,title:_?`${_.name} already exists`:H.hint,onClick:()=>void Z(H.type),children:[s.jsx(Kl,{className:"mr-1 h-4 w-4"}),_?`${H.label} (added)`:H.label]},H.type)}),s.jsxs(ln,{open:l,onOpenChange:o,children:[s.jsx(Si,{asChild:!0,children:s.jsx(le,{children:"Add compatible provider"})}),s.jsxs(Kt,{children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"New provider"}),s.jsx(jr,{children:"API-key or compatible endpoint."})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-name",children:"Name"}),s.jsx(Ee,{id:"provider-name",value:c.name,onChange:H=>u({...c,name:H.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-slug",children:"Slug (optional)"}),s.jsx(Ee,{id:"provider-slug",value:c.slug,onChange:H=>u({...c,slug:H.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(zn,{value:c.type,onValueChange:H=>u(_=>({..._,type:H,baseUrl:s4[H]})),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(nt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-base-url",children:"Base URL"}),s.jsx(Ee,{id:"provider-base-url",value:c.baseUrl,onChange:H=>u({...c,baseUrl:H.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-api-key",children:"API key"}),s.jsx(Ee,{id:"provider-api-key",type:"password",value:c.apiKey,onChange:H=>u({...c,apiKey:H.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-headers",children:"Custom headers (JSON)"}),s.jsx(Ee,{id:"provider-headers",value:c.customHeaders,onChange:H=>u({...c,customHeaders:H.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:c.enabled,onCheckedChange:H=>u({...c,enabled:H})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),s.jsx(le,{disabled:f||!c.name||!c.apiKey,onClick:P,children:f?"Creating…":"Create"})]})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"All providers"}),s.jsxs(kn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Name"}),s.jsx(ve,{children:"Type"}),s.jsx(ve,{children:"Base URL"}),s.jsx(ve,{children:"Models"}),s.jsx(ve,{children:"Health"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{className:"text-right",children:"Actions"})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),n.map(H=>s.jsxs(h.Fragment,{children:[s.jsxs(Be,{children:[s.jsxs(fe,{className:"font-medium",children:[H.name," ",s.jsx("span",{className:"text-xs text-muted-foreground",children:H.slug})]}),s.jsx(fe,{children:s.jsx(We,{variant:"outline",children:H.type})}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:H.baseUrl}),s.jsx(fe,{children:H.modelCount}),s.jsx(fe,{children:s.jsx(We,{variant:H.health==="healthy"?"success":H.health==="down"?"destructive":"secondary",children:H.health})}),s.jsx(fe,{children:H.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[(H.type==="codex"||H.type==="qoder")&&s.jsxs(s.Fragment,{children:[s.jsxs(le,{size:"sm",variant:M[H.id]?"secondary":"outline","aria-expanded":!!M[H.id],onClick:()=>O(_=>({..._,[H.id]:!_[H.id]})),children:[M[H.id]?s.jsx(V0,{className:"h-3 w-3"}):s.jsx(Hm,{className:"h-3 w-3"}),s.jsx("span",{className:"ml-1",children:"Accounts"})]}),s.jsxs(le,{size:"sm",variant:"outline",onClick:()=>A(H),children:[s.jsx(qm,{className:"mr-1 h-3 w-3"})," Import models"]})]}),s.jsx(le,{size:"sm",variant:"outline",disabled:g===H.id,onClick:()=>ee(H.id),children:s.jsx(kE,{className:"h-3 w-3"})}),s.jsx(le,{size:"sm",variant:"outline",onClick:()=>V(H),children:"✎"}),s.jsx(le,{size:"sm",variant:"outline",onClick:()=>S(H.id),children:s.jsx(Ql,{className:"h-3 w-3"})})]})})]}),H.type==="codex"&&M[H.id]&&s.jsx(Be,{children:s.jsx(fe,{colSpan:7,className:"bg-muted/30",children:s.jsx(X_,{providerId:H.id,providerName:H.name})})}),H.type==="qoder"&&M[H.id]&&s.jsx(Be,{children:s.jsx(fe,{colSpan:7,className:"bg-muted/30",children:s.jsx(n4,{providerId:H.id,providerName:H.name})})})]},H.id))]})]})})]}),D&&s.jsx(r4,{providerId:D.id,providerName:D.name,open:!0,onOpenChange:H=>{H||A(null)},onImported:()=>void k()}),s.jsx(ln,{open:!!x,onOpenChange:H=>{H||(y(null),w(ks))},children:s.jsxs(Kt,{children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"Edit provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ee,{value:b.name,onChange:H=>w({...b,name:H.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional)"}),s.jsx(Ee,{value:b.slug,onChange:H=>w({...b,slug:H.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(zn,{value:b.type,onValueChange:H=>w({...b,type:H}),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(nt,{value:"anthropic",children:"Anthropic-compatible"}),s.jsx(nt,{value:"codex",children:"Codex OAuth"})]})]})]}),b.type==="codex"?s.jsxs("p",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:[s.jsx($E,{className:"mr-1 inline h-3 w-3"})," Codex credentials live in the account pool — manage them from the Accounts panel."]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(be,{children:"Base URL"}),s.jsx(Ee,{value:b.baseUrl,onChange:H=>w({...b,baseUrl:H.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"API key (leave empty to keep current)"}),s.jsx(Ee,{type:"password",value:b.apiKey,onChange:H=>w({...b,apiKey:H.target.value})})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Custom headers (JSON)"}),s.jsx(Ee,{value:b.customHeaders,onChange:H=>w({...b,customHeaders:H.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:b.enabled,onCheckedChange:H=>w({...b,enabled:H})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>{y(null),w(ks)},children:"Cancel"}),s.jsx(le,{disabled:f||!b.name,onClick:ce,children:"Save changes"})]})]})}),s.jsx(tj,{open:!!N,onOpenChange:H=>{H||S(null)},children:s.jsxs(jp,{children:[s.jsxs(aj,{children:[s.jsx(Sp,{children:"Delete provider?"}),s.jsx(Cp,{children:"This will soft-disable the provider if models depend on it."})]}),s.jsxs(rj,{children:[s.jsx(Ep,{children:"Cancel"}),s.jsx(Np,{disabled:C,onClick:H=>{N&&(H.preventDefault(),se(N))},children:C?"Deleting…":"Delete"})]})]})})]})}const wm=["image_input","audio_input","tools","structured_output","reasoning","chat","streaming"],i4=["unknown","yes","no"];function c4(n,a){return n[a]===!0?"yes":n[a]===!1?"no":"unknown"}function u4(n){const a={};for(const l of wm)a[l]=n[l]==="yes"?!0:n[l]==="no"?!1:null;return a}function d4(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState("all"),[f,p]=h.useState(!1),[g,v]=h.useState(""),[x,y]=h.useState([]),[b,w]=h.useState(new Set),[N,S]=h.useState(!1),[C,R]=h.useState(""),[D,A]=h.useState(""),[M,O]=h.useState(null),[E,z]=h.useState(!1),[k,P]=h.useState(null),[Z,ee]=h.useState(null),[V,ce]=h.useState(null),[se,H]=h.useState({}),[_,q]=h.useState(!1),W=G=>{const ue={};for(const he of wm)ue[he]=c4(G.capabilities,he);H(ue),ce(G)},Q=async()=>{if(V){q(!0);try{await pe.patch("/api/admin/models",{id:V.id,capabilities:u4(se)}),de.success("Capabilities updated"),ce(null),te()}catch(G){de.error(G.message)}finally{q(!1)}}},te=async()=>{const[G,ue]=await Promise.all([pe.get("/api/admin/models"),pe.get("/api/admin/providers")]);a(G.models),o(ue.providers)};h.useEffect(()=>{te()},[]);const L=n.filter(G=>!(c!=="all"&&G.providerId!==c||C&&!G.publicModelId.toLowerCase().includes(C.toLowerCase()))),U=x.filter(G=>{if(!D)return!0;const ue=D.toLowerCase();return G.upstreamId.toLowerCase().includes(ue)||G.displayName.toLowerCase().includes(ue)}),Y=async()=>{if(g){S(!0);try{const G=await pe.post(`/api/admin/providers/${g}/discover`);y(G.models),w(new Set)}catch(G){de.error(G.message)}finally{S(!1)}}},ae=async()=>{if(b.size!==0)try{const G=await pe.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(b)});de.success(`Imported ${G.imported} of ${G.requested}`),p(!1),y([]),w(new Set),te()}catch(G){de.error(G.message)}},ge=async()=>{if(Z)try{await pe.del(`/api/admin/models/${Z.id}`),de.success("Model deleted"),ee(null),te()}catch(G){de.error(G.message)}},ye=async G=>{var he,xe,Ae;O(G),z(!0);const ue=Date.now();P({phase:"streaming",startedAt:ue,text:"",progress:{}});try{const Ne=await gu(`/api/admin/models/${G}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!Ne.ok){const qe=await Ne.text().catch(()=>"");P({phase:"error",model:G,error:`HTTP ${Ne.status}: ${qe}`});return}const Oe=(he=Ne.body)==null?void 0:he.getReader();if(!Oe){P({phase:"error",model:G,error:"No response body"});return}const Qe=new TextDecoder;let et="",ie="",Le=!1;for(;!Le;){const{value:qe,done:_t}=await Oe.read();Le=_t,qe&&(et+=Qe.decode(qe,{stream:!0}));let St;for(;(St=et.indexOf(`
|
|
388
|
-
|
|
389
|
-
`))>=0;){const Wt=et.slice(0,St);et=et.slice(St+2);const mn=Wt.split(`
|
|
390
|
-
`);let en="",Ct="";for(const xn of mn)xn.startsWith("event: ")?en=xn.slice(7):xn.startsWith("data: ")&&(Ct=xn.slice(6));if(Ct){if(en===""||en==="message")try{const At=(xe=JSON.parse(Ct).choices)==null?void 0:xe[0];(Ae=At==null?void 0:At.delta)!=null&&Ae.content&&(ie+=At.delta.content),P(Mt=>{if(!Mt||Mt.phase!=="streaming")return Mt;const pn=Date.now()-ue,pa=Mt.progress.ttftMs??pn;return{...Mt,text:ie,progress:{ttftMs:pa,elapsedMs:pn}}})}catch{}if(en==="test_meta")try{const xn=JSON.parse(Ct);P({phase:"done",model:G,result:xn,text:ie})}catch{}if(en==="test_error")try{const xn=JSON.parse(Ct);P({phase:"error",model:G,error:xn.message})}catch{}}}}P(qe=>!qe||qe.phase==="streaming"?{phase:"error",model:G,error:"Stream ended unexpectedly"}:qe)}catch(Ne){P({phase:"error",model:G,error:Ne.message})}finally{O(null)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"Models",description:"Physical models imported from providers",actions:s.jsxs(ln,{open:f,onOpenChange:p,children:[s.jsx(Si,{asChild:!0,children:s.jsxs(le,{variant:"outline",children:[s.jsx(qm,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"Discover models"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsxs(zn,{value:g,onValueChange:v,children:[s.jsx(jn,{children:s.jsx(Ln,{placeholder:"Choose provider"})}),s.jsx(Sn,{children:l.map(G=>s.jsx(nt,{value:G.id,children:G.name},G.id))})]})}),s.jsx(le,{onClick:Y,disabled:!g||N,children:N?"Fetching…":"Fetch"})]}),x.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Vm,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ee,{className:"pl-8",placeholder:"Search models…",value:D,onChange:G=>A(G.target.value)}),D&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>A(""),children:s.jsx(ku,{className:"h-4 w-4"})})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm text-muted-foreground",children:[U.length," / ",x.length," · ",b.size," selected"]}),s.jsx(le,{variant:"outline",size:"sm",onClick:()=>w(new Set(U.filter(G=>!G.alreadyImported).map(G=>G.upstreamId))),children:"Select All (new)"}),s.jsx(le,{variant:"outline",size:"sm",onClick:()=>w(new Set),children:"Clear"})]})]}),s.jsx("div",{className:"max-h-80 space-y-1 overflow-auto rounded border p-2",children:U.length===0&&x.length>0?s.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):U.map(G=>s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(Cr,{checked:b.has(G.upstreamId),onCheckedChange:ue=>{const he=new Set(b);ue?he.add(G.upstreamId):he.delete(G.upstreamId),w(he)}}),s.jsx("span",{className:"font-mono text-xs",children:G.upstreamId}),G.alreadyImported&&s.jsx(We,{variant:"secondary",children:"imported"})]},G.upstreamId))})]})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsxs(le,{disabled:b.size===0,onClick:ae,children:["Import ",b.size||""]})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"All models"}),s.jsxs(kn,{children:[n.length," total"]})]}),s.jsxs(ot,{children:[s.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[s.jsxs(zn,{value:c,onValueChange:u,children:[s.jsx(jn,{className:"w-56",children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"all",children:"All providers"}),l.map(G=>s.jsx(nt,{value:G.id,children:G.name},G.id))]})]}),s.jsx(Ee,{className:"max-w-xs",placeholder:"Search public ID",value:C,onChange:G=>R(G.target.value)})]}),s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Public ID"}),s.jsx(ve,{children:"Provider"}),s.jsx(ve,{children:"Upstream ID"}),s.jsx(ve,{children:"Capabilities"}),s.jsx(ve,{children:"Available"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{})]})}),s.jsxs(Pn,{children:[L.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),L.map(G=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-mono text-xs",children:G.publicModelId}),s.jsx(fe,{children:G.providerSlug}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:G.upstreamModelId}),s.jsx(fe,{className:"space-x-1",children:Object.entries(G.capabilities).filter(([,ue])=>ue===!0).slice(0,4).map(([ue])=>s.jsx(We,{variant:"outline",className:"mr-1",children:ue},ue))}),s.jsx(fe,{children:G.upstreamAvailable?s.jsx(We,{variant:"success",children:"up"}):s.jsx(We,{variant:"destructive",children:"down"})}),s.jsx(fe,{children:G.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(le,{size:"sm",variant:"outline",onClick:()=>W(G),disabled:M!==null,children:[s.jsx(PE,{className:"h-3.5 w-3.5"})," Capabilities"]}),s.jsxs(le,{size:"sm",variant:"outline",onClick:()=>void ye(G.id),disabled:M!==null,children:[M===G.id?s.jsx(pr,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(RE,{className:"h-3.5 w-3.5"})," Test"]}),s.jsxs(le,{size:"sm",variant:"destructive",onClick:()=>ee(G),disabled:M!==null,children:[s.jsx(Ql,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},G.id))]})]})]})]}),s.jsx(ln,{open:!!Z,onOpenChange:G=>{G||ee(null)},children:s.jsxs(Kt,{className:"max-w-md",children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"Xoá model"})}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("p",{children:["Bạn có chắc muốn xoá model ",s.jsx("span",{className:"font-mono",children:Z==null?void 0:Z.publicModelId}),"?"]}),s.jsx("p",{className:"text-muted-foreground",children:"Model đang được dùng trong combo sẽ bị soft-disable (vô hiệu hoá) thay vì xoá hẳn, để giữ lịch sử và tham chiếu combo."})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>ee(null),children:"Huỷ"}),s.jsx(le,{variant:"destructive",onClick:ge,children:"Xoá"})]})]})}),s.jsx(ln,{open:V!==null,onOpenChange:G=>{G||ce(null)},children:s.jsxs(Kt,{className:"max-w-lg",children:[s.jsx(Qt,{children:s.jsxs(Zt,{children:["Capabilities — ",V==null?void 0:V.publicModelId]})}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.jsx("strong",{children:"Unknown"})," means the router has no verified answer and will attempt the request."," ",s.jsx("strong",{children:"No"})," blocks requests needing that capability (HTTP 400/502 before any upstream call)."]}),wm.map(G=>{var he;const ue=(he=V==null?void 0:V.discoveredCapabilities)==null?void 0:he[G];return s.jsxs("div",{className:"flex items-center justify-between gap-3 rounded px-1 py-1 text-sm hover:bg-accent",children:[s.jsxs("span",{className:"flex items-baseline gap-2",children:[s.jsx("code",{className:"text-xs",children:G}),s.jsx("span",{className:"text-xs text-muted-foreground",children:ue===void 0?"discovered: unknown":`discovered: ${String(ue)}`})]}),s.jsx("div",{className:"flex gap-1",children:i4.map(xe=>s.jsx(le,{size:"sm",variant:se[G]===xe?"default":"outline",onClick:()=>H(Ae=>({...Ae,[G]:xe})),children:xe==="unknown"?"Unknown":xe==="yes"?"Yes":"No"},xe))})]},G)})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>ce(null),children:"Huỷ"}),s.jsx(le,{onClick:Q,disabled:_,children:_?"Saving…":"Lưu"})]})]})}),s.jsx(ln,{open:E,onOpenChange:z,children:s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"Kết quả test model"})}),k&&k.phase==="streaming"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(pr,{className:"h-4 w-4 animate-spin"})," Đang stream…",s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["TTFT ",k.progress.ttftMs!=null?`${k.progress.ttftMs} ms`:"…"]}),s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["· ",k.progress.elapsedMs!=null?`${k.progress.elapsedMs} ms`:"…"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi (streaming)"}),s.jsxs("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:[k.text||s.jsx("span",{className:"text-muted-foreground/60 animate-pulse",children:"waiting for first token…"}),k.phase==="streaming"&&s.jsx("span",{className:"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-primary/70"})]})]})]}),k&&k.phase==="done"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(We,{variant:k.result.success?"success":"destructive",children:k.result.success?"Thành công":"Thất bại"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Thời gian phản hồi"}),s.jsxs("div",{className:"font-mono",children:[k.result.latencyMs," ms"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"TTFT"}),s.jsx("div",{className:"font-mono",children:k.result.ttftMs!=null?`${k.result.ttftMs} ms`:"—"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tokens (in / out)"}),s.jsxs("div",{className:"font-mono",children:[k.result.usage.input," / ",k.result.usage.output]})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi của model"}),s.jsx("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:k.text||k.result.text||"(trống)"})]}),k.result.attempts.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Attempts"}),s.jsx("div",{className:"space-y-1",children:k.result.attempts.map((G,ue)=>s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[s.jsx(We,{variant:G.success?"success":"destructive",children:G.success?"OK":"FAIL"}),s.jsxs("span",{className:"font-mono",children:[G.providerName," / ",G.modelId]}),s.jsxs("span",{className:"text-muted-foreground",children:[G.latencyMs," ms"]}),G.failureReason&&s.jsx("span",{className:"text-destructive",children:G.failureReason})]},ue))})]})]}),k&&k.phase==="error"&&s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx(We,{variant:"destructive",children:"Thất bại"}),s.jsx("p",{className:"text-destructive",children:k.error})]}),s.jsx(Vt,{children:s.jsx(le,{variant:"outline",onClick:()=>z(!1),children:"Đóng"})})]})})]})}const jm=n=>n.map((a,l)=>({...a,position:l}));function f4(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState(!1),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(!1),[b,w]=h.useState(!1),[N,S]=h.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),[C,R]=h.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),D=async()=>{const[k,P]=await Promise.all([pe.get("/api/admin/combos"),pe.get("/api/admin/models")]);a(k.combos),o(P.models)};h.useEffect(()=>{D()},[]);const A=async()=>{if(N.members.length===0){de.error("Add at least one member");return}y(!0);try{await pe.post("/api/admin/combos",{name:N.name,slug:N.slug||void 0,mode:N.mode,enabled:N.enabled,members:N.members}),de.success("Combo created"),u(!1),S({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),D()}catch(k){de.error(k.message)}finally{y(!1)}},M=async k=>{try{const Z=(await pe.get(`/api/admin/combos/${k.id}`)).combo;v(Z.id),R({name:Z.name,slug:Z.publicModelId.startsWith("combo/")?Z.slug:"",mode:Z.mode,enabled:Z.enabled,members:Z.members.map(ee=>({modelId:ee.modelId,weight:ee.weight,position:ee.position,enabled:ee.enabled}))}),p(!0)}catch(P){de.error(P.message)}},O=async()=>{if(g){if(C.members.length===0){de.error("Add at least one member");return}w(!0);try{await pe.patch("/api/admin/combos",{id:g,name:C.name,slug:C.slug||void 0,mode:C.mode,enabled:C.enabled,members:C.members}),de.success("Combo updated"),p(!1),v(null),D()}catch(k){de.error(k.message)}finally{w(!1)}}},E=k=>{R(P=>({...P,members:jm([...P.members,{modelId:k,weight:1,position:P.members.length,enabled:!0}])}))},z=async k=>{if(confirm("Delete this combo?"))try{await pe.del(`/api/admin/combos/${k}`),de.success("Combo removed"),D()}catch(P){de.error(P.message)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"Combos",description:"Virtual models combining physical models",actions:s.jsxs(ln,{open:c,onOpenChange:u,children:[s.jsx(Si,{asChild:!0,children:s.jsxs(le,{children:[s.jsx(Kl,{className:"mr-1 h-4 w-4"})," New combo"]})}),s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"New combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ee,{value:N.name,onChange:k=>S({...N,name:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — empty uses the name as the model ID)"}),s.jsx(Ee,{value:N.slug,onChange:k=>S({...N,slug:k.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Mode"}),s.jsxs(zn,{value:N.mode,onValueChange:k=>S({...N,mode:k}),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(nt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:N.enabled,onCheckedChange:k=>S({...N,enabled:k})}),s.jsx(be,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Members — priority order · drag to reorder"}),s.jsx(d0,{models:l,addedIds:N.members.map(k=>k.modelId),onAdd:E}),s.jsx(u0,{className:"mt-2",members:N.members,label:k=>{var P;return((P=l.find(Z=>Z.id===k.modelId))==null?void 0:P.publicModelId)??k.modelId},onChange:k=>S(P=>({...P,members:k}))})]})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),s.jsx(le,{disabled:!N.name||x,onClick:A,children:x?"Creating…":"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"All combos"}),s.jsxs(kn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Public ID"}),s.jsx(ve,{children:"Mode"}),s.jsx(ve,{children:"Members"}),s.jsx(ve,{children:"Healthy"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No combos yet."})}),n.map(k=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-mono text-xs",children:k.publicModelId}),s.jsx(fe,{children:s.jsx(We,{variant:"outline",children:k.mode})}),s.jsx(fe,{children:k.memberCount}),s.jsx(fe,{children:k.healthyMemberCount}),s.jsx(fe,{children:k.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(le,{size:"sm",variant:"outline",onClick:()=>void M(k),children:[s.jsx(BE,{className:"h-3.5 w-3.5"})," Sửa"]}),s.jsxs(le,{size:"sm",variant:"destructive",onClick:()=>z(k.id),children:[s.jsx(Ql,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},k.id))]})]})})]}),s.jsx(ln,{open:f,onOpenChange:p,children:s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"Edit combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ee,{value:C.name,onChange:k=>R({...C,name:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Ee,{value:C.slug,onChange:k=>R({...C,slug:k.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Mode"}),s.jsxs(zn,{value:C.mode,onValueChange:k=>R({...C,mode:k}),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(nt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:C.enabled,onCheckedChange:k=>R({...C,enabled:k})}),s.jsx(be,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Members — priority order · drag to reorder"}),s.jsx(d0,{models:l,addedIds:C.members.map(k=>k.modelId),onAdd:E}),s.jsx(u0,{className:"mt-2",members:C.members,label:k=>{var P;return((P=l.find(Z=>Z.id===k.modelId))==null?void 0:P.publicModelId)??k.modelId},onChange:k=>R(P=>({...P,members:k}))})]})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(le,{disabled:!C.name||b,onClick:O,children:b?"Saving…":"Save"})]})]})})]})}function u0({members:n,label:a,onChange:l,className:o}){const c=Ip(Vl(Ai,{activationConstraint:{distance:4}}),Vl(Ti,{coordinateGetter:Xp}));if(n.length===0)return s.jsx("p",{className:Ce("text-xs text-muted-foreground",o),children:"No members yet — add at least one."});const u=({active:f,over:p})=>{!p||f.id===p.id||l(jm(Mi(n,Number(f.id),Number(p.id))))};return s.jsx(qp,{sensors:c,collisionDetection:Pp,modifiers:[Vp,$p],onDragEnd:u,children:s.jsx(Yp,{items:n.map((f,p)=>p),strategy:Gp,children:s.jsx("div",{className:Ce("space-y-1",o),children:n.map((f,p)=>s.jsx(h4,{index:p,member:f,label:a(f),onWeight:g=>l(n.map((v,x)=>x===p?{...v,weight:g}:v)),onRemove:()=>l(jm(n.filter((g,v)=>v!==p)))},f.id??f.modelId))})})})}function h4({index:n,member:a,label:l,onWeight:o,onRemove:c}){const{attributes:u,listeners:f,setNodeRef:p,transform:g,transition:v,isDragging:x}=Fp({id:n});return s.jsxs("div",{ref:p,style:{transform:g?`translate3d(${g.x}px, ${g.y}px, 0)`:void 0,transition:v},className:Ce("flex items-center gap-2 rounded border p-2 text-sm",x&&"relative z-10 bg-muted/60 shadow-sm"),children:[s.jsx("button",{type:"button",...u,...f,"aria-label":`Reorder ${l}`,title:"Drag to change priority",className:"cursor-grab touch-none rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground active:cursor-grabbing",children:s.jsx($m,{className:"h-4 w-4"})}),s.jsx("span",{className:"w-5 text-xs tabular-nums text-muted-foreground",children:n+1}),s.jsx("span",{className:"flex-1 font-mono text-xs",children:l}),s.jsx(Ee,{type:"number",min:1,value:a.weight,onChange:y=>o(Number(y.target.value)),className:"w-20","aria-label":`Weight for ${l}`}),s.jsx(le,{size:"sm",variant:"outline",onClick:c,children:"Remove"})]})}function d0({models:n,addedIds:a,onAdd:l}){const[o,c]=h.useState(""),f=(o?n.filter(p=>{const g=o.toLowerCase();return p.publicModelId.toLowerCase().includes(g)||p.displayName.toLowerCase().includes(g)}):n).filter(p=>!a.includes(p.id));return s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Vm,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ee,{className:"pl-8",placeholder:"Search models…",value:o,onChange:p=>c(p.target.value)}),o&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>c(""),children:s.jsx(ku,{className:"h-4 w-4"})})]}),f.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No models match."}):s.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded border p-1",children:f.map(p=>s.jsxs("div",{className:"flex items-center justify-between rounded p-1 text-sm hover:bg-accent",children:[s.jsx("span",{className:"font-mono text-xs",children:p.publicModelId}),s.jsx(le,{size:"sm",variant:"ghost",onClick:()=>l(p.id),children:"+ Add"})]},p.id))})]})}function m4(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState([]),[f,p]=h.useState(!1),[g,v]=h.useState({alias:"",targetKind:"model",targetId:"",enabled:!0}),x=async()=>{const[b,w,N]=await Promise.all([pe.get("/api/admin/aliases"),pe.get("/api/admin/models"),pe.get("/api/admin/combos")]);a(b.aliases),o(w.models),u(N.combos)};h.useEffect(()=>{x()},[]);const y=async()=>{try{await pe.post("/api/admin/aliases",g),de.success("Alias created"),p(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),x()}catch(b){de.error(b.message)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:s.jsxs(ln,{open:f,onOpenChange:p,children:[s.jsx(Si,{asChild:!0,children:s.jsxs(le,{children:[s.jsx(Kl,{className:"mr-1 h-4 w-4"})," New alias"]})}),s.jsxs(Kt,{children:[s.jsx(Qt,{children:s.jsx(Zt,{children:"New alias"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Alias"}),s.jsx(Ee,{value:g.alias,onChange:b=>v({...g,alias:b.target.value}),placeholder:"coding"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Target type"}),s.jsxs(zn,{value:g.targetKind,onValueChange:b=>v({...g,targetKind:b}),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"model",children:"Model"}),s.jsx(nt,{value:"combo",children:"Combo"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Target"}),s.jsxs(zn,{value:g.targetId,onValueChange:b=>v({...g,targetId:b}),children:[s.jsx(jn,{children:s.jsx(Ln,{placeholder:"Choose target"})}),s.jsx(Sn,{children:(g.targetKind==="model"?l:c).map(b=>s.jsx(nt,{value:b.id,children:b.publicModelId},b.id))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:g.enabled,onCheckedChange:b=>v({...g,enabled:b})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(le,{disabled:!g.alias||!g.targetId,onClick:y,children:"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"All aliases"}),s.jsxs(kn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Alias"}),s.jsx(ve,{children:"Target"}),s.jsx(ve,{children:"Type"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),n.map(b=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-mono text-xs",children:b.alias}),s.jsx(fe,{className:"font-mono text-xs",children:b.targetName??b.targetId}),s.jsx(fe,{children:s.jsx(We,{variant:"outline",children:b.targetKind})}),s.jsx(fe,{children:b.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsx(le,{size:"sm",variant:"outline",onClick:async()=>{await pe.del(`/api/admin/aliases/${b.id}`),de.success("Removed"),x()},children:"Delete"})})]},b.id))]})]})})]})]})}function p4(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState([]),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(null),[N,S]=h.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C=async()=>{const[E,z,k]=await Promise.all([pe.get("/api/admin/api-keys"),pe.get("/api/admin/models"),pe.get("/api/admin/combos")]);a(E.apiKeys),o(z.models),u(k.combos)};h.useEffect(()=>{C()},[]);const R=async()=>{try{if(g){await pe.patch("/api/admin/api-keys",{id:g,name:N.name,expiresAt:N.expiresAt||null,allowAllModels:N.allowAll,permissions:N.allowAll?[]:N.permissions,rpmLimit:N.rpmLimit?Number(N.rpmLimit):null,tpmLimit:N.tpmLimit?Number(N.tpmLimit):null,maxConcurrent:N.concurrency?Number(N.concurrency):null}),p(!1),v(null),S({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),de.success("Key updated"),C();return}const E=await pe.post("/api/admin/api-keys",{name:N.name,expiresAt:N.expiresAt||null,allowAllModels:N.allowAll,permissions:N.allowAll?void 0:N.permissions,rpmLimit:N.rpmLimit?Number(N.rpmLimit):null,tpmLimit:N.tpmLimit?Number(N.tpmLimit):null,maxConcurrent:N.concurrency?Number(N.concurrency):null,...N.customSecret.trim()?{secret:N.customSecret.trim()}:{}});p(!1),y({secret:E.secret,name:E.name}),S({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C()}catch(E){de.error(E.message)}},D=async E=>{try{const k=((await pe.get(`/api/admin/api-keys/${E.id}`)).apiKey.permissions??[]).filter(P=>P.targetKind==="model"||P.targetKind==="combo");v(E.id),S({name:E.name,expiresAt:E.expiresAt?E.expiresAt.slice(0,16):"",allowAll:E.allowAllModels,permissions:k,rpmLimit:E.rpmLimit!=null?String(E.rpmLimit):"",tpmLimit:E.tpmLimit!=null?String(E.tpmLimit):"",concurrency:E.concurrencyLimit!=null?String(E.concurrencyLimit):"",customSecret:""}),p(!0)}catch(z){de.error(z.message)}},A=()=>{p(!1),v(null),S({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""})},M=async(E,z)=>{try{await pe.patch("/api/admin/api-keys",{id:E,enabled:!z}),de.success(z?"Key disabled":"Key enabled"),C()}catch(k){de.error(k.message)}},O=async E=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await pe.del(`/api/admin/api-keys/${E}`),de.success("Key deleted"),C()}catch(z){de.error(z.message)}};return s.jsxs("div",{children:[s.jsx(Va,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:s.jsxs(ln,{open:f,onOpenChange:E=>{E?p(!0):A()},children:[s.jsx(Si,{asChild:!0,children:s.jsxs(le,{children:[s.jsx(Kl,{className:"mr-1 h-4 w-4"})," New key"]})}),s.jsxs(Kt,{className:"max-w-2xl",children:[s.jsx(Qt,{children:s.jsx(Zt,{children:g?"Edit API key":"New API key"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ee,{value:N.name,onChange:E=>S({...N,name:E.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Expires (optional)"}),s.jsx(Ee,{type:"datetime-local",value:N.expiresAt,onChange:E=>S({...N,expiresAt:E.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{children:[s.jsx(be,{children:"RPM limit"}),s.jsx(Ee,{value:N.rpmLimit,onChange:E=>S({...N,rpmLimit:E.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TPM limit"}),s.jsx(Ee,{value:N.tpmLimit,onChange:E=>S({...N,tpmLimit:E.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Concurrency"}),s.jsx(Ee,{value:N.concurrency,onChange:E=>S({...N,concurrency:E.target.value}),type:"number"})]})]}),!g&&s.jsxs("div",{children:[s.jsx(be,{children:"Key value (optional)"}),s.jsx(Ee,{value:N.customSecret,onChange:E=>S({...N,customSecret:E.target.value}),placeholder:"Leave empty to auto-generate ld-…"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"If provided, this exact value is stored as the key. Otherwise a random ld-… key is generated."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ha,{checked:N.allowAll,onCheckedChange:E=>S({...N,allowAll:E})}),s.jsx(be,{children:"Allow all current and future models"})]}),!N.allowAll&&s.jsxs("div",{children:[s.jsx(be,{children:"Scope"}),s.jsx("div",{className:"max-h-48 space-y-1 overflow-auto rounded border p-2",children:[...l.map(E=>({targetKind:"model",targetId:E.id,label:E.publicModelId})),...c.map(E=>({targetKind:"combo",targetId:E.id,label:E.publicModelId}))].map(E=>{const z=N.permissions.some(k=>k.targetKind===E.targetKind&&k.targetId===E.targetId);return s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(Cr,{checked:z,onCheckedChange:k=>{S(P=>({...P,permissions:k?[...P.permissions,{targetKind:E.targetKind,targetId:E.targetId}]:P.permissions.filter(Z=>!(Z.targetKind===E.targetKind&&Z.targetId===E.targetId))}))}}),s.jsx("span",{className:"font-mono text-xs",children:E.label}),s.jsx(We,{variant:"outline",className:"ml-1",children:E.targetKind})]},`${E.targetKind}:${E.targetId}`)})})]})]}),s.jsxs(Vt,{children:[s.jsx(le,{variant:"outline",onClick:A,children:"Cancel"}),s.jsx(le,{disabled:!N.name,onClick:R,children:g?"Save changes":"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"All keys"}),s.jsxs(kn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Name"}),s.jsx(ve,{children:"Prefix"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Scope"}),s.jsx(ve,{children:"RPM/TPM/Conc"}),s.jsx(ve,{})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),n.map(E=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-medium",children:E.name}),s.jsxs(fe,{className:"font-mono text-xs",children:[E.keyPrefix,"…"]}),s.jsx(fe,{children:E.enabled?s.jsx(We,{variant:"success",children:"enabled"}):s.jsx(We,{variant:"destructive",children:"disabled"})}),s.jsx(fe,{children:E.allowAllModels?"all":`${E.modelScopeCount} scoped`}),s.jsx(fe,{className:"text-xs",children:[E.rpmLimit,E.tpmLimit,E.concurrencyLimit].map((z,k)=>z?["","RPM","TPM","Conc"][k+1]:null).filter(Boolean).join(" / ")||"—"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[E.secret&&s.jsxs(s.Fragment,{children:[s.jsx(le,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(E.secret),de.success("Copied")},children:s.jsx(ou,{className:"h-3.5 w-3.5"})}),s.jsx(le,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>w({secret:E.secret,name:E.name}),children:s.jsx(NE,{className:"h-3.5 w-3.5"})})]}),s.jsx(le,{size:"sm",variant:"ghost",title:"Edit",onClick:()=>void D(E),children:s.jsx(OE,{className:"h-3.5 w-3.5"})}),s.jsxs(le,{size:"sm",variant:"outline",onClick:()=>M(E.id,E.enabled),children:[E.enabled?s.jsx(mE,{className:"mr-1 h-3.5 w-3.5"}):s.jsx(Ou,{className:"mr-1 h-3.5 w-3.5"}),E.enabled?"Disable":"Enable"]}),s.jsx(le,{size:"sm",variant:"destructive",onClick:()=>O(E.id),children:s.jsx(Ql,{className:"h-3.5 w-3.5"})})]})})]},E.id))]})]})})]}),s.jsx(ln,{open:!!x,onOpenChange:E=>{E||y(null)},children:s.jsxs(Kt,{children:[s.jsxs(Qt,{children:[s.jsx(Zt,{children:"API key created"}),s.jsx(jr,{children:"Copy now — this secret will not be shown again."})]}),s.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:x==null?void 0:x.secret}),s.jsxs(Vt,{children:[s.jsxs(le,{onClick:()=>{x&&(navigator.clipboard.writeText(x.secret),de.success("Copied"))},children:[s.jsx(ou,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(le,{variant:"outline",onClick:()=>y(null),children:"I have saved it"})]})]})}),s.jsx(ln,{open:!!b,onOpenChange:E=>{E||w(null)},children:s.jsxs(Kt,{children:[s.jsxs(Qt,{children:[s.jsxs(Zt,{children:["API key: ",b==null?void 0:b.name]}),s.jsx(jr,{children:"Full secret for this key, readable any time."})]}),s.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:b==null?void 0:b.secret}),s.jsxs(Vt,{children:[s.jsxs(le,{onClick:()=>{b&&(navigator.clipboard.writeText(b.secret),de.success("Copied"))},children:[s.jsx(ou,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(le,{variant:"outline",onClick:()=>w(null),children:"Close"})]})]})})]})}const g4=3e3;function v4(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 x4(){const[n,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(0),[f,p]=h.useState({success:"all",protocol:"all",streaming:"all",model:""}),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(0),N=50,S=h.useRef(Date.now()),C=h.useRef(new Set),R=h.useRef(f);R.current=f;const D=h.useRef(c);D.current=c;const A=h.useCallback(async()=>{const O=new URLSearchParams;O.set("limit",String(N)),O.set("offset",String(c)),f.success!=="all"&&O.set("success",f.success),f.protocol!=="all"&&O.set("protocol",f.protocol),f.streaming!=="all"&&O.set("streaming",f.streaming),f.model&&O.set("requestedModel",f.model);const E=await pe.get(`/api/admin/requests?${O.toString()}`);a(E.requests),o(E.total);for(const z of E.requests)C.current.add(z.id)},[c,f]);h.useEffect(()=>{A()},[A]),h.useEffect(()=>{w(0)},[c,f]),h.useEffect(()=>{let O=!1,E=null;const z=new Set,k=()=>{O||(E=new EventSource(`/api/admin/requests/stream?since=${S.current}`),E.addEventListener("request",P=>{if(!O)try{const Z=JSON.parse(P.data),ee=new Date(Z.createdAt).getTime();if(Number.isFinite(ee)&&(S.current=Math.max(S.current,ee)),C.current.has(Z.id))return;C.current.add(Z.id),w(V=>V+1),D.current===0&&v4(Z,R.current)&&(a(V=>V.some(ce=>ce.id===Z.id)?V:[Z,...V].slice(0,N)),o(V=>V+1))}catch{}}),E.onerror=()=>{E==null||E.close(),E=null,O||z.add(setTimeout(k,g4))})};return k(),()=>{O=!0,E==null||E.close();for(const P of z)clearTimeout(P);z.clear()}},[]);const M=async O=>{v(O);const E=await pe.get(`/api/admin/requests/${O}`);y(E)};return s.jsxs("div",{children:[s.jsx(Va,{title:"Requests",description:`${l} matching · live updates`}),s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(zn,{value:f.success,onValueChange:O=>{u(0),p({...f,success:O})},children:[s.jsx(jn,{className:"w-36",children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"all",children:"All"}),s.jsx(nt,{value:"true",children:"Success"}),s.jsx(nt,{value:"false",children:"Failed"})]})]}),s.jsxs(zn,{value:f.protocol,onValueChange:O=>{u(0),p({...f,protocol:O})},children:[s.jsx(jn,{className:"w-32",children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"all",children:"Any protocol"}),s.jsx(nt,{value:"openai",children:"OpenAI"}),s.jsx(nt,{value:"anthropic",children:"Anthropic"})]})]}),s.jsxs(zn,{value:f.streaming,onValueChange:O=>{u(0),p({...f,streaming:O})},children:[s.jsx(jn,{className:"w-32",children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"all",children:"Any"}),s.jsx(nt,{value:"true",children:"Streaming"}),s.jsx(nt,{value:"false",children:"Non-stream"})]})]}),s.jsx(Ee,{className:"max-w-xs",placeholder:"Model contains…",value:f.model,onChange:O=>{u(0),p({...f,model:O.target.value})}}),b>0&&s.jsxs(le,{size:"sm",variant:"secondary",onClick:()=>{w(0),A()},children:[b," new request",b>1?"s":""," — refresh"]})]}),s.jsx(lt,{className:"mt-3 text-base",children:"Results"})]}),s.jsxs(ot,{children:[s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Time"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Requested"}),s.jsx(ve,{children:"Final"}),s.jsx(ve,{children:"Tokens"}),s.jsx(ve,{children:"Latency"}),s.jsx(ve,{children:"Attempts"}),s.jsx(ve,{children:"Key"}),s.jsx(ve,{children:"IP"}),s.jsx(ve,{})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),n.map(O=>s.jsxs(Be,{className:"cursor-pointer",onClick:()=>M(O.id),children:[s.jsx(fe,{className:"text-xs",children:Ym(O.createdAt)}),s.jsx(fe,{children:O.success?s.jsx(We,{variant:"success",children:O.httpStatus}):s.jsx(We,{variant:"destructive",children:O.httpStatus})}),s.jsx(fe,{className:"font-mono text-xs",children:O.requestedModel}),s.jsx(fe,{className:"font-mono text-xs text-muted-foreground",children:O.finalModelPublicId??"—"}),s.jsxs(fe,{className:"text-xs",children:[Xt(O.inputTokens+O.outputTokens)," ",O.cacheReadTokens?s.jsxs("span",{className:"text-amber-600",children:["(+",O.cacheReadTokens," cache)"]}):null]}),s.jsxs(fe,{className:"text-xs",children:[Is(O.totalLatencyMs),O.ttftMs?s.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",O.ttftMs,"ms"]}):null]}),s.jsxs(fe,{className:"text-xs",children:[O.attemptsCount,O.gatewayCacheHit?s.jsx(We,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),s.jsx(fe,{className:"text-xs",children:O.apiKeyName??"—"}),s.jsx(fe,{className:"text-xs",children:O.clientIp}),s.jsx(fe,{className:"text-right",children:s.jsx(le,{size:"sm",variant:"ghost",children:"View"})})]},O.id))]})]}),s.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Showing ",c+1,"–",Math.min(c+N,l)," of ",l]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(le,{size:"sm",variant:"outline",disabled:c===0,onClick:()=>u(Math.max(0,c-N)),children:"Prev"}),s.jsx(le,{size:"sm",variant:"outline",disabled:c+N>=l,onClick:()=>u(c+N),children:"Next"})]})]})]})]}),s.jsx(ln,{open:!!g,onOpenChange:O=>{O||(v(null),y(null))},children:s.jsxs(Kt,{className:"max-w-3xl",children:[s.jsx(Qt,{children:s.jsxs(Zt,{children:["Request ",CR(g,16)]})}),x?s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Status"}),x.request.success?s.jsx(We,{variant:"success",children:x.request.httpStatus}):s.jsx(We,{variant:"destructive",children:x.request.httpStatus})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),Is(x.request.totalLatencyMs)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Xt(x.request.inputTokens)," · out ",Xt(x.request.outputTokens)," · cache ",Xt(x.request.cacheReadTokens)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Attempts"}),x.request.attemptsCount]})]}),x.request.errorType&&s.jsxs("div",{className:"rounded border border-destructive/40 bg-destructive/10 p-2",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Error"}),s.jsxs("div",{className:"font-mono text-xs",children:[x.request.errorType,": ",x.request.errorMessage]})]}),x.request.requestPayload&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Request content"}),s.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&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Response content"}),s.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&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Attempts"}),s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"#"}),s.jsx(ve,{children:"Provider"}),s.jsx(ve,{children:"Model"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Latency"}),s.jsx(ve,{children:"Reason"})]})}),s.jsx(Pn,{children:x.attempts.map(O=>s.jsxs(Be,{children:[s.jsx(fe,{children:O.attemptNumber}),s.jsx(fe,{children:O.providerName}),s.jsx(fe,{className:"font-mono text-xs",children:O.modelPublicId}),s.jsx(fe,{children:O.success?s.jsx(We,{variant:"success",children:String(O.statusCode??"OK")}):s.jsx(We,{variant:"destructive",children:String(O.statusCode??"err")})}),s.jsx(fe,{className:"text-xs",children:Is(O.latencyMs)}),s.jsx(fe,{className:"text-xs",children:O.failureReason??O.selectionReason})]},O.id))})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}var y4=Object.defineProperty,so=(n,a)=>y4(n,"name",{value:a,configurable:!0}),ng="Tabs",[b4,E5]=Hn(ng,[Gu]),Wj=Gu(),[w4,ag]=b4(ng),j4=h.forwardRef(so(function(a,l){const{__scopeTabs:o,value:c,onValueChange:u,defaultValue:f,orientation:p="horizontal",dir:g,activationMode:v="automatic",...x}=a,y=bi(g),[b,w]=Ia({prop:c,onChange:u,defaultProp:f??"",caller:ng});return s.jsx(w4,{scope:o,baseId:Na(),value:b,onValueChange:w,orientation:p,dir:y,activationMode:v,children:s.jsx(He.div,{dir:y,"data-orientation":p,...x,ref:l})})},"Tabs")),S4="TabsList",C4=h.forwardRef(so(function(a,l){const{__scopeTabs:o,loop:c=!0,...u}=a,f=ag(S4,o),p=Wj(o);return s.jsx(iw,{asChild:!0,...p,orientation:f.orientation,dir:f.dir,loop:c,children:s.jsx(He.div,{role:"tablist","aria-orientation":f.orientation,...u,ref:l})})},"TabsList")),N4="TabsTrigger",E4=h.forwardRef(so(function(a,l){const{__scopeTabs:o,value:c,disabled:u=!1,...f}=a,p=ag(N4,o),g=Wj(o),v=rg(p.baseId,c),x=sg(p.baseId,c),y=c===p.value;return s.jsx(cw,{asChild:!0,...g,focusable:!u,active:y,children:s.jsx(He.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":x,"data-state":y?"active":"inactive","data-disabled":u?"":void 0,disabled:u,id:v,...f,ref:l,onMouseDown:Se(a.onMouseDown,b=>{!u&&b.button===0&&b.ctrlKey===!1?p.onValueChange(c):b.preventDefault()}),onKeyDown:Se(a.onKeyDown,b=>{u||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&p.onValueChange(c)}),onFocus:Se(a.onFocus,()=>{const b=p.activationMode!=="manual";!y&&!u&&b&&p.onValueChange(c)})})})},"TabsTrigger")),R4="TabsContent",T4=h.forwardRef(so(function(a,l){const{__scopeTabs:o,value:c,forceMount:u,children:f,...p}=a,g=ag(R4,o),v=rg(g.baseId,c),x=sg(g.baseId,c),y=c===g.value,b=h.useRef(y);return h.useEffect(()=>{const w=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(w)},[]),s.jsx(Er,{present:u||y,children:({present:w})=>s.jsx(He.div,{"data-state":y?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:x,tabIndex:0,...p,ref:l,style:{...a.style,animationDuration:b.current?"0s":void 0},children:w&&f})})},"TabsContent"));function rg(n,a){return`${n}-trigger-${a}`}so(rg,"makeTriggerId");function sg(n,a){return`${n}-content-${a}`}so(sg,"makeContentId");var A4=j4,eS=C4,tS=E4,nS=T4;const aS=A4,lg=h.forwardRef(({className:n,...a},l)=>s.jsx(eS,{ref:l,className:Ce("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...a}));lg.displayName=eS.displayName;const mr=h.forwardRef(({className:n,...a},l)=>s.jsx(tS,{ref:l,className:Ce("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",n),...a}));mr.displayName=tS.displayName;const Il=h.forwardRef(({className:n,...a},l)=>s.jsx(nS,{ref:l,className:Ce("mt-2 ring-offset-background focus-visible:outline-none",n),...a}));Il.displayName=nS.displayName;const M4=3e3,D4=1600,O4=10,k4=3,_4=12,z4=10*6e4;function L4(n,a){return{...n,totalRequests:n.totalRequests+1,successfulRequests:n.successfulRequests+(a.success?1:0),failedRequests:n.failedRequests+(a.success?0:1),successRate:n.totalRequests+1?(n.successfulRequests+(a.success?1:0))/(n.totalRequests+1):0,inputTokens:n.inputTokens+a.inputTokens,outputTokens:n.outputTokens+a.outputTokens,totalTokens:n.totalTokens+a.inputTokens+a.outputTokens,cacheReadTokens:n.cacheReadTokens+a.cacheReadTokens,averageLatencyMs:(n.averageLatencyMs*n.totalRequests+a.totalLatencyMs)/(n.totalRequests+1)}}function U4(n){const[a,l]=h.useState(null),[o,c]=h.useState(null),[u,f]=h.useState([]),[p,g]=h.useState([]),[v,x]=h.useState([]),[y,b]=h.useState([]),[w,N]=h.useState(!0),[S,C]=h.useState(null),R=h.useRef([]),D=h.useRef(null),A=h.useRef(new Set),M=h.useRef(Date.now()),O=h.useRef(0),E=h.useRef([]),z=h.useRef([]);return h.useEffect(()=>{let k=!1;return N(!0),C(null),A.current=new Set,M.current=Date.now(),pe.get(`/api/admin/stats?preset=${n}`).then(P=>{if(!k){l(P),c(P.summary),D.current=P.summary,f(P.recent),g(P.providers),R.current=P.providers;for(const Z of P.recent)A.current.add(Z.id);N(!1)}}).catch(P=>{k||(C(P.message),N(!1))}),()=>{k=!0}},[n]),h.useEffect(()=>{let k=!1,P=null;const Z=new Set,ee=()=>{k||(P=new EventSource(`/api/admin/requests/stream?since=${M.current}`),P.addEventListener("request",ce=>{if(!k)try{const se=JSON.parse(ce.data),H=new Date(se.createdAt).getTime();if(Number.isFinite(H)&&(M.current=Math.max(M.current,H)),A.current.has(se.id))return;if(A.current.add(se.id),D.current&&c(L4(D.current,se)),f(_=>_.some(q=>q.id===se.id)?_:[se,..._].slice(0,O4)),se.providerId){R.current=R.current.map(Q=>Q.id===se.providerId?{...Q,requests:Q.requests+1,errorRate:Q.requests+1?(Q.errorRate*Q.requests+(se.success?0:1))/(Q.requests+1):0}:Q),g(R.current);const _=`p${++O.current}`,q={id:_,providerId:se.providerId,success:se.success};E.current=[...E.current.slice(-(k4*4)),q],x(E.current);const W=setTimeout(()=>{E.current=E.current.filter(Q=>Q.id!==_),x(E.current)},D4);Z.add(W)}z.current.some(_=>_.id===se.id)&&(z.current=z.current.filter(_=>_.id!==se.id),b(z.current))}catch{}}),P.addEventListener("request_started",ce=>{if(!k)try{const se=JSON.parse(ce.data);if(!se.providerId||se.providerId==="")return;z.current=[...z.current.filter(H=>H.id!==se.requestId).slice(-(_4-1)),{id:se.requestId,providerId:se.providerId,startedAt:Date.now(),ttftMs:se.ttftMs??0}],b(z.current)}catch{}}),P.onerror=()=>{P==null||P.close(),P=null,k||Z.add(setTimeout(ee,M4))})};ee();const V=setInterval(()=>{const ce=Date.now()-z4;z.current.some(se=>se.startedAt<ce)&&(z.current=z.current.filter(se=>se.startedAt>=ce),b(z.current))},3e4);return()=>{k=!0,P==null||P.close();for(const ce of Z)clearTimeout(ce);Z.clear(),clearInterval(V)}},[]),h.useEffect(()=>{const k=setInterval(()=>{pe.get("/api/admin/providers").then(P=>{const Z=new Map(P.providers.map(ee=>[ee.id,ee]));R.current=R.current.map(ee=>{const V=Z.get(ee.id);return V?{...ee,health:V.health,enabled:V.enabled}:ee}),g(R.current)}).catch(()=>{})},3e4);return()=>clearInterval(k)},[]),{snapshot:a,live:o??(a==null?void 0:a.summary)??I4,recent:u,providers:p,pulses:v,activeRoutes:y,loading:w,error:S}}const I4={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 rS({data:n,className:a,strokeClass:l="stroke-primary",fillClass:o}){if(n.length===0)return s.jsx("svg",{className:Ce("h-6 w-20",a),viewBox:"0 0 80 24"});const f=Math.max(...n),p=Math.min(...n),g=f-p||1,x=n.map((y,b)=>{const w=b/(n.length-1)*78+1,N=22-(y-p)/g*20;return`${w.toFixed(1)},${N.toFixed(1)}`}).join(" ");return s.jsxs("svg",{className:Ce("h-6 w-20",a),viewBox:"0 0 80 24",preserveAspectRatio:"none",children:[o&&s.jsx("polygon",{points:`1,23 ${x} 79,23`,className:o}),s.jsx("polyline",{points:x,fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:l})]})}function P4(n,a,l){const o=performance.now();let c=0;const u=f=>{const p=Math.min((f-o)/a,1),g=Math.round(n*p);g!==c&&(c=g,l(g)),p<1&&requestAnimationFrame(u)};requestAnimationFrame(u)}function B4({delta:n,inverse:a}){if(Math.abs(n)<.005)return null;const l=n>0,o=a?!l:l,c=`${(Math.abs(n)*100).toFixed(1)}%`;return s.jsxs("span",{className:Ce("ml-1.5 inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold leading-none",o?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"),children:[s.jsx("span",{className:"mr-0.5",children:l?"▲":"▼"}),c]})}function ns({icon:n,label:a,value:l,format:o="number",delta:c,deltaInverse:u,sparkData:f,sparkStroke:p}){const[g,v]=h.useState(0),x=h.useRef(0);h.useEffect(()=>{const b=x.current,w=l;x.current=l,b!==w&&P4(Math.abs(w-b),600,N=>v(b+(w>b?N:-N)))},[l]);const y=o==="percent"?_u(g):o==="latency"?Is(g):Xt(Math.round(g));return s.jsxs(rt,{children:[s.jsxs(st,{className:"flex flex-row items-center justify-between pb-1",children:[s.jsxs(lt,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(n,{className:"h-4 w-4"}),a]}),c!==void 0&&s.jsx(B4,{delta:c,inverse:u})]}),s.jsxs(ot,{className:"flex items-end justify-between",children:[s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:y}),f&&f.length>1&&s.jsx(rS,{data:f,strokeClass:p??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const sS=1e3,f0=380,tu=60,as=sS/2,rs=720,Hh=62,H4=260;function q4(n){return n==="healthy"?"fill-emerald-400":n==="degraded"?"fill-amber-400":"fill-red-400"}function nu(n,a,l,o){const c=n+(l-n)*.45,u=n+(l-n)*.55;return`M${n},${a} C${c},${a} ${u},${o} ${l},${o}`}function $4({liveRequests:n,successRate:a,providers:l,pulses:o,activeRoutes:c}){const u=f0/2,f=u,p=Math.max(1,l.reduce((x,y)=>x+y.requests,0)),g=new Set(c.map(x=>x.providerId)),v=g.size>0;return s.jsxs(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(lt,{className:"text-base",children:"Real-time Request Routing"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-emerald-400"})," healthy"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-400"})," degraded"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-red-400"})," down"]})]})]})}),s.jsx(ot,{className:"pt-0",children:s.jsx("div",{className:"relative w-full",children:s.jsxs("svg",{viewBox:`0 0 ${sS} ${f0}`,className:"w-full h-auto",preserveAspectRatio:"xMidYMid meet",children:[s.jsx("defs",{children:s.jsxs("filter",{id:"glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[s.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),s.jsxs("feMerge",{children:[s.jsx("feMergeNode",{in:"blur"}),s.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),l.map(x=>{const b=60+l.indexOf(x)*Hh,w=x.requests/p,N=Math.max(1.5,Math.min(6,2+w*8)),S=g.has(x.id);return s.jsxs("g",{children:[S&&s.jsx("path",{d:nu(as,u,rs-20,b),fill:"none",stroke:"hsl(var(--primary) / 0.25)",strokeWidth:N+6,strokeLinecap:"round"}),s.jsx("path",{d:nu(as,u,rs-20,b),fill:"none",stroke:S?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:S?N+1:N,strokeLinecap:"round",opacity:S?.95:.6,className:S?"route-active":void 0})]},x.id)}),s.jsx("path",{d:nu(tu+30,f,as-30,u),fill:"none",stroke:v?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:3,strokeLinecap:"round",strokeDasharray:"6 3",opacity:v?.9:.5,className:v?"route-active":void 0}),o.map(x=>{const y=l.findIndex(S=>S.id===x.providerId);if(y===-1)return null;const b=60+y*Hh,w=nu(as,u,rs-20,b),N=x.success?"var(--primary)":"#f87171";return s.jsxs("g",{filter:"url(#glow)",children:[s.jsx("circle",{r:5,fill:N,opacity:.9,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})}),s.jsx("circle",{r:9,fill:N,opacity:.25,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})})]},x.id)}),s.jsx("circle",{cx:tu,cy:f,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),s.jsx("text",{x:tu,y:f-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:h0(n)}),s.jsx("text",{x:tu,y:f+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),s.jsx("circle",{cx:as,cy:u,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),s.jsx("image",{x:as-12,y:u-16,width:24,height:24,href:"/logo.png"}),s.jsx("text",{x:as,y:u+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),s.jsxs("text",{x:as,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*Hh,w=x.requests/p,N=!x.enabled||x.requests===0;return s.jsxs("g",{opacity:N?.4:1,children:[s.jsx("rect",{x:rs-20,y:b-14,width:H4,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),s.jsx("circle",{cx:rs-6,cy:b+10,r:4,className:q4(x.health)}),s.jsx("text",{x:rs+6,y:b-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:x.name}),s.jsxs("text",{x:rs+6,y:b+12,className:"fill-muted-foreground",fontSize:10,children:[x.modelCount," model",x.modelCount!==1?"s":""," · ",h0(x.requests)," req"]}),s.jsxs("text",{x:rs+6,y:b+25,className:"fill-muted-foreground",fontSize:10,children:[(w*100).toFixed(1),"% traffic · ",x.avgLatencyMs<1e3?`${Math.round(x.avgLatencyMs)}ms`:`${(x.avgLatencyMs/1e3).toFixed(1)}s`," avg",x.errorRate>0&&s.jsxs("tspan",{className:"fill-red-500",children:[" · ",(x.errorRate*100).toFixed(0),"% err"]})]})]},x.id)})]})})})]})}function h0(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}function V4({rows:n}){return s.jsxs(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Recent Requests"})}),s.jsx(ot,{children:n.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No requests yet — traffic will appear here live."}):s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Model"}),s.jsx(ve,{children:"Provider"}),s.jsx(ve,{children:"Tokens"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Time"})]})}),s.jsx(Pn,{children:n.map(a=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-mono text-xs",children:a.requestedModel}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:a.providerName??"—"}),s.jsxs(fe,{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["in ",Xt(a.inputTokens)," · out ",Xt(a.outputTokens)]}),a.cacheReadTokens>0&&s.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",Xt(a.cacheReadTokens)," cache)"]})]}),s.jsx(fe,{children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:a.success?"h-2 w-2 rounded-full bg-emerald-400":"h-2 w-2 rounded-full bg-red-400"}),s.jsx("span",{className:"text-xs",children:a.success?a.httpStatus:`${a.httpStatus} err`})]})}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:NR(a.createdAt)})]},a.id))})]})})]})}const Sm=34,m0=2*Math.PI*Sm;function G4(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 Y4({successRate:n,averageLatencyMs:a,latencySpark:l}){const{stroke:o,text:c}=G4(n),u=Math.min(1,Math.max(0,n)),f=m0*(1-u);return s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Success Rate"})}),s.jsxs(ot,{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"relative h-20 w-20",children:[s.jsxs("svg",{viewBox:"0 0 80 80",className:"h-20 w-20 -rotate-90",children:[s.jsx("circle",{cx:"40",cy:"40",r:Sm,fill:"none",stroke:"hsl(var(--border))",strokeWidth:7}),s.jsx("circle",{cx:"40",cy:"40",r:Sm,fill:"none",stroke:o,strokeWidth:7,strokeLinecap:"round",strokeDasharray:m0,strokeDashoffset:f,style:{transition:"stroke-dashoffset 0.6s ease, stroke 0.4s ease"}})]}),s.jsx("span",{className:`absolute inset-0 flex items-center justify-center text-sm font-semibold tabular-nums ${c}`,children:_u(n)})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Share of requests that completed successfully over the selected window. Updated in real time."})]})]}),s.jsxs(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Average Latency"})}),s.jsxs(ot,{className:"flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:Is(a)}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Live average across the selected window"})]}),s.jsx(rS,{data:l,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function F4(){const[n,a]=h.useState("7d"),{snapshot:l,live:o,recent:c,providers:u,pulses:f,activeRoutes:p,loading:g,error:v}=U4(n);if(g)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(v||!l)return s.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",v??"unknown error"]});const x=o,y=l.previous,b=l.series;function w(C,R){return R>0?(C-R)/R:void 0}const N=b.map(C=>C.requests),S=b.map(C=>C.avgLatency);return s.jsxs("div",{children:[s.jsx(Va,{title:"Statistics",description:"Real-time monitoring dashboard",actions:s.jsx(aS,{value:n,onValueChange:C=>void a(C),children:s.jsxs(lg,{children:[s.jsx(mr,{value:"today",children:"Today"}),s.jsx(mr,{value:"7d",children:"7 days"}),s.jsx(mr,{value:"30d",children:"30 days"})]})})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsx(ns,{icon:$0,label:"Requests",value:x.totalRequests,delta:w(x.totalRequests,y.totalRequests),sparkData:N}),s.jsx(ns,{icon:Ou,label:"Success rate",format:"percent",value:x.successRate,delta:w(x.successRate,y.successRate),sparkData:N,sparkStroke:"stroke-emerald-500"}),s.jsx(ns,{icon:jE,label:"Total tokens",value:x.totalTokens,delta:w(x.totalTokens,y.totalTokens),sparkData:b.map(C=>C.inputTokens+C.outputTokens)}),s.jsx(ns,{icon:SE,label:"Cache hit rate",format:"percent",value:x.cacheHitRate,delta:w(x.cacheHitRate,y.cacheHitRate),sparkData:b.map(C=>C.cacheRead)}),s.jsx(ns,{icon:yE,label:"Avg latency",format:"latency",value:x.averageLatencyMs,delta:w(x.averageLatencyMs,y.averageLatencyMs),deltaInverse:!0,sparkData:S,sparkStroke:"stroke-amber-500"}),s.jsx(ns,{icon:Y0,label:"p95 latency",format:"latency",value:x.p95LatencyMs}),s.jsx(ns,{icon:qE,label:"Avg TTFT",format:"latency",value:x.averageTtftMs??0}),s.jsx(ns,{icon:zE,label:"Fallback rate",format:"percent",value:x.fallbackRate,delta:w(x.fallbackRate,y.fallbackRate),deltaInverse:!0})]}),s.jsx("div",{className:"mt-6",children:s.jsx($4,{liveRequests:x.totalRequests,successRate:x.successRate,providers:u,pulses:f,activeRoutes:p})}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-3",children:[s.jsx("div",{className:"lg:col-span-2",children:s.jsx(V4,{rows:c})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Top Models"})}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Model"}),s.jsx(ve,{children:"Req"}),s.jsx(ve,{children:"Errors"}),s.jsx(ve,{children:"Tokens"})]})}),s.jsxs(Pn,{children:[l.topModels.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),l.topModels.map(C=>s.jsxs(Be,{children:[s.jsx(fe,{className:"font-mono text-xs",children:C.publicId}),s.jsx(fe,{className:"text-xs",children:Xt(C.requests)}),s.jsx(fe,{className:"text-xs",children:s.jsx("span",{className:C.errorRate>.1?"text-destructive":"text-muted-foreground",children:_u(C.errorRate)})}),s.jsx(fe,{className:"text-xs",children:Xt(C.totalTokens)})]},C.publicId))]})]})})]}),s.jsxs(rt,{children:[s.jsx(st,{className:"pb-2",children:s.jsx(lt,{className:"text-base",children:"Top API Keys"})}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Key"}),s.jsx(ve,{children:"Requests"}),s.jsx(ve,{children:"Tokens"})]})}),s.jsxs(Pn,{children:[l.topApiKeys.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),l.topApiKeys.map((C,R)=>s.jsxs(Be,{children:[s.jsx(fe,{className:"text-xs",children:C.name}),s.jsx(fe,{className:"text-xs",children:Xt(C.requests)}),s.jsx(fe,{className:"text-xs",children:Xt(C.totalTokens)})]},R))]})]})})]})]})]}),s.jsx("div",{className:"mt-6",children:s.jsx(Y4,{successRate:x.successRate,averageLatencyMs:x.averageLatencyMs,latencySpark:S})})]})}function X4(){const[n,a]=h.useState([]),[l,o]=h.useState(0);return h.useEffect(()=>{pe.get("/api/admin/audit?limit=200").then(c=>{a(c.rows),o(c.total)})},[]),s.jsxs("div",{children:[s.jsx(Va,{title:"Audit Logs",description:`${l} entries · immutable`}),s.jsxs(rt,{children:[s.jsx(st,{children:s.jsx(lt,{className:"text-base",children:"All entries"})}),s.jsx(ot,{children:s.jsxs(Un,{children:[s.jsx(In,{children:s.jsxs(Be,{children:[s.jsx(ve,{children:"Time"}),s.jsx(ve,{children:"Action"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Target"}),s.jsx(ve,{children:"IP"}),s.jsx(ve,{children:"Actor"})]})}),s.jsxs(Pn,{children:[n.length===0&&s.jsx(Be,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),n.map(c=>s.jsxs(Be,{children:[s.jsx(fe,{className:"text-xs",children:Ym(c.createdAt)}),s.jsx(fe,{className:"font-mono text-xs",children:c.action}),s.jsx(fe,{children:c.success?s.jsx(We,{variant:"success",children:"ok"}):s.jsx(We,{variant:"destructive",children:"fail"})}),s.jsx(fe,{className:"text-xs",children:c.targetName??c.targetId??"—"}),s.jsx(fe,{className:"text-xs",children:c.ip}),s.jsx(fe,{className:"text-xs",children:c.actor})]},c.id))]})]})})]})]})}const Cm={enabled:!0,sound:!0};let pi=Cm,Nm=!1,au=null;const Em=new Set;function lS(){for(const n of Em)n()}function oS(n=!1){return Nm&&!n?Promise.resolve():(!n&&au||(au=(async()=>{try{const a=await pe.get("/api/admin/settings");pi={enabled:a.settings.notificationsEnabled??Cm.enabled,sound:a.settings.notificationSoundEnabled??Cm.sound},Nm=!0,lS()}catch{}})()),au)}async function p0(n){const a={};n.enabled!==void 0&&(a.notificationsEnabled=n.enabled),n.sound!==void 0&&(a.notificationSoundEnabled=n.sound),await pe.patch("/api/admin/settings",a),pi={...pi,...n},Nm=!0,lS()}function K4(n){return Em.add(n),()=>Em.delete(n)}function iS(){return h.useSyncExternalStore(K4,()=>pi,()=>pi)}function Q4(){const[n]=aE(),[a,l]=h.useState(null),[o,c]=h.useState(null),[u,f]=h.useState({current:"",next:""}),[p,g]=h.useState(""),[v,x]=h.useState(""),[y,b]=h.useState(null),[w,N]=h.useState(!1),[S,C]=h.useState("idle"),[R,D]=h.useState(null),A=async(ie=!1)=>{C("checking"),D(null);try{const Le=await pe.get(`/api/admin/update/check${ie?"?force=1":""}`);b(Le),C("idle")}catch(Le){D(Le.message),C("error")}},M=async()=>{N(!0),C("installing"),D(null);try{const ie=await pe.post("/api/admin/update/run");C("restarting"),de.success(ie.message||"Update started — the gateway will restart shortly.");const Le=setInterval(()=>{fetch("/health").then(qe=>{qe.ok&&(clearInterval(Le),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(Le),12e4)}catch(ie){de.error(ie.message),D(ie.message),C("error")}finally{N(!1)}},[O,E]=h.useState("disabled"),[z,k]=h.useState(""),[P,Z]=h.useState(""),[ee,V]=h.useState(""),[ce,se]=h.useState([]),[H,_]=h.useState(""),[q,W]=h.useState(""),[Q,te]=h.useState(!1),[L,U]=h.useState(null),[Y,ae]=h.useState(""),[ge,ye]=h.useState(""),[G,ue]=h.useState(""),he=async()=>{const ie=await pe.get("/api/admin/settings");l(ie.settings),g(ie.settings.adminIpAllow??""),x(ie.settings.adminIpBlock??"");const Le=await pe.get("/api/admin/settings/system");c(Le);try{const qe=await pe.get("/api/admin/me");E(qe.totpEnabled?"enabled":"disabled")}catch{}};if(h.useEffect(()=>{oS(!0)},[]),h.useEffect(()=>{he(),A(!0)},[]),!a)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const xe=async ie=>{try{await pe.patch("/api/admin/settings",ie),de.success("Saved"),he()}catch(Le){de.error(Le.message)}},Ae=async()=>{try{const ie=await pe.post("/api/admin/account/totp/begin");k(ie.secret),Z(ie.qr),E("setup"),de.info("Scan the QR code with your authenticator app")}catch(ie){de.error(ie.message)}},Ne=async()=>{if(!ee||ee.length!==6){de.error("Enter a 6-digit code");return}try{const ie=await pe.post("/api/admin/account/totp/verify",{code:ee});se(ie.recoveryCodes),E("showingRecovery"),de.success("TOTP enabled successfully")}catch(ie){de.error(ie.message)}},Oe=async()=>{if(!H){de.error("Enter your password");return}if(!q){de.error("Enter a TOTP code or recovery code");return}try{await pe.post("/api/admin/account/totp/disable",{password:H,totp:q}),E("disabled"),_(""),W(""),de.success("TOTP disabled"),he()}catch(ie){de.error(ie.message)}},Qe=async()=>{te(!0);try{const ie=await pe.post("/api/admin/account/totp/recovery/regenerate",{password:H,totp:q});se(ie.recoveryCodes),E("showingRecovery"),de.success("Recovery codes regenerated")}catch(ie){de.error(ie.message)}te(!1)},et=n.get("tab")||"logging";return s.jsxs("div",{children:[s.jsx(Va,{title:"Settings",description:"Logging, security, backup, and system info"}),s.jsxs(aS,{defaultValue:et,children:[s.jsxs(lg,{children:[s.jsx(mr,{value:"logging",children:"Logging"}),s.jsx(mr,{value:"access",children:"Access Control"}),s.jsx(mr,{value:"security",children:"Security"}),s.jsx(mr,{value:"backup",children:"Backup"}),s.jsx(mr,{value:"system",children:"System"})]}),s.jsx(Il,{value:"logging",children:s.jsxs(rt,{children:[s.jsx(st,{children:s.jsx(lt,{className:"text-base",children:"Logging policy"})}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Request-content logging"}),s.jsxs(zn,{value:a.contentLogMode,onValueChange:ie=>xe({contentLogMode:ie}),children:[s.jsx(jn,{children:s.jsx(Ln,{})}),s.jsxs(Sn,{children:[s.jsx(nt,{value:"off",children:"Off"}),s.jsx(nt,{value:"metadata",children:"Metadata only (default)"}),s.jsx(nt,{value:"prompt",children:"Prompt (sanitized)"}),s.jsx(nt,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Retention (days)"}),s.jsx(Ee,{type:"number",min:1,max:3650,value:a.retentionDays,onChange:ie=>xe({retentionDays:Number(ie.target.value)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Database size limit (MB)"}),s.jsx(Ee,{type:"number",min:64,value:a.dbSizeLimitMb,onChange:ie=>xe({dbSizeLimitMb:Number(ie.target.value)})})]}),s.jsx("div",{className:"flex items-center gap-2 pt-2",children:s.jsx(le,{onClick:async()=>{const ie=await pe.post("/api/admin/settings/cleanup");de.success(`Deleted ${ie.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),s.jsx(Il,{value:"access",children:s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"IP access control"}),s.jsx(kn,{children:"Allowlist / Blocklist for this admin website (not model traffic)"})]}),s.jsxs(ot,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Allow only these IPs"}),s.jsx(mi,{placeholder:`192.168.1.0/24
|
|
391
|
-
10.0.0.1`,value:p,onChange:ie=>g(ie.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Newlines-delimited CIDR ranges (IPv4 only). Leave empty = no allow restrictions. When you save a non-empty list, your current IP is auto-added to prevent lockout."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Block these IPs"}),s.jsx(mi,{placeholder:"192.168.1.100",value:v,onChange:ie=>x(ie.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'Newlines-delimited CIDR ranges (IPv4 only). Blocked IPs are rejected with "Không có quyền truy cập" before any login page.'})]}),s.jsx(le,{onClick:()=>{const ie={};p!==((a==null?void 0:a.adminIpAllow)??"")&&(ie.adminIpAllow=p||null),v!==((a==null?void 0:a.adminIpBlock)??"")&&(ie.adminIpBlock=v||null),pe.patch("/api/admin/settings",ie).then(Le=>{de.success("Saved"+(Le.addedIp?` — added your IP: ${Le.addedIp}`:"")),he(),g(""),x("")}).catch(Le=>de.error(Le.message))},children:"Save access control"}),s.jsxs("div",{className:"rounded bg-amber-50 border border-amber-200 p-3 dark:bg-amber-950/20 dark:border-amber-800",children:[s.jsx("p",{className:"text-sm font-medium text-amber-900 dark:text-amber-200",children:"⚠️ If you enable an allow list, you cannot access the gateway unless your IP matches."}),s.jsx("p",{className:"text-xs text-amber-800 dark:text-amber-300",children:"The server automatically adds your current IP when you save — but if you configure it from a different machine, that machine will be locked out immediately."})]})]})]})}),s.jsx(Il,{value:"security",children:s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"Security"}),s.jsx(kn,{children:"Change password, 2FA, and trusted proxy configuration"})]}),s.jsxs(ot,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Trusted proxy hops"}),s.jsx(Ee,{type:"number",min:0,max:8,value:a.trustProxyHops,onChange:ie=>xe({trustProxyHops:Number(ie.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"0 = never trust X-Forwarded-For (direct exposure). 1+ only when behind a single trusted reverse proxy."})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(be,{className:"text-base",children:"TOTP 2FA"}),O==="enabled"?s.jsx("span",{className:"rounded bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800 dark:bg-green-900 dark:text-green-200",children:"Enabled"}):null,O==="disabled"?s.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:"Disabled"}):null]}),O==="disabled"&&s.jsx(le,{variant:"outline",onClick:Ae,children:"Enable TOTP"}),O==="setup"&&s.jsxs("div",{className:"space-y-3 rounded border p-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan this QR code with your authenticator app, or enter the secret manually."}),P&&s.jsx("img",{src:P,alt:"TOTP QR code",className:"h-40 w-40"}),s.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",z]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(be,{children:"Verify code"}),s.jsx(Ee,{value:ee,onChange:ie=>V(ie.target.value),placeholder:"123456",maxLength:6})]}),s.jsx(le,{disabled:ee.length<6,onClick:Ne,children:"Verify & enable"})]})]}),O==="showingRecovery"&&s.jsxs("div",{className:"space-y-3 rounded border border-amber-500/40 bg-amber-50 p-3 dark:bg-amber-950/20",children:[s.jsx("p",{className:"text-sm font-medium",children:"Recovery codes — save these now!"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Each code can be used once to log in without your TOTP device. They will not be shown again."}),s.jsx("div",{className:"space-y-1",children:ce.map((ie,Le)=>s.jsx("div",{className:"font-mono text-xs",children:ie},Le))}),s.jsx(le,{onClick:()=>{E("enabled"),de.success("Recovery codes saved")},children:"I have saved them"})]}),O==="enabled"&&s.jsxs("div",{className:"space-y-3 rounded border p-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Password"}),s.jsx(Ee,{type:"password",value:H,onChange:ie=>_(ie.target.value),placeholder:"Current password"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TOTP code"}),s.jsx(Ee,{value:q,onChange:ie=>W(ie.target.value),placeholder:"123456",maxLength:6})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(le,{variant:"outline",size:"sm",disabled:Q||!H||q.length<6,onClick:Qe,children:"Regenerate recovery codes"}),s.jsx(le,{variant:"destructive",size:"sm",disabled:!H||q.length<6,onClick:Oe,children:"Disable TOTP"})]})]})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx(be,{children:"Change password"}),s.jsx(Ee,{type:"password",placeholder:"Current password",value:u.current,onChange:ie=>f({...u,current:ie.target.value})}),s.jsx(Ee,{type:"password",placeholder:"New password (12+ chars)",value:u.next,onChange:ie=>f({...u,next:ie.target.value})}),s.jsx(le,{disabled:!u.current||u.next.length<12,onClick:async()=>{try{await pe.post("/api/admin/account/password",{currentPassword:u.current,newPassword:u.next}),de.success("Password changed"),f({current:"",next:""})}catch(ie){de.error(ie.message)}},children:"Change password"})]})]})]})}),s.jsx(Il,{value:"backup",children:s.jsxs(rt,{children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"Backup & restore"}),s.jsx(kn,{children:"Download a snapshot or restore from a previous backup"})]}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(be,{children:"Backup passphrase (6 digits)"}),s.jsx(Ee,{inputMode:"numeric",maxLength:6,value:Y,onChange:ie=>ae(ie.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.jsx(Ee,{inputMode:"numeric",maxLength:6,value:ge,onChange:ie=>ye(ie.target.value.replace(/\D/g,"")),placeholder:"Repeat passphrase"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"This passphrase encrypts the master key inside the backup. You must enter the same 6 digits when importing on a new instance. Without it, encrypted provider credentials cannot be recovered."})]}),s.jsx(le,{disabled:Y.length!==6||Y!==ge,onClick:async()=>{try{const ie=await gu("/api/admin/backup/create",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({passphrase:Y})});if(!ie.ok)throw new Error("Backup failed");const Le=await ie.blob(),qe=URL.createObjectURL(Le),_t=document.createElement("a");_t.href=qe,_t.download="latedev-backup.json",_t.click(),URL.revokeObjectURL(qe),de.success("Backup downloaded"),ae(""),ye("")}catch(ie){de.error(ie.message)}},children:"Download backup"}),s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(be,{children:"Backup passphrase for restore"}),s.jsx(Ee,{inputMode:"numeric",maxLength:6,value:G,onChange:ie=>ue(ie.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the 6-digit passphrase entered when the backup was created. It is required to restore the master key and administrator access."})]}),s.jsxs(tj,{open:L!==null,onOpenChange:ie=>{ie||U(null)},children:[s.jsx(BO,{asChild:!0,children:s.jsxs("div",{children:[s.jsx(be,{children:"Restore from backup file"}),s.jsx(Ee,{type:"file",accept:".json,application/json","data-testid":"restore-file",onChange:ie=>{var qe;const Le=(qe=ie.target.files)==null?void 0:qe[0];U(Le??null)}})]})}),s.jsxs(jp,{children:[s.jsxs(aj,{children:[s.jsx(Sp,{children:"Restore backup?"}),s.jsxs(Cp,{children:["Restoring will replace the entire current database with the selected backup (",(L==null?void 0:L.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),s.jsxs(rj,{children:[s.jsx(Ep,{children:"Cancel"}),s.jsx(Np,{onClick:async()=>{var Le,qe;const ie=L;if(ie)try{const _t=JSON.parse(await ie.text()),St=await gu("/api/admin/backup/restore",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({backup:_t,passphrase:G})});if(!St.ok)throw new Error(((qe=(Le=await St.json())==null?void 0:Le.error)==null?void 0:qe.message)??"Restore failed");de.success("Restored. Reloading…"),U(null),setTimeout(()=>location.reload(),600)}catch(_t){de.error(_t.message)}},children:"Restore"})]})]})]})]})]})}),s.jsxs(Il,{value:"system",children:[s.jsxs(rt,{children:[s.jsx(st,{children:s.jsx(lt,{className:"text-base",children:"System"})}),s.jsxs(ot,{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"App version:"})," ",o==null?void 0:o.appVersion]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Data directory:"})," ",s.jsx("span",{className:"font-mono",children:o==null?void 0:o.dataDir})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Encryption:"})," ",o!=null&&o.masterKeyConfigured?"Configured":"Not configured"," (v",o==null?void 0:o.masterKeyVersion,")"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Environment:"})," ",o==null?void 0:o.environment]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(Ha,{checked:a.gatewayCacheEnabled,onCheckedChange:ie=>xe({gatewayCacheEnabled:ie})}),s.jsx(be,{children:"Gateway response cache (disabled by default)"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Cache TTL (s)"}),s.jsx(Ee,{type:"number",min:1,value:a.gatewayCacheDefaultTtlSeconds,onChange:ie=>xe({gatewayCacheDefaultTtlSeconds:Number(ie.target.value)})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Cache max size (MB)"}),s.jsx(Ee,{type:"number",min:1,value:a.gatewayCacheMaxSizeMb,onChange:ie=>xe({gatewayCacheMaxSizeMb:Number(ie.target.value)})})]})]}),s.jsx(le,{variant:"outline",onClick:async()=>{const ie=await pe.post("/api/admin/settings/cache/clear");de.success(`Cleared ${ie.deleted} entries`)},children:"Clear gateway cache"})]})]}),s.jsx(Z4,{}),s.jsxs(rt,{className:"mt-4",children:[s.jsxs(st,{children:[s.jsx(lt,{className:"text-base",children:"Updates"}),s.jsx(kn,{children:"Automatic updates from the npm registry"})]}),s.jsxs(ot,{className:"space-y-3 text-sm",children:[S==="checking"&&!y&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(pr,{className:"h-4 w-4 animate-spin"})," Checking for updates…"]}),y&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Current version"}),s.jsxs("div",{className:"font-mono",children:["v",y.currentVersion]})]}),s.jsx("span",{className:"text-muted-foreground",children:"→"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Latest version"}),s.jsx("div",{className:"font-mono",children:y.latestVersion?`v${y.latestVersion}`:"—"})]}),y.status.docker?s.jsx(We,{variant:"secondary",children:y.status.watchtower?"Docker + Watchtower":"Docker"}):y.latestVersion===null?s.jsx(We,{variant:"secondary",children:"Registry unreachable"}):y.hasUpdate?s.jsx(We,{variant:"success",children:"Update available"}):s.jsxs(We,{variant:"outline",children:[s.jsx(Ou,{className:"mr-1 h-3 w-3"})," Up to date"]})]}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable&&s.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&&s.jsxs("p",{className:"text-muted-foreground",children:["The Watchtower sidecar is configured but not running — start it with ",s.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"docker compose --profile updater up -d"}),"."]}),y.status.docker&&!y.status.watchtower&&s.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&&s.jsxs("p",{className:"text-muted-foreground",children:["Could not reach the npm registry (offline or blocked). ",R&&s.jsx("span",{className:"text-destructive",children:R})]}),S==="installing"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(pr,{className:"h-4 w-4 animate-spin"})," Applying the update… this can take a minute."]}),S==="restarting"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(pr,{className:"h-4 w-4 animate-spin"})," Update applied — the gateway is restarting on the new version. This page reloads automatically."]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y.hasUpdate&&S==="idle"&&(!y.status.docker||y.status.watchtower&&y.watchtowerReachable!==!1)&&s.jsxs(le,{disabled:w||y.status.docker&&y.watchtowerReachable===!1,onClick:M,children:[s.jsx(qm,{className:"mr-1 h-4 w-4"})," Update now"]}),y.hasUpdate&&y.changelogUrl&&s.jsx(le,{variant:"outline",asChild:!0,children:s.jsx("a",{href:y.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),S==="idle"&&s.jsx(le,{variant:"ghost",disabled:w,onClick:()=>A(!0),children:"Check again"})]})]})]})]})]})]})]})}function Z4(){const n=iS();return s.jsxs(rt,{className:"mt-4",children:[s.jsx(st,{children:s.jsxs(lt,{className:"text-base flex items-center gap-2",children:[s.jsx(pE,{className:"h-4 w-4"})," Notifications"]})}),s.jsxs(ot,{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:"Show request notifications"}),s.jsx(Ha,{checked:n.enabled,onCheckedChange:a=>void p0({enabled:a})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(VE,{className:"h-3 w-3"})," Play notification sound"]}),s.jsx(Ha,{checked:n.sound,onCheckedChange:a=>void p0({sound:a})})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function J4({items:n,onDismiss:a}){return n.length?s.jsx("div",{className:"fixed top-16 right-4 z-50 flex max-h-[calc(100vh-8rem)] w-80 flex-col gap-2 overflow-y-auto",children:n.map(l=>{const o=!l.success,c=l.success&&l.totalLatencyMs>15e3,u=Ce("rounded-md border shadow-lg transition-all",o&&"bg-destructive text-destructive-foreground border-destructive",c&&"bg-amber-500/90 text-amber-950 border-amber-600/50",!o&&!c&&"bg-card text-card-foreground border-border");return s.jsxs(Ls,{to:"/requests",className:Ce("block shrink-0 p-3 hover:opacity-95",u),children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[o?s.jsx(xE,{className:"h-4 w-4 shrink-0"}):l.success?s.jsx(Ou,{className:"h-4 w-4 shrink-0"}):s.jsx(GE,{className:"h-4 w-4 shrink-0 opacity-70"}),s.jsx("div",{className:"min-w-0 truncate text-sm font-medium",title:l.requestedModel,children:l.requestedModel})]}),s.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100",onClick:f=>{f.preventDefault(),f.stopPropagation(),a(l.id)},"aria-label":"Dismiss",type:"button",children:s.jsx(ku,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"mt-1 text-xs",children:[l.success?"Thành công":"Thất bại",!l.success&&l.errorType&&s.jsx("span",{className:"ml-1 inline-block rounded bg-black/15 px-1 py-0.5 align-text-bottom text-[10px]",children:l.errorType})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:["in ",Xt(l.inputTokens)," · out ",Xt(l.outputTokens),(l.cacheReadTokens>0||l.cacheWriteTokens>0)&&s.jsxs(s.Fragment,{children:[" · cache ",l.cacheReadTokens>0&&s.jsxs("span",{children:["r",Xt(l.cacheReadTokens)]}),l.cacheReadTokens>0&&l.cacheWriteTokens>0&&"/",l.cacheWriteTokens>0&&s.jsxs("span",{children:["w",Xt(l.cacheWriteTokens)]})]})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[Is(l.totalLatencyMs),l.ttftMs!=null&&l.ttftMs>=0&&s.jsxs("span",{children:[" · TTFT ",Is(l.ttftMs)]})]})]},l.id)})}):null}const W4=5e3,e5=8,t5=3e3;let ru=null;function n5(){try{ru||(ru=new Audio("/notification.mp3")),ru.currentTime=0,ru.play().catch(()=>{})}catch{}}function a5(){const[n,a]=h.useState([]),l=h.useRef(null),o=h.useRef(new Map),c=h.useRef(Date.now()),u=h.useRef(new Set),f=iS(),p=h.useRef(f.sound);p.current=f.sound,h.useEffect(()=>{oS()},[]);const g=f.enabled;return h.useEffect(()=>{var w;if(!g){(w=l.current)==null||w.close(),l.current=null;const N=o.current;for(const S of N.values())clearTimeout(S);N.clear(),a([]);return}let x=!1;const y=o.current,b=()=>{if(x)return;const N=new EventSource(`/api/admin/requests/stream?since=${c.current}`);l.current=N,N.addEventListener("request",S=>{if(!x)try{const C=JSON.parse(S.data),R=new Date(C.createdAt).getTime();if(Number.isFinite(R)&&(c.current=Math.max(c.current,R)),u.current.has(C.id))return;u.current.add(C.id),a(A=>A.some(M=>M.id===C.id)?A:[C,...A].slice(0,e5));const D=setTimeout(()=>{a(A=>A.filter(M=>M.id!==C.id)),y.delete(C.id)},W4);y.set(C.id,D),p.current&&n5()}catch{}}),N.onerror=()=>{N.close(),l.current=null,x||setTimeout(b,t5)}};return b(),()=>{var N;x=!0,(N=l.current)==null||N.close(),l.current=null;for(const S of y.values())clearTimeout(S);y.clear()}},[g]),{items:n,dismiss:x=>{const y=o.current.get(x);y&&(clearTimeout(y),o.current.delete(x)),a(b=>b.filter(w=>w.id!==x))}}}function r5({children:n}){const{user:a,loading:l}=Pm(),o=Bn();return l?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):a?s.jsx(s.Fragment,{children:n}):s.jsx($h,{to:"/login",state:{from:o},replace:!0})}function s5(){const{items:n,dismiss:a}=a5();return s.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[s.jsx(RR,{}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(TD,{}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsxs(z0,{children:[s.jsx(Dn,{index:!0,element:s.jsx(iO,{})}),s.jsx(Dn,{path:"/providers",element:s.jsx(o4,{})}),s.jsx(Dn,{path:"/models",element:s.jsx(d4,{})}),s.jsx(Dn,{path:"/combos",element:s.jsx(f4,{})}),s.jsx(Dn,{path:"/aliases",element:s.jsx(m4,{})}),s.jsx(Dn,{path:"/api-keys",element:s.jsx(p4,{})}),s.jsx(Dn,{path:"/requests",element:s.jsx(x4,{})}),s.jsx(Dn,{path:"/statistics",element:s.jsx(F4,{})}),s.jsx(Dn,{path:"/audit",element:s.jsx(X4,{})}),s.jsx(Dn,{path:"/settings/*",element:s.jsx(Q4,{})})]})})]}),s.jsx(J4,{items:n,onDismiss:a})]})}function l5({children:n}){const[a,l]=h.useState(null),o=Bn();return h.useEffect(()=>{pe.get("/api/admin/setup/status").then(c=>l(c.setupComplete)).catch(()=>l(!0))},[]),a===null?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):!a&&o.pathname!=="/setup"?s.jsx($h,{to:"/setup",replace:!0}):a&&o.pathname==="/setup"?s.jsx($h,{to:"/",replace:!0}):s.jsx(s.Fragment,{children:n})}function o5(){return s.jsx(uE,{children:s.jsx(l5,{children:s.jsxs(z0,{children:[s.jsx(Dn,{path:"/setup",element:s.jsx(lO,{})}),s.jsx(Dn,{path:"/login",element:s.jsx(sO,{})}),s.jsx(Dn,{path:"/*",element:s.jsx(r5,{children:s.jsx(s5,{})})})]})})})}const i5=rO;M2.createRoot(document.getElementById("root")).render(s.jsx(me.StrictMode,{children:s.jsx(LR,{defaultTheme:"dark",storageKey:"latedev-theme",children:s.jsxs(tg,{children:[s.jsx(WN,{children:s.jsx(o5,{})}),s.jsx(i5,{position:"top-right"})]})})}));
|