ldrouter 1.14.0 → 1.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/README.md +23 -1
- package/dist/server/app.js +10 -1
- package/dist/server/auth/api-key.js +2 -2
- package/dist/server/auth/middleware.js +37 -1
- package/dist/server/db/index.js +5 -0
- package/dist/server/db/migrate.js +38 -5
- package/dist/server/db/repositories/codex-accounts.js +187 -0
- package/dist/server/db/schema.js +44 -3
- package/dist/server/gateway/runner.js +75 -12
- package/dist/server/providers/codex-autostart.js +98 -0
- package/dist/server/providers/codex-import.js +156 -0
- package/dist/server/providers/codex-oauth.js +77 -0
- package/dist/server/providers/codex-refresh.js +165 -0
- package/dist/server/providers/codex-usage.js +192 -0
- package/dist/server/providers/codex.js +186 -0
- package/dist/server/providers/index.js +5 -0
- package/dist/server/routes/admin/auth.js +4 -1
- package/dist/server/routes/admin/codex.js +331 -0
- package/dist/server/routes/admin/models.js +20 -3
- package/dist/server/routes/admin/providers.js +63 -20
- package/dist/server/routes/admin/requests.js +1 -0
- package/dist/server/routes/admin.js +12 -0
- package/dist/server/routing/capabilities.js +3 -3
- package/dist/server/routing/combo.js +20 -14
- package/dist/server/upstream/client.js +54 -38
- package/dist/web/assets/index-Coy-u6h8.css +1 -0
- package/dist/web/assets/index-qDG5c6aL.js +386 -0
- package/dist/web/index.html +2 -2
- package/migrations/0005_codex_accounts.sql +105 -0
- package/migrations/0006_codex_usage.sql +9 -0
- package/package.json +5 -1
- package/dist/web/assets/index-CBMHkVXC.js +0 -330
- package/dist/web/assets/index-Dswaxg_c.css +0 -1
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
var xx=a=>{throw TypeError(a)};var yx=(a,l,o)=>l.has(a)||xx("Cannot "+o);var Yt=(a,l,o)=>(yx(a,l,"read from private field"),o?o.call(a):l.get(a)),bx=(a,l,o)=>l.has(a)?xx("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(a):l.set(a,o),pf=(a,l,o,i)=>(yx(a,l,"write to private field"),i?i.call(a,o):l.set(a,o),o);function tj(a,l){for(var o=0;o<l.length;o++){const i=l[o];if(typeof i!="string"&&!Array.isArray(i)){for(const u in i)if(u!=="default"&&!(u in a)){const d=Object.getOwnPropertyDescriptor(i,u);d&&Object.defineProperty(a,u,d.get?d:{enumerable:!0,get:()=>i[u]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function o(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(u){if(u.ep)return;u.ep=!0;const d=o(u);fetch(u.href,d)}})();function vh(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var gf={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 Sx;function nj(){if(Sx)return vo;Sx=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(i,u,d){var h=null;if(d!==void 0&&(h=""+d),u.key!==void 0&&(h=""+u.key),"key"in u){d={};for(var p in u)p!=="key"&&(d[p]=u[p])}else d=u;return u=d.ref,{$$typeof:a,type:i,key:h,ref:u!==void 0?u:null,props:d}}return vo.Fragment=l,vo.jsx=o,vo.jsxs=o,vo}var wx;function aj(){return wx||(wx=1,gf.exports=nj()),gf.exports}var s=aj(),vf={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 jx;function lj(){if(jx)return Oe;jx=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=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"),S=Symbol.iterator;function w(D){return D===null||typeof D!="object"?null:(D=S&&D[S]||D["@@iterator"],typeof D=="function"?D:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,j={};function N(D,q,Q){this.props=D,this.context=q,this.refs=j,this.updater=Q||C}N.prototype.isReactComponent={},N.prototype.setState=function(D,q){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,q,"setState")},N.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function A(){}A.prototype=N.prototype;function T(D,q,Q){this.props=D,this.context=q,this.refs=j,this.updater=Q||C}var O=T.prototype=new A;O.constructor=T,E(O,N.prototype),O.isPureReactComponent=!0;var _=Array.isArray;function M(){}var H={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function K(D,q,Q){var ae=Q.ref;return{$$typeof:a,type:D,key:q,ref:ae!==void 0?ae:null,props:Q}}function se(D,q){return K(D.type,q,D.props)}function X(D){return typeof D=="object"&&D!==null&&D.$$typeof===a}function I(D){var q={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(Q){return q[Q]})}var re=/\/+/g;function W(D,q){return typeof D=="object"&&D!==null&&D.key!=null?I(""+D.key):q.toString(36)}function oe(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(M,M):(D.status="pending",D.then(function(q){D.status==="pending"&&(D.status="fulfilled",D.value=q)},function(q){D.status==="pending"&&(D.status="rejected",D.reason=q)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function U(D,q,Q,ae,ce){var be=typeof D;(be==="undefined"||be==="boolean")&&(D=null);var ue=!1;if(D===null)ue=!0;else switch(be){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(D.$$typeof){case a:case l:ue=!0;break;case x:return ue=D._init,U(ue(D._payload),q,Q,ae,ce)}}if(ue)return ce=ce(D),ue=ae===""?"."+W(D,0):ae,_(ce)?(Q="",ue!=null&&(Q=ue.replace(re,"$&/")+"/"),U(ce,q,Q,"",function(Ce){return Ce})):ce!=null&&(X(ce)&&(ce=se(ce,Q+(ce.key==null||D&&D.key===ce.key?"":(""+ce.key).replace(re,"$&/")+"/")+ue)),q.push(ce)),1;ue=0;var fe=ae===""?".":ae+":";if(_(D))for(var ve=0;ve<D.length;ve++)ae=D[ve],be=fe+W(ae,ve),ue+=U(ae,q,Q,be,ce);else if(ve=w(D),typeof ve=="function")for(D=ve.call(D),ve=0;!(ae=D.next()).done;)ae=ae.value,be=fe+W(ae,ve++),ue+=U(ae,q,Q,be,ce);else if(be==="object"){if(typeof D.then=="function")return U(oe(D),q,Q,ae,ce);throw q=String(D),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ue}function $(D,q,Q){if(D==null)return D;var ae=[],ce=0;return U(D,ae,"","",function(be){return q.call(Q,be,ce++)}),ae}function ne(D){if(D._status===-1){var q=D._result;q=q(),q.then(function(Q){(D._status===0||D._status===-1)&&(D._status=1,D._result=Q)},function(Q){(D._status===0||D._status===-1)&&(D._status=2,D._result=Q)}),D._status===-1&&(D._status=0,D._result=q)}if(D._status===1)return D._result.default;throw D._result}var B=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},Z={map:$,forEach:function(D,q,Q){$(D,function(){q.apply(this,arguments)},Q)},count:function(D){var q=0;return $(D,function(){q++}),q},toArray:function(D){return $(D,function(q){return q})||[]},only:function(D){if(!X(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Oe.Activity=y,Oe.Children=Z,Oe.Component=N,Oe.Fragment=o,Oe.Profiler=u,Oe.PureComponent=T,Oe.StrictMode=i,Oe.Suspense=g,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(D){return H.H.useMemoCache(D)}},Oe.cache=function(D){return function(){return D.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(D,q,Q){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ae=E({},D.props),ce=D.key;if(q!=null)for(be in q.key!==void 0&&(ce=""+q.key),q)!z.call(q,be)||be==="key"||be==="__self"||be==="__source"||be==="ref"&&q.ref===void 0||(ae[be]=q[be]);var be=arguments.length-2;if(be===1)ae.children=Q;else if(1<be){for(var ue=Array(be),fe=0;fe<be;fe++)ue[fe]=arguments[fe+2];ae.children=ue}return K(D.type,ce,ae)},Oe.createContext=function(D){return D={$$typeof:h,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:d,_context:D},D},Oe.createElement=function(D,q,Q){var ae,ce={},be=null;if(q!=null)for(ae in q.key!==void 0&&(be=""+q.key),q)z.call(q,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ce[ae]=q[ae]);var ue=arguments.length-2;if(ue===1)ce.children=Q;else if(1<ue){for(var fe=Array(ue),ve=0;ve<ue;ve++)fe[ve]=arguments[ve+2];ce.children=fe}if(D&&D.defaultProps)for(ae in ue=D.defaultProps,ue)ce[ae]===void 0&&(ce[ae]=ue[ae]);return K(D,be,ce)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(D){return{$$typeof:p,render:D}},Oe.isValidElement=X,Oe.lazy=function(D){return{$$typeof:x,_payload:{_status:-1,_result:D},_init:ne}},Oe.memo=function(D,q){return{$$typeof:v,type:D,compare:q===void 0?null:q}},Oe.startTransition=function(D){var q=H.T,Q={};H.T=Q;try{var ae=D(),ce=H.S;ce!==null&&ce(Q,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(M,B)}catch(be){B(be)}finally{q!==null&&Q.types!==null&&(q.types=Q.types),H.T=q}},Oe.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Oe.use=function(D){return H.H.use(D)},Oe.useActionState=function(D,q,Q){return H.H.useActionState(D,q,Q)},Oe.useCallback=function(D,q){return H.H.useCallback(D,q)},Oe.useContext=function(D){return H.H.useContext(D)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(D,q){return H.H.useDeferredValue(D,q)},Oe.useEffect=function(D,q){return H.H.useEffect(D,q)},Oe.useEffectEvent=function(D){return H.H.useEffectEvent(D)},Oe.useId=function(){return H.H.useId()},Oe.useImperativeHandle=function(D,q,Q){return H.H.useImperativeHandle(D,q,Q)},Oe.useInsertionEffect=function(D,q){return H.H.useInsertionEffect(D,q)},Oe.useLayoutEffect=function(D,q){return H.H.useLayoutEffect(D,q)},Oe.useMemo=function(D,q){return H.H.useMemo(D,q)},Oe.useOptimistic=function(D,q){return H.H.useOptimistic(D,q)},Oe.useReducer=function(D,q,Q){return H.H.useReducer(D,q,Q)},Oe.useRef=function(D){return H.H.useRef(D)},Oe.useState=function(D){return H.H.useState(D)},Oe.useSyncExternalStore=function(D,q,Q){return H.H.useSyncExternalStore(D,q,Q)},Oe.useTransition=function(){return H.H.useTransition()},Oe.version="19.2.8",Oe}var Cx;function xh(){return Cx||(Cx=1,vf.exports=lj()),vf.exports}var m=xh();const ie=vh(m),gs=tj({__proto__:null,default:ie},[m]);var xf={exports:{}},xo={},yf={exports:{}},bf={};/**
|
|
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 Ex;function rj(){return Ex||(Ex=1,(function(a){function l(U,$){var ne=U.length;U.push($);e:for(;0<ne;){var B=ne-1>>>1,Z=U[B];if(0<u(Z,$))U[B]=$,U[ne]=Z,ne=B;else break e}}function o(U){return U.length===0?null:U[0]}function i(U){if(U.length===0)return null;var $=U[0],ne=U.pop();if(ne!==$){U[0]=ne;e:for(var B=0,Z=U.length,D=Z>>>1;B<D;){var q=2*(B+1)-1,Q=U[q],ae=q+1,ce=U[ae];if(0>u(Q,ne))ae<Z&&0>u(ce,Q)?(U[B]=ce,U[ae]=ne,B=ae):(U[B]=Q,U[q]=ne,B=q);else if(ae<Z&&0>u(ce,ne))U[B]=ce,U[ae]=ne,B=ae;else break e}}return $}function u(U,$){var ne=U.sortIndex-$.sortIndex;return ne!==0?ne:U.id-$.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();a.unstable_now=function(){return h.now()-p}}var g=[],v=[],x=1,y=null,S=3,w=!1,C=!1,E=!1,j=!1,N=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function O(U){for(var $=o(v);$!==null;){if($.callback===null)i(v);else if($.startTime<=U)i(v),$.sortIndex=$.expirationTime,l(g,$);else break;$=o(v)}}function _(U){if(E=!1,O(U),!C)if(o(g)!==null)C=!0,M||(M=!0,I());else{var $=o(v);$!==null&&oe(_,$.startTime-U)}}var M=!1,H=-1,z=5,K=-1;function se(){return j?!0:!(a.unstable_now()-K<z)}function X(){if(j=!1,M){var U=a.unstable_now();K=U;var $=!0;try{e:{C=!1,E&&(E=!1,A(H),H=-1),w=!0;var ne=S;try{t:{for(O(U),y=o(g);y!==null&&!(y.expirationTime>U&&se());){var B=y.callback;if(typeof B=="function"){y.callback=null,S=y.priorityLevel;var Z=B(y.expirationTime<=U);if(U=a.unstable_now(),typeof Z=="function"){y.callback=Z,O(U),$=!0;break t}y===o(g)&&i(g),O(U)}else i(g);y=o(g)}if(y!==null)$=!0;else{var D=o(v);D!==null&&oe(_,D.startTime-U),$=!1}}break e}finally{y=null,S=ne,w=!1}$=void 0}}finally{$?I():M=!1}}}var I;if(typeof T=="function")I=function(){T(X)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,W=re.port2;re.port1.onmessage=X,I=function(){W.postMessage(null)}}else I=function(){N(X,0)};function oe(U,$){H=N(function(){U(a.unstable_now())},$)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(U){U.callback=null},a.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<U?Math.floor(1e3/U):5},a.unstable_getCurrentPriorityLevel=function(){return S},a.unstable_next=function(U){switch(S){case 1:case 2:case 3:var $=3;break;default:$=S}var ne=S;S=$;try{return U()}finally{S=ne}},a.unstable_requestPaint=function(){j=!0},a.unstable_runWithPriority=function(U,$){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ne=S;S=U;try{return $()}finally{S=ne}},a.unstable_scheduleCallback=function(U,$,ne){var B=a.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?B+ne:B):ne=B,U){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=ne+Z,U={id:x++,callback:$,priorityLevel:U,startTime:ne,expirationTime:Z,sortIndex:-1},ne>B?(U.sortIndex=ne,l(v,U),o(g)===null&&U===o(v)&&(E?(A(H),H=-1):E=!0,oe(_,ne-B))):(U.sortIndex=Z,l(g,U),C||w||(C=!0,M||(M=!0,I()))),U},a.unstable_shouldYield=se,a.unstable_wrapCallback=function(U){var $=S;return function(){var ne=S;S=$;try{return U.apply(this,arguments)}finally{S=ne}}}})(bf)),bf}var Rx;function sj(){return Rx||(Rx=1,yf.exports=rj()),yf.exports}var Sf={exports:{}},$t={};/**
|
|
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 Nx;function oj(){if(Nx)return $t;Nx=1;var a=xh();function l(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 o(){}var i={d:{f:o,r:function(){throw Error(l(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},u=Symbol.for("react.portal");function d(g,v,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:y==null?null:""+y,children:g,containerInfo:v,implementation:x}}var h=a.__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 $t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,$t.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(l(299));return d(g,v,null,x)},$t.flushSync=function(g){var v=h.T,x=i.p;try{if(h.T=null,i.p=2,g)return g()}finally{h.T=v,i.p=x,i.d.f()}},$t.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,i.d.C(g,v))},$t.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},$t.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin),S=typeof v.integrity=="string"?v.integrity:void 0,w=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;x==="style"?i.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:y,integrity:S,fetchPriority:w}):x==="script"&&i.d.X(g,{crossOrigin:y,integrity:S,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},$t.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);i.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&&i.d.M(g)},$t.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);i.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})}},$t.preloadModule=function(g,v){if(typeof g=="string")if(v){var x=p(v.as,v.crossOrigin);i.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 i.d.m(g)},$t.requestFormReset=function(g){i.d.r(g)},$t.unstable_batchedUpdates=function(g,v){return g(v)},$t.useFormState=function(g,v,x){return h.H.useFormState(g,v,x)},$t.useFormStatus=function(){return h.H.useHostTransitionStatus()},$t.version="19.2.8",$t}var Tx;function Sy(){if(Tx)return Sf.exports;Tx=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Sf.exports=oj(),Sf.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 Ax;function ij(){if(Ax)return xo;Ax=1;var a=sj(),l=xh(),o=Sy();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(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(d(e)!==e)throw Error(i(188))}function v(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var c=n.return;if(c===null)break;var f=c.alternate;if(f===null){if(r=c.return,r!==null){n=r;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===n)return g(c),e;if(f===r)return g(c),t;f=f.sibling}throw Error(i(188))}if(n.return!==r.return)n=c,r=f;else{for(var b=!1,R=c.child;R;){if(R===n){b=!0,n=c,r=f;break}if(R===r){b=!0,r=c,n=f;break}R=R.sibling}if(!b){for(R=f.child;R;){if(R===n){b=!0,n=f,r=c;break}if(R===r){b=!0,r=f,n=c;break}R=R.sibling}if(!b)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?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,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),T=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function I(e){return e===null||typeof e!="object"?null:(e=X&&e[X]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function W(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case N:return"Profiler";case j:return"StrictMode";case _:return"Suspense";case M:return"SuspenseList";case K:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case T:return e.displayName||"Context";case A:return(e._context.displayName||"Context")+".Consumer";case O:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return t=e.displayName||null,t!==null?t:W(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return W(e(t))}catch{}}return null}var oe=Array.isArray,U=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},B=[],Z=-1;function D(e){return{current:e}}function q(e){0>Z||(e.current=B[Z],B[Z]=null,Z--)}function Q(e,t){Z++,B[Z]=e.current,e.current=t}var ae=D(null),ce=D(null),be=D(null),ue=D(null);function fe(e,t){switch(Q(be,t),Q(ce,e),Q(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qv(t),e=Iv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(ae),Q(ae,e)}function ve(){q(ae),q(ce),q(be)}function Ce(e){e.memoizedState!==null&&Q(ue,e);var t=ae.current,n=Iv(t,e.type);t!==n&&(Q(ce,e),Q(ae,n))}function De(e){ce.current===e&&(q(ae),q(ce)),ue.current===e&&(q(ue),ho._currentValue=ne)}var Ae,Ue;function pt(e){if(Ae===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||"",Ue=-1<n.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ae+e+Ue}var gt=!1;function le(e,t){if(!e||gt)return"";gt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(F){var Y=F}Reflect.construct(e,[],te)}else{try{te.call()}catch(F){Y=F}e.call(te.prototype)}}else{try{throw Error()}catch(F){Y=F}(te=e())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(F){if(F&&Y&&typeof F.stack=="string")return[F.stack,Y.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=r.DetermineComponentFrameRoot(),b=f[0],R=f[1];if(b&&R){var k=b.split(`
|
|
44
|
-
`),G=R.split(`
|
|
45
|
-
`);for(c=r=0;r<k.length&&!k[r].includes("DetermineComponentFrameRoot");)r++;for(;c<G.length&&!G[c].includes("DetermineComponentFrameRoot");)c++;if(r===k.length||c===G.length)for(r=k.length-1,c=G.length-1;1<=r&&0<=c&&k[r]!==G[c];)c--;for(;1<=r&&0<=c;r--,c--)if(k[r]!==G[c]){if(r!==1||c!==1)do if(r--,c--,0>c||k[r]!==G[c]){var J=`
|
|
46
|
-
`+k[r].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=r&&0<=c);break}}}finally{gt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?pt(n):""}function Me(e,t){switch(e.tag){case 26:case 27:case 5:return pt(e.type);case 16:return pt("Lazy");case 13:return e.child!==t&&t!==null?pt("Suspense Fallback"):pt("Suspense");case 19:return pt("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 pt("Activity");default:return""}}function Fe(e){try{var t="",n=null;do t+=Me(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
|
|
47
|
-
Error generating stack: `+r.message+`
|
|
48
|
-
`+r.stack}}var St=Object.prototype.hasOwnProperty,Jt=a.unstable_scheduleCallback,pn=a.unstable_cancelCallback,ja=a.unstable_shouldYield,Ca=a.unstable_requestPaint,Kt=a.unstable_now,Jc=a.unstable_getCurrentPriorityLevel,Xt=a.unstable_ImmediatePriority,Ea=a.unstable_UserBlockingPriority,br=a.unstable_NormalPriority,Wc=a.unstable_LowPriority,Vl=a.unstable_IdlePriority,eu=a.log,Po=a.unstable_setDisableYieldValue,Ra=null,Ct=null;function Zn(e){if(typeof eu=="function"&&Po(e),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(Ra,e)}catch{}}var Et=Math.clz32?Math.clz32:qo,tu=Math.log,nu=Math.LN2;function qo(e){return e>>>=0,e===0?32:31-(tu(e)/nu|0)|0}var Gl=256,Sr=262144,sl=4194304;function Gt(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 wr(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var c=0,f=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var R=r&134217727;return R!==0?(r=R&~f,r!==0?c=Gt(r):(b&=R,b!==0?c=Gt(b):n||(n=R&~e,n!==0&&(c=Gt(n))))):(R=r&~f,R!==0?c=Gt(R):b!==0?c=Gt(b):n||(n=r&~e,n!==0&&(c=Gt(n)))),c===0?0:t!==0&&t!==c&&(t&f)===0&&(f=c&-c,n=t&-t,f>=n||f===32&&(n&4194048)!==0)?t:c}function Te(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qe(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 ct(){var e=sl;return sl<<=1,(sl&62914560)===0&&(sl=4194304),e}function Ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Bt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function oa(e,t,n,r,c,f){var b=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var R=e.entanglements,k=e.expirationTimes,G=e.hiddenUpdates;for(n=b&~n;0<n;){var J=31-Et(n),te=1<<J;R[J]=0,k[J]=-1;var Y=G[J];if(Y!==null)for(G[J]=null,J=0;J<Y.length;J++){var F=Y[J];F!==null&&(F.lane&=-536870913)}n&=~te}r!==0&&ia(e,r,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function ia(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Wt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Et(n),c=1<<r;c&t|e[r]&t&&(e[r]|=t),n&=~c}}function Jn(e,t){var n=t&-t;return n=(n&42)!==0?1:au(n),(n&(e.suspendedLanes|t))!==0?0:n}function au(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 lu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rm(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:dx(e.type))}function Nm(e,t){var n=$.p;try{return $.p=e,t()}finally{$.p=n}}var ol=Math.random().toString(36).slice(2),Ht="__reactFiber$"+ol,en="__reactProps$"+ol,jr="__reactContainer$"+ol,ru="__reactEvents$"+ol,G1="__reactListeners$"+ol,Y1="__reactHandles$"+ol,Tm="__reactResources$"+ol,Ns="__reactMarker$"+ol;function su(e){delete e[Ht],delete e[en],delete e[ru],delete e[G1],delete e[Y1]}function Cr(e){var t=e[Ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[jr]||n[Ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Fv(e);e!==null;){if(n=e[Ht])return n;e=Fv(e)}return t}e=n,n=e.parentNode}return null}function Er(e){if(e=e[Ht]||e[jr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ts(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Rr(e){var t=e[Tm];return t||(t=e[Tm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function kt(e){e[Ns]=!0}var Am=new Set,Mm={};function Yl(e,t){Nr(e,t),Nr(e+"Capture",t)}function Nr(e,t){for(Mm[e]=t,e=0;e<t.length;e++)Am.add(t[e])}var $1=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]*$"),Dm={},Om={};function K1(e){return St.call(Om,e)?!0:St.call(Dm,e)?!1:$1.test(e)?Om[e]=!0:(Dm[e]=!0,!1)}function Io(e,t,n){if(K1(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Vo(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Na(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function Dn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _m(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function X1(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(b){n=""+b,f.call(this,b)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(b){n=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ou(e){if(!e._valueTracker){var t=_m(e)?"checked":"value";e._valueTracker=X1(e,t,""+e[t])}}function km(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_m(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Go(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 F1=/[\n"\\]/g;function On(e){return e.replace(F1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function iu(e,t,n,r,c,f,b,R){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Dn(t)):e.value!==""+Dn(t)&&(e.value=""+Dn(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?cu(e,b,Dn(t)):n!=null?cu(e,b,Dn(n)):r!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+Dn(R):e.removeAttribute("name")}function zm(e,t,n,r,c,f,b,R){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||n!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){ou(e);return}n=n!=null?""+Dn(n):"",t=t!=null?""+Dn(t):n,R||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=R?e.checked:!!r,e.defaultChecked=!!r,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),ou(e)}function cu(e,t,n){t==="number"&&Go(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Tr(e,t,n,r){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Dn(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Lm(e,t,n){if(t!=null&&(t=""+Dn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Dn(n):""}function Um(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(oe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=Dn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),ou(e)}function Ar(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Q1=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 Bm(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Q1.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Hm(e,t,n){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&n[c]!==r&&Bm(e,c,r)}else for(var f in t)t.hasOwnProperty(f)&&Bm(e,f,t[f])}function uu(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 Z1=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"]]),J1=/^[\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 Yo(e){return J1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ta(){}var du=null;function fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mr=null,Dr=null;function Pm(e){var t=Er(e);if(t&&(e=t.stateNode)){var n=e[en]||null;e:switch(e=t.stateNode,t.type){case"input":if(iu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+On(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var c=r[en]||null;if(!c)throw Error(i(90));iu(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&km(r)}break e;case"textarea":Lm(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Tr(e,!!n.multiple,t,!1)}}}var hu=!1;function qm(e,t,n){if(hu)return e(t,n);hu=!0;try{var r=e(t);return r}finally{if(hu=!1,(Mr!==null||Dr!==null)&&(Oi(),Mr&&(t=Mr,e=Dr,Dr=Mr=null,Pm(t),e)))for(t=0;t<e.length;t++)Pm(e[t])}}function As(e,t){var n=e.stateNode;if(n===null)return null;var r=n[en]||null;if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(i(231,t,typeof n));return n}var Aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mu=!1;if(Aa)try{var Ms={};Object.defineProperty(Ms,"passive",{get:function(){mu=!0}}),window.addEventListener("test",Ms,Ms),window.removeEventListener("test",Ms,Ms)}catch{mu=!1}var il=null,pu=null,$o=null;function Im(){if($o)return $o;var e,t=pu,n=t.length,r,c="value"in il?il.value:il.textContent,f=c.length;for(e=0;e<n&&t[e]===c[e];e++);var b=n-e;for(r=1;r<=b&&t[n-r]===c[f-r];r++);return $o=c.slice(e,1<r?1-r:void 0)}function Ko(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 Xo(){return!0}function Vm(){return!1}function tn(e){function t(n,r,c,f,b){this._reactName=n,this._targetInst=c,this.type=r,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(n=e[R],this[R]=n?n(f):f[R]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Xo:Vm,this.isPropagationStopped=Vm,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Xo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xo)},persist:function(){},isPersistent:Xo}),t}var $l={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fo=tn($l),Ds=y({},$l,{view:0,detail:0}),W1=tn(Ds),gu,vu,Os,Qo=y({},Ds,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yu,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!==Os&&(Os&&e.type==="mousemove"?(gu=e.screenX-Os.screenX,vu=e.screenY-Os.screenY):vu=gu=0,Os=e),gu)},movementY:function(e){return"movementY"in e?e.movementY:vu}}),Gm=tn(Qo),eS=y({},Qo,{dataTransfer:0}),tS=tn(eS),nS=y({},Ds,{relatedTarget:0}),xu=tn(nS),aS=y({},$l,{animationName:0,elapsedTime:0,pseudoElement:0}),lS=tn(aS),rS=y({},$l,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sS=tn(rS),oS=y({},$l,{data:0}),Ym=tn(oS),iS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cS={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"},uS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uS[e])?!!t[e]:!1}function yu(){return dS}var fS=y({},Ds,{key:function(e){if(e.key){var t=iS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ko(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yu,charCode:function(e){return e.type==="keypress"?Ko(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ko(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hS=tn(fS),mS=y({},Qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$m=tn(mS),pS=y({},Ds,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yu}),gS=tn(pS),vS=y({},$l,{propertyName:0,elapsedTime:0,pseudoElement:0}),xS=tn(vS),yS=y({},Qo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),bS=tn(yS),SS=y({},$l,{newState:0,oldState:0}),wS=tn(SS),jS=[9,13,27,32],bu=Aa&&"CompositionEvent"in window,_s=null;Aa&&"documentMode"in document&&(_s=document.documentMode);var CS=Aa&&"TextEvent"in window&&!_s,Km=Aa&&(!bu||_s&&8<_s&&11>=_s),Xm=" ",Fm=!1;function Qm(e,t){switch(e){case"keyup":return jS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Or=!1;function ES(e,t){switch(e){case"compositionend":return Zm(t);case"keypress":return t.which!==32?null:(Fm=!0,Xm);case"textInput":return e=t.data,e===Xm&&Fm?null:e;default:return null}}function RS(e,t){if(Or)return e==="compositionend"||!bu&&Qm(e,t)?(e=Im(),$o=pu=il=null,Or=!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 Km&&t.locale!=="ko"?null:t.data;default:return null}}var NS={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 Jm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!NS[e.type]:t==="textarea"}function Wm(e,t,n,r){Mr?Dr?Dr.push(r):Dr=[r]:Mr=r,t=Hi(t,"onChange"),0<t.length&&(n=new Fo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ks=null,zs=null;function TS(e){zv(e,0)}function Zo(e){var t=Ts(e);if(km(t))return e}function ep(e,t){if(e==="change")return t}var tp=!1;if(Aa){var Su;if(Aa){var wu="oninput"in document;if(!wu){var np=document.createElement("div");np.setAttribute("oninput","return;"),wu=typeof np.oninput=="function"}Su=wu}else Su=!1;tp=Su&&(!document.documentMode||9<document.documentMode)}function ap(){ks&&(ks.detachEvent("onpropertychange",lp),zs=ks=null)}function lp(e){if(e.propertyName==="value"&&Zo(zs)){var t=[];Wm(t,zs,e,fu(e)),qm(TS,t)}}function AS(e,t,n){e==="focusin"?(ap(),ks=t,zs=n,ks.attachEvent("onpropertychange",lp)):e==="focusout"&&ap()}function MS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zo(zs)}function DS(e,t){if(e==="click")return Zo(t)}function OS(e,t){if(e==="input"||e==="change")return Zo(t)}function _S(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gn=typeof Object.is=="function"?Object.is:_S;function Ls(e,t){if(gn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var c=n[r];if(!St.call(t,c)||!gn(e[c],t[c]))return!1}return!0}function rp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sp(e,t){var n=rp(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=rp(n)}}function op(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?op(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ip(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Go(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Go(e.document)}return t}function ju(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 kS=Aa&&"documentMode"in document&&11>=document.documentMode,_r=null,Cu=null,Us=null,Eu=!1;function cp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Eu||_r==null||_r!==Go(r)||(r=_r,"selectionStart"in r&&ju(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Us&&Ls(Us,r)||(Us=r,r=Hi(Cu,"onSelect"),0<r.length&&(t=new Fo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=_r)))}function Kl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var kr={animationend:Kl("Animation","AnimationEnd"),animationiteration:Kl("Animation","AnimationIteration"),animationstart:Kl("Animation","AnimationStart"),transitionrun:Kl("Transition","TransitionRun"),transitionstart:Kl("Transition","TransitionStart"),transitioncancel:Kl("Transition","TransitionCancel"),transitionend:Kl("Transition","TransitionEnd")},Ru={},up={};Aa&&(up=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);function Xl(e){if(Ru[e])return Ru[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in up)return Ru[e]=t[n];return e}var dp=Xl("animationend"),fp=Xl("animationiteration"),hp=Xl("animationstart"),zS=Xl("transitionrun"),LS=Xl("transitionstart"),US=Xl("transitioncancel"),mp=Xl("transitionend"),pp=new Map,Nu="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(" ");Nu.push("scrollEnd");function Wn(e,t){pp.set(e,t),Yl(t,[e])}var Jo=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)},_n=[],zr=0,Tu=0;function Wo(){for(var e=zr,t=Tu=zr=0;t<e;){var n=_n[t];_n[t++]=null;var r=_n[t];_n[t++]=null;var c=_n[t];_n[t++]=null;var f=_n[t];if(_n[t++]=null,r!==null&&c!==null){var b=r.pending;b===null?c.next=c:(c.next=b.next,b.next=c),r.pending=c}f!==0&&gp(n,c,f)}}function ei(e,t,n,r){_n[zr++]=e,_n[zr++]=t,_n[zr++]=n,_n[zr++]=r,Tu|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Au(e,t,n,r){return ei(e,t,n,r),ti(e)}function Fl(e,t){return ei(e,null,null,t),ti(e)}function gp(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var c=!1,f=e.return;f!==null;)f.childLanes|=n,r=f.alternate,r!==null&&(r.childLanes|=n),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&t!==null&&(c=31-Et(n),e=f.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=n|536870912),f):null}function ti(e){if(50<ro)throw ro=0,Bd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Lr={};function BS(e,t,n,r){this.tag=e,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vn(e,t,n,r){return new BS(e,t,n,r)}function Mu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ma(e,t){var n=e.alternate;return n===null?(n=vn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function vp(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ni(e,t,n,r,c,f){var b=0;if(r=e,typeof e=="function")Mu(e)&&(b=1);else if(typeof e=="string")b=Vw(e,n,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K:return e=vn(31,n,t,c),e.elementType=K,e.lanes=f,e;case E:return Ql(n.children,c,f,t);case j:b=8,c|=24;break;case N:return e=vn(12,n,t,c|2),e.elementType=N,e.lanes=f,e;case _:return e=vn(13,n,t,c),e.elementType=_,e.lanes=f,e;case M:return e=vn(19,n,t,c),e.elementType=M,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:b=10;break e;case A:b=9;break e;case O:b=11;break e;case H:b=14;break e;case z:b=16,r=null;break e}b=29,n=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=vn(b,n,t,c),t.elementType=e,t.type=r,t.lanes=f,t}function Ql(e,t,n,r){return e=vn(7,e,r,t),e.lanes=n,e}function Du(e,t,n){return e=vn(6,e,null,t),e.lanes=n,e}function xp(e){var t=vn(18,null,null,0);return t.stateNode=e,t}function Ou(e,t,n){return t=vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yp=new WeakMap;function kn(e,t){if(typeof e=="object"&&e!==null){var n=yp.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Fe(t)},yp.set(e,t),t)}return{value:e,source:t,stack:Fe(t)}}var Ur=[],Br=0,ai=null,Bs=0,zn=[],Ln=0,cl=null,ca=1,ua="";function Da(e,t){Ur[Br++]=Bs,Ur[Br++]=ai,ai=e,Bs=t}function bp(e,t,n){zn[Ln++]=ca,zn[Ln++]=ua,zn[Ln++]=cl,cl=e;var r=ca;e=ua;var c=32-Et(r)-1;r&=~(1<<c),n+=1;var f=32-Et(t)+c;if(30<f){var b=c-c%5;f=(r&(1<<b)-1).toString(32),r>>=b,c-=b,ca=1<<32-Et(t)+c|n<<c|r,ua=f+e}else ca=1<<f|n<<c|r,ua=e}function _u(e){e.return!==null&&(Da(e,1),bp(e,1,0))}function ku(e){for(;e===ai;)ai=Ur[--Br],Ur[Br]=null,Bs=Ur[--Br],Ur[Br]=null;for(;e===cl;)cl=zn[--Ln],zn[Ln]=null,ua=zn[--Ln],zn[Ln]=null,ca=zn[--Ln],zn[Ln]=null}function Sp(e,t){zn[Ln++]=ca,zn[Ln++]=ua,zn[Ln++]=cl,ca=t.id,ua=t.overflow,cl=e}var Pt=null,ft=null,Ve=!1,ul=null,Un=!1,zu=Error(i(519));function dl(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hs(kn(t,e)),zu}function wp(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ht]=e,t[en]=r,n){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(n=0;n<oo.length;n++)He(oo[n],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),zm(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),Um(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||Hv(t.textContent,n)?(r.popover!=null&&(He("beforetoggle",t),He("toggle",t)),r.onScroll!=null&&He("scroll",t),r.onScrollEnd!=null&&He("scrollend",t),r.onClick!=null&&(t.onclick=Ta),t=!0):t=!1,t||dl(e,!0)}function jp(e){for(Pt=e.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:Un=!1;return;case 27:case 3:Un=!0;return;default:Pt=Pt.return}}function Hr(e){if(e!==Pt)return!1;if(!Ve)return jp(e),Ve=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Wd(e.type,e.memoizedProps)),n=!n),n&&ft&&dl(e),jp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ft=Xv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ft=Xv(e)}else t===27?(t=ft,El(e.type)?(e=lf,lf=null,ft=e):ft=t):ft=Pt?Hn(e.stateNode.nextSibling):null;return!0}function Zl(){ft=Pt=null,Ve=!1}function Lu(){var e=ul;return e!==null&&(rn===null?rn=e:rn.push.apply(rn,e),ul=null),e}function Hs(e){ul===null?ul=[e]:ul.push(e)}var Uu=D(null),Jl=null,Oa=null;function fl(e,t,n){Q(Uu,t._currentValue),t._currentValue=n}function _a(e){e._currentValue=Uu.current,q(Uu)}function Bu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Hu(e,t,n,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var b=c.child;f=f.firstContext;e:for(;f!==null;){var R=f;f=c;for(var k=0;k<t.length;k++)if(R.context===t[k]){f.lanes|=n,R=f.alternate,R!==null&&(R.lanes|=n),Bu(f.return,n,e),r||(b=null);break e}f=R.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(i(341));b.lanes|=n,f=b.alternate,f!==null&&(f.lanes|=n),Bu(b,n,e),b=null}else b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}function Pr(e,t,n,r){e=null;for(var c=t,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var b=c.alternate;if(b===null)throw Error(i(387));if(b=b.memoizedProps,b!==null){var R=c.type;gn(c.pendingProps.value,b.value)||(e!==null?e.push(R):e=[R])}}else if(c===ue.current){if(b=c.alternate,b===null)throw Error(i(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ho):e=[ho])}c=c.return}e!==null&&Hu(t,e,n,r),t.flags|=262144}function li(e){for(e=e.firstContext;e!==null;){if(!gn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wl(e){Jl=e,Oa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qt(e){return Cp(Jl,e)}function ri(e,t){return Jl===null&&Wl(e),Cp(e,t)}function Cp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Oa===null){if(e===null)throw Error(i(308));Oa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Oa=Oa.next=t;return n}var HS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},PS=a.unstable_scheduleCallback,qS=a.unstable_NormalPriority,Rt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pu(){return{controller:new HS,data:new Map,refCount:0}}function Ps(e){e.refCount--,e.refCount===0&&PS(qS,function(){e.controller.abort()})}var qs=null,qu=0,qr=0,Ir=null;function IS(e,t){if(qs===null){var n=qs=[];qu=0,qr=Gd(),Ir={status:"pending",value:void 0,then:function(r){n.push(r)}}}return qu++,t.then(Ep,Ep),t}function Ep(){if(--qu===0&&qs!==null){Ir!==null&&(Ir.status="fulfilled");var e=qs;qs=null,qr=0,Ir=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function VS(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),r}var Rp=U.S;U.S=function(e,t){cv=Kt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&IS(e,t),Rp!==null&&Rp(e,t)};var er=D(null);function Iu(){var e=er.current;return e!==null?e:ut.pooledCache}function si(e,t){t===null?Q(er,er.current):Q(er,t.pool)}function Np(){var e=Iu();return e===null?null:{parent:Rt._currentValue,pool:e}}var Vr=Error(i(460)),Vu=Error(i(474)),oi=Error(i(542)),ii={then:function(){}};function Tp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ap(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ta,Ta),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Dp(e),e;default:if(typeof t.status=="string")t.then(Ta,Ta);else{if(e=ut,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Dp(e),e}throw nr=t,Vr}}function tr(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(nr=n,Vr):n}}var nr=null;function Mp(){if(nr===null)throw Error(i(459));var e=nr;return nr=null,e}function Dp(e){if(e===Vr||e===oi)throw Error(i(483))}var Gr=null,Is=0;function ci(e){var t=Is;return Is+=1,Gr===null&&(Gr=[]),Ap(Gr,e,t)}function Vs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ui(e,t){throw t.$$typeof===S?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Op(e){function t(P,L){if(e){var V=P.deletions;V===null?(P.deletions=[L],P.flags|=16):V.push(L)}}function n(P,L){if(!e)return null;for(;L!==null;)t(P,L),L=L.sibling;return null}function r(P){for(var L=new Map;P!==null;)P.key!==null?L.set(P.key,P):L.set(P.index,P),P=P.sibling;return L}function c(P,L){return P=Ma(P,L),P.index=0,P.sibling=null,P}function f(P,L,V){return P.index=V,e?(V=P.alternate,V!==null?(V=V.index,V<L?(P.flags|=67108866,L):V):(P.flags|=67108866,L)):(P.flags|=1048576,L)}function b(P){return e&&P.alternate===null&&(P.flags|=67108866),P}function R(P,L,V,ee){return L===null||L.tag!==6?(L=Du(V,P.mode,ee),L.return=P,L):(L=c(L,V),L.return=P,L)}function k(P,L,V,ee){var we=V.type;return we===E?J(P,L,V.props.children,ee,V.key):L!==null&&(L.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===z&&tr(we)===L.type)?(L=c(L,V.props),Vs(L,V),L.return=P,L):(L=ni(V.type,V.key,V.props,null,P.mode,ee),Vs(L,V),L.return=P,L)}function G(P,L,V,ee){return L===null||L.tag!==4||L.stateNode.containerInfo!==V.containerInfo||L.stateNode.implementation!==V.implementation?(L=Ou(V,P.mode,ee),L.return=P,L):(L=c(L,V.children||[]),L.return=P,L)}function J(P,L,V,ee,we){return L===null||L.tag!==7?(L=Ql(V,P.mode,ee,we),L.return=P,L):(L=c(L,V),L.return=P,L)}function te(P,L,V){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Du(""+L,P.mode,V),L.return=P,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case w:return V=ni(L.type,L.key,L.props,null,P.mode,V),Vs(V,L),V.return=P,V;case C:return L=Ou(L,P.mode,V),L.return=P,L;case z:return L=tr(L),te(P,L,V)}if(oe(L)||I(L))return L=Ql(L,P.mode,V,null),L.return=P,L;if(typeof L.then=="function")return te(P,ci(L),V);if(L.$$typeof===T)return te(P,ri(P,L),V);ui(P,L)}return null}function Y(P,L,V,ee){var we=L!==null?L.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return we!==null?null:R(P,L,""+V,ee);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case w:return V.key===we?k(P,L,V,ee):null;case C:return V.key===we?G(P,L,V,ee):null;case z:return V=tr(V),Y(P,L,V,ee)}if(oe(V)||I(V))return we!==null?null:J(P,L,V,ee,null);if(typeof V.then=="function")return Y(P,L,ci(V),ee);if(V.$$typeof===T)return Y(P,L,ri(P,V),ee);ui(P,V)}return null}function F(P,L,V,ee,we){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return P=P.get(V)||null,R(L,P,""+ee,we);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case w:return P=P.get(ee.key===null?V:ee.key)||null,k(L,P,ee,we);case C:return P=P.get(ee.key===null?V:ee.key)||null,G(L,P,ee,we);case z:return ee=tr(ee),F(P,L,V,ee,we)}if(oe(ee)||I(ee))return P=P.get(V)||null,J(L,P,ee,we,null);if(typeof ee.then=="function")return F(P,L,V,ci(ee),we);if(ee.$$typeof===T)return F(P,L,V,ri(L,ee),we);ui(L,ee)}return null}function ge(P,L,V,ee){for(var we=null,Ye=null,ye=L,ke=L=0,Ie=null;ye!==null&&ke<V.length;ke++){ye.index>ke?(Ie=ye,ye=null):Ie=ye.sibling;var $e=Y(P,ye,V[ke],ee);if($e===null){ye===null&&(ye=Ie);break}e&&ye&&$e.alternate===null&&t(P,ye),L=f($e,L,ke),Ye===null?we=$e:Ye.sibling=$e,Ye=$e,ye=Ie}if(ke===V.length)return n(P,ye),Ve&&Da(P,ke),we;if(ye===null){for(;ke<V.length;ke++)ye=te(P,V[ke],ee),ye!==null&&(L=f(ye,L,ke),Ye===null?we=ye:Ye.sibling=ye,Ye=ye);return Ve&&Da(P,ke),we}for(ye=r(ye);ke<V.length;ke++)Ie=F(ye,P,ke,V[ke],ee),Ie!==null&&(e&&Ie.alternate!==null&&ye.delete(Ie.key===null?ke:Ie.key),L=f(Ie,L,ke),Ye===null?we=Ie:Ye.sibling=Ie,Ye=Ie);return e&&ye.forEach(function(Ml){return t(P,Ml)}),Ve&&Da(P,ke),we}function Re(P,L,V,ee){if(V==null)throw Error(i(151));for(var we=null,Ye=null,ye=L,ke=L=0,Ie=null,$e=V.next();ye!==null&&!$e.done;ke++,$e=V.next()){ye.index>ke?(Ie=ye,ye=null):Ie=ye.sibling;var Ml=Y(P,ye,$e.value,ee);if(Ml===null){ye===null&&(ye=Ie);break}e&&ye&&Ml.alternate===null&&t(P,ye),L=f(Ml,L,ke),Ye===null?we=Ml:Ye.sibling=Ml,Ye=Ml,ye=Ie}if($e.done)return n(P,ye),Ve&&Da(P,ke),we;if(ye===null){for(;!$e.done;ke++,$e=V.next())$e=te(P,$e.value,ee),$e!==null&&(L=f($e,L,ke),Ye===null?we=$e:Ye.sibling=$e,Ye=$e);return Ve&&Da(P,ke),we}for(ye=r(ye);!$e.done;ke++,$e=V.next())$e=F(ye,P,ke,$e.value,ee),$e!==null&&(e&&$e.alternate!==null&&ye.delete($e.key===null?ke:$e.key),L=f($e,L,ke),Ye===null?we=$e:Ye.sibling=$e,Ye=$e);return e&&ye.forEach(function(ej){return t(P,ej)}),Ve&&Da(P,ke),we}function st(P,L,V,ee){if(typeof V=="object"&&V!==null&&V.type===E&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case w:e:{for(var we=V.key;L!==null;){if(L.key===we){if(we=V.type,we===E){if(L.tag===7){n(P,L.sibling),ee=c(L,V.props.children),ee.return=P,P=ee;break e}}else if(L.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===z&&tr(we)===L.type){n(P,L.sibling),ee=c(L,V.props),Vs(ee,V),ee.return=P,P=ee;break e}n(P,L);break}else t(P,L);L=L.sibling}V.type===E?(ee=Ql(V.props.children,P.mode,ee,V.key),ee.return=P,P=ee):(ee=ni(V.type,V.key,V.props,null,P.mode,ee),Vs(ee,V),ee.return=P,P=ee)}return b(P);case C:e:{for(we=V.key;L!==null;){if(L.key===we)if(L.tag===4&&L.stateNode.containerInfo===V.containerInfo&&L.stateNode.implementation===V.implementation){n(P,L.sibling),ee=c(L,V.children||[]),ee.return=P,P=ee;break e}else{n(P,L);break}else t(P,L);L=L.sibling}ee=Ou(V,P.mode,ee),ee.return=P,P=ee}return b(P);case z:return V=tr(V),st(P,L,V,ee)}if(oe(V))return ge(P,L,V,ee);if(I(V)){if(we=I(V),typeof we!="function")throw Error(i(150));return V=we.call(V),Re(P,L,V,ee)}if(typeof V.then=="function")return st(P,L,ci(V),ee);if(V.$$typeof===T)return st(P,L,ri(P,V),ee);ui(P,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,L!==null&&L.tag===6?(n(P,L.sibling),ee=c(L,V),ee.return=P,P=ee):(n(P,L),ee=Du(V,P.mode,ee),ee.return=P,P=ee),b(P)):n(P,L)}return function(P,L,V,ee){try{Is=0;var we=st(P,L,V,ee);return Gr=null,we}catch(ye){if(ye===Vr||ye===oi)throw ye;var Ye=vn(29,ye,null,P.mode);return Ye.lanes=ee,Ye.return=P,Ye}finally{}}}var ar=Op(!0),_p=Op(!1),hl=!1;function Gu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yu(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 ml(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pl(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Xe&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=ti(e),gp(e,null,n),t}return ei(e,r,t,n),ti(e)}function Gs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wt(e,n)}}function $u(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var c=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var b={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?c=f=b:f=f.next=b,n=n.next}while(n!==null);f===null?c=f=t:f=f.next=t}else c=f=t;n={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ku=!1;function Ys(){if(Ku){var e=Ir;if(e!==null)throw e}}function $s(e,t,n,r){Ku=!1;var c=e.updateQueue;hl=!1;var f=c.firstBaseUpdate,b=c.lastBaseUpdate,R=c.shared.pending;if(R!==null){c.shared.pending=null;var k=R,G=k.next;k.next=null,b===null?f=G:b.next=G,b=k;var J=e.alternate;J!==null&&(J=J.updateQueue,R=J.lastBaseUpdate,R!==b&&(R===null?J.firstBaseUpdate=G:R.next=G,J.lastBaseUpdate=k))}if(f!==null){var te=c.baseState;b=0,J=G=k=null,R=f;do{var Y=R.lane&-536870913,F=Y!==R.lane;if(F?(qe&Y)===Y:(r&Y)===Y){Y!==0&&Y===qr&&(Ku=!0),J!==null&&(J=J.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var ge=e,Re=R;Y=t;var st=n;switch(Re.tag){case 1:if(ge=Re.payload,typeof ge=="function"){te=ge.call(st,te,Y);break e}te=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Re.payload,Y=typeof ge=="function"?ge.call(st,te,Y):ge,Y==null)break e;te=y({},te,Y);break e;case 2:hl=!0}}Y=R.callback,Y!==null&&(e.flags|=64,F&&(e.flags|=8192),F=c.callbacks,F===null?c.callbacks=[Y]:F.push(Y))}else F={lane:Y,tag:R.tag,payload:R.payload,callback:R.callback,next:null},J===null?(G=J=F,k=te):J=J.next=F,b|=Y;if(R=R.next,R===null){if(R=c.shared.pending,R===null)break;F=R,R=F.next,F.next=null,c.lastBaseUpdate=F,c.shared.pending=null}}while(!0);J===null&&(k=te),c.baseState=k,c.firstBaseUpdate=G,c.lastBaseUpdate=J,f===null&&(c.shared.lanes=0),bl|=b,e.lanes=b,e.memoizedState=te}}function kp(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function zp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)kp(n[e],t)}var Yr=D(null),di=D(0);function Lp(e,t){e=Ia,Q(di,e),Q(Yr,t),Ia=e|t.baseLanes}function Xu(){Q(di,Ia),Q(Yr,Yr.current)}function Fu(){Ia=di.current,q(Yr),q(di)}var xn=D(null),Bn=null;function gl(e){var t=e.alternate;Q(wt,wt.current&1),Q(xn,e),Bn===null&&(t===null||Yr.current!==null||t.memoizedState!==null)&&(Bn=e)}function Qu(e){Q(wt,wt.current),Q(xn,e),Bn===null&&(Bn=e)}function Up(e){e.tag===22?(Q(wt,wt.current),Q(xn,e),Bn===null&&(Bn=e)):vl()}function vl(){Q(wt,wt.current),Q(xn,xn.current)}function yn(e){q(xn),Bn===e&&(Bn=null),q(wt)}var wt=D(0);function fi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||nf(n)||af(n)))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 ka=0,_e=null,lt=null,Nt=null,hi=!1,$r=!1,lr=!1,mi=0,Ks=0,Kr=null,GS=0;function yt(){throw Error(i(321))}function Zu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gn(e[n],t[n]))return!1;return!0}function Ju(e,t,n,r,c,f){return ka=f,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?bg:hd,lr=!1,f=n(r,c),lr=!1,$r&&(f=Hp(t,n,r,c)),Bp(e),f}function Bp(e){U.H=Qs;var t=lt!==null&<.next!==null;if(ka=0,Nt=lt=_e=null,hi=!1,Ks=0,Kr=null,t)throw Error(i(300));e===null||Tt||(e=e.dependencies,e!==null&&li(e)&&(Tt=!0))}function Hp(e,t,n,r){_e=e;var c=0;do{if($r&&(Kr=null),Ks=0,$r=!1,25<=c)throw Error(i(301));if(c+=1,Nt=lt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}U.H=Sg,f=t(n,r)}while($r);return f}function YS(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Xs(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(_e.flags|=1024),t}function Wu(){var e=mi!==0;return mi=0,e}function ed(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function td(e){if(hi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hi=!1}ka=0,Nt=lt=_e=null,$r=!1,Ks=mi=0,Kr=null}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?_e.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function jt(){if(lt===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=Nt===null?_e.memoizedState:Nt.next;if(t!==null)Nt=t,lt=e;else{if(e===null)throw _e.alternate===null?Error(i(467)):Error(i(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Nt===null?_e.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function pi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xs(e){var t=Ks;return Ks+=1,Kr===null&&(Kr=[]),e=Ap(Kr,e,t),t=_e,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?bg:hd),e}function gi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Xs(e);if(e.$$typeof===T)return qt(e)}throw Error(i(438,String(e)))}function nd(e){var t=null,n=_e.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=_e.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=pi(),_e.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=se;return t.index++,n}function za(e,t){return typeof t=="function"?t(e):t}function vi(e){var t=jt();return ad(t,lt,e)}function ad(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var c=e.baseQueue,f=r.pending;if(f!==null){if(c!==null){var b=c.next;c.next=f.next,f.next=b}t.baseQueue=c=f,r.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{t=c.next;var R=b=null,k=null,G=t,J=!1;do{var te=G.lane&-536870913;if(te!==G.lane?(qe&te)===te:(ka&te)===te){var Y=G.revertLane;if(Y===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),te===qr&&(J=!0);else if((ka&Y)===Y){G=G.next,Y===qr&&(J=!0);continue}else te={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},k===null?(R=k=te,b=f):k=k.next=te,_e.lanes|=Y,bl|=Y;te=G.action,lr&&n(f,te),f=G.hasEagerState?G.eagerState:n(f,te)}else Y={lane:te,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},k===null?(R=k=Y,b=f):k=k.next=Y,_e.lanes|=te,bl|=te;G=G.next}while(G!==null&&G!==t);if(k===null?b=f:k.next=R,!gn(f,e.memoizedState)&&(Tt=!0,J&&(n=Ir,n!==null)))throw n;e.memoizedState=f,e.baseState=b,e.baseQueue=k,r.lastRenderedState=f}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ld(e){var t=jt(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,c=n.pending,f=t.memoizedState;if(c!==null){n.pending=null;var b=c=c.next;do f=e(f,b.action),b=b.next;while(b!==c);gn(f,t.memoizedState)||(Tt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,r]}function Pp(e,t,n){var r=_e,c=jt(),f=Ve;if(f){if(n===void 0)throw Error(i(407));n=n()}else n=t();var b=!gn((lt||c).memoizedState,n);if(b&&(c.memoizedState=n,Tt=!0),c=c.queue,od(Vp.bind(null,r,c,e),[e]),c.getSnapshot!==t||b||Nt!==null&&Nt.memoizedState.tag&1){if(r.flags|=2048,Xr(9,{destroy:void 0},Ip.bind(null,r,c,n,t),null),ut===null)throw Error(i(349));f||(ka&127)!==0||qp(r,t,n)}return n}function qp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=_e.updateQueue,t===null?(t=pi(),_e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ip(e,t,n,r){t.value=n,t.getSnapshot=r,Gp(t)&&Yp(e)}function Vp(e,t,n){return n(function(){Gp(t)&&Yp(e)})}function Gp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gn(e,n)}catch{return!0}}function Yp(e){var t=Fl(e,2);t!==null&&sn(t,e,2)}function rd(e){var t=Qt();if(typeof e=="function"){var n=e;if(e=n(),lr){Zn(!0);try{n()}finally{Zn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:e},t}function $p(e,t,n,r){return e.baseState=n,ad(e,lt,typeof r=="function"?r:za)}function $S(e,t,n,r,c){if(bi(e))throw Error(i(485));if(e=t.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){f.listeners.push(b)}};U.T!==null?n(!0):f.isTransition=!1,r(f),n=t.pending,n===null?(f.next=t.pending=f,Kp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Kp(e,t){var n=t.action,r=t.payload,c=e.state;if(t.isTransition){var f=U.T,b={};U.T=b;try{var R=n(c,r),k=U.S;k!==null&&k(b,R),Xp(e,t,R)}catch(G){sd(e,t,G)}finally{f!==null&&b.types!==null&&(f.types=b.types),U.T=f}}else try{f=n(c,r),Xp(e,t,f)}catch(G){sd(e,t,G)}}function Xp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){Fp(e,t,r)},function(r){return sd(e,t,r)}):Fp(e,t,n)}function Fp(e,t,n){t.status="fulfilled",t.value=n,Qp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Kp(e,n)))}function sd(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,Qp(t),t=t.next;while(t!==r)}e.action=null}function Qp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zp(e,t){return t}function Jp(e,t){if(Ve){var n=ut.formState;if(n!==null){e:{var r=_e;if(Ve){if(ft){t:{for(var c=ft,f=Un;c.nodeType!==8;){if(!f){c=null;break t}if(c=Hn(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){ft=Hn(c.nextSibling),r=c.data==="F!";break e}}dl(r)}r=!1}r&&(t=n[0])}}return n=Qt(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zp,lastRenderedState:t},n.queue=r,n=vg.bind(null,_e,r),r.dispatch=n,r=rd(!1),f=fd.bind(null,_e,!1,r.queue),r=Qt(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,n=$S.bind(null,_e,c,f,n),c.dispatch=n,r.memoizedState=e,[t,n,!1]}function Wp(e){var t=jt();return eg(t,lt,e)}function eg(e,t,n){if(t=ad(e,t,Zp)[0],e=vi(za)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Xs(t)}catch(b){throw b===Vr?oi:b}else r=t;t=jt();var c=t.queue,f=c.dispatch;return n!==t.memoizedState&&(_e.flags|=2048,Xr(9,{destroy:void 0},KS.bind(null,c,n),null)),[r,f,e]}function KS(e,t){e.action=t}function tg(e){var t=jt(),n=lt;if(n!==null)return eg(t,n,e);jt(),t=t.memoizedState,n=jt();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Xr(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=_e.updateQueue,t===null&&(t=pi(),_e.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ng(){return jt().memoizedState}function xi(e,t,n,r){var c=Qt();_e.flags|=e,c.memoizedState=Xr(1|t,{destroy:void 0},n,r===void 0?null:r)}function yi(e,t,n,r){var c=jt();r=r===void 0?null:r;var f=c.memoizedState.inst;lt!==null&&r!==null&&Zu(r,lt.memoizedState.deps)?c.memoizedState=Xr(t,f,n,r):(_e.flags|=e,c.memoizedState=Xr(1|t,f,n,r))}function ag(e,t){xi(8390656,8,e,t)}function od(e,t){yi(2048,8,e,t)}function XS(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=pi(),_e.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function lg(e){var t=jt().memoizedState;return XS({ref:t,nextImpl:e}),function(){if((Xe&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function rg(e,t){return yi(4,2,e,t)}function sg(e,t){return yi(4,4,e,t)}function og(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ig(e,t,n){n=n!=null?n.concat([e]):null,yi(4,4,og.bind(null,t,e),n)}function id(){}function cg(e,t){var n=jt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ug(e,t){var n=jt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zu(t,r[1]))return r[0];if(r=e(),lr){Zn(!0);try{e()}finally{Zn(!1)}}return n.memoizedState=[r,t],r}function cd(e,t,n){return n===void 0||(ka&1073741824)!==0&&(qe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=dv(),_e.lanes|=e,bl|=e,n)}function dg(e,t,n,r){return gn(n,t)?n:Yr.current!==null?(e=cd(e,n,r),gn(e,t)||(Tt=!0),e):(ka&42)===0||(ka&1073741824)!==0&&(qe&261930)===0?(Tt=!0,e.memoizedState=n):(e=dv(),_e.lanes|=e,bl|=e,t)}function fg(e,t,n,r,c){var f=$.p;$.p=f!==0&&8>f?f:8;var b=U.T,R={};U.T=R,fd(e,!1,t,n);try{var k=c(),G=U.S;if(G!==null&&G(R,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var J=VS(k,r);Fs(e,t,J,wn(e))}else Fs(e,t,r,wn(e))}catch(te){Fs(e,t,{then:function(){},status:"rejected",reason:te},wn())}finally{$.p=f,b!==null&&R.types!==null&&(b.types=R.types),U.T=b}}function FS(){}function ud(e,t,n,r){if(e.tag!==5)throw Error(i(476));var c=hg(e).queue;fg(e,c,t,ne,n===null?FS:function(){return mg(e),n(r)})}function hg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function mg(e){var t=hg(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},wn())}function dd(){return qt(ho)}function pg(){return jt().memoizedState}function gg(){return jt().memoizedState}function QS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=wn();e=ml(n);var r=pl(t,e,n);r!==null&&(sn(r,t,n),Gs(r,t,n)),t={cache:Pu()},e.payload=t;return}t=t.return}}function ZS(e,t,n){var r=wn();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bi(e)?xg(t,n):(n=Au(e,t,n,r),n!==null&&(sn(n,e,r),yg(n,t,r)))}function vg(e,t,n){var r=wn();Fs(e,t,n,r)}function Fs(e,t,n,r){var c={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bi(e))xg(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,R=f(b,n);if(c.hasEagerState=!0,c.eagerState=R,gn(R,b))return ei(e,t,c,0),ut===null&&Wo(),!1}catch{}finally{}if(n=Au(e,t,c,r),n!==null)return sn(n,e,r),yg(n,t,r),!0}return!1}function fd(e,t,n,r){if(r={lane:2,revertLane:Gd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bi(e)){if(t)throw Error(i(479))}else t=Au(e,n,r,2),t!==null&&sn(t,e,2)}function bi(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function xg(e,t){$r=hi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yg(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wt(e,n)}}var Qs={readContext:qt,use:gi,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};Qs.useEffectEvent=yt;var bg={readContext:qt,use:gi,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:qt,useEffect:ag,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,xi(4194308,4,og.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xi(4194308,4,e,t)},useInsertionEffect:function(e,t){xi(4,2,e,t)},useMemo:function(e,t){var n=Qt();t=t===void 0?null:t;var r=e();if(lr){Zn(!0);try{e()}finally{Zn(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Qt();if(n!==void 0){var c=n(t);if(lr){Zn(!0);try{n(t)}finally{Zn(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=ZS.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:function(e){e=rd(e);var t=e.queue,n=vg.bind(null,_e,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:id,useDeferredValue:function(e,t){var n=Qt();return cd(n,e,t)},useTransition:function(){var e=rd(!1);return e=fg.bind(null,_e,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=_e,c=Qt();if(Ve){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ut===null)throw Error(i(349));(qe&127)!==0||qp(r,t,n)}c.memoizedState=n;var f={value:n,getSnapshot:t};return c.queue=f,ag(Vp.bind(null,r,f,e),[e]),r.flags|=2048,Xr(9,{destroy:void 0},Ip.bind(null,r,f,n,t),null),n},useId:function(){var e=Qt(),t=ut.identifierPrefix;if(Ve){var n=ua,r=ca;n=(r&~(1<<32-Et(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=mi++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=GS++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:dd,useFormState:Jp,useActionState:Jp,useOptimistic:function(e){var t=Qt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fd.bind(null,_e,!0,n),n.dispatch=t,[e,t]},useMemoCache:nd,useCacheRefresh:function(){return Qt().memoizedState=QS.bind(null,_e)},useEffectEvent:function(e){var t=Qt(),n={impl:e};return t.memoizedState=n,function(){if((Xe&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},hd={readContext:qt,use:gi,useCallback:cg,useContext:qt,useEffect:od,useImperativeHandle:ig,useInsertionEffect:rg,useLayoutEffect:sg,useMemo:ug,useReducer:vi,useRef:ng,useState:function(){return vi(za)},useDebugValue:id,useDeferredValue:function(e,t){var n=jt();return dg(n,lt.memoizedState,e,t)},useTransition:function(){var e=vi(za)[0],t=jt().memoizedState;return[typeof e=="boolean"?e:Xs(e),t]},useSyncExternalStore:Pp,useId:pg,useHostTransitionStatus:dd,useFormState:Wp,useActionState:Wp,useOptimistic:function(e,t){var n=jt();return $p(n,lt,e,t)},useMemoCache:nd,useCacheRefresh:gg};hd.useEffectEvent=lg;var Sg={readContext:qt,use:gi,useCallback:cg,useContext:qt,useEffect:od,useImperativeHandle:ig,useInsertionEffect:rg,useLayoutEffect:sg,useMemo:ug,useReducer:ld,useRef:ng,useState:function(){return ld(za)},useDebugValue:id,useDeferredValue:function(e,t){var n=jt();return lt===null?cd(n,e,t):dg(n,lt.memoizedState,e,t)},useTransition:function(){var e=ld(za)[0],t=jt().memoizedState;return[typeof e=="boolean"?e:Xs(e),t]},useSyncExternalStore:Pp,useId:pg,useHostTransitionStatus:dd,useFormState:tg,useActionState:tg,useOptimistic:function(e,t){var n=jt();return lt!==null?$p(n,lt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:nd,useCacheRefresh:gg};Sg.useEffectEvent=lg;function md(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:y({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pd={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wn(),c=ml(r);c.payload=t,n!=null&&(c.callback=n),t=pl(e,c,r),t!==null&&(sn(t,e,r),Gs(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wn(),c=ml(r);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=pl(e,c,r),t!==null&&(sn(t,e,r),Gs(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wn(),r=ml(n);r.tag=2,t!=null&&(r.callback=t),t=pl(e,r,n),t!==null&&(sn(t,e,n),Gs(t,e,n))}};function wg(e,t,n,r,c,f,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,f,b):t.prototype&&t.prototype.isPureReactComponent?!Ls(n,r)||!Ls(c,f):!0}function jg(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&pd.enqueueReplaceState(t,t.state,null)}function rr(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=y({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function Cg(e){Jo(e)}function Eg(e){console.error(e)}function Rg(e){Jo(e)}function Si(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Ng(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function gd(e,t,n){return n=ml(n),n.tag=3,n.payload={element:null},n.callback=function(){Si(e,t)},n}function Tg(e){return e=ml(e),e.tag=3,e}function Ag(e,t,n,r){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var f=r.value;e.payload=function(){return c(f)},e.callback=function(){Ng(t,n,r)}}var b=n.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Ng(t,n,r),typeof c!="function"&&(Sl===null?Sl=new Set([this]):Sl.add(this));var R=r.stack;this.componentDidCatch(r.value,{componentStack:R!==null?R:""})})}function JS(e,t,n,r,c){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Pr(t,n,c,!0),n=xn.current,n!==null){switch(n.tag){case 31:case 13:return Bn===null?_i():n.alternate===null&&bt===0&&(bt=3),n.flags&=-257,n.flags|=65536,n.lanes=c,r===ii?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qd(e,r,c)),!1;case 22:return n.flags|=65536,r===ii?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),qd(e,r,c)),!1}throw Error(i(435,n.tag))}return qd(e,r,c),_i(),!1}if(Ve)return t=xn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==zu&&(e=Error(i(422),{cause:r}),Hs(kn(e,n)))):(r!==zu&&(t=Error(i(423),{cause:r}),Hs(kn(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=kn(r,n),c=gd(e.stateNode,r,c),$u(e,c),bt!==4&&(bt=2)),!1;var f=Error(i(520),{cause:r});if(f=kn(f,n),lo===null?lo=[f]:lo.push(f),bt!==4&&(bt=2),t===null)return!0;r=kn(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=gd(n.stateNode,r,e),$u(n,e),!1;case 1:if(t=n.type,f=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Sl===null||!Sl.has(f))))return n.flags|=65536,c&=-c,n.lanes|=c,c=Tg(c),Ag(c,e,n,r),$u(n,c),!1}n=n.return}while(n!==null);return!1}var vd=Error(i(461)),Tt=!1;function It(e,t,n,r){t.child=e===null?_p(t,null,n,r):ar(t,e.child,n,r)}function Mg(e,t,n,r,c){n=n.render;var f=t.ref;if("ref"in r){var b={};for(var R in r)R!=="ref"&&(b[R]=r[R])}else b=r;return Wl(t),r=Ju(e,t,n,b,f,c),R=Wu(),e!==null&&!Tt?(ed(e,t,c),La(e,t,c)):(Ve&&R&&_u(t),t.flags|=1,It(e,t,r,c),t.child)}function Dg(e,t,n,r,c){if(e===null){var f=n.type;return typeof f=="function"&&!Mu(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Og(e,t,f,r,c)):(e=ni(n.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Ed(e,c)){var b=f.memoizedProps;if(n=n.compare,n=n!==null?n:Ls,n(b,r)&&e.ref===t.ref)return La(e,t,c)}return t.flags|=1,e=Ma(f,r),e.ref=t.ref,e.return=t,t.child=e}function Og(e,t,n,r,c){if(e!==null){var f=e.memoizedProps;if(Ls(f,r)&&e.ref===t.ref)if(Tt=!1,t.pendingProps=r=f,Ed(e,c))(e.flags&131072)!==0&&(Tt=!0);else return t.lanes=e.lanes,La(e,t,c)}return xd(e,t,n,r,c)}function _g(e,t,n,r){var c=r.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~f}else r=0,t.child=null;return kg(e,t,f,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&si(t,f!==null?f.cachePool:null),f!==null?Lp(t,f):Xu(),Up(t);else return r=t.lanes=536870912,kg(e,t,f!==null?f.baseLanes|n:n,n,r)}else f!==null?(si(t,f.cachePool),Lp(t,f),vl(),t.memoizedState=null):(e!==null&&si(t,null),Xu(),vl());return It(e,t,c,n),t.child}function Zs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function kg(e,t,n,r,c){var f=Iu();return f=f===null?null:{parent:Rt._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&si(t,null),Xu(),Up(t),e!==null&&Pr(e,t,r,!0),t.childLanes=c,null}function wi(e,t){return t=Ci({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zg(e,t,n){return ar(t,e.child,null,n),e=wi(t,t.pendingProps),e.flags|=2,yn(t),t.memoizedState=null,e}function WS(e,t,n){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ve){if(r.mode==="hidden")return e=wi(t,r),t.lanes=536870912,Zs(null,e);if(Qu(t),(e=ft)?(e=Kv(e,Un),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cl!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},n=xp(e),n.return=t,t.child=n,Pt=t,ft=null)):e=null,e===null)throw dl(t);return t.lanes=536870912,null}return wi(t,r)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(Qu(t),c)if(t.flags&256)t.flags&=-257,t=zg(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Tt||Pr(e,t,n,!1),c=(n&e.childLanes)!==0,Tt||c){if(r=ut,r!==null&&(b=Jn(r,n),b!==0&&b!==f.retryLane))throw f.retryLane=b,Fl(e,b),sn(r,e,b),vd;_i(),t=zg(e,t,n)}else e=f.treeContext,ft=Hn(b.nextSibling),Pt=t,Ve=!0,ul=null,Un=!1,e!==null&&Sp(t,e),t=wi(t,r),t.flags|=4096;return t}return e=Ma(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ji(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function xd(e,t,n,r,c){return Wl(t),n=Ju(e,t,n,r,void 0,c),r=Wu(),e!==null&&!Tt?(ed(e,t,c),La(e,t,c)):(Ve&&r&&_u(t),t.flags|=1,It(e,t,n,c),t.child)}function Lg(e,t,n,r,c,f){return Wl(t),t.updateQueue=null,n=Hp(t,r,n,c),Bp(e),r=Wu(),e!==null&&!Tt?(ed(e,t,f),La(e,t,f)):(Ve&&r&&_u(t),t.flags|=1,It(e,t,n,f),t.child)}function Ug(e,t,n,r,c){if(Wl(t),t.stateNode===null){var f=Lr,b=n.contextType;typeof b=="object"&&b!==null&&(f=qt(b)),f=new n(r,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=pd,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=r,f.state=t.memoizedState,f.refs={},Gu(t),b=n.contextType,f.context=typeof b=="object"&&b!==null?qt(b):Lr,f.state=t.memoizedState,b=n.getDerivedStateFromProps,typeof b=="function"&&(md(t,n,b,r),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&pd.enqueueReplaceState(f,f.state,null),$s(t,r,f,c),Ys(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){f=t.stateNode;var R=t.memoizedProps,k=rr(n,R);f.props=k;var G=f.context,J=n.contextType;b=Lr,typeof J=="object"&&J!==null&&(b=qt(J));var te=n.getDerivedStateFromProps;J=typeof te=="function"||typeof f.getSnapshotBeforeUpdate=="function",R=t.pendingProps!==R,J||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(R||G!==b)&&jg(t,f,r,b),hl=!1;var Y=t.memoizedState;f.state=Y,$s(t,r,f,c),Ys(),G=t.memoizedState,R||Y!==G||hl?(typeof te=="function"&&(md(t,n,te,r),G=t.memoizedState),(k=hl||wg(t,n,k,r,Y,G,b))?(J||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=G),f.props=r,f.state=G,f.context=b,r=k):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{f=t.stateNode,Yu(e,t),b=t.memoizedProps,J=rr(n,b),f.props=J,te=t.pendingProps,Y=f.context,G=n.contextType,k=Lr,typeof G=="object"&&G!==null&&(k=qt(G)),R=n.getDerivedStateFromProps,(G=typeof R=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==te||Y!==k)&&jg(t,f,r,k),hl=!1,Y=t.memoizedState,f.state=Y,$s(t,r,f,c),Ys();var F=t.memoizedState;b!==te||Y!==F||hl||e!==null&&e.dependencies!==null&&li(e.dependencies)?(typeof R=="function"&&(md(t,n,R,r),F=t.memoizedState),(J=hl||wg(t,n,J,r,Y,F,k)||e!==null&&e.dependencies!==null&&li(e.dependencies))?(G||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(r,F,k),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(r,F,k)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=F),f.props=r,f.state=F,f.context=k,r=J):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),r=!1)}return f=r,ji(e,t),r=(t.flags&128)!==0,f||r?(f=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&r?(t.child=ar(t,e.child,null,c),t.child=ar(t,null,n,c)):It(e,t,n,c),t.memoizedState=f.state,e=t.child):e=La(e,t,c),e}function Bg(e,t,n,r){return Zl(),t.flags|=256,It(e,t,n,r),t.child}var yd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bd(e){return{baseLanes:e,cachePool:Np()}}function Sd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Sn),e}function Hg(e,t,n){var r=t.pendingProps,c=!1,f=(t.flags&128)!==0,b;if((b=f)||(b=e!==null&&e.memoizedState===null?!1:(wt.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ve){if(c?gl(t):vl(),(e=ft)?(e=Kv(e,Un),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cl!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},n=xp(e),n.return=t,t.child=n,Pt=t,ft=null)):e=null,e===null)throw dl(t);return af(e)?t.lanes=32:t.lanes=536870912,null}var R=r.children;return r=r.fallback,c?(vl(),c=t.mode,R=Ci({mode:"hidden",children:R},c),r=Ql(r,c,n,null),R.return=t,r.return=t,R.sibling=r,t.child=R,r=t.child,r.memoizedState=bd(n),r.childLanes=Sd(e,b,n),t.memoizedState=yd,Zs(null,r)):(gl(t),wd(t,R))}var k=e.memoizedState;if(k!==null&&(R=k.dehydrated,R!==null)){if(f)t.flags&256?(gl(t),t.flags&=-257,t=jd(e,t,n)):t.memoizedState!==null?(vl(),t.child=e.child,t.flags|=128,t=null):(vl(),R=r.fallback,c=t.mode,r=Ci({mode:"visible",children:r.children},c),R=Ql(R,c,n,null),R.flags|=2,r.return=t,R.return=t,r.sibling=R,t.child=r,ar(t,e.child,null,n),r=t.child,r.memoizedState=bd(n),r.childLanes=Sd(e,b,n),t.memoizedState=yd,t=Zs(null,r));else if(gl(t),af(R)){if(b=R.nextSibling&&R.nextSibling.dataset,b)var G=b.dgst;b=G,r=Error(i(419)),r.stack="",r.digest=b,Hs({value:r,source:null,stack:null}),t=jd(e,t,n)}else if(Tt||Pr(e,t,n,!1),b=(n&e.childLanes)!==0,Tt||b){if(b=ut,b!==null&&(r=Jn(b,n),r!==0&&r!==k.retryLane))throw k.retryLane=r,Fl(e,r),sn(b,e,r),vd;nf(R)||_i(),t=jd(e,t,n)}else nf(R)?(t.flags|=192,t.child=e.child,t=null):(e=k.treeContext,ft=Hn(R.nextSibling),Pt=t,Ve=!0,ul=null,Un=!1,e!==null&&Sp(t,e),t=wd(t,r.children),t.flags|=4096);return t}return c?(vl(),R=r.fallback,c=t.mode,k=e.child,G=k.sibling,r=Ma(k,{mode:"hidden",children:r.children}),r.subtreeFlags=k.subtreeFlags&65011712,G!==null?R=Ma(G,R):(R=Ql(R,c,n,null),R.flags|=2),R.return=t,r.return=t,r.sibling=R,t.child=r,Zs(null,r),r=t.child,R=e.child.memoizedState,R===null?R=bd(n):(c=R.cachePool,c!==null?(k=Rt._currentValue,c=c.parent!==k?{parent:k,pool:k}:c):c=Np(),R={baseLanes:R.baseLanes|n,cachePool:c}),r.memoizedState=R,r.childLanes=Sd(e,b,n),t.memoizedState=yd,Zs(e.child,r)):(gl(t),n=e.child,e=n.sibling,n=Ma(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=n,t.memoizedState=null,n)}function wd(e,t){return t=Ci({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ci(e,t){return e=vn(22,e,null,t),e.lanes=0,e}function jd(e,t,n){return ar(t,e.child,null,n),e=wd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bu(e.return,t,n)}function Cd(e,t,n,r,c,f){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:c,treeForkCount:f}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=r,b.tail=n,b.tailMode=c,b.treeForkCount=f)}function qg(e,t,n){var r=t.pendingProps,c=r.revealOrder,f=r.tail;r=r.children;var b=wt.current,R=(b&2)!==0;if(R?(b=b&1|2,t.flags|=128):b&=1,Q(wt,b),It(e,t,r,n),r=Ve?Bs:0,!R&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pg(e,n,t);else if(e.tag===19)Pg(e,n,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(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&fi(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),Cd(t,!1,c,n,f,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&fi(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}Cd(t,!0,n,null,f,r);break;case"together":Cd(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function La(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Pr(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ma(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ma(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ed(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&li(e)))}function ew(e,t,n){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),fl(t,Rt,e.memoizedState.cache),Zl();break;case 27:case 5:Ce(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:fl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(gl(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Hg(e,t,n):(gl(t),e=La(e,t,n),e!==null?e.sibling:null);gl(t);break;case 19:var c=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Pr(e,t,n,!1),r=(n&t.childLanes)!==0),c){if(r)return qg(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Q(wt,wt.current),r)break;return null;case 22:return t.lanes=0,_g(e,t,n,t.pendingProps);case 24:fl(t,Rt,e.memoizedState.cache)}return La(e,t,n)}function Ig(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Tt=!0;else{if(!Ed(e,n)&&(t.flags&128)===0)return Tt=!1,ew(e,t,n);Tt=(e.flags&131072)!==0}else Tt=!1,Ve&&(t.flags&1048576)!==0&&bp(t,Bs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=tr(t.elementType),t.type=e,typeof e=="function")Mu(e)?(r=rr(e,r),t.tag=1,t=Ug(null,t,e,r,n)):(t.tag=0,t=xd(null,t,e,r,n));else{if(e!=null){var c=e.$$typeof;if(c===O){t.tag=11,t=Mg(null,t,e,r,n);break e}else if(c===H){t.tag=14,t=Dg(null,t,e,r,n);break e}}throw t=W(e)||e,Error(i(306,t,""))}}return t;case 0:return xd(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,c=rr(r,t.pendingProps),Ug(e,t,r,c,n);case 3:e:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var f=t.memoizedState;c=f.element,Yu(e,t),$s(t,r,null,n);var b=t.memoizedState;if(r=b.cache,fl(t,Rt,r),r!==f.cache&&Hu(t,[Rt],n,!0),Ys(),r=b.element,f.isDehydrated)if(f={element:r,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Bg(e,t,r,n);break e}else if(r!==c){c=kn(Error(i(424)),t),Hs(c),t=Bg(e,t,r,n);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(ft=Hn(e.firstChild),Pt=t,Ve=!0,ul=null,Un=!0,n=_p(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Zl(),r===c){t=La(e,t,n);break e}It(e,t,r,n)}t=t.child}return t;case 26:return ji(e,t),e===null?(n=Wv(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ve||(n=t.type,e=t.pendingProps,r=Pi(be.current).createElement(n),r[Ht]=t,r[en]=e,Vt(r,n,e),kt(r),t.stateNode=r):t.memoizedState=Wv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&Ve&&(r=t.stateNode=Qv(t.type,t.pendingProps,be.current),Pt=t,Un=!0,c=ft,El(t.type)?(lf=c,ft=Hn(r.firstChild)):ft=c),It(e,t,t.pendingProps.children,n),ji(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ve&&((c=r=ft)&&(r=Mw(r,t.type,t.pendingProps,Un),r!==null?(t.stateNode=r,Pt=t,ft=Hn(r.firstChild),Un=!1,c=!0):c=!1),c||dl(t)),Ce(t),c=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,r=f.children,Wd(c,f)?r=null:b!==null&&Wd(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=Ju(e,t,YS,null,null,n),ho._currentValue=c),ji(e,t),It(e,t,r,n),t.child;case 6:return e===null&&Ve&&((e=n=ft)&&(n=Dw(n,t.pendingProps,Un),n!==null?(t.stateNode=n,Pt=t,ft=null,e=!0):e=!1),e||dl(t)),null;case 13:return Hg(e,t,n);case 4:return fe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ar(t,null,r,n):It(e,t,r,n),t.child;case 11:return Mg(e,t,t.type,t.pendingProps,n);case 7:return It(e,t,t.pendingProps,n),t.child;case 8:return It(e,t,t.pendingProps.children,n),t.child;case 12:return It(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,fl(t,t.type,r.value),It(e,t,r.children,n),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,Wl(t),c=qt(c),r=r(c),t.flags|=1,It(e,t,r,n),t.child;case 14:return Dg(e,t,t.type,t.pendingProps,n);case 15:return Og(e,t,t.type,t.pendingProps,n);case 19:return qg(e,t,n);case 31:return WS(e,t,n);case 22:return _g(e,t,n,t.pendingProps);case 24:return Wl(t),r=qt(Rt),e===null?(c=Iu(),c===null&&(c=ut,f=Pu(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=n),c=f),t.memoizedState={parent:r,cache:c},Gu(t),fl(t,Rt,c)):((e.lanes&n)!==0&&(Yu(e,t),$s(t,null,null,n),Ys()),c=e.memoizedState,f=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),fl(t,Rt,r)):(r=f.cache,fl(t,Rt,r),r!==c.cache&&Hu(t,[Rt],n,!0))),It(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ua(e){e.flags|=4}function Rd(e,t,n,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(pv())e.flags|=8192;else throw nr=ii,Vu}else e.flags&=-16777217}function Vg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!lx(t))if(pv())e.flags|=8192;else throw nr=ii,Vu}function Ei(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ct():536870912,e.lanes|=t,Jr|=t)}function Js(e,t){if(!Ve)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ht(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function tw(e,t,n){var r=t.pendingProps;switch(ku(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(t),null;case 1:return ht(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),_a(Rt),ve(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hr(t)?Ua(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Lu())),ht(t),null;case 26:var c=t.type,f=t.memoizedState;return e===null?(Ua(t),f!==null?(ht(t),Vg(t,f)):(ht(t),Rd(t,c,null,r,n))):f?f!==e.memoizedState?(Ua(t),ht(t),Vg(t,f)):(ht(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ua(t),ht(t),Rd(t,c,e,r,n)),null;case 27:if(De(t),n=be.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ua(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ht(t),null}e=ae.current,Hr(t)?wp(t):(e=Qv(c,r,n),t.stateNode=e,Ua(t))}return ht(t),null;case 5:if(De(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ua(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ht(t),null}if(f=ae.current,Hr(t))wp(t);else{var b=Pi(be.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof r.is=="string"?b.createElement("select",{is:r.is}):b.createElement("select"),r.multiple?f.multiple=!0:r.size&&(f.size=r.size);break;default:f=typeof r.is=="string"?b.createElement(c,{is:r.is}):b.createElement(c)}}f[Ht]=t,f[en]=r;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)f.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=f;e:switch(Vt(f,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ua(t)}}return ht(t),Rd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ua(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=be.current,Hr(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,c=Pt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[Ht]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Hv(e.nodeValue,n)),e||dl(t,!0)}else e=Pi(e).createTextNode(r),e[Ht]=t,t.stateNode=e}return ht(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hr(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[Ht]=t}else Zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),e=!1}else n=Lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(yn(t),t):(yn(t),null);if((t.flags&128)!==0)throw Error(i(558))}return ht(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Hr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[Ht]=t}else Zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),c=!1}else c=Lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(yn(t),t):(yn(t),null)}return yn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),f=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(f=r.memoizedState.cachePool.pool),f!==c&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ei(t,t.updateQueue),ht(t),null);case 4:return ve(),e===null&&Xd(t.stateNode.containerInfo),ht(t),null;case 10:return _a(t.type),ht(t),null;case 19:if(q(wt),r=t.memoizedState,r===null)return ht(t),null;if(c=(t.flags&128)!==0,f=r.rendering,f===null)if(c)Js(r,!1);else{if(bt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=fi(e),f!==null){for(t.flags|=128,Js(r,!1),e=f.updateQueue,t.updateQueue=e,Ei(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vp(n,e),n=n.sibling;return Q(wt,wt.current&1|2),Ve&&Da(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Kt()>Mi&&(t.flags|=128,c=!0,Js(r,!1),t.lanes=4194304)}else{if(!c)if(e=fi(f),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Ei(t,e),Js(r,!0),r.tail===null&&r.tailMode==="hidden"&&!f.alternate&&!Ve)return ht(t),null}else 2*Kt()-r.renderingStartTime>Mi&&n!==536870912&&(t.flags|=128,c=!0,Js(r,!1),t.lanes=4194304);r.isBackwards?(f.sibling=t.child,t.child=f):(e=r.last,e!==null?e.sibling=f:t.child=f,r.last=f)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Kt(),e.sibling=null,n=wt.current,Q(wt,c?n&1|2:n&1),Ve&&Da(t,r.treeForkCount),e):(ht(t),null);case 22:case 23:return yn(t),Fu(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(ht(t),t.subtreeFlags&6&&(t.flags|=8192)):ht(t),n=t.updateQueue,n!==null&&Ei(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&q(er),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),_a(Rt),ht(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function nw(e,t){switch(ku(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _a(Rt),ve(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return De(t),null;case 31:if(t.memoizedState!==null){if(yn(t),t.alternate===null)throw Error(i(340));Zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(yn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(wt),null;case 4:return ve(),null;case 10:return _a(t.type),null;case 22:case 23:return yn(t),Fu(),e!==null&&q(er),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _a(Rt),null;case 25:return null;default:return null}}function Gg(e,t){switch(ku(t),t.tag){case 3:_a(Rt),ve();break;case 26:case 27:case 5:De(t);break;case 4:ve();break;case 31:t.memoizedState!==null&&yn(t);break;case 13:yn(t);break;case 19:q(wt);break;case 10:_a(t.type);break;case 22:case 23:yn(t),Fu(),e!==null&&q(er);break;case 24:_a(Rt)}}function Ws(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var c=r.next;n=c;do{if((n.tag&e)===e){r=void 0;var f=n.create,b=n.inst;r=f(),b.destroy=r}n=n.next}while(n!==c)}}catch(R){nt(t,t.return,R)}}function xl(e,t,n){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var f=c.next;r=f;do{if((r.tag&e)===e){var b=r.inst,R=b.destroy;if(R!==void 0){b.destroy=void 0,c=t;var k=n,G=R;try{G()}catch(J){nt(c,k,J)}}}r=r.next}while(r!==f)}}catch(J){nt(t,t.return,J)}}function Yg(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{zp(t,n)}catch(r){nt(e,e.return,r)}}}function $g(e,t,n){n.props=rr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){nt(e,t,r)}}function eo(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(c){nt(e,t,c)}}function da(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(c){nt(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){nt(e,t,c)}else n.current=null}function Kg(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(c){nt(e,e.return,c)}}function Nd(e,t,n){try{var r=e.stateNode;Cw(r,e.type,n,t),r[en]=t}catch(c){nt(e,e.return,c)}}function Xg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&El(e.type)||e.tag===4}function Td(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xg(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&&El(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 Ad(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ta));else if(r!==4&&(r===27&&El(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Ad(e,t,n),e=e.sibling;e!==null;)Ad(e,t,n),e=e.sibling}function Ri(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&El(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ri(e,t,n),e=e.sibling;e!==null;)Ri(e,t,n),e=e.sibling}function Fg(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Vt(t,r,n),t[Ht]=e,t[en]=n}catch(f){nt(e,e.return,f)}}var Ba=!1,At=!1,Md=!1,Qg=typeof WeakSet=="function"?WeakSet:Set,zt=null;function aw(e,t){if(e=e.containerInfo,Zd=Ki,e=ip(e),ju(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var c=r.anchorOffset,f=r.focusNode;r=r.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var b=0,R=-1,k=-1,G=0,J=0,te=e,Y=null;t:for(;;){for(var F;te!==n||c!==0&&te.nodeType!==3||(R=b+c),te!==f||r!==0&&te.nodeType!==3||(k=b+r),te.nodeType===3&&(b+=te.nodeValue.length),(F=te.firstChild)!==null;)Y=te,te=F;for(;;){if(te===e)break t;if(Y===n&&++G===c&&(R=b),Y===f&&++J===r&&(k=b),(F=te.nextSibling)!==null)break;te=Y,Y=te.parentNode}te=F}n=R===-1||k===-1?null:{start:R,end:k}}else n=null}n=n||{start:0,end:0}}else n=null;for(Jd={focusedElem:e,selectionRange:n},Ki=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,f=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(n=0;n<e.length;n++)c=e[n],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,c=f.memoizedProps,f=f.memoizedState,r=n.stateNode;try{var ge=rr(n.type,c);e=r.getSnapshotBeforeUpdate(ge,f),r.__reactInternalSnapshotBeforeUpdate=e}catch(Re){nt(n,n.return,Re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)tf(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":tf(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(i(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function Zg(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pa(e,n),r&4&&Ws(5,n);break;case 1:if(Pa(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(b){nt(n,n.return,b)}else{var c=rr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){nt(n,n.return,b)}}r&64&&Yg(n),r&512&&eo(n,n.return);break;case 3:if(Pa(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{zp(e,t)}catch(b){nt(n,n.return,b)}}break;case 27:t===null&&r&4&&Fg(n);case 26:case 5:Pa(e,n),t===null&&r&4&&Kg(n),r&512&&eo(n,n.return);break;case 12:Pa(e,n);break;case 31:Pa(e,n),r&4&&ev(e,n);break;case 13:Pa(e,n),r&4&&tv(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=fw.bind(null,n),Ow(e,n))));break;case 22:if(r=n.memoizedState!==null||Ba,!r){t=t!==null&&t.memoizedState!==null||At,c=Ba;var f=At;Ba=r,(At=t)&&!f?qa(e,n,(n.subtreeFlags&8772)!==0):Pa(e,n),Ba=c,At=f}break;case 30:break;default:Pa(e,n)}}function Jg(e){var t=e.alternate;t!==null&&(e.alternate=null,Jg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&su(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 vt=null,nn=!1;function Ha(e,t,n){for(n=n.child;n!==null;)Wg(e,t,n),n=n.sibling}function Wg(e,t,n){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(Ra,n)}catch{}switch(n.tag){case 26:At||da(n,t),Ha(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:At||da(n,t);var r=vt,c=nn;El(n.type)&&(vt=n.stateNode,nn=!1),Ha(e,t,n),co(n.stateNode),vt=r,nn=c;break;case 5:At||da(n,t);case 6:if(r=vt,c=nn,vt=null,Ha(e,t,n),vt=r,nn=c,vt!==null)if(nn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(n.stateNode)}catch(f){nt(n,t,f)}else try{vt.removeChild(n.stateNode)}catch(f){nt(n,t,f)}break;case 18:vt!==null&&(nn?(e=vt,Yv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ss(e)):Yv(vt,n.stateNode));break;case 4:r=vt,c=nn,vt=n.stateNode.containerInfo,nn=!0,Ha(e,t,n),vt=r,nn=c;break;case 0:case 11:case 14:case 15:xl(2,n,t),At||xl(4,n,t),Ha(e,t,n);break;case 1:At||(da(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&$g(n,t,r)),Ha(e,t,n);break;case 21:Ha(e,t,n);break;case 22:At=(r=At)||n.memoizedState!==null,Ha(e,t,n),At=r;break;default:Ha(e,t,n)}}function ev(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ss(e)}catch(n){nt(t,t.return,n)}}}function tv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ss(e)}catch(n){nt(t,t.return,n)}}function lw(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qg),t;default:throw Error(i(435,e.tag))}}function Ni(e,t){var n=lw(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var c=hw.bind(null,e,r);r.then(c,c)}})}function an(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var c=n[r],f=e,b=t,R=b;e:for(;R!==null;){switch(R.tag){case 27:if(El(R.type)){vt=R.stateNode,nn=!1;break e}break;case 5:vt=R.stateNode,nn=!1;break e;case 3:case 4:vt=R.stateNode.containerInfo,nn=!0;break e}R=R.return}if(vt===null)throw Error(i(160));Wg(f,b,c),vt=null,nn=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)nv(t,e),t=t.sibling}var ea=null;function nv(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:an(t,e),ln(e),r&4&&(xl(3,e,e.return),Ws(3,e),xl(5,e,e.return));break;case 1:an(t,e),ln(e),r&512&&(At||n===null||da(n,n.return)),r&64&&Ba&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var c=ea;if(an(t,e),ln(e),r&512&&(At||n===null||da(n,n.return)),r&4){var f=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":f=c.getElementsByTagName("title")[0],(!f||f[Ns]||f[Ht]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(r),c.head.insertBefore(f,c.querySelector("head > title"))),Vt(f,r,n),f[Ht]=e,kt(f),r=f;break e;case"link":var b=nx("link","href",c).get(r+(n.href||""));if(b){for(var R=0;R<b.length;R++)if(f=b[R],f.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&f.getAttribute("rel")===(n.rel==null?null:n.rel)&&f.getAttribute("title")===(n.title==null?null:n.title)&&f.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){b.splice(R,1);break t}}f=c.createElement(r),Vt(f,r,n),c.head.appendChild(f);break;case"meta":if(b=nx("meta","content",c).get(r+(n.content||""))){for(R=0;R<b.length;R++)if(f=b[R],f.getAttribute("content")===(n.content==null?null:""+n.content)&&f.getAttribute("name")===(n.name==null?null:n.name)&&f.getAttribute("property")===(n.property==null?null:n.property)&&f.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&f.getAttribute("charset")===(n.charSet==null?null:n.charSet)){b.splice(R,1);break t}}f=c.createElement(r),Vt(f,r,n),c.head.appendChild(f);break;default:throw Error(i(468,r))}f[Ht]=e,kt(f),r=f}e.stateNode=r}else ax(c,e.type,e.stateNode);else e.stateNode=tx(c,r,e.memoizedProps);else f!==r?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,r===null?ax(c,e.type,e.stateNode):tx(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Nd(e,e.memoizedProps,n.memoizedProps)}break;case 27:an(t,e),ln(e),r&512&&(At||n===null||da(n,n.return)),n!==null&&r&4&&Nd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(an(t,e),ln(e),r&512&&(At||n===null||da(n,n.return)),e.flags&32){c=e.stateNode;try{Ar(c,"")}catch(ge){nt(e,e.return,ge)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Nd(e,c,n!==null?n.memoizedProps:c)),r&1024&&(Md=!0);break;case 6:if(an(t,e),ln(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ge){nt(e,e.return,ge)}}break;case 3:if(Vi=null,c=ea,ea=qi(t.containerInfo),an(t,e),ea=c,ln(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ss(t.containerInfo)}catch(ge){nt(e,e.return,ge)}Md&&(Md=!1,av(e));break;case 4:r=ea,ea=qi(e.stateNode.containerInfo),an(t,e),ln(e),ea=r;break;case 12:an(t,e),ln(e);break;case 31:an(t,e),ln(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ni(e,r)));break;case 13:an(t,e),ln(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ai=Kt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ni(e,r)));break;case 22:c=e.memoizedState!==null;var k=n!==null&&n.memoizedState!==null,G=Ba,J=At;if(Ba=G||c,At=J||k,an(t,e),At=J,Ba=G,ln(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(n===null||k||Ba||At||sr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){k=n=t;try{if(f=k.stateNode,c)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{R=k.stateNode;var te=k.memoizedProps.style,Y=te!=null&&te.hasOwnProperty("display")?te.display:null;R.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(ge){nt(k,k.return,ge)}}}else if(t.tag===6){if(n===null){k=t;try{k.stateNode.nodeValue=c?"":k.memoizedProps}catch(ge){nt(k,k.return,ge)}}}else if(t.tag===18){if(n===null){k=t;try{var F=k.stateNode;c?$v(F,!0):$v(k.stateNode,!1)}catch(ge){nt(k,k.return,ge)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Ni(e,n))));break;case 19:an(t,e),ln(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ni(e,r)));break;case 30:break;case 21:break;default:an(t,e),ln(e)}}function ln(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Xg(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode,f=Td(e);Ri(e,f,c);break;case 5:var b=n.stateNode;n.flags&32&&(Ar(b,""),n.flags&=-33);var R=Td(e);Ri(e,R,b);break;case 3:case 4:var k=n.stateNode.containerInfo,G=Td(e);Ad(e,G,k);break;default:throw Error(i(161))}}catch(J){nt(e,e.return,J)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function av(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;av(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Pa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zg(e,t.alternate,t),t=t.sibling}function sr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:xl(4,t,t.return),sr(t);break;case 1:da(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&$g(t,t.return,n),sr(t);break;case 27:co(t.stateNode);case 26:case 5:da(t,t.return),sr(t);break;case 22:t.memoizedState===null&&sr(t);break;case 30:sr(t);break;default:sr(t)}e=e.sibling}}function qa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,f=t,b=f.flags;switch(f.tag){case 0:case 11:case 15:qa(c,f,n),Ws(4,f);break;case 1:if(qa(c,f,n),r=f,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(G){nt(r,r.return,G)}if(r=f,c=r.updateQueue,c!==null){var R=r.stateNode;try{var k=c.shared.hiddenCallbacks;if(k!==null)for(c.shared.hiddenCallbacks=null,c=0;c<k.length;c++)kp(k[c],R)}catch(G){nt(r,r.return,G)}}n&&b&64&&Yg(f),eo(f,f.return);break;case 27:Fg(f);case 26:case 5:qa(c,f,n),n&&r===null&&b&4&&Kg(f),eo(f,f.return);break;case 12:qa(c,f,n);break;case 31:qa(c,f,n),n&&b&4&&ev(c,f);break;case 13:qa(c,f,n),n&&b&4&&tv(c,f);break;case 22:f.memoizedState===null&&qa(c,f,n),eo(f,f.return);break;case 30:break;default:qa(c,f,n)}t=t.sibling}}function Dd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ps(n))}function Od(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ps(e))}function ta(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)lv(e,t,n,r),t=t.sibling}function lv(e,t,n,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:ta(e,t,n,r),c&2048&&Ws(9,t);break;case 1:ta(e,t,n,r);break;case 3:ta(e,t,n,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ps(e)));break;case 12:if(c&2048){ta(e,t,n,r),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,R=f.onPostCommit;typeof R=="function"&&R(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){nt(t,t.return,k)}}else ta(e,t,n,r);break;case 31:ta(e,t,n,r);break;case 13:ta(e,t,n,r);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?ta(e,t,n,r):to(e,t):f._visibility&2?ta(e,t,n,r):(f._visibility|=2,Fr(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Dd(b,t);break;case 24:ta(e,t,n,r),c&2048&&Od(t.alternate,t);break;default:ta(e,t,n,r)}}function Fr(e,t,n,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,b=t,R=n,k=r,G=b.flags;switch(b.tag){case 0:case 11:case 15:Fr(f,b,R,k,c),Ws(8,b);break;case 23:break;case 22:var J=b.stateNode;b.memoizedState!==null?J._visibility&2?Fr(f,b,R,k,c):to(f,b):(J._visibility|=2,Fr(f,b,R,k,c)),c&&G&2048&&Dd(b.alternate,b);break;case 24:Fr(f,b,R,k,c),c&&G&2048&&Od(b.alternate,b);break;default:Fr(f,b,R,k,c)}t=t.sibling}}function to(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,c=r.flags;switch(r.tag){case 22:to(n,r),c&2048&&Dd(r.alternate,r);break;case 24:to(n,r),c&2048&&Od(r.alternate,r);break;default:to(n,r)}t=t.sibling}}var no=8192;function Qr(e,t,n){if(e.subtreeFlags&no)for(e=e.child;e!==null;)rv(e,t,n),e=e.sibling}function rv(e,t,n){switch(e.tag){case 26:Qr(e,t,n),e.flags&no&&e.memoizedState!==null&&Gw(n,ea,e.memoizedState,e.memoizedProps);break;case 5:Qr(e,t,n);break;case 3:case 4:var r=ea;ea=qi(e.stateNode.containerInfo),Qr(e,t,n),ea=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=no,no=16777216,Qr(e,t,n),no=r):Qr(e,t,n));break;default:Qr(e,t,n)}}function sv(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 n=0;n<t.length;n++){var r=t[n];zt=r,iv(r,e)}sv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ov(e),e=e.sibling}function ov(e){switch(e.tag){case 0:case 11:case 15:ao(e),e.flags&2048&&xl(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,Ti(e)):ao(e);break;default:ao(e)}}function Ti(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];zt=r,iv(r,e)}sv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),Ti(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ti(t));break;default:Ti(t)}e=e.sibling}}function iv(e,t){for(;zt!==null;){var n=zt;switch(n.tag){case 0:case 11:case 15:xl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ps(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,zt=r;else e:for(n=e;zt!==null;){r=zt;var c=r.sibling,f=r.return;if(Jg(r),r===n){zt=null;break e}if(c!==null){c.return=f,zt=c;break e}zt=f}}}var rw={getCacheForType:function(e){var t=qt(Rt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return qt(Rt).controller.signal}},sw=typeof WeakMap=="function"?WeakMap:Map,Xe=0,ut=null,Be=null,qe=0,tt=0,bn=null,yl=!1,Zr=!1,_d=!1,Ia=0,bt=0,bl=0,or=0,kd=0,Sn=0,Jr=0,lo=null,rn=null,zd=!1,Ai=0,cv=0,Mi=1/0,Di=null,Sl=null,Dt=0,wl=null,Wr=null,Va=0,Ld=0,Ud=null,uv=null,ro=0,Bd=null;function wn(){return(Xe&2)!==0&&qe!==0?qe&-qe:U.T!==null?Gd():Rm()}function dv(){if(Sn===0)if((qe&536870912)===0||Ve){var e=Sr;Sr<<=1,(Sr&3932160)===0&&(Sr=262144),Sn=e}else Sn=536870912;return e=xn.current,e!==null&&(e.flags|=32),Sn}function sn(e,t,n){(e===ut&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(es(e,0),jl(e,qe,Sn,!1)),Bt(e,n),((Xe&2)===0||e!==ut)&&(e===ut&&((Xe&2)===0&&(or|=n),bt===4&&jl(e,qe,Sn,!1)),fa(e))}function fv(e,t,n){if((Xe&6)!==0)throw Error(i(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Te(e,t),c=r?cw(e,t):Pd(e,t,!0),f=r;do{if(c===0){Zr&&!r&&jl(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!ow(n)){c=Pd(e,t,!1),f=!1;continue}if(c===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var R=e;c=lo;var k=R.current.memoizedState.isDehydrated;if(k&&(es(R,b).flags|=256),b=Pd(R,b,!1),b!==2){if(_d&&!k){R.errorRecoveryDisabledLanes|=f,or|=f,c=4;break e}f=rn,rn=c,f!==null&&(rn===null?rn=f:rn.push.apply(rn,f))}c=b}if(f=!1,c!==2)continue}}if(c===1){es(e,0),jl(e,t,0,!0);break}e:{switch(r=e,f=c,f){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:jl(r,t,Sn,!yl);break e;case 2:rn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Ai+300-Kt(),10<c)){if(jl(r,t,Sn,!yl),wr(r,0,!0)!==0)break e;Va=t,r.timeoutHandle=Vv(hv.bind(null,r,n,rn,Di,zd,t,Sn,or,Jr,yl,f,"Throttled",-0,0),c);break e}hv(r,n,rn,Di,zd,t,Sn,or,Jr,yl,f,null,-0,0)}}break}while(!0);fa(e)}function hv(e,t,n,r,c,f,b,R,k,G,J,te,Y,F){if(e.timeoutHandle=-1,te=t.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ta},rv(t,f,te);var ge=(f&62914560)===f?Ai-Kt():(f&4194048)===f?cv-Kt():0;if(ge=Yw(te,ge),ge!==null){Va=f,e.cancelPendingCommit=ge(Sv.bind(null,e,t,f,n,r,c,b,R,k,J,te,null,Y,F)),jl(e,f,b,!G);return}}Sv(e,t,f,n,r,c,b,R,k)}function ow(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var c=n[r],f=c.getSnapshot;c=c.value;try{if(!gn(f(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 jl(e,t,n,r){t&=~kd,t&=~or,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var f=31-Et(c),b=1<<f;r[f]=-1,c&=~b}n!==0&&ia(e,n,t)}function Oi(){return(Xe&6)===0?(so(0),!1):!0}function Hd(){if(Be!==null){if(tt===0)var e=Be.return;else e=Be,Oa=Jl=null,td(e),Gr=null,Is=0,e=Be;for(;e!==null;)Gg(e.alternate,e),e=e.return;Be=null}}function es(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Nw(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Va=0,Hd(),ut=e,Be=n=Ma(e.current,null),qe=t,tt=0,bn=null,yl=!1,Zr=Te(e,t),_d=!1,Jr=Sn=kd=or=bl=bt=0,rn=lo=null,zd=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-Et(r),f=1<<c;t|=e[c],r&=~f}return Ia=t,Wo(),n}function mv(e,t){_e=null,U.H=Qs,t===Vr||t===oi?(t=Mp(),tt=3):t===Vu?(t=Mp(),tt=4):tt=t===vd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,bn=t,Be===null&&(bt=1,Si(e,kn(t,e.current)))}function pv(){var e=xn.current;return e===null?!0:(qe&4194048)===qe?Bn===null:(qe&62914560)===qe||(qe&536870912)!==0?e===Bn:!1}function gv(){var e=U.H;return U.H=Qs,e===null?Qs:e}function vv(){var e=U.A;return U.A=rw,e}function _i(){bt=4,yl||(qe&4194048)!==qe&&xn.current!==null||(Zr=!0),(bl&134217727)===0&&(or&134217727)===0||ut===null||jl(ut,qe,Sn,!1)}function Pd(e,t,n){var r=Xe;Xe|=2;var c=gv(),f=vv();(ut!==e||qe!==t)&&(Di=null,es(e,t)),t=!1;var b=bt;e:do try{if(tt!==0&&Be!==null){var R=Be,k=bn;switch(tt){case 8:Hd(),b=6;break e;case 3:case 2:case 9:case 6:xn.current===null&&(t=!0);var G=tt;if(tt=0,bn=null,ts(e,R,k,G),n&&Zr){b=0;break e}break;default:G=tt,tt=0,bn=null,ts(e,R,k,G)}}iw(),b=bt;break}catch(J){mv(e,J)}while(!0);return t&&e.shellSuspendCounter++,Oa=Jl=null,Xe=r,U.H=c,U.A=f,Be===null&&(ut=null,qe=0,Wo()),b}function iw(){for(;Be!==null;)xv(Be)}function cw(e,t){var n=Xe;Xe|=2;var r=gv(),c=vv();ut!==e||qe!==t?(Di=null,Mi=Kt()+500,es(e,t)):Zr=Te(e,t);e:do try{if(tt!==0&&Be!==null){t=Be;var f=bn;t:switch(tt){case 1:tt=0,bn=null,ts(e,t,f,1);break;case 2:case 9:if(Tp(f)){tt=0,bn=null,yv(t);break}t=function(){tt!==2&&tt!==9||ut!==e||(tt=7),fa(e)},f.then(t,t);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:Tp(f)?(tt=0,bn=null,yv(t)):(tt=0,bn=null,ts(e,t,f,7));break;case 5:var b=null;switch(Be.tag){case 26:b=Be.memoizedState;case 5:case 27:var R=Be;if(b?lx(b):R.stateNode.complete){tt=0,bn=null;var k=R.sibling;if(k!==null)Be=k;else{var G=R.return;G!==null?(Be=G,ki(G)):Be=null}break t}}tt=0,bn=null,ts(e,t,f,5);break;case 6:tt=0,bn=null,ts(e,t,f,6);break;case 8:Hd(),bt=6;break e;default:throw Error(i(462))}}uw();break}catch(J){mv(e,J)}while(!0);return Oa=Jl=null,U.H=r,U.A=c,Xe=n,Be!==null?0:(ut=null,qe=0,Wo(),bt)}function uw(){for(;Be!==null&&!ja();)xv(Be)}function xv(e){var t=Ig(e.alternate,e,Ia);e.memoizedProps=e.pendingProps,t===null?ki(e):Be=t}function yv(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Lg(n,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=Lg(n,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:td(t);default:Gg(n,t),t=Be=vp(t,Ia),t=Ig(n,t,Ia)}e.memoizedProps=e.pendingProps,t===null?ki(e):Be=t}function ts(e,t,n,r){Oa=Jl=null,td(t),Gr=null,Is=0;var c=t.return;try{if(JS(e,c,t,n,qe)){bt=1,Si(e,kn(n,e.current)),Be=null;return}}catch(f){if(c!==null)throw Be=c,f;bt=1,Si(e,kn(n,e.current)),Be=null;return}t.flags&32768?(Ve||r===1?e=!0:Zr||(qe&536870912)!==0?e=!1:(yl=e=!0,(r===2||r===9||r===3||r===6)&&(r=xn.current,r!==null&&r.tag===13&&(r.flags|=16384))),bv(t,e)):ki(t)}function ki(e){var t=e;do{if((t.flags&32768)!==0){bv(t,yl);return}e=t.return;var n=tw(t.alternate,t,Ia);if(n!==null){Be=n;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);bt===0&&(bt=5)}function bv(e,t){do{var n=nw(e.alternate,e);if(n!==null){n.flags&=32767,Be=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=n}while(e!==null);bt=6,Be=null}function Sv(e,t,n,r,c,f,b,R,k){e.cancelPendingCommit=null;do zi();while(Dt!==0);if((Xe&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(f=t.lanes|t.childLanes,f|=Tu,oa(e,n,f,b,R,k),e===ut&&(Be=ut=null,qe=0),Wr=t,wl=e,Va=n,Ld=f,Ud=c,uv=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,mw(br,function(){return Rv(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=U.T,U.T=null,c=$.p,$.p=2,b=Xe,Xe|=4;try{aw(e,t,n)}finally{Xe=b,$.p=c,U.T=r}}Dt=1,wv(),jv(),Cv()}}function wv(){if(Dt===1){Dt=0;var e=wl,t=Wr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=U.T,U.T=null;var r=$.p;$.p=2;var c=Xe;Xe|=4;try{nv(t,e);var f=Jd,b=ip(e.containerInfo),R=f.focusedElem,k=f.selectionRange;if(b!==R&&R&&R.ownerDocument&&op(R.ownerDocument.documentElement,R)){if(k!==null&&ju(R)){var G=k.start,J=k.end;if(J===void 0&&(J=G),"selectionStart"in R)R.selectionStart=G,R.selectionEnd=Math.min(J,R.value.length);else{var te=R.ownerDocument||document,Y=te&&te.defaultView||window;if(Y.getSelection){var F=Y.getSelection(),ge=R.textContent.length,Re=Math.min(k.start,ge),st=k.end===void 0?Re:Math.min(k.end,ge);!F.extend&&Re>st&&(b=st,st=Re,Re=b);var P=sp(R,Re),L=sp(R,st);if(P&&L&&(F.rangeCount!==1||F.anchorNode!==P.node||F.anchorOffset!==P.offset||F.focusNode!==L.node||F.focusOffset!==L.offset)){var V=te.createRange();V.setStart(P.node,P.offset),F.removeAllRanges(),Re>st?(F.addRange(V),F.extend(L.node,L.offset)):(V.setEnd(L.node,L.offset),F.addRange(V))}}}}for(te=[],F=R;F=F.parentNode;)F.nodeType===1&&te.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<te.length;R++){var ee=te[R];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}Ki=!!Zd,Jd=Zd=null}finally{Xe=c,$.p=r,U.T=n}}e.current=t,Dt=2}}function jv(){if(Dt===2){Dt=0;var e=wl,t=Wr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=U.T,U.T=null;var r=$.p;$.p=2;var c=Xe;Xe|=4;try{Zg(e,t.alternate,t)}finally{Xe=c,$.p=r,U.T=n}}Dt=3}}function Cv(){if(Dt===4||Dt===3){Dt=0,Ca();var e=wl,t=Wr,n=Va,r=uv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Dt=5:(Dt=0,Wr=wl=null,Ev(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Sl=null),lu(n),t=t.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(Ra,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=U.T,c=$.p,$.p=2,U.T=null;try{for(var f=e.onRecoverableError,b=0;b<r.length;b++){var R=r[b];f(R.value,{componentStack:R.stack})}}finally{U.T=t,$.p=c}}(Va&3)!==0&&zi(),fa(e),c=e.pendingLanes,(n&261930)!==0&&(c&42)!==0?e===Bd?ro++:(ro=0,Bd=e):ro=0,so(0)}}function Ev(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ps(t)))}function zi(){return wv(),jv(),Cv(),Rv()}function Rv(){if(Dt!==5)return!1;var e=wl,t=Ld;Ld=0;var n=lu(Va),r=U.T,c=$.p;try{$.p=32>n?32:n,U.T=null,n=Ud,Ud=null;var f=wl,b=Va;if(Dt=0,Wr=wl=null,Va=0,(Xe&6)!==0)throw Error(i(331));var R=Xe;if(Xe|=4,ov(f.current),lv(f,f.current,b,n),Xe=R,so(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(Ra,f)}catch{}return!0}finally{$.p=c,U.T=r,Ev(e,t)}}function Nv(e,t,n){t=kn(n,t),t=gd(e.stateNode,t,2),e=pl(e,t,2),e!==null&&(Bt(e,2),fa(e))}function nt(e,t,n){if(e.tag===3)Nv(e,e,n);else for(;t!==null;){if(t.tag===3){Nv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Sl===null||!Sl.has(r))){e=kn(n,e),n=Tg(2),r=pl(t,n,2),r!==null&&(Ag(n,r,t,e),Bt(r,2),fa(r));break}}t=t.return}}function qd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new sw;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(n)||(_d=!0,c.add(n),e=dw.bind(null,e,t,n),t.then(e,e))}function dw(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ut===e&&(qe&n)===n&&(bt===4||bt===3&&(qe&62914560)===qe&&300>Kt()-Ai?(Xe&2)===0&&es(e,0):kd|=n,Jr===qe&&(Jr=0)),fa(e)}function Tv(e,t){t===0&&(t=ct()),e=Fl(e,t),e!==null&&(Bt(e,t),fa(e))}function fw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Tv(e,n)}function hw(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Tv(e,n)}function mw(e,t){return Jt(e,t)}var Li=null,ns=null,Id=!1,Ui=!1,Vd=!1,Cl=0;function fa(e){e!==ns&&e.next===null&&(ns===null?Li=ns=e:ns=ns.next=e),Ui=!0,Id||(Id=!0,gw())}function so(e,t){if(!Vd&&Ui){Vd=!0;do for(var n=!1,r=Li;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var f=0;else{var b=r.suspendedLanes,R=r.pingedLanes;f=(1<<31-Et(42|e)+1)-1,f&=c&~(b&~R),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,Ov(r,f))}else f=qe,f=wr(r,r===ut?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(f&3)===0||Te(r,f)||(n=!0,Ov(r,f));r=r.next}while(n);Vd=!1}}function pw(){Av()}function Av(){Ui=Id=!1;var e=0;Cl!==0&&Rw()&&(e=Cl);for(var t=Kt(),n=null,r=Li;r!==null;){var c=r.next,f=Mv(r,t);f===0?(r.next=null,n===null?Li=c:n.next=c,c===null&&(ns=n)):(n=r,(e!==0||(f&3)!==0)&&(Ui=!0)),r=c}Dt!==0&&Dt!==5||so(e),Cl!==0&&(Cl=0)}function Mv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-Et(f),R=1<<b,k=c[b];k===-1?((R&n)===0||(R&r)!==0)&&(c[b]=Qe(R,t)):k<=t&&(e.expiredLanes|=R),f&=~R}if(t=ut,n=qe,n=wr(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&pn(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Te(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&pn(r),lu(n)){case 2:case 8:n=Ea;break;case 32:n=br;break;case 268435456:n=Vl;break;default:n=br}return r=Dv.bind(null,e),n=Jt(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&pn(r),e.callbackPriority=2,e.callbackNode=null,2}function Dv(e,t){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(zi()&&e.callbackNode!==n)return null;var r=qe;return r=wr(e,e===ut?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(fv(e,r,t),Mv(e,Kt()),e.callbackNode!=null&&e.callbackNode===n?Dv.bind(null,e):null)}function Ov(e,t){if(zi())return null;fv(e,t,!0)}function gw(){Tw(function(){(Xe&6)!==0?Jt(Xt,pw):Av()})}function Gd(){if(Cl===0){var e=qr;e===0&&(e=Gl,Gl<<=1,(Gl&261888)===0&&(Gl=256)),Cl=e}return Cl}function _v(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yo(""+e)}function kv(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vw(e,t,n,r,c){if(t==="submit"&&n&&n.stateNode===c){var f=_v((c[en]||null).action),b=r.submitter;b&&(t=(t=b[en]||null)?_v(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var R=new Fo("action","action",null,r,c);e.push({event:R,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Cl!==0){var k=b?kv(c,b):new FormData(c);ud(n,{pending:!0,data:k,method:c.method,action:f},null,k)}}else typeof f=="function"&&(R.preventDefault(),k=b?kv(c,b):new FormData(c),ud(n,{pending:!0,data:k,method:c.method,action:f},f,k))},currentTarget:c}]})}}for(var Yd=0;Yd<Nu.length;Yd++){var $d=Nu[Yd],xw=$d.toLowerCase(),yw=$d[0].toUpperCase()+$d.slice(1);Wn(xw,"on"+yw)}Wn(dp,"onAnimationEnd"),Wn(fp,"onAnimationIteration"),Wn(hp,"onAnimationStart"),Wn("dblclick","onDoubleClick"),Wn("focusin","onFocus"),Wn("focusout","onBlur"),Wn(zS,"onTransitionRun"),Wn(LS,"onTransitionStart"),Wn(US,"onTransitionCancel"),Wn(mp,"onTransitionEnd"),Nr("onMouseEnter",["mouseout","mouseover"]),Nr("onMouseLeave",["mouseout","mouseover"]),Nr("onPointerEnter",["pointerout","pointerover"]),Nr("onPointerLeave",["pointerout","pointerover"]),Yl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oo="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(" "),bw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(oo));function zv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],c=r.event;r=r.listeners;e:{var f=void 0;if(t)for(var b=r.length-1;0<=b;b--){var R=r[b],k=R.instance,G=R.currentTarget;if(R=R.listener,k!==f&&c.isPropagationStopped())break e;f=R,c.currentTarget=G;try{f(c)}catch(J){Jo(J)}c.currentTarget=null,f=k}else for(b=0;b<r.length;b++){if(R=r[b],k=R.instance,G=R.currentTarget,R=R.listener,k!==f&&c.isPropagationStopped())break e;f=R,c.currentTarget=G;try{f(c)}catch(J){Jo(J)}c.currentTarget=null,f=k}}}}function He(e,t){var n=t[ru];n===void 0&&(n=t[ru]=new Set);var r=e+"__bubble";n.has(r)||(Lv(t,e,2,!1),n.add(r))}function Kd(e,t,n){var r=0;t&&(r|=4),Lv(n,e,r,t)}var Bi="_reactListening"+Math.random().toString(36).slice(2);function Xd(e){if(!e[Bi]){e[Bi]=!0,Am.forEach(function(n){n!=="selectionchange"&&(bw.has(n)||Kd(n,!1,e),Kd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Bi]||(t[Bi]=!0,Kd("selectionchange",!1,t))}}function Lv(e,t,n,r){switch(dx(t)){case 2:var c=Xw;break;case 8:c=Fw;break;default:c=uf}n=c.bind(null,t,n,e),c=void 0,!mu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function Fd(e,t,n,r,c){var f=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var b=r.tag;if(b===3||b===4){var R=r.stateNode.containerInfo;if(R===c)break;if(b===4)for(b=r.return;b!==null;){var k=b.tag;if((k===3||k===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;R!==null;){if(b=Cr(R),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){r=f=b;continue e}R=R.parentNode}}r=r.return}qm(function(){var G=f,J=fu(n),te=[];e:{var Y=pp.get(e);if(Y!==void 0){var F=Fo,ge=e;switch(e){case"keypress":if(Ko(n)===0)break e;case"keydown":case"keyup":F=hS;break;case"focusin":ge="focus",F=xu;break;case"focusout":ge="blur",F=xu;break;case"beforeblur":case"afterblur":F=xu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=Gm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=tS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=gS;break;case dp:case fp:case hp:F=lS;break;case mp:F=xS;break;case"scroll":case"scrollend":F=W1;break;case"wheel":F=bS;break;case"copy":case"cut":case"paste":F=sS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=$m;break;case"toggle":case"beforetoggle":F=wS}var Re=(t&4)!==0,st=!Re&&(e==="scroll"||e==="scrollend"),P=Re?Y!==null?Y+"Capture":null:Y;Re=[];for(var L=G,V;L!==null;){var ee=L;if(V=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||V===null||P===null||(ee=As(L,P),ee!=null&&Re.push(io(L,ee,V))),st)break;L=L.return}0<Re.length&&(Y=new F(Y,ge,null,n,J),te.push({event:Y,listeners:Re}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",Y&&n!==du&&(ge=n.relatedTarget||n.fromElement)&&(Cr(ge)||ge[jr]))break e;if((F||Y)&&(Y=J.window===J?J:(Y=J.ownerDocument)?Y.defaultView||Y.parentWindow:window,F?(ge=n.relatedTarget||n.toElement,F=G,ge=ge?Cr(ge):null,ge!==null&&(st=d(ge),Re=ge.tag,ge!==st||Re!==5&&Re!==27&&Re!==6)&&(ge=null)):(F=null,ge=G),F!==ge)){if(Re=Gm,ee="onMouseLeave",P="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Re=$m,ee="onPointerLeave",P="onPointerEnter",L="pointer"),st=F==null?Y:Ts(F),V=ge==null?Y:Ts(ge),Y=new Re(ee,L+"leave",F,n,J),Y.target=st,Y.relatedTarget=V,ee=null,Cr(J)===G&&(Re=new Re(P,L+"enter",ge,n,J),Re.target=V,Re.relatedTarget=st,ee=Re),st=ee,F&&ge)t:{for(Re=Sw,P=F,L=ge,V=0,ee=P;ee;ee=Re(ee))V++;ee=0;for(var we=L;we;we=Re(we))ee++;for(;0<V-ee;)P=Re(P),V--;for(;0<ee-V;)L=Re(L),ee--;for(;V--;){if(P===L||L!==null&&P===L.alternate){Re=P;break t}P=Re(P),L=Re(L)}Re=null}else Re=null;F!==null&&Uv(te,Y,F,Re,!1),ge!==null&&st!==null&&Uv(te,st,ge,Re,!0)}}e:{if(Y=G?Ts(G):window,F=Y.nodeName&&Y.nodeName.toLowerCase(),F==="select"||F==="input"&&Y.type==="file")var Ye=ep;else if(Jm(Y))if(tp)Ye=OS;else{Ye=MS;var ye=AS}else F=Y.nodeName,!F||F.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?G&&uu(G.elementType)&&(Ye=ep):Ye=DS;if(Ye&&(Ye=Ye(e,G))){Wm(te,Ye,n,J);break e}ye&&ye(e,Y,G),e==="focusout"&&G&&Y.type==="number"&&G.memoizedProps.value!=null&&cu(Y,"number",Y.value)}switch(ye=G?Ts(G):window,e){case"focusin":(Jm(ye)||ye.contentEditable==="true")&&(_r=ye,Cu=G,Us=null);break;case"focusout":Us=Cu=_r=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,cp(te,n,J);break;case"selectionchange":if(kS)break;case"keydown":case"keyup":cp(te,n,J)}var ke;if(bu)e:{switch(e){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else Or?Qm(e,n)&&(Ie="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ie="onCompositionStart");Ie&&(Km&&n.locale!=="ko"&&(Or||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&Or&&(ke=Im()):(il=J,pu="value"in il?il.value:il.textContent,Or=!0)),ye=Hi(G,Ie),0<ye.length&&(Ie=new Ym(Ie,e,null,n,J),te.push({event:Ie,listeners:ye}),ke?Ie.data=ke:(ke=Zm(n),ke!==null&&(Ie.data=ke)))),(ke=CS?ES(e,n):RS(e,n))&&(Ie=Hi(G,"onBeforeInput"),0<Ie.length&&(ye=new Ym("onBeforeInput","beforeinput",null,n,J),te.push({event:ye,listeners:Ie}),ye.data=ke)),vw(te,e,G,n,J)}zv(te,t)})}function io(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Hi(e,t){for(var n=t+"Capture",r=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=As(e,n),c!=null&&r.unshift(io(e,c,f)),c=As(e,t),c!=null&&r.push(io(e,c,f))),e.tag===3)return r;e=e.return}return[]}function Sw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Uv(e,t,n,r,c){for(var f=t._reactName,b=[];n!==null&&n!==r;){var R=n,k=R.alternate,G=R.stateNode;if(R=R.tag,k!==null&&k===r)break;R!==5&&R!==26&&R!==27||G===null||(k=G,c?(G=As(n,f),G!=null&&b.unshift(io(n,G,k))):c||(G=As(n,f),G!=null&&b.push(io(n,G,k)))),n=n.return}b.length!==0&&e.push({event:t,listeners:b})}var ww=/\r\n?/g,jw=/\u0000|\uFFFD/g;function Bv(e){return(typeof e=="string"?e:""+e).replace(ww,`
|
|
49
|
-
`).replace(jw,"")}function Hv(e,t){return t=Bv(t),Bv(e)===t}function rt(e,t,n,r,c,f){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Ar(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Ar(e,""+r);break;case"className":Vo(e,"class",r);break;case"tabIndex":Vo(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Vo(e,n,r);break;case"style":Hm(e,r,f);break;case"data":if(t!=="object"){Vo(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Yo(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"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 f=="function"&&(n==="formAction"?(t!=="input"&&rt(e,t,"name",c.name,c,null),rt(e,t,"formEncType",c.formEncType,c,null),rt(e,t,"formMethod",c.formMethod,c,null),rt(e,t,"formTarget",c.formTarget,c,null)):(rt(e,t,"encType",c.encType,c,null),rt(e,t,"method",c.method,c,null),rt(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Yo(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=Ta);break;case"onScroll":r!=null&&He("scroll",e);break;case"onScrollEnd":r!=null&&He("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=Yo(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":He("beforetoggle",e),He("toggle",e),Io(e,"popover",r);break;case"xlinkActuate":Na(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Na(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Na(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Na(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Na(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Na(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Na(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Na(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Na(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Io(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Z1.get(n)||n,Io(e,n,r))}}function Qd(e,t,n,r,c,f){switch(n){case"style":Hm(e,r,f);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Ar(e,r):(typeof r=="number"||typeof r=="bigint")&&Ar(e,""+r);break;case"onScroll":r!=null&&He("scroll",e);break;case"onScrollEnd":r!=null&&He("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Ta);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mm.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),t=n.slice(2,c?n.length-7:void 0),f=e[en]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,c),typeof r=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,c);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):Io(e,n,r)}}}function Vt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("load",e);var r=!1,c=!1,f;for(f in n)if(n.hasOwnProperty(f)){var b=n[f];if(b!=null)switch(f){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:rt(e,t,f,b,n,null)}}c&&rt(e,t,"srcSet",n.srcSet,n,null),r&&rt(e,t,"src",n.src,n,null);return;case"input":He("invalid",e);var R=f=b=c=null,k=null,G=null;for(r in n)if(n.hasOwnProperty(r)){var J=n[r];if(J!=null)switch(r){case"name":c=J;break;case"type":b=J;break;case"checked":k=J;break;case"defaultChecked":G=J;break;case"value":f=J;break;case"defaultValue":R=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(137,t));break;default:rt(e,t,r,J,n,null)}}zm(e,f,R,k,G,b,c,!1);return;case"select":He("invalid",e),r=b=f=null;for(c in n)if(n.hasOwnProperty(c)&&(R=n[c],R!=null))switch(c){case"value":f=R;break;case"defaultValue":b=R;break;case"multiple":r=R;default:rt(e,t,c,R,n,null)}t=f,n=b,e.multiple=!!r,t!=null?Tr(e,!!r,t,!1):n!=null&&Tr(e,!!r,n,!0);return;case"textarea":He("invalid",e),f=c=r=null;for(b in n)if(n.hasOwnProperty(b)&&(R=n[b],R!=null))switch(b){case"value":r=R;break;case"defaultValue":c=R;break;case"children":f=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(i(91));break;default:rt(e,t,b,R,n,null)}Um(e,r,c,f);return;case"option":for(k in n)if(n.hasOwnProperty(k)&&(r=n[k],r!=null))switch(k){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:rt(e,t,k,r,n,null)}return;case"dialog":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(r=0;r<oo.length;r++)He(oo[r],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("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(G in n)if(n.hasOwnProperty(G)&&(r=n[G],r!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:rt(e,t,G,r,n,null)}return;default:if(uu(t)){for(J in n)n.hasOwnProperty(J)&&(r=n[J],r!==void 0&&Qd(e,t,J,r,n,void 0));return}}for(R in n)n.hasOwnProperty(R)&&(r=n[R],r!=null&&rt(e,t,R,r,n,null))}function Cw(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,b=null,R=null,k=null,G=null,J=null;for(F in n){var te=n[F];if(n.hasOwnProperty(F)&&te!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":k=te;default:r.hasOwnProperty(F)||rt(e,t,F,null,r,te)}}for(var Y in r){var F=r[Y];if(te=n[Y],r.hasOwnProperty(Y)&&(F!=null||te!=null))switch(Y){case"type":f=F;break;case"name":c=F;break;case"checked":G=F;break;case"defaultChecked":J=F;break;case"value":b=F;break;case"defaultValue":R=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(137,t));break;default:F!==te&&rt(e,t,Y,F,r,te)}}iu(e,b,R,k,G,J,f,c);return;case"select":F=b=R=Y=null;for(f in n)if(k=n[f],n.hasOwnProperty(f)&&k!=null)switch(f){case"value":break;case"multiple":F=k;default:r.hasOwnProperty(f)||rt(e,t,f,null,r,k)}for(c in r)if(f=r[c],k=n[c],r.hasOwnProperty(c)&&(f!=null||k!=null))switch(c){case"value":Y=f;break;case"defaultValue":R=f;break;case"multiple":b=f;default:f!==k&&rt(e,t,c,f,r,k)}t=R,n=b,r=F,Y!=null?Tr(e,!!n,Y,!1):!!r!=!!n&&(t!=null?Tr(e,!!n,t,!0):Tr(e,!!n,n?[]:"",!1));return;case"textarea":F=Y=null;for(R in n)if(c=n[R],n.hasOwnProperty(R)&&c!=null&&!r.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:rt(e,t,R,null,r,c)}for(b in r)if(c=r[b],f=n[b],r.hasOwnProperty(b)&&(c!=null||f!=null))switch(b){case"value":Y=c;break;case"defaultValue":F=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==f&&rt(e,t,b,c,r,f)}Lm(e,Y,F);return;case"option":for(var ge in n)if(Y=n[ge],n.hasOwnProperty(ge)&&Y!=null&&!r.hasOwnProperty(ge))switch(ge){case"selected":e.selected=!1;break;default:rt(e,t,ge,null,r,Y)}for(k in r)if(Y=r[k],F=n[k],r.hasOwnProperty(k)&&Y!==F&&(Y!=null||F!=null))switch(k){case"selected":e.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:rt(e,t,k,Y,r,F)}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 Re in n)Y=n[Re],n.hasOwnProperty(Re)&&Y!=null&&!r.hasOwnProperty(Re)&&rt(e,t,Re,null,r,Y);for(G in r)if(Y=r[G],F=n[G],r.hasOwnProperty(G)&&Y!==F&&(Y!=null||F!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,t));break;default:rt(e,t,G,Y,r,F)}return;default:if(uu(t)){for(var st in n)Y=n[st],n.hasOwnProperty(st)&&Y!==void 0&&!r.hasOwnProperty(st)&&Qd(e,t,st,void 0,r,Y);for(J in r)Y=r[J],F=n[J],!r.hasOwnProperty(J)||Y===F||Y===void 0&&F===void 0||Qd(e,t,J,Y,r,F);return}}for(var P in n)Y=n[P],n.hasOwnProperty(P)&&Y!=null&&!r.hasOwnProperty(P)&&rt(e,t,P,null,r,Y);for(te in r)Y=r[te],F=n[te],!r.hasOwnProperty(te)||Y===F||Y==null&&F==null||rt(e,t,te,Y,r,F)}function Pv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ew(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var c=n[r],f=c.transferSize,b=c.initiatorType,R=c.duration;if(f&&R&&Pv(b)){for(b=0,R=c.responseEnd,r+=1;r<n.length;r++){var k=n[r],G=k.startTime;if(G>R)break;var J=k.transferSize,te=k.initiatorType;J&&Pv(te)&&(k=k.responseEnd,b+=J*(k<R?1:(R-G)/(k-G)))}if(--r,t+=8*(f+b)/(c.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 Zd=null,Jd=null;function Pi(e){return e.nodeType===9?e:e.ownerDocument}function qv(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 Iv(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 Wd(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 ef=null;function Rw(){var e=window.event;return e&&e.type==="popstate"?e===ef?!1:(ef=e,!0):(ef=null,!1)}var Vv=typeof setTimeout=="function"?setTimeout:void 0,Nw=typeof clearTimeout=="function"?clearTimeout:void 0,Gv=typeof Promise=="function"?Promise:void 0,Tw=typeof queueMicrotask=="function"?queueMicrotask:typeof Gv<"u"?function(e){return Gv.resolve(null).then(e).catch(Aw)}:Vv;function Aw(e){setTimeout(function(){throw e})}function El(e){return e==="head"}function Yv(e,t){var n=t,r=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(c),ss(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")co(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,co(n);for(var f=n.firstChild;f;){var b=f.nextSibling,R=f.nodeName;f[Ns]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=b}}else n==="body"&&co(e.ownerDocument.body);n=c}while(n);ss(t)}function $v(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":tf(n),su(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Mw(e,t,n,r){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Ns])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Hn(e.nextSibling),e===null)break}return null}function Dw(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Hn(e.nextSibling),e===null))return null;return e}function Kv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Hn(e.nextSibling),e===null))return null;return e}function nf(e){return e.data==="$?"||e.data==="$~"}function af(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ow(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Hn(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 lf=null;function Xv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Hn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Fv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Qv(e,t,n){switch(t=Pi(n),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function co(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);su(e)}var Pn=new Map,Zv=new Set;function qi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ga=$.d;$.d={f:_w,r:kw,D:zw,C:Lw,L:Uw,m:Bw,X:Pw,S:Hw,M:qw};function _w(){var e=Ga.f(),t=Oi();return e||t}function kw(e){var t=Er(e);t!==null&&t.tag===5&&t.type==="form"?mg(t):Ga.r(e)}var as=typeof document>"u"?null:document;function Jv(e,t,n){var r=as;if(r&&typeof t=="string"&&t){var c=On(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),Zv.has(c)||(Zv.add(c),e={rel:e,crossOrigin:n,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Vt(t,"link",e),kt(t),r.head.appendChild(t)))}}function zw(e){Ga.D(e),Jv("dns-prefetch",e,null)}function Lw(e,t){Ga.C(e,t),Jv("preconnect",e,t)}function Uw(e,t,n){Ga.L(e,t,n);var r=as;if(r&&e&&t){var c='link[rel="preload"][as="'+On(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+On(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+On(n.imageSizes)+'"]')):c+='[href="'+On(e)+'"]';var f=c;switch(t){case"style":f=ls(e);break;case"script":f=rs(e)}Pn.has(f)||(e=y({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Pn.set(f,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(uo(f))||t==="script"&&r.querySelector(fo(f))||(t=r.createElement("link"),Vt(t,"link",e),kt(t),r.head.appendChild(t)))}}function Bw(e,t){Ga.m(e,t);var n=as;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+On(r)+'"][href="'+On(e)+'"]',f=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=rs(e)}if(!Pn.has(f)&&(e=y({rel:"modulepreload",href:e},t),Pn.set(f,e),n.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(fo(f)))return}r=n.createElement("link"),Vt(r,"link",e),kt(r),n.head.appendChild(r)}}}function Hw(e,t,n){Ga.S(e,t,n);var r=as;if(r&&e){var c=Rr(r).hoistableStyles,f=ls(e);t=t||"default";var b=c.get(f);if(!b){var R={loading:0,preload:null};if(b=r.querySelector(uo(f)))R.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Pn.get(f))&&rf(e,n);var k=b=r.createElement("link");kt(k),Vt(k,"link",e),k._p=new Promise(function(G,J){k.onload=G,k.onerror=J}),k.addEventListener("load",function(){R.loading|=1}),k.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Ii(b,t,r)}b={type:"stylesheet",instance:b,count:1,state:R},c.set(f,b)}}}function Pw(e,t){Ga.X(e,t);var n=as;if(n&&e){var r=Rr(n).hoistableScripts,c=rs(e),f=r.get(c);f||(f=n.querySelector(fo(c)),f||(e=y({src:e,async:!0},t),(t=Pn.get(c))&&sf(e,t),f=n.createElement("script"),kt(f),Vt(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(c,f))}}function qw(e,t){Ga.M(e,t);var n=as;if(n&&e){var r=Rr(n).hoistableScripts,c=rs(e),f=r.get(c);f||(f=n.querySelector(fo(c)),f||(e=y({src:e,async:!0,type:"module"},t),(t=Pn.get(c))&&sf(e,t),f=n.createElement("script"),kt(f),Vt(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(c,f))}}function Wv(e,t,n,r){var c=(c=be.current)?qi(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ls(n.href),n=Rr(c).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ls(n.href);var f=Rr(c).hoistableStyles,b=f.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=c.querySelector(uo(e)))&&!f._p&&(b.instance=f,b.state.loading=5),Pn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Pn.set(e,n),f||Iw(c,e,n,b.state))),t&&r===null)throw Error(i(528,""));return b}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=rs(n),n=Rr(c).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function ls(e){return'href="'+On(e)+'"'}function uo(e){return'link[rel="stylesheet"]['+e+"]"}function ex(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Iw(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Vt(t,"link",n),kt(t),e.head.appendChild(t))}function rs(e){return'[src="'+On(e)+'"]'}function fo(e){return"script[async]"+e}function tx(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+On(n.href)+'"]');if(r)return t.instance=r,kt(r),r;var c=y({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),kt(r),Vt(r,"style",c),Ii(r,n.precedence,e),t.instance=r;case"stylesheet":c=ls(n.href);var f=e.querySelector(uo(c));if(f)return t.state.loading|=4,t.instance=f,kt(f),f;r=ex(n),(c=Pn.get(c))&&rf(r,c),f=(e.ownerDocument||e).createElement("link"),kt(f);var b=f;return b._p=new Promise(function(R,k){b.onload=R,b.onerror=k}),Vt(f,"link",r),t.state.loading|=4,Ii(f,n.precedence,e),t.instance=f;case"script":return f=rs(n.src),(c=e.querySelector(fo(f)))?(t.instance=c,kt(c),c):(r=n,(c=Pn.get(f))&&(r=y({},n),sf(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),kt(c),Vt(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ii(r,n.precedence,e));return t.instance}function Ii(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,f=c,b=0;b<r.length;b++){var R=r[b];if(R.dataset.precedence===t)f=R;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function rf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function sf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vi=null;function nx(e,t,n){if(Vi===null){var r=new Map,c=Vi=new Map;c.set(n,r)}else c=Vi,r=c.get(n),r||(r=new Map,c.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var f=n[c];if(!(f[Ns]||f[Ht]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var R=r.get(b);R?R.push(f):r.set(b,[f])}}return r}function ax(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Vw(e,t,n){if(n===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 lx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Gw(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=ls(r.href),f=t.querySelector(uo(c));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Gi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,kt(f);return}f=t.ownerDocument||t,r=ex(r),(c=Pn.get(c))&&rf(r,c),f=f.createElement("link"),kt(f);var b=f;b._p=new Promise(function(R,k){b.onload=R,b.onerror=k}),Vt(f,"link",r),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Gi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var of=0;function Yw(e,t){return e.stylesheets&&e.count===0&&$i(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&$i(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&of===0&&(of=62500*Ew());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$i(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>of?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Gi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$i(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yi=null;function $i(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yi=new Map,t.forEach($w,e),Yi=null,Gi.call(e))}function $w(e,t){if(!(t.state.loading&4)){var n=Yi.get(e);if(n)var r=n.get(null);else{n=new Map,Yi.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var b=c[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(n.set(b.dataset.precedence,b),r=b)}r&&n.set(null,r)}c=t.instance,b=c.getAttribute("data-precedence"),f=n.get(b)||r,f===r&&n.set(null,c),n.set(b,c),this.count++,r=Gi.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ho={$$typeof:T,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function Kw(e,t,n,r,c,f,b,R,k){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=Ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ft(0),this.hiddenUpdates=Ft(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function rx(e,t,n,r,c,f,b,R,k,G,J,te){return e=new Kw(e,t,n,b,k,G,J,te,R),t=1,f===!0&&(t|=24),f=vn(3,null,null,t),e.current=f,f.stateNode=e,t=Pu(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:r,isDehydrated:n,cache:t},Gu(f),e}function sx(e){return e?(e=Lr,e):Lr}function ox(e,t,n,r,c,f){c=sx(c),r.context===null?r.context=c:r.pendingContext=c,r=ml(t),r.payload={element:n},f=f===void 0?null:f,f!==null&&(r.callback=f),n=pl(e,r,t),n!==null&&(sn(n,e,t),Gs(n,e,t))}function ix(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cf(e,t){ix(e,t),(e=e.alternate)&&ix(e,t)}function cx(e){if(e.tag===13||e.tag===31){var t=Fl(e,67108864);t!==null&&sn(t,e,67108864),cf(e,67108864)}}function ux(e){if(e.tag===13||e.tag===31){var t=wn();t=au(t);var n=Fl(e,t);n!==null&&sn(n,e,t),cf(e,t)}}var Ki=!0;function Xw(e,t,n,r){var c=U.T;U.T=null;var f=$.p;try{$.p=2,uf(e,t,n,r)}finally{$.p=f,U.T=c}}function Fw(e,t,n,r){var c=U.T;U.T=null;var f=$.p;try{$.p=8,uf(e,t,n,r)}finally{$.p=f,U.T=c}}function uf(e,t,n,r){if(Ki){var c=df(r);if(c===null)Fd(e,t,r,Xi,n),fx(e,r);else if(Zw(c,e,t,n,r))r.stopPropagation();else if(fx(e,r),t&4&&-1<Qw.indexOf(e)){for(;c!==null;){var f=Er(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=Gt(f.pendingLanes);if(b!==0){var R=f;for(R.pendingLanes|=2,R.entangledLanes|=2;b;){var k=1<<31-Et(b);R.entanglements[1]|=k,b&=~k}fa(f),(Xe&6)===0&&(Mi=Kt()+500,so(0))}}break;case 31:case 13:R=Fl(f,2),R!==null&&sn(R,f,2),Oi(),cf(f,2)}if(f=df(r),f===null&&Fd(e,t,r,Xi,n),f===c)break;c=f}c!==null&&r.stopPropagation()}else Fd(e,t,r,null,n)}}function df(e){return e=fu(e),ff(e)}var Xi=null;function ff(e){if(Xi=null,e=Cr(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Xi=e,null}function dx(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(Jc()){case Xt:return 2;case Ea:return 8;case br:case Wc:return 32;case Vl:return 268435456;default:return 32}default:return 32}}var hf=!1,Rl=null,Nl=null,Tl=null,mo=new Map,po=new Map,Al=[],Qw="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 fx(e,t){switch(e){case"focusin":case"focusout":Rl=null;break;case"dragenter":case"dragleave":Nl=null;break;case"mouseover":case"mouseout":Tl=null;break;case"pointerover":case"pointerout":mo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":po.delete(t.pointerId)}}function go(e,t,n,r,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:f,targetContainers:[c]},t!==null&&(t=Er(t),t!==null&&cx(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Zw(e,t,n,r,c){switch(t){case"focusin":return Rl=go(Rl,e,t,n,r,c),!0;case"dragenter":return Nl=go(Nl,e,t,n,r,c),!0;case"mouseover":return Tl=go(Tl,e,t,n,r,c),!0;case"pointerover":var f=c.pointerId;return mo.set(f,go(mo.get(f)||null,e,t,n,r,c)),!0;case"gotpointercapture":return f=c.pointerId,po.set(f,go(po.get(f)||null,e,t,n,r,c)),!0}return!1}function hx(e){var t=Cr(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,Nm(e.priority,function(){ux(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,Nm(e.priority,function(){ux(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=df(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);du=r,n.target.dispatchEvent(r),du=null}else return t=Er(n),t!==null&&cx(t),e.blockedOn=n,!1;t.shift()}return!0}function mx(e,t,n){Fi(e)&&n.delete(t)}function Jw(){hf=!1,Rl!==null&&Fi(Rl)&&(Rl=null),Nl!==null&&Fi(Nl)&&(Nl=null),Tl!==null&&Fi(Tl)&&(Tl=null),mo.forEach(mx),po.forEach(mx)}function Qi(e,t){e.blockedOn===t&&(e.blockedOn=null,hf||(hf=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Jw)))}var Zi=null;function px(e){Zi!==e&&(Zi=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Zi===e&&(Zi=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(ff(r||n)===null)continue;break}var f=Er(n);f!==null&&(e.splice(t,3),t-=3,ud(f,{pending:!0,data:c,method:n.method,action:r},r,c))}}))}function ss(e){function t(k){return Qi(k,e)}Rl!==null&&Qi(Rl,e),Nl!==null&&Qi(Nl,e),Tl!==null&&Qi(Tl,e),mo.forEach(t),po.forEach(t);for(var n=0;n<Al.length;n++){var r=Al[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Al.length&&(n=Al[0],n.blockedOn===null);)hx(n),n.blockedOn===null&&Al.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var c=n[r],f=n[r+1],b=c[en]||null;if(typeof f=="function")b||px(n);else if(b){var R=null;if(f&&f.hasAttribute("formAction")){if(c=f,b=f[en]||null)R=b.formAction;else if(ff(c)!==null)continue}else R=b.action;typeof R=="function"?n[r+1]=R:(n.splice(r,3),r-=3),px(n)}}}function gx(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return c=b})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function mf(e){this._internalRoot=e}Ji.prototype.render=mf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current,r=wn();ox(n,r,e,t,null,null)},Ji.prototype.unmount=mf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ox(e.current,2,null,e,null,null),Oi(),t[jr]=null}};function Ji(e){this._internalRoot=e}Ji.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Al.length&&t!==0&&t<Al[n].priority;n++);Al.splice(n,0,e),n===0&&hx(e)}};var vx=l.version;if(vx!=="19.2.8")throw Error(i(527,vx,"19.2.8"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var Ww={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wi.isDisabled&&Wi.supportsFiber)try{Ra=Wi.inject(Ww),Ct=Wi}catch{}}return xo.createRoot=function(e,t){if(!u(e))throw Error(i(299));var n=!1,r="",c=Cg,f=Eg,b=Rg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=rx(e,1,!1,null,null,n,r,null,c,f,b,gx),e[jr]=t.current,Xd(e),new mf(t)},xo.hydrateRoot=function(e,t,n){if(!u(e))throw Error(i(299));var r=!1,c="",f=Cg,b=Eg,R=Rg,k=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(b=n.onCaughtError),n.onRecoverableError!==void 0&&(R=n.onRecoverableError),n.formState!==void 0&&(k=n.formState)),t=rx(e,1,!0,t,n??null,r,c,k,f,b,R,gx),t.context=sx(null),n=t.current,r=wn(),r=au(r),c=ml(r),c.callback=null,pl(n,c,r),n=r,t.current.lanes=n,Bt(t,n),fa(t),e[jr]=t.current,Xd(e),new Ji(t)},xo.version="19.2.8",xo}var Mx;function cj(){if(Mx)return xf.exports;Mx=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),xf.exports=ij(),xf.exports}var uj=cj();const dj=vh(uj);/**
|
|
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 yh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,wy=/^[\\/]{2}/;function fj(a,l){return l+a.replace(/\\/g,"/")}var Dx="popstate";function Ox(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function hj(a={}){function l(i,u){var v;let d=(v=u.state)==null?void 0:v.masked,{pathname:h,search:p,hash:g}=d||i.location;return Pf("",{pathname:h,search:p,hash:g},u.state&&u.state.usr||null,u.state&&u.state.key||"default",d?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function o(i,u){return typeof u=="string"?u:Co(u)}return pj(l,o,null,a)}function xt(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function $n(a,l){if(!a){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function mj(){return Math.random().toString(36).substring(2,10)}function _x(a,l){return{usr:a.state,key:a.key,idx:l,masked:a.mask?{pathname:a.pathname,search:a.search,hash:a.hash}:void 0}}function Pf(a,l,o=null,i,u){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof l=="string"?vs(l):l,state:o,key:l&&l.key||i||mj(),mask:u}}function Co({pathname:a="/",search:l="",hash:o=""}){return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function vs(a){let l={};if(a){let o=a.indexOf("#");o>=0&&(l.hash=a.substring(o),a=a.substring(0,o));let i=a.indexOf("?");i>=0&&(l.search=a.substring(i),a=a.substring(0,i)),a&&(l.pathname=a)}return l}function pj(a,l,o,i={}){let{window:u=document.defaultView,v5Compat:d=!1}=i,h=u.history,p="POP",g=null,v=x();v==null&&(v=0,h.replaceState({...h.state,idx:v},""));function x(){return(h.state||{idx:null}).idx}function y(){p="POP";let j=x(),N=j==null?null:j-v;v=j,g&&g({action:p,location:E.location,delta:N})}function S(j,N){p="PUSH";let A=Ox(j)?j:Pf(E.location,j,N);v=x()+1;let T=_x(A,v),O=E.createHref(A.mask||A);try{h.pushState(T,"",O)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;u.location.assign(O)}d&&g&&g({action:p,location:E.location,delta:1})}function w(j,N){p="REPLACE";let A=Ox(j)?j:Pf(E.location,j,N);v=x();let T=_x(A,v),O=E.createHref(A.mask||A);h.replaceState(T,"",O),d&&g&&g({action:p,location:E.location,delta:0})}function C(j){return gj(u,j)}let E={get action(){return p},get location(){return a(u,h)},listen(j){if(g)throw new Error("A history only accepts one active listener");return u.addEventListener(Dx,y),g=j,()=>{u.removeEventListener(Dx,y),g=null}},createHref(j){return l(u,j)},createURL:C,encodeLocation(j){let N=C(j);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:S,replace:w,go(j){return h.go(j)}};return E}function gj(a,l,o=!1){let i="http://localhost";a&&(i=a.location.origin!=="null"?a.location.origin:a.location.href),xt(i,"No window.location.(origin|href) available to create URL");let u=typeof l=="string"?l:Co(l);return u=u.replace(/ $/,"%20"),!o&&wy.test(u)&&(u=i+u),new URL(u,i)}function jy(a,l,o="/"){return vj(a,l,o,!1)}function vj(a,l,o,i,u){let d=typeof l=="string"?vs(l):l,h=Za(d.pathname||"/",o);if(h==null)return null;let p=xj(a),g=null,v=Aj(h);for(let x=0;g==null&&x<p.length;++x)g=Tj(p[x],v,i);return g}function xj(a){let l=Cy(a);return yj(l),l}function Cy(a,l=[],o=[],i="",u=!1){let d=(h,p,g=u,v)=>{let x={relativePath:v===void 0?h.path||"":v,caseSensitive:h.caseSensitive===!0,childrenIndex:p,route:h};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(i)&&g)return;xt(x.relativePath.startsWith(i),`Absolute route path "${x.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(i.length)}let y=la([i,x.relativePath]),S=o.concat(x);h.children&&h.children.length>0&&(xt(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Cy(h.children,l,S,y,g)),!(h.path==null&&!h.index)&&l.push({path:y,score:Rj(y,h.index),routesMeta:S.map((w,C)=>{let[E,j]=Ny(w.relativePath,w.caseSensitive,C===S.length-1);return{...w,matcher:E,compiledParams:j}})})};return a.forEach((h,p)=>{var g;if(h.path===""||!((g=h.path)!=null&&g.includes("?")))d(h,p);else for(let v of Ey(h.path))d(h,p,!0,v)}),l}function Ey(a){let l=a.split("/");if(l.length===0)return[];let[o,...i]=l,u=o.endsWith("?"),d=o.replace(/\?$/,"");if(i.length===0)return u?[d,""]:[d];let h=Ey(i.join("/")),p=[];return p.push(...h.map(g=>g===""?d:[d,g].join("/"))),u&&p.push(...h),p.map(g=>a.startsWith("/")&&g===""?"/":g)}function yj(a){a.sort((l,o)=>l.score!==o.score?o.score-l.score:Nj(l.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var bj=/^:[\w-]+$/,Sj=3,wj=2,jj=1,Cj=10,Ej=-2,kx=a=>a==="*";function Rj(a,l){let o=a.split("/"),i=o.length;return o.some(kx)&&(i+=Ej),l&&(i+=wj),o.filter(u=>!kx(u)).reduce((u,d)=>u+(bj.test(d)?Sj:d===""?jj:Cj),i)}function Nj(a,l){return a.length===l.length&&a.slice(0,-1).every((i,u)=>i===l[u])?a[a.length-1]-l[l.length-1]:0}function Tj(a,l,o=!1){let{routesMeta:i}=a,u={},d="/",h=[];for(let p=0;p<i.length;++p){let g=i[p],v=p===i.length-1,x=d==="/"?l:l.slice(d.length)||"/",y={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},S=g.matcher&&g.compiledParams?Ry(y,x,g.matcher,g.compiledParams):bc(y,x),w=g.route;if(!S&&v&&o&&!i[i.length-1].route.index&&(S=bc({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!S)return null;Object.assign(u,S.params),h.push({params:u,pathname:la([d,S.pathname]),pathnameBase:Oj(la([d,S.pathnameBase])),route:w}),S.pathnameBase!=="/"&&(d=la([d,S.pathnameBase]))}return h}function bc(a,l){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[o,i]=Ny(a.path,a.caseSensitive,a.end);return Ry(a,l,o,i)}function Ry(a,l,o,i){let u=l.match(o);if(!u)return null;let d=u[0],h=d.replace(/(.)\/+$/,"$1"),p=u.slice(1);return{params:i.reduce((v,{paramName:x,isOptional:y},S)=>{if(x==="*"){let C=p[S]||"";h=d.slice(0,d.length-C.length).replace(/(.)\/+$/,"$1")}const w=p[S];return y&&!w?v[x]=void 0:v[x]=(w||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:h,pattern:a}}function Ny(a,l=!1,o=!0){$n(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let i=[],u="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,p,g,v,x)=>{if(i.push({paramName:p,isOptional:g!=null}),g){let y=x.charAt(v+h.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(i.push({paramName:"*"}),u+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?u+="\\/*$":a!==""&&a!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,l?void 0:"i"),i]}function Aj(a){try{return a.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return $n(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),a}}function Za(a,l){if(l==="/")return a;if(!a.toLowerCase().startsWith(l.toLowerCase()))return null;let o=l.endsWith("/")?l.length-1:l.length,i=a.charAt(o);return i&&i!=="/"?null:a.slice(o)||"/"}function Mj(a,l="/"){let{pathname:o,search:i="",hash:u=""}=typeof a=="string"?vs(a):a,d;return o?(o=Ty(o),o.startsWith("/")?d=zx(o.substring(1),"/"):d=zx(o,l)):d=l,{pathname:d,search:_j(i),hash:kj(u)}}function zx(a,l){let o=Sc(l).split("/");return a.split("/").forEach(u=>{u===".."?o.length>1&&o.pop():u!=="."&&o.push(u)}),o.length>1?o.join("/"):"/"}function wf(a,l,o,i){return`Cannot include a '${a}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Dj(a){return a.filter((l,o)=>o===0||l.route.path&&l.route.path.length>0)}function bh(a){let l=Dj(a);return l.map((o,i)=>i===l.length-1?o.pathname:o.pathnameBase)}function Nc(a,l,o,i=!1){let u;typeof a=="string"?u=vs(a):(u={...a},xt(!u.pathname||!u.pathname.includes("?"),wf("?","pathname","search",u)),xt(!u.pathname||!u.pathname.includes("#"),wf("#","pathname","hash",u)),xt(!u.search||!u.search.includes("#"),wf("#","search","hash",u)));let d=a===""||u.pathname==="",h=d?"/":u.pathname,p;if(h==null)p=o;else{let y=l.length-1;if(!i&&h.startsWith("..")){let S=h.split("/");for(;S[0]==="..";)S.shift(),y-=1;u.pathname=S.join("/")}p=y>=0?l[y]:"/"}let g=Mj(u,p),v=h&&h!=="/"&&h.endsWith("/"),x=(d||h===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}var Ty=a=>a.replace(/[\\/]{2,}/g,"/"),la=a=>Ty(a.join("/")),Sc=a=>a.replace(/\/+$/,""),Oj=a=>Sc(a).replace(/^\/*/,"/"),_j=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,kj=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,zj=class{constructor(a,l,o,i=!1){this.status=a,this.statusText=l||"",this.internal=i,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function Lj(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function Uj(a){let l=a.map(o=>o.route.path).filter(Boolean);return la(l)||"/"}var Ay=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function My(a,l){let o=a;if(typeof o!="string"||!yh.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let i=o,u=!1;if(Ay)try{let d=new URL(window.location.href),h=wy.test(o)?new URL(fj(o,d.protocol)):new URL(o),p=Za(h.pathname,l);h.origin===d.origin&&p!=null?o=p+h.search+h.hash:u=!0}catch{$n(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:u,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Dy=["POST","PUT","PATCH","DELETE"];new Set(Dy);var Bj=["GET",...Dy];new Set(Bj);var Hj=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Pj(a){try{return Hj.includes(new URL(a).protocol)}catch{return!1}}var xs=m.createContext(null);xs.displayName="DataRouter";var Tc=m.createContext(null);Tc.displayName="DataRouterState";var Oy=m.createContext(!1);function qj(){return m.useContext(Oy)}var _y=m.createContext({isTransitioning:!1});_y.displayName="ViewTransition";var Ij=m.createContext(new Map);Ij.displayName="Fetchers";var Vj=m.createContext(null);Vj.displayName="Await";var An=m.createContext(null);An.displayName="Navigation";var Mo=m.createContext(null);Mo.displayName="Location";var Sa=m.createContext({outlet:null,matches:[],isDataRoute:!1});Sa.displayName="Route";var Sh=m.createContext(null);Sh.displayName="RouteError";var ky="REACT_ROUTER_ERROR",Gj="REDIRECT",Yj="ROUTE_ERROR_RESPONSE";function $j(a){if(a.startsWith(`${ky}:${Gj}:{`))try{let l=JSON.parse(a.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function Kj(a){if(a.startsWith(`${ky}:${Yj}:{`))try{let l=JSON.parse(a.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new zj(l.status,l.statusText,l.data)}catch{}}function Xj(a,{relative:l}={}){xt(ys(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=m.useContext(An),{hash:u,pathname:d,search:h}=Oo(a,{relative:l}),p=d;return o!=="/"&&(p=d==="/"?o:la([o,d])),i.createHref({pathname:p,search:h,hash:u})}function ys(){return m.useContext(Mo)!=null}function hn(){return xt(ys(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(Mo).location}var zy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ly(a){m.useContext(An).static||m.useLayoutEffect(a)}function Do(){let{isDataRoute:a}=m.useContext(Sa);return a?o2():Fj()}function Fj(){xt(ys(),"useNavigate() may be used only in the context of a <Router> component.");let a=m.useContext(xs),{basename:l,navigator:o}=m.useContext(An),{matches:i}=m.useContext(Sa),{pathname:u}=hn(),d=JSON.stringify(bh(i)),h=m.useRef(!1);return Ly(()=>{h.current=!0}),m.useCallback((g,v={})=>{if($n(h.current,zy),!h.current)return;if(typeof g=="number"){o.go(g);return}let x=Nc(g,JSON.parse(d),u,v.relative==="path");a==null&&l!=="/"&&(x.pathname=x.pathname==="/"?l:la([l,x.pathname])),(v.replace?o.replace:o.push)(x,v.state,v)},[l,o,d,u,a])}m.createContext(null);function Oo(a,{relative:l}={}){let{matches:o}=m.useContext(Sa),{pathname:i}=hn(),u=JSON.stringify(bh(o));return m.useMemo(()=>Nc(a,JSON.parse(u),i,l==="path"),[a,u,i,l])}function Qj(a,l){return Uy(a,l)}function Uy(a,l,o){var j;xt(ys(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=m.useContext(An),{matches:u}=m.useContext(Sa),d=u[u.length-1],h=d?d.params:{},p=d?d.pathname:"/",g=d?d.pathnameBase:"/",v=d&&d.route;{let N=v&&v.path||"";Hy(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=hn(),y;if(l){let N=typeof l=="string"?vs(l):l;xt(g==="/"||((j=N.pathname)==null?void 0:j.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 S=y.pathname||"/",w=S;if(g!=="/"){let N=g.replace(/^\//,"").split("/");w="/"+S.replace(/^\//,"").split("/").slice(N.length).join("/")}let C=o&&o.state.matches.length?o.state.matches.map(N=>Object.assign(N,{route:o.manifest[N.route.id]||N.route})):jy(a,{pathname:w});$n(v||C!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),$n(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.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 E=t2(C&&C.map(N=>Object.assign({},N,{params:Object.assign({},h,N.params),pathname:la([g,i.encodeLocation?i.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?g:la([g,i.encodeLocation?i.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),u,o);return l&&E?m.createElement(Mo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},E):E}function Zj(){let a=s2(),l=Lj(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),o=a instanceof Error?a.stack:null,i="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:i},d={padding:"2px 4px",backgroundColor:i},h=null;return console.error("Error handled by React Router default ErrorBoundary:",a),h=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:d},"ErrorBoundary")," or"," ",m.createElement("code",{style:d},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},l),o?m.createElement("pre",{style:u},o):null,h)}var Jj=m.createElement(Zj,null),By=class extends m.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){this.props.onError?this.props.onError(a,l):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const o=Kj(a.digest);o&&(a=o)}let l=a!==void 0?m.createElement(Sa.Provider,{value:this.props.routeContext},m.createElement(Sh.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?m.createElement(Wj,{error:a},l):l}};By.contextType=Oy;var jf=new WeakMap;function Wj({children:a,error:l}){let{basename:o}=m.useContext(An);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=$j(l.digest);if(i){let u=jf.get(l);if(u)throw u;let d=My(i.location,o),h=d.absoluteURL||d.to;if(Pj(h))throw new Error("Invalid redirect location");if(Ay&&!jf.get(l))if(d.isExternal||i.reloadDocument)window.location.href=h;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:i.replace}));throw jf.set(l,p),p}return m.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return a}function e2({routeContext:a,match:l,children:o}){let i=m.useContext(xs);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),m.createElement(Sa.Provider,{value:a},o)}function t2(a,l=[],o){let i=o==null?void 0:o.state;if(a==null){if(!i)return null;if(i.errors)a=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)a=i.matches;else return null}let u=a,d=i==null?void 0:i.errors;if(d!=null){let x=u.findIndex(y=>y.route.id&&(d==null?void 0:d[y.route.id])!==void 0);xt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),u=u.slice(0,Math.min(u.length,x+1))}let h=!1,p=-1;if(o&&i){h=i.renderFallback;for(let x=0;x<u.length;x++){let y=u[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=x),y.route.id){let{loaderData:S,errors:w}=i,C=y.route.loader&&!S.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||C){o.isStatic&&(h=!0),p>=0?u=u.slice(0,p+1):u=[u[0]];break}}}}let g=o==null?void 0:o.onError,v=i&&g?(x,y)=>{var S,w;g(x,{location:i.location,params:((w=(S=i.matches)==null?void 0:S[0])==null?void 0:w.params)??{},pattern:Uj(i.matches),errorInfo:y})}:void 0;return u.reduceRight((x,y,S)=>{let w,C=!1,E=null,j=null;i&&(w=d&&y.route.id?d[y.route.id]:void 0,E=y.route.errorElement||Jj,h&&(p<0&&S===0?(Hy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,j=null):p===S&&(C=!0,j=y.route.hydrateFallbackElement||null)));let N=l.concat(u.slice(0,S+1)),A=()=>{let T;return w?T=E:C?T=j:y.route.Component?T=m.createElement(y.route.Component,null):y.route.element?T=y.route.element:T=x,m.createElement(e2,{match:y,routeContext:{outlet:x,matches:N,isDataRoute:i!=null},children:T})};return i&&(y.route.ErrorBoundary||y.route.errorElement||S===0)?m.createElement(By,{location:i.location,revalidation:i.revalidation,component:E,error:w,children:A(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:v}):A()},null)}function wh(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function n2(a){let l=m.useContext(xs);return xt(l,wh(a)),l}function a2(a){let l=m.useContext(Tc);return xt(l,wh(a)),l}function l2(a){let l=m.useContext(Sa);return xt(l,wh(a)),l}function jh(a){let l=l2(a),o=l.matches[l.matches.length-1];return xt(o.route.id,`${a} can only be used on routes that contain a unique "id"`),o.route.id}function r2(){return jh("useRouteId")}function s2(){var i;let a=m.useContext(Sh),l=a2("useRouteError"),o=jh("useRouteError");return a!==void 0?a:(i=l.errors)==null?void 0:i[o]}function o2(){let{router:a}=n2("useNavigate"),l=jh("useNavigate"),o=m.useRef(!1);return Ly(()=>{o.current=!0}),m.useCallback(async(u,d={})=>{$n(o.current,zy),o.current&&(typeof u=="number"?await a.navigate(u):await a.navigate(u,{fromRouteId:l,...d}))},[a,l])}var Lx={};function Hy(a,l,o){!l&&!Lx[a]&&(Lx[a]=!0,$n(!1,o))}m.memo(i2);function i2({routes:a,manifest:l,future:o,state:i,isStatic:u,onError:d}){return Uy(a,void 0,{manifest:l,state:i,isStatic:u,onError:d})}function qf({to:a,replace:l,state:o,relative:i}){xt(ys(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u}=m.useContext(An);$n(!u,"<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:d}=m.useContext(Sa),{pathname:h}=hn(),p=Do(),g=Nc(a,bh(d),h,i==="path"),v=JSON.stringify(g);return m.useEffect(()=>{p(JSON.parse(v),{replace:l,state:o,relative:i})},[p,v,i,l,o]),null}function on(a){xt(!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 c2({basename:a="/",children:l=null,location:o,navigationType:i="POP",navigator:u,static:d=!1,useTransitions:h}){xt(!ys(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=a.replace(/^\/*/,"/"),g=m.useMemo(()=>({basename:p,navigator:u,static:d,useTransitions:h,future:{}}),[p,u,d,h]);typeof o=="string"&&(o=vs(o));let{pathname:v="/",search:x="",hash:y="",state:S=null,key:w="default",mask:C}=o,E=m.useMemo(()=>{let j=Za(v,p);return j==null?null:{location:{pathname:j,search:x,hash:y,state:S,key:w,mask:C},navigationType:i}},[p,v,x,y,S,w,i,C]);return $n(E!=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.`),E==null?null:m.createElement(An.Provider,{value:g},m.createElement(Mo.Provider,{children:l,value:E}))}function Py({children:a,location:l}){return Qj(If(a),l)}function If(a,l=[]){let o=[];return m.Children.forEach(a,(i,u)=>{if(!m.isValidElement(i))return;let d=[...l,u];if(i.type===m.Fragment){o.push.apply(o,If(i.props.children,d));return}xt(i.type===on,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),xt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let h={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(h.children=If(i.props.children,d)),o.push(h)}),o}var mc="get",pc="application/x-www-form-urlencoded";function Ac(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function u2(a){return Ac(a)&&a.tagName.toLowerCase()==="button"}function d2(a){return Ac(a)&&a.tagName.toLowerCase()==="form"}function f2(a){return Ac(a)&&a.tagName.toLowerCase()==="input"}function h2(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function m2(a,l){return a.button===0&&(!l||l==="_self")&&!h2(a)}function Vf(a=""){return new URLSearchParams(typeof a=="string"||Array.isArray(a)||a instanceof URLSearchParams?a:Object.keys(a).reduce((l,o)=>{let i=a[o];return l.concat(Array.isArray(i)?i.map(u=>[o,u]):[[o,i]])},[]))}function p2(a,l){let o=Vf(a);return l&&l.forEach((i,u)=>{o.has(u)||l.getAll(u).forEach(d=>{o.append(u,d)})}),o}var ec=null;function g2(){if(ec===null)try{new FormData(document.createElement("form"),0),ec=!1}catch{ec=!0}return ec}var v2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cf(a){return a!=null&&!v2.has(a)?($n(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pc}"`),null):a}function x2(a,l){let o,i,u,d,h;if(d2(a)){let p=a.getAttribute("action");i=p?Za(p,l):null,o=a.getAttribute("method")||mc,u=Cf(a.getAttribute("enctype"))||pc,d=new FormData(a)}else if(u2(a)||f2(a)&&(a.type==="submit"||a.type==="image")){let p=a.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||p.getAttribute("action");if(i=g?Za(g,l):null,o=a.getAttribute("formmethod")||p.getAttribute("method")||mc,u=Cf(a.getAttribute("formenctype"))||Cf(p.getAttribute("enctype"))||pc,d=new FormData(p,a),!g2()){let{name:v,type:x,value:y}=a;if(x==="image"){let S=v?`${v}.`:"";d.append(`${S}x`,"0"),d.append(`${S}y`,"0")}else v&&d.append(v,y)}}else{if(Ac(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=mc,i=null,u=pc,h=a}return d&&u==="text/plain"&&(h=d,d=void 0),{action:i,method:o.toLowerCase(),encType:u,formData:d,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ch(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function qy(a,l,o,i){let u=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return o?u.pathname.endsWith("/")?u.pathname=`${u.pathname}_.${i}`:u.pathname=`${u.pathname}.${i}`:u.pathname==="/"?u.pathname=`_root.${i}`:l&&Za(u.pathname,l)==="/"?u.pathname=`${Sc(l)}/_root.${i}`:u.pathname=`${Sc(u.pathname)}.${i}`,u}async function y2(a,l){if(a.id in l)return l[a.id];try{let o=await import(a.module);return l[a.id]=o,o}catch(o){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function b2(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function S2(a,l,o){let i=await Promise.all(a.map(async u=>{let d=l.routes[u.route.id];if(d){let h=await y2(d,o);return h.links?h.links():[]}return[]}));return E2(i.flat(1).filter(b2).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function Ux(a,l,o,i,u,d){let h=(g,v)=>o[v]?g.route.id!==o[v].route.id:!0,p=(g,v)=>{var x;return o[v].pathname!==g.pathname||((x=o[v].route.path)==null?void 0:x.endsWith("*"))&&o[v].params["*"]!==g.params["*"]};return d==="assets"?l.filter((g,v)=>h(g,v)||p(g,v)):d==="data"?l.filter((g,v)=>{var y;let x=i.routes[g.route.id];if(!x||!x.hasLoader)return!1;if(h(g,v)||p(g,v))return!0;if(g.route.shouldRevalidate){let S=g.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((y=o[0])==null?void 0:y.params)||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof S=="boolean")return S}return!0}):[]}function w2(a,l,{includeHydrateFallback:o}={}){return j2(a.map(i=>{let u=l.routes[i.route.id];if(!u)return[];let d=[u.module];return u.clientActionModule&&(d=d.concat(u.clientActionModule)),u.clientLoaderModule&&(d=d.concat(u.clientLoaderModule)),o&&u.hydrateFallbackModule&&(d=d.concat(u.hydrateFallbackModule)),u.imports&&(d=d.concat(u.imports)),d}).flat(1))}function j2(a){return[...new Set(a)]}function C2(a){let l={},o=Object.keys(a).sort();for(let i of o)l[i]=a[i];return l}function E2(a,l){let o=new Set;return new Set(l),a.reduce((i,u)=>{let d=JSON.stringify(C2(u));return o.has(d)||(o.add(d),i.push({key:d,link:u})),i},[])}function Eh(){let a=m.useContext(xs);return Ch(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function R2(){let a=m.useContext(Tc);return Ch(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Rh=m.createContext(void 0);Rh.displayName="FrameworkContext";function Mc(){let a=m.useContext(Rh);return Ch(a,"You must render this element inside a <HydratedRouter> element"),a}function N2(a,l){let o=m.useContext(Rh),[i,u]=m.useState(!1),[d,h]=m.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:v,onMouseLeave:x,onTouchStart:y}=l,S=m.useRef(null);m.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let E=N=>{N.forEach(A=>{h(A.isIntersecting)})},j=new IntersectionObserver(E,{threshold:.5});return S.current&&j.observe(S.current),()=>{j.disconnect()}}},[a]),m.useEffect(()=>{if(i){let E=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(E)}}},[i]);let w=()=>{u(!0)},C=()=>{u(!1),h(!1)};return o?a!=="intent"?[d,S,{}]:[d,S,{onFocus:yo(p,w),onBlur:yo(g,C),onMouseEnter:yo(v,w),onMouseLeave:yo(x,C),onTouchStart:yo(y,w)}]:[!1,S,{}]}function yo(a,l){return o=>{a&&a(o),o.defaultPrevented||l(o)}}function T2({page:a,...l}){let o=qj(),{nonce:i}=Mc(),{router:u}=Eh(),d=m.useMemo(()=>jy(u.routes,a,u.basename),[u.routes,a,u.basename]);return d?(l.nonce==null&&i&&(l={...l,nonce:i}),o?m.createElement(M2,{page:a,matches:d,...l}):m.createElement(D2,{page:a,matches:d,...l})):null}function A2(a){let{manifest:l,routeModules:o}=Mc(),[i,u]=m.useState([]);return m.useEffect(()=>{let d=!1;return S2(a,l,o).then(h=>{d||u(h)}),()=>{d=!0}},[a,l,o]),i}function M2({page:a,matches:l,...o}){let i=hn(),{future:u}=Mc(),{basename:d}=Eh(),h=m.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let p=qy(a,d,u.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let x of l)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]},[d,u.v8_trailingSlashAwareDataRequests,a,i,l]);return m.createElement(m.Fragment,null,h.map(p=>m.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...o})))}function D2({page:a,matches:l,...o}){let i=hn(),{future:u,manifest:d,routeModules:h}=Mc(),{basename:p}=Eh(),{loaderData:g,matches:v}=R2(),x=m.useMemo(()=>Ux(a,l,v,d,i,"data"),[a,l,v,d,i]),y=m.useMemo(()=>Ux(a,l,v,d,i,"assets"),[a,l,v,d,i]),S=m.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let E=new Set,j=!1;if(l.forEach(A=>{var O;let T=d.routes[A.route.id];!T||!T.hasLoader||(!x.some(_=>_.route.id===A.route.id)&&A.route.id in g&&((O=h[A.route.id])!=null&&O.shouldRevalidate)||T.hasClientLoader?j=!0:E.add(A.route.id))}),E.size===0)return[];let N=qy(a,p,u.v8_trailingSlashAwareDataRequests,"data");return j&&E.size>0&&N.searchParams.set("_routes",l.filter(A=>E.has(A.route.id)).map(A=>A.route.id).join(",")),[N.pathname+N.search]},[p,u.v8_trailingSlashAwareDataRequests,g,i,d,x,l,a,h]),w=m.useMemo(()=>w2(y,d),[y,d]),C=A2(y);return m.createElement(m.Fragment,null,S.map(E=>m.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...o})),w.map(E=>m.createElement("link",{key:E,rel:"modulepreload",href:E,...o})),C.map(({key:E,link:j})=>m.createElement("link",{key:E,nonce:o.nonce,...j,crossOrigin:j.crossOrigin??o.crossOrigin})))}function O2(...a){return l=>{a.forEach(o=>{typeof o=="function"?o(l):o!=null&&(o.current=l)})}}var _2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_2&&(window.__reactRouterVersion="7.18.2")}catch{}function k2({basename:a,children:l,useTransitions:o,window:i}){let u=m.useRef();u.current==null&&(u.current=hj({window:i,v5Compat:!0}));let d=u.current,[h,p]=m.useState({action:d.action,location:d.location}),g=m.useCallback(v=>{o===!1?p(v):m.startTransition(()=>p(v))},[o]);return m.useLayoutEffect(()=>d.listen(g),[d,g]),m.createElement(c2,{basename:a,children:l,location:h.location,navigationType:h.action,navigator:d,useTransitions:o})}var ur=m.forwardRef(function({onClick:l,discover:o="render",prefetch:i="none",relative:u,reloadDocument:d,replace:h,mask:p,state:g,target:v,to:x,preventScrollReset:y,viewTransition:S,defaultShouldRevalidate:w,...C},E){let{basename:j,navigator:N,useTransitions:A}=m.useContext(An),T=typeof x=="string"&&yh.test(x),O=My(x,j);x=O.to;let _=Xj(x,{relative:u}),M=hn(),H=null;if(p){let oe=Nc(p,[],M.mask?M.mask.pathname:"/",!0);j!=="/"&&(oe.pathname=oe.pathname==="/"?j:la([j,oe.pathname])),H=N.createHref(oe)}let[z,K,se]=N2(i,C),X=U2(x,{replace:h,mask:p,state:g,target:v,preventScrollReset:y,relative:u,viewTransition:S,defaultShouldRevalidate:w,useTransitions:A});function I(oe){l&&l(oe),oe.defaultPrevented||X(oe)}let re=!(O.isExternal||d),W=m.createElement("a",{...C,...se,href:(re?H:void 0)||O.absoluteURL||_,onClick:re?I:l,ref:O2(E,K),target:v,"data-discover":!T&&o==="render"?"true":void 0});return z&&!T?m.createElement(m.Fragment,null,W,m.createElement(T2,{page:_})):W});ur.displayName="Link";var Iy=m.forwardRef(function({"aria-current":l="page",caseSensitive:o=!1,className:i="",end:u=!1,style:d,to:h,viewTransition:p,children:g,...v},x){let y=Oo(h,{relative:v.relative}),S=hn(),w=m.useContext(Tc),{navigator:C,basename:E}=m.useContext(An),j=w!=null&&V2(y)&&p===!0,N=C.encodeLocation?C.encodeLocation(y).pathname:y.pathname,A=S.pathname,T=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;o||(A=A.toLowerCase(),T=T?T.toLowerCase():null,N=N.toLowerCase()),T&&E&&(T=Za(T,E)||T);const O=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let _=A===N||!u&&A.startsWith(N)&&A.charAt(O)==="/",M=T!=null&&(T===N||!u&&T.startsWith(N)&&T.charAt(N.length)==="/"),H={isActive:_,isPending:M,isTransitioning:j},z=_?l:void 0,K;typeof i=="function"?K=i(H):K=[i,_?"active":null,M?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let se=typeof d=="function"?d(H):d;return m.createElement(ur,{...v,"aria-current":z,className:K,ref:x,style:se,to:h,viewTransition:p},typeof g=="function"?g(H):g)});Iy.displayName="NavLink";var z2=m.forwardRef(({discover:a="render",fetcherKey:l,navigate:o,reloadDocument:i,replace:u,state:d,method:h=mc,action:p,onSubmit:g,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:S,...w},C)=>{let{useTransitions:E}=m.useContext(An),j=q2(),N=I2(p,{relative:v}),A=h.toLowerCase()==="get"?"get":"post",T=typeof p=="string"&&yh.test(p),O=_=>{if(g&&g(_),_.defaultPrevented)return;_.preventDefault();let M=_.nativeEvent.submitter,H=(M==null?void 0:M.getAttribute("formmethod"))||h,z=()=>j(M||_.currentTarget,{fetcherKey:l,method:H,navigate:o,replace:u,state:d,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:S});E&&o!==!1?m.startTransition(()=>z()):z()};return m.createElement("form",{ref:C,method:A,action:N,onSubmit:i?g:O,...w,"data-discover":!T&&a==="render"?"true":void 0})});z2.displayName="Form";function L2(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vy(a){let l=m.useContext(xs);return xt(l,L2(a)),l}function U2(a,{target:l,replace:o,mask:i,state:u,preventScrollReset:d,relative:h,viewTransition:p,defaultShouldRevalidate:g,useTransitions:v}={}){let x=Do(),y=hn(),S=Oo(a,{relative:h});return m.useCallback(w=>{if(m2(w,l)){w.preventDefault();let C=o!==void 0?o:Co(y)===Co(S),E=()=>x(a,{replace:C,mask:i,state:u,preventScrollReset:d,relative:h,viewTransition:p,defaultShouldRevalidate:g});v?m.startTransition(()=>E()):E()}},[y,x,S,o,i,u,l,a,d,h,p,g,v])}function B2(a){$n(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 l=m.useRef(Vf(a)),o=m.useRef(!1),i=hn(),u=m.useMemo(()=>p2(i.search,o.current?null:l.current),[i.search]),d=Do(),h=m.useCallback((p,g)=>{const v=Vf(typeof p=="function"?p(new URLSearchParams(u)):p);o.current=!0,d("?"+v,g)},[d,u]);return[u,h]}var H2=0,P2=()=>`__${String(++H2)}__`;function q2(){let{router:a}=Vy("useSubmit"),{basename:l}=m.useContext(An),o=r2(),i=a.fetch,u=a.navigate;return m.useCallback(async(d,h={})=>{let{action:p,method:g,encType:v,formData:x,body:y}=x2(d,l);if(h.navigate===!1){let S=h.fetcherKey||P2();await i(S,o,h.action||p,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:y,formMethod:h.method||g,formEncType:h.encType||v,flushSync:h.flushSync})}else await u(h.action||p,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:y,formMethod:h.method||g,formEncType:h.encType||v,replace:h.replace,state:h.state,fromRouteId:o,flushSync:h.flushSync,viewTransition:h.viewTransition})},[i,u,l,o])}function I2(a,{relative:l}={}){let{basename:o}=m.useContext(An),i=m.useContext(Sa);xt(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),d={...Oo(a||".",{relative:l})},h=hn();if(a==null){d.search=h.search;let p=new URLSearchParams(d.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();d.search=x?`?${x}`:""}}return(!a||a===".")&&u.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:la([o,d.pathname])),Co(d)}function V2(a,{relative:l}={}){let o=m.useContext(_y);xt(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Vy("useViewTransitionState"),u=Oo(a,{relative:l});if(!o.isTransitioning)return!1;let d=Za(o.currentLocation.pathname,i)||o.currentLocation.pathname,h=Za(o.nextLocation.pathname,i)||o.nextLocation.pathname;return bc(u.pathname,h)!=null||bc(u.pathname,d)!=null}var bs=Sy();const G2=vh(bs),Y2="";class $2 extends Error{constructor(l,o,i){var u;super(typeof i=="object"&&i&&"error"in i?String(((u=i.error)==null?void 0:u.message)??i):"Request failed"),this.status=l,this.type=o,this.body=i}}async function bo(a,l,o,i){var g;const u=o!==void 0,d=await fetch(`${Y2}${l}`,{method:a,headers:{...u?{"content-type":"application/json"}:{},...(i==null?void 0:i.headers)??{}},body:u?JSON.stringify(o):void 0,credentials:"include",...i}),h=await d.text();let p;try{p=h?JSON.parse(h):void 0}catch{p=h}if(!d.ok)throw new $2(d.status,typeof p=="object"&&p&&"error"in p?String(((g=p.error)==null?void 0:g.type)??"error"):"error",p);return p}const Se={get:(a,l)=>bo("GET",a,void 0,l),post:(a,l,o)=>bo("POST",a,l,o),patch:(a,l,o)=>bo("PATCH",a,l,o),put:(a,l,o)=>bo("PUT",a,l,o),del:a=>bo("DELETE",a)},Gy=m.createContext(void 0);function K2({children:a}){const[l,o]=m.useState(null),[i,u]=m.useState(!0),d=m.useCallback(async()=>{try{const g=await Se.get("/api/admin/me");o(g)}catch{o(null)}finally{u(!1)}},[]);m.useEffect(()=>{d()},[d]);const h=m.useCallback(async(g,v,x,y)=>{const S={username:g,password:v};x&&(S.totp=x),y&&(S.recoveryCode=y);try{const w=await Se.post("/api/admin/login",S);return o({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const C=w.status,E=w.type;if(C===401&&E==="totp_required")return{totpRequired:!0};throw w}},[]),p=m.useCallback(async()=>{await Se.post("/api/admin/logout"),o(null)},[]);return s.jsx(Gy.Provider,{value:{user:l,loading:i,login:h,logout:p,refresh:d},children:a})}function Nh(){const a=m.useContext(Gy);if(!a)throw new Error("useAuth must be inside AuthProvider");return a}/**
|
|
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 X2=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yy=(...a)=>a.filter((l,o,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===o).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 F2={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 Q2=m.forwardRef(({color:a="currentColor",size:l=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:u="",children:d,iconNode:h,...p},g)=>m.createElement("svg",{ref:g,...F2,width:l,height:l,stroke:a,strokeWidth:i?Number(o)*24/Number(l):o,className:Yy("lucide",u),...p},[...h.map(([v,x])=>m.createElement(v,x)),...Array.isArray(d)?d:[d]]));/**
|
|
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 Le=(a,l)=>{const o=m.forwardRef(({className:i,...u},d)=>m.createElement(Q2,{ref:d,iconNode:l,className:Yy(`lucide-${X2(a)}`,i),...u}));return o.displayName=`${a}`,o};/**
|
|
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 $y=Le("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 Z2=Le("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 J2=Le("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 W2=Le("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 Ky=Le("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 eC=Le("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 tC=Le("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 Dc=Le("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 nC=Le("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 aC=Le("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 lC=Le("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 rC=Le("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 Ef=Le("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 sC=Le("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 oC=Le("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 Xy=Le("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 iC=Le("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 cC=Le("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 uC=Le("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 Fy=Le("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 Qy=Le("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"}]]);/**
|
|
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 Zy=Le("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"}]]);/**
|
|
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 jo=Le("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 dC=Le("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"}]]);/**
|
|
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 fC=Le("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"}]]);/**
|
|
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 hC=Le("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 Jy=Le("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"}]]);/**
|
|
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 mC=Le("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"}]]);/**
|
|
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 pC=Le("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 _o=Le("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 gC=Le("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"}]]);/**
|
|
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 vC=Le("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"}]]);/**
|
|
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 Wy=Le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 xC=Le("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"}]]);/**
|
|
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 yC=Le("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"}]]);/**
|
|
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 bC=Le("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"}]]);/**
|
|
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 Oc=Le("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"}]]);/**
|
|
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 SC=Le("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"}]]);/**
|
|
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 wC=Le("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"}]]);/**
|
|
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 _c=Le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
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 jC=Le("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 eb(a){var l,o,i="";if(typeof a=="string"||typeof a=="number")i+=a;else if(typeof a=="object")if(Array.isArray(a)){var u=a.length;for(l=0;l<u;l++)a[l]&&(o=eb(a[l]))&&(i&&(i+=" "),i+=o)}else for(o in a)a[o]&&(i&&(i+=" "),i+=o);return i}function tb(){for(var a,l,o=0,i="",u=arguments.length;o<u;o++)(a=arguments[o])&&(l=eb(a))&&(i&&(i+=" "),i+=l);return i}const Th="-",CC=a=>{const l=RC(a),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:h=>{const p=h.split(Th);return p[0]===""&&p.length!==1&&p.shift(),nb(p,l)||EC(h)},getConflictingClassGroupIds:(h,p)=>{const g=o[h]||[];return p&&i[h]?[...g,...i[h]]:g}}},nb=(a,l)=>{var h;if(a.length===0)return l.classGroupId;const o=a[0],i=l.nextPart.get(o),u=i?nb(a.slice(1),i):void 0;if(u)return u;if(l.validators.length===0)return;const d=a.join(Th);return(h=l.validators.find(({validator:p})=>p(d)))==null?void 0:h.classGroupId},Bx=/^\[(.+)\]$/,EC=a=>{if(Bx.test(a)){const l=Bx.exec(a)[1],o=l==null?void 0:l.substring(0,l.indexOf(":"));if(o)return"arbitrary.."+o}},RC=a=>{const{theme:l,prefix:o}=a,i={nextPart:new Map,validators:[]};return TC(Object.entries(a.classGroups),o).forEach(([d,h])=>{Gf(h,i,d,l)}),i},Gf=(a,l,o,i)=>{a.forEach(u=>{if(typeof u=="string"){const d=u===""?l:Hx(l,u);d.classGroupId=o;return}if(typeof u=="function"){if(NC(u)){Gf(u(i),l,o,i);return}l.validators.push({validator:u,classGroupId:o});return}Object.entries(u).forEach(([d,h])=>{Gf(h,Hx(l,d),o,i)})})},Hx=(a,l)=>{let o=a;return l.split(Th).forEach(i=>{o.nextPart.has(i)||o.nextPart.set(i,{nextPart:new Map,validators:[]}),o=o.nextPart.get(i)}),o},NC=a=>a.isThemeGetter,TC=(a,l)=>l?a.map(([o,i])=>{const u=i.map(d=>typeof d=="string"?l+d:typeof d=="object"?Object.fromEntries(Object.entries(d).map(([h,p])=>[l+h,p])):d);return[o,u]}):a,AC=a=>{if(a<1)return{get:()=>{},set:()=>{}};let l=0,o=new Map,i=new Map;const u=(d,h)=>{o.set(d,h),l++,l>a&&(l=0,i=o,o=new Map)};return{get(d){let h=o.get(d);if(h!==void 0)return h;if((h=i.get(d))!==void 0)return u(d,h),h},set(d,h){o.has(d)?o.set(d,h):u(d,h)}}},ab="!",MC=a=>{const{separator:l,experimentalParseClassName:o}=a,i=l.length===1,u=l[0],d=l.length,h=p=>{const g=[];let v=0,x=0,y;for(let j=0;j<p.length;j++){let N=p[j];if(v===0){if(N===u&&(i||p.slice(j,j+d)===l)){g.push(p.slice(x,j)),x=j+d;continue}if(N==="/"){y=j;continue}}N==="["?v++:N==="]"&&v--}const S=g.length===0?p:p.substring(x),w=S.startsWith(ab),C=w?S.substring(1):S,E=y&&y>x?y-x:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:C,maybePostfixModifierPosition:E}};return o?p=>o({className:p,parseClassName:h}):h},DC=a=>{if(a.length<=1)return a;const l=[];let o=[];return a.forEach(i=>{i[0]==="["?(l.push(...o.sort(),i),o=[]):o.push(i)}),l.push(...o.sort()),l},OC=a=>({cache:AC(a.cacheSize),parseClassName:MC(a),...CC(a)}),_C=/\s+/,kC=(a,l)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:u}=l,d=[],h=a.trim().split(_C);let p="";for(let g=h.length-1;g>=0;g-=1){const v=h[g],{modifiers:x,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:w}=o(v);let C=!!w,E=i(C?S.substring(0,w):S);if(!E){if(!C){p=v+(p.length>0?" "+p:p);continue}if(E=i(S),!E){p=v+(p.length>0?" "+p:p);continue}C=!1}const j=DC(x).join(":"),N=y?j+ab:j,A=N+E;if(d.includes(A))continue;d.push(A);const T=u(E,C);for(let O=0;O<T.length;++O){const _=T[O];d.push(N+_)}p=v+(p.length>0?" "+p:p)}return p};function zC(){let a=0,l,o,i="";for(;a<arguments.length;)(l=arguments[a++])&&(o=lb(l))&&(i&&(i+=" "),i+=o);return i}const lb=a=>{if(typeof a=="string")return a;let l,o="";for(let i=0;i<a.length;i++)a[i]&&(l=lb(a[i]))&&(o&&(o+=" "),o+=l);return o};function LC(a,...l){let o,i,u,d=h;function h(g){const v=l.reduce((x,y)=>y(x),a());return o=OC(v),i=o.cache.get,u=o.cache.set,d=p,p(g)}function p(g){const v=i(g);if(v)return v;const x=kC(g,o);return u(g,x),x}return function(){return d(zC.apply(null,arguments))}}const mt=a=>{const l=o=>o[a]||[];return l.isThemeGetter=!0,l},rb=/^\[(?:([a-z-]+):)?(.+)\]$/i,UC=/^\d+\/\d+$/,BC=new Set(["px","full","screen"]),HC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PC=/\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$/,qC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,VC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ya=a=>fs(a)||BC.has(a)||UC.test(a),Dl=a=>Ss(a,"length",ZC),fs=a=>!!a&&!Number.isNaN(Number(a)),Rf=a=>Ss(a,"number",fs),So=a=>!!a&&Number.isInteger(Number(a)),GC=a=>a.endsWith("%")&&fs(a.slice(0,-1)),ze=a=>rb.test(a),Ol=a=>HC.test(a),YC=new Set(["length","size","percentage"]),$C=a=>Ss(a,YC,sb),KC=a=>Ss(a,"position",sb),XC=new Set(["image","url"]),FC=a=>Ss(a,XC,WC),QC=a=>Ss(a,"",JC),wo=()=>!0,Ss=(a,l,o)=>{const i=rb.exec(a);return i?i[1]?typeof l=="string"?i[1]===l:l.has(i[1]):o(i[2]):!1},ZC=a=>PC.test(a)&&!qC.test(a),sb=()=>!1,JC=a=>IC.test(a),WC=a=>VC.test(a),eE=()=>{const a=mt("colors"),l=mt("spacing"),o=mt("blur"),i=mt("brightness"),u=mt("borderColor"),d=mt("borderRadius"),h=mt("borderSpacing"),p=mt("borderWidth"),g=mt("contrast"),v=mt("grayscale"),x=mt("hueRotate"),y=mt("invert"),S=mt("gap"),w=mt("gradientColorStops"),C=mt("gradientColorStopPositions"),E=mt("inset"),j=mt("margin"),N=mt("opacity"),A=mt("padding"),T=mt("saturate"),O=mt("scale"),_=mt("sepia"),M=mt("skew"),H=mt("space"),z=mt("translate"),K=()=>["auto","contain","none"],se=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto",ze,l],I=()=>[ze,l],re=()=>["",Ya,Dl],W=()=>["auto",fs,ze],oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",ze],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[fs,ze];return{cacheSize:500,separator:":",theme:{colors:[wo],spacing:[Ya,Dl],blur:["none","",Ol,ze],brightness:D(),borderColor:[a],borderRadius:["none","","full",Ol,ze],borderSpacing:I(),borderWidth:re(),contrast:D(),grayscale:B(),hueRotate:D(),invert:B(),gap:I(),gradientColorStops:[a],gradientColorStopPositions:[GC,Dl],inset:X(),margin:X(),opacity:D(),padding:I(),saturate:D(),scale:D(),sepia:B(),skew:D(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",ze]}],container:["container"],columns:[{columns:[Ol]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"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:[...oe(),ze]}],overflow:[{overflow:se()}],"overflow-x":[{"overflow-x":se()}],"overflow-y":[{"overflow-y":se()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",So,ze]}],basis:[{basis:X()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ze]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",So,ze]}],"grid-cols":[{"grid-cols":[wo]}],"col-start-end":[{col:["auto",{span:["full",So,ze]},ze]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[wo]}],"row-start-end":[{row:["auto",{span:[So,ze]},ze]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ze]}],gap:[{gap:[S]}],"gap-x":[{"gap-x":[S]}],"gap-y":[{"gap-y":[S]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[H]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[H]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ze,l]}],"min-w":[{"min-w":[ze,l,"min","max","fit"]}],"max-w":[{"max-w":[ze,l,"none","full","min","max","fit","prose",{screen:[Ol]},Ol]}],h:[{h:[ze,l,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ze,l,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ze,l,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ze,l,"auto","min","max","fit"]}],"font-size":[{text:["base",Ol,Dl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Rf]}],"font-family":[{font:[wo]}],"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",ze]}],"line-clamp":[{"line-clamp":["none",fs,Rf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ya,ze]}],"list-image":[{"list-image":["none",ze]}],"list-style-type":[{list:["none","disc","decimal",ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[a]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[a]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ya,Dl]}],"underline-offset":[{"underline-offset":["auto",Ya,ze]}],"text-decoration-color":[{decoration:[a]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze]}],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",ze]}],"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:[...oe(),KC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",$C]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},FC]}],"bg-color":[{bg:[a]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[d]}],"rounded-s":[{"rounded-s":[d]}],"rounded-e":[{"rounded-e":[d]}],"rounded-t":[{"rounded-t":[d]}],"rounded-r":[{"rounded-r":[d]}],"rounded-b":[{"rounded-b":[d]}],"rounded-l":[{"rounded-l":[d]}],"rounded-ss":[{"rounded-ss":[d]}],"rounded-se":[{"rounded-se":[d]}],"rounded-ee":[{"rounded-ee":[d]}],"rounded-es":[{"rounded-es":[d]}],"rounded-tl":[{"rounded-tl":[d]}],"rounded-tr":[{"rounded-tr":[d]}],"rounded-br":[{"rounded-br":[d]}],"rounded-bl":[{"rounded-bl":[d]}],"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:[...U(),"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:U()}],"border-color":[{border:[u]}],"border-color-x":[{"border-x":[u]}],"border-color-y":[{"border-y":[u]}],"border-color-s":[{"border-s":[u]}],"border-color-e":[{"border-e":[u]}],"border-color-t":[{"border-t":[u]}],"border-color-r":[{"border-r":[u]}],"border-color-b":[{"border-b":[u]}],"border-color-l":[{"border-l":[u]}],"divide-color":[{divide:[u]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Ya,ze]}],"outline-w":[{outline:[Ya,Dl]}],"outline-color":[{outline:[a]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[a]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[Ya,Dl]}],"ring-offset-color":[{"ring-offset":[a]}],shadow:[{shadow:["","inner","none",Ol,QC]}],"shadow-color":[{shadow:[wo]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[i]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",Ol,ze]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[T]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"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":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ze]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",ze]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[So,ze]}],"translate-x":[{"translate-x":[z]}],"translate-y":[{"translate-y":[z]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ze]}],accent:[{accent:["auto",a]}],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",ze]}],"caret-color":[{caret:[a]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",ze]}],fill:[{fill:[a,"none"]}],"stroke-w":[{stroke:[Ya,Dl,Rf]}],stroke:[{stroke:[a,"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"]}}},tE=LC(eE);function Ee(...a){return tE(tb(a))}function Ot(a,l="—"){return a==null||Number.isNaN(a)?l:a.toLocaleString()}function kc(a,l=1,o="—"){return a==null||Number.isNaN(a)?o:`${(a*100).toFixed(l)}%`}function dr(a){return a?a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`:"—"}function Ah(a){if(!a)return"—";try{return new Date(a).toLocaleString()}catch{return a}}function nE(a,l=8){return a?a.length>l?`${a.slice(0,l)}…`:a:"—"}function aE(a){if(!a)return"—";const l=Date.now()-new Date(a).getTime();if(!Number.isFinite(l)||l<0)return"—";const o=Math.floor(l/1e3);if(o<60)return`${o}s ago`;const i=Math.floor(o/60);if(i<60)return`${i}m ago`;const u=Math.floor(i/60);return u<24?`${u}h ago`:`${Math.floor(u/24)}d ago`}const lE=[{to:"/",label:"Dashboard",icon:Fy,end:!0},{to:"/providers",label:"Providers",icon:Jy},{to:"/models",label:"Models",icon:W2},{to:"/combos",label:"Combos",icon:Zy},{to:"/aliases",label:"Aliases",icon:lC},{to:"/api-keys",label:"API Keys",icon:Qy},{to:"/requests",label:"Requests",icon:$y},{to:"/statistics",label:"Statistics",icon:cC},{to:"/audit",label:"Audit Logs",icon:vC},{to:"/settings",label:"Settings",icon:rC}];function rE(){const[a,l]=m.useState(null);return m.useEffect(()=>{let o=!1;return fetch("/api/admin/settings/system",{credentials:"include"}).then(i=>i.ok?i.json():null).then(i=>{!o&&(i!=null&&i.appVersion)&&l(i.appVersion)}).catch(()=>{}),()=>{o=!0}},[]),s.jsxs("aside",{className:"hidden w-60 shrink-0 border-r bg-sidebar text-sidebar-foreground md:flex md:flex-col",children:[s.jsxs("div",{className:"flex h-14 items-center gap-2 border-b px-4",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-7 w-7 object-contain"}),s.jsx("div",{className:"font-semibold tracking-tight",children:"LateDev Router"})]}),s.jsx("nav",{className:"flex-1 space-y-0.5 p-2",children:lE.map(o=>s.jsxs(Iy,{to:o.to,end:o.end,className:({isActive:i})=>Ee("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors",i?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[s.jsx(o.icon,{className:"h-4 w-4"}),o.label]},o.to))}),s.jsxs("div",{className:"border-t p-3 text-xs text-muted-foreground flex items-center gap-2",children:[s.jsx(xC,{className:"h-3.5 w-3.5 text-primary"})," ",a?`v${a}`:"v…"]})]})}var sE=Object.defineProperty,Mh=(a,l)=>sE(a,"name",{value:l,configurable:!0});function Yf(a,l){if(typeof a=="function")return a(l);a!=null&&(a.current=l)}Mh(Yf,"setRef");function ob(...a){return l=>{let o=!1;const i=a.map(u=>{const d=Yf(u,l);return!o&&typeof d=="function"&&(o=!0),d});if(o)return()=>{for(let u=0;u<i.length;u++){const d=i[u];typeof d=="function"?d():Yf(a[u],null)}}}}Mh(ob,"composeRefs");function Ge(...a){return m.useCallback(ob(...a),a)}Mh(Ge,"useComposedRefs");var oE=Object.defineProperty,ra=(a,l)=>oE(a,"name",{value:l,configurable:!0});function va(a){const l=m.forwardRef((o,i)=>{let{children:u,...d}=o,h=null,p=!1;const g=[];$f(u)&&typeof tc=="function"&&(u=tc(u._payload)),m.Children.forEach(u,S=>{var w;if(fb(S)){p=!0;const C=S;let E="child"in C.props?C.props.child:C.props.children;$f(E)&&typeof tc=="function"&&(E=tc(E._payload)),h=cE(C,E),g.push((w=h==null?void 0:h.props)==null?void 0:w.children)}else g.push(S)}),h?h=m.cloneElement(h,void 0,g):!p&&m.Children.count(u)===1&&m.isValidElement(u)&&(h=u);const v=h?db(h):void 0,x=Ge(i,v);if(!h){if(u||u===0)throw new Error(p?fE(a):dE(a));return u}const y=ub(d,h.props??{});return h.type!==m.Fragment&&(y.ref=i?x:v),m.cloneElement(h,y)});return l.displayName=`${a}.Slot`,l}ra(va,"createSlot");var iE=va("Slot"),ib=Symbol.for("radix.slottable");function cb(a){const l=ra(o=>"child"in o?o.children(o.child):o.children,"Slottable");return l.displayName=`${a}.Slottable`,l.__radixId=ib,l}ra(cb,"createSlottable");var cE=ra((a,l)=>{if("child"in a.props){const o=a.props.child;return m.isValidElement(o)?m.cloneElement(o,void 0,a.props.children(o.props.children)):null}return m.isValidElement(l)?l:null},"getSlottableElementFromSlottable");function ub(a,l){const o={...l};for(const i in l){const u=a[i],d=l[i];/^on[A-Z]/.test(i)?u&&d?o[i]=(...p)=>{const g=d(...p);return u(...p),g}:u&&(o[i]=u):i==="style"?o[i]={...u,...d}:i==="className"&&(o[i]=[u,d].filter(Boolean).join(" "))}return{...a,...o}}ra(ub,"mergeProps");function db(a){var i,u;let l=(i=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:i.get,o=l&&"isReactWarning"in l&&l.isReactWarning;return o?a.ref:(l=(u=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:u.get,o=l&&"isReactWarning"in l&&l.isReactWarning,o?a.props.ref:a.props.ref||a.ref)}ra(db,"getElementRef");function fb(a){return m.isValidElement(a)&&typeof a.type=="function"&&"__radixId"in a.type&&a.type.__radixId===ib}ra(fb,"isSlottable");var uE=Symbol.for("react.lazy");function $f(a){return a!=null&&typeof a=="object"&&"$$typeof"in a&&a.$$typeof===uE&&"_payload"in a&&hb(a._payload)}ra($f,"isLazyComponent");function hb(a){return typeof a=="object"&&a!==null&&"then"in a}ra(hb,"isPromiseLike");var dE=ra(a=>`${a} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),fE=ra(a=>`${a} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),tc=gs[" use ".trim().toString()];const Px=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,qx=tb,mb=(a,l)=>o=>{var i;if((l==null?void 0:l.variants)==null)return qx(a,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:u,defaultVariants:d}=l,h=Object.keys(u).map(v=>{const x=o==null?void 0:o[v],y=d==null?void 0:d[v];if(x===null)return null;const S=Px(x)||Px(y);return u[v][S]}),p=o&&Object.entries(o).reduce((v,x)=>{let[y,S]=x;return S===void 0||(v[y]=S),v},{}),g=l==null||(i=l.compoundVariants)===null||i===void 0?void 0:i.reduce((v,x)=>{let{class:y,className:S,...w}=x;return Object.entries(w).every(C=>{let[E,j]=C;return Array.isArray(j)?j.includes({...d,...p}[E]):{...d,...p}[E]===j})?[...v,y,S]:v},[]);return qx(a,h,g,o==null?void 0:o.class,o==null?void 0:o.className)},hE=mb("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-6",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),he=m.forwardRef(({className:a,variant:l,size:o,asChild:i=!1,...u},d)=>{const h=i?iE:"button";return s.jsx(h,{className:Ee(hE({variant:l,size:o,className:a})),ref:d,...u})});he.displayName="Button";const pb=m.createContext(void 0);function mE({children:a,defaultTheme:l="system",storageKey:o="latedev-theme"}){const[i,u]=m.useState(()=>localStorage.getItem(o)||l);m.useEffect(()=>{const h=window.document.documentElement;if(h.classList.remove("light","dark"),i==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";h.classList.add(p);return}h.classList.add(i)},[i]);const d={theme:i,setTheme:h=>{localStorage.setItem(o,h),u(h)}};return s.jsx(pb.Provider,{value:d,children:a})}function pE(){const a=m.useContext(pb);if(!a)throw new Error("useTheme must be used within ThemeProvider");return a}var gE=Object.defineProperty,ws=(a,l)=>gE(a,"name",{value:l,configurable:!0}),gb=!!(typeof window<"u"&&window.document&&window.document.createElement);function je(a,l,{checkForDefaultPrevented:o=!0}={}){return ws(function(u){if(a==null||a(u),o===!1||!u||!u.defaultPrevented)return l==null?void 0:l(u)},"handleEvent")}ws(je,"composeEventHandlers");function vE(a){var l;if(!gb)throw new Error("Cannot access window outside of the DOM");return((l=a==null?void 0:a.ownerDocument)==null?void 0:l.defaultView)??window}ws(vE,"getOwnerWindow");function Kf(a){if(!gb)throw new Error("Cannot access document outside of the DOM");return(a==null?void 0:a.ownerDocument)??document}ws(Kf,"getOwnerDocument");function vb(a,l=!1){const{activeElement:o}=Kf(a);if(!(o!=null&&o.nodeName))return null;if(xb(o)&&o.contentDocument)return vb(o.contentDocument.body,l);if(l){const i=o.getAttribute("aria-activedescendant");if(i){const u=Kf(o).getElementById(i);if(u)return u}}return o}ws(vb,"getActiveElement");function xb(a){return a.tagName==="IFRAME"}ws(xb,"isFrame");var xE=Object.defineProperty,qn=(a,l)=>xE(a,"name",{value:l,configurable:!0});function yE(a,l){const o=m.createContext(l);o.displayName=a+"Context";const i=qn(d=>{const{children:h,...p}=d,g=m.useMemo(()=>p,Object.values(p));return s.jsx(o.Provider,{value:g,children:h})},"Provider");i.displayName=a+"Provider";function u(d,h={}){const{optional:p=!1}=h,g=m.useContext(o);if(g)return g;if(l!==void 0)return l;if(!p)throw new Error(`\`${d}\` must be used within \`${a}\``)}return qn(u,"useContext"),[i,u]}qn(yE,"createContext");function mn(a,l=[]){let o=[];function i(d,h){const p=m.createContext(h);p.displayName=d+"Context";const g=o.length;o=[...o,h];const v=qn(y=>{var N;const{scope:S,children:w,...C}=y,E=((N=S==null?void 0:S[a])==null?void 0:N[g])||p,j=m.useMemo(()=>C,Object.values(C));return s.jsx(E.Provider,{value:j,children:w})},"Provider");v.displayName=d+"Provider";function x(y,S,w={}){var N;const{optional:C=!1}=w,E=((N=S==null?void 0:S[a])==null?void 0:N[g])||p,j=m.useContext(E);if(j)return j;if(h!==void 0)return h;if(!C)throw new Error(`\`${y}\` must be used within \`${d}\``)}return qn(x,"useContext"),[v,x]}qn(i,"createContext");const u=qn(()=>{const d=o.map(h=>m.createContext(h));return qn(function(p){const g=(p==null?void 0:p[a])||d;return m.useMemo(()=>({[`__scope${a}`]:{...p,[a]:g}}),[p,g])},"useScope")},"createScope");return u.scopeName=a,[i,yb(u,...l)]}qn(mn,"createContextScope");function yb(...a){const l=a[0];if(a.length===1)return l;const o=qn(()=>{const i=a.map(u=>({useScope:u(),scopeName:u.scopeName}));return qn(function(d){const h=i.reduce((p,{useScope:g,scopeName:v})=>{const y=g(d)[`__scope${v}`];return{...p,...y}},{});return m.useMemo(()=>({[`__scope${l.scopeName}`]:h}),[h])},"useComposedScopes")},"createScope");return o.scopeName=l.scopeName,o}qn(yb,"composeContextScopes");var _t=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},bE=Object.defineProperty,SE=(a,l)=>bE(a,"name",{value:l,configurable:!0}),Ix=gs[" useEffectEvent ".trim().toString()],Vx=gs[" useInsertionEffect ".trim().toString()];function bb(a){if(typeof Ix=="function")return Ix(a);const l=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Vx=="function"?Vx(()=>{l.current=a}):_t(()=>{l.current=a}),m.useMemo(()=>((...o)=>{var i;return(i=l.current)==null?void 0:i.call(l,...o)}),[])}SE(bb,"useEffectEvent");var wE=Object.defineProperty,ko=(a,l)=>wE(a,"name",{value:l,configurable:!0}),jE=gs[" useInsertionEffect ".trim().toString()]||_t;function Ja({prop:a,defaultProp:l,onChange:o=ko(()=>{},"onChange"),caller:i}){const[u,d,h]=Sb({defaultProp:l,onChange:o}),p=a!==void 0,g=p?a:u,v=m.useCallback(x=>{var y;if(p){const S=wb(x)?x(a):x;S!==a&&((y=h.current)==null||y.call(h,S))}else d(x)},[p,a,d,h]);return[g,v]}ko(Ja,"useControllableState");function Sb({defaultProp:a,onChange:l}){const[o,i]=m.useState(a),u=m.useRef(o),d=m.useRef(l);return jE(()=>{d.current=l},[l]),m.useEffect(()=>{var h;u.current!==o&&((h=d.current)==null||h.call(d,o),u.current=o)},[o,u]),[o,i,d]}ko(Sb,"useUncontrolledState");function wb(a){return typeof a=="function"}ko(wb,"isFunction");var Gx=Symbol("RADIX:SYNC_STATE");function CE(a,l,o,i){const{prop:u,defaultProp:d,onChange:h,caller:p}=l,g=u!==void 0,v=bb(h),x=[{...o,state:d}];i&&x.push(i);const[y,S]=m.useReducer((j,N)=>{if(N.type===Gx)return{...j,state:N.state};const A=a(j,N);return g&&!Object.is(A.state,j.state)&&v(A.state),A},...x),w=y.state,C=m.useRef(w);m.useEffect(()=>{C.current!==w&&(C.current=w,g||v(w))},[w,C,g]);const E=m.useMemo(()=>u!==void 0?{...y,state:u}:y,[y,u]);return m.useEffect(()=>{g&&!Object.is(u,y.state)&&S({type:Gx,state:u})},[u,y.state,g]),[E,S]}ko(CE,"useControllableStateReducer");var EE=Object.defineProperty,RE=(a,l)=>EE(a,"name",{value:l,configurable:!0}),NE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=NE.reduce((a,l)=>{const o=va(`Primitive.${l}`),i=m.forwardRef((u,d)=>{const{asChild:h,...p}=u,g=h?o:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(g,{...p,ref:d})});return i.displayName=`Primitive.${l}`,{...a,[l]:i}},{});function Dh(a,l){a&&bs.flushSync(()=>a.dispatchEvent(l))}RE(Dh,"dispatchDiscreteCustomEvent");var TE=Object.defineProperty,Ut=(a,l)=>TE(a,"name",{value:l,configurable:!0});function zc(a){const l=a+"CollectionProvider",[o,i]=mn(l),[u,d]=o(l,{collectionRef:{current:null},itemMap:new Map}),h=Ut(E=>{const{scope:j,children:N}=E,A=m.useRef(null),T=m.useRef(new Map).current;return s.jsx(u,{scope:j,itemMap:T,collectionRef:A,children:N})},"CollectionProvider");h.displayName=l;const p=a+"CollectionSlot",g=va(p),v=m.forwardRef((E,j)=>{const{scope:N,children:A}=E,T=d(p,N),O=Ge(j,T.collectionRef);return s.jsx(g,{ref:O,children:A})});v.displayName=p;const x=a+"CollectionItemSlot",y="data-radix-collection-item",S=va(x),w=m.forwardRef((E,j)=>{const{scope:N,children:A,...T}=E,O=m.useRef(null),_=Ge(j,O),M=d(x,N);return m.useEffect(()=>(M.itemMap.set(O,{ref:O,...T}),()=>void M.itemMap.delete(O))),s.jsx(S,{[y]:"",ref:_,children:A})});w.displayName=x;function C(E){const j=d(a+"CollectionConsumer",E);return m.useCallback(()=>{const A=j.collectionRef.current;if(!A)return[];const T=Array.from(A.querySelectorAll(`[${y}]`));return Array.from(j.itemMap.values()).sort((M,H)=>T.indexOf(M.ref.current)-T.indexOf(H.ref.current))},[j.collectionRef,j.itemMap])}return Ut(C,"useCollection"),[{Provider:h,Slot:v,ItemSlot:w},C,i]}Ut(zc,"createCollection");var Yx=new WeakMap,Mt,jn,Nf=(jn=class extends Map{constructor(o){super(o);bx(this,Mt);pf(this,Mt,[...super.keys()]),Yx.set(this,!0)}set(o,i){return Yx.get(this)&&(this.has(o)?Yt(this,Mt)[Yt(this,Mt).indexOf(o)]=o:Yt(this,Mt).push(o)),super.set(o,i),this}insert(o,i,u){const d=this.has(i),h=Yt(this,Mt).length,p=Oh(o);let g=p>=0?p:h+p;const v=g<0||g>=h?-1:g;if(v===this.size||d&&v===this.size-1||v===-1)return this.set(i,u),this;const x=this.size+(d?0:1);p<0&&g++;const y=[...Yt(this,Mt)];let S,w=!1;for(let C=g;C<x;C++)if(g===C){let E=y[C];y[C]===i&&(E=y[C+1]),d&&this.delete(i),S=this.get(E),this.set(i,u)}else{!w&&y[C-1]===i&&(w=!0);const E=y[w?C:C-1],j=S;S=this.get(E),this.delete(E),this.set(E,j)}return this}with(o,i,u){const d=new jn(this);return d.insert(o,i,u),d}before(o){const i=Yt(this,Mt).indexOf(o)-1;if(!(i<0))return this.entryAt(i)}setBefore(o,i,u){const d=Yt(this,Mt).indexOf(o);return d===-1?this:this.insert(d,i,u)}after(o){let i=Yt(this,Mt).indexOf(o);if(i=i===-1||i===this.size-1?-1:i+1,i!==-1)return this.entryAt(i)}setAfter(o,i,u){const d=Yt(this,Mt).indexOf(o);return d===-1?this:this.insert(d+1,i,u)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return pf(this,Mt,[]),super.clear()}delete(o){const i=super.delete(o);return i&&Yt(this,Mt).splice(Yt(this,Mt).indexOf(o),1),i}deleteAt(o){const i=this.keyAt(o);return i!==void 0?this.delete(i):!1}at(o){const i=gc(Yt(this,Mt),o);if(i!==void 0)return this.get(i)}entryAt(o){const i=gc(Yt(this,Mt),o);if(i!==void 0)return[i,this.get(i)]}indexOf(o){return Yt(this,Mt).indexOf(o)}keyAt(o){return gc(Yt(this,Mt),o)}from(o,i){const u=this.indexOf(o);if(u===-1)return;let d=u+i;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(o,i){const u=this.indexOf(o);if(u===-1)return;let d=u+i;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(o,i){let u=0;for(const d of this){if(Reflect.apply(o,i,[d,u,this]))return d;u++}}findIndex(o,i){let u=0;for(const d of this){if(Reflect.apply(o,i,[d,u,this]))return u;u++}return-1}filter(o,i){const u=[];let d=0;for(const h of this)Reflect.apply(o,i,[h,d,this])&&u.push(h),d++;return new jn(u)}map(o,i){const u=[];let d=0;for(const h of this)u.push([h[0],Reflect.apply(o,i,[h,d,this])]),d++;return new jn(u)}reduce(...o){const[i,u]=o;let d=0,h=u??this.at(0);for(const p of this)d===0&&o.length===1?h=p:h=Reflect.apply(i,this,[h,p,d,this]),d++;return h}reduceRight(...o){const[i,u]=o;let d=u??this.at(-1);for(let h=this.size-1;h>=0;h--){const p=this.at(h);h===this.size-1&&o.length===1?d=p:d=Reflect.apply(i,this,[d,p,h,this])}return d}toSorted(o){const i=[...this.entries()].sort(o);return new jn(i)}toReversed(){const o=new jn;for(let i=this.size-1;i>=0;i--){const u=this.keyAt(i),d=this.get(u);o.set(u,d)}return o}toSpliced(...o){const i=[...this.entries()];return i.splice(...o),new jn(i)}slice(o,i){const u=new jn;let d=this.size-1;if(o===void 0)return u;o<0&&(o=o+this.size),i!==void 0&&i>0&&(d=i-1);for(let h=o;h<=d;h++){const p=this.keyAt(h),g=this.get(p);u.set(p,g)}return u}every(o,i){let u=0;for(const d of this){if(!Reflect.apply(o,i,[d,u,this]))return!1;u++}return!0}some(o,i){let u=0;for(const d of this){if(Reflect.apply(o,i,[d,u,this]))return!0;u++}return!1}},Mt=new WeakMap,Ut(jn,"OrderedDict"),jn);function gc(a,l){if("at"in Array.prototype)return Array.prototype.at.call(a,l);const o=jb(a,l);return o===-1?void 0:a[o]}Ut(gc,"at");function jb(a,l){const o=a.length,i=Oh(l),u=i>=0?i:o+i;return u<0||u>=o?-1:u}Ut(jb,"toSafeIndex");function Oh(a){return a!==a||a===0?0:Math.trunc(a)}Ut(Oh,"toSafeInteger");function AE(a){const l=a+"CollectionProvider",[o,i]=mn(l),[u,d]=o(l,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Nf,setItemMap:Ut(()=>{},"setItemMap")}),h=Ut(({state:T,...O})=>T?s.jsx(g,{...O,state:T}):s.jsx(p,{...O}),"CollectionProvider");h.displayName=l;const p=Ut(T=>{const O=j();return s.jsx(g,{...T,state:O})},"CollectionInit");p.displayName=l+"Init";const g=Ut(T=>{const{scope:O,children:_,state:M}=T,H=m.useRef(null),[z,K]=m.useState(null),se=Ge(H,K),[X,I]=M;return m.useEffect(()=>{if(!z)return;const re=Rb(()=>{});return re.observe(z,{childList:!0,subtree:!0}),()=>{re.disconnect()}},[z]),s.jsx(u,{scope:O,itemMap:X,setItemMap:I,collectionRef:se,collectionRefObject:H,collectionElement:z,children:_})},"CollectionProviderImpl");g.displayName=l+"Impl";const v=a+"CollectionSlot",x=va(v),y=m.forwardRef((T,O)=>{const{scope:_,children:M}=T,H=d(v,_),z=Ge(O,H.collectionRef);return s.jsx(x,{ref:z,children:M})});y.displayName=v;const S=a+"CollectionItemSlot",w="data-radix-collection-item",C=va(S),E=m.forwardRef((T,O)=>{const{scope:_,children:M,...H}=T,z=m.useRef(null),[K,se]=m.useState(null),X=Ge(O,z,se),I=d(S,_),{setItemMap:re}=I,W=m.useRef(H);Cb(W.current,H)||(W.current=H);const oe=W.current;return m.useEffect(()=>{const U=oe;return re($=>K?$.has(K)?$.set(K,{...U,element:K}).toSorted(Xf):($.set(K,{...U,element:K}),$.toSorted(Xf)):$),()=>{re($=>!K||!$.has(K)?$:($.delete(K),new Nf($)))}},[K,oe,re]),s.jsx(C,{[w]:"",ref:X,children:M})});E.displayName=S;function j(){return m.useState(new Nf)}Ut(j,"useInitCollection");function N(T){const{itemMap:O}=d(a+"CollectionConsumer",T);return O}return Ut(N,"useCollection"),[{Provider:h,Slot:y,ItemSlot:E},{createCollectionScope:i,useCollection:N,useInitCollection:j}]}Ut(AE,"createCollection");function Cb(a,l){if(a===l)return!0;if(typeof a!="object"||typeof l!="object"||a==null||l==null)return!1;const o=Object.keys(a),i=Object.keys(l);if(o.length!==i.length)return!1;for(const u of o)if(!Object.prototype.hasOwnProperty.call(l,u)||a[u]!==l[u])return!1;return!0}Ut(Cb,"shallowEqual");function Eb(a,l){return!!(l.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)}Ut(Eb,"isElementPreceding");function Xf(a,l){return!a[1].element||!l[1].element?0:Eb(a[1].element,l[1].element)?-1:1}Ut(Xf,"sortByDocumentPosition");function Rb(a){return new MutationObserver(o=>{for(const i of o)if(i.type==="childList"){a();return}})}Ut(Rb,"getChildListObserver");var ME=Object.defineProperty,DE=(a,l)=>ME(a,"name",{value:l,configurable:!0}),OE=m.createContext(void 0);function zo(a){const l=m.useContext(OE);return a||l||"ltr"}DE(zo,"useDirection");var _E=Object.defineProperty,kE=(a,l)=>_E(a,"name",{value:l,configurable:!0});function Kn(a){const l=m.useRef(a);return m.useEffect(()=>{l.current=a}),m.useMemo(()=>((...o)=>{var i;return(i=l.current)==null?void 0:i.call(l,...o)}),[])}kE(Kn,"useCallbackRef");var zE=Object.defineProperty,Lt=(a,l)=>zE(a,"name",{value:l,configurable:!0}),Ff="dismissableLayer.update",LE="dismissableLayer.pointerDownOutside",UE="dismissableLayer.focusOutside",$x,Nb=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Lc=m.forwardRef(Lt(function(l,o){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:u=!1,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:v,...x}=l,y=m.useContext(Nb),[S,w]=m.useState(null),C=(S==null?void 0:S.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=m.useState({}),j=Ge(o,w),N=Array.from(y.layers),[A]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),T=A?N.indexOf(A):-1,O=S?N.indexOf(S):-1,_=y.layersWithOutsidePointerEventsDisabled.size>0,M=O>=T,H=m.useRef(!1),z=Ab(I=>{h==null||h(I),g==null||g(I),I.defaultPrevented||v==null||v()},{ownerDocument:C,deferPointerDownOutside:u,isDeferredPointerDownOutsideRef:H,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(I=>{if(!(I instanceof Node))return!1;const re=[...y.branches].some(W=>W.contains(I));return M&&!re},[y.branches,M])}),K=Mb(I=>{if(u&&H.current)return;const re=I.target;[...y.branches].some(oe=>oe.contains(re))||(p==null||p(I),g==null||g(I),I.defaultPrevented||v==null||v())},C),se=S?O===N.length-1:!1,X=Kn(I=>{I.key==="Escape"&&(d==null||d(I),!I.defaultPrevented&&v&&(I.preventDefault(),v()))});return m.useEffect(()=>{if(se)return C.addEventListener("keydown",X,{capture:!0}),()=>C.removeEventListener("keydown",X,{capture:!0})},[C,se,X]),m.useEffect(()=>{if(S)return i&&(y.layersWithOutsidePointerEventsDisabled.size===0&&($x=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(S)),y.layers.add(S),Qf(),()=>{i&&(y.layersWithOutsidePointerEventsDisabled.delete(S),y.layersWithOutsidePointerEventsDisabled.size===0&&(C.body.style.pointerEvents=$x))}},[S,C,i,y]),m.useEffect(()=>()=>{S&&(y.layers.delete(S),y.layersWithOutsidePointerEventsDisabled.delete(S),Qf())},[S,y]),m.useEffect(()=>{const I=Lt(()=>E({}),"handleUpdate");return document.addEventListener(Ff,I),()=>document.removeEventListener(Ff,I)},[]),s.jsx(Pe.div,{...x,ref:j,style:{pointerEvents:_?M?"auto":"none":void 0,...l.style},onFocusCapture:je(l.onFocusCapture,K.onFocusCapture),onBlurCapture:je(l.onBlurCapture,K.onBlurCapture),onPointerDownCapture:je(l.onPointerDownCapture,z.onPointerDownCapture)})},"DismissableLayer"));function Tb(){const a=m.useContext(Nb),[l,o]=m.useState(null);return m.useEffect(()=>{if(l)return a.dismissableSurfaces.add(l),()=>{a.dismissableSurfaces.delete(l)}},[l,a.dismissableSurfaces]),o}Lt(Tb,"useDismissableLayerSurface");var BE=Lt(()=>!0,"IS_TRUE");function Ab(a,l){const{ownerDocument:o=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:u,dismissableSurfaces:d,shouldHandlePointerDownOutside:h=BE}=l,p=Kn(a),g=m.useRef(!1),v=m.useRef(!1),x=m.useRef(new Map),y=m.useRef(()=>{});return m.useEffect(()=>{function S(){v.current=!1,u.current=!1,x.current.clear()}Lt(S,"resetOutsideInteraction");function w(){return Array.from(x.current.values()).some(Boolean)}Lt(w,"isOutsideInteractionIntercepted");function C(T){if(!v.current)return;const O=T.target;O instanceof Node&&[...d].some(M=>M.contains(O))||x.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{v.current&&y.current()},0)}Lt(C,"handleInteractionCapture");function E(T){v.current&&x.current.set(T.type,!1)}Lt(E,"handleInteractionBubble");const j=Lt(T=>{if(T.target&&!g.current){let O=function(){o.removeEventListener("click",y.current);const M=w();S(),M||_h(LE,p,_,{discrete:!0})};if(Lt(O,"handleAndDispatchPointerDownOutsideEvent"),!h(T.target)){o.removeEventListener("click",y.current),S(),g.current=!1;return}const _={originalEvent:T};v.current=!0,u.current=i&&T.button===0,x.current.clear(),!i||T.button!==0?O():(o.removeEventListener("click",y.current),y.current=O,o.addEventListener("click",y.current,{once:!0}))}else o.removeEventListener("click",y.current),S();g.current=!1},"handlePointerDown"),N=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of N)o.addEventListener(T,C,!0),o.addEventListener(T,E);const A=window.setTimeout(()=>{o.addEventListener("pointerdown",j)},0);return()=>{window.clearTimeout(A),o.removeEventListener("pointerdown",j),o.removeEventListener("click",y.current);for(const T of N)o.removeEventListener(T,C,!0),o.removeEventListener(T,E)}},[o,p,i,u,d,h]),{onPointerDownCapture:Lt(()=>g.current=!0,"onPointerDownCapture")}}Lt(Ab,"usePointerDownOutside");function Mb(a,l=globalThis==null?void 0:globalThis.document){const o=Kn(a),i=m.useRef(!1);return m.useEffect(()=>{const u=Lt(d=>{d.target&&!i.current&&_h(UE,o,{originalEvent:d},{discrete:!1})},"handleFocus");return l.addEventListener("focusin",u),()=>l.removeEventListener("focusin",u)},[l,o]),{onFocusCapture:Lt(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Lt(()=>i.current=!1,"onBlurCapture")}}Lt(Mb,"useFocusOutside");function Qf(){const a=new CustomEvent(Ff);document.dispatchEvent(a)}Lt(Qf,"dispatchUpdate");function _h(a,l,o,{discrete:i}){const u=o.originalEvent.target,d=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:o});l&&u.addEventListener(a,l,{once:!0}),i?Dh(u,d):u.dispatchEvent(d)}Lt(_h,"handleAndDispatchCustomEvent");var HE=Object.defineProperty,kh=(a,l)=>HE(a,"name",{value:l,configurable:!0}),nc=0,ha=null;function PE(a){return Lo(),a.children}kh(PE,"FocusGuards");function Lo(){m.useEffect(()=>{ha||(ha={start:Zf(),end:Zf()});const{start:a,end:l}=ha;return document.body.firstElementChild!==a&&document.body.insertAdjacentElement("afterbegin",a),document.body.lastElementChild!==l&&document.body.insertAdjacentElement("beforeend",l),nc++,()=>{nc===1&&(ha==null||ha.start.remove(),ha==null||ha.end.remove(),ha=null),nc=Math.max(0,nc-1)}},[])}kh(Lo,"useFocusGuards");function Zf(){const a=document.createElement("span");return a.setAttribute("data-radix-focus-guard",""),a.tabIndex=0,a.style.outline="none",a.style.opacity="0",a.style.position="fixed",a.style.pointerEvents="none",a}kh(Zf,"createFocusGuard");var qE=Object.defineProperty,Zt=(a,l)=>qE(a,"name",{value:l,configurable:!0}),Tf="focusScope.autoFocusOnMount",Af="focusScope.autoFocusOnUnmount",Kx={bubbles:!1,cancelable:!0},zh=m.forwardRef(Zt(function(l,o){const{loop:i=!1,trapped:u=!1,onMountAutoFocus:d,onUnmountAutoFocus:h,...p}=l,[g,v]=m.useState(null),x=Kn(d),y=Kn(h),S=m.useRef(null),w=Ge(o,v),C=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(u){let j=function(O){if(C.paused||!g)return;const _=O.target;g.contains(_)?S.current=_:$a(S.current,{select:!0})},N=function(O){if(C.paused||!g)return;const _=O.relatedTarget;_!==null&&(g.contains(_)||$a(S.current,{select:!0}))},A=function(O){if(document.activeElement===document.body)for(const M of O)M.removedNodes.length>0&&$a(g)};Zt(j,"handleFocusIn"),Zt(N,"handleFocusOut"),Zt(A,"handleMutations"),document.addEventListener("focusin",j),document.addEventListener("focusout",N);const T=new MutationObserver(A);return g&&T.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",N),T.disconnect()}}},[u,g,C.paused]),m.useEffect(()=>{if(g){Xx.add(C);const j=document.activeElement;if(!g.contains(j)){const A=new CustomEvent(Tf,Kx);g.addEventListener(Tf,x),g.dispatchEvent(A),A.defaultPrevented||(Db(Lb(Lh(g)),{select:!0}),document.activeElement===j&&$a(g))}return()=>{g.removeEventListener(Tf,x),setTimeout(()=>{const A=new CustomEvent(Af,Kx);g.addEventListener(Af,y),g.dispatchEvent(A),A.defaultPrevented||$a(j??document.body,{select:!0}),g.removeEventListener(Af,y),Xx.remove(C)},0)}}},[g,x,y,C]);const E=m.useCallback(j=>{if(!i&&!u||C.paused)return;const N=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,A=document.activeElement;if(N&&A){const T=j.currentTarget,[O,_]=Ob(T);O&&_?!j.shiftKey&&A===_?(j.preventDefault(),i&&$a(O,{select:!0})):j.shiftKey&&A===O&&(j.preventDefault(),i&&$a(_,{select:!0})):A===T&&j.preventDefault()}},[i,u,C.paused]);return s.jsx(Pe.div,{tabIndex:-1,...p,ref:w,onKeyDown:E})},"FocusScope"));function Db(a,{select:l=!1}={}){const o=document.activeElement;for(const i of a)if($a(i,{select:l}),document.activeElement!==o)return}Zt(Db,"focusFirst");function Ob(a){const l=Lh(a),o=Jf(l,a),i=Jf(l.reverse(),a);return[o,i]}Zt(Ob,"getTabbableEdges");function Lh(a){const l=[],o=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:Zt(i=>{const u=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||u?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;o.nextNode();)l.push(o.currentNode);return l}Zt(Lh,"getTabbableCandidates");function Jf(a,l){const o=typeof l.checkVisibility=="function"&&l.checkVisibility({checkVisibilityCSS:!0});for(const i of a)if(!(o?!i.checkVisibility({checkVisibilityCSS:!0}):_b(i,{upTo:l})))return i}Zt(Jf,"findVisible");function _b(a,{upTo:l}){if(getComputedStyle(a).visibility==="hidden")return!0;for(;a;){if(l!==void 0&&a===l)return!1;if(getComputedStyle(a).display==="none")return!0;a=a.parentElement}return!1}Zt(_b,"isHidden");function kb(a){return a instanceof HTMLInputElement&&"select"in a}Zt(kb,"isSelectableInput");function $a(a,{select:l=!1}={}){if(a&&a.focus){const o=document.activeElement;a.focus({preventScroll:!0}),a!==o&&kb(a)&&l&&a.select()}}Zt($a,"focus");var Xx=zb();function zb(){let a=[];return{add(l){const o=a[0];l!==o&&(o==null||o.pause()),a=Wf(a,l),a.unshift(l)},remove(l){var o;a=Wf(a,l),(o=a[0])==null||o.resume()}}}Zt(zb,"createFocusScopesStack");function Wf(a,l){const o=[...a],i=o.indexOf(l);return i!==-1&&o.splice(i,1),o}Zt(Wf,"arrayRemove");function Lb(a){return a.filter(l=>l.tagName!=="A")}Zt(Lb,"removeLinks");var IE=Object.defineProperty,VE=(a,l)=>IE(a,"name",{value:l,configurable:!0}),GE=gs[" useId ".trim().toString()]||(()=>{}),YE=0;function ga(a){const[l,o]=m.useState(GE());return _t(()=>{a||o(i=>i??String(YE++))},[a]),a||(l?`radix-${l}`:"")}VE(ga,"useId");const $E=["top","right","bottom","left"],Bl=Math.min,Xa=Math.max,wc=Math.round,ac=Math.floor,Fa=a=>({x:a,y:a}),KE={left:"right",right:"left",bottom:"top",top:"bottom"};function Ub(a,l,o){return Xa(a,Bl(l,o))}function Wa(a,l){return typeof a=="function"?a(l):a}function Hl(a){return a.split("-")[0]}function js(a){return a.split("-")[1]}function Uh(a){return a==="x"?"y":"x"}function Bh(a){return a==="y"?"height":"width"}function pa(a){const l=a[0];return l==="t"||l==="b"?"y":"x"}function Hh(a){return Uh(pa(a))}function XE(a,l,o){o===void 0&&(o=!1);const i=js(a),u=Hh(a),d=Bh(u);let h=u==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return l.reference[d]>l.floating[d]&&(h=jc(h)),[h,jc(h)]}function FE(a){const l=jc(a);return[eh(a),l,eh(l)]}function eh(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}const Fx=["left","right"],Qx=["right","left"],QE=["top","bottom"],ZE=["bottom","top"];function JE(a,l,o){switch(a){case"top":case"bottom":return o?l?Qx:Fx:l?Fx:Qx;case"left":case"right":return l?QE:ZE;default:return[]}}function WE(a,l,o,i){const u=js(a);let d=JE(Hl(a),o==="start",i);return u&&(d=d.map(h=>h+"-"+u),l&&(d=d.concat(d.map(eh)))),d}function jc(a){const l=Hl(a);return KE[l]+a.slice(l.length)}function eR(a){var l,o,i,u;return{top:(l=a.top)!=null?l:0,right:(o=a.right)!=null?o:0,bottom:(i=a.bottom)!=null?i:0,left:(u=a.left)!=null?u:0}}function Bb(a){return typeof a!="number"?eR(a):{top:a,right:a,bottom:a,left:a}}function Cc(a){const{x:l,y:o,width:i,height:u}=a;return{width:i,height:u,top:o,left:l,right:l+i,bottom:o+u,x:l,y:o}}function Zx(a,l,o){let{reference:i,floating:u}=a;const d=pa(l),h=Hh(l),p=Bh(h),g=Hl(l),v=d==="y",x=i.x+i.width/2-u.width/2,y=i.y+i.height/2-u.height/2,S=i[p]/2-u[p]/2;let w;switch(g){case"top":w={x,y:i.y-u.height};break;case"bottom":w={x,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y};break;case"left":w={x:i.x-u.width,y};break;default:w={x:i.x,y:i.y}}const C=js(l);return C&&(w[h]+=S*(C==="end"?1:-1)*(o&&v?-1:1)),w}async function tR(a,l){var o;l===void 0&&(l={});const{x:i,y:u,platform:d,rects:h,elements:p,strategy:g}=a,{boundary:v="clippingAncestors",rootBoundary:x="viewport",elementContext:y="floating",altBoundary:S=!1,padding:w=0}=Wa(l,a),C=Bb(w),j=p[S?y==="floating"?"reference":"floating":y],N=Cc(await d.getClippingRect({element:(o=await(d.isElement==null?void 0:d.isElement(j)))==null||o?j:j.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(p.floating)),boundary:v,rootBoundary:x,strategy:g})),A=y==="floating"?{x:i,y:u,width:h.floating.width,height:h.floating.height}:h.reference,T=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p.floating)),O=await(d.isElement==null?void 0:d.isElement(T))&&await(d.getScale==null?void 0:d.getScale(T))||{x:1,y:1},_=Cc(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:A,offsetParent:T,strategy:g}):A);return{top:(N.top-_.top+C.top)/O.y,bottom:(_.bottom-N.bottom+C.bottom)/O.y,left:(N.left-_.left+C.left)/O.x,right:(_.right-N.right+C.right)/O.x}}const nR=50,aR=async(a,l,o)=>{const{placement:i="bottom",strategy:u="absolute",middleware:d=[],platform:h}=o,p=h.detectOverflow?h:{...h,detectOverflow:tR},g=await(h.isRTL==null?void 0:h.isRTL(l));let v=await h.getElementRects({reference:a,floating:l,strategy:u}),{x,y}=Zx(v,i,g),S=i,w=0;const C={};for(let E=0;E<d.length;E++){const j=d[E];if(!j)continue;const{name:N,fn:A}=j,{x:T,y:O,data:_,reset:M}=await A({x,y,initialPlacement:i,placement:S,strategy:u,middlewareData:C,rects:v,platform:p,elements:{reference:a,floating:l}});x=T??x,y=O??y,C[N]={...C[N],..._},M&&w<nR&&(w++,typeof M=="object"&&(M.placement&&(S=M.placement),M.rects&&(v=M.rects===!0?await h.getElementRects({reference:a,floating:l,strategy:u}):M.rects),{x,y}=Zx(v,S,g)),E=-1)}return{x,y,placement:S,strategy:u,middlewareData:C}},lR=a=>({name:"arrow",options:a,async fn(l){const{x:o,y:i,placement:u,rects:d,platform:h,elements:p,middlewareData:g}=l,{element:v,padding:x=0}=Wa(a,l)||{};if(v==null)return{};const y=Bb(x),S={x:o,y:i},w=Hh(u),C=Bh(w),E=await h.getDimensions(v),j=w==="y",N=j?"top":"left",A=j?"bottom":"right",T=j?"clientHeight":"clientWidth",O=d.reference[C]+d.reference[w]-S[w]-d.floating[C],_=S[w]-d.reference[w],M=await(h.getOffsetParent==null?void 0:h.getOffsetParent(v));let H=M?M[T]:0;(!H||!await(h.isElement==null?void 0:h.isElement(M)))&&(H=p.floating[T]||d.floating[C]);const z=O/2-_/2,K=H/2-E[C]/2-1,se=Bl(y[N],K),X=Bl(y[A],K),I=H-E[C]-X,re=H/2-E[C]/2+z,W=Ub(se,re,I),oe=!g.arrow&&js(u)!=null&&re!==W&&d.reference[C]/2-(re<se?se:X)-E[C]/2<0,U=oe?re<se?re-se:re-I:0;return{[w]:S[w]+U,data:{[w]:W,centerOffset:re-W-U,...oe&&{alignmentOffset:U}},reset:oe}}}),rR=function(a){return a===void 0&&(a={}),{name:"flip",options:a,async fn(l){var o,i;const{placement:u,middlewareData:d,rects:h,initialPlacement:p,platform:g,elements:v}=l,{mainAxis:x=!0,crossAxis:y=!0,fallbackPlacements:S,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:E=!0,...j}=Wa(a,l);if((o=d.arrow)!=null&&o.alignmentOffset)return{};const N=Hl(u),A=pa(p),T=Hl(p)===p,O=await(g.isRTL==null?void 0:g.isRTL(v.floating)),_=S||(T||!E?[jc(p)]:FE(p)),M=C!=="none";!S&&M&&_.push(...WE(p,E,C,O));const H=[p,..._],z=await g.detectOverflow(l,j),K=[];let se=((i=d.flip)==null?void 0:i.overflows)||[];if(x&&K.push(z[N]),y){const W=XE(u,h,O);K.push(z[W[0]],z[W[1]])}if(se=[...se,{placement:u,overflows:K}],!K.every(W=>W<=0)){var X,I;const W=(((X=d.flip)==null?void 0:X.index)||0)+1,oe=H[W];if(oe&&(!(y==="alignment"?A!==pa(oe):!1)||se.every(ne=>pa(ne.placement)===A?ne.overflows[0]>0:!0)))return{data:{index:W,overflows:se},reset:{placement:oe}};let U=(I=se.filter($=>$.overflows[0]<=0).sort(($,ne)=>$.overflows[1]-ne.overflows[1])[0])==null?void 0:I.placement;if(!U)switch(w){case"bestFit":{var re;const $=(re=se.filter(ne=>{if(M){const B=pa(ne.placement);return B===A||B==="y"}return!0}).map(ne=>[ne.placement,ne.overflows.filter(B=>B>0).reduce((B,Z)=>B+Z,0)]).sort((ne,B)=>ne[1]-B[1])[0])==null?void 0:re[0];$&&(U=$);break}case"initialPlacement":U=p;break}if(u!==U)return{reset:{placement:U}}}return{}}}};function Jx(a,l){return{top:a.top-l.height,right:a.right-l.width,bottom:a.bottom-l.height,left:a.left-l.width}}function Wx(a){return $E.some(l=>a[l]>=0)}const sR=function(a){return a===void 0&&(a={}),{name:"hide",options:a,async fn(l){const{rects:o,platform:i}=l,{strategy:u="referenceHidden",...d}=Wa(a,l);switch(u){case"referenceHidden":{const h=await i.detectOverflow(l,{...d,elementContext:"reference"}),p=Jx(h,o.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:Wx(p)}}}case"escaped":{const h=await i.detectOverflow(l,{...d,altBoundary:!0}),p=Jx(h,o.floating);return{data:{escapedOffsets:p,escaped:Wx(p)}}}default:return{}}}}},Hb=new Set(["left","top"]);async function oR(a,l){const{placement:o,platform:i,elements:u}=a,d=await(i.isRTL==null?void 0:i.isRTL(u.floating)),h=Hl(o),p=js(o),g=pa(o)==="y",v=Hb.has(h)?-1:1,x=d&&g?-1:1,y=Wa(l,a);let{mainAxis:S,crossAxis:w,alignmentAxis:C}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof C=="number"&&(w=p==="end"?C*-1:C),g?{x:w*x,y:S*v}:{x:S*v,y:w*x}}const iR=function(a){return a===void 0&&(a=0),{name:"offset",options:a,async fn(l){var o,i;const{x:u,y:d,placement:h,middlewareData:p}=l,g=await oR(l,a);return h===((o=p.offset)==null?void 0:o.placement)&&(i=p.arrow)!=null&&i.alignmentOffset?{}:{x:u+g.x,y:d+g.y,data:{...g,placement:h}}}}},cR=function(a){return a===void 0&&(a={}),{name:"shift",options:a,async fn(l){const{x:o,y:i,placement:u,platform:d}=l,{mainAxis:h=!0,crossAxis:p=!1,limiter:g={fn:A=>{let{x:T,y:O}=A;return{x:T,y:O}}},...v}=Wa(a,l),x={x:o,y:i},y=await d.detectOverflow(l,v),S=pa(u),w=Uh(S);let C=x[w],E=x[S];const j=(A,T)=>Ub(T+y[A==="y"?"top":"left"],T,T-y[A==="y"?"bottom":"right"]);h&&(C=j(w,C)),p&&(E=j(S,E));const N=g.fn({...l,[w]:C,[S]:E});return{...N,data:{x:N.x-o,y:N.y-i,enabled:{[w]:h,[S]:p}}}}}},uR=function(a){return a===void 0&&(a={}),{options:a,fn(l){var o,i;const{x:u,y:d,placement:h,rects:p,middlewareData:g}=l,{offset:v=0,mainAxis:x=!0,crossAxis:y=!0}=Wa(a,l),S={x:u,y:d},w=pa(h),C=Uh(w);let E=S[C],j=S[w];const N=Wa(v,l),A=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:(o=N.mainAxis)!=null?o:0,crossAxis:(i=N.crossAxis)!=null?i:0};if(x){const _=C==="y"?"height":"width",M=p.reference[C]-p.floating[_]+A.mainAxis,H=p.reference[C]+p.reference[_]-A.mainAxis;E<M?E=M:E>H&&(E=H)}if(y){var T,O;const _=C==="y"?"width":"height",M=Hb.has(Hl(h)),H=p.reference[w]-p.floating[_]+(M&&((T=g.offset)==null?void 0:T[w])||0)+(M?0:A.crossAxis),z=p.reference[w]+p.reference[_]+(M?0:((O=g.offset)==null?void 0:O[w])||0)-(M?A.crossAxis:0);j<H?j=H:j>z&&(j=z)}return{[C]:E,[w]:j}}}},dR=function(a){return a===void 0&&(a={}),{name:"size",options:a,async fn(l){const{placement:o,rects:i,platform:u,elements:d}=l,{apply:h=()=>{},...p}=Wa(a,l),g=await u.detectOverflow(l,p),v=Hl(o),x=js(o),y=pa(o)==="y",{width:S,height:w}=i.floating;let C,E;v==="top"||v==="bottom"?(C=v,E=x===(await(u.isRTL==null?void 0:u.isRTL(d.floating))?"start":"end")?"left":"right"):(E=v,C=x==="end"?"top":"bottom");const j=w-g.top-g.bottom,N=S-g.left-g.right,A=Bl(w-g[C],j),T=Bl(S-g[E],N),O=l.middlewareData.shift,_=!O;let M=A,H=T;O!=null&&O.enabled.x&&(H=N),O!=null&&O.enabled.y&&(M=j),_&&!x&&(y?H=S-2*Xa(g.left,g.right):M=w-2*Xa(g.top,g.bottom)),await h({...l,availableWidth:H,availableHeight:M});const z=await u.getDimensions(d.floating);return S!==z.width||w!==z.height?{reset:{rects:!0}}:{}}}};function Uc(){return typeof window<"u"}function Cs(a){return Pb(a)?(a.nodeName||"").toLowerCase():"#document"}function fn(a){var l;return(a==null||(l=a.ownerDocument)==null?void 0:l.defaultView)||window}function nl(a){var l;return(l=(Pb(a)?a.ownerDocument:a.document)||window.document)==null?void 0:l.documentElement}function Pb(a){return Uc()?a instanceof Node||a instanceof fn(a).Node:!1}function xa(a){return Uc()?a instanceof Element||a instanceof fn(a).Element:!1}function ql(a){return Uc()?a instanceof HTMLElement||a instanceof fn(a).HTMLElement:!1}function ey(a){return!Uc()||typeof ShadowRoot>"u"?!1:a instanceof ShadowRoot||a instanceof fn(a).ShadowRoot}function Bc(a){const{overflow:l,overflowX:o,overflowY:i,display:u}=ya(a);return/auto|scroll|overlay|hidden|clip/.test(l+i+o)&&u!=="inline"&&u!=="contents"}function fR(a){return/^(table|td|th)$/.test(Cs(a))}function Hc(a){try{if(a.matches(":popover-open"))return!0}catch{}try{return a.matches(":modal")}catch{return!1}}const hR=/transform|translate|scale|rotate|perspective|filter/,mR=/paint|layout|strict|content/,ir=a=>!!a&&a!=="none";let Mf;function Ph(a){const l=xa(a)?ya(a):a;return ir(l.transform)||ir(l.translate)||ir(l.scale)||ir(l.rotate)||ir(l.perspective)||!qh()&&(ir(l.backdropFilter)||ir(l.filter))||hR.test(l.willChange||"")||mR.test(l.contain||"")}function pR(a){let l=fr(a);for(;ql(l)&&!Eo(l);){if(Ph(l))return l;if(Hc(l))return null;l=fr(l)}return null}function qh(){return Mf==null&&(Mf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Mf}function Eo(a){return/^(html|body|#document)$/.test(Cs(a))}function ya(a){return fn(a).getComputedStyle(a)}function Pc(a){return xa(a)?{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}:{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function fr(a){if(Cs(a)==="html")return a;const l=a.assignedSlot||a.parentNode||ey(a)&&a.host||nl(a);return ey(l)?l.host:l}function qb(a){const l=fr(a);return Eo(l)?(a.ownerDocument||a).body:ql(l)&&Bc(l)?l:qb(l)}function Ro(a,l,o){var i;l===void 0&&(l=[]),o===void 0&&(o=!0);const u=qb(a),d=u===((i=a.ownerDocument)==null?void 0:i.body),h=fn(u);if(d){const p=th(h);return l.concat(h,h.visualViewport||[],Bc(u)?u:[],p&&o?Ro(p):[])}else return l.concat(u,Ro(u,[],o))}function th(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function Ib(a){const l=ya(a);let o=parseFloat(l.width)||0,i=parseFloat(l.height)||0;const u=ql(a),d=u?a.offsetWidth:o,h=u?a.offsetHeight:i,p=wc(o)!==d||wc(i)!==h;return p&&(o=d,i=h),{width:o,height:i,$:p}}function Ih(a){return xa(a)?a:a.contextElement}function hs(a){const l=Ih(a);if(!ql(l))return Fa(1);const o=l.getBoundingClientRect(),{width:i,height:u,$:d}=Ib(l);let h=(d?wc(o.width):o.width)/i,p=(d?wc(o.height):o.height)/u;return(!h||!Number.isFinite(h))&&(h=1),(!p||!Number.isFinite(p))&&(p=1),{x:h,y:p}}const gR=Fa(0);function Vb(a){const l=fn(a);return!qh()||!l.visualViewport?gR:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function vR(a,l,o){return l===void 0&&(l=!1),!!o&&l&&o===fn(a)}function hr(a,l,o,i){l===void 0&&(l=!1),o===void 0&&(o=!1);const u=a.getBoundingClientRect(),d=Ih(a);let h=Fa(1);l&&(i?xa(i)&&(h=hs(i)):h=hs(a));const p=vR(d,o,i)?Vb(d):Fa(0);let g=(u.left+p.x)/h.x,v=(u.top+p.y)/h.y,x=u.width/h.x,y=u.height/h.y;if(d&&i){const S=fn(d),w=xa(i)?fn(i):i;let C=S,E=th(C);for(;E&&w!==C;){const j=hs(E),N=E.getBoundingClientRect(),A=ya(E),T=N.left+(E.clientLeft+parseFloat(A.paddingLeft))*j.x,O=N.top+(E.clientTop+parseFloat(A.paddingTop))*j.y;g*=j.x,v*=j.y,x*=j.x,y*=j.y,g+=T,v+=O,C=fn(E),E=th(C)}}return Cc({width:x,height:y,x:g,y:v})}function qc(a,l){const o=Pc(a).scrollLeft;return l?l.left+o:hr(nl(a)).left+o}function Gb(a,l){const o=a.getBoundingClientRect(),i=o.left+l.scrollLeft-qc(a,o),u=o.top+l.scrollTop;return{x:i,y:u}}function xR(a){let{elements:l,rect:o,offsetParent:i,strategy:u}=a;const d=u==="fixed",h=nl(i),p=l?Hc(l.floating):!1;if(i===h||p&&d)return o;let g={scrollLeft:0,scrollTop:0},v=Fa(1);const x=Fa(0),y=ql(i);if((y||!d)&&((Cs(i)!=="body"||Bc(h))&&(g=Pc(i)),y)){const w=hr(i);v=hs(i),x.x=w.x+i.clientLeft,x.y=w.y+i.clientTop}const S=h&&!y&&!d?Gb(h,g):Fa(0);return{width:o.width*v.x,height:o.height*v.y,x:o.x*v.x-g.scrollLeft*v.x+x.x+S.x,y:o.y*v.y-g.scrollTop*v.y+x.y+S.y}}function yR(a){return a.getClientRects?Array.from(a.getClientRects()):[]}function bR(a){const l=Pc(a),o=a.ownerDocument.body,i=Xa(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),u=Xa(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let d=-l.scrollLeft+qc(a);const h=-l.scrollTop;return ya(o).direction==="rtl"&&(d+=Xa(a.clientWidth,o.clientWidth)-i),{width:i,height:u,x:d,y:h}}const SR=25;function wR(a,l,o){o===void 0&&(o="viewport");const i=o==="layoutViewport",u=fn(a),d=nl(a),h=u.visualViewport;let p=d.clientWidth,g=d.clientHeight,v=0,x=0;if(h){const S=!qh()||l==="fixed";i?S||(v=-h.offsetLeft,x=-h.offsetTop):(p=h.width,g=h.height,S&&(v=h.offsetLeft,x=h.offsetTop))}if(qc(d)<=0){const S=d.ownerDocument,w=S.body,C=getComputedStyle(w),E=S.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,j=Math.abs(d.clientWidth-w.clientWidth-E),N=getComputedStyle(d).scrollbarGutter==="stable both-edges"?j/2:j;N<=SR&&(p-=N)}return{width:p,height:g,x:v,y:x}}function jR(a,l){const o=hr(a,!0,l==="fixed"),i=o.top+a.clientTop,u=o.left+a.clientLeft,d=hs(a),h=a.clientWidth*d.x,p=a.clientHeight*d.y,g=u*d.x,v=i*d.y;return{width:h,height:p,x:g,y:v}}function ty(a,l,o){let i;if(l==="viewport"||l==="layoutViewport")i=wR(a,o,l);else if(l==="document")i=bR(nl(a));else if(xa(l))i=jR(l,o);else{const u=Vb(a);i={x:l.x-u.x,y:l.y-u.y,width:l.width,height:l.height}}return Cc(i)}function CR(a,l){const o=l.get(a);if(o)return o;let i=Ro(a,[],!1).filter(p=>xa(p)&&Cs(p)!=="body"),u=null;const d=ya(a).position==="fixed";let h=d?fr(a):a;for(;xa(h)&&!Eo(h);){const p=ya(h),g=Ph(h),v=u?u.position:d?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&p.position==="static")?i=i.filter(y=>y!==h):u=p,h=fr(h)}return l.set(a,i),i}function ER(a){let{element:l,boundary:o,rootBoundary:i,strategy:u}=a;const h=[...o==="clippingAncestors"?Hc(l)?[]:CR(l,this._c):[].concat(o),i],p=ty(l,h[0],u);let g=p.top,v=p.right,x=p.bottom,y=p.left;for(let S=1;S<h.length;S++){const w=ty(l,h[S],u);g=Xa(w.top,g),v=Bl(w.right,v),x=Bl(w.bottom,x),y=Xa(w.left,y)}return{width:v-y,height:x-g,x:y,y:g}}function RR(a){const{width:l,height:o}=Ib(a);return{width:l,height:o}}function NR(a,l,o){const i=ql(l),u=nl(l),d=o==="fixed",h=hr(a,!0,d,l);let p={scrollLeft:0,scrollTop:0};const g=Fa(0);if((i||!d)&&((Cs(l)!=="body"||Bc(u))&&(p=Pc(l)),i)){const S=hr(l,!0,d,l);g.x=S.x+l.clientLeft,g.y=S.y+l.clientTop}!i&&u&&(g.x=qc(u));const v=u&&!i&&!d?Gb(u,p):Fa(0),x=h.left+p.scrollLeft-g.x-v.x,y=h.top+p.scrollTop-g.y-v.y;return{x,y,width:h.width,height:h.height}}function Df(a){return ya(a).position==="static"}function ny(a,l){if(!ql(a)||ya(a).position==="fixed")return null;if(l)return l(a);let o=a.offsetParent;return nl(a)===o&&(o=o.ownerDocument.body),o}function Yb(a,l){const o=fn(a);if(Hc(a))return o;if(!ql(a)){let u=fr(a);for(;u&&!Eo(u);){if(xa(u)&&!Df(u))return u;u=fr(u)}return o}let i=ny(a,l);for(;i&&fR(i)&&Df(i);)i=ny(i,l);return i&&Eo(i)&&Df(i)&&!Ph(i)?o:i||pR(a)||o}const TR=async function(a){const l=this.getOffsetParent||Yb,o=this.getDimensions,i=await o(a.floating);return{reference:NR(a.reference,await l(a.floating),a.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function AR(a){return ya(a).direction==="rtl"}const MR={convertOffsetParentRelativeRectToViewportRelativeRect:xR,getDocumentElement:nl,getClippingRect:ER,getOffsetParent:Yb,getElementRects:TR,getClientRects:yR,getDimensions:RR,getScale:hs,isElement:xa,isRTL:AR};function $b(a,l){return a.x===l.x&&a.y===l.y&&a.width===l.width&&a.height===l.height}function DR(a,l,o){let i=null,u;const d=nl(a);function h(){var x;clearTimeout(u),(x=i)==null||x.disconnect(),i=null}function p(x,y){x===void 0&&(x=!1),y===void 0&&(y=1),h();const S=a.getBoundingClientRect(),{left:w,top:C,width:E,height:j}=S;if(x||l(),!E||!j)return;const N=ac(C),A=ac(d.clientWidth-(w+E)),T=ac(d.clientHeight-(C+j)),O=ac(w),M={rootMargin:-N+"px "+-A+"px "+-T+"px "+-O+"px",threshold:Xa(0,Bl(1,y))||1};let H=!0;function z(K){const se=K[0].intersectionRatio;if(!$b(S,a.getBoundingClientRect()))return p();if(se!==y){if(!H)return p();se?p(!1,se):u=setTimeout(()=>{p(!1,1e-7)},1e3)}H=!1}try{i=new IntersectionObserver(z,{...M,root:d.ownerDocument})}catch{i=new IntersectionObserver(z,M)}i.observe(a)}const g=fn(a),v=()=>p(o);return g.addEventListener("resize",v),p(!0),()=>{g.removeEventListener("resize",v),h()}}function OR(a,l,o,i){i===void 0&&(i={});const{ancestorScroll:u=!0,ancestorResize:d=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=i,v=Ih(a),x=u||d?[...v?Ro(v):[],...l?Ro(l):[]]:[];x.forEach(N=>{u&&N.addEventListener("scroll",o),d&&N.addEventListener("resize",o)});const y=v&&p?DR(v,o,d):null;let S=-1,w=null;h&&(w=new ResizeObserver(N=>{let[A]=N;A&&A.target===v&&w&&l&&(w.unobserve(l),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var T;(T=w)==null||T.observe(l)})),o()}),v&&!g&&w.observe(v),l&&w.observe(l));let C,E=g?hr(a):null;g&&j();function j(){const N=hr(a);E&&!$b(E,N)&&o(),E=N,C=requestAnimationFrame(j)}return o(),()=>{var N;x.forEach(A=>{u&&A.removeEventListener("scroll",o),d&&A.removeEventListener("resize",o)}),y==null||y(),(N=w)==null||N.disconnect(),w=null,g&&cancelAnimationFrame(C)}}const _R=iR,kR=cR,zR=rR,LR=dR,UR=sR,ay=lR,BR=uR,HR=(a,l,o)=>{const i=new Map,u=o??{},d={...MR,...u.platform,_c:i};return aR(a,l,{...u,platform:d})};var PR=typeof document<"u",qR=function(){},vc=PR?m.useLayoutEffect:qR;function Ec(a,l){if(a===l)return!0;if(typeof a!=typeof l)return!1;if(typeof a=="function"&&a.toString()===l.toString())return!0;let o,i,u;if(a&&l&&typeof a=="object"){if(Array.isArray(a)){if(o=a.length,o!==l.length)return!1;for(i=o;i--!==0;)if(!Ec(a[i],l[i]))return!1;return!0}if(u=Object.keys(a),o=u.length,o!==Object.keys(l).length)return!1;for(i=o;i--!==0;)if(!{}.hasOwnProperty.call(l,u[i]))return!1;for(i=o;i--!==0;){const d=u[i];if(!(d==="_owner"&&a.$$typeof)&&!Ec(a[d],l[d]))return!1}return!0}return a!==a&&l!==l}function Kb(a){return typeof window>"u"?1:(a.ownerDocument.defaultView||window).devicePixelRatio||1}function ly(a,l){const o=Kb(a);return Math.round(l*o)/o}function Of(a){const l=m.useRef(a);return vc(()=>{l.current=a}),l}function IR(a){a===void 0&&(a={});const{placement:l="bottom",strategy:o="absolute",middleware:i=[],platform:u,elements:{reference:d,floating:h}={},transform:p=!0,whileElementsMounted:g,open:v}=a,[x,y]=m.useState({x:0,y:0,strategy:o,placement:l,middlewareData:{},isPositioned:!1}),[S,w]=m.useState(i);Ec(S,i)||w(i);const[C,E]=m.useState(null),[j,N]=m.useState(null),A=m.useCallback(ne=>{ne!==M.current&&(M.current=ne,E(ne))},[]),T=m.useCallback(ne=>{ne!==H.current&&(H.current=ne,N(ne))},[]),O=d||C,_=h||j,M=m.useRef(null),H=m.useRef(null),z=m.useRef(x),K=g!=null,se=Of(g),X=Of(u),I=Of(v),re=m.useCallback(()=>{if(!M.current||!H.current)return;const ne={placement:l,strategy:o,middleware:S};X.current&&(ne.platform=X.current),HR(M.current,H.current,ne).then(B=>{const Z={...B,isPositioned:I.current!==!1};W.current&&!Ec(z.current,Z)&&(z.current=Z,bs.flushSync(()=>{y(Z)}))})},[S,l,o,X,I]);vc(()=>{v===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,y(ne=>({...ne,isPositioned:!1})))},[v]);const W=m.useRef(!1);vc(()=>(W.current=!0,()=>{W.current=!1}),[]),vc(()=>{if(O&&(M.current=O),_&&(H.current=_),O&&_){if(se.current)return se.current(O,_,re);re()}},[O,_,re,se,K]);const oe=m.useMemo(()=>({reference:M,floating:H,setReference:A,setFloating:T}),[A,T]),U=m.useMemo(()=>({reference:O,floating:_}),[O,_]),$=m.useMemo(()=>{const ne={position:o,left:0,top:0};if(!U.floating)return ne;const B=ly(U.floating,x.x),Z=ly(U.floating,x.y);return p?{...ne,transform:"translate("+B+"px, "+Z+"px)",...Kb(U.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:B,top:Z}},[o,p,U.floating,x.x,x.y]);return m.useMemo(()=>({...x,update:re,refs:oe,elements:U,floatingStyles:$}),[x,re,oe,U,$])}const VR=a=>{function l(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:a,fn(o){const{element:i,padding:u}=typeof a=="function"?a(o):a;return i&&l(i)?i.current!=null?ay({element:i.current,padding:u}).fn(o):{}:i?ay({element:i,padding:u}).fn(o):{}}}},GR=(a,l)=>{const o=_R(a);return{name:o.name,fn:o.fn,options:[a,l]}},YR=(a,l)=>{const o=kR(a);return{name:o.name,fn:o.fn,options:[a,l]}},$R=(a,l)=>({fn:BR(a).fn,options:[a,l]}),KR=(a,l)=>{const o=zR(a);return{name:o.name,fn:o.fn,options:[a,l]}},XR=(a,l)=>{const o=LR(a);return{name:o.name,fn:o.fn,options:[a,l]}},FR=(a,l)=>{const o=UR(a);return{name:o.name,fn:o.fn,options:[a,l]}},QR=(a,l)=>{const o=VR(a);return{name:o.name,fn:o.fn,options:[a,l]}};var ZR=Object.defineProperty,JR=(a,l)=>ZR(a,"name",{value:l,configurable:!0});function Ic(a){const[l,o]=m.useState(void 0);return _t(()=>{if(a){o({width:a.offsetWidth,height:a.offsetHeight});const i=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const d=u[0];let h,p;if("borderBoxSize"in d){const g=d.borderBoxSize,v=Array.isArray(g)?g[0]:g;h=v.inlineSize,p=v.blockSize}else h=a.offsetWidth,p=a.offsetHeight;o({width:h,height:p})});return i.observe(a,{box:"border-box"}),()=>i.unobserve(a)}else o(void 0)},[a]),l}JR(Ic,"useSize");var WR=Object.defineProperty,Ll=(a,l)=>WR(a,"name",{value:l,configurable:!0}),Xb="Popper",[Fb,Es]=mn(Xb),[eN,Qb]=Fb(Xb),tN=Ll(a=>{const{__scopePopper:l,children:o}=a,[i,u]=m.useState(null),[d,h]=m.useState(void 0);return s.jsx(eN,{scope:l,anchor:i,onAnchorChange:u,placementState:d,setPlacementState:h,children:o})},"Popper"),nN="PopperAnchor",aN=m.forwardRef(Ll(function(l,o){const{__scopePopper:i,virtualRef:u,...d}=l,h=Qb(nN,i),p=m.useRef(null),g=h.onAnchorChange,v=m.useCallback(E=>{p.current=E,E&&g(E)},[g]),x=Ge(o,v),y=m.useRef(null);m.useEffect(()=>{if(!u)return;const E=y.current;y.current=u.current,E!==y.current&&g(y.current)});const S=h.placementState&&Vc(h.placementState),w=S==null?void 0:S[0],C=S==null?void 0:S[1];return u?null:s.jsx(Pe.div,{"data-radix-popper-side":w,"data-radix-popper-align":C,...d,ref:x})},"PopperAnchor")),Zb="PopperContent",[lN,UO]=Fb(Zb),rN=m.forwardRef(Ll(function(l,o){var ve,Ce,De,Ae,Ue,pt,gt;const{__scopePopper:i,side:u="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:S="partial",hideWhenDetached:w=!1,updatePositionStrategy:C="optimized",onPlaced:E,...j}=l,N=Qb(Zb,i),[A,T]=m.useState(null),O=Ge(o,T),[_,M]=m.useState(null),H=Ic(_),z=(H==null?void 0:H.width)??0,K=(H==null?void 0:H.height)??0,se=u+(h!=="center"?"-"+h:""),X=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},I=Array.isArray(x)?x:[x],re=I.length>0,W={padding:X,boundary:I.filter(Jb),altBoundary:re},{refs:oe,floatingStyles:U,placement:$,isPositioned:ne,middlewareData:B}=IR({strategy:"fixed",placement:se,whileElementsMounted:Ll((...le)=>OR(...le,{animationFrame:C==="always"}),"whileElementsMounted"),elements:{reference:N.anchor},middleware:[GR({mainAxis:d+K,alignmentAxis:p}),v&&YR({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?$R():void 0,...W}),v&&KR({...W}),XR({...W,apply:Ll(({elements:le,rects:Me,availableWidth:Fe,availableHeight:St})=>{const{width:Jt,height:pn}=Me.reference,ja=le.floating.style;ja.setProperty("--radix-popper-available-width",`${Fe}px`),ja.setProperty("--radix-popper-available-height",`${St}px`),ja.setProperty("--radix-popper-anchor-width",`${Jt}px`),ja.setProperty("--radix-popper-anchor-height",`${pn}px`)},"apply")}),_&&QR({element:_,padding:g}),sN({arrowWidth:z,arrowHeight:K}),w&&FR({strategy:"referenceHidden",...W,boundary:re?W.boundary:void 0})]}),Z=N.setPlacementState;_t(()=>(Z($),()=>{Z(void 0)}),[$,Z]);const[D,q]=Vc($),Q=Kn(E);_t(()=>{ne&&(Q==null||Q())},[ne,Q]);const ae=(ve=B.arrow)==null?void 0:ve.x,ce=(Ce=B.arrow)==null?void 0:Ce.y,be=((De=B.arrow)==null?void 0:De.centerOffset)!==0,[ue,fe]=m.useState();return _t(()=>{A&&fe(window.getComputedStyle(A).zIndex)},[A]),s.jsx("div",{ref:oe.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:ne?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(Ae=B.transformOrigin)==null?void 0:Ae.x,(Ue=B.transformOrigin)==null?void 0:Ue.y].join(" "),...((pt=B.hide)==null?void 0:pt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:l.dir,children:s.jsx(lN,{scope:i,placedSide:D,placedAlign:q,onArrowChange:M,arrowX:ae,arrowY:ce,shouldHideArrow:be,children:s.jsx(Pe.div,{"data-side":D,"data-align":q,...j,ref:O,style:{...j.style,animation:ne?(gt=j.style)==null?void 0:gt.animation:"none"}})})})},"PopperContent"));function Jb(a){return a!==null}Ll(Jb,"isNotNull");var sN=Ll(a=>({name:"transformOrigin",options:a,fn(l){var j,N,A;const{placement:o,rects:i,middlewareData:u}=l,h=((j=u.arrow)==null?void 0:j.centerOffset)!==0,p=h?0:a.arrowWidth,g=h?0:a.arrowHeight,[v,x]=Vc(o),y={start:"0%",center:"50%",end:"100%"}[x],S=(((N=u.arrow)==null?void 0:N.x)??0)+p/2,w=(((A=u.arrow)==null?void 0:A.y)??0)+g/2;let C="",E="";return v==="bottom"?(C=h?y:`${S}px`,E=`${-g}px`):v==="top"?(C=h?y:`${S}px`,E=`${i.floating.height+g}px`):v==="right"?(C=`${-g}px`,E=h?y:`${w}px`):v==="left"&&(C=`${i.floating.width+g}px`,E=h?y:`${w}px`),{data:{x:C,y:E}}}}),"transformOrigin");function Vc(a){const[l,o="center"]=a.split("-");return[l,o]}Ll(Vc,"getSideAndAlignFromPlacement");var Wb=tN,e0=aN,Vh=rN,oN=Object.defineProperty,iN=(a,l)=>oN(a,"name",{value:l,configurable:!0}),Gh=m.forwardRef(iN(function(l,o){var g;const{container:i,...u}=l,[d,h]=m.useState(!1);_t(()=>h(!0),[]);const p=i||d&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?bs.createPortal(s.jsx(Pe.div,{...u,ref:o}),p):null},"Portal")),cN=Object.defineProperty,el=(a,l)=>cN(a,"name",{value:l,configurable:!0});function t0(a,l){return m.useReducer((o,i)=>l[o][i]??o,a)}el(t0,"useStateMachine");var al=el(a=>{const{present:l,children:o}=a,i=n0(l),u=typeof o=="function"?o({present:i.isPresent}):m.Children.only(o),d=a0(i.ref,l0(u));return typeof o=="function"||i.isPresent?m.cloneElement(u,{ref:d}):null},"Presence");function n0(a){const[l,o]=m.useState(),i=m.useRef(null),u=m.useRef(a),d=m.useRef("none"),h=m.useRef(void 0),p=a?"mounted":"unmounted",[g,v]=t0(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{g==="mounted"?(d.current=h.current??us(i.current),h.current=void 0):d.current="none"},[g]),_t(()=>{const x=i.current,y=u.current;if(y!==a){const w=d.current,C=us(x);a?(h.current=C,v("MOUNT")):C==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(y&&w!==C?"ANIMATION_OUT":"UNMOUNT"),u.current=a}},[a,v]),_t(()=>{if(l){let x;const y=l.ownerDocument.defaultView??window,S=el(C=>{const j=us(i.current).includes(CSS.escape(C.animationName));if(C.target===l&&j&&(v("ANIMATION_END"),!u.current)){const N=l.style.animationFillMode;l.style.animationFillMode="forwards",x=y.setTimeout(()=>{l.style.animationFillMode==="forwards"&&(l.style.animationFillMode=N)})}},"handleAnimationEnd"),w=el(C=>{C.target===l&&(d.current=us(i.current))},"handleAnimationStart");return l.addEventListener("animationstart",w),l.addEventListener("animationcancel",S),l.addEventListener("animationend",S),()=>{y.clearTimeout(x),l.removeEventListener("animationstart",w),l.removeEventListener("animationcancel",S),l.removeEventListener("animationend",S)}}else v("ANIMATION_END")},[l,v]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:m.useCallback(x=>{if(x){const y=getComputedStyle(x);i.current=y,h.current=us(y)}else i.current=null;o(x)},[])}}el(n0,"usePresence");function nh(a,l){if(typeof a=="function")return a(l);a!=null&&(a.current=l)}el(nh,"setRef");function a0(...a){const l=m.useRef(a);return l.current=a,m.useCallback(o=>{const i=l.current;let u=!1;const d=i.map(h=>{const p=nh(h,o);return!u&&typeof p=="function"&&(u=!0),p});if(u)return()=>{for(let h=0;h<d.length;h++){const p=d[h];typeof p=="function"?p():nh(i[h],null)}}},[])}el(a0,"useStableComposedRefs");function us(a){return(a==null?void 0:a.animationName)||"none"}el(us,"getAnimationName");function l0(a){var i,u;let l=(i=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:i.get,o=l&&"isReactWarning"in l&&l.isReactWarning;return o?a.ref:(l=(u=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:u.get,o=l&&"isReactWarning"in l&&l.isReactWarning,o?a.props.ref:a.props.ref||a.ref)}el(l0,"getElementRef");var uN=Object.defineProperty,Yh=(a,l)=>uN(a,"name",{value:l,configurable:!0}),_f=!1;function r0(){const[a,l]=m.useState(_f);return m.useEffect(()=>{_f||(_f=!0,l(!0))},[]),a}Yh(r0,"useIsHydrated");var s0=gs[" useSyncExternalStore ".trim().toString()];function o0(){return()=>{}}Yh(o0,"subscribe");function i0(){return s0(o0,()=>!0,()=>!1)}Yh(i0,"useIsHydratedModern");var dN=typeof s0=="function"?i0:r0,fN=Object.defineProperty,pr=(a,l)=>fN(a,"name",{value:l,configurable:!0}),kf="rovingFocusGroup.onEntryFocus",hN={bubbles:!1,cancelable:!0},Gc="RovingFocusGroup",[ah,c0,mN]=zc(Gc),[pN,Yc]=mn(Gc,[mN]),[gN,vN]=pN(Gc),xN=m.forwardRef(pr(function(l,o){return s.jsx(ah.Provider,{scope:l.__scopeRovingFocusGroup,children:s.jsx(ah.Slot,{scope:l.__scopeRovingFocusGroup,children:s.jsx(yN,{...l,ref:o})})})},"RovingFocusGroup")),yN=m.forwardRef(pr(function(l,o){const{__scopeRovingFocusGroup:i,orientation:u,loop:d=!1,dir:h,currentTabStopId:p,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:x,preventScrollOnEntryFocus:y=!1,...S}=l,w=m.useRef(null),C=Ge(o,w),E=zo(h),[j,N]=Ja({prop:p,defaultProp:g??null,onChange:v,caller:Gc}),[A,T]=m.useState(!1),O=Kn(x),_=c0(i),M=m.useRef(!1),[H,z]=m.useState(0);return m.useEffect(()=>{const K=w.current;if(K)return K.addEventListener(kf,O),()=>K.removeEventListener(kf,O)},[O]),s.jsx(gN,{scope:i,orientation:u,dir:E,loop:d,currentTabStopId:j,onItemFocus:m.useCallback(K=>N(K),[N]),onItemShiftTab:m.useCallback(()=>T(!0),[]),onFocusableItemAdd:m.useCallback(()=>z(K=>K+1),[]),onFocusableItemRemove:m.useCallback(()=>z(K=>K-1),[]),children:s.jsx(Pe.div,{tabIndex:A||H===0?-1:0,"data-orientation":u,...S,ref:C,style:{outline:"none",...l.style},onMouseDown:je(l.onMouseDown,()=>{M.current=!0}),onFocus:je(l.onFocus,K=>{const se=!M.current;if(K.target===K.currentTarget&&se&&!A){const X=new CustomEvent(kf,hN);if(K.currentTarget.dispatchEvent(X),!X.defaultPrevented){const I=_().filter($=>$.focusable),re=I.find($=>$.active),W=I.find($=>$.id===j),U=[re,W,...I].filter(Boolean).map($=>$.ref.current);$h(U,y)}}M.current=!1}),onBlur:je(l.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),bN="RovingFocusGroupItem",SN=m.forwardRef(pr(function(l,o){const{__scopeRovingFocusGroup:i,focusable:u=!0,active:d=!1,tabStopId:h,children:p,...g}=l,v=ga(),x=h||v,y=vN(bN,i),S=y.currentTabStopId===x,w=c0(i),{onFocusableItemAdd:C,onFocusableItemRemove:E,currentTabStopId:j}=y,N=dN();return _t(()=>{if(!(!N||!u))return C(),()=>E()},[N,u,C,E]),m.useEffect(()=>{if(!(N||!u))return C(),()=>E()},[N,u,C,E]),s.jsx(ah.ItemSlot,{scope:i,id:x,focusable:u,active:d,children:s.jsx(Pe.span,{tabIndex:S?0:-1,"data-orientation":y.orientation,...g,ref:o,onMouseDown:je(l.onMouseDown,A=>{u?y.onItemFocus(x):A.preventDefault()}),onFocus:je(l.onFocus,()=>y.onItemFocus(x)),onKeyDown:je(l.onKeyDown,A=>{if(A.key==="Tab"&&A.shiftKey){y.onItemShiftTab();return}if(A.target!==A.currentTarget)return;const T=d0(A,y.orientation,y.dir);if(T!==void 0){if(A.metaKey||A.ctrlKey||A.altKey||A.shiftKey)return;A.preventDefault();let _=w().filter(M=>M.focusable).map(M=>M.ref.current);if(T==="last")_.reverse();else if(T==="prev"||T==="next"){T==="prev"&&_.reverse();const M=_.indexOf(A.currentTarget);_=y.loop?f0(_,M+1):_.slice(M+1)}setTimeout(()=>$h(_))}}),children:typeof p=="function"?p({isCurrentTabStop:S,hasTabStop:j!=null}):p})})},"RovingFocusGroupItem")),wN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function u0(a,l){return l!=="rtl"?a:a==="ArrowLeft"?"ArrowRight":a==="ArrowRight"?"ArrowLeft":a}pr(u0,"getDirectionAwareKey");function d0(a,l,o){const i=u0(a.key,o);if(!(l==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(l==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return wN[i]}pr(d0,"getFocusIntent");function $h(a,l=!1){const o=document.activeElement;for(const i of a)if(i===o||(i.focus({preventScroll:l}),document.activeElement!==o))return}pr($h,"focusFirst");function f0(a,l){return a.map((o,i)=>a[(l+i)%a.length])}pr(f0,"wrapArray");var h0=xN,m0=SN,jN=function(a){if(typeof document>"u")return null;var l=Array.isArray(a)?a[0]:a;return l.ownerDocument.body},os=new WeakMap,lc=new WeakMap,rc={},zf=0,p0=function(a){return a&&(a.host||p0(a.parentNode))},CN=function(a,l){return l.map(function(o){if(a.contains(o))return o;var i=p0(o);return i&&a.contains(i)?i:(console.error("aria-hidden",o,"in not contained inside",a,". Doing nothing"),null)}).filter(function(o){return!!o})},EN=function(a,l,o,i){var u=CN(l,Array.isArray(a)?a:[a]);rc[o]||(rc[o]=new WeakMap);var d=rc[o],h=[],p=new Set,g=new Set(u),v=function(y){!y||p.has(y)||(p.add(y),v(y.parentNode))};u.forEach(v);var x=function(y){!y||g.has(y)||Array.prototype.forEach.call(y.children,function(S){if(p.has(S))x(S);else try{var w=S.getAttribute(i),C=w!==null&&w!=="false",E=(os.get(S)||0)+1,j=(d.get(S)||0)+1;os.set(S,E),d.set(S,j),h.push(S),E===1&&C&&lc.set(S,!0),j===1&&S.setAttribute(o,"true"),C||S.setAttribute(i,"true")}catch(N){console.error("aria-hidden: cannot operate on ",S,N)}})};return x(l),p.clear(),zf++,function(){h.forEach(function(y){var S=os.get(y)-1,w=d.get(y)-1;os.set(y,S),d.set(y,w),S||(lc.has(y)||y.removeAttribute(i),lc.delete(y)),w||y.removeAttribute(o)}),zf--,zf||(os=new WeakMap,os=new WeakMap,lc=new WeakMap,rc={})}},Kh=function(a,l,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(a)?a:[a]),u=jN(a);return u?(i.push.apply(i,Array.from(u.querySelectorAll("[aria-live], script"))),EN(i,u,o,"aria-hidden")):function(){return null}},ma=function(){return ma=Object.assign||function(l){for(var o,i=1,u=arguments.length;i<u;i++){o=arguments[i];for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(l[d]=o[d])}return l},ma.apply(this,arguments)};function g0(a,l){var o={};for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&l.indexOf(i)<0&&(o[i]=a[i]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,i=Object.getOwnPropertySymbols(a);u<i.length;u++)l.indexOf(i[u])<0&&Object.prototype.propertyIsEnumerable.call(a,i[u])&&(o[i[u]]=a[i[u]]);return o}function RN(a,l,o){if(o||arguments.length===2)for(var i=0,u=l.length,d;i<u;i++)(d||!(i in l))&&(d||(d=Array.prototype.slice.call(l,0,i)),d[i]=l[i]);return a.concat(d||Array.prototype.slice.call(l))}var xc="right-scroll-bar-position",yc="width-before-scroll-bar",NN="with-scroll-bars-hidden",TN="--removed-body-scroll-bar-size";function Lf(a,l){return typeof a=="function"?a(l):a&&(a.current=l),a}function AN(a,l){var o=m.useState(function(){return{value:a,callback:l,facade:{get current(){return o.value},set current(i){var u=o.value;u!==i&&(o.value=i,o.callback(i,u))}}}})[0];return o.callback=l,o.facade}var MN=typeof window<"u"?m.useLayoutEffect:m.useEffect,ry=new WeakMap;function DN(a,l){var o=AN(null,function(i){return a.forEach(function(u){return Lf(u,i)})});return MN(function(){var i=ry.get(o);if(i){var u=new Set(i),d=new Set(a),h=o.current;u.forEach(function(p){d.has(p)||Lf(p,null)}),d.forEach(function(p){u.has(p)||Lf(p,h)})}ry.set(o,a)},[a]),o}function ON(a){return a}function _N(a,l){l===void 0&&(l=ON);var o=[],i=!1,u={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:a},useMedium:function(d){var h=l(d,i);return o.push(h),function(){o=o.filter(function(p){return p!==h})}},assignSyncMedium:function(d){for(i=!0;o.length;){var h=o;o=[],h.forEach(d)}o={push:function(p){return d(p)},filter:function(){return o}}},assignMedium:function(d){i=!0;var h=[];if(o.length){var p=o;o=[],p.forEach(d),h=o}var g=function(){var x=h;h=[],x.forEach(d)},v=function(){return Promise.resolve().then(g)};v(),o={push:function(x){h.push(x),v()},filter:function(x){return h=h.filter(x),o}}}};return u}function kN(a){a===void 0&&(a={});var l=_N(null);return l.options=ma({async:!0,ssr:!1},a),l}var v0=function(a){var l=a.sideCar,o=g0(a,["sideCar"]);if(!l)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=l.read();if(!i)throw new Error("Sidecar medium not found");return m.createElement(i,ma({},o))};v0.isSideCarExport=!0;function zN(a,l){return a.useMedium(l),v0}var x0=kN(),Uf=function(){},$c=m.forwardRef(function(a,l){var o=m.useRef(null),i=m.useState({onScrollCapture:Uf,onWheelCapture:Uf,onTouchMoveCapture:Uf}),u=i[0],d=i[1],h=a.forwardProps,p=a.children,g=a.className,v=a.removeScrollBar,x=a.enabled,y=a.shards,S=a.sideCar,w=a.noRelative,C=a.noIsolation,E=a.inert,j=a.allowPinchZoom,N=a.as,A=N===void 0?"div":N,T=a.gapMode,O=g0(a,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=S,M=DN([o,l]),H=ma(ma({},O),u);return m.createElement(m.Fragment,null,x&&m.createElement(_,{sideCar:x0,removeScrollBar:v,shards:y,noRelative:w,noIsolation:C,inert:E,setCallbacks:d,allowPinchZoom:!!j,lockRef:o,gapMode:T}),h?m.cloneElement(m.Children.only(p),ma(ma({},H),{ref:M})):m.createElement(A,ma({},H,{className:g,ref:M}),p))});$c.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$c.classNames={fullWidth:yc,zeroRight:xc};var LN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function UN(){if(!document)return null;var a=document.createElement("style");a.type="text/css";var l=LN();return l&&a.setAttribute("nonce",l),a}function BN(a,l){a.styleSheet?a.styleSheet.cssText=l:a.appendChild(document.createTextNode(l))}function HN(a){var l=document.head||document.getElementsByTagName("head")[0];l.appendChild(a)}var PN=function(){var a=0,l=null;return{add:function(o){a==0&&(l=UN())&&(BN(l,o),HN(l)),a++},remove:function(){a--,!a&&l&&(l.parentNode&&l.parentNode.removeChild(l),l=null)}}},qN=function(){var a=PN();return function(l,o){m.useEffect(function(){return a.add(l),function(){a.remove()}},[l&&o])}},y0=function(){var a=qN(),l=function(o){var i=o.styles,u=o.dynamic;return a(i,u),null};return l},IN={left:0,top:0,right:0,gap:0},Bf=function(a){return parseInt(a||"",10)||0},VN=function(a){var l=window.getComputedStyle(document.body),o=l[a==="padding"?"paddingLeft":"marginLeft"],i=l[a==="padding"?"paddingTop":"marginTop"],u=l[a==="padding"?"paddingRight":"marginRight"];return[Bf(o),Bf(i),Bf(u)]},GN=function(a){if(a===void 0&&(a="margin"),typeof window>"u")return IN;var l=VN(a),o=document.documentElement.clientWidth,i=window.innerWidth;return{left:l[0],top:l[1],right:l[2],gap:Math.max(0,i-o+l[2]-l[0])}},YN=y0(),ms="data-scroll-locked",$N=function(a,l,o,i){var u=a.left,d=a.top,h=a.right,p=a.gap;return o===void 0&&(o="margin"),`
|
|
286
|
-
.`.concat(NN,` {
|
|
287
|
-
overflow: hidden `).concat(i,`;
|
|
288
|
-
padding-right: `).concat(p,"px ").concat(i,`;
|
|
289
|
-
}
|
|
290
|
-
body[`).concat(ms,`] {
|
|
291
|
-
overflow: hidden `).concat(i,`;
|
|
292
|
-
overscroll-behavior: contain;
|
|
293
|
-
`).concat([l&&"position: relative ".concat(i,";"),o==="margin"&&`
|
|
294
|
-
padding-left: `.concat(u,`px;
|
|
295
|
-
padding-top: `).concat(d,`px;
|
|
296
|
-
padding-right: `).concat(h,`px;
|
|
297
|
-
margin-left:0;
|
|
298
|
-
margin-top:0;
|
|
299
|
-
margin-right: `).concat(p,"px ").concat(i,`;
|
|
300
|
-
`),o==="padding"&&"padding-right: ".concat(p,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.`).concat(xc,` {
|
|
304
|
-
right: `).concat(p,"px ").concat(i,`;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.`).concat(yc,` {
|
|
308
|
-
margin-right: `).concat(p,"px ").concat(i,`;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.`).concat(xc," .").concat(xc,` {
|
|
312
|
-
right: 0 `).concat(i,`;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.`).concat(yc," .").concat(yc,` {
|
|
316
|
-
margin-right: 0 `).concat(i,`;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
body[`).concat(ms,`] {
|
|
320
|
-
`).concat(TN,": ").concat(p,`px;
|
|
321
|
-
}
|
|
322
|
-
`)},sy=function(){var a=parseInt(document.body.getAttribute(ms)||"0",10);return isFinite(a)?a:0},KN=function(){m.useEffect(function(){return document.body.setAttribute(ms,(sy()+1).toString()),function(){var a=sy()-1;a<=0?document.body.removeAttribute(ms):document.body.setAttribute(ms,a.toString())}},[])},XN=function(a){var l=a.noRelative,o=a.noImportant,i=a.gapMode,u=i===void 0?"margin":i;KN();var d=m.useMemo(function(){return GN(u)},[u]);return m.createElement(YN,{styles:$N(d,!l,u,o?"":"!important")})},lh=!1;if(typeof window<"u")try{var sc=Object.defineProperty({},"passive",{get:function(){return lh=!0,!0}});window.addEventListener("test",sc,sc),window.removeEventListener("test",sc,sc)}catch{lh=!1}var is=lh?{passive:!1}:!1,FN=function(a){return a.tagName==="TEXTAREA"},b0=function(a,l){if(!(a instanceof Element))return!1;var o=window.getComputedStyle(a);return o[l]!=="hidden"&&!(o.overflowY===o.overflowX&&!FN(a)&&o[l]==="visible")},QN=function(a){return b0(a,"overflowY")},ZN=function(a){return b0(a,"overflowX")},oy=function(a,l){var o=l.ownerDocument,i=l;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var u=S0(a,i);if(u){var d=w0(a,i),h=d[1],p=d[2];if(h>p)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},JN=function(a){var l=a.scrollTop,o=a.scrollHeight,i=a.clientHeight;return[l,o,i]},WN=function(a){var l=a.scrollLeft,o=a.scrollWidth,i=a.clientWidth;return[l,o,i]},S0=function(a,l){return a==="v"?QN(l):ZN(l)},w0=function(a,l){return a==="v"?JN(l):WN(l)},eT=function(a,l){return a==="h"&&l==="rtl"?-1:1},tT=function(a,l,o,i,u){var d=eT(a,window.getComputedStyle(l).direction),h=d*i,p=o.target,g=l.contains(p),v=!1,x=h>0,y=0,S=0;do{if(!p)break;var w=w0(a,p),C=w[0],E=w[1],j=w[2],N=E-j-d*C;(C||N)&&S0(a,p)&&(y+=N,S+=C);var A=p.parentNode;p=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!g&&p!==document.body||g&&(l.contains(p)||l===p));return(x&&Math.abs(y)<1||!x&&Math.abs(S)<1)&&(v=!0),v},oc=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},iy=function(a){return[a.deltaX,a.deltaY]},cy=function(a){return a&&"current"in a?a.current:a},nT=function(a,l){return a[0]===l[0]&&a[1]===l[1]},aT=function(a){return`
|
|
323
|
-
.block-interactivity-`.concat(a,` {pointer-events: none;}
|
|
324
|
-
.allow-interactivity-`).concat(a,` {pointer-events: all;}
|
|
325
|
-
`)},lT=0,cs=[];function rT(a){var l=m.useRef([]),o=m.useRef([0,0]),i=m.useRef(),u=m.useState(lT++)[0],d=m.useState(y0)[0],h=m.useRef(a);m.useEffect(function(){h.current=a},[a]),m.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(u));var E=RN([a.lockRef.current],(a.shards||[]).map(cy),!0).filter(Boolean);return E.forEach(function(j){return j.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),E.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(u))})}}},[a.inert,a.lockRef.current,a.shards]);var p=m.useCallback(function(E,j){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!h.current.allowPinchZoom;var N=oc(E),A=o.current,T="deltaX"in E?E.deltaX:A[0]-N[0],O="deltaY"in E?E.deltaY:A[1]-N[1],_,M=E.target,H=Math.abs(T)>Math.abs(O)?"h":"v";if("touches"in E&&H==="h"&&M.type==="range")return!1;var z=window.getSelection(),K=z&&z.anchorNode,se=K?K===M||K.contains(M):!1;if(se)return!1;var X=oy(H,M);if(!X)return!0;if(X?_=H:(_=H==="v"?"h":"v",X=oy(H,M)),!X)return!1;if(!i.current&&"changedTouches"in E&&(T||O)&&(i.current=_),!_)return!0;var I=i.current||_;return tT(I,j,E,I==="h"?T:O)},[]),g=m.useCallback(function(E){var j=E;if(!(!cs.length||cs[cs.length-1]!==d)){var N="deltaY"in j?iy(j):oc(j),A=l.current.filter(function(_){return _.name===j.type&&(_.target===j.target||j.target===_.shadowParent)&&nT(_.delta,N)})[0];if(A&&A.should){j.cancelable&&j.preventDefault();return}if(!A){var T=(h.current.shards||[]).map(cy).filter(Boolean).filter(function(_){return _.contains(j.target)}),O=T.length>0?p(j,T[0]):!h.current.noIsolation;O&&j.cancelable&&j.preventDefault()}}},[]),v=m.useCallback(function(E,j,N,A){var T={name:E,delta:j,target:N,should:A,shadowParent:sT(N)};l.current.push(T),setTimeout(function(){l.current=l.current.filter(function(O){return O!==T})},1)},[]),x=m.useCallback(function(E){o.current=oc(E),i.current=void 0},[]),y=m.useCallback(function(E){v(E.type,iy(E),E.target,p(E,a.lockRef.current))},[]),S=m.useCallback(function(E){v(E.type,oc(E),E.target,p(E,a.lockRef.current))},[]);m.useEffect(function(){return cs.push(d),a.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:S}),document.addEventListener("wheel",g,is),document.addEventListener("touchmove",g,is),document.addEventListener("touchstart",x,is),function(){cs=cs.filter(function(E){return E!==d}),document.removeEventListener("wheel",g,is),document.removeEventListener("touchmove",g,is),document.removeEventListener("touchstart",x,is)}},[]);var w=a.removeScrollBar,C=a.inert;return m.createElement(m.Fragment,null,C?m.createElement(d,{styles:aT(u)}):null,w?m.createElement(XN,{noRelative:a.noRelative,gapMode:a.gapMode}):null)}function sT(a){for(var l=null;a!==null;)a instanceof ShadowRoot&&(l=a.host,a=a.host),a=a.parentNode;return l}const oT=zN(x0,rT);var Kc=m.forwardRef(function(a,l){return m.createElement($c,ma({},a,{ref:l,sideCar:oT}))});Kc.classNames=$c.classNames;var iT=Object.defineProperty,dt=(a,l)=>iT(a,"name",{value:l,configurable:!0}),cT=["Enter"," "],uT=["ArrowDown","PageUp","Home"],j0=["ArrowUp","PageDown","End"],dT=[...uT,...j0],Xc="Menu",[rh,fT,hT]=zc(Xc),[gr,C0]=mn(Xc,[hT,Es,Yc]),Xh=Es(),E0=Yc(),[mT,Uo]=gr(Xc),[pT,Fh]=gr(Xc),gT=dt(a=>{const{__scopeMenu:l,open:o=!1,children:i,dir:u,onOpenChange:d,modal:h=!0}=a,p=Xh(l),[g,v]=m.useState(null),x=m.useRef(!1),y=Kn(d),S=zo(u);return m.useEffect(()=>{const w=dt(()=>{x.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},"handleKeyDown"),C=dt(()=>x.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),m.useEffect(()=>{if(!o)return;const w=dt(()=>y(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[o,y]),s.jsx(Wb,{...p,children:s.jsx(mT,{scope:l,open:o,onOpenChange:y,content:g,onContentChange:v,children:s.jsx(pT,{scope:l,onClose:m.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:x,dir:S,modal:h,children:i})})})},"Menu"),vT=m.forwardRef(dt(function(l,o){const{__scopeMenu:i,...u}=l,d=Xh(i);return s.jsx(e0,{...d,...u,ref:o})},"MenuAnchor")),R0="MenuPortal",[xT,yT]=gr(R0,{forceMount:void 0}),bT=dt(a=>{const{__scopeMenu:l,forceMount:o,children:i,container:u}=a,d=Uo(R0,l);return s.jsx(xT,{scope:l,forceMount:o,children:s.jsx(al,{present:o||d.open,children:s.jsx(Gh,{asChild:!0,container:u,children:i})})})},"MenuPortal"),Ul="MenuContent",[ST,N0]=gr(Ul),wT=m.forwardRef(dt(function(l,o){const i=yT(Ul,l.__scopeMenu),{forceMount:u=i.forceMount,...d}=l,h=Uo(Ul,l.__scopeMenu),p=Fh(Ul,l.__scopeMenu);return s.jsx(rh.Provider,{scope:l.__scopeMenu,children:s.jsx(al,{present:u||h.open,children:s.jsx(rh.Slot,{scope:l.__scopeMenu,children:p.modal?s.jsx(jT,{...d,ref:o}):s.jsx(CT,{...d,ref:o})})})})},"MenuContent")),jT=m.forwardRef(dt(function(l,o){const i=Uo(Ul,l.__scopeMenu),u=m.useRef(null),d=Ge(o,u);return m.useEffect(()=>{const h=u.current;if(h)return Kh(h)},[]),s.jsx(T0,{...l,ref:d,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:je(l.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),CT=m.forwardRef(dt(function(l,o){const i=Uo(Ul,l.__scopeMenu);return s.jsx(T0,{...l,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),ET=va("MenuContent.ScrollLock"),T0=m.forwardRef(dt(function(l,o){const{__scopeMenu:i,loop:u=!1,trapFocus:d,onOpenAutoFocus:h,onCloseAutoFocus:p,disableOutsidePointerEvents:g,onEntryFocus:v,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:S,onInteractOutside:w,onDismiss:C,disableOutsideScroll:E,...j}=l,N=Uo(Ul,i),A=Fh(Ul,i),T=Xh(i),O=E0(i),_=fT(i),[M,H]=m.useState(null),z=m.useRef(null),K=Ge(o,z,N.onContentChange),se=m.useRef(0),X=m.useRef(""),I=m.useRef(0),re=m.useRef(null),W=m.useRef("right"),oe=m.useRef(0),U=E?Kc:m.Fragment,$=E?{as:ET,allowPinchZoom:!0}:void 0,ne=dt(Z=>{var fe,ve;const D=X.current+Z,q=_().filter(Ce=>!Ce.disabled),Q=document.activeElement,ae=(fe=q.find(Ce=>Ce.ref.current===Q))==null?void 0:fe.textValue,ce=q.map(Ce=>Ce.textValue),be=_0(ce,D,ae),ue=(ve=q.find(Ce=>Ce.textValue===be))==null?void 0:ve.ref.current;dt((function Ce(De){X.current=De,window.clearTimeout(se.current),De!==""&&(se.current=window.setTimeout(()=>Ce(""),1e3))}),"updateSearch")(D),ue&&setTimeout(()=>ue.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(se.current),[]),Lo();const B=m.useCallback(Z=>{var q,Q;return W.current===((q=re.current)==null?void 0:q.side)&&z0(Z,(Q=re.current)==null?void 0:Q.area)},[]);return s.jsx(ST,{scope:i,searchRef:X,onItemEnter:m.useCallback(Z=>{B(Z)&&Z.preventDefault()},[B]),onItemLeave:m.useCallback(Z=>{var D;B(Z)||((D=z.current)==null||D.focus(),H(null))},[B]),onTriggerLeave:m.useCallback(Z=>{B(Z)&&Z.preventDefault()},[B]),pointerGraceTimerRef:I,onPointerGraceIntentChange:m.useCallback(Z=>{re.current=Z},[]),children:s.jsx(U,{...$,children:s.jsx(zh,{asChild:!0,trapped:d,onMountAutoFocus:je(h,Z=>{var D;Z.preventDefault(),(D=z.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:s.jsx(Lc,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:S,onInteractOutside:w,onDismiss:C,children:s.jsx(h0,{asChild:!0,...O,dir:A.dir,orientation:"vertical",loop:u,currentTabStopId:M,onCurrentTabStopIdChange:H,onEntryFocus:je(v,Z=>{A.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Vh,{role:"menu","aria-orientation":"vertical","data-state":A0(N.open),"data-radix-menu-content":"",dir:A.dir,...T,...j,ref:K,style:{outline:"none",...j.style},onKeyDown:je(j.onKeyDown,Z=>{const q=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,Q=Z.ctrlKey||Z.altKey||Z.metaKey,ae=Z.key.length===1;q&&(Z.key==="Tab"&&Z.preventDefault(),!Q&&ae&&ne(Z.key));const ce=z.current;if(Z.target!==ce||!dT.includes(Z.key))return;Z.preventDefault();const ue=_().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);j0.includes(Z.key)&&ue.reverse(),D0(ue)}),onBlur:je(l.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(se.current),X.current="")}),onPointerMove:je(l.onPointerMove,Rc(Z=>{const D=Z.target,q=oe.current!==Z.clientX;if(Z.currentTarget.contains(D)&&q){const Q=Z.clientX>oe.current?"right":"left";W.current=Q,oe.current=Z.clientX}}))})})})})})})},"MenuContentImpl")),RT=m.forwardRef(dt(function(l,o){const{__scopeMenu:i,...u}=l;return s.jsx(Pe.div,{...u,ref:o})},"MenuLabel")),sh="MenuItem",uy="menu.itemSelect",NT=m.forwardRef(dt(function(l,o){const{disabled:i=!1,onSelect:u,...d}=l,h=m.useRef(null),p=Fh(sh,l.__scopeMenu),g=N0(sh,l.__scopeMenu),v=Ge(o,h),x=m.useRef(!1),y=dt(()=>{const S=h.current;if(!i&&S){const w=new CustomEvent(uy,{bubbles:!0,cancelable:!0});S.addEventListener(uy,C=>u==null?void 0:u(C),{once:!0}),Dh(S,w),w.defaultPrevented?x.current=!1:p.onClose()}},"handleSelect");return s.jsx(TT,{...d,ref:v,disabled:i,onClick:je(l.onClick,y),onPointerDown:S=>{var w;(w=l.onPointerDown)==null||w.call(l,S),x.current=!0},onPointerUp:je(l.onPointerUp,S=>{var w;x.current||(w=S.currentTarget)==null||w.click()}),onKeyDown:je(l.onKeyDown,S=>{i||S.target!==S.currentTarget||g.searchRef.current!==""&&S.key===" "||cT.includes(S.key)&&(S.currentTarget.click(),S.preventDefault())})})},"MenuItem")),TT=m.forwardRef(dt(function(l,o){const{__scopeMenu:i,disabled:u=!1,textValue:d,...h}=l,p=N0(sh,i),g=E0(i),v=m.useRef(null),x=Ge(o,v),[y,S]=m.useState(!1),[w,C]=m.useState("");return m.useEffect(()=>{const E=v.current;E&&C((E.textContent??"").trim())},[h.children]),s.jsx(rh.ItemSlot,{scope:i,disabled:u,textValue:d??w,children:s.jsx(m0,{asChild:!0,...g,focusable:!u,children:s.jsx(Pe.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":u||void 0,"data-disabled":u?"":void 0,...h,ref:x,onPointerMove:je(l.onPointerMove,Rc(E=>{u?p.onItemLeave(E):(p.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(l.onPointerLeave,Rc(E=>p.onItemLeave(E))),onFocus:je(l.onFocus,()=>S(!0)),onBlur:je(l.onBlur,()=>S(!1))})})})},"MenuItemImpl")),AT="MenuRadioGroup",[BO,HO]=gr(AT,{value:void 0,onValueChange:dt(()=>{},"onValueChange")}),MT="MenuItemIndicator",[PO,qO]=gr(MT,{checked:!1}),DT=m.forwardRef(dt(function(l,o){const{__scopeMenu:i,...u}=l;return s.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...u,ref:o})},"MenuSeparator")),OT="MenuSub",[IO,VO]=gr(OT);function A0(a){return a?"open":"closed"}dt(A0,"getOpenState");function M0(a){return a==="indeterminate"}dt(M0,"isIndeterminate");function _T(a){return M0(a)?"indeterminate":a?"checked":"unchecked"}dt(_T,"getCheckedState");function D0(a){const l=document.activeElement;for(const o of a)if(o===l||(o.focus(),document.activeElement!==l))return}dt(D0,"focusFirst");function O0(a,l){return a.map((o,i)=>a[(l+i)%a.length])}dt(O0,"wrapArray");function _0(a,l,o){const u=l.length>1&&Array.from(l).every(v=>v===l[0])?l[0]:l,d=o?a.indexOf(o):-1;let h=O0(a,Math.max(d,0));u.length===1&&(h=h.filter(v=>v!==o));const g=h.find(v=>v.toLowerCase().startsWith(u.toLowerCase()));return g!==o?g:void 0}dt(_0,"getNextMatch");function k0(a,l){const{x:o,y:i}=a;let u=!1;for(let d=0,h=l.length-1;d<l.length;h=d++){const p=l[d],g=l[h],v=p.x,x=p.y,y=g.x,S=g.y;x>i!=S>i&&o<(y-v)*(i-x)/(S-x)+v&&(u=!u)}return u}dt(k0,"isPointInPolygon");function z0(a,l){if(!l)return!1;const o={x:a.clientX,y:a.clientY};return k0(o,l)}dt(z0,"isPointerInGraceArea");function Rc(a){return l=>l.pointerType==="mouse"?a(l):void 0}dt(Rc,"whenMouse");var kT=gT,zT=vT,LT=bT,UT=wT,BT=RT,HT=NT,PT=DT,qT=Object.defineProperty,vr=(a,l)=>qT(a,"name",{value:l,configurable:!0}),Qh="DropdownMenu",[IT,GO]=mn(Qh,[C0]),xr=C0(),[VT,L0]=IT(Qh),GT=vr(a=>{const{__scopeDropdownMenu:l,children:o,dir:i,open:u,defaultOpen:d,onOpenChange:h,modal:p=!0}=a,g=xr(l),v=m.useRef(null),[x,y]=Ja({prop:u,defaultProp:d??!1,onChange:h,caller:Qh});return s.jsx(VT,{scope:l,triggerId:ga(),triggerRef:v,contentId:ga(),open:x,onOpenChange:y,onOpenToggle:m.useCallback(()=>y(S=>!S),[y]),modal:p,children:s.jsx(kT,{...g,open:x,onOpenChange:y,dir:i,modal:p,children:o})})},"DropdownMenu"),YT="DropdownMenuTrigger",$T=m.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,disabled:u=!1,...d}=l,h=L0(YT,i),p=xr(i),g=Ge(o,h.triggerRef);return s.jsx(zT,{asChild:!0,...p,children:s.jsx(Pe.button,{type:"button",id:h.triggerId,"aria-haspopup":"menu","aria-expanded":h.open,"aria-controls":h.open?h.contentId:void 0,"data-state":h.open?"open":"closed","data-disabled":u?"":void 0,disabled:u,...d,ref:g,onPointerDown:je(l.onPointerDown,v=>{!u&&v.button===0&&v.ctrlKey===!1&&(h.onOpenToggle(),h.open||v.preventDefault())}),onKeyDown:je(l.onKeyDown,v=>{u||(["Enter"," "].includes(v.key)&&h.onOpenToggle(),v.key==="ArrowDown"&&h.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),KT=vr(a=>{const{__scopeDropdownMenu:l,...o}=a,i=xr(l);return s.jsx(LT,{...i,...o})},"DropdownMenuPortal"),XT="DropdownMenuContent",FT=m.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=L0(XT,i),h=xr(i),p=m.useRef(!1);return s.jsx(UT,{id:d.contentId,"aria-labelledby":d.triggerId,...h,...u,ref:o,onCloseAutoFocus:je(l.onCloseAutoFocus,g=>{var v;p.current||(v=d.triggerRef.current)==null||v.focus(),p.current=!1,g.preventDefault()}),onInteractOutside:je(l.onInteractOutside,g=>{const v=g.detail.originalEvent,x=v.button===0&&v.ctrlKey===!0,y=v.button===2||x;(!d.modal||y)&&(p.current=!0)}),style:{...l.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")),QT=m.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=xr(i);return s.jsx(BT,{...d,...u,ref:o})},"DropdownMenuLabel")),ZT=m.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=xr(i);return s.jsx(HT,{...d,...u,ref:o})},"DropdownMenuItem")),JT=m.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=xr(i);return s.jsx(PT,{...d,...u,ref:o})},"DropdownMenuSeparator")),WT=GT,eA=$T,tA=KT,U0=FT,B0=QT,H0=ZT,P0=JT;const nA=WT,aA=eA,q0=m.forwardRef(({className:a,sideOffset:l=4,...o},i)=>s.jsx(tA,{children:s.jsx(U0,{ref:i,sideOffset:l,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",a),...o})}));q0.displayName=U0.displayName;const I0=m.forwardRef(({className:a,inset:l,...o},i)=>s.jsx(H0,{ref:i,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",l&&"pl-8",a),...o}));I0.displayName=H0.displayName;const lA=m.forwardRef(({className:a,...l},o)=>s.jsx(B0,{ref:o,className:Ee("px-2 py-1.5 text-sm font-semibold",a),...l}));lA.displayName=B0.displayName;const rA=m.forwardRef(({className:a,...l},o)=>s.jsx(P0,{ref:o,className:Ee("-mx-1 my-1 h-px bg-muted",a),...l}));rA.displayName=P0.displayName;function sA(){const{theme:a,setTheme:l}=pE(),{user:o,logout:i}=Nh(),[u,d]=m.useState(!1),[h,p]=m.useState(null),g=Do(),v=a==="light"?bC:a==="dark"?hC:fC;return m.useEffect(()=>{Se.get("/api/admin/update/check?force=1").then(x=>p(x)).catch(()=>{})},[]),s.jsxs("header",{className:"flex h-14 items-center justify-between border-b bg-background px-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"Admin"}),s.jsxs("div",{className:"flex items-center gap-2",children:[(h==null?void 0:h.hasUpdate)&&s.jsxs(he,{variant:"ghost",size:"sm",title:`New version available: v${h.latestVersion} — go to Settings → System to update`,onClick:()=>g("/settings?tab=system"),children:[s.jsx(tC,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",h.latestVersion]}),s.jsx(he,{variant:"ghost",size:"icon",onClick:()=>l(a==="dark"?"light":"dark"),children:s.jsx(v,{className:"h-4 w-4"})}),s.jsxs(nA,{open:u,onOpenChange:d,children:[s.jsx(aA,{asChild:!0,children:s.jsx(he,{variant:"ghost",children:(o==null?void 0:o.username)??"admin"})}),s.jsx(q0,{align:"end",children:s.jsxs(I0,{onClick:()=>void i(),children:[s.jsx(dC,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Ne=m.forwardRef(({className:a,type:l,...o},i)=>s.jsx("input",{type:l,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",a),ref:i,...o}));Ne.displayName="Input";var oA=Object.defineProperty,iA=(a,l)=>oA(a,"name",{value:l,configurable:!0}),cA=m.forwardRef(iA(function(l,o){return s.jsx(Pe.label,{...l,ref:o,onMouseDown:i=>{var d;i.target.closest("button, input, select, textarea")||((d=l.onMouseDown)==null||d.call(l,i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}})},"Label")),V0=cA;const xe=m.forwardRef(({className:a,...l},o)=>s.jsx(V0,{ref:o,className:Ee("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",a),...l}));xe.displayName=V0.displayName;const Ze=m.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Ee("rounded-lg border bg-card text-card-foreground shadow-sm",a),...l}));Ze.displayName="Card";const Je=m.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Ee("flex flex-col space-y-1.5 p-6",a),...l}));Je.displayName="CardHeader";const We=m.forwardRef(({className:a,...l},o)=>s.jsx("h3",{ref:o,className:Ee("text-lg font-semibold leading-none tracking-tight",a),...l}));We.displayName="CardTitle";const un=m.forwardRef(({className:a,...l},o)=>s.jsx("p",{ref:o,className:Ee("text-sm text-muted-foreground",a),...l}));un.displayName="CardDescription";const et=m.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Ee("p-6 pt-0",a),...l}));et.displayName="CardContent";const G0=m.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Ee("flex items-center p-6 pt-0",a),...l}));G0.displayName="CardFooter";var uA=a=>{switch(a){case"success":return hA;case"info":return pA;case"warning":return mA;case"error":return gA;default:return null}},dA=Array(12).fill(0),fA=({visible:a,className:l})=>ie.createElement("div",{className:["sonner-loading-wrapper",l].filter(Boolean).join(" "),"data-visible":a},ie.createElement("div",{className:"sonner-spinner"},dA.map((o,i)=>ie.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),hA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.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"})),mA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ie.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"})),pA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.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"})),gA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.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"})),vA=ie.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"},ie.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ie.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),xA=()=>{let[a,l]=ie.useState(document.hidden);return ie.useEffect(()=>{let o=()=>{l(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),a},oh=1,yA=class{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{let l=this.subscribers.indexOf(a);this.subscribers.splice(l,1)}),this.publish=a=>{this.subscribers.forEach(l=>l(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var l;let{message:o,...i}=a,u=typeof(a==null?void 0:a.id)=="number"||((l=a.id)==null?void 0:l.length)>0?a.id:oh++,d=this.toasts.find(p=>p.id===u),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...a,id:u,title:o}),{...p,...a,id:u,dismissible:h,title:o}):p):this.addToast({title:o,...i,dismissible:h,id:u}),u},this.dismiss=a=>(this.dismissedToasts.add(a),a||this.toasts.forEach(l=>{this.subscribers.forEach(o=>o({id:l.id,dismiss:!0}))}),this.subscribers.forEach(l=>l({id:a,dismiss:!0})),a),this.message=(a,l)=>this.create({...l,message:a}),this.error=(a,l)=>this.create({...l,message:a,type:"error"}),this.success=(a,l)=>this.create({...l,type:"success",message:a}),this.info=(a,l)=>this.create({...l,type:"info",message:a}),this.warning=(a,l)=>this.create({...l,type:"warning",message:a}),this.loading=(a,l)=>this.create({...l,type:"loading",message:a}),this.promise=(a,l)=>{if(!l)return;let o;l.loading!==void 0&&(o=this.create({...l,promise:a,type:"loading",message:l.loading,description:typeof l.description!="function"?l.description:void 0}));let i=a instanceof Promise?a:a(),u=o!==void 0,d,h=i.then(async g=>{if(d=["resolve",g],ie.isValidElement(g))u=!1,this.create({id:o,type:"default",message:g});else if(SA(g)&&!g.ok){u=!1;let v=typeof l.error=="function"?await l.error(`HTTP error! status: ${g.status}`):l.error,x=typeof l.description=="function"?await l.description(`HTTP error! status: ${g.status}`):l.description;this.create({id:o,type:"error",message:v,description:x})}else if(l.success!==void 0){u=!1;let v=typeof l.success=="function"?await l.success(g):l.success,x=typeof l.description=="function"?await l.description(g):l.description;this.create({id:o,type:"success",message:v,description:x})}}).catch(async g=>{if(d=["reject",g],l.error!==void 0){u=!1;let v=typeof l.error=="function"?await l.error(g):l.error,x=typeof l.description=="function"?await l.description(g):l.description;this.create({id:o,type:"error",message:v,description:x})}}).finally(()=>{var g;u&&(this.dismiss(o),o=void 0),(g=l.finally)==null||g.call(l)}),p=()=>new Promise((g,v)=>h.then(()=>d[0]==="reject"?v(d[1]):g(d[1])).catch(v));return typeof o!="string"&&typeof o!="number"?{unwrap:p}:Object.assign(o,{unwrap:p})},this.custom=(a,l)=>{let o=(l==null?void 0:l.id)||oh++;return this.create({jsx:a(o),id:o,...l}),o},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},cn=new yA,bA=(a,l)=>{let o=(l==null?void 0:l.id)||oh++;return cn.addToast({title:a,...l,id:o}),o},SA=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",wA=bA,jA=()=>cn.toasts,CA=()=>cn.getActiveToasts(),me=Object.assign(wA,{success:cn.success,info:cn.info,warning:cn.warning,error:cn.error,custom:cn.custom,message:cn.message,promise:cn.promise,dismiss:cn.dismiss,loading:cn.loading},{getHistory:jA,getToasts:CA});function EA(a,{insertAt:l}={}){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",l==="top"&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=a:i.appendChild(document.createTextNode(a))}EA(`: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%)}
|
|
326
|
-
`);function ic(a){return a.label!==void 0}var RA=3,NA="32px",TA="16px",dy=4e3,AA=356,MA=14,DA=20,OA=200;function na(...a){return a.filter(Boolean).join(" ")}function _A(a){let[l,o]=a.split("-"),i=[];return l&&i.push(l),o&&i.push(o),i}var kA=a=>{var l,o,i,u,d,h,p,g,v,x,y;let{invert:S,toast:w,unstyled:C,interacting:E,setHeights:j,visibleToasts:N,heights:A,index:T,toasts:O,expanded:_,removeToast:M,defaultRichColors:H,closeButton:z,style:K,cancelButtonStyle:se,actionButtonStyle:X,className:I="",descriptionClassName:re="",duration:W,position:oe,gap:U,loadingIcon:$,expandByDefault:ne,classNames:B,icons:Z,closeButtonAriaLabel:D="Close toast",pauseWhenPageIsHidden:q}=a,[Q,ae]=ie.useState(null),[ce,be]=ie.useState(null),[ue,fe]=ie.useState(!1),[ve,Ce]=ie.useState(!1),[De,Ae]=ie.useState(!1),[Ue,pt]=ie.useState(!1),[gt,le]=ie.useState(!1),[Me,Fe]=ie.useState(0),[St,Jt]=ie.useState(0),pn=ie.useRef(w.duration||W||dy),ja=ie.useRef(null),Ca=ie.useRef(null),Kt=T===0,Jc=T+1<=N,Xt=w.type,Ea=w.dismissible!==!1,br=w.className||"",Wc=w.descriptionClassName||"",Vl=ie.useMemo(()=>A.findIndex(Te=>Te.toastId===w.id)||0,[A,w.id]),eu=ie.useMemo(()=>{var Te;return(Te=w.closeButton)!=null?Te:z},[w.closeButton,z]),Po=ie.useMemo(()=>w.duration||W||dy,[w.duration,W]),Ra=ie.useRef(0),Ct=ie.useRef(0),Zn=ie.useRef(0),Et=ie.useRef(null),[tu,nu]=oe.split("-"),qo=ie.useMemo(()=>A.reduce((Te,Qe,ct)=>ct>=Vl?Te:Te+Qe.height,0),[A,Vl]),Gl=xA(),Sr=w.invert||S,sl=Xt==="loading";Ct.current=ie.useMemo(()=>Vl*U+qo,[Vl,qo]),ie.useEffect(()=>{pn.current=Po},[Po]),ie.useEffect(()=>{fe(!0)},[]),ie.useEffect(()=>{let Te=Ca.current;if(Te){let Qe=Te.getBoundingClientRect().height;return Jt(Qe),j(ct=>[{toastId:w.id,height:Qe,position:w.position},...ct]),()=>j(ct=>ct.filter(Ft=>Ft.toastId!==w.id))}},[j,w.id]),ie.useLayoutEffect(()=>{if(!ue)return;let Te=Ca.current,Qe=Te.style.height;Te.style.height="auto";let ct=Te.getBoundingClientRect().height;Te.style.height=Qe,Jt(ct),j(Ft=>Ft.find(Bt=>Bt.toastId===w.id)?Ft.map(Bt=>Bt.toastId===w.id?{...Bt,height:ct}:Bt):[{toastId:w.id,height:ct,position:w.position},...Ft])},[ue,w.title,w.description,j,w.id]);let Gt=ie.useCallback(()=>{Ce(!0),Fe(Ct.current),j(Te=>Te.filter(Qe=>Qe.toastId!==w.id)),setTimeout(()=>{M(w)},OA)},[w,M,j,Ct]);ie.useEffect(()=>{if(w.promise&&Xt==="loading"||w.duration===1/0||w.type==="loading")return;let Te;return _||E||q&&Gl?(()=>{if(Zn.current<Ra.current){let Qe=new Date().getTime()-Ra.current;pn.current=pn.current-Qe}Zn.current=new Date().getTime()})():pn.current!==1/0&&(Ra.current=new Date().getTime(),Te=setTimeout(()=>{var Qe;(Qe=w.onAutoClose)==null||Qe.call(w,w),Gt()},pn.current)),()=>clearTimeout(Te)},[_,E,w,Xt,q,Gl,Gt]),ie.useEffect(()=>{w.delete&&Gt()},[Gt,w.delete]);function wr(){var Te,Qe,ct;return Z!=null&&Z.loading?ie.createElement("div",{className:na(B==null?void 0:B.loader,(Te=w==null?void 0:w.classNames)==null?void 0:Te.loader,"sonner-loader"),"data-visible":Xt==="loading"},Z.loading):$?ie.createElement("div",{className:na(B==null?void 0:B.loader,(Qe=w==null?void 0:w.classNames)==null?void 0:Qe.loader,"sonner-loader"),"data-visible":Xt==="loading"},$):ie.createElement(fA,{className:na(B==null?void 0:B.loader,(ct=w==null?void 0:w.classNames)==null?void 0:ct.loader),visible:Xt==="loading"})}return ie.createElement("li",{tabIndex:0,ref:Ca,className:na(I,br,B==null?void 0:B.toast,(l=w==null?void 0:w.classNames)==null?void 0:l.toast,B==null?void 0:B.default,B==null?void 0:B[Xt],(o=w==null?void 0:w.classNames)==null?void 0:o[Xt]),"data-sonner-toast":"","data-rich-colors":(i=w.richColors)!=null?i:H,"data-styled":!(w.jsx||w.unstyled||C),"data-mounted":ue,"data-promise":!!w.promise,"data-swiped":gt,"data-removed":ve,"data-visible":Jc,"data-y-position":tu,"data-x-position":nu,"data-index":T,"data-front":Kt,"data-swiping":De,"data-dismissible":Ea,"data-type":Xt,"data-invert":Sr,"data-swipe-out":Ue,"data-swipe-direction":ce,"data-expanded":!!(_||ne&&ue),style:{"--index":T,"--toasts-before":T,"--z-index":O.length-T,"--offset":`${ve?Me:Ct.current}px`,"--initial-height":ne?"auto":`${St}px`,...K,...w.style},onDragEnd:()=>{Ae(!1),ae(null),Et.current=null},onPointerDown:Te=>{sl||!Ea||(ja.current=new Date,Fe(Ct.current),Te.target.setPointerCapture(Te.pointerId),Te.target.tagName!=="BUTTON"&&(Ae(!0),Et.current={x:Te.clientX,y:Te.clientY}))},onPointerUp:()=>{var Te,Qe,ct,Ft;if(Ue||!Ea)return;Et.current=null;let Bt=Number(((Te=Ca.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),oa=Number(((Qe=Ca.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ia=new Date().getTime()-((ct=ja.current)==null?void 0:ct.getTime()),Wt=Q==="x"?Bt:oa,Jn=Math.abs(Wt)/ia;if(Math.abs(Wt)>=DA||Jn>.11){Fe(Ct.current),(Ft=w.onDismiss)==null||Ft.call(w,w),be(Q==="x"?Bt>0?"right":"left":oa>0?"down":"up"),Gt(),pt(!0),le(!1);return}Ae(!1),ae(null)},onPointerMove:Te=>{var Qe,ct,Ft,Bt;if(!Et.current||!Ea||((Qe=window.getSelection())==null?void 0:Qe.toString().length)>0)return;let oa=Te.clientY-Et.current.y,ia=Te.clientX-Et.current.x,Wt=(ct=a.swipeDirections)!=null?ct:_A(oe);!Q&&(Math.abs(ia)>1||Math.abs(oa)>1)&&ae(Math.abs(ia)>Math.abs(oa)?"x":"y");let Jn={x:0,y:0};Q==="y"?(Wt.includes("top")||Wt.includes("bottom"))&&(Wt.includes("top")&&oa<0||Wt.includes("bottom")&&oa>0)&&(Jn.y=oa):Q==="x"&&(Wt.includes("left")||Wt.includes("right"))&&(Wt.includes("left")&&ia<0||Wt.includes("right")&&ia>0)&&(Jn.x=ia),(Math.abs(Jn.x)>0||Math.abs(Jn.y)>0)&&le(!0),(Ft=Ca.current)==null||Ft.style.setProperty("--swipe-amount-x",`${Jn.x}px`),(Bt=Ca.current)==null||Bt.style.setProperty("--swipe-amount-y",`${Jn.y}px`)}},eu&&!w.jsx?ie.createElement("button",{"aria-label":D,"data-disabled":sl,"data-close-button":!0,onClick:sl||!Ea?()=>{}:()=>{var Te;Gt(),(Te=w.onDismiss)==null||Te.call(w,w)},className:na(B==null?void 0:B.closeButton,(u=w==null?void 0:w.classNames)==null?void 0:u.closeButton)},(d=Z==null?void 0:Z.close)!=null?d:vA):null,w.jsx||m.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ie.createElement(ie.Fragment,null,Xt||w.icon||w.promise?ie.createElement("div",{"data-icon":"",className:na(B==null?void 0:B.icon,(h=w==null?void 0:w.classNames)==null?void 0:h.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||wr():null,w.type!=="loading"?w.icon||(Z==null?void 0:Z[Xt])||uA(Xt):null):null,ie.createElement("div",{"data-content":"",className:na(B==null?void 0:B.content,(p=w==null?void 0:w.classNames)==null?void 0:p.content)},ie.createElement("div",{"data-title":"",className:na(B==null?void 0:B.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?ie.createElement("div",{"data-description":"",className:na(re,Wc,B==null?void 0:B.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&&ic(w.cancel)?ie.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||se,onClick:Te=>{var Qe,ct;ic(w.cancel)&&Ea&&((ct=(Qe=w.cancel).onClick)==null||ct.call(Qe,Te),Gt())},className:na(B==null?void 0:B.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&&ic(w.action)?ie.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||X,onClick:Te=>{var Qe,ct;ic(w.action)&&((ct=(Qe=w.action).onClick)==null||ct.call(Qe,Te),!Te.defaultPrevented&&Gt())},className:na(B==null?void 0:B.actionButton,(y=w==null?void 0:w.classNames)==null?void 0:y.actionButton)},w.action.label):null))};function fy(){if(typeof window>"u"||typeof document>"u")return"ltr";let a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function zA(a,l){let o={};return[a,l].forEach((i,u)=>{let d=u===1,h=d?"--mobile-offset":"--offset",p=d?TA:NA;function g(v){["top","right","bottom","left"].forEach(x=>{o[`${h}-${x}`]=typeof v=="number"?`${v}px`:v})}typeof i=="number"||typeof i=="string"?g(i):typeof i=="object"?["top","right","bottom","left"].forEach(v=>{i[v]===void 0?o[`${h}-${v}`]=p:o[`${h}-${v}`]=typeof i[v]=="number"?`${i[v]}px`:i[v]}):g(p)}),o}var LA=m.forwardRef(function(a,l){let{invert:o,position:i="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:h,className:p,offset:g,mobileOffset:v,theme:x="light",richColors:y,duration:S,style:w,visibleToasts:C=RA,toastOptions:E,dir:j=fy(),gap:N=MA,loadingIcon:A,icons:T,containerAriaLabel:O="Notifications",pauseWhenPageIsHidden:_}=a,[M,H]=ie.useState([]),z=ie.useMemo(()=>Array.from(new Set([i].concat(M.filter(q=>q.position).map(q=>q.position)))),[M,i]),[K,se]=ie.useState([]),[X,I]=ie.useState(!1),[re,W]=ie.useState(!1),[oe,U]=ie.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ie.useRef(null),ne=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=ie.useRef(null),Z=ie.useRef(!1),D=ie.useCallback(q=>{H(Q=>{var ae;return(ae=Q.find(ce=>ce.id===q.id))!=null&&ae.delete||cn.dismiss(q.id),Q.filter(({id:ce})=>ce!==q.id)})},[]);return ie.useEffect(()=>cn.subscribe(q=>{if(q.dismiss){H(Q=>Q.map(ae=>ae.id===q.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{G2.flushSync(()=>{H(Q=>{let ae=Q.findIndex(ce=>ce.id===q.id);return ae!==-1?[...Q.slice(0,ae),{...Q[ae],...q},...Q.slice(ae+1)]:[q,...Q]})})})}),[]),ie.useEffect(()=>{if(x!=="system"){U(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:Q})=>{U(Q?"dark":"light")})}catch{q.addListener(({matches:ae})=>{try{U(ae?"dark":"light")}catch(ce){console.error(ce)}})}},[x]),ie.useEffect(()=>{M.length<=1&&I(!1)},[M]),ie.useEffect(()=>{let q=Q=>{var ae,ce;u.every(be=>Q[be]||Q.code===be)&&(I(!0),(ae=$.current)==null||ae.focus()),Q.code==="Escape"&&(document.activeElement===$.current||(ce=$.current)!=null&&ce.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[u]),ie.useEffect(()=>{if($.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,Z.current=!1)}},[$.current]),ie.createElement("section",{ref:l,"aria-label":`${O} ${ne}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((q,Q)=>{var ae;let[ce,be]=q.split("-");return M.length?ie.createElement("ol",{key:q,dir:j==="auto"?fy():j,tabIndex:-1,ref:$,className:p,"data-sonner-toaster":!0,"data-theme":oe,"data-y-position":ce,"data-lifted":X&&M.length>1&&!d,"data-x-position":be,style:{"--front-toast-height":`${((ae=K[0])==null?void 0:ae.height)||0}px`,"--width":`${AA}px`,"--gap":`${N}px`,...w,...zA(g,v)},onBlur:ue=>{Z.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(Z.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,B.current=ue.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{re||I(!1)},onDragEnd:()=>I(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},M.filter(ue=>!ue.position&&Q===0||ue.position===q).map((ue,fe)=>{var ve,Ce;return ie.createElement(kA,{key:ue.id,icons:T,index:fe,toast:ue,defaultRichColors:y,duration:(ve=E==null?void 0:E.duration)!=null?ve:S,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:o,visibleToasts:C,closeButton:(Ce=E==null?void 0:E.closeButton)!=null?Ce:h,interacting:re,position:q,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,removeToast:D,toasts:M.filter(De=>De.position==ue.position),heights:K.filter(De=>De.position==ue.position),setHeights:se,expandByDefault:d,gap:N,loadingIcon:A,expanded:X,pauseWhenPageIsHidden:_,swipeDirections:a.swipeDirections})})):null}))});function UA(){const{login:a}=Nh(),[l,o]=m.useState("admin"),[i,u]=m.useState(""),[d,h]=m.useState(""),[p,g]=m.useState(""),[v,x]=m.useState(!1),[y,S]=m.useState(!1),w=Do(),C=hn();return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(Ze,{className:"w-full max-w-sm",children:[s.jsxs(Je,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain"}),s.jsx(We,{children:"Sign in"})]}),s.jsx(un,{children:"Enter your admin credentials."})]}),s.jsxs(et,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Username"}),s.jsx(Ne,{value:l,onChange:E=>o(E.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Password"}),s.jsx(Ne,{type:"password",value:i,onChange:E=>u(E.target.value)})]}),v&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"2FA code (or recovery code)"}),s.jsx(Ne,{value:d,onChange:E=>h(E.target.value),placeholder:"123456",maxLength:6})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Recovery code (alternative)"}),s.jsx(Ne,{value:p,onChange:E=>g(E.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),s.jsx("div",{className:"px-6 pb-6",children:s.jsx(he,{className:"w-full",disabled:y,onClick:async()=>{var E,j;S(!0);try{if((await a(l,i,d||void 0,p||void 0)).totpRequired){x(!0);return}const A=((j=(E=C.state)==null?void 0:E.from)==null?void 0:j.pathname)??"/";w(A,{replace:!0})}catch(N){me.error(N.message)}finally{S(!1)}},children:"Sign in"})})]})})}function BA(){const[a,l]=m.useState("admin"),[o,i]=m.useState(""),[u,d]=m.useState(""),[h,p]=m.useState(!1),[g,v]=m.useState(!0),[x,y]=m.useState(null),[S,w]=m.useState(""),[C,E]=m.useState(!1);m.useEffect(()=>{Se.get("/api/admin/setup/status").then(A=>v(!A.masterKeyConfigured)).catch(()=>v(!0))},[]);const j=!g||u.trim().length>=32,N=!h&&o.length>=12&&j;return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(Ze,{className:"w-full max-w-md",children:[s.jsxs(Je,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain rounded"}),s.jsx(We,{children:"Welcome to LateDev Router"})]}),s.jsx(un,{children:"Set up the administrator account to get started."})]}),s.jsxs(et,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Username"}),s.jsx(Ne,{value:a,onChange:A=>l(A.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Password (12+ chars)"}),s.jsx(Ne,{type:"password",value:o,onChange:A=>i(A.target.value)})]}),g&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Master encryption key (required, 32+ chars)"}),s.jsx(Ne,{type:"password",value:u,onChange:A=>d(A.target.value),placeholder:"Paste or generate a 32+ character key"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Provider API keys are encrypted with this key (AES-256-GCM). Store it somewhere safe — if it is lost, stored provider credentials cannot be recovered. Generate one with:"," ",s.jsx("code",{className:"break-all",children:`node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"`})]})]})]}),s.jsxs(G0,{className:"flex-col items-stretch gap-4",children:[s.jsx(he,{disabled:!N,onClick:async()=>{p(!0);try{await Se.post("/api/admin/setup",{username:a,password:o,setupMasterKey:g?u.trim():void 0}),me.success("Admin account created"),window.location.assign("/login")}catch(A){me.error(A.message)}finally{p(!1)}},children:"Create admin"}),s.jsxs("div",{className:"border-t pt-4 space-y-2",children:[s.jsx(xe,{children:"Import existing database"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use this to restore the administrator account, password, TOTP settings, providers, models, and master key from a backup without setting up again. Enter the same 6-digit backup passphrase used when the file was created."}),s.jsx(Ne,{type:"file",accept:".json,application/json",onChange:A=>{var T;return y(((T=A.target.files)==null?void 0:T[0])??null)}}),s.jsx(Ne,{inputMode:"numeric",maxLength:6,value:S,onChange:A=>w(A.target.value.replace(/\D/g,"")),placeholder:"Backup passphrase (6 digits)"}),s.jsx(he,{variant:"outline",disabled:!x||S.length!==6||C,onClick:async()=>{var A,T;if(x){E(!0);try{const O=JSON.parse(await x.text()),_=await fetch("/api/admin/backup/restore",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({backup:O,passphrase:S})});if(!_.ok)throw new Error(((T=(A=await _.json())==null?void 0:A.error)==null?void 0:T.message)??"Import failed");me.success("Database imported"),window.location.assign("/login")}catch(O){me.error(O.message)}finally{E(!1)}}},children:"Import database"})]})]})]})})}function wa({title:a,description:l,actions:o,className:i}){return s.jsxs("div",{className:Ee("mb-6 flex items-start justify-between gap-4",i),children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:a}),l&&s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:l})]}),o&&s.jsx("div",{className:"flex items-center gap-2",children:o})]})}const HA=mb("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 at({className:a,variant:l,...o}){return s.jsx("div",{className:Ee(HA({variant:l}),a),...o})}function PA(){const[a,l]=m.useState(null);return m.useEffect(()=>{Se.get("/api/admin/dashboard").then(l).catch(()=>l(null))},[]),a?s.jsxs("div",{children:[s.jsx(wa,{title:"Dashboard",description:"Operational summary for today",actions:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ur,{to:"/providers",children:[s.jsx(_o,{className:"mr-1 h-4 w-4"})," Provider"]})}),s.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ur,{to:"/combos",children:[s.jsx(Zy,{className:"mr-1 h-4 w-4"})," Combo"]})}),s.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ur,{to:"/api-keys",children:[s.jsx(Qy,{className:"mr-1 h-4 w-4"})," API Key"]})})]})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-1",children:s.jsx(We,{className:"text-sm text-muted-foreground",children:"Requests today"})}),s.jsx(et,{className:"text-2xl font-semibold",children:Ot(a.today.total)})]}),s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-1",children:s.jsx(We,{className:"text-sm text-muted-foreground",children:"Success rate"})}),s.jsx(et,{className:"text-2xl font-semibold",children:a.today.total?kc(a.today.success/a.today.total):"—"})]}),s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-1",children:s.jsx(We,{className:"text-sm text-muted-foreground",children:"Failed"})}),s.jsx(et,{className:"text-2xl font-semibold",children:Ot(a.today.failed)})]}),s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-1",children:s.jsx(We,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),s.jsx(et,{className:"text-2xl font-semibold",children:Ot(a.today.totalTokens)})]})]}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Provider health"}),s.jsxs(un,{children:[a.providers.length," configured"]})]}),s.jsxs(et,{className:"space-y-2",children:[a.providers.length===0&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["No providers yet. ",s.jsx(ur,{to:"/providers",className:"text-primary",children:"Add one"}),"."]}),a.providers.map(o=>s.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Jy,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"font-medium",children:o.name}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o.slug}),s.jsx(at,{variant:"outline",className:"ml-2",children:o.type})]}),s.jsx(at,{variant:o.health==="healthy"?"success":o.health==="down"?"destructive":"secondary",children:o.health})]},o.id))]})]}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Recent failures"}),s.jsx(un,{children:"Today"})]}),s.jsxs(et,{className:"space-y-1 text-sm",children:[a.recentFailures.length===0&&s.jsx("p",{className:"text-muted-foreground",children:"No failures today."}),a.recentFailures.map(o=>{var i;return s.jsxs("div",{className:"flex items-center justify-between border-b py-1 last:border-0",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-mono text-xs",children:o.requestedModel}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.errorType??`HTTP ${o.httpStatus}`," — ",(i=o.errorMessage)==null?void 0:i.slice(0,60)]})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:Ah(o.createdAt)})]},o.id)})]})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const Xn=m.forwardRef(({className:a,...l},o)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:o,className:Ee("w-full caption-bottom text-sm",a),...l})}));Xn.displayName="Table";const Fn=m.forwardRef(({className:a,...l},o)=>s.jsx("thead",{ref:o,className:Ee("[&_tr]:border-b",a),...l}));Fn.displayName="TableHeader";const Qn=m.forwardRef(({className:a,...l},o)=>s.jsx("tbody",{ref:o,className:Ee("[&_tr:last-child]:border-0",a),...l}));Qn.displayName="TableBody";const Ke=m.forwardRef(({className:a,...l},o)=>s.jsx("tr",{ref:o,className:Ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...l}));Ke.displayName="TableRow";const pe=m.forwardRef(({className:a,...l},o)=>s.jsx("th",{ref:o,className:Ee("h-10 px-2 text-left align-middle font-medium text-muted-foreground",a),...l}));pe.displayName="TableHead";const de=m.forwardRef(({className:a,...l},o)=>s.jsx("td",{ref:o,className:Ee("p-2 align-middle",a),...l}));de.displayName="TableCell";var qA=Object.defineProperty,Mn=(a,l)=>qA(a,"name",{value:l,configurable:!0}),Zh="Dialog",[Y0,$0]=mn(Zh),[IA,sa]=Y0(Zh),K0=Mn(a=>{const{__scopeDialog:l,children:o,open:i,defaultOpen:u,onOpenChange:d,modal:h=!0}=a,p=m.useRef(null),g=m.useRef(null),[v,x]=Ja({prop:i,defaultProp:u??!1,onChange:d,caller:Zh}),[y,S]=m.useState(0),[w,C]=m.useState(0);return s.jsx(IA,{scope:l,triggerRef:p,contentRef:g,contentId:ga(),titleId:ga(),descriptionId:ga(),titlePresent:y>0,descriptionPresent:w>0,setTitleCount:S,setDescriptionCount:C,open:v,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(E=>!E),[x]),modal:h,children:o})},"Dialog"),VA="DialogTrigger",X0=m.forwardRef(Mn(function(l,o){const{__scopeDialog:i,...u}=l,d=sa(VA,i),h=Ge(o,d.triggerRef);return s.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":Fc(d.open),...u,ref:h,onClick:je(l.onClick,d.onOpenToggle)})},"DialogTrigger")),F0="DialogPortal",[GA,Q0]=Y0(F0,{forceMount:void 0}),Z0=Mn(a=>{const{__scopeDialog:l,forceMount:o,children:i,container:u}=a,d=sa(F0,l);return s.jsx(GA,{scope:l,forceMount:o,children:m.Children.map(i,h=>s.jsx(al,{present:o||d.open,children:s.jsx(Gh,{asChild:!0,container:u,children:h})}))})},"DialogPortal"),ih="DialogOverlay",Jh=m.forwardRef(Mn(function(l,o){const i=Q0(ih,l.__scopeDialog),{forceMount:u=i.forceMount,...d}=l,h=sa(ih,l.__scopeDialog);return h.modal?s.jsx(al,{present:u||h.open,children:s.jsx($A,{...d,ref:o})}):null},"DialogOverlay")),YA=va("DialogOverlay.RemoveScroll"),$A=m.forwardRef(Mn(function(l,o){const{__scopeDialog:i,...u}=l,d=sa(ih,i),h=Tb(),p=Ge(o,h);return s.jsx(Kc,{as:YA,allowPinchZoom:!0,shards:[d.contentRef],children:s.jsx(Pe.div,{"data-state":Fc(d.open),...u,ref:p,style:{pointerEvents:"auto",...u.style}})})},"DialogOverlayImpl")),No="DialogContent",Wh=m.forwardRef(Mn(function(l,o){const i=Q0(No,l.__scopeDialog),{forceMount:u=i.forceMount,...d}=l,h=sa(No,l.__scopeDialog);return s.jsx(al,{present:u||h.open,children:h.modal?s.jsx(KA,{...d,ref:o}):s.jsx(XA,{...d,ref:o})})},"DialogContent")),KA=m.forwardRef(Mn(function(l,o){const i=sa(No,l.__scopeDialog),u=m.useRef(null),d=Ge(o,i.contentRef,u);return m.useEffect(()=>{const h=u.current;if(h)return Kh(h)},[]),s.jsx(J0,{...l,ref:d,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:je(l.onCloseAutoFocus,h=>{var p;h.preventDefault(),(p=i.triggerRef.current)==null||p.focus()}),onPointerDownOutside:je(l.onPointerDownOutside,h=>{const p=h.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&h.preventDefault()}),onFocusOutside:je(l.onFocusOutside,h=>h.preventDefault())})},"DialogContentModal")),XA=m.forwardRef(Mn(function(l,o){const i=sa(No,l.__scopeDialog),u=m.useRef(!1),d=m.useRef(!1);return s.jsx(J0,{...l,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var p,g;(p=l.onCloseAutoFocus)==null||p.call(l,h),h.defaultPrevented||(u.current||(g=i.triggerRef.current)==null||g.focus(),h.preventDefault()),u.current=!1,d.current=!1},onInteractOutside:h=>{var v,x;(v=l.onInteractOutside)==null||v.call(l,h),h.defaultPrevented||(u.current=!0,h.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const p=h.target;((x=i.triggerRef.current)==null?void 0:x.contains(p))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&d.current&&h.preventDefault()}})},"DialogContentNonModal")),J0=m.forwardRef(Mn(function(l,o){const{__scopeDialog:i,trapFocus:u,onOpenAutoFocus:d,onCloseAutoFocus:h,...p}=l,g=sa(No,i);return Lo(),s.jsx(s.Fragment,{children:s.jsx(zh,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:d,onUnmountAutoFocus:h,children:s.jsx(Lc,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Fc(g.open),...p,ref:o,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),FA="DialogTitle",em=m.forwardRef(Mn(function(l,o){const{__scopeDialog:i,...u}=l,d=sa(FA,i),{setTitleCount:h}=d;return _t(()=>(h(p=>p+1),()=>h(p=>p-1)),[h]),s.jsx(Pe.h2,{id:d.titleId,...u,ref:o})},"DialogTitle")),QA="DialogDescription",tm=m.forwardRef(Mn(function(l,o){const{__scopeDialog:i,...u}=l,d=sa(QA,i),{setDescriptionCount:h}=d;return _t(()=>(h(p=>p+1),()=>h(p=>p-1)),[h]),s.jsx(Pe.p,{id:d.descriptionId,...u,ref:o})},"DialogDescription")),ZA="DialogClose",nm=m.forwardRef(Mn(function(l,o){const{__scopeDialog:i,...u}=l,d=sa(ZA,i);return s.jsx(Pe.button,{type:"button",...u,ref:o,onClick:je(l.onClick,()=>d.onOpenChange(!1))})},"DialogClose"));function Fc(a){return a?"open":"closed"}Mn(Fc,"getState");const In=K0,Bo=X0,JA=Z0,W0=m.forwardRef(({className:a,...l},o)=>s.jsx(Jh,{ref:o,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",a),...l}));W0.displayName=Jh.displayName;const Cn=m.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(JA,{children:[s.jsx(W0,{}),s.jsxs(Wh,{ref:i,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",a),...o,children:[l,s.jsxs(nm,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[s.jsx(_c,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Cn.displayName=Wh.displayName;const En=({className:a,...l})=>s.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",a),...l});En.displayName="DialogHeader";const Vn=({className:a,...l})=>s.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...l});Vn.displayName="DialogFooter";const Rn=m.forwardRef(({className:a,...l},o)=>s.jsx(em,{ref:o,className:Ee("text-lg font-semibold leading-none tracking-tight",a),...l}));Rn.displayName=em.displayName;const ch=m.forwardRef(({className:a,...l},o)=>s.jsx(tm,{ref:o,className:Ee("text-sm text-muted-foreground",a),...l}));ch.displayName=tm.displayName;var WA=Object.defineProperty,ll=(a,l)=>WA(a,"name",{value:l,configurable:!0}),eM="AlertDialog",[tM,YO]=mn(eM,[$0]),rl=$0(),nM=ll(a=>{const{__scopeAlertDialog:l,...o}=a,i=rl(l);return s.jsx(K0,{...i,...o,modal:!0})},"AlertDialog"),aM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=rl(i);return s.jsx(X0,{...d,...u,ref:o})},"AlertDialogTrigger")),lM=ll(a=>{const{__scopeAlertDialog:l,...o}=a,i=rl(l);return s.jsx(Z0,{...i,...o})},"AlertDialogPortal"),rM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=rl(i);return s.jsx(Jh,{...d,...u,ref:o})},"AlertDialogOverlay")),sM="AlertDialogContent",[oM,iM]=tM(sM),cM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,children:u,...d}=l,h=rl(i),p=m.useRef(null),g=Ge(o,p),v=m.useRef(null);return s.jsx(oM,{scope:i,cancelRef:v,children:s.jsx(Wh,{role:"alertdialog",...h,...d,ref:g,onOpenAutoFocus:je(d.onOpenAutoFocus,x=>{var y;x.preventDefault(),(y=v.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),children:u})})},"AlertDialogContent")),uM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=rl(i);return s.jsx(em,{...d,...u,ref:o})},"AlertDialogTitle")),dM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=rl(i);return s.jsx(tm,{...d,...u,ref:o})},"AlertDialogDescription")),fM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=rl(i);return s.jsx(nm,{...d,...u,ref:o})},"AlertDialogAction")),hM="AlertDialogCancel",mM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,{cancelRef:d}=iM(hM,i),h=rl(i),p=Ge(o,d);return s.jsx(nm,{...h,...u,ref:p})},"AlertDialogCancel")),pM=nM,gM=aM,vM=lM,e1=rM,t1=cM,n1=fM,a1=mM,l1=uM,r1=dM;const s1=pM,xM=gM,yM=vM,o1=m.forwardRef(({className:a,...l},o)=>s.jsx(e1,{ref:o,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",a),...l}));o1.displayName=e1.displayName;const am=m.forwardRef(({className:a,...l},o)=>s.jsxs(yM,{children:[s.jsx(o1,{}),s.jsx(t1,{ref:o,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]",a),...l})]}));am.displayName=t1.displayName;const i1=({className:a,...l})=>s.jsx("div",{className:Ee("flex flex-col space-y-2 text-center sm:text-left",a),...l}),c1=({className:a,...l})=>s.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...l}),lm=m.forwardRef(({className:a,...l},o)=>s.jsx(l1,{ref:o,className:Ee("text-lg font-semibold",a),...l}));lm.displayName=l1.displayName;const rm=m.forwardRef(({className:a,...l},o)=>s.jsx(r1,{ref:o,className:Ee("text-sm text-muted-foreground",a),...l}));rm.displayName=r1.displayName;const sm=m.forwardRef(({className:a,...l},o)=>s.jsx(n1,{ref:o,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",a),...l}));sm.displayName=n1.displayName;const om=m.forwardRef(({className:a,...l},o)=>s.jsx(a1,{ref:o,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",a),...l}));om.displayName=a1.displayName;var bM=Object.defineProperty,SM=(a,l)=>bM(a,"name",{value:l,configurable:!0});function uh(a,[l,o]){return Math.min(o,Math.max(l,a))}SM(uh,"clamp");var wM=Object.defineProperty,jM=(a,l)=>wM(a,"name",{value:l,configurable:!0});function u1(a){const l=m.useRef({value:a,previous:a});return m.useMemo(()=>(l.current.value!==a&&(l.current.previous=l.current.value,l.current.value=a),l.current.previous),[a])}jM(u1,"usePrevious");var CM=Object.defineProperty,EM=(a,l)=>CM(a,"name",{value:l,configurable:!0}),d1=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"}),RM=m.forwardRef(EM(function(l,o){return s.jsx(Pe.span,{...l,ref:o,style:{...d1,...l.style}})},"VisuallyHidden")),NM=RM,TM=Object.defineProperty,it=(a,l)=>TM(a,"name",{value:l,configurable:!0}),AM=[" ","Enter","ArrowUp","ArrowDown"],MM=[" ","Enter"],ps="Select",[Qc,im,DM]=zc(ps),[yr,$O]=mn(ps,[DM,Es]),cm=Es(),[OM,Il]=yr(ps),[_M,kM]=yr(ps);function f1(a){const{__scopeSelect:l,children:o,open:i,defaultOpen:u,onOpenChange:d,value:h,defaultValue:p,onValueChange:g,dir:v,name:x,autoComplete:y,disabled:S,required:w,form:C,internal_do_not_use_render:E}=a,j=cm(l),[N,A]=m.useState(null),[T,O]=m.useState(null),[_,M]=m.useState(!1),H=zo(v),[z,K]=Ja({prop:i,defaultProp:u??!1,onChange:d,caller:ps}),[se,X]=Ja({prop:h,defaultProp:p,onChange:g,caller:ps}),I=m.useRef(null),re=m.useRef(se);m.useEffect(()=>{const q=C?N==null?void 0:N.ownerDocument.getElementById(C):N==null?void 0:N.form;if(q instanceof HTMLFormElement){const Q=it(()=>X(re.current),"reset");return q.addEventListener("reset",Q),()=>q.removeEventListener("reset",Q)}},[C,N,X]);const W=N?!!C||!!N.closest("form"):!0,[oe,U]=m.useState(new Set),$=ga(),ne=Array.from(oe).map(q=>q.props.value).join(";"),B=m.useCallback(q=>{U(Q=>new Set(Q).add(q))},[]),Z=m.useCallback(q=>{U(Q=>{const ae=new Set(Q);return ae.delete(q),ae})},[]),D={required:w,trigger:N,onTriggerChange:A,valueNode:T,onValueNodeChange:O,valueNodeHasChildren:_,onValueNodeHasChildrenChange:M,contentId:$,value:se,onValueChange:X,open:z,onOpenChange:K,dir:H,triggerPointerDownPosRef:I,disabled:S,name:x,autoComplete:y,form:C,nativeOptions:oe,nativeSelectKey:ne,isFormControl:W};return s.jsx(Wb,{...j,children:s.jsx(OM,{scope:l,...D,children:s.jsx(Qc.Provider,{scope:l,children:s.jsx(_M,{scope:l,onNativeOptionAdd:B,onNativeOptionRemove:Z,children:x1(E)?E(D):o})})})})}it(f1,"SelectProvider");var zM=it(a=>{const{__scopeSelect:l,children:o,...i}=a;return s.jsx(f1,{__scopeSelect:l,...i,internal_do_not_use_render:({isFormControl:u})=>s.jsxs(s.Fragment,{children:[o,u?s.jsx(aD,{__scopeSelect:l}):null]})})},"Select"),LM="SelectTrigger",h1=m.forwardRef(it(function(l,o){const{__scopeSelect:i,disabled:u=!1,...d}=l,h=cm(i),p=Il(LM,i),g=p.disabled||u,v=Ge(o,p.onTriggerChange),x=im(i),y=m.useRef("touch"),[S,w,C]=um(j=>{const N=x().filter(O=>!O.disabled),A=N.find(O=>O.value===p.value),T=dm(N,j,A);T!==void 0&&p.onValueChange(T.value)}),E=it(j=>{g||(p.onOpenChange(!0),C()),j&&(p.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})},"handleOpen");return s.jsx(e0,{asChild:!0,...h,children:s.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":p.open?p.contentId:void 0,"aria-expanded":p.open,"aria-required":p.required,"aria-autocomplete":"none",dir:p.dir,"data-state":p.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":Ho(p.value)?"":void 0,...d,ref:v,onClick:je(d.onClick,j=>{j.currentTarget.focus(),y.current!=="mouse"&&E(j)}),onPointerDown:je(d.onPointerDown,j=>{y.current=j.pointerType;const N=j.target;N.hasPointerCapture(j.pointerId)&&N.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(E(j),j.preventDefault())}),onKeyDown:je(d.onKeyDown,j=>{const N=S.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&w(j.key),!(N&&j.key===" ")&&AM.includes(j.key)&&(E(),j.preventDefault())})})})},"SelectTrigger")),UM="SelectValue",BM=m.forwardRef(it(function(l,o){const{__scopeSelect:i,className:u,style:d,children:h,placeholder:p="",...g}=l,v=Il(UM,i),{onValueNodeHasChildrenChange:x}=v,y=h!==void 0,S=Ge(o,v.onValueNodeChange);_t(()=>{x(y)},[x,y]);const w=Ho(v.value);return s.jsx(Pe.span,{...g,asChild:w?!1:g.asChild,ref:S,style:{pointerEvents:"none"},children:s.jsx(m.Fragment,{children:w?p:h},w?"placeholder":"value")})},"SelectValue")),HM=m.forwardRef(it(function(l,o){const{__scopeSelect:i,children:u,...d}=l;return s.jsx(Pe.span,{"aria-hidden":!0,...d,ref:o,children:u||"▼"})},"SelectIcon")),PM="SelectPortal",[qM,IM]=yr(PM,{forceMount:void 0}),VM=it(a=>{const{__scopeSelect:l,forceMount:o,...i}=a;return s.jsx(qM,{scope:a.__scopeSelect,forceMount:o,children:s.jsx(Gh,{asChild:!0,...i})})},"SelectPortal"),mr="SelectContent",m1=m.forwardRef(it(function(l,o){const i=IM(mr,l.__scopeSelect),{forceMount:u=i.forceMount,...d}=l,h=Il(mr,l.__scopeSelect),[p,g]=m.useState();return _t(()=>{g(new DocumentFragment)},[]),s.jsx(al,{present:u||h.open,children:({present:v})=>v?s.jsx($M,{...d,ref:o}):s.jsx(GM,{...d,fragment:p})})},"SelectContent")),GM=m.forwardRef(it(function(l,o){const{__scopeSelect:i,children:u,fragment:d}=l;return d?bs.createPortal(s.jsx(p1,{scope:i,children:s.jsx(Qc.Slot,{scope:i,children:s.jsx("div",{ref:o,children:u})})}),d):null},"SelectContentFragment")),aa=10,[p1,Zc]=yr(mr),YM=va("SelectContent.RemoveScroll"),$M=m.forwardRef(it(function(l,o){const{__scopeSelect:i}=l,{position:u="item-aligned",onCloseAutoFocus:d,onEscapeKeyDown:h,onPointerDownOutside:p,side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:S,collisionBoundary:w,collisionPadding:C,sticky:E,hideWhenDetached:j,avoidCollisions:N,...A}=l,T=Il(mr,i),[O,_]=m.useState(null),[M,H]=m.useState(null),z=Ge(o,_),[K,se]=m.useState(null),[X,I]=m.useState(null),re=im(i),[W,oe]=m.useState(!1),U=m.useRef(!1);m.useEffect(()=>{if(O)return Kh(O)},[O]),Lo();const $=m.useCallback(fe=>{const[ve,...Ce]=re().map(Ue=>Ue.ref.current),[De]=Ce.slice(-1),Ae=document.activeElement;for(const Ue of fe)if(Ue===Ae||(Ue==null||Ue.scrollIntoView({block:"nearest"}),Ue===ve&&M&&(M.scrollTop=0),Ue===De&&M&&(M.scrollTop=M.scrollHeight),Ue==null||Ue.focus(),document.activeElement!==Ae))return},[re,M]),ne=m.useCallback(()=>$([K,O]),[$,K,O]);m.useEffect(()=>{W&&ne()},[W,ne]);const{onOpenChange:B,triggerPointerDownPosRef:Z}=T;m.useEffect(()=>{if(O){let fe={x:0,y:0};const ve=it(De=>{var Ae,Ue;fe={x:Math.abs(Math.round(De.pageX)-(((Ae=Z.current)==null?void 0:Ae.x)??0)),y:Math.abs(Math.round(De.pageY)-(((Ue=Z.current)==null?void 0:Ue.y)??0))}},"handlePointerMove"),Ce=it(De=>{fe.x<=10&&fe.y<=10?De.preventDefault():De.composedPath().includes(O)||B(!1),document.removeEventListener("pointermove",ve),Z.current=null},"handlePointerUp");return Z.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[O,B,Z]),m.useEffect(()=>{const fe=it(()=>B(!1),"close");return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[B]);const[D,q]=um(fe=>{const ve=re().filter(Ae=>!Ae.disabled),Ce=ve.find(Ae=>Ae.ref.current===document.activeElement),De=dm(ve,fe,Ce);De&&setTimeout(()=>{var Ae;return(Ae=De.ref.current)==null?void 0:Ae.focus()})}),Q=m.useCallback((fe,ve,Ce)=>{const De=!U.current&&!Ce;(T.value!==void 0&&T.value===ve||De)&&(se(fe),De&&(U.current=!0))},[T.value]),ae=m.useCallback(()=>O==null?void 0:O.focus(),[O]),ce=m.useCallback((fe,ve,Ce)=>{const De=!U.current&&!Ce;(T.value!==void 0&&T.value===ve||De)&&I(fe)},[T.value]),be=u==="popper"?hy:KM,ue=be===hy?{side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:S,collisionBoundary:w,collisionPadding:C,sticky:E,hideWhenDetached:j,avoidCollisions:N}:{};return s.jsx(p1,{scope:i,content:O,viewport:M,onViewportChange:H,itemRefCallback:Q,selectedItem:K,onItemLeave:ae,itemTextRefCallback:ce,focusSelectedItem:ne,selectedItemText:X,position:u,isPositioned:W,searchRef:D,children:s.jsx(Kc,{as:YM,allowPinchZoom:!0,children:s.jsx(zh,{asChild:!0,trapped:T.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:je(d,fe=>{var ve;(ve=T.trigger)==null||ve.focus({preventScroll:!0}),fe.preventDefault()}),children:s.jsx(Lc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:s.jsx(be,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:fe=>fe.preventDefault(),...A,...ue,onPlaced:()=>oe(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:je(A.onKeyDown,fe=>{const ve=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!ve&&fe.key.length===1&&q(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let De=re().filter(Ae=>!Ae.disabled).map(Ae=>Ae.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(De=De.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const Ae=fe.target,Ue=De.indexOf(Ae);De=De.slice(Ue+1)}setTimeout(()=>$(De)),fe.preventDefault()}})})})})})})},"SelectContentImpl")),KM=m.forwardRef(it(function(l,o){const{__scopeSelect:i,onPlaced:u,...d}=l,h=Il(mr,i),p=Zc(mr,i),[g,v]=m.useState(null),[x,y]=m.useState(null),S=Ge(o,y),w=im(i),C=m.useRef(!1),E=m.useRef(!0),{viewport:j,selectedItem:N,selectedItemText:A,focusSelectedItem:T}=p,O=m.useCallback(()=>{if(h.trigger&&h.valueNode&&g&&x&&j&&N&&A){const z=h.trigger.getBoundingClientRect(),K=x.getBoundingClientRect(),se=h.valueNode.getBoundingClientRect(),X=A.getBoundingClientRect();if(h.dir!=="rtl"){const Ae=X.left-K.left,Ue=se.left-Ae,pt=z.left-Ue,gt=z.width+pt,le=Math.max(gt,K.width),Me=window.innerWidth-aa,Fe=uh(Ue,[aa,Math.max(aa,Me-le)]);g.style.minWidth=gt+"px",g.style.left=Fe+"px"}else{const Ae=K.right-X.right,Ue=window.innerWidth-se.right-Ae,pt=window.innerWidth-z.right-Ue,gt=z.width+pt,le=Math.max(gt,K.width),Me=window.innerWidth-aa,Fe=uh(Ue,[aa,Math.max(aa,Me-le)]);g.style.minWidth=gt+"px",g.style.right=Fe+"px"}const I=w(),re=window.innerHeight-aa*2,W=j.scrollHeight,oe=window.getComputedStyle(x),U=parseInt(oe.borderTopWidth,10),$=parseInt(oe.paddingTop,10),ne=parseInt(oe.borderBottomWidth,10),B=parseInt(oe.paddingBottom,10),Z=U+$+W+B+ne,D=Math.min(N.offsetHeight*5,Z),q=window.getComputedStyle(j),Q=parseInt(q.paddingTop,10),ae=parseInt(q.paddingBottom,10),ce=z.top+z.height/2-aa,be=re-ce,ue=N.offsetHeight/2,fe=N.offsetTop+ue,ve=U+$+fe,Ce=Z-ve;if(ve<=ce){const Ae=I.length>0&&N===I[I.length-1].ref.current;g.style.bottom="0px";const Ue=x.clientHeight-j.offsetTop-j.offsetHeight,pt=Math.max(be,ue+(Ae?ae:0)+Ue+ne),gt=ve+pt;g.style.height=gt+"px"}else{const Ae=I.length>0&&N===I[0].ref.current;g.style.top="0px";const pt=Math.max(ce,U+j.offsetTop+(Ae?Q:0)+ue)+Ce;g.style.height=pt+"px",j.scrollTop=ve-ce+j.offsetTop}g.style.margin=`${aa}px 0`,g.style.minHeight=D+"px",g.style.maxHeight=re+"px",u==null||u(),requestAnimationFrame(()=>C.current=!0)}},[w,h.trigger,h.valueNode,g,x,j,N,A,h.dir,u]);_t(()=>O(),[O]);const[_,M]=m.useState();_t(()=>{x&&M(window.getComputedStyle(x).zIndex)},[x]);const H=m.useCallback(z=>{z&&E.current===!0&&(O(),T==null||T(),E.current=!1)},[O,T]);return s.jsx(XM,{scope:i,contentWrapper:g,shouldExpandOnScrollRef:C,onScrollButtonChange:H,children:s.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:s.jsx(Pe.div,{...d,ref:S,style:{boxSizing:"border-box",maxHeight:"100%",...d.style}})})})},"SelectItemAlignedPosition")),hy=m.forwardRef(it(function(l,o){const{__scopeSelect:i,align:u="start",collisionPadding:d=aa,...h}=l,p=cm(i);return s.jsx(Vh,{...p,...h,ref:o,align:u,collisionPadding:d,style:{boxSizing:"border-box",...h.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")),[XM,FM]=yr(mr,{}),my="SelectViewport",QM=m.forwardRef(it(function(l,o){const{__scopeSelect:i,nonce:u,...d}=l,h=Zc(my,i),p=FM(my,i),g=Ge(o,h.onViewportChange),v=m.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),s.jsx(Qc.Slot,{scope:i,children:s.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...d,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...d.style},onScroll:je(d.onScroll,x=>{const y=x.currentTarget,{contentWrapper:S,shouldExpandOnScrollRef:w}=p;if(w!=null&&w.current&&S){const C=Math.abs(v.current-y.scrollTop);if(C>0){const E=window.innerHeight-aa*2,j=parseFloat(S.style.minHeight),N=parseFloat(S.style.height),A=Math.max(j,N);if(A<E){const T=A+C,O=Math.min(E,T),_=T-O;S.style.height=O+"px",S.style.bottom==="0px"&&(y.scrollTop=_>0?_:0,S.style.justifyContent="flex-end")}}}v.current=y.scrollTop})})})]})},"SelectViewport")),ZM="SelectGroup",[KO,XO]=yr(ZM),dh="SelectItem",[JM,g1]=yr(dh),v1=m.forwardRef(it(function(l,o){const{__scopeSelect:i,value:u,disabled:d=!1,textValue:h,...p}=l,g=Il(dh,i),v=Zc(dh,i),x=g.value===u,[y,S]=m.useState(h??""),[w,C]=m.useState(!1),E=Kn(O=>{var _;return(_=v.itemRefCallback)==null?void 0:_.call(v,O,u,d)}),j=Ge(o,E),N=ga(),A=m.useRef("touch"),T=it(()=>{d||(g.onValueChange(u),g.onOpenChange(!1))},"handleSelect");return s.jsx(JM,{scope:i,value:u,disabled:d,textId:N,isSelected:x,onItemTextChange:m.useCallback(O=>{S(_=>_||((O==null?void 0:O.textContent)??"").trim())},[]),children:s.jsx(Qc.ItemSlot,{scope:i,value:u,disabled:d,textValue:y,children:s.jsx(Pe.div,{role:"option","aria-labelledby":N,"data-highlighted":w?"":void 0,"aria-selected":x&&w,"data-state":x?"checked":"unchecked","aria-disabled":d||void 0,"data-disabled":d?"":void 0,tabIndex:d?void 0:-1,...p,ref:j,onFocus:je(p.onFocus,()=>C(!0)),onBlur:je(p.onBlur,()=>C(!1)),onClick:je(p.onClick,()=>{A.current!=="mouse"&&T()}),onPointerUp:je(p.onPointerUp,()=>{A.current==="mouse"&&T()}),onPointerDown:je(p.onPointerDown,O=>{A.current=O.pointerType}),onPointerMove:je(p.onPointerMove,O=>{var _;A.current=O.pointerType,d?(_=v.onItemLeave)==null||_.call(v):A.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(p.onPointerLeave,O=>{var _;O.currentTarget===document.activeElement&&((_=v.onItemLeave)==null||_.call(v))}),onKeyDown:je(p.onKeyDown,O=>{var M;d||O.target!==O.currentTarget||((M=v.searchRef)==null?void 0:M.current)!==""&&O.key===" "||(MM.includes(O.key)&&T(),O.key===" "&&O.preventDefault())})})})})},"SelectItem")),cc="SelectItemText",WM=m.forwardRef(it(function(l,o){const{__scopeSelect:i,className:u,style:d,...h}=l,p=Il(cc,i),g=Zc(cc,i),v=g1(cc,i),x=kM(cc,i),[y,S]=m.useState(null),w=Kn(T=>{var O;return(O=g.itemTextRefCallback)==null?void 0:O.call(g,T,v.value,v.disabled)}),C=Ge(o,S,v.onItemTextChange,w),E=y==null?void 0:y.textContent,j=m.useMemo(()=>s.jsx("option",{value:v.value,disabled:v.disabled,children:E},v.value),[v.disabled,v.value,E]),{onNativeOptionAdd:N,onNativeOptionRemove:A}=x;return _t(()=>(N(j),()=>A(j)),[N,A,j]),s.jsxs(s.Fragment,{children:[s.jsx(Pe.span,{id:v.textId,...h,ref:C}),v.isSelected&&p.valueNode&&!p.valueNodeHasChildren&&!Ho(p.value)?bs.createPortal(h.children,p.valueNode):null]})},"SelectItemText")),eD="SelectItemIndicator",tD=m.forwardRef(it(function(l,o){const{__scopeSelect:i,...u}=l;return g1(eD,i).isSelected?s.jsx(Pe.span,{"aria-hidden":!0,...u,ref:o}):null},"SelectItemIndicator")),nD="SelectBubbleInput",aD=m.forwardRef(it(function({__scopeSelect:l,...o},i){const u=Il(nD,l),{value:d,onValueChange:h,required:p,disabled:g,name:v,autoComplete:x,form:y}=u,{nativeOptions:S,nativeSelectKey:w}=u,C=m.useRef(null),E=Ge(i,C),j=d??"",N=u1(j),A=Array.from(S).some(T=>(T.props.value??"")==="");return m.useEffect(()=>{const T=C.current;if(!T)return;const O=window.HTMLSelectElement.prototype,M=Object.getOwnPropertyDescriptor(O,"value").set;if(N!==j&&M){const H=new Event("change",{bubbles:!0});M.call(T,j),T.dispatchEvent(H)}},[N,j]),s.jsxs(Pe.select,{"aria-hidden":!0,required:p,tabIndex:-1,name:v,autoComplete:x,disabled:g,form:y,onChange:T=>h(T.target.value),...o,style:{...d1,...o.style},ref:E,defaultValue:j,children:[Ho(d)&&!A?s.jsx("option",{value:""}):null,Array.from(S)]},w)},"SelectBubbleInput"));function x1(a){return typeof a=="function"}it(x1,"isFunction");function Ho(a){return a===""||a===void 0}it(Ho,"shouldShowPlaceholder");function um(a){const l=Kn(a),o=m.useRef(""),i=m.useRef(0),u=m.useCallback(h=>{const p=o.current+h;l(p),it((function g(v){o.current=v,window.clearTimeout(i.current),v!==""&&(i.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(p)},[l]),d=m.useCallback(()=>{o.current="",window.clearTimeout(i.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(i.current),[]),[o,u,d]}it(um,"useTypeaheadSearch");function dm(a,l,o){const u=l.length>1&&Array.from(l).every(v=>v===l[0])?l[0]:l,d=o?a.indexOf(o):-1;let h=y1(a,Math.max(d,0));u.length===1&&(h=h.filter(v=>v!==o));const g=h.find(v=>v.textValue.toLowerCase().startsWith(u.toLowerCase()));return g!==o?g:void 0}it(dm,"findNextItem");function y1(a,l){return a.map((o,i)=>a[(l+i)%a.length])}it(y1,"wrapArray");const Gn=zM,Yn=BM,Nn=m.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(h1,{ref:i,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",a),...o,children:[l,s.jsx(HM,{asChild:!0,children:s.jsx(eC,{className:"h-4 w-4 opacity-50"})})]}));Nn.displayName=h1.displayName;const Tn=m.forwardRef(({className:a,children:l,position:o="popper",...i},u)=>s.jsx(VM,{children:s.jsx(m1,{ref:u,className:Ee("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",a),position:o,...i,children:s.jsx(QM,{className:Ee("p-1",o==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:l})})}));Tn.displayName=m1.displayName;const ot=m.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(v1,{ref:i,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",a),...o,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(tD,{children:s.jsx(Ky,{className:"h-4 w-4"})})}),s.jsx(WM,{children:l})]}));ot.displayName=v1.displayName;var lD=Object.defineProperty,Pl=(a,l)=>lD(a,"name",{value:l,configurable:!0}),fm="Switch",[rD,FO]=mn(fm),[sD,hm]=rD(fm);function b1(a){const{__scopeSwitch:l,checked:o,children:i,defaultChecked:u,disabled:d,form:h,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=a,[S,w]=Ja({prop:o,defaultProp:u??!1,onChange:g,caller:fm}),[C,E]=m.useState(null),[j,N]=m.useState(null),A=m.useRef(!1),[T,O]=m.useReducer(H=>H+1,0),_=C?!!h||!!C.closest("form"):!0,M={checked:S,setChecked:w,disabled:d,control:C,setControl:E,name:p,form:h,value:x,hasConsumerStoppedPropagationRef:A,userInteractionCount:T,onUserInteraction:O,required:v,defaultChecked:u,isFormControl:_,bubbleInput:j,setBubbleInput:N};return s.jsx(sD,{scope:l,...M,children:w1(y)?y(M):i})}Pl(b1,"SwitchProvider");var oD="SwitchTrigger",iD=m.forwardRef(Pl(function({__scopeSwitch:l,onClick:o,...i},u){const{control:d,form:h,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:S,hasConsumerStoppedPropagationRef:w,onUserInteraction:C,isFormControl:E,bubbleInput:j}=hm(oD,l),N=Ge(u,y),A=m.useRef(v);return m.useEffect(()=>{const T=h?d==null?void 0:d.ownerDocument.getElementById(h):d==null?void 0:d.form;if(T instanceof HTMLFormElement){const O=Pl(()=>S(A.current),"reset");return T.addEventListener("reset",O),()=>T.removeEventListener("reset",O)}},[d,h,S]),s.jsx(Pe.button,{type:"button",role:"switch","aria-checked":v,"aria-required":x,"data-state":mm(v),"data-disabled":g?"":void 0,disabled:g,value:p,...i,ref:N,onClick:je(o,T=>{C(),S(O=>!O),j&&E&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"SwitchTrigger")),S1=m.forwardRef(Pl(function(l,o){const{__scopeSwitch:i,name:u,checked:d,defaultChecked:h,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...S}=l;return s.jsx(b1,{__scopeSwitch:i,checked:d,defaultChecked:h,disabled:g,required:p,onCheckedChange:x,name:u,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(iD,{...S,ref:o,__scopeSwitch:i}),w&&s.jsx(fD,{__scopeSwitch:i})]})})},"Switch")),cD="SwitchThumb",uD=m.forwardRef(Pl(function(l,o){const{__scopeSwitch:i,...u}=l,d=hm(cD,i);return s.jsx(Pe.span,{"data-state":mm(d.checked),"data-disabled":d.disabled?"":void 0,...u,ref:o})},"SwitchThumb")),dD="SwitchBubbleInput",fD=m.forwardRef(Pl(function({__scopeSwitch:l,onClick:o,...i},u){const{control:d,hasConsumerStoppedPropagationRef:h,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:S,value:w,form:C,bubbleInput:E,setBubbleInput:j}=hm(dD,l),N=Ge(u,j),A=Ic(d),T=m.useRef(!1),O=m.useRef(g),_=m.useRef(p);m.useEffect(()=>{const H=E;if(!H)return;const z=window.HTMLInputElement.prototype,se=Object.getOwnPropertyDescriptor(z,"checked").set,X=p!==_.current;_.current=p;const I=O.current!==g;O.current=g;const re=!(X&&h.current);if(I&&se){T.current=!X;const W=new Event("click",{bubbles:re});se.call(H,g),H.dispatchEvent(W),T.current=!1}},[E,g,h,p]);const M=m.useRef(g);return s.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??M.current,required:x,disabled:y,name:S,value:w,form:C,...i,tabIndex:-1,ref:N,onClick:je(o,H=>{T.current&&H.stopPropagation()}),style:{...i.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function w1(a){return typeof a=="function"}Pl(w1,"isFunction");function mm(a){return a?"checked":"unchecked"}Pl(mm,"getState");const ba=m.forwardRef(({className:a,...l},o)=>s.jsx(S1,{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",a),...l,ref:o,children:s.jsx(uD,{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")})}));ba.displayName=S1.displayName;const cr={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0};function hD(){const[a,l]=m.useState([]),[o,i]=m.useState(!1),[u,d]=m.useState(cr),[h,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(null),[S,w]=m.useState(cr),[C,E]=m.useState(null),[j,N]=m.useState(!1),A=()=>Se.get("/api/admin/providers").then(z=>l(z.providers));m.useEffect(()=>{A()},[]);const T=async()=>{p(!0);try{let z;if(u.customHeaders.trim())try{z=JSON.parse(u.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await Se.post("/api/admin/providers",{name:u.name,slug:u.slug||void 0,type:u.type,baseUrl:u.baseUrl,apiKey:u.apiKey,customHeaders:z,enabled:u.enabled}),me.success("Provider created"),i(!1),d(cr),A()}catch(z){me.error(z.message)}finally{p(!1)}},O=async z=>{v(z);try{const K=await Se.post(`/api/admin/providers/${z}/test`);me.success(K.ok?`Connection OK: ${K.detail}`:`Failed: ${K.detail}`),A()}catch(K){me.error(K.message)}finally{v(null)}},_=z=>{y(z.id),w({...cr,name:z.name,slug:z.slug||"",type:z.type,baseUrl:z.baseUrl,apiKey:"",customHeaders:"",enabled:z.enabled})},M=async()=>{if(x){p(!0);try{let z;if(S.customHeaders.trim())try{z=JSON.parse(S.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await Se.patch("/api/admin/providers",{id:x,name:S.name,slug:S.slug||void 0,type:S.type,baseUrl:S.baseUrl,apiKey:S.apiKey||void 0,customHeaders:z,enabled:S.enabled}),me.success("Provider updated"),y(null),w(cr),A()}catch(z){me.error(z.message)}finally{p(!1)}}},H=async z=>{N(!0);try{await Se.del(`/api/admin/providers/${z}`),me.success("Provider removed"),A()}catch(K){me.error(K.message)}finally{N(!1),E(null)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:s.jsxs(In,{open:o,onOpenChange:i,children:[s.jsx(Bo,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(_o,{className:"mr-1 h-4 w-4"})," Add provider"]})}),s.jsxs(Cn,{children:[s.jsx(En,{children:s.jsx(Rn,{children:"New provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Ne,{value:u.name,onChange:z=>d({...u,name:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional)"}),s.jsx(Ne,{value:u.slug,onChange:z=>d({...u,slug:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Type"}),s.jsxs(Gn,{value:u.type,onValueChange:z=>d({...u,type:z}),children:[s.jsx(Nn,{children:s.jsx(Yn,{})}),s.jsxs(Tn,{children:[s.jsx(ot,{value:"openai",children:"OpenAI-compatible"}),s.jsx(ot,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Base URL"}),s.jsx(Ne,{value:u.baseUrl,onChange:z=>d({...u,baseUrl:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"API key"}),s.jsx(Ne,{type:"password",value:u.apiKey,onChange:z=>d({...u,apiKey:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Custom headers (JSON)"}),s.jsx(Ne,{value:u.customHeaders,onChange:z=>d({...u,customHeaders:z.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:u.enabled,onCheckedChange:z=>d({...u,enabled:z})}),s.jsx(xe,{children:"Enabled"})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>i(!1),children:"Cancel"}),s.jsx(he,{disabled:h||!u.name||!u.apiKey,onClick:T,children:"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All providers"}),s.jsxs(un,{children:[a.length," total"]})]}),s.jsx(et,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Ke,{children:[s.jsx(pe,{children:"Name"}),s.jsx(pe,{children:"Type"}),s.jsx(pe,{children:"Base URL"}),s.jsx(pe,{children:"Models"}),s.jsx(pe,{children:"Health"}),s.jsx(pe,{children:"Enabled"}),s.jsx(pe,{className:"text-right",children:"Actions"})]})}),s.jsxs(Qn,{children:[a.length===0&&s.jsx(Ke,{children:s.jsx(de,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),a.map(z=>s.jsxs(Ke,{children:[s.jsxs(de,{className:"font-medium",children:[z.name," ",s.jsx("span",{className:"text-xs text-muted-foreground",children:z.slug})]}),s.jsx(de,{children:s.jsx(at,{variant:"outline",children:z.type})}),s.jsx(de,{className:"text-xs text-muted-foreground",children:z.baseUrl}),s.jsx(de,{children:z.modelCount}),s.jsx(de,{children:s.jsx(at,{variant:z.health==="healthy"?"success":z.health==="down"?"destructive":"secondary",children:z.health})}),s.jsx(de,{children:z.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(he,{size:"sm",variant:"outline",disabled:g===z.id,onClick:()=>O(z.id),children:s.jsx(pC,{className:"h-3 w-3"})}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>_(z),children:"✎"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>E(z.id),children:s.jsx(Oc,{className:"h-3 w-3"})})]})})]},z.id))]})]})})]}),s.jsx(In,{open:!!x,onOpenChange:z=>{z||(y(null),w(cr))},children:s.jsxs(Cn,{children:[s.jsx(En,{children:s.jsx(Rn,{children:"Edit provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Ne,{value:S.name,onChange:z=>w({...S,name:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional)"}),s.jsx(Ne,{value:S.slug,onChange:z=>w({...S,slug:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Type"}),s.jsxs(Gn,{value:S.type,onValueChange:z=>w({...S,type:z}),children:[s.jsx(Nn,{children:s.jsx(Yn,{})}),s.jsxs(Tn,{children:[s.jsx(ot,{value:"openai",children:"OpenAI-compatible"}),s.jsx(ot,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Base URL"}),s.jsx(Ne,{value:S.baseUrl,onChange:z=>w({...S,baseUrl:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"API key (leave empty to keep current)"}),s.jsx(Ne,{type:"password",value:S.apiKey,onChange:z=>w({...S,apiKey:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Custom headers (JSON)"}),s.jsx(Ne,{value:S.customHeaders,onChange:z=>w({...S,customHeaders:z.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:S.enabled,onCheckedChange:z=>w({...S,enabled:z})}),s.jsx(xe,{children:"Enabled"})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>{y(null),w(cr)},children:"Cancel"}),s.jsx(he,{disabled:h||!S.name,onClick:M,children:"Save changes"})]})]})}),s.jsx(s1,{open:!!C,onOpenChange:z=>{z||E(null)},children:s.jsxs(am,{children:[s.jsxs(i1,{children:[s.jsx(lm,{children:"Delete provider?"}),s.jsx(rm,{children:"This will soft-disable the provider if models depend on it."})]}),s.jsxs(c1,{children:[s.jsx(om,{children:"Cancel"}),s.jsx(sm,{disabled:j,onClick:z=>{C&&(z.preventDefault(),H(C))},children:j?"Deleting…":"Delete"})]})]})})]})}var mD=Object.defineProperty,tl=(a,l)=>mD(a,"name",{value:l,configurable:!0}),pm="Checkbox",[pD,QO]=mn(pm),[gD,gm]=pD(pm);function j1(a){const{__scopeCheckbox:l,checked:o,children:i,defaultChecked:u,disabled:d,form:h,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=a,[S,w]=Ja({prop:o,defaultProp:u??!1,onChange:g,caller:pm}),[C,E]=m.useState(null),[j,N]=m.useState(null),A=m.useRef(!1),[T,O]=m.useReducer(H=>H+1,0),_=C?!!h||!!C.closest("form"):!0,M={checked:S,disabled:d,setChecked:w,control:C,setControl:E,name:p,form:h,value:x,hasConsumerStoppedPropagationRef:A,userInteractionCount:T,onUserInteraction:O,required:v,defaultChecked:Qa(u)?!1:u,isFormControl:_,bubbleInput:j,setBubbleInput:N};return s.jsx(gD,{scope:l,...M,children:E1(y)?y(M):i})}tl(j1,"CheckboxProvider");var vD="CheckboxTrigger",xD=m.forwardRef(tl(function({__scopeCheckbox:l,onKeyDown:o,onClick:i,...u},d){const{control:h,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:S,hasConsumerStoppedPropagationRef:w,onUserInteraction:C,isFormControl:E,bubbleInput:j}=gm(vD,l),N=Ge(d,y),A=m.useRef(v);return m.useEffect(()=>{const T=h==null?void 0:h.form;if(T){const O=tl(()=>S(A.current),"reset");return T.addEventListener("reset",O),()=>T.removeEventListener("reset",O)}},[h,S]),s.jsx(Pe.button,{type:"button",role:"checkbox","aria-checked":Qa(v)?"mixed":v,"aria-required":x,"data-state":vm(v),"data-disabled":g?"":void 0,disabled:g,value:p,...u,ref:N,onKeyDown:je(o,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:je(i,T=>{C(),S(O=>Qa(O)?!0:!O),j&&E&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"CheckboxTrigger")),C1=m.forwardRef(tl(function(l,o){const{__scopeCheckbox:i,name:u,checked:d,defaultChecked:h,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...S}=l;return s.jsx(j1,{__scopeCheckbox:i,checked:d,defaultChecked:h,disabled:g,required:p,onCheckedChange:x,name:u,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(xD,{...S,ref:o,__scopeCheckbox:i}),w&&s.jsx(wD,{__scopeCheckbox:i})]})})},"Checkbox")),yD="CheckboxIndicator",bD=m.forwardRef(tl(function(l,o){const{__scopeCheckbox:i,forceMount:u,...d}=l,h=gm(yD,i);return s.jsx(al,{present:u||Qa(h.checked)||h.checked===!0,children:s.jsx(Pe.span,{"data-state":vm(h.checked),"data-disabled":h.disabled?"":void 0,...d,ref:o,style:{pointerEvents:"none",...l.style}})})},"CheckboxIndicator")),SD="CheckboxBubbleInput",wD=m.forwardRef(tl(function({__scopeCheckbox:l,onClick:o,...i},u){const{control:d,hasConsumerStoppedPropagationRef:h,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:S,value:w,form:C,bubbleInput:E,setBubbleInput:j}=gm(SD,l),N=Ge(u,j),A=Ic(d),T=m.useRef(!1),O=m.useRef(g),_=m.useRef(p);m.useEffect(()=>{const H=E;if(!H)return;const z=window.HTMLInputElement.prototype,se=Object.getOwnPropertyDescriptor(z,"checked").set,X=p!==_.current;_.current=p;const I=O.current!==g;O.current=g;const re=!(X&&h.current);if(I&&se){T.current=!X;const W=new Event("click",{bubbles:re});H.indeterminate=Qa(g),se.call(H,Qa(g)?!1:g),H.dispatchEvent(W),T.current=!1}},[E,g,h,p]);const M=m.useRef(Qa(g)?!1:g);return s.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??M.current,required:x,disabled:y,name:S,value:w,form:C,...i,tabIndex:-1,ref:N,onClick:je(o,H=>{T.current&&H.stopPropagation()}),style:{...i.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function E1(a){return typeof a=="function"}tl(E1,"isFunction");function Qa(a){return a==="indeterminate"}tl(Qa,"isIndeterminate");function vm(a){return Qa(a)?"indeterminate":a?"checked":"unchecked"}tl(vm,"getState");const xm=m.forwardRef(({className:a,...l},o)=>s.jsx(C1,{ref:o,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",a),...l,children:s.jsx(bD,{className:Ee("flex items-center justify-center text-current"),children:s.jsx(Ky,{className:"h-3.5 w-3.5"})})}));xm.displayName=C1.displayName;function jD(){const[a,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState("all"),[h,p]=m.useState(!1),[g,v]=m.useState(""),[x,y]=m.useState([]),[S,w]=m.useState(new Set),[C,E]=m.useState(!1),[j,N]=m.useState(""),[A,T]=m.useState(""),[O,_]=m.useState(null),[M,H]=m.useState(!1),[z,K]=m.useState(null),[se,X]=m.useState(null),I=async()=>{const[B,Z]=await Promise.all([Se.get("/api/admin/models"),Se.get("/api/admin/providers")]);l(B.models),i(Z.providers)};m.useEffect(()=>{I()},[]);const re=a.filter(B=>!(u!=="all"&&B.providerId!==u||j&&!B.publicModelId.toLowerCase().includes(j.toLowerCase()))),W=x.filter(B=>{if(!A)return!0;const Z=A.toLowerCase();return B.upstreamId.toLowerCase().includes(Z)||B.displayName.toLowerCase().includes(Z)}),oe=async()=>{if(g){E(!0);try{const B=await Se.post(`/api/admin/providers/${g}/discover`);y(B.models),w(new Set)}catch(B){me.error(B.message)}finally{E(!1)}}},U=async()=>{if(S.size!==0)try{const B=await Se.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(S)});me.success(`Imported ${B.imported} of ${B.requested}`),p(!1),y([]),w(new Set),I()}catch(B){me.error(B.message)}},$=async()=>{if(se)try{await Se.del(`/api/admin/models/${se.id}`),me.success("Model deleted"),X(null),I()}catch(B){me.error(B.message)}},ne=async B=>{var D,q,Q;_(B),H(!0);const Z=Date.now();K({phase:"streaming",startedAt:Z,text:"",progress:{}});try{const ae=await globalThis.fetch(`/api/admin/models/${B}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},credentials:"include",body:"{}"});if(!ae.ok){const Ce=await ae.text().catch(()=>"");K({phase:"error",model:B,error:`HTTP ${ae.status}: ${Ce}`});return}const ce=(D=ae.body)==null?void 0:D.getReader();if(!ce){K({phase:"error",model:B,error:"No response body"});return}const be=new TextDecoder;let ue="",fe="",ve=!1;for(;!ve;){const{value:Ce,done:De}=await ce.read();ve=De,Ce&&(ue+=be.decode(Ce,{stream:!0}));let Ae;for(;(Ae=ue.indexOf(`
|
|
327
|
-
|
|
328
|
-
`))>=0;){const Ue=ue.slice(0,Ae);ue=ue.slice(Ae+2);const pt=Ue.split(`
|
|
329
|
-
`);let gt="",le="";for(const Me of pt)Me.startsWith("event: ")?gt=Me.slice(7):Me.startsWith("data: ")&&(le=Me.slice(6));if(le){if(gt===""||gt==="message")try{const Fe=(q=JSON.parse(le).choices)==null?void 0:q[0];(Q=Fe==null?void 0:Fe.delta)!=null&&Q.content&&(fe+=Fe.delta.content),K(St=>{if(!St||St.phase!=="streaming")return St;const Jt=Date.now()-Z,pn=St.progress.ttftMs??Jt;return{...St,text:fe,progress:{ttftMs:pn,elapsedMs:Jt}}})}catch{}if(gt==="test_meta")try{const Me=JSON.parse(le);K({phase:"done",model:B,result:Me,text:fe})}catch{}if(gt==="test_error")try{const Me=JSON.parse(le);K({phase:"error",model:B,error:Me.message})}catch{}}}}K(Ce=>!Ce||Ce.phase==="streaming"?{phase:"error",model:B,error:"Stream ended unexpectedly"}:Ce)}catch(ae){K({phase:"error",model:B,error:ae.message})}finally{_(null)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Models",description:"Physical models imported from providers",actions:s.jsxs(In,{open:h,onOpenChange:p,children:[s.jsx(Bo,{asChild:!0,children:s.jsxs(he,{variant:"outline",children:[s.jsx(Xy,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),s.jsxs(Cn,{className:"max-w-2xl",children:[s.jsx(En,{children:s.jsx(Rn,{children:"Discover models"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsxs(Gn,{value:g,onValueChange:v,children:[s.jsx(Nn,{children:s.jsx(Yn,{placeholder:"Choose provider"})}),s.jsx(Tn,{children:o.map(B=>s.jsx(ot,{value:B.id,children:B.name},B.id))})]})}),s.jsx(he,{onClick:oe,disabled:!g||C,children:C?"Fetching…":"Fetch"})]}),x.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Wy,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ne,{className:"pl-8",placeholder:"Search models…",value:A,onChange:B=>T(B.target.value)}),A&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>T(""),children:s.jsx(_c,{className:"h-4 w-4"})})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm text-muted-foreground",children:[W.length," / ",x.length," · ",S.size," selected"]}),s.jsx(he,{variant:"outline",size:"sm",onClick:()=>w(new Set(W.filter(B=>!B.alreadyImported).map(B=>B.upstreamId))),children:"Select All (new)"}),s.jsx(he,{variant:"outline",size:"sm",onClick:()=>w(new Set),children:"Clear"})]})]}),s.jsx("div",{className:"max-h-80 space-y-1 overflow-auto rounded border p-2",children:W.length===0&&x.length>0?s.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):W.map(B=>s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(xm,{checked:S.has(B.upstreamId),onCheckedChange:Z=>{const D=new Set(S);Z?D.add(B.upstreamId):D.delete(B.upstreamId),w(D)}}),s.jsx("span",{className:"font-mono text-xs",children:B.upstreamId}),B.alreadyImported&&s.jsx(at,{variant:"secondary",children:"imported"})]},B.upstreamId))})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsxs(he,{disabled:S.size===0,onClick:U,children:["Import ",S.size||""]})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All models"}),s.jsxs(un,{children:[a.length," total"]})]}),s.jsxs(et,{children:[s.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[s.jsxs(Gn,{value:u,onValueChange:d,children:[s.jsx(Nn,{className:"w-56",children:s.jsx(Yn,{})}),s.jsxs(Tn,{children:[s.jsx(ot,{value:"all",children:"All providers"}),o.map(B=>s.jsx(ot,{value:B.id,children:B.name},B.id))]})]}),s.jsx(Ne,{className:"max-w-xs",placeholder:"Search public ID",value:j,onChange:B=>N(B.target.value)})]}),s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Ke,{children:[s.jsx(pe,{children:"Public ID"}),s.jsx(pe,{children:"Provider"}),s.jsx(pe,{children:"Upstream ID"}),s.jsx(pe,{children:"Capabilities"}),s.jsx(pe,{children:"Available"}),s.jsx(pe,{children:"Enabled"}),s.jsx(pe,{})]})}),s.jsxs(Qn,{children:[re.length===0&&s.jsx(Ke,{children:s.jsx(de,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),re.map(B=>s.jsxs(Ke,{children:[s.jsx(de,{className:"font-mono text-xs",children:B.publicModelId}),s.jsx(de,{children:B.providerSlug}),s.jsx(de,{className:"text-xs text-muted-foreground",children:B.upstreamModelId}),s.jsx(de,{className:"space-x-1",children:Object.entries(B.capabilities).filter(([,Z])=>Z===!0).slice(0,4).map(([Z])=>s.jsx(at,{variant:"outline",className:"mr-1",children:Z},Z))}),s.jsx(de,{children:B.upstreamAvailable?s.jsx(at,{variant:"success",children:"up"}):s.jsx(at,{variant:"destructive",children:"down"})}),s.jsx(de,{children:B.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(he,{size:"sm",variant:"outline",onClick:()=>void ne(B.id),disabled:O!==null,children:[O===B.id?s.jsx(jo,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(uC,{className:"h-3.5 w-3.5"})," Test"]}),s.jsxs(he,{size:"sm",variant:"destructive",onClick:()=>X(B),disabled:O!==null,children:[s.jsx(Oc,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},B.id))]})]})]})]}),s.jsx(In,{open:!!se,onOpenChange:B=>{B||X(null)},children:s.jsxs(Cn,{className:"max-w-md",children:[s.jsx(En,{children:s.jsx(Rn,{children:"Xoá model"})}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("p",{children:["Bạn có chắc muốn xoá model ",s.jsx("span",{className:"font-mono",children:se==null?void 0:se.publicModelId}),"?"]}),s.jsx("p",{className:"text-muted-foreground",children:"Model đang được dùng trong combo sẽ bị soft-disable (vô hiệu hoá) thay vì xoá hẳn, để giữ lịch sử và tham chiếu combo."})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>X(null),children:"Huỷ"}),s.jsx(he,{variant:"destructive",onClick:$,children:"Xoá"})]})]})}),s.jsx(In,{open:M,onOpenChange:H,children:s.jsxs(Cn,{className:"max-w-2xl",children:[s.jsx(En,{children:s.jsx(Rn,{children:"Kết quả test model"})}),z&&z.phase==="streaming"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(jo,{className:"h-4 w-4 animate-spin"})," Đang stream…",s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["TTFT ",z.progress.ttftMs!=null?`${z.progress.ttftMs} ms`:"…"]}),s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["· ",z.progress.elapsedMs!=null?`${z.progress.elapsedMs} ms`:"…"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi (streaming)"}),s.jsxs("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:[z.text||s.jsx("span",{className:"text-muted-foreground/60 animate-pulse",children:"waiting for first token…"}),z.phase==="streaming"&&s.jsx("span",{className:"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-primary/70"})]})]})]}),z&&z.phase==="done"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(at,{variant:z.result.success?"success":"destructive",children:z.result.success?"Thành công":"Thất bại"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Thời gian phản hồi"}),s.jsxs("div",{className:"font-mono",children:[z.result.latencyMs," ms"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"TTFT"}),s.jsx("div",{className:"font-mono",children:z.result.ttftMs!=null?`${z.result.ttftMs} ms`:"—"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tokens (in / out)"}),s.jsxs("div",{className:"font-mono",children:[z.result.usage.input," / ",z.result.usage.output]})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi của model"}),s.jsx("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:z.text||z.result.text||"(trống)"})]}),z.result.attempts.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Attempts"}),s.jsx("div",{className:"space-y-1",children:z.result.attempts.map((B,Z)=>s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[s.jsx(at,{variant:B.success?"success":"destructive",children:B.success?"OK":"FAIL"}),s.jsxs("span",{className:"font-mono",children:[B.providerName," / ",B.modelId]}),s.jsxs("span",{className:"text-muted-foreground",children:[B.latencyMs," ms"]}),B.failureReason&&s.jsx("span",{className:"text-destructive",children:B.failureReason})]},Z))})]})]}),z&&z.phase==="error"&&s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx(at,{variant:"destructive",children:"Thất bại"}),s.jsx("p",{className:"text-destructive",children:z.error})]}),s.jsx(Vn,{children:s.jsx(he,{variant:"outline",onClick:()=>H(!1),children:"Đóng"})})]})})]})}function CD(){const[a,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState(!1),[h,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(!1),[S,w]=m.useState(!1),[C,E]=m.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),[j,N]=m.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),A=async()=>{const[X,I]=await Promise.all([Se.get("/api/admin/combos"),Se.get("/api/admin/models")]);l(X.combos),i(I.models)};m.useEffect(()=>{A()},[]);const T=X=>{E(I=>({...I,members:[...I.members,{modelId:X,weight:1,position:I.members.length,enabled:!0}]}))},O=X=>{E(I=>({...I,members:I.members.filter((re,W)=>W!==X).map((re,W)=>({...re,position:W}))}))},_=async()=>{if(C.members.length===0){me.error("Add at least one member");return}y(!0);try{await Se.post("/api/admin/combos",{name:C.name,slug:C.slug||void 0,mode:C.mode,enabled:C.enabled,members:C.members}),me.success("Combo created"),d(!1),E({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),A()}catch(X){me.error(X.message)}finally{y(!1)}},M=async X=>{try{const re=(await Se.get(`/api/admin/combos/${X.id}`)).combo;v(re.id),N({name:re.name,slug:re.slug??"",mode:re.mode,enabled:re.enabled,members:re.members.map(W=>({modelId:W.modelId,weight:W.weight,position:W.position,enabled:W.enabled}))}),p(!0)}catch(I){me.error(I.message)}},H=async()=>{if(g){if(j.members.length===0){me.error("Add at least one member");return}w(!0);try{await Se.patch("/api/admin/combos",{id:g,name:j.name,slug:j.slug||void 0,mode:j.mode,enabled:j.enabled,members:j.members}),me.success("Combo updated"),p(!1),v(null),A()}catch(X){me.error(X.message)}finally{w(!1)}}},z=X=>{N(I=>({...I,members:[...I.members,{modelId:X,weight:1,position:I.members.length,enabled:!0}]}))},K=X=>{N(I=>({...I,members:I.members.filter((re,W)=>W!==X).map((re,W)=>({...re,position:W}))}))},se=async X=>{if(confirm("Delete this combo?"))try{await Se.del(`/api/admin/combos/${X}`),me.success("Combo removed"),A()}catch(I){me.error(I.message)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Combos",description:"Virtual models combining physical models",actions:s.jsxs(In,{open:u,onOpenChange:d,children:[s.jsx(Bo,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(_o,{className:"mr-1 h-4 w-4"})," New combo"]})}),s.jsxs(Cn,{className:"max-w-2xl",children:[s.jsx(En,{children:s.jsx(Rn,{children:"New combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Ne,{value:C.name,onChange:X=>E({...C,name:X.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Ne,{value:C.slug,onChange:X=>E({...C,slug:X.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Mode"}),s.jsxs(Gn,{value:C.mode,onValueChange:X=>E({...C,mode:X}),children:[s.jsx(Nn,{children:s.jsx(Yn,{})}),s.jsxs(Tn,{children:[s.jsx(ot,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(ot,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:C.enabled,onCheckedChange:X=>E({...C,enabled:X})}),s.jsx(xe,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Members"}),s.jsx(py,{models:o,addedIds:C.members.map(X=>X.modelId),onAdd:T}),s.jsx("div",{className:"mt-2 space-y-1",children:C.members.map((X,I)=>{var re;return s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-sm",children:[s.jsx("span",{className:"font-mono text-xs",children:(re=o.find(W=>W.id===X.modelId))==null?void 0:re.publicModelId}),s.jsx(Ne,{type:"number",min:1,value:X.weight,onChange:W=>{const oe=Number(W.target.value);E(U=>({...U,members:U.members.map(($,ne)=>ne===I?{...$,weight:oe}:$)}))},className:"w-20"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>O(I),children:"Remove"})]},I)})})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),s.jsx(he,{disabled:!C.name||x,onClick:_,children:x?"Creating…":"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All combos"}),s.jsxs(un,{children:[a.length," total"]})]}),s.jsx(et,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Ke,{children:[s.jsx(pe,{children:"Public ID"}),s.jsx(pe,{children:"Mode"}),s.jsx(pe,{children:"Members"}),s.jsx(pe,{children:"Healthy"}),s.jsx(pe,{children:"Enabled"}),s.jsx(pe,{})]})}),s.jsxs(Qn,{children:[a.length===0&&s.jsx(Ke,{children:s.jsx(de,{colSpan:6,className:"text-center text-muted-foreground",children:"No combos yet."})}),a.map(X=>s.jsxs(Ke,{children:[s.jsx(de,{className:"font-mono text-xs",children:X.publicModelId}),s.jsx(de,{children:s.jsx(at,{variant:"outline",children:X.mode})}),s.jsx(de,{children:X.memberCount}),s.jsx(de,{children:X.healthyMemberCount}),s.jsx(de,{children:X.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(he,{size:"sm",variant:"outline",onClick:()=>void M(X),children:[s.jsx(yC,{className:"h-3.5 w-3.5"})," Sửa"]}),s.jsxs(he,{size:"sm",variant:"destructive",onClick:()=>se(X.id),children:[s.jsx(Oc,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},X.id))]})]})})]}),s.jsx(In,{open:h,onOpenChange:p,children:s.jsxs(Cn,{className:"max-w-2xl",children:[s.jsx(En,{children:s.jsx(Rn,{children:"Edit combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Ne,{value:j.name,onChange:X=>N({...j,name:X.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Ne,{value:j.slug,onChange:X=>N({...j,slug:X.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Mode"}),s.jsxs(Gn,{value:j.mode,onValueChange:X=>N({...j,mode:X}),children:[s.jsx(Nn,{children:s.jsx(Yn,{})}),s.jsxs(Tn,{children:[s.jsx(ot,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(ot,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:j.enabled,onCheckedChange:X=>N({...j,enabled:X})}),s.jsx(xe,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Members"}),s.jsx(py,{models:o,addedIds:j.members.map(X=>X.modelId),onAdd:z}),s.jsx("div",{className:"mt-2 space-y-1",children:j.members.map((X,I)=>{var re;return s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-sm",children:[s.jsx("span",{className:"font-mono text-xs",children:(re=o.find(W=>W.id===X.modelId))==null?void 0:re.publicModelId}),s.jsx(Ne,{type:"number",min:1,value:X.weight,onChange:W=>{const oe=Number(W.target.value);N(U=>({...U,members:U.members.map(($,ne)=>ne===I?{...$,weight:oe}:$)}))},className:"w-20"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>K(I),children:"Remove"})]},I)})})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(he,{disabled:!j.name||S,onClick:H,children:S?"Saving…":"Save"})]})]})})]})}function py({models:a,addedIds:l,onAdd:o}){const[i,u]=m.useState(""),h=(i?a.filter(p=>{const g=i.toLowerCase();return p.publicModelId.toLowerCase().includes(g)||p.displayName.toLowerCase().includes(g)}):a).filter(p=>!l.includes(p.id));return s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Wy,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ne,{className:"pl-8",placeholder:"Search models…",value:i,onChange:p=>u(p.target.value)}),i&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>u(""),children:s.jsx(_c,{className:"h-4 w-4"})})]}),h.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No models match."}):s.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded border p-1",children:h.map(p=>s.jsxs("div",{className:"flex items-center justify-between rounded p-1 text-sm hover:bg-accent",children:[s.jsx("span",{className:"font-mono text-xs",children:p.publicModelId}),s.jsx(he,{size:"sm",variant:"ghost",onClick:()=>o(p.id),children:"+ Add"})]},p.id))})]})}function ED(){const[a,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState([]),[h,p]=m.useState(!1),[g,v]=m.useState({alias:"",targetKind:"model",targetId:"",enabled:!0}),x=async()=>{const[S,w,C]=await Promise.all([Se.get("/api/admin/aliases"),Se.get("/api/admin/models"),Se.get("/api/admin/combos")]);l(S.aliases),i(w.models),d(C.combos)};m.useEffect(()=>{x()},[]);const y=async()=>{try{await Se.post("/api/admin/aliases",g),me.success("Alias created"),p(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),x()}catch(S){me.error(S.message)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:s.jsxs(In,{open:h,onOpenChange:p,children:[s.jsx(Bo,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(_o,{className:"mr-1 h-4 w-4"})," New alias"]})}),s.jsxs(Cn,{children:[s.jsx(En,{children:s.jsx(Rn,{children:"New alias"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Alias"}),s.jsx(Ne,{value:g.alias,onChange:S=>v({...g,alias:S.target.value}),placeholder:"coding"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Target type"}),s.jsxs(Gn,{value:g.targetKind,onValueChange:S=>v({...g,targetKind:S}),children:[s.jsx(Nn,{children:s.jsx(Yn,{})}),s.jsxs(Tn,{children:[s.jsx(ot,{value:"model",children:"Model"}),s.jsx(ot,{value:"combo",children:"Combo"})]})]})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Target"}),s.jsxs(Gn,{value:g.targetId,onValueChange:S=>v({...g,targetId:S}),children:[s.jsx(Nn,{children:s.jsx(Yn,{placeholder:"Choose target"})}),s.jsx(Tn,{children:(g.targetKind==="model"?o:u).map(S=>s.jsx(ot,{value:S.id,children:S.publicModelId},S.id))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:g.enabled,onCheckedChange:S=>v({...g,enabled:S})}),s.jsx(xe,{children:"Enabled"})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(he,{disabled:!g.alias||!g.targetId,onClick:y,children:"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All aliases"}),s.jsxs(un,{children:[a.length," total"]})]}),s.jsx(et,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Ke,{children:[s.jsx(pe,{children:"Alias"}),s.jsx(pe,{children:"Target"}),s.jsx(pe,{children:"Type"}),s.jsx(pe,{children:"Enabled"}),s.jsx(pe,{})]})}),s.jsxs(Qn,{children:[a.length===0&&s.jsx(Ke,{children:s.jsx(de,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),a.map(S=>s.jsxs(Ke,{children:[s.jsx(de,{className:"font-mono text-xs",children:S.alias}),s.jsx(de,{className:"font-mono text-xs",children:S.targetName??S.targetId}),s.jsx(de,{children:s.jsx(at,{variant:"outline",children:S.targetKind})}),s.jsx(de,{children:S.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsx(he,{size:"sm",variant:"outline",onClick:async()=>{await Se.del(`/api/admin/aliases/${S.id}`),me.success("Removed"),x()},children:"Delete"})})]},S.id))]})]})})]})]})}function RD(){const[a,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState([]),[h,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(null),[S,w]=m.useState(null),[C,E]=m.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),j=async()=>{const[M,H,z]=await Promise.all([Se.get("/api/admin/api-keys"),Se.get("/api/admin/models"),Se.get("/api/admin/combos")]);l(M.apiKeys),i(H.models),d(z.combos)};m.useEffect(()=>{j()},[]);const N=async()=>{try{if(g){await Se.patch("/api/admin/api-keys",{id:g,name:C.name,expiresAt:C.expiresAt||null,allowAllModels:C.allowAll,permissions:C.allowAll?[]:C.permissions,rpmLimit:C.rpmLimit?Number(C.rpmLimit):null,tpmLimit:C.tpmLimit?Number(C.tpmLimit):null,maxConcurrent:C.concurrency?Number(C.concurrency):null}),p(!1),v(null),E({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),me.success("Key updated"),j();return}const M=await Se.post("/api/admin/api-keys",{name:C.name,expiresAt:C.expiresAt||null,allowAllModels:C.allowAll,permissions:C.allowAll?void 0:C.permissions,rpmLimit:C.rpmLimit?Number(C.rpmLimit):null,tpmLimit:C.tpmLimit?Number(C.tpmLimit):null,maxConcurrent:C.concurrency?Number(C.concurrency):null,...C.customSecret.trim()?{secret:C.customSecret.trim()}:{}});p(!1),y({secret:M.secret,name:M.name}),E({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),j()}catch(M){me.error(M.message)}},A=async M=>{try{const z=((await Se.get(`/api/admin/api-keys/${M.id}`)).apiKey.permissions??[]).filter(K=>K.targetKind==="model"||K.targetKind==="combo");v(M.id),E({name:M.name,expiresAt:M.expiresAt?M.expiresAt.slice(0,16):"",allowAll:M.allowAllModels,permissions:z,rpmLimit:M.rpmLimit!=null?String(M.rpmLimit):"",tpmLimit:M.tpmLimit!=null?String(M.tpmLimit):"",concurrency:M.concurrencyLimit!=null?String(M.concurrencyLimit):"",customSecret:""}),p(!0)}catch(H){me.error(H.message)}},T=()=>{p(!1),v(null),E({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""})},O=async(M,H)=>{try{await Se.patch("/api/admin/api-keys",{id:M,enabled:!H}),me.success(H?"Key disabled":"Key enabled"),j()}catch(z){me.error(z.message)}},_=async M=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await Se.del(`/api/admin/api-keys/${M}`),me.success("Key deleted"),j()}catch(H){me.error(H.message)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:s.jsxs(In,{open:h,onOpenChange:M=>{M?p(!0):T()},children:[s.jsx(Bo,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(_o,{className:"mr-1 h-4 w-4"})," New key"]})}),s.jsxs(Cn,{className:"max-w-2xl",children:[s.jsx(En,{children:s.jsx(Rn,{children:g?"Edit API key":"New API key"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Ne,{value:C.name,onChange:M=>E({...C,name:M.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Expires (optional)"}),s.jsx(Ne,{type:"datetime-local",value:C.expiresAt,onChange:M=>E({...C,expiresAt:M.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"RPM limit"}),s.jsx(Ne,{value:C.rpmLimit,onChange:M=>E({...C,rpmLimit:M.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"TPM limit"}),s.jsx(Ne,{value:C.tpmLimit,onChange:M=>E({...C,tpmLimit:M.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Concurrency"}),s.jsx(Ne,{value:C.concurrency,onChange:M=>E({...C,concurrency:M.target.value}),type:"number"})]})]}),!g&&s.jsxs("div",{children:[s.jsx(xe,{children:"Key value (optional)"}),s.jsx(Ne,{value:C.customSecret,onChange:M=>E({...C,customSecret:M.target.value}),placeholder:"Leave empty to auto-generate ld-…"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"If provided, this exact value is stored as the key. Otherwise a random ld-… key is generated."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:C.allowAll,onCheckedChange:M=>E({...C,allowAll:M})}),s.jsx(xe,{children:"Allow all current and future models"})]}),!C.allowAll&&s.jsxs("div",{children:[s.jsx(xe,{children:"Scope"}),s.jsx("div",{className:"max-h-48 space-y-1 overflow-auto rounded border p-2",children:[...o.map(M=>({targetKind:"model",targetId:M.id,label:M.publicModelId})),...u.map(M=>({targetKind:"combo",targetId:M.id,label:M.publicModelId}))].map(M=>{const H=C.permissions.some(z=>z.targetKind===M.targetKind&&z.targetId===M.targetId);return s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(xm,{checked:H,onCheckedChange:z=>{E(K=>({...K,permissions:z?[...K.permissions,{targetKind:M.targetKind,targetId:M.targetId}]:K.permissions.filter(se=>!(se.targetKind===M.targetKind&&se.targetId===M.targetId))}))}}),s.jsx("span",{className:"font-mono text-xs",children:M.label}),s.jsx(at,{variant:"outline",className:"ml-1",children:M.targetKind})]},`${M.targetKind}:${M.targetId}`)})})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:T,children:"Cancel"}),s.jsx(he,{disabled:!C.name,onClick:N,children:g?"Save changes":"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All keys"}),s.jsxs(un,{children:[a.length," total"]})]}),s.jsx(et,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Ke,{children:[s.jsx(pe,{children:"Name"}),s.jsx(pe,{children:"Prefix"}),s.jsx(pe,{children:"Status"}),s.jsx(pe,{children:"Scope"}),s.jsx(pe,{children:"RPM/TPM/Conc"}),s.jsx(pe,{})]})}),s.jsxs(Qn,{children:[a.length===0&&s.jsx(Ke,{children:s.jsx(de,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),a.map(M=>s.jsxs(Ke,{children:[s.jsx(de,{className:"font-medium",children:M.name}),s.jsxs(de,{className:"font-mono text-xs",children:[M.keyPrefix,"…"]}),s.jsx(de,{children:M.enabled?s.jsx(at,{variant:"success",children:"enabled"}):s.jsx(at,{variant:"destructive",children:"disabled"})}),s.jsx(de,{children:M.allowAllModels?"all":`${M.modelScopeCount} scoped`}),s.jsx(de,{className:"text-xs",children:[M.rpmLimit,M.tpmLimit,M.concurrencyLimit].map((H,z)=>H?["","RPM","TPM","Conc"][z+1]:null).filter(Boolean).join(" / ")||"—"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[M.secret&&s.jsxs(s.Fragment,{children:[s.jsx(he,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(M.secret),me.success("Copied")},children:s.jsx(Ef,{className:"h-3.5 w-3.5"})}),s.jsx(he,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>w({secret:M.secret,name:M.name}),children:s.jsx(iC,{className:"h-3.5 w-3.5"})})]}),s.jsx(he,{size:"sm",variant:"ghost",title:"Edit",onClick:()=>void A(M),children:s.jsx(mC,{className:"h-3.5 w-3.5"})}),s.jsxs(he,{size:"sm",variant:"outline",onClick:()=>O(M.id,M.enabled),children:[M.enabled?s.jsx(Z2,{className:"mr-1 h-3.5 w-3.5"}):s.jsx(Dc,{className:"mr-1 h-3.5 w-3.5"}),M.enabled?"Disable":"Enable"]}),s.jsx(he,{size:"sm",variant:"destructive",onClick:()=>_(M.id),children:s.jsx(Oc,{className:"h-3.5 w-3.5"})})]})})]},M.id))]})]})})]}),s.jsx(In,{open:!!x,onOpenChange:M=>{M||y(null)},children:s.jsxs(Cn,{children:[s.jsxs(En,{children:[s.jsx(Rn,{children:"API key created"}),s.jsx(ch,{children:"Copy now — this secret will not be shown again."})]}),s.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:x==null?void 0:x.secret}),s.jsxs(Vn,{children:[s.jsxs(he,{onClick:()=>{x&&(navigator.clipboard.writeText(x.secret),me.success("Copied"))},children:[s.jsx(Ef,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(he,{variant:"outline",onClick:()=>y(null),children:"I have saved it"})]})]})}),s.jsx(In,{open:!!S,onOpenChange:M=>{M||w(null)},children:s.jsxs(Cn,{children:[s.jsxs(En,{children:[s.jsxs(Rn,{children:["API key: ",S==null?void 0:S.name]}),s.jsx(ch,{children:"Full secret for this key, readable any time."})]}),s.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:S==null?void 0:S.secret}),s.jsxs(Vn,{children:[s.jsxs(he,{onClick:()=>{S&&(navigator.clipboard.writeText(S.secret),me.success("Copied"))},children:[s.jsx(Ef,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(he,{variant:"outline",onClick:()=>w(null),children:"Close"})]})]})})]})}const ND=3e3;function TD(a,l){return!(l.success!=="all"&&a.success!==(l.success==="true")||l.protocol!=="all"&&a.protocol!==l.protocol||l.streaming!=="all"&&a.streaming!==(l.streaming==="true")||l.model&&!a.requestedModel.toLowerCase().includes(l.model.toLowerCase()))}function AD(){const[a,l]=m.useState([]),[o,i]=m.useState(0),[u,d]=m.useState(0),[h,p]=m.useState({success:"all",protocol:"all",streaming:"all",model:""}),[g,v]=m.useState(null),[x,y]=m.useState(null),[S,w]=m.useState(0),C=50,E=m.useRef(Date.now()),j=m.useRef(new Set),N=m.useRef(h);N.current=h;const A=m.useRef(u);A.current=u;const T=m.useCallback(async()=>{const _=new URLSearchParams;_.set("limit",String(C)),_.set("offset",String(u)),h.success!=="all"&&_.set("success",h.success),h.protocol!=="all"&&_.set("protocol",h.protocol),h.streaming!=="all"&&_.set("streaming",h.streaming),h.model&&_.set("requestedModel",h.model);const M=await Se.get(`/api/admin/requests?${_.toString()}`);l(M.requests),i(M.total);for(const H of M.requests)j.current.add(H.id)},[u,h]);m.useEffect(()=>{T()},[T]),m.useEffect(()=>{w(0)},[u,h]),m.useEffect(()=>{let _=!1,M=null;const H=new Set,z=()=>{_||(M=new EventSource(`/api/admin/requests/stream?since=${E.current}`),M.addEventListener("request",K=>{if(!_)try{const se=JSON.parse(K.data),X=new Date(se.createdAt).getTime();if(Number.isFinite(X)&&(E.current=Math.max(E.current,X)),j.current.has(se.id))return;j.current.add(se.id),w(I=>I+1),A.current===0&&TD(se,N.current)&&(l(I=>I.some(re=>re.id===se.id)?I:[se,...I].slice(0,C)),i(I=>I+1))}catch{}}),M.onerror=()=>{M==null||M.close(),M=null,_||H.add(setTimeout(z,ND))})};return z(),()=>{_=!0,M==null||M.close();for(const K of H)clearTimeout(K);H.clear()}},[]);const O=async _=>{v(_);const M=await Se.get(`/api/admin/requests/${_}`);y(M)};return s.jsxs("div",{children:[s.jsx(wa,{title:"Requests",description:`${o} matching · live updates`}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Gn,{value:h.success,onValueChange:_=>{d(0),p({...h,success:_})},children:[s.jsx(Nn,{className:"w-36",children:s.jsx(Yn,{})}),s.jsxs(Tn,{children:[s.jsx(ot,{value:"all",children:"All"}),s.jsx(ot,{value:"true",children:"Success"}),s.jsx(ot,{value:"false",children:"Failed"})]})]}),s.jsxs(Gn,{value:h.protocol,onValueChange:_=>{d(0),p({...h,protocol:_})},children:[s.jsx(Nn,{className:"w-32",children:s.jsx(Yn,{})}),s.jsxs(Tn,{children:[s.jsx(ot,{value:"all",children:"Any protocol"}),s.jsx(ot,{value:"openai",children:"OpenAI"}),s.jsx(ot,{value:"anthropic",children:"Anthropic"})]})]}),s.jsxs(Gn,{value:h.streaming,onValueChange:_=>{d(0),p({...h,streaming:_})},children:[s.jsx(Nn,{className:"w-32",children:s.jsx(Yn,{})}),s.jsxs(Tn,{children:[s.jsx(ot,{value:"all",children:"Any"}),s.jsx(ot,{value:"true",children:"Streaming"}),s.jsx(ot,{value:"false",children:"Non-stream"})]})]}),s.jsx(Ne,{className:"max-w-xs",placeholder:"Model contains…",value:h.model,onChange:_=>{d(0),p({...h,model:_.target.value})}}),S>0&&s.jsxs(he,{size:"sm",variant:"secondary",onClick:()=>{w(0),T()},children:[S," new request",S>1?"s":""," — refresh"]})]}),s.jsx(We,{className:"mt-3 text-base",children:"Results"})]}),s.jsxs(et,{children:[s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Ke,{children:[s.jsx(pe,{children:"Time"}),s.jsx(pe,{children:"Status"}),s.jsx(pe,{children:"Requested"}),s.jsx(pe,{children:"Final"}),s.jsx(pe,{children:"Tokens"}),s.jsx(pe,{children:"Latency"}),s.jsx(pe,{children:"Attempts"}),s.jsx(pe,{children:"Key"}),s.jsx(pe,{children:"IP"}),s.jsx(pe,{})]})}),s.jsxs(Qn,{children:[a.length===0&&s.jsx(Ke,{children:s.jsx(de,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),a.map(_=>s.jsxs(Ke,{className:"cursor-pointer",onClick:()=>O(_.id),children:[s.jsx(de,{className:"text-xs",children:Ah(_.createdAt)}),s.jsx(de,{children:_.success?s.jsx(at,{variant:"success",children:_.httpStatus}):s.jsx(at,{variant:"destructive",children:_.httpStatus})}),s.jsx(de,{className:"font-mono text-xs",children:_.requestedModel}),s.jsx(de,{className:"font-mono text-xs text-muted-foreground",children:_.finalModelPublicId??"—"}),s.jsxs(de,{className:"text-xs",children:[Ot(_.inputTokens+_.outputTokens)," ",_.cacheReadTokens?s.jsxs("span",{className:"text-amber-600",children:["(+",_.cacheReadTokens," cache)"]}):null]}),s.jsxs(de,{className:"text-xs",children:[dr(_.totalLatencyMs),_.ttftMs?s.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",_.ttftMs,"ms"]}):null]}),s.jsxs(de,{className:"text-xs",children:[_.attemptsCount,_.gatewayCacheHit?s.jsx(at,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),s.jsx(de,{className:"text-xs",children:_.apiKeyName??"—"}),s.jsx(de,{className:"text-xs",children:_.clientIp}),s.jsx(de,{className:"text-right",children:s.jsx(he,{size:"sm",variant:"ghost",children:"View"})})]},_.id))]})]}),s.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Showing ",u+1,"–",Math.min(u+C,o)," of ",o]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(he,{size:"sm",variant:"outline",disabled:u===0,onClick:()=>d(Math.max(0,u-C)),children:"Prev"}),s.jsx(he,{size:"sm",variant:"outline",disabled:u+C>=o,onClick:()=>d(u+C),children:"Next"})]})]})]})]}),s.jsx(In,{open:!!g,onOpenChange:_=>{_||(v(null),y(null))},children:s.jsxs(Cn,{className:"max-w-3xl",children:[s.jsx(En,{children:s.jsxs(Rn,{children:["Request ",nE(g,16)]})}),x?s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Status"}),x.request.success?s.jsx(at,{variant:"success",children:x.request.httpStatus}):s.jsx(at,{variant:"destructive",children:x.request.httpStatus})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),dr(x.request.totalLatencyMs)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Ot(x.request.inputTokens)," · out ",Ot(x.request.outputTokens)," · cache ",Ot(x.request.cacheReadTokens)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Attempts"}),x.request.attemptsCount]})]}),x.request.errorType&&s.jsxs("div",{className:"rounded border border-destructive/40 bg-destructive/10 p-2",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Error"}),s.jsxs("div",{className:"font-mono text-xs",children:[x.request.errorType,": ",x.request.errorMessage]})]}),x.request.requestPayload&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Request content"}),s.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.requestPayload})]}),x.request.responsePayload&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Response content"}),s.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.responsePayload})]}),x.attempts.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Attempts"}),s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Ke,{children:[s.jsx(pe,{children:"#"}),s.jsx(pe,{children:"Provider"}),s.jsx(pe,{children:"Model"}),s.jsx(pe,{children:"Status"}),s.jsx(pe,{children:"Latency"}),s.jsx(pe,{children:"Reason"})]})}),s.jsx(Qn,{children:x.attempts.map(_=>s.jsxs(Ke,{children:[s.jsx(de,{children:_.attemptNumber}),s.jsx(de,{children:_.providerName}),s.jsx(de,{className:"font-mono text-xs",children:_.modelPublicId}),s.jsx(de,{children:_.success?s.jsx(at,{variant:"success",children:String(_.statusCode??"OK")}):s.jsx(at,{variant:"destructive",children:String(_.statusCode??"err")})}),s.jsx(de,{className:"text-xs",children:dr(_.latencyMs)}),s.jsx(de,{className:"text-xs",children:_.failureReason??_.selectionReason})]},_.id))})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}var MD=Object.defineProperty,Rs=(a,l)=>MD(a,"name",{value:l,configurable:!0}),ym="Tabs",[DD,ZO]=mn(ym,[Yc]),R1=Yc(),[OD,bm]=DD(ym),_D=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,value:u,onValueChange:d,defaultValue:h,orientation:p="horizontal",dir:g,activationMode:v="automatic",...x}=l,y=zo(g),[S,w]=Ja({prop:u,onChange:d,defaultProp:h??"",caller:ym});return s.jsx(OD,{scope:i,baseId:ga(),value:S,onValueChange:w,orientation:p,dir:y,activationMode:v,children:s.jsx(Pe.div,{dir:y,"data-orientation":p,...x,ref:o})})},"Tabs")),kD="TabsList",zD=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,loop:u=!0,...d}=l,h=bm(kD,i),p=R1(i);return s.jsx(h0,{asChild:!0,...p,orientation:h.orientation,dir:h.dir,loop:u,children:s.jsx(Pe.div,{role:"tablist","aria-orientation":h.orientation,...d,ref:o})})},"TabsList")),LD="TabsTrigger",UD=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,value:u,disabled:d=!1,...h}=l,p=bm(LD,i),g=R1(i),v=Sm(p.baseId,u),x=wm(p.baseId,u),y=u===p.value;return s.jsx(m0,{asChild:!0,...g,focusable:!d,active:y,children:s.jsx(Pe.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":x,"data-state":y?"active":"inactive","data-disabled":d?"":void 0,disabled:d,id:v,...h,ref:o,onMouseDown:je(l.onMouseDown,S=>{!d&&S.button===0&&S.ctrlKey===!1?p.onValueChange(u):S.preventDefault()}),onKeyDown:je(l.onKeyDown,S=>{d||S.target!==S.currentTarget||[" ","Enter"].includes(S.key)&&p.onValueChange(u)}),onFocus:je(l.onFocus,()=>{const S=p.activationMode!=="manual";!y&&!d&&S&&p.onValueChange(u)})})})},"TabsTrigger")),BD="TabsContent",HD=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,value:u,forceMount:d,children:h,...p}=l,g=bm(BD,i),v=Sm(g.baseId,u),x=wm(g.baseId,u),y=u===g.value,S=m.useRef(y);return m.useEffect(()=>{const w=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(w)},[]),s.jsx(al,{present:d||y,children:({present:w})=>s.jsx(Pe.div,{"data-state":y?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:x,tabIndex:0,...p,ref:o,style:{...l.style,animationDuration:S.current?"0s":void 0},children:w&&h})})},"TabsContent"));function Sm(a,l){return`${a}-trigger-${l}`}Rs(Sm,"makeTriggerId");function wm(a,l){return`${a}-content-${l}`}Rs(wm,"makeContentId");var PD=_D,N1=zD,T1=UD,A1=HD;const M1=PD,jm=m.forwardRef(({className:a,...l},o)=>s.jsx(N1,{ref:o,className:Ee("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",a),...l}));jm.displayName=N1.displayName;const Ka=m.forwardRef(({className:a,...l},o)=>s.jsx(T1,{ref:o,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",a),...l}));Ka.displayName=T1.displayName;const ds=m.forwardRef(({className:a,...l},o)=>s.jsx(A1,{ref:o,className:Ee("mt-2 ring-offset-background focus-visible:outline-none",a),...l}));ds.displayName=A1.displayName;const qD=3e3,ID=1600,VD=10,GD=3,YD=12,$D=10*6e4;function KD(a,l){return{...a,totalRequests:a.totalRequests+1,successfulRequests:a.successfulRequests+(l.success?1:0),failedRequests:a.failedRequests+(l.success?0:1),successRate:a.totalRequests+1?(a.successfulRequests+(l.success?1:0))/(a.totalRequests+1):0,inputTokens:a.inputTokens+l.inputTokens,outputTokens:a.outputTokens+l.outputTokens,totalTokens:a.totalTokens+l.inputTokens+l.outputTokens,cacheReadTokens:a.cacheReadTokens+l.cacheReadTokens,averageLatencyMs:(a.averageLatencyMs*a.totalRequests+l.totalLatencyMs)/(a.totalRequests+1)}}function XD(a){const[l,o]=m.useState(null),[i,u]=m.useState(null),[d,h]=m.useState([]),[p,g]=m.useState([]),[v,x]=m.useState([]),[y,S]=m.useState([]),[w,C]=m.useState(!0),[E,j]=m.useState(null),N=m.useRef([]),A=m.useRef(null),T=m.useRef(new Set),O=m.useRef(Date.now()),_=m.useRef(0),M=m.useRef([]),H=m.useRef([]);return m.useEffect(()=>{let z=!1;return C(!0),j(null),T.current=new Set,O.current=Date.now(),Se.get(`/api/admin/stats?preset=${a}`).then(K=>{if(!z){o(K),u(K.summary),A.current=K.summary,h(K.recent),g(K.providers),N.current=K.providers;for(const se of K.recent)T.current.add(se.id);C(!1)}}).catch(K=>{z||(j(K.message),C(!1))}),()=>{z=!0}},[a]),m.useEffect(()=>{let z=!1,K=null;const se=new Set,X=()=>{z||(K=new EventSource(`/api/admin/requests/stream?since=${O.current}`),K.addEventListener("request",re=>{if(!z)try{const W=JSON.parse(re.data),oe=new Date(W.createdAt).getTime();if(Number.isFinite(oe)&&(O.current=Math.max(O.current,oe)),T.current.has(W.id))return;if(T.current.add(W.id),A.current&&u(KD(A.current,W)),h(U=>U.some($=>$.id===W.id)?U:[W,...U].slice(0,VD)),W.providerId){N.current=N.current.map(B=>B.id===W.providerId?{...B,requests:B.requests+1,errorRate:B.requests+1?(B.errorRate*B.requests+(W.success?0:1))/(B.requests+1):0}:B),g(N.current);const U=`p${++_.current}`,$={id:U,providerId:W.providerId,success:W.success};M.current=[...M.current.slice(-(GD*4)),$],x(M.current);const ne=setTimeout(()=>{M.current=M.current.filter(B=>B.id!==U),x(M.current)},ID);se.add(ne)}H.current.some(U=>U.id===W.id)&&(H.current=H.current.filter(U=>U.id!==W.id),S(H.current))}catch{}}),K.addEventListener("request_started",re=>{if(!z)try{const W=JSON.parse(re.data);if(!W.providerId||W.providerId==="")return;H.current=[...H.current.filter(oe=>oe.id!==W.requestId).slice(-(YD-1)),{id:W.requestId,providerId:W.providerId,startedAt:Date.now(),ttftMs:W.ttftMs??0}],S(H.current)}catch{}}),K.onerror=()=>{K==null||K.close(),K=null,z||se.add(setTimeout(X,qD))})};X();const I=setInterval(()=>{const re=Date.now()-$D;H.current.some(W=>W.startedAt<re)&&(H.current=H.current.filter(W=>W.startedAt>=re),S(H.current))},3e4);return()=>{z=!0,K==null||K.close();for(const re of se)clearTimeout(re);se.clear(),clearInterval(I)}},[]),m.useEffect(()=>{const z=setInterval(()=>{Se.get("/api/admin/providers").then(K=>{const se=new Map(K.providers.map(X=>[X.id,X]));N.current=N.current.map(X=>{const I=se.get(X.id);return I?{...X,health:I.health,enabled:I.enabled}:X}),g(N.current)}).catch(()=>{})},3e4);return()=>clearInterval(z)},[]),{snapshot:l,live:i??(l==null?void 0:l.summary)??FD,recent:d,providers:p,pulses:v,activeRoutes:y,loading:w,error:E}}const FD={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 D1({data:a,className:l,strokeClass:o="stroke-primary",fillClass:i}){if(a.length===0)return s.jsx("svg",{className:Ee("h-6 w-20",l),viewBox:"0 0 80 24"});const h=Math.max(...a),p=Math.min(...a),g=h-p||1,x=a.map((y,S)=>{const w=S/(a.length-1)*78+1,C=22-(y-p)/g*20;return`${w.toFixed(1)},${C.toFixed(1)}`}).join(" ");return s.jsxs("svg",{className:Ee("h-6 w-20",l),viewBox:"0 0 80 24",preserveAspectRatio:"none",children:[i&&s.jsx("polygon",{points:`1,23 ${x} 79,23`,className:i}),s.jsx("polyline",{points:x,fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:o})]})}function QD(a,l,o){const i=performance.now();let u=0;const d=h=>{const p=Math.min((h-i)/l,1),g=Math.round(a*p);g!==u&&(u=g,o(g)),p<1&&requestAnimationFrame(d)};requestAnimationFrame(d)}function ZD({delta:a,inverse:l}){if(Math.abs(a)<.005)return null;const o=a>0,i=l?!o:o,u=`${(Math.abs(a)*100).toFixed(1)}%`;return s.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",i?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"),children:[s.jsx("span",{className:"mr-0.5",children:o?"▲":"▼"}),u]})}function _l({icon:a,label:l,value:o,format:i="number",delta:u,deltaInverse:d,sparkData:h,sparkStroke:p}){const[g,v]=m.useState(0),x=m.useRef(0);m.useEffect(()=>{const S=x.current,w=o;x.current=o,S!==w&&QD(Math.abs(w-S),600,C=>v(S+(w>S?C:-C)))},[o]);const y=i==="percent"?kc(g):i==="latency"?dr(g):Ot(Math.round(g));return s.jsxs(Ze,{children:[s.jsxs(Je,{className:"flex flex-row items-center justify-between pb-1",children:[s.jsxs(We,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(a,{className:"h-4 w-4"}),l]}),u!==void 0&&s.jsx(ZD,{delta:u,inverse:d})]}),s.jsxs(et,{className:"flex items-end justify-between",children:[s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:y}),h&&h.length>1&&s.jsx(D1,{data:h,strokeClass:p??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const O1=1e3,gy=380,uc=60,kl=O1/2,zl=720,Hf=62,JD=260;function WD(a){return a==="healthy"?"fill-emerald-400":a==="degraded"?"fill-amber-400":"fill-red-400"}function dc(a,l,o,i){const u=a+(o-a)*.45,d=a+(o-a)*.55;return`M${a},${l} C${u},${l} ${d},${i} ${o},${i}`}function eO({liveRequests:a,successRate:l,providers:o,pulses:i,activeRoutes:u}){const d=gy/2,h=d,p=Math.max(1,o.reduce((x,y)=>x+y.requests,0)),g=new Set(u.map(x=>x.providerId)),v=g.size>0;return s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(We,{className:"text-base",children:"Real-time Request Routing"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-emerald-400"})," healthy"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-400"})," degraded"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-red-400"})," down"]})]})]})}),s.jsx(et,{className:"pt-0",children:s.jsx("div",{className:"relative w-full",children:s.jsxs("svg",{viewBox:`0 0 ${O1} ${gy}`,className:"w-full h-auto",preserveAspectRatio:"xMidYMid meet",children:[s.jsx("defs",{children:s.jsxs("filter",{id:"glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[s.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),s.jsxs("feMerge",{children:[s.jsx("feMergeNode",{in:"blur"}),s.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),o.map(x=>{const S=60+o.indexOf(x)*Hf,w=x.requests/p,C=Math.max(1.5,Math.min(6,2+w*8)),E=g.has(x.id);return s.jsxs("g",{children:[E&&s.jsx("path",{d:dc(kl,d,zl-20,S),fill:"none",stroke:"hsl(var(--primary) / 0.25)",strokeWidth:C+6,strokeLinecap:"round"}),s.jsx("path",{d:dc(kl,d,zl-20,S),fill:"none",stroke:E?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:E?C+1:C,strokeLinecap:"round",opacity:E?.95:.6,className:E?"route-active":void 0})]},x.id)}),s.jsx("path",{d:dc(uc+30,h,kl-30,d),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}),i.map(x=>{const y=o.findIndex(E=>E.id===x.providerId);if(y===-1)return null;const S=60+y*Hf,w=dc(kl,d,zl-20,S),C=x.success?"var(--primary)":"#f87171";return s.jsxs("g",{filter:"url(#glow)",children:[s.jsx("circle",{r:5,fill:C,opacity:.9,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})}),s.jsx("circle",{r:9,fill:C,opacity:.25,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})})]},x.id)}),s.jsx("circle",{cx:uc,cy:h,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),s.jsx("text",{x:uc,y:h-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:vy(a)}),s.jsx("text",{x:uc,y:h+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),s.jsx("circle",{cx:kl,cy:d,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),s.jsx("image",{x:kl-12,y:d-16,width:24,height:24,href:"/logo.png"}),s.jsx("text",{x:kl,y:d+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),s.jsxs("text",{x:kl,y:d+38,textAnchor:"middle",className:"fill-emerald-500",fontSize:10,fontWeight:600,children:[(l*100).toFixed(1),"%"]}),o.map((x,y)=>{const S=60+y*Hf,w=x.requests/p,C=!x.enabled||x.requests===0;return s.jsxs("g",{opacity:C?.4:1,children:[s.jsx("rect",{x:zl-20,y:S-14,width:JD,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),s.jsx("circle",{cx:zl-6,cy:S+10,r:4,className:WD(x.health)}),s.jsx("text",{x:zl+6,y:S-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:x.name}),s.jsxs("text",{x:zl+6,y:S+12,className:"fill-muted-foreground",fontSize:10,children:[x.modelCount," model",x.modelCount!==1?"s":""," · ",vy(x.requests)," req"]}),s.jsxs("text",{x:zl+6,y:S+25,className:"fill-muted-foreground",fontSize:10,children:[(w*100).toFixed(1),"% traffic · ",x.avgLatencyMs<1e3?`${Math.round(x.avgLatencyMs)}ms`:`${(x.avgLatencyMs/1e3).toFixed(1)}s`," avg",x.errorRate>0&&s.jsxs("tspan",{className:"fill-red-500",children:[" · ",(x.errorRate*100).toFixed(0),"% err"]})]})]},x.id)})]})})})]})}function vy(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a)}function tO({rows:a}){return s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsx(We,{className:"text-base",children:"Recent Requests"})}),s.jsx(et,{children:a.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No requests yet — traffic will appear here live."}):s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Ke,{children:[s.jsx(pe,{children:"Model"}),s.jsx(pe,{children:"Provider"}),s.jsx(pe,{children:"Tokens"}),s.jsx(pe,{children:"Status"}),s.jsx(pe,{children:"Time"})]})}),s.jsx(Qn,{children:a.map(l=>s.jsxs(Ke,{children:[s.jsx(de,{className:"font-mono text-xs",children:l.requestedModel}),s.jsx(de,{className:"text-xs text-muted-foreground",children:l.providerName??"—"}),s.jsxs(de,{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["in ",Ot(l.inputTokens)," · out ",Ot(l.outputTokens)]}),l.cacheReadTokens>0&&s.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",Ot(l.cacheReadTokens)," cache)"]})]}),s.jsx(de,{children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:l.success?"h-2 w-2 rounded-full bg-emerald-400":"h-2 w-2 rounded-full bg-red-400"}),s.jsx("span",{className:"text-xs",children:l.success?l.httpStatus:`${l.httpStatus} err`})]})}),s.jsx(de,{className:"text-xs text-muted-foreground",children:aE(l.createdAt)})]},l.id))})]})})]})}const fh=34,xy=2*Math.PI*fh;function nO(a){return a>=.95?{stroke:"#4ade80",text:"text-emerald-500"}:a>=.8?{stroke:"#fbbf24",text:"text-amber-500"}:{stroke:"#f87171",text:"text-red-500"}}function aO({successRate:a,averageLatencyMs:l,latencySpark:o}){const{stroke:i,text:u}=nO(a),d=Math.min(1,Math.max(0,a)),h=xy*(1-d);return s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsx(We,{className:"text-base",children:"Success Rate"})}),s.jsxs(et,{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"relative h-20 w-20",children:[s.jsxs("svg",{viewBox:"0 0 80 80",className:"h-20 w-20 -rotate-90",children:[s.jsx("circle",{cx:"40",cy:"40",r:fh,fill:"none",stroke:"hsl(var(--border))",strokeWidth:7}),s.jsx("circle",{cx:"40",cy:"40",r:fh,fill:"none",stroke:i,strokeWidth:7,strokeLinecap:"round",strokeDasharray:xy,strokeDashoffset:h,style:{transition:"stroke-dashoffset 0.6s ease, stroke 0.4s ease"}})]}),s.jsx("span",{className:`absolute inset-0 flex items-center justify-center text-sm font-semibold tabular-nums ${u}`,children:kc(a)})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Share of requests that completed successfully over the selected window. Updated in real time."})]})]}),s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsx(We,{className:"text-base",children:"Average Latency"})}),s.jsxs(et,{className:"flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:dr(l)}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Live average across the selected window"})]}),s.jsx(D1,{data:o,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function lO(){const[a,l]=m.useState("7d"),{snapshot:o,live:i,recent:u,providers:d,pulses:h,activeRoutes:p,loading:g,error:v}=XD(a);if(g)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(v||!o)return s.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",v??"unknown error"]});const x=i,y=o.previous,S=o.series;function w(j,N){return N>0?(j-N)/N:void 0}const C=S.map(j=>j.requests),E=S.map(j=>j.avgLatency);return s.jsxs("div",{children:[s.jsx(wa,{title:"Statistics",description:"Real-time monitoring dashboard",actions:s.jsx(M1,{value:a,onValueChange:j=>void l(j),children:s.jsxs(jm,{children:[s.jsx(Ka,{value:"today",children:"Today"}),s.jsx(Ka,{value:"7d",children:"7 days"}),s.jsx(Ka,{value:"30d",children:"30 days"})]})})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsx(_l,{icon:$y,label:"Requests",value:x.totalRequests,delta:w(x.totalRequests,y.totalRequests),sparkData:C}),s.jsx(_l,{icon:Dc,label:"Success rate",format:"percent",value:x.successRate,delta:w(x.successRate,y.successRate),sparkData:C,sparkStroke:"stroke-emerald-500"}),s.jsx(_l,{icon:sC,label:"Total tokens",value:x.totalTokens,delta:w(x.totalTokens,y.totalTokens),sparkData:S.map(j=>j.inputTokens+j.outputTokens)}),s.jsx(_l,{icon:oC,label:"Cache hit rate",format:"percent",value:x.cacheHitRate,delta:w(x.cacheHitRate,y.cacheHitRate),sparkData:S.map(j=>j.cacheRead)}),s.jsx(_l,{icon:aC,label:"Avg latency",format:"latency",value:x.averageLatencyMs,delta:w(x.averageLatencyMs,y.averageLatencyMs),deltaInverse:!0,sparkData:E,sparkStroke:"stroke-amber-500"}),s.jsx(_l,{icon:Fy,label:"p95 latency",format:"latency",value:x.p95LatencyMs}),s.jsx(_l,{icon:SC,label:"Avg TTFT",format:"latency",value:x.averageTtftMs??0}),s.jsx(_l,{icon:gC,label:"Fallback rate",format:"percent",value:x.fallbackRate,delta:w(x.fallbackRate,y.fallbackRate),deltaInverse:!0})]}),s.jsx("div",{className:"mt-6",children:s.jsx(eO,{liveRequests:x.totalRequests,successRate:x.successRate,providers:d,pulses:h,activeRoutes:p})}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-3",children:[s.jsx("div",{className:"lg:col-span-2",children:s.jsx(tO,{rows:u})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsx(We,{className:"text-base",children:"Top Models"})}),s.jsx(et,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Ke,{children:[s.jsx(pe,{children:"Model"}),s.jsx(pe,{children:"Req"}),s.jsx(pe,{children:"Errors"}),s.jsx(pe,{children:"Tokens"})]})}),s.jsxs(Qn,{children:[o.topModels.length===0&&s.jsx(Ke,{children:s.jsx(de,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),o.topModels.map(j=>s.jsxs(Ke,{children:[s.jsx(de,{className:"font-mono text-xs",children:j.publicId}),s.jsx(de,{className:"text-xs",children:Ot(j.requests)}),s.jsx(de,{className:"text-xs",children:s.jsx("span",{className:j.errorRate>.1?"text-destructive":"text-muted-foreground",children:kc(j.errorRate)})}),s.jsx(de,{className:"text-xs",children:Ot(j.totalTokens)})]},j.publicId))]})]})})]}),s.jsxs(Ze,{children:[s.jsx(Je,{className:"pb-2",children:s.jsx(We,{className:"text-base",children:"Top API Keys"})}),s.jsx(et,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Ke,{children:[s.jsx(pe,{children:"Key"}),s.jsx(pe,{children:"Requests"}),s.jsx(pe,{children:"Tokens"})]})}),s.jsxs(Qn,{children:[o.topApiKeys.length===0&&s.jsx(Ke,{children:s.jsx(de,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),o.topApiKeys.map((j,N)=>s.jsxs(Ke,{children:[s.jsx(de,{className:"text-xs",children:j.name}),s.jsx(de,{className:"text-xs",children:Ot(j.requests)}),s.jsx(de,{className:"text-xs",children:Ot(j.totalTokens)})]},N))]})]})})]})]})]}),s.jsx("div",{className:"mt-6",children:s.jsx(aO,{successRate:x.successRate,averageLatencyMs:x.averageLatencyMs,latencySpark:E})})]})}function rO(){const[a,l]=m.useState([]),[o,i]=m.useState(0);return m.useEffect(()=>{Se.get("/api/admin/audit?limit=200").then(u=>{l(u.rows),i(u.total)})},[]),s.jsxs("div",{children:[s.jsx(wa,{title:"Audit Logs",description:`${o} entries · immutable`}),s.jsxs(Ze,{children:[s.jsx(Je,{children:s.jsx(We,{className:"text-base",children:"All entries"})}),s.jsx(et,{children:s.jsxs(Xn,{children:[s.jsx(Fn,{children:s.jsxs(Ke,{children:[s.jsx(pe,{children:"Time"}),s.jsx(pe,{children:"Action"}),s.jsx(pe,{children:"Status"}),s.jsx(pe,{children:"Target"}),s.jsx(pe,{children:"IP"}),s.jsx(pe,{children:"Actor"})]})}),s.jsxs(Qn,{children:[a.length===0&&s.jsx(Ke,{children:s.jsx(de,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),a.map(u=>s.jsxs(Ke,{children:[s.jsx(de,{className:"text-xs",children:Ah(u.createdAt)}),s.jsx(de,{className:"font-mono text-xs",children:u.action}),s.jsx(de,{children:u.success?s.jsx(at,{variant:"success",children:"ok"}):s.jsx(at,{variant:"destructive",children:"fail"})}),s.jsx(de,{className:"text-xs",children:u.targetName??u.targetId??"—"}),s.jsx(de,{className:"text-xs",children:u.ip}),s.jsx(de,{className:"text-xs",children:u.actor})]},u.id))]})]})})]})]})}const hh={enabled:!0,sound:!0};let To=hh,mh=!1,fc=null;const ph=new Set;function _1(){for(const a of ph)a()}function k1(a=!1){return mh&&!a?Promise.resolve():(!a&&fc||(fc=(async()=>{try{const l=await Se.get("/api/admin/settings");To={enabled:l.settings.notificationsEnabled??hh.enabled,sound:l.settings.notificationSoundEnabled??hh.sound},mh=!0,_1()}catch{}})()),fc)}async function yy(a){const l={};a.enabled!==void 0&&(l.notificationsEnabled=a.enabled),a.sound!==void 0&&(l.notificationSoundEnabled=a.sound),await Se.patch("/api/admin/settings",l),To={...To,...a},mh=!0,_1()}function sO(a){return ph.add(a),()=>ph.delete(a)}function z1(){return m.useSyncExternalStore(sO,()=>To,()=>To)}const gh=m.forwardRef(({className:a,...l},o)=>s.jsx("textarea",{ref:o,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",a),...l}));gh.displayName="Textarea";function oO(){const[a]=B2(),[l,o]=m.useState(null),[i,u]=m.useState(null),[d,h]=m.useState({current:"",next:""}),[p,g]=m.useState(""),[v,x]=m.useState(""),[y,S]=m.useState(null),[w,C]=m.useState(!1),[E,j]=m.useState("idle"),[N,A]=m.useState(null),T=async(le=!1)=>{j("checking"),A(null);try{const Me=await Se.get(`/api/admin/update/check${le?"?force=1":""}`);S(Me),j("idle")}catch(Me){A(Me.message),j("error")}},O=async()=>{C(!0),j("installing"),A(null);try{const le=await Se.post("/api/admin/update/run");j("restarting"),me.success(le.message||"Update started — the gateway will restart shortly.");const Me=setInterval(()=>{fetch("/health").then(Fe=>{Fe.ok&&(clearInterval(Me),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(Me),12e4)}catch(le){me.error(le.message),A(le.message),j("error")}finally{C(!1)}},[_,M]=m.useState("disabled"),[H,z]=m.useState(""),[K,se]=m.useState(""),[X,I]=m.useState(""),[re,W]=m.useState([]),[oe,U]=m.useState(""),[$,ne]=m.useState(""),[B,Z]=m.useState(!1),[D,q]=m.useState(null),[Q,ae]=m.useState(""),[ce,be]=m.useState(""),[ue,fe]=m.useState(""),ve=async()=>{const le=await Se.get("/api/admin/settings");o(le.settings),g(le.settings.adminIpAllow??""),x(le.settings.adminIpBlock??"");const Me=await Se.get("/api/admin/settings/system");u(Me);try{const Fe=await Se.get("/api/admin/me");M(Fe.totpEnabled?"enabled":"disabled")}catch{}};if(m.useEffect(()=>{k1(!0)},[]),m.useEffect(()=>{ve(),T(!0)},[]),!l)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const Ce=async le=>{try{await Se.patch("/api/admin/settings",le),me.success("Saved"),ve()}catch(Me){me.error(Me.message)}},De=async()=>{try{const le=await Se.post("/api/admin/account/totp/begin");z(le.secret),se(le.qr),M("setup"),me.info("Scan the QR code with your authenticator app")}catch(le){me.error(le.message)}},Ae=async()=>{if(!X||X.length!==6){me.error("Enter a 6-digit code");return}try{const le=await Se.post("/api/admin/account/totp/verify",{code:X});W(le.recoveryCodes),M("showingRecovery"),me.success("TOTP enabled successfully")}catch(le){me.error(le.message)}},Ue=async()=>{if(!oe){me.error("Enter your password");return}if(!$){me.error("Enter a TOTP code or recovery code");return}try{await Se.post("/api/admin/account/totp/disable",{password:oe,totp:$}),M("disabled"),U(""),ne(""),me.success("TOTP disabled"),ve()}catch(le){me.error(le.message)}},pt=async()=>{Z(!0);try{const le=await Se.post("/api/admin/account/totp/recovery/regenerate",{password:oe,totp:$});W(le.recoveryCodes),M("showingRecovery"),me.success("Recovery codes regenerated")}catch(le){me.error(le.message)}Z(!1)},gt=a.get("tab")||"logging";return s.jsxs("div",{children:[s.jsx(wa,{title:"Settings",description:"Logging, security, backup, and system info"}),s.jsxs(M1,{defaultValue:gt,children:[s.jsxs(jm,{children:[s.jsx(Ka,{value:"logging",children:"Logging"}),s.jsx(Ka,{value:"access",children:"Access Control"}),s.jsx(Ka,{value:"security",children:"Security"}),s.jsx(Ka,{value:"backup",children:"Backup"}),s.jsx(Ka,{value:"system",children:"System"})]}),s.jsx(ds,{value:"logging",children:s.jsxs(Ze,{children:[s.jsx(Je,{children:s.jsx(We,{className:"text-base",children:"Logging policy"})}),s.jsxs(et,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Request-content logging"}),s.jsxs(Gn,{value:l.contentLogMode,onValueChange:le=>Ce({contentLogMode:le}),children:[s.jsx(Nn,{children:s.jsx(Yn,{})}),s.jsxs(Tn,{children:[s.jsx(ot,{value:"off",children:"Off"}),s.jsx(ot,{value:"metadata",children:"Metadata only (default)"}),s.jsx(ot,{value:"prompt",children:"Prompt (sanitized)"}),s.jsx(ot,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Retention (days)"}),s.jsx(Ne,{type:"number",min:1,max:3650,value:l.retentionDays,onChange:le=>Ce({retentionDays:Number(le.target.value)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Database size limit (MB)"}),s.jsx(Ne,{type:"number",min:64,value:l.dbSizeLimitMb,onChange:le=>Ce({dbSizeLimitMb:Number(le.target.value)})})]}),s.jsx("div",{className:"flex items-center gap-2 pt-2",children:s.jsx(he,{onClick:async()=>{const le=await Se.post("/api/admin/settings/cleanup");me.success(`Deleted ${le.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),s.jsx(ds,{value:"access",children:s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"IP access control"}),s.jsx(un,{children:"Allowlist / Blocklist for this admin website (not model traffic)"})]}),s.jsxs(et,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(xe,{children:"Allow only these IPs"}),s.jsx(gh,{placeholder:`192.168.1.0/24
|
|
330
|
-
10.0.0.1`,value:p,onChange:le=>g(le.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Newlines-delimited CIDR ranges (IPv4 only). Leave empty = no allow restrictions. When you save a non-empty list, your current IP is auto-added to prevent lockout."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(xe,{children:"Block these IPs"}),s.jsx(gh,{placeholder:"192.168.1.100",value:v,onChange:le=>x(le.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'Newlines-delimited CIDR ranges (IPv4 only). Blocked IPs are rejected with "Không có quyền truy cập" before any login page.'})]}),s.jsx(he,{onClick:()=>{const le={};p!==((l==null?void 0:l.adminIpAllow)??"")&&(le.adminIpAllow=p||null),v!==((l==null?void 0:l.adminIpBlock)??"")&&(le.adminIpBlock=v||null),Se.patch("/api/admin/settings",le).then(Me=>{me.success("Saved"+(Me.addedIp?` — added your IP: ${Me.addedIp}`:"")),ve(),g(""),x("")}).catch(Me=>me.error(Me.message))},children:"Save access control"}),s.jsxs("div",{className:"rounded bg-amber-50 border border-amber-200 p-3 dark:bg-amber-950/20 dark:border-amber-800",children:[s.jsx("p",{className:"text-sm font-medium text-amber-900 dark:text-amber-200",children:"⚠️ If you enable an allow list, you cannot access the gateway unless your IP matches."}),s.jsx("p",{className:"text-xs text-amber-800 dark:text-amber-300",children:"The server automatically adds your current IP when you save — but if you configure it from a different machine, that machine will be locked out immediately."})]})]})]})}),s.jsx(ds,{value:"security",children:s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Security"}),s.jsx(un,{children:"Change password, 2FA, and trusted proxy configuration"})]}),s.jsxs(et,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(xe,{children:"Trusted proxy hops"}),s.jsx(Ne,{type:"number",min:0,max:8,value:l.trustProxyHops,onChange:le=>Ce({trustProxyHops:Number(le.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"0 = never trust X-Forwarded-For (direct exposure). 1+ only when behind a single trusted reverse proxy."})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xe,{className:"text-base",children:"TOTP 2FA"}),_==="enabled"?s.jsx("span",{className:"rounded bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800 dark:bg-green-900 dark:text-green-200",children:"Enabled"}):null,_==="disabled"?s.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:"Disabled"}):null]}),_==="disabled"&&s.jsx(he,{variant:"outline",onClick:De,children:"Enable TOTP"}),_==="setup"&&s.jsxs("div",{className:"space-y-3 rounded border p-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan this QR code with your authenticator app, or enter the secret manually."}),K&&s.jsx("img",{src:K,alt:"TOTP QR code",className:"h-40 w-40"}),s.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",H]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(xe,{children:"Verify code"}),s.jsx(Ne,{value:X,onChange:le=>I(le.target.value),placeholder:"123456",maxLength:6})]}),s.jsx(he,{disabled:X.length<6,onClick:Ae,children:"Verify & enable"})]})]}),_==="showingRecovery"&&s.jsxs("div",{className:"space-y-3 rounded border border-amber-500/40 bg-amber-50 p-3 dark:bg-amber-950/20",children:[s.jsx("p",{className:"text-sm font-medium",children:"Recovery codes — save these now!"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Each code can be used once to log in without your TOTP device. They will not be shown again."}),s.jsx("div",{className:"space-y-1",children:re.map((le,Me)=>s.jsx("div",{className:"font-mono text-xs",children:le},Me))}),s.jsx(he,{onClick:()=>{M("enabled"),me.success("Recovery codes saved")},children:"I have saved them"})]}),_==="enabled"&&s.jsxs("div",{className:"space-y-3 rounded border p-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Password"}),s.jsx(Ne,{type:"password",value:oe,onChange:le=>U(le.target.value),placeholder:"Current password"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"TOTP code"}),s.jsx(Ne,{value:$,onChange:le=>ne(le.target.value),placeholder:"123456",maxLength:6})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{variant:"outline",size:"sm",disabled:B||!oe||$.length<6,onClick:pt,children:"Regenerate recovery codes"}),s.jsx(he,{variant:"destructive",size:"sm",disabled:!oe||$.length<6,onClick:Ue,children:"Disable TOTP"})]})]})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx(xe,{children:"Change password"}),s.jsx(Ne,{type:"password",placeholder:"Current password",value:d.current,onChange:le=>h({...d,current:le.target.value})}),s.jsx(Ne,{type:"password",placeholder:"New password (12+ chars)",value:d.next,onChange:le=>h({...d,next:le.target.value})}),s.jsx(he,{disabled:!d.current||d.next.length<12,onClick:async()=>{try{await Se.post("/api/admin/account/password",{currentPassword:d.current,newPassword:d.next}),me.success("Password changed"),h({current:"",next:""})}catch(le){me.error(le.message)}},children:"Change password"})]})]})]})}),s.jsx(ds,{value:"backup",children:s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Backup & restore"}),s.jsx(un,{children:"Download a snapshot or restore from a previous backup"})]}),s.jsxs(et,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(xe,{children:"Backup passphrase (6 digits)"}),s.jsx(Ne,{inputMode:"numeric",maxLength:6,value:Q,onChange:le=>ae(le.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.jsx(Ne,{inputMode:"numeric",maxLength:6,value:ce,onChange:le=>be(le.target.value.replace(/\D/g,"")),placeholder:"Repeat passphrase"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"This passphrase encrypts the master key inside the backup. You must enter the same 6 digits when importing on a new instance. Without it, encrypted provider credentials cannot be recovered."})]}),s.jsx(he,{disabled:Q.length!==6||Q!==ce,onClick:async()=>{try{const le=await fetch("/api/admin/backup/create",{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({passphrase:Q})});if(!le.ok)throw new Error("Backup failed");const Me=await le.blob(),Fe=URL.createObjectURL(Me),St=document.createElement("a");St.href=Fe,St.download="latedev-backup.json",St.click(),URL.revokeObjectURL(Fe),me.success("Backup downloaded"),ae(""),be("")}catch(le){me.error(le.message)}},children:"Download backup"}),s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(xe,{children:"Backup passphrase for restore"}),s.jsx(Ne,{inputMode:"numeric",maxLength:6,value:ue,onChange:le=>fe(le.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the 6-digit passphrase entered when the backup was created. It is required to restore the master key and administrator access."})]}),s.jsxs(s1,{open:D!==null,onOpenChange:le=>{le||q(null)},children:[s.jsx(xM,{asChild:!0,children:s.jsxs("div",{children:[s.jsx(xe,{children:"Restore from backup file"}),s.jsx(Ne,{type:"file",accept:".json,application/json","data-testid":"restore-file",onChange:le=>{var Fe;const Me=(Fe=le.target.files)==null?void 0:Fe[0];q(Me??null)}})]})}),s.jsxs(am,{children:[s.jsxs(i1,{children:[s.jsx(lm,{children:"Restore backup?"}),s.jsxs(rm,{children:["Restoring will replace the entire current database with the selected backup (",(D==null?void 0:D.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),s.jsxs(c1,{children:[s.jsx(om,{children:"Cancel"}),s.jsx(sm,{onClick:async()=>{var Me,Fe;const le=D;if(le)try{const St=JSON.parse(await le.text()),Jt=await fetch("/api/admin/backup/restore",{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({backup:St,passphrase:ue})});if(!Jt.ok)throw new Error(((Fe=(Me=await Jt.json())==null?void 0:Me.error)==null?void 0:Fe.message)??"Restore failed");me.success("Restored. Reloading…"),q(null),setTimeout(()=>location.reload(),600)}catch(St){me.error(St.message)}},children:"Restore"})]})]})]})]})]})}),s.jsxs(ds,{value:"system",children:[s.jsxs(Ze,{children:[s.jsx(Je,{children:s.jsx(We,{className:"text-base",children:"System"})}),s.jsxs(et,{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"App version:"})," ",i==null?void 0:i.appVersion]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Data directory:"})," ",s.jsx("span",{className:"font-mono",children:i==null?void 0:i.dataDir})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Encryption:"})," ",i!=null&&i.masterKeyConfigured?"Configured":"Not configured"," (v",i==null?void 0:i.masterKeyVersion,")"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Environment:"})," ",i==null?void 0:i.environment]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(ba,{checked:l.gatewayCacheEnabled,onCheckedChange:le=>Ce({gatewayCacheEnabled:le})}),s.jsx(xe,{children:"Gateway response cache (disabled by default)"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Cache TTL (s)"}),s.jsx(Ne,{type:"number",min:1,value:l.gatewayCacheDefaultTtlSeconds,onChange:le=>Ce({gatewayCacheDefaultTtlSeconds:Number(le.target.value)})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Cache max size (MB)"}),s.jsx(Ne,{type:"number",min:1,value:l.gatewayCacheMaxSizeMb,onChange:le=>Ce({gatewayCacheMaxSizeMb:Number(le.target.value)})})]})]}),s.jsx(he,{variant:"outline",onClick:async()=>{const le=await Se.post("/api/admin/settings/cache/clear");me.success(`Cleared ${le.deleted} entries`)},children:"Clear gateway cache"})]})]}),s.jsx(iO,{}),s.jsxs(Ze,{className:"mt-4",children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Updates"}),s.jsx(un,{children:"Automatic updates from the npm registry"})]}),s.jsxs(et,{className:"space-y-3 text-sm",children:[E==="checking"&&!y&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(jo,{className:"h-4 w-4 animate-spin"})," Checking for updates…"]}),y&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Current version"}),s.jsxs("div",{className:"font-mono",children:["v",y.currentVersion]})]}),s.jsx("span",{className:"text-muted-foreground",children:"→"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Latest version"}),s.jsx("div",{className:"font-mono",children:y.latestVersion?`v${y.latestVersion}`:"—"})]}),y.status.docker?s.jsx(at,{variant:"secondary",children:y.status.watchtower?"Docker + Watchtower":"Docker"}):y.latestVersion===null?s.jsx(at,{variant:"secondary",children:"Registry unreachable"}):y.hasUpdate?s.jsx(at,{variant:"success",children:"Update available"}):s.jsxs(at,{variant:"outline",children:[s.jsx(Dc,{className:"mr-1 h-3 w-3"})," Up to date"]})]}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable&&s.jsx("p",{className:"text-muted-foreground",children:"Watchtower pulls new images automatically every hour — or use Update now for an instant update."}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable===!1&&s.jsxs("p",{className:"text-muted-foreground",children:["The Watchtower sidecar is configured but not running — start it with ",s.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"docker compose --profile updater up -d"}),"."]}),y.status.docker&&!y.status.watchtower&&s.jsx("p",{className:"text-muted-foreground",children:y.status.reason??"This instance runs in Docker — update by pulling the new image tag."}),!y.status.docker&&y.latestVersion===null&&s.jsxs("p",{className:"text-muted-foreground",children:["Could not reach the npm registry (offline or blocked). ",N&&s.jsx("span",{className:"text-destructive",children:N})]}),E==="installing"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(jo,{className:"h-4 w-4 animate-spin"})," Applying the update… this can take a minute."]}),E==="restarting"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(jo,{className:"h-4 w-4 animate-spin"})," Update applied — the gateway is restarting on the new version. This page reloads automatically."]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y.hasUpdate&&E==="idle"&&(!y.status.docker||y.status.watchtower&&y.watchtowerReachable!==!1)&&s.jsxs(he,{disabled:w||y.status.docker&&y.watchtowerReachable===!1,onClick:O,children:[s.jsx(Xy,{className:"mr-1 h-4 w-4"})," Update now"]}),y.hasUpdate&&y.changelogUrl&&s.jsx(he,{variant:"outline",asChild:!0,children:s.jsx("a",{href:y.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),E==="idle"&&s.jsx(he,{variant:"ghost",disabled:w,onClick:()=>T(!0),children:"Check again"})]})]})]})]})]})]})]})}function iO(){const a=z1();return s.jsxs(Ze,{className:"mt-4",children:[s.jsx(Je,{children:s.jsxs(We,{className:"text-base flex items-center gap-2",children:[s.jsx(J2,{className:"h-4 w-4"})," Notifications"]})}),s.jsxs(et,{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:"Show request notifications"}),s.jsx(ba,{checked:a.enabled,onCheckedChange:l=>void yy({enabled:l})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(wC,{className:"h-3 w-3"})," Play notification sound"]}),s.jsx(ba,{checked:a.sound,onCheckedChange:l=>void yy({sound:l})})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function cO({items:a,onDismiss:l}){return a.length?s.jsx("div",{className:"fixed top-16 right-4 z-50 flex max-h-[calc(100vh-8rem)] w-80 flex-col gap-2 overflow-y-auto",children:a.map(o=>{const i=!o.success,u=o.success&&o.totalLatencyMs>15e3,d=Ee("rounded-md border shadow-lg transition-all",i&&"bg-destructive text-destructive-foreground border-destructive",u&&"bg-amber-500/90 text-amber-950 border-amber-600/50",!i&&!u&&"bg-card text-card-foreground border-border");return s.jsxs(ur,{to:"/requests",className:Ee("block shrink-0 p-3 hover:opacity-95",d),children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[i?s.jsx(nC,{className:"h-4 w-4 shrink-0"}):o.success?s.jsx(Dc,{className:"h-4 w-4 shrink-0"}):s.jsx(jC,{className:"h-4 w-4 shrink-0 opacity-70"}),s.jsx("div",{className:"min-w-0 truncate text-sm font-medium",title:o.requestedModel,children:o.requestedModel})]}),s.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100",onClick:h=>{h.preventDefault(),h.stopPropagation(),l(o.id)},"aria-label":"Dismiss",type:"button",children:s.jsx(_c,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"mt-1 text-xs",children:[o.success?"Thành công":"Thất bại",!o.success&&o.errorType&&s.jsx("span",{className:"ml-1 inline-block rounded bg-black/15 px-1 py-0.5 align-text-bottom text-[10px]",children:o.errorType})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:["in ",Ot(o.inputTokens)," · out ",Ot(o.outputTokens),(o.cacheReadTokens>0||o.cacheWriteTokens>0)&&s.jsxs(s.Fragment,{children:[" · cache ",o.cacheReadTokens>0&&s.jsxs("span",{children:["r",Ot(o.cacheReadTokens)]}),o.cacheReadTokens>0&&o.cacheWriteTokens>0&&"/",o.cacheWriteTokens>0&&s.jsxs("span",{children:["w",Ot(o.cacheWriteTokens)]})]})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[dr(o.totalLatencyMs),o.ttftMs!=null&&o.ttftMs>=0&&s.jsxs("span",{children:[" · TTFT ",dr(o.ttftMs)]})]})]},o.id)})}):null}const uO=5e3,dO=8,fO=3e3;let hc=null;function hO(){try{hc||(hc=new Audio("/notification.mp3")),hc.currentTime=0,hc.play().catch(()=>{})}catch{}}function mO(){const[a,l]=m.useState([]),o=m.useRef(null),i=m.useRef(new Map),u=m.useRef(Date.now()),d=m.useRef(new Set),h=z1(),p=m.useRef(h.sound);p.current=h.sound,m.useEffect(()=>{k1()},[]);const g=h.enabled;return m.useEffect(()=>{var w;if(!g){(w=o.current)==null||w.close(),o.current=null;const C=i.current;for(const E of C.values())clearTimeout(E);C.clear(),l([]);return}let x=!1;const y=i.current,S=()=>{if(x)return;const C=new EventSource(`/api/admin/requests/stream?since=${u.current}`);o.current=C,C.addEventListener("request",E=>{if(!x)try{const j=JSON.parse(E.data),N=new Date(j.createdAt).getTime();if(Number.isFinite(N)&&(u.current=Math.max(u.current,N)),d.current.has(j.id))return;d.current.add(j.id),l(T=>T.some(O=>O.id===j.id)?T:[j,...T].slice(0,dO));const A=setTimeout(()=>{l(T=>T.filter(O=>O.id!==j.id)),y.delete(j.id)},uO);y.set(j.id,A),p.current&&hO()}catch{}}),C.onerror=()=>{C.close(),o.current=null,x||setTimeout(S,fO)}};return S(),()=>{var C;x=!0,(C=o.current)==null||C.close(),o.current=null;for(const E of y.values())clearTimeout(E);y.clear()}},[g]),{items:a,dismiss:x=>{const y=i.current.get(x);y&&(clearTimeout(y),i.current.delete(x)),l(S=>S.filter(w=>w.id!==x))}}}function pO({children:a}){const{user:l,loading:o}=Nh(),i=hn();return o?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):l?s.jsx(s.Fragment,{children:a}):s.jsx(qf,{to:"/login",state:{from:i},replace:!0})}function gO(){const{items:a,dismiss:l}=mO();return s.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[s.jsx(rE,{}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(sA,{}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsxs(Py,{children:[s.jsx(on,{index:!0,element:s.jsx(PA,{})}),s.jsx(on,{path:"/providers",element:s.jsx(hD,{})}),s.jsx(on,{path:"/models",element:s.jsx(jD,{})}),s.jsx(on,{path:"/combos",element:s.jsx(CD,{})}),s.jsx(on,{path:"/aliases",element:s.jsx(ED,{})}),s.jsx(on,{path:"/api-keys",element:s.jsx(RD,{})}),s.jsx(on,{path:"/requests",element:s.jsx(AD,{})}),s.jsx(on,{path:"/statistics",element:s.jsx(lO,{})}),s.jsx(on,{path:"/audit",element:s.jsx(rO,{})}),s.jsx(on,{path:"/settings/*",element:s.jsx(oO,{})})]})})]}),s.jsx(cO,{items:a,onDismiss:l})]})}function vO({children:a}){const[l,o]=m.useState(null),i=hn();return m.useEffect(()=>{Se.get("/api/admin/setup/status").then(u=>o(u.setupComplete)).catch(()=>o(!0))},[]),l===null?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):!l&&i.pathname!=="/setup"?s.jsx(qf,{to:"/setup",replace:!0}):l&&i.pathname==="/setup"?s.jsx(qf,{to:"/",replace:!0}):s.jsx(s.Fragment,{children:a})}function xO(){return s.jsx(K2,{children:s.jsx(vO,{children:s.jsxs(Py,{children:[s.jsx(on,{path:"/setup",element:s.jsx(BA,{})}),s.jsx(on,{path:"/login",element:s.jsx(UA,{})}),s.jsx(on,{path:"/*",element:s.jsx(pO,{children:s.jsx(gO,{})})})]})})})}const yO=LA;var bO=Object.defineProperty,dn=(a,l)=>bO(a,"name",{value:l,configurable:!0}),[Cm,JO]=mn("Tooltip",[Es]),SO=Es(),wO="TooltipProvider",jO=700,by="tooltip.open",[CO,EO]=Cm(wO),RO=dn(a=>{const{__scopeTooltip:l,delayDuration:o=jO,skipDelayDuration:i=300,disableHoverableContent:u=!1,children:d}=a,h=m.useRef(!0),p=m.useRef(!1),g=m.useRef(0);return m.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),s.jsx(CO,{scope:l,isOpenDelayedRef:h,delayDuration:o,onOpen:m.useCallback(()=>{i<=0||(window.clearTimeout(g.current),h.current=!1)},[i]),onClose:m.useCallback(()=>{i<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>h.current=!0,i))},[i]),isPointerInTransitRef:p,onPointerInTransitChange:m.useCallback(v=>{p.current=v},[]),disableHoverableContent:u,children:d})},"TooltipProvider"),NO="Tooltip",[WO,Em]=Cm(NO),TO="TooltipPortal",[e_,AO]=Cm(TO,{forceMount:void 0}),Ao="TooltipContent",MO=m.forwardRef(dn(function(l,o){const i=AO(Ao,l.__scopeTooltip),{forceMount:u=i.forceMount,side:d="top",...h}=l,p=Em(Ao,l.__scopeTooltip);return s.jsx(al,{present:u||p.open,children:p.disableHoverableContent?s.jsx(L1,{side:d,...h,ref:o}):s.jsx(DO,{side:d,...h,ref:o})})},"TooltipContent")),DO=m.forwardRef(dn(function(l,o){const i=Em(Ao,l.__scopeTooltip),u=EO(Ao,l.__scopeTooltip),d=m.useRef(null),h=Ge(o,d),[p,g]=m.useState(null),{trigger:v,onClose:x}=i,y=d.current,{onPointerInTransitChange:S}=u,w=m.useCallback(()=>{g(null),S(!1)},[S]),C=m.useCallback((E,j)=>{const N=E.currentTarget,A={x:E.clientX,y:E.clientY},T=U1(A,N.getBoundingClientRect()),O=B1(A,T),_=H1(j.getBoundingClientRect()),M=q1([...O,..._]);g(M),S(!0)},[S]);return m.useEffect(()=>()=>w(),[w]),m.useEffect(()=>{if(v&&y){const E=dn(N=>C(N,y),"handleTriggerLeave"),j=dn(N=>C(N,v),"handleContentLeave");return v.addEventListener("pointerleave",E),y.addEventListener("pointerleave",j),()=>{v.removeEventListener("pointerleave",E),y.removeEventListener("pointerleave",j)}}},[v,y,C,w]),m.useEffect(()=>{if(p){const E=dn(j=>{const N=j.target,A={x:j.clientX,y:j.clientY},T=(v==null?void 0:v.contains(N))||(y==null?void 0:y.contains(N)),O=!P1(A,p);T?w():O&&(w(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[v,y,p,x,w]),s.jsx(L1,{...l,ref:h})},"TooltipContentHoverable")),OO=cb("TooltipContent"),L1=m.forwardRef(dn(function(l,o){const{__scopeTooltip:i,children:u,"aria-label":d,id:h,onEscapeKeyDown:p,onPointerDownOutside:g,...v}=l,x=Em(Ao,i),y=SO(i),{onClose:S}=x;m.useEffect(()=>(document.addEventListener(by,S),()=>document.removeEventListener(by,S)),[S]),m.useEffect(()=>{if(x.trigger){const C=dn(E=>{E.target instanceof Node&&E.target.contains(x.trigger)&&S()},"handleScroll");return window.addEventListener("scroll",C,{capture:!0}),()=>window.removeEventListener("scroll",C,{capture:!0})}},[x.trigger,S]);const{setContentId:w}=x;return _t(()=>(w(h),()=>{w(void 0)}),[h,w]),s.jsx(Lc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:C=>C.preventDefault(),onDismiss:S,children:s.jsxs(Vh,{"data-state":x.stateAttribute,role:d?void 0:"tooltip",id:d?void 0:x.contentId,...y,...v,ref:o,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(OO,{children:u}),d?s.jsx(NM,{id:x.contentId,role:"tooltip",children:d}):null]})})},"TooltipContentImpl"));function U1(a,l){const o=Math.abs(l.top-a.y),i=Math.abs(l.bottom-a.y),u=Math.abs(l.right-a.x),d=Math.abs(l.left-a.x);switch(Math.min(o,i,u,d)){case d:return"left";case u:return"right";case o:return"top";case i:return"bottom";default:throw new Error("unreachable")}}dn(U1,"getExitSideFromRect");function B1(a,l,o=5){const i=[];switch(l){case"top":i.push({x:a.x-o,y:a.y+o},{x:a.x+o,y:a.y+o});break;case"bottom":i.push({x:a.x-o,y:a.y-o},{x:a.x+o,y:a.y-o});break;case"left":i.push({x:a.x+o,y:a.y-o},{x:a.x+o,y:a.y+o});break;case"right":i.push({x:a.x-o,y:a.y-o},{x:a.x-o,y:a.y+o});break}return i}dn(B1,"getPaddedExitPoints");function H1(a){const{top:l,right:o,bottom:i,left:u}=a;return[{x:u,y:l},{x:o,y:l},{x:o,y:i},{x:u,y:i}]}dn(H1,"getPointsFromRect");function P1(a,l){const{x:o,y:i}=a;let u=!1;for(let d=0,h=l.length-1;d<l.length;h=d++){const p=l[d],g=l[h],v=p.x,x=p.y,y=g.x,S=g.y;x>i!=S>i&&o<(y-v)*(i-x)/(S-x)+v&&(u=!u)}return u}dn(P1,"isPointInPolygon");function q1(a){const l=a.slice();return l.sort((o,i)=>o.x<i.x?-1:o.x>i.x?1:o.y<i.y?-1:o.y>i.y?1:0),I1(l)}dn(q1,"getHull");function I1(a){if(a.length<=1)return a.slice();const l=[];for(let i=0;i<a.length;i++){const u=a[i];for(;l.length>=2;){const d=l[l.length-1],h=l[l.length-2];if((d.x-h.x)*(u.y-h.y)>=(d.y-h.y)*(u.x-h.x))l.pop();else break}l.push(u)}l.pop();const o=[];for(let i=a.length-1;i>=0;i--){const u=a[i];for(;o.length>=2;){const d=o[o.length-1],h=o[o.length-2];if((d.x-h.x)*(u.y-h.y)>=(d.y-h.y)*(u.x-h.x))o.pop();else break}o.push(u)}return o.pop(),l.length===1&&o.length===1&&l[0].x===o[0].x&&l[0].y===o[0].y?l:l.concat(o)}dn(I1,"getHullPresorted");var _O=RO,V1=MO;const kO=_O,zO=m.forwardRef(({className:a,sideOffset:l=4,...o},i)=>s.jsx(V1,{ref:i,sideOffset:l,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",a),...o}));zO.displayName=V1.displayName;dj.createRoot(document.getElementById("root")).render(s.jsx(ie.StrictMode,{children:s.jsx(mE,{defaultTheme:"dark",storageKey:"latedev-theme",children:s.jsxs(kO,{children:[s.jsx(k2,{children:s.jsx(xO,{})}),s.jsx(yO,{position:"top-right"})]})})}));
|