ldrouter 1.17.9 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -66
- package/dist/server/app.js +0 -2
- package/dist/server/db/migrate.js +1 -2
- package/dist/server/db/schema.js +1 -2
- package/dist/server/gateway/runner.js +4 -2
- package/dist/server/routes/admin/combos.js +128 -11
- package/dist/server/routes/admin/dashboard.js +24 -0
- package/dist/server/routes/admin/models.js +4 -0
- package/dist/server/routes/admin/providers.js +25 -64
- package/dist/server/routes/admin/requests.js +32 -0
- package/dist/server/routes/admin.js +0 -8
- package/dist/server/routing/combo.js +8 -31
- package/dist/server/upstream/client.js +3 -26
- package/dist/web/assets/index-CyboDiyN.js +349 -0
- package/dist/web/assets/index-n9bGQMSj.css +1 -0
- package/dist/web/index.html +2 -2
- package/migrations/0010_ordered_combos.sql +55 -0
- package/package.json +1 -1
- package/dist/web/assets/index-CbKRlw3a.css +0 -1
- package/dist/web/assets/index-D-rviQ3G.js +0 -391
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
var Ay=n=>{throw TypeError(n)};var Dy=(n,a,l)=>a.has(n)||Ay("Cannot "+l);var un=(n,a,l)=>(Dy(n,a,"read from private field"),l?l.call(n):a.get(n)),Oy=(n,a,l)=>a.has(n)?Ay("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,l),ih=(n,a,l,s)=>(Dy(n,a,"write to private field"),s?s.call(n,l):a.set(n,l),l);function t2(n,a){for(var l=0;l<a.length;l++){const s=a[l];if(typeof s!="string"&&!Array.isArray(s)){for(const c in s)if(c!=="default"&&!(c in n)){const u=Object.getOwnPropertyDescriptor(s,c);u&&Object.defineProperty(n,c,u.get?u:{enumerable:!0,get:()=>s[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(c){if(c.ep)return;c.ep=!0;const u=l(c);fetch(c.href,u)}})();function wm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ch={exports:{}},Vo={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var _y;function n2(){if(_y)return Vo;_y=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(s,c,u){var f=null;if(u!==void 0&&(f=""+u),c.key!==void 0&&(f=""+c.key),"key"in c){u={};for(var p in c)p!=="key"&&(u[p]=c[p])}else u=c;return c=u.ref,{$$typeof:n,type:s,key:f,ref:c!==void 0?c:null,props:u}}return Vo.Fragment=a,Vo.jsx=l,Vo.jsxs=l,Vo}var ky;function a2(){return ky||(ky=1,ch.exports=n2()),ch.exports}var o=a2(),uh={exports:{}},Oe={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var zy;function r2(){if(zy)return Oe;zy=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function w(z){return z===null||typeof z!="object"?null:(z=b&&z[b]||z["@@iterator"],typeof z=="function"?z:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function N(z,I,F){this.props=z,this.context=I,this.refs=C,this.updater=F||E}N.prototype.isReactComponent={},N.prototype.setState=function(z,I){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,I,"setState")},N.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function M(){}M.prototype=N.prototype;function T(z,I,F){this.props=z,this.context=I,this.refs=C,this.updater=F||E}var D=T.prototype=new M;D.constructor=T,j(D,N.prototype),D.isPureReactComponent=!0;var O=Array.isArray;function A(){}var U={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function $(z,I,F){var re=F.ref;return{$$typeof:n,type:z,key:I,ref:re!==void 0?re:null,props:F}}function X(z,I){return $(z.type,I,z.props)}function te(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function G(z){var I={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(F){return I[F]})}var ie=/\/+/g;function ce(z,I){return typeof z=="object"&&z!==null&&z.key!=null?G(""+z.key):I.toString(36)}function se(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(A,A):(z.status="pending",z.then(function(I){z.status==="pending"&&(z.status="fulfilled",z.value=I)},function(I){z.status==="pending"&&(z.status="rejected",z.reason=I)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function _(z,I,F,re,he){var ge=typeof z;(ge==="undefined"||ge==="boolean")&&(z=null);var q=!1;if(z===null)q=!0;else switch(ge){case"bigint":case"string":case"number":q=!0;break;case"object":switch(z.$$typeof){case n:case a:q=!0;break;case x:return q=z._init,_(q(z._payload),I,F,re,he)}}if(q)return he=he(z),q=re===""?"."+ce(z,0):re,O(he)?(F="",q!=null&&(F=q.replace(ie,"$&/")+"/"),_(he,I,F,"",function(fe){return fe})):he!=null&&(te(he)&&(he=X(he,F+(he.key==null||z&&z.key===he.key?"":(""+he.key).replace(ie,"$&/")+"/")+q)),I.push(he)),1;q=0;var oe=re===""?".":re+":";if(O(z))for(var de=0;de<z.length;de++)re=z[de],ge=oe+ce(re,de),q+=_(re,I,F,ge,he);else if(de=w(z),typeof de=="function")for(z=de.call(z),de=0;!(re=z.next()).done;)re=re.value,ge=oe+ce(re,de++),q+=_(re,I,F,ge,he);else if(ge==="object"){if(typeof z.then=="function")return _(se(z),I,F,re,he);throw I=String(z),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return q}function H(z,I,F){if(z==null)return z;var re=[],he=0;return _(z,re,"","",function(ge){return I.call(F,ge,he++)}),re}function Q(z){if(z._status===-1){var I=z._result;I=I(),I.then(function(F){(z._status===0||z._status===-1)&&(z._status=1,z._result=F)},function(F){(z._status===0||z._status===-1)&&(z._status=2,z._result=F)}),z._status===-1&&(z._status=0,z._result=I)}if(z._status===1)return z._result.default;throw z._result}var J=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},ee={map:H,forEach:function(z,I,F){H(z,function(){I.apply(this,arguments)},F)},count:function(z){var I=0;return H(z,function(){I++}),I},toArray:function(z){return H(z,function(I){return I})||[]},only:function(z){if(!te(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Oe.Activity=y,Oe.Children=ee,Oe.Component=N,Oe.Fragment=l,Oe.Profiler=c,Oe.PureComponent=T,Oe.StrictMode=s,Oe.Suspense=g,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(z){return U.H.useMemoCache(z)}},Oe.cache=function(z){return function(){return z.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(z,I,F){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var re=j({},z.props),he=z.key;if(I!=null)for(ge in I.key!==void 0&&(he=""+I.key),I)!k.call(I,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&I.ref===void 0||(re[ge]=I[ge]);var ge=arguments.length-2;if(ge===1)re.children=F;else if(1<ge){for(var q=Array(ge),oe=0;oe<ge;oe++)q[oe]=arguments[oe+2];re.children=q}return $(z.type,he,re)},Oe.createContext=function(z){return z={$$typeof:f,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:u,_context:z},z},Oe.createElement=function(z,I,F){var re,he={},ge=null;if(I!=null)for(re in I.key!==void 0&&(ge=""+I.key),I)k.call(I,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(he[re]=I[re]);var q=arguments.length-2;if(q===1)he.children=F;else if(1<q){for(var oe=Array(q),de=0;de<q;de++)oe[de]=arguments[de+2];he.children=oe}if(z&&z.defaultProps)for(re in q=z.defaultProps,q)he[re]===void 0&&(he[re]=q[re]);return $(z,ge,he)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(z){return{$$typeof:p,render:z}},Oe.isValidElement=te,Oe.lazy=function(z){return{$$typeof:x,_payload:{_status:-1,_result:z},_init:Q}},Oe.memo=function(z,I){return{$$typeof:v,type:z,compare:I===void 0?null:I}},Oe.startTransition=function(z){var I=U.T,F={};U.T=F;try{var re=z(),he=U.S;he!==null&&he(F,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(A,J)}catch(ge){J(ge)}finally{I!==null&&F.types!==null&&(I.types=F.types),U.T=I}},Oe.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Oe.use=function(z){return U.H.use(z)},Oe.useActionState=function(z,I,F){return U.H.useActionState(z,I,F)},Oe.useCallback=function(z,I){return U.H.useCallback(z,I)},Oe.useContext=function(z){return U.H.useContext(z)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(z,I){return U.H.useDeferredValue(z,I)},Oe.useEffect=function(z,I){return U.H.useEffect(z,I)},Oe.useEffectEvent=function(z){return U.H.useEffectEvent(z)},Oe.useId=function(){return U.H.useId()},Oe.useImperativeHandle=function(z,I,F){return U.H.useImperativeHandle(z,I,F)},Oe.useInsertionEffect=function(z,I){return U.H.useInsertionEffect(z,I)},Oe.useLayoutEffect=function(z,I){return U.H.useLayoutEffect(z,I)},Oe.useMemo=function(z,I){return U.H.useMemo(z,I)},Oe.useOptimistic=function(z,I){return U.H.useOptimistic(z,I)},Oe.useReducer=function(z,I,F){return U.H.useReducer(z,I,F)},Oe.useRef=function(z){return U.H.useRef(z)},Oe.useState=function(z){return U.H.useState(z)},Oe.useSyncExternalStore=function(z,I,F){return U.H.useSyncExternalStore(z,I,F)},Oe.useTransition=function(){return U.H.useTransition()},Oe.version="19.2.8",Oe}var Ly;function Sm(){return Ly||(Ly=1,uh.exports=r2()),uh.exports}var m=Sm();const ue=wm(m),Hs=t2({__proto__:null,default:ue},[m]);var dh={exports:{}},$o={},fh={exports:{}},hh={};/**
|
|
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 Uy;function l2(){return Uy||(Uy=1,(function(n){function a(_,H){var Q=_.length;_.push(H);e:for(;0<Q;){var J=Q-1>>>1,ee=_[J];if(0<c(ee,H))_[J]=H,_[Q]=ee,Q=J;else break e}}function l(_){return _.length===0?null:_[0]}function s(_){if(_.length===0)return null;var H=_[0],Q=_.pop();if(Q!==H){_[0]=Q;e:for(var J=0,ee=_.length,z=ee>>>1;J<z;){var I=2*(J+1)-1,F=_[I],re=I+1,he=_[re];if(0>c(F,Q))re<ee&&0>c(he,F)?(_[J]=he,_[re]=Q,J=re):(_[J]=F,_[I]=Q,J=I);else if(re<ee&&0>c(he,Q))_[J]=he,_[re]=Q,J=re;else break e}}return H}function c(_,H){var Q=_.sortIndex-H.sortIndex;return Q!==0?Q:_.id-H.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var g=[],v=[],x=1,y=null,b=3,w=!1,E=!1,j=!1,C=!1,N=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function D(_){for(var H=l(v);H!==null;){if(H.callback===null)s(v);else if(H.startTime<=_)s(v),H.sortIndex=H.expirationTime,a(g,H);else break;H=l(v)}}function O(_){if(j=!1,D(_),!E)if(l(g)!==null)E=!0,A||(A=!0,G());else{var H=l(v);H!==null&&se(O,H.startTime-_)}}var A=!1,U=-1,k=5,$=-1;function X(){return C?!0:!(n.unstable_now()-$<k)}function te(){if(C=!1,A){var _=n.unstable_now();$=_;var H=!0;try{e:{E=!1,j&&(j=!1,M(U),U=-1),w=!0;var Q=b;try{t:{for(D(_),y=l(g);y!==null&&!(y.expirationTime>_&&X());){var J=y.callback;if(typeof J=="function"){y.callback=null,b=y.priorityLevel;var ee=J(y.expirationTime<=_);if(_=n.unstable_now(),typeof ee=="function"){y.callback=ee,D(_),H=!0;break t}y===l(g)&&s(g),D(_)}else s(g);y=l(g)}if(y!==null)H=!0;else{var z=l(v);z!==null&&se(O,z.startTime-_),H=!1}}break e}finally{y=null,b=Q,w=!1}H=void 0}}finally{H?G():A=!1}}}var G;if(typeof T=="function")G=function(){T(te)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,ce=ie.port2;ie.port1.onmessage=te,G=function(){ce.postMessage(null)}}else G=function(){N(te,0)};function se(_,H){U=N(function(){_(n.unstable_now())},H)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(_){_.callback=null},n.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):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 H=3;break;default:H=b}var Q=b;b=H;try{return _()}finally{b=Q}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(_,H){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var Q=b;b=_;try{return H()}finally{b=Q}},n.unstable_scheduleCallback=function(_,H,Q){var J=n.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?J+Q:J):Q=J,_){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=Q+ee,_={id:x++,callback:H,priorityLevel:_,startTime:Q,expirationTime:ee,sortIndex:-1},Q>J?(_.sortIndex=Q,a(v,_),l(g)===null&&_===l(v)&&(j?(M(U),U=-1):j=!0,se(O,Q-J))):(_.sortIndex=ee,a(g,_),E||w||(E=!0,A||(A=!0,G()))),_},n.unstable_shouldYield=X,n.unstable_wrapCallback=function(_){var H=b;return function(){var Q=b;b=H;try{return _.apply(this,arguments)}finally{b=Q}}}})(hh)),hh}var By;function s2(){return By||(By=1,fh.exports=l2()),fh.exports}var mh={exports:{}},dn={};/**
|
|
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 Hy;function o2(){if(Hy)return dn;Hy=1;var n=Sm();function a(g){var v="https://react.dev/errors/"+g;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)v+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+g+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var s={d:{f:l,r:function(){throw Error(a(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},c=Symbol.for("react.portal");function u(g,v,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:y==null?null:""+y,children:g,containerInfo:v,implementation:x}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,dn.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)},dn.flushSync=function(g){var v=f.T,x=s.p;try{if(f.T=null,s.p=2,g)return g()}finally{f.T=v,s.p=x,s.d.f()}},dn.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,s.d.C(g,v))},dn.prefetchDNS=function(g){typeof g=="string"&&s.d.D(g)},dn.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin),b=typeof v.integrity=="string"?v.integrity:void 0,w=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;x==="style"?s.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:w}):x==="script"&&s.d.X(g,{crossOrigin:y,integrity:b,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},dn.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var x=p(v.as,v.crossOrigin);s.d.M(g,{crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&s.d.M(g)},dn.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin);s.d.L(g,x,{crossOrigin:y,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},dn.preloadModule=function(g,v){if(typeof g=="string")if(v){var x=p(v.as,v.crossOrigin);s.d.m(g,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else s.d.m(g)},dn.requestFormReset=function(g){s.d.r(g)},dn.unstable_batchedUpdates=function(g,v){return g(v)},dn.useFormState=function(g,v,x){return f.H.useFormState(g,v,x)},dn.useFormStatus=function(){return f.H.useHostTransitionStatus()},dn.version="19.2.8",dn}var Iy;function Zb(){if(Iy)return mh.exports;Iy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),mh.exports=o2(),mh.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 Py;function i2(){if(Py)return $o;Py=1;var n=s2(),a=Sm(),l=Zb();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(u(e)!==e)throw Error(s(188))}function v(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(s(188));return t!==e?null:e}for(var r=e,i=t;;){var d=r.return;if(d===null)break;var h=d.alternate;if(h===null){if(i=d.return,i!==null){r=i;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===r)return g(d),e;if(h===i)return g(d),t;h=h.sibling}throw Error(s(188))}if(r.return!==i.return)r=d,i=h;else{for(var S=!1,R=d.child;R;){if(R===r){S=!0,r=d,i=h;break}if(R===i){S=!0,i=d,r=h;break}R=R.sibling}if(!S){for(R=h.child;R;){if(R===r){S=!0,r=h,i=d;break}if(R===i){S=!0,i=h,r=d;break}R=R.sibling}if(!S)throw Error(s(189))}}if(r.alternate!==i)throw Error(s(190))}if(r.tag!==3)throw Error(s(188));return r.stateNode.current===r?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),T=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function G(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Symbol.for("react.client.reference");function ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case N:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case T:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return t=e.displayName||null,t!==null?t:ce(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var se=Array.isArray,_=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},J=[],ee=-1;function z(e){return{current:e}}function I(e){0>ee||(e.current=J[ee],J[ee]=null,ee--)}function F(e,t){ee++,J[ee]=e.current,e.current=t}var re=z(null),he=z(null),ge=z(null),q=z(null);function oe(e,t){switch(F(ge,t),F(he,e),F(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Wx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Wx(t),e=ey(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}I(re),F(re,e)}function de(){I(re),I(he),I(ge)}function fe(e){e.memoizedState!==null&&F(q,e);var t=re.current,r=ey(t,e.type);t!==r&&(F(he,e),F(re,r))}function Te(e){he.current===e&&(I(re),I(he)),q.current===e&&(I(q),Ho._currentValue=Q)}var je,De;function Fe(e){if(je===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||"",De=-1<r.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+je+e+De}var et=!1;function le(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 ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(Z){var K=Z}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(Z){K=Z}e.call(ae.prototype)}}else{try{throw Error()}catch(Z){K=Z}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(Z){if(Z&&K&&typeof Z.stack=="string")return[Z.stack,K.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=i.DetermineComponentFrameRoot(),S=h[0],R=h[1];if(S&&R){var L=S.split(`
|
|
44
|
+
`),Y=R.split(`
|
|
45
|
+
`);for(d=i=0;i<L.length&&!L[i].includes("DetermineComponentFrameRoot");)i++;for(;d<Y.length&&!Y[d].includes("DetermineComponentFrameRoot");)d++;if(i===L.length||d===Y.length)for(i=L.length-1,d=Y.length-1;1<=i&&0<=d&&L[i]!==Y[d];)d--;for(;1<=i&&0<=d;i--,d--)if(L[i]!==Y[d]){if(i!==1||d!==1)do if(i--,d--,0>d||L[i]!==Y[d]){var W=`
|
|
46
|
+
`+L[i].replace(" at new "," at ");return e.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",e.displayName)),W}while(1<=i&&0<=d);break}}}finally{et=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Fe(r):""}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return Fe(e.type);case 16:return Fe("Lazy");case 13:return e.child!==t&&t!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return le(e.type,!1);case 11:return le(e.type.render,!1);case 1:return le(e.type,!0);case 31:return Fe("Activity");default:return""}}function Ie(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 kt=Object.prototype.hasOwnProperty,St=n.unstable_scheduleCallback,Ft=n.unstable_cancelCallback,on=n.unstable_shouldYield,Qt=n.unstable_requestPaint,jt=n.unstable_now,fn=n.unstable_getCurrentPriorityLevel,Mt=n.unstable_ImmediatePriority,At=n.unstable_UserBlockingPriority,cn=n.unstable_NormalPriority,fa=n.unstable_LowPriority,Ta=n.unstable_IdlePriority,Gn=n.log,dl=n.unstable_setDisableYieldValue,ha=null,Dt=null;function hn(e){if(typeof Gn=="function"&&dl(e),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(ha,e)}catch{}}var Tt=Math.clz32?Math.clz32:ql,Js=Math.log,Pl=Math.LN2;function ql(e){return e>>>=0,e===0?32:31-(Js(e)/Pl|0)|0}var Ya=256,Nr=262144,vt=4194304;function st(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 Bt(e,t,r){var i=e.pendingLanes;if(i===0)return 0;var d=0,h=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var R=i&134217727;return R!==0?(i=R&~h,i!==0?d=st(i):(S&=R,S!==0?d=st(S):r||(r=R&~e,r!==0&&(d=st(r))))):(R=i&~h,R!==0?d=st(R):S!==0?d=st(S):r||(r=i&~e,r!==0&&(d=st(r)))),d===0?0:t!==0&&t!==d&&(t&h)===0&&(h=d&-d,r=t&-t,h>=r||h===32&&(r&4194048)!==0)?t:d}function Ce(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ke(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(){var e=vt;return vt<<=1,(vt&62914560)===0&&(vt=4194304),e}function gt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ct(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(e,t,r,i,d,h){var S=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var R=e.entanglements,L=e.expirationTimes,Y=e.hiddenUpdates;for(r=S&~r;0<r;){var W=31-Tt(r),ae=1<<W;R[W]=0,L[W]=-1;var K=Y[W];if(K!==null)for(Y[W]=null,W=0;W<K.length;W++){var Z=K[W];Z!==null&&(Z.lane&=-536870913)}r&=~ae}i!==0&&$t(e,i,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(S&~t))}function $t(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 xt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Tt(r),d=1<<i;d&t|e[i]&t&&(e[i]|=t),r&=~d}}function zt(e,t){var r=t&-t;return r=(r&42)!==0?1:Ga(r),(r&(e.suspendedLanes|t))!==0?0:r}function Ga(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ka(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ma(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:jy(e.type))}function Tr(e,t){var r=H.p;try{return H.p=e,t()}finally{H.p=r}}var Kn=Math.random().toString(36).slice(2),nn="__reactFiber$"+Kn,bn="__reactProps$"+Kn,Vl="__reactContainer$"+Kn,Ju="__reactEvents$"+Kn,$S="__reactListeners$"+Kn,YS="__reactHandles$"+Kn,Ip="__reactResources$"+Kn,Ws="__reactMarker$"+Kn;function Wu(e){delete e[nn],delete e[bn],delete e[Ju],delete e[$S],delete e[YS]}function $l(e){var t=e[nn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Vl]||r[nn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=oy(e);e!==null;){if(r=e[nn])return r;e=oy(e)}return t}e=r,r=e.parentNode}return null}function Yl(e){if(e=e[nn]||e[Vl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function eo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Gl(e){var t=e[Ip];return t||(t=e[Ip]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Zt(e){e[Ws]=!0}var Pp=new Set,qp={};function fl(e,t){Kl(e,t),Kl(e+"Capture",t)}function Kl(e,t){for(qp[e]=t,e=0;e<t.length;e++)Pp.add(t[e])}var GS=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]*$"),Vp={},$p={};function KS(e){return kt.call($p,e)?!0:kt.call(Vp,e)?!1:GS.test(e)?$p[e]=!0:(Vp[e]=!0,!1)}function yi(e,t,r){if(KS(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function bi(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function Xa(e,t,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+i)}}function Xn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function XS(e,t,r){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,h=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(S){r=""+S,h.call(this,S)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(S){r=""+S},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ed(e){if(!e._valueTracker){var t=Yp(e)?"checked":"value";e._valueTracker=XS(e,t,""+e[t])}}function Gp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Yp(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function wi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var FS=/[\n"\\]/g;function Fn(e){return e.replace(FS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function td(e,t,r,i,d,h,S,R){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),t!=null?S==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Xn(t)):e.value!==""+Xn(t)&&(e.value=""+Xn(t)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),t!=null?nd(e,S,Xn(t)):r!=null?nd(e,S,Xn(r)):i!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+Xn(R):e.removeAttribute("name")}function Kp(e,t,r,i,d,h,S,R){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){ed(e);return}r=r!=null?""+Xn(r):"",t=t!=null?""+Xn(t):r,R||t===e.value||(e.value=t),e.defaultValue=t}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=R?e.checked:!!i,e.defaultChecked=!!i,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),ed(e)}function nd(e,t,r){t==="number"&&wi(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Xl(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=""+Xn(r),t=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Xp(e,t,r){if(t!=null&&(t=""+Xn(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+Xn(r):""}function Fp(e,t,r,i){if(t==null){if(i!=null){if(r!=null)throw Error(s(92));if(se(i)){if(1<i.length)throw Error(s(93));i=i[0]}r=i}r==null&&(r=""),t=r}r=Xn(t),e.defaultValue=r,i=e.textContent,i===r&&i!==""&&i!==null&&(e.value=i),ed(e)}function Fl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var QS=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 Qp(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||QS.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function Zp(e,t,r){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,r!=null){for(var i in r)!r.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var d in t)i=t[d],t.hasOwnProperty(d)&&r[d]!==i&&Qp(e,d,i)}else for(var h in t)t.hasOwnProperty(h)&&Qp(e,h,t[h])}function ad(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 ZS=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"]]),JS=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Si(e){return JS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Fa(){}var rd=null;function ld(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ql=null,Zl=null;function Jp(e){var t=Yl(e);if(t&&(e=t.stateNode)){var r=e[bn]||null;e:switch(e=t.stateNode,t.type){case"input":if(td(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="'+Fn(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var d=i[bn]||null;if(!d)throw Error(s(90));td(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&&Gp(i)}break e;case"textarea":Xp(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&Xl(e,!!r.multiple,t,!1)}}}var sd=!1;function Wp(e,t,r){if(sd)return e(t,r);sd=!0;try{var i=e(t);return i}finally{if(sd=!1,(Ql!==null||Zl!==null)&&(cc(),Ql&&(t=Ql,e=Zl,Zl=Ql=null,Jp(t),e)))for(t=0;t<e.length;t++)Jp(e[t])}}function to(e,t){var r=e.stateNode;if(r===null)return null;var i=r[bn]||null;if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(s(231,t,typeof r));return r}var Qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),od=!1;if(Qa)try{var no={};Object.defineProperty(no,"passive",{get:function(){od=!0}}),window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{od=!1}var Mr=null,id=null,ji=null;function eg(){if(ji)return ji;var e,t=id,r=t.length,i,d="value"in Mr?Mr.value:Mr.textContent,h=d.length;for(e=0;e<r&&t[e]===d[e];e++);var S=r-e;for(i=1;i<=S&&t[r-i]===d[h-i];i++);return ji=d.slice(e,1<i?1-i:void 0)}function Ci(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ei(){return!0}function tg(){return!1}function wn(e){function t(r,i,d,h,S){this._reactName=r,this._targetInst=d,this.type=i,this.nativeEvent=h,this.target=S,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(r=e[R],this[R]=r?r(h):h[R]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ei:tg,this.isPropagationStopped=tg,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ei)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ei)},persist:function(){},isPersistent:Ei}),t}var hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ri=wn(hl),ao=y({},hl,{view:0,detail:0}),WS=wn(ao),cd,ud,ro,Ni=y({},ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ro&&(ro&&e.type==="mousemove"?(cd=e.screenX-ro.screenX,ud=e.screenY-ro.screenY):ud=cd=0,ro=e),cd)},movementY:function(e){return"movementY"in e?e.movementY:ud}}),ng=wn(Ni),ej=y({},Ni,{dataTransfer:0}),tj=wn(ej),nj=y({},ao,{relatedTarget:0}),dd=wn(nj),aj=y({},hl,{animationName:0,elapsedTime:0,pseudoElement:0}),rj=wn(aj),lj=y({},hl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sj=wn(lj),oj=y({},hl,{data:0}),ag=wn(oj),ij={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cj={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"},uj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uj[e])?!!t[e]:!1}function fd(){return dj}var fj=y({},ao,{key:function(e){if(e.key){var t=ij[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ci(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cj[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fd,charCode:function(e){return e.type==="keypress"?Ci(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ci(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hj=wn(fj),mj=y({},Ni,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rg=wn(mj),pj=y({},ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fd}),gj=wn(pj),vj=y({},hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),xj=wn(vj),yj=y({},Ni,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),bj=wn(yj),wj=y({},hl,{newState:0,oldState:0}),Sj=wn(wj),jj=[9,13,27,32],hd=Qa&&"CompositionEvent"in window,lo=null;Qa&&"documentMode"in document&&(lo=document.documentMode);var Cj=Qa&&"TextEvent"in window&&!lo,lg=Qa&&(!hd||lo&&8<lo&&11>=lo),sg=" ",og=!1;function ig(e,t){switch(e){case"keyup":return jj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jl=!1;function Ej(e,t){switch(e){case"compositionend":return cg(t);case"keypress":return t.which!==32?null:(og=!0,sg);case"textInput":return e=t.data,e===sg&&og?null:e;default:return null}}function Rj(e,t){if(Jl)return e==="compositionend"||!hd&&ig(e,t)?(e=eg(),ji=id=Mr=null,Jl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return lg&&t.locale!=="ko"?null:t.data;default:return null}}var Nj={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 ug(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Nj[e.type]:t==="textarea"}function dg(e,t,r,i){Ql?Zl?Zl.push(i):Zl=[i]:Ql=i,t=gc(t,"onChange"),0<t.length&&(r=new Ri("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var so=null,oo=null;function Tj(e){Kx(e,0)}function Ti(e){var t=eo(e);if(Gp(t))return e}function fg(e,t){if(e==="change")return t}var hg=!1;if(Qa){var md;if(Qa){var pd="oninput"in document;if(!pd){var mg=document.createElement("div");mg.setAttribute("oninput","return;"),pd=typeof mg.oninput=="function"}md=pd}else md=!1;hg=md&&(!document.documentMode||9<document.documentMode)}function pg(){so&&(so.detachEvent("onpropertychange",gg),oo=so=null)}function gg(e){if(e.propertyName==="value"&&Ti(oo)){var t=[];dg(t,oo,e,ld(e)),Wp(Tj,t)}}function Mj(e,t,r){e==="focusin"?(pg(),so=t,oo=r,so.attachEvent("onpropertychange",gg)):e==="focusout"&&pg()}function Aj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ti(oo)}function Dj(e,t){if(e==="click")return Ti(t)}function Oj(e,t){if(e==="input"||e==="change")return Ti(t)}function _j(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ln=typeof Object.is=="function"?Object.is:_j;function io(e,t){if(Ln(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(!kt.call(t,d)||!Ln(e[d],t[d]))return!1}return!0}function vg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xg(e,t){var r=vg(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=vg(r)}}function yg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=wi(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=wi(e.document)}return t}function gd(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 kj=Qa&&"documentMode"in document&&11>=document.documentMode,Wl=null,vd=null,co=null,xd=!1;function wg(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;xd||Wl==null||Wl!==wi(i)||(i=Wl,"selectionStart"in i&&gd(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),co&&io(co,i)||(co=i,i=gc(vd,"onSelect"),0<i.length&&(t=new Ri("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Wl)))}function ml(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var es={animationend:ml("Animation","AnimationEnd"),animationiteration:ml("Animation","AnimationIteration"),animationstart:ml("Animation","AnimationStart"),transitionrun:ml("Transition","TransitionRun"),transitionstart:ml("Transition","TransitionStart"),transitioncancel:ml("Transition","TransitionCancel"),transitionend:ml("Transition","TransitionEnd")},yd={},Sg={};Qa&&(Sg=document.createElement("div").style,"AnimationEvent"in window||(delete es.animationend.animation,delete es.animationiteration.animation,delete es.animationstart.animation),"TransitionEvent"in window||delete es.transitionend.transition);function pl(e){if(yd[e])return yd[e];if(!es[e])return e;var t=es[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Sg)return yd[e]=t[r];return e}var jg=pl("animationend"),Cg=pl("animationiteration"),Eg=pl("animationstart"),zj=pl("transitionrun"),Lj=pl("transitionstart"),Uj=pl("transitioncancel"),Rg=pl("transitionend"),Ng=new Map,bd="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(" ");bd.push("scrollEnd");function pa(e,t){Ng.set(e,t),fl(t,[e])}var Mi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Qn=[],ts=0,wd=0;function Ai(){for(var e=ts,t=wd=ts=0;t<e;){var r=Qn[t];Qn[t++]=null;var i=Qn[t];Qn[t++]=null;var d=Qn[t];Qn[t++]=null;var h=Qn[t];if(Qn[t++]=null,i!==null&&d!==null){var S=i.pending;S===null?d.next=d:(d.next=S.next,S.next=d),i.pending=d}h!==0&&Tg(r,d,h)}}function Di(e,t,r,i){Qn[ts++]=e,Qn[ts++]=t,Qn[ts++]=r,Qn[ts++]=i,wd|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Sd(e,t,r,i){return Di(e,t,r,i),Oi(e)}function gl(e,t){return Di(e,null,null,t),Oi(e)}function Tg(e,t,r){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r);for(var d=!1,h=e.return;h!==null;)h.childLanes|=r,i=h.alternate,i!==null&&(i.childLanes|=r),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&t!==null&&(d=31-Tt(r),e=h.hiddenUpdates,i=e[d],i===null?e[d]=[t]:i.push(t),t.lane=r|536870912),h):null}function Oi(e){if(50<Oo)throw Oo=0,Of=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ns={};function Bj(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 Un(e,t,r,i){return new Bj(e,t,r,i)}function jd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Za(e,t){var r=e.alternate;return r===null?(r=Un(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 Mg(e,t){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function _i(e,t,r,i,d,h){var S=0;if(i=e,typeof e=="function")jd(e)&&(S=1);else if(typeof e=="string")S=VC(e,r,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=Un(31,r,t,d),e.elementType=$,e.lanes=h,e;case j:return vl(r.children,d,h,t);case C:S=8,d|=24;break;case N:return e=Un(12,r,t,d|2),e.elementType=N,e.lanes=h,e;case O:return e=Un(13,r,t,d),e.elementType=O,e.lanes=h,e;case A:return e=Un(19,r,t,d),e.elementType=A,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:S=10;break e;case M:S=9;break e;case D:S=11;break e;case U:S=14;break e;case k:S=16,i=null;break e}S=29,r=Error(s(130,e===null?"null":typeof e,"")),i=null}return t=Un(S,r,t,d),t.elementType=e,t.type=i,t.lanes=h,t}function vl(e,t,r,i){return e=Un(7,e,i,t),e.lanes=r,e}function Cd(e,t,r){return e=Un(6,e,null,t),e.lanes=r,e}function Ag(e){var t=Un(18,null,null,0);return t.stateNode=e,t}function Ed(e,t,r){return t=Un(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Dg=new WeakMap;function Zn(e,t){if(typeof e=="object"&&e!==null){var r=Dg.get(e);return r!==void 0?r:(t={value:e,source:t,stack:Ie(t)},Dg.set(e,t),t)}return{value:e,source:t,stack:Ie(t)}}var as=[],rs=0,ki=null,uo=0,Jn=[],Wn=0,Ar=null,Ma=1,Aa="";function Ja(e,t){as[rs++]=uo,as[rs++]=ki,ki=e,uo=t}function Og(e,t,r){Jn[Wn++]=Ma,Jn[Wn++]=Aa,Jn[Wn++]=Ar,Ar=e;var i=Ma;e=Aa;var d=32-Tt(i)-1;i&=~(1<<d),r+=1;var h=32-Tt(t)+d;if(30<h){var S=d-d%5;h=(i&(1<<S)-1).toString(32),i>>=S,d-=S,Ma=1<<32-Tt(t)+d|r<<d|i,Aa=h+e}else Ma=1<<h|r<<d|i,Aa=e}function Rd(e){e.return!==null&&(Ja(e,1),Og(e,1,0))}function Nd(e){for(;e===ki;)ki=as[--rs],as[rs]=null,uo=as[--rs],as[rs]=null;for(;e===Ar;)Ar=Jn[--Wn],Jn[Wn]=null,Aa=Jn[--Wn],Jn[Wn]=null,Ma=Jn[--Wn],Jn[Wn]=null}function _g(e,t){Jn[Wn++]=Ma,Jn[Wn++]=Aa,Jn[Wn++]=Ar,Ma=t.id,Aa=t.overflow,Ar=e}var an=null,yt=null,Ge=!1,Dr=null,ea=!1,Td=Error(s(519));function Or(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fo(Zn(t,e)),Td}function kg(e){var t=e.stateNode,r=e.type,i=e.memoizedProps;switch(t[nn]=e,t[bn]=i,r){case"dialog":qe("cancel",t),qe("close",t);break;case"iframe":case"object":case"embed":qe("load",t);break;case"video":case"audio":for(r=0;r<ko.length;r++)qe(ko[r],t);break;case"source":qe("error",t);break;case"img":case"image":case"link":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"input":qe("invalid",t),Kp(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),Fp(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||Zx(t.textContent,r)?(i.popover!=null&&(qe("beforetoggle",t),qe("toggle",t)),i.onScroll!=null&&qe("scroll",t),i.onScrollEnd!=null&&qe("scrollend",t),i.onClick!=null&&(t.onclick=Fa),t=!0):t=!1,t||Or(e,!0)}function zg(e){for(an=e.return;an;)switch(an.tag){case 5:case 31:case 13:ea=!1;return;case 27:case 3:ea=!0;return;default:an=an.return}}function ls(e){if(e!==an)return!1;if(!Ge)return zg(e),Ge=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Kf(e.type,e.memoizedProps)),r=!r),r&&yt&&Or(e),zg(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));yt=sy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));yt=sy(e)}else t===27?(t=yt,Gr(e.type)?(e=Jf,Jf=null,yt=e):yt=t):yt=an?na(e.stateNode.nextSibling):null;return!0}function xl(){yt=an=null,Ge=!1}function Md(){var e=Dr;return e!==null&&(En===null?En=e:En.push.apply(En,e),Dr=null),e}function fo(e){Dr===null?Dr=[e]:Dr.push(e)}var Ad=z(null),yl=null,Wa=null;function _r(e,t,r){F(Ad,t._currentValue),t._currentValue=r}function er(e){e._currentValue=Ad.current,I(Ad)}function Dd(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 Od(e,t,r,i){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var S=d.child;h=h.firstContext;e:for(;h!==null;){var R=h;h=d;for(var L=0;L<t.length;L++)if(R.context===t[L]){h.lanes|=r,R=h.alternate,R!==null&&(R.lanes|=r),Dd(h.return,r,e),i||(S=null);break e}h=R.next}}else if(d.tag===18){if(S=d.return,S===null)throw Error(s(341));S.lanes|=r,h=S.alternate,h!==null&&(h.lanes|=r),Dd(S,r,e),S=null}else S=d.child;if(S!==null)S.return=d;else for(S=d;S!==null;){if(S===e){S=null;break}if(d=S.sibling,d!==null){d.return=S.return,S=d;break}S=S.return}d=S}}function ss(e,t,r,i){e=null;for(var d=t,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var S=d.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var R=d.type;Ln(d.pendingProps.value,S.value)||(e!==null?e.push(R):e=[R])}}else if(d===q.current){if(S=d.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Ho):e=[Ho])}d=d.return}e!==null&&Od(t,e,r,i),t.flags|=262144}function zi(e){for(e=e.firstContext;e!==null;){if(!Ln(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bl(e){yl=e,Wa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function rn(e){return Lg(yl,e)}function Li(e,t){return yl===null&&bl(e),Lg(e,t)}function Lg(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},Wa===null){if(e===null)throw Error(s(308));Wa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wa=Wa.next=t;return r}var Hj=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()})}},Ij=n.unstable_scheduleCallback,Pj=n.unstable_NormalPriority,Ht={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _d(){return{controller:new Hj,data:new Map,refCount:0}}function ho(e){e.refCount--,e.refCount===0&&Ij(Pj,function(){e.controller.abort()})}var mo=null,kd=0,os=0,is=null;function qj(e,t){if(mo===null){var r=mo=[];kd=0,os=Bf(),is={status:"pending",value:void 0,then:function(i){r.push(i)}}}return kd++,t.then(Ug,Ug),t}function Ug(){if(--kd===0&&mo!==null){is!==null&&(is.status="fulfilled");var e=mo;mo=null,os=0,is=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Vj(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 Bg=_.S;_.S=function(e,t){wx=jt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&qj(e,t),Bg!==null&&Bg(e,t)};var wl=z(null);function zd(){var e=wl.current;return e!==null?e:mt.pooledCache}function Ui(e,t){t===null?F(wl,wl.current):F(wl,t.pool)}function Hg(){var e=zd();return e===null?null:{parent:Ht._currentValue,pool:e}}var cs=Error(s(460)),Ld=Error(s(474)),Bi=Error(s(542)),Hi={then:function(){}};function Ig(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Pg(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(Fa,Fa),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vg(e),e;default:if(typeof t.status=="string")t.then(Fa,Fa);else{if(e=mt,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=i}},function(i){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vg(e),e}throw jl=t,cs}}function Sl(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(jl=r,cs):r}}var jl=null;function qg(){if(jl===null)throw Error(s(459));var e=jl;return jl=null,e}function Vg(e){if(e===cs||e===Bi)throw Error(s(483))}var us=null,po=0;function Ii(e){var t=po;return po+=1,us===null&&(us=[]),Pg(us,e,t)}function go(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Pi(e,t){throw t.$$typeof===b?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function $g(e){function t(P,B){if(e){var V=P.deletions;V===null?(P.deletions=[B],P.flags|=16):V.push(B)}}function r(P,B){if(!e)return null;for(;B!==null;)t(P,B),B=B.sibling;return null}function i(P){for(var B=new Map;P!==null;)P.key!==null?B.set(P.key,P):B.set(P.index,P),P=P.sibling;return B}function d(P,B){return P=Za(P,B),P.index=0,P.sibling=null,P}function h(P,B,V){return P.index=V,e?(V=P.alternate,V!==null?(V=V.index,V<B?(P.flags|=67108866,B):V):(P.flags|=67108866,B)):(P.flags|=1048576,B)}function S(P){return e&&P.alternate===null&&(P.flags|=67108866),P}function R(P,B,V,ne){return B===null||B.tag!==6?(B=Cd(V,P.mode,ne),B.return=P,B):(B=d(B,V),B.return=P,B)}function L(P,B,V,ne){var Re=V.type;return Re===j?W(P,B,V.props.children,ne,V.key):B!==null&&(B.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===k&&Sl(Re)===B.type)?(B=d(B,V.props),go(B,V),B.return=P,B):(B=_i(V.type,V.key,V.props,null,P.mode,ne),go(B,V),B.return=P,B)}function Y(P,B,V,ne){return B===null||B.tag!==4||B.stateNode.containerInfo!==V.containerInfo||B.stateNode.implementation!==V.implementation?(B=Ed(V,P.mode,ne),B.return=P,B):(B=d(B,V.children||[]),B.return=P,B)}function W(P,B,V,ne,Re){return B===null||B.tag!==7?(B=vl(V,P.mode,ne,Re),B.return=P,B):(B=d(B,V),B.return=P,B)}function ae(P,B,V){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Cd(""+B,P.mode,V),B.return=P,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return V=_i(B.type,B.key,B.props,null,P.mode,V),go(V,B),V.return=P,V;case E:return B=Ed(B,P.mode,V),B.return=P,B;case k:return B=Sl(B),ae(P,B,V)}if(se(B)||G(B))return B=vl(B,P.mode,V,null),B.return=P,B;if(typeof B.then=="function")return ae(P,Ii(B),V);if(B.$$typeof===T)return ae(P,Li(P,B),V);Pi(P,B)}return null}function K(P,B,V,ne){var Re=B!==null?B.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Re!==null?null:R(P,B,""+V,ne);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case w:return V.key===Re?L(P,B,V,ne):null;case E:return V.key===Re?Y(P,B,V,ne):null;case k:return V=Sl(V),K(P,B,V,ne)}if(se(V)||G(V))return Re!==null?null:W(P,B,V,ne,null);if(typeof V.then=="function")return K(P,B,Ii(V),ne);if(V.$$typeof===T)return K(P,B,Li(P,V),ne);Pi(P,V)}return null}function Z(P,B,V,ne,Re){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return P=P.get(V)||null,R(B,P,""+ne,Re);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:return P=P.get(ne.key===null?V:ne.key)||null,L(B,P,ne,Re);case E:return P=P.get(ne.key===null?V:ne.key)||null,Y(B,P,ne,Re);case k:return ne=Sl(ne),Z(P,B,V,ne,Re)}if(se(ne)||G(ne))return P=P.get(V)||null,W(B,P,ne,Re,null);if(typeof ne.then=="function")return Z(P,B,V,Ii(ne),Re);if(ne.$$typeof===T)return Z(P,B,V,Li(B,ne),Re);Pi(B,ne)}return null}function xe(P,B,V,ne){for(var Re=null,Ze=null,be=B,Be=B=0,Ye=null;be!==null&&Be<V.length;Be++){be.index>Be?(Ye=be,be=null):Ye=be.sibling;var Je=K(P,be,V[Be],ne);if(Je===null){be===null&&(be=Ye);break}e&&be&&Je.alternate===null&&t(P,be),B=h(Je,B,Be),Ze===null?Re=Je:Ze.sibling=Je,Ze=Je,be=Ye}if(Be===V.length)return r(P,be),Ge&&Ja(P,Be),Re;if(be===null){for(;Be<V.length;Be++)be=ae(P,V[Be],ne),be!==null&&(B=h(be,B,Be),Ze===null?Re=be:Ze.sibling=be,Ze=be);return Ge&&Ja(P,Be),Re}for(be=i(be);Be<V.length;Be++)Ye=Z(be,P,Be,V[Be],ne),Ye!==null&&(e&&Ye.alternate!==null&&be.delete(Ye.key===null?Be:Ye.key),B=h(Ye,B,Be),Ze===null?Re=Ye:Ze.sibling=Ye,Ze=Ye);return e&&be.forEach(function(Zr){return t(P,Zr)}),Ge&&Ja(P,Be),Re}function Me(P,B,V,ne){if(V==null)throw Error(s(151));for(var Re=null,Ze=null,be=B,Be=B=0,Ye=null,Je=V.next();be!==null&&!Je.done;Be++,Je=V.next()){be.index>Be?(Ye=be,be=null):Ye=be.sibling;var Zr=K(P,be,Je.value,ne);if(Zr===null){be===null&&(be=Ye);break}e&&be&&Zr.alternate===null&&t(P,be),B=h(Zr,B,Be),Ze===null?Re=Zr:Ze.sibling=Zr,Ze=Zr,be=Ye}if(Je.done)return r(P,be),Ge&&Ja(P,Be),Re;if(be===null){for(;!Je.done;Be++,Je=V.next())Je=ae(P,Je.value,ne),Je!==null&&(B=h(Je,B,Be),Ze===null?Re=Je:Ze.sibling=Je,Ze=Je);return Ge&&Ja(P,Be),Re}for(be=i(be);!Je.done;Be++,Je=V.next())Je=Z(be,P,Be,Je.value,ne),Je!==null&&(e&&Je.alternate!==null&&be.delete(Je.key===null?Be:Je.key),B=h(Je,B,Be),Ze===null?Re=Je:Ze.sibling=Je,Ze=Je);return e&&be.forEach(function(e2){return t(P,e2)}),Ge&&Ja(P,Be),Re}function ft(P,B,V,ne){if(typeof V=="object"&&V!==null&&V.type===j&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case w:e:{for(var Re=V.key;B!==null;){if(B.key===Re){if(Re=V.type,Re===j){if(B.tag===7){r(P,B.sibling),ne=d(B,V.props.children),ne.return=P,P=ne;break e}}else if(B.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===k&&Sl(Re)===B.type){r(P,B.sibling),ne=d(B,V.props),go(ne,V),ne.return=P,P=ne;break e}r(P,B);break}else t(P,B);B=B.sibling}V.type===j?(ne=vl(V.props.children,P.mode,ne,V.key),ne.return=P,P=ne):(ne=_i(V.type,V.key,V.props,null,P.mode,ne),go(ne,V),ne.return=P,P=ne)}return S(P);case E:e:{for(Re=V.key;B!==null;){if(B.key===Re)if(B.tag===4&&B.stateNode.containerInfo===V.containerInfo&&B.stateNode.implementation===V.implementation){r(P,B.sibling),ne=d(B,V.children||[]),ne.return=P,P=ne;break e}else{r(P,B);break}else t(P,B);B=B.sibling}ne=Ed(V,P.mode,ne),ne.return=P,P=ne}return S(P);case k:return V=Sl(V),ft(P,B,V,ne)}if(se(V))return xe(P,B,V,ne);if(G(V)){if(Re=G(V),typeof Re!="function")throw Error(s(150));return V=Re.call(V),Me(P,B,V,ne)}if(typeof V.then=="function")return ft(P,B,Ii(V),ne);if(V.$$typeof===T)return ft(P,B,Li(P,V),ne);Pi(P,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,B!==null&&B.tag===6?(r(P,B.sibling),ne=d(B,V),ne.return=P,P=ne):(r(P,B),ne=Cd(V,P.mode,ne),ne.return=P,P=ne),S(P)):r(P,B)}return function(P,B,V,ne){try{po=0;var Re=ft(P,B,V,ne);return us=null,Re}catch(be){if(be===cs||be===Bi)throw be;var Ze=Un(29,be,null,P.mode);return Ze.lanes=ne,Ze.return=P,Ze}finally{}}}var Cl=$g(!0),Yg=$g(!1),kr=!1;function Ud(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bd(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 zr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Lr(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=Oi(e),Tg(e,null,r),t}return Di(e,i,t,r),Oi(e)}function vo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,xt(e,r)}}function Hd(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var d=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var S={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?d=h=S:h=h.next=S,r=r.next}while(r!==null);h===null?d=h=t:h=h.next=t}else d=h=t;r={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:i.shared,callbacks:i.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Id=!1;function xo(){if(Id){var e=is;if(e!==null)throw e}}function yo(e,t,r,i){Id=!1;var d=e.updateQueue;kr=!1;var h=d.firstBaseUpdate,S=d.lastBaseUpdate,R=d.shared.pending;if(R!==null){d.shared.pending=null;var L=R,Y=L.next;L.next=null,S===null?h=Y:S.next=Y,S=L;var W=e.alternate;W!==null&&(W=W.updateQueue,R=W.lastBaseUpdate,R!==S&&(R===null?W.firstBaseUpdate=Y:R.next=Y,W.lastBaseUpdate=L))}if(h!==null){var ae=d.baseState;S=0,W=Y=L=null,R=h;do{var K=R.lane&-536870913,Z=K!==R.lane;if(Z?($e&K)===K:(i&K)===K){K!==0&&K===os&&(Id=!0),W!==null&&(W=W.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var xe=e,Me=R;K=t;var ft=r;switch(Me.tag){case 1:if(xe=Me.payload,typeof xe=="function"){ae=xe.call(ft,ae,K);break e}ae=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Me.payload,K=typeof xe=="function"?xe.call(ft,ae,K):xe,K==null)break e;ae=y({},ae,K);break e;case 2:kr=!0}}K=R.callback,K!==null&&(e.flags|=64,Z&&(e.flags|=8192),Z=d.callbacks,Z===null?d.callbacks=[K]:Z.push(K))}else Z={lane:K,tag:R.tag,payload:R.payload,callback:R.callback,next:null},W===null?(Y=W=Z,L=ae):W=W.next=Z,S|=K;if(R=R.next,R===null){if(R=d.shared.pending,R===null)break;Z=R,R=Z.next,Z.next=null,d.lastBaseUpdate=Z,d.shared.pending=null}}while(!0);W===null&&(L=ae),d.baseState=L,d.firstBaseUpdate=Y,d.lastBaseUpdate=W,h===null&&(d.shared.lanes=0),Pr|=S,e.lanes=S,e.memoizedState=ae}}function Gg(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function Kg(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Gg(r[e],t)}var ds=z(null),qi=z(0);function Xg(e,t){e=cr,F(qi,e),F(ds,t),cr=e|t.baseLanes}function Pd(){F(qi,cr),F(ds,ds.current)}function qd(){cr=qi.current,I(ds),I(qi)}var Bn=z(null),ta=null;function Ur(e){var t=e.alternate;F(Lt,Lt.current&1),F(Bn,e),ta===null&&(t===null||ds.current!==null||t.memoizedState!==null)&&(ta=e)}function Vd(e){F(Lt,Lt.current),F(Bn,e),ta===null&&(ta=e)}function Fg(e){e.tag===22?(F(Lt,Lt.current),F(Bn,e),ta===null&&(ta=e)):Br()}function Br(){F(Lt,Lt.current),F(Bn,Bn.current)}function Hn(e){I(Bn),ta===e&&(ta=null),I(Lt)}var Lt=z(0);function Vi(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Qf(r)||Zf(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,ut=null,It=null,$i=!1,fs=!1,El=!1,Yi=0,bo=0,hs=null,$j=0;function Ot(){throw Error(s(321))}function $d(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ln(e[r],t[r]))return!1;return!0}function Yd(e,t,r,i,d,h){return tr=h,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_.H=e===null||e.memoizedState===null?Ov:sf,El=!1,h=r(i,d),El=!1,fs&&(h=Zg(t,r,i,d)),Qg(e),h}function Qg(e){_.H=jo;var t=ut!==null&&ut.next!==null;if(tr=0,It=ut=ze=null,$i=!1,bo=0,hs=null,t)throw Error(s(300));e===null||Pt||(e=e.dependencies,e!==null&&zi(e)&&(Pt=!0))}function Zg(e,t,r,i){ze=e;var d=0;do{if(fs&&(hs=null),bo=0,fs=!1,25<=d)throw Error(s(301));if(d+=1,It=ut=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}_.H=_v,h=t(r,i)}while(fs);return h}function Yj(){var e=_.H,t=e.useState()[0];return t=typeof t.then=="function"?wo(t):t,e=e.useState()[0],(ut!==null?ut.memoizedState:null)!==e&&(ze.flags|=1024),t}function Gd(){var e=Yi!==0;return Yi=0,e}function Kd(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function Xd(e){if($i){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}$i=!1}tr=0,It=ut=ze=null,fs=!1,bo=Yi=0,hs=null}function mn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?ze.memoizedState=It=e:It=It.next=e,It}function Ut(){if(ut===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=ut.next;var t=It===null?ze.memoizedState:It.next;if(t!==null)It=t,ut=e;else{if(e===null)throw ze.alternate===null?Error(s(467)):Error(s(310));ut=e,e={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},It===null?ze.memoizedState=It=e:It=It.next=e}return It}function Gi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wo(e){var t=bo;return bo+=1,hs===null&&(hs=[]),e=Pg(hs,e,t),t=ze,(It===null?t.memoizedState:It.next)===null&&(t=t.alternate,_.H=t===null||t.memoizedState===null?Ov:sf),e}function Ki(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wo(e);if(e.$$typeof===T)return rn(e)}throw Error(s(438,String(e)))}function Fd(e){var t=null,r=ze.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=Gi(),ze.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),i=0;i<e;i++)r[i]=X;return t.index++,r}function nr(e,t){return typeof t=="function"?t(e):t}function Xi(e){var t=Ut();return Qd(t,ut,e)}function Qd(e,t,r){var i=e.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=r;var d=e.baseQueue,h=i.pending;if(h!==null){if(d!==null){var S=d.next;d.next=h.next,h.next=S}t.baseQueue=d=h,i.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{t=d.next;var R=S=null,L=null,Y=t,W=!1;do{var ae=Y.lane&-536870913;if(ae!==Y.lane?($e&ae)===ae:(tr&ae)===ae){var K=Y.revertLane;if(K===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),ae===os&&(W=!0);else if((tr&K)===K){Y=Y.next,K===os&&(W=!0);continue}else ae={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},L===null?(R=L=ae,S=h):L=L.next=ae,ze.lanes|=K,Pr|=K;ae=Y.action,El&&r(h,ae),h=Y.hasEagerState?Y.eagerState:r(h,ae)}else K={lane:ae,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},L===null?(R=L=K,S=h):L=L.next=K,ze.lanes|=ae,Pr|=ae;Y=Y.next}while(Y!==null&&Y!==t);if(L===null?S=h:L.next=R,!Ln(h,e.memoizedState)&&(Pt=!0,W&&(r=is,r!==null)))throw r;e.memoizedState=h,e.baseState=S,e.baseQueue=L,i.lastRenderedState=h}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Zd(e){var t=Ut(),r=t.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=e;var i=r.dispatch,d=r.pending,h=t.memoizedState;if(d!==null){r.pending=null;var S=d=d.next;do h=e(h,S.action),S=S.next;while(S!==d);Ln(h,t.memoizedState)||(Pt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),r.lastRenderedState=h}return[h,i]}function Jg(e,t,r){var i=ze,d=Ut(),h=Ge;if(h){if(r===void 0)throw Error(s(407));r=r()}else r=t();var S=!Ln((ut||d).memoizedState,r);if(S&&(d.memoizedState=r,Pt=!0),d=d.queue,ef(tv.bind(null,i,d,e),[e]),d.getSnapshot!==t||S||It!==null&&It.memoizedState.tag&1){if(i.flags|=2048,ms(9,{destroy:void 0},ev.bind(null,i,d,r,t),null),mt===null)throw Error(s(349));h||(tr&127)!==0||Wg(i,t,r)}return r}function Wg(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ze.updateQueue,t===null?(t=Gi(),ze.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function ev(e,t,r,i){t.value=r,t.getSnapshot=i,nv(t)&&av(e)}function tv(e,t,r){return r(function(){nv(t)&&av(e)})}function nv(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ln(e,r)}catch{return!0}}function av(e){var t=gl(e,2);t!==null&&Rn(t,e,2)}function Jd(e){var t=mn();if(typeof e=="function"){var r=e;if(e=r(),El){hn(!0);try{r()}finally{hn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:e},t}function rv(e,t,r,i){return e.baseState=r,Qd(e,ut,typeof i=="function"?i:nr)}function Gj(e,t,r,i,d){if(Zi(e))throw Error(s(485));if(e=t.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){h.listeners.push(S)}};_.T!==null?r(!0):h.isTransition=!1,i(h),r=t.pending,r===null?(h.next=t.pending=h,lv(t,h)):(h.next=r.next,t.pending=r.next=h)}}function lv(e,t){var r=t.action,i=t.payload,d=e.state;if(t.isTransition){var h=_.T,S={};_.T=S;try{var R=r(d,i),L=_.S;L!==null&&L(S,R),sv(e,t,R)}catch(Y){Wd(e,t,Y)}finally{h!==null&&S.types!==null&&(h.types=S.types),_.T=h}}else try{h=r(d,i),sv(e,t,h)}catch(Y){Wd(e,t,Y)}}function sv(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){ov(e,t,i)},function(i){return Wd(e,t,i)}):ov(e,t,r)}function ov(e,t,r){t.status="fulfilled",t.value=r,iv(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,lv(e,r)))}function Wd(e,t,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=r,iv(t),t=t.next;while(t!==i)}e.action=null}function iv(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function cv(e,t){return t}function uv(e,t){if(Ge){var r=mt.formState;if(r!==null){e:{var i=ze;if(Ge){if(yt){t:{for(var d=yt,h=ea;d.nodeType!==8;){if(!h){d=null;break t}if(d=na(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){yt=na(d.nextSibling),i=d.data==="F!";break e}}Or(i)}i=!1}i&&(t=r[0])}}return r=mn(),r.memoizedState=r.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cv,lastRenderedState:t},r.queue=i,r=Mv.bind(null,ze,i),i.dispatch=r,i=Jd(!1),h=lf.bind(null,ze,!1,i.queue),i=mn(),d={state:t,dispatch:null,action:e,pending:null},i.queue=d,r=Gj.bind(null,ze,d,h,r),d.dispatch=r,i.memoizedState=e,[t,r,!1]}function dv(e){var t=Ut();return fv(t,ut,e)}function fv(e,t,r){if(t=Qd(e,t,cv)[0],e=Xi(nr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=wo(t)}catch(S){throw S===cs?Bi:S}else i=t;t=Ut();var d=t.queue,h=d.dispatch;return r!==t.memoizedState&&(ze.flags|=2048,ms(9,{destroy:void 0},Kj.bind(null,d,r),null)),[i,h,e]}function Kj(e,t){e.action=t}function hv(e){var t=Ut(),r=ut;if(r!==null)return fv(t,r,e);Ut(),t=t.memoizedState,r=Ut();var i=r.queue.dispatch;return r.memoizedState=e,[t,i,!1]}function ms(e,t,r,i){return e={tag:e,create:r,deps:i,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Gi(),ze.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e),e}function mv(){return Ut().memoizedState}function Fi(e,t,r,i){var d=mn();ze.flags|=e,d.memoizedState=ms(1|t,{destroy:void 0},r,i===void 0?null:i)}function Qi(e,t,r,i){var d=Ut();i=i===void 0?null:i;var h=d.memoizedState.inst;ut!==null&&i!==null&&$d(i,ut.memoizedState.deps)?d.memoizedState=ms(t,h,r,i):(ze.flags|=e,d.memoizedState=ms(1|t,h,r,i))}function pv(e,t){Fi(8390656,8,e,t)}function ef(e,t){Qi(2048,8,e,t)}function Xj(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=Gi(),ze.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function gv(e){var t=Ut().memoizedState;return Xj({ref:t,nextImpl:e}),function(){if((tt&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function vv(e,t){return Qi(4,2,e,t)}function xv(e,t){return Qi(4,4,e,t)}function yv(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 bv(e,t,r){r=r!=null?r.concat([e]):null,Qi(4,4,yv.bind(null,t,e),r)}function tf(){}function wv(e,t){var r=Ut();t=t===void 0?null:t;var i=r.memoizedState;return t!==null&&$d(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Sv(e,t){var r=Ut();t=t===void 0?null:t;var i=r.memoizedState;if(t!==null&&$d(t,i[1]))return i[0];if(i=e(),El){hn(!0);try{e()}finally{hn(!1)}}return r.memoizedState=[i,t],i}function nf(e,t,r){return r===void 0||(tr&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=jx(),ze.lanes|=e,Pr|=e,r)}function jv(e,t,r,i){return Ln(r,t)?r:ds.current!==null?(e=nf(e,r,i),Ln(e,t)||(Pt=!0),e):(tr&42)===0||(tr&1073741824)!==0&&($e&261930)===0?(Pt=!0,e.memoizedState=r):(e=jx(),ze.lanes|=e,Pr|=e,t)}function Cv(e,t,r,i,d){var h=H.p;H.p=h!==0&&8>h?h:8;var S=_.T,R={};_.T=R,lf(e,!1,t,r);try{var L=d(),Y=_.S;if(Y!==null&&Y(R,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var W=Vj(L,i);So(e,t,W,qn(e))}else So(e,t,i,qn(e))}catch(ae){So(e,t,{then:function(){},status:"rejected",reason:ae},qn())}finally{H.p=h,S!==null&&R.types!==null&&(S.types=R.types),_.T=S}}function Fj(){}function af(e,t,r,i){if(e.tag!==5)throw Error(s(476));var d=Ev(e).queue;Cv(e,d,t,Q,r===null?Fj:function(){return Rv(e),r(i)})}function Ev(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:nr,lastRenderedState:Q},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 Rv(e){var t=Ev(e);t.next===null&&(t=e.alternate.memoizedState),So(e,t.next.queue,{},qn())}function rf(){return rn(Ho)}function Nv(){return Ut().memoizedState}function Tv(){return Ut().memoizedState}function Qj(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=qn();e=zr(r);var i=Lr(t,e,r);i!==null&&(Rn(i,t,r),vo(i,t,r)),t={cache:_d()},e.payload=t;return}t=t.return}}function Zj(e,t,r){var i=qn();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Zi(e)?Av(t,r):(r=Sd(e,t,r,i),r!==null&&(Rn(r,e,i),Dv(r,t,i)))}function Mv(e,t,r){var i=qn();So(e,t,r,i)}function So(e,t,r,i){var d={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Zi(e))Av(t,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var S=t.lastRenderedState,R=h(S,r);if(d.hasEagerState=!0,d.eagerState=R,Ln(R,S))return Di(e,t,d,0),mt===null&&Ai(),!1}catch{}finally{}if(r=Sd(e,t,d,i),r!==null)return Rn(r,e,i),Dv(r,t,i),!0}return!1}function lf(e,t,r,i){if(i={lane:2,revertLane:Bf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Zi(e)){if(t)throw Error(s(479))}else t=Sd(e,r,i,2),t!==null&&Rn(t,e,2)}function Zi(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function Av(e,t){fs=$i=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Dv(e,t,r){if((r&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,xt(e,r)}}var jo={readContext:rn,use:Ki,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};jo.useEffectEvent=Ot;var Ov={readContext:rn,use:Ki,useCallback:function(e,t){return mn().memoizedState=[e,t===void 0?null:t],e},useContext:rn,useEffect:pv,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,Fi(4194308,4,yv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Fi(4194308,4,e,t)},useInsertionEffect:function(e,t){Fi(4,2,e,t)},useMemo:function(e,t){var r=mn();t=t===void 0?null:t;var i=e();if(El){hn(!0);try{e()}finally{hn(!1)}}return r.memoizedState=[i,t],i},useReducer:function(e,t,r){var i=mn();if(r!==void 0){var d=r(t);if(El){hn(!0);try{r(t)}finally{hn(!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=Zj.bind(null,ze,e),[i.memoizedState,e]},useRef:function(e){var t=mn();return e={current:e},t.memoizedState=e},useState:function(e){e=Jd(e);var t=e.queue,r=Mv.bind(null,ze,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:tf,useDeferredValue:function(e,t){var r=mn();return nf(r,e,t)},useTransition:function(){var e=Jd(!1);return e=Cv.bind(null,ze,e.queue,!0,!1),mn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var i=ze,d=mn();if(Ge){if(r===void 0)throw Error(s(407));r=r()}else{if(r=t(),mt===null)throw Error(s(349));($e&127)!==0||Wg(i,t,r)}d.memoizedState=r;var h={value:r,getSnapshot:t};return d.queue=h,pv(tv.bind(null,i,h,e),[e]),i.flags|=2048,ms(9,{destroy:void 0},ev.bind(null,i,h,r,t),null),r},useId:function(){var e=mn(),t=mt.identifierPrefix;if(Ge){var r=Aa,i=Ma;r=(i&~(1<<32-Tt(i)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Yi++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=$j++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:rf,useFormState:uv,useActionState:uv,useOptimistic:function(e){var t=mn();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=lf.bind(null,ze,!0,r),r.dispatch=t,[e,t]},useMemoCache:Fd,useCacheRefresh:function(){return mn().memoizedState=Qj.bind(null,ze)},useEffectEvent:function(e){var t=mn(),r={impl:e};return t.memoizedState=r,function(){if((tt&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},sf={readContext:rn,use:Ki,useCallback:wv,useContext:rn,useEffect:ef,useImperativeHandle:bv,useInsertionEffect:vv,useLayoutEffect:xv,useMemo:Sv,useReducer:Xi,useRef:mv,useState:function(){return Xi(nr)},useDebugValue:tf,useDeferredValue:function(e,t){var r=Ut();return jv(r,ut.memoizedState,e,t)},useTransition:function(){var e=Xi(nr)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:wo(e),t]},useSyncExternalStore:Jg,useId:Nv,useHostTransitionStatus:rf,useFormState:dv,useActionState:dv,useOptimistic:function(e,t){var r=Ut();return rv(r,ut,e,t)},useMemoCache:Fd,useCacheRefresh:Tv};sf.useEffectEvent=gv;var _v={readContext:rn,use:Ki,useCallback:wv,useContext:rn,useEffect:ef,useImperativeHandle:bv,useInsertionEffect:vv,useLayoutEffect:xv,useMemo:Sv,useReducer:Zd,useRef:mv,useState:function(){return Zd(nr)},useDebugValue:tf,useDeferredValue:function(e,t){var r=Ut();return ut===null?nf(r,e,t):jv(r,ut.memoizedState,e,t)},useTransition:function(){var e=Zd(nr)[0],t=Ut().memoizedState;return[typeof e=="boolean"?e:wo(e),t]},useSyncExternalStore:Jg,useId:Nv,useHostTransitionStatus:rf,useFormState:hv,useActionState:hv,useOptimistic:function(e,t){var r=Ut();return ut!==null?rv(r,ut,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Fd,useCacheRefresh:Tv};_v.useEffectEvent=gv;function of(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 cf={enqueueSetState:function(e,t,r){e=e._reactInternals;var i=qn(),d=zr(i);d.payload=t,r!=null&&(d.callback=r),t=Lr(e,d,i),t!==null&&(Rn(t,e,i),vo(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=qn(),d=zr(i);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=Lr(e,d,i),t!==null&&(Rn(t,e,i),vo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=qn(),i=zr(r);i.tag=2,t!=null&&(i.callback=t),t=Lr(e,i,r),t!==null&&(Rn(t,e,r),vo(t,e,r))}};function kv(e,t,r,i,d,h,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,S):t.prototype&&t.prototype.isPureReactComponent?!io(r,i)||!io(d,h):!0}function zv(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&&cf.enqueueReplaceState(t,t.state,null)}function Rl(e,t){var r=t;if("ref"in t){r={};for(var i in t)i!=="ref"&&(r[i]=t[i])}if(e=e.defaultProps){r===t&&(r=y({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function Lv(e){Mi(e)}function Uv(e){console.error(e)}function Bv(e){Mi(e)}function Ji(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Hv(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 uf(e,t,r){return r=zr(r),r.tag=3,r.payload={element:null},r.callback=function(){Ji(e,t)},r}function Iv(e){return e=zr(e),e.tag=3,e}function Pv(e,t,r,i){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var h=i.value;e.payload=function(){return d(h)},e.callback=function(){Hv(t,r,i)}}var S=r.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){Hv(t,r,i),typeof d!="function"&&(qr===null?qr=new Set([this]):qr.add(this));var R=i.stack;this.componentDidCatch(i.value,{componentStack:R!==null?R:""})})}function Jj(e,t,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=r.alternate,t!==null&&ss(t,r,d,!0),r=Bn.current,r!==null){switch(r.tag){case 31:case 13:return ta===null?uc():r.alternate===null&&_t===0&&(_t=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===Hi?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([i]):t.add(i),zf(e,i,d)),!1;case 22:return r.flags|=65536,i===Hi?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([i]):r.add(i)),zf(e,i,d)),!1}throw Error(s(435,r.tag))}return zf(e,i,d),uc(),!1}if(Ge)return t=Bn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,i!==Td&&(e=Error(s(422),{cause:i}),fo(Zn(e,r)))):(i!==Td&&(t=Error(s(423),{cause:i}),fo(Zn(t,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=Zn(i,r),d=uf(e.stateNode,i,d),Hd(e,d),_t!==4&&(_t=2)),!1;var h=Error(s(520),{cause:i});if(h=Zn(h,r),Do===null?Do=[h]:Do.push(h),_t!==4&&(_t=2),t===null)return!0;i=Zn(i,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=uf(r.stateNode,i,e),Hd(r,e),!1;case 1:if(t=r.type,h=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(qr===null||!qr.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=Iv(d),Pv(d,e,r,i),Hd(r,d),!1}r=r.return}while(r!==null);return!1}var df=Error(s(461)),Pt=!1;function ln(e,t,r,i){t.child=e===null?Yg(t,null,r,i):Cl(t,e.child,r,i)}function qv(e,t,r,i,d){r=r.render;var h=t.ref;if("ref"in i){var S={};for(var R in i)R!=="ref"&&(S[R]=i[R])}else S=i;return bl(t),i=Yd(e,t,r,S,h,d),R=Gd(),e!==null&&!Pt?(Kd(e,t,d),ar(e,t,d)):(Ge&&R&&Rd(t),t.flags|=1,ln(e,t,i,d),t.child)}function Vv(e,t,r,i,d){if(e===null){var h=r.type;return typeof h=="function"&&!jd(h)&&h.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=h,$v(e,t,h,i,d)):(e=_i(r.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!yf(e,d)){var S=h.memoizedProps;if(r=r.compare,r=r!==null?r:io,r(S,i)&&e.ref===t.ref)return ar(e,t,d)}return t.flags|=1,e=Za(h,i),e.ref=t.ref,e.return=t,t.child=e}function $v(e,t,r,i,d){if(e!==null){var h=e.memoizedProps;if(io(h,i)&&e.ref===t.ref)if(Pt=!1,t.pendingProps=i=h,yf(e,d))(e.flags&131072)!==0&&(Pt=!0);else return t.lanes=e.lanes,ar(e,t,d)}return ff(e,t,r,i,d)}function Yv(e,t,r,i){var d=i.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|r:r,e!==null){for(i=t.child=e.child,d=0;i!==null;)d=d|i.lanes|i.childLanes,i=i.sibling;i=d&~h}else i=0,t.child=null;return Gv(e,t,h,r,i)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ui(t,h!==null?h.cachePool:null),h!==null?Xg(t,h):Pd(),Fg(t);else return i=t.lanes=536870912,Gv(e,t,h!==null?h.baseLanes|r:r,r,i)}else h!==null?(Ui(t,h.cachePool),Xg(t,h),Br(),t.memoizedState=null):(e!==null&&Ui(t,null),Pd(),Br());return ln(e,t,d,r),t.child}function Co(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Gv(e,t,r,i,d){var h=zd();return h=h===null?null:{parent:Ht._currentValue,pool:h},t.memoizedState={baseLanes:r,cachePool:h},e!==null&&Ui(t,null),Pd(),Fg(t),e!==null&&ss(e,t,i,!0),t.childLanes=d,null}function Wi(e,t){return t=tc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Kv(e,t,r){return Cl(t,e.child,null,r),e=Wi(t,t.pendingProps),e.flags|=2,Hn(t),t.memoizedState=null,e}function Wj(e,t,r){var i=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(i.mode==="hidden")return e=Wi(t,i),t.lanes=536870912,Co(null,e);if(Vd(t),(e=yt)?(e=ly(e,ea),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ar!==null?{id:Ma,overflow:Aa}:null,retryLane:536870912,hydrationErrors:null},r=Ag(e),r.return=t,t.child=r,an=t,yt=null)):e=null,e===null)throw Or(t);return t.lanes=536870912,null}return Wi(t,i)}var h=e.memoizedState;if(h!==null){var S=h.dehydrated;if(Vd(t),d)if(t.flags&256)t.flags&=-257,t=Kv(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(Pt||ss(e,t,r,!1),d=(r&e.childLanes)!==0,Pt||d){if(i=mt,i!==null&&(S=zt(i,r),S!==0&&S!==h.retryLane))throw h.retryLane=S,gl(e,S),Rn(i,e,S),df;uc(),t=Kv(e,t,r)}else e=h.treeContext,yt=na(S.nextSibling),an=t,Ge=!0,Dr=null,ea=!1,e!==null&&_g(t,e),t=Wi(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 ec(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function ff(e,t,r,i,d){return bl(t),r=Yd(e,t,r,i,void 0,d),i=Gd(),e!==null&&!Pt?(Kd(e,t,d),ar(e,t,d)):(Ge&&i&&Rd(t),t.flags|=1,ln(e,t,r,d),t.child)}function Xv(e,t,r,i,d,h){return bl(t),t.updateQueue=null,r=Zg(t,i,r,d),Qg(e),i=Gd(),e!==null&&!Pt?(Kd(e,t,h),ar(e,t,h)):(Ge&&i&&Rd(t),t.flags|=1,ln(e,t,r,h),t.child)}function Fv(e,t,r,i,d){if(bl(t),t.stateNode===null){var h=ns,S=r.contextType;typeof S=="object"&&S!==null&&(h=rn(S)),h=new r(i,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=cf,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=i,h.state=t.memoizedState,h.refs={},Ud(t),S=r.contextType,h.context=typeof S=="object"&&S!==null?rn(S):ns,h.state=t.memoizedState,S=r.getDerivedStateFromProps,typeof S=="function"&&(of(t,r,S,i),h.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(S=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),S!==h.state&&cf.enqueueReplaceState(h,h.state,null),yo(t,i,h,d),xo(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){h=t.stateNode;var R=t.memoizedProps,L=Rl(r,R);h.props=L;var Y=h.context,W=r.contextType;S=ns,typeof W=="object"&&W!==null&&(S=rn(W));var ae=r.getDerivedStateFromProps;W=typeof ae=="function"||typeof h.getSnapshotBeforeUpdate=="function",R=t.pendingProps!==R,W||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(R||Y!==S)&&zv(t,h,i,S),kr=!1;var K=t.memoizedState;h.state=K,yo(t,i,h,d),xo(),Y=t.memoizedState,R||K!==Y||kr?(typeof ae=="function"&&(of(t,r,ae,i),Y=t.memoizedState),(L=kr||kv(t,r,L,i,K,Y,S))?(W||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=Y),h.props=i,h.state=Y,h.context=S,i=L):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{h=t.stateNode,Bd(e,t),S=t.memoizedProps,W=Rl(r,S),h.props=W,ae=t.pendingProps,K=h.context,Y=r.contextType,L=ns,typeof Y=="object"&&Y!==null&&(L=rn(Y)),R=r.getDerivedStateFromProps,(Y=typeof R=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S!==ae||K!==L)&&zv(t,h,i,L),kr=!1,K=t.memoizedState,h.state=K,yo(t,i,h,d),xo();var Z=t.memoizedState;S!==ae||K!==Z||kr||e!==null&&e.dependencies!==null&&zi(e.dependencies)?(typeof R=="function"&&(of(t,r,R,i),Z=t.memoizedState),(W=kr||kv(t,r,W,i,K,Z,L)||e!==null&&e.dependencies!==null&&zi(e.dependencies))?(Y||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(i,Z,L),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(i,Z,L)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=Z),h.props=i,h.state=Z,h.context=L,i=W):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),i=!1)}return h=i,ec(e,t),i=(t.flags&128)!==0,h||i?(h=t.stateNode,r=i&&typeof r.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&i?(t.child=Cl(t,e.child,null,d),t.child=Cl(t,null,r,d)):ln(e,t,r,d),t.memoizedState=h.state,e=t.child):e=ar(e,t,d),e}function Qv(e,t,r,i){return xl(),t.flags|=256,ln(e,t,r,i),t.child}var hf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mf(e){return{baseLanes:e,cachePool:Hg()}}function pf(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=Pn),e}function Zv(e,t,r){var i=t.pendingProps,d=!1,h=(t.flags&128)!==0,S;if((S=h)||(S=e!==null&&e.memoizedState===null?!1:(Lt.current&2)!==0),S&&(d=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(d?Ur(t):Br(),(e=yt)?(e=ly(e,ea),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ar!==null?{id:Ma,overflow:Aa}:null,retryLane:536870912,hydrationErrors:null},r=Ag(e),r.return=t,t.child=r,an=t,yt=null)):e=null,e===null)throw Or(t);return Zf(e)?t.lanes=32:t.lanes=536870912,null}var R=i.children;return i=i.fallback,d?(Br(),d=t.mode,R=tc({mode:"hidden",children:R},d),i=vl(i,d,r,null),R.return=t,i.return=t,R.sibling=i,t.child=R,i=t.child,i.memoizedState=mf(r),i.childLanes=pf(e,S,r),t.memoizedState=hf,Co(null,i)):(Ur(t),gf(t,R))}var L=e.memoizedState;if(L!==null&&(R=L.dehydrated,R!==null)){if(h)t.flags&256?(Ur(t),t.flags&=-257,t=vf(e,t,r)):t.memoizedState!==null?(Br(),t.child=e.child,t.flags|=128,t=null):(Br(),R=i.fallback,d=t.mode,i=tc({mode:"visible",children:i.children},d),R=vl(R,d,r,null),R.flags|=2,i.return=t,R.return=t,i.sibling=R,t.child=i,Cl(t,e.child,null,r),i=t.child,i.memoizedState=mf(r),i.childLanes=pf(e,S,r),t.memoizedState=hf,t=Co(null,i));else if(Ur(t),Zf(R)){if(S=R.nextSibling&&R.nextSibling.dataset,S)var Y=S.dgst;S=Y,i=Error(s(419)),i.stack="",i.digest=S,fo({value:i,source:null,stack:null}),t=vf(e,t,r)}else if(Pt||ss(e,t,r,!1),S=(r&e.childLanes)!==0,Pt||S){if(S=mt,S!==null&&(i=zt(S,r),i!==0&&i!==L.retryLane))throw L.retryLane=i,gl(e,i),Rn(S,e,i),df;Qf(R)||uc(),t=vf(e,t,r)}else Qf(R)?(t.flags|=192,t.child=e.child,t=null):(e=L.treeContext,yt=na(R.nextSibling),an=t,Ge=!0,Dr=null,ea=!1,e!==null&&_g(t,e),t=gf(t,i.children),t.flags|=4096);return t}return d?(Br(),R=i.fallback,d=t.mode,L=e.child,Y=L.sibling,i=Za(L,{mode:"hidden",children:i.children}),i.subtreeFlags=L.subtreeFlags&65011712,Y!==null?R=Za(Y,R):(R=vl(R,d,r,null),R.flags|=2),R.return=t,i.return=t,i.sibling=R,t.child=i,Co(null,i),i=t.child,R=e.child.memoizedState,R===null?R=mf(r):(d=R.cachePool,d!==null?(L=Ht._currentValue,d=d.parent!==L?{parent:L,pool:L}:d):d=Hg(),R={baseLanes:R.baseLanes|r,cachePool:d}),i.memoizedState=R,i.childLanes=pf(e,S,r),t.memoizedState=hf,Co(e.child,i)):(Ur(t),r=e.child,e=r.sibling,r=Za(r,{mode:"visible",children:i.children}),r.return=t,r.sibling=null,e!==null&&(S=t.deletions,S===null?(t.deletions=[e],t.flags|=16):S.push(e)),t.child=r,t.memoizedState=null,r)}function gf(e,t){return t=tc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function tc(e,t){return e=Un(22,e,null,t),e.lanes=0,e}function vf(e,t,r){return Cl(t,e.child,null,r),e=gf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jv(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Dd(e.return,t,r)}function xf(e,t,r,i,d,h){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:d,treeForkCount:h}:(S.isBackwards=t,S.rendering=null,S.renderingStartTime=0,S.last=i,S.tail=r,S.tailMode=d,S.treeForkCount=h)}function Wv(e,t,r){var i=t.pendingProps,d=i.revealOrder,h=i.tail;i=i.children;var S=Lt.current,R=(S&2)!==0;if(R?(S=S&1|2,t.flags|=128):S&=1,F(Lt,S),ln(e,t,i,r),i=Ge?uo:0,!R&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jv(e,r,t);else if(e.tag===19)Jv(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(r=t.child,d=null;r!==null;)e=r.alternate,e!==null&&Vi(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=t.child,t.child=null):(d=r.sibling,r.sibling=null),xf(t,!1,d,r,h,i);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Vi(e)===null){t.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}xf(t,!0,r,null,h,i);break;case"together":xf(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),Pr|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(ss(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,r=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 yf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&zi(e)))}function eC(e,t,r){switch(t.tag){case 3:oe(t,t.stateNode.containerInfo),_r(t,Ht,e.memoizedState.cache),xl();break;case 27:case 5:fe(t);break;case 4:oe(t,t.stateNode.containerInfo);break;case 10:_r(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Vd(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Ur(t),t.flags|=128,null):(r&t.child.childLanes)!==0?Zv(e,t,r):(Ur(t),e=ar(e,t,r),e!==null?e.sibling:null);Ur(t);break;case 19:var d=(e.flags&128)!==0;if(i=(r&t.childLanes)!==0,i||(ss(e,t,r,!1),i=(r&t.childLanes)!==0),d){if(i)return Wv(e,t,r);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),F(Lt,Lt.current),i)break;return null;case 22:return t.lanes=0,Yv(e,t,r,t.pendingProps);case 24:_r(t,Ht,e.memoizedState.cache)}return ar(e,t,r)}function ex(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)Pt=!0;else{if(!yf(e,r)&&(t.flags&128)===0)return Pt=!1,eC(e,t,r);Pt=(e.flags&131072)!==0}else Pt=!1,Ge&&(t.flags&1048576)!==0&&Og(t,uo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Sl(t.elementType),t.type=e,typeof e=="function")jd(e)?(i=Rl(e,i),t.tag=1,t=Fv(null,t,e,i,r)):(t.tag=0,t=ff(null,t,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===D){t.tag=11,t=qv(null,t,e,i,r);break e}else if(d===U){t.tag=14,t=Vv(null,t,e,i,r);break e}}throw t=ce(e)||e,Error(s(306,t,""))}}return t;case 0:return ff(e,t,t.type,t.pendingProps,r);case 1:return i=t.type,d=Rl(i,t.pendingProps),Fv(e,t,i,d,r);case 3:e:{if(oe(t,t.stateNode.containerInfo),e===null)throw Error(s(387));i=t.pendingProps;var h=t.memoizedState;d=h.element,Bd(e,t),yo(t,i,null,r);var S=t.memoizedState;if(i=S.cache,_r(t,Ht,i),i!==h.cache&&Od(t,[Ht],r,!0),xo(),i=S.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:S.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=Qv(e,t,i,r);break e}else if(i!==d){d=Zn(Error(s(424)),t),fo(d),t=Qv(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(yt=na(e.firstChild),an=t,Ge=!0,Dr=null,ea=!0,r=Yg(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(xl(),i===d){t=ar(e,t,r);break e}ln(e,t,i,r)}t=t.child}return t;case 26:return ec(e,t),e===null?(r=dy(t.type,null,t.pendingProps,null))?t.memoizedState=r:Ge||(r=t.type,e=t.pendingProps,i=vc(ge.current).createElement(r),i[nn]=t,i[bn]=e,sn(i,r,e),Zt(i),t.stateNode=i):t.memoizedState=dy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&Ge&&(i=t.stateNode=iy(t.type,t.pendingProps,ge.current),an=t,ea=!0,d=yt,Gr(t.type)?(Jf=d,yt=na(i.firstChild)):yt=d),ln(e,t,t.pendingProps.children,r),ec(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((d=i=yt)&&(i=AC(i,t.type,t.pendingProps,ea),i!==null?(t.stateNode=i,an=t,yt=na(i.firstChild),ea=!1,d=!0):d=!1),d||Or(t)),fe(t),d=t.type,h=t.pendingProps,S=e!==null?e.memoizedProps:null,i=h.children,Kf(d,h)?i=null:S!==null&&Kf(d,S)&&(t.flags|=32),t.memoizedState!==null&&(d=Yd(e,t,Yj,null,null,r),Ho._currentValue=d),ec(e,t),ln(e,t,i,r),t.child;case 6:return e===null&&Ge&&((e=r=yt)&&(r=DC(r,t.pendingProps,ea),r!==null?(t.stateNode=r,an=t,yt=null,e=!0):e=!1),e||Or(t)),null;case 13:return Zv(e,t,r);case 4:return oe(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Cl(t,null,i,r):ln(e,t,i,r),t.child;case 11:return qv(e,t,t.type,t.pendingProps,r);case 7:return ln(e,t,t.pendingProps,r),t.child;case 8:return ln(e,t,t.pendingProps.children,r),t.child;case 12:return ln(e,t,t.pendingProps.children,r),t.child;case 10:return i=t.pendingProps,_r(t,t.type,i.value),ln(e,t,i.children,r),t.child;case 9:return d=t.type._context,i=t.pendingProps.children,bl(t),d=rn(d),i=i(d),t.flags|=1,ln(e,t,i,r),t.child;case 14:return Vv(e,t,t.type,t.pendingProps,r);case 15:return $v(e,t,t.type,t.pendingProps,r);case 19:return Wv(e,t,r);case 31:return Wj(e,t,r);case 22:return Yv(e,t,r,t.pendingProps);case 24:return bl(t),i=rn(Ht),e===null?(d=zd(),d===null&&(d=mt,h=_d(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),t.memoizedState={parent:i,cache:d},Ud(t),_r(t,Ht,d)):((e.lanes&r)!==0&&(Bd(e,t),yo(t,null,null,r),xo()),d=e.memoizedState,h=t.memoizedState,d.parent!==i?(d={parent:i,cache:i},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),_r(t,Ht,i)):(i=h.cache,_r(t,Ht,i),i!==d.cache&&Od(t,[Ht],r,!0))),ln(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function rr(e){e.flags|=4}function bf(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(Nx())e.flags|=8192;else throw jl=Hi,Ld}else e.flags&=-16777217}function tx(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!gy(t))if(Nx())e.flags|=8192;else throw jl=Hi,Ld}function nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ue():536870912,e.lanes|=t,xs|=t)}function Eo(e,t){if(!Ge)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function bt(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 tC(e,t,r){var i=t.pendingProps;switch(Nd(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(t),null;case 1:return bt(t),null;case 3:return r=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),er(Ht),de(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ls(t)?rr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Md())),bt(t),null;case 26:var d=t.type,h=t.memoizedState;return e===null?(rr(t),h!==null?(bt(t),tx(t,h)):(bt(t),bf(t,d,null,i,r))):h?h!==e.memoizedState?(rr(t),bt(t),tx(t,h)):(bt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&rr(t),bt(t),bf(t,d,e,i,r)),null;case 27:if(Te(t),r=ge.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&rr(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return bt(t),null}e=re.current,ls(t)?kg(t):(e=iy(d,i,r),t.stateNode=e,rr(t))}return bt(t),null;case 5:if(Te(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&rr(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return bt(t),null}if(h=re.current,ls(t))kg(t);else{var S=vc(ge.current);switch(h){case 1:h=S.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=S.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=S.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof i.is=="string"?S.createElement("select",{is:i.is}):S.createElement("select"),i.multiple?h.multiple=!0:i.size&&(h.size=i.size);break;default:h=typeof i.is=="string"?S.createElement(d,{is:i.is}):S.createElement(d)}}h[nn]=t,h[bn]=i;e:for(S=t.child;S!==null;){if(S.tag===5||S.tag===6)h.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===t)break e;for(;S.sibling===null;){if(S.return===null||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}t.stateNode=h;e:switch(sn(h,d,i),d){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&rr(t)}}return bt(t),bf(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(s(166));if(e=ge.current,ls(t)){if(e=t.stateNode,r=t.memoizedProps,i=null,d=an,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[nn]=t,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||Zx(e.nodeValue,r)),e||Or(t,!0)}else e=vc(e).createTextNode(i),e[nn]=t,t.stateNode=e}return bt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(i=ls(t),r!==null){if(e===null){if(!i)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[nn]=t}else xl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bt(t),e=!1}else r=Md(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(Hn(t),t):(Hn(t),null);if((t.flags&128)!==0)throw Error(s(558))}return bt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=ls(t),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(s(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[nn]=t}else xl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bt(t),d=!1}else d=Md(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(Hn(t),t):(Hn(t),null)}return Hn(t),(t.flags&128)!==0?(t.lanes=r,t):(r=i!==null,e=e!==null&&e.memoizedState!==null,r&&(i=t.child,d=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(d=i.alternate.memoizedState.cachePool.pool),h=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),h!==d&&(i.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),nc(t,t.updateQueue),bt(t),null);case 4:return de(),e===null&&qf(t.stateNode.containerInfo),bt(t),null;case 10:return er(t.type),bt(t),null;case 19:if(I(Lt),i=t.memoizedState,i===null)return bt(t),null;if(d=(t.flags&128)!==0,h=i.rendering,h===null)if(d)Eo(i,!1);else{if(_t!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Vi(e),h!==null){for(t.flags|=128,Eo(i,!1),e=h.updateQueue,t.updateQueue=e,nc(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Mg(r,e),r=r.sibling;return F(Lt,Lt.current&1|2),Ge&&Ja(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&jt()>oc&&(t.flags|=128,d=!0,Eo(i,!1),t.lanes=4194304)}else{if(!d)if(e=Vi(h),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,nc(t,e),Eo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!h.alternate&&!Ge)return bt(t),null}else 2*jt()-i.renderingStartTime>oc&&r!==536870912&&(t.flags|=128,d=!0,Eo(i,!1),t.lanes=4194304);i.isBackwards?(h.sibling=t.child,t.child=h):(e=i.last,e!==null?e.sibling=h:t.child=h,i.last=h)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=jt(),e.sibling=null,r=Lt.current,F(Lt,d?r&1|2:r&1),Ge&&Ja(t,i.treeForkCount),e):(bt(t),null);case 22:case 23:return Hn(t),qd(),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&&(bt(t),t.subtreeFlags&6&&(t.flags|=8192)):bt(t),r=t.updateQueue,r!==null&&nc(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==r&&(t.flags|=2048),e!==null&&I(wl),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),er(Ht),bt(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function nC(e,t){switch(Nd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return er(Ht),de(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Te(t),null;case 31:if(t.memoizedState!==null){if(Hn(t),t.alternate===null)throw Error(s(340));xl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Hn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));xl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(Lt),null;case 4:return de(),null;case 10:return er(t.type),null;case 22:case 23:return Hn(t),qd(),e!==null&&I(wl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return er(Ht),null;case 25:return null;default:return null}}function nx(e,t){switch(Nd(t),t.tag){case 3:er(Ht),de();break;case 26:case 27:case 5:Te(t);break;case 4:de();break;case 31:t.memoizedState!==null&&Hn(t);break;case 13:Hn(t);break;case 19:I(Lt);break;case 10:er(t.type);break;case 22:case 23:Hn(t),qd(),e!==null&&I(wl);break;case 24:er(Ht)}}function Ro(e,t){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var d=i.next;r=d;do{if((r.tag&e)===e){i=void 0;var h=r.create,S=r.inst;i=h(),S.destroy=i}r=r.next}while(r!==d)}}catch(R){it(t,t.return,R)}}function Hr(e,t,r){try{var i=t.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var h=d.next;i=h;do{if((i.tag&e)===e){var S=i.inst,R=S.destroy;if(R!==void 0){S.destroy=void 0,d=t;var L=r,Y=R;try{Y()}catch(W){it(d,L,W)}}}i=i.next}while(i!==h)}}catch(W){it(t,t.return,W)}}function ax(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{Kg(t,r)}catch(i){it(e,e.return,i)}}}function rx(e,t,r){r.props=Rl(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){it(e,t,i)}}function No(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof r=="function"?e.refCleanup=r(i):r.current=i}}catch(d){it(e,t,d)}}function Da(e,t){var r=e.ref,i=e.refCleanup;if(r!==null)if(typeof i=="function")try{i()}catch(d){it(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){it(e,t,d)}else r.current=null}function lx(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){it(e,e.return,d)}}function wf(e,t,r){try{var i=e.stateNode;CC(i,e.type,r,t),i[bn]=t}catch(d){it(e,e.return,d)}}function sx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Gr(e.type)||e.tag===4}function Sf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sx(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&&Gr(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 jf(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=Fa));else if(i!==4&&(i===27&&Gr(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(jf(e,t,r),e=e.sibling;e!==null;)jf(e,t,r),e=e.sibling}function ac(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(i===27&&Gr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(ac(e,t,r),e=e.sibling;e!==null;)ac(e,t,r),e=e.sibling}function ox(e){var t=e.stateNode,r=e.memoizedProps;try{for(var i=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);sn(t,i,r),t[nn]=e,t[bn]=r}catch(h){it(e,e.return,h)}}var lr=!1,qt=!1,Cf=!1,ix=typeof WeakSet=="function"?WeakSet:Set,Jt=null;function aC(e,t){if(e=e.containerInfo,Yf=Cc,e=bg(e),gd(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var d=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var S=0,R=-1,L=-1,Y=0,W=0,ae=e,K=null;t:for(;;){for(var Z;ae!==r||d!==0&&ae.nodeType!==3||(R=S+d),ae!==h||i!==0&&ae.nodeType!==3||(L=S+i),ae.nodeType===3&&(S+=ae.nodeValue.length),(Z=ae.firstChild)!==null;)K=ae,ae=Z;for(;;){if(ae===e)break t;if(K===r&&++Y===d&&(R=S),K===h&&++W===i&&(L=S),(Z=ae.nextSibling)!==null)break;ae=K,K=ae.parentNode}ae=Z}r=R===-1||L===-1?null:{start:R,end:L}}else r=null}r=r||{start:0,end:0}}else r=null;for(Gf={focusedElem:e,selectionRange:r},Cc=!1,Jt=t;Jt!==null;)if(t=Jt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Jt=e;else for(;Jt!==null;){switch(t=Jt,h=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,r=t,d=h.memoizedProps,h=h.memoizedState,i=r.stateNode;try{var xe=Rl(r.type,d);e=i.getSnapshotBeforeUpdate(xe,h),i.__reactInternalSnapshotBeforeUpdate=e}catch(Me){it(r,r.return,Me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)Ff(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ff(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,Jt=e;break}Jt=t.return}}function cx(e,t,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:or(e,r),i&4&&Ro(5,r);break;case 1:if(or(e,r),i&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(S){it(r,r.return,S)}else{var d=Rl(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(S){it(r,r.return,S)}}i&64&&ax(r),i&512&&No(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{Kg(e,t)}catch(S){it(r,r.return,S)}}break;case 27:t===null&&i&4&&ox(r);case 26:case 5:or(e,r),t===null&&i&4&&lx(r),i&512&&No(r,r.return);break;case 12:or(e,r);break;case 31:or(e,r),i&4&&fx(e,r);break;case 13:or(e,r),i&4&&hx(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=fC.bind(null,r),OC(e,r))));break;case 22:if(i=r.memoizedState!==null||lr,!i){t=t!==null&&t.memoizedState!==null||qt,d=lr;var h=qt;lr=i,(qt=t)&&!h?ir(e,r,(r.subtreeFlags&8772)!==0):or(e,r),lr=d,qt=h}break;case 30:break;default:or(e,r)}}function ux(e){var t=e.alternate;t!==null&&(e.alternate=null,ux(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Wu(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,Sn=!1;function sr(e,t,r){for(r=r.child;r!==null;)dx(e,t,r),r=r.sibling}function dx(e,t,r){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(ha,r)}catch{}switch(r.tag){case 26:qt||Da(r,t),sr(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:qt||Da(r,t);var i=Et,d=Sn;Gr(r.type)&&(Et=r.stateNode,Sn=!1),sr(e,t,r),Lo(r.stateNode),Et=i,Sn=d;break;case 5:qt||Da(r,t);case 6:if(i=Et,d=Sn,Et=null,sr(e,t,r),Et=i,Sn=d,Et!==null)if(Sn)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(r.stateNode)}catch(h){it(r,t,h)}else try{Et.removeChild(r.stateNode)}catch(h){it(r,t,h)}break;case 18:Et!==null&&(Sn?(e=Et,ay(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Rs(e)):ay(Et,r.stateNode));break;case 4:i=Et,d=Sn,Et=r.stateNode.containerInfo,Sn=!0,sr(e,t,r),Et=i,Sn=d;break;case 0:case 11:case 14:case 15:Hr(2,r,t),qt||Hr(4,r,t),sr(e,t,r);break;case 1:qt||(Da(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"&&rx(r,t,i)),sr(e,t,r);break;case 21:sr(e,t,r);break;case 22:qt=(i=qt)||r.memoizedState!==null,sr(e,t,r),qt=i;break;default:sr(e,t,r)}}function fx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rs(e)}catch(r){it(t,t.return,r)}}}function hx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rs(e)}catch(r){it(t,t.return,r)}}function rC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ix),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ix),t;default:throw Error(s(435,e.tag))}}function rc(e,t){var r=rC(e);t.forEach(function(i){if(!r.has(i)){r.add(i);var d=hC.bind(null,e,i);i.then(d,d)}})}function jn(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var d=r[i],h=e,S=t,R=S;e:for(;R!==null;){switch(R.tag){case 27:if(Gr(R.type)){Et=R.stateNode,Sn=!1;break e}break;case 5:Et=R.stateNode,Sn=!1;break e;case 3:case 4:Et=R.stateNode.containerInfo,Sn=!0;break e}R=R.return}if(Et===null)throw Error(s(160));dx(h,S,d),Et=null,Sn=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)mx(t,e),t=t.sibling}var ga=null;function mx(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:jn(t,e),Cn(e),i&4&&(Hr(3,e,e.return),Ro(3,e),Hr(5,e,e.return));break;case 1:jn(t,e),Cn(e),i&512&&(qt||r===null||Da(r,r.return)),i&64&&lr&&(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=ga;if(jn(t,e),Cn(e),i&512&&(qt||r===null||Da(r,r.return)),i&4){var h=r!==null?r.memoizedState:null;if(i=e.memoizedState,r===null)if(i===null)if(e.stateNode===null){e:{i=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":h=d.getElementsByTagName("title")[0],(!h||h[Ws]||h[nn]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(i),d.head.insertBefore(h,d.querySelector("head > title"))),sn(h,i,r),h[nn]=e,Zt(h),i=h;break e;case"link":var S=my("link","href",d).get(i+(r.href||""));if(S){for(var R=0;R<S.length;R++)if(h=S[R],h.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&h.getAttribute("rel")===(r.rel==null?null:r.rel)&&h.getAttribute("title")===(r.title==null?null:r.title)&&h.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){S.splice(R,1);break t}}h=d.createElement(i),sn(h,i,r),d.head.appendChild(h);break;case"meta":if(S=my("meta","content",d).get(i+(r.content||""))){for(R=0;R<S.length;R++)if(h=S[R],h.getAttribute("content")===(r.content==null?null:""+r.content)&&h.getAttribute("name")===(r.name==null?null:r.name)&&h.getAttribute("property")===(r.property==null?null:r.property)&&h.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&h.getAttribute("charset")===(r.charSet==null?null:r.charSet)){S.splice(R,1);break t}}h=d.createElement(i),sn(h,i,r),d.head.appendChild(h);break;default:throw Error(s(468,i))}h[nn]=e,Zt(h),i=h}e.stateNode=i}else py(d,e.type,e.stateNode);else e.stateNode=hy(d,i,e.memoizedProps);else h!==i?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,i===null?py(d,e.type,e.stateNode):hy(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&wf(e,e.memoizedProps,r.memoizedProps)}break;case 27:jn(t,e),Cn(e),i&512&&(qt||r===null||Da(r,r.return)),r!==null&&i&4&&wf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(jn(t,e),Cn(e),i&512&&(qt||r===null||Da(r,r.return)),e.flags&32){d=e.stateNode;try{Fl(d,"")}catch(xe){it(e,e.return,xe)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,wf(e,d,r!==null?r.memoizedProps:d)),i&1024&&(Cf=!0);break;case 6:if(jn(t,e),Cn(e),i&4){if(e.stateNode===null)throw Error(s(162));i=e.memoizedProps,r=e.stateNode;try{r.nodeValue=i}catch(xe){it(e,e.return,xe)}}break;case 3:if(bc=null,d=ga,ga=xc(t.containerInfo),jn(t,e),ga=d,Cn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Rs(t.containerInfo)}catch(xe){it(e,e.return,xe)}Cf&&(Cf=!1,px(e));break;case 4:i=ga,ga=xc(e.stateNode.containerInfo),jn(t,e),Cn(e),ga=i;break;case 12:jn(t,e),Cn(e);break;case 31:jn(t,e),Cn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,rc(e,i)));break;case 13:jn(t,e),Cn(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(sc=jt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,rc(e,i)));break;case 22:d=e.memoizedState!==null;var L=r!==null&&r.memoizedState!==null,Y=lr,W=qt;if(lr=Y||d,qt=W||L,jn(t,e),qt=W,lr=Y,Cn(e),i&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(r===null||L||lr||qt||Nl(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){L=r=t;try{if(h=L.stateNode,d)S=h.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{R=L.stateNode;var ae=L.memoizedProps.style,K=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;R.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(xe){it(L,L.return,xe)}}}else if(t.tag===6){if(r===null){L=t;try{L.stateNode.nodeValue=d?"":L.memoizedProps}catch(xe){it(L,L.return,xe)}}}else if(t.tag===18){if(r===null){L=t;try{var Z=L.stateNode;d?ry(Z,!0):ry(L.stateNode,!1)}catch(xe){it(L,L.return,xe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(r=i.retryQueue,r!==null&&(i.retryQueue=null,rc(e,r))));break;case 19:jn(t,e),Cn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,rc(e,i)));break;case 30:break;case 21:break;default:jn(t,e),Cn(e)}}function Cn(e){var t=e.flags;if(t&2){try{for(var r,i=e.return;i!==null;){if(sx(i)){r=i;break}i=i.return}if(r==null)throw Error(s(160));switch(r.tag){case 27:var d=r.stateNode,h=Sf(e);ac(e,h,d);break;case 5:var S=r.stateNode;r.flags&32&&(Fl(S,""),r.flags&=-33);var R=Sf(e);ac(e,R,S);break;case 3:case 4:var L=r.stateNode.containerInfo,Y=Sf(e);jf(e,Y,L);break;default:throw Error(s(161))}}catch(W){it(e,e.return,W)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function px(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;px(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;)cx(e,t.alternate,t),t=t.sibling}function Nl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hr(4,t,t.return),Nl(t);break;case 1:Da(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&rx(t,t.return,r),Nl(t);break;case 27:Lo(t.stateNode);case 26:case 5:Da(t,t.return),Nl(t);break;case 22:t.memoizedState===null&&Nl(t);break;case 30:Nl(t);break;default:Nl(t)}e=e.sibling}}function ir(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,d=e,h=t,S=h.flags;switch(h.tag){case 0:case 11:case 15:ir(d,h,r),Ro(4,h);break;case 1:if(ir(d,h,r),i=h,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(Y){it(i,i.return,Y)}if(i=h,d=i.updateQueue,d!==null){var R=i.stateNode;try{var L=d.shared.hiddenCallbacks;if(L!==null)for(d.shared.hiddenCallbacks=null,d=0;d<L.length;d++)Gg(L[d],R)}catch(Y){it(i,i.return,Y)}}r&&S&64&&ax(h),No(h,h.return);break;case 27:ox(h);case 26:case 5:ir(d,h,r),r&&i===null&&S&4&&lx(h),No(h,h.return);break;case 12:ir(d,h,r);break;case 31:ir(d,h,r),r&&S&4&&fx(d,h);break;case 13:ir(d,h,r),r&&S&4&&hx(d,h);break;case 22:h.memoizedState===null&&ir(d,h,r),No(h,h.return);break;case 30:break;default:ir(d,h,r)}t=t.sibling}}function Ef(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&ho(r))}function Rf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ho(e))}function va(e,t,r,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)gx(e,t,r,i),t=t.sibling}function gx(e,t,r,i){var d=t.flags;switch(t.tag){case 0:case 11:case 15:va(e,t,r,i),d&2048&&Ro(9,t);break;case 1:va(e,t,r,i);break;case 3:va(e,t,r,i),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ho(e)));break;case 12:if(d&2048){va(e,t,r,i),e=t.stateNode;try{var h=t.memoizedProps,S=h.id,R=h.onPostCommit;typeof R=="function"&&R(S,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(L){it(t,t.return,L)}}else va(e,t,r,i);break;case 31:va(e,t,r,i);break;case 13:va(e,t,r,i);break;case 23:break;case 22:h=t.stateNode,S=t.alternate,t.memoizedState!==null?h._visibility&2?va(e,t,r,i):To(e,t):h._visibility&2?va(e,t,r,i):(h._visibility|=2,ps(e,t,r,i,(t.subtreeFlags&10256)!==0||!1)),d&2048&&Ef(S,t);break;case 24:va(e,t,r,i),d&2048&&Rf(t.alternate,t);break;default:va(e,t,r,i)}}function ps(e,t,r,i,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,S=t,R=r,L=i,Y=S.flags;switch(S.tag){case 0:case 11:case 15:ps(h,S,R,L,d),Ro(8,S);break;case 23:break;case 22:var W=S.stateNode;S.memoizedState!==null?W._visibility&2?ps(h,S,R,L,d):To(h,S):(W._visibility|=2,ps(h,S,R,L,d)),d&&Y&2048&&Ef(S.alternate,S);break;case 24:ps(h,S,R,L,d),d&&Y&2048&&Rf(S.alternate,S);break;default:ps(h,S,R,L,d)}t=t.sibling}}function To(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,i=t,d=i.flags;switch(i.tag){case 22:To(r,i),d&2048&&Ef(i.alternate,i);break;case 24:To(r,i),d&2048&&Rf(i.alternate,i);break;default:To(r,i)}t=t.sibling}}var Mo=8192;function gs(e,t,r){if(e.subtreeFlags&Mo)for(e=e.child;e!==null;)vx(e,t,r),e=e.sibling}function vx(e,t,r){switch(e.tag){case 26:gs(e,t,r),e.flags&Mo&&e.memoizedState!==null&&$C(r,ga,e.memoizedState,e.memoizedProps);break;case 5:gs(e,t,r);break;case 3:case 4:var i=ga;ga=xc(e.stateNode.containerInfo),gs(e,t,r),ga=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Mo,Mo=16777216,gs(e,t,r),Mo=i):gs(e,t,r));break;default:gs(e,t,r)}}function xx(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ao(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];Jt=i,bx(i,e)}xx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yx(e),e=e.sibling}function yx(e){switch(e.tag){case 0:case 11:case 15:Ao(e),e.flags&2048&&Hr(9,e,e.return);break;case 3:Ao(e);break;case 12:Ao(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,lc(e)):Ao(e);break;default:Ao(e)}}function lc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];Jt=i,bx(i,e)}xx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hr(8,t,t.return),lc(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,lc(t));break;default:lc(t)}e=e.sibling}}function bx(e,t){for(;Jt!==null;){var r=Jt;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:ho(r.memoizedState.cache)}if(i=r.child,i!==null)i.return=r,Jt=i;else e:for(r=e;Jt!==null;){i=Jt;var d=i.sibling,h=i.return;if(ux(i),i===r){Jt=null;break e}if(d!==null){d.return=h,Jt=d;break e}Jt=h}}}var lC={getCacheForType:function(e){var t=rn(Ht),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return rn(Ht).controller.signal}},sC=typeof WeakMap=="function"?WeakMap:Map,tt=0,mt=null,Pe=null,$e=0,ot=0,In=null,Ir=!1,vs=!1,Nf=!1,cr=0,_t=0,Pr=0,Tl=0,Tf=0,Pn=0,xs=0,Do=null,En=null,Mf=!1,sc=0,wx=0,oc=1/0,ic=null,qr=null,Yt=0,Vr=null,ys=null,ur=0,Af=0,Df=null,Sx=null,Oo=0,Of=null;function qn(){return(tt&2)!==0&&$e!==0?$e&-$e:_.T!==null?Bf():ma()}function jx(){if(Pn===0)if(($e&536870912)===0||Ge){var e=Nr;Nr<<=1,(Nr&3932160)===0&&(Nr=262144),Pn=e}else Pn=536870912;return e=Bn.current,e!==null&&(e.flags|=32),Pn}function Rn(e,t,r){(e===mt&&(ot===2||ot===9)||e.cancelPendingCommit!==null)&&(bs(e,0),$r(e,$e,Pn,!1)),Ct(e,r),((tt&2)===0||e!==mt)&&(e===mt&&((tt&2)===0&&(Tl|=r),_t===4&&$r(e,$e,Pn,!1)),Oa(e))}function Cx(e,t,r){if((tt&6)!==0)throw Error(s(327));var i=!r&&(t&127)===0&&(t&e.expiredLanes)===0||Ce(e,t),d=i?cC(e,t):kf(e,t,!0),h=i;do{if(d===0){vs&&!i&&$r(e,t,0,!1);break}else{if(r=e.current.alternate,h&&!oC(r)){d=kf(e,t,!1),h=!1;continue}if(d===2){if(h=t,e.errorRecoveryDisabledLanes&h)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){t=S;e:{var R=e;d=Do;var L=R.current.memoizedState.isDehydrated;if(L&&(bs(R,S).flags|=256),S=kf(R,S,!1),S!==2){if(Nf&&!L){R.errorRecoveryDisabledLanes|=h,Tl|=h,d=4;break e}h=En,En=d,h!==null&&(En===null?En=h:En.push.apply(En,h))}d=S}if(h=!1,d!==2)continue}}if(d===1){bs(e,0),$r(e,t,0,!0);break}e:{switch(i=e,h=d,h){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:$r(i,t,Pn,!Ir);break e;case 2:En=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(d=sc+300-jt(),10<d)){if($r(i,t,Pn,!Ir),Bt(i,0,!0)!==0)break e;ur=t,i.timeoutHandle=ty(Ex.bind(null,i,r,En,ic,Mf,t,Pn,Tl,xs,Ir,h,"Throttled",-0,0),d);break e}Ex(i,r,En,ic,Mf,t,Pn,Tl,xs,Ir,h,null,-0,0)}}break}while(!0);Oa(e)}function Ex(e,t,r,i,d,h,S,R,L,Y,W,ae,K,Z){if(e.timeoutHandle=-1,ae=t.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Fa},vx(t,h,ae);var xe=(h&62914560)===h?sc-jt():(h&4194048)===h?wx-jt():0;if(xe=YC(ae,xe),xe!==null){ur=h,e.cancelPendingCommit=xe(_x.bind(null,e,t,h,r,i,d,S,R,L,W,ae,null,K,Z)),$r(e,h,S,!Y);return}}_x(e,t,h,r,i,d,S,R,L)}function oC(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var i=0;i<r.length;i++){var d=r[i],h=d.getSnapshot;d=d.value;try{if(!Ln(h(),d))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function $r(e,t,r,i){t&=~Tf,t&=~Tl,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var d=t;0<d;){var h=31-Tt(d),S=1<<h;i[h]=-1,d&=~S}r!==0&&$t(e,r,t)}function cc(){return(tt&6)===0?(_o(0),!1):!0}function _f(){if(Pe!==null){if(ot===0)var e=Pe.return;else e=Pe,Wa=yl=null,Xd(e),us=null,po=0,e=Pe;for(;e!==null;)nx(e.alternate,e),e=e.return;Pe=null}}function bs(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,NC(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),ur=0,_f(),mt=e,Pe=r=Za(e.current,null),$e=t,ot=0,In=null,Ir=!1,vs=Ce(e,t),Nf=!1,xs=Pn=Tf=Tl=Pr=_t=0,En=Do=null,Mf=!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),h=1<<d;t|=e[d],i&=~h}return cr=t,Ai(),r}function Rx(e,t){ze=null,_.H=jo,t===cs||t===Bi?(t=qg(),ot=3):t===Ld?(t=qg(),ot=4):ot=t===df?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,In=t,Pe===null&&(_t=1,Ji(e,Zn(t,e.current)))}function Nx(){var e=Bn.current;return e===null?!0:($e&4194048)===$e?ta===null:($e&62914560)===$e||($e&536870912)!==0?e===ta:!1}function Tx(){var e=_.H;return _.H=jo,e===null?jo:e}function Mx(){var e=_.A;return _.A=lC,e}function uc(){_t=4,Ir||($e&4194048)!==$e&&Bn.current!==null||(vs=!0),(Pr&134217727)===0&&(Tl&134217727)===0||mt===null||$r(mt,$e,Pn,!1)}function kf(e,t,r){var i=tt;tt|=2;var d=Tx(),h=Mx();(mt!==e||$e!==t)&&(ic=null,bs(e,t)),t=!1;var S=_t;e:do try{if(ot!==0&&Pe!==null){var R=Pe,L=In;switch(ot){case 8:_f(),S=6;break e;case 3:case 2:case 9:case 6:Bn.current===null&&(t=!0);var Y=ot;if(ot=0,In=null,ws(e,R,L,Y),r&&vs){S=0;break e}break;default:Y=ot,ot=0,In=null,ws(e,R,L,Y)}}iC(),S=_t;break}catch(W){Rx(e,W)}while(!0);return t&&e.shellSuspendCounter++,Wa=yl=null,tt=i,_.H=d,_.A=h,Pe===null&&(mt=null,$e=0,Ai()),S}function iC(){for(;Pe!==null;)Ax(Pe)}function cC(e,t){var r=tt;tt|=2;var i=Tx(),d=Mx();mt!==e||$e!==t?(ic=null,oc=jt()+500,bs(e,t)):vs=Ce(e,t);e:do try{if(ot!==0&&Pe!==null){t=Pe;var h=In;t:switch(ot){case 1:ot=0,In=null,ws(e,t,h,1);break;case 2:case 9:if(Ig(h)){ot=0,In=null,Dx(t);break}t=function(){ot!==2&&ot!==9||mt!==e||(ot=7),Oa(e)},h.then(t,t);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:Ig(h)?(ot=0,In=null,Dx(t)):(ot=0,In=null,ws(e,t,h,7));break;case 5:var S=null;switch(Pe.tag){case 26:S=Pe.memoizedState;case 5:case 27:var R=Pe;if(S?gy(S):R.stateNode.complete){ot=0,In=null;var L=R.sibling;if(L!==null)Pe=L;else{var Y=R.return;Y!==null?(Pe=Y,dc(Y)):Pe=null}break t}}ot=0,In=null,ws(e,t,h,5);break;case 6:ot=0,In=null,ws(e,t,h,6);break;case 8:_f(),_t=6;break e;default:throw Error(s(462))}}uC();break}catch(W){Rx(e,W)}while(!0);return Wa=yl=null,_.H=i,_.A=d,tt=r,Pe!==null?0:(mt=null,$e=0,Ai(),_t)}function uC(){for(;Pe!==null&&!on();)Ax(Pe)}function Ax(e){var t=ex(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?dc(e):Pe=t}function Dx(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=Xv(r,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=Xv(r,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:Xd(t);default:nx(r,t),t=Pe=Mg(t,cr),t=ex(r,t,cr)}e.memoizedProps=e.pendingProps,t===null?dc(e):Pe=t}function ws(e,t,r,i){Wa=yl=null,Xd(t),us=null,po=0;var d=t.return;try{if(Jj(e,d,t,r,$e)){_t=1,Ji(e,Zn(r,e.current)),Pe=null;return}}catch(h){if(d!==null)throw Pe=d,h;_t=1,Ji(e,Zn(r,e.current)),Pe=null;return}t.flags&32768?(Ge||i===1?e=!0:vs||($e&536870912)!==0?e=!1:(Ir=e=!0,(i===2||i===9||i===3||i===6)&&(i=Bn.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ox(t,e)):dc(t)}function dc(e){var t=e;do{if((t.flags&32768)!==0){Ox(t,Ir);return}e=t.return;var r=tC(t.alternate,t,cr);if(r!==null){Pe=r;return}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);_t===0&&(_t=5)}function Ox(e,t){do{var r=nC(e.alternate,e);if(r!==null){r.flags&=32767,Pe=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){Pe=e;return}Pe=e=r}while(e!==null);_t=6,Pe=null}function _x(e,t,r,i,d,h,S,R,L){e.cancelPendingCommit=null;do fc();while(Yt!==0);if((tt&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(h=t.lanes|t.childLanes,h|=wd,ct(e,r,h,S,R,L),e===mt&&(Pe=mt=null,$e=0),ys=t,Vr=e,ur=r,Af=h,Df=d,Sx=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,mC(cn,function(){return Bx(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=_.T,_.T=null,d=H.p,H.p=2,S=tt,tt|=4;try{aC(e,t,r)}finally{tt=S,H.p=d,_.T=i}}Yt=1,kx(),zx(),Lx()}}function kx(){if(Yt===1){Yt=0;var e=Vr,t=ys,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=_.T,_.T=null;var i=H.p;H.p=2;var d=tt;tt|=4;try{mx(t,e);var h=Gf,S=bg(e.containerInfo),R=h.focusedElem,L=h.selectionRange;if(S!==R&&R&&R.ownerDocument&&yg(R.ownerDocument.documentElement,R)){if(L!==null&&gd(R)){var Y=L.start,W=L.end;if(W===void 0&&(W=Y),"selectionStart"in R)R.selectionStart=Y,R.selectionEnd=Math.min(W,R.value.length);else{var ae=R.ownerDocument||document,K=ae&&ae.defaultView||window;if(K.getSelection){var Z=K.getSelection(),xe=R.textContent.length,Me=Math.min(L.start,xe),ft=L.end===void 0?Me:Math.min(L.end,xe);!Z.extend&&Me>ft&&(S=ft,ft=Me,Me=S);var P=xg(R,Me),B=xg(R,ft);if(P&&B&&(Z.rangeCount!==1||Z.anchorNode!==P.node||Z.anchorOffset!==P.offset||Z.focusNode!==B.node||Z.focusOffset!==B.offset)){var V=ae.createRange();V.setStart(P.node,P.offset),Z.removeAllRanges(),Me>ft?(Z.addRange(V),Z.extend(B.node,B.offset)):(V.setEnd(B.node,B.offset),Z.addRange(V))}}}}for(ae=[],Z=R;Z=Z.parentNode;)Z.nodeType===1&&ae.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ae.length;R++){var ne=ae[R];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Cc=!!Yf,Gf=Yf=null}finally{tt=d,H.p=i,_.T=r}}e.current=t,Yt=2}}function zx(){if(Yt===2){Yt=0;var e=Vr,t=ys,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=_.T,_.T=null;var i=H.p;H.p=2;var d=tt;tt|=4;try{cx(e,t.alternate,t)}finally{tt=d,H.p=i,_.T=r}}Yt=3}}function Lx(){if(Yt===4||Yt===3){Yt=0,Qt();var e=Vr,t=ys,r=ur,i=Sx;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Yt=5:(Yt=0,ys=Vr=null,Ux(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(qr=null),Ka(r),t=t.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(ha,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=_.T,d=H.p,H.p=2,_.T=null;try{for(var h=e.onRecoverableError,S=0;S<i.length;S++){var R=i[S];h(R.value,{componentStack:R.stack})}}finally{_.T=t,H.p=d}}(ur&3)!==0&&fc(),Oa(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===Of?Oo++:(Oo=0,Of=e):Oo=0,_o(0)}}function Ux(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ho(t)))}function fc(){return kx(),zx(),Lx(),Bx()}function Bx(){if(Yt!==5)return!1;var e=Vr,t=Af;Af=0;var r=Ka(ur),i=_.T,d=H.p;try{H.p=32>r?32:r,_.T=null,r=Df,Df=null;var h=Vr,S=ur;if(Yt=0,ys=Vr=null,ur=0,(tt&6)!==0)throw Error(s(331));var R=tt;if(tt|=4,yx(h.current),gx(h,h.current,S,r),tt=R,_o(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(ha,h)}catch{}return!0}finally{H.p=d,_.T=i,Ux(e,t)}}function Hx(e,t,r){t=Zn(r,t),t=uf(e.stateNode,t,2),e=Lr(e,t,2),e!==null&&(Ct(e,2),Oa(e))}function it(e,t,r){if(e.tag===3)Hx(e,e,r);else for(;t!==null;){if(t.tag===3){Hx(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(qr===null||!qr.has(i))){e=Zn(r,e),r=Iv(2),i=Lr(t,r,2),i!==null&&(Pv(r,i,t,e),Ct(i,2),Oa(i));break}}t=t.return}}function zf(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new sC;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)||(Nf=!0,d.add(r),e=dC.bind(null,e,t,r),t.then(e,e))}function dC(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,mt===e&&($e&r)===r&&(_t===4||_t===3&&($e&62914560)===$e&&300>jt()-sc?(tt&2)===0&&bs(e,0):Tf|=r,xs===$e&&(xs=0)),Oa(e)}function Ix(e,t){t===0&&(t=Ue()),e=gl(e,t),e!==null&&(Ct(e,t),Oa(e))}function fC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Ix(e,r)}function hC(e,t){var r=0;switch(e.tag){case 31:case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(r=d.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(t),Ix(e,r)}function mC(e,t){return St(e,t)}var hc=null,Ss=null,Lf=!1,mc=!1,Uf=!1,Yr=0;function Oa(e){e!==Ss&&e.next===null&&(Ss===null?hc=Ss=e:Ss=Ss.next=e),mc=!0,Lf||(Lf=!0,gC())}function _o(e,t){if(!Uf&&mc){Uf=!0;do for(var r=!1,i=hc;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var h=0;else{var S=i.suspendedLanes,R=i.pingedLanes;h=(1<<31-Tt(42|e)+1)-1,h&=d&~(S&~R),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,$x(i,h))}else h=$e,h=Bt(i,i===mt?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(h&3)===0||Ce(i,h)||(r=!0,$x(i,h));i=i.next}while(r);Uf=!1}}function pC(){Px()}function Px(){mc=Lf=!1;var e=0;Yr!==0&&RC()&&(e=Yr);for(var t=jt(),r=null,i=hc;i!==null;){var d=i.next,h=qx(i,t);h===0?(i.next=null,r===null?hc=d:r.next=d,d===null&&(Ss=r)):(r=i,(e!==0||(h&3)!==0)&&(mc=!0)),i=d}Yt!==0&&Yt!==5||_o(e),Yr!==0&&(Yr=0)}function qx(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var S=31-Tt(h),R=1<<S,L=d[S];L===-1?((R&r)===0||(R&i)!==0)&&(d[S]=ke(R,t)):L<=t&&(e.expiredLanes|=R),h&=~R}if(t=mt,r=$e,r=Bt(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,r===0||e===t&&(ot===2||ot===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Ft(i),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Ce(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(i!==null&&Ft(i),Ka(r)){case 2:case 8:r=At;break;case 32:r=cn;break;case 268435456:r=Ta;break;default:r=cn}return i=Vx.bind(null,e),r=St(r,i),e.callbackPriority=t,e.callbackNode=r,t}return i!==null&&i!==null&&Ft(i),e.callbackPriority=2,e.callbackNode=null,2}function Vx(e,t){if(Yt!==0&&Yt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(fc()&&e.callbackNode!==r)return null;var i=$e;return i=Bt(e,e===mt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Cx(e,i,t),qx(e,jt()),e.callbackNode!=null&&e.callbackNode===r?Vx.bind(null,e):null)}function $x(e,t){if(fc())return null;Cx(e,t,!0)}function gC(){TC(function(){(tt&6)!==0?St(Mt,pC):Px()})}function Bf(){if(Yr===0){var e=os;e===0&&(e=Ya,Ya<<=1,(Ya&261888)===0&&(Ya=256)),Yr=e}return Yr}function Yx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Si(""+e)}function Gx(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 vC(e,t,r,i,d){if(t==="submit"&&r&&r.stateNode===d){var h=Yx((d[bn]||null).action),S=i.submitter;S&&(t=(t=S[bn]||null)?Yx(t.formAction):S.getAttribute("formAction"),t!==null&&(h=t,S=null));var R=new Ri("action","action",null,i,d);e.push({event:R,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Yr!==0){var L=S?Gx(d,S):new FormData(d);af(r,{pending:!0,data:L,method:d.method,action:h},null,L)}}else typeof h=="function"&&(R.preventDefault(),L=S?Gx(d,S):new FormData(d),af(r,{pending:!0,data:L,method:d.method,action:h},h,L))},currentTarget:d}]})}}for(var Hf=0;Hf<bd.length;Hf++){var If=bd[Hf],xC=If.toLowerCase(),yC=If[0].toUpperCase()+If.slice(1);pa(xC,"on"+yC)}pa(jg,"onAnimationEnd"),pa(Cg,"onAnimationIteration"),pa(Eg,"onAnimationStart"),pa("dblclick","onDoubleClick"),pa("focusin","onFocus"),pa("focusout","onBlur"),pa(zj,"onTransitionRun"),pa(Lj,"onTransitionStart"),pa(Uj,"onTransitionCancel"),pa(Rg,"onTransitionEnd"),Kl("onMouseEnter",["mouseout","mouseover"]),Kl("onMouseLeave",["mouseout","mouseover"]),Kl("onPointerEnter",["pointerout","pointerover"]),Kl("onPointerLeave",["pointerout","pointerover"]),fl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fl("onBeforeInput",["compositionend","keypress","textInput","paste"]),fl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ko="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),bC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ko));function Kx(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],d=i.event;i=i.listeners;e:{var h=void 0;if(t)for(var S=i.length-1;0<=S;S--){var R=i[S],L=R.instance,Y=R.currentTarget;if(R=R.listener,L!==h&&d.isPropagationStopped())break e;h=R,d.currentTarget=Y;try{h(d)}catch(W){Mi(W)}d.currentTarget=null,h=L}else for(S=0;S<i.length;S++){if(R=i[S],L=R.instance,Y=R.currentTarget,R=R.listener,L!==h&&d.isPropagationStopped())break e;h=R,d.currentTarget=Y;try{h(d)}catch(W){Mi(W)}d.currentTarget=null,h=L}}}}function qe(e,t){var r=t[Ju];r===void 0&&(r=t[Ju]=new Set);var i=e+"__bubble";r.has(i)||(Xx(t,e,2,!1),r.add(i))}function Pf(e,t,r){var i=0;t&&(i|=4),Xx(r,e,i,t)}var pc="_reactListening"+Math.random().toString(36).slice(2);function qf(e){if(!e[pc]){e[pc]=!0,Pp.forEach(function(r){r!=="selectionchange"&&(bC.has(r)||Pf(r,!1,e),Pf(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pc]||(t[pc]=!0,Pf("selectionchange",!1,t))}}function Xx(e,t,r,i){switch(jy(t)){case 2:var d=XC;break;case 8:d=FC;break;default:d=ah}r=d.bind(null,t,r,e),d=void 0,!od||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 Vf(e,t,r,i,d){var h=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var S=i.tag;if(S===3||S===4){var R=i.stateNode.containerInfo;if(R===d)break;if(S===4)for(S=i.return;S!==null;){var L=S.tag;if((L===3||L===4)&&S.stateNode.containerInfo===d)return;S=S.return}for(;R!==null;){if(S=$l(R),S===null)return;if(L=S.tag,L===5||L===6||L===26||L===27){i=h=S;continue e}R=R.parentNode}}i=i.return}Wp(function(){var Y=h,W=ld(r),ae=[];e:{var K=Ng.get(e);if(K!==void 0){var Z=Ri,xe=e;switch(e){case"keypress":if(Ci(r)===0)break e;case"keydown":case"keyup":Z=hj;break;case"focusin":xe="focus",Z=dd;break;case"focusout":xe="blur",Z=dd;break;case"beforeblur":case"afterblur":Z=dd;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=ng;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=tj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=gj;break;case jg:case Cg:case Eg:Z=rj;break;case Rg:Z=xj;break;case"scroll":case"scrollend":Z=WS;break;case"wheel":Z=bj;break;case"copy":case"cut":case"paste":Z=sj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=rg;break;case"toggle":case"beforetoggle":Z=Sj}var Me=(t&4)!==0,ft=!Me&&(e==="scroll"||e==="scrollend"),P=Me?K!==null?K+"Capture":null:K;Me=[];for(var B=Y,V;B!==null;){var ne=B;if(V=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||V===null||P===null||(ne=to(B,P),ne!=null&&Me.push(zo(B,ne,V))),ft)break;B=B.return}0<Me.length&&(K=new Z(K,xe,null,r,W),ae.push({event:K,listeners:Me}))}}if((t&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",Z=e==="mouseout"||e==="pointerout",K&&r!==rd&&(xe=r.relatedTarget||r.fromElement)&&($l(xe)||xe[Vl]))break e;if((Z||K)&&(K=W.window===W?W:(K=W.ownerDocument)?K.defaultView||K.parentWindow:window,Z?(xe=r.relatedTarget||r.toElement,Z=Y,xe=xe?$l(xe):null,xe!==null&&(ft=u(xe),Me=xe.tag,xe!==ft||Me!==5&&Me!==27&&Me!==6)&&(xe=null)):(Z=null,xe=Y),Z!==xe)){if(Me=ng,ne="onMouseLeave",P="onMouseEnter",B="mouse",(e==="pointerout"||e==="pointerover")&&(Me=rg,ne="onPointerLeave",P="onPointerEnter",B="pointer"),ft=Z==null?K:eo(Z),V=xe==null?K:eo(xe),K=new Me(ne,B+"leave",Z,r,W),K.target=ft,K.relatedTarget=V,ne=null,$l(W)===Y&&(Me=new Me(P,B+"enter",xe,r,W),Me.target=V,Me.relatedTarget=ft,ne=Me),ft=ne,Z&&xe)t:{for(Me=wC,P=Z,B=xe,V=0,ne=P;ne;ne=Me(ne))V++;ne=0;for(var Re=B;Re;Re=Me(Re))ne++;for(;0<V-ne;)P=Me(P),V--;for(;0<ne-V;)B=Me(B),ne--;for(;V--;){if(P===B||B!==null&&P===B.alternate){Me=P;break t}P=Me(P),B=Me(B)}Me=null}else Me=null;Z!==null&&Fx(ae,K,Z,Me,!1),xe!==null&&ft!==null&&Fx(ae,ft,xe,Me,!0)}}e:{if(K=Y?eo(Y):window,Z=K.nodeName&&K.nodeName.toLowerCase(),Z==="select"||Z==="input"&&K.type==="file")var Ze=fg;else if(ug(K))if(hg)Ze=Oj;else{Ze=Aj;var be=Mj}else Z=K.nodeName,!Z||Z.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?Y&&ad(Y.elementType)&&(Ze=fg):Ze=Dj;if(Ze&&(Ze=Ze(e,Y))){dg(ae,Ze,r,W);break e}be&&be(e,K,Y),e==="focusout"&&Y&&K.type==="number"&&Y.memoizedProps.value!=null&&nd(K,"number",K.value)}switch(be=Y?eo(Y):window,e){case"focusin":(ug(be)||be.contentEditable==="true")&&(Wl=be,vd=Y,co=null);break;case"focusout":co=vd=Wl=null;break;case"mousedown":xd=!0;break;case"contextmenu":case"mouseup":case"dragend":xd=!1,wg(ae,r,W);break;case"selectionchange":if(kj)break;case"keydown":case"keyup":wg(ae,r,W)}var Be;if(hd)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 Jl?ig(e,r)&&(Ye="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ye="onCompositionStart");Ye&&(lg&&r.locale!=="ko"&&(Jl||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Jl&&(Be=eg()):(Mr=W,id="value"in Mr?Mr.value:Mr.textContent,Jl=!0)),be=gc(Y,Ye),0<be.length&&(Ye=new ag(Ye,e,null,r,W),ae.push({event:Ye,listeners:be}),Be?Ye.data=Be:(Be=cg(r),Be!==null&&(Ye.data=Be)))),(Be=Cj?Ej(e,r):Rj(e,r))&&(Ye=gc(Y,"onBeforeInput"),0<Ye.length&&(be=new ag("onBeforeInput","beforeinput",null,r,W),ae.push({event:be,listeners:Ye}),be.data=Be)),vC(ae,e,Y,r,W)}Kx(ae,t)})}function zo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function gc(e,t){for(var r=t+"Capture",i=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=to(e,r),d!=null&&i.unshift(zo(e,d,h)),d=to(e,t),d!=null&&i.push(zo(e,d,h))),e.tag===3)return i;e=e.return}return[]}function wC(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Fx(e,t,r,i,d){for(var h=t._reactName,S=[];r!==null&&r!==i;){var R=r,L=R.alternate,Y=R.stateNode;if(R=R.tag,L!==null&&L===i)break;R!==5&&R!==26&&R!==27||Y===null||(L=Y,d?(Y=to(r,h),Y!=null&&S.unshift(zo(r,Y,L))):d||(Y=to(r,h),Y!=null&&S.push(zo(r,Y,L)))),r=r.return}S.length!==0&&e.push({event:t,listeners:S})}var SC=/\r\n?/g,jC=/\u0000|\uFFFD/g;function Qx(e){return(typeof e=="string"?e:""+e).replace(SC,`
|
|
49
|
+
`).replace(jC,"")}function Zx(e,t){return t=Qx(t),Qx(e)===t}function dt(e,t,r,i,d,h){switch(r){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Fl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Fl(e,""+i);break;case"className":bi(e,"class",i);break;case"tabIndex":bi(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":bi(e,r,i);break;case"style":Zp(e,i,h);break;case"data":if(t!=="object"){bi(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=Si(""+i),e.setAttribute(r,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(r==="formAction"?(t!=="input"&&dt(e,t,"name",d.name,d,null),dt(e,t,"formEncType",d.formEncType,d,null),dt(e,t,"formMethod",d.formMethod,d,null),dt(e,t,"formTarget",d.formTarget,d,null)):(dt(e,t,"encType",d.encType,d,null),dt(e,t,"method",d.method,d,null),dt(e,t,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=Si(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=Fa);break;case"onScroll":i!=null&&qe("scroll",e);break;case"onScrollEnd":i!=null&&qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}r=Si(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""+i):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":i===!0?e.setAttribute(r,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,i):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(r,i):e.removeAttribute(r);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(r):e.setAttribute(r,i);break;case"popover":qe("beforetoggle",e),qe("toggle",e),yi(e,"popover",i);break;case"xlinkActuate":Xa(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Xa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Xa(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Xa(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Xa(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Xa(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Xa(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":yi(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=ZS.get(r)||r,yi(e,r,i))}}function $f(e,t,r,i,d,h){switch(r){case"style":Zp(e,i,h);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"children":typeof i=="string"?Fl(e,i):(typeof i=="number"||typeof i=="bigint")&&Fl(e,""+i);break;case"onScroll":i!=null&&qe("scroll",e);break;case"onScrollEnd":i!=null&&qe("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Fa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qp.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),t=r.slice(2,d?r.length-7:void 0),h=e[bn]||null,h=h!=null?h[r]:null,typeof h=="function"&&e.removeEventListener(t,h,d),typeof i=="function")){typeof h!="function"&&h!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,i,d);break e}r in e?e[r]=i:i===!0?e.setAttribute(r,""):yi(e,r,i)}}}function sn(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",e),qe("load",e);var i=!1,d=!1,h;for(h in r)if(r.hasOwnProperty(h)){var S=r[h];if(S!=null)switch(h){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:dt(e,t,h,S,r,null)}}d&&dt(e,t,"srcSet",r.srcSet,r,null),i&&dt(e,t,"src",r.src,r,null);return;case"input":qe("invalid",e);var R=h=S=d=null,L=null,Y=null;for(i in r)if(r.hasOwnProperty(i)){var W=r[i];if(W!=null)switch(i){case"name":d=W;break;case"type":S=W;break;case"checked":L=W;break;case"defaultChecked":Y=W;break;case"value":h=W;break;case"defaultValue":R=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(s(137,t));break;default:dt(e,t,i,W,r,null)}}Kp(e,h,R,L,Y,S,d,!1);return;case"select":qe("invalid",e),i=S=h=null;for(d in r)if(r.hasOwnProperty(d)&&(R=r[d],R!=null))switch(d){case"value":h=R;break;case"defaultValue":S=R;break;case"multiple":i=R;default:dt(e,t,d,R,r,null)}t=h,r=S,e.multiple=!!i,t!=null?Xl(e,!!i,t,!1):r!=null&&Xl(e,!!i,r,!0);return;case"textarea":qe("invalid",e),h=d=i=null;for(S in r)if(r.hasOwnProperty(S)&&(R=r[S],R!=null))switch(S){case"value":i=R;break;case"defaultValue":d=R;break;case"children":h=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(s(91));break;default:dt(e,t,S,R,r,null)}Fp(e,i,d,h);return;case"option":for(L in r)if(r.hasOwnProperty(L)&&(i=r[L],i!=null))switch(L){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:dt(e,t,L,i,r,null)}return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(i=0;i<ko.length;i++)qe(ko[i],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in r)if(r.hasOwnProperty(Y)&&(i=r[Y],i!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:dt(e,t,Y,i,r,null)}return;default:if(ad(t)){for(W in r)r.hasOwnProperty(W)&&(i=r[W],i!==void 0&&$f(e,t,W,i,r,void 0));return}}for(R in r)r.hasOwnProperty(R)&&(i=r[R],i!=null&&dt(e,t,R,i,r,null))}function CC(e,t,r,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,S=null,R=null,L=null,Y=null,W=null;for(Z in r){var ae=r[Z];if(r.hasOwnProperty(Z)&&ae!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":L=ae;default:i.hasOwnProperty(Z)||dt(e,t,Z,null,i,ae)}}for(var K in i){var Z=i[K];if(ae=r[K],i.hasOwnProperty(K)&&(Z!=null||ae!=null))switch(K){case"type":h=Z;break;case"name":d=Z;break;case"checked":Y=Z;break;case"defaultChecked":W=Z;break;case"value":S=Z;break;case"defaultValue":R=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(s(137,t));break;default:Z!==ae&&dt(e,t,K,Z,i,ae)}}td(e,S,R,L,Y,W,h,d);return;case"select":Z=S=R=K=null;for(h in r)if(L=r[h],r.hasOwnProperty(h)&&L!=null)switch(h){case"value":break;case"multiple":Z=L;default:i.hasOwnProperty(h)||dt(e,t,h,null,i,L)}for(d in i)if(h=i[d],L=r[d],i.hasOwnProperty(d)&&(h!=null||L!=null))switch(d){case"value":K=h;break;case"defaultValue":R=h;break;case"multiple":S=h;default:h!==L&&dt(e,t,d,h,i,L)}t=R,r=S,i=Z,K!=null?Xl(e,!!r,K,!1):!!i!=!!r&&(t!=null?Xl(e,!!r,t,!0):Xl(e,!!r,r?[]:"",!1));return;case"textarea":Z=K=null;for(R in r)if(d=r[R],r.hasOwnProperty(R)&&d!=null&&!i.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:dt(e,t,R,null,i,d)}for(S in i)if(d=i[S],h=r[S],i.hasOwnProperty(S)&&(d!=null||h!=null))switch(S){case"value":K=d;break;case"defaultValue":Z=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==h&&dt(e,t,S,d,i,h)}Xp(e,K,Z);return;case"option":for(var xe in r)if(K=r[xe],r.hasOwnProperty(xe)&&K!=null&&!i.hasOwnProperty(xe))switch(xe){case"selected":e.selected=!1;break;default:dt(e,t,xe,null,i,K)}for(L in i)if(K=i[L],Z=r[L],i.hasOwnProperty(L)&&K!==Z&&(K!=null||Z!=null))switch(L){case"selected":e.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:dt(e,t,L,K,i,Z)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in r)K=r[Me],r.hasOwnProperty(Me)&&K!=null&&!i.hasOwnProperty(Me)&&dt(e,t,Me,null,i,K);for(Y in i)if(K=i[Y],Z=r[Y],i.hasOwnProperty(Y)&&K!==Z&&(K!=null||Z!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(s(137,t));break;default:dt(e,t,Y,K,i,Z)}return;default:if(ad(t)){for(var ft in r)K=r[ft],r.hasOwnProperty(ft)&&K!==void 0&&!i.hasOwnProperty(ft)&&$f(e,t,ft,void 0,i,K);for(W in i)K=i[W],Z=r[W],!i.hasOwnProperty(W)||K===Z||K===void 0&&Z===void 0||$f(e,t,W,K,i,Z);return}}for(var P in r)K=r[P],r.hasOwnProperty(P)&&K!=null&&!i.hasOwnProperty(P)&&dt(e,t,P,null,i,K);for(ae in i)K=i[ae],Z=r[ae],!i.hasOwnProperty(ae)||K===Z||K==null&&Z==null||dt(e,t,ae,K,i,Z)}function Jx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function EC(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,r=performance.getEntriesByType("resource"),i=0;i<r.length;i++){var d=r[i],h=d.transferSize,S=d.initiatorType,R=d.duration;if(h&&R&&Jx(S)){for(S=0,R=d.responseEnd,i+=1;i<r.length;i++){var L=r[i],Y=L.startTime;if(Y>R)break;var W=L.transferSize,ae=L.initiatorType;W&&Jx(ae)&&(L=L.responseEnd,S+=W*(L<R?1:(R-Y)/(L-Y)))}if(--i,t+=8*(h+S)/(d.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Yf=null,Gf=null;function vc(e){return e.nodeType===9?e:e.ownerDocument}function Wx(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 ey(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 Kf(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 Xf=null;function RC(){var e=window.event;return e&&e.type==="popstate"?e===Xf?!1:(Xf=e,!0):(Xf=null,!1)}var ty=typeof setTimeout=="function"?setTimeout:void 0,NC=typeof clearTimeout=="function"?clearTimeout:void 0,ny=typeof Promise=="function"?Promise:void 0,TC=typeof queueMicrotask=="function"?queueMicrotask:typeof ny<"u"?function(e){return ny.resolve(null).then(e).catch(MC)}:ty;function MC(e){setTimeout(function(){throw e})}function Gr(e){return e==="head"}function ay(e,t){var r=t,i=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(i===0){e.removeChild(d),Rs(t);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")Lo(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Lo(r);for(var h=r.firstChild;h;){var S=h.nextSibling,R=h.nodeName;h[Ws]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=S}}else r==="body"&&Lo(e.ownerDocument.body);r=d}while(r);Rs(t)}function ry(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 Ff(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":Ff(r),Wu(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function AC(e,t,r,i){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Ws])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=na(e.nextSibling),e===null)break}return null}function DC(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=na(e.nextSibling),e===null))return null;return e}function ly(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=na(e.nextSibling),e===null))return null;return e}function Qf(e){return e.data==="$?"||e.data==="$~"}function Zf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function OC(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 na(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 Jf=null;function sy(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return na(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function oy(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 iy(e,t,r){switch(t=vc(r),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Lo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Wu(e)}var aa=new Map,cy=new Set;function xc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var dr=H.d;H.d={f:_C,r:kC,D:zC,C:LC,L:UC,m:BC,X:IC,S:HC,M:PC};function _C(){var e=dr.f(),t=cc();return e||t}function kC(e){var t=Yl(e);t!==null&&t.tag===5&&t.type==="form"?Rv(t):dr.r(e)}var js=typeof document>"u"?null:document;function uy(e,t,r){var i=js;if(i&&typeof t=="string"&&t){var d=Fn(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),cy.has(d)||(cy.add(d),e={rel:e,crossOrigin:r,href:t},i.querySelector(d)===null&&(t=i.createElement("link"),sn(t,"link",e),Zt(t),i.head.appendChild(t)))}}function zC(e){dr.D(e),uy("dns-prefetch",e,null)}function LC(e,t){dr.C(e,t),uy("preconnect",e,t)}function UC(e,t,r){dr.L(e,t,r);var i=js;if(i&&e&&t){var d='link[rel="preload"][as="'+Fn(t)+'"]';t==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+Fn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+Fn(r.imageSizes)+'"]')):d+='[href="'+Fn(e)+'"]';var h=d;switch(t){case"style":h=Cs(e);break;case"script":h=Es(e)}aa.has(h)||(e=y({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),aa.set(h,e),i.querySelector(d)!==null||t==="style"&&i.querySelector(Uo(h))||t==="script"&&i.querySelector(Bo(h))||(t=i.createElement("link"),sn(t,"link",e),Zt(t),i.head.appendChild(t)))}}function BC(e,t){dr.m(e,t);var r=js;if(r&&e){var i=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+Fn(i)+'"][href="'+Fn(e)+'"]',h=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Es(e)}if(!aa.has(h)&&(e=y({rel:"modulepreload",href:e},t),aa.set(h,e),r.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Bo(h)))return}i=r.createElement("link"),sn(i,"link",e),Zt(i),r.head.appendChild(i)}}}function HC(e,t,r){dr.S(e,t,r);var i=js;if(i&&e){var d=Gl(i).hoistableStyles,h=Cs(e);t=t||"default";var S=d.get(h);if(!S){var R={loading:0,preload:null};if(S=i.querySelector(Uo(h)))R.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},r),(r=aa.get(h))&&Wf(e,r);var L=S=i.createElement("link");Zt(L),sn(L,"link",e),L._p=new Promise(function(Y,W){L.onload=Y,L.onerror=W}),L.addEventListener("load",function(){R.loading|=1}),L.addEventListener("error",function(){R.loading|=2}),R.loading|=4,yc(S,t,i)}S={type:"stylesheet",instance:S,count:1,state:R},d.set(h,S)}}}function IC(e,t){dr.X(e,t);var r=js;if(r&&e){var i=Gl(r).hoistableScripts,d=Es(e),h=i.get(d);h||(h=r.querySelector(Bo(d)),h||(e=y({src:e,async:!0},t),(t=aa.get(d))&&eh(e,t),h=r.createElement("script"),Zt(h),sn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(d,h))}}function PC(e,t){dr.M(e,t);var r=js;if(r&&e){var i=Gl(r).hoistableScripts,d=Es(e),h=i.get(d);h||(h=r.querySelector(Bo(d)),h||(e=y({src:e,async:!0,type:"module"},t),(t=aa.get(d))&&eh(e,t),h=r.createElement("script"),Zt(h),sn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(d,h))}}function dy(e,t,r,i){var d=(d=ge.current)?xc(d):null;if(!d)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=Cs(r.href),r=Gl(d).hoistableStyles,i=r.get(t),i||(i={type:"style",instance:null,count:0,state:null},r.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Cs(r.href);var h=Gl(d).hoistableStyles,S=h.get(e);if(S||(d=d.ownerDocument||d,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,S),(h=d.querySelector(Uo(e)))&&!h._p&&(S.instance=h,S.state.loading=5),aa.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},aa.set(e,r),h||qC(d,e,r,S.state))),t&&i===null)throw Error(s(528,""));return S}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Es(r),r=Gl(d).hoistableScripts,i=r.get(t),i||(i={type:"script",instance:null,count:0,state:null},r.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Cs(e){return'href="'+Fn(e)+'"'}function Uo(e){return'link[rel="stylesheet"]['+e+"]"}function fy(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function qC(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}),sn(t,"link",r),Zt(t),e.head.appendChild(t))}function Es(e){return'[src="'+Fn(e)+'"]'}function Bo(e){return"script[async]"+e}function hy(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Fn(r.href)+'"]');if(i)return t.instance=i,Zt(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"),Zt(i),sn(i,"style",d),yc(i,r.precedence,e),t.instance=i;case"stylesheet":d=Cs(r.href);var h=e.querySelector(Uo(d));if(h)return t.state.loading|=4,t.instance=h,Zt(h),h;i=fy(r),(d=aa.get(d))&&Wf(i,d),h=(e.ownerDocument||e).createElement("link"),Zt(h);var S=h;return S._p=new Promise(function(R,L){S.onload=R,S.onerror=L}),sn(h,"link",i),t.state.loading|=4,yc(h,r.precedence,e),t.instance=h;case"script":return h=Es(r.src),(d=e.querySelector(Bo(h)))?(t.instance=d,Zt(d),d):(i=r,(d=aa.get(h))&&(i=y({},r),eh(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),Zt(d),sn(d,"link",i),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,yc(i,r.precedence,e));return t.instance}function yc(e,t,r){for(var i=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,h=d,S=0;S<i.length;S++){var R=i[S];if(R.dataset.precedence===t)h=R;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function Wf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function eh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var bc=null;function my(e,t,r){if(bc===null){var i=new Map,d=bc=new Map;d.set(r,i)}else d=bc,i=d.get(r),i||(i=new Map,d.set(r,i));if(i.has(e))return i;for(i.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var h=r[d];if(!(h[Ws]||h[nn]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var S=h.getAttribute(t)||"";S=e+S;var R=i.get(S);R?R.push(h):i.set(S,[h])}}return i}function py(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function VC(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 gy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $C(e,t,r,i){if(r.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=Cs(i.href),h=t.querySelector(Uo(d));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=wc.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=h,Zt(h);return}h=t.ownerDocument||t,i=fy(i),(d=aa.get(d))&&Wf(i,d),h=h.createElement("link"),Zt(h);var S=h;S._p=new Promise(function(R,L){S.onload=R,S.onerror=L}),sn(h,"link",i),r.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=wc.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var th=0;function YC(e,t){return e.stylesheets&&e.count===0&&jc(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&jc(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&th===0&&(th=62500*EC());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jc(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>th?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Sc=null;function jc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Sc=new Map,t.forEach(GC,e),Sc=null,wc.call(e))}function GC(e,t){if(!(t.state.loading&4)){var r=Sc.get(e);if(r)var i=r.get(null);else{r=new Map,Sc.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var S=d[h];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(r.set(S.dataset.precedence,S),i=S)}i&&r.set(null,i)}d=t.instance,S=d.getAttribute("data-precedence"),h=r.get(S)||i,h===i&&r.set(null,d),r.set(S,d),this.count++,i=wc.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Ho={$$typeof:T,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function KC(e,t,r,i,d,h,S,R,L){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=gt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.hiddenUpdates=gt(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function vy(e,t,r,i,d,h,S,R,L,Y,W,ae){return e=new KC(e,t,r,S,L,Y,W,ae,R),t=1,h===!0&&(t|=24),h=Un(3,null,null,t),e.current=h,h.stateNode=e,t=_d(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:i,isDehydrated:r,cache:t},Ud(h),e}function xy(e){return e?(e=ns,e):ns}function yy(e,t,r,i,d,h){d=xy(d),i.context===null?i.context=d:i.pendingContext=d,i=zr(t),i.payload={element:r},h=h===void 0?null:h,h!==null&&(i.callback=h),r=Lr(e,i,t),r!==null&&(Rn(r,e,t),vo(r,e,t))}function by(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function nh(e,t){by(e,t),(e=e.alternate)&&by(e,t)}function wy(e){if(e.tag===13||e.tag===31){var t=gl(e,67108864);t!==null&&Rn(t,e,67108864),nh(e,67108864)}}function Sy(e){if(e.tag===13||e.tag===31){var t=qn();t=Ga(t);var r=gl(e,t);r!==null&&Rn(r,e,t),nh(e,t)}}var Cc=!0;function XC(e,t,r,i){var d=_.T;_.T=null;var h=H.p;try{H.p=2,ah(e,t,r,i)}finally{H.p=h,_.T=d}}function FC(e,t,r,i){var d=_.T;_.T=null;var h=H.p;try{H.p=8,ah(e,t,r,i)}finally{H.p=h,_.T=d}}function ah(e,t,r,i){if(Cc){var d=rh(i);if(d===null)Vf(e,t,i,Ec,r),Cy(e,i);else if(ZC(d,e,t,r,i))i.stopPropagation();else if(Cy(e,i),t&4&&-1<QC.indexOf(e)){for(;d!==null;){var h=Yl(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var S=st(h.pendingLanes);if(S!==0){var R=h;for(R.pendingLanes|=2,R.entangledLanes|=2;S;){var L=1<<31-Tt(S);R.entanglements[1]|=L,S&=~L}Oa(h),(tt&6)===0&&(oc=jt()+500,_o(0))}}break;case 31:case 13:R=gl(h,2),R!==null&&Rn(R,h,2),cc(),nh(h,2)}if(h=rh(i),h===null&&Vf(e,t,i,Ec,r),h===d)break;d=h}d!==null&&i.stopPropagation()}else Vf(e,t,i,null,r)}}function rh(e){return e=ld(e),lh(e)}var Ec=null;function lh(e){if(Ec=null,e=$l(e),e!==null){var t=u(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=f(t),e!==null)return e;e=null}else if(r===31){if(e=p(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ec=e,null}function jy(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(fn()){case Mt:return 2;case At:return 8;case cn:case fa:return 32;case Ta:return 268435456;default:return 32}default:return 32}}var sh=!1,Kr=null,Xr=null,Fr=null,Io=new Map,Po=new Map,Qr=[],QC="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 Cy(e,t){switch(e){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Xr=null;break;case"mouseover":case"mouseout":Fr=null;break;case"pointerover":case"pointerout":Io.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Po.delete(t.pointerId)}}function qo(e,t,r,i,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:h,targetContainers:[d]},t!==null&&(t=Yl(t),t!==null&&wy(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function ZC(e,t,r,i,d){switch(t){case"focusin":return Kr=qo(Kr,e,t,r,i,d),!0;case"dragenter":return Xr=qo(Xr,e,t,r,i,d),!0;case"mouseover":return Fr=qo(Fr,e,t,r,i,d),!0;case"pointerover":var h=d.pointerId;return Io.set(h,qo(Io.get(h)||null,e,t,r,i,d)),!0;case"gotpointercapture":return h=d.pointerId,Po.set(h,qo(Po.get(h)||null,e,t,r,i,d)),!0}return!1}function Ey(e){var t=$l(e.target);if(t!==null){var r=u(t);if(r!==null){if(t=r.tag,t===13){if(t=f(r),t!==null){e.blockedOn=t,Tr(e.priority,function(){Sy(r)});return}}else if(t===31){if(t=p(r),t!==null){e.blockedOn=t,Tr(e.priority,function(){Sy(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=rh(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);rd=i,r.target.dispatchEvent(i),rd=null}else return t=Yl(r),t!==null&&wy(t),e.blockedOn=r,!1;t.shift()}return!0}function Ry(e,t,r){Rc(e)&&r.delete(t)}function JC(){sh=!1,Kr!==null&&Rc(Kr)&&(Kr=null),Xr!==null&&Rc(Xr)&&(Xr=null),Fr!==null&&Rc(Fr)&&(Fr=null),Io.forEach(Ry),Po.forEach(Ry)}function Nc(e,t){e.blockedOn===t&&(e.blockedOn=null,sh||(sh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,JC)))}var Tc=null;function Ny(e){Tc!==e&&(Tc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Tc===e&&(Tc=null);for(var t=0;t<e.length;t+=3){var r=e[t],i=e[t+1],d=e[t+2];if(typeof i!="function"){if(lh(i||r)===null)continue;break}var h=Yl(r);h!==null&&(e.splice(t,3),t-=3,af(h,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function Rs(e){function t(L){return Nc(L,e)}Kr!==null&&Nc(Kr,e),Xr!==null&&Nc(Xr,e),Fr!==null&&Nc(Fr,e),Io.forEach(t),Po.forEach(t);for(var r=0;r<Qr.length;r++){var i=Qr[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Qr.length&&(r=Qr[0],r.blockedOn===null);)Ey(r),r.blockedOn===null&&Qr.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(i=0;i<r.length;i+=3){var d=r[i],h=r[i+1],S=d[bn]||null;if(typeof h=="function")S||Ny(r);else if(S){var R=null;if(h&&h.hasAttribute("formAction")){if(d=h,S=h[bn]||null)R=S.formAction;else if(lh(d)!==null)continue}else R=S.action;typeof R=="function"?r[i+1]=R:(r.splice(i,3),i-=3),Ny(r)}}}function Ty(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(S){return d=S})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),i||setTimeout(r,20)}function r(){if(!i&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(r,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function oh(e){this._internalRoot=e}Mc.prototype.render=oh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var r=t.current,i=qn();yy(r,i,e,t,null,null)},Mc.prototype.unmount=oh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yy(e.current,2,null,e,null,null),cc(),t[Vl]=null}};function Mc(e){this._internalRoot=e}Mc.prototype.unstable_scheduleHydration=function(e){if(e){var t=ma();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Qr.length&&t!==0&&t<Qr[r].priority;r++);Qr.splice(r,0,e),r===0&&Ey(e)}};var My=a.version;if(My!=="19.2.8")throw Error(s(527,My,"19.2.8"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var WC={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ac=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ac.isDisabled&&Ac.supportsFiber)try{ha=Ac.inject(WC),Dt=Ac}catch{}}return $o.createRoot=function(e,t){if(!c(e))throw Error(s(299));var r=!1,i="",d=Lv,h=Uv,S=Bv;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(S=t.onRecoverableError)),t=vy(e,1,!1,null,null,r,i,null,d,h,S,Ty),e[Vl]=t.current,qf(e),new oh(t)},$o.hydrateRoot=function(e,t,r){if(!c(e))throw Error(s(299));var i=!1,d="",h=Lv,S=Uv,R=Bv,L=null;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(S=r.onCaughtError),r.onRecoverableError!==void 0&&(R=r.onRecoverableError),r.formState!==void 0&&(L=r.formState)),t=vy(e,1,!0,t,r??null,i,d,L,h,S,R,Ty),t.context=xy(null),r=t.current,i=qn(),i=Ga(i),d=zr(i),d.callback=null,Lr(r,d,i),r=i,t.current.lanes=r,Ct(t,r),Oa(t),e[Vl]=t.current,qf(e),new Mc(t)},$o.version="19.2.8",$o}var qy;function c2(){if(qy)return dh.exports;qy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),dh.exports=i2(),dh.exports}var u2=c2();const d2=wm(u2);/**
|
|
50
|
+
* react-router v7.18.2
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var jm=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Jb=/^[\\/]{2}/;function f2(n,a){return a+n.replace(/\\/g,"/")}var Vy="popstate";function $y(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function h2(n={}){function a(s,c){var v;let u=(v=c.state)==null?void 0:v.masked,{pathname:f,search:p,hash:g}=u||s.location;return Hh("",{pathname:f,search:p,hash:g},c.state&&c.state.usr||null,c.state&&c.state.key||"default",u?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function l(s,c){return typeof c=="string"?c:Zo(c)}return p2(a,l,null,n)}function Nt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function oa(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function m2(){return Math.random().toString(36).substring(2,10)}function Yy(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Hh(n,a,l=null,s,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Is(a):a,state:l,key:a&&a.key||s||m2(),mask:c}}function Zo({pathname:n="/",search:a="",hash:l=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),l&&l!=="#"&&(n+=l.charAt(0)==="#"?l:"#"+l),n}function Is(n){let a={};if(n){let l=n.indexOf("#");l>=0&&(a.hash=n.substring(l),n=n.substring(0,l));let s=n.indexOf("?");s>=0&&(a.search=n.substring(s),n=n.substring(0,s)),n&&(a.pathname=n)}return a}function p2(n,a,l,s={}){let{window:c=document.defaultView,v5Compat:u=!1}=s,f=c.history,p="POP",g=null,v=x();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function x(){return(f.state||{idx:null}).idx}function y(){p="POP";let C=x(),N=C==null?null:C-v;v=C,g&&g({action:p,location:j.location,delta:N})}function b(C,N){p="PUSH";let M=$y(C)?C:Hh(j.location,C,N);v=x()+1;let T=Yy(M,v),D=j.createHref(M.mask||M);try{f.pushState(T,"",D)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;c.location.assign(D)}u&&g&&g({action:p,location:j.location,delta:1})}function w(C,N){p="REPLACE";let M=$y(C)?C:Hh(j.location,C,N);v=x();let T=Yy(M,v),D=j.createHref(M.mask||M);f.replaceState(T,"",D),u&&g&&g({action:p,location:j.location,delta:0})}function E(C){return g2(c,C)}let j={get action(){return p},get location(){return n(c,f)},listen(C){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(Vy,y),g=C,()=>{c.removeEventListener(Vy,y),g=null}},createHref(C){return a(c,C)},createURL:E,encodeLocation(C){let N=E(C);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:b,replace:w,go(C){return f.go(C)}};return j}function g2(n,a,l=!1){let s="http://localhost";n&&(s=n.location.origin!=="null"?n.location.origin:n.location.href),Nt(s,"No window.location.(origin|href) available to create URL");let c=typeof a=="string"?a:Zo(a);return c=c.replace(/ $/,"%20"),!l&&Jb.test(c)&&(c=s+c),new URL(c,s)}function Wb(n,a,l="/"){return v2(n,a,l,!1)}function v2(n,a,l,s,c){let u=typeof a=="string"?Is(a):a,f=xr(u.pathname||"/",l);if(f==null)return null;let p=x2(n),g=null,v=M2(f);for(let x=0;g==null&&x<p.length;++x)g=T2(p[x],v,s);return g}function x2(n){let a=e0(n);return y2(a),a}function e0(n,a=[],l=[],s="",c=!1){let u=(f,p,g=c,v)=>{let x={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(s)&&g)return;Nt(x.relativePath.startsWith(s),`Absolute route path "${x.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(s.length)}let y=wa([s,x.relativePath]),b=l.concat(x);f.children&&f.children.length>0&&(Nt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),e0(f.children,a,b,y,g)),!(f.path==null&&!f.index)&&a.push({path:y,score:R2(y,f.index),routesMeta:b.map((w,E)=>{let[j,C]=a0(w.relativePath,w.caseSensitive,E===b.length-1);return{...w,matcher:j,compiledParams:C}})})};return n.forEach((f,p)=>{var g;if(f.path===""||!((g=f.path)!=null&&g.includes("?")))u(f,p);else for(let v of t0(f.path))u(f,p,!0,v)}),a}function t0(n){let a=n.split("/");if(a.length===0)return[];let[l,...s]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(s.length===0)return c?[u,""]:[u];let f=t0(s.join("/")),p=[];return p.push(...f.map(g=>g===""?u:[u,g].join("/"))),c&&p.push(...f),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function y2(n){n.sort((a,l)=>a.score!==l.score?l.score-a.score:N2(a.routesMeta.map(s=>s.childrenIndex),l.routesMeta.map(s=>s.childrenIndex)))}var b2=/^:[\w-]+$/,w2=3,S2=2,j2=1,C2=10,E2=-2,Gy=n=>n==="*";function R2(n,a){let l=n.split("/"),s=l.length;return l.some(Gy)&&(s+=E2),a&&(s+=S2),l.filter(c=>!Gy(c)).reduce((c,u)=>c+(b2.test(u)?w2:u===""?j2:C2),s)}function N2(n,a){return n.length===a.length&&n.slice(0,-1).every((s,c)=>s===a[c])?n[n.length-1]-a[a.length-1]:0}function T2(n,a,l=!1){let{routesMeta:s}=n,c={},u="/",f=[];for(let p=0;p<s.length;++p){let g=s[p],v=p===s.length-1,x=u==="/"?a:a.slice(u.length)||"/",y={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},b=g.matcher&&g.compiledParams?n0(y,x,g.matcher,g.compiledParams):tu(y,x),w=g.route;if(!b&&v&&l&&!s[s.length-1].route.index&&(b=tu({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:wa([u,b.pathname]),pathnameBase:O2(wa([u,b.pathnameBase])),route:w}),b.pathnameBase!=="/"&&(u=wa([u,b.pathnameBase]))}return f}function tu(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[l,s]=a0(n.path,n.caseSensitive,n.end);return n0(n,a,l,s)}function n0(n,a,l,s){let c=a.match(l);if(!c)return null;let u=c[0],f=u.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:s.reduce((v,{paramName:x,isOptional:y},b)=>{if(x==="*"){let E=p[b]||"";f=u.slice(0,u.length-E.length).replace(/(.)\/+$/,"$1")}const w=p[b];return y&&!w?v[x]=void 0:v[x]=(w||"").replace(/%2F/g,"/"),v},{}),pathname:u,pathnameBase:f,pattern:n}}function a0(n,a=!1,l=!0){oa(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let s=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,g,v,x)=>{if(s.push({paramName:p,isOptional:g!=null}),g){let y=x.charAt(v+f.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(s.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),s]}function M2(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return oa(!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 xr(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,s=n.charAt(l);return s&&s!=="/"?null:n.slice(l)||"/"}function A2(n,a="/"){let{pathname:l,search:s="",hash:c=""}=typeof n=="string"?Is(n):n,u;return l?(l=r0(l),l.startsWith("/")?u=Ky(l.substring(1),"/"):u=Ky(l,a)):u=a,{pathname:u,search:_2(s),hash:k2(c)}}function Ky(n,a){let l=nu(a).split("/");return n.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function ph(n,a,l,s){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function D2(n){return n.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Cm(n){let a=D2(n);return a.map((l,s)=>s===a.length-1?l.pathname:l.pathnameBase)}function vu(n,a,l,s=!1){let c;typeof n=="string"?c=Is(n):(c={...n},Nt(!c.pathname||!c.pathname.includes("?"),ph("?","pathname","search",c)),Nt(!c.pathname||!c.pathname.includes("#"),ph("#","pathname","hash",c)),Nt(!c.search||!c.search.includes("#"),ph("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=l;else{let y=a.length-1;if(!s&&f.startsWith("..")){let b=f.split("/");for(;b[0]==="..";)b.shift(),y-=1;c.pathname=b.join("/")}p=y>=0?a[y]:"/"}let g=A2(c,p),v=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}var r0=n=>n.replace(/[\\/]{2,}/g,"/"),wa=n=>r0(n.join("/")),nu=n=>n.replace(/\/+$/,""),O2=n=>nu(n).replace(/^\/*/,"/"),_2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,k2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,z2=class{constructor(n,a,l,s=!1){this.status=n,this.statusText=a||"",this.internal=s,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function L2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function U2(n){let a=n.map(l=>l.route.path).filter(Boolean);return wa(a)||"/"}var l0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function s0(n,a){let l=n;if(typeof l!="string"||!jm.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let s=l,c=!1;if(l0)try{let u=new URL(window.location.href),f=Jb.test(l)?new URL(f2(l,u.protocol)):new URL(l),p=xr(f.pathname,a);f.origin===u.origin&&p!=null?l=p+f.search+f.hash:c=!0}catch{oa(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:c,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var o0=["POST","PUT","PATCH","DELETE"];new Set(o0);var B2=["GET",...o0];new Set(B2);var H2=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function I2(n){try{return H2.includes(new URL(n).protocol)}catch{return!1}}var Ps=m.createContext(null);Ps.displayName="DataRouter";var xu=m.createContext(null);xu.displayName="DataRouterState";var i0=m.createContext(!1);function P2(){return m.useContext(i0)}var c0=m.createContext({isTransitioning:!1});c0.displayName="ViewTransition";var q2=m.createContext(new Map);q2.displayName="Fetchers";var V2=m.createContext(null);V2.displayName="Await";var $n=m.createContext(null);$n.displayName="Navigation";var si=m.createContext(null);si.displayName="Location";var Va=m.createContext({outlet:null,matches:[],isDataRoute:!1});Va.displayName="Route";var Em=m.createContext(null);Em.displayName="RouteError";var u0="REACT_ROUTER_ERROR",$2="REDIRECT",Y2="ROUTE_ERROR_RESPONSE";function G2(n){if(n.startsWith(`${u0}:${$2}:{`))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 K2(n){if(n.startsWith(`${u0}:${Y2}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new z2(a.status,a.statusText,a.data)}catch{}}function X2(n,{relative:a}={}){Nt(qs(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:s}=m.useContext($n),{hash:c,pathname:u,search:f}=ii(n,{relative:a}),p=u;return l!=="/"&&(p=u==="/"?l:wa([l,u])),s.createHref({pathname:p,search:f,hash:c})}function qs(){return m.useContext(si)!=null}function _n(){return Nt(qs(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(si).location}var d0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function f0(n){m.useContext($n).static||m.useLayoutEffect(n)}function oi(){let{isDataRoute:n}=m.useContext(Va);return n?oE():F2()}function F2(){Nt(qs(),"useNavigate() may be used only in the context of a <Router> component.");let n=m.useContext(Ps),{basename:a,navigator:l}=m.useContext($n),{matches:s}=m.useContext(Va),{pathname:c}=_n(),u=JSON.stringify(Cm(s)),f=m.useRef(!1);return f0(()=>{f.current=!0}),m.useCallback((g,v={})=>{if(oa(f.current,d0),!f.current)return;if(typeof g=="number"){l.go(g);return}let x=vu(g,JSON.parse(u),c,v.relative==="path");n==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:wa([a,x.pathname])),(v.replace?l.replace:l.push)(x,v.state,v)},[a,l,u,c,n])}m.createContext(null);function ii(n,{relative:a}={}){let{matches:l}=m.useContext(Va),{pathname:s}=_n(),c=JSON.stringify(Cm(l));return m.useMemo(()=>vu(n,JSON.parse(c),s,a==="path"),[n,c,s,a])}function Q2(n,a){return h0(n,a)}function h0(n,a,l){var C;Nt(qs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=m.useContext($n),{matches:c}=m.useContext(Va),u=c[c.length-1],f=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",v=u&&u.route;{let N=v&&v.path||"";p0(p,!v||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${N}">) 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="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let x=_n(),y;if(a){let N=typeof a=="string"?Is(a):a;Nt(g==="/"||((C=N.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 "${N.pathname}" was given in the \`location\` prop.`),y=N}else y=x;let b=y.pathname||"/",w=b;if(g!=="/"){let N=g.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(N.length).join("/")}let E=l&&l.state.matches.length?l.state.matches.map(N=>Object.assign(N,{route:l.manifest[N.route.id]||N.route})):Wb(n,{pathname:w});oa(v||E!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),oa(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=tE(E&&E.map(N=>Object.assign({},N,{params:Object.assign({},f,N.params),pathname:wa([g,s.encodeLocation?s.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?g:wa([g,s.encodeLocation?s.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),c,l);return a&&j?m.createElement(si.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},j):j}function Z2(){let n=sE(),a=L2(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),l=n instanceof Error?n.stack:null,s="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:u},"ErrorBoundary")," or"," ",m.createElement("code",{style:u},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},a),l?m.createElement("pre",{style:c},l):null,f)}var J2=m.createElement(Z2,null),m0=class extends m.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const l=K2(n.digest);l&&(n=l)}let a=n!==void 0?m.createElement(Va.Provider,{value:this.props.routeContext},m.createElement(Em.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?m.createElement(W2,{error:n},a):a}};m0.contextType=i0;var gh=new WeakMap;function W2({children:n,error:a}){let{basename:l}=m.useContext($n);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let s=G2(a.digest);if(s){let c=gh.get(a);if(c)throw c;let u=s0(s.location,l),f=u.absoluteURL||u.to;if(I2(f))throw new Error("Invalid redirect location");if(l0&&!gh.get(a))if(u.isExternal||s.reloadDocument)window.location.href=f;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:s.replace}));throw gh.set(a,p),p}return m.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return n}function eE({routeContext:n,match:a,children:l}){let s=m.useContext(Ps);return s&&s.static&&s.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=a.route.id),m.createElement(Va.Provider,{value:n},l)}function tE(n,a=[],l){let s=l==null?void 0:l.state;if(n==null){if(!s)return null;if(s.errors)n=s.matches;else if(a.length===0&&!s.initialized&&s.matches.length>0)n=s.matches;else return null}let c=n,u=s==null?void 0:s.errors;if(u!=null){let x=c.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);Nt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let f=!1,p=-1;if(l&&s){f=s.renderFallback;for(let x=0;x<c.length;x++){let y=c[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=x),y.route.id){let{loaderData:b,errors:w}=s,E=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||E){l.isStatic&&(f=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let g=l==null?void 0:l.onError,v=s&&g?(x,y)=>{var b,w;g(x,{location:s.location,params:((w=(b=s.matches)==null?void 0:b[0])==null?void 0:w.params)??{},pattern:U2(s.matches),errorInfo:y})}:void 0;return c.reduceRight((x,y,b)=>{let w,E=!1,j=null,C=null;s&&(w=u&&y.route.id?u[y.route.id]:void 0,j=y.route.errorElement||J2,f&&(p<0&&b===0?(p0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,C=null):p===b&&(E=!0,C=y.route.hydrateFallbackElement||null)));let N=a.concat(c.slice(0,b+1)),M=()=>{let T;return w?T=j:E?T=C:y.route.Component?T=m.createElement(y.route.Component,null):y.route.element?T=y.route.element:T=x,m.createElement(eE,{match:y,routeContext:{outlet:x,matches:N,isDataRoute:s!=null},children:T})};return s&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?m.createElement(m0,{location:s.location,revalidation:s.revalidation,component:j,error:w,children:M(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:v}):M()},null)}function Rm(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nE(n){let a=m.useContext(Ps);return Nt(a,Rm(n)),a}function aE(n){let a=m.useContext(xu);return Nt(a,Rm(n)),a}function rE(n){let a=m.useContext(Va);return Nt(a,Rm(n)),a}function Nm(n){let a=rE(n),l=a.matches[a.matches.length-1];return Nt(l.route.id,`${n} can only be used on routes that contain a unique "id"`),l.route.id}function lE(){return Nm("useRouteId")}function sE(){var s;let n=m.useContext(Em),a=aE("useRouteError"),l=Nm("useRouteError");return n!==void 0?n:(s=a.errors)==null?void 0:s[l]}function oE(){let{router:n}=nE("useNavigate"),a=Nm("useNavigate"),l=m.useRef(!1);return f0(()=>{l.current=!0}),m.useCallback(async(c,u={})=>{oa(l.current,d0),l.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...u}))},[n,a])}var Xy={};function p0(n,a,l){!a&&!Xy[n]&&(Xy[n]=!0,oa(!1,l))}m.memo(iE);function iE({routes:n,manifest:a,future:l,state:s,isStatic:c,onError:u}){return h0(n,void 0,{manifest:a,state:s,isStatic:c,onError:u})}function Ih({to:n,replace:a,state:l,relative:s}){Nt(qs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=m.useContext($n);oa(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=m.useContext(Va),{pathname:f}=_n(),p=oi(),g=vu(n,Cm(u),f,s==="path"),v=JSON.stringify(g);return m.useEffect(()=>{p(JSON.parse(v),{replace:a,state:l,relative:s})},[p,v,s,a,l]),null}function Nn(n){Nt(!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 cE({basename:n="/",children:a=null,location:l,navigationType:s="POP",navigator:c,static:u=!1,useTransitions:f}){Nt(!qs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=m.useMemo(()=>({basename:p,navigator:c,static:u,useTransitions:f,future:{}}),[p,c,u,f]);typeof l=="string"&&(l=Is(l));let{pathname:v="/",search:x="",hash:y="",state:b=null,key:w="default",mask:E}=l,j=m.useMemo(()=>{let C=xr(v,p);return C==null?null:{location:{pathname:C,search:x,hash:y,state:b,key:w,mask:E},navigationType:s}},[p,v,x,y,b,w,s,E]);return oa(j!=null,`<Router basename="${p}"> is not able to match the URL "${v}${x}${y}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:m.createElement($n.Provider,{value:g},m.createElement(si.Provider,{children:a,value:j}))}function g0({children:n,location:a}){return Q2(Ph(n),a)}function Ph(n,a=[]){let l=[];return m.Children.forEach(n,(s,c)=>{if(!m.isValidElement(s))return;let u=[...a,c];if(s.type===m.Fragment){l.push.apply(l,Ph(s.props.children,u));return}Nt(s.type===Nn,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Nt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let f={id:s.props.id||u.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(f.children=Ph(s.props.children,u)),l.push(f)}),l}var Kc="get",Xc="application/x-www-form-urlencoded";function yu(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function uE(n){return yu(n)&&n.tagName.toLowerCase()==="button"}function dE(n){return yu(n)&&n.tagName.toLowerCase()==="form"}function fE(n){return yu(n)&&n.tagName.toLowerCase()==="input"}function hE(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function mE(n,a){return n.button===0&&(!a||a==="_self")&&!hE(n)}function qh(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,l)=>{let s=n[l];return a.concat(Array.isArray(s)?s.map(c=>[l,c]):[[l,s]])},[]))}function pE(n,a){let l=qh(n);return a&&a.forEach((s,c)=>{l.has(c)||a.getAll(c).forEach(u=>{l.append(c,u)})}),l}var Dc=null;function gE(){if(Dc===null)try{new FormData(document.createElement("form"),0),Dc=!1}catch{Dc=!0}return Dc}var vE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vh(n){return n!=null&&!vE.has(n)?(oa(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xc}"`),null):n}function xE(n,a){let l,s,c,u,f;if(dE(n)){let p=n.getAttribute("action");s=p?xr(p,a):null,l=n.getAttribute("method")||Kc,c=vh(n.getAttribute("enctype"))||Xc,u=new FormData(n)}else if(uE(n)||fE(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||p.getAttribute("action");if(s=g?xr(g,a):null,l=n.getAttribute("formmethod")||p.getAttribute("method")||Kc,c=vh(n.getAttribute("formenctype"))||vh(p.getAttribute("enctype"))||Xc,u=new FormData(p,n),!gE()){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(yu(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=Kc,s=null,c=Xc,f=n}return u&&c==="text/plain"&&(f=u,u=void 0),{action:s,method:l.toLowerCase(),encType:c,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Tm(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function v0(n,a,l,s){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return l?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${s}`:c.pathname=`${c.pathname}.${s}`:c.pathname==="/"?c.pathname=`_root.${s}`:a&&xr(c.pathname,a)==="/"?c.pathname=`${nu(a)}/_root.${s}`:c.pathname=`${nu(c.pathname)}.${s}`,c}async function yE(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 bE(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 wE(n,a,l){let s=await Promise.all(n.map(async c=>{let u=a.routes[c.route.id];if(u){let f=await yE(u,l);return f.links?f.links():[]}return[]}));return EE(s.flat(1).filter(bE).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Fy(n,a,l,s,c,u){let f=(g,v)=>l[v]?g.route.id!==l[v].route.id:!0,p=(g,v)=>{var x;return l[v].pathname!==g.pathname||((x=l[v].route.path)==null?void 0:x.endsWith("*"))&&l[v].params["*"]!==g.params["*"]};return u==="assets"?a.filter((g,v)=>f(g,v)||p(g,v)):u==="data"?a.filter((g,v)=>{var y;let x=s.routes[g.route.id];if(!x||!x.hasLoader)return!1;if(f(g,v)||p(g,v))return!0;if(g.route.shouldRevalidate){let b=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((y=l[0])==null?void 0:y.params)||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function SE(n,a,{includeHydrateFallback:l}={}){return jE(n.map(s=>{let c=a.routes[s.route.id];if(!c)return[];let u=[c.module];return c.clientActionModule&&(u=u.concat(c.clientActionModule)),c.clientLoaderModule&&(u=u.concat(c.clientLoaderModule)),l&&c.hydrateFallbackModule&&(u=u.concat(c.hydrateFallbackModule)),c.imports&&(u=u.concat(c.imports)),u}).flat(1))}function jE(n){return[...new Set(n)]}function CE(n){let a={},l=Object.keys(n).sort();for(let s of l)a[s]=n[s];return a}function EE(n,a){let l=new Set;return new Set(a),n.reduce((s,c)=>{let u=JSON.stringify(CE(c));return l.has(u)||(l.add(u),s.push({key:u,link:c})),s},[])}function Mm(){let n=m.useContext(Ps);return Tm(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function RE(){let n=m.useContext(xu);return Tm(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Am=m.createContext(void 0);Am.displayName="FrameworkContext";function bu(){let n=m.useContext(Am);return Tm(n,"You must render this element inside a <HydratedRouter> element"),n}function NE(n,a){let l=m.useContext(Am),[s,c]=m.useState(!1),[u,f]=m.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:v,onMouseLeave:x,onTouchStart:y}=a,b=m.useRef(null);m.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let j=N=>{N.forEach(M=>{f(M.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[n]),m.useEffect(()=>{if(s){let j=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(j)}}},[s]);let w=()=>{c(!0)},E=()=>{c(!1),f(!1)};return l?n!=="intent"?[u,b,{}]:[u,b,{onFocus:Yo(p,w),onBlur:Yo(g,E),onMouseEnter:Yo(v,w),onMouseLeave:Yo(x,E),onTouchStart:Yo(y,w)}]:[!1,b,{}]}function Yo(n,a){return l=>{n&&n(l),l.defaultPrevented||a(l)}}function TE({page:n,...a}){let l=P2(),{nonce:s}=bu(),{router:c}=Mm(),u=m.useMemo(()=>Wb(c.routes,n,c.basename),[c.routes,n,c.basename]);return u?(a.nonce==null&&s&&(a={...a,nonce:s}),l?m.createElement(AE,{page:n,matches:u,...a}):m.createElement(DE,{page:n,matches:u,...a})):null}function ME(n){let{manifest:a,routeModules:l}=bu(),[s,c]=m.useState([]);return m.useEffect(()=>{let u=!1;return wE(n,a,l).then(f=>{u||c(f)}),()=>{u=!0}},[n,a,l]),s}function AE({page:n,matches:a,...l}){let s=_n(),{future:c}=bu(),{basename:u}=Mm(),f=m.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let p=v0(n,u,c.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let x of a)typeof x.route.shouldRevalidate=="function"?g=!0:v.push(x.route.id);return g&&v.length>0&&p.searchParams.set("_routes",v.join(",")),[p.pathname+p.search]},[u,c.v8_trailingSlashAwareDataRequests,n,s,a]);return m.createElement(m.Fragment,null,f.map(p=>m.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...l})))}function DE({page:n,matches:a,...l}){let s=_n(),{future:c,manifest:u,routeModules:f}=bu(),{basename:p}=Mm(),{loaderData:g,matches:v}=RE(),x=m.useMemo(()=>Fy(n,a,v,u,s,"data"),[n,a,v,u,s]),y=m.useMemo(()=>Fy(n,a,v,u,s,"assets"),[n,a,v,u,s]),b=m.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let j=new Set,C=!1;if(a.forEach(M=>{var D;let T=u.routes[M.route.id];!T||!T.hasLoader||(!x.some(O=>O.route.id===M.route.id)&&M.route.id in g&&((D=f[M.route.id])!=null&&D.shouldRevalidate)||T.hasClientLoader?C=!0:j.add(M.route.id))}),j.size===0)return[];let N=v0(n,p,c.v8_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&N.searchParams.set("_routes",a.filter(M=>j.has(M.route.id)).map(M=>M.route.id).join(",")),[N.pathname+N.search]},[p,c.v8_trailingSlashAwareDataRequests,g,s,u,x,a,n,f]),w=m.useMemo(()=>SE(y,u),[y,u]),E=ME(y);return m.createElement(m.Fragment,null,b.map(j=>m.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...l})),w.map(j=>m.createElement("link",{key:j,rel:"modulepreload",href:j,...l})),E.map(({key:j,link:C})=>m.createElement("link",{key:j,nonce:l.nonce,...C,crossOrigin:C.crossOrigin??l.crossOrigin})))}function OE(...n){return a=>{n.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var _E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_E&&(window.__reactRouterVersion="7.18.2")}catch{}function kE({basename:n,children:a,useTransitions:l,window:s}){let c=m.useRef();c.current==null&&(c.current=h2({window:s,v5Compat:!0}));let u=c.current,[f,p]=m.useState({action:u.action,location:u.location}),g=m.useCallback(v=>{l===!1?p(v):m.startTransition(()=>p(v))},[l]);return m.useLayoutEffect(()=>u.listen(g),[u,g]),m.createElement(cE,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:u,useTransitions:l})}var ra=m.forwardRef(function({onClick:a,discover:l="render",prefetch:s="none",relative:c,reloadDocument:u,replace:f,mask:p,state:g,target:v,to:x,preventScrollReset:y,viewTransition:b,defaultShouldRevalidate:w,...E},j){let{basename:C,navigator:N,useTransitions:M}=m.useContext($n),T=typeof x=="string"&&jm.test(x),D=s0(x,C);x=D.to;let O=X2(x,{relative:c}),A=_n(),U=null;if(p){let se=vu(p,[],A.mask?A.mask.pathname:"/",!0);C!=="/"&&(se.pathname=se.pathname==="/"?C:wa([C,se.pathname])),U=N.createHref(se)}let[k,$,X]=NE(s,E),te=UE(x,{replace:f,mask:p,state:g,target:v,preventScrollReset:y,relative:c,viewTransition:b,defaultShouldRevalidate:w,useTransitions:M});function G(se){a&&a(se),se.defaultPrevented||te(se)}let ie=!(D.isExternal||u),ce=m.createElement("a",{...E,...X,href:(ie?U:void 0)||D.absoluteURL||O,onClick:ie?G:a,ref:OE(j,$),target:v,"data-discover":!T&&l==="render"?"true":void 0});return k&&!T?m.createElement(m.Fragment,null,ce,m.createElement(TE,{page:O})):ce});ra.displayName="Link";var x0=m.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:s="",end:c=!1,style:u,to:f,viewTransition:p,children:g,...v},x){let y=ii(f,{relative:v.relative}),b=_n(),w=m.useContext(xu),{navigator:E,basename:j}=m.useContext($n),C=w!=null&&VE(y)&&p===!0,N=E.encodeLocation?E.encodeLocation(y).pathname:y.pathname,M=b.pathname,T=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;l||(M=M.toLowerCase(),T=T?T.toLowerCase():null,N=N.toLowerCase()),T&&j&&(T=xr(T,j)||T);const D=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let O=M===N||!c&&M.startsWith(N)&&M.charAt(D)==="/",A=T!=null&&(T===N||!c&&T.startsWith(N)&&T.charAt(N.length)==="/"),U={isActive:O,isPending:A,isTransitioning:C},k=O?a:void 0,$;typeof s=="function"?$=s(U):$=[s,O?"active":null,A?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let X=typeof u=="function"?u(U):u;return m.createElement(ra,{...v,"aria-current":k,className:$,ref:x,style:X,to:f,viewTransition:p},typeof g=="function"?g(U):g)});x0.displayName="NavLink";var zE=m.forwardRef(({discover:n="render",fetcherKey:a,navigate:l,reloadDocument:s,replace:c,state:u,method:f=Kc,action:p,onSubmit:g,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b,...w},E)=>{let{useTransitions:j}=m.useContext($n),C=PE(),N=qE(p,{relative:v}),M=f.toLowerCase()==="get"?"get":"post",T=typeof p=="string"&&jm.test(p),D=O=>{if(g&&g(O),O.defaultPrevented)return;O.preventDefault();let A=O.nativeEvent.submitter,U=(A==null?void 0:A.getAttribute("formmethod"))||f,k=()=>C(A||O.currentTarget,{fetcherKey:a,method:U,navigate:l,replace:c,state:u,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b});j&&l!==!1?m.startTransition(()=>k()):k()};return m.createElement("form",{ref:E,method:M,action:N,onSubmit:s?g:D,...w,"data-discover":!T&&n==="render"?"true":void 0})});zE.displayName="Form";function LE(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function y0(n){let a=m.useContext(Ps);return Nt(a,LE(n)),a}function UE(n,{target:a,replace:l,mask:s,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g,useTransitions:v}={}){let x=oi(),y=_n(),b=ii(n,{relative:f});return m.useCallback(w=>{if(mE(w,a)){w.preventDefault();let E=l!==void 0?l:Zo(y)===Zo(b),j=()=>x(n,{replace:E,mask:s,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g});v?m.startTransition(()=>j()):j()}},[y,x,b,l,s,c,a,n,u,f,p,g,v])}function BE(n){oa(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=m.useRef(qh(n)),l=m.useRef(!1),s=_n(),c=m.useMemo(()=>pE(s.search,l.current?null:a.current),[s.search]),u=oi(),f=m.useCallback((p,g)=>{const v=qh(typeof p=="function"?p(new URLSearchParams(c)):p);l.current=!0,u("?"+v,g)},[u,c]);return[c,f]}var HE=0,IE=()=>`__${String(++HE)}__`;function PE(){let{router:n}=y0("useSubmit"),{basename:a}=m.useContext($n),l=lE(),s=n.fetch,c=n.navigate;return m.useCallback(async(u,f={})=>{let{action:p,method:g,encType:v,formData:x,body:y}=xE(u,a);if(f.navigate===!1){let b=f.fetcherKey||IE();await s(b,l,f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||g,formEncType:f.encType||v,flushSync:f.flushSync})}else await c(f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||g,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:l,flushSync:f.flushSync,viewTransition:f.viewTransition})},[s,c,a,l])}function qE(n,{relative:a}={}){let{basename:l}=m.useContext($n),s=m.useContext(Va);Nt(s,"useFormAction must be used inside a RouteContext");let[c]=s.matches.slice(-1),u={...ii(n||".",{relative:a})},f=_n();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:wa([l,u.pathname])),Zo(u)}function VE(n,{relative:a}={}){let l=m.useContext(c0);Nt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=y0("useViewTransitionState"),c=ii(n,{relative:a});if(!l.isTransitioning)return!1;let u=xr(l.currentLocation.pathname,s)||l.currentLocation.pathname,f=xr(l.nextLocation.pathname,s)||l.nextLocation.pathname;return tu(c.pathname,f)!=null||tu(c.pathname,u)!=null}var ba=Zb();const $E=wm(ba),wu="",au="x-csrf-token",Qy=new Set(["/api/admin/login","/api/admin/setup"]);let Dl=null,xh=null;async function Dm(){return Dl||(xh??(xh=fetch(`${wu}/api/admin/csrf`,{credentials:"include"}).then(async n=>{if(!n.ok)throw new Error("Unable to acquire CSRF token");return Dl=(await n.json()).csrfToken,Dl}).finally(()=>{xh=null})),xh)}class Om extends Error{constructor(a,l,s){var c;super(typeof s=="object"&&s&&"error"in s?String(((c=s.error)==null?void 0:c.message)??s):"Request failed"),this.status=a,this.type=l,this.body=s}}async function b0(n){var s;const a=await n.text();let l;try{l=a?JSON.parse(a):void 0}catch{l=a}if(!n.ok)throw new Om(n.status,typeof l=="object"&&l&&"error"in l?String(((s=l.error)==null?void 0:s.type)??"error"):"error",l);return l}async function As(n,a,l,s,c=!0){const u=l!==void 0,f={...s==null?void 0:s.headers};u&&!f["content-type"]&&(f["content-type"]="application/json"),n!=="GET"&&n!=="HEAD"&&!Qy.has(a)&&!f[au]&&(f[au]=await Dm());const p=await fetch(`${wu}${a}`,{...s,method:n,headers:f,body:u?JSON.stringify(l):void 0,credentials:"include"});try{return await b0(p)}catch(g){const v=g instanceof Om&&(g.status===401||g.status===403)&&(g.type==="authentication_error"||g.type==="csrf_error");if(c&&v&&n!=="GET"&&n!=="HEAD"&&!Qy.has(a))return Dl=null,As(n,a,l,s,!1);throw g}}async function w0(n,a,l=!0){const s=await fetch(`${wu}${n}`,{method:"POST",headers:{[au]:await Dm()},body:a,credentials:"include"});try{return await b0(s)}catch(c){const u=c instanceof Om&&(c.status===401||c.status===403)&&(c.type==="authentication_error"||c.type==="csrf_error");if(l&&u)return Dl=null,w0(n,a,!1);throw c}}async function ru(n,a,l=!0){const s={...a==null?void 0:a.headers,[au]:await Dm()},c=await fetch(`${wu}${n}`,{...a,headers:s,credentials:"include"});return l&&c.status===403?(Dl=null,ru(n,a,!1)):c}const Se={get:(n,a)=>As("GET",n,void 0,a),post:(n,a,l)=>As("POST",n,a,l),upload:w0,patch:(n,a,l)=>As("PATCH",n,a,l),put:(n,a,l)=>As("PUT",n,a,l),del:(n,a)=>As("DELETE",n,void 0,a)},S0=m.createContext(void 0);function YE({children:n}){const[a,l]=m.useState(null),[s,c]=m.useState(!0),u=m.useCallback(async()=>{try{const g=await Se.get("/api/admin/me");l(g)}catch{l(null)}finally{c(!1)}},[]);m.useEffect(()=>{u()},[u]);const f=m.useCallback(async(g,v,x,y)=>{const b={username:g,password:v};x&&(b.totp=x),y&&(b.recoveryCode=y);try{const w=await Se.post("/api/admin/login",b);return l({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const E=w.status,j=w.type;if(E===401&&j==="totp_required")return{totpRequired:!0};throw w}},[]),p=m.useCallback(async()=>{await Se.post("/api/admin/logout"),l(null)},[]);return o.jsx(S0.Provider,{value:{user:a,loading:s,login:f,logout:p,refresh:u},children:n})}function _m(){const n=m.useContext(S0);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 GE=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j0=(...n)=>n.filter((a,l,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===l).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.469.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/var KE={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 XE=m.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:s,className:c="",children:u,iconNode:f,...p},g)=>m.createElement("svg",{ref:g,...KE,width:a,height:a,stroke:n,strokeWidth:s?Number(l)*24/Number(a):l,className:j0("lucide",c),...p},[...f.map(([v,x])=>m.createElement(v,x)),...Array.isArray(u)?u:[u]]));/**
|
|
76
|
+
* @license lucide-react v0.469.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const _e=(n,a)=>{const l=m.forwardRef(({className:s,...c},u)=>m.createElement(XE,{ref:u,iconNode:a,className:j0(`lucide-${GE(n)}`,s),...c}));return l.displayName=`${n}`,l};/**
|
|
81
|
+
* @license lucide-react v0.469.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const km=_e("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
86
|
+
* @license lucide-react v0.469.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const FE=_e("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
91
|
+
* @license lucide-react v0.469.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const QE=_e("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
|
96
|
+
* @license lucide-react v0.469.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const ZE=_e("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
|
|
101
|
+
* @license lucide-react v0.469.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const C0=_e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
106
|
+
* @license lucide-react v0.469.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const JE=_e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
111
|
+
* @license lucide-react v0.469.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const WE=_e("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
|
|
116
|
+
* @license lucide-react v0.469.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const ci=_e("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
121
|
+
* @license lucide-react v0.469.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const eR=_e("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
126
|
+
* @license lucide-react v0.469.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const tR=_e("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
131
|
+
* @license lucide-react v0.469.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const nR=_e("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
136
|
+
* @license lucide-react v0.469.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const aR=_e("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
|
|
141
|
+
* @license lucide-react v0.469.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const Fc=_e("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
146
|
+
* @license lucide-react v0.469.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const rR=_e("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
151
|
+
* @license lucide-react v0.469.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const lR=_e("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
156
|
+
* @license lucide-react v0.469.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const E0=_e("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
161
|
+
* @license lucide-react v0.469.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const sR=_e("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
166
|
+
* @license lucide-react v0.469.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const oR=_e("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
171
|
+
* @license lucide-react v0.469.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const iR=_e("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
|
|
176
|
+
* @license lucide-react v0.469.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const R0=_e("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
181
|
+
* @license lucide-react v0.469.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const cR=_e("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
186
|
+
* @license lucide-react v0.469.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const N0=_e("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
191
|
+
* @license lucide-react v0.469.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const T0=_e("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
196
|
+
* @license lucide-react v0.469.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const _s=_e("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
201
|
+
* @license lucide-react v0.469.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const uR=_e("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
206
|
+
* @license lucide-react v0.469.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const dR=_e("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
211
|
+
* @license lucide-react v0.469.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const fR=_e("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
216
|
+
* @license lucide-react v0.469.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const M0=_e("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
221
|
+
* @license lucide-react v0.469.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const hR=_e("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
226
|
+
* @license lucide-react v0.469.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const A0=_e("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
231
|
+
* @license lucide-react v0.469.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const Su=_e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
236
|
+
* @license lucide-react v0.469.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const mR=_e("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/**
|
|
241
|
+
* @license lucide-react v0.469.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const pR=_e("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
|
|
246
|
+
* @license lucide-react v0.469.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const D0=_e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
251
|
+
* @license lucide-react v0.469.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const gR=_e("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
256
|
+
* @license lucide-react v0.469.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const vR=_e("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
261
|
+
* @license lucide-react v0.469.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const xR=_e("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
266
|
+
* @license lucide-react v0.469.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const yR=_e("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
271
|
+
* @license lucide-react v0.469.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const ju=_e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
276
|
+
* @license lucide-react v0.469.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const bR=_e("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
281
|
+
* @license lucide-react v0.469.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const O0=_e("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
286
|
+
* @license lucide-react v0.469.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const wR=_e("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
291
|
+
* @license lucide-react v0.469.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const Cu=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
296
|
+
* @license lucide-react v0.469.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const SR=_e("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function _0(n){var a,l,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(a=0;a<c;a++)n[a]&&(l=_0(n[a]))&&(s&&(s+=" "),s+=l)}else for(l in n)n[l]&&(s&&(s+=" "),s+=l);return s}function k0(){for(var n,a,l=0,s="",c=arguments.length;l<c;l++)(n=arguments[l])&&(a=_0(n))&&(s&&(s+=" "),s+=a);return s}const zm="-",jR=n=>{const a=ER(n),{conflictingClassGroups:l,conflictingClassGroupModifiers:s}=n;return{getClassGroupId:f=>{const p=f.split(zm);return p[0]===""&&p.length!==1&&p.shift(),z0(p,a)||CR(f)},getConflictingClassGroupIds:(f,p)=>{const g=l[f]||[];return p&&s[f]?[...g,...s[f]]:g}}},z0=(n,a)=>{var f;if(n.length===0)return a.classGroupId;const l=n[0],s=a.nextPart.get(l),c=s?z0(n.slice(1),s):void 0;if(c)return c;if(a.validators.length===0)return;const u=n.join(zm);return(f=a.validators.find(({validator:p})=>p(u)))==null?void 0:f.classGroupId},Zy=/^\[(.+)\]$/,CR=n=>{if(Zy.test(n)){const a=Zy.exec(n)[1],l=a==null?void 0:a.substring(0,a.indexOf(":"));if(l)return"arbitrary.."+l}},ER=n=>{const{theme:a,prefix:l}=n,s={nextPart:new Map,validators:[]};return NR(Object.entries(n.classGroups),l).forEach(([u,f])=>{Vh(f,s,u,a)}),s},Vh=(n,a,l,s)=>{n.forEach(c=>{if(typeof c=="string"){const u=c===""?a:Jy(a,c);u.classGroupId=l;return}if(typeof c=="function"){if(RR(c)){Vh(c(s),a,l,s);return}a.validators.push({validator:c,classGroupId:l});return}Object.entries(c).forEach(([u,f])=>{Vh(f,Jy(a,u),l,s)})})},Jy=(n,a)=>{let l=n;return a.split(zm).forEach(s=>{l.nextPart.has(s)||l.nextPart.set(s,{nextPart:new Map,validators:[]}),l=l.nextPart.get(s)}),l},RR=n=>n.isThemeGetter,NR=(n,a)=>a?n.map(([l,s])=>{const c=s.map(u=>typeof u=="string"?a+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([f,p])=>[a+f,p])):u);return[l,c]}):n,TR=n=>{if(n<1)return{get:()=>{},set:()=>{}};let a=0,l=new Map,s=new Map;const c=(u,f)=>{l.set(u,f),a++,a>n&&(a=0,s=l,l=new Map)};return{get(u){let f=l.get(u);if(f!==void 0)return f;if((f=s.get(u))!==void 0)return c(u,f),f},set(u,f){l.has(u)?l.set(u,f):c(u,f)}}},L0="!",MR=n=>{const{separator:a,experimentalParseClassName:l}=n,s=a.length===1,c=a[0],u=a.length,f=p=>{const g=[];let v=0,x=0,y;for(let C=0;C<p.length;C++){let N=p[C];if(v===0){if(N===c&&(s||p.slice(C,C+u)===a)){g.push(p.slice(x,C)),x=C+u;continue}if(N==="/"){y=C;continue}}N==="["?v++:N==="]"&&v--}const b=g.length===0?p:p.substring(x),w=b.startsWith(L0),E=w?b.substring(1):b,j=y&&y>x?y-x:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:E,maybePostfixModifierPosition:j}};return l?p=>l({className:p,parseClassName:f}):f},AR=n=>{if(n.length<=1)return n;const a=[];let l=[];return n.forEach(s=>{s[0]==="["?(a.push(...l.sort(),s),l=[]):l.push(s)}),a.push(...l.sort()),a},DR=n=>({cache:TR(n.cacheSize),parseClassName:MR(n),...jR(n)}),OR=/\s+/,_R=(n,a)=>{const{parseClassName:l,getClassGroupId:s,getConflictingClassGroupIds:c}=a,u=[],f=n.trim().split(OR);let p="";for(let g=f.length-1;g>=0;g-=1){const v=f[g],{modifiers:x,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:w}=l(v);let E=!!w,j=s(E?b.substring(0,w):b);if(!j){if(!E){p=v+(p.length>0?" "+p:p);continue}if(j=s(b),!j){p=v+(p.length>0?" "+p:p);continue}E=!1}const C=AR(x).join(":"),N=y?C+L0:C,M=N+j;if(u.includes(M))continue;u.push(M);const T=c(j,E);for(let D=0;D<T.length;++D){const O=T[D];u.push(N+O)}p=v+(p.length>0?" "+p:p)}return p};function kR(){let n=0,a,l,s="";for(;n<arguments.length;)(a=arguments[n++])&&(l=U0(a))&&(s&&(s+=" "),s+=l);return s}const U0=n=>{if(typeof n=="string")return n;let a,l="";for(let s=0;s<n.length;s++)n[s]&&(a=U0(n[s]))&&(l&&(l+=" "),l+=a);return l};function zR(n,...a){let l,s,c,u=f;function f(g){const v=a.reduce((x,y)=>y(x),n());return l=DR(v),s=l.cache.get,c=l.cache.set,u=p,p(g)}function p(g){const v=s(g);if(v)return v;const x=_R(g,l);return c(g,x),x}return function(){return u(kR.apply(null,arguments))}}const wt=n=>{const a=l=>l[n]||[];return a.isThemeGetter=!0,a},B0=/^\[(?:([a-z-]+):)?(.+)\]$/i,LR=/^\d+\/\d+$/,UR=new Set(["px","full","screen"]),BR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,HR=/\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$/,IR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,PR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fr=n=>ks(n)||UR.has(n)||LR.test(n),Jr=n=>Vs(n,"length",QR),ks=n=>!!n&&!Number.isNaN(Number(n)),yh=n=>Vs(n,"number",ks),Go=n=>!!n&&Number.isInteger(Number(n)),VR=n=>n.endsWith("%")&&ks(n.slice(0,-1)),He=n=>B0.test(n),Wr=n=>BR.test(n),$R=new Set(["length","size","percentage"]),YR=n=>Vs(n,$R,H0),GR=n=>Vs(n,"position",H0),KR=new Set(["image","url"]),XR=n=>Vs(n,KR,JR),FR=n=>Vs(n,"",ZR),Ko=()=>!0,Vs=(n,a,l)=>{const s=B0.exec(n);return s?s[1]?typeof a=="string"?s[1]===a:a.has(s[1]):l(s[2]):!1},QR=n=>HR.test(n)&&!IR.test(n),H0=()=>!1,ZR=n=>PR.test(n),JR=n=>qR.test(n),WR=()=>{const n=wt("colors"),a=wt("spacing"),l=wt("blur"),s=wt("brightness"),c=wt("borderColor"),u=wt("borderRadius"),f=wt("borderSpacing"),p=wt("borderWidth"),g=wt("contrast"),v=wt("grayscale"),x=wt("hueRotate"),y=wt("invert"),b=wt("gap"),w=wt("gradientColorStops"),E=wt("gradientColorStopPositions"),j=wt("inset"),C=wt("margin"),N=wt("opacity"),M=wt("padding"),T=wt("saturate"),D=wt("scale"),O=wt("sepia"),A=wt("skew"),U=wt("space"),k=wt("translate"),$=()=>["auto","contain","none"],X=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",He,a],G=()=>[He,a],ie=()=>["",fr,Jr],ce=()=>["auto",ks,He],se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",He],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[ks,He];return{cacheSize:500,separator:":",theme:{colors:[Ko],spacing:[fr,Jr],blur:["none","",Wr,He],brightness:z(),borderColor:[n],borderRadius:["none","","full",Wr,He],borderSpacing:G(),borderWidth:ie(),contrast:z(),grayscale:J(),hueRotate:z(),invert:J(),gap:G(),gradientColorStops:[n],gradientColorStopPositions:[VR,Jr],inset:te(),margin:te(),opacity:z(),padding:G(),saturate:z(),scale:z(),sepia:J(),skew:z(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",He]}],container:["container"],columns:[{columns:[Wr]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...se(),He]}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Go,He]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",He]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",Go,He]}],"grid-cols":[{"grid-cols":[Ko]}],"col-start-end":[{col:["auto",{span:["full",Go,He]},He]}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":[Ko]}],"row-start-end":[{row:["auto",{span:[Go,He]},He]}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",He]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",He]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[U]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[U]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",He,a]}],"min-w":[{"min-w":[He,a,"min","max","fit"]}],"max-w":[{"max-w":[He,a,"none","full","min","max","fit","prose",{screen:[Wr]},Wr]}],h:[{h:[He,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[He,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[He,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[He,a,"auto","min","max","fit"]}],"font-size":[{text:["base",Wr,Jr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",yh]}],"font-family":[{font:[Ko]}],"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",He]}],"line-clamp":[{"line-clamp":["none",ks,yh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",fr,He]}],"list-image":[{"list-image":["none",He]}],"list-style-type":[{list:["none","disc","decimal",He]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",fr,Jr]}],"underline-offset":[{"underline-offset":["auto",fr,He]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He]}],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",He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...se(),GR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",YR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},XR]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"border-w":[{border:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[N]}],"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":[N]}],"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,He]}],"outline-w":[{outline:[fr,Jr]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[fr,Jr]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",Wr,FR]}],"shadow-color":[{shadow:[Ko]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[l]}],brightness:[{brightness:[s]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",Wr,He]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[T]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[l]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"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",He]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",He]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",He]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[D]}],"scale-x":[{"scale-x":[D]}],"scale-y":[{"scale-y":[D]}],rotate:[{rotate:[Go,He]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",He]}],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",He]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",He]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[fr,Jr,yh]}],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"]}}},eN=zR(WR);function Ee(...n){return eN(k0(n))}function Kt(n,a="—"){return n==null||Number.isNaN(n)?a:n.toLocaleString()}function Eu(n,a=1,l="—"){return n==null||Number.isNaN(n)?l:`${(n*100).toFixed(a)}%`}function Ol(n){return n?n<1e3?`${Math.round(n)} ms`:`${(n/1e3).toFixed(2)} s`:"—"}function Lm(n){if(!n)return"—";try{return new Date(n).toLocaleString()}catch{return n}}function tN(n,a=8){return n?n.length>a?`${n.slice(0,a)}…`:n:"—"}function nN(n){if(!n)return"—";const a=Date.now()-new Date(n).getTime();if(!Number.isFinite(a)||a<0)return"—";const l=Math.floor(a/1e3);if(l<60)return`${l}s ago`;const s=Math.floor(l/60);if(s<60)return`${s}m ago`;const c=Math.floor(s/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const aN=[{to:"/",label:"Dashboard",icon:R0,end:!0},{to:"/providers",label:"Providers",icon:M0},{to:"/models",label:"Models",icon:ZE},{to:"/combos",label:"Combos",icon:T0},{to:"/aliases",label:"Aliases",icon:nR},{to:"/api-keys",label:"API Keys",icon:N0},{to:"/requests",label:"Requests",icon:km},{to:"/statistics",label:"Statistics",icon:oR},{to:"/audit",label:"Audit Logs",icon:pR},{to:"/settings",label:"Settings",icon:aR}];function rN(){const[n,a]=m.useState(null);return m.useEffect(()=>{let l=!1;return fetch("/api/admin/settings/system",{credentials:"include"}).then(s=>s.ok?s.json():null).then(s=>{!l&&(s!=null&&s.appVersion)&&a(s.appVersion)}).catch(()=>{}),()=>{l=!0}},[]),o.jsxs("aside",{className:"hidden w-60 shrink-0 border-r bg-sidebar text-sidebar-foreground md:flex md:flex-col",children:[o.jsxs("div",{className:"flex h-14 items-center gap-2 border-b px-4",children:[o.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-7 w-7 object-contain"}),o.jsx("div",{className:"font-semibold tracking-tight",children:"LateDev Router"})]}),o.jsx("nav",{className:"flex-1 space-y-0.5 p-2",children:aN.map(l=>o.jsxs(x0,{to:l.to,end:l.end,className:({isActive:s})=>Ee("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors",s?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[o.jsx(l.icon,{className:"h-4 w-4"}),l.label]},l.to))}),o.jsxs("div",{className:"border-t p-3 text-xs text-muted-foreground flex items-center gap-2",children:[o.jsx(gR,{className:"h-3.5 w-3.5 text-primary"})," ",n?`v${n}`:"v…"]})]})}var lN=Object.defineProperty,Um=(n,a)=>lN(n,"name",{value:a,configurable:!0});function $h(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}Um($h,"setRef");function I0(...n){return a=>{let l=!1;const s=n.map(c=>{const u=$h(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c<s.length;c++){const u=s[c];typeof u=="function"?u():$h(n[c],null)}}}}Um(I0,"composeRefs");function Xe(...n){return m.useCallback(I0(...n),n)}Um(Xe,"useComposedRefs");var sN=Object.defineProperty,Ra=(n,a)=>sN(n,"name",{value:a,configurable:!0});function Ha(n){const a=m.forwardRef((l,s)=>{let{children:c,...u}=l,f=null,p=!1;const g=[];Yh(c)&&typeof Oc=="function"&&(c=Oc(c._payload)),m.Children.forEach(c,b=>{var w;if(Y0(b)){p=!0;const E=b;let j="child"in E.props?E.props.child:E.props.children;Yh(j)&&typeof Oc=="function"&&(j=Oc(j._payload)),f=iN(E,j),g.push((w=f==null?void 0:f.props)==null?void 0:w.children)}else g.push(b)}),f?f=m.cloneElement(f,void 0,g):!p&&m.Children.count(c)===1&&m.isValidElement(c)&&(f=c);const v=f?$0(f):void 0,x=Xe(s,v);if(!f){if(c||c===0)throw new Error(p?dN(n):uN(n));return c}const y=V0(u,f.props??{});return f.type!==m.Fragment&&(y.ref=s?x:v),m.cloneElement(f,y)});return a.displayName=`${n}.Slot`,a}Ra(Ha,"createSlot");var oN=Ha("Slot"),P0=Symbol.for("radix.slottable");function q0(n){const a=Ra(l=>"child"in l?l.children(l.child):l.children,"Slottable");return a.displayName=`${n}.Slottable`,a.__radixId=P0,a}Ra(q0,"createSlottable");var iN=Ra((n,a)=>{if("child"in n.props){const l=n.props.child;return m.isValidElement(l)?m.cloneElement(l,void 0,n.props.children(l.props.children)):null}return m.isValidElement(a)?a:null},"getSlottableElementFromSlottable");function V0(n,a){const l={...a};for(const s in a){const c=n[s],u=a[s];/^on[A-Z]/.test(s)?c&&u?l[s]=(...p)=>{const g=u(...p);return c(...p),g}:c&&(l[s]=c):s==="style"?l[s]={...c,...u}:s==="className"&&(l[s]=[c,u].filter(Boolean).join(" "))}return{...n,...l}}Ra(V0,"mergeProps");function $0(n){var s,c;let a=(s=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:s.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}Ra($0,"getElementRef");function Y0(n){return m.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===P0}Ra(Y0,"isSlottable");var cN=Symbol.for("react.lazy");function Yh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===cN&&"_payload"in n&&G0(n._payload)}Ra(Yh,"isLazyComponent");function G0(n){return typeof n=="object"&&n!==null&&"then"in n}Ra(G0,"isPromiseLike");var uN=Ra(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),dN=Ra(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Oc=Hs[" use ".trim().toString()];const Wy=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,eb=k0,K0=(n,a)=>l=>{var s;if((a==null?void 0:a.variants)==null)return eb(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=Wy(x)||Wy(y);return c[v][b]}),p=l&&Object.entries(l).reduce((v,x)=>{let[y,b]=x;return b===void 0||(v[y]=b),v},{}),g=a==null||(s=a.compoundVariants)===null||s===void 0?void 0:s.reduce((v,x)=>{let{class:y,className:b,...w}=x;return Object.entries(w).every(E=>{let[j,C]=E;return Array.isArray(C)?C.includes({...u,...p}[j]):{...u,...p}[j]===C})?[...v,y,b]:v},[]);return eb(n,f,g,l==null?void 0:l.class,l==null?void 0:l.className)},fN=K0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-6",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),me=m.forwardRef(({className:n,variant:a,size:l,asChild:s=!1,...c},u)=>{const f=s?oN:"button";return o.jsx(f,{className:Ee(fN({variant:a,size:l,className:n})),ref:u,...c})});me.displayName="Button";const X0=m.createContext(void 0);function hN({children:n,defaultTheme:a="system",storageKey:l="latedev-theme"}){const[s,c]=m.useState(()=>localStorage.getItem(l)||a);m.useEffect(()=>{const f=window.document.documentElement;if(f.classList.remove("light","dark"),s==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(p);return}f.classList.add(s)},[s]);const u={theme:s,setTheme:f=>{localStorage.setItem(l,f),c(f)}};return o.jsx(X0.Provider,{value:u,children:n})}function mN(){const n=m.useContext(X0);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}var pN=Object.defineProperty,$s=(n,a)=>pN(n,"name",{value:a,configurable:!0}),F0=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ne(n,a,{checkForDefaultPrevented:l=!0}={}){return $s(function(c){if(n==null||n(c),l===!1||!c||!c.defaultPrevented)return a==null?void 0:a(c)},"handleEvent")}$s(Ne,"composeEventHandlers");function gN(n){var a;if(!F0)throw new Error("Cannot access window outside of the DOM");return((a=n==null?void 0:n.ownerDocument)==null?void 0:a.defaultView)??window}$s(gN,"getOwnerWindow");function Gh(n){if(!F0)throw new Error("Cannot access document outside of the DOM");return(n==null?void 0:n.ownerDocument)??document}$s(Gh,"getOwnerDocument");function Q0(n,a=!1){const{activeElement:l}=Gh(n);if(!(l!=null&&l.nodeName))return null;if(Z0(l)&&l.contentDocument)return Q0(l.contentDocument.body,a);if(a){const s=l.getAttribute("aria-activedescendant");if(s){const c=Gh(l).getElementById(s);if(c)return c}}return l}$s(Q0,"getActiveElement");function Z0(n){return n.tagName==="IFRAME"}$s(Z0,"isFrame");var vN=Object.defineProperty,sa=(n,a)=>vN(n,"name",{value:a,configurable:!0});function xN(n,a){const l=m.createContext(a);l.displayName=n+"Context";const s=sa(u=>{const{children:f,...p}=u,g=m.useMemo(()=>p,Object.values(p));return o.jsx(l.Provider,{value:g,children:f})},"Provider");s.displayName=n+"Provider";function c(u,f={}){const{optional:p=!1}=f,g=m.useContext(l);if(g)return g;if(a!==void 0)return a;if(!p)throw new Error(`\`${u}\` must be used within \`${n}\``)}return sa(c,"useContext"),[s,c]}sa(xN,"createContext");function kn(n,a=[]){let l=[];function s(u,f){const p=m.createContext(f);p.displayName=u+"Context";const g=l.length;l=[...l,f];const v=sa(y=>{var N;const{scope:b,children:w,...E}=y,j=((N=b==null?void 0:b[n])==null?void 0:N[g])||p,C=m.useMemo(()=>E,Object.values(E));return o.jsx(j.Provider,{value:C,children:w})},"Provider");v.displayName=u+"Provider";function x(y,b,w={}){var N;const{optional:E=!1}=w,j=((N=b==null?void 0:b[n])==null?void 0:N[g])||p,C=m.useContext(j);if(C)return C;if(f!==void 0)return f;if(!E)throw new Error(`\`${y}\` must be used within \`${u}\``)}return sa(x,"useContext"),[v,x]}sa(s,"createContext");const c=sa(()=>{const u=l.map(f=>m.createContext(f));return sa(function(p){const g=(p==null?void 0:p[n])||u;return m.useMemo(()=>({[`__scope${n}`]:{...p,[n]:g}}),[p,g])},"useScope")},"createScope");return c.scopeName=n,[s,J0(c,...a)]}sa(kn,"createContextScope");function J0(...n){const a=n[0];if(n.length===1)return a;const l=sa(()=>{const s=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return sa(function(u){const f=s.reduce((p,{useScope:g,scopeName:v})=>{const y=g(u)[`__scope${v}`];return{...p,...y}},{});return m.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])},"useComposedScopes")},"createScope");return l.scopeName=a.scopeName,l}sa(J0,"composeContextScopes");var Xt=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},yN=Object.defineProperty,bN=(n,a)=>yN(n,"name",{value:a,configurable:!0}),tb=Hs[" useEffectEvent ".trim().toString()],nb=Hs[" useInsertionEffect ".trim().toString()];function W0(n){if(typeof tb=="function")return tb(n);const a=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof nb=="function"?nb(()=>{a.current=n}):Xt(()=>{a.current=n}),m.useMemo(()=>((...l)=>{var s;return(s=a.current)==null?void 0:s.call(a,...l)}),[])}bN(W0,"useEffectEvent");var wN=Object.defineProperty,ui=(n,a)=>wN(n,"name",{value:a,configurable:!0}),SN=Hs[" useInsertionEffect ".trim().toString()]||Xt;function yr({prop:n,defaultProp:a,onChange:l=ui(()=>{},"onChange"),caller:s}){const[c,u,f]=e1({defaultProp:a,onChange:l}),p=n!==void 0,g=p?n:c,v=m.useCallback(x=>{var y;if(p){const b=t1(x)?x(n):x;b!==n&&((y=f.current)==null||y.call(f,b))}else u(x)},[p,n,u,f]);return[g,v]}ui(yr,"useControllableState");function e1({defaultProp:n,onChange:a}){const[l,s]=m.useState(n),c=m.useRef(l),u=m.useRef(a);return SN(()=>{u.current=a},[a]),m.useEffect(()=>{var f;c.current!==l&&((f=u.current)==null||f.call(u,l),c.current=l)},[l,c]),[l,s,u]}ui(e1,"useUncontrolledState");function t1(n){return typeof n=="function"}ui(t1,"isFunction");var ab=Symbol("RADIX:SYNC_STATE");function jN(n,a,l,s){const{prop:c,defaultProp:u,onChange:f,caller:p}=a,g=c!==void 0,v=W0(f),x=[{...l,state:u}];s&&x.push(s);const[y,b]=m.useReducer((C,N)=>{if(N.type===ab)return{...C,state:N.state};const M=n(C,N);return g&&!Object.is(M.state,C.state)&&v(M.state),M},...x),w=y.state,E=m.useRef(w);m.useEffect(()=>{E.current!==w&&(E.current=w,g||v(w))},[w,E,g]);const j=m.useMemo(()=>c!==void 0?{...y,state:c}:y,[y,c]);return m.useEffect(()=>{g&&!Object.is(c,y.state)&&b({type:ab,state:c})},[c,y.state,g]),[j,b]}ui(jN,"useControllableStateReducer");var CN=Object.defineProperty,EN=(n,a)=>CN(n,"name",{value:a,configurable:!0}),RN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ve=RN.reduce((n,a)=>{const l=Ha(`Primitive.${a}`),s=m.forwardRef((c,u)=>{const{asChild:f,...p}=c,g=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(g,{...p,ref:u})});return s.displayName=`Primitive.${a}`,{...n,[a]:s}},{});function Bm(n,a){n&&ba.flushSync(()=>n.dispatchEvent(a))}EN(Bm,"dispatchDiscreteCustomEvent");var NN=Object.defineProperty,tn=(n,a)=>NN(n,"name",{value:a,configurable:!0});function Ru(n){const a=n+"CollectionProvider",[l,s]=kn(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=tn(j=>{const{scope:C,children:N}=j,M=m.useRef(null),T=m.useRef(new Map).current;return o.jsx(c,{scope:C,itemMap:T,collectionRef:M,children:N})},"CollectionProvider");f.displayName=a;const p=n+"CollectionSlot",g=Ha(p),v=m.forwardRef((j,C)=>{const{scope:N,children:M}=j,T=u(p,N),D=Xe(C,T.collectionRef);return o.jsx(g,{ref:D,children:M})});v.displayName=p;const x=n+"CollectionItemSlot",y="data-radix-collection-item",b=Ha(x),w=m.forwardRef((j,C)=>{const{scope:N,children:M,...T}=j,D=m.useRef(null),O=Xe(C,D),A=u(x,N);return m.useEffect(()=>(A.itemMap.set(D,{ref:D,...T}),()=>void A.itemMap.delete(D))),o.jsx(b,{[y]:"",ref:O,children:M})});w.displayName=x;function E(j){const C=u(n+"CollectionConsumer",j);return m.useCallback(()=>{const M=C.collectionRef.current;if(!M)return[];const T=Array.from(M.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((A,U)=>T.indexOf(A.ref.current)-T.indexOf(U.ref.current))},[C.collectionRef,C.itemMap])}return tn(E,"useCollection"),[{Provider:f,Slot:v,ItemSlot:w},E,s]}tn(Ru,"createCollection");var rb=new WeakMap,Vt,Vn,bh=(Vn=class extends Map{constructor(l){super(l);Oy(this,Vt);ih(this,Vt,[...super.keys()]),rb.set(this,!0)}set(l,s){return rb.get(this)&&(this.has(l)?un(this,Vt)[un(this,Vt).indexOf(l)]=l:un(this,Vt).push(l)),super.set(l,s),this}insert(l,s,c){const u=this.has(s),f=un(this,Vt).length,p=Hm(l);let g=p>=0?p:f+p;const v=g<0||g>=f?-1:g;if(v===this.size||u&&v===this.size-1||v===-1)return this.set(s,c),this;const x=this.size+(u?0:1);p<0&&g++;const y=[...un(this,Vt)];let b,w=!1;for(let E=g;E<x;E++)if(g===E){let j=y[E];y[E]===s&&(j=y[E+1]),u&&this.delete(s),b=this.get(j),this.set(s,c)}else{!w&&y[E-1]===s&&(w=!0);const j=y[w?E:E-1],C=b;b=this.get(j),this.delete(j),this.set(j,C)}return this}with(l,s,c){const u=new Vn(this);return u.insert(l,s,c),u}before(l){const s=un(this,Vt).indexOf(l)-1;if(!(s<0))return this.entryAt(s)}setBefore(l,s,c){const u=un(this,Vt).indexOf(l);return u===-1?this:this.insert(u,s,c)}after(l){let s=un(this,Vt).indexOf(l);if(s=s===-1||s===this.size-1?-1:s+1,s!==-1)return this.entryAt(s)}setAfter(l,s,c){const u=un(this,Vt).indexOf(l);return u===-1?this:this.insert(u+1,s,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return ih(this,Vt,[]),super.clear()}delete(l){const s=super.delete(l);return s&&un(this,Vt).splice(un(this,Vt).indexOf(l),1),s}deleteAt(l){const s=this.keyAt(l);return s!==void 0?this.delete(s):!1}at(l){const s=Qc(un(this,Vt),l);if(s!==void 0)return this.get(s)}entryAt(l){const s=Qc(un(this,Vt),l);if(s!==void 0)return[s,this.get(s)]}indexOf(l){return un(this,Vt).indexOf(l)}keyAt(l){return Qc(un(this,Vt),l)}from(l,s){const c=this.indexOf(l);if(c===-1)return;let u=c+s;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.at(u)}keyFrom(l,s){const c=this.indexOf(l);if(c===-1)return;let u=c+s;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.keyAt(u)}find(l,s){let c=0;for(const u of this){if(Reflect.apply(l,s,[u,c,this]))return u;c++}}findIndex(l,s){let c=0;for(const u of this){if(Reflect.apply(l,s,[u,c,this]))return c;c++}return-1}filter(l,s){const c=[];let u=0;for(const f of this)Reflect.apply(l,s,[f,u,this])&&c.push(f),u++;return new Vn(c)}map(l,s){const c=[];let u=0;for(const f of this)c.push([f[0],Reflect.apply(l,s,[f,u,this])]),u++;return new Vn(c)}reduce(...l){const[s,c]=l;let u=0,f=c??this.at(0);for(const p of this)u===0&&l.length===1?f=p:f=Reflect.apply(s,this,[f,p,u,this]),u++;return f}reduceRight(...l){const[s,c]=l;let u=c??this.at(-1);for(let f=this.size-1;f>=0;f--){const p=this.at(f);f===this.size-1&&l.length===1?u=p:u=Reflect.apply(s,this,[u,p,f,this])}return u}toSorted(l){const s=[...this.entries()].sort(l);return new Vn(s)}toReversed(){const l=new Vn;for(let s=this.size-1;s>=0;s--){const c=this.keyAt(s),u=this.get(c);l.set(c,u)}return l}toSpliced(...l){const s=[...this.entries()];return s.splice(...l),new Vn(s)}slice(l,s){const c=new Vn;let u=this.size-1;if(l===void 0)return c;l<0&&(l=l+this.size),s!==void 0&&s>0&&(u=s-1);for(let f=l;f<=u;f++){const p=this.keyAt(f),g=this.get(p);c.set(p,g)}return c}every(l,s){let c=0;for(const u of this){if(!Reflect.apply(l,s,[u,c,this]))return!1;c++}return!0}some(l,s){let c=0;for(const u of this){if(Reflect.apply(l,s,[u,c,this]))return!0;c++}return!1}},Vt=new WeakMap,tn(Vn,"OrderedDict"),Vn);function Qc(n,a){if("at"in Array.prototype)return Array.prototype.at.call(n,a);const l=n1(n,a);return l===-1?void 0:n[l]}tn(Qc,"at");function n1(n,a){const l=n.length,s=Hm(a),c=s>=0?s:l+s;return c<0||c>=l?-1:c}tn(n1,"toSafeIndex");function Hm(n){return n!==n||n===0?0:Math.trunc(n)}tn(Hm,"toSafeInteger");function TN(n){const a=n+"CollectionProvider",[l,s]=kn(a),[c,u]=l(a,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new bh,setItemMap:tn(()=>{},"setItemMap")}),f=tn(({state:T,...D})=>T?o.jsx(g,{...D,state:T}):o.jsx(p,{...D}),"CollectionProvider");f.displayName=a;const p=tn(T=>{const D=C();return o.jsx(g,{...T,state:D})},"CollectionInit");p.displayName=a+"Init";const g=tn(T=>{const{scope:D,children:O,state:A}=T,U=m.useRef(null),[k,$]=m.useState(null),X=Xe(U,$),[te,G]=A;return m.useEffect(()=>{if(!k)return;const ie=l1(()=>{});return ie.observe(k,{childList:!0,subtree:!0}),()=>{ie.disconnect()}},[k]),o.jsx(c,{scope:D,itemMap:te,setItemMap:G,collectionRef:X,collectionRefObject:U,collectionElement:k,children:O})},"CollectionProviderImpl");g.displayName=a+"Impl";const v=n+"CollectionSlot",x=Ha(v),y=m.forwardRef((T,D)=>{const{scope:O,children:A}=T,U=u(v,O),k=Xe(D,U.collectionRef);return o.jsx(x,{ref:k,children:A})});y.displayName=v;const b=n+"CollectionItemSlot",w="data-radix-collection-item",E=Ha(b),j=m.forwardRef((T,D)=>{const{scope:O,children:A,...U}=T,k=m.useRef(null),[$,X]=m.useState(null),te=Xe(D,k,X),G=u(b,O),{setItemMap:ie}=G,ce=m.useRef(U);a1(ce.current,U)||(ce.current=U);const se=ce.current;return m.useEffect(()=>{const _=se;return ie(H=>$?H.has($)?H.set($,{..._,element:$}).toSorted(Kh):(H.set($,{..._,element:$}),H.toSorted(Kh)):H),()=>{ie(H=>!$||!H.has($)?H:(H.delete($),new bh(H)))}},[$,se,ie]),o.jsx(E,{[w]:"",ref:te,children:A})});j.displayName=b;function C(){return m.useState(new bh)}tn(C,"useInitCollection");function N(T){const{itemMap:D}=u(n+"CollectionConsumer",T);return D}return tn(N,"useCollection"),[{Provider:f,Slot:y,ItemSlot:j},{createCollectionScope:s,useCollection:N,useInitCollection:C}]}tn(TN,"createCollection");function a1(n,a){if(n===a)return!0;if(typeof n!="object"||typeof a!="object"||n==null||a==null)return!1;const l=Object.keys(n),s=Object.keys(a);if(l.length!==s.length)return!1;for(const c of l)if(!Object.prototype.hasOwnProperty.call(a,c)||n[c]!==a[c])return!1;return!0}tn(a1,"shallowEqual");function r1(n,a){return!!(a.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}tn(r1,"isElementPreceding");function Kh(n,a){return!n[1].element||!a[1].element?0:r1(n[1].element,a[1].element)?-1:1}tn(Kh,"sortByDocumentPosition");function l1(n){return new MutationObserver(l=>{for(const s of l)if(s.type==="childList"){n();return}})}tn(l1,"getChildListObserver");var MN=Object.defineProperty,AN=(n,a)=>MN(n,"name",{value:a,configurable:!0}),DN=m.createContext(void 0);function di(n){const a=m.useContext(DN);return n||a||"ltr"}AN(di,"useDirection");var ON=Object.defineProperty,_N=(n,a)=>ON(n,"name",{value:a,configurable:!0});function ia(n){const a=m.useRef(n);return m.useEffect(()=>{a.current=n}),m.useMemo(()=>((...l)=>{var s;return(s=a.current)==null?void 0:s.call(a,...l)}),[])}_N(ia,"useCallbackRef");var kN=Object.defineProperty,en=(n,a)=>kN(n,"name",{value:a,configurable:!0}),Xh="dismissableLayer.update",zN="dismissableLayer.pointerDownOutside",LN="dismissableLayer.focusOutside",lb,s1=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Nu=m.forwardRef(en(function(a,l){const{disableOutsidePointerEvents:s=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:g,onDismiss:v,...x}=a,y=m.useContext(s1),[b,w]=m.useState(null),E=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=m.useState({}),C=Xe(l,w),N=Array.from(y.layers),[M]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),T=M?N.indexOf(M):-1,D=b?N.indexOf(b):-1,O=y.layersWithOutsidePointerEventsDisabled.size>0,A=D>=T,U=m.useRef(!1),k=i1(G=>{f==null||f(G),g==null||g(G),G.defaultPrevented||v==null||v()},{ownerDocument:E,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:U,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(G=>{if(!(G instanceof Node))return!1;const ie=[...y.branches].some(ce=>ce.contains(G));return A&&!ie},[y.branches,A])}),$=c1(G=>{if(c&&U.current)return;const ie=G.target;[...y.branches].some(se=>se.contains(ie))||(p==null||p(G),g==null||g(G),G.defaultPrevented||v==null||v())},E),X=b?D===N.length-1:!1,te=ia(G=>{G.key==="Escape"&&(u==null||u(G),!G.defaultPrevented&&v&&(G.preventDefault(),v()))});return m.useEffect(()=>{if(X)return E.addEventListener("keydown",te,{capture:!0}),()=>E.removeEventListener("keydown",te,{capture:!0})},[E,X,te]),m.useEffect(()=>{if(b)return s&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(lb=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(b)),y.layers.add(b),Fh(),()=>{s&&(y.layersWithOutsidePointerEventsDisabled.delete(b),y.layersWithOutsidePointerEventsDisabled.size===0&&(E.body.style.pointerEvents=lb))}},[b,E,s,y]),m.useEffect(()=>()=>{b&&(y.layers.delete(b),y.layersWithOutsidePointerEventsDisabled.delete(b),Fh())},[b,y]),m.useEffect(()=>{const G=en(()=>j({}),"handleUpdate");return document.addEventListener(Xh,G),()=>document.removeEventListener(Xh,G)},[]),o.jsx(Ve.div,{...x,ref:C,style:{pointerEvents:O?A?"auto":"none":void 0,...a.style},onFocusCapture:Ne(a.onFocusCapture,$.onFocusCapture),onBlurCapture:Ne(a.onBlurCapture,$.onBlurCapture),onPointerDownCapture:Ne(a.onPointerDownCapture,k.onPointerDownCapture)})},"DismissableLayer"));function o1(){const n=m.useContext(s1),[a,l]=m.useState(null);return m.useEffect(()=>{if(a)return n.dismissableSurfaces.add(a),()=>{n.dismissableSurfaces.delete(a)}},[a,n.dismissableSurfaces]),l}en(o1,"useDismissableLayerSurface");var UN=en(()=>!0,"IS_TRUE");function i1(n,a){const{ownerDocument:l=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:s=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:u,shouldHandlePointerDownOutside:f=UN}=a,p=ia(n),g=m.useRef(!1),v=m.useRef(!1),x=m.useRef(new Map),y=m.useRef(()=>{});return m.useEffect(()=>{function b(){v.current=!1,c.current=!1,x.current.clear()}en(b,"resetOutsideInteraction");function w(){return Array.from(x.current.values()).some(Boolean)}en(w,"isOutsideInteractionIntercepted");function E(T){if(!v.current)return;const D=T.target;D instanceof Node&&[...u].some(A=>A.contains(D))||x.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{v.current&&y.current()},0)}en(E,"handleInteractionCapture");function j(T){v.current&&x.current.set(T.type,!1)}en(j,"handleInteractionBubble");const C=en(T=>{if(T.target&&!g.current){let D=function(){l.removeEventListener("click",y.current);const A=w();b(),A||Im(zN,p,O,{discrete:!0})};if(en(D,"handleAndDispatchPointerDownOutsideEvent"),!f(T.target)){l.removeEventListener("click",y.current),b(),g.current=!1;return}const O={originalEvent:T};v.current=!0,c.current=s&&T.button===0,x.current.clear(),!s||T.button!==0?D():(l.removeEventListener("click",y.current),y.current=D,l.addEventListener("click",y.current,{once:!0}))}else l.removeEventListener("click",y.current),b();g.current=!1},"handlePointerDown"),N=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of N)l.addEventListener(T,E,!0),l.addEventListener(T,j);const M=window.setTimeout(()=>{l.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(M),l.removeEventListener("pointerdown",C),l.removeEventListener("click",y.current);for(const T of N)l.removeEventListener(T,E,!0),l.removeEventListener(T,j)}},[l,p,s,c,u,f]),{onPointerDownCapture:en(()=>g.current=!0,"onPointerDownCapture")}}en(i1,"usePointerDownOutside");function c1(n,a=globalThis==null?void 0:globalThis.document){const l=ia(n),s=m.useRef(!1);return m.useEffect(()=>{const c=en(u=>{u.target&&!s.current&&Im(LN,l,{originalEvent:u},{discrete:!1})},"handleFocus");return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:en(()=>s.current=!0,"onFocusCapture"),onBlurCapture:en(()=>s.current=!1,"onBlurCapture")}}en(c1,"useFocusOutside");function Fh(){const n=new CustomEvent(Xh);document.dispatchEvent(n)}en(Fh,"dispatchUpdate");function Im(n,a,l,{discrete:s}){const c=l.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(n,a,{once:!0}),s?Bm(c,u):c.dispatchEvent(u)}en(Im,"handleAndDispatchCustomEvent");var BN=Object.defineProperty,Pm=(n,a)=>BN(n,"name",{value:a,configurable:!0}),_c=0,_a=null;function HN(n){return fi(),n.children}Pm(HN,"FocusGuards");function fi(){m.useEffect(()=>{_a||(_a={start:Qh(),end:Qh()});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),_c++,()=>{_c===1&&(_a==null||_a.start.remove(),_a==null||_a.end.remove(),_a=null),_c=Math.max(0,_c-1)}},[])}Pm(fi,"useFocusGuards");function Qh(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}Pm(Qh,"createFocusGuard");var IN=Object.defineProperty,pn=(n,a)=>IN(n,"name",{value:a,configurable:!0}),wh="focusScope.autoFocusOnMount",Sh="focusScope.autoFocusOnUnmount",sb={bubbles:!1,cancelable:!0},qm=m.forwardRef(pn(function(a,l){const{loop:s=!1,trapped:c=!1,onMountAutoFocus:u,onUnmountAutoFocus:f,...p}=a,[g,v]=m.useState(null),x=ia(u),y=ia(f),b=m.useRef(null),w=Xe(l,v),E=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(c){let C=function(D){if(E.paused||!g)return;const O=D.target;g.contains(O)?b.current=O:hr(b.current,{select:!0})},N=function(D){if(E.paused||!g)return;const O=D.relatedTarget;O!==null&&(g.contains(O)||hr(b.current,{select:!0}))},M=function(D){if(document.activeElement===document.body)for(const A of D)A.removedNodes.length>0&&hr(g)};pn(C,"handleFocusIn"),pn(N,"handleFocusOut"),pn(M,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",N);const T=new MutationObserver(M);return g&&T.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",N),T.disconnect()}}},[c,g,E.paused]),m.useEffect(()=>{if(g){ob.add(E);const C=document.activeElement;if(!g.contains(C)){const M=new CustomEvent(wh,sb);g.addEventListener(wh,x),g.dispatchEvent(M),M.defaultPrevented||(u1(p1(Vm(g)),{select:!0}),document.activeElement===C&&hr(g))}return()=>{g.removeEventListener(wh,x),setTimeout(()=>{const M=new CustomEvent(Sh,sb);g.addEventListener(Sh,y),g.dispatchEvent(M),M.defaultPrevented||hr(C??document.body,{select:!0}),g.removeEventListener(Sh,y),ob.remove(E)},0)}}},[g,x,y,E]);const j=m.useCallback(C=>{if(!s&&!c||E.paused)return;const N=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,M=document.activeElement;if(N&&M){const T=C.currentTarget,[D,O]=d1(T);D&&O?!C.shiftKey&&M===O?(C.preventDefault(),s&&hr(D,{select:!0})):C.shiftKey&&M===D&&(C.preventDefault(),s&&hr(O,{select:!0})):M===T&&C.preventDefault()}},[s,c,E.paused]);return o.jsx(Ve.div,{tabIndex:-1,...p,ref:w,onKeyDown:j})},"FocusScope"));function u1(n,{select:a=!1}={}){const l=document.activeElement;for(const s of n)if(hr(s,{select:a}),document.activeElement!==l)return}pn(u1,"focusFirst");function d1(n){const a=Vm(n),l=Zh(a,n),s=Zh(a.reverse(),n);return[l,s]}pn(d1,"getTabbableEdges");function Vm(n){const a=[],l=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:pn(s=>{const c=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||c?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;l.nextNode();)a.push(l.currentNode);return a}pn(Vm,"getTabbableCandidates");function Zh(n,a){const l=typeof a.checkVisibility=="function"&&a.checkVisibility({checkVisibilityCSS:!0});for(const s of n)if(!(l?!s.checkVisibility({checkVisibilityCSS:!0}):f1(s,{upTo:a})))return s}pn(Zh,"findVisible");function f1(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}pn(f1,"isHidden");function h1(n){return n instanceof HTMLInputElement&&"select"in n}pn(h1,"isSelectableInput");function hr(n,{select:a=!1}={}){if(n&&n.focus){const l=document.activeElement;n.focus({preventScroll:!0}),n!==l&&h1(n)&&a&&n.select()}}pn(hr,"focus");var ob=m1();function m1(){let n=[];return{add(a){const l=n[0];a!==l&&(l==null||l.pause()),n=Jh(n,a),n.unshift(a)},remove(a){var l;n=Jh(n,a),(l=n[0])==null||l.resume()}}}pn(m1,"createFocusScopesStack");function Jh(n,a){const l=[...n],s=l.indexOf(a);return s!==-1&&l.splice(s,1),l}pn(Jh,"arrayRemove");function p1(n){return n.filter(a=>a.tagName!=="A")}pn(p1,"removeLinks");var PN=Object.defineProperty,qN=(n,a)=>PN(n,"name",{value:a,configurable:!0}),VN=Hs[" useId ".trim().toString()]||(()=>{}),$N=0;function La(n){const[a,l]=m.useState(VN());return Xt(()=>{n||l(s=>s??String($N++))},[n]),n||(a?`radix-${a}`:"")}qN(La,"useId");const YN=["top","right","bottom","left"],sl=Math.min,pr=Math.max,lu=Math.round,kc=Math.floor,gr=n=>({x:n,y:n}),GN={left:"right",right:"left",bottom:"top",top:"bottom"};function g1(n,a,l){return pr(n,sl(a,l))}function br(n,a){return typeof n=="function"?n(a):n}function ol(n){return n.split("-")[0]}function Ys(n){return n.split("-")[1]}function $m(n){return n==="x"?"y":"x"}function Ym(n){return n==="y"?"height":"width"}function za(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function Gm(n){return $m(za(n))}function KN(n,a,l){l===void 0&&(l=!1);const s=Ys(n),c=Gm(n),u=Ym(c);let f=c==="x"?s===(l?"end":"start")?"right":"left":s==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=su(f)),[f,su(f)]}function XN(n){const a=su(n);return[Wh(n),a,Wh(a)]}function Wh(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const ib=["left","right"],cb=["right","left"],FN=["top","bottom"],QN=["bottom","top"];function ZN(n,a,l){switch(n){case"top":case"bottom":return l?a?cb:ib:a?ib:cb;case"left":case"right":return a?FN:QN;default:return[]}}function JN(n,a,l,s){const c=Ys(n);let u=ZN(ol(n),l==="start",s);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(Wh)))),u}function su(n){const a=ol(n);return GN[a]+n.slice(a.length)}function WN(n){var a,l,s,c;return{top:(a=n.top)!=null?a:0,right:(l=n.right)!=null?l:0,bottom:(s=n.bottom)!=null?s:0,left:(c=n.left)!=null?c:0}}function v1(n){return typeof n!="number"?WN(n):{top:n,right:n,bottom:n,left:n}}function ou(n){const{x:a,y:l,width:s,height:c}=n;return{width:s,height:c,top:l,left:a,right:a+s,bottom:l+c,x:a,y:l}}function ub(n,a,l){let{reference:s,floating:c}=n;const u=za(a),f=Gm(a),p=Ym(f),g=ol(a),v=u==="y",x=s.x+s.width/2-c.width/2,y=s.y+s.height/2-c.height/2,b=s[p]/2-c[p]/2;let w;switch(g){case"top":w={x,y:s.y-c.height};break;case"bottom":w={x,y:s.y+s.height};break;case"right":w={x:s.x+s.width,y};break;case"left":w={x:s.x-c.width,y};break;default:w={x:s.x,y:s.y}}const E=Ys(a);return E&&(w[f]+=b*(E==="end"?1:-1)*(l&&v?-1:1)),w}async function eT(n,a){var l;a===void 0&&(a={});const{x:s,y:c,platform:u,rects:f,elements:p,strategy:g}=n,{boundary:v="clippingAncestors",rootBoundary:x="viewport",elementContext:y="floating",altBoundary:b=!1,padding:w=0}=br(a,n),E=v1(w),C=p[b?y==="floating"?"reference":"floating":y],N=ou(await u.getClippingRect({element:(l=await(u.isElement==null?void 0:u.isElement(C)))==null||l?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(p.floating)),boundary:v,rootBoundary:x,strategy:g})),M=y==="floating"?{x:s,y:c,width:f.floating.width,height:f.floating.height}:f.reference,T=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),D=await(u.isElement==null?void 0:u.isElement(T))&&await(u.getScale==null?void 0:u.getScale(T))||{x:1,y:1},O=ou(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:M,offsetParent:T,strategy:g}):M);return{top:(N.top-O.top+E.top)/D.y,bottom:(O.bottom-N.bottom+E.bottom)/D.y,left:(N.left-O.left+E.left)/D.x,right:(O.right-N.right+E.right)/D.x}}const tT=50,nT=async(n,a,l)=>{const{placement:s="bottom",strategy:c="absolute",middleware:u=[],platform:f}=l,p=f.detectOverflow?f:{...f,detectOverflow:eT},g=await(f.isRTL==null?void 0:f.isRTL(a));let v=await f.getElementRects({reference:n,floating:a,strategy:c}),{x,y}=ub(v,s,g),b=s,w=0;const E={};for(let j=0;j<u.length;j++){const C=u[j];if(!C)continue;const{name:N,fn:M}=C,{x:T,y:D,data:O,reset:A}=await M({x,y,initialPlacement:s,placement:b,strategy:c,middlewareData:E,rects:v,platform:p,elements:{reference:n,floating:a}});x=T??x,y=D??y,E[N]={...E[N],...O},A&&w<tT&&(w++,typeof A=="object"&&(A.placement&&(b=A.placement),A.rects&&(v=A.rects===!0?await f.getElementRects({reference:n,floating:a,strategy:c}):A.rects),{x,y}=ub(v,b,g)),j=-1)}return{x,y,placement:b,strategy:c,middlewareData:E}},aT=n=>({name:"arrow",options:n,async fn(a){const{x:l,y:s,placement:c,rects:u,platform:f,elements:p,middlewareData:g}=a,{element:v,padding:x=0}=br(n,a)||{};if(v==null)return{};const y=v1(x),b={x:l,y:s},w=Gm(c),E=Ym(w),j=await f.getDimensions(v),C=w==="y",N=C?"top":"left",M=C?"bottom":"right",T=C?"clientHeight":"clientWidth",D=u.reference[E]+u.reference[w]-b[w]-u.floating[E],O=b[w]-u.reference[w],A=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v));let U=A?A[T]:0;(!U||!await(f.isElement==null?void 0:f.isElement(A)))&&(U=p.floating[T]||u.floating[E]);const k=D/2-O/2,$=U/2-j[E]/2-1,X=sl(y[N],$),te=sl(y[M],$),G=U-j[E]-te,ie=U/2-j[E]/2+k,ce=g1(X,ie,G),se=!g.arrow&&Ys(c)!=null&&ie!==ce&&u.reference[E]/2-(ie<X?X:te)-j[E]/2<0,_=se?ie<X?ie-X:ie-G:0;return{[w]:b[w]+_,data:{[w]:ce,centerOffset:ie-ce-_,...se&&{alignmentOffset:_}},reset:se}}}),rT=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var l,s;const{placement:c,middlewareData:u,rects:f,initialPlacement:p,platform:g,elements:v}=a,{mainAxis:x=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:j=!0,...C}=br(n,a);if((l=u.arrow)!=null&&l.alignmentOffset)return{};const N=ol(c),M=za(p),T=ol(p)===p,D=await(g.isRTL==null?void 0:g.isRTL(v.floating)),O=b||(T||!j?[su(p)]:XN(p)),A=E!=="none";!b&&A&&O.push(...JN(p,j,E,D));const U=[p,...O],k=await g.detectOverflow(a,C),$=[];let X=((s=u.flip)==null?void 0:s.overflows)||[];if(x&&$.push(k[N]),y){const ce=KN(c,f,D);$.push(k[ce[0]],k[ce[1]])}if(X=[...X,{placement:c,overflows:$}],!$.every(ce=>ce<=0)){var te,G;const ce=(((te=u.flip)==null?void 0:te.index)||0)+1,se=U[ce];if(se&&(!(y==="alignment"?M!==za(se):!1)||X.every(Q=>za(Q.placement)===M?Q.overflows[0]>0:!0)))return{data:{index:ce,overflows:X},reset:{placement:se}};let _=(G=X.filter(H=>H.overflows[0]<=0).sort((H,Q)=>H.overflows[1]-Q.overflows[1])[0])==null?void 0:G.placement;if(!_)switch(w){case"bestFit":{var ie;const H=(ie=X.filter(Q=>{if(A){const J=za(Q.placement);return J===M||J==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(J=>J>0).reduce((J,ee)=>J+ee,0)]).sort((Q,J)=>Q[1]-J[1])[0])==null?void 0:ie[0];H&&(_=H);break}case"initialPlacement":_=p;break}if(c!==_)return{reset:{placement:_}}}return{}}}};function db(n,a){return{top:n.top-a.height,right:n.right-a.width,bottom:n.bottom-a.height,left:n.left-a.width}}function fb(n){return YN.some(a=>n[a]>=0)}const lT=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(a){const{rects:l,platform:s}=a,{strategy:c="referenceHidden",...u}=br(n,a);switch(c){case"referenceHidden":{const f=await s.detectOverflow(a,{...u,elementContext:"reference"}),p=db(f,l.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:fb(p)}}}case"escaped":{const f=await s.detectOverflow(a,{...u,altBoundary:!0}),p=db(f,l.floating);return{data:{escapedOffsets:p,escaped:fb(p)}}}default:return{}}}}},x1=new Set(["left","top"]);async function sT(n,a){const{placement:l,platform:s,elements:c}=n,u=await(s.isRTL==null?void 0:s.isRTL(c.floating)),f=ol(l),p=Ys(l),g=za(l)==="y",v=x1.has(f)?-1:1,x=u&&g?-1:1,y=br(a,n);let{mainAxis:b,crossAxis:w,alignmentAxis:E}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof E=="number"&&(w=p==="end"?E*-1:E),g?{x:w*x,y:b*v}:{x:b*v,y:w*x}}const oT=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var l,s;const{x:c,y:u,placement:f,middlewareData:p}=a,g=await sT(a,n);return f===((l=p.offset)==null?void 0:l.placement)&&(s=p.arrow)!=null&&s.alignmentOffset?{}:{x:c+g.x,y:u+g.y,data:{...g,placement:f}}}}},iT=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(a){const{x:l,y:s,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:g={fn:M=>{let{x:T,y:D}=M;return{x:T,y:D}}},...v}=br(n,a),x={x:l,y:s},y=await u.detectOverflow(a,v),b=za(c),w=$m(b);let E=x[w],j=x[b];const C=(M,T)=>g1(T+y[M==="y"?"top":"left"],T,T-y[M==="y"?"bottom":"right"]);f&&(E=C(w,E)),p&&(j=C(b,j));const N=g.fn({...a,[w]:E,[b]:j});return{...N,data:{x:N.x-l,y:N.y-s,enabled:{[w]:f,[b]:p}}}}}},cT=function(n){return n===void 0&&(n={}),{options:n,fn(a){var l,s;const{x:c,y:u,placement:f,rects:p,middlewareData:g}=a,{offset:v=0,mainAxis:x=!0,crossAxis:y=!0}=br(n,a),b={x:c,y:u},w=za(f),E=$m(w);let j=b[E],C=b[w];const N=br(v,a),M=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:(l=N.mainAxis)!=null?l:0,crossAxis:(s=N.crossAxis)!=null?s:0};if(x){const O=E==="y"?"height":"width",A=p.reference[E]-p.floating[O]+M.mainAxis,U=p.reference[E]+p.reference[O]-M.mainAxis;j<A?j=A:j>U&&(j=U)}if(y){var T,D;const O=E==="y"?"width":"height",A=x1.has(ol(f)),U=p.reference[w]-p.floating[O]+(A&&((T=g.offset)==null?void 0:T[w])||0)+(A?0:M.crossAxis),k=p.reference[w]+p.reference[O]+(A?0:((D=g.offset)==null?void 0:D[w])||0)-(A?M.crossAxis:0);C<U?C=U:C>k&&(C=k)}return{[E]:j,[w]:C}}}},uT=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(a){const{placement:l,rects:s,platform:c,elements:u}=a,{apply:f=()=>{},...p}=br(n,a),g=await c.detectOverflow(a,p),v=ol(l),x=Ys(l),y=za(l)==="y",{width:b,height:w}=s.floating;let E,j;v==="top"||v==="bottom"?(E=v,j=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(j=v,E=x==="end"?"top":"bottom");const C=w-g.top-g.bottom,N=b-g.left-g.right,M=sl(w-g[E],C),T=sl(b-g[j],N),D=a.middlewareData.shift,O=!D;let A=M,U=T;D!=null&&D.enabled.x&&(U=N),D!=null&&D.enabled.y&&(A=C),O&&!x&&(y?U=b-2*pr(g.left,g.right):A=w-2*pr(g.top,g.bottom)),await f({...a,availableWidth:U,availableHeight:A});const k=await c.getDimensions(u.floating);return b!==k.width||w!==k.height?{reset:{rects:!0}}:{}}}};function Tu(){return typeof window<"u"}function Gs(n){return y1(n)?(n.nodeName||"").toLowerCase():"#document"}function On(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function jr(n){var a;return(a=(y1(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function y1(n){return Tu()?n instanceof Node||n instanceof On(n).Node:!1}function Ia(n){return Tu()?n instanceof Element||n instanceof On(n).Element:!1}function cl(n){return Tu()?n instanceof HTMLElement||n instanceof On(n).HTMLElement:!1}function hb(n){return!Tu()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof On(n).ShadowRoot}function Mu(n){const{overflow:a,overflowX:l,overflowY:s,display:c}=Pa(n);return/auto|scroll|overlay|hidden|clip/.test(a+s+l)&&c!=="inline"&&c!=="contents"}function dT(n){return/^(table|td|th)$/.test(Gs(n))}function Au(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const fT=/transform|translate|scale|rotate|perspective|filter/,hT=/paint|layout|strict|content/,Ml=n=>!!n&&n!=="none";let jh;function Km(n){const a=Ia(n)?Pa(n):n;return Ml(a.transform)||Ml(a.translate)||Ml(a.scale)||Ml(a.rotate)||Ml(a.perspective)||!Xm()&&(Ml(a.backdropFilter)||Ml(a.filter))||fT.test(a.willChange||"")||hT.test(a.contain||"")}function mT(n){let a=_l(n);for(;cl(a)&&!Jo(a);){if(Km(a))return a;if(Au(a))return null;a=_l(a)}return null}function Xm(){return jh==null&&(jh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),jh}function Jo(n){return/^(html|body|#document)$/.test(Gs(n))}function Pa(n){return On(n).getComputedStyle(n)}function Du(n){return Ia(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function _l(n){if(Gs(n)==="html")return n;const a=n.assignedSlot||n.parentNode||hb(n)&&n.host||jr(n);return hb(a)?a.host:a}function b1(n){const a=_l(n);return Jo(a)?(n.ownerDocument||n).body:cl(a)&&Mu(a)?a:b1(a)}function Wo(n,a,l){var s;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=b1(n),u=c===((s=n.ownerDocument)==null?void 0:s.body),f=On(c);if(u){const p=em(f);return a.concat(f,f.visualViewport||[],Mu(c)?c:[],p&&l?Wo(p):[])}else return a.concat(c,Wo(c,[],l))}function em(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function w1(n){const a=Pa(n);let l=parseFloat(a.width)||0,s=parseFloat(a.height)||0;const c=cl(n),u=c?n.offsetWidth:l,f=c?n.offsetHeight:s,p=lu(l)!==u||lu(s)!==f;return p&&(l=u,s=f),{width:l,height:s,$:p}}function Fm(n){return Ia(n)?n:n.contextElement}function zs(n){const a=Fm(n);if(!cl(a))return gr(1);const l=a.getBoundingClientRect(),{width:s,height:c,$:u}=w1(a);let f=(u?lu(l.width):l.width)/s,p=(u?lu(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const pT=gr(0);function S1(n){const a=On(n);return!Xm()||!a.visualViewport?pT:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function gT(n,a,l){return a===void 0&&(a=!1),!!l&&a&&l===On(n)}function kl(n,a,l,s){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),u=Fm(n);let f=gr(1);a&&(s?Ia(s)&&(f=zs(s)):f=zs(n));const p=gT(u,l,s)?S1(u):gr(0);let g=(c.left+p.x)/f.x,v=(c.top+p.y)/f.y,x=c.width/f.x,y=c.height/f.y;if(u&&s){const b=On(u),w=Ia(s)?On(s):s;let E=b,j=em(E);for(;j&&w!==E;){const C=zs(j),N=j.getBoundingClientRect(),M=Pa(j),T=N.left+(j.clientLeft+parseFloat(M.paddingLeft))*C.x,D=N.top+(j.clientTop+parseFloat(M.paddingTop))*C.y;g*=C.x,v*=C.y,x*=C.x,y*=C.y,g+=T,v+=D,E=On(j),j=em(E)}}return ou({width:x,height:y,x:g,y:v})}function Ou(n,a){const l=Du(n).scrollLeft;return a?a.left+l:kl(jr(n)).left+l}function j1(n,a){const l=n.getBoundingClientRect(),s=l.left+a.scrollLeft-Ou(n,l),c=l.top+a.scrollTop;return{x:s,y:c}}function vT(n){let{elements:a,rect:l,offsetParent:s,strategy:c}=n;const u=c==="fixed",f=jr(s),p=a?Au(a.floating):!1;if(s===f||p&&u)return l;let g={scrollLeft:0,scrollTop:0},v=gr(1);const x=gr(0),y=cl(s);if((y||!u)&&((Gs(s)!=="body"||Mu(f))&&(g=Du(s)),y)){const w=kl(s);v=zs(s),x.x=w.x+s.clientLeft,x.y=w.y+s.clientTop}const b=f&&!y&&!u?j1(f,g):gr(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 xT(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function yT(n){const a=Du(n),l=n.ownerDocument.body,s=pr(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),c=pr(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let u=-a.scrollLeft+Ou(n);const f=-a.scrollTop;return Pa(l).direction==="rtl"&&(u+=pr(n.clientWidth,l.clientWidth)-s),{width:s,height:c,x:u,y:f}}const bT=25;function wT(n,a,l){l===void 0&&(l="viewport");const s=l==="layoutViewport",c=On(n),u=jr(n),f=c.visualViewport;let p=u.clientWidth,g=u.clientHeight,v=0,x=0;if(f){const b=!Xm()||a==="fixed";s?b||(v=-f.offsetLeft,x=-f.offsetTop):(p=f.width,g=f.height,b&&(v=f.offsetLeft,x=f.offsetTop))}if(Ou(u)<=0){const b=u.ownerDocument,w=b.body,E=getComputedStyle(w),j=b.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,C=Math.abs(u.clientWidth-w.clientWidth-j),N=getComputedStyle(u).scrollbarGutter==="stable both-edges"?C/2:C;N<=bT&&(p-=N)}return{width:p,height:g,x:v,y:x}}function ST(n,a){const l=kl(n,!0,a==="fixed"),s=l.top+n.clientTop,c=l.left+n.clientLeft,u=zs(n),f=n.clientWidth*u.x,p=n.clientHeight*u.y,g=c*u.x,v=s*u.y;return{width:f,height:p,x:g,y:v}}function mb(n,a,l){let s;if(a==="viewport"||a==="layoutViewport")s=wT(n,l,a);else if(a==="document")s=yT(jr(n));else if(Ia(a))s=ST(a,l);else{const c=S1(n);s={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return ou(s)}function jT(n,a){const l=a.get(n);if(l)return l;let s=Wo(n,[],!1).filter(p=>Ia(p)&&Gs(p)!=="body"),c=null;const u=Pa(n).position==="fixed";let f=u?_l(n):n;for(;Ia(f)&&!Jo(f);){const p=Pa(f),g=Km(f),v=c?c.position:u?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&p.position==="static")?s=s.filter(y=>y!==f):c=p,f=_l(f)}return a.set(n,s),s}function CT(n){let{element:a,boundary:l,rootBoundary:s,strategy:c}=n;const f=[...l==="clippingAncestors"?Au(a)?[]:jT(a,this._c):[].concat(l),s],p=mb(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=mb(a,f[b],c);g=pr(w.top,g),v=sl(w.right,v),x=sl(w.bottom,x),y=pr(w.left,y)}return{width:v-y,height:x-g,x:y,y:g}}function ET(n){const{width:a,height:l}=w1(n);return{width:a,height:l}}function RT(n,a,l){const s=cl(a),c=jr(a),u=l==="fixed",f=kl(n,!0,u,a);let p={scrollLeft:0,scrollTop:0};const g=gr(0);if((s||!u)&&((Gs(a)!=="body"||Mu(c))&&(p=Du(a)),s)){const b=kl(a,!0,u,a);g.x=b.x+a.clientLeft,g.y=b.y+a.clientTop}!s&&c&&(g.x=Ou(c));const v=c&&!s&&!u?j1(c,p):gr(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 Ch(n){return Pa(n).position==="static"}function pb(n,a){if(!cl(n)||Pa(n).position==="fixed")return null;if(a)return a(n);let l=n.offsetParent;return jr(n)===l&&(l=l.ownerDocument.body),l}function C1(n,a){const l=On(n);if(Au(n))return l;if(!cl(n)){let c=_l(n);for(;c&&!Jo(c);){if(Ia(c)&&!Ch(c))return c;c=_l(c)}return l}let s=pb(n,a);for(;s&&dT(s)&&Ch(s);)s=pb(s,a);return s&&Jo(s)&&Ch(s)&&!Km(s)?l:s||mT(n)||l}const NT=async function(n){const a=this.getOffsetParent||C1,l=this.getDimensions,s=await l(n.floating);return{reference:RT(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function TT(n){return Pa(n).direction==="rtl"}const MT={convertOffsetParentRelativeRectToViewportRelativeRect:vT,getDocumentElement:jr,getClippingRect:CT,getOffsetParent:C1,getElementRects:NT,getClientRects:xT,getDimensions:ET,getScale:zs,isElement:Ia,isRTL:TT};function E1(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function AT(n,a,l){let s=null,c;const u=jr(n);function f(){var x;clearTimeout(c),(x=s)==null||x.disconnect(),s=null}function p(x,y){x===void 0&&(x=!1),y===void 0&&(y=1),f();const b=n.getBoundingClientRect(),{left:w,top:E,width:j,height:C}=b;if(x||a(),!j||!C)return;const N=kc(E),M=kc(u.clientWidth-(w+j)),T=kc(u.clientHeight-(E+C)),D=kc(w),A={rootMargin:-N+"px "+-M+"px "+-T+"px "+-D+"px",threshold:pr(0,sl(1,y))||1};let U=!0;function k($){const X=$[0].intersectionRatio;if(!E1(b,n.getBoundingClientRect()))return p();if(X!==y){if(!U)return p();X?p(!1,X):c=setTimeout(()=>{p(!1,1e-7)},1e3)}U=!1}try{s=new IntersectionObserver(k,{...A,root:u.ownerDocument})}catch{s=new IntersectionObserver(k,A)}s.observe(n)}const g=On(n),v=()=>p(l);return g.addEventListener("resize",v),p(!0),()=>{g.removeEventListener("resize",v),f()}}function DT(n,a,l,s){s===void 0&&(s={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=s,v=Fm(n),x=c||u?[...v?Wo(v):[],...a?Wo(a):[]]:[];x.forEach(N=>{c&&N.addEventListener("scroll",l),u&&N.addEventListener("resize",l)});const y=v&&p?AT(v,l,u):null;let b=-1,w=null;f&&(w=new ResizeObserver(N=>{let[M]=N;M&&M.target===v&&w&&a&&(w.unobserve(a),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var T;(T=w)==null||T.observe(a)})),l()}),v&&!g&&w.observe(v),a&&w.observe(a));let E,j=g?kl(n):null;g&&C();function C(){const N=kl(n);j&&!E1(j,N)&&l(),j=N,E=requestAnimationFrame(C)}return l(),()=>{var N;x.forEach(M=>{c&&M.removeEventListener("scroll",l),u&&M.removeEventListener("resize",l)}),y==null||y(),(N=w)==null||N.disconnect(),w=null,g&&cancelAnimationFrame(E)}}const OT=oT,_T=iT,kT=rT,zT=uT,LT=lT,gb=aT,UT=cT,BT=(n,a,l)=>{const s=new Map,c=l??{},u={...MT,...c.platform,_c:s};return nT(n,a,{...c,platform:u})};var HT=typeof document<"u",IT=function(){},Zc=HT?m.useLayoutEffect:IT;function iu(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(typeof n=="function"&&n.toString()===a.toString())return!0;let l,s,c;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==a.length)return!1;for(s=l;s--!==0;)if(!iu(n[s],a[s]))return!1;return!0}if(c=Object.keys(n),l=c.length,l!==Object.keys(a).length)return!1;for(s=l;s--!==0;)if(!{}.hasOwnProperty.call(a,c[s]))return!1;for(s=l;s--!==0;){const u=c[s];if(!(u==="_owner"&&n.$$typeof)&&!iu(n[u],a[u]))return!1}return!0}return n!==n&&a!==a}function R1(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function vb(n,a){const l=R1(n);return Math.round(a*l)/l}function Eh(n){const a=m.useRef(n);return Zc(()=>{a.current=n}),a}function PT(n){n===void 0&&(n={});const{placement:a="bottom",strategy:l="absolute",middleware:s=[],platform:c,elements:{reference:u,floating:f}={},transform:p=!0,whileElementsMounted:g,open:v}=n,[x,y]=m.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[b,w]=m.useState(s);iu(b,s)||w(s);const[E,j]=m.useState(null),[C,N]=m.useState(null),M=m.useCallback(Q=>{Q!==A.current&&(A.current=Q,j(Q))},[]),T=m.useCallback(Q=>{Q!==U.current&&(U.current=Q,N(Q))},[]),D=u||E,O=f||C,A=m.useRef(null),U=m.useRef(null),k=m.useRef(x),$=g!=null,X=Eh(g),te=Eh(c),G=Eh(v),ie=m.useCallback(()=>{if(!A.current||!U.current)return;const Q={placement:a,strategy:l,middleware:b};te.current&&(Q.platform=te.current),BT(A.current,U.current,Q).then(J=>{const ee={...J,isPositioned:G.current!==!1};ce.current&&!iu(k.current,ee)&&(k.current=ee,ba.flushSync(()=>{y(ee)}))})},[b,a,l,te,G]);Zc(()=>{v===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,y(Q=>({...Q,isPositioned:!1})))},[v]);const ce=m.useRef(!1);Zc(()=>(ce.current=!0,()=>{ce.current=!1}),[]),Zc(()=>{if(D&&(A.current=D),O&&(U.current=O),D&&O){if(X.current)return X.current(D,O,ie);ie()}},[D,O,ie,X,$]);const se=m.useMemo(()=>({reference:A,floating:U,setReference:M,setFloating:T}),[M,T]),_=m.useMemo(()=>({reference:D,floating:O}),[D,O]),H=m.useMemo(()=>{const Q={position:l,left:0,top:0};if(!_.floating)return Q;const J=vb(_.floating,x.x),ee=vb(_.floating,x.y);return p?{...Q,transform:"translate("+J+"px, "+ee+"px)",...R1(_.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:J,top:ee}},[l,p,_.floating,x.x,x.y]);return m.useMemo(()=>({...x,update:ie,refs:se,elements:_,floatingStyles:H}),[x,ie,se,_,H])}const qT=n=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:s,padding:c}=typeof n=="function"?n(l):n;return s&&a(s)?s.current!=null?gb({element:s.current,padding:c}).fn(l):{}:s?gb({element:s,padding:c}).fn(l):{}}}},VT=(n,a)=>{const l=OT(n);return{name:l.name,fn:l.fn,options:[n,a]}},$T=(n,a)=>{const l=_T(n);return{name:l.name,fn:l.fn,options:[n,a]}},YT=(n,a)=>({fn:UT(n).fn,options:[n,a]}),GT=(n,a)=>{const l=kT(n);return{name:l.name,fn:l.fn,options:[n,a]}},KT=(n,a)=>{const l=zT(n);return{name:l.name,fn:l.fn,options:[n,a]}},XT=(n,a)=>{const l=LT(n);return{name:l.name,fn:l.fn,options:[n,a]}},FT=(n,a)=>{const l=qT(n);return{name:l.name,fn:l.fn,options:[n,a]}};var QT=Object.defineProperty,ZT=(n,a)=>QT(n,"name",{value:a,configurable:!0});function _u(n){const[a,l]=m.useState(void 0);return Xt(()=>{if(n){l({width:n.offsetWidth,height:n.offsetHeight});const s=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let f,p;if("borderBoxSize"in u){const g=u.borderBoxSize,v=Array.isArray(g)?g[0]:g;f=v.inlineSize,p=v.blockSize}else f=n.offsetWidth,p=n.offsetHeight;l({width:f,height:p})});return s.observe(n,{box:"border-box"}),()=>s.unobserve(n)}else l(void 0)},[n]),a}ZT(_u,"useSize");var JT=Object.defineProperty,rl=(n,a)=>JT(n,"name",{value:a,configurable:!0}),N1="Popper",[T1,Ks]=kn(N1),[WT,M1]=T1(N1),eM=rl(n=>{const{__scopePopper:a,children:l}=n,[s,c]=m.useState(null),[u,f]=m.useState(void 0);return o.jsx(WT,{scope:a,anchor:s,onAnchorChange:c,placementState:u,setPlacementState:f,children:l})},"Popper"),tM="PopperAnchor",nM=m.forwardRef(rl(function(a,l){const{__scopePopper:s,virtualRef:c,...u}=a,f=M1(tM,s),p=m.useRef(null),g=f.onAnchorChange,v=m.useCallback(j=>{p.current=j,j&&g(j)},[g]),x=Xe(l,v),y=m.useRef(null);m.useEffect(()=>{if(!c)return;const j=y.current;y.current=c.current,j!==y.current&&g(y.current)});const b=f.placementState&&ku(f.placementState),w=b==null?void 0:b[0],E=b==null?void 0:b[1];return c?null:o.jsx(Ve.div,{"data-radix-popper-side":w,"data-radix-popper-align":E,...u,ref:x})},"PopperAnchor")),A1="PopperContent",[aM,U4]=T1(A1),rM=m.forwardRef(rl(function(a,l){var de,fe,Te,je,De,Fe,et;const{__scopePopper:s,side:c="bottom",sideOffset:u=0,align:f="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:w=!1,updatePositionStrategy:E="optimized",onPlaced:j,...C}=a,N=M1(A1,s),[M,T]=m.useState(null),D=Xe(l,T),[O,A]=m.useState(null),U=_u(O),k=(U==null?void 0:U.width)??0,$=(U==null?void 0:U.height)??0,X=c+(f!=="center"?"-"+f:""),te=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},G=Array.isArray(x)?x:[x],ie=G.length>0,ce={padding:te,boundary:G.filter(D1),altBoundary:ie},{refs:se,floatingStyles:_,placement:H,isPositioned:Q,middlewareData:J}=PT({strategy:"fixed",placement:X,whileElementsMounted:rl((...le)=>DT(...le,{animationFrame:E==="always"}),"whileElementsMounted"),elements:{reference:N.anchor},middleware:[VT({mainAxis:u+$,alignmentAxis:p}),v&&$T({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?YT():void 0,...ce}),v&>({...ce}),KT({...ce,apply:rl(({elements:le,rects:Le,availableWidth:Ie,availableHeight:kt})=>{const{width:St,height:Ft}=Le.reference,on=le.floating.style;on.setProperty("--radix-popper-available-width",`${Ie}px`),on.setProperty("--radix-popper-available-height",`${kt}px`),on.setProperty("--radix-popper-anchor-width",`${St}px`),on.setProperty("--radix-popper-anchor-height",`${Ft}px`)},"apply")}),O&&FT({element:O,padding:g}),lM({arrowWidth:k,arrowHeight:$}),w&&XT({strategy:"referenceHidden",...ce,boundary:ie?ce.boundary:void 0})]}),ee=N.setPlacementState;Xt(()=>(ee(H),()=>{ee(void 0)}),[H,ee]);const[z,I]=ku(H),F=ia(j);Xt(()=>{Q&&(F==null||F())},[Q,F]);const re=(de=J.arrow)==null?void 0:de.x,he=(fe=J.arrow)==null?void 0:fe.y,ge=((Te=J.arrow)==null?void 0:Te.centerOffset)!==0,[q,oe]=m.useState();return Xt(()=>{M&&oe(window.getComputedStyle(M).zIndex)},[M]),o.jsx("div",{ref:se.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:Q?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[(je=J.transformOrigin)==null?void 0:je.x,(De=J.transformOrigin)==null?void 0:De.y].join(" "),...((Fe=J.hide)==null?void 0:Fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:o.jsx(aM,{scope:s,placedSide:z,placedAlign:I,onArrowChange:A,arrowX:re,arrowY:he,shouldHideArrow:ge,children:o.jsx(Ve.div,{"data-side":z,"data-align":I,...C,ref:D,style:{...C.style,animation:Q?(et=C.style)==null?void 0:et.animation:"none"}})})})},"PopperContent"));function D1(n){return n!==null}rl(D1,"isNotNull");var lM=rl(n=>({name:"transformOrigin",options:n,fn(a){var C,N,M;const{placement:l,rects:s,middlewareData:c}=a,f=((C=c.arrow)==null?void 0:C.centerOffset)!==0,p=f?0:n.arrowWidth,g=f?0:n.arrowHeight,[v,x]=ku(l),y={start:"0%",center:"50%",end:"100%"}[x],b=(((N=c.arrow)==null?void 0:N.x)??0)+p/2,w=(((M=c.arrow)==null?void 0:M.y)??0)+g/2;let E="",j="";return v==="bottom"?(E=f?y:`${b}px`,j=`${-g}px`):v==="top"?(E=f?y:`${b}px`,j=`${s.floating.height+g}px`):v==="right"?(E=`${-g}px`,j=f?y:`${w}px`):v==="left"&&(E=`${s.floating.width+g}px`,j=f?y:`${w}px`),{data:{x:E,y:j}}}}),"transformOrigin");function ku(n){const[a,l="center"]=n.split("-");return[a,l]}rl(ku,"getSideAndAlignFromPlacement");var O1=eM,_1=nM,Qm=rM,sM=Object.defineProperty,oM=(n,a)=>sM(n,"name",{value:a,configurable:!0}),Zm=m.forwardRef(oM(function(a,l){var g;const{container:s,...c}=a,[u,f]=m.useState(!1);Xt(()=>f(!0),[]);const p=s||u&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?ba.createPortal(o.jsx(Ve.div,{...c,ref:l}),p):null},"Portal")),iM=Object.defineProperty,wr=(n,a)=>iM(n,"name",{value:a,configurable:!0});function k1(n,a){return m.useReducer((l,s)=>a[l][s]??l,n)}wr(k1,"useStateMachine");var Cr=wr(n=>{const{present:a,children:l}=n,s=z1(a),c=typeof l=="function"?l({present:s.isPresent}):m.Children.only(l),u=L1(s.ref,U1(c));return typeof l=="function"||s.isPresent?m.cloneElement(c,{ref:u}):null},"Presence");function z1(n){const[a,l]=m.useState(),s=m.useRef(null),c=m.useRef(n),u=m.useRef("none"),f=m.useRef(void 0),p=n?"mounted":"unmounted",[g,v]=k1(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{g==="mounted"?(u.current=f.current??Ds(s.current),f.current=void 0):u.current="none"},[g]),Xt(()=>{const x=s.current,y=c.current;if(y!==n){const w=u.current,E=Ds(x);n?(f.current=E,v("MOUNT")):E==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(y&&w!==E?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,v]),Xt(()=>{if(a){let x;const y=a.ownerDocument.defaultView??window,b=wr(E=>{const C=Ds(s.current).includes(CSS.escape(E.animationName));if(E.target===a&&C&&(v("ANIMATION_END"),!c.current)){const N=a.style.animationFillMode;a.style.animationFillMode="forwards",x=y.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=N)})}},"handleAnimationEnd"),w=wr(E=>{E.target===a&&(u.current=Ds(s.current))},"handleAnimationStart");return a.addEventListener("animationstart",w),a.addEventListener("animationcancel",b),a.addEventListener("animationend",b),()=>{y.clearTimeout(x),a.removeEventListener("animationstart",w),a.removeEventListener("animationcancel",b),a.removeEventListener("animationend",b)}}else v("ANIMATION_END")},[a,v]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:m.useCallback(x=>{if(x){const y=getComputedStyle(x);s.current=y,f.current=Ds(y)}else s.current=null;l(x)},[])}}wr(z1,"usePresence");function tm(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}wr(tm,"setRef");function L1(...n){const a=m.useRef(n);return a.current=n,m.useCallback(l=>{const s=a.current;let c=!1;const u=s.map(f=>{const p=tm(f,l);return!c&&typeof p=="function"&&(c=!0),p});if(c)return()=>{for(let f=0;f<u.length;f++){const p=u[f];typeof p=="function"?p():tm(s[f],null)}}},[])}wr(L1,"useStableComposedRefs");function Ds(n){return(n==null?void 0:n.animationName)||"none"}wr(Ds,"getAnimationName");function U1(n){var s,c;let a=(s=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:s.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}wr(U1,"getElementRef");var cM=Object.defineProperty,Jm=(n,a)=>cM(n,"name",{value:a,configurable:!0}),Rh=!1;function B1(){const[n,a]=m.useState(Rh);return m.useEffect(()=>{Rh||(Rh=!0,a(!0))},[]),n}Jm(B1,"useIsHydrated");var H1=Hs[" useSyncExternalStore ".trim().toString()];function I1(){return()=>{}}Jm(I1,"subscribe");function P1(){return H1(I1,()=>!0,()=>!1)}Jm(P1,"useIsHydratedModern");var uM=typeof H1=="function"?P1:B1,dM=Object.defineProperty,Ll=(n,a)=>dM(n,"name",{value:a,configurable:!0}),Nh="rovingFocusGroup.onEntryFocus",fM={bubbles:!1,cancelable:!0},zu="RovingFocusGroup",[nm,q1,hM]=Ru(zu),[mM,Lu]=kn(zu,[hM]),[pM,gM]=mM(zu),vM=m.forwardRef(Ll(function(a,l){return o.jsx(nm.Provider,{scope:a.__scopeRovingFocusGroup,children:o.jsx(nm.Slot,{scope:a.__scopeRovingFocusGroup,children:o.jsx(xM,{...a,ref:l})})})},"RovingFocusGroup")),xM=m.forwardRef(Ll(function(a,l){const{__scopeRovingFocusGroup:s,orientation:c,loop:u=!1,dir:f,currentTabStopId:p,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:x,preventScrollOnEntryFocus:y=!1,...b}=a,w=m.useRef(null),E=Xe(l,w),j=di(f),[C,N]=yr({prop:p,defaultProp:g??null,onChange:v,caller:zu}),[M,T]=m.useState(!1),D=ia(x),O=q1(s),A=m.useRef(!1),[U,k]=m.useState(0);return m.useEffect(()=>{const $=w.current;if($)return $.addEventListener(Nh,D),()=>$.removeEventListener(Nh,D)},[D]),o.jsx(pM,{scope:s,orientation:c,dir:j,loop:u,currentTabStopId:C,onItemFocus:m.useCallback($=>N($),[N]),onItemShiftTab:m.useCallback(()=>T(!0),[]),onFocusableItemAdd:m.useCallback(()=>k($=>$+1),[]),onFocusableItemRemove:m.useCallback(()=>k($=>$-1),[]),children:o.jsx(Ve.div,{tabIndex:M||U===0?-1:0,"data-orientation":c,...b,ref:E,style:{outline:"none",...a.style},onMouseDown:Ne(a.onMouseDown,()=>{A.current=!0}),onFocus:Ne(a.onFocus,$=>{const X=!A.current;if($.target===$.currentTarget&&X&&!M){const te=new CustomEvent(Nh,fM);if($.currentTarget.dispatchEvent(te),!te.defaultPrevented){const G=O().filter(H=>H.focusable),ie=G.find(H=>H.active),ce=G.find(H=>H.id===C),_=[ie,ce,...G].filter(Boolean).map(H=>H.ref.current);Wm(_,y)}}A.current=!1}),onBlur:Ne(a.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),yM="RovingFocusGroupItem",bM=m.forwardRef(Ll(function(a,l){const{__scopeRovingFocusGroup:s,focusable:c=!0,active:u=!1,tabStopId:f,children:p,...g}=a,v=La(),x=f||v,y=gM(yM,s),b=y.currentTabStopId===x,w=q1(s),{onFocusableItemAdd:E,onFocusableItemRemove:j,currentTabStopId:C}=y,N=uM();return Xt(()=>{if(!(!N||!c))return E(),()=>j()},[N,c,E,j]),m.useEffect(()=>{if(!(N||!c))return E(),()=>j()},[N,c,E,j]),o.jsx(nm.ItemSlot,{scope:s,id:x,focusable:c,active:u,children:o.jsx(Ve.span,{tabIndex:b?0:-1,"data-orientation":y.orientation,...g,ref:l,onMouseDown:Ne(a.onMouseDown,M=>{c?y.onItemFocus(x):M.preventDefault()}),onFocus:Ne(a.onFocus,()=>y.onItemFocus(x)),onKeyDown:Ne(a.onKeyDown,M=>{if(M.key==="Tab"&&M.shiftKey){y.onItemShiftTab();return}if(M.target!==M.currentTarget)return;const T=$1(M,y.orientation,y.dir);if(T!==void 0){if(M.metaKey||M.ctrlKey||M.altKey||M.shiftKey)return;M.preventDefault();let O=w().filter(A=>A.focusable).map(A=>A.ref.current);if(T==="last")O.reverse();else if(T==="prev"||T==="next"){T==="prev"&&O.reverse();const A=O.indexOf(M.currentTarget);O=y.loop?Y1(O,A+1):O.slice(A+1)}setTimeout(()=>Wm(O))}}),children:typeof p=="function"?p({isCurrentTabStop:b,hasTabStop:C!=null}):p})})},"RovingFocusGroupItem")),wM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function V1(n,a){return a!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}Ll(V1,"getDirectionAwareKey");function $1(n,a,l){const s=V1(n.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return wM[s]}Ll($1,"getFocusIntent");function Wm(n,a=!1){const l=document.activeElement;for(const s of n)if(s===l||(s.focus({preventScroll:a}),document.activeElement!==l))return}Ll(Wm,"focusFirst");function Y1(n,a){return n.map((l,s)=>n[(a+s)%n.length])}Ll(Y1,"wrapArray");var G1=vM,K1=bM,SM=function(n){if(typeof document>"u")return null;var a=Array.isArray(n)?n[0]:n;return a.ownerDocument.body},Ns=new WeakMap,zc=new WeakMap,Lc={},Th=0,X1=function(n){return n&&(n.host||X1(n.parentNode))},jM=function(n,a){return a.map(function(l){if(n.contains(l))return l;var s=X1(l);return s&&n.contains(s)?s:(console.error("aria-hidden",l,"in not contained inside",n,". Doing nothing"),null)}).filter(function(l){return!!l})},CM=function(n,a,l,s){var c=jM(a,Array.isArray(n)?n:[n]);Lc[l]||(Lc[l]=new WeakMap);var u=Lc[l],f=[],p=new Set,g=new Set(c),v=function(y){!y||p.has(y)||(p.add(y),v(y.parentNode))};c.forEach(v);var x=function(y){!y||g.has(y)||Array.prototype.forEach.call(y.children,function(b){if(p.has(b))x(b);else try{var w=b.getAttribute(s),E=w!==null&&w!=="false",j=(Ns.get(b)||0)+1,C=(u.get(b)||0)+1;Ns.set(b,j),u.set(b,C),f.push(b),j===1&&E&&zc.set(b,!0),C===1&&b.setAttribute(l,"true"),E||b.setAttribute(s,"true")}catch(N){console.error("aria-hidden: cannot operate on ",b,N)}})};return x(a),p.clear(),Th++,function(){f.forEach(function(y){var b=Ns.get(y)-1,w=u.get(y)-1;Ns.set(y,b),u.set(y,w),b||(zc.has(y)||y.removeAttribute(s),zc.delete(y)),w||y.removeAttribute(l)}),Th--,Th||(Ns=new WeakMap,Ns=new WeakMap,zc=new WeakMap,Lc={})}},ep=function(n,a,l){l===void 0&&(l="data-aria-hidden");var s=Array.from(Array.isArray(n)?n:[n]),c=SM(n);return c?(s.push.apply(s,Array.from(c.querySelectorAll("[aria-live], script"))),CM(s,c,l,"aria-hidden")):function(){return null}},ka=function(){return ka=Object.assign||function(a){for(var l,s=1,c=arguments.length;s<c;s++){l=arguments[s];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},ka.apply(this,arguments)};function F1(n,a){var l={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&a.indexOf(s)<0&&(l[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,s=Object.getOwnPropertySymbols(n);c<s.length;c++)a.indexOf(s[c])<0&&Object.prototype.propertyIsEnumerable.call(n,s[c])&&(l[s[c]]=n[s[c]]);return l}function EM(n,a,l){if(l||arguments.length===2)for(var s=0,c=a.length,u;s<c;s++)(u||!(s in a))&&(u||(u=Array.prototype.slice.call(a,0,s)),u[s]=a[s]);return n.concat(u||Array.prototype.slice.call(a))}var Jc="right-scroll-bar-position",Wc="width-before-scroll-bar",RM="with-scroll-bars-hidden",NM="--removed-body-scroll-bar-size";function Mh(n,a){return typeof n=="function"?n(a):n&&(n.current=a),n}function TM(n,a){var l=m.useState(function(){return{value:n,callback:a,facade:{get current(){return l.value},set current(s){var c=l.value;c!==s&&(l.value=s,l.callback(s,c))}}}})[0];return l.callback=a,l.facade}var MM=typeof window<"u"?m.useLayoutEffect:m.useEffect,xb=new WeakMap;function AM(n,a){var l=TM(null,function(s){return n.forEach(function(c){return Mh(c,s)})});return MM(function(){var s=xb.get(l);if(s){var c=new Set(s),u=new Set(n),f=l.current;c.forEach(function(p){u.has(p)||Mh(p,null)}),u.forEach(function(p){c.has(p)||Mh(p,f)})}xb.set(l,n)},[n]),l}function DM(n){return n}function OM(n,a){a===void 0&&(a=DM);var l=[],s=!1,c={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:n},useMedium:function(u){var f=a(u,s);return l.push(f),function(){l=l.filter(function(p){return p!==f})}},assignSyncMedium:function(u){for(s=!0;l.length;){var f=l;l=[],f.forEach(u)}l={push:function(p){return u(p)},filter:function(){return l}}},assignMedium:function(u){s=!0;var f=[];if(l.length){var p=l;l=[],p.forEach(u),f=l}var g=function(){var x=f;f=[],x.forEach(u)},v=function(){return Promise.resolve().then(g)};v(),l={push:function(x){f.push(x),v()},filter:function(x){return f=f.filter(x),l}}}};return c}function _M(n){n===void 0&&(n={});var a=OM(null);return a.options=ka({async:!0,ssr:!1},n),a}var Q1=function(n){var a=n.sideCar,l=F1(n,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=a.read();if(!s)throw new Error("Sidecar medium not found");return m.createElement(s,ka({},l))};Q1.isSideCarExport=!0;function kM(n,a){return n.useMedium(a),Q1}var Z1=_M(),Ah=function(){},Uu=m.forwardRef(function(n,a){var l=m.useRef(null),s=m.useState({onScrollCapture:Ah,onWheelCapture:Ah,onTouchMoveCapture:Ah}),c=s[0],u=s[1],f=n.forwardProps,p=n.children,g=n.className,v=n.removeScrollBar,x=n.enabled,y=n.shards,b=n.sideCar,w=n.noRelative,E=n.noIsolation,j=n.inert,C=n.allowPinchZoom,N=n.as,M=N===void 0?"div":N,T=n.gapMode,D=F1(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=b,A=AM([l,a]),U=ka(ka({},D),c);return m.createElement(m.Fragment,null,x&&m.createElement(O,{sideCar:Z1,removeScrollBar:v,shards:y,noRelative:w,noIsolation:E,inert:j,setCallbacks:u,allowPinchZoom:!!C,lockRef:l,gapMode:T}),f?m.cloneElement(m.Children.only(p),ka(ka({},U),{ref:A})):m.createElement(M,ka({},U,{className:g,ref:A}),p))});Uu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Uu.classNames={fullWidth:Wc,zeroRight:Jc};var zM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function LM(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var a=zM();return a&&n.setAttribute("nonce",a),n}function UM(n,a){n.styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a))}function BM(n){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(n)}var HM=function(){var n=0,a=null;return{add:function(l){n==0&&(a=LM())&&(UM(a,l),BM(a)),n++},remove:function(){n--,!n&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},IM=function(){var n=HM();return function(a,l){m.useEffect(function(){return n.add(a),function(){n.remove()}},[a&&l])}},J1=function(){var n=IM(),a=function(l){var s=l.styles,c=l.dynamic;return n(s,c),null};return a},PM={left:0,top:0,right:0,gap:0},Dh=function(n){return parseInt(n||"",10)||0},qM=function(n){var a=window.getComputedStyle(document.body),l=a[n==="padding"?"paddingLeft":"marginLeft"],s=a[n==="padding"?"paddingTop":"marginTop"],c=a[n==="padding"?"paddingRight":"marginRight"];return[Dh(l),Dh(s),Dh(c)]},VM=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return PM;var a=qM(n),l=document.documentElement.clientWidth,s=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,s-l+a[2]-a[0])}},$M=J1(),Ls="data-scroll-locked",YM=function(n,a,l,s){var c=n.left,u=n.top,f=n.right,p=n.gap;return l===void 0&&(l="margin"),`
|
|
301
|
+
.`.concat(RM,` {
|
|
302
|
+
overflow: hidden `).concat(s,`;
|
|
303
|
+
padding-right: `).concat(p,"px ").concat(s,`;
|
|
304
|
+
}
|
|
305
|
+
body[`).concat(Ls,`] {
|
|
306
|
+
overflow: hidden `).concat(s,`;
|
|
307
|
+
overscroll-behavior: contain;
|
|
308
|
+
`).concat([a&&"position: relative ".concat(s,";"),l==="margin"&&`
|
|
309
|
+
padding-left: `.concat(c,`px;
|
|
310
|
+
padding-top: `).concat(u,`px;
|
|
311
|
+
padding-right: `).concat(f,`px;
|
|
312
|
+
margin-left:0;
|
|
313
|
+
margin-top:0;
|
|
314
|
+
margin-right: `).concat(p,"px ").concat(s,`;
|
|
315
|
+
`),l==="padding"&&"padding-right: ".concat(p,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.`).concat(Jc,` {
|
|
319
|
+
right: `).concat(p,"px ").concat(s,`;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.`).concat(Wc,` {
|
|
323
|
+
margin-right: `).concat(p,"px ").concat(s,`;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.`).concat(Jc," .").concat(Jc,` {
|
|
327
|
+
right: 0 `).concat(s,`;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.`).concat(Wc," .").concat(Wc,` {
|
|
331
|
+
margin-right: 0 `).concat(s,`;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
body[`).concat(Ls,`] {
|
|
335
|
+
`).concat(NM,": ").concat(p,`px;
|
|
336
|
+
}
|
|
337
|
+
`)},yb=function(){var n=parseInt(document.body.getAttribute(Ls)||"0",10);return isFinite(n)?n:0},GM=function(){m.useEffect(function(){return document.body.setAttribute(Ls,(yb()+1).toString()),function(){var n=yb()-1;n<=0?document.body.removeAttribute(Ls):document.body.setAttribute(Ls,n.toString())}},[])},KM=function(n){var a=n.noRelative,l=n.noImportant,s=n.gapMode,c=s===void 0?"margin":s;GM();var u=m.useMemo(function(){return VM(c)},[c]);return m.createElement($M,{styles:YM(u,!a,c,l?"":"!important")})},am=!1;if(typeof window<"u")try{var Uc=Object.defineProperty({},"passive",{get:function(){return am=!0,!0}});window.addEventListener("test",Uc,Uc),window.removeEventListener("test",Uc,Uc)}catch{am=!1}var Ts=am?{passive:!1}:!1,XM=function(n){return n.tagName==="TEXTAREA"},W1=function(n,a){if(!(n instanceof Element))return!1;var l=window.getComputedStyle(n);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!XM(n)&&l[a]==="visible")},FM=function(n){return W1(n,"overflowY")},QM=function(n){return W1(n,"overflowX")},bb=function(n,a){var l=a.ownerDocument,s=a;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var c=ew(n,s);if(c){var u=tw(n,s),f=u[1],p=u[2];if(f>p)return!0}s=s.parentNode}while(s&&s!==l.body);return!1},ZM=function(n){var a=n.scrollTop,l=n.scrollHeight,s=n.clientHeight;return[a,l,s]},JM=function(n){var a=n.scrollLeft,l=n.scrollWidth,s=n.clientWidth;return[a,l,s]},ew=function(n,a){return n==="v"?FM(a):QM(a)},tw=function(n,a){return n==="v"?ZM(a):JM(a)},WM=function(n,a){return n==="h"&&a==="rtl"?-1:1},eA=function(n,a,l,s,c){var u=WM(n,window.getComputedStyle(a).direction),f=u*s,p=l.target,g=a.contains(p),v=!1,x=f>0,y=0,b=0;do{if(!p)break;var w=tw(n,p),E=w[0],j=w[1],C=w[2],N=j-C-u*E;(E||N)&&ew(n,p)&&(y+=N,b+=E);var M=p.parentNode;p=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!g&&p!==document.body||g&&(a.contains(p)||a===p));return(x&&Math.abs(y)<1||!x&&Math.abs(b)<1)&&(v=!0),v},Bc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},wb=function(n){return[n.deltaX,n.deltaY]},Sb=function(n){return n&&"current"in n?n.current:n},tA=function(n,a){return n[0]===a[0]&&n[1]===a[1]},nA=function(n){return`
|
|
338
|
+
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
|
339
|
+
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
|
340
|
+
`)},aA=0,Ms=[];function rA(n){var a=m.useRef([]),l=m.useRef([0,0]),s=m.useRef(),c=m.useState(aA++)[0],u=m.useState(J1)[0],f=m.useRef(n);m.useEffect(function(){f.current=n},[n]),m.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var j=EM([n.lockRef.current],(n.shards||[]).map(Sb),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var p=m.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!f.current.allowPinchZoom;var N=Bc(j),M=l.current,T="deltaX"in j?j.deltaX:M[0]-N[0],D="deltaY"in j?j.deltaY:M[1]-N[1],O,A=j.target,U=Math.abs(T)>Math.abs(D)?"h":"v";if("touches"in j&&U==="h"&&A.type==="range")return!1;var k=window.getSelection(),$=k&&k.anchorNode,X=$?$===A||$.contains(A):!1;if(X)return!1;var te=bb(U,A);if(!te)return!0;if(te?O=U:(O=U==="v"?"h":"v",te=bb(U,A)),!te)return!1;if(!s.current&&"changedTouches"in j&&(T||D)&&(s.current=O),!O)return!0;var G=s.current||O;return eA(G,C,j,G==="h"?T:D)},[]),g=m.useCallback(function(j){var C=j;if(!(!Ms.length||Ms[Ms.length-1]!==u)){var N="deltaY"in C?wb(C):Bc(C),M=a.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&tA(O.delta,N)})[0];if(M&&M.should){C.cancelable&&C.preventDefault();return}if(!M){var T=(f.current.shards||[]).map(Sb).filter(Boolean).filter(function(O){return O.contains(C.target)}),D=T.length>0?p(C,T[0]):!f.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),v=m.useCallback(function(j,C,N,M){var T={name:j,delta:C,target:N,should:M,shadowParent:lA(N)};a.current.push(T),setTimeout(function(){a.current=a.current.filter(function(D){return D!==T})},1)},[]),x=m.useCallback(function(j){l.current=Bc(j),s.current=void 0},[]),y=m.useCallback(function(j){v(j.type,wb(j),j.target,p(j,n.lockRef.current))},[]),b=m.useCallback(function(j){v(j.type,Bc(j),j.target,p(j,n.lockRef.current))},[]);m.useEffect(function(){return Ms.push(u),n.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",g,Ts),document.addEventListener("touchmove",g,Ts),document.addEventListener("touchstart",x,Ts),function(){Ms=Ms.filter(function(j){return j!==u}),document.removeEventListener("wheel",g,Ts),document.removeEventListener("touchmove",g,Ts),document.removeEventListener("touchstart",x,Ts)}},[]);var w=n.removeScrollBar,E=n.inert;return m.createElement(m.Fragment,null,E?m.createElement(u,{styles:nA(c)}):null,w?m.createElement(KM,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function lA(n){for(var a=null;n!==null;)n instanceof ShadowRoot&&(a=n.host,n=n.host),n=n.parentNode;return a}const sA=kM(Z1,rA);var Bu=m.forwardRef(function(n,a){return m.createElement(Uu,ka({},n,{ref:a,sideCar:sA}))});Bu.classNames=Uu.classNames;var oA=Object.defineProperty,pt=(n,a)=>oA(n,"name",{value:a,configurable:!0}),iA=["Enter"," "],cA=["ArrowDown","PageUp","Home"],nw=["ArrowUp","PageDown","End"],uA=[...cA,...nw],Hu="Menu",[rm,dA,fA]=Ru(Hu),[Ul,aw]=kn(Hu,[fA,Ks,Lu]),tp=Ks(),rw=Lu(),[hA,hi]=Ul(Hu),[mA,np]=Ul(Hu),pA=pt(n=>{const{__scopeMenu:a,open:l=!1,children:s,dir:c,onOpenChange:u,modal:f=!0}=n,p=tp(a),[g,v]=m.useState(null),x=m.useRef(!1),y=ia(u),b=di(c);return m.useEffect(()=>{const w=pt(()=>{x.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},"handleKeyDown"),E=pt(()=>x.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),m.useEffect(()=>{if(!l)return;const w=pt(()=>y(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[l,y]),o.jsx(O1,{...p,children:o.jsx(hA,{scope:a,open:l,onOpenChange:y,content:g,onContentChange:v,children:o.jsx(mA,{scope:a,onClose:m.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:x,dir:b,modal:f,children:s})})})},"Menu"),gA=m.forwardRef(pt(function(a,l){const{__scopeMenu:s,...c}=a,u=tp(s);return o.jsx(_1,{...u,...c,ref:l})},"MenuAnchor")),lw="MenuPortal",[vA,xA]=Ul(lw,{forceMount:void 0}),yA=pt(n=>{const{__scopeMenu:a,forceMount:l,children:s,container:c}=n,u=hi(lw,a);return o.jsx(vA,{scope:a,forceMount:l,children:o.jsx(Cr,{present:l||u.open,children:o.jsx(Zm,{asChild:!0,container:c,children:s})})})},"MenuPortal"),ll="MenuContent",[bA,sw]=Ul(ll),wA=m.forwardRef(pt(function(a,l){const s=xA(ll,a.__scopeMenu),{forceMount:c=s.forceMount,...u}=a,f=hi(ll,a.__scopeMenu),p=np(ll,a.__scopeMenu);return o.jsx(rm.Provider,{scope:a.__scopeMenu,children:o.jsx(Cr,{present:c||f.open,children:o.jsx(rm.Slot,{scope:a.__scopeMenu,children:p.modal?o.jsx(SA,{...u,ref:l}):o.jsx(jA,{...u,ref:l})})})})},"MenuContent")),SA=m.forwardRef(pt(function(a,l){const s=hi(ll,a.__scopeMenu),c=m.useRef(null),u=Xe(l,c);return m.useEffect(()=>{const f=c.current;if(f)return ep(f)},[]),o.jsx(ow,{...a,ref:u,trapFocus:s.open,disableOutsidePointerEvents:s.open,disableOutsideScroll:!0,onFocusOutside:Ne(a.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>s.onOpenChange(!1)})},"MenuRootContentModal")),jA=m.forwardRef(pt(function(a,l){const s=hi(ll,a.__scopeMenu);return o.jsx(ow,{...a,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>s.onOpenChange(!1)})},"MenuRootContentNonModal")),CA=Ha("MenuContent.ScrollLock"),ow=m.forwardRef(pt(function(a,l){const{__scopeMenu:s,loop:c=!1,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:p,disableOutsidePointerEvents:g,onEntryFocus:v,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:E,disableOutsideScroll:j,...C}=a,N=hi(ll,s),M=np(ll,s),T=tp(s),D=rw(s),O=dA(s),[A,U]=m.useState(null),k=m.useRef(null),$=Xe(l,k,N.onContentChange),X=m.useRef(0),te=m.useRef(""),G=m.useRef(0),ie=m.useRef(null),ce=m.useRef("right"),se=m.useRef(0),_=j?Bu:m.Fragment,H=j?{as:CA,allowPinchZoom:!0}:void 0,Q=pt(ee=>{var oe,de;const z=te.current+ee,I=O().filter(fe=>!fe.disabled),F=document.activeElement,re=(oe=I.find(fe=>fe.ref.current===F))==null?void 0:oe.textValue,he=I.map(fe=>fe.textValue),ge=fw(he,z,re),q=(de=I.find(fe=>fe.textValue===ge))==null?void 0:de.ref.current;pt((function fe(Te){te.current=Te,window.clearTimeout(X.current),Te!==""&&(X.current=window.setTimeout(()=>fe(""),1e3))}),"updateSearch")(z),q&&setTimeout(()=>q.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(X.current),[]),fi();const J=m.useCallback(ee=>{var I,F;return ce.current===((I=ie.current)==null?void 0:I.side)&&mw(ee,(F=ie.current)==null?void 0:F.area)},[]);return o.jsx(bA,{scope:s,searchRef:te,onItemEnter:m.useCallback(ee=>{J(ee)&&ee.preventDefault()},[J]),onItemLeave:m.useCallback(ee=>{var z;J(ee)||((z=k.current)==null||z.focus(),U(null))},[J]),onTriggerLeave:m.useCallback(ee=>{J(ee)&&ee.preventDefault()},[J]),pointerGraceTimerRef:G,onPointerGraceIntentChange:m.useCallback(ee=>{ie.current=ee},[]),children:o.jsx(_,{...H,children:o.jsx(qm,{asChild:!0,trapped:u,onMountAutoFocus:Ne(f,ee=>{var z;ee.preventDefault(),(z=k.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:o.jsx(Nu,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:E,children:o.jsx(G1,{asChild:!0,...D,dir:M.dir,orientation:"vertical",loop:c,currentTabStopId:A,onCurrentTabStopIdChange:U,onEntryFocus:Ne(v,ee=>{M.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Qm,{role:"menu","aria-orientation":"vertical","data-state":iw(N.open),"data-radix-menu-content":"",dir:M.dir,...T,...C,ref:$,style:{outline:"none",...C.style},onKeyDown:Ne(C.onKeyDown,ee=>{const I=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,F=ee.ctrlKey||ee.altKey||ee.metaKey,re=ee.key.length===1;I&&(ee.key==="Tab"&&ee.preventDefault(),!F&&re&&Q(ee.key));const he=k.current;if(ee.target!==he||!uA.includes(ee.key))return;ee.preventDefault();const q=O().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);nw.includes(ee.key)&&q.reverse(),uw(q)}),onBlur:Ne(a.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(X.current),te.current="")}),onPointerMove:Ne(a.onPointerMove,cu(ee=>{const z=ee.target,I=se.current!==ee.clientX;if(ee.currentTarget.contains(z)&&I){const F=ee.clientX>se.current?"right":"left";ce.current=F,se.current=ee.clientX}}))})})})})})})},"MenuContentImpl")),EA=m.forwardRef(pt(function(a,l){const{__scopeMenu:s,...c}=a;return o.jsx(Ve.div,{...c,ref:l})},"MenuLabel")),lm="MenuItem",jb="menu.itemSelect",RA=m.forwardRef(pt(function(a,l){const{disabled:s=!1,onSelect:c,...u}=a,f=m.useRef(null),p=np(lm,a.__scopeMenu),g=sw(lm,a.__scopeMenu),v=Xe(l,f),x=m.useRef(!1),y=pt(()=>{const b=f.current;if(!s&&b){const w=new CustomEvent(jb,{bubbles:!0,cancelable:!0});b.addEventListener(jb,E=>c==null?void 0:c(E),{once:!0}),Bm(b,w),w.defaultPrevented?x.current=!1:p.onClose()}},"handleSelect");return o.jsx(NA,{...u,ref:v,disabled:s,onClick:Ne(a.onClick,y),onPointerDown:b=>{var w;(w=a.onPointerDown)==null||w.call(a,b),x.current=!0},onPointerUp:Ne(a.onPointerUp,b=>{var w;x.current||(w=b.currentTarget)==null||w.click()}),onKeyDown:Ne(a.onKeyDown,b=>{s||b.target!==b.currentTarget||g.searchRef.current!==""&&b.key===" "||iA.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),NA=m.forwardRef(pt(function(a,l){const{__scopeMenu:s,disabled:c=!1,textValue:u,...f}=a,p=sw(lm,s),g=rw(s),v=m.useRef(null),x=Xe(l,v),[y,b]=m.useState(!1),[w,E]=m.useState("");return m.useEffect(()=>{const j=v.current;j&&E((j.textContent??"").trim())},[f.children]),o.jsx(rm.ItemSlot,{scope:s,disabled:c,textValue:u??w,children:o.jsx(K1,{asChild:!0,...g,focusable:!c,children:o.jsx(Ve.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...f,ref:x,onPointerMove:Ne(a.onPointerMove,cu(j=>{c?p.onItemLeave(j):(p.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ne(a.onPointerLeave,cu(j=>p.onItemLeave(j))),onFocus:Ne(a.onFocus,()=>b(!0)),onBlur:Ne(a.onBlur,()=>b(!1))})})})},"MenuItemImpl")),TA="MenuRadioGroup",[B4,H4]=Ul(TA,{value:void 0,onValueChange:pt(()=>{},"onValueChange")}),MA="MenuItemIndicator",[I4,P4]=Ul(MA,{checked:!1}),AA=m.forwardRef(pt(function(a,l){const{__scopeMenu:s,...c}=a;return o.jsx(Ve.div,{role:"separator","aria-orientation":"horizontal",...c,ref:l})},"MenuSeparator")),DA="MenuSub",[q4,V4]=Ul(DA);function iw(n){return n?"open":"closed"}pt(iw,"getOpenState");function cw(n){return n==="indeterminate"}pt(cw,"isIndeterminate");function OA(n){return cw(n)?"indeterminate":n?"checked":"unchecked"}pt(OA,"getCheckedState");function uw(n){const a=document.activeElement;for(const l of n)if(l===a||(l.focus(),document.activeElement!==a))return}pt(uw,"focusFirst");function dw(n,a){return n.map((l,s)=>n[(a+s)%n.length])}pt(dw,"wrapArray");function fw(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=dw(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}pt(fw,"getNextMatch");function hw(n,a){const{x:l,y:s}=n;let c=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],v=p.x,x=p.y,y=g.x,b=g.y;x>s!=b>s&&l<(y-v)*(s-x)/(b-x)+v&&(c=!c)}return c}pt(hw,"isPointInPolygon");function mw(n,a){if(!a)return!1;const l={x:n.clientX,y:n.clientY};return hw(l,a)}pt(mw,"isPointerInGraceArea");function cu(n){return a=>a.pointerType==="mouse"?n(a):void 0}pt(cu,"whenMouse");var _A=pA,kA=gA,zA=yA,LA=wA,UA=EA,BA=RA,HA=AA,IA=Object.defineProperty,Bl=(n,a)=>IA(n,"name",{value:a,configurable:!0}),ap="DropdownMenu",[PA,$4]=kn(ap,[aw]),Hl=aw(),[qA,pw]=PA(ap),VA=Bl(n=>{const{__scopeDropdownMenu:a,children:l,dir:s,open:c,defaultOpen:u,onOpenChange:f,modal:p=!0}=n,g=Hl(a),v=m.useRef(null),[x,y]=yr({prop:c,defaultProp:u??!1,onChange:f,caller:ap});return o.jsx(qA,{scope:a,triggerId:La(),triggerRef:v,contentId:La(),open:x,onOpenChange:y,onOpenToggle:m.useCallback(()=>y(b=>!b),[y]),modal:p,children:o.jsx(_A,{...g,open:x,onOpenChange:y,dir:s,modal:p,children:l})})},"DropdownMenu"),$A="DropdownMenuTrigger",YA=m.forwardRef(Bl(function(a,l){const{__scopeDropdownMenu:s,disabled:c=!1,...u}=a,f=pw($A,s),p=Hl(s),g=Xe(l,f.triggerRef);return o.jsx(kA,{asChild:!0,...p,children:o.jsx(Ve.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...u,ref:g,onPointerDown:Ne(a.onPointerDown,v=>{!c&&v.button===0&&v.ctrlKey===!1&&(f.onOpenToggle(),f.open||v.preventDefault())}),onKeyDown:Ne(a.onKeyDown,v=>{c||(["Enter"," "].includes(v.key)&&f.onOpenToggle(),v.key==="ArrowDown"&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),GA=Bl(n=>{const{__scopeDropdownMenu:a,...l}=n,s=Hl(a);return o.jsx(zA,{...s,...l})},"DropdownMenuPortal"),KA="DropdownMenuContent",XA=m.forwardRef(Bl(function(a,l){const{__scopeDropdownMenu:s,...c}=a,u=pw(KA,s),f=Hl(s),p=m.useRef(!1);return o.jsx(LA,{id:u.contentId,"aria-labelledby":u.triggerId,...f,...c,ref:l,onCloseAutoFocus:Ne(a.onCloseAutoFocus,g=>{var v;p.current||(v=u.triggerRef.current)==null||v.focus(),p.current=!1,g.preventDefault()}),onInteractOutside:Ne(a.onInteractOutside,g=>{const v=g.detail.originalEvent,x=v.button===0&&v.ctrlKey===!0,y=v.button===2||x;(!u.modal||y)&&(p.current=!0)}),style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),FA=m.forwardRef(Bl(function(a,l){const{__scopeDropdownMenu:s,...c}=a,u=Hl(s);return o.jsx(UA,{...u,...c,ref:l})},"DropdownMenuLabel")),QA=m.forwardRef(Bl(function(a,l){const{__scopeDropdownMenu:s,...c}=a,u=Hl(s);return o.jsx(BA,{...u,...c,ref:l})},"DropdownMenuItem")),ZA=m.forwardRef(Bl(function(a,l){const{__scopeDropdownMenu:s,...c}=a,u=Hl(s);return o.jsx(HA,{...u,...c,ref:l})},"DropdownMenuSeparator")),JA=VA,WA=YA,eD=GA,gw=XA,vw=FA,xw=QA,yw=ZA;const tD=JA,nD=WA,bw=m.forwardRef(({className:n,sideOffset:a=4,...l},s)=>o.jsx(eD,{children:o.jsx(gw,{ref:s,sideOffset:a,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",n),...l})}));bw.displayName=gw.displayName;const ww=m.forwardRef(({className:n,inset:a,...l},s)=>o.jsx(xw,{ref:s,className:Ee("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",n),...l}));ww.displayName=xw.displayName;const aD=m.forwardRef(({className:n,...a},l)=>o.jsx(vw,{ref:l,className:Ee("px-2 py-1.5 text-sm font-semibold",n),...a}));aD.displayName=vw.displayName;const rD=m.forwardRef(({className:n,...a},l)=>o.jsx(yw,{ref:l,className:Ee("-mx-1 my-1 h-px bg-muted",n),...a}));rD.displayName=yw.displayName;function lD(){const{theme:n,setTheme:a}=mN(),{user:l,logout:s}=_m(),[c,u]=m.useState(!1),[f,p]=m.useState(null),g=oi(),v=n==="light"?yR:n==="dark"?fR:dR;return m.useEffect(()=>{Se.get("/api/admin/update/check?force=1").then(x=>p(x)).catch(()=>{})},[]),o.jsxs("header",{className:"flex h-14 items-center justify-between border-b bg-background px-4",children:[o.jsx("div",{className:"text-sm text-muted-foreground",children:"Admin"}),o.jsxs("div",{className:"flex items-center gap-2",children:[(f==null?void 0:f.hasUpdate)&&o.jsxs(me,{variant:"ghost",size:"sm",title:`New version available: v${f.latestVersion} — go to Settings → System to update`,onClick:()=>g("/settings?tab=system"),children:[o.jsx(WE,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",f.latestVersion]}),o.jsx(me,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:o.jsx(v,{className:"h-4 w-4"})}),o.jsxs(tD,{open:c,onOpenChange:u,children:[o.jsx(nD,{asChild:!0,children:o.jsx(me,{variant:"ghost",children:(l==null?void 0:l.username)??"admin"})}),o.jsx(bw,{align:"end",children:o.jsxs(ww,{onClick:()=>void s(),children:[o.jsx(uR,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Ae=m.forwardRef(({className:n,type:a,...l},s)=>o.jsx("input",{type:a,className:Ee("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n),ref:s,...l}));Ae.displayName="Input";var sD=Object.defineProperty,oD=(n,a)=>sD(n,"name",{value:a,configurable:!0}),iD=m.forwardRef(oD(function(a,l){return o.jsx(Ve.label,{...a,ref:l,onMouseDown:s=>{var u;s.target.closest("button, input, select, textarea")||((u=a.onMouseDown)==null||u.call(a,s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}})},"Label")),Sw=iD;const we=m.forwardRef(({className:n,...a},l)=>o.jsx(Sw,{ref:l,className:Ee("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...a}));we.displayName=Sw.displayName;const nt=m.forwardRef(({className:n,...a},l)=>o.jsx("div",{ref:l,className:Ee("rounded-lg border bg-card text-card-foreground shadow-sm",n),...a}));nt.displayName="Card";const at=m.forwardRef(({className:n,...a},l)=>o.jsx("div",{ref:l,className:Ee("flex flex-col space-y-1.5 p-6",n),...a}));at.displayName="CardHeader";const rt=m.forwardRef(({className:n,...a},l)=>o.jsx("h3",{ref:l,className:Ee("text-lg font-semibold leading-none tracking-tight",n),...a}));rt.displayName="CardTitle";const gn=m.forwardRef(({className:n,...a},l)=>o.jsx("p",{ref:l,className:Ee("text-sm text-muted-foreground",n),...a}));gn.displayName="CardDescription";const lt=m.forwardRef(({className:n,...a},l)=>o.jsx("div",{ref:l,className:Ee("p-6 pt-0",n),...a}));lt.displayName="CardContent";const jw=m.forwardRef(({className:n,...a},l)=>o.jsx("div",{ref:l,className:Ee("flex items-center p-6 pt-0",n),...a}));jw.displayName="CardFooter";var cD=n=>{switch(n){case"success":return fD;case"info":return mD;case"warning":return hD;case"error":return pD;default:return null}},uD=Array(12).fill(0),dD=({visible:n,className:a})=>ue.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":n},ue.createElement("div",{className:"sonner-spinner"},uD.map((l,s)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),fD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),hD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),mD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),pD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"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"})),gD=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),vD=()=>{let[n,a]=ue.useState(document.hidden);return ue.useEffect(()=>{let l=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",l),()=>window.removeEventListener("visibilitychange",l)},[]),n},sm=1,xD=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;let{message:l,...s}=n,c=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:sm++,u=this.toasts.find(p=>p.id===c),f=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),u?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...n,id:c,title:l}),{...p,...n,id:c,dismissible:f,title:l}):p):this.addToast({title:l,...s,dismissible:f,id:c}),c},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(a=>{this.subscribers.forEach(l=>l({id:a.id,dismiss:!0}))}),this.subscribers.forEach(a=>a({id:n,dismiss:!0})),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let l;a.loading!==void 0&&(l=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));let s=n instanceof Promise?n:n(),c=l!==void 0,u,f=s.then(async g=>{if(u=["resolve",g],ue.isValidElement(g))c=!1,this.create({id:l,type:"default",message:g});else if(bD(g)&&!g.ok){c=!1;let v=typeof a.error=="function"?await a.error(`HTTP error! status: ${g.status}`):a.error,x=typeof a.description=="function"?await a.description(`HTTP error! status: ${g.status}`):a.description;this.create({id:l,type:"error",message:v,description:x})}else if(a.success!==void 0){c=!1;let v=typeof a.success=="function"?await a.success(g):a.success,x=typeof a.description=="function"?await a.description(g):a.description;this.create({id:l,type:"success",message:v,description:x})}}).catch(async g=>{if(u=["reject",g],a.error!==void 0){c=!1;let v=typeof a.error=="function"?await a.error(g):a.error,x=typeof a.description=="function"?await a.description(g):a.description;this.create({id:l,type:"error",message:v,description:x})}}).finally(()=>{var g;c&&(this.dismiss(l),l=void 0),(g=a.finally)==null||g.call(a)}),p=()=>new Promise((g,v)=>f.then(()=>u[0]==="reject"?v(u[1]):g(u[1])).catch(v));return typeof l!="string"&&typeof l!="number"?{unwrap:p}:Object.assign(l,{unwrap:p})},this.custom=(n,a)=>{let l=(a==null?void 0:a.id)||sm++;return this.create({jsx:n(l),id:l,...a}),l},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Tn=new xD,yD=(n,a)=>{let l=(a==null?void 0:a.id)||sm++;return Tn.addToast({title:n,...a,id:l}),l},bD=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",wD=yD,SD=()=>Tn.toasts,jD=()=>Tn.getActiveToasts(),ve=Object.assign(wD,{success:Tn.success,info:Tn.info,warning:Tn.warning,error:Tn.error,custom:Tn.custom,message:Tn.message,promise:Tn.promise,dismiss:Tn.dismiss,loading:Tn.loading},{getHistory:SD,getToasts:jD});function CD(n,{insertAt:a}={}){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",a==="top"&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=n:s.appendChild(document.createTextNode(n))}CD(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
341
|
+
`);function Hc(n){return n.label!==void 0}var ED=3,RD="32px",ND="16px",Cb=4e3,TD=356,MD=14,AD=20,DD=200;function xa(...n){return n.filter(Boolean).join(" ")}function OD(n){let[a,l]=n.split("-"),s=[];return a&&s.push(a),l&&s.push(l),s}var _D=n=>{var a,l,s,c,u,f,p,g,v,x,y;let{invert:b,toast:w,unstyled:E,interacting:j,setHeights:C,visibleToasts:N,heights:M,index:T,toasts:D,expanded:O,removeToast:A,defaultRichColors:U,closeButton:k,style:$,cancelButtonStyle:X,actionButtonStyle:te,className:G="",descriptionClassName:ie="",duration:ce,position:se,gap:_,loadingIcon:H,expandByDefault:Q,classNames:J,icons:ee,closeButtonAriaLabel:z="Close toast",pauseWhenPageIsHidden:I}=n,[F,re]=ue.useState(null),[he,ge]=ue.useState(null),[q,oe]=ue.useState(!1),[de,fe]=ue.useState(!1),[Te,je]=ue.useState(!1),[De,Fe]=ue.useState(!1),[et,le]=ue.useState(!1),[Le,Ie]=ue.useState(0),[kt,St]=ue.useState(0),Ft=ue.useRef(w.duration||ce||Cb),on=ue.useRef(null),Qt=ue.useRef(null),jt=T===0,fn=T+1<=N,Mt=w.type,At=w.dismissible!==!1,cn=w.className||"",fa=w.descriptionClassName||"",Ta=ue.useMemo(()=>M.findIndex(Ce=>Ce.toastId===w.id)||0,[M,w.id]),Gn=ue.useMemo(()=>{var Ce;return(Ce=w.closeButton)!=null?Ce:k},[w.closeButton,k]),dl=ue.useMemo(()=>w.duration||ce||Cb,[w.duration,ce]),ha=ue.useRef(0),Dt=ue.useRef(0),hn=ue.useRef(0),Tt=ue.useRef(null),[Js,Pl]=se.split("-"),ql=ue.useMemo(()=>M.reduce((Ce,ke,Ue)=>Ue>=Ta?Ce:Ce+ke.height,0),[M,Ta]),Ya=vD(),Nr=w.invert||b,vt=Mt==="loading";Dt.current=ue.useMemo(()=>Ta*_+ql,[Ta,ql]),ue.useEffect(()=>{Ft.current=dl},[dl]),ue.useEffect(()=>{oe(!0)},[]),ue.useEffect(()=>{let Ce=Qt.current;if(Ce){let ke=Ce.getBoundingClientRect().height;return St(ke),C(Ue=>[{toastId:w.id,height:ke,position:w.position},...Ue]),()=>C(Ue=>Ue.filter(gt=>gt.toastId!==w.id))}},[C,w.id]),ue.useLayoutEffect(()=>{if(!q)return;let Ce=Qt.current,ke=Ce.style.height;Ce.style.height="auto";let Ue=Ce.getBoundingClientRect().height;Ce.style.height=ke,St(Ue),C(gt=>gt.find(Ct=>Ct.toastId===w.id)?gt.map(Ct=>Ct.toastId===w.id?{...Ct,height:Ue}:Ct):[{toastId:w.id,height:Ue,position:w.position},...gt])},[q,w.title,w.description,C,w.id]);let st=ue.useCallback(()=>{fe(!0),Ie(Dt.current),C(Ce=>Ce.filter(ke=>ke.toastId!==w.id)),setTimeout(()=>{A(w)},DD)},[w,A,C,Dt]);ue.useEffect(()=>{if(w.promise&&Mt==="loading"||w.duration===1/0||w.type==="loading")return;let Ce;return O||j||I&&Ya?(()=>{if(hn.current<ha.current){let ke=new Date().getTime()-ha.current;Ft.current=Ft.current-ke}hn.current=new Date().getTime()})():Ft.current!==1/0&&(ha.current=new Date().getTime(),Ce=setTimeout(()=>{var ke;(ke=w.onAutoClose)==null||ke.call(w,w),st()},Ft.current)),()=>clearTimeout(Ce)},[O,j,w,Mt,I,Ya,st]),ue.useEffect(()=>{w.delete&&st()},[st,w.delete]);function Bt(){var Ce,ke,Ue;return ee!=null&&ee.loading?ue.createElement("div",{className:xa(J==null?void 0:J.loader,(Ce=w==null?void 0:w.classNames)==null?void 0:Ce.loader,"sonner-loader"),"data-visible":Mt==="loading"},ee.loading):H?ue.createElement("div",{className:xa(J==null?void 0:J.loader,(ke=w==null?void 0:w.classNames)==null?void 0:ke.loader,"sonner-loader"),"data-visible":Mt==="loading"},H):ue.createElement(dD,{className:xa(J==null?void 0:J.loader,(Ue=w==null?void 0:w.classNames)==null?void 0:Ue.loader),visible:Mt==="loading"})}return ue.createElement("li",{tabIndex:0,ref:Qt,className:xa(G,cn,J==null?void 0:J.toast,(a=w==null?void 0:w.classNames)==null?void 0:a.toast,J==null?void 0:J.default,J==null?void 0:J[Mt],(l=w==null?void 0:w.classNames)==null?void 0:l[Mt]),"data-sonner-toast":"","data-rich-colors":(s=w.richColors)!=null?s:U,"data-styled":!(w.jsx||w.unstyled||E),"data-mounted":q,"data-promise":!!w.promise,"data-swiped":et,"data-removed":de,"data-visible":fn,"data-y-position":Js,"data-x-position":Pl,"data-index":T,"data-front":jt,"data-swiping":Te,"data-dismissible":At,"data-type":Mt,"data-invert":Nr,"data-swipe-out":De,"data-swipe-direction":he,"data-expanded":!!(O||Q&&q),style:{"--index":T,"--toasts-before":T,"--z-index":D.length-T,"--offset":`${de?Le:Dt.current}px`,"--initial-height":Q?"auto":`${kt}px`,...$,...w.style},onDragEnd:()=>{je(!1),re(null),Tt.current=null},onPointerDown:Ce=>{vt||!At||(on.current=new Date,Ie(Dt.current),Ce.target.setPointerCapture(Ce.pointerId),Ce.target.tagName!=="BUTTON"&&(je(!0),Tt.current={x:Ce.clientX,y:Ce.clientY}))},onPointerUp:()=>{var Ce,ke,Ue,gt;if(De||!At)return;Tt.current=null;let Ct=Number(((Ce=Qt.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ct=Number(((ke=Qt.current)==null?void 0:ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),$t=new Date().getTime()-((Ue=on.current)==null?void 0:Ue.getTime()),xt=F==="x"?Ct:ct,zt=Math.abs(xt)/$t;if(Math.abs(xt)>=AD||zt>.11){Ie(Dt.current),(gt=w.onDismiss)==null||gt.call(w,w),ge(F==="x"?Ct>0?"right":"left":ct>0?"down":"up"),st(),Fe(!0),le(!1);return}je(!1),re(null)},onPointerMove:Ce=>{var ke,Ue,gt,Ct;if(!Tt.current||!At||((ke=window.getSelection())==null?void 0:ke.toString().length)>0)return;let ct=Ce.clientY-Tt.current.y,$t=Ce.clientX-Tt.current.x,xt=(Ue=n.swipeDirections)!=null?Ue:OD(se);!F&&(Math.abs($t)>1||Math.abs(ct)>1)&&re(Math.abs($t)>Math.abs(ct)?"x":"y");let zt={x:0,y:0};F==="y"?(xt.includes("top")||xt.includes("bottom"))&&(xt.includes("top")&&ct<0||xt.includes("bottom")&&ct>0)&&(zt.y=ct):F==="x"&&(xt.includes("left")||xt.includes("right"))&&(xt.includes("left")&&$t<0||xt.includes("right")&&$t>0)&&(zt.x=$t),(Math.abs(zt.x)>0||Math.abs(zt.y)>0)&&le(!0),(gt=Qt.current)==null||gt.style.setProperty("--swipe-amount-x",`${zt.x}px`),(Ct=Qt.current)==null||Ct.style.setProperty("--swipe-amount-y",`${zt.y}px`)}},Gn&&!w.jsx?ue.createElement("button",{"aria-label":z,"data-disabled":vt,"data-close-button":!0,onClick:vt||!At?()=>{}:()=>{var Ce;st(),(Ce=w.onDismiss)==null||Ce.call(w,w)},className:xa(J==null?void 0:J.closeButton,(c=w==null?void 0:w.classNames)==null?void 0:c.closeButton)},(u=ee==null?void 0:ee.close)!=null?u:gD):null,w.jsx||m.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ue.createElement(ue.Fragment,null,Mt||w.icon||w.promise?ue.createElement("div",{"data-icon":"",className:xa(J==null?void 0:J.icon,(f=w==null?void 0:w.classNames)==null?void 0:f.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||Bt():null,w.type!=="loading"?w.icon||(ee==null?void 0:ee[Mt])||cD(Mt):null):null,ue.createElement("div",{"data-content":"",className:xa(J==null?void 0:J.content,(p=w==null?void 0:w.classNames)==null?void 0:p.content)},ue.createElement("div",{"data-title":"",className:xa(J==null?void 0:J.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?ue.createElement("div",{"data-description":"",className:xa(ie,fa,J==null?void 0:J.description,(v=w==null?void 0:w.classNames)==null?void 0:v.description)},typeof w.description=="function"?w.description():w.description):null),m.isValidElement(w.cancel)?w.cancel:w.cancel&&Hc(w.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||X,onClick:Ce=>{var ke,Ue;Hc(w.cancel)&&At&&((Ue=(ke=w.cancel).onClick)==null||Ue.call(ke,Ce),st())},className:xa(J==null?void 0:J.cancelButton,(x=w==null?void 0:w.classNames)==null?void 0:x.cancelButton)},w.cancel.label):null,m.isValidElement(w.action)?w.action:w.action&&Hc(w.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||te,onClick:Ce=>{var ke,Ue;Hc(w.action)&&((Ue=(ke=w.action).onClick)==null||Ue.call(ke,Ce),!Ce.defaultPrevented&&st())},className:xa(J==null?void 0:J.actionButton,(y=w==null?void 0:w.classNames)==null?void 0:y.actionButton)},w.action.label):null))};function Eb(){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 kD(n,a){let l={};return[n,a].forEach((s,c)=>{let u=c===1,f=u?"--mobile-offset":"--offset",p=u?ND:RD;function g(v){["top","right","bottom","left"].forEach(x=>{l[`${f}-${x}`]=typeof v=="number"?`${v}px`:v})}typeof s=="number"||typeof s=="string"?g(s):typeof s=="object"?["top","right","bottom","left"].forEach(v=>{s[v]===void 0?l[`${f}-${v}`]=p:l[`${f}-${v}`]=typeof s[v]=="number"?`${s[v]}px`:s[v]}):g(p)}),l}var zD=m.forwardRef(function(n,a){let{invert:l,position:s="bottom-right",hotkey:c=["altKey","KeyT"],expand:u,closeButton:f,className:p,offset:g,mobileOffset:v,theme:x="light",richColors:y,duration:b,style:w,visibleToasts:E=ED,toastOptions:j,dir:C=Eb(),gap:N=MD,loadingIcon:M,icons:T,containerAriaLabel:D="Notifications",pauseWhenPageIsHidden:O}=n,[A,U]=ue.useState([]),k=ue.useMemo(()=>Array.from(new Set([s].concat(A.filter(I=>I.position).map(I=>I.position)))),[A,s]),[$,X]=ue.useState([]),[te,G]=ue.useState(!1),[ie,ce]=ue.useState(!1),[se,_]=ue.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=ue.useRef(null),Q=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),J=ue.useRef(null),ee=ue.useRef(!1),z=ue.useCallback(I=>{U(F=>{var re;return(re=F.find(he=>he.id===I.id))!=null&&re.delete||Tn.dismiss(I.id),F.filter(({id:he})=>he!==I.id)})},[]);return ue.useEffect(()=>Tn.subscribe(I=>{if(I.dismiss){U(F=>F.map(re=>re.id===I.id?{...re,delete:!0}:re));return}setTimeout(()=>{$E.flushSync(()=>{U(F=>{let re=F.findIndex(he=>he.id===I.id);return re!==-1?[...F.slice(0,re),{...F[re],...I},...F.slice(re+1)]:[I,...F]})})})}),[]),ue.useEffect(()=>{if(x!=="system"){_(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?_("dark"):_("light")),typeof window>"u")return;let I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:F})=>{_(F?"dark":"light")})}catch{I.addListener(({matches:re})=>{try{_(re?"dark":"light")}catch(he){console.error(he)}})}},[x]),ue.useEffect(()=>{A.length<=1&&G(!1)},[A]),ue.useEffect(()=>{let I=F=>{var re,he;c.every(ge=>F[ge]||F.code===ge)&&(G(!0),(re=H.current)==null||re.focus()),F.code==="Escape"&&(document.activeElement===H.current||(he=H.current)!=null&&he.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[c]),ue.useEffect(()=>{if(H.current)return()=>{J.current&&(J.current.focus({preventScroll:!0}),J.current=null,ee.current=!1)}},[H.current]),ue.createElement("section",{ref:a,"aria-label":`${D} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((I,F)=>{var re;let[he,ge]=I.split("-");return A.length?ue.createElement("ol",{key:I,dir:C==="auto"?Eb():C,tabIndex:-1,ref:H,className:p,"data-sonner-toaster":!0,"data-theme":se,"data-y-position":he,"data-lifted":te&&A.length>1&&!u,"data-x-position":ge,style:{"--front-toast-height":`${((re=$[0])==null?void 0:re.height)||0}px`,"--width":`${TD}px`,"--gap":`${N}px`,...w,...kD(g,v)},onBlur:q=>{ee.current&&!q.currentTarget.contains(q.relatedTarget)&&(ee.current=!1,J.current&&(J.current.focus({preventScroll:!0}),J.current=null))},onFocus:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||ee.current||(ee.current=!0,J.current=q.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{ie||G(!1)},onDragEnd:()=>G(!1),onPointerDown:q=>{q.target instanceof HTMLElement&&q.target.dataset.dismissible==="false"||ce(!0)},onPointerUp:()=>ce(!1)},A.filter(q=>!q.position&&F===0||q.position===I).map((q,oe)=>{var de,fe;return ue.createElement(_D,{key:q.id,icons:T,index:oe,toast:q,defaultRichColors:y,duration:(de=j==null?void 0:j.duration)!=null?de:b,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:l,visibleToasts:E,closeButton:(fe=j==null?void 0:j.closeButton)!=null?fe:f,interacting:ie,position:I,style:j==null?void 0:j.style,unstyled:j==null?void 0:j.unstyled,classNames:j==null?void 0:j.classNames,cancelButtonStyle:j==null?void 0:j.cancelButtonStyle,actionButtonStyle:j==null?void 0:j.actionButtonStyle,removeToast:z,toasts:A.filter(Te=>Te.position==q.position),heights:$.filter(Te=>Te.position==q.position),setHeights:X,expandByDefault:u,gap:N,loadingIcon:M,expanded:te,pauseWhenPageIsHidden:O,swipeDirections:n.swipeDirections})})):null}))});function LD(){const{login:n}=_m(),[a,l]=m.useState("admin"),[s,c]=m.useState(""),[u,f]=m.useState(""),[p,g]=m.useState(""),[v,x]=m.useState(!1),[y,b]=m.useState(!1),w=oi(),E=_n();return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:o.jsxs(nt,{className:"w-full max-w-sm",children:[o.jsxs(at,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain"}),o.jsx(rt,{children:"Sign in"})]}),o.jsx(gn,{children:"Enter your admin credentials."})]}),o.jsxs(lt,{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(we,{children:"Username"}),o.jsx(Ae,{value:a,onChange:j=>l(j.target.value),autoFocus:!0})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(we,{children:"Password"}),o.jsx(Ae,{type:"password",value:s,onChange:j=>c(j.target.value)})]}),v&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(we,{children:"2FA code (or recovery code)"}),o.jsx(Ae,{value:u,onChange:j=>f(j.target.value),placeholder:"123456",maxLength:6})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(we,{children:"Recovery code (alternative)"}),o.jsx(Ae,{value:p,onChange:j=>g(j.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),o.jsx("div",{className:"px-6 pb-6",children:o.jsx(me,{className:"w-full",disabled:y,onClick:async()=>{var j,C;b(!0);try{if((await n(a,s,u||void 0,p||void 0)).totpRequired){x(!0);return}const M=((C=(j=E.state)==null?void 0:j.from)==null?void 0:C.pathname)??"/";w(M,{replace:!0})}catch(N){ve.error(N.message)}finally{b(!1)}},children:"Sign in"})})]})})}function UD(){const[n,a]=m.useState("admin"),[l,s]=m.useState(""),[c,u]=m.useState(""),[f,p]=m.useState(!1),[g,v]=m.useState(!0),[x,y]=m.useState(null),[b,w]=m.useState(""),[E,j]=m.useState(!1);m.useEffect(()=>{Se.get("/api/admin/setup/status").then(M=>v(!M.masterKeyConfigured)).catch(()=>v(!0))},[]);const C=!g||c.trim().length>=32,N=!f&&l.length>=12&&C;return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:o.jsxs(nt,{className:"w-full max-w-md",children:[o.jsxs(at,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain rounded"}),o.jsx(rt,{children:"Welcome to LateDev Router"})]}),o.jsx(gn,{children:"Set up the administrator account to get started."})]}),o.jsxs(lt,{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(we,{children:"Username"}),o.jsx(Ae,{value:n,onChange:M=>a(M.target.value)})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(we,{children:"Password (12+ chars)"}),o.jsx(Ae,{type:"password",value:l,onChange:M=>s(M.target.value)})]}),g&&o.jsxs("div",{className:"space-y-1",children:[o.jsx(we,{children:"Master encryption key (required, 32+ chars)"}),o.jsx(Ae,{type:"password",value:c,onChange:M=>u(M.target.value),placeholder:"Paste or generate a 32+ character key"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Provider API keys are encrypted with this key (AES-256-GCM). Store it somewhere safe — if it is lost, stored provider credentials cannot be recovered. Generate one with:"," ",o.jsx("code",{className:"break-all",children:`node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"`})]})]})]}),o.jsxs(jw,{className:"flex-col items-stretch gap-4",children:[o.jsx(me,{disabled:!N,onClick:async()=>{p(!0);try{await Se.post("/api/admin/setup",{username:n,password:l,setupMasterKey:g?c.trim():void 0}),ve.success("Admin account created"),window.location.assign("/login")}catch(M){ve.error(M.message)}finally{p(!1)}},children:"Create admin"}),o.jsxs("div",{className:"border-t pt-4 space-y-2",children:[o.jsx(we,{children:"Import existing database"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Use this to restore the administrator account, password, TOTP settings, providers, models, and master key from a backup without setting up again. Enter the same 6-digit backup passphrase used when the file was created."}),o.jsx(Ae,{type:"file",accept:".json,application/json",onChange:M=>{var T;return y(((T=M.target.files)==null?void 0:T[0])??null)}}),o.jsx(Ae,{inputMode:"numeric",maxLength:6,value:b,onChange:M=>w(M.target.value.replace(/\D/g,"")),placeholder:"Backup passphrase (6 digits)"}),o.jsx(me,{variant:"outline",disabled:!x||b.length!==6||E,onClick:async()=>{var M,T;if(x){j(!0);try{const D=JSON.parse(await x.text()),O=await fetch("/api/admin/backup/restore",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({backup:D,passphrase:b})});if(!O.ok)throw new Error(((T=(M=await O.json())==null?void 0:M.error)==null?void 0:T.message)??"Import failed");ve.success("Database imported"),window.location.assign("/login")}catch(D){ve.error(D.message)}finally{j(!1)}}},children:"Import database"})]})]})]})})}function $a({title:n,description:a,actions:l,className:s}){return o.jsxs("div",{className:Ee("mb-6 flex items-start justify-between gap-4",s),children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:n}),a&&o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a})]}),l&&o.jsx("div",{className:"flex items-center gap-2",children:l})]})}const BD=K0("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",success:"border-transparent bg-emerald-600 text-white",warning:"border-transparent bg-amber-500 text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Qe({className:n,variant:a,...l}){return o.jsx("div",{className:Ee(BD({variant:a}),n),...l})}const Oh=n=>n==="ready"||n==="healthy"?"success":n==="disabled"?"secondary":"destructive";function HD(){const[n,a]=m.useState(null);return m.useEffect(()=>{Se.get("/api/admin/dashboard").then(a).catch(()=>a(null))},[]),n?o.jsxs("div",{children:[o.jsx($a,{title:"Dashboard",description:"Operational summary for today",actions:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(me,{asChild:!0,variant:"outline",size:"sm",children:o.jsxs(ra,{to:"/providers",children:[o.jsx(Su,{className:"mr-1 h-4 w-4"})," Provider"]})}),o.jsx(me,{asChild:!0,variant:"outline",size:"sm",children:o.jsxs(ra,{to:"/combos",children:[o.jsx(T0,{className:"mr-1 h-4 w-4"})," Combo"]})}),o.jsx(me,{asChild:!0,variant:"outline",size:"sm",children:o.jsxs(ra,{to:"/api-keys",children:[o.jsx(N0,{className:"mr-1 h-4 w-4"})," API Key"]})})]})}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[o.jsxs(nt,{children:[o.jsx(at,{className:"pb-1",children:o.jsx(rt,{className:"text-sm text-muted-foreground",children:"Requests today"})}),o.jsx(lt,{className:"text-2xl font-semibold",children:Kt(n.today.total)})]}),o.jsxs(nt,{children:[o.jsx(at,{className:"pb-1",children:o.jsx(rt,{className:"text-sm text-muted-foreground",children:"Success rate"})}),o.jsx(lt,{className:"text-2xl font-semibold",children:n.today.total?Eu(n.today.success/n.today.total):"—"})]}),o.jsxs(nt,{children:[o.jsx(at,{className:"pb-1",children:o.jsx(rt,{className:"text-sm text-muted-foreground",children:"Failed"})}),o.jsx(lt,{className:"text-2xl font-semibold",children:Kt(n.today.failed)})]}),o.jsxs(nt,{children:[o.jsx(at,{className:"pb-1",children:o.jsx(rt,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),o.jsx(lt,{className:"text-2xl font-semibold",children:Kt(n.today.totalTokens)})]})]}),o.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[o.jsxs(nt,{children:[o.jsxs(at,{children:[o.jsx(rt,{className:"text-base",children:"Provider health"}),o.jsxs(gn,{children:[n.providers.length," configured"]})]}),o.jsxs(lt,{className:"space-y-2",children:[n.providers.length===0&&o.jsxs("p",{className:"text-sm text-muted-foreground",children:["No providers yet. ",o.jsx(ra,{to:"/providers",className:"text-primary",children:"Add one"}),"."]}),n.providers.map(l=>o.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(M0,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),o.jsx(ra,{className:"truncate font-medium text-primary hover:underline",to:`/providers?providerId=${encodeURIComponent(l.id)}`,children:l.name}),o.jsx("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:l.slug}),o.jsx(Qe,{variant:"outline",className:"ml-2",children:l.type})]}),o.jsx(Qe,{variant:Oh(l.health),children:l.health})]},l.id))]})]}),o.jsxs(nt,{children:[o.jsxs(at,{children:[o.jsx(rt,{className:"text-base",children:"Recent failures"}),o.jsx(gn,{children:"Today"})]}),o.jsxs(lt,{className:"space-y-1 text-sm",children:[n.recentFailures.length===0&&o.jsx("p",{className:"text-muted-foreground",children:"No failures today."}),n.recentFailures.map(l=>{var s;return o.jsxs("div",{className:"flex items-center justify-between border-b py-1 last:border-0",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-mono text-xs",children:l.requestedModel}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.errorType??`HTTP ${l.httpStatus}`," — ",(s=l.errorMessage)==null?void 0:s.slice(0,60)]})]}),o.jsx("span",{className:"text-xs text-muted-foreground",children:Lm(l.createdAt)})]},l.id)})]})]})]}),o.jsxs(nt,{className:"mt-6",children:[o.jsxs(at,{children:[o.jsxs(rt,{className:"flex items-center gap-2 text-base",children:[o.jsx(km,{className:"h-4 w-4"})," Health center"]}),o.jsx(gn,{children:"Passive status from recent traffic; no active provider polling."})]}),o.jsxs(lt,{className:"grid gap-4 lg:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-sm font-medium",children:"Combos"}),o.jsx("div",{className:"space-y-2",children:n.combos.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"No combos configured."}):n.combos.map(l=>o.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx(ra,{className:"font-mono text-xs text-primary hover:underline",to:"/combos",children:l.publicModelId}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.readyMembers,"/",l.memberCount," members ready",l.reasons.length>0?` · ${l.reasons.join(", ")}`:""]})]}),o.jsx(Qe,{variant:Oh(l.state),children:l.state})]},l.id))})]}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-sm font-medium",children:"Models"}),o.jsx("div",{className:"max-h-64 space-y-2 overflow-auto",children:n.models.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"No models imported."}):n.models.map(l=>o.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx(ra,{className:"font-mono text-xs text-primary hover:underline",to:`/models?providerId=${encodeURIComponent(l.providerId)}`,children:l.publicModelId}),o.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:[l.providerName??"Unknown provider",l.lastFailureReason?` · last: ${l.lastFailureReason}`:""]})]}),o.jsx(Qe,{variant:Oh(l.state),children:l.state})]},l.id))})]})]})]})]}):o.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const ca=m.forwardRef(({className:n,...a},l)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:l,className:Ee("w-full caption-bottom text-sm",n),...a})}));ca.displayName="Table";const ua=m.forwardRef(({className:n,...a},l)=>o.jsx("thead",{ref:l,className:Ee("[&_tr]:border-b",n),...a}));ua.displayName="TableHeader";const da=m.forwardRef(({className:n,...a},l)=>o.jsx("tbody",{ref:l,className:Ee("[&_tr:last-child]:border-0",n),...a}));da.displayName="TableBody";const We=m.forwardRef(({className:n,...a},l)=>o.jsx("tr",{ref:l,className:Ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...a}));We.displayName="TableRow";const ye=m.forwardRef(({className:n,...a},l)=>o.jsx("th",{ref:l,className:Ee("h-10 px-2 text-left align-middle font-medium text-muted-foreground",n),...a}));ye.displayName="TableHead";const pe=m.forwardRef(({className:n,...a},l)=>o.jsx("td",{ref:l,className:Ee("p-2 align-middle",n),...a}));pe.displayName="TableCell";var ID=Object.defineProperty,Yn=(n,a)=>ID(n,"name",{value:a,configurable:!0}),rp="Dialog",[Cw,Ew]=kn(rp),[PD,Na]=Cw(rp),Rw=Yn(n=>{const{__scopeDialog:a,children:l,open:s,defaultOpen:c,onOpenChange:u,modal:f=!0}=n,p=m.useRef(null),g=m.useRef(null),[v,x]=yr({prop:s,defaultProp:c??!1,onChange:u,caller:rp}),[y,b]=m.useState(0),[w,E]=m.useState(0);return o.jsx(PD,{scope:a,triggerRef:p,contentRef:g,contentId:La(),titleId:La(),descriptionId:La(),titlePresent:y>0,descriptionPresent:w>0,setTitleCount:b,setDescriptionCount:E,open:v,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(j=>!j),[x]),modal:f,children:l})},"Dialog"),qD="DialogTrigger",Nw=m.forwardRef(Yn(function(a,l){const{__scopeDialog:s,...c}=a,u=Na(qD,s),f=Xe(l,u.triggerRef);return o.jsx(Ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":Iu(u.open),...c,ref:f,onClick:Ne(a.onClick,u.onOpenToggle)})},"DialogTrigger")),Tw="DialogPortal",[VD,Mw]=Cw(Tw,{forceMount:void 0}),Aw=Yn(n=>{const{__scopeDialog:a,forceMount:l,children:s,container:c}=n,u=Na(Tw,a);return o.jsx(VD,{scope:a,forceMount:l,children:m.Children.map(s,f=>o.jsx(Cr,{present:l||u.open,children:o.jsx(Zm,{asChild:!0,container:c,children:f})}))})},"DialogPortal"),om="DialogOverlay",lp=m.forwardRef(Yn(function(a,l){const s=Mw(om,a.__scopeDialog),{forceMount:c=s.forceMount,...u}=a,f=Na(om,a.__scopeDialog);return f.modal?o.jsx(Cr,{present:c||f.open,children:o.jsx(YD,{...u,ref:l})}):null},"DialogOverlay")),$D=Ha("DialogOverlay.RemoveScroll"),YD=m.forwardRef(Yn(function(a,l){const{__scopeDialog:s,...c}=a,u=Na(om,s),f=o1(),p=Xe(l,f);return o.jsx(Bu,{as:$D,allowPinchZoom:!0,shards:[u.contentRef],children:o.jsx(Ve.div,{"data-state":Iu(u.open),...c,ref:p,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),ei="DialogContent",sp=m.forwardRef(Yn(function(a,l){const s=Mw(ei,a.__scopeDialog),{forceMount:c=s.forceMount,...u}=a,f=Na(ei,a.__scopeDialog);return o.jsx(Cr,{present:c||f.open,children:f.modal?o.jsx(GD,{...u,ref:l}):o.jsx(KD,{...u,ref:l})})},"DialogContent")),GD=m.forwardRef(Yn(function(a,l){const s=Na(ei,a.__scopeDialog),c=m.useRef(null),u=Xe(l,s.contentRef,c);return m.useEffect(()=>{const f=c.current;if(f)return ep(f)},[]),o.jsx(Dw,{...a,ref:u,trapFocus:s.open,disableOutsidePointerEvents:s.open,onCloseAutoFocus:Ne(a.onCloseAutoFocus,f=>{var p;f.preventDefault(),(p=s.triggerRef.current)==null||p.focus()}),onPointerDownOutside:Ne(a.onPointerDownOutside,f=>{const p=f.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&f.preventDefault()}),onFocusOutside:Ne(a.onFocusOutside,f=>f.preventDefault())})},"DialogContentModal")),KD=m.forwardRef(Yn(function(a,l){const s=Na(ei,a.__scopeDialog),c=m.useRef(!1),u=m.useRef(!1);return o.jsx(Dw,{...a,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:f=>{var p,g;(p=a.onCloseAutoFocus)==null||p.call(a,f),f.defaultPrevented||(c.current||(g=s.triggerRef.current)==null||g.focus(),f.preventDefault()),c.current=!1,u.current=!1},onInteractOutside:f=>{var v,x;(v=a.onInteractOutside)==null||v.call(a,f),f.defaultPrevented||(c.current=!0,f.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const p=f.target;((x=s.triggerRef.current)==null?void 0:x.contains(p))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&u.current&&f.preventDefault()}})},"DialogContentNonModal")),Dw=m.forwardRef(Yn(function(a,l){const{__scopeDialog:s,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,...p}=a,g=Na(ei,s);return fi(),o.jsx(o.Fragment,{children:o.jsx(qm,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:u,onUnmountAutoFocus:f,children:o.jsx(Nu,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Iu(g.open),...p,ref:l,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),XD="DialogTitle",op=m.forwardRef(Yn(function(a,l){const{__scopeDialog:s,...c}=a,u=Na(XD,s),{setTitleCount:f}=u;return Xt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),o.jsx(Ve.h2,{id:u.titleId,...c,ref:l})},"DialogTitle")),FD="DialogDescription",ip=m.forwardRef(Yn(function(a,l){const{__scopeDialog:s,...c}=a,u=Na(FD,s),{setDescriptionCount:f}=u;return Xt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),o.jsx(Ve.p,{id:u.descriptionId,...c,ref:l})},"DialogDescription")),QD="DialogClose",cp=m.forwardRef(Yn(function(a,l){const{__scopeDialog:s,...c}=a,u=Na(QD,s);return o.jsx(Ve.button,{type:"button",...c,ref:l,onClick:Ne(a.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function Iu(n){return n?"open":"closed"}Yn(Iu,"getState");const Mn=Rw,mi=Nw,ZD=Aw,Ow=m.forwardRef(({className:n,...a},l)=>o.jsx(lp,{ref:l,className:Ee("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...a}));Ow.displayName=lp.displayName;const vn=m.forwardRef(({className:n,children:a,...l},s)=>o.jsxs(ZD,{children:[o.jsx(Ow,{}),o.jsxs(sp,{ref:s,className:Ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 sm:rounded-lg",n),...l,children:[a,o.jsxs(cp,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[o.jsx(Cu,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));vn.displayName=sp.displayName;const xn=({className:n,...a})=>o.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",n),...a});xn.displayName="DialogHeader";const An=({className:n,...a})=>o.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a});An.displayName="DialogFooter";const yn=m.forwardRef(({className:n,...a},l)=>o.jsx(op,{ref:l,className:Ee("text-lg font-semibold leading-none tracking-tight",n),...a}));yn.displayName=op.displayName;const uu=m.forwardRef(({className:n,...a},l)=>o.jsx(ip,{ref:l,className:Ee("text-sm text-muted-foreground",n),...a}));uu.displayName=ip.displayName;var JD=Object.defineProperty,Er=(n,a)=>JD(n,"name",{value:a,configurable:!0}),WD="AlertDialog",[eO,Y4]=kn(WD,[Ew]),Rr=Ew(),tO=Er(n=>{const{__scopeAlertDialog:a,...l}=n,s=Rr(a);return o.jsx(Rw,{...s,...l,modal:!0})},"AlertDialog"),nO=m.forwardRef(Er(function(a,l){const{__scopeAlertDialog:s,...c}=a,u=Rr(s);return o.jsx(Nw,{...u,...c,ref:l})},"AlertDialogTrigger")),aO=Er(n=>{const{__scopeAlertDialog:a,...l}=n,s=Rr(a);return o.jsx(Aw,{...s,...l})},"AlertDialogPortal"),rO=m.forwardRef(Er(function(a,l){const{__scopeAlertDialog:s,...c}=a,u=Rr(s);return o.jsx(lp,{...u,...c,ref:l})},"AlertDialogOverlay")),lO="AlertDialogContent",[sO,oO]=eO(lO),iO=m.forwardRef(Er(function(a,l){const{__scopeAlertDialog:s,children:c,...u}=a,f=Rr(s),p=m.useRef(null),g=Xe(l,p),v=m.useRef(null);return o.jsx(sO,{scope:s,cancelRef:v,children:o.jsx(sp,{role:"alertdialog",...f,...u,ref:g,onOpenAutoFocus:Ne(u.onOpenAutoFocus,x=>{var y;x.preventDefault(),(y=v.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),children:c})})},"AlertDialogContent")),cO=m.forwardRef(Er(function(a,l){const{__scopeAlertDialog:s,...c}=a,u=Rr(s);return o.jsx(op,{...u,...c,ref:l})},"AlertDialogTitle")),uO=m.forwardRef(Er(function(a,l){const{__scopeAlertDialog:s,...c}=a,u=Rr(s);return o.jsx(ip,{...u,...c,ref:l})},"AlertDialogDescription")),dO=m.forwardRef(Er(function(a,l){const{__scopeAlertDialog:s,...c}=a,u=Rr(s);return o.jsx(cp,{...u,...c,ref:l})},"AlertDialogAction")),fO="AlertDialogCancel",hO=m.forwardRef(Er(function(a,l){const{__scopeAlertDialog:s,...c}=a,{cancelRef:u}=oO(fO,s),f=Rr(s),p=Xe(l,u);return o.jsx(cp,{...f,...c,ref:p})},"AlertDialogCancel")),mO=tO,pO=nO,gO=aO,_w=rO,kw=iO,zw=dO,Lw=hO,Uw=cO,Bw=uO;const up=mO,vO=pO,xO=gO,Hw=m.forwardRef(({className:n,...a},l)=>o.jsx(_w,{ref:l,className:Ee("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...a}));Hw.displayName=_w.displayName;const Pu=m.forwardRef(({className:n,...a},l)=>o.jsxs(xO,{children:[o.jsx(Hw,{}),o.jsx(kw,{ref:l,className:Ee("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:max-w-[425px]",n),...a})]}));Pu.displayName=kw.displayName;const dp=({className:n,...a})=>o.jsx("div",{className:Ee("flex flex-col space-y-2 text-center sm:text-left",n),...a}),fp=({className:n,...a})=>o.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a}),qu=m.forwardRef(({className:n,...a},l)=>o.jsx(Uw,{ref:l,className:Ee("text-lg font-semibold",n),...a}));qu.displayName=Uw.displayName;const Vu=m.forwardRef(({className:n,...a},l)=>o.jsx(Bw,{ref:l,className:Ee("text-sm text-muted-foreground",n),...a}));Vu.displayName=Bw.displayName;const $u=m.forwardRef(({className:n,...a},l)=>o.jsx(zw,{ref:l,className:Ee("inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",n),...a}));$u.displayName=zw.displayName;const Yu=m.forwardRef(({className:n,...a},l)=>o.jsx(Lw,{ref:l,className:Ee("inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium hover:bg-accent",n),...a}));Yu.displayName=Lw.displayName;var yO=Object.defineProperty,bO=(n,a)=>yO(n,"name",{value:a,configurable:!0});function im(n,[a,l]){return Math.min(l,Math.max(a,n))}bO(im,"clamp");var wO=Object.defineProperty,SO=(n,a)=>wO(n,"name",{value:a,configurable:!0});function Iw(n){const a=m.useRef({value:n,previous:n});return m.useMemo(()=>(a.current.value!==n&&(a.current.previous=a.current.value,a.current.value=n),a.current.previous),[n])}SO(Iw,"usePrevious");var jO=Object.defineProperty,CO=(n,a)=>jO(n,"name",{value:a,configurable:!0}),Pw=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"}),EO=m.forwardRef(CO(function(a,l){return o.jsx(Ve.span,{...a,ref:l,style:{...Pw,...a.style}})},"VisuallyHidden")),RO=EO,NO=Object.defineProperty,ht=(n,a)=>NO(n,"name",{value:a,configurable:!0}),TO=[" ","Enter","ArrowUp","ArrowDown"],MO=[" ","Enter"],Bs="Select",[Gu,hp,AO]=Ru(Bs),[Il,G4]=kn(Bs,[AO,Ks]),mp=Ks(),[DO,ul]=Il(Bs),[OO,_O]=Il(Bs);function qw(n){const{__scopeSelect:a,children:l,open:s,defaultOpen:c,onOpenChange:u,value:f,defaultValue:p,onValueChange:g,dir:v,name:x,autoComplete:y,disabled:b,required:w,form:E,internal_do_not_use_render:j}=n,C=mp(a),[N,M]=m.useState(null),[T,D]=m.useState(null),[O,A]=m.useState(!1),U=di(v),[k,$]=yr({prop:s,defaultProp:c??!1,onChange:u,caller:Bs}),[X,te]=yr({prop:f,defaultProp:p,onChange:g,caller:Bs}),G=m.useRef(null),ie=m.useRef(X);m.useEffect(()=>{const I=E?N==null?void 0:N.ownerDocument.getElementById(E):N==null?void 0:N.form;if(I instanceof HTMLFormElement){const F=ht(()=>te(ie.current),"reset");return I.addEventListener("reset",F),()=>I.removeEventListener("reset",F)}},[E,N,te]);const ce=N?!!E||!!N.closest("form"):!0,[se,_]=m.useState(new Set),H=La(),Q=Array.from(se).map(I=>I.props.value).join(";"),J=m.useCallback(I=>{_(F=>new Set(F).add(I))},[]),ee=m.useCallback(I=>{_(F=>{const re=new Set(F);return re.delete(I),re})},[]),z={required:w,trigger:N,onTriggerChange:M,valueNode:T,onValueNodeChange:D,valueNodeHasChildren:O,onValueNodeHasChildrenChange:A,contentId:H,value:X,onValueChange:te,open:k,onOpenChange:$,dir:U,triggerPointerDownPosRef:G,disabled:b,name:x,autoComplete:y,form:E,nativeOptions:se,nativeSelectKey:Q,isFormControl:ce};return o.jsx(O1,{...C,children:o.jsx(DO,{scope:a,...z,children:o.jsx(Gu.Provider,{scope:a,children:o.jsx(OO,{scope:a,onNativeOptionAdd:J,onNativeOptionRemove:ee,children:Xw(j)?j(z):l})})})})}ht(qw,"SelectProvider");var kO=ht(n=>{const{__scopeSelect:a,children:l,...s}=n;return o.jsx(qw,{__scopeSelect:a,...s,internal_do_not_use_render:({isFormControl:c})=>o.jsxs(o.Fragment,{children:[l,c?o.jsx(n_,{__scopeSelect:a}):null]})})},"Select"),zO="SelectTrigger",Vw=m.forwardRef(ht(function(a,l){const{__scopeSelect:s,disabled:c=!1,...u}=a,f=mp(s),p=ul(zO,s),g=p.disabled||c,v=Xe(l,p.onTriggerChange),x=hp(s),y=m.useRef("touch"),[b,w,E]=pp(C=>{const N=x().filter(D=>!D.disabled),M=N.find(D=>D.value===p.value),T=gp(N,C,M);T!==void 0&&p.onValueChange(T.value)}),j=ht(C=>{g||(p.onOpenChange(!0),E()),C&&(p.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return o.jsx(_1,{asChild:!0,...f,children:o.jsx(Ve.button,{type:"button",role:"combobox","aria-controls":p.open?p.contentId:void 0,"aria-expanded":p.open,"aria-required":p.required,"aria-autocomplete":"none",dir:p.dir,"data-state":p.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":pi(p.value)?"":void 0,...u,ref:v,onClick:Ne(u.onClick,C=>{C.currentTarget.focus(),y.current!=="mouse"&&j(C)}),onPointerDown:Ne(u.onPointerDown,C=>{y.current=C.pointerType;const N=C.target;N.hasPointerCapture(C.pointerId)&&N.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(j(C),C.preventDefault())}),onKeyDown:Ne(u.onKeyDown,C=>{const N=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&w(C.key),!(N&&C.key===" ")&&TO.includes(C.key)&&(j(),C.preventDefault())})})})},"SelectTrigger")),LO="SelectValue",UO=m.forwardRef(ht(function(a,l){const{__scopeSelect:s,className:c,style:u,children:f,placeholder:p="",...g}=a,v=ul(LO,s),{onValueNodeHasChildrenChange:x}=v,y=f!==void 0,b=Xe(l,v.onValueNodeChange);Xt(()=>{x(y)},[x,y]);const w=pi(v.value);return o.jsx(Ve.span,{...g,asChild:w?!1:g.asChild,ref:b,style:{pointerEvents:"none"},children:o.jsx(m.Fragment,{children:w?p:f},w?"placeholder":"value")})},"SelectValue")),BO=m.forwardRef(ht(function(a,l){const{__scopeSelect:s,children:c,...u}=a;return o.jsx(Ve.span,{"aria-hidden":!0,...u,ref:l,children:c||"▼"})},"SelectIcon")),HO="SelectPortal",[IO,PO]=Il(HO,{forceMount:void 0}),qO=ht(n=>{const{__scopeSelect:a,forceMount:l,...s}=n;return o.jsx(IO,{scope:n.__scopeSelect,forceMount:l,children:o.jsx(Zm,{asChild:!0,...s})})},"SelectPortal"),zl="SelectContent",$w=m.forwardRef(ht(function(a,l){const s=PO(zl,a.__scopeSelect),{forceMount:c=s.forceMount,...u}=a,f=ul(zl,a.__scopeSelect),[p,g]=m.useState();return Xt(()=>{g(new DocumentFragment)},[]),o.jsx(Cr,{present:c||f.open,children:({present:v})=>v?o.jsx(YO,{...u,ref:l}):o.jsx(VO,{...u,fragment:p})})},"SelectContent")),VO=m.forwardRef(ht(function(a,l){const{__scopeSelect:s,children:c,fragment:u}=a;return u?ba.createPortal(o.jsx(Yw,{scope:s,children:o.jsx(Gu.Slot,{scope:s,children:o.jsx("div",{ref:l,children:c})})}),u):null},"SelectContentFragment")),ya=10,[Yw,Ku]=Il(zl),$O=Ha("SelectContent.RemoveScroll"),YO=m.forwardRef(ht(function(a,l){const{__scopeSelect:s}=a,{position:c="item-aligned",onCloseAutoFocus:u,onEscapeKeyDown:f,onPointerDownOutside:p,side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:E,sticky:j,hideWhenDetached:C,avoidCollisions:N,...M}=a,T=ul(zl,s),[D,O]=m.useState(null),[A,U]=m.useState(null),k=Xe(l,O),[$,X]=m.useState(null),[te,G]=m.useState(null),ie=hp(s),[ce,se]=m.useState(!1),_=m.useRef(!1);m.useEffect(()=>{if(D)return ep(D)},[D]),fi();const H=m.useCallback(oe=>{const[de,...fe]=ie().map(De=>De.ref.current),[Te]=fe.slice(-1),je=document.activeElement;for(const De of oe)if(De===je||(De==null||De.scrollIntoView({block:"nearest"}),De===de&&A&&(A.scrollTop=0),De===Te&&A&&(A.scrollTop=A.scrollHeight),De==null||De.focus(),document.activeElement!==je))return},[ie,A]),Q=m.useCallback(()=>H([$,D]),[H,$,D]);m.useEffect(()=>{ce&&Q()},[ce,Q]);const{onOpenChange:J,triggerPointerDownPosRef:ee}=T;m.useEffect(()=>{if(D){let oe={x:0,y:0};const de=ht(Te=>{var je,De;oe={x:Math.abs(Math.round(Te.pageX)-(((je=ee.current)==null?void 0:je.x)??0)),y:Math.abs(Math.round(Te.pageY)-(((De=ee.current)==null?void 0:De.y)??0))}},"handlePointerMove"),fe=ht(Te=>{oe.x<=10&&oe.y<=10?Te.preventDefault():Te.composedPath().includes(D)||J(!1),document.removeEventListener("pointermove",de),ee.current=null},"handlePointerUp");return ee.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",fe,{capture:!0})}}},[D,J,ee]),m.useEffect(()=>{const oe=ht(()=>J(!1),"close");return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[J]);const[z,I]=pp(oe=>{const de=ie().filter(je=>!je.disabled),fe=de.find(je=>je.ref.current===document.activeElement),Te=gp(de,oe,fe);Te&&setTimeout(()=>{var je;return(je=Te.ref.current)==null?void 0:je.focus()})}),F=m.useCallback((oe,de,fe)=>{const Te=!_.current&&!fe;(T.value!==void 0&&T.value===de||Te)&&(X(oe),Te&&(_.current=!0))},[T.value]),re=m.useCallback(()=>D==null?void 0:D.focus(),[D]),he=m.useCallback((oe,de,fe)=>{const Te=!_.current&&!fe;(T.value!==void 0&&T.value===de||Te)&&G(oe)},[T.value]),ge=c==="popper"?Rb:GO,q=ge===Rb?{side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:E,sticky:j,hideWhenDetached:C,avoidCollisions:N}:{};return o.jsx(Yw,{scope:s,content:D,viewport:A,onViewportChange:U,itemRefCallback:F,selectedItem:$,onItemLeave:re,itemTextRefCallback:he,focusSelectedItem:Q,selectedItemText:te,position:c,isPositioned:ce,searchRef:z,children:o.jsx(Bu,{as:$O,allowPinchZoom:!0,children:o.jsx(qm,{asChild:!0,trapped:T.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:Ne(u,oe=>{var de;(de=T.trigger)==null||de.focus({preventScroll:!0}),oe.preventDefault()}),children:o.jsx(Nu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:o.jsx(ge,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:oe=>oe.preventDefault(),...M,...q,onPlaced:()=>se(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:Ne(M.onKeyDown,oe=>{const de=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!de&&oe.key.length===1&&I(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let Te=ie().filter(je=>!je.disabled).map(je=>je.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const je=oe.target,De=Te.indexOf(je);Te=Te.slice(De+1)}setTimeout(()=>H(Te)),oe.preventDefault()}})})})})})})},"SelectContentImpl")),GO=m.forwardRef(ht(function(a,l){const{__scopeSelect:s,onPlaced:c,...u}=a,f=ul(zl,s),p=Ku(zl,s),[g,v]=m.useState(null),[x,y]=m.useState(null),b=Xe(l,y),w=hp(s),E=m.useRef(!1),j=m.useRef(!0),{viewport:C,selectedItem:N,selectedItemText:M,focusSelectedItem:T}=p,D=m.useCallback(()=>{if(f.trigger&&f.valueNode&&g&&x&&C&&N&&M){const k=f.trigger.getBoundingClientRect(),$=x.getBoundingClientRect(),X=f.valueNode.getBoundingClientRect(),te=M.getBoundingClientRect();if(f.dir!=="rtl"){const je=te.left-$.left,De=X.left-je,Fe=k.left-De,et=k.width+Fe,le=Math.max(et,$.width),Le=window.innerWidth-ya,Ie=im(De,[ya,Math.max(ya,Le-le)]);g.style.minWidth=et+"px",g.style.left=Ie+"px"}else{const je=$.right-te.right,De=window.innerWidth-X.right-je,Fe=window.innerWidth-k.right-De,et=k.width+Fe,le=Math.max(et,$.width),Le=window.innerWidth-ya,Ie=im(De,[ya,Math.max(ya,Le-le)]);g.style.minWidth=et+"px",g.style.right=Ie+"px"}const G=w(),ie=window.innerHeight-ya*2,ce=C.scrollHeight,se=window.getComputedStyle(x),_=parseInt(se.borderTopWidth,10),H=parseInt(se.paddingTop,10),Q=parseInt(se.borderBottomWidth,10),J=parseInt(se.paddingBottom,10),ee=_+H+ce+J+Q,z=Math.min(N.offsetHeight*5,ee),I=window.getComputedStyle(C),F=parseInt(I.paddingTop,10),re=parseInt(I.paddingBottom,10),he=k.top+k.height/2-ya,ge=ie-he,q=N.offsetHeight/2,oe=N.offsetTop+q,de=_+H+oe,fe=ee-de;if(de<=he){const je=G.length>0&&N===G[G.length-1].ref.current;g.style.bottom="0px";const De=x.clientHeight-C.offsetTop-C.offsetHeight,Fe=Math.max(ge,q+(je?re:0)+De+Q),et=de+Fe;g.style.height=et+"px"}else{const je=G.length>0&&N===G[0].ref.current;g.style.top="0px";const Fe=Math.max(he,_+C.offsetTop+(je?F:0)+q)+fe;g.style.height=Fe+"px",C.scrollTop=de-he+C.offsetTop}g.style.margin=`${ya}px 0`,g.style.minHeight=z+"px",g.style.maxHeight=ie+"px",c==null||c(),requestAnimationFrame(()=>E.current=!0)}},[w,f.trigger,f.valueNode,g,x,C,N,M,f.dir,c]);Xt(()=>D(),[D]);const[O,A]=m.useState();Xt(()=>{x&&A(window.getComputedStyle(x).zIndex)},[x]);const U=m.useCallback(k=>{k&&j.current===!0&&(D(),T==null||T(),j.current=!1)},[D,T]);return o.jsx(KO,{scope:s,contentWrapper:g,shouldExpandOnScrollRef:E,onScrollButtonChange:U,children:o.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:o.jsx(Ve.div,{...u,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...u.style}})})})},"SelectItemAlignedPosition")),Rb=m.forwardRef(ht(function(a,l){const{__scopeSelect:s,align:c="start",collisionPadding:u=ya,...f}=a,p=mp(s);return o.jsx(Qm,{...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")),[KO,XO]=Il(zl,{}),Nb="SelectViewport",FO=m.forwardRef(ht(function(a,l){const{__scopeSelect:s,nonce:c,...u}=a,f=Ku(Nb,s),p=XO(Nb,s),g=Xe(l,f.onViewportChange),v=m.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),o.jsx(Gu.Slot,{scope:s,children:o.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...u,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...u.style},onScroll:Ne(u.onScroll,x=>{const y=x.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:w}=p;if(w!=null&&w.current&&b){const E=Math.abs(v.current-y.scrollTop);if(E>0){const j=window.innerHeight-ya*2,C=parseFloat(b.style.minHeight),N=parseFloat(b.style.height),M=Math.max(C,N);if(M<j){const T=M+E,D=Math.min(j,T),O=T-D;b.style.height=D+"px",b.style.bottom==="0px"&&(y.scrollTop=O>0?O:0,b.style.justifyContent="flex-end")}}}v.current=y.scrollTop})})})]})},"SelectViewport")),QO="SelectGroup",[K4,X4]=Il(QO),cm="SelectItem",[ZO,Gw]=Il(cm),Kw=m.forwardRef(ht(function(a,l){const{__scopeSelect:s,value:c,disabled:u=!1,textValue:f,...p}=a,g=ul(cm,s),v=Ku(cm,s),x=g.value===c,[y,b]=m.useState(f??""),[w,E]=m.useState(!1),j=ia(D=>{var O;return(O=v.itemRefCallback)==null?void 0:O.call(v,D,c,u)}),C=Xe(l,j),N=La(),M=m.useRef("touch"),T=ht(()=>{u||(g.onValueChange(c),g.onOpenChange(!1))},"handleSelect");return o.jsx(ZO,{scope:s,value:c,disabled:u,textId:N,isSelected:x,onItemTextChange:m.useCallback(D=>{b(O=>O||((D==null?void 0:D.textContent)??"").trim())},[]),children:o.jsx(Gu.ItemSlot,{scope:s,value:c,disabled:u,textValue:y,children:o.jsx(Ve.div,{role:"option","aria-labelledby":N,"data-highlighted":w?"":void 0,"aria-selected":x&&w,"data-state":x?"checked":"unchecked","aria-disabled":u||void 0,"data-disabled":u?"":void 0,tabIndex:u?void 0:-1,...p,ref:C,onFocus:Ne(p.onFocus,()=>E(!0)),onBlur:Ne(p.onBlur,()=>E(!1)),onClick:Ne(p.onClick,()=>{M.current!=="mouse"&&T()}),onPointerUp:Ne(p.onPointerUp,()=>{M.current==="mouse"&&T()}),onPointerDown:Ne(p.onPointerDown,D=>{M.current=D.pointerType}),onPointerMove:Ne(p.onPointerMove,D=>{var O;M.current=D.pointerType,u?(O=v.onItemLeave)==null||O.call(v):M.current==="mouse"&&D.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ne(p.onPointerLeave,D=>{var O;D.currentTarget===document.activeElement&&((O=v.onItemLeave)==null||O.call(v))}),onKeyDown:Ne(p.onKeyDown,D=>{var A;u||D.target!==D.currentTarget||((A=v.searchRef)==null?void 0:A.current)!==""&&D.key===" "||(MO.includes(D.key)&&T(),D.key===" "&&D.preventDefault())})})})})},"SelectItem")),Ic="SelectItemText",JO=m.forwardRef(ht(function(a,l){const{__scopeSelect:s,className:c,style:u,...f}=a,p=ul(Ic,s),g=Ku(Ic,s),v=Gw(Ic,s),x=_O(Ic,s),[y,b]=m.useState(null),w=ia(T=>{var D;return(D=g.itemTextRefCallback)==null?void 0:D.call(g,T,v.value,v.disabled)}),E=Xe(l,b,v.onItemTextChange,w),j=y==null?void 0:y.textContent,C=m.useMemo(()=>o.jsx("option",{value:v.value,disabled:v.disabled,children:j},v.value),[v.disabled,v.value,j]),{onNativeOptionAdd:N,onNativeOptionRemove:M}=x;return Xt(()=>(N(C),()=>M(C)),[N,M,C]),o.jsxs(o.Fragment,{children:[o.jsx(Ve.span,{id:v.textId,...f,ref:E}),v.isSelected&&p.valueNode&&!p.valueNodeHasChildren&&!pi(p.value)?ba.createPortal(f.children,p.valueNode):null]})},"SelectItemText")),WO="SelectItemIndicator",e_=m.forwardRef(ht(function(a,l){const{__scopeSelect:s,...c}=a;return Gw(WO,s).isSelected?o.jsx(Ve.span,{"aria-hidden":!0,...c,ref:l}):null},"SelectItemIndicator")),t_="SelectBubbleInput",n_=m.forwardRef(ht(function({__scopeSelect:a,...l},s){const c=ul(t_,a),{value:u,onValueChange:f,required:p,disabled:g,name:v,autoComplete:x,form:y}=c,{nativeOptions:b,nativeSelectKey:w}=c,E=m.useRef(null),j=Xe(s,E),C=u??"",N=Iw(C),M=Array.from(b).some(T=>(T.props.value??"")==="");return m.useEffect(()=>{const T=E.current;if(!T)return;const D=window.HTMLSelectElement.prototype,A=Object.getOwnPropertyDescriptor(D,"value").set;if(N!==C&&A){const U=new Event("change",{bubbles:!0});A.call(T,C),T.dispatchEvent(U)}},[N,C]),o.jsxs(Ve.select,{"aria-hidden":!0,required:p,tabIndex:-1,name:v,autoComplete:x,disabled:g,form:y,onChange:T=>f(T.target.value),...l,style:{...Pw,...l.style},ref:j,defaultValue:C,children:[pi(u)&&!M?o.jsx("option",{value:""}):null,Array.from(b)]},w)},"SelectBubbleInput"));function Xw(n){return typeof n=="function"}ht(Xw,"isFunction");function pi(n){return n===""||n===void 0}ht(pi,"shouldShowPlaceholder");function pp(n){const a=ia(n),l=m.useRef(""),s=m.useRef(0),c=m.useCallback(f=>{const p=l.current+f;a(p),ht((function g(v){l.current=v,window.clearTimeout(s.current),v!==""&&(s.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(p)},[a]),u=m.useCallback(()=>{l.current="",window.clearTimeout(s.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(s.current),[]),[l,c,u]}ht(pp,"useTypeaheadSearch");function gp(n,a,l){const c=a.length>1&&Array.from(a).every(v=>v===a[0])?a[0]:a,u=l?n.indexOf(l):-1;let f=Fw(n,Math.max(u,0));c.length===1&&(f=f.filter(v=>v!==l));const g=f.find(v=>v.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==l?g:void 0}ht(gp,"findNextItem");function Fw(n,a){return n.map((l,s)=>n[(a+s)%n.length])}ht(Fw,"wrapArray");const Ua=kO,Ba=UO,Sa=m.forwardRef(({className:n,children:a,...l},s)=>o.jsxs(Vw,{ref:s,className:Ee("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n),...l,children:[a,o.jsx(BO,{asChild:!0,children:o.jsx(JE,{className:"h-4 w-4 opacity-50"})})]}));Sa.displayName=Vw.displayName;const ja=m.forwardRef(({className:n,children:a,position:l="popper",...s},c)=>o.jsx(qO,{children:o.jsx($w,{ref:c,className:Ee("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",n),position:l,...s,children:o.jsx(FO,{className:Ee("p-1",l==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:a})})}));ja.displayName=$w.displayName;const Rt=m.forwardRef(({className:n,children:a,...l},s)=>o.jsxs(Kw,{ref:s,className:Ee("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...l,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(e_,{children:o.jsx(C0,{className:"h-4 w-4"})})}),o.jsx(JO,{children:a})]}));Rt.displayName=Kw.displayName;var a_=Object.defineProperty,il=(n,a)=>a_(n,"name",{value:a,configurable:!0}),vp="Switch",[r_,F4]=kn(vp),[l_,xp]=r_(vp);function Qw(n){const{__scopeSwitch:a,checked:l,children:s,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=yr({prop:l,defaultProp:c??!1,onChange:g,caller:vp}),[E,j]=m.useState(null),[C,N]=m.useState(null),M=m.useRef(!1),[T,D]=m.useReducer(U=>U+1,0),O=E?!!f||!!E.closest("form"):!0,A={checked:b,setChecked:w,disabled:u,control:E,setControl:j,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:M,userInteractionCount:T,onUserInteraction:D,required:v,defaultChecked:c,isFormControl:O,bubbleInput:C,setBubbleInput:N};return o.jsx(l_,{scope:a,...A,children:Jw(y)?y(A):s})}il(Qw,"SwitchProvider");var s_="SwitchTrigger",o_=m.forwardRef(il(function({__scopeSwitch:a,onClick:l,...s},c){const{control:u,form:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:E,isFormControl:j,bubbleInput:C}=xp(s_,a),N=Xe(c,y),M=m.useRef(v);return m.useEffect(()=>{const T=f?u==null?void 0:u.ownerDocument.getElementById(f):u==null?void 0:u.form;if(T instanceof HTMLFormElement){const D=il(()=>b(M.current),"reset");return T.addEventListener("reset",D),()=>T.removeEventListener("reset",D)}},[u,f,b]),o.jsx(Ve.button,{type:"button",role:"switch","aria-checked":v,"aria-required":x,"data-state":yp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...s,ref:N,onClick:Ne(l,T=>{E(),b(D=>!D),C&&j&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"SwitchTrigger")),Zw=m.forwardRef(il(function(a,l){const{__scopeSwitch:s,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return o.jsx(Qw,{__scopeSwitch:s,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>o.jsxs(o.Fragment,{children:[o.jsx(o_,{...b,ref:l,__scopeSwitch:s}),w&&o.jsx(d_,{__scopeSwitch:s})]})})},"Switch")),i_="SwitchThumb",c_=m.forwardRef(il(function(a,l){const{__scopeSwitch:s,...c}=a,u=xp(i_,s);return o.jsx(Ve.span,{"data-state":yp(u.checked),"data-disabled":u.disabled?"":void 0,...c,ref:l})},"SwitchThumb")),u_="SwitchBubbleInput",d_=m.forwardRef(il(function({__scopeSwitch:a,onClick:l,...s},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:E,bubbleInput:j,setBubbleInput:C}=xp(u_,a),N=Xe(c,C),M=_u(u),T=m.useRef(!1),D=m.useRef(g),O=m.useRef(p);m.useEffect(()=>{const U=j;if(!U)return;const k=window.HTMLInputElement.prototype,X=Object.getOwnPropertyDescriptor(k,"checked").set,te=p!==O.current;O.current=p;const G=D.current!==g;D.current=g;const ie=!(te&&f.current);if(G&&X){T.current=!te;const ce=new Event("click",{bubbles:ie});X.call(U,g),U.dispatchEvent(ce),T.current=!1}},[j,g,f,p]);const A=m.useRef(g);return o.jsx(Ve.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??A.current,required:x,disabled:y,name:b,value:w,form:E,...s,tabIndex:-1,ref:N,onClick:Ne(l,U=>{T.current&&U.stopPropagation()}),style:{...s.style,...M,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Jw(n){return typeof n=="function"}il(Jw,"isFunction");function yp(n){return n?"checked":"unchecked"}il(yp,"getState");const Ca=m.forwardRef(({className:n,...a},l)=>o.jsx(Zw,{className:Ee("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",n),...a,ref:l,children:o.jsx(c_,{className:Ee("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Ca.displayName=Zw.displayName;const Al={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0},f_={openai:"https://api.openai.com",anthropic:"https://api.anthropic.com"};function h_(){const[n,a]=m.useState([]),[l,s]=m.useState(!1),[c,u]=m.useState(Al),[f,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(null),[b,w]=m.useState(Al),[E,j]=m.useState(null),[C,N]=m.useState(!1),M=async()=>{try{const k=await Se.get("/api/admin/providers");a(k.providers)}catch(k){ve.error(k.message||"Unable to load providers")}};m.useEffect(()=>{M()},[]);const T=async()=>{p(!0);try{let k;if(c.customHeaders.trim())try{k=JSON.parse(c.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await Se.post("/api/admin/providers",{name:c.name,slug:c.slug||void 0,type:c.type,baseUrl:c.baseUrl,apiKey:c.apiKey,customHeaders:k,enabled:c.enabled}),ve.success("Provider created"),s(!1),u(Al),M()}catch(k){ve.error(k.message)}finally{p(!1)}},D=async k=>{v(k);try{const $=await Se.post(`/api/admin/providers/${k}/test`);ve.success($.ok?`Connection OK: ${$.detail}`:`Failed: ${$.detail}`),M()}catch($){ve.error($.message)}finally{v(null)}},O=k=>{y(k.id),w({...Al,name:k.name,slug:k.slug||"",type:k.type,baseUrl:k.baseUrl,apiKey:"",customHeaders:"",enabled:k.enabled})},A=async()=>{if(x){p(!0);try{let k;if(b.customHeaders.trim())try{k=JSON.parse(b.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await Se.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:k,enabled:b.enabled}),ve.success("Provider updated"),y(null),w(Al),M()}catch(k){ve.error(k.message)}finally{p(!1)}}},U=async k=>{N(!0);try{await Se.del(`/api/admin/providers/${k}`),ve.success("Provider removed"),M()}catch($){ve.error($.message)}finally{N(!1),j(null)}};return o.jsxs("div",{children:[o.jsx($a,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:o.jsx("div",{className:"flex gap-2",children:o.jsxs(Mn,{open:l,onOpenChange:s,children:[o.jsx(mi,{asChild:!0,children:o.jsx(me,{children:"Add compatible provider"})}),o.jsxs(vn,{children:[o.jsxs(xn,{children:[o.jsx(yn,{children:"New provider"}),o.jsx(uu,{children:"API-key or compatible endpoint."})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx(we,{htmlFor:"provider-name",children:"Name"}),o.jsx(Ae,{id:"provider-name",value:c.name,onChange:k=>u({...c,name:k.target.value})})]}),o.jsxs("div",{children:[o.jsx(we,{htmlFor:"provider-slug",children:"Slug (optional)"}),o.jsx(Ae,{id:"provider-slug",value:c.slug,onChange:k=>u({...c,slug:k.target.value})})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Type"}),o.jsxs(Ua,{value:c.type,onValueChange:k=>u($=>({...$,type:k,baseUrl:f_[k]})),children:[o.jsx(Sa,{children:o.jsx(Ba,{})}),o.jsxs(ja,{children:[o.jsx(Rt,{value:"openai",children:"OpenAI-compatible"}),o.jsx(Rt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),o.jsxs("div",{children:[o.jsx(we,{htmlFor:"provider-base-url",children:"Base URL"}),o.jsx(Ae,{id:"provider-base-url",value:c.baseUrl,onChange:k=>u({...c,baseUrl:k.target.value})})]}),o.jsxs("div",{children:[o.jsx(we,{htmlFor:"provider-api-key",children:"API key"}),o.jsx(Ae,{id:"provider-api-key",type:"password",value:c.apiKey,onChange:k=>u({...c,apiKey:k.target.value})})]}),o.jsxs("div",{children:[o.jsx(we,{htmlFor:"provider-headers",children:"Custom headers (JSON)"}),o.jsx(Ae,{id:"provider-headers",value:c.customHeaders,onChange:k=>u({...c,customHeaders:k.target.value}),placeholder:'{"X-Org":"acme"}'})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ca,{checked:c.enabled,onCheckedChange:k=>u({...c,enabled:k})}),o.jsx(we,{children:"Enabled"})]})]}),o.jsxs(An,{children:[o.jsx(me,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),o.jsx(me,{disabled:f||!c.name||!c.apiKey,onClick:T,children:f?"Creating…":"Create"})]})]})]})})}),o.jsxs(nt,{children:[o.jsxs(at,{children:[o.jsx(rt,{className:"text-base",children:"All providers"}),o.jsxs(gn,{children:[n.length," total"]})]}),o.jsx(lt,{children:o.jsxs(ca,{children:[o.jsx(ua,{children:o.jsxs(We,{children:[o.jsx(ye,{children:"Name"}),o.jsx(ye,{children:"Type"}),o.jsx(ye,{children:"Base URL"}),o.jsx(ye,{children:"Models"}),o.jsx(ye,{children:"Health"}),o.jsx(ye,{children:"Enabled"}),o.jsx(ye,{className:"text-right",children:"Actions"})]})}),o.jsxs(da,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),n.map(k=>o.jsxs(We,{children:[o.jsxs(pe,{className:"font-medium",children:[k.name," ",o.jsx("span",{className:"text-xs text-muted-foreground",children:k.slug})]}),o.jsx(pe,{children:o.jsx(Qe,{variant:"outline",children:k.type})}),o.jsx(pe,{className:"text-xs text-muted-foreground",children:k.baseUrl}),o.jsx(pe,{children:k.modelCount}),o.jsx(pe,{children:o.jsx(Qe,{variant:k.health==="healthy"?"success":k.health==="down"?"destructive":"secondary",children:k.health})}),o.jsx(pe,{children:k.enabled?"Yes":"No"}),o.jsx(pe,{className:"text-right",children:o.jsxs("div",{className:"flex justify-end gap-1",children:[o.jsx(me,{size:"sm",variant:"outline",disabled:g===k.id,onClick:()=>D(k.id),children:o.jsx(A0,{className:"h-3 w-3"})}),o.jsx(me,{size:"sm",variant:"outline",onClick:()=>O(k),children:"✎"}),o.jsx(me,{size:"sm",variant:"outline",onClick:()=>j(k.id),children:o.jsx(ju,{className:"h-3 w-3"})})]})})]},k.id))]})]})})]}),o.jsx(Mn,{open:!!x,onOpenChange:k=>{k||(y(null),w(Al))},children:o.jsxs(vn,{children:[o.jsx(xn,{children:o.jsx(yn,{children:"Edit provider"})}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx(we,{children:"Name"}),o.jsx(Ae,{value:b.name,onChange:k=>w({...b,name:k.target.value})})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Slug (optional)"}),o.jsx(Ae,{value:b.slug,onChange:k=>w({...b,slug:k.target.value})})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Type"}),o.jsxs(Ua,{value:b.type,onValueChange:k=>w({...b,type:k}),children:[o.jsx(Sa,{children:o.jsx(Ba,{})}),o.jsxs(ja,{children:[o.jsx(Rt,{value:"openai",children:"OpenAI-compatible"}),o.jsx(Rt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Base URL"}),o.jsx(Ae,{value:b.baseUrl,onChange:k=>w({...b,baseUrl:k.target.value})})]}),o.jsxs("div",{children:[o.jsx(we,{children:"API key (leave empty to keep current)"}),o.jsx(Ae,{type:"password",value:b.apiKey,onChange:k=>w({...b,apiKey:k.target.value})})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Custom headers (JSON)"}),o.jsx(Ae,{value:b.customHeaders,onChange:k=>w({...b,customHeaders:k.target.value}),placeholder:'{"X-Org":"acme"}'})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ca,{checked:b.enabled,onCheckedChange:k=>w({...b,enabled:k})}),o.jsx(we,{children:"Enabled"})]})]}),o.jsxs(An,{children:[o.jsx(me,{variant:"outline",onClick:()=>{y(null),w(Al)},children:"Cancel"}),o.jsx(me,{disabled:f||!b.name,onClick:A,children:"Save changes"})]})]})}),o.jsx(up,{open:!!E,onOpenChange:k=>{k||j(null)},children:o.jsxs(Pu,{children:[o.jsxs(dp,{children:[o.jsx(qu,{children:"Delete provider?"}),o.jsx(Vu,{children:"This will soft-disable the provider if models depend on it."})]}),o.jsxs(fp,{children:[o.jsx(Yu,{children:"Cancel"}),o.jsx($u,{disabled:C,onClick:k=>{E&&(k.preventDefault(),U(E))},children:C?"Deleting…":"Delete"})]})]})})]})}var m_=Object.defineProperty,Sr=(n,a)=>m_(n,"name",{value:a,configurable:!0}),bp="Checkbox",[p_,Q4]=kn(bp),[g_,wp]=p_(bp);function Ww(n){const{__scopeCheckbox:a,checked:l,children:s,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=yr({prop:l,defaultProp:c??!1,onChange:g,caller:bp}),[E,j]=m.useState(null),[C,N]=m.useState(null),M=m.useRef(!1),[T,D]=m.useReducer(U=>U+1,0),O=E?!!f||!!E.closest("form"):!0,A={checked:b,disabled:u,setChecked:w,control:E,setControl:j,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:M,userInteractionCount:T,onUserInteraction:D,required:v,defaultChecked:vr(c)?!1:c,isFormControl:O,bubbleInput:C,setBubbleInput:N};return o.jsx(g_,{scope:a,...A,children:tS(y)?y(A):s})}Sr(Ww,"CheckboxProvider");var v_="CheckboxTrigger",x_=m.forwardRef(Sr(function({__scopeCheckbox:a,onKeyDown:l,onClick:s,...c},u){const{control:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:E,isFormControl:j,bubbleInput:C}=wp(v_,a),N=Xe(u,y),M=m.useRef(v);return m.useEffect(()=>{const T=f==null?void 0:f.form;if(T){const D=Sr(()=>b(M.current),"reset");return T.addEventListener("reset",D),()=>T.removeEventListener("reset",D)}},[f,b]),o.jsx(Ve.button,{type:"button",role:"checkbox","aria-checked":vr(v)?"mixed":v,"aria-required":x,"data-state":Sp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...c,ref:N,onKeyDown:Ne(l,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:Ne(s,T=>{E(),b(D=>vr(D)?!0:!D),C&&j&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"CheckboxTrigger")),eS=m.forwardRef(Sr(function(a,l){const{__scopeCheckbox:s,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return o.jsx(Ww,{__scopeCheckbox:s,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>o.jsxs(o.Fragment,{children:[o.jsx(x_,{...b,ref:l,__scopeCheckbox:s}),w&&o.jsx(S_,{__scopeCheckbox:s})]})})},"Checkbox")),y_="CheckboxIndicator",b_=m.forwardRef(Sr(function(a,l){const{__scopeCheckbox:s,forceMount:c,...u}=a,f=wp(y_,s);return o.jsx(Cr,{present:c||vr(f.checked)||f.checked===!0,children:o.jsx(Ve.span,{"data-state":Sp(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:l,style:{pointerEvents:"none",...a.style}})})},"CheckboxIndicator")),w_="CheckboxBubbleInput",S_=m.forwardRef(Sr(function({__scopeCheckbox:a,onClick:l,...s},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:E,bubbleInput:j,setBubbleInput:C}=wp(w_,a),N=Xe(c,C),M=_u(u),T=m.useRef(!1),D=m.useRef(g),O=m.useRef(p);m.useEffect(()=>{const U=j;if(!U)return;const k=window.HTMLInputElement.prototype,X=Object.getOwnPropertyDescriptor(k,"checked").set,te=p!==O.current;O.current=p;const G=D.current!==g;D.current=g;const ie=!(te&&f.current);if(G&&X){T.current=!te;const ce=new Event("click",{bubbles:ie});U.indeterminate=vr(g),X.call(U,vr(g)?!1:g),U.dispatchEvent(ce),T.current=!1}},[j,g,f,p]);const A=m.useRef(vr(g)?!1:g);return o.jsx(Ve.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??A.current,required:x,disabled:y,name:b,value:w,form:E,...s,tabIndex:-1,ref:N,onClick:Ne(l,U=>{T.current&&U.stopPropagation()}),style:{...s.style,...M,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function tS(n){return typeof n=="function"}Sr(tS,"isFunction");function vr(n){return n==="indeterminate"}Sr(vr,"isIndeterminate");function Sp(n){return vr(n)?"indeterminate":n?"checked":"unchecked"}Sr(Sp,"getState");const jp=m.forwardRef(({className:n,...a},l)=>o.jsx(eS,{ref:l,className:Ee("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",n),...a,children:o.jsx(b_,{className:Ee("flex items-center justify-center text-current"),children:o.jsx(C0,{className:"h-3.5 w-3.5"})})}));jp.displayName=eS.displayName;const um=["image_input","audio_input","tools","structured_output","reasoning","chat","streaming"],j_=["unknown","yes","no"];function C_(n,a){return n[a]===!0?"yes":n[a]===!1?"no":"unknown"}function E_(n){const a={};for(const l of um)a[l]=n[l]==="yes"?!0:n[l]==="no"?!1:null;return a}function R_(){const[n,a]=m.useState([]),[l,s]=m.useState([]),[c,u]=m.useState("all"),[f,p]=m.useState(!1),[g,v]=m.useState(""),[x,y]=m.useState([]),[b,w]=m.useState(new Set),[E,j]=m.useState(!1),[C,N]=m.useState(""),[M,T]=m.useState(""),[D,O]=m.useState(null),[A,U]=m.useState(!1),[k,$]=m.useState(null),[X,te]=m.useState(null),[G,ie]=m.useState(null),[ce,se]=m.useState({}),[_,H]=m.useState(!1),Q=q=>{const oe={};for(const de of um)oe[de]=C_(q.capabilities,de);se(oe),ie(q)},J=async()=>{if(G){H(!0);try{await Se.patch("/api/admin/models",{id:G.id,capabilities:E_(ce)}),ve.success("Capabilities updated"),ie(null),ee()}catch(q){ve.error(q.message)}finally{H(!1)}}},ee=async()=>{const[q,oe]=await Promise.all([Se.get("/api/admin/models"),Se.get("/api/admin/providers")]);a(q.models),s(oe.providers)};m.useEffect(()=>{ee()},[]);const z=n.filter(q=>!(c!=="all"&&q.providerId!==c||C&&!q.publicModelId.toLowerCase().includes(C.toLowerCase()))),I=x.filter(q=>{if(!M)return!0;const oe=M.toLowerCase();return q.upstreamId.toLowerCase().includes(oe)||q.displayName.toLowerCase().includes(oe)}),F=async()=>{if(g){j(!0);try{const q=await Se.post(`/api/admin/providers/${g}/discover`);y(q.models),w(new Set)}catch(q){ve.error(q.message)}finally{j(!1)}}},re=async()=>{if(b.size!==0)try{const q=await Se.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(b)});ve.success(`Imported ${q.imported} of ${q.requested}`),p(!1),y([]),w(new Set),ee()}catch(q){ve.error(q.message)}},he=async()=>{if(X)try{await Se.del(`/api/admin/models/${X.id}`),ve.success("Model deleted"),te(null),ee()}catch(q){ve.error(q.message)}},ge=async q=>{var de,fe,Te;O(q),U(!0);const oe=Date.now();$({phase:"streaming",startedAt:oe,text:"",progress:{}});try{const je=await ru(`/api/admin/models/${q}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!je.ok){const Ie=await je.text().catch(()=>"");$({phase:"error",model:q,error:`HTTP ${je.status}: ${Ie}`});return}const De=(de=je.body)==null?void 0:de.getReader();if(!De){$({phase:"error",model:q,error:"No response body"});return}const Fe=new TextDecoder;let et="",le="",Le=!1;for(;!Le;){const{value:Ie,done:kt}=await De.read();Le=kt,Ie&&(et+=Fe.decode(Ie,{stream:!0}));let St;for(;(St=et.indexOf(`
|
|
342
|
+
|
|
343
|
+
`))>=0;){const Ft=et.slice(0,St);et=et.slice(St+2);const on=Ft.split(`
|
|
344
|
+
`);let Qt="",jt="";for(const fn of on)fn.startsWith("event: ")?Qt=fn.slice(7):fn.startsWith("data: ")&&(jt=fn.slice(6));if(jt){if(Qt===""||Qt==="message")try{const Mt=(fe=JSON.parse(jt).choices)==null?void 0:fe[0];(Te=Mt==null?void 0:Mt.delta)!=null&&Te.content&&(le+=Mt.delta.content),$(At=>{if(!At||At.phase!=="streaming")return At;const cn=Date.now()-oe,fa=At.progress.ttftMs??cn;return{...At,text:le,progress:{ttftMs:fa,elapsedMs:cn}}})}catch{}if(Qt==="test_meta")try{const fn=JSON.parse(jt);$({phase:"done",model:q,result:fn,text:le})}catch{}if(Qt==="test_error")try{const fn=JSON.parse(jt);$({phase:"error",model:q,error:fn.message})}catch{}}}}$(Ie=>!Ie||Ie.phase==="streaming"?{phase:"error",model:q,error:"Stream ended unexpectedly"}:Ie)}catch(je){$({phase:"error",model:q,error:je.message})}finally{O(null)}};return o.jsxs("div",{children:[o.jsx($a,{title:"Models",description:"Physical models imported from providers",actions:o.jsxs(Mn,{open:f,onOpenChange:p,children:[o.jsx(mi,{asChild:!0,children:o.jsxs(me,{variant:"outline",children:[o.jsx(E0,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),o.jsxs(vn,{className:"max-w-2xl",children:[o.jsx(xn,{children:o.jsx(yn,{children:"Discover models"})}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsx("div",{className:"flex-1",children:o.jsxs(Ua,{value:g,onValueChange:v,children:[o.jsx(Sa,{children:o.jsx(Ba,{placeholder:"Choose provider"})}),o.jsx(ja,{children:l.map(q=>o.jsx(Rt,{value:q.id,children:q.name},q.id))})]})}),o.jsx(me,{onClick:F,disabled:!g||E,children:E?"Fetching…":"Fetch"})]}),x.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("div",{className:"flex items-center gap-2 flex-1",children:o.jsxs("div",{className:"relative flex-1",children:[o.jsx(D0,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(Ae,{className:"pl-8",placeholder:"Search models…",value:M,onChange:q=>T(q.target.value)}),M&&o.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>T(""),children:o.jsx(Cu,{className:"h-4 w-4"})})]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"text-sm text-muted-foreground",children:[I.length," / ",x.length," · ",b.size," selected"]}),o.jsx(me,{variant:"outline",size:"sm",onClick:()=>w(new Set(I.filter(q=>!q.alreadyImported).map(q=>q.upstreamId))),children:"Select All (new)"}),o.jsx(me,{variant:"outline",size:"sm",onClick:()=>w(new Set),children:"Clear"})]})]}),o.jsx("div",{className:"max-h-80 space-y-1 overflow-auto rounded border p-2",children:I.length===0&&x.length>0?o.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):I.map(q=>o.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[o.jsx(jp,{checked:b.has(q.upstreamId),onCheckedChange:oe=>{const de=new Set(b);oe?de.add(q.upstreamId):de.delete(q.upstreamId),w(de)}}),o.jsx("span",{className:"font-mono text-xs",children:q.upstreamId}),q.alreadyImported&&o.jsx(Qe,{variant:"secondary",children:"imported"})]},q.upstreamId))})]})]}),o.jsxs(An,{children:[o.jsx(me,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),o.jsxs(me,{disabled:b.size===0,onClick:re,children:["Import ",b.size||""]})]})]})]})}),o.jsxs(nt,{children:[o.jsxs(at,{children:[o.jsx(rt,{className:"text-base",children:"All models"}),o.jsxs(gn,{children:[n.length," total"]})]}),o.jsxs(lt,{children:[o.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[o.jsxs(Ua,{value:c,onValueChange:u,children:[o.jsx(Sa,{className:"w-56",children:o.jsx(Ba,{})}),o.jsxs(ja,{children:[o.jsx(Rt,{value:"all",children:"All providers"}),l.map(q=>o.jsx(Rt,{value:q.id,children:q.name},q.id))]})]}),o.jsx(Ae,{className:"max-w-xs",placeholder:"Search public ID",value:C,onChange:q=>N(q.target.value)})]}),o.jsxs(ca,{children:[o.jsx(ua,{children:o.jsxs(We,{children:[o.jsx(ye,{children:"Public ID"}),o.jsx(ye,{children:"Provider"}),o.jsx(ye,{children:"Upstream ID"}),o.jsx(ye,{children:"Capabilities"}),o.jsx(ye,{children:"Available"}),o.jsx(ye,{children:"Enabled"}),o.jsx(ye,{})]})}),o.jsxs(da,{children:[z.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),z.map(q=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-mono text-xs",children:q.publicModelId}),o.jsx(pe,{children:q.providerSlug}),o.jsx(pe,{className:"text-xs text-muted-foreground",children:q.upstreamModelId}),o.jsx(pe,{className:"space-x-1",children:Object.entries(q.capabilities).filter(([,oe])=>oe===!0).slice(0,4).map(([oe])=>o.jsx(Qe,{variant:"outline",className:"mr-1",children:oe},oe))}),o.jsx(pe,{children:q.upstreamAvailable?o.jsx(Qe,{variant:"success",children:"up"}):o.jsx(Qe,{variant:"destructive",children:"down"})}),o.jsx(pe,{children:q.enabled?"Yes":"No"}),o.jsx(pe,{className:"text-right",children:o.jsxs("div",{className:"flex items-center justify-end gap-1",children:[o.jsxs(me,{size:"sm",variant:"outline",onClick:()=>Q(q),disabled:D!==null,children:[o.jsx(vR,{className:"h-3.5 w-3.5"})," Capabilities"]}),o.jsxs(me,{size:"sm",variant:"outline",onClick:()=>void ge(q.id),disabled:D!==null,children:[D===q.id?o.jsx(_s,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(iR,{className:"h-3.5 w-3.5"})," Test"]}),o.jsxs(me,{size:"sm",variant:"destructive",onClick:()=>te(q),disabled:D!==null,children:[o.jsx(ju,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},q.id))]})]})]})]}),o.jsx(Mn,{open:!!X,onOpenChange:q=>{q||te(null)},children:o.jsxs(vn,{className:"max-w-md",children:[o.jsx(xn,{children:o.jsx(yn,{children:"Xoá model"})}),o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsxs("p",{children:["Bạn có chắc muốn xoá model ",o.jsx("span",{className:"font-mono",children:X==null?void 0:X.publicModelId}),"?"]}),o.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."})]}),o.jsxs(An,{children:[o.jsx(me,{variant:"outline",onClick:()=>te(null),children:"Huỷ"}),o.jsx(me,{variant:"destructive",onClick:he,children:"Xoá"})]})]})}),o.jsx(Mn,{open:G!==null,onOpenChange:q=>{q||ie(null)},children:o.jsxs(vn,{className:"max-w-lg",children:[o.jsx(xn,{children:o.jsxs(yn,{children:["Capabilities — ",G==null?void 0:G.publicModelId]})}),o.jsxs("div",{className:"space-y-1",children:[o.jsxs("p",{className:"text-xs text-muted-foreground",children:[o.jsx("strong",{children:"Unknown"})," means the router has no verified answer and will attempt the request."," ",o.jsx("strong",{children:"No"})," blocks requests needing that capability (HTTP 400/502 before any upstream call)."]}),um.map(q=>{var de;const oe=(de=G==null?void 0:G.discoveredCapabilities)==null?void 0:de[q];return o.jsxs("div",{className:"flex items-center justify-between gap-3 rounded px-1 py-1 text-sm hover:bg-accent",children:[o.jsxs("span",{className:"flex items-baseline gap-2",children:[o.jsx("code",{className:"text-xs",children:q}),o.jsx("span",{className:"text-xs text-muted-foreground",children:oe===void 0?"discovered: unknown":`discovered: ${String(oe)}`})]}),o.jsx("div",{className:"flex gap-1",children:j_.map(fe=>o.jsx(me,{size:"sm",variant:ce[q]===fe?"default":"outline",onClick:()=>se(Te=>({...Te,[q]:fe})),children:fe==="unknown"?"Unknown":fe==="yes"?"Yes":"No"},fe))})]},q)})]}),o.jsxs(An,{children:[o.jsx(me,{variant:"outline",onClick:()=>ie(null),children:"Huỷ"}),o.jsx(me,{onClick:J,disabled:_,children:_?"Saving…":"Lưu"})]})]})}),o.jsx(Mn,{open:A,onOpenChange:U,children:o.jsxs(vn,{className:"max-w-2xl",children:[o.jsx(xn,{children:o.jsx(yn,{children:"Kết quả test model"})}),k&&k.phase==="streaming"&&o.jsxs("div",{className:"space-y-3 text-sm",children:[o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(_s,{className:"h-4 w-4 animate-spin"})," Đang stream…",o.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["TTFT ",k.progress.ttftMs!=null?`${k.progress.ttftMs} ms`:"…"]}),o.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["· ",k.progress.elapsedMs!=null?`${k.progress.elapsedMs} ms`:"…"]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi (streaming)"}),o.jsxs("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:[k.text||o.jsx("span",{className:"text-muted-foreground/60 animate-pulse",children:"waiting for first token…"}),k.phase==="streaming"&&o.jsx("span",{className:"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-primary/70"})]})]})]}),k&&k.phase==="done"&&o.jsxs("div",{className:"space-y-3 text-sm",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx(Qe,{variant:k.result.success?"success":"destructive",children:k.result.success?"Thành công":"Thất bại"}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Thời gian phản hồi"}),o.jsxs("div",{className:"font-mono",children:[k.result.latencyMs," ms"]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"TTFT"}),o.jsx("div",{className:"font-mono",children:k.result.ttftMs!=null?`${k.result.ttftMs} ms`:"—"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Tokens (in / out)"}),o.jsxs("div",{className:"font-mono",children:[k.result.usage.input," / ",k.result.usage.output]})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi của model"}),o.jsx("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:k.text||k.result.text||"(trống)"})]}),k.result.attempts.length>0&&o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Attempts"}),o.jsx("div",{className:"space-y-1",children:k.result.attempts.map((q,oe)=>o.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[o.jsx(Qe,{variant:q.success?"success":"destructive",children:q.success?"OK":"FAIL"}),o.jsxs("span",{className:"font-mono",children:[q.providerName," / ",q.modelId]}),o.jsxs("span",{className:"text-muted-foreground",children:[q.latencyMs," ms"]}),q.failureReason&&o.jsx("span",{className:"text-destructive",children:q.failureReason})]},oe))})]})]}),k&&k.phase==="error"&&o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsx(Qe,{variant:"destructive",children:"Thất bại"}),o.jsx("p",{className:"text-destructive",children:k.error})]}),o.jsx(An,{children:o.jsx(me,{variant:"outline",onClick:()=>U(!1),children:"Đóng"})})]})})]})}function N_(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return m.useMemo(()=>s=>{a.forEach(c=>c(s))},a)}const Xu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xs(n){const a=Object.prototype.toString.call(n);return a==="[object Window]"||a==="[object global]"}function Cp(n){return"nodeType"in n}function zn(n){var a,l;return n?Xs(n)?n:Cp(n)&&(a=(l=n.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function Ep(n){const{Document:a}=zn(n);return n instanceof a}function gi(n){return Xs(n)?!1:n instanceof zn(n).HTMLElement}function nS(n){return n instanceof zn(n).SVGElement}function Fs(n){return n?Xs(n)?n.document:Cp(n)?Ep(n)?n:gi(n)||nS(n)?n.ownerDocument:document:document:document}const qa=Xu?m.useLayoutEffect:m.useEffect;function Rp(n){const a=m.useRef(n);return qa(()=>{a.current=n}),m.useCallback(function(){for(var l=arguments.length,s=new Array(l),c=0;c<l;c++)s[c]=arguments[c];return a.current==null?void 0:a.current(...s)},[])}function T_(){const n=m.useRef(null),a=m.useCallback((s,c)=>{n.current=setInterval(s,c)},[]),l=m.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[a,l]}function ti(n,a){a===void 0&&(a=[n]);const l=m.useRef(n);return qa(()=>{l.current!==n&&(l.current=n)},a),l}function vi(n,a){const l=m.useRef();return m.useMemo(()=>{const s=n(l.current);return l.current=s,s},[...a])}function du(n){const a=Rp(n),l=m.useRef(null),s=m.useCallback(c=>{c!==l.current&&(a==null||a(c,l.current)),l.current=c},[]);return[l,s]}function dm(n){const a=m.useRef();return m.useEffect(()=>{a.current=n},[n]),a.current}let _h={};function xi(n,a){return m.useMemo(()=>{if(a)return a;const l=_h[n]==null?0:_h[n]+1;return _h[n]=l,n+"-"+l},[n,a])}function aS(n){return function(a){for(var l=arguments.length,s=new Array(l>1?l-1:0),c=1;c<l;c++)s[c-1]=arguments[c];return s.reduce((u,f)=>{const p=Object.entries(f);for(const[g,v]of p){const x=u[g];x!=null&&(u[g]=x+n*v)}return u},{...a})}}const Us=aS(1),ni=aS(-1);function M_(n){return"clientX"in n&&"clientY"in n}function Np(n){if(!n)return!1;const{KeyboardEvent:a}=zn(n.target);return a&&n instanceof a}function A_(n){if(!n)return!1;const{TouchEvent:a}=zn(n.target);return a&&n instanceof a}function fm(n){if(A_(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 M_(n)?{x:n.clientX,y:n.clientY}:null}const fu=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[fu.Translate.toString(n),fu.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:a,duration:l,easing:s}=n;return a+" "+l+"ms "+s}}}),Tb="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function D_(n){return n.matches(Tb)?n:n.querySelector(Tb)}const O_={display:"none"};function __(n){let{id:a,value:l}=n;return ue.createElement("div",{id:a,style:O_},l)}function k_(n){let{id:a,announcement:l,ariaLiveType:s="assertive"}=n;const c={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ue.createElement("div",{id:a,style:c,role:"status","aria-live":s,"aria-atomic":!0},l)}function z_(){const[n,a]=m.useState("");return{announce:m.useCallback(s=>{s!=null&&a(s)},[]),announcement:n}}const rS=m.createContext(null);function L_(n){const a=m.useContext(rS);m.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(n)},[n,a])}function U_(){const[n]=m.useState(()=>new Set),a=m.useCallback(s=>(n.add(s),()=>n.delete(s)),[n]);return[m.useCallback(s=>{let{type:c,event:u}=s;n.forEach(f=>{var p;return(p=f[c])==null?void 0:p.call(f,u)})},[n]),a]}const B_={draggable:`
|
|
345
|
+
To pick up a draggable item, press the space bar.
|
|
346
|
+
While dragging, use the arrow keys to move the item.
|
|
347
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
348
|
+
`},H_={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 I_(n){let{announcements:a=H_,container:l,hiddenTextDescribedById:s,screenReaderInstructions:c=B_}=n;const{announce:u,announcement:f}=z_(),p=xi("DndLiveRegion"),[g,v]=m.useState(!1);if(m.useEffect(()=>{v(!0)},[]),L_(m.useMemo(()=>({onDragStart(y){let{active:b}=y;u(a.onDragStart({active:b}))},onDragMove(y){let{active:b,over:w}=y;a.onDragMove&&u(a.onDragMove({active:b,over:w}))},onDragOver(y){let{active:b,over:w}=y;u(a.onDragOver({active:b,over:w}))},onDragEnd(y){let{active:b,over:w}=y;u(a.onDragEnd({active:b,over:w}))},onDragCancel(y){let{active:b,over:w}=y;u(a.onDragCancel({active:b,over:w}))}}),[u,a])),!g)return null;const x=ue.createElement(ue.Fragment,null,ue.createElement(__,{id:s,value:c.draggable}),ue.createElement(k_,{id:p,announcement:f}));return l?ba.createPortal(x,l):x}var Gt;(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"})(Gt||(Gt={}));function hu(){}function Mb(n,a){return m.useMemo(()=>({sensor:n,options:a??{}}),[n,a])}function P_(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return m.useMemo(()=>[...a].filter(s=>s!=null),[...a])}const Ea=Object.freeze({x:0,y:0});function lS(n,a){return Math.sqrt(Math.pow(n.x-a.x,2)+Math.pow(n.y-a.y,2))}function sS(n,a){let{data:{value:l}}=n,{data:{value:s}}=a;return l-s}function q_(n,a){let{data:{value:l}}=n,{data:{value:s}}=a;return s-l}function Ab(n){let{left:a,top:l,height:s,width:c}=n;return[{x:a,y:l},{x:a+c,y:l},{x:a,y:l+s},{x:a+c,y:l+s}]}function oS(n,a){if(!n||n.length===0)return null;const[l]=n;return l[a]}function Db(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 V_=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:s}=n;const c=Db(a,a.left,a.top),u=[];for(const f of s){const{id:p}=f,g=l.get(p);if(g){const v=lS(Db(g),c);u.push({id:p,data:{droppableContainer:f,value:v}})}}return u.sort(sS)},$_=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:s}=n;const c=Ab(a),u=[];for(const f of s){const{id:p}=f,g=l.get(p);if(g){const v=Ab(g),x=c.reduce((b,w,E)=>b+lS(v[E],w),0),y=Number((x/4).toFixed(4));u.push({id:p,data:{droppableContainer:f,value:y}})}}return u.sort(sS)};function Y_(n,a){const l=Math.max(a.top,n.top),s=Math.max(a.left,n.left),c=Math.min(a.left+a.width,n.left+n.width),u=Math.min(a.top+a.height,n.top+n.height),f=c-s,p=u-l;if(s<c&&l<u){const g=a.width*a.height,v=n.width*n.height,x=f*p,y=x/(g+v-x);return Number(y.toFixed(4))}return 0}const G_=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:s}=n;const c=[];for(const u of s){const{id:f}=u,p=l.get(f);if(p){const g=Y_(p,a);g>0&&c.push({id:f,data:{droppableContainer:u,value:g}})}}return c.sort(q_)};function K_(n,a,l){return{...n,scaleX:a&&l?a.width/l.width:1,scaleY:a&&l?a.height/l.height:1}}function iS(n,a){return n&&a?{x:n.left-a.left,y:n.top-a.top}:Ea}function X_(n){return function(l){for(var s=arguments.length,c=new Array(s>1?s-1:0),u=1;u<s;u++)c[u-1]=arguments[u];return c.reduce((f,p)=>({...f,top:f.top+n*p.y,bottom:f.bottom+n*p.y,left:f.left+n*p.x,right:f.right+n*p.x}),{...l})}}const F_=X_(1);function Q_(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 Z_(n,a,l){const s=Q_(a);if(!s)return n;const{scaleX:c,scaleY:u,x:f,y:p}=s,g=n.left-f-(1-c)*parseFloat(l),v=n.top-p-(1-u)*parseFloat(l.slice(l.indexOf(" ")+1)),x=c?n.width/c:n.width,y=u?n.height/u:n.height;return{width:x,height:y,top:v,right:g+x,bottom:v+y,left:g}}const J_={ignoreTransform:!1};function Qs(n,a){a===void 0&&(a=J_);let l=n.getBoundingClientRect();if(a.ignoreTransform){const{transform:v,transformOrigin:x}=zn(n).getComputedStyle(n);v&&(l=Z_(l,v,x))}const{top:s,left:c,width:u,height:f,bottom:p,right:g}=l;return{top:s,left:c,width:u,height:f,bottom:p,right:g}}function Ob(n){return Qs(n,{ignoreTransform:!0})}function W_(n){const a=n.innerWidth,l=n.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function e3(n,a){return a===void 0&&(a=zn(n).getComputedStyle(n)),a.position==="fixed"}function t3(n,a){a===void 0&&(a=zn(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 Fu(n,a){const l=[];function s(c){if(a!=null&&l.length>=a||!c)return l;if(Ep(c)&&c.scrollingElement!=null&&!l.includes(c.scrollingElement))return l.push(c.scrollingElement),l;if(!gi(c)||nS(c)||l.includes(c))return l;const u=zn(n).getComputedStyle(c);return c!==n&&t3(c,u)&&l.push(c),e3(c,u)?l:s(c.parentNode)}return n?s(n):l}function cS(n){const[a]=Fu(n,1);return a??null}function kh(n){return!Xu||!n?null:Xs(n)?n:Cp(n)?Ep(n)||n===Fs(n).scrollingElement?window:gi(n)?n:null:null}function uS(n){return Xs(n)?n.scrollX:n.scrollLeft}function dS(n){return Xs(n)?n.scrollY:n.scrollTop}function hm(n){return{x:uS(n),y:dS(n)}}var Wt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Wt||(Wt={}));function fS(n){return!Xu||!n?!1:n===document.scrollingElement}function hS(n){const a={x:0,y:0},l=fS(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},s={x:n.scrollWidth-l.width,y:n.scrollHeight-l.height},c=n.scrollTop<=a.y,u=n.scrollLeft<=a.x,f=n.scrollTop>=s.y,p=n.scrollLeft>=s.x;return{isTop:c,isLeft:u,isBottom:f,isRight:p,maxScroll:s,minScroll:a}}const n3={x:.2,y:.2};function a3(n,a,l,s,c){let{top:u,left:f,right:p,bottom:g}=l;s===void 0&&(s=10),c===void 0&&(c=n3);const{isTop:v,isBottom:x,isLeft:y,isRight:b}=hS(n),w={x:0,y:0},E={x:0,y:0},j={height:a.height*c.y,width:a.width*c.x};return!v&&u<=a.top+j.height?(w.y=Wt.Backward,E.y=s*Math.abs((a.top+j.height-u)/j.height)):!x&&g>=a.bottom-j.height&&(w.y=Wt.Forward,E.y=s*Math.abs((a.bottom-j.height-g)/j.height)),!b&&p>=a.right-j.width?(w.x=Wt.Forward,E.x=s*Math.abs((a.right-j.width-p)/j.width)):!y&&f<=a.left+j.width&&(w.x=Wt.Backward,E.x=s*Math.abs((a.left+j.width-f)/j.width)),{direction:w,speed:E}}function r3(n){if(n===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:a,left:l,right:s,bottom:c}=n.getBoundingClientRect();return{top:a,left:l,right:s,bottom:c,width:n.clientWidth,height:n.clientHeight}}function mS(n){return n.reduce((a,l)=>Us(a,hm(l)),Ea)}function l3(n){return n.reduce((a,l)=>a+uS(l),0)}function s3(n){return n.reduce((a,l)=>a+dS(l),0)}function o3(n,a){if(a===void 0&&(a=Qs),!n)return;const{top:l,left:s,bottom:c,right:u}=a(n);cS(n)&&(c<=0||u<=0||l>=window.innerHeight||s>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const i3=[["x",["left","right"],l3],["y",["top","bottom"],s3]];class Tp{constructor(a,l){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const s=Fu(l),c=mS(s);this.rect={...a},this.width=a.width,this.height=a.height;for(const[u,f,p]of i3)for(const g of f)Object.defineProperty(this,g,{get:()=>{const v=p(s),x=c[u]-v;return this.rect[g]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Xo{constructor(a){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(l=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...l)})},this.target=a}add(a,l,s){var c;(c=this.target)==null||c.addEventListener(a,l,s),this.listeners.push([a,l,s])}}function c3(n){const{EventTarget:a}=zn(n);return n instanceof a?n:Fs(n)}function zh(n,a){const l=Math.abs(n.x),s=Math.abs(n.y);return typeof a=="number"?Math.sqrt(l**2+s**2)>a:"x"in a&&"y"in a?l>a.x&&s>a.y:"x"in a?l>a.x:"y"in a?s>a.y:!1}var la;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(la||(la={}));function _b(n){n.preventDefault()}function u3(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 pS={start:[Ke.Space,Ke.Enter],cancel:[Ke.Esc],end:[Ke.Space,Ke.Enter,Ke.Tab]},d3=(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 Mp{constructor(a){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=a;const{event:{target:l}}=a;this.props=a,this.listeners=new Xo(Fs(l)),this.windowListeners=new Xo(zn(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(la.Resize,this.handleCancel),this.windowListeners.add(la.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(la.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:l}=this.props,s=a.node.current;s&&o3(s),l(Ea)}handleKeyDown(a){if(Np(a)){const{active:l,context:s,options:c}=this.props,{keyboardCodes:u=pS,coordinateGetter:f=d3,scrollBehavior:p="smooth"}=c,{code:g}=a;if(u.end.includes(g)){this.handleEnd(a);return}if(u.cancel.includes(g)){this.handleCancel(a);return}const{collisionRect:v}=s.current,x=v?{x:v.left,y:v.top}:Ea;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:l,context:s.current,currentCoordinates:x});if(y){const b=ni(y,x),w={x:0,y:0},{scrollableAncestors:E}=s.current;for(const j of E){const C=a.code,{isTop:N,isRight:M,isLeft:T,isBottom:D,maxScroll:O,minScroll:A}=hS(j),U=r3(j),k={x:Math.min(C===Ke.Right?U.right-U.width/2:U.right,Math.max(C===Ke.Right?U.left:U.left+U.width/2,y.x)),y:Math.min(C===Ke.Down?U.bottom-U.height/2:U.bottom,Math.max(C===Ke.Down?U.top:U.top+U.height/2,y.y))},$=C===Ke.Right&&!M||C===Ke.Left&&!T,X=C===Ke.Down&&!D||C===Ke.Up&&!N;if($&&k.x!==y.x){const te=j.scrollLeft+b.x,G=C===Ke.Right&&te<=O.x||C===Ke.Left&&te>=A.x;if(G&&!b.y){j.scrollTo({left:te,behavior:p});return}G?w.x=j.scrollLeft-te:w.x=C===Ke.Right?j.scrollLeft-O.x:j.scrollLeft-A.x,w.x&&j.scrollBy({left:-w.x,behavior:p});break}else if(X&&k.y!==y.y){const te=j.scrollTop+b.y,G=C===Ke.Down&&te<=O.y||C===Ke.Up&&te>=A.y;if(G&&!b.x){j.scrollTo({top:te,behavior:p});return}G?w.y=j.scrollTop-te:w.y=C===Ke.Down?j.scrollTop-O.y:j.scrollTop-A.y,w.y&&j.scrollBy({top:-w.y,behavior:p});break}}this.handleMove(a,Us(ni(y,this.referenceCoordinates),w))}}}handleMove(a,l){const{onMove:s}=this.props;a.preventDefault(),s(l)}handleEnd(a){const{onEnd:l}=this.props;a.preventDefault(),this.detach(),l()}handleCancel(a){const{onCancel:l}=this.props;a.preventDefault(),this.detach(),l()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Mp.activators=[{eventName:"onKeyDown",handler:(n,a,l)=>{let{keyboardCodes:s=pS,onActivation:c}=a,{active:u}=l;const{code:f}=n.nativeEvent;if(s.start.includes(f)){const p=u.activatorNode.current;return p&&n.target!==p?!1:(n.preventDefault(),c==null||c({event:n.nativeEvent}),!0)}return!1}}];function kb(n){return!!(n&&"distance"in n)}function zb(n){return!!(n&&"delay"in n)}class Ap{constructor(a,l,s){var c;s===void 0&&(s=c3(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=Fs(f),this.documentListeners=new Xo(this.document),this.listeners=new Xo(s),this.windowListeners=new Xo(zn(f)),this.initialCoordinates=(c=fm(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:s}}}=this;if(this.listeners.add(a.move.name,this.handleMove,{passive:!1}),this.listeners.add(a.end.name,this.handleEnd),a.cancel&&this.listeners.add(a.cancel.name,this.handleCancel),this.windowListeners.add(la.Resize,this.handleCancel),this.windowListeners.add(la.DragStart,_b),this.windowListeners.add(la.VisibilityChange,this.handleCancel),this.windowListeners.add(la.ContextMenu,_b),this.documentListeners.add(la.Keydown,this.handleKeydown),l){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zb(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(kb(l)){this.handlePending(l);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(a,l){const{active:s,onPending:c}=this.props;c(s,a,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:a}=this,{onStart:l}=this.props;a&&(this.activated=!0,this.documentListeners.add(la.Click,u3,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(la.SelectionChange,this.removeTextSelection),l(a))}handleMove(a){var l;const{activated:s,initialCoordinates:c,props:u}=this,{onMove:f,options:{activationConstraint:p}}=u;if(!c)return;const g=(l=fm(a))!=null?l:Ea,v=ni(c,g);if(!s&&p){if(kb(p)){if(p.tolerance!=null&&zh(v,p.tolerance))return this.handleCancel();if(zh(v,p.distance))return this.handleStart()}if(zb(p)&&zh(v,p.tolerance))return this.handleCancel();this.handlePending(p,v);return}a.cancelable&&a.preventDefault(),f(g)}handleEnd(){const{onAbort:a,onEnd:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleCancel(){const{onAbort:a,onCancel:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleKeydown(a){a.code===Ke.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const f3={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Dp extends Ap{constructor(a){const{event:l}=a,s=Fs(l.target);super(a,f3,s)}}Dp.activators=[{eventName:"onPointerDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:s}=a;return!l.isPrimary||l.button!==0?!1:(s==null||s({event:l}),!0)}}];const h3={move:{name:"mousemove"},end:{name:"mouseup"}};var mm;(function(n){n[n.RightClick=2]="RightClick"})(mm||(mm={}));class m3 extends Ap{constructor(a){super(a,h3,Fs(a.event.target))}}m3.activators=[{eventName:"onMouseDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:s}=a;return l.button===mm.RightClick?!1:(s==null||s({event:l}),!0)}}];const Lh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class p3 extends Ap{constructor(a){super(a,Lh)}static setup(){return window.addEventListener(Lh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Lh.move.name,a)};function a(){}}}p3.activators=[{eventName:"onTouchStart",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:s}=a;const{touches:c}=l;return c.length>1?!1:(s==null||s({event:l}),!0)}}];var Fo;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Fo||(Fo={}));var mu;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(mu||(mu={}));function g3(n){let{acceleration:a,activator:l=Fo.Pointer,canScroll:s,draggingRect:c,enabled:u,interval:f=5,order:p=mu.TreeOrder,pointerCoordinates:g,scrollableAncestors:v,scrollableAncestorRects:x,delta:y,threshold:b}=n;const w=x3({delta:y,disabled:!u}),[E,j]=T_(),C=m.useRef({x:0,y:0}),N=m.useRef({x:0,y:0}),M=m.useMemo(()=>{switch(l){case Fo.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case Fo.DraggableRect:return c}},[l,c,g]),T=m.useRef(null),D=m.useCallback(()=>{const A=T.current;if(!A)return;const U=C.current.x*N.current.x,k=C.current.y*N.current.y;A.scrollBy(U,k)},[]),O=m.useMemo(()=>p===mu.TreeOrder?[...v].reverse():v,[p,v]);m.useEffect(()=>{if(!u||!v.length||!M){j();return}for(const A of O){if((s==null?void 0:s(A))===!1)continue;const U=v.indexOf(A),k=x[U];if(!k)continue;const{direction:$,speed:X}=a3(A,k,M,a,b);for(const te of["x","y"])w[te][$[te]]||(X[te]=0,$[te]=0);if(X.x>0||X.y>0){j(),T.current=A,E(D,f),C.current=X,N.current=$;return}}C.current={x:0,y:0},N.current={x:0,y:0},j()},[a,D,s,j,u,f,JSON.stringify(M),JSON.stringify(w),E,v,O,x,JSON.stringify(b)])}const v3={x:{[Wt.Backward]:!1,[Wt.Forward]:!1},y:{[Wt.Backward]:!1,[Wt.Forward]:!1}};function x3(n){let{delta:a,disabled:l}=n;const s=dm(a);return vi(c=>{if(l||!s||!c)return v3;const u={x:Math.sign(a.x-s.x),y:Math.sign(a.y-s.y)};return{x:{[Wt.Backward]:c.x[Wt.Backward]||u.x===-1,[Wt.Forward]:c.x[Wt.Forward]||u.x===1},y:{[Wt.Backward]:c.y[Wt.Backward]||u.y===-1,[Wt.Forward]:c.y[Wt.Forward]||u.y===1}}},[l,a,s])}function y3(n,a){const l=a!=null?n.get(a):void 0,s=l?l.node.current:null;return vi(c=>{var u;return a==null?null:(u=s??c)!=null?u:null},[s,a])}function b3(n,a){return m.useMemo(()=>n.reduce((l,s)=>{const{sensor:c}=s,u=c.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,s)}));return[...l,...u]},[]),[n,a])}var ai;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(ai||(ai={}));var pm;(function(n){n.Optimized="optimized"})(pm||(pm={}));const Lb=new Map;function w3(n,a){let{dragging:l,dependencies:s,config:c}=a;const[u,f]=m.useState(null),{frequency:p,measure:g,strategy:v}=c,x=m.useRef(n),y=C(),b=ti(y),w=m.useCallback(function(N){N===void 0&&(N=[]),!b.current&&f(M=>M===null?N:M.concat(N.filter(T=>!M.includes(T))))},[b]),E=m.useRef(null),j=vi(N=>{if(y&&!l)return Lb;if(!N||N===Lb||x.current!==n||u!=null){const M=new Map;for(let T of n){if(!T)continue;if(u&&u.length>0&&!u.includes(T.id)&&T.rect.current){M.set(T.id,T.rect.current);continue}const D=T.node.current,O=D?new Tp(g(D),D):null;T.rect.current=O,O&&M.set(T.id,O)}return M}return N},[n,u,l,y,g]);return m.useEffect(()=>{x.current=n},[n]),m.useEffect(()=>{y||w()},[l,y]),m.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),m.useEffect(()=>{y||typeof p!="number"||E.current!==null||(E.current=setTimeout(()=>{w(),E.current=null},p))},[p,y,w,...s]),{droppableRects:j,measureDroppableContainers:w,measuringScheduled:u!=null};function C(){switch(v){case ai.Always:return!1;case ai.BeforeDragging:return l;default:return!l}}}function gS(n,a){return vi(l=>n?l||(typeof a=="function"?a(n):n):null,[a,n])}function S3(n,a){return gS(n,a)}function j3(n){let{callback:a,disabled:l}=n;const s=Rp(a),c=m.useMemo(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(s)},[s,l]);return m.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function Qu(n){let{callback:a,disabled:l}=n;const s=Rp(a),c=m.useMemo(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(s)},[l]);return m.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function C3(n){return new Tp(Qs(n),n)}function Ub(n,a,l){a===void 0&&(a=C3);const[s,c]=m.useState(null);function u(){c(g=>{if(!n)return null;if(n.isConnected===!1){var v;return(v=g??l)!=null?v:null}const x=a(n);return JSON.stringify(g)===JSON.stringify(x)?g:x})}const f=j3({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=Qu({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]),s}function E3(n){const a=gS(n);return iS(n,a)}const Bb=[];function R3(n){const a=m.useRef(n),l=vi(s=>n?s&&s!==Bb&&n&&a.current&&n.parentNode===a.current.parentNode?s:Fu(n):Bb,[n]);return m.useEffect(()=>{a.current=n},[n]),l}function N3(n){const[a,l]=m.useState(null),s=m.useRef(n),c=m.useCallback(u=>{const f=kh(u.target);f&&l(p=>p?(p.set(f,hm(f)),new Map(p)):null)},[]);return m.useEffect(()=>{const u=s.current;if(n!==u){f(u);const p=n.map(g=>{const v=kh(g);return v?(v.addEventListener("scroll",c,{passive:!0}),[v,hm(v)]):null}).filter(g=>g!=null);l(p.length?new Map(p):null),s.current=n}return()=>{f(n),f(u)};function f(p){p.forEach(g=>{const v=kh(g);v==null||v.removeEventListener("scroll",c)})}},[c,n]),m.useMemo(()=>n.length?a?Array.from(a.values()).reduce((u,f)=>Us(u,f),Ea):mS(n):Ea,[n,a])}function Hb(n,a){a===void 0&&(a=[]);const l=m.useRef(null);return m.useEffect(()=>{l.current=null},a),m.useEffect(()=>{const s=n!==Ea;s&&!l.current&&(l.current=n),!s&&l.current&&(l.current=null)},[n]),l.current?ni(n,l.current):Ea}function T3(n){m.useEffect(()=>{if(!Xu)return;const a=n.map(l=>{let{sensor:s}=l;return s.setup==null?void 0:s.setup()});return()=>{for(const l of a)l==null||l()}},n.map(a=>{let{sensor:l}=a;return l}))}function M3(n,a){return m.useMemo(()=>n.reduce((l,s)=>{let{eventName:c,handler:u}=s;return l[c]=f=>{u(f,a)},l},{}),[n,a])}function vS(n){return m.useMemo(()=>n?W_(n):null,[n])}const Ib=[];function A3(n,a){a===void 0&&(a=Qs);const[l]=n,s=vS(l?zn(l):null),[c,u]=m.useState(Ib);function f(){u(()=>n.length?n.map(g=>fS(g)?s:new Tp(a(g),g)):Ib)}const p=Qu({callback:f});return qa(()=>{p==null||p.disconnect(),f(),n.forEach(g=>p==null?void 0:p.observe(g))},[n]),c}function D3(n){if(!n)return null;if(n.children.length>1)return n;const a=n.children[0];return gi(a)?a:n}function O3(n){let{measure:a}=n;const[l,s]=m.useState(null),c=m.useCallback(v=>{for(const{target:x}of v)if(gi(x)){s(y=>{const b=a(x);return y?{...y,width:b.width,height:b.height}:b});break}},[a]),u=Qu({callback:c}),f=m.useCallback(v=>{const x=D3(v);u==null||u.disconnect(),x&&(u==null||u.observe(x)),s(x?a(x):null)},[a,u]),[p,g]=du(f);return m.useMemo(()=>({nodeRef:p,rect:l,setRef:g}),[l,p,g])}const _3=[{sensor:Dp,options:{}},{sensor:Mp,options:{}}],k3={current:{}},eu={draggable:{measure:Ob},droppable:{measure:Ob,strategy:ai.WhileDragging,frequency:pm.Optimized},dragOverlay:{measure:Qs}};class Qo extends Map{get(a){var l;return a!=null&&(l=super.get(a))!=null?l:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(a=>{let{disabled:l}=a;return!l})}getNodeFor(a){var l,s;return(l=(s=this.get(a))==null?void 0:s.node.current)!=null?l:void 0}}const z3={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Qo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:hu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eu,measureDroppableContainers:hu,windowRect:null,measuringScheduled:!1},L3={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:hu,draggableNodes:new Map,over:null,measureDroppableContainers:hu},Zu=m.createContext(L3),xS=m.createContext(z3);function U3(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Qo}}}function B3(n,a){switch(a.type){case Gt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case Gt.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 Gt.DragEnd:case Gt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Gt.RegisterDroppable:{const{element:l}=a,{id:s}=l,c=new Qo(n.droppable.containers);return c.set(s,l),{...n,droppable:{...n.droppable,containers:c}}}case Gt.SetDroppableDisabled:{const{id:l,key:s,disabled:c}=a,u=n.droppable.containers.get(l);if(!u||s!==u.key)return n;const f=new Qo(n.droppable.containers);return f.set(l,{...u,disabled:c}),{...n,droppable:{...n.droppable,containers:f}}}case Gt.UnregisterDroppable:{const{id:l,key:s}=a,c=n.droppable.containers.get(l);if(!c||s!==c.key)return n;const u=new Qo(n.droppable.containers);return u.delete(l),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function H3(n){let{disabled:a}=n;const{active:l,activatorEvent:s,draggableNodes:c}=m.useContext(Zu),u=dm(s),f=dm(l==null?void 0:l.id);return m.useEffect(()=>{if(!a&&!s&&u&&f!=null){if(!Np(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=D_(x);if(y){y.focus();break}}})}},[s,a,c,f,u]),null}function I3(n,a){let{transform:l,...s}=a;return n!=null&&n.length?n.reduce((c,u)=>u({transform:c,...s}),l):l}function P3(n){return m.useMemo(()=>({draggable:{...eu.draggable,...n==null?void 0:n.draggable},droppable:{...eu.droppable,...n==null?void 0:n.droppable},dragOverlay:{...eu.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function q3(n){let{activeNode:a,measure:l,initialRect:s,config:c=!0}=n;const u=m.useRef(!1),{x:f,y:p}=typeof c=="boolean"?{x:c,y:c}:c;qa(()=>{if(!f&&!p||!a){u.current=!1;return}if(u.current||!s)return;const v=a==null?void 0:a.node.current;if(!v||v.isConnected===!1)return;const x=l(v),y=iS(x,s);if(f||(y.x=0),p||(y.y=0),u.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const b=cS(v);b&&b.scrollBy({top:y.y,left:y.x})}},[a,f,p,s,l])}const yS=m.createContext({...Ea,scaleX:1,scaleY:1});var al;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(al||(al={}));const V3=m.memo(function(a){var l,s,c,u;let{id:f,accessibility:p,autoScroll:g=!0,children:v,sensors:x=_3,collisionDetection:y=G_,measuring:b,modifiers:w,...E}=a;const j=m.useReducer(B3,void 0,U3),[C,N]=j,[M,T]=U_(),[D,O]=m.useState(al.Uninitialized),A=D===al.Initialized,{draggable:{active:U,nodes:k,translate:$},droppable:{containers:X}}=C,te=U!=null?k.get(U):null,G=m.useRef({initial:null,translated:null}),ie=m.useMemo(()=>{var vt;return U!=null?{id:U,data:(vt=te==null?void 0:te.data)!=null?vt:k3,rect:G}:null},[U,te]),ce=m.useRef(null),[se,_]=m.useState(null),[H,Q]=m.useState(null),J=ti(E,Object.values(E)),ee=xi("DndDescribedBy",f),z=m.useMemo(()=>X.getEnabled(),[X]),I=P3(b),{droppableRects:F,measureDroppableContainers:re,measuringScheduled:he}=w3(z,{dragging:A,dependencies:[$.x,$.y],config:I.droppable}),ge=y3(k,U),q=m.useMemo(()=>H?fm(H):null,[H]),oe=Nr(),de=S3(ge,I.draggable.measure);q3({activeNode:U!=null?k.get(U):null,config:oe.layoutShiftCompensation,initialRect:de,measure:I.draggable.measure});const fe=Ub(ge,I.draggable.measure,de),Te=Ub(ge?ge.parentElement:null),je=m.useRef({activatorEvent:null,active:null,activeNode:ge,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:X,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),De=X.getNodeFor((l=je.current.over)==null?void 0:l.id),Fe=O3({measure:I.dragOverlay.measure}),et=(s=Fe.nodeRef.current)!=null?s:ge,le=A?(c=Fe.rect)!=null?c:fe:null,Le=!!(Fe.nodeRef.current&&Fe.rect),Ie=E3(Le?null:fe),kt=vS(et?zn(et):null),St=R3(A?De??ge:null),Ft=A3(St),on=I3(w,{transform:{x:$.x-Ie.x,y:$.y-Ie.y,scaleX:1,scaleY:1},activatorEvent:H,active:ie,activeNodeRect:fe,containerNodeRect:Te,draggingNodeRect:le,over:je.current.over,overlayNodeRect:Fe.rect,scrollableAncestors:St,scrollableAncestorRects:Ft,windowRect:kt}),Qt=q?Us(q,$):null,jt=N3(St),fn=Hb(jt),Mt=Hb(jt,[fe]),At=Us(on,fn),cn=le?F_(le,on):null,fa=ie&&cn?y({active:ie,collisionRect:cn,droppableRects:F,droppableContainers:z,pointerCoordinates:Qt}):null,Ta=oS(fa,"id"),[Gn,dl]=m.useState(null),ha=Le?on:Us(on,Mt),Dt=K_(ha,(u=Gn==null?void 0:Gn.rect)!=null?u:null,fe),hn=m.useRef(null),Tt=m.useCallback((vt,st)=>{let{sensor:Bt,options:Ce}=st;if(ce.current==null)return;const ke=k.get(ce.current);if(!ke)return;const Ue=vt.nativeEvent,gt=new Bt({active:ce.current,activeNode:ke,event:Ue,options:Ce,context:je,onAbort(ct){if(!k.get(ct))return;const{onDragAbort:xt}=J.current,zt={id:ct};xt==null||xt(zt),M({type:"onDragAbort",event:zt})},onPending(ct,$t,xt,zt){if(!k.get(ct))return;const{onDragPending:Ka}=J.current,ma={id:ct,constraint:$t,initialCoordinates:xt,offset:zt};Ka==null||Ka(ma),M({type:"onDragPending",event:ma})},onStart(ct){const $t=ce.current;if($t==null)return;const xt=k.get($t);if(!xt)return;const{onDragStart:zt}=J.current,Ga={activatorEvent:Ue,active:{id:$t,data:xt.data,rect:G}};ba.unstable_batchedUpdates(()=>{zt==null||zt(Ga),O(al.Initializing),N({type:Gt.DragStart,initialCoordinates:ct,active:$t}),M({type:"onDragStart",event:Ga}),_(hn.current),Q(Ue)})},onMove(ct){N({type:Gt.DragMove,coordinates:ct})},onEnd:Ct(Gt.DragEnd),onCancel:Ct(Gt.DragCancel)});hn.current=gt;function Ct(ct){return async function(){const{active:xt,collisions:zt,over:Ga,scrollAdjustedTranslate:Ka}=je.current;let ma=null;if(xt&&Ka){const{cancelDrop:Tr}=J.current;ma={activatorEvent:Ue,active:xt,collisions:zt,delta:Ka,over:Ga},ct===Gt.DragEnd&&typeof Tr=="function"&&await Promise.resolve(Tr(ma))&&(ct=Gt.DragCancel)}ce.current=null,ba.unstable_batchedUpdates(()=>{N({type:ct}),O(al.Uninitialized),dl(null),_(null),Q(null),hn.current=null;const Tr=ct===Gt.DragEnd?"onDragEnd":"onDragCancel";if(ma){const Kn=J.current[Tr];Kn==null||Kn(ma),M({type:Tr,event:ma})}})}}},[k]),Js=m.useCallback((vt,st)=>(Bt,Ce)=>{const ke=Bt.nativeEvent,Ue=k.get(Ce);if(ce.current!==null||!Ue||ke.dndKit||ke.defaultPrevented)return;const gt={active:Ue};vt(Bt,st.options,gt)===!0&&(ke.dndKit={capturedBy:st.sensor},ce.current=Ce,Tt(Bt,st))},[k,Tt]),Pl=b3(x,Js);T3(x),qa(()=>{fe&&D===al.Initializing&&O(al.Initialized)},[fe,D]),m.useEffect(()=>{const{onDragMove:vt}=J.current,{active:st,activatorEvent:Bt,collisions:Ce,over:ke}=je.current;if(!st||!Bt)return;const Ue={active:st,activatorEvent:Bt,collisions:Ce,delta:{x:At.x,y:At.y},over:ke};ba.unstable_batchedUpdates(()=>{vt==null||vt(Ue),M({type:"onDragMove",event:Ue})})},[At.x,At.y]),m.useEffect(()=>{const{active:vt,activatorEvent:st,collisions:Bt,droppableContainers:Ce,scrollAdjustedTranslate:ke}=je.current;if(!vt||ce.current==null||!st||!ke)return;const{onDragOver:Ue}=J.current,gt=Ce.get(Ta),Ct=gt&>.rect.current?{id:gt.id,rect:gt.rect.current,data:gt.data,disabled:gt.disabled}:null,ct={active:vt,activatorEvent:st,collisions:Bt,delta:{x:ke.x,y:ke.y},over:Ct};ba.unstable_batchedUpdates(()=>{dl(Ct),Ue==null||Ue(ct),M({type:"onDragOver",event:ct})})},[Ta]),qa(()=>{je.current={activatorEvent:H,active:ie,activeNode:ge,collisionRect:cn,collisions:fa,droppableRects:F,draggableNodes:k,draggingNode:et,draggingNodeRect:le,droppableContainers:X,over:Gn,scrollableAncestors:St,scrollAdjustedTranslate:At},G.current={initial:le,translated:cn}},[ie,ge,fa,cn,k,et,le,F,X,Gn,St,At]),g3({...oe,delta:$,draggingRect:cn,pointerCoordinates:Qt,scrollableAncestors:St,scrollableAncestorRects:Ft});const ql=m.useMemo(()=>({active:ie,activeNode:ge,activeNodeRect:fe,activatorEvent:H,collisions:fa,containerNodeRect:Te,dragOverlay:Fe,draggableNodes:k,droppableContainers:X,droppableRects:F,over:Gn,measureDroppableContainers:re,scrollableAncestors:St,scrollableAncestorRects:Ft,measuringConfiguration:I,measuringScheduled:he,windowRect:kt}),[ie,ge,fe,H,fa,Te,Fe,k,X,F,Gn,re,St,Ft,I,he,kt]),Ya=m.useMemo(()=>({activatorEvent:H,activators:Pl,active:ie,activeNodeRect:fe,ariaDescribedById:{draggable:ee},dispatch:N,draggableNodes:k,over:Gn,measureDroppableContainers:re}),[H,Pl,ie,fe,N,ee,k,Gn,re]);return ue.createElement(rS.Provider,{value:T},ue.createElement(Zu.Provider,{value:Ya},ue.createElement(xS.Provider,{value:ql},ue.createElement(yS.Provider,{value:Dt},v)),ue.createElement(H3,{disabled:(p==null?void 0:p.restoreFocus)===!1})),ue.createElement(I_,{...p,hiddenTextDescribedById:ee}));function Nr(){const vt=(se==null?void 0:se.autoScrollEnabled)===!1,st=typeof g=="object"?g.enabled===!1:g===!1,Bt=A&&!vt&&!st;return typeof g=="object"?{...g,enabled:Bt}:{enabled:Bt}}}),$3=m.createContext(null),Pb="button",Y3="Draggable";function G3(n){let{id:a,data:l,disabled:s=!1,attributes:c}=n;const u=xi(Y3),{activators:f,activatorEvent:p,active:g,activeNodeRect:v,ariaDescribedById:x,draggableNodes:y,over:b}=m.useContext(Zu),{role:w=Pb,roleDescription:E="draggable",tabIndex:j=0}=c??{},C=(g==null?void 0:g.id)===a,N=m.useContext(C?yS:$3),[M,T]=du(),[D,O]=du(),A=M3(f,a),U=ti(l);qa(()=>(y.set(a,{id:a,key:u,node:M,activatorNode:D,data:U}),()=>{const $=y.get(a);$&&$.key===u&&y.delete(a)}),[y,a]);const k=m.useMemo(()=>({role:w,tabIndex:j,"aria-disabled":s,"aria-pressed":C&&w===Pb?!0:void 0,"aria-roledescription":E,"aria-describedby":x.draggable}),[s,w,j,C,E,x.draggable]);return{active:g,activatorEvent:p,activeNodeRect:v,attributes:k,isDragging:C,listeners:s?void 0:A,node:M,over:b,setNodeRef:T,setActivatorNodeRef:O,transform:N}}function K3(){return m.useContext(xS)}const X3="Droppable",F3={timeout:25};function Q3(n){let{data:a,disabled:l=!1,id:s,resizeObserverConfig:c}=n;const u=xi(X3),{active:f,dispatch:p,over:g,measureDroppableContainers:v}=m.useContext(Zu),x=m.useRef({disabled:l}),y=m.useRef(!1),b=m.useRef(null),w=m.useRef(null),{disabled:E,updateMeasurementsFor:j,timeout:C}={...F3,...c},N=ti(j??s),M=m.useCallback(()=>{if(!y.current){y.current=!0;return}w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{v(Array.isArray(N.current)?N.current:[N.current]),w.current=null},C)},[C]),T=Qu({callback:M,disabled:E||!f}),D=m.useCallback((k,$)=>{T&&($&&(T.unobserve($),y.current=!1),k&&T.observe(k))},[T]),[O,A]=du(D),U=ti(a);return m.useEffect(()=>{!T||!O.current||(T.disconnect(),y.current=!1,T.observe(O.current))},[O,T]),m.useEffect(()=>(p({type:Gt.RegisterDroppable,element:{id:s,key:u,disabled:l,node:O,rect:b,data:U}}),()=>p({type:Gt.UnregisterDroppable,key:u,id:s})),[s]),m.useEffect(()=>{l!==x.current.disabled&&(p({type:Gt.SetDroppableDisabled,id:s,key:u,disabled:l}),x.current.disabled=l)},[s,u,l,p]),{active:f,rect:b,isOver:(g==null?void 0:g.id)===s,node:O,over:g,setNodeRef:A}}function Z3(n,a,l){const s={...n};return a.top+n.y<=l.top?s.y=l.top-a.top:a.bottom+n.y>=l.top+l.height&&(s.y=l.top+l.height-a.bottom),a.left+n.x<=l.left?s.x=l.left-a.left:a.right+n.x>=l.left+l.width&&(s.x=l.left+l.width-a.right),s}const J3=n=>{let{containerNodeRect:a,draggingNodeRect:l,transform:s}=n;return!l||!a?s:Z3(s,l,a)},W3=n=>{let{transform:a}=n;return{...a,x:0}};function Op(n,a,l){const s=n.slice();return s.splice(l<0?s.length+l:l,0,s.splice(a,1)[0]),s}function ek(n,a){return n.reduce((l,s,c)=>{const u=a.get(s);return u&&(l[c]=u),l},Array(n.length))}function Pc(n){return n!==null&&n>=0}function tk(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 nk(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const bS=n=>{let{rects:a,activeIndex:l,overIndex:s,index:c}=n;const u=Op(a,s,l),f=a[c],p=u[c];return!p||!f?null:{x:p.left-f.left,y:p.top-f.top,scaleX:p.width/f.width,scaleY:p.height/f.height}},qc={scaleX:1,scaleY:1},ak=n=>{var a;let{activeIndex:l,activeNodeRect:s,index:c,rects:u,overIndex:f}=n;const p=(a=u[l])!=null?a:s;if(!p)return null;if(c===l){const v=u[f];return v?{x:0,y:l<f?v.top+v.height-(p.top+p.height):v.top-p.top,...qc}:null}const g=rk(u,c,l);return c>l&&c<=f?{x:0,y:-p.height-g,...qc}:c<l&&c>=f?{x:0,y:p.height+g,...qc}:{x:0,y:0,...qc}};function rk(n,a,l){const s=n[a],c=n[a-1],u=n[a+1];return s?l<a?c?s.top-(c.top+c.height):u?u.top-(s.top+s.height):0:u?u.top-(s.top+s.height):c?s.top-(c.top+c.height):0:0}const wS="Sortable",SS=ue.createContext({activeIndex:-1,containerId:wS,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:bS,disabled:{draggable:!1,droppable:!1}});function lk(n){let{children:a,id:l,items:s,strategy:c=bS,disabled:u=!1}=n;const{active:f,dragOverlay:p,droppableRects:g,over:v,measureDroppableContainers:x}=K3(),y=xi(wS,l),b=p.rect!==null,w=m.useMemo(()=>s.map(A=>typeof A=="object"&&"id"in A?A.id:A),[s]),E=f!=null,j=f?w.indexOf(f.id):-1,C=v?w.indexOf(v.id):-1,N=m.useRef(w),M=!tk(w,N.current),T=C!==-1&&j===-1||M,D=nk(u);qa(()=>{M&&E&&x(w)},[M,w,E,x]),m.useEffect(()=>{N.current=w},[w]);const O=m.useMemo(()=>({activeIndex:j,containerId:y,disabled:D,disableTransforms:T,items:w,overIndex:C,useDragOverlay:b,sortedRects:ek(w,g),strategy:c}),[j,y,D.draggable,D.droppable,T,w,C,g,b,c]);return ue.createElement(SS.Provider,{value:O},a)}const sk=n=>{let{id:a,items:l,activeIndex:s,overIndex:c}=n;return Op(l,s,c).indexOf(a)},ok=n=>{let{containerId:a,isSorting:l,wasDragging:s,index:c,items:u,newIndex:f,previousItems:p,previousContainerId:g,transition:v}=n;return!v||!s||p!==u&&c===f?!1:l?!0:f!==c&&a===g},ik={duration:200,easing:"ease"},jS="transform",ck=fu.Transition.toString({property:jS,duration:0,easing:"linear"}),uk={roleDescription:"sortable"};function dk(n){let{disabled:a,index:l,node:s,rect:c}=n;const[u,f]=m.useState(null),p=m.useRef(l);return qa(()=>{if(!a&&l!==p.current&&s.current){const g=c.current;if(g){const v=Qs(s.current,{ignoreTransform:!0}),x={x:g.left-v.left,y:g.top-v.top,scaleX:g.width/v.width,scaleY:g.height/v.height};(x.x||x.y)&&f(x)}}l!==p.current&&(p.current=l)},[a,l,s,c]),m.useEffect(()=>{u&&f(null)},[u]),u}function fk(n){let{animateLayoutChanges:a=ok,attributes:l,disabled:s,data:c,getNewIndex:u=sk,id:f,strategy:p,resizeObserverConfig:g,transition:v=ik}=n;const{items:x,containerId:y,activeIndex:b,disabled:w,disableTransforms:E,sortedRects:j,overIndex:C,useDragOverlay:N,strategy:M}=m.useContext(SS),T=hk(s,w),D=x.indexOf(f),O=m.useMemo(()=>({sortable:{containerId:y,index:D,items:x},...c}),[y,c,D,x]),A=m.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:U,node:k,isOver:$,setNodeRef:X}=Q3({id:f,data:O,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...g}}),{active:te,activatorEvent:G,activeNodeRect:ie,attributes:ce,setNodeRef:se,listeners:_,isDragging:H,over:Q,setActivatorNodeRef:J,transform:ee}=G3({id:f,data:O,attributes:{...uk,...l},disabled:T.draggable}),z=N_(X,se),I=!!te,F=I&&!E&&Pc(b)&&Pc(C),re=!N&&H,he=re&&F?ee:null,q=F?he??(p??M)({rects:j,activeNodeRect:ie,activeIndex:b,overIndex:C,index:D}):null,oe=Pc(b)&&Pc(C)?u({id:f,items:x,activeIndex:b,overIndex:C}):D,de=te==null?void 0:te.id,fe=m.useRef({activeId:de,items:x,newIndex:oe,containerId:y}),Te=x!==fe.current.items,je=a({active:te,containerId:y,isDragging:H,isSorting:I,id:f,index:D,items:x,newIndex:fe.current.newIndex,previousItems:fe.current.items,previousContainerId:fe.current.containerId,transition:v,wasDragging:fe.current.activeId!=null}),De=dk({disabled:!je,index:D,node:k,rect:U});return m.useEffect(()=>{I&&fe.current.newIndex!==oe&&(fe.current.newIndex=oe),y!==fe.current.containerId&&(fe.current.containerId=y),x!==fe.current.items&&(fe.current.items=x)},[I,oe,y,x]),m.useEffect(()=>{if(de===fe.current.activeId)return;if(de!=null&&fe.current.activeId==null){fe.current.activeId=de;return}const et=setTimeout(()=>{fe.current.activeId=de},50);return()=>clearTimeout(et)},[de]),{active:te,activeIndex:b,attributes:ce,data:O,rect:U,index:D,newIndex:oe,items:x,isOver:$,isSorting:I,isDragging:H,listeners:_,node:k,overIndex:C,over:Q,setNodeRef:z,setActivatorNodeRef:J,setDroppableNodeRef:X,setDraggableNodeRef:se,transform:De??q,transition:Fe()};function Fe(){if(De||Te&&fe.current.newIndex===D)return ck;if(!(re&&!Np(G)||!v)&&(I||je))return fu.Transition.toString({...v,property:jS})}}function hk(n,a){var l,s;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(l=n==null?void 0:n.draggable)!=null?l:a.draggable,droppable:(s=n==null?void 0:n.droppable)!=null?s:a.droppable}}function pu(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 mk=[Ke.Down,Ke.Right,Ke.Up,Ke.Left],pk=(n,a)=>{let{context:{active:l,collisionRect:s,droppableRects:c,droppableContainers:u,over:f,scrollableAncestors:p}}=a;if(mk.includes(n.code)){if(n.preventDefault(),!l||!s)return;const g=[];u.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const b=c.get(y.id);if(b)switch(n.code){case Ke.Down:s.top<b.top&&g.push(y);break;case Ke.Up:s.top>b.top&&g.push(y);break;case Ke.Left:s.left>b.left&&g.push(y);break;case Ke.Right:s.left<b.left&&g.push(y);break}});const v=$_({collisionRect:s,droppableRects:c,droppableContainers:g});let x=oS(v,"id");if(x===(f==null?void 0:f.id)&&v.length>1&&(x=v[1].id),x!=null){const y=u.get(l.id),b=u.get(x),w=b?c.get(b.id):null,E=b==null?void 0:b.node.current;if(E&&w&&y&&b){const C=Fu(E).some((A,U)=>p[U]!==A),N=CS(y,b),M=gk(y,b),T=C||!N?{x:0,y:0}:{x:M?s.width-w.width:0,y:M?s.height-w.height:0},D={x:w.left,y:w.top};return T.x&&T.y?D:ni(D,T)}}}};function CS(n,a){return!pu(n)||!pu(a)?!1:n.data.current.sortable.containerId===a.data.current.sortable.containerId}function gk(n,a){return!pu(n)||!pu(a)||!CS(n,a)?!1:n.data.current.sortable.index<a.data.current.sortable.index}const Uh={maxTotalAttempts:3,fallbackOnConnection:!0,fallbackOnConnectTimeout:!0,fallbackOnFirstTokenTimeout:!0,fallbackOn408:!0,fallbackOn429:!0,fallbackOn5xx:!0},vk={member_disabled:"member disabled",model_missing:"model missing",provider_disabled:"provider disabled",provider_down:"provider down",model_disabled:"model disabled",upstream_unavailable:"upstream unavailable",circuit_open:"circuit open",chat_capability_unavailable:"chat capability unavailable"},gu=n=>n.map((a,l)=>({...a,position:l}));function xk(){const[n,a]=m.useState([]),[l,s]=m.useState([]),[c,u]=m.useState(!1),[f,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(!1),[b,w]=m.useState(!1),[E,j]=m.useState(null),[C,N]=m.useState(null),[M,T]=m.useState({name:"",slug:"",enabled:!0,...Uh,members:[]}),[D,O]=m.useState({name:"",slug:"",enabled:!0,...Uh,members:[]}),[A,U]=m.useState(null),k=async()=>{const[_,H]=await Promise.all([Se.get("/api/admin/combos"),Se.get("/api/admin/models")]);a(_.combos),s(H.models)};m.useEffect(()=>{k()},[]);const $=async _=>{j(_.id);try{N(await Se.post("/api/admin/combos/"+_.id+"/test"))}catch(H){ve.error(H.message)}finally{j(null)}},X=async()=>{if(M.members.length===0){ve.error("Add at least one member");return}y(!0);try{await Se.post("/api/admin/combos",{name:M.name,slug:M.slug||void 0,enabled:M.enabled,...M,members:M.members}),ve.success("Combo created"),u(!1),T({name:"",slug:"",enabled:!0,...Uh,members:[]}),k()}catch(_){ve.error(_.message)}finally{y(!1)}},te=async _=>{try{const Q=(await Se.get(`/api/admin/combos/${_.id}`)).combo;v(Q.id),O({name:Q.name,slug:Q.publicModelId.startsWith("combo/")?Q.slug:"",enabled:Q.enabled,maxTotalAttempts:Q.maxTotalAttempts,fallbackOnConnection:Q.fallbackOnConnection,fallbackOnConnectTimeout:Q.fallbackOnConnectTimeout,fallbackOnFirstTokenTimeout:Q.fallbackOnFirstTokenTimeout,fallbackOn408:Q.fallbackOn408,fallbackOn429:Q.fallbackOn429,fallbackOn5xx:Q.fallbackOn5xx,members:Q.members.map(J=>({modelId:J.modelId,position:J.position,enabled:J.enabled}))}),p(!0)}catch(H){ve.error(H.message)}},G=async()=>{if(g){if(D.members.length===0){ve.error("Add at least one member");return}w(!0);try{await Se.patch("/api/admin/combos",{id:g,name:D.name,slug:D.slug||void 0,enabled:D.enabled,...D,members:D.members}),ve.success("Combo updated"),p(!1),v(null),k()}catch(_){ve.error(_.message)}finally{w(!1)}}},ie=_=>{T(H=>({...H,members:gu([...H.members,{modelId:_,position:H.members.length,enabled:!0}])}))},ce=_=>{O(H=>({...H,members:gu([...H.members,{modelId:_,position:H.members.length,enabled:!0}])}))},se=async _=>{try{await Se.del(`/api/admin/combos/${_}`),ve.success("Combo removed"),U(null),k()}catch(H){ve.error(H.message)}};return o.jsxs("div",{children:[o.jsx($a,{title:"Combos",description:"Virtual models combining physical models",actions:o.jsxs(Mn,{open:c,onOpenChange:u,children:[o.jsx(mi,{asChild:!0,children:o.jsxs(me,{children:[o.jsx(Su,{className:"mr-1 h-4 w-4"})," New combo"]})}),o.jsxs(vn,{className:"max-h-[calc(100vh-2rem)] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[o.jsx(xn,{children:o.jsx(yn,{children:"New combo"})}),o.jsxs("div",{className:"min-h-0 space-y-3 overflow-y-auto pr-1",children:[o.jsxs("div",{children:[o.jsx(we,{children:"Name"}),o.jsx(Ae,{value:M.name,onChange:_=>T({...M,name:_.target.value})})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Slug (optional — empty uses the name as the model ID)"}),o.jsx(Ae,{value:M.slug,onChange:_=>T({...M,slug:_.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ca,{checked:M.enabled,onCheckedChange:_=>T({...M,enabled:_})}),o.jsx(we,{children:"Enabled"})]}),o.jsx(qb,{value:M,onChange:_=>T(H=>({...H,..._}))}),o.jsxs("div",{children:[o.jsx(we,{children:"Members — priority order · drag to reorder"}),o.jsx(Yb,{models:l,addedIds:M.members.map(_=>_.modelId),onAdd:ie}),o.jsx(Vb,{members:M.members,modelFor:_=>l.find(H=>H.id===_.modelId)??null}),o.jsx($b,{className:"mt-2",members:M.members,label:_=>{var H;return((H=l.find(Q=>Q.id===_.modelId))==null?void 0:H.publicModelId)??_.modelId},modelFor:_=>l.find(H=>H.id===_.modelId)??null,onChange:_=>T(H=>({...H,members:_}))})]})]}),o.jsxs(An,{children:[o.jsx(me,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),o.jsx(me,{disabled:!M.name||x,onClick:X,children:x?"Creating…":"Create"})]})]})]})}),o.jsxs(nt,{children:[o.jsxs(at,{children:[o.jsx(rt,{className:"text-base",children:"All combos"}),o.jsxs(gn,{children:[n.length," total"]})]}),o.jsx(lt,{children:o.jsxs(ca,{children:[o.jsx(ua,{children:o.jsxs(We,{children:[o.jsx(ye,{children:"Public ID"}),o.jsx(ye,{children:"Members"}),o.jsx(ye,{children:"Status"}),o.jsx(ye,{children:"Enabled"}),o.jsx(ye,{})]})}),o.jsxs(da,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:5,className:"text-center text-muted-foreground",children:"No combos yet."})}),n.map(_=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-mono text-xs",children:_.publicModelId}),o.jsx(pe,{children:_.memberCount}),o.jsxs(pe,{children:[o.jsxs(Qe,{variant:_.status==="ready"?"success":_.status==="disabled"?"secondary":"destructive",children:[_.healthyMemberCount,"/",_.memberCount," ready"]}),_.capabilityWarnings.length>0&&o.jsx("div",{className:"text-xs text-amber-600",children:"Capability metadata differs"}),_.status==="unavailable"&&_.unavailableReasons.length>0&&o.jsx("div",{className:"text-xs text-muted-foreground",children:_.unavailableReasons.map(H=>vk[H]??H).join(", ")})]}),o.jsx(pe,{children:_.enabled?"Yes":"No"}),o.jsx(pe,{className:"text-right",children:o.jsxs("div",{className:"flex items-center justify-end gap-1",children:[o.jsxs(me,{size:"sm",variant:"outline",title:"Sends a real non-streaming inference request",onClick:()=>void $(_),disabled:E===_.id,children:[E===_.id?o.jsx(_s,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):o.jsx(A0,{className:"mr-1 h-3.5 w-3.5"})," Test"]}),o.jsxs(me,{size:"sm",variant:"outline",onClick:()=>void te(_),children:[o.jsx(xR,{className:"h-3.5 w-3.5"})," Sửa"]}),o.jsxs(me,{size:"sm",variant:"destructive",onClick:()=>U(_),children:[o.jsx(ju,{className:"h-3.5 w-3.5"})," Delete"]})]})})]},_.id))]})]})})]}),o.jsx(Mn,{open:f,onOpenChange:p,children:o.jsxs(vn,{className:"max-h-[calc(100vh-2rem)] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[o.jsx(xn,{children:o.jsx(yn,{children:"Edit combo"})}),o.jsxs("div",{className:"min-h-0 space-y-3 overflow-y-auto pr-1",children:[o.jsxs("div",{children:[o.jsx(we,{children:"Name"}),o.jsx(Ae,{value:D.name,onChange:_=>O({...D,name:_.target.value})})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Slug (optional — leave empty to use the name as the model ID)"}),o.jsx(Ae,{value:D.slug,onChange:_=>O({...D,slug:_.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ca,{checked:D.enabled,onCheckedChange:_=>O({...D,enabled:_})}),o.jsx(we,{children:"Enabled"})]}),o.jsx(qb,{value:D,onChange:_=>O(H=>({...H,..._}))}),o.jsxs("div",{children:[o.jsx(we,{children:"Members — priority order · drag to reorder"}),o.jsx(Yb,{models:l,addedIds:D.members.map(_=>_.modelId),onAdd:ce}),o.jsx(Vb,{members:D.members,modelFor:_=>l.find(H=>H.id===_.modelId)??null}),o.jsx($b,{className:"mt-2",members:D.members,label:_=>{var H;return((H=l.find(Q=>Q.id===_.modelId))==null?void 0:H.publicModelId)??_.modelId},modelFor:_=>l.find(H=>H.id===_.modelId)??null,onChange:_=>O(H=>({...H,members:_}))})]})]}),o.jsxs(An,{children:[o.jsx(me,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),o.jsx(me,{disabled:!D.name||b,onClick:G,children:b?"Saving…":"Save"})]})]})}),o.jsx(Mn,{open:C!==null,onOpenChange:_=>{_||N(null)},children:o.jsxs(vn,{className:"max-w-2xl",children:[o.jsxs(xn,{children:[o.jsx(yn,{children:"Combo test result"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Test sends a real non-streaming inference request through this combo."})]}),C&&o.jsx(yk,{result:C}),o.jsx(An,{children:o.jsx(me,{onClick:()=>N(null),children:"Close"})})]})}),o.jsx(up,{open:A!==null,onOpenChange:_=>{_||U(null)},children:o.jsxs(Pu,{children:[o.jsxs(dp,{children:[o.jsx(qu,{children:"Delete combo?"}),o.jsx(Vu,{children:"This removes the virtual model and its ordered fallback configuration. Request history is preserved."})]}),o.jsxs(fp,{children:[o.jsx(Yu,{children:"Cancel"}),o.jsx($u,{onClick:()=>A&&void se(A.id),children:"Delete"})]})]})})]})}function qb({value:n,onChange:a}){const l=[["fallbackOnConnection","Connection failure"],["fallbackOnConnectTimeout","Connect timeout"],["fallbackOnFirstTokenTimeout","First-token timeout"],["fallbackOn408","HTTP 408"],["fallbackOn429","HTTP 429"],["fallbackOn5xx","HTTP 5xx"]];return o.jsxs("div",{className:"rounded border bg-muted/20 p-3",children:[o.jsx("div",{className:"mb-2 text-sm font-medium",children:"Fallback policy"}),o.jsxs("div",{className:"grid gap-3 sm:grid-cols-[10rem_1fr]",children:[o.jsxs("div",{children:[o.jsx(we,{children:"Max total attempts"}),o.jsx(Ae,{type:"number",min:1,max:8,value:n.maxTotalAttempts,onChange:s=>a({maxTotalAttempts:Math.min(8,Math.max(1,Number(s.target.value)||1))})})]}),o.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:l.map(([s,c])=>o.jsxs("label",{className:"flex items-center gap-2 text-xs",children:[o.jsx(Ca,{checked:!!n[s],onCheckedChange:u=>a({[s]:u})}),o.jsx("span",{children:c})]},s))})]})]})}function Vb({members:n,modelFor:a}){if(n.length===0)return null;const l=n.map(a).filter(c=>!!c),s=["chat","streaming","tools","structured_output","image_input","reasoning"].filter(c=>new Set(l.map(u=>u.capabilities[c]===!0?"yes":u.capabilities[c]===!1?"no":"unknown")).size>1);return o.jsxs("div",{className:"rounded border bg-muted/20 p-2 text-xs",children:[o.jsxs("div",{className:"mb-1 font-medium",children:["Route preview ",o.jsx("span",{className:"font-normal text-muted-foreground",children:"(first available member wins)"})]}),s.length>0&&o.jsxs("div",{className:"mb-2 flex items-center gap-1 text-amber-600",children:[o.jsx(O0,{className:"h-3.5 w-3.5"})," Members differ on: ",s.join(", ")]}),o.jsx("div",{className:"space-y-1",children:n.map((c,u)=>{const f=a(c);return o.jsxs("div",{className:"flex items-center gap-2 font-mono",children:[o.jsxs("span",{className:"w-4 text-muted-foreground",children:[u+1,"."]}),o.jsx("span",{children:(f==null?void 0:f.publicModelId)??c.modelId}),o.jsxs("span",{className:"text-muted-foreground",children:["→ ",(f==null?void 0:f.upstreamModelId)??"upstream model unknown"]})]},c.id??c.modelId)})})]})}function yk({result:n}){return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between rounded border p-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[n.success?o.jsx(ci,{className:"h-4 w-4 text-emerald-600"}):o.jsx(O0,{className:"h-4 w-4 text-amber-600"}),o.jsx(Qe,{variant:n.success?"success":"warning",children:n.success?"Success":"Failed"})]}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.latencyMs," ms total"]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-sm font-medium",children:"Selected upstream"}),n.selectedModel?o.jsxs("div",{className:"rounded border bg-muted/20 p-2 font-mono text-xs",children:[n.selectedModel.publicModelId," → ",n.selectedModel.upstreamModelId,o.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",n.selectedModel.providerSlug,")"]})]}):o.jsx("p",{className:"text-sm text-muted-foreground",children:"No member completed successfully."})]}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-sm font-medium",children:"Attempts"}),o.jsx("div",{className:"space-y-1",children:n.attempts.map((a,l)=>o.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[o.jsxs("span",{className:"w-4 text-muted-foreground",children:[l+1,"."]}),o.jsxs("span",{className:"min-w-0 flex-1 font-mono",children:[a.publicModelId," → ",a.upstreamModelId]}),o.jsxs("span",{className:"text-muted-foreground",children:[a.latencyMs," ms"]}),o.jsx(Qe,{variant:a.success?"success":"warning",children:a.success?"Used":a.failureReason??"Skipped"})]},a.publicModelId+"-"+l))})]}),n.text&&o.jsx("pre",{className:"max-h-32 overflow-auto whitespace-pre-wrap rounded border bg-muted/20 p-2 text-xs",children:n.text})]})}function $b({members:n,label:a,modelFor:l,onChange:s,className:c}){const u=P_(Mb(Dp,{activationConstraint:{distance:4}}),Mb(Mp,{coordinateGetter:pk}));if(n.length===0)return o.jsx("p",{className:Ee("text-xs text-muted-foreground",c),children:"No members yet — add at least one."});const f=({active:p,over:g})=>{!g||p.id===g.id||s(gu(Op(n,Number(p.id),Number(g.id))))};return o.jsx(V3,{sensors:u,collisionDetection:V_,modifiers:[W3,J3],onDragEnd:f,children:o.jsx(lk,{items:n.map((p,g)=>g),strategy:ak,children:o.jsx("div",{className:Ee("space-y-1",c),children:n.map((p,g)=>o.jsx(bk,{index:g,label:a(p),model:l(p),onRemove:()=>s(gu(n.filter((v,x)=>x!==g)))},p.id??p.modelId))})})})}function bk({index:n,label:a,model:l,onRemove:s}){const{attributes:c,listeners:u,setNodeRef:f,transform:p,transition:g,isDragging:v}=fk({id:n});return o.jsxs("div",{ref:f,style:{transform:p?`translate3d(${p.x}px, ${p.y}px, 0)`:void 0,transition:g},className:Ee("flex items-center gap-2 rounded border p-2 text-sm",v&&"relative z-10 bg-muted/60 shadow-sm"),children:[o.jsx("button",{type:"button",...c,...u,"aria-label":`Reorder ${a}`,title:"Drag to change priority",className:"cursor-grab touch-none rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground active:cursor-grabbing",children:o.jsx(cR,{className:"h-4 w-4"})}),o.jsx("span",{className:"w-5 text-xs tabular-nums text-muted-foreground",children:n+1}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("div",{className:"truncate font-mono text-xs",children:a}),o.jsxs("div",{className:"truncate text-[11px] text-muted-foreground",children:[(l==null?void 0:l.providerSlug)||"provider"," · upstream: ",(l==null?void 0:l.upstreamModelId)??"unknown"]})]}),o.jsx(Qe,{variant:l&&l.enabled&&l.providerEnabled&&l.providerHealth!=="down"&&l.providerHealth!=="circuit_open"&&!l.circuitOpen&&l.upstreamAvailable&&l.capabilities.chat!==!1?"success":"warning",children:l&&l.enabled&&l.providerEnabled&&l.providerHealth!=="down"&&l.providerHealth!=="circuit_open"&&!l.circuitOpen&&l.upstreamAvailable&&l.capabilities.chat!==!1?"Ready":"Unavailable"}),o.jsx(me,{size:"sm",variant:"outline",onClick:s,children:"Remove"})]})}function Yb({models:n,addedIds:a,onAdd:l}){const[s,c]=m.useState(""),f=(s?n.filter(p=>{const g=s.toLowerCase();return p.publicModelId.toLowerCase().includes(g)||p.displayName.toLowerCase().includes(g)}):n).filter(p=>!a.includes(p.id));return o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"relative",children:[o.jsx(D0,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),o.jsx(Ae,{className:"pl-8",placeholder:"Search models…",value:s,onChange:p=>c(p.target.value)}),s&&o.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>c(""),children:o.jsx(Cu,{className:"h-4 w-4"})})]}),f.length===0?o.jsx("p",{className:"text-xs text-muted-foreground",children:"No models match."}):o.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded border p-1",children:f.map(p=>o.jsxs("div",{className:"flex items-center justify-between rounded p-1 text-sm hover:bg-accent",children:[o.jsx("span",{className:"font-mono text-xs",children:p.publicModelId}),o.jsx(me,{size:"sm",variant:"ghost",onClick:()=>l(p.id),children:"+ Add"})]},p.id))})]})}function wk(){const[n,a]=m.useState([]),[l,s]=m.useState([]),[c,u]=m.useState([]),[f,p]=m.useState(!1),[g,v]=m.useState({alias:"",targetKind:"model",targetId:"",enabled:!0}),x=async()=>{const[b,w,E]=await Promise.all([Se.get("/api/admin/aliases"),Se.get("/api/admin/models"),Se.get("/api/admin/combos")]);a(b.aliases),s(w.models),u(E.combos)};m.useEffect(()=>{x()},[]);const y=async()=>{try{await Se.post("/api/admin/aliases",g),ve.success("Alias created"),p(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),x()}catch(b){ve.error(b.message)}};return o.jsxs("div",{children:[o.jsx($a,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:o.jsxs(Mn,{open:f,onOpenChange:p,children:[o.jsx(mi,{asChild:!0,children:o.jsxs(me,{children:[o.jsx(Su,{className:"mr-1 h-4 w-4"})," New alias"]})}),o.jsxs(vn,{children:[o.jsx(xn,{children:o.jsx(yn,{children:"New alias"})}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx(we,{children:"Alias"}),o.jsx(Ae,{value:g.alias,onChange:b=>v({...g,alias:b.target.value}),placeholder:"coding"})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Target type"}),o.jsxs(Ua,{value:g.targetKind,onValueChange:b=>v({...g,targetKind:b}),children:[o.jsx(Sa,{children:o.jsx(Ba,{})}),o.jsxs(ja,{children:[o.jsx(Rt,{value:"model",children:"Model"}),o.jsx(Rt,{value:"combo",children:"Combo"})]})]})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Target"}),o.jsxs(Ua,{value:g.targetId,onValueChange:b=>v({...g,targetId:b}),children:[o.jsx(Sa,{children:o.jsx(Ba,{placeholder:"Choose target"})}),o.jsx(ja,{children:(g.targetKind==="model"?l:c).map(b=>o.jsx(Rt,{value:b.id,children:b.publicModelId},b.id))})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ca,{checked:g.enabled,onCheckedChange:b=>v({...g,enabled:b})}),o.jsx(we,{children:"Enabled"})]})]}),o.jsxs(An,{children:[o.jsx(me,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),o.jsx(me,{disabled:!g.alias||!g.targetId,onClick:y,children:"Create"})]})]})]})}),o.jsxs(nt,{children:[o.jsxs(at,{children:[o.jsx(rt,{className:"text-base",children:"All aliases"}),o.jsxs(gn,{children:[n.length," total"]})]}),o.jsx(lt,{children:o.jsxs(ca,{children:[o.jsx(ua,{children:o.jsxs(We,{children:[o.jsx(ye,{children:"Alias"}),o.jsx(ye,{children:"Target"}),o.jsx(ye,{children:"Type"}),o.jsx(ye,{children:"Enabled"}),o.jsx(ye,{})]})}),o.jsxs(da,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),n.map(b=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-mono text-xs",children:b.alias}),o.jsx(pe,{className:"font-mono text-xs",children:b.targetName??b.targetId}),o.jsx(pe,{children:o.jsx(Qe,{variant:"outline",children:b.targetKind})}),o.jsx(pe,{children:b.enabled?"Yes":"No"}),o.jsx(pe,{className:"text-right",children:o.jsx(me,{size:"sm",variant:"outline",onClick:async()=>{await Se.del(`/api/admin/aliases/${b.id}`),ve.success("Removed"),x()},children:"Delete"})})]},b.id))]})]})})]})]})}function Sk(){const[n,a]=m.useState([]),[l,s]=m.useState([]),[c,u]=m.useState([]),[f,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(null),[b,w]=m.useState(null),[E,j]=m.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C=async()=>{const[A,U,k]=await Promise.all([Se.get("/api/admin/api-keys"),Se.get("/api/admin/models"),Se.get("/api/admin/combos")]);a(A.apiKeys),s(U.models),u(k.combos)};m.useEffect(()=>{C()},[]);const N=async()=>{try{if(g){await Se.patch("/api/admin/api-keys",{id:g,name:E.name,expiresAt:E.expiresAt||null,allowAllModels:E.allowAll,permissions:E.allowAll?[]:E.permissions,rpmLimit:E.rpmLimit?Number(E.rpmLimit):null,tpmLimit:E.tpmLimit?Number(E.tpmLimit):null,maxConcurrent:E.concurrency?Number(E.concurrency):null}),p(!1),v(null),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),ve.success("Key updated"),C();return}const A=await Se.post("/api/admin/api-keys",{name:E.name,expiresAt:E.expiresAt||null,allowAllModels:E.allowAll,permissions:E.allowAll?void 0:E.permissions,rpmLimit:E.rpmLimit?Number(E.rpmLimit):null,tpmLimit:E.tpmLimit?Number(E.tpmLimit):null,maxConcurrent:E.concurrency?Number(E.concurrency):null,...E.customSecret.trim()?{secret:E.customSecret.trim()}:{}});p(!1),y({secret:A.secret,name:A.name}),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C()}catch(A){ve.error(A.message)}},M=async A=>{try{const k=((await Se.get(`/api/admin/api-keys/${A.id}`)).apiKey.permissions??[]).filter($=>$.targetKind==="model"||$.targetKind==="combo");v(A.id),j({name:A.name,expiresAt:A.expiresAt?A.expiresAt.slice(0,16):"",allowAll:A.allowAllModels,permissions:k,rpmLimit:A.rpmLimit!=null?String(A.rpmLimit):"",tpmLimit:A.tpmLimit!=null?String(A.tpmLimit):"",concurrency:A.concurrencyLimit!=null?String(A.concurrencyLimit):"",customSecret:""}),p(!0)}catch(U){ve.error(U.message)}},T=()=>{p(!1),v(null),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""})},D=async(A,U)=>{try{await Se.patch("/api/admin/api-keys",{id:A,enabled:!U}),ve.success(U?"Key disabled":"Key enabled"),C()}catch(k){ve.error(k.message)}},O=async A=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await Se.del(`/api/admin/api-keys/${A}`),ve.success("Key deleted"),C()}catch(U){ve.error(U.message)}};return o.jsxs("div",{children:[o.jsx($a,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:o.jsxs(Mn,{open:f,onOpenChange:A=>{A?p(!0):T()},children:[o.jsx(mi,{asChild:!0,children:o.jsxs(me,{children:[o.jsx(Su,{className:"mr-1 h-4 w-4"})," New key"]})}),o.jsxs(vn,{className:"max-w-2xl",children:[o.jsx(xn,{children:o.jsx(yn,{children:g?"Edit API key":"New API key"})}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{children:[o.jsx(we,{children:"Name"}),o.jsx(Ae,{value:E.name,onChange:A=>j({...E,name:A.target.value})})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Expires (optional)"}),o.jsx(Ae,{type:"datetime-local",value:E.expiresAt,onChange:A=>j({...E,expiresAt:A.target.value})})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[o.jsxs("div",{children:[o.jsx(we,{children:"RPM limit"}),o.jsx(Ae,{value:E.rpmLimit,onChange:A=>j({...E,rpmLimit:A.target.value}),type:"number"})]}),o.jsxs("div",{children:[o.jsx(we,{children:"TPM limit"}),o.jsx(Ae,{value:E.tpmLimit,onChange:A=>j({...E,tpmLimit:A.target.value}),type:"number"})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Concurrency"}),o.jsx(Ae,{value:E.concurrency,onChange:A=>j({...E,concurrency:A.target.value}),type:"number"})]})]}),!g&&o.jsxs("div",{children:[o.jsx(we,{children:"Key value (optional)"}),o.jsx(Ae,{value:E.customSecret,onChange:A=>j({...E,customSecret:A.target.value}),placeholder:"Leave empty to auto-generate ld-…"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"If provided, this exact value is stored as the key. Otherwise a random ld-… key is generated."})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ca,{checked:E.allowAll,onCheckedChange:A=>j({...E,allowAll:A})}),o.jsx(we,{children:"Allow all current and future models"})]}),!E.allowAll&&o.jsxs("div",{children:[o.jsx(we,{children:"Scope"}),o.jsx("div",{className:"max-h-48 space-y-1 overflow-auto rounded border p-2",children:[...l.map(A=>({targetKind:"model",targetId:A.id,label:A.publicModelId})),...c.map(A=>({targetKind:"combo",targetId:A.id,label:A.publicModelId}))].map(A=>{const U=E.permissions.some(k=>k.targetKind===A.targetKind&&k.targetId===A.targetId);return o.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[o.jsx(jp,{checked:U,onCheckedChange:k=>{j($=>({...$,permissions:k?[...$.permissions,{targetKind:A.targetKind,targetId:A.targetId}]:$.permissions.filter(X=>!(X.targetKind===A.targetKind&&X.targetId===A.targetId))}))}}),o.jsx("span",{className:"font-mono text-xs",children:A.label}),o.jsx(Qe,{variant:"outline",className:"ml-1",children:A.targetKind})]},`${A.targetKind}:${A.targetId}`)})})]})]}),o.jsxs(An,{children:[o.jsx(me,{variant:"outline",onClick:T,children:"Cancel"}),o.jsx(me,{disabled:!E.name,onClick:N,children:g?"Save changes":"Create"})]})]})]})}),o.jsxs(nt,{children:[o.jsxs(at,{children:[o.jsx(rt,{className:"text-base",children:"All keys"}),o.jsxs(gn,{children:[n.length," total"]})]}),o.jsx(lt,{children:o.jsxs(ca,{children:[o.jsx(ua,{children:o.jsxs(We,{children:[o.jsx(ye,{children:"Name"}),o.jsx(ye,{children:"Prefix"}),o.jsx(ye,{children:"Status"}),o.jsx(ye,{children:"Scope"}),o.jsx(ye,{children:"RPM/TPM/Conc"}),o.jsx(ye,{})]})}),o.jsxs(da,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),n.map(A=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-medium",children:A.name}),o.jsxs(pe,{className:"font-mono text-xs",children:[A.keyPrefix,"…"]}),o.jsx(pe,{children:A.enabled?o.jsx(Qe,{variant:"success",children:"enabled"}):o.jsx(Qe,{variant:"destructive",children:"disabled"})}),o.jsx(pe,{children:A.allowAllModels?"all":`${A.modelScopeCount} scoped`}),o.jsx(pe,{className:"text-xs",children:[A.rpmLimit,A.tpmLimit,A.concurrencyLimit].map((U,k)=>U?["","RPM","TPM","Conc"][k+1]:null).filter(Boolean).join(" / ")||"—"}),o.jsx(pe,{className:"text-right",children:o.jsxs("div",{className:"flex items-center justify-end gap-1",children:[A.secret&&o.jsxs(o.Fragment,{children:[o.jsx(me,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(A.secret),ve.success("Copied")},children:o.jsx(Fc,{className:"h-3.5 w-3.5"})}),o.jsx(me,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>w({secret:A.secret,name:A.name}),children:o.jsx(sR,{className:"h-3.5 w-3.5"})})]}),o.jsx(me,{size:"sm",variant:"ghost",title:"Edit",onClick:()=>void M(A),children:o.jsx(hR,{className:"h-3.5 w-3.5"})}),o.jsxs(me,{size:"sm",variant:"outline",onClick:()=>D(A.id,A.enabled),children:[A.enabled?o.jsx(FE,{className:"mr-1 h-3.5 w-3.5"}):o.jsx(ci,{className:"mr-1 h-3.5 w-3.5"}),A.enabled?"Disable":"Enable"]}),o.jsx(me,{size:"sm",variant:"destructive",onClick:()=>O(A.id),children:o.jsx(ju,{className:"h-3.5 w-3.5"})})]})})]},A.id))]})]})})]}),o.jsx(Mn,{open:!!x,onOpenChange:A=>{A||y(null)},children:o.jsxs(vn,{children:[o.jsxs(xn,{children:[o.jsx(yn,{children:"API key created"}),o.jsx(uu,{children:"Copy now — this secret will not be shown again."})]}),o.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:x==null?void 0:x.secret}),o.jsxs(An,{children:[o.jsxs(me,{onClick:()=>{x&&(navigator.clipboard.writeText(x.secret),ve.success("Copied"))},children:[o.jsx(Fc,{className:"mr-1 h-4 w-4"})," Copy"]}),o.jsx(me,{variant:"outline",onClick:()=>y(null),children:"I have saved it"})]})]})}),o.jsx(Mn,{open:!!b,onOpenChange:A=>{A||w(null)},children:o.jsxs(vn,{children:[o.jsxs(xn,{children:[o.jsxs(yn,{children:["API key: ",b==null?void 0:b.name]}),o.jsx(uu,{children:"Full secret for this key, readable any time."})]}),o.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:b==null?void 0:b.secret}),o.jsxs(An,{children:[o.jsxs(me,{onClick:()=>{b&&(navigator.clipboard.writeText(b.secret),ve.success("Copied"))},children:[o.jsx(Fc,{className:"mr-1 h-4 w-4"})," Copy"]}),o.jsx(me,{variant:"outline",onClick:()=>w(null),children:"Close"})]})]})})]})}const jk=3e3;function Ck(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 Ek(){const[n,a]=m.useState([]),[l,s]=m.useState(0),[c,u]=m.useState(0),[f,p]=m.useState({success:"all",protocol:"all",streaming:"all",model:""}),[g,v]=m.useState(null),[x,y]=m.useState(null),[b,w]=m.useState(0),E=50,j=m.useRef(Date.now()),C=m.useRef(new Set),N=m.useRef(f);N.current=f;const M=m.useRef(c);M.current=c;const T=m.useCallback(async()=>{const O=new URLSearchParams;O.set("limit",String(E)),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 A=await Se.get(`/api/admin/requests?${O.toString()}`);a(A.requests),s(A.total);for(const U of A.requests)C.current.add(U.id)},[c,f]);m.useEffect(()=>{T()},[T]),m.useEffect(()=>{w(0)},[c,f]),m.useEffect(()=>{let O=!1,A=null;const U=new Set,k=()=>{O||(A=new EventSource(`/api/admin/requests/stream?since=${j.current}`),A.addEventListener("request",$=>{if(!O)try{const X=JSON.parse($.data),te=new Date(X.createdAt).getTime();if(Number.isFinite(te)&&(j.current=Math.max(j.current,te)),C.current.has(X.id))return;C.current.add(X.id),w(G=>G+1),M.current===0&&Ck(X,N.current)&&(a(G=>G.some(ie=>ie.id===X.id)?G:[X,...G].slice(0,E)),s(G=>G+1))}catch{}}),A.onerror=()=>{A==null||A.close(),A=null,O||U.add(setTimeout(k,jk))})};return k(),()=>{O=!0,A==null||A.close();for(const $ of U)clearTimeout($);U.clear()}},[]);const D=async O=>{v(O);const A=await Se.get(`/api/admin/requests/${O}`);y(A)};return o.jsxs("div",{children:[o.jsx($a,{title:"Requests",description:`${l} matching · live updates`}),o.jsxs(nt,{children:[o.jsxs(at,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs(Ua,{value:f.success,onValueChange:O=>{u(0),p({...f,success:O})},children:[o.jsx(Sa,{className:"w-36",children:o.jsx(Ba,{})}),o.jsxs(ja,{children:[o.jsx(Rt,{value:"all",children:"All"}),o.jsx(Rt,{value:"true",children:"Success"}),o.jsx(Rt,{value:"false",children:"Failed"})]})]}),o.jsxs(Ua,{value:f.protocol,onValueChange:O=>{u(0),p({...f,protocol:O})},children:[o.jsx(Sa,{className:"w-32",children:o.jsx(Ba,{})}),o.jsxs(ja,{children:[o.jsx(Rt,{value:"all",children:"Any protocol"}),o.jsx(Rt,{value:"openai",children:"OpenAI"}),o.jsx(Rt,{value:"anthropic",children:"Anthropic"})]})]}),o.jsxs(Ua,{value:f.streaming,onValueChange:O=>{u(0),p({...f,streaming:O})},children:[o.jsx(Sa,{className:"w-32",children:o.jsx(Ba,{})}),o.jsxs(ja,{children:[o.jsx(Rt,{value:"all",children:"Any"}),o.jsx(Rt,{value:"true",children:"Streaming"}),o.jsx(Rt,{value:"false",children:"Non-stream"})]})]}),o.jsx(Ae,{className:"max-w-xs",placeholder:"Model contains…",value:f.model,onChange:O=>{u(0),p({...f,model:O.target.value})}}),b>0&&o.jsxs(me,{size:"sm",variant:"secondary",onClick:()=>{w(0),T()},children:[b," new request",b>1?"s":""," — refresh"]})]}),o.jsx(rt,{className:"mt-3 text-base",children:"Results"})]}),o.jsxs(lt,{children:[o.jsxs(ca,{children:[o.jsx(ua,{children:o.jsxs(We,{children:[o.jsx(ye,{children:"Time"}),o.jsx(ye,{children:"Status"}),o.jsx(ye,{children:"Requested"}),o.jsx(ye,{children:"Final"}),o.jsx(ye,{children:"Tokens"}),o.jsx(ye,{children:"Latency"}),o.jsx(ye,{children:"Attempts"}),o.jsx(ye,{children:"Key"}),o.jsx(ye,{children:"IP"}),o.jsx(ye,{})]})}),o.jsxs(da,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),n.map(O=>o.jsxs(We,{className:"cursor-pointer",onClick:()=>D(O.id),children:[o.jsx(pe,{className:"text-xs",children:Lm(O.createdAt)}),o.jsx(pe,{children:O.success?o.jsx(Qe,{variant:"success",children:O.httpStatus}):o.jsx(Qe,{variant:"destructive",children:O.httpStatus})}),o.jsx(pe,{className:"font-mono text-xs",children:O.requestedModel}),o.jsx(pe,{className:"font-mono text-xs text-muted-foreground",children:O.finalModelPublicId??"—"}),o.jsxs(pe,{className:"text-xs",children:[Kt(O.inputTokens+O.outputTokens)," ",O.cacheReadTokens?o.jsxs("span",{className:"text-amber-600",children:["(+",O.cacheReadTokens," cache)"]}):null]}),o.jsxs(pe,{className:"text-xs",children:[Ol(O.totalLatencyMs),O.ttftMs?o.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",O.ttftMs,"ms"]}):null]}),o.jsxs(pe,{className:"text-xs",children:[O.attemptsCount,O.gatewayCacheHit?o.jsx(Qe,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),o.jsx(pe,{className:"text-xs",children:O.apiKeyName??"—"}),o.jsx(pe,{className:"text-xs",children:O.clientIp}),o.jsx(pe,{className:"text-right",children:o.jsx(me,{size:"sm",variant:"ghost",children:"View"})})]},O.id))]})]}),o.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Showing ",c+1,"–",Math.min(c+E,l)," of ",l]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(me,{size:"sm",variant:"outline",disabled:c===0,onClick:()=>u(Math.max(0,c-E)),children:"Prev"}),o.jsx(me,{size:"sm",variant:"outline",disabled:c+E>=l,onClick:()=>u(c+E),children:"Next"})]})]})]})]}),o.jsx(Mn,{open:!!g,onOpenChange:O=>{O||(v(null),y(null))},children:o.jsxs(vn,{className:"max-w-3xl",children:[o.jsx(xn,{children:o.jsxs(yn,{children:["Request ",tN(g,16)]})}),x?o.jsxs("div",{className:"space-y-3 text-sm",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Requested model"}),o.jsx("span",{className:"font-mono text-xs",children:x.request.requestedModel})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Upstream model"}),o.jsx("span",{className:"font-mono text-xs",children:x.request.finalModelUpstreamId??"—"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Provider"}),x.request.providerId?o.jsx(ra,{className:"text-primary underline",to:`/providers?providerId=${encodeURIComponent(x.request.providerId)}`,children:x.request.providerName??x.request.providerSlug??x.request.providerId}):"—"]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Route"}),x.request.resolvedTargetId?o.jsx(ra,{className:"text-primary underline",to:x.request.resolvedTargetKind==="combo"?"/combos":"/models",children:x.request.resolvedTargetKind??"target"}):"—"]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Status"}),x.request.success?o.jsx(Qe,{variant:"success",children:x.request.httpStatus}):o.jsx(Qe,{variant:"destructive",children:x.request.httpStatus})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),Ol(x.request.totalLatencyMs)]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Kt(x.request.inputTokens)," · out ",Kt(x.request.outputTokens)," · cache ",Kt(x.request.cacheReadTokens)]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-muted-foreground text-xs",children:"Attempts"}),x.request.attemptsCount]})]}),x.request.errorType&&o.jsxs("div",{className:"rounded border border-destructive/40 bg-destructive/10 p-2",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Error"}),o.jsxs("div",{className:"font-mono text-xs",children:[x.request.errorType,": ",x.request.errorMessage]})]}),x.request.fallbackReasons.length>0&&o.jsxs("div",{className:"rounded border border-amber-500/40 bg-amber-500/10 p-2",children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Fallback reasons"}),o.jsx("div",{className:"text-xs",children:x.request.fallbackReasons.join(", ")})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"Safe replay curl"}),o.jsxs(me,{size:"sm",variant:"ghost",onClick:()=>{navigator.clipboard.writeText(x.request.reproductionCurl).then(()=>ve.success("Curl copied"))},children:[o.jsx(Fc,{className:"mr-1 h-3.5 w-3.5"})," Copy"]})]}),o.jsx("pre",{className:"max-h-36 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 font-mono text-xs",children:x.request.reproductionCurl}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Replace the placeholder key before running. No stored secret is included."})]}),x.request.requestPayload&&o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Request content"}),o.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.requestPayload})]}),x.request.responsePayload&&o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Response content"}),o.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.responsePayload})]}),x.attempts.length>0&&o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Attempts"}),o.jsxs(ca,{children:[o.jsx(ua,{children:o.jsxs(We,{children:[o.jsx(ye,{children:"#"}),o.jsx(ye,{children:"Provider"}),o.jsx(ye,{children:"Model"}),o.jsx(ye,{children:"Status"}),o.jsx(ye,{children:"Latency"}),o.jsx(ye,{children:"Reason"})]})}),o.jsx(da,{children:x.attempts.map(O=>o.jsxs(We,{children:[o.jsx(pe,{children:O.attemptNumber}),o.jsx(pe,{children:O.providerName}),o.jsxs(pe,{children:[o.jsx("div",{className:"font-mono text-xs",children:O.modelPublicId}),o.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["upstream: ",O.upstreamModelId]})]}),o.jsx(pe,{children:O.success?o.jsx(Qe,{variant:"success",children:String(O.statusCode??"OK")}):o.jsx(Qe,{variant:"destructive",children:String(O.statusCode??"err")})}),o.jsx(pe,{className:"text-xs",children:Ol(O.latencyMs)}),o.jsx(pe,{className:"text-xs",children:O.failureReason??O.selectionReason})]},O.id))})]})]})]}):o.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}var Rk=Object.defineProperty,Zs=(n,a)=>Rk(n,"name",{value:a,configurable:!0}),_p="Tabs",[Nk,Z4]=kn(_p,[Lu]),ES=Lu(),[Tk,kp]=Nk(_p),Mk=m.forwardRef(Zs(function(a,l){const{__scopeTabs:s,value:c,onValueChange:u,defaultValue:f,orientation:p="horizontal",dir:g,activationMode:v="automatic",...x}=a,y=di(g),[b,w]=yr({prop:c,onChange:u,defaultProp:f??"",caller:_p});return o.jsx(Tk,{scope:s,baseId:La(),value:b,onValueChange:w,orientation:p,dir:y,activationMode:v,children:o.jsx(Ve.div,{dir:y,"data-orientation":p,...x,ref:l})})},"Tabs")),Ak="TabsList",Dk=m.forwardRef(Zs(function(a,l){const{__scopeTabs:s,loop:c=!0,...u}=a,f=kp(Ak,s),p=ES(s);return o.jsx(G1,{asChild:!0,...p,orientation:f.orientation,dir:f.dir,loop:c,children:o.jsx(Ve.div,{role:"tablist","aria-orientation":f.orientation,...u,ref:l})})},"TabsList")),Ok="TabsTrigger",_k=m.forwardRef(Zs(function(a,l){const{__scopeTabs:s,value:c,disabled:u=!1,...f}=a,p=kp(Ok,s),g=ES(s),v=zp(p.baseId,c),x=Lp(p.baseId,c),y=c===p.value;return o.jsx(K1,{asChild:!0,...g,focusable:!u,active:y,children:o.jsx(Ve.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":x,"data-state":y?"active":"inactive","data-disabled":u?"":void 0,disabled:u,id:v,...f,ref:l,onMouseDown:Ne(a.onMouseDown,b=>{!u&&b.button===0&&b.ctrlKey===!1?p.onValueChange(c):b.preventDefault()}),onKeyDown:Ne(a.onKeyDown,b=>{u||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&p.onValueChange(c)}),onFocus:Ne(a.onFocus,()=>{const b=p.activationMode!=="manual";!y&&!u&&b&&p.onValueChange(c)})})})},"TabsTrigger")),kk="TabsContent",zk=m.forwardRef(Zs(function(a,l){const{__scopeTabs:s,value:c,forceMount:u,children:f,...p}=a,g=kp(kk,s),v=zp(g.baseId,c),x=Lp(g.baseId,c),y=c===g.value,b=m.useRef(y);return m.useEffect(()=>{const w=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(w)},[]),o.jsx(Cr,{present:u||y,children:({present:w})=>o.jsx(Ve.div,{"data-state":y?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:x,tabIndex:0,...p,ref:l,style:{...a.style,animationDuration:b.current?"0s":void 0},children:w&&f})})},"TabsContent"));function zp(n,a){return`${n}-trigger-${a}`}Zs(zp,"makeTriggerId");function Lp(n,a){return`${n}-content-${a}`}Zs(Lp,"makeContentId");var Lk=Mk,RS=Dk,NS=_k,TS=zk;const MS=Lk,Up=m.forwardRef(({className:n,...a},l)=>o.jsx(RS,{ref:l,className:Ee("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...a}));Up.displayName=RS.displayName;const mr=m.forwardRef(({className:n,...a},l)=>o.jsx(NS,{ref:l,className:Ee("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",n),...a}));mr.displayName=NS.displayName;const Os=m.forwardRef(({className:n,...a},l)=>o.jsx(TS,{ref:l,className:Ee("mt-2 ring-offset-background focus-visible:outline-none",n),...a}));Os.displayName=TS.displayName;const Uk=3e3,Bk=1600,Hk=10,Ik=3,Pk=12,qk=10*6e4,Vk={cacheReadTokens:0,promptTokens:0,gatewayCacheHits:0,fallbacks:0};function AS(n,a,l){return l==="anthropic"?n+a:n}function $k(n){return n.promptTokens>0?n.cacheReadTokens/n.promptTokens:0}function Yk(n,a){return a>0?n.fallbacks/a:0}function Gk(n,a){return a>0?n.gatewayCacheHits/a:0}function Kk(n,a,l){const s=n.totalRequests+1,c=n.successfulRequests+(l.success?1:0),u={cacheReadTokens:a.cacheReadTokens+l.cacheReadTokens,promptTokens:a.promptTokens+AS(l.inputTokens,l.cacheReadTokens,l.providerType),gatewayCacheHits:a.gatewayCacheHits+(l.gatewayCacheHit?1:0),fallbacks:a.fallbacks+(l.attemptsCount>1?1:0)};return{...n,...u,totalRequests:s,successfulRequests:c,failedRequests:n.failedRequests+(l.success?0:1),successRate:c/s,inputTokens:n.inputTokens+l.inputTokens,outputTokens:n.outputTokens+l.outputTokens,totalTokens:n.totalTokens+l.inputTokens+l.outputTokens,cacheHitRate:$k(u),gatewayCacheHitRate:Gk(u,s),fallbackRate:Yk(u,s),averageLatencyMs:(n.averageLatencyMs*n.totalRequests+l.totalLatencyMs)/s}}function Xk(n){const[a,l]=m.useState(null),[s,c]=m.useState(null),[u,f]=m.useState([]),[p,g]=m.useState([]),[v,x]=m.useState([]),[y,b]=m.useState([]),[w,E]=m.useState(!0),[j,C]=m.useState(null),N=m.useRef([]),M=m.useRef(null),T=m.useRef(Vk),D=m.useRef(new Set),O=m.useRef(Date.now()),A=m.useRef(0),U=m.useRef([]),k=m.useRef([]);return m.useEffect(()=>{let $=!1;return E(!0),C(null),D.current=new Set,O.current=Date.now(),Se.get(`/api/admin/stats?preset=${n}`).then(X=>{if(!$){l(X),c(X.summary),M.current=X.summary,T.current={cacheReadTokens:X.summary.cacheReadTokens,promptTokens:X.summary.cacheHitRate>0?Math.round(X.summary.cacheReadTokens/X.summary.cacheHitRate):X.summary.inputTokens,gatewayCacheHits:Math.round(X.summary.gatewayCacheHitRate*X.summary.totalRequests),fallbacks:Math.round(X.summary.fallbackRate*X.summary.totalRequests)},f(X.recent),g(X.providers),N.current=X.providers;for(const te of X.recent)D.current.add(te.id);E(!1)}}).catch(X=>{$||(C(X.message),E(!1))}),()=>{$=!0}},[n]),m.useEffect(()=>{let $=!1,X=null;const te=new Set,G=()=>{$||(X=new EventSource(`/api/admin/requests/stream?since=${O.current}`),X.addEventListener("request",ce=>{if(!$)try{const se=JSON.parse(ce.data),_=new Date(se.createdAt).getTime();if(Number.isFinite(_)&&(O.current=Math.max(O.current,_)),D.current.has(se.id))return;D.current.add(se.id);const H={cacheReadTokens:T.current.cacheReadTokens+se.cacheReadTokens,promptTokens:T.current.promptTokens+AS(se.inputTokens,se.cacheReadTokens,se.providerType),gatewayCacheHits:T.current.gatewayCacheHits+(se.gatewayCacheHit?1:0),fallbacks:T.current.fallbacks+(se.attemptsCount>1?1:0)};if(T.current=H,M.current&&c(Kk(M.current,H,se)),f(Q=>Q.some(J=>J.id===se.id)?Q:[se,...Q].slice(0,Hk)),se.providerId){N.current=N.current.map(z=>z.id===se.providerId?{...z,requests:z.requests+1,errorRate:z.requests+1?(z.errorRate*z.requests+(se.success?0:1))/(z.requests+1):0}:z),g(N.current);const Q=`p${++A.current}`,J={id:Q,providerId:se.providerId,success:se.success};U.current=[...U.current.slice(-(Ik*4)),J],x(U.current);const ee=setTimeout(()=>{U.current=U.current.filter(z=>z.id!==Q),x(U.current)},Bk);te.add(ee)}k.current.some(Q=>Q.id===se.id)&&(k.current=k.current.filter(Q=>Q.id!==se.id),b(k.current))}catch{}}),X.addEventListener("request_started",ce=>{if(!$)try{const se=JSON.parse(ce.data);if(!se.providerId||se.providerId==="")return;k.current=[...k.current.filter(_=>_.id!==se.requestId).slice(-(Pk-1)),{id:se.requestId,providerId:se.providerId,startedAt:Date.now(),ttftMs:se.ttftMs??0}],b(k.current)}catch{}}),X.onerror=()=>{X==null||X.close(),X=null,$||te.add(setTimeout(G,Uk))})};G();const ie=setInterval(()=>{const ce=Date.now()-qk;k.current.some(se=>se.startedAt<ce)&&(k.current=k.current.filter(se=>se.startedAt>=ce),b(k.current))},3e4);return()=>{$=!0,X==null||X.close();for(const ce of te)clearTimeout(ce);te.clear(),clearInterval(ie)}},[]),m.useEffect(()=>{const $=setInterval(()=>{Se.get("/api/admin/providers").then(X=>{const te=new Map(X.providers.map(G=>[G.id,G]));N.current=N.current.map(G=>{const ie=te.get(G.id);return ie?{...G,health:ie.health,enabled:ie.enabled}:G}),g(N.current)}).catch(()=>{})},3e4);return()=>clearInterval($)},[]),{snapshot:a,live:s??(a==null?void 0:a.summary)??Fk,recent:u,providers:p,pulses:v,activeRoutes:y,loading:w,error:j}}const Fk={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 DS({data:n,className:a,strokeClass:l="stroke-primary",fillClass:s}){if(n.length===0)return o.jsx("svg",{className:Ee("h-6 w-20",a),viewBox:"0 0 80 24"});const f=Math.max(...n),p=Math.min(...n),g=f-p||1,x=n.map((y,b)=>{const w=b/(n.length-1)*78+1,E=22-(y-p)/g*20;return`${w.toFixed(1)},${E.toFixed(1)}`}).join(" ");return o.jsxs("svg",{className:Ee("h-6 w-20",a),viewBox:"0 0 80 24",preserveAspectRatio:"none",children:[s&&o.jsx("polygon",{points:`1,23 ${x} 79,23`,className:s}),o.jsx("polyline",{points:x,fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:l})]})}function Qk(n,a,l){const s=performance.now();let c=0;const u=f=>{const p=Math.min((f-s)/a,1),g=Math.round(n*p);g!==c&&(c=g,l(g)),p<1&&requestAnimationFrame(u)};requestAnimationFrame(u)}function Zk({delta:n,inverse:a}){if(Math.abs(n)<.005)return null;const l=n>0,s=a?!l:l,c=`${(Math.abs(n)*100).toFixed(1)}%`;return o.jsxs("span",{className:Ee("ml-1.5 inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold leading-none",s?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"),children:[o.jsx("span",{className:"mr-0.5",children:l?"▲":"▼"}),c]})}function el({icon:n,label:a,value:l,format:s="number",delta:c,deltaInverse:u,sparkData:f,sparkStroke:p}){const[g,v]=m.useState(0),x=m.useRef(0);m.useEffect(()=>{const b=x.current,w=l;x.current=l,b!==w&&Qk(Math.abs(w-b),600,E=>v(b+(w>b?E:-E)))},[l]);const y=s==="percent"?Eu(g):s==="latency"?Ol(g):Kt(Math.round(g));return o.jsxs(nt,{children:[o.jsxs(at,{className:"flex flex-row items-center justify-between pb-1",children:[o.jsxs(rt,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[o.jsx(n,{className:"h-4 w-4"}),a]}),c!==void 0&&o.jsx(Zk,{delta:c,inverse:u})]}),o.jsxs(lt,{className:"flex items-end justify-between",children:[o.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:y}),f&&f.length>1&&o.jsx(DS,{data:f,strokeClass:p??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const OS=1e3,Gb=380,Vc=60,tl=OS/2,nl=720,Bh=62,Jk=260;function Wk(n){return n==="healthy"?"fill-emerald-400":n==="degraded"?"fill-amber-400":"fill-red-400"}function $c(n,a,l,s){const c=n+(l-n)*.45,u=n+(l-n)*.55;return`M${n},${a} C${c},${a} ${u},${s} ${l},${s}`}function e4({liveRequests:n,successRate:a,providers:l,pulses:s,activeRoutes:c}){const u=Gb/2,f=u,p=Math.max(1,l.reduce((x,y)=>x+y.requests,0)),g=new Set(c.map(x=>x.providerId)),v=g.size>0;return o.jsxs(nt,{children:[o.jsx(at,{className:"pb-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(rt,{className:"text-base",children:"Real-time Request Routing"}),o.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-emerald-400"})," healthy"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-400"})," degraded"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-red-400"})," down"]})]})]})}),o.jsx(lt,{className:"pt-0",children:o.jsx("div",{className:"relative w-full",children:o.jsxs("svg",{viewBox:`0 0 ${OS} ${Gb}`,className:"w-full h-auto",preserveAspectRatio:"xMidYMid meet",children:[o.jsx("defs",{children:o.jsxs("filter",{id:"glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[o.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),o.jsxs("feMerge",{children:[o.jsx("feMergeNode",{in:"blur"}),o.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),l.map(x=>{const b=60+l.indexOf(x)*Bh,w=x.requests/p,E=Math.max(1.5,Math.min(6,2+w*8)),j=g.has(x.id);return o.jsxs("g",{children:[j&&o.jsx("path",{d:$c(tl,u,nl-20,b),fill:"none",stroke:"hsl(var(--primary) / 0.25)",strokeWidth:E+6,strokeLinecap:"round"}),o.jsx("path",{d:$c(tl,u,nl-20,b),fill:"none",stroke:j?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:j?E+1:E,strokeLinecap:"round",opacity:j?.95:.6,className:j?"route-active":void 0})]},x.id)}),o.jsx("path",{d:$c(Vc+30,f,tl-30,u),fill:"none",stroke:v?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:3,strokeLinecap:"round",strokeDasharray:"6 3",opacity:v?.9:.5,className:v?"route-active":void 0}),s.map(x=>{const y=l.findIndex(j=>j.id===x.providerId);if(y===-1)return null;const b=60+y*Bh,w=$c(tl,u,nl-20,b),E=x.success?"var(--primary)":"#f87171";return o.jsxs("g",{filter:"url(#glow)",children:[o.jsx("circle",{r:5,fill:E,opacity:.9,children:o.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})}),o.jsx("circle",{r:9,fill:E,opacity:.25,children:o.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})})]},x.id)}),o.jsx("circle",{cx:Vc,cy:f,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),o.jsx("text",{x:Vc,y:f-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:Kb(n)}),o.jsx("text",{x:Vc,y:f+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),o.jsx("circle",{cx:tl,cy:u,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),o.jsx("image",{x:tl-12,y:u-16,width:24,height:24,href:"/logo.png"}),o.jsx("text",{x:tl,y:u+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),o.jsxs("text",{x:tl,y:u+38,textAnchor:"middle",className:"fill-emerald-500",fontSize:10,fontWeight:600,children:[(a*100).toFixed(1),"%"]}),l.map((x,y)=>{const b=60+y*Bh,w=x.requests/p,E=!x.enabled||x.requests===0;return o.jsxs("g",{opacity:E?.4:1,children:[o.jsx("rect",{x:nl-20,y:b-14,width:Jk,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),o.jsx("circle",{cx:nl-6,cy:b+10,r:4,className:Wk(x.health)}),o.jsx("text",{x:nl+6,y:b-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:x.name}),o.jsxs("text",{x:nl+6,y:b+12,className:"fill-muted-foreground",fontSize:10,children:[x.modelCount," model",x.modelCount!==1?"s":""," · ",Kb(x.requests)," req"]}),o.jsxs("text",{x:nl+6,y:b+25,className:"fill-muted-foreground",fontSize:10,children:[(w*100).toFixed(1),"% traffic · ",x.avgLatencyMs<1e3?`${Math.round(x.avgLatencyMs)}ms`:`${(x.avgLatencyMs/1e3).toFixed(1)}s`," avg",x.errorRate>0&&o.jsxs("tspan",{className:"fill-red-500",children:[" · ",(x.errorRate*100).toFixed(0),"% err"]})]})]},x.id)})]})})})]})}function Kb(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}function t4({rows:n}){return o.jsxs(nt,{children:[o.jsx(at,{className:"pb-2",children:o.jsx(rt,{className:"text-base",children:"Recent Requests"})}),o.jsx(lt,{children:n.length===0?o.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No requests yet — traffic will appear here live."}):o.jsxs(ca,{children:[o.jsx(ua,{children:o.jsxs(We,{children:[o.jsx(ye,{children:"Model"}),o.jsx(ye,{children:"Provider"}),o.jsx(ye,{children:"Tokens"}),o.jsx(ye,{children:"Status"}),o.jsx(ye,{children:"Time"})]})}),o.jsx(da,{children:n.map(a=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-mono text-xs",children:a.requestedModel}),o.jsx(pe,{className:"text-xs text-muted-foreground",children:a.providerName??"—"}),o.jsxs(pe,{className:"text-xs",children:[o.jsxs("span",{className:"font-mono",children:["in ",Kt(a.inputTokens)," · out ",Kt(a.outputTokens)]}),a.cacheReadTokens>0&&o.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",Kt(a.cacheReadTokens)," cache)"]})]}),o.jsx(pe,{children:o.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[o.jsx("span",{className:a.success?"h-2 w-2 rounded-full bg-emerald-400":"h-2 w-2 rounded-full bg-red-400"}),o.jsx("span",{className:"text-xs",children:a.success?a.httpStatus:`${a.httpStatus} err`})]})}),o.jsx(pe,{className:"text-xs text-muted-foreground",children:nN(a.createdAt)})]},a.id))})]})})]})}const gm=34,Xb=2*Math.PI*gm;function n4(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 a4({successRate:n,averageLatencyMs:a,latencySpark:l}){const{stroke:s,text:c}=n4(n),u=Math.min(1,Math.max(0,n)),f=Xb*(1-u);return o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsxs(nt,{children:[o.jsx(at,{className:"pb-2",children:o.jsx(rt,{className:"text-base",children:"Success Rate"})}),o.jsxs(lt,{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"relative h-20 w-20",children:[o.jsxs("svg",{viewBox:"0 0 80 80",className:"h-20 w-20 -rotate-90",children:[o.jsx("circle",{cx:"40",cy:"40",r:gm,fill:"none",stroke:"hsl(var(--border))",strokeWidth:7}),o.jsx("circle",{cx:"40",cy:"40",r:gm,fill:"none",stroke:s,strokeWidth:7,strokeLinecap:"round",strokeDasharray:Xb,strokeDashoffset:f,style:{transition:"stroke-dashoffset 0.6s ease, stroke 0.4s ease"}})]}),o.jsx("span",{className:`absolute inset-0 flex items-center justify-center text-sm font-semibold tabular-nums ${c}`,children:Eu(n)})]}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Share of requests that completed successfully over the selected window. Updated in real time."})]})]}),o.jsxs(nt,{children:[o.jsx(at,{className:"pb-2",children:o.jsx(rt,{className:"text-base",children:"Average Latency"})}),o.jsxs(lt,{className:"flex items-end justify-between",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:Ol(a)}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Live average across the selected window"})]}),o.jsx(DS,{data:l,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function r4(){const[n,a]=m.useState("7d"),{snapshot:l,live:s,recent:c,providers:u,pulses:f,activeRoutes:p,loading:g,error:v}=Xk(n);if(g)return o.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(v||!l)return o.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",v??"unknown error"]});const x=s,y=l.previous,b=l.series;function w(C,N){return N>0?(C-N)/N:void 0}const E=b.map(C=>C.requests),j=b.map(C=>C.avgLatency);return o.jsxs("div",{children:[o.jsx($a,{title:"Statistics",description:"Real-time monitoring dashboard",actions:o.jsx(MS,{value:n,onValueChange:C=>void a(C),children:o.jsxs(Up,{children:[o.jsx(mr,{value:"today",children:"Today"}),o.jsx(mr,{value:"7d",children:"7 days"}),o.jsx(mr,{value:"30d",children:"30 days"})]})})}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[o.jsx(el,{icon:km,label:"Requests",value:x.totalRequests,delta:w(x.totalRequests,y.totalRequests),sparkData:E}),o.jsx(el,{icon:ci,label:"Success rate",format:"percent",value:x.successRate,delta:w(x.successRate,y.successRate),sparkData:E,sparkStroke:"stroke-emerald-500"}),o.jsx(el,{icon:rR,label:"Total tokens",value:x.totalTokens,delta:w(x.totalTokens,y.totalTokens),sparkData:b.map(C=>C.inputTokens+C.outputTokens)}),o.jsx(el,{icon:lR,label:"Cache hit rate",format:"percent",value:x.cacheHitRate,delta:w(x.cacheHitRate,y.cacheHitRate),sparkData:b.map(C=>C.cacheRead)}),o.jsx(el,{icon:tR,label:"Avg latency",format:"latency",value:x.averageLatencyMs,delta:w(x.averageLatencyMs,y.averageLatencyMs),deltaInverse:!0,sparkData:j,sparkStroke:"stroke-amber-500"}),o.jsx(el,{icon:R0,label:"p95 latency",format:"latency",value:x.p95LatencyMs}),o.jsx(el,{icon:bR,label:"Avg TTFT",format:"latency",value:x.averageTtftMs??0}),o.jsx(el,{icon:mR,label:"Fallback rate",format:"percent",value:x.fallbackRate,delta:w(x.fallbackRate,y.fallbackRate),deltaInverse:!0})]}),o.jsx("div",{className:"mt-6",children:o.jsx(e4,{liveRequests:x.totalRequests,successRate:x.successRate,providers:u,pulses:f,activeRoutes:p})}),o.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-3",children:[o.jsx("div",{className:"lg:col-span-2",children:o.jsx(t4,{rows:c})}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs(nt,{children:[o.jsx(at,{className:"pb-2",children:o.jsx(rt,{className:"text-base",children:"Top Models"})}),o.jsx(lt,{children:o.jsxs(ca,{children:[o.jsx(ua,{children:o.jsxs(We,{children:[o.jsx(ye,{children:"Model"}),o.jsx(ye,{children:"Req"}),o.jsx(ye,{children:"Errors"}),o.jsx(ye,{children:"Tokens"})]})}),o.jsxs(da,{children:[l.topModels.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),l.topModels.map(C=>o.jsxs(We,{children:[o.jsx(pe,{className:"font-mono text-xs",children:C.publicId}),o.jsx(pe,{className:"text-xs",children:Kt(C.requests)}),o.jsx(pe,{className:"text-xs",children:o.jsx("span",{className:C.errorRate>.1?"text-destructive":"text-muted-foreground",children:Eu(C.errorRate)})}),o.jsx(pe,{className:"text-xs",children:Kt(C.totalTokens)})]},C.publicId))]})]})})]}),o.jsxs(nt,{children:[o.jsx(at,{className:"pb-2",children:o.jsx(rt,{className:"text-base",children:"Top API Keys"})}),o.jsx(lt,{children:o.jsxs(ca,{children:[o.jsx(ua,{children:o.jsxs(We,{children:[o.jsx(ye,{children:"Key"}),o.jsx(ye,{children:"Requests"}),o.jsx(ye,{children:"Tokens"})]})}),o.jsxs(da,{children:[l.topApiKeys.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),l.topApiKeys.map((C,N)=>o.jsxs(We,{children:[o.jsx(pe,{className:"text-xs",children:C.name}),o.jsx(pe,{className:"text-xs",children:Kt(C.requests)}),o.jsx(pe,{className:"text-xs",children:Kt(C.totalTokens)})]},N))]})]})})]})]})]}),o.jsx("div",{className:"mt-6",children:o.jsx(a4,{successRate:x.successRate,averageLatencyMs:x.averageLatencyMs,latencySpark:j})})]})}function l4(){const[n,a]=m.useState([]),[l,s]=m.useState(0);return m.useEffect(()=>{Se.get("/api/admin/audit?limit=200").then(c=>{a(c.rows),s(c.total)})},[]),o.jsxs("div",{children:[o.jsx($a,{title:"Audit Logs",description:`${l} entries · immutable`}),o.jsxs(nt,{children:[o.jsx(at,{children:o.jsx(rt,{className:"text-base",children:"All entries"})}),o.jsx(lt,{children:o.jsxs(ca,{children:[o.jsx(ua,{children:o.jsxs(We,{children:[o.jsx(ye,{children:"Time"}),o.jsx(ye,{children:"Action"}),o.jsx(ye,{children:"Status"}),o.jsx(ye,{children:"Target"}),o.jsx(ye,{children:"IP"}),o.jsx(ye,{children:"Actor"})]})}),o.jsxs(da,{children:[n.length===0&&o.jsx(We,{children:o.jsx(pe,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),n.map(c=>o.jsxs(We,{children:[o.jsx(pe,{className:"text-xs",children:Lm(c.createdAt)}),o.jsx(pe,{className:"font-mono text-xs",children:c.action}),o.jsx(pe,{children:c.success?o.jsx(Qe,{variant:"success",children:"ok"}):o.jsx(Qe,{variant:"destructive",children:"fail"})}),o.jsx(pe,{className:"text-xs",children:c.targetName??c.targetId??"—"}),o.jsx(pe,{className:"text-xs",children:c.ip}),o.jsx(pe,{className:"text-xs",children:c.actor})]},c.id))]})]})})]})]})}const vm={enabled:!0,sound:!0};let ri=vm,xm=!1,Yc=null;const ym=new Set;function _S(){for(const n of ym)n()}function kS(n=!1){return xm&&!n?Promise.resolve():(!n&&Yc||(Yc=(async()=>{try{const a=await Se.get("/api/admin/settings");ri={enabled:a.settings.notificationsEnabled??vm.enabled,sound:a.settings.notificationSoundEnabled??vm.sound},xm=!0,_S()}catch{}})()),Yc)}async function Fb(n){const a={};n.enabled!==void 0&&(a.notificationsEnabled=n.enabled),n.sound!==void 0&&(a.notificationSoundEnabled=n.sound),await Se.patch("/api/admin/settings",a),ri={...ri,...n},xm=!0,_S()}function s4(n){return ym.add(n),()=>ym.delete(n)}function zS(){return m.useSyncExternalStore(s4,()=>ri,()=>ri)}const bm=m.forwardRef(({className:n,...a},l)=>o.jsx("textarea",{ref:l,className:Ee("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n),...a}));bm.displayName="Textarea";function o4(){const[n]=BE(),[a,l]=m.useState(null),[s,c]=m.useState(null),[u,f]=m.useState({current:"",next:""}),[p,g]=m.useState(""),[v,x]=m.useState(""),[y,b]=m.useState(null),[w,E]=m.useState(!1),[j,C]=m.useState("idle"),[N,M]=m.useState(null),T=async(le=!1)=>{C("checking"),M(null);try{const Le=await Se.get(`/api/admin/update/check${le?"?force=1":""}`);b(Le),C("idle")}catch(Le){M(Le.message),C("error")}},D=async()=>{E(!0),C("installing"),M(null);try{const le=await Se.post("/api/admin/update/run");C("restarting"),ve.success(le.message||"Update started — the gateway will restart shortly.");const Le=setInterval(()=>{fetch("/health").then(Ie=>{Ie.ok&&(clearInterval(Le),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(Le),12e4)}catch(le){ve.error(le.message),M(le.message),C("error")}finally{E(!1)}},[O,A]=m.useState("disabled"),[U,k]=m.useState(""),[$,X]=m.useState(""),[te,G]=m.useState(""),[ie,ce]=m.useState([]),[se,_]=m.useState(""),[H,Q]=m.useState(""),[J,ee]=m.useState(!1),[z,I]=m.useState(null),[F,re]=m.useState(""),[he,ge]=m.useState(""),[q,oe]=m.useState(""),de=async()=>{const le=await Se.get("/api/admin/settings");l(le.settings),g(le.settings.adminIpAllow??""),x(le.settings.adminIpBlock??"");const Le=await Se.get("/api/admin/settings/system");c(Le);try{const Ie=await Se.get("/api/admin/me");A(Ie.totpEnabled?"enabled":"disabled")}catch{}};if(m.useEffect(()=>{kS(!0)},[]),m.useEffect(()=>{de(),T(!0)},[]),!a)return o.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const fe=async le=>{try{await Se.patch("/api/admin/settings",le),ve.success("Saved"),de()}catch(Le){ve.error(Le.message)}},Te=async()=>{try{const le=await Se.post("/api/admin/account/totp/begin");k(le.secret),X(le.qr),A("setup"),ve.info("Scan the QR code with your authenticator app")}catch(le){ve.error(le.message)}},je=async()=>{if(!te||te.length!==6){ve.error("Enter a 6-digit code");return}try{const le=await Se.post("/api/admin/account/totp/verify",{code:te});ce(le.recoveryCodes),A("showingRecovery"),ve.success("TOTP enabled successfully")}catch(le){ve.error(le.message)}},De=async()=>{if(!se){ve.error("Enter your password");return}if(!H){ve.error("Enter a TOTP code or recovery code");return}try{await Se.post("/api/admin/account/totp/disable",{password:se,totp:H}),A("disabled"),_(""),Q(""),ve.success("TOTP disabled"),de()}catch(le){ve.error(le.message)}},Fe=async()=>{ee(!0);try{const le=await Se.post("/api/admin/account/totp/recovery/regenerate",{password:se,totp:H});ce(le.recoveryCodes),A("showingRecovery"),ve.success("Recovery codes regenerated")}catch(le){ve.error(le.message)}ee(!1)},et=n.get("tab")||"logging";return o.jsxs("div",{children:[o.jsx($a,{title:"Settings",description:"Logging, security, backup, and system info"}),o.jsxs(MS,{defaultValue:et,children:[o.jsxs(Up,{children:[o.jsx(mr,{value:"logging",children:"Logging"}),o.jsx(mr,{value:"access",children:"Access Control"}),o.jsx(mr,{value:"security",children:"Security"}),o.jsx(mr,{value:"backup",children:"Backup"}),o.jsx(mr,{value:"system",children:"System"})]}),o.jsx(Os,{value:"logging",children:o.jsxs(nt,{children:[o.jsx(at,{children:o.jsx(rt,{className:"text-base",children:"Logging policy"})}),o.jsxs(lt,{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(we,{children:"Request-content logging"}),o.jsxs(Ua,{value:a.contentLogMode,onValueChange:le=>fe({contentLogMode:le}),children:[o.jsx(Sa,{children:o.jsx(Ba,{})}),o.jsxs(ja,{children:[o.jsx(Rt,{value:"off",children:"Off"}),o.jsx(Rt,{value:"metadata",children:"Metadata only (default)"}),o.jsx(Rt,{value:"prompt",children:"Prompt (sanitized)"}),o.jsx(Rt,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(we,{children:"Retention (days)"}),o.jsx(Ae,{type:"number",min:1,max:3650,value:a.retentionDays,onChange:le=>fe({retentionDays:Number(le.target.value)})})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(we,{children:"Database size limit (MB)"}),o.jsx(Ae,{type:"number",min:64,value:a.dbSizeLimitMb,onChange:le=>fe({dbSizeLimitMb:Number(le.target.value)})})]}),o.jsx("div",{className:"flex items-center gap-2 pt-2",children:o.jsx(me,{onClick:async()=>{const le=await Se.post("/api/admin/settings/cleanup");ve.success(`Deleted ${le.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),o.jsx(Os,{value:"access",children:o.jsxs(nt,{children:[o.jsxs(at,{children:[o.jsx(rt,{className:"text-base",children:"IP access control"}),o.jsx(gn,{children:"Allowlist / Blocklist for this admin website (not model traffic)"})]}),o.jsxs(lt,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(we,{children:"Allow only these IPs"}),o.jsx(bm,{placeholder:`192.168.1.0/24
|
|
349
|
+
10.0.0.1`,value:p,onChange:le=>g(le.target.value)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Newlines-delimited CIDR ranges (IPv4 only). Leave empty = no allow restrictions. When you save a non-empty list, your current IP is auto-added to prevent lockout."})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(we,{children:"Block these IPs"}),o.jsx(bm,{placeholder:"192.168.1.100",value:v,onChange:le=>x(le.target.value)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:'Newlines-delimited CIDR ranges (IPv4 only). Blocked IPs are rejected with "Không có quyền truy cập" before any login page.'})]}),o.jsx(me,{onClick:()=>{const le={};p!==((a==null?void 0:a.adminIpAllow)??"")&&(le.adminIpAllow=p||null),v!==((a==null?void 0:a.adminIpBlock)??"")&&(le.adminIpBlock=v||null),Se.patch("/api/admin/settings",le).then(Le=>{ve.success("Saved"+(Le.addedIp?` — added your IP: ${Le.addedIp}`:"")),de(),g(""),x("")}).catch(Le=>ve.error(Le.message))},children:"Save access control"}),o.jsxs("div",{className:"rounded bg-amber-50 border border-amber-200 p-3 dark:bg-amber-950/20 dark:border-amber-800",children:[o.jsx("p",{className:"text-sm font-medium text-amber-900 dark:text-amber-200",children:"⚠️ If you enable an allow list, you cannot access the gateway unless your IP matches."}),o.jsx("p",{className:"text-xs text-amber-800 dark:text-amber-300",children:"The server automatically adds your current IP when you save — but if you configure it from a different machine, that machine will be locked out immediately."})]})]})]})}),o.jsx(Os,{value:"security",children:o.jsxs(nt,{children:[o.jsxs(at,{children:[o.jsx(rt,{className:"text-base",children:"Security"}),o.jsx(gn,{children:"Change password, 2FA, and trusted proxy configuration"})]}),o.jsxs(lt,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(we,{children:"Trusted proxy hops"}),o.jsx(Ae,{type:"number",min:0,max:8,value:a.trustProxyHops,onChange:le=>fe({trustProxyHops:Number(le.target.value)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"0 = never trust X-Forwarded-For (direct exposure). 1+ only when behind a single trusted reverse proxy."})]}),o.jsxs("div",{className:"space-y-2 border-t pt-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(we,{className:"text-base",children:"TOTP 2FA"}),O==="enabled"?o.jsx("span",{className:"rounded bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800 dark:bg-green-900 dark:text-green-200",children:"Enabled"}):null,O==="disabled"?o.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:"Disabled"}):null]}),O==="disabled"&&o.jsx(me,{variant:"outline",onClick:Te,children:"Enable TOTP"}),O==="setup"&&o.jsxs("div",{className:"space-y-3 rounded border p-3",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan this QR code with your authenticator app, or enter the secret manually."}),$&&o.jsx("img",{src:$,alt:"TOTP QR code",className:"h-40 w-40"}),o.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",U]}),o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsxs("div",{className:"flex-1",children:[o.jsx(we,{children:"Verify code"}),o.jsx(Ae,{value:te,onChange:le=>G(le.target.value),placeholder:"123456",maxLength:6})]}),o.jsx(me,{disabled:te.length<6,onClick:je,children:"Verify & enable"})]})]}),O==="showingRecovery"&&o.jsxs("div",{className:"space-y-3 rounded border border-amber-500/40 bg-amber-50 p-3 dark:bg-amber-950/20",children:[o.jsx("p",{className:"text-sm font-medium",children:"Recovery codes — save these now!"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Each code can be used once to log in without your TOTP device. They will not be shown again."}),o.jsx("div",{className:"space-y-1",children:ie.map((le,Le)=>o.jsx("div",{className:"font-mono text-xs",children:le},Le))}),o.jsx(me,{onClick:()=>{A("enabled"),ve.success("Recovery codes saved")},children:"I have saved them"})]}),O==="enabled"&&o.jsxs("div",{className:"space-y-3 rounded border p-3",children:[o.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx(we,{children:"Password"}),o.jsx(Ae,{type:"password",value:se,onChange:le=>_(le.target.value),placeholder:"Current password"})]}),o.jsxs("div",{children:[o.jsx(we,{children:"TOTP code"}),o.jsx(Ae,{value:H,onChange:le=>Q(le.target.value),placeholder:"123456",maxLength:6})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(me,{variant:"outline",size:"sm",disabled:J||!se||H.length<6,onClick:Fe,children:"Regenerate recovery codes"}),o.jsx(me,{variant:"destructive",size:"sm",disabled:!se||H.length<6,onClick:De,children:"Disable TOTP"})]})]})]}),o.jsxs("div",{className:"space-y-2 border-t pt-4",children:[o.jsx(we,{children:"Change password"}),o.jsx(Ae,{type:"password",placeholder:"Current password",value:u.current,onChange:le=>f({...u,current:le.target.value})}),o.jsx(Ae,{type:"password",placeholder:"New password (12+ chars)",value:u.next,onChange:le=>f({...u,next:le.target.value})}),o.jsx(me,{disabled:!u.current||u.next.length<12,onClick:async()=>{try{await Se.post("/api/admin/account/password",{currentPassword:u.current,newPassword:u.next}),ve.success("Password changed"),f({current:"",next:""})}catch(le){ve.error(le.message)}},children:"Change password"})]})]})]})}),o.jsx(Os,{value:"backup",children:o.jsxs(nt,{children:[o.jsxs(at,{children:[o.jsx(rt,{className:"text-base",children:"Backup & restore"}),o.jsx(gn,{children:"Download a snapshot or restore from a previous backup"})]}),o.jsxs(lt,{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-2 rounded border p-3",children:[o.jsx(we,{children:"Backup passphrase (6 digits)"}),o.jsx(Ae,{inputMode:"numeric",maxLength:6,value:F,onChange:le=>re(le.target.value.replace(/\D/g,"")),placeholder:"123456"}),o.jsx(Ae,{inputMode:"numeric",maxLength:6,value:he,onChange:le=>ge(le.target.value.replace(/\D/g,"")),placeholder:"Repeat passphrase"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"This passphrase encrypts the master key inside the backup. You must enter the same 6 digits when importing on a new instance. Without it, encrypted provider credentials cannot be recovered."})]}),o.jsx(me,{disabled:F.length!==6||F!==he,onClick:async()=>{try{const le=await ru("/api/admin/backup/create",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({passphrase:F})});if(!le.ok)throw new Error("Backup failed");const Le=await le.blob(),Ie=URL.createObjectURL(Le),kt=document.createElement("a");kt.href=Ie,kt.download="latedev-backup.json",kt.click(),URL.revokeObjectURL(Ie),ve.success("Backup downloaded"),re(""),ge("")}catch(le){ve.error(le.message)}},children:"Download backup"}),o.jsxs("div",{className:"space-y-2 rounded border p-3",children:[o.jsx(we,{children:"Backup passphrase for restore"}),o.jsx(Ae,{inputMode:"numeric",maxLength:6,value:q,onChange:le=>oe(le.target.value.replace(/\D/g,"")),placeholder:"123456"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the 6-digit passphrase entered when the backup was created. It is required to restore the master key and administrator access."})]}),o.jsxs(up,{open:z!==null,onOpenChange:le=>{le||I(null)},children:[o.jsx(vO,{asChild:!0,children:o.jsxs("div",{children:[o.jsx(we,{children:"Restore from backup file"}),o.jsx(Ae,{type:"file",accept:".json,application/json","data-testid":"restore-file",onChange:le=>{var Ie;const Le=(Ie=le.target.files)==null?void 0:Ie[0];I(Le??null)}})]})}),o.jsxs(Pu,{children:[o.jsxs(dp,{children:[o.jsx(qu,{children:"Restore backup?"}),o.jsxs(Vu,{children:["Restoring will replace the entire current database with the selected backup (",(z==null?void 0:z.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),o.jsxs(fp,{children:[o.jsx(Yu,{children:"Cancel"}),o.jsx($u,{onClick:async()=>{var Le,Ie;const le=z;if(le)try{const kt=JSON.parse(await le.text()),St=await ru("/api/admin/backup/restore",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({backup:kt,passphrase:q})});if(!St.ok)throw new Error(((Ie=(Le=await St.json())==null?void 0:Le.error)==null?void 0:Ie.message)??"Restore failed");ve.success("Restored. Reloading…"),I(null),setTimeout(()=>location.reload(),600)}catch(kt){ve.error(kt.message)}},children:"Restore"})]})]})]})]})]})}),o.jsxs(Os,{value:"system",children:[o.jsxs(nt,{children:[o.jsx(at,{children:o.jsx(rt,{className:"text-base",children:"System"})}),o.jsxs(lt,{className:"space-y-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"App version:"})," ",s==null?void 0:s.appVersion]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Data directory:"})," ",o.jsx("span",{className:"font-mono",children:s==null?void 0:s.dataDir})]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Encryption:"})," ",s!=null&&s.masterKeyConfigured?"Configured":"Not configured"," (v",s==null?void 0:s.masterKeyVersion,")"]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-muted-foreground",children:"Environment:"})," ",s==null?void 0:s.environment]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[o.jsx(Ca,{checked:a.gatewayCacheEnabled,onCheckedChange:le=>fe({gatewayCacheEnabled:le})}),o.jsx(we,{children:"Gateway response cache (disabled by default)"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx(we,{children:"Cache TTL (s)"}),o.jsx(Ae,{type:"number",min:1,value:a.gatewayCacheDefaultTtlSeconds,onChange:le=>fe({gatewayCacheDefaultTtlSeconds:Number(le.target.value)})})]}),o.jsxs("div",{children:[o.jsx(we,{children:"Cache max size (MB)"}),o.jsx(Ae,{type:"number",min:1,value:a.gatewayCacheMaxSizeMb,onChange:le=>fe({gatewayCacheMaxSizeMb:Number(le.target.value)})})]})]}),o.jsx(me,{variant:"outline",onClick:async()=>{const le=await Se.post("/api/admin/settings/cache/clear");ve.success(`Cleared ${le.deleted} entries`)},children:"Clear gateway cache"})]})]}),o.jsx(i4,{}),o.jsxs(nt,{className:"mt-4",children:[o.jsxs(at,{children:[o.jsx(rt,{className:"text-base",children:"Updates"}),o.jsx(gn,{children:"Automatic updates from the npm registry"})]}),o.jsxs(lt,{className:"space-y-3 text-sm",children:[j==="checking"&&!y&&o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(_s,{className:"h-4 w-4 animate-spin"})," Checking for updates…"]}),y&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Current version"}),o.jsxs("div",{className:"font-mono",children:["v",y.currentVersion]})]}),o.jsx("span",{className:"text-muted-foreground",children:"→"}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Latest version"}),o.jsx("div",{className:"font-mono",children:y.latestVersion?`v${y.latestVersion}`:"—"})]}),y.status.docker?o.jsx(Qe,{variant:"secondary",children:y.status.watchtower?"Docker + Watchtower":"Docker"}):y.latestVersion===null?o.jsx(Qe,{variant:"secondary",children:"Registry unreachable"}):y.hasUpdate?o.jsx(Qe,{variant:"success",children:"Update available"}):o.jsxs(Qe,{variant:"outline",children:[o.jsx(ci,{className:"mr-1 h-3 w-3"})," Up to date"]})]}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable&&o.jsx("p",{className:"text-muted-foreground",children:"Watchtower pulls new images automatically every hour — or use Update now for an instant update."}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable===!1&&o.jsxs("p",{className:"text-muted-foreground",children:["The Watchtower sidecar is configured but not running — start it with ",o.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"docker compose --profile updater up -d"}),"."]}),y.status.docker&&!y.status.watchtower&&o.jsx("p",{className:"text-muted-foreground",children:y.status.reason??"This instance runs in Docker — update by pulling the new image tag."}),!y.status.docker&&y.latestVersion===null&&o.jsxs("p",{className:"text-muted-foreground",children:["Could not reach the npm registry (offline or blocked). ",N&&o.jsx("span",{className:"text-destructive",children:N})]}),j==="installing"&&o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(_s,{className:"h-4 w-4 animate-spin"})," Applying the update… this can take a minute."]}),j==="restarting"&&o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(_s,{className:"h-4 w-4 animate-spin"})," Update applied — the gateway is restarting on the new version. This page reloads automatically."]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y.hasUpdate&&j==="idle"&&(!y.status.docker||y.status.watchtower&&y.watchtowerReachable!==!1)&&o.jsxs(me,{disabled:w||y.status.docker&&y.watchtowerReachable===!1,onClick:D,children:[o.jsx(E0,{className:"mr-1 h-4 w-4"})," Update now"]}),y.hasUpdate&&y.changelogUrl&&o.jsx(me,{variant:"outline",asChild:!0,children:o.jsx("a",{href:y.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),j==="idle"&&o.jsx(me,{variant:"ghost",disabled:w,onClick:()=>T(!0),children:"Check again"})]})]})]})]})]})]})]})}function i4(){const n=zS();return o.jsxs(nt,{className:"mt-4",children:[o.jsx(at,{children:o.jsxs(rt,{className:"text-base flex items-center gap-2",children:[o.jsx(QE,{className:"h-4 w-4"})," Notifications"]})}),o.jsxs(lt,{className:"space-y-3 text-sm",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{children:"Show request notifications"}),o.jsx(Ca,{checked:n.enabled,onCheckedChange:a=>void Fb({enabled:a})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(wR,{className:"h-3 w-3"})," Play notification sound"]}),o.jsx(Ca,{checked:n.sound,onCheckedChange:a=>void Fb({sound:a})})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function c4({items:n,onDismiss:a}){return n.length?o.jsx("div",{className:"fixed top-16 right-4 z-50 flex max-h-[calc(100vh-8rem)] w-80 flex-col gap-2 overflow-y-auto",children:n.map(l=>{const s=!l.success,c=l.success&&l.totalLatencyMs>15e3,u=Ee("rounded-md border shadow-lg transition-all",s&&"bg-destructive text-destructive-foreground border-destructive",c&&"bg-amber-500/90 text-amber-950 border-amber-600/50",!s&&!c&&"bg-card text-card-foreground border-border");return o.jsxs(ra,{to:"/requests",className:Ee("block shrink-0 p-3 hover:opacity-95",u),children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s?o.jsx(eR,{className:"h-4 w-4 shrink-0"}):l.success?o.jsx(ci,{className:"h-4 w-4 shrink-0"}):o.jsx(SR,{className:"h-4 w-4 shrink-0 opacity-70"}),o.jsx("div",{className:"min-w-0 truncate text-sm font-medium",title:l.requestedModel,children:l.requestedModel})]}),o.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100",onClick:f=>{f.preventDefault(),f.stopPropagation(),a(l.id)},"aria-label":"Dismiss",type:"button",children:o.jsx(Cu,{className:"h-3.5 w-3.5"})})]}),o.jsxs("div",{className:"mt-1 text-xs",children:[l.success?"Thành công":"Thất bại",!l.success&&l.errorType&&o.jsx("span",{className:"ml-1 inline-block rounded bg-black/15 px-1 py-0.5 align-text-bottom text-[10px]",children:l.errorType})]}),o.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:["in ",Kt(l.inputTokens)," · out ",Kt(l.outputTokens),(l.cacheReadTokens>0||l.cacheWriteTokens>0)&&o.jsxs(o.Fragment,{children:[" · cache ",l.cacheReadTokens>0&&o.jsxs("span",{children:["r",Kt(l.cacheReadTokens)]}),l.cacheReadTokens>0&&l.cacheWriteTokens>0&&"/",l.cacheWriteTokens>0&&o.jsxs("span",{children:["w",Kt(l.cacheWriteTokens)]})]})]}),o.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[Ol(l.totalLatencyMs),l.ttftMs!=null&&l.ttftMs>=0&&o.jsxs("span",{children:[" · TTFT ",Ol(l.ttftMs)]})]})]},l.id)})}):null}const u4=5e3,d4=8,f4=3e3;let Gc=null;function h4(){try{Gc||(Gc=new Audio("/notification.mp3")),Gc.currentTime=0,Gc.play().catch(()=>{})}catch{}}function m4(){const[n,a]=m.useState([]),l=m.useRef(null),s=m.useRef(new Map),c=m.useRef(Date.now()),u=m.useRef(new Set),f=zS(),p=m.useRef(f.sound);p.current=f.sound,m.useEffect(()=>{kS()},[]);const g=f.enabled;return m.useEffect(()=>{var w;if(!g){(w=l.current)==null||w.close(),l.current=null;const E=s.current;for(const j of E.values())clearTimeout(j);E.clear(),a([]);return}let x=!1;const y=s.current,b=()=>{if(x)return;const E=new EventSource(`/api/admin/requests/stream?since=${c.current}`);l.current=E,E.addEventListener("request",j=>{if(!x)try{const C=JSON.parse(j.data),N=new Date(C.createdAt).getTime();if(Number.isFinite(N)&&(c.current=Math.max(c.current,N)),u.current.has(C.id))return;u.current.add(C.id),a(T=>T.some(D=>D.id===C.id)?T:[C,...T].slice(0,d4));const M=setTimeout(()=>{a(T=>T.filter(D=>D.id!==C.id)),y.delete(C.id)},u4);y.set(C.id,M),p.current&&h4()}catch{}}),E.onerror=()=>{E.close(),l.current=null,x||setTimeout(b,f4)}};return b(),()=>{var E;x=!0,(E=l.current)==null||E.close(),l.current=null;for(const j of y.values())clearTimeout(j);y.clear()}},[g]),{items:n,dismiss:x=>{const y=s.current.get(x);y&&(clearTimeout(y),s.current.delete(x)),a(b=>b.filter(w=>w.id!==x))}}}function p4({children:n}){const{user:a,loading:l}=_m(),s=_n();return l?o.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):a?o.jsx(o.Fragment,{children:n}):o.jsx(Ih,{to:"/login",state:{from:s},replace:!0})}function g4(){const{items:n,dismiss:a}=m4();return o.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[o.jsx(rN,{}),o.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[o.jsx(lD,{}),o.jsx("main",{className:"flex-1 overflow-auto p-6",children:o.jsxs(g0,{children:[o.jsx(Nn,{index:!0,element:o.jsx(HD,{})}),o.jsx(Nn,{path:"/providers",element:o.jsx(h_,{})}),o.jsx(Nn,{path:"/models",element:o.jsx(R_,{})}),o.jsx(Nn,{path:"/combos",element:o.jsx(xk,{})}),o.jsx(Nn,{path:"/aliases",element:o.jsx(wk,{})}),o.jsx(Nn,{path:"/api-keys",element:o.jsx(Sk,{})}),o.jsx(Nn,{path:"/requests",element:o.jsx(Ek,{})}),o.jsx(Nn,{path:"/statistics",element:o.jsx(r4,{})}),o.jsx(Nn,{path:"/audit",element:o.jsx(l4,{})}),o.jsx(Nn,{path:"/settings/*",element:o.jsx(o4,{})})]})})]}),o.jsx(c4,{items:n,onDismiss:a})]})}function v4({children:n}){const[a,l]=m.useState(null),s=_n();return m.useEffect(()=>{Se.get("/api/admin/setup/status").then(c=>l(c.setupComplete)).catch(()=>l(!0))},[]),a===null?o.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):!a&&s.pathname!=="/setup"?o.jsx(Ih,{to:"/setup",replace:!0}):a&&s.pathname==="/setup"?o.jsx(Ih,{to:"/",replace:!0}):o.jsx(o.Fragment,{children:n})}function x4(){return o.jsx(YE,{children:o.jsx(v4,{children:o.jsxs(g0,{children:[o.jsx(Nn,{path:"/setup",element:o.jsx(UD,{})}),o.jsx(Nn,{path:"/login",element:o.jsx(LD,{})}),o.jsx(Nn,{path:"/*",element:o.jsx(p4,{children:o.jsx(g4,{})})})]})})})}const y4=zD;var b4=Object.defineProperty,Dn=(n,a)=>b4(n,"name",{value:a,configurable:!0}),[Bp,J4]=kn("Tooltip",[Ks]),w4=Ks(),S4="TooltipProvider",j4=700,Qb="tooltip.open",[C4,E4]=Bp(S4),R4=Dn(n=>{const{__scopeTooltip:a,delayDuration:l=j4,skipDelayDuration:s=300,disableHoverableContent:c=!1,children:u}=n,f=m.useRef(!0),p=m.useRef(!1),g=m.useRef(0);return m.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),o.jsx(C4,{scope:a,isOpenDelayedRef:f,delayDuration:l,onOpen:m.useCallback(()=>{s<=0||(window.clearTimeout(g.current),f.current=!1)},[s]),onClose:m.useCallback(()=>{s<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,s))},[s]),isPointerInTransitRef:p,onPointerInTransitChange:m.useCallback(v=>{p.current=v},[]),disableHoverableContent:c,children:u})},"TooltipProvider"),N4="Tooltip",[W4,Hp]=Bp(N4),T4="TooltipPortal",[e5,M4]=Bp(T4,{forceMount:void 0}),li="TooltipContent",A4=m.forwardRef(Dn(function(a,l){const s=M4(li,a.__scopeTooltip),{forceMount:c=s.forceMount,side:u="top",...f}=a,p=Hp(li,a.__scopeTooltip);return o.jsx(Cr,{present:c||p.open,children:p.disableHoverableContent?o.jsx(LS,{side:u,...f,ref:l}):o.jsx(D4,{side:u,...f,ref:l})})},"TooltipContent")),D4=m.forwardRef(Dn(function(a,l){const s=Hp(li,a.__scopeTooltip),c=E4(li,a.__scopeTooltip),u=m.useRef(null),f=Xe(l,u),[p,g]=m.useState(null),{trigger:v,onClose:x}=s,y=u.current,{onPointerInTransitChange:b}=c,w=m.useCallback(()=>{g(null),b(!1)},[b]),E=m.useCallback((j,C)=>{const N=j.currentTarget,M={x:j.clientX,y:j.clientY},T=US(M,N.getBoundingClientRect()),D=BS(M,T),O=HS(C.getBoundingClientRect()),A=PS([...D,...O]);g(A),b(!0)},[b]);return m.useEffect(()=>()=>w(),[w]),m.useEffect(()=>{if(v&&y){const j=Dn(N=>E(N,y),"handleTriggerLeave"),C=Dn(N=>E(N,v),"handleContentLeave");return v.addEventListener("pointerleave",j),y.addEventListener("pointerleave",C),()=>{v.removeEventListener("pointerleave",j),y.removeEventListener("pointerleave",C)}}},[v,y,E,w]),m.useEffect(()=>{if(p){const j=Dn(C=>{const N=C.target,M={x:C.clientX,y:C.clientY},T=(v==null?void 0:v.contains(N))||(y==null?void 0:y.contains(N)),D=!IS(M,p);T?w():D&&(w(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[v,y,p,x,w]),o.jsx(LS,{...a,ref:f})},"TooltipContentHoverable")),O4=q0("TooltipContent"),LS=m.forwardRef(Dn(function(a,l){const{__scopeTooltip:s,children:c,"aria-label":u,id:f,onEscapeKeyDown:p,onPointerDownOutside:g,...v}=a,x=Hp(li,s),y=w4(s),{onClose:b}=x;m.useEffect(()=>(document.addEventListener(Qb,b),()=>document.removeEventListener(Qb,b)),[b]),m.useEffect(()=>{if(x.trigger){const E=Dn(j=>{j.target instanceof Node&&j.target.contains(x.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",E,{capture:!0}),()=>window.removeEventListener("scroll",E,{capture:!0})}},[x.trigger,b]);const{setContentId:w}=x;return Xt(()=>(w(f),()=>{w(void 0)}),[f,w]),o.jsx(Nu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:E=>E.preventDefault(),onDismiss:b,children:o.jsxs(Qm,{"data-state":x.stateAttribute,role:u?void 0:"tooltip",id:u?void 0:x.contentId,...y,...v,ref:l,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(O4,{children:c}),u?o.jsx(RO,{id:x.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl"));function US(n,a){const l=Math.abs(a.top-n.y),s=Math.abs(a.bottom-n.y),c=Math.abs(a.right-n.x),u=Math.abs(a.left-n.x);switch(Math.min(l,s,c,u)){case u:return"left";case c:return"right";case l:return"top";case s:return"bottom";default:throw new Error("unreachable")}}Dn(US,"getExitSideFromRect");function BS(n,a,l=5){const s=[];switch(a){case"top":s.push({x:n.x-l,y:n.y+l},{x:n.x+l,y:n.y+l});break;case"bottom":s.push({x:n.x-l,y:n.y-l},{x:n.x+l,y:n.y-l});break;case"left":s.push({x:n.x+l,y:n.y-l},{x:n.x+l,y:n.y+l});break;case"right":s.push({x:n.x-l,y:n.y-l},{x:n.x-l,y:n.y+l});break}return s}Dn(BS,"getPaddedExitPoints");function HS(n){const{top:a,right:l,bottom:s,left:c}=n;return[{x:c,y:a},{x:l,y:a},{x:l,y:s},{x:c,y:s}]}Dn(HS,"getPointsFromRect");function IS(n,a){const{x:l,y:s}=n;let c=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],v=p.x,x=p.y,y=g.x,b=g.y;x>s!=b>s&&l<(y-v)*(s-x)/(b-x)+v&&(c=!c)}return c}Dn(IS,"isPointInPolygon");function PS(n){const a=n.slice();return a.sort((l,s)=>l.x<s.x?-1:l.x>s.x?1:l.y<s.y?-1:l.y>s.y?1:0),qS(a)}Dn(PS,"getHull");function qS(n){if(n.length<=1)return n.slice();const a=[];for(let s=0;s<n.length;s++){const c=n[s];for(;a.length>=2;){const u=a[a.length-1],f=a[a.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))a.pop();else break}a.push(c)}a.pop();const l=[];for(let s=n.length-1;s>=0;s--){const c=n[s];for(;l.length>=2;){const u=l[l.length-1],f=l[l.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))l.pop();else break}l.push(c)}return l.pop(),a.length===1&&l.length===1&&a[0].x===l[0].x&&a[0].y===l[0].y?a:a.concat(l)}Dn(qS,"getHullPresorted");var _4=R4,VS=A4;const k4=_4,z4=m.forwardRef(({className:n,sideOffset:a=4,...l},s)=>o.jsx(VS,{ref:s,sideOffset:a,className:Ee("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95",n),...l}));z4.displayName=VS.displayName;d2.createRoot(document.getElementById("root")).render(o.jsx(ue.StrictMode,{children:o.jsx(hN,{defaultTheme:"dark",storageKey:"latedev-theme",children:o.jsxs(k4,{children:[o.jsx(kE,{children:o.jsx(x4,{})}),o.jsx(y4,{position:"top-right"})]})})}));
|