ldrouter 1.10.2 → 1.11.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 +19 -0
- package/dist/server/app.js +4 -0
- package/dist/server/auth/api-key.js +2 -3
- package/dist/server/db/migrate.js +2 -0
- package/dist/server/db/repositories/settings.js +6 -0
- package/dist/server/db/schema.js +6 -1
- package/dist/server/gateway/events.js +15 -0
- package/dist/server/gateway/runner.js +11 -4
- package/dist/server/routes/admin/models.js +11 -1
- package/dist/server/routes/admin/requests.js +12 -1
- package/dist/server/routes/admin/settings.js +40 -2
- package/dist/server/security/admin-ip-gate.js +42 -0
- package/dist/server/security/redact.js +1 -1
- package/dist/server/upstream/client.js +22 -4
- package/dist/web/assets/index-CqVMNQ5F.css +1 -0
- package/dist/web/assets/index-DPH5tP2x.js +330 -0
- package/dist/web/index.html +2 -2
- package/migrations/0004_admin_ip_access.sql +2 -0
- package/package.json +1 -1
- package/dist/web/assets/index-BprlMazL.css +0 -1
- package/dist/web/assets/index-CHg2RW0K.js +0 -324
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
var vx=a=>{throw TypeError(a)};var xx=(a,l,o)=>l.has(a)||vx("Cannot "+o);var Gt=(a,l,o)=>(xx(a,l,"read from private field"),o?o.call(a):l.get(a)),yx=(a,l,o)=>l.has(a)?vx("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(a):l.set(a,o),mf=(a,l,o,i)=>(xx(a,l,"write to private field"),i?i.call(a,o):l.set(a,o),o);function ej(a,l){for(var o=0;o<l.length;o++){const i=l[o];if(typeof i!="string"&&!Array.isArray(i)){for(const c in i)if(c!=="default"&&!(c in a)){const d=Object.getOwnPropertyDescriptor(i,c);d&&Object.defineProperty(a,c,d.get?d:{enumerable:!0,get:()=>i[c]})}}}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 c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const d of c)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(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(c){if(c.ep)return;c.ep=!0;const d=o(c);fetch(c.href,d)}})();function gh(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var pf={exports:{}},go={};/**
|
|
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 bx;function tj(){if(bx)return go;bx=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(i,c,d){var h=null;if(d!==void 0&&(h=""+d),c.key!==void 0&&(h=""+c.key),"key"in c){d={};for(var m in c)m!=="key"&&(d[m]=c[m])}else d=c;return c=d.ref,{$$typeof:a,type:i,key:h,ref:c!==void 0?c:null,props:d}}return go.Fragment=l,go.jsx=o,go.jsxs=o,go}var Sx;function nj(){return Sx||(Sx=1,pf.exports=tj()),pf.exports}var s=nj(),gf={exports:{}},Te={};/**
|
|
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 wx;function aj(){if(wx)return Te;wx=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),x=Symbol.iterator;function w(D){return D===null||typeof D!="object"?null:(D=x&&D[x]||D["@@iterator"],typeof D=="function"?D:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function T(D,P,Q){this.props=D,this.context=P,this.refs=C,this.updater=Q||E}T.prototype.isReactComponent={},T.prototype.setState=function(D,P){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,P,"setState")},T.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function N(){}N.prototype=T.prototype;function M(D,P,Q){this.props=D,this.context=P,this.refs=C,this.updater=Q||E}var A=M.prototype=new N;A.constructor=M,j(A,T.prototype),A.isPureReactComponent=!0;var _=Array.isArray;function z(){}var q={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function W(D,P,Q){var ae=Q.ref;return{$$typeof:a,type:D,key:P,ref:ae!==void 0?ae:null,props:Q}}function re(D,P){return W(D.type,P,D.props)}function K(D){return typeof D=="object"&&D!==null&&D.$$typeof===a}function V(D){var P={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(Q){return P[Q]})}var le=/\/+/g;function se(D,P){return typeof D=="object"&&D!==null&&D.key!=null?V(""+D.key):P.toString(36)}function ce(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(z,z):(D.status="pending",D.then(function(P){D.status==="pending"&&(D.status="fulfilled",D.value=P)},function(P){D.status==="pending"&&(D.status="rejected",D.reason=P)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function U(D,P,Q,ae,de){var Z=typeof D;(Z==="undefined"||Z==="boolean")&&(D=null);var oe=!1;if(D===null)oe=!0;else switch(Z){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(D.$$typeof){case a:case l:oe=!0;break;case b:return oe=D._init,U(oe(D._payload),P,Q,ae,de)}}if(oe)return de=de(D),oe=ae===""?"."+se(D,0):ae,_(de)?(Q="",oe!=null&&(Q=oe.replace(le,"$&/")+"/"),U(de,P,Q,"",function(Re){return Re})):de!=null&&(K(de)&&(de=re(de,Q+(de.key==null||D&&D.key===de.key?"":(""+de.key).replace(le,"$&/")+"/")+oe)),P.push(de)),1;oe=0;var ie=ae===""?".":ae+":";if(_(D))for(var me=0;me<D.length;me++)ae=D[me],Z=ie+se(ae,me),oe+=U(ae,P,Q,Z,de);else if(me=w(D),typeof me=="function")for(D=me.call(D),me=0;!(ae=D.next()).done;)ae=ae.value,Z=ie+se(ae,me++),oe+=U(ae,P,Q,Z,de);else if(Z==="object"){if(typeof D.then=="function")return U(ce(D),P,Q,ae,de);throw P=String(D),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return oe}function $(D,P,Q){if(D==null)return D;var ae=[],de=0;return U(D,ae,"","",function(Z){return P.call(Q,Z,de++)}),ae}function ne(D){if(D._status===-1){var P=D._result;P=P(),P.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=P)}if(D._status===1)return D._result.default;throw D._result}var H=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=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(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},F={map:$,forEach:function(D,P,Q){$(D,function(){P.apply(this,arguments)},Q)},count:function(D){var P=0;return $(D,function(){P++}),P},toArray:function(D){return $(D,function(P){return P})||[]},only:function(D){if(!K(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Te.Activity=S,Te.Children=F,Te.Component=T,Te.Fragment=o,Te.Profiler=c,Te.PureComponent=M,Te.StrictMode=i,Te.Suspense=g,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,Te.__COMPILER_RUNTIME={__proto__:null,c:function(D){return q.H.useMemoCache(D)}},Te.cache=function(D){return function(){return D.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(D,P,Q){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ae=j({},D.props),de=D.key;if(P!=null)for(Z in P.key!==void 0&&(de=""+P.key),P)!k.call(P,Z)||Z==="key"||Z==="__self"||Z==="__source"||Z==="ref"&&P.ref===void 0||(ae[Z]=P[Z]);var Z=arguments.length-2;if(Z===1)ae.children=Q;else if(1<Z){for(var oe=Array(Z),ie=0;ie<Z;ie++)oe[ie]=arguments[ie+2];ae.children=oe}return W(D.type,de,ae)},Te.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},Te.createElement=function(D,P,Q){var ae,de={},Z=null;if(P!=null)for(ae in P.key!==void 0&&(Z=""+P.key),P)k.call(P,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(de[ae]=P[ae]);var oe=arguments.length-2;if(oe===1)de.children=Q;else if(1<oe){for(var ie=Array(oe),me=0;me<oe;me++)ie[me]=arguments[me+2];de.children=ie}if(D&&D.defaultProps)for(ae in oe=D.defaultProps,oe)de[ae]===void 0&&(de[ae]=oe[ae]);return W(D,Z,de)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(D){return{$$typeof:m,render:D}},Te.isValidElement=K,Te.lazy=function(D){return{$$typeof:b,_payload:{_status:-1,_result:D},_init:ne}},Te.memo=function(D,P){return{$$typeof:v,type:D,compare:P===void 0?null:P}},Te.startTransition=function(D){var P=q.T,Q={};q.T=Q;try{var ae=D(),de=q.S;de!==null&&de(Q,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(z,H)}catch(Z){H(Z)}finally{P!==null&&Q.types!==null&&(P.types=Q.types),q.T=P}},Te.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},Te.use=function(D){return q.H.use(D)},Te.useActionState=function(D,P,Q){return q.H.useActionState(D,P,Q)},Te.useCallback=function(D,P){return q.H.useCallback(D,P)},Te.useContext=function(D){return q.H.useContext(D)},Te.useDebugValue=function(){},Te.useDeferredValue=function(D,P){return q.H.useDeferredValue(D,P)},Te.useEffect=function(D,P){return q.H.useEffect(D,P)},Te.useEffectEvent=function(D){return q.H.useEffectEvent(D)},Te.useId=function(){return q.H.useId()},Te.useImperativeHandle=function(D,P,Q){return q.H.useImperativeHandle(D,P,Q)},Te.useInsertionEffect=function(D,P){return q.H.useInsertionEffect(D,P)},Te.useLayoutEffect=function(D,P){return q.H.useLayoutEffect(D,P)},Te.useMemo=function(D,P){return q.H.useMemo(D,P)},Te.useOptimistic=function(D,P){return q.H.useOptimistic(D,P)},Te.useReducer=function(D,P,Q){return q.H.useReducer(D,P,Q)},Te.useRef=function(D){return q.H.useRef(D)},Te.useState=function(D){return q.H.useState(D)},Te.useSyncExternalStore=function(D,P,Q){return q.H.useSyncExternalStore(D,P,Q)},Te.useTransition=function(){return q.H.useTransition()},Te.version="19.2.8",Te}var jx;function vh(){return jx||(jx=1,gf.exports=aj()),gf.exports}var p=vh();const ue=gh(p),ps=ej({__proto__:null,default:ue},[p]);var vf={exports:{}},vo={},xf={exports:{}},yf={};/**
|
|
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 Cx;function lj(){return Cx||(Cx=1,(function(a){function l(U,$){var ne=U.length;U.push($);e:for(;0<ne;){var H=ne-1>>>1,F=U[H];if(0<c(F,$))U[H]=$,U[ne]=F,ne=H;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 H=0,F=U.length,D=F>>>1;H<D;){var P=2*(H+1)-1,Q=U[P],ae=P+1,de=U[ae];if(0>c(Q,ne))ae<F&&0>c(de,Q)?(U[H]=de,U[ae]=ne,H=ae):(U[H]=Q,U[P]=ne,H=P);else if(ae<F&&0>c(de,ne))U[H]=de,U[ae]=ne,H=ae;else break e}}return $}function c(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,m=h.now();a.unstable_now=function(){return h.now()-m}}var g=[],v=[],b=1,S=null,x=3,w=!1,E=!1,j=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function A(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(j=!1,A(U),!E)if(o(g)!==null)E=!0,z||(z=!0,V());else{var $=o(v);$!==null&&ce(_,$.startTime-U)}}var z=!1,q=-1,k=5,W=-1;function re(){return C?!0:!(a.unstable_now()-W<k)}function K(){if(C=!1,z){var U=a.unstable_now();W=U;var $=!0;try{e:{E=!1,j&&(j=!1,N(q),q=-1),w=!0;var ne=x;try{t:{for(A(U),S=o(g);S!==null&&!(S.expirationTime>U&&re());){var H=S.callback;if(typeof H=="function"){S.callback=null,x=S.priorityLevel;var F=H(S.expirationTime<=U);if(U=a.unstable_now(),typeof F=="function"){S.callback=F,A(U),$=!0;break t}S===o(g)&&i(g),A(U)}else i(g);S=o(g)}if(S!==null)$=!0;else{var D=o(v);D!==null&&ce(_,D.startTime-U),$=!1}}break e}finally{S=null,x=ne,w=!1}$=void 0}}finally{$?V():z=!1}}}var V;if(typeof M=="function")V=function(){M(K)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,se=le.port2;le.port1.onmessage=K,V=function(){se.postMessage(null)}}else V=function(){T(K,0)};function ce(U,$){q=T(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"):k=0<U?Math.floor(1e3/U):5},a.unstable_getCurrentPriorityLevel=function(){return x},a.unstable_next=function(U){switch(x){case 1:case 2:case 3:var $=3;break;default:$=x}var ne=x;x=$;try{return U()}finally{x=ne}},a.unstable_requestPaint=function(){C=!0},a.unstable_runWithPriority=function(U,$){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ne=x;x=U;try{return $()}finally{x=ne}},a.unstable_scheduleCallback=function(U,$,ne){var H=a.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?H+ne:H):ne=H,U){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=ne+F,U={id:b++,callback:$,priorityLevel:U,startTime:ne,expirationTime:F,sortIndex:-1},ne>H?(U.sortIndex=ne,l(v,U),o(g)===null&&U===o(v)&&(j?(N(q),q=-1):j=!0,ce(_,ne-H))):(U.sortIndex=F,l(g,U),E||w||(E=!0,z||(z=!0,V()))),U},a.unstable_shouldYield=re,a.unstable_wrapCallback=function(U){var $=x;return function(){var ne=x;x=$;try{return U.apply(this,arguments)}finally{x=ne}}}})(yf)),yf}var Ex;function rj(){return Ex||(Ex=1,xf.exports=lj()),xf.exports}var bf={exports:{}},Yt={};/**
|
|
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 Rx;function sj(){if(Rx)return Yt;Rx=1;var a=vh();function l(g){var v="https://react.dev/errors/"+g;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)v+="&args[]="+encodeURIComponent(arguments[b])}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},c=Symbol.for("react.portal");function d(g,v,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:S==null?null:""+S,children:g,containerInfo:v,implementation:b}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return Yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Yt.createPortal=function(g,v){var b=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,b)},Yt.flushSync=function(g){var v=h.T,b=i.p;try{if(h.T=null,i.p=2,g)return g()}finally{h.T=v,i.p=b,i.d.f()}},Yt.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))},Yt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Yt.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var b=v.as,S=m(b,v.crossOrigin),x=typeof v.integrity=="string"?v.integrity:void 0,w=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;b==="style"?i.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:S,integrity:x,fetchPriority:w}):b==="script"&&i.d.X(g,{crossOrigin:S,integrity:x,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},Yt.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var b=m(v.as,v.crossOrigin);i.d.M(g,{crossOrigin:b,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)},Yt.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var b=v.as,S=m(b,v.crossOrigin);i.d.L(g,b,{crossOrigin:S,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})}},Yt.preloadModule=function(g,v){if(typeof g=="string")if(v){var b=m(v.as,v.crossOrigin);i.d.m(g,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else i.d.m(g)},Yt.requestFormReset=function(g){i.d.r(g)},Yt.unstable_batchedUpdates=function(g,v){return g(v)},Yt.useFormState=function(g,v,b){return h.H.useFormState(g,v,b)},Yt.useFormStatus=function(){return h.H.useHostTransitionStatus()},Yt.version="19.2.8",Yt}var Nx;function by(){if(Nx)return bf.exports;Nx=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(),bf.exports=sj(),bf.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 Tx;function oj(){if(Tx)return vo;Tx=1;var a=rj(),l=vh(),o=by();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 c(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 m(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 u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(r=u.return,r!==null){n=r;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return g(u),e;if(f===r)return g(u),t;f=f.sibling}throw Error(i(188))}if(n.return!==r.return)n=u,r=f;else{for(var y=!1,R=u.child;R;){if(R===n){y=!0,n=u,r=f;break}if(R===r){y=!0,r=u,n=f;break}R=R.sibling}if(!y){for(R=f.child;R;){if(R===n){y=!0,n=f,r=u;break}if(R===r){y=!0,r=f,n=u;break}R=R.sibling}if(!y)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 b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var S=Object.assign,x=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),M=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),re=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function V(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var le=Symbol.for("react.client.reference");function se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case T:return"Profiler";case C:return"StrictMode";case _:return"Suspense";case z:return"SuspenseList";case W:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case M:return e.displayName||"Context";case N:return(e._context.displayName||"Context")+".Consumer";case A:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return t=e.displayName||null,t!==null?t:se(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=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},H=[],F=-1;function D(e){return{current:e}}function P(e){0>F||(e.current=H[F],H[F]=null,F--)}function Q(e,t){F++,H[F]=e.current,e.current=t}var ae=D(null),de=D(null),Z=D(null),oe=D(null);function ie(e,t){switch(Q(Z,t),Q(de,e),Q(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Pv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Pv(t),e=qv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(ae),Q(ae,e)}function me(){P(ae),P(de),P(Z)}function Re(e){e.memoizedState!==null&&Q(oe,e);var t=ae.current,n=qv(t,e.type);t!==n&&(Q(de,e),Q(ae,n))}function Ae(e){de.current===e&&(P(ae),P(de)),oe.current===e&&(P(oe),fo._currentValue=ne)}var Me,He;function mt(e){if(Me===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Me=t&&t[1]||"",He=-1<n.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Me+e+He}var pt=!1;function bt(e,t){if(!e||pt)return"";pt=!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(X){var Y=X}Reflect.construct(e,[],te)}else{try{te.call()}catch(X){Y=X}e.call(te.prototype)}}else{try{throw Error()}catch(X){Y=X}(te=e())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(X){if(X&&Y&&typeof X.stack=="string")return[X.stack,Y.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=r.DetermineComponentFrameRoot(),y=f[0],R=f[1];if(y&&R){var O=y.split(`
|
|
44
|
-
`),G=R.split(`
|
|
45
|
-
`);for(u=r=0;r<O.length&&!O[r].includes("DetermineComponentFrameRoot");)r++;for(;u<G.length&&!G[u].includes("DetermineComponentFrameRoot");)u++;if(r===O.length||u===G.length)for(r=O.length-1,u=G.length-1;1<=r&&0<=u&&O[r]!==G[u];)u--;for(;1<=r&&0<=u;r--,u--)if(O[r]!==G[u]){if(r!==1||u!==1)do if(r--,u--,0>u||O[r]!==G[u]){var J=`
|
|
46
|
-
`+O[r].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=r&&0<=u);break}}}finally{pt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?mt(n):""}function St(e,t){switch(e.tag){case 26:case 27:case 5:return mt(e.type);case 16:return mt("Lazy");case 13:return e.child!==t&&t!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("SuspenseList");case 0:case 15:return bt(e.type,!1);case 11:return bt(e.type.render,!1);case 1:return bt(e.type,!0);case 31:return mt("Activity");default:return""}}function Lt(e){try{var t="",n=null;do t+=St(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
|
|
47
|
-
Error generating stack: `+r.message+`
|
|
48
|
-
`+r.stack}}var fn=Object.prototype.hasOwnProperty,Qn=a.unstable_scheduleCallback,hn=a.unstable_cancelCallback,ja=a.unstable_shouldYield,Ca=a.unstable_requestPaint,$t=a.unstable_now,Zc=a.unstable_getCurrentPriorityLevel,Kt=a.unstable_ImmediatePriority,Ea=a.unstable_UserBlockingPriority,br=a.unstable_NormalPriority,Jc=a.unstable_LowPriority,ql=a.unstable_IdlePriority,Wc=a.log,Po=a.unstable_setDisableYieldValue,Ra=null,wt=null;function Zn(e){if(typeof Wc=="function"&&Po(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Ra,e)}catch{}}var jt=Math.clz32?Math.clz32:qo,eu=Math.log,tu=Math.LN2;function qo(e){return e>>>=0,e===0?32:31-(eu(e)/tu|0)|0}var Vl=256,Sr=262144,rl=4194304;function It(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function wr(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var u=0,f=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var R=r&134217727;return R!==0?(r=R&~f,r!==0?u=It(r):(y&=R,y!==0?u=It(y):n||(n=R&~e,n!==0&&(u=It(n))))):(R=r&~f,R!==0?u=It(R):y!==0?u=It(y):n||(n=r&~e,n!==0&&(u=It(n)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,n=t&-t,f>=n||f===32&&(n&4194048)!==0)?t:u}function Ee(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function st(){var e=rl;return rl<<=1,(rl&62914560)===0&&(rl=4194304),e}function Xt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ut(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function oa(e,t,n,r,u,f){var y=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,O=e.expirationTimes,G=e.hiddenUpdates;for(n=y&~n;0<n;){var J=31-jt(n),te=1<<J;R[J]=0,O[J]=-1;var Y=G[J];if(Y!==null)for(G[J]=null,J=0;J<Y.length;J++){var X=Y[J];X!==null&&(X.lane&=-536870913)}n&=~te}r!==0&&ia(e,r,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(y&~t))}function ia(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-jt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Zt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-jt(n),u=1<<r;u&t|e[r]&t&&(e[r]|=t),n&=~u}}function Jn(e,t){var n=t&-t;return n=(n&42)!==0?1:nu(n),(n&(e.suspendedLanes|t))!==0?0:n}function nu(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 au(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Em(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:ux(e.type))}function Rm(e,t){var n=$.p;try{return $.p=e,t()}finally{$.p=n}}var sl=Math.random().toString(36).slice(2),Ht="__reactFiber$"+sl,Jt="__reactProps$"+sl,jr="__reactContainer$"+sl,lu="__reactEvents$"+sl,I1="__reactListeners$"+sl,G1="__reactHandles$"+sl,Nm="__reactResources$"+sl,Rs="__reactMarker$"+sl;function ru(e){delete e[Ht],delete e[Jt],delete e[lu],delete e[I1],delete e[G1]}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=Xv(e);e!==null;){if(n=e[Ht])return n;e=Xv(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 Ns(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[Nm];return t||(t=e[Nm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Dt(e){e[Rs]=!0}var Tm=new Set,Mm={};function Il(e,t){Nr(e,t),Nr(e+"Capture",t)}function Nr(e,t){for(Mm[e]=t,e=0;e<t.length;e++)Tm.add(t[e])}var Y1=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]*$"),Am={},_m={};function $1(e){return fn.call(_m,e)?!0:fn.call(Am,e)?!1:Y1.test(e)?_m[e]=!0:(Am[e]=!0,!1)}function Vo(e,t,n){if($1(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 Io(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 An(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Dm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function K1(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 u=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(y){n=""+y,f.call(this,y)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(y){n=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function su(e){if(!e._valueTracker){var t=Dm(e)?"checked":"value";e._valueTracker=K1(e,t,""+e[t])}}function Om(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Dm(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 X1=/[\n"\\]/g;function _n(e){return e.replace(X1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ou(e,t,n,r,u,f,y,R){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+An(t)):e.value!==""+An(t)&&(e.value=""+An(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?iu(e,y,An(t)):n!=null?iu(e,y,An(n)):r!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+An(R):e.removeAttribute("name")}function km(e,t,n,r,u,f,y,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)){su(e);return}n=n!=null?""+An(n):"",t=t!=null?""+An(t):n,R||t===e.value||(e.value=t),e.defaultValue=t}r=r??u,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=R?e.checked:!!r,e.defaultChecked=!!r,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),su(e)}function iu(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 u=0;u<n.length;u++)t["$"+n[u]]=!0;for(n=0;n<e.length;n++)u=t.hasOwnProperty("$"+e[n].value),e[n].selected!==u&&(e[n].selected=u),u&&r&&(e[n].defaultSelected=!0)}else{for(n=""+An(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,r&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function zm(e,t,n){if(t!=null&&(t=""+An(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+An(n):""}function Lm(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ce(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=An(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),su(e)}function Mr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var F1=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 Um(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||F1.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 u in t)r=t[u],t.hasOwnProperty(u)&&n[u]!==r&&Um(e,u,r)}else for(var f in t)t.hasOwnProperty(f)&&Um(e,f,t[f])}function cu(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 Q1=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"]]),Z1=/^[\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 Z1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ta(){}var uu=null;function du(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ar=null,_r=null;function Bm(e){var t=Er(e);if(t&&(e=t.stateNode)){var n=e[Jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ou(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="'+_n(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var u=r[Jt]||null;if(!u)throw Error(i(90));ou(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Om(r)}break e;case"textarea":zm(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Tr(e,!!n.multiple,t,!1)}}}var fu=!1;function Pm(e,t,n){if(fu)return e(t,n);fu=!0;try{var r=e(t);return r}finally{if(fu=!1,(Ar!==null||_r!==null)&&(Di(),Ar&&(t=Ar,e=_r,_r=Ar=null,Bm(t),e)))for(t=0;t<e.length;t++)Bm(e[t])}}function Ts(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Jt]||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 Ma=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hu=!1;if(Ma)try{var Ms={};Object.defineProperty(Ms,"passive",{get:function(){hu=!0}}),window.addEventListener("test",Ms,Ms),window.removeEventListener("test",Ms,Ms)}catch{hu=!1}var ol=null,mu=null,$o=null;function qm(){if($o)return $o;var e,t=mu,n=t.length,r,u="value"in ol?ol.value:ol.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var y=n-e;for(r=1;r<=y&&t[n-r]===u[f-r];r++);return $o=u.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 Wt(e){function t(n,r,u,f,y){this._reactName=n,this._targetInst=u,this.type=r,this.nativeEvent=f,this.target=y,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 S(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 Gl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fo=Wt(Gl),As=S({},Gl,{view:0,detail:0}),J1=Wt(As),pu,gu,_s,Qo=S({},As,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xu,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!==_s&&(_s&&e.type==="mousemove"?(pu=e.screenX-_s.screenX,gu=e.screenY-_s.screenY):gu=pu=0,_s=e),pu)},movementY:function(e){return"movementY"in e?e.movementY:gu}}),Im=Wt(Qo),W1=S({},Qo,{dataTransfer:0}),eS=Wt(W1),tS=S({},As,{relatedTarget:0}),vu=Wt(tS),nS=S({},Gl,{animationName:0,elapsedTime:0,pseudoElement:0}),aS=Wt(nS),lS=S({},Gl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rS=Wt(lS),sS=S({},Gl,{data:0}),Gm=Wt(sS),oS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iS={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"},cS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cS[e])?!!t[e]:!1}function xu(){return uS}var dS=S({},As,{key:function(e){if(e.key){var t=oS[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"?iS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xu,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}}),fS=Wt(dS),hS=S({},Qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ym=Wt(hS),mS=S({},As,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xu}),pS=Wt(mS),gS=S({},Gl,{propertyName:0,elapsedTime:0,pseudoElement:0}),vS=Wt(gS),xS=S({},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}),yS=Wt(xS),bS=S({},Gl,{newState:0,oldState:0}),SS=Wt(bS),wS=[9,13,27,32],yu=Ma&&"CompositionEvent"in window,Ds=null;Ma&&"documentMode"in document&&(Ds=document.documentMode);var jS=Ma&&"TextEvent"in window&&!Ds,$m=Ma&&(!yu||Ds&&8<Ds&&11>=Ds),Km=" ",Xm=!1;function Fm(e,t){switch(e){case"keyup":return wS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dr=!1;function CS(e,t){switch(e){case"compositionend":return Qm(t);case"keypress":return t.which!==32?null:(Xm=!0,Km);case"textInput":return e=t.data,e===Km&&Xm?null:e;default:return null}}function ES(e,t){if(Dr)return e==="compositionend"||!yu&&Fm(e,t)?(e=qm(),$o=mu=ol=null,Dr=!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 $m&&t.locale!=="ko"?null:t.data;default:return null}}var RS={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 Zm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!RS[e.type]:t==="textarea"}function Jm(e,t,n,r){Ar?_r?_r.push(r):_r=[r]:Ar=r,t=Bi(t,"onChange"),0<t.length&&(n=new Fo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Os=null,ks=null;function NS(e){kv(e,0)}function Zo(e){var t=Ns(e);if(Om(t))return e}function Wm(e,t){if(e==="change")return t}var ep=!1;if(Ma){var bu;if(Ma){var Su="oninput"in document;if(!Su){var tp=document.createElement("div");tp.setAttribute("oninput","return;"),Su=typeof tp.oninput=="function"}bu=Su}else bu=!1;ep=bu&&(!document.documentMode||9<document.documentMode)}function np(){Os&&(Os.detachEvent("onpropertychange",ap),ks=Os=null)}function ap(e){if(e.propertyName==="value"&&Zo(ks)){var t=[];Jm(t,ks,e,du(e)),Pm(NS,t)}}function TS(e,t,n){e==="focusin"?(np(),Os=t,ks=n,Os.attachEvent("onpropertychange",ap)):e==="focusout"&&np()}function MS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zo(ks)}function AS(e,t){if(e==="click")return Zo(t)}function _S(e,t){if(e==="input"||e==="change")return Zo(t)}function DS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mn=typeof Object.is=="function"?Object.is:DS;function zs(e,t){if(mn(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 u=n[r];if(!fn.call(t,u)||!mn(e[u],t[u]))return!1}return!0}function lp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rp(e,t){var n=lp(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=lp(n)}}function sp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function op(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 wu(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 OS=Ma&&"documentMode"in document&&11>=document.documentMode,Or=null,ju=null,Ls=null,Cu=!1;function ip(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Cu||Or==null||Or!==Go(r)||(r=Or,"selectionStart"in r&&wu(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}),Ls&&zs(Ls,r)||(Ls=r,r=Bi(ju,"onSelect"),0<r.length&&(t=new Fo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Or)))}function Yl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var kr={animationend:Yl("Animation","AnimationEnd"),animationiteration:Yl("Animation","AnimationIteration"),animationstart:Yl("Animation","AnimationStart"),transitionrun:Yl("Transition","TransitionRun"),transitionstart:Yl("Transition","TransitionStart"),transitioncancel:Yl("Transition","TransitionCancel"),transitionend:Yl("Transition","TransitionEnd")},Eu={},cp={};Ma&&(cp=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 $l(e){if(Eu[e])return Eu[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in cp)return Eu[e]=t[n];return e}var up=$l("animationend"),dp=$l("animationiteration"),fp=$l("animationstart"),kS=$l("transitionrun"),zS=$l("transitionstart"),LS=$l("transitioncancel"),hp=$l("transitionend"),mp=new Map,Ru="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(" ");Ru.push("scrollEnd");function Wn(e,t){mp.set(e,t),Il(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)},Dn=[],zr=0,Nu=0;function Wo(){for(var e=zr,t=Nu=zr=0;t<e;){var n=Dn[t];Dn[t++]=null;var r=Dn[t];Dn[t++]=null;var u=Dn[t];Dn[t++]=null;var f=Dn[t];if(Dn[t++]=null,r!==null&&u!==null){var y=r.pending;y===null?u.next=u:(u.next=y.next,y.next=u),r.pending=u}f!==0&&pp(n,u,f)}}function ei(e,t,n,r){Dn[zr++]=e,Dn[zr++]=t,Dn[zr++]=n,Dn[zr++]=r,Nu|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Tu(e,t,n,r){return ei(e,t,n,r),ti(e)}function Kl(e,t){return ei(e,null,null,t),ti(e)}function pp(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var u=!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||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-jt(n),e=f.hiddenUpdates,r=e[u],r===null?e[u]=[t]:r.push(t),t.lane=n|536870912),f):null}function ti(e){if(50<lo)throw lo=0,Ud=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 US(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 pn(e,t,n,r){return new US(e,t,n,r)}function Mu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Aa(e,t){var n=e.alternate;return n===null?(n=pn(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 gp(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,u,f){var y=0;if(r=e,typeof e=="function")Mu(e)&&(y=1);else if(typeof e=="string")y=Vw(e,n,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case W:return e=pn(31,n,t,u),e.elementType=W,e.lanes=f,e;case j:return Xl(n.children,u,f,t);case C:y=8,u|=24;break;case T:return e=pn(12,n,t,u|2),e.elementType=T,e.lanes=f,e;case _:return e=pn(13,n,t,u),e.elementType=_,e.lanes=f,e;case z:return e=pn(19,n,t,u),e.elementType=z,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case M:y=10;break e;case N:y=9;break e;case A:y=11;break e;case q:y=14;break e;case k:y=16,r=null;break e}y=29,n=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=pn(y,n,t,u),t.elementType=e,t.type=r,t.lanes=f,t}function Xl(e,t,n,r){return e=pn(7,e,r,t),e.lanes=n,e}function Au(e,t,n){return e=pn(6,e,null,t),e.lanes=n,e}function vp(e){var t=pn(18,null,null,0);return t.stateNode=e,t}function _u(e,t,n){return t=pn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xp=new WeakMap;function On(e,t){if(typeof e=="object"&&e!==null){var n=xp.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Lt(t)},xp.set(e,t),t)}return{value:e,source:t,stack:Lt(t)}}var Ur=[],Hr=0,ai=null,Us=0,kn=[],zn=0,il=null,ca=1,ua="";function _a(e,t){Ur[Hr++]=Us,Ur[Hr++]=ai,ai=e,Us=t}function yp(e,t,n){kn[zn++]=ca,kn[zn++]=ua,kn[zn++]=il,il=e;var r=ca;e=ua;var u=32-jt(r)-1;r&=~(1<<u),n+=1;var f=32-jt(t)+u;if(30<f){var y=u-u%5;f=(r&(1<<y)-1).toString(32),r>>=y,u-=y,ca=1<<32-jt(t)+u|n<<u|r,ua=f+e}else ca=1<<f|n<<u|r,ua=e}function Du(e){e.return!==null&&(_a(e,1),yp(e,1,0))}function Ou(e){for(;e===ai;)ai=Ur[--Hr],Ur[Hr]=null,Us=Ur[--Hr],Ur[Hr]=null;for(;e===il;)il=kn[--zn],kn[zn]=null,ua=kn[--zn],kn[zn]=null,ca=kn[--zn],kn[zn]=null}function bp(e,t){kn[zn++]=ca,kn[zn++]=ua,kn[zn++]=il,ca=t.id,ua=t.overflow,il=e}var Bt=null,ct=null,qe=!1,cl=null,Ln=!1,ku=Error(i(519));function ul(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hs(On(t,e)),ku}function Sp(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ht]=e,t[Jt]=r,n){case"dialog":Le("cancel",t),Le("close",t);break;case"iframe":case"object":case"embed":Le("load",t);break;case"video":case"audio":for(n=0;n<so.length;n++)Le(so[n],t);break;case"source":Le("error",t);break;case"img":case"image":case"link":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"input":Le("invalid",t),km(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Le("invalid",t);break;case"textarea":Le("invalid",t),Lm(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&&(Le("beforetoggle",t),Le("toggle",t)),r.onScroll!=null&&Le("scroll",t),r.onScrollEnd!=null&&Le("scrollend",t),r.onClick!=null&&(t.onclick=Ta),t=!0):t=!1,t||ul(e,!0)}function wp(e){for(Bt=e.return;Bt;)switch(Bt.tag){case 5:case 31:case 13:Ln=!1;return;case 27:case 3:Ln=!0;return;default:Bt=Bt.return}}function Br(e){if(e!==Bt)return!1;if(!qe)return wp(e),qe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Jd(e.type,e.memoizedProps)),n=!n),n&&ct&&ul(e),wp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ct=Kv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ct=Kv(e)}else t===27?(t=ct,Cl(e.type)?(e=af,af=null,ct=e):ct=t):ct=Bt?Hn(e.stateNode.nextSibling):null;return!0}function Fl(){ct=Bt=null,qe=!1}function zu(){var e=cl;return e!==null&&(an===null?an=e:an.push.apply(an,e),cl=null),e}function Hs(e){cl===null?cl=[e]:cl.push(e)}var Lu=D(null),Ql=null,Da=null;function dl(e,t,n){Q(Lu,t._currentValue),t._currentValue=n}function Oa(e){e._currentValue=Lu.current,P(Lu)}function Uu(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 u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var y=u.child;f=f.firstContext;e:for(;f!==null;){var R=f;f=u;for(var O=0;O<t.length;O++)if(R.context===t[O]){f.lanes|=n,R=f.alternate,R!==null&&(R.lanes|=n),Uu(f.return,n,e),r||(y=null);break e}f=R.next}}else if(u.tag===18){if(y=u.return,y===null)throw Error(i(341));y.lanes|=n,f=y.alternate,f!==null&&(f.lanes|=n),Uu(y,n,e),y=null}else y=u.child;if(y!==null)y.return=u;else for(y=u;y!==null;){if(y===e){y=null;break}if(u=y.sibling,u!==null){u.return=y.return,y=u;break}y=y.return}u=y}}function Pr(e,t,n,r){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var y=u.alternate;if(y===null)throw Error(i(387));if(y=y.memoizedProps,y!==null){var R=u.type;mn(u.pendingProps.value,y.value)||(e!==null?e.push(R):e=[R])}}else if(u===oe.current){if(y=u.alternate,y===null)throw Error(i(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(fo):e=[fo])}u=u.return}e!==null&&Hu(t,e,n,r),t.flags|=262144}function li(e){for(e=e.firstContext;e!==null;){if(!mn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zl(e){Ql=e,Da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pt(e){return jp(Ql,e)}function ri(e,t){return Ql===null&&Zl(e),jp(e,t)}function jp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Da===null){if(e===null)throw Error(i(308));Da=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Da=Da.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()})}},BS=a.unstable_scheduleCallback,PS=a.unstable_NormalPriority,Ct={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bu(){return{controller:new HS,data:new Map,refCount:0}}function Bs(e){e.refCount--,e.refCount===0&&BS(PS,function(){e.controller.abort()})}var Ps=null,Pu=0,qr=0,Vr=null;function qS(e,t){if(Ps===null){var n=Ps=[];Pu=0,qr=Id(),Vr={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Pu++,t.then(Cp,Cp),t}function Cp(){if(--Pu===0&&Ps!==null){Vr!==null&&(Vr.status="fulfilled");var e=Ps;Ps=null,qr=0,Vr=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(u){n.push(u)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(r.status="rejected",r.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),r}var Ep=U.S;U.S=function(e,t){iv=$t(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&qS(e,t),Ep!==null&&Ep(e,t)};var Jl=D(null);function qu(){var e=Jl.current;return e!==null?e:ot.pooledCache}function si(e,t){t===null?Q(Jl,Jl.current):Q(Jl,t.pool)}function Rp(){var e=qu();return e===null?null:{parent:Ct._currentValue,pool:e}}var Ir=Error(i(460)),Vu=Error(i(474)),oi=Error(i(542)),ii={then:function(){}};function Np(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Tp(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,Ap(e),e;default:if(typeof t.status=="string")t.then(Ta,Ta);else{if(e=ot,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=r}},function(r){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ap(e),e}throw er=t,Ir}}function Wl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(er=n,Ir):n}}var er=null;function Mp(){if(er===null)throw Error(i(459));var e=er;return er=null,e}function Ap(e){if(e===Ir||e===oi)throw Error(i(483))}var Gr=null,qs=0;function ci(e){var t=qs;return qs+=1,Gr===null&&(Gr=[]),Tp(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===x?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function _p(e){function t(B,L){if(e){var I=B.deletions;I===null?(B.deletions=[L],B.flags|=16):I.push(L)}}function n(B,L){if(!e)return null;for(;L!==null;)t(B,L),L=L.sibling;return null}function r(B){for(var L=new Map;B!==null;)B.key!==null?L.set(B.key,B):L.set(B.index,B),B=B.sibling;return L}function u(B,L){return B=Aa(B,L),B.index=0,B.sibling=null,B}function f(B,L,I){return B.index=I,e?(I=B.alternate,I!==null?(I=I.index,I<L?(B.flags|=67108866,L):I):(B.flags|=67108866,L)):(B.flags|=1048576,L)}function y(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function R(B,L,I,ee){return L===null||L.tag!==6?(L=Au(I,B.mode,ee),L.return=B,L):(L=u(L,I),L.return=B,L)}function O(B,L,I,ee){var be=I.type;return be===j?J(B,L,I.props.children,ee,I.key):L!==null&&(L.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===k&&Wl(be)===L.type)?(L=u(L,I.props),Vs(L,I),L.return=B,L):(L=ni(I.type,I.key,I.props,null,B.mode,ee),Vs(L,I),L.return=B,L)}function G(B,L,I,ee){return L===null||L.tag!==4||L.stateNode.containerInfo!==I.containerInfo||L.stateNode.implementation!==I.implementation?(L=_u(I,B.mode,ee),L.return=B,L):(L=u(L,I.children||[]),L.return=B,L)}function J(B,L,I,ee,be){return L===null||L.tag!==7?(L=Xl(I,B.mode,ee,be),L.return=B,L):(L=u(L,I),L.return=B,L)}function te(B,L,I){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Au(""+L,B.mode,I),L.return=B,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case w:return I=ni(L.type,L.key,L.props,null,B.mode,I),Vs(I,L),I.return=B,I;case E:return L=_u(L,B.mode,I),L.return=B,L;case k:return L=Wl(L),te(B,L,I)}if(ce(L)||V(L))return L=Xl(L,B.mode,I,null),L.return=B,L;if(typeof L.then=="function")return te(B,ci(L),I);if(L.$$typeof===M)return te(B,ri(B,L),I);ui(B,L)}return null}function Y(B,L,I,ee){var be=L!==null?L.key:null;if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return be!==null?null:R(B,L,""+I,ee);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case w:return I.key===be?O(B,L,I,ee):null;case E:return I.key===be?G(B,L,I,ee):null;case k:return I=Wl(I),Y(B,L,I,ee)}if(ce(I)||V(I))return be!==null?null:J(B,L,I,ee,null);if(typeof I.then=="function")return Y(B,L,ci(I),ee);if(I.$$typeof===M)return Y(B,L,ri(B,I),ee);ui(B,I)}return null}function X(B,L,I,ee,be){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return B=B.get(I)||null,R(L,B,""+ee,be);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case w:return B=B.get(ee.key===null?I:ee.key)||null,O(L,B,ee,be);case E:return B=B.get(ee.key===null?I:ee.key)||null,G(L,B,ee,be);case k:return ee=Wl(ee),X(B,L,I,ee,be)}if(ce(ee)||V(ee))return B=B.get(I)||null,J(L,B,ee,be,null);if(typeof ee.then=="function")return X(B,L,I,ci(ee),be);if(ee.$$typeof===M)return X(B,L,I,ri(L,ee),be);ui(L,ee)}return null}function ge(B,L,I,ee){for(var be=null,Ie=null,ve=L,De=L=0,Pe=null;ve!==null&&De<I.length;De++){ve.index>De?(Pe=ve,ve=null):Pe=ve.sibling;var Ge=Y(B,ve,I[De],ee);if(Ge===null){ve===null&&(ve=Pe);break}e&&ve&&Ge.alternate===null&&t(B,ve),L=f(Ge,L,De),Ie===null?be=Ge:Ie.sibling=Ge,Ie=Ge,ve=Pe}if(De===I.length)return n(B,ve),qe&&_a(B,De),be;if(ve===null){for(;De<I.length;De++)ve=te(B,I[De],ee),ve!==null&&(L=f(ve,L,De),Ie===null?be=ve:Ie.sibling=ve,Ie=ve);return qe&&_a(B,De),be}for(ve=r(ve);De<I.length;De++)Pe=X(ve,B,De,I[De],ee),Pe!==null&&(e&&Pe.alternate!==null&&ve.delete(Pe.key===null?De:Pe.key),L=f(Pe,L,De),Ie===null?be=Pe:Ie.sibling=Pe,Ie=Pe);return e&&ve.forEach(function(Ml){return t(B,Ml)}),qe&&_a(B,De),be}function Ce(B,L,I,ee){if(I==null)throw Error(i(151));for(var be=null,Ie=null,ve=L,De=L=0,Pe=null,Ge=I.next();ve!==null&&!Ge.done;De++,Ge=I.next()){ve.index>De?(Pe=ve,ve=null):Pe=ve.sibling;var Ml=Y(B,ve,Ge.value,ee);if(Ml===null){ve===null&&(ve=Pe);break}e&&ve&&Ml.alternate===null&&t(B,ve),L=f(Ml,L,De),Ie===null?be=Ml:Ie.sibling=Ml,Ie=Ml,ve=Pe}if(Ge.done)return n(B,ve),qe&&_a(B,De),be;if(ve===null){for(;!Ge.done;De++,Ge=I.next())Ge=te(B,Ge.value,ee),Ge!==null&&(L=f(Ge,L,De),Ie===null?be=Ge:Ie.sibling=Ge,Ie=Ge);return qe&&_a(B,De),be}for(ve=r(ve);!Ge.done;De++,Ge=I.next())Ge=X(ve,B,De,Ge.value,ee),Ge!==null&&(e&&Ge.alternate!==null&&ve.delete(Ge.key===null?De:Ge.key),L=f(Ge,L,De),Ie===null?be=Ge:Ie.sibling=Ge,Ie=Ge);return e&&ve.forEach(function(Ww){return t(B,Ww)}),qe&&_a(B,De),be}function at(B,L,I,ee){if(typeof I=="object"&&I!==null&&I.type===j&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case w:e:{for(var be=I.key;L!==null;){if(L.key===be){if(be=I.type,be===j){if(L.tag===7){n(B,L.sibling),ee=u(L,I.props.children),ee.return=B,B=ee;break e}}else if(L.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===k&&Wl(be)===L.type){n(B,L.sibling),ee=u(L,I.props),Vs(ee,I),ee.return=B,B=ee;break e}n(B,L);break}else t(B,L);L=L.sibling}I.type===j?(ee=Xl(I.props.children,B.mode,ee,I.key),ee.return=B,B=ee):(ee=ni(I.type,I.key,I.props,null,B.mode,ee),Vs(ee,I),ee.return=B,B=ee)}return y(B);case E:e:{for(be=I.key;L!==null;){if(L.key===be)if(L.tag===4&&L.stateNode.containerInfo===I.containerInfo&&L.stateNode.implementation===I.implementation){n(B,L.sibling),ee=u(L,I.children||[]),ee.return=B,B=ee;break e}else{n(B,L);break}else t(B,L);L=L.sibling}ee=_u(I,B.mode,ee),ee.return=B,B=ee}return y(B);case k:return I=Wl(I),at(B,L,I,ee)}if(ce(I))return ge(B,L,I,ee);if(V(I)){if(be=V(I),typeof be!="function")throw Error(i(150));return I=be.call(I),Ce(B,L,I,ee)}if(typeof I.then=="function")return at(B,L,ci(I),ee);if(I.$$typeof===M)return at(B,L,ri(B,I),ee);ui(B,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,L!==null&&L.tag===6?(n(B,L.sibling),ee=u(L,I),ee.return=B,B=ee):(n(B,L),ee=Au(I,B.mode,ee),ee.return=B,B=ee),y(B)):n(B,L)}return function(B,L,I,ee){try{qs=0;var be=at(B,L,I,ee);return Gr=null,be}catch(ve){if(ve===Ir||ve===oi)throw ve;var Ie=pn(29,ve,null,B.mode);return Ie.lanes=ee,Ie.return=B,Ie}finally{}}}var tr=_p(!0),Dp=_p(!1),fl=!1;function Iu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gu(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 hl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ml(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,($e&2)!==0){var u=r.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),r.pending=t,t=ti(e),pp(e,null,n),t}return ei(e,r,t,n),ti(e)}function Is(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,Zt(e,n)}}function Yu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var y={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=y:f=f.next=y,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:r.baseState,firstBaseUpdate:u,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 $u=!1;function Gs(){if($u){var e=Vr;if(e!==null)throw e}}function Ys(e,t,n,r){$u=!1;var u=e.updateQueue;fl=!1;var f=u.firstBaseUpdate,y=u.lastBaseUpdate,R=u.shared.pending;if(R!==null){u.shared.pending=null;var O=R,G=O.next;O.next=null,y===null?f=G:y.next=G,y=O;var J=e.alternate;J!==null&&(J=J.updateQueue,R=J.lastBaseUpdate,R!==y&&(R===null?J.firstBaseUpdate=G:R.next=G,J.lastBaseUpdate=O))}if(f!==null){var te=u.baseState;y=0,J=G=O=null,R=f;do{var Y=R.lane&-536870913,X=Y!==R.lane;if(X?(Be&Y)===Y:(r&Y)===Y){Y!==0&&Y===qr&&($u=!0),J!==null&&(J=J.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var ge=e,Ce=R;Y=t;var at=n;switch(Ce.tag){case 1:if(ge=Ce.payload,typeof ge=="function"){te=ge.call(at,te,Y);break e}te=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ce.payload,Y=typeof ge=="function"?ge.call(at,te,Y):ge,Y==null)break e;te=S({},te,Y);break e;case 2:fl=!0}}Y=R.callback,Y!==null&&(e.flags|=64,X&&(e.flags|=8192),X=u.callbacks,X===null?u.callbacks=[Y]:X.push(Y))}else X={lane:Y,tag:R.tag,payload:R.payload,callback:R.callback,next:null},J===null?(G=J=X,O=te):J=J.next=X,y|=Y;if(R=R.next,R===null){if(R=u.shared.pending,R===null)break;X=R,R=X.next,X.next=null,u.lastBaseUpdate=X,u.shared.pending=null}}while(!0);J===null&&(O=te),u.baseState=O,u.firstBaseUpdate=G,u.lastBaseUpdate=J,f===null&&(u.shared.lanes=0),yl|=y,e.lanes=y,e.memoizedState=te}}function Op(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function kp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Op(n[e],t)}var Yr=D(null),di=D(0);function zp(e,t){e=Va,Q(di,e),Q(Yr,t),Va=e|t.baseLanes}function Ku(){Q(di,Va),Q(Yr,Yr.current)}function Xu(){Va=di.current,P(Yr),P(di)}var gn=D(null),Un=null;function pl(e){var t=e.alternate;Q(xt,xt.current&1),Q(gn,e),Un===null&&(t===null||Yr.current!==null||t.memoizedState!==null)&&(Un=e)}function Fu(e){Q(xt,xt.current),Q(gn,e),Un===null&&(Un=e)}function Lp(e){e.tag===22?(Q(xt,xt.current),Q(gn,e),Un===null&&(Un=e)):gl()}function gl(){Q(xt,xt.current),Q(gn,gn.current)}function vn(e){P(gn),Un===e&&(Un=null),P(xt)}var xt=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||tf(n)||nf(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,tt=null,Et=null,hi=!1,$r=!1,nr=!1,mi=0,$s=0,Kr=null,IS=0;function gt(){throw Error(i(321))}function Qu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mn(e[n],t[n]))return!1;return!0}function Zu(e,t,n,r,u,f){return ka=f,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?yg:fd,nr=!1,f=n(r,u),nr=!1,$r&&(f=Hp(t,n,r,u)),Up(e),f}function Up(e){U.H=Fs;var t=tt!==null&&tt.next!==null;if(ka=0,Et=tt=_e=null,hi=!1,$s=0,Kr=null,t)throw Error(i(300));e===null||Rt||(e=e.dependencies,e!==null&&li(e)&&(Rt=!0))}function Hp(e,t,n,r){_e=e;var u=0;do{if($r&&(Kr=null),$s=0,$r=!1,25<=u)throw Error(i(301));if(u+=1,Et=tt=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=bg,f=t(n,r)}while($r);return f}function GS(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Ks(t):t,e=e.useState()[0],(tt!==null?tt.memoizedState:null)!==e&&(_e.flags|=1024),t}function Ju(){var e=mi!==0;return mi=0,e}function Wu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ed(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,Et=tt=_e=null,$r=!1,$s=mi=0,Kr=null}function Ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Et===null?_e.memoizedState=Et=e:Et=Et.next=e,Et}function yt(){if(tt===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=tt.next;var t=Et===null?_e.memoizedState:Et.next;if(t!==null)Et=t,tt=e;else{if(e===null)throw _e.alternate===null?Error(i(467)):Error(i(310));tt=e,e={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},Et===null?_e.memoizedState=Et=e:Et=Et.next=e}return Et}function pi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ks(e){var t=$s;return $s+=1,Kr===null&&(Kr=[]),e=Tp(Kr,e,t),t=_e,(Et===null?t.memoizedState:Et.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?yg:fd),e}function gi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ks(e);if(e.$$typeof===M)return Pt(e)}throw Error(i(438,String(e)))}function td(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(u){return u.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]=re;return t.index++,n}function za(e,t){return typeof t=="function"?t(e):t}function vi(e){var t=yt();return nd(t,tt,e)}function nd(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var u=e.baseQueue,f=r.pending;if(f!==null){if(u!==null){var y=u.next;u.next=f.next,f.next=y}t.baseQueue=u=f,r.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var R=y=null,O=null,G=t,J=!1;do{var te=G.lane&-536870913;if(te!==G.lane?(Be&te)===te:(ka&te)===te){var Y=G.revertLane;if(Y===0)O!==null&&(O=O.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},O===null?(R=O=te,y=f):O=O.next=te,_e.lanes|=Y,yl|=Y;te=G.action,nr&&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},O===null?(R=O=Y,y=f):O=O.next=Y,_e.lanes|=te,yl|=te;G=G.next}while(G!==null&&G!==t);if(O===null?y=f:O.next=R,!mn(f,e.memoizedState)&&(Rt=!0,J&&(n=Vr,n!==null)))throw n;e.memoizedState=f,e.baseState=y,e.baseQueue=O,r.lastRenderedState=f}return u===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ad(e){var t=yt(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var y=u=u.next;do f=e(f,y.action),y=y.next;while(y!==u);mn(f,t.memoizedState)||(Rt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,r]}function Bp(e,t,n){var r=_e,u=yt(),f=qe;if(f){if(n===void 0)throw Error(i(407));n=n()}else n=t();var y=!mn((tt||u).memoizedState,n);if(y&&(u.memoizedState=n,Rt=!0),u=u.queue,sd(Vp.bind(null,r,u,e),[e]),u.getSnapshot!==t||y||Et!==null&&Et.memoizedState.tag&1){if(r.flags|=2048,Xr(9,{destroy:void 0},qp.bind(null,r,u,n,t),null),ot===null)throw Error(i(349));f||(ka&127)!==0||Pp(r,t,n)}return n}function Pp(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 qp(e,t,n,r){t.value=n,t.getSnapshot=r,Ip(t)&&Gp(e)}function Vp(e,t,n){return n(function(){Ip(t)&&Gp(e)})}function Ip(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mn(e,n)}catch{return!0}}function Gp(e){var t=Kl(e,2);t!==null&&ln(t,e,2)}function ld(e){var t=Ft();if(typeof e=="function"){var n=e;if(e=n(),nr){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 Yp(e,t,n,r){return e.baseState=n,nd(e,tt,typeof r=="function"?r:za)}function YS(e,t,n,r,u){if(bi(e))throw Error(i(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){f.listeners.push(y)}};U.T!==null?n(!0):f.isTransition=!1,r(f),n=t.pending,n===null?(f.next=t.pending=f,$p(t,f)):(f.next=n.next,t.pending=n.next=f)}}function $p(e,t){var n=t.action,r=t.payload,u=e.state;if(t.isTransition){var f=U.T,y={};U.T=y;try{var R=n(u,r),O=U.S;O!==null&&O(y,R),Kp(e,t,R)}catch(G){rd(e,t,G)}finally{f!==null&&y.types!==null&&(f.types=y.types),U.T=f}}else try{f=n(u,r),Kp(e,t,f)}catch(G){rd(e,t,G)}}function Kp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){Xp(e,t,r)},function(r){return rd(e,t,r)}):Xp(e,t,n)}function Xp(e,t,n){t.status="fulfilled",t.value=n,Fp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,$p(e,n)))}function rd(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,Fp(t),t=t.next;while(t!==r)}e.action=null}function Fp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qp(e,t){return t}function Zp(e,t){if(qe){var n=ot.formState;if(n!==null){e:{var r=_e;if(qe){if(ct){t:{for(var u=ct,f=Ln;u.nodeType!==8;){if(!f){u=null;break t}if(u=Hn(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){ct=Hn(u.nextSibling),r=u.data==="F!";break e}}ul(r)}r=!1}r&&(t=n[0])}}return n=Ft(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qp,lastRenderedState:t},n.queue=r,n=gg.bind(null,_e,r),r.dispatch=n,r=ld(!1),f=dd.bind(null,_e,!1,r.queue),r=Ft(),u={state:t,dispatch:null,action:e,pending:null},r.queue=u,n=YS.bind(null,_e,u,f,n),u.dispatch=n,r.memoizedState=e,[t,n,!1]}function Jp(e){var t=yt();return Wp(t,tt,e)}function Wp(e,t,n){if(t=nd(e,t,Qp)[0],e=vi(za)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Ks(t)}catch(y){throw y===Ir?oi:y}else r=t;t=yt();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(_e.flags|=2048,Xr(9,{destroy:void 0},$S.bind(null,u,n),null)),[r,f,e]}function $S(e,t){e.action=t}function eg(e){var t=yt(),n=tt;if(n!==null)return Wp(t,n,e);yt(),t=t.memoizedState,n=yt();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 tg(){return yt().memoizedState}function xi(e,t,n,r){var u=Ft();_e.flags|=e,u.memoizedState=Xr(1|t,{destroy:void 0},n,r===void 0?null:r)}function yi(e,t,n,r){var u=yt();r=r===void 0?null:r;var f=u.memoizedState.inst;tt!==null&&r!==null&&Qu(r,tt.memoizedState.deps)?u.memoizedState=Xr(t,f,n,r):(_e.flags|=e,u.memoizedState=Xr(1|t,f,n,r))}function ng(e,t){xi(8390656,8,e,t)}function sd(e,t){yi(2048,8,e,t)}function KS(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 ag(e){var t=yt().memoizedState;return KS({ref:t,nextImpl:e}),function(){if(($e&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function lg(e,t){return yi(4,2,e,t)}function rg(e,t){return yi(4,4,e,t)}function sg(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 og(e,t,n){n=n!=null?n.concat([e]):null,yi(4,4,sg.bind(null,t,e),n)}function od(){}function ig(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function cg(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qu(t,r[1]))return r[0];if(r=e(),nr){Zn(!0);try{e()}finally{Zn(!1)}}return n.memoizedState=[r,t],r}function id(e,t,n){return n===void 0||(ka&1073741824)!==0&&(Be&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=uv(),_e.lanes|=e,yl|=e,n)}function ug(e,t,n,r){return mn(n,t)?n:Yr.current!==null?(e=id(e,n,r),mn(e,t)||(Rt=!0),e):(ka&42)===0||(ka&1073741824)!==0&&(Be&261930)===0?(Rt=!0,e.memoizedState=n):(e=uv(),_e.lanes|=e,yl|=e,t)}function dg(e,t,n,r,u){var f=$.p;$.p=f!==0&&8>f?f:8;var y=U.T,R={};U.T=R,dd(e,!1,t,n);try{var O=u(),G=U.S;if(G!==null&&G(R,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var J=VS(O,r);Xs(e,t,J,bn(e))}else Xs(e,t,r,bn(e))}catch(te){Xs(e,t,{then:function(){},status:"rejected",reason:te},bn())}finally{$.p=f,y!==null&&R.types!==null&&(y.types=R.types),U.T=y}}function XS(){}function cd(e,t,n,r){if(e.tag!==5)throw Error(i(476));var u=fg(e).queue;dg(e,u,t,ne,n===null?XS:function(){return hg(e),n(r)})}function fg(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 hg(e){var t=fg(e);t.next===null&&(t=e.alternate.memoizedState),Xs(e,t.next.queue,{},bn())}function ud(){return Pt(fo)}function mg(){return yt().memoizedState}function pg(){return yt().memoizedState}function FS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=bn();e=hl(n);var r=ml(t,e,n);r!==null&&(ln(r,t,n),Is(r,t,n)),t={cache:Bu()},e.payload=t;return}t=t.return}}function QS(e,t,n){var r=bn();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bi(e)?vg(t,n):(n=Tu(e,t,n,r),n!==null&&(ln(n,e,r),xg(n,t,r)))}function gg(e,t,n){var r=bn();Xs(e,t,n,r)}function Xs(e,t,n,r){var u={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bi(e))vg(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var y=t.lastRenderedState,R=f(y,n);if(u.hasEagerState=!0,u.eagerState=R,mn(R,y))return ei(e,t,u,0),ot===null&&Wo(),!1}catch{}finally{}if(n=Tu(e,t,u,r),n!==null)return ln(n,e,r),xg(n,t,r),!0}return!1}function dd(e,t,n,r){if(r={lane:2,revertLane:Id(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bi(e)){if(t)throw Error(i(479))}else t=Tu(e,n,r,2),t!==null&&ln(t,e,2)}function bi(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function vg(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 xg(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zt(e,n)}}var Fs={readContext:Pt,use:gi,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};Fs.useEffectEvent=gt;var yg={readContext:Pt,use:gi,useCallback:function(e,t){return Ft().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:ng,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,xi(4194308,4,sg.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=Ft();t=t===void 0?null:t;var r=e();if(nr){Zn(!0);try{e()}finally{Zn(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ft();if(n!==void 0){var u=n(t);if(nr){Zn(!0);try{n(t)}finally{Zn(!1)}}}else u=t;return r.memoizedState=r.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},r.queue=e,e=e.dispatch=QS.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=Ft();return e={current:e},t.memoizedState=e},useState:function(e){e=ld(e);var t=e.queue,n=gg.bind(null,_e,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:od,useDeferredValue:function(e,t){var n=Ft();return id(n,e,t)},useTransition:function(){var e=ld(!1);return e=dg.bind(null,_e,e.queue,!0,!1),Ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=_e,u=Ft();if(qe){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ot===null)throw Error(i(349));(Be&127)!==0||Pp(r,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,ng(Vp.bind(null,r,f,e),[e]),r.flags|=2048,Xr(9,{destroy:void 0},qp.bind(null,r,f,n,t),null),n},useId:function(){var e=Ft(),t=ot.identifierPrefix;if(qe){var n=ua,r=ca;n=(r&~(1<<32-jt(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=mi++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=IS++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ud,useFormState:Zp,useActionState:Zp,useOptimistic:function(e){var t=Ft();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dd.bind(null,_e,!0,n),n.dispatch=t,[e,t]},useMemoCache:td,useCacheRefresh:function(){return Ft().memoizedState=FS.bind(null,_e)},useEffectEvent:function(e){var t=Ft(),n={impl:e};return t.memoizedState=n,function(){if(($e&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},fd={readContext:Pt,use:gi,useCallback:ig,useContext:Pt,useEffect:sd,useImperativeHandle:og,useInsertionEffect:lg,useLayoutEffect:rg,useMemo:cg,useReducer:vi,useRef:tg,useState:function(){return vi(za)},useDebugValue:od,useDeferredValue:function(e,t){var n=yt();return ug(n,tt.memoizedState,e,t)},useTransition:function(){var e=vi(za)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Ks(e),t]},useSyncExternalStore:Bp,useId:mg,useHostTransitionStatus:ud,useFormState:Jp,useActionState:Jp,useOptimistic:function(e,t){var n=yt();return Yp(n,tt,e,t)},useMemoCache:td,useCacheRefresh:pg};fd.useEffectEvent=ag;var bg={readContext:Pt,use:gi,useCallback:ig,useContext:Pt,useEffect:sd,useImperativeHandle:og,useInsertionEffect:lg,useLayoutEffect:rg,useMemo:cg,useReducer:ad,useRef:tg,useState:function(){return ad(za)},useDebugValue:od,useDeferredValue:function(e,t){var n=yt();return tt===null?id(n,e,t):ug(n,tt.memoizedState,e,t)},useTransition:function(){var e=ad(za)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Ks(e),t]},useSyncExternalStore:Bp,useId:mg,useHostTransitionStatus:ud,useFormState:eg,useActionState:eg,useOptimistic:function(e,t){var n=yt();return tt!==null?Yp(n,tt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:td,useCacheRefresh:pg};bg.useEffectEvent=ag;function hd(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:S({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var md={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=bn(),u=hl(r);u.payload=t,n!=null&&(u.callback=n),t=ml(e,u,r),t!==null&&(ln(t,e,r),Is(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=bn(),u=hl(r);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=ml(e,u,r),t!==null&&(ln(t,e,r),Is(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=bn(),r=hl(n);r.tag=2,t!=null&&(r.callback=t),t=ml(e,r,n),t!==null&&(ln(t,e,n),Is(t,e,n))}};function Sg(e,t,n,r,u,f,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,f,y):t.prototype&&t.prototype.isPureReactComponent?!zs(n,r)||!zs(u,f):!0}function wg(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&&md.enqueueReplaceState(t,t.state,null)}function ar(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=S({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function jg(e){Jo(e)}function Cg(e){console.error(e)}function Eg(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 Rg(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function pd(e,t,n){return n=hl(n),n.tag=3,n.payload={element:null},n.callback=function(){Si(e,t)},n}function Ng(e){return e=hl(e),e.tag=3,e}function Tg(e,t,n,r){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=r.value;e.payload=function(){return u(f)},e.callback=function(){Rg(t,n,r)}}var y=n.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Rg(t,n,r),typeof u!="function"&&(bl===null?bl=new Set([this]):bl.add(this));var R=r.stack;this.componentDidCatch(r.value,{componentStack:R!==null?R:""})})}function ZS(e,t,n,r,u){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Pr(t,n,u,!0),n=gn.current,n!==null){switch(n.tag){case 31:case 13:return Un===null?Oi():n.alternate===null&&vt===0&&(vt=3),n.flags&=-257,n.flags|=65536,n.lanes=u,r===ii?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Pd(e,r,u)),!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)),Pd(e,r,u)),!1}throw Error(i(435,n.tag))}return Pd(e,r,u),Oi(),!1}if(qe)return t=gn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,r!==ku&&(e=Error(i(422),{cause:r}),Hs(On(e,n)))):(r!==ku&&(t=Error(i(423),{cause:r}),Hs(On(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,r=On(r,n),u=pd(e.stateNode,r,u),Yu(e,u),vt!==4&&(vt=2)),!1;var f=Error(i(520),{cause:r});if(f=On(f,n),ao===null?ao=[f]:ao.push(f),vt!==4&&(vt=2),t===null)return!0;r=On(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=pd(n.stateNode,r,e),Yu(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"&&(bl===null||!bl.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Ng(u),Tg(u,e,n,r),Yu(n,u),!1}n=n.return}while(n!==null);return!1}var gd=Error(i(461)),Rt=!1;function qt(e,t,n,r){t.child=e===null?Dp(t,null,n,r):tr(t,e.child,n,r)}function Mg(e,t,n,r,u){n=n.render;var f=t.ref;if("ref"in r){var y={};for(var R in r)R!=="ref"&&(y[R]=r[R])}else y=r;return Zl(t),r=Zu(e,t,n,y,f,u),R=Ju(),e!==null&&!Rt?(Wu(e,t,u),La(e,t,u)):(qe&&R&&Du(t),t.flags|=1,qt(e,t,r,u),t.child)}function Ag(e,t,n,r,u){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,_g(e,t,f,r,u)):(e=ni(n.type,null,r,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Cd(e,u)){var y=f.memoizedProps;if(n=n.compare,n=n!==null?n:zs,n(y,r)&&e.ref===t.ref)return La(e,t,u)}return t.flags|=1,e=Aa(f,r),e.ref=t.ref,e.return=t,t.child=e}function _g(e,t,n,r,u){if(e!==null){var f=e.memoizedProps;if(zs(f,r)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=r=f,Cd(e,u))(e.flags&131072)!==0&&(Rt=!0);else return t.lanes=e.lanes,La(e,t,u)}return vd(e,t,n,r,u)}function Dg(e,t,n,r){var u=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,u=0;r!==null;)u=u|r.lanes|r.childLanes,r=r.sibling;r=u&~f}else r=0,t.child=null;return Og(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?zp(t,f):Ku(),Lp(t);else return r=t.lanes=536870912,Og(e,t,f!==null?f.baseLanes|n:n,n,r)}else f!==null?(si(t,f.cachePool),zp(t,f),gl(),t.memoizedState=null):(e!==null&&si(t,null),Ku(),gl());return qt(e,t,u,n),t.child}function Qs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Og(e,t,n,r,u){var f=qu();return f=f===null?null:{parent:Ct._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&si(t,null),Ku(),Lp(t),e!==null&&Pr(e,t,r,!0),t.childLanes=u,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 kg(e,t,n){return tr(t,e.child,null,n),e=wi(t,t.pendingProps),e.flags|=2,vn(t),t.memoizedState=null,e}function JS(e,t,n){var r=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(qe){if(r.mode==="hidden")return e=wi(t,r),t.lanes=536870912,Qs(null,e);if(Fu(t),(e=ct)?(e=$v(e,Ln),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:il!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},n=vp(e),n.return=t,t.child=n,Bt=t,ct=null)):e=null,e===null)throw ul(t);return t.lanes=536870912,null}return wi(t,r)}var f=e.memoizedState;if(f!==null){var y=f.dehydrated;if(Fu(t),u)if(t.flags&256)t.flags&=-257,t=kg(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Rt||Pr(e,t,n,!1),u=(n&e.childLanes)!==0,Rt||u){if(r=ot,r!==null&&(y=Jn(r,n),y!==0&&y!==f.retryLane))throw f.retryLane=y,Kl(e,y),ln(r,e,y),gd;Oi(),t=kg(e,t,n)}else e=f.treeContext,ct=Hn(y.nextSibling),Bt=t,qe=!0,cl=null,Ln=!1,e!==null&&bp(t,e),t=wi(t,r),t.flags|=4096;return t}return e=Aa(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 vd(e,t,n,r,u){return Zl(t),n=Zu(e,t,n,r,void 0,u),r=Ju(),e!==null&&!Rt?(Wu(e,t,u),La(e,t,u)):(qe&&r&&Du(t),t.flags|=1,qt(e,t,n,u),t.child)}function zg(e,t,n,r,u,f){return Zl(t),t.updateQueue=null,n=Hp(t,r,n,u),Up(e),r=Ju(),e!==null&&!Rt?(Wu(e,t,f),La(e,t,f)):(qe&&r&&Du(t),t.flags|=1,qt(e,t,n,f),t.child)}function Lg(e,t,n,r,u){if(Zl(t),t.stateNode===null){var f=Lr,y=n.contextType;typeof y=="object"&&y!==null&&(f=Pt(y)),f=new n(r,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=md,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=r,f.state=t.memoizedState,f.refs={},Iu(t),y=n.contextType,f.context=typeof y=="object"&&y!==null?Pt(y):Lr,f.state=t.memoizedState,y=n.getDerivedStateFromProps,typeof y=="function"&&(hd(t,n,y,r),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(y=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),y!==f.state&&md.enqueueReplaceState(f,f.state,null),Ys(t,r,f,u),Gs(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){f=t.stateNode;var R=t.memoizedProps,O=ar(n,R);f.props=O;var G=f.context,J=n.contextType;y=Lr,typeof J=="object"&&J!==null&&(y=Pt(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!==y)&&wg(t,f,r,y),fl=!1;var Y=t.memoizedState;f.state=Y,Ys(t,r,f,u),Gs(),G=t.memoizedState,R||Y!==G||fl?(typeof te=="function"&&(hd(t,n,te,r),G=t.memoizedState),(O=fl||Sg(t,n,O,r,Y,G,y))?(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=y,r=O):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{f=t.stateNode,Gu(e,t),y=t.memoizedProps,J=ar(n,y),f.props=J,te=t.pendingProps,Y=f.context,G=n.contextType,O=Lr,typeof G=="object"&&G!==null&&(O=Pt(G)),R=n.getDerivedStateFromProps,(G=typeof R=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==te||Y!==O)&&wg(t,f,r,O),fl=!1,Y=t.memoizedState,f.state=Y,Ys(t,r,f,u),Gs();var X=t.memoizedState;y!==te||Y!==X||fl||e!==null&&e.dependencies!==null&&li(e.dependencies)?(typeof R=="function"&&(hd(t,n,R,r),X=t.memoizedState),(J=fl||Sg(t,n,J,r,Y,X,O)||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,X,O),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(r,X,O)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=X),f.props=r,f.state=X,f.context=O,r=J):(typeof f.componentDidUpdate!="function"||y===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||y===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=tr(t,e.child,null,u),t.child=tr(t,null,n,u)):qt(e,t,n,u),t.memoizedState=f.state,e=t.child):e=La(e,t,u),e}function Ug(e,t,n,r){return Fl(),t.flags|=256,qt(e,t,n,r),t.child}var xd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yd(e){return{baseLanes:e,cachePool:Rp()}}function bd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=yn),e}function Hg(e,t,n){var r=t.pendingProps,u=!1,f=(t.flags&128)!==0,y;if((y=f)||(y=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),y&&(u=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(qe){if(u?pl(t):gl(),(e=ct)?(e=$v(e,Ln),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:il!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},n=vp(e),n.return=t,t.child=n,Bt=t,ct=null)):e=null,e===null)throw ul(t);return nf(e)?t.lanes=32:t.lanes=536870912,null}var R=r.children;return r=r.fallback,u?(gl(),u=t.mode,R=Ci({mode:"hidden",children:R},u),r=Xl(r,u,n,null),R.return=t,r.return=t,R.sibling=r,t.child=R,r=t.child,r.memoizedState=yd(n),r.childLanes=bd(e,y,n),t.memoizedState=xd,Qs(null,r)):(pl(t),Sd(t,R))}var O=e.memoizedState;if(O!==null&&(R=O.dehydrated,R!==null)){if(f)t.flags&256?(pl(t),t.flags&=-257,t=wd(e,t,n)):t.memoizedState!==null?(gl(),t.child=e.child,t.flags|=128,t=null):(gl(),R=r.fallback,u=t.mode,r=Ci({mode:"visible",children:r.children},u),R=Xl(R,u,n,null),R.flags|=2,r.return=t,R.return=t,r.sibling=R,t.child=r,tr(t,e.child,null,n),r=t.child,r.memoizedState=yd(n),r.childLanes=bd(e,y,n),t.memoizedState=xd,t=Qs(null,r));else if(pl(t),nf(R)){if(y=R.nextSibling&&R.nextSibling.dataset,y)var G=y.dgst;y=G,r=Error(i(419)),r.stack="",r.digest=y,Hs({value:r,source:null,stack:null}),t=wd(e,t,n)}else if(Rt||Pr(e,t,n,!1),y=(n&e.childLanes)!==0,Rt||y){if(y=ot,y!==null&&(r=Jn(y,n),r!==0&&r!==O.retryLane))throw O.retryLane=r,Kl(e,r),ln(y,e,r),gd;tf(R)||Oi(),t=wd(e,t,n)}else tf(R)?(t.flags|=192,t.child=e.child,t=null):(e=O.treeContext,ct=Hn(R.nextSibling),Bt=t,qe=!0,cl=null,Ln=!1,e!==null&&bp(t,e),t=Sd(t,r.children),t.flags|=4096);return t}return u?(gl(),R=r.fallback,u=t.mode,O=e.child,G=O.sibling,r=Aa(O,{mode:"hidden",children:r.children}),r.subtreeFlags=O.subtreeFlags&65011712,G!==null?R=Aa(G,R):(R=Xl(R,u,n,null),R.flags|=2),R.return=t,r.return=t,r.sibling=R,t.child=r,Qs(null,r),r=t.child,R=e.child.memoizedState,R===null?R=yd(n):(u=R.cachePool,u!==null?(O=Ct._currentValue,u=u.parent!==O?{parent:O,pool:O}:u):u=Rp(),R={baseLanes:R.baseLanes|n,cachePool:u}),r.memoizedState=R,r.childLanes=bd(e,y,n),t.memoizedState=xd,Qs(e.child,r)):(pl(t),n=e.child,e=n.sibling,n=Aa(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=n,t.memoizedState=null,n)}function Sd(e,t){return t=Ci({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ci(e,t){return e=pn(22,e,null,t),e.lanes=0,e}function wd(e,t,n){return tr(t,e.child,null,n),e=Sd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Uu(e.return,t,n)}function jd(e,t,n,r,u,f){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:u,treeForkCount:f}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=r,y.tail=n,y.tailMode=u,y.treeForkCount=f)}function Pg(e,t,n){var r=t.pendingProps,u=r.revealOrder,f=r.tail;r=r.children;var y=xt.current,R=(y&2)!==0;if(R?(y=y&1|2,t.flags|=128):y&=1,Q(xt,y),qt(e,t,r,n),r=qe?Us:0,!R&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bg(e,n,t);else if(e.tag===19)Bg(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(u){case"forwards":for(n=t.child,u=null;n!==null;)e=n.alternate,e!==null&&fi(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),jd(t,!1,u,n,f,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&fi(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}jd(t,!0,n,null,f,r);break;case"together":jd(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),yl|=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=Aa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Aa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&li(e)))}function WS(e,t,n){switch(t.tag){case 3:ie(t,t.stateNode.containerInfo),dl(t,Ct,e.memoizedState.cache),Fl();break;case 27:case 5:Re(t);break;case 4:ie(t,t.stateNode.containerInfo);break;case 10:dl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(pl(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Hg(e,t,n):(pl(t),e=La(e,t,n),e!==null?e.sibling:null);pl(t);break;case 19:var u=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Pr(e,t,n,!1),r=(n&t.childLanes)!==0),u){if(r)return Pg(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Q(xt,xt.current),r)break;return null;case 22:return t.lanes=0,Dg(e,t,n,t.pendingProps);case 24:dl(t,Ct,e.memoizedState.cache)}return La(e,t,n)}function qg(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rt=!0;else{if(!Cd(e,n)&&(t.flags&128)===0)return Rt=!1,WS(e,t,n);Rt=(e.flags&131072)!==0}else Rt=!1,qe&&(t.flags&1048576)!==0&&yp(t,Us,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Wl(t.elementType),t.type=e,typeof e=="function")Mu(e)?(r=ar(e,r),t.tag=1,t=Lg(null,t,e,r,n)):(t.tag=0,t=vd(null,t,e,r,n));else{if(e!=null){var u=e.$$typeof;if(u===A){t.tag=11,t=Mg(null,t,e,r,n);break e}else if(u===q){t.tag=14,t=Ag(null,t,e,r,n);break e}}throw t=se(e)||e,Error(i(306,t,""))}}return t;case 0:return vd(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,u=ar(r,t.pendingProps),Lg(e,t,r,u,n);case 3:e:{if(ie(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var f=t.memoizedState;u=f.element,Gu(e,t),Ys(t,r,null,n);var y=t.memoizedState;if(r=y.cache,dl(t,Ct,r),r!==f.cache&&Hu(t,[Ct],n,!0),Gs(),r=y.element,f.isDehydrated)if(f={element:r,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Ug(e,t,r,n);break e}else if(r!==u){u=On(Error(i(424)),t),Hs(u),t=Ug(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(ct=Hn(e.firstChild),Bt=t,qe=!0,cl=null,Ln=!0,n=Dp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Fl(),r===u){t=La(e,t,n);break e}qt(e,t,r,n)}t=t.child}return t;case 26:return ji(e,t),e===null?(n=Jv(t.type,null,t.pendingProps,null))?t.memoizedState=n:qe||(n=t.type,e=t.pendingProps,r=Pi(Z.current).createElement(n),r[Ht]=t,r[Jt]=e,Vt(r,n,e),Dt(r),t.stateNode=r):t.memoizedState=Jv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Re(t),e===null&&qe&&(r=t.stateNode=Fv(t.type,t.pendingProps,Z.current),Bt=t,Ln=!0,u=ct,Cl(t.type)?(af=u,ct=Hn(r.firstChild)):ct=u),qt(e,t,t.pendingProps.children,n),ji(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&qe&&((u=r=ct)&&(r=Mw(r,t.type,t.pendingProps,Ln),r!==null?(t.stateNode=r,Bt=t,ct=Hn(r.firstChild),Ln=!1,u=!0):u=!1),u||ul(t)),Re(t),u=t.type,f=t.pendingProps,y=e!==null?e.memoizedProps:null,r=f.children,Jd(u,f)?r=null:y!==null&&Jd(u,y)&&(t.flags|=32),t.memoizedState!==null&&(u=Zu(e,t,GS,null,null,n),fo._currentValue=u),ji(e,t),qt(e,t,r,n),t.child;case 6:return e===null&&qe&&((e=n=ct)&&(n=Aw(n,t.pendingProps,Ln),n!==null?(t.stateNode=n,Bt=t,ct=null,e=!0):e=!1),e||ul(t)),null;case 13:return Hg(e,t,n);case 4:return ie(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=tr(t,null,r,n):qt(e,t,r,n),t.child;case 11:return Mg(e,t,t.type,t.pendingProps,n);case 7:return qt(e,t,t.pendingProps,n),t.child;case 8:return qt(e,t,t.pendingProps.children,n),t.child;case 12:return qt(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,dl(t,t.type,r.value),qt(e,t,r.children,n),t.child;case 9:return u=t.type._context,r=t.pendingProps.children,Zl(t),u=Pt(u),r=r(u),t.flags|=1,qt(e,t,r,n),t.child;case 14:return Ag(e,t,t.type,t.pendingProps,n);case 15:return _g(e,t,t.type,t.pendingProps,n);case 19:return Pg(e,t,n);case 31:return JS(e,t,n);case 22:return Dg(e,t,n,t.pendingProps);case 24:return Zl(t),r=Pt(Ct),e===null?(u=qu(),u===null&&(u=ot,f=Bu(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:r,cache:u},Iu(t),dl(t,Ct,u)):((e.lanes&n)!==0&&(Gu(e,t),Ys(t,null,null,n),Gs()),u=e.memoizedState,f=t.memoizedState,u.parent!==r?(u={parent:r,cache:r},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),dl(t,Ct,r)):(r=f.cache,dl(t,Ct,r),r!==u.cache&&Hu(t,[Ct],n,!0))),qt(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 Ed(e,t,n,r,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(mv())e.flags|=8192;else throw er=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,!ax(t))if(mv())e.flags|=8192;else throw er=ii,Vu}function Ei(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?st():536870912,e.lanes|=t,Jr|=t)}function Zs(e,t){if(!qe)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 ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,r|=u.subtreeFlags&65011712,r|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,r|=u.subtreeFlags,r|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ew(e,t,n){var r=t.pendingProps;switch(Ou(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return ut(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Oa(Ct),me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Br(t)?Ua(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,zu())),ut(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Ua(t),f!==null?(ut(t),Vg(t,f)):(ut(t),Ed(t,u,null,r,n))):f?f!==e.memoizedState?(Ua(t),ut(t),Vg(t,f)):(ut(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ua(t),ut(t),Ed(t,u,e,r,n)),null;case 27:if(Ae(t),n=Z.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ua(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ut(t),null}e=ae.current,Br(t)?Sp(t):(e=Fv(u,r,n),t.stateNode=e,Ua(t))}return ut(t),null;case 5:if(Ae(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ua(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ut(t),null}if(f=ae.current,Br(t))Sp(t);else{var y=Pi(Z.current);switch(f){case 1:f=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=y.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof r.is=="string"?y.createElement("select",{is:r.is}):y.createElement("select"),r.multiple?f.multiple=!0:r.size&&(f.size=r.size);break;default:f=typeof r.is=="string"?y.createElement(u,{is:r.is}):y.createElement(u)}}f[Ht]=t,f[Jt]=r;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)f.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=f;e:switch(Vt(f,u,r),u){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 ut(t),Ed(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=Z.current,Br(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,u=Bt,u!==null)switch(u.tag){case 27:case 5:r=u.memoizedProps}e[Ht]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Hv(e.nodeValue,n)),e||ul(t,!0)}else e=Pi(e).createTextNode(r),e[Ht]=t,t.stateNode=e}return ut(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Br(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 Fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),e=!1}else n=zu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(vn(t),t):(vn(t),null);if((t.flags&128)!==0)throw Error(i(558))}return ut(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Br(t),r!==null&&r.dehydrated!==null){if(e===null){if(!u)throw Error(i(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(i(317));u[Ht]=t}else Fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),u=!1}else u=zu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(vn(t),t):(vn(t),null)}return vn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,u=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(u=r.alternate.memoizedState.cachePool.pool),f=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(f=r.memoizedState.cachePool.pool),f!==u&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ei(t,t.updateQueue),ut(t),null);case 4:return me(),e===null&&Kd(t.stateNode.containerInfo),ut(t),null;case 10:return Oa(t.type),ut(t),null;case 19:if(P(xt),r=t.memoizedState,r===null)return ut(t),null;if(u=(t.flags&128)!==0,f=r.rendering,f===null)if(u)Zs(r,!1);else{if(vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=fi(e),f!==null){for(t.flags|=128,Zs(r,!1),e=f.updateQueue,t.updateQueue=e,Ei(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)gp(n,e),n=n.sibling;return Q(xt,xt.current&1|2),qe&&_a(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&$t()>Ai&&(t.flags|=128,u=!0,Zs(r,!1),t.lanes=4194304)}else{if(!u)if(e=fi(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Ei(t,e),Zs(r,!0),r.tail===null&&r.tailMode==="hidden"&&!f.alternate&&!qe)return ut(t),null}else 2*$t()-r.renderingStartTime>Ai&&n!==536870912&&(t.flags|=128,u=!0,Zs(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=$t(),e.sibling=null,n=xt.current,Q(xt,u?n&1|2:n&1),qe&&_a(t,r.treeForkCount),e):(ut(t),null);case 22:case 23:return vn(t),Xu(),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&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(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&&P(Jl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Oa(Ct),ut(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function tw(e,t){switch(Ou(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Oa(Ct),me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(vn(t),t.alternate===null)throw Error(i(340));Fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(vn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(xt),null;case 4:return me(),null;case 10:return Oa(t.type),null;case 22:case 23:return vn(t),Xu(),e!==null&&P(Jl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Oa(Ct),null;case 25:return null;default:return null}}function Ig(e,t){switch(Ou(t),t.tag){case 3:Oa(Ct),me();break;case 26:case 27:case 5:Ae(t);break;case 4:me();break;case 31:t.memoizedState!==null&&vn(t);break;case 13:vn(t);break;case 19:P(xt);break;case 10:Oa(t.type);break;case 22:case 23:vn(t),Xu(),e!==null&&P(Jl);break;case 24:Oa(Ct)}}function Js(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var u=r.next;n=u;do{if((n.tag&e)===e){r=void 0;var f=n.create,y=n.inst;r=f(),y.destroy=r}n=n.next}while(n!==u)}}catch(R){Fe(t,t.return,R)}}function vl(e,t,n){try{var r=t.updateQueue,u=r!==null?r.lastEffect:null;if(u!==null){var f=u.next;r=f;do{if((r.tag&e)===e){var y=r.inst,R=y.destroy;if(R!==void 0){y.destroy=void 0,u=t;var O=n,G=R;try{G()}catch(J){Fe(u,O,J)}}}r=r.next}while(r!==f)}}catch(J){Fe(t,t.return,J)}}function Gg(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{kp(t,n)}catch(r){Fe(e,e.return,r)}}}function Yg(e,t,n){n.props=ar(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Fe(e,t,r)}}function Ws(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(u){Fe(e,t,u)}}function da(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(u){Fe(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){Fe(e,t,u)}else n.current=null}function $g(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(u){Fe(e,e.return,u)}}function Rd(e,t,n){try{var r=e.stateNode;jw(r,e.type,n,t),r[Jt]=t}catch(u){Fe(e,e.return,u)}}function Kg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cl(e.type)||e.tag===4}function Nd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kg(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&&Cl(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 Td(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&&Cl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Td(e,t,n),e=e.sibling;e!==null;)Td(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&&Cl(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 Xg(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Vt(t,r,n),t[Ht]=e,t[Jt]=n}catch(f){Fe(e,e.return,f)}}var Ha=!1,Nt=!1,Md=!1,Fg=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function nw(e,t){if(e=e.containerInfo,Qd=Ki,e=op(e),wu(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 u=r.anchorOffset,f=r.focusNode;r=r.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var y=0,R=-1,O=-1,G=0,J=0,te=e,Y=null;t:for(;;){for(var X;te!==n||u!==0&&te.nodeType!==3||(R=y+u),te!==f||r!==0&&te.nodeType!==3||(O=y+r),te.nodeType===3&&(y+=te.nodeValue.length),(X=te.firstChild)!==null;)Y=te,te=X;for(;;){if(te===e)break t;if(Y===n&&++G===u&&(R=y),Y===f&&++J===r&&(O=y),(X=te.nextSibling)!==null)break;te=Y,Y=te.parentNode}te=X}n=R===-1||O===-1?null:{start:R,end:O}}else n=null}n=n||{start:0,end:0}}else n=null;for(Zd={focusedElem:e,selectionRange:n},Ki=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,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++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,u=f.memoizedProps,f=f.memoizedState,r=n.stateNode;try{var ge=ar(n.type,u);e=r.getSnapshotBeforeUpdate(ge,f),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){Fe(n,n.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ef(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,Ot=e;break}Ot=t.return}}function Qg(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pa(e,n),r&4&&Js(5,n);break;case 1:if(Pa(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(y){Fe(n,n.return,y)}else{var u=ar(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Fe(n,n.return,y)}}r&64&&Gg(n),r&512&&Ws(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{kp(e,t)}catch(y){Fe(n,n.return,y)}}break;case 27:t===null&&r&4&&Xg(n);case 26:case 5:Pa(e,n),t===null&&r&4&&$g(n),r&512&&Ws(n,n.return);break;case 12:Pa(e,n);break;case 31:Pa(e,n),r&4&&Wg(e,n);break;case 13:Pa(e,n),r&4&&ev(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=dw.bind(null,n),_w(e,n))));break;case 22:if(r=n.memoizedState!==null||Ha,!r){t=t!==null&&t.memoizedState!==null||Nt,u=Ha;var f=Nt;Ha=r,(Nt=t)&&!f?qa(e,n,(n.subtreeFlags&8772)!==0):Pa(e,n),Ha=u,Nt=f}break;case 30:break;default:Pa(e,n)}}function Zg(e){var t=e.alternate;t!==null&&(e.alternate=null,Zg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ru(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 ft=null,en=!1;function Ba(e,t,n){for(n=n.child;n!==null;)Jg(e,t,n),n=n.sibling}function Jg(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Ra,n)}catch{}switch(n.tag){case 26:Nt||da(n,t),Ba(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Nt||da(n,t);var r=ft,u=en;Cl(n.type)&&(ft=n.stateNode,en=!1),Ba(e,t,n),io(n.stateNode),ft=r,en=u;break;case 5:Nt||da(n,t);case 6:if(r=ft,u=en,ft=null,Ba(e,t,n),ft=r,en=u,ft!==null)if(en)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(n.stateNode)}catch(f){Fe(n,t,f)}else try{ft.removeChild(n.stateNode)}catch(f){Fe(n,t,f)}break;case 18:ft!==null&&(en?(e=ft,Gv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ss(e)):Gv(ft,n.stateNode));break;case 4:r=ft,u=en,ft=n.stateNode.containerInfo,en=!0,Ba(e,t,n),ft=r,en=u;break;case 0:case 11:case 14:case 15:vl(2,n,t),Nt||vl(4,n,t),Ba(e,t,n);break;case 1:Nt||(da(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&Yg(n,t,r)),Ba(e,t,n);break;case 21:Ba(e,t,n);break;case 22:Nt=(r=Nt)||n.memoizedState!==null,Ba(e,t,n),Nt=r;break;default:Ba(e,t,n)}}function Wg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ss(e)}catch(n){Fe(t,t.return,n)}}}function ev(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){Fe(t,t.return,n)}}function aw(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Fg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Fg),t;default:throw Error(i(435,e.tag))}}function Ni(e,t){var n=aw(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var u=fw.bind(null,e,r);r.then(u,u)}})}function tn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var u=n[r],f=e,y=t,R=y;e:for(;R!==null;){switch(R.tag){case 27:if(Cl(R.type)){ft=R.stateNode,en=!1;break e}break;case 5:ft=R.stateNode,en=!1;break e;case 3:case 4:ft=R.stateNode.containerInfo,en=!0;break e}R=R.return}if(ft===null)throw Error(i(160));Jg(f,y,u),ft=null,en=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)tv(t,e),t=t.sibling}var ea=null;function tv(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:tn(t,e),nn(e),r&4&&(vl(3,e,e.return),Js(3,e),vl(5,e,e.return));break;case 1:tn(t,e),nn(e),r&512&&(Nt||n===null||da(n,n.return)),r&64&&Ha&&(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 u=ea;if(tn(t,e),nn(e),r&512&&(Nt||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,u=u.ownerDocument||u;t:switch(r){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Rs]||f[Ht]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(r),u.head.insertBefore(f,u.querySelector("head > title"))),Vt(f,r,n),f[Ht]=e,Dt(f),r=f;break e;case"link":var y=tx("link","href",u).get(r+(n.href||""));if(y){for(var R=0;R<y.length;R++)if(f=y[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)){y.splice(R,1);break t}}f=u.createElement(r),Vt(f,r,n),u.head.appendChild(f);break;case"meta":if(y=tx("meta","content",u).get(r+(n.content||""))){for(R=0;R<y.length;R++)if(f=y[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)){y.splice(R,1);break t}}f=u.createElement(r),Vt(f,r,n),u.head.appendChild(f);break;default:throw Error(i(468,r))}f[Ht]=e,Dt(f),r=f}e.stateNode=r}else nx(u,e.type,e.stateNode);else e.stateNode=ex(u,r,e.memoizedProps);else f!==r?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,r===null?nx(u,e.type,e.stateNode):ex(u,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Rd(e,e.memoizedProps,n.memoizedProps)}break;case 27:tn(t,e),nn(e),r&512&&(Nt||n===null||da(n,n.return)),n!==null&&r&4&&Rd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(tn(t,e),nn(e),r&512&&(Nt||n===null||da(n,n.return)),e.flags&32){u=e.stateNode;try{Mr(u,"")}catch(ge){Fe(e,e.return,ge)}}r&4&&e.stateNode!=null&&(u=e.memoizedProps,Rd(e,u,n!==null?n.memoizedProps:u)),r&1024&&(Md=!0);break;case 6:if(tn(t,e),nn(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ge){Fe(e,e.return,ge)}}break;case 3:if(Ii=null,u=ea,ea=qi(t.containerInfo),tn(t,e),ea=u,nn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ss(t.containerInfo)}catch(ge){Fe(e,e.return,ge)}Md&&(Md=!1,nv(e));break;case 4:r=ea,ea=qi(e.stateNode.containerInfo),tn(t,e),nn(e),ea=r;break;case 12:tn(t,e),nn(e);break;case 31:tn(t,e),nn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ni(e,r)));break;case 13:tn(t,e),nn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Mi=$t()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ni(e,r)));break;case 22:u=e.memoizedState!==null;var O=n!==null&&n.memoizedState!==null,G=Ha,J=Nt;if(Ha=G||u,Nt=J||O,tn(t,e),Nt=J,Ha=G,nn(e),r&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||O||Ha||Nt||lr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){O=n=t;try{if(f=O.stateNode,u)y=f.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{R=O.stateNode;var te=O.memoizedProps.style,Y=te!=null&&te.hasOwnProperty("display")?te.display:null;R.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(ge){Fe(O,O.return,ge)}}}else if(t.tag===6){if(n===null){O=t;try{O.stateNode.nodeValue=u?"":O.memoizedProps}catch(ge){Fe(O,O.return,ge)}}}else if(t.tag===18){if(n===null){O=t;try{var X=O.stateNode;u?Yv(X,!0):Yv(O.stateNode,!1)}catch(ge){Fe(O,O.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:tn(t,e),nn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ni(e,r)));break;case 30:break;case 21:break;default:tn(t,e),nn(e)}}function nn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kg(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var u=n.stateNode,f=Nd(e);Ri(e,f,u);break;case 5:var y=n.stateNode;n.flags&32&&(Mr(y,""),n.flags&=-33);var R=Nd(e);Ri(e,R,y);break;case 3:case 4:var O=n.stateNode.containerInfo,G=Nd(e);Td(e,G,O);break;default:throw Error(i(161))}}catch(J){Fe(e,e.return,J)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function nv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;nv(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;)Qg(e,t.alternate,t),t=t.sibling}function lr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:vl(4,t,t.return),lr(t);break;case 1:da(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Yg(t,t.return,n),lr(t);break;case 27:io(t.stateNode);case 26:case 5:da(t,t.return),lr(t);break;case 22:t.memoizedState===null&&lr(t);break;case 30:lr(t);break;default:lr(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,u=e,f=t,y=f.flags;switch(f.tag){case 0:case 11:case 15:qa(u,f,n),Js(4,f);break;case 1:if(qa(u,f,n),r=f,u=r.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(G){Fe(r,r.return,G)}if(r=f,u=r.updateQueue,u!==null){var R=r.stateNode;try{var O=u.shared.hiddenCallbacks;if(O!==null)for(u.shared.hiddenCallbacks=null,u=0;u<O.length;u++)Op(O[u],R)}catch(G){Fe(r,r.return,G)}}n&&y&64&&Gg(f),Ws(f,f.return);break;case 27:Xg(f);case 26:case 5:qa(u,f,n),n&&r===null&&y&4&&$g(f),Ws(f,f.return);break;case 12:qa(u,f,n);break;case 31:qa(u,f,n),n&&y&4&&Wg(u,f);break;case 13:qa(u,f,n),n&&y&4&&ev(u,f);break;case 22:f.memoizedState===null&&qa(u,f,n),Ws(f,f.return);break;case 30:break;default:qa(u,f,n)}t=t.sibling}}function Ad(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&&Bs(n))}function _d(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Bs(e))}function ta(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)av(e,t,n,r),t=t.sibling}function av(e,t,n,r){var u=t.flags;switch(t.tag){case 0:case 11:case 15:ta(e,t,n,r),u&2048&&Js(9,t);break;case 1:ta(e,t,n,r);break;case 3:ta(e,t,n,r),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Bs(e)));break;case 12:if(u&2048){ta(e,t,n,r),e=t.stateNode;try{var f=t.memoizedProps,y=f.id,R=f.onPostCommit;typeof R=="function"&&R(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(O){Fe(t,t.return,O)}}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,y=t.alternate,t.memoizedState!==null?f._visibility&2?ta(e,t,n,r):eo(e,t):f._visibility&2?ta(e,t,n,r):(f._visibility|=2,Fr(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Ad(y,t);break;case 24:ta(e,t,n,r),u&2048&&_d(t.alternate,t);break;default:ta(e,t,n,r)}}function Fr(e,t,n,r,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,y=t,R=n,O=r,G=y.flags;switch(y.tag){case 0:case 11:case 15:Fr(f,y,R,O,u),Js(8,y);break;case 23:break;case 22:var J=y.stateNode;y.memoizedState!==null?J._visibility&2?Fr(f,y,R,O,u):eo(f,y):(J._visibility|=2,Fr(f,y,R,O,u)),u&&G&2048&&Ad(y.alternate,y);break;case 24:Fr(f,y,R,O,u),u&&G&2048&&_d(y.alternate,y);break;default:Fr(f,y,R,O,u)}t=t.sibling}}function eo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,u=r.flags;switch(r.tag){case 22:eo(n,r),u&2048&&Ad(r.alternate,r);break;case 24:eo(n,r),u&2048&&_d(r.alternate,r);break;default:eo(n,r)}t=t.sibling}}var to=8192;function Qr(e,t,n){if(e.subtreeFlags&to)for(e=e.child;e!==null;)lv(e,t,n),e=e.sibling}function lv(e,t,n){switch(e.tag){case 26:Qr(e,t,n),e.flags&to&&e.memoizedState!==null&&Iw(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=to,to=16777216,Qr(e,t,n),to=r):Qr(e,t,n));break;default:Qr(e,t,n)}}function rv(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 no(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];Ot=r,ov(r,e)}rv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)sv(e),e=e.sibling}function sv(e){switch(e.tag){case 0:case 11:case 15:no(e),e.flags&2048&&vl(9,e,e.return);break;case 3:no(e);break;case 12:no(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)):no(e);break;default:no(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];Ot=r,ov(r,e)}rv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vl(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 ov(e,t){for(;Ot!==null;){var n=Ot;switch(n.tag){case 0:case 11:case 15:vl(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:Bs(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Ot=r;else e:for(n=e;Ot!==null;){r=Ot;var u=r.sibling,f=r.return;if(Zg(r),r===n){Ot=null;break e}if(u!==null){u.return=f,Ot=u;break e}Ot=f}}}var lw={getCacheForType:function(e){var t=Pt(Ct),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Pt(Ct).controller.signal}},rw=typeof WeakMap=="function"?WeakMap:Map,$e=0,ot=null,ze=null,Be=0,Xe=0,xn=null,xl=!1,Zr=!1,Dd=!1,Va=0,vt=0,yl=0,rr=0,Od=0,yn=0,Jr=0,ao=null,an=null,kd=!1,Mi=0,iv=0,Ai=1/0,_i=null,bl=null,Mt=0,Sl=null,Wr=null,Ia=0,zd=0,Ld=null,cv=null,lo=0,Ud=null;function bn(){return($e&2)!==0&&Be!==0?Be&-Be:U.T!==null?Id():Em()}function uv(){if(yn===0)if((Be&536870912)===0||qe){var e=Sr;Sr<<=1,(Sr&3932160)===0&&(Sr=262144),yn=e}else yn=536870912;return e=gn.current,e!==null&&(e.flags|=32),yn}function ln(e,t,n){(e===ot&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)&&(es(e,0),wl(e,Be,yn,!1)),Ut(e,n),(($e&2)===0||e!==ot)&&(e===ot&&(($e&2)===0&&(rr|=n),vt===4&&wl(e,Be,yn,!1)),fa(e))}function dv(e,t,n){if(($e&6)!==0)throw Error(i(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ee(e,t),u=r?iw(e,t):Bd(e,t,!0),f=r;do{if(u===0){Zr&&!r&&wl(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!sw(n)){u=Bd(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var R=e;u=ao;var O=R.current.memoizedState.isDehydrated;if(O&&(es(R,y).flags|=256),y=Bd(R,y,!1),y!==2){if(Dd&&!O){R.errorRecoveryDisabledLanes|=f,rr|=f,u=4;break e}f=an,an=u,f!==null&&(an===null?an=f:an.push.apply(an,f))}u=y}if(f=!1,u!==2)continue}}if(u===1){es(e,0),wl(e,t,0,!0);break}e:{switch(r=e,f=u,f){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:wl(r,t,yn,!xl);break e;case 2:an=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(u=Mi+300-$t(),10<u)){if(wl(r,t,yn,!xl),wr(r,0,!0)!==0)break e;Ia=t,r.timeoutHandle=Vv(fv.bind(null,r,n,an,_i,kd,t,yn,rr,Jr,xl,f,"Throttled",-0,0),u);break e}fv(r,n,an,_i,kd,t,yn,rr,Jr,xl,f,null,-0,0)}}break}while(!0);fa(e)}function fv(e,t,n,r,u,f,y,R,O,G,J,te,Y,X){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},lv(t,f,te);var ge=(f&62914560)===f?Mi-$t():(f&4194048)===f?iv-$t():0;if(ge=Gw(te,ge),ge!==null){Ia=f,e.cancelPendingCommit=ge(bv.bind(null,e,t,f,n,r,u,y,R,O,J,te,null,Y,X)),wl(e,f,y,!G);return}}bv(e,t,f,n,r,u,y,R,O)}function sw(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 u=n[r],f=u.getSnapshot;u=u.value;try{if(!mn(f(),u))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 wl(e,t,n,r){t&=~Od,t&=~rr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var u=t;0<u;){var f=31-jt(u),y=1<<f;r[f]=-1,u&=~y}n!==0&&ia(e,n,t)}function Di(){return($e&6)===0?(ro(0),!1):!0}function Hd(){if(ze!==null){if(Xe===0)var e=ze.return;else e=ze,Da=Ql=null,ed(e),Gr=null,qs=0,e=ze;for(;e!==null;)Ig(e.alternate,e),e=e.return;ze=null}}function es(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Rw(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ia=0,Hd(),ot=e,ze=n=Aa(e.current,null),Be=t,Xe=0,xn=null,xl=!1,Zr=Ee(e,t),Dd=!1,Jr=yn=Od=rr=yl=vt=0,an=ao=null,kd=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var u=31-jt(r),f=1<<u;t|=e[u],r&=~f}return Va=t,Wo(),n}function hv(e,t){_e=null,U.H=Fs,t===Ir||t===oi?(t=Mp(),Xe=3):t===Vu?(t=Mp(),Xe=4):Xe=t===gd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,xn=t,ze===null&&(vt=1,Si(e,On(t,e.current)))}function mv(){var e=gn.current;return e===null?!0:(Be&4194048)===Be?Un===null:(Be&62914560)===Be||(Be&536870912)!==0?e===Un:!1}function pv(){var e=U.H;return U.H=Fs,e===null?Fs:e}function gv(){var e=U.A;return U.A=lw,e}function Oi(){vt=4,xl||(Be&4194048)!==Be&&gn.current!==null||(Zr=!0),(yl&134217727)===0&&(rr&134217727)===0||ot===null||wl(ot,Be,yn,!1)}function Bd(e,t,n){var r=$e;$e|=2;var u=pv(),f=gv();(ot!==e||Be!==t)&&(_i=null,es(e,t)),t=!1;var y=vt;e:do try{if(Xe!==0&&ze!==null){var R=ze,O=xn;switch(Xe){case 8:Hd(),y=6;break e;case 3:case 2:case 9:case 6:gn.current===null&&(t=!0);var G=Xe;if(Xe=0,xn=null,ts(e,R,O,G),n&&Zr){y=0;break e}break;default:G=Xe,Xe=0,xn=null,ts(e,R,O,G)}}ow(),y=vt;break}catch(J){hv(e,J)}while(!0);return t&&e.shellSuspendCounter++,Da=Ql=null,$e=r,U.H=u,U.A=f,ze===null&&(ot=null,Be=0,Wo()),y}function ow(){for(;ze!==null;)vv(ze)}function iw(e,t){var n=$e;$e|=2;var r=pv(),u=gv();ot!==e||Be!==t?(_i=null,Ai=$t()+500,es(e,t)):Zr=Ee(e,t);e:do try{if(Xe!==0&&ze!==null){t=ze;var f=xn;t:switch(Xe){case 1:Xe=0,xn=null,ts(e,t,f,1);break;case 2:case 9:if(Np(f)){Xe=0,xn=null,xv(t);break}t=function(){Xe!==2&&Xe!==9||ot!==e||(Xe=7),fa(e)},f.then(t,t);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:Np(f)?(Xe=0,xn=null,xv(t)):(Xe=0,xn=null,ts(e,t,f,7));break;case 5:var y=null;switch(ze.tag){case 26:y=ze.memoizedState;case 5:case 27:var R=ze;if(y?ax(y):R.stateNode.complete){Xe=0,xn=null;var O=R.sibling;if(O!==null)ze=O;else{var G=R.return;G!==null?(ze=G,ki(G)):ze=null}break t}}Xe=0,xn=null,ts(e,t,f,5);break;case 6:Xe=0,xn=null,ts(e,t,f,6);break;case 8:Hd(),vt=6;break e;default:throw Error(i(462))}}cw();break}catch(J){hv(e,J)}while(!0);return Da=Ql=null,U.H=r,U.A=u,$e=n,ze!==null?0:(ot=null,Be=0,Wo(),vt)}function cw(){for(;ze!==null&&!ja();)vv(ze)}function vv(e){var t=qg(e.alternate,e,Va);e.memoizedProps=e.pendingProps,t===null?ki(e):ze=t}function xv(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=zg(n,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=zg(n,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:ed(t);default:Ig(n,t),t=ze=gp(t,Va),t=qg(n,t,Va)}e.memoizedProps=e.pendingProps,t===null?ki(e):ze=t}function ts(e,t,n,r){Da=Ql=null,ed(t),Gr=null,qs=0;var u=t.return;try{if(ZS(e,u,t,n,Be)){vt=1,Si(e,On(n,e.current)),ze=null;return}}catch(f){if(u!==null)throw ze=u,f;vt=1,Si(e,On(n,e.current)),ze=null;return}t.flags&32768?(qe||r===1?e=!0:Zr||(Be&536870912)!==0?e=!1:(xl=e=!0,(r===2||r===9||r===3||r===6)&&(r=gn.current,r!==null&&r.tag===13&&(r.flags|=16384))),yv(t,e)):ki(t)}function ki(e){var t=e;do{if((t.flags&32768)!==0){yv(t,xl);return}e=t.return;var n=ew(t.alternate,t,Va);if(n!==null){ze=n;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);vt===0&&(vt=5)}function yv(e,t){do{var n=tw(e.alternate,e);if(n!==null){n.flags&=32767,ze=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ze=e;return}ze=e=n}while(e!==null);vt=6,ze=null}function bv(e,t,n,r,u,f,y,R,O){e.cancelPendingCommit=null;do zi();while(Mt!==0);if(($e&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(f=t.lanes|t.childLanes,f|=Nu,oa(e,n,f,y,R,O),e===ot&&(ze=ot=null,Be=0),Wr=t,Sl=e,Ia=n,zd=f,Ld=u,cv=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,hw(br,function(){return Ev(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=U.T,U.T=null,u=$.p,$.p=2,y=$e,$e|=4;try{nw(e,t,n)}finally{$e=y,$.p=u,U.T=r}}Mt=1,Sv(),wv(),jv()}}function Sv(){if(Mt===1){Mt=0;var e=Sl,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 u=$e;$e|=4;try{tv(t,e);var f=Zd,y=op(e.containerInfo),R=f.focusedElem,O=f.selectionRange;if(y!==R&&R&&R.ownerDocument&&sp(R.ownerDocument.documentElement,R)){if(O!==null&&wu(R)){var G=O.start,J=O.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 X=Y.getSelection(),ge=R.textContent.length,Ce=Math.min(O.start,ge),at=O.end===void 0?Ce:Math.min(O.end,ge);!X.extend&&Ce>at&&(y=at,at=Ce,Ce=y);var B=rp(R,Ce),L=rp(R,at);if(B&&L&&(X.rangeCount!==1||X.anchorNode!==B.node||X.anchorOffset!==B.offset||X.focusNode!==L.node||X.focusOffset!==L.offset)){var I=te.createRange();I.setStart(B.node,B.offset),X.removeAllRanges(),Ce>at?(X.addRange(I),X.extend(L.node,L.offset)):(I.setEnd(L.node,L.offset),X.addRange(I))}}}}for(te=[],X=R;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.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=!!Qd,Zd=Qd=null}finally{$e=u,$.p=r,U.T=n}}e.current=t,Mt=2}}function wv(){if(Mt===2){Mt=0;var e=Sl,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 u=$e;$e|=4;try{Qg(e,t.alternate,t)}finally{$e=u,$.p=r,U.T=n}}Mt=3}}function jv(){if(Mt===4||Mt===3){Mt=0,Ca();var e=Sl,t=Wr,n=Ia,r=cv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Mt=5:(Mt=0,Wr=Sl=null,Cv(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(bl=null),au(n),t=t.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Ra,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=U.T,u=$.p,$.p=2,U.T=null;try{for(var f=e.onRecoverableError,y=0;y<r.length;y++){var R=r[y];f(R.value,{componentStack:R.stack})}}finally{U.T=t,$.p=u}}(Ia&3)!==0&&zi(),fa(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===Ud?lo++:(lo=0,Ud=e):lo=0,ro(0)}}function Cv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Bs(t)))}function zi(){return Sv(),wv(),jv(),Ev()}function Ev(){if(Mt!==5)return!1;var e=Sl,t=zd;zd=0;var n=au(Ia),r=U.T,u=$.p;try{$.p=32>n?32:n,U.T=null,n=Ld,Ld=null;var f=Sl,y=Ia;if(Mt=0,Wr=Sl=null,Ia=0,($e&6)!==0)throw Error(i(331));var R=$e;if($e|=4,sv(f.current),av(f,f.current,y,n),$e=R,ro(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Ra,f)}catch{}return!0}finally{$.p=u,U.T=r,Cv(e,t)}}function Rv(e,t,n){t=On(n,t),t=pd(e.stateNode,t,2),e=ml(e,t,2),e!==null&&(Ut(e,2),fa(e))}function Fe(e,t,n){if(e.tag===3)Rv(e,e,n);else for(;t!==null;){if(t.tag===3){Rv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(bl===null||!bl.has(r))){e=On(n,e),n=Ng(2),r=ml(t,n,2),r!==null&&(Tg(n,r,t,e),Ut(r,2),fa(r));break}}t=t.return}}function Pd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rw;var u=new Set;r.set(t,u)}else u=r.get(t),u===void 0&&(u=new Set,r.set(t,u));u.has(n)||(Dd=!0,u.add(n),e=uw.bind(null,e,t,n),t.then(e,e))}function uw(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ot===e&&(Be&n)===n&&(vt===4||vt===3&&(Be&62914560)===Be&&300>$t()-Mi?($e&2)===0&&es(e,0):Od|=n,Jr===Be&&(Jr=0)),fa(e)}function Nv(e,t){t===0&&(t=st()),e=Kl(e,t),e!==null&&(Ut(e,t),fa(e))}function dw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Nv(e,n)}function fw(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,u=e.memoizedState;u!==null&&(n=u.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),Nv(e,n)}function hw(e,t){return Qn(e,t)}var Li=null,ns=null,qd=!1,Ui=!1,Vd=!1,jl=0;function fa(e){e!==ns&&e.next===null&&(ns===null?Li=ns=e:ns=ns.next=e),Ui=!0,qd||(qd=!0,pw())}function ro(e,t){if(!Vd&&Ui){Vd=!0;do for(var n=!1,r=Li;r!==null;){if(e!==0){var u=r.pendingLanes;if(u===0)var f=0;else{var y=r.suspendedLanes,R=r.pingedLanes;f=(1<<31-jt(42|e)+1)-1,f&=u&~(y&~R),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,_v(r,f))}else f=Be,f=wr(r,r===ot?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(f&3)===0||Ee(r,f)||(n=!0,_v(r,f));r=r.next}while(n);Vd=!1}}function mw(){Tv()}function Tv(){Ui=qd=!1;var e=0;jl!==0&&Ew()&&(e=jl);for(var t=$t(),n=null,r=Li;r!==null;){var u=r.next,f=Mv(r,t);f===0?(r.next=null,n===null?Li=u:n.next=u,u===null&&(ns=n)):(n=r,(e!==0||(f&3)!==0)&&(Ui=!0)),r=u}Mt!==0&&Mt!==5||ro(e),jl!==0&&(jl=0)}function Mv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var y=31-jt(f),R=1<<y,O=u[y];O===-1?((R&n)===0||(R&r)!==0)&&(u[y]=Ke(R,t)):O<=t&&(e.expiredLanes|=R),f&=~R}if(t=ot,n=Be,n=wr(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&hn(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ee(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&hn(r),au(n)){case 2:case 8:n=Ea;break;case 32:n=br;break;case 268435456:n=ql;break;default:n=br}return r=Av.bind(null,e),n=Qn(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&hn(r),e.callbackPriority=2,e.callbackNode=null,2}function Av(e,t){if(Mt!==0&&Mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(zi()&&e.callbackNode!==n)return null;var r=Be;return r=wr(e,e===ot?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(dv(e,r,t),Mv(e,$t()),e.callbackNode!=null&&e.callbackNode===n?Av.bind(null,e):null)}function _v(e,t){if(zi())return null;dv(e,t,!0)}function pw(){Nw(function(){($e&6)!==0?Qn(Kt,mw):Tv()})}function Id(){if(jl===0){var e=qr;e===0&&(e=Vl,Vl<<=1,(Vl&261888)===0&&(Vl=256)),jl=e}return jl}function Dv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yo(""+e)}function Ov(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 gw(e,t,n,r,u){if(t==="submit"&&n&&n.stateNode===u){var f=Dv((u[Jt]||null).action),y=r.submitter;y&&(t=(t=y[Jt]||null)?Dv(t.formAction):y.getAttribute("formAction"),t!==null&&(f=t,y=null));var R=new Fo("action","action",null,r,u);e.push({event:R,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jl!==0){var O=y?Ov(u,y):new FormData(u);cd(n,{pending:!0,data:O,method:u.method,action:f},null,O)}}else typeof f=="function"&&(R.preventDefault(),O=y?Ov(u,y):new FormData(u),cd(n,{pending:!0,data:O,method:u.method,action:f},f,O))},currentTarget:u}]})}}for(var Gd=0;Gd<Ru.length;Gd++){var Yd=Ru[Gd],vw=Yd.toLowerCase(),xw=Yd[0].toUpperCase()+Yd.slice(1);Wn(vw,"on"+xw)}Wn(up,"onAnimationEnd"),Wn(dp,"onAnimationIteration"),Wn(fp,"onAnimationStart"),Wn("dblclick","onDoubleClick"),Wn("focusin","onFocus"),Wn("focusout","onBlur"),Wn(kS,"onTransitionRun"),Wn(zS,"onTransitionStart"),Wn(LS,"onTransitionCancel"),Wn(hp,"onTransitionEnd"),Nr("onMouseEnter",["mouseout","mouseover"]),Nr("onMouseLeave",["mouseout","mouseover"]),Nr("onPointerEnter",["pointerout","pointerover"]),Nr("onPointerLeave",["pointerout","pointerover"]),Il("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Il("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Il("onBeforeInput",["compositionend","keypress","textInput","paste"]),Il("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Il("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Il("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var so="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(" "),yw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(so));function kv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],u=r.event;r=r.listeners;e:{var f=void 0;if(t)for(var y=r.length-1;0<=y;y--){var R=r[y],O=R.instance,G=R.currentTarget;if(R=R.listener,O!==f&&u.isPropagationStopped())break e;f=R,u.currentTarget=G;try{f(u)}catch(J){Jo(J)}u.currentTarget=null,f=O}else for(y=0;y<r.length;y++){if(R=r[y],O=R.instance,G=R.currentTarget,R=R.listener,O!==f&&u.isPropagationStopped())break e;f=R,u.currentTarget=G;try{f(u)}catch(J){Jo(J)}u.currentTarget=null,f=O}}}}function Le(e,t){var n=t[lu];n===void 0&&(n=t[lu]=new Set);var r=e+"__bubble";n.has(r)||(zv(t,e,2,!1),n.add(r))}function $d(e,t,n){var r=0;t&&(r|=4),zv(n,e,r,t)}var Hi="_reactListening"+Math.random().toString(36).slice(2);function Kd(e){if(!e[Hi]){e[Hi]=!0,Tm.forEach(function(n){n!=="selectionchange"&&(yw.has(n)||$d(n,!1,e),$d(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hi]||(t[Hi]=!0,$d("selectionchange",!1,t))}}function zv(e,t,n,r){switch(ux(t)){case 2:var u=Kw;break;case 8:u=Xw;break;default:u=cf}n=u.bind(null,t,n,e),u=void 0,!hu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),r?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function Xd(e,t,n,r,u){var f=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var y=r.tag;if(y===3||y===4){var R=r.stateNode.containerInfo;if(R===u)break;if(y===4)for(y=r.return;y!==null;){var O=y.tag;if((O===3||O===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;R!==null;){if(y=Cr(R),y===null)return;if(O=y.tag,O===5||O===6||O===26||O===27){r=f=y;continue e}R=R.parentNode}}r=r.return}Pm(function(){var G=f,J=du(n),te=[];e:{var Y=mp.get(e);if(Y!==void 0){var X=Fo,ge=e;switch(e){case"keypress":if(Ko(n)===0)break e;case"keydown":case"keyup":X=fS;break;case"focusin":ge="focus",X=vu;break;case"focusout":ge="blur",X=vu;break;case"beforeblur":case"afterblur":X=vu;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":X=Im;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=eS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=pS;break;case up:case dp:case fp:X=aS;break;case hp:X=vS;break;case"scroll":case"scrollend":X=J1;break;case"wheel":X=yS;break;case"copy":case"cut":case"paste":X=rS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Ym;break;case"toggle":case"beforetoggle":X=SS}var Ce=(t&4)!==0,at=!Ce&&(e==="scroll"||e==="scrollend"),B=Ce?Y!==null?Y+"Capture":null:Y;Ce=[];for(var L=G,I;L!==null;){var ee=L;if(I=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||I===null||B===null||(ee=Ts(L,B),ee!=null&&Ce.push(oo(L,ee,I))),at)break;L=L.return}0<Ce.length&&(Y=new X(Y,ge,null,n,J),te.push({event:Y,listeners:Ce}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",X=e==="mouseout"||e==="pointerout",Y&&n!==uu&&(ge=n.relatedTarget||n.fromElement)&&(Cr(ge)||ge[jr]))break e;if((X||Y)&&(Y=J.window===J?J:(Y=J.ownerDocument)?Y.defaultView||Y.parentWindow:window,X?(ge=n.relatedTarget||n.toElement,X=G,ge=ge?Cr(ge):null,ge!==null&&(at=d(ge),Ce=ge.tag,ge!==at||Ce!==5&&Ce!==27&&Ce!==6)&&(ge=null)):(X=null,ge=G),X!==ge)){if(Ce=Im,ee="onMouseLeave",B="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Ym,ee="onPointerLeave",B="onPointerEnter",L="pointer"),at=X==null?Y:Ns(X),I=ge==null?Y:Ns(ge),Y=new Ce(ee,L+"leave",X,n,J),Y.target=at,Y.relatedTarget=I,ee=null,Cr(J)===G&&(Ce=new Ce(B,L+"enter",ge,n,J),Ce.target=I,Ce.relatedTarget=at,ee=Ce),at=ee,X&&ge)t:{for(Ce=bw,B=X,L=ge,I=0,ee=B;ee;ee=Ce(ee))I++;ee=0;for(var be=L;be;be=Ce(be))ee++;for(;0<I-ee;)B=Ce(B),I--;for(;0<ee-I;)L=Ce(L),ee--;for(;I--;){if(B===L||L!==null&&B===L.alternate){Ce=B;break t}B=Ce(B),L=Ce(L)}Ce=null}else Ce=null;X!==null&&Lv(te,Y,X,Ce,!1),ge!==null&&at!==null&&Lv(te,at,ge,Ce,!0)}}e:{if(Y=G?Ns(G):window,X=Y.nodeName&&Y.nodeName.toLowerCase(),X==="select"||X==="input"&&Y.type==="file")var Ie=Wm;else if(Zm(Y))if(ep)Ie=_S;else{Ie=MS;var ve=TS}else X=Y.nodeName,!X||X.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?G&&cu(G.elementType)&&(Ie=Wm):Ie=AS;if(Ie&&(Ie=Ie(e,G))){Jm(te,Ie,n,J);break e}ve&&ve(e,Y,G),e==="focusout"&&G&&Y.type==="number"&&G.memoizedProps.value!=null&&iu(Y,"number",Y.value)}switch(ve=G?Ns(G):window,e){case"focusin":(Zm(ve)||ve.contentEditable==="true")&&(Or=ve,ju=G,Ls=null);break;case"focusout":Ls=ju=Or=null;break;case"mousedown":Cu=!0;break;case"contextmenu":case"mouseup":case"dragend":Cu=!1,ip(te,n,J);break;case"selectionchange":if(OS)break;case"keydown":case"keyup":ip(te,n,J)}var De;if(yu)e:{switch(e){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else Dr?Fm(e,n)&&(Pe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Pe="onCompositionStart");Pe&&($m&&n.locale!=="ko"&&(Dr||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&Dr&&(De=qm()):(ol=J,mu="value"in ol?ol.value:ol.textContent,Dr=!0)),ve=Bi(G,Pe),0<ve.length&&(Pe=new Gm(Pe,e,null,n,J),te.push({event:Pe,listeners:ve}),De?Pe.data=De:(De=Qm(n),De!==null&&(Pe.data=De)))),(De=jS?CS(e,n):ES(e,n))&&(Pe=Bi(G,"onBeforeInput"),0<Pe.length&&(ve=new Gm("onBeforeInput","beforeinput",null,n,J),te.push({event:ve,listeners:Pe}),ve.data=De)),gw(te,e,G,n,J)}kv(te,t)})}function oo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Bi(e,t){for(var n=t+"Capture",r=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Ts(e,n),u!=null&&r.unshift(oo(e,u,f)),u=Ts(e,t),u!=null&&r.push(oo(e,u,f))),e.tag===3)return r;e=e.return}return[]}function bw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Lv(e,t,n,r,u){for(var f=t._reactName,y=[];n!==null&&n!==r;){var R=n,O=R.alternate,G=R.stateNode;if(R=R.tag,O!==null&&O===r)break;R!==5&&R!==26&&R!==27||G===null||(O=G,u?(G=Ts(n,f),G!=null&&y.unshift(oo(n,G,O))):u||(G=Ts(n,f),G!=null&&y.push(oo(n,G,O)))),n=n.return}y.length!==0&&e.push({event:t,listeners:y})}var Sw=/\r\n?/g,ww=/\u0000|\uFFFD/g;function Uv(e){return(typeof e=="string"?e:""+e).replace(Sw,`
|
|
49
|
-
`).replace(ww,"")}function Hv(e,t){return t=Uv(t),Uv(e)===t}function nt(e,t,n,r,u,f){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Mr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Mr(e,""+r);break;case"className":Io(e,"class",r);break;case"tabIndex":Io(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Io(e,n,r);break;case"style":Hm(e,r,f);break;case"data":if(t!=="object"){Io(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"&&nt(e,t,"name",u.name,u,null),nt(e,t,"formEncType",u.formEncType,u,null),nt(e,t,"formMethod",u.formMethod,u,null),nt(e,t,"formTarget",u.formTarget,u,null)):(nt(e,t,"encType",u.encType,u,null),nt(e,t,"method",u.method,u,null),nt(e,t,"target",u.target,u,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&&Le("scroll",e);break;case"onScrollEnd":r!=null&&Le("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(u.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":Le("beforetoggle",e),Le("toggle",e),Vo(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":Vo(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=Q1.get(n)||n,Vo(e,n,r))}}function Fd(e,t,n,r,u,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(u.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Mr(e,r):(typeof r=="number"||typeof r=="bigint")&&Mr(e,""+r);break;case"onScroll":r!=null&&Le("scroll",e);break;case"onScrollEnd":r!=null&&Le("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"&&(u=n.endsWith("Capture"),t=n.slice(2,u?n.length-7:void 0),f=e[Jt]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof r=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,u);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):Vo(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":Le("error",e),Le("load",e);var r=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var y=n[f];if(y!=null)switch(f){case"src":r=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:nt(e,t,f,y,n,null)}}u&&nt(e,t,"srcSet",n.srcSet,n,null),r&&nt(e,t,"src",n.src,n,null);return;case"input":Le("invalid",e);var R=f=y=u=null,O=null,G=null;for(r in n)if(n.hasOwnProperty(r)){var J=n[r];if(J!=null)switch(r){case"name":u=J;break;case"type":y=J;break;case"checked":O=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:nt(e,t,r,J,n,null)}}km(e,f,R,O,G,y,u,!1);return;case"select":Le("invalid",e),r=y=f=null;for(u in n)if(n.hasOwnProperty(u)&&(R=n[u],R!=null))switch(u){case"value":f=R;break;case"defaultValue":y=R;break;case"multiple":r=R;default:nt(e,t,u,R,n,null)}t=f,n=y,e.multiple=!!r,t!=null?Tr(e,!!r,t,!1):n!=null&&Tr(e,!!r,n,!0);return;case"textarea":Le("invalid",e),f=u=r=null;for(y in n)if(n.hasOwnProperty(y)&&(R=n[y],R!=null))switch(y){case"value":r=R;break;case"defaultValue":u=R;break;case"children":f=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(i(91));break;default:nt(e,t,y,R,n,null)}Lm(e,r,u,f);return;case"option":for(O in n)if(n.hasOwnProperty(O)&&(r=n[O],r!=null))switch(O){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:nt(e,t,O,r,n,null)}return;case"dialog":Le("beforetoggle",e),Le("toggle",e),Le("cancel",e),Le("close",e);break;case"iframe":case"object":Le("load",e);break;case"video":case"audio":for(r=0;r<so.length;r++)Le(so[r],e);break;case"image":Le("error",e),Le("load",e);break;case"details":Le("toggle",e);break;case"embed":case"source":case"link":Le("error",e),Le("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:nt(e,t,G,r,n,null)}return;default:if(cu(t)){for(J in n)n.hasOwnProperty(J)&&(r=n[J],r!==void 0&&Fd(e,t,J,r,n,void 0));return}}for(R in n)n.hasOwnProperty(R)&&(r=n[R],r!=null&&nt(e,t,R,r,n,null))}function jw(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 u=null,f=null,y=null,R=null,O=null,G=null,J=null;for(X in n){var te=n[X];if(n.hasOwnProperty(X)&&te!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":O=te;default:r.hasOwnProperty(X)||nt(e,t,X,null,r,te)}}for(var Y in r){var X=r[Y];if(te=n[Y],r.hasOwnProperty(Y)&&(X!=null||te!=null))switch(Y){case"type":f=X;break;case"name":u=X;break;case"checked":G=X;break;case"defaultChecked":J=X;break;case"value":y=X;break;case"defaultValue":R=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,t));break;default:X!==te&&nt(e,t,Y,X,r,te)}}ou(e,y,R,O,G,J,f,u);return;case"select":X=y=R=Y=null;for(f in n)if(O=n[f],n.hasOwnProperty(f)&&O!=null)switch(f){case"value":break;case"multiple":X=O;default:r.hasOwnProperty(f)||nt(e,t,f,null,r,O)}for(u in r)if(f=r[u],O=n[u],r.hasOwnProperty(u)&&(f!=null||O!=null))switch(u){case"value":Y=f;break;case"defaultValue":R=f;break;case"multiple":y=f;default:f!==O&&nt(e,t,u,f,r,O)}t=R,n=y,r=X,Y!=null?Tr(e,!!n,Y,!1):!!r!=!!n&&(t!=null?Tr(e,!!n,t,!0):Tr(e,!!n,n?[]:"",!1));return;case"textarea":X=Y=null;for(R in n)if(u=n[R],n.hasOwnProperty(R)&&u!=null&&!r.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:nt(e,t,R,null,r,u)}for(y in r)if(u=r[y],f=n[y],r.hasOwnProperty(y)&&(u!=null||f!=null))switch(y){case"value":Y=u;break;case"defaultValue":X=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(i(91));break;default:u!==f&&nt(e,t,y,u,r,f)}zm(e,Y,X);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:nt(e,t,ge,null,r,Y)}for(O in r)if(Y=r[O],X=n[O],r.hasOwnProperty(O)&&Y!==X&&(Y!=null||X!=null))switch(O){case"selected":e.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:nt(e,t,O,Y,r,X)}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 Ce in n)Y=n[Ce],n.hasOwnProperty(Ce)&&Y!=null&&!r.hasOwnProperty(Ce)&&nt(e,t,Ce,null,r,Y);for(G in r)if(Y=r[G],X=n[G],r.hasOwnProperty(G)&&Y!==X&&(Y!=null||X!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,t));break;default:nt(e,t,G,Y,r,X)}return;default:if(cu(t)){for(var at in n)Y=n[at],n.hasOwnProperty(at)&&Y!==void 0&&!r.hasOwnProperty(at)&&Fd(e,t,at,void 0,r,Y);for(J in r)Y=r[J],X=n[J],!r.hasOwnProperty(J)||Y===X||Y===void 0&&X===void 0||Fd(e,t,J,Y,r,X);return}}for(var B in n)Y=n[B],n.hasOwnProperty(B)&&Y!=null&&!r.hasOwnProperty(B)&&nt(e,t,B,null,r,Y);for(te in r)Y=r[te],X=n[te],!r.hasOwnProperty(te)||Y===X||Y==null&&X==null||nt(e,t,te,Y,r,X)}function Bv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Cw(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var u=n[r],f=u.transferSize,y=u.initiatorType,R=u.duration;if(f&&R&&Bv(y)){for(y=0,R=u.responseEnd,r+=1;r<n.length;r++){var O=n[r],G=O.startTime;if(G>R)break;var J=O.transferSize,te=O.initiatorType;J&&Bv(te)&&(O=O.responseEnd,y+=J*(O<R?1:(R-G)/(O-G)))}if(--r,t+=8*(f+y)/(u.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 Qd=null,Zd=null;function Pi(e){return e.nodeType===9?e:e.ownerDocument}function Pv(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 qv(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 Jd(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 Wd=null;function Ew(){var e=window.event;return e&&e.type==="popstate"?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Vv=typeof setTimeout=="function"?setTimeout:void 0,Rw=typeof clearTimeout=="function"?clearTimeout:void 0,Iv=typeof Promise=="function"?Promise:void 0,Nw=typeof queueMicrotask=="function"?queueMicrotask:typeof Iv<"u"?function(e){return Iv.resolve(null).then(e).catch(Tw)}:Vv;function Tw(e){setTimeout(function(){throw e})}function Cl(e){return e==="head"}function Gv(e,t){var n=t,r=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(u),ss(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")io(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,io(n);for(var f=n.firstChild;f;){var y=f.nextSibling,R=f.nodeName;f[Rs]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=y}}else n==="body"&&io(e.ownerDocument.body);n=u}while(n);ss(t)}function Yv(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 ef(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":ef(n),ru(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 u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Rs])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!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Hn(e.nextSibling),e===null)break}return null}function Aw(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 $v(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 tf(e){return e.data==="$?"||e.data==="$~"}function nf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _w(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 af=null;function Kv(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 Xv(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 Fv(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 io(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ru(e)}var Bn=new Map,Qv=new Set;function qi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ga=$.d;$.d={f:Dw,r:Ow,D:kw,C:zw,L:Lw,m:Uw,X:Bw,S:Hw,M:Pw};function Dw(){var e=Ga.f(),t=Di();return e||t}function Ow(e){var t=Er(e);t!==null&&t.tag===5&&t.type==="form"?hg(t):Ga.r(e)}var as=typeof document>"u"?null:document;function Zv(e,t,n){var r=as;if(r&&typeof t=="string"&&t){var u=_n(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Qv.has(u)||(Qv.add(u),e={rel:e,crossOrigin:n,href:t},r.querySelector(u)===null&&(t=r.createElement("link"),Vt(t,"link",e),Dt(t),r.head.appendChild(t)))}}function kw(e){Ga.D(e),Zv("dns-prefetch",e,null)}function zw(e,t){Ga.C(e,t),Zv("preconnect",e,t)}function Lw(e,t,n){Ga.L(e,t,n);var r=as;if(r&&e&&t){var u='link[rel="preload"][as="'+_n(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+_n(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+_n(n.imageSizes)+'"]')):u+='[href="'+_n(e)+'"]';var f=u;switch(t){case"style":f=ls(e);break;case"script":f=rs(e)}Bn.has(f)||(e=S({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Bn.set(f,e),r.querySelector(u)!==null||t==="style"&&r.querySelector(co(f))||t==="script"&&r.querySelector(uo(f))||(t=r.createElement("link"),Vt(t,"link",e),Dt(t),r.head.appendChild(t)))}}function Uw(e,t){Ga.m(e,t);var n=as;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+_n(r)+'"][href="'+_n(e)+'"]',f=u;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=rs(e)}if(!Bn.has(f)&&(e=S({rel:"modulepreload",href:e},t),Bn.set(f,e),n.querySelector(u)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(uo(f)))return}r=n.createElement("link"),Vt(r,"link",e),Dt(r),n.head.appendChild(r)}}}function Hw(e,t,n){Ga.S(e,t,n);var r=as;if(r&&e){var u=Rr(r).hoistableStyles,f=ls(e);t=t||"default";var y=u.get(f);if(!y){var R={loading:0,preload:null};if(y=r.querySelector(co(f)))R.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Bn.get(f))&&lf(e,n);var O=y=r.createElement("link");Dt(O),Vt(O,"link",e),O._p=new Promise(function(G,J){O.onload=G,O.onerror=J}),O.addEventListener("load",function(){R.loading|=1}),O.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Vi(y,t,r)}y={type:"stylesheet",instance:y,count:1,state:R},u.set(f,y)}}}function Bw(e,t){Ga.X(e,t);var n=as;if(n&&e){var r=Rr(n).hoistableScripts,u=rs(e),f=r.get(u);f||(f=n.querySelector(uo(u)),f||(e=S({src:e,async:!0},t),(t=Bn.get(u))&&rf(e,t),f=n.createElement("script"),Dt(f),Vt(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(u,f))}}function Pw(e,t){Ga.M(e,t);var n=as;if(n&&e){var r=Rr(n).hoistableScripts,u=rs(e),f=r.get(u);f||(f=n.querySelector(uo(u)),f||(e=S({src:e,async:!0,type:"module"},t),(t=Bn.get(u))&&rf(e,t),f=n.createElement("script"),Dt(f),Vt(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(u,f))}}function Jv(e,t,n,r){var u=(u=Z.current)?qi(u):null;if(!u)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(u).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(u).hoistableStyles,y=f.get(e);if(y||(u=u.ownerDocument||u,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,y),(f=u.querySelector(co(e)))&&!f._p&&(y.instance=f,y.state.loading=5),Bn.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},Bn.set(e,n),f||qw(u,e,n,y.state))),t&&r===null)throw Error(i(528,""));return y}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(u).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="'+_n(e)+'"'}function co(e){return'link[rel="stylesheet"]['+e+"]"}function Wv(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function qw(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),Dt(t),e.head.appendChild(t))}function rs(e){return'[src="'+_n(e)+'"]'}function uo(e){return"script[async]"+e}function ex(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+_n(n.href)+'"]');if(r)return t.instance=r,Dt(r),r;var u=S({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Dt(r),Vt(r,"style",u),Vi(r,n.precedence,e),t.instance=r;case"stylesheet":u=ls(n.href);var f=e.querySelector(co(u));if(f)return t.state.loading|=4,t.instance=f,Dt(f),f;r=Wv(n),(u=Bn.get(u))&&lf(r,u),f=(e.ownerDocument||e).createElement("link"),Dt(f);var y=f;return y._p=new Promise(function(R,O){y.onload=R,y.onerror=O}),Vt(f,"link",r),t.state.loading|=4,Vi(f,n.precedence,e),t.instance=f;case"script":return f=rs(n.src),(u=e.querySelector(uo(f)))?(t.instance=u,Dt(u),u):(r=n,(u=Bn.get(f))&&(r=S({},n),rf(r,u)),e=e.ownerDocument||e,u=e.createElement("script"),Dt(u),Vt(u,"link",r),e.head.appendChild(u),t.instance=u);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,Vi(r,n.precedence,e));return t.instance}function Vi(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=r.length?r[r.length-1]:null,f=u,y=0;y<r.length;y++){var R=r[y];if(R.dataset.precedence===t)f=R;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function lf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function rf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ii=null;function tx(e,t,n){if(Ii===null){var r=new Map,u=Ii=new Map;u.set(n,r)}else u=Ii,r=u.get(n),r||(r=new Map,u.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[Rs]||f[Ht]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var y=f.getAttribute(t)||"";y=e+y;var R=r.get(y);R?R.push(f):r.set(y,[f])}}return r}function nx(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 ax(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Iw(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 u=ls(r.href),f=t.querySelector(co(u));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,Dt(f);return}f=t.ownerDocument||t,r=Wv(r),(u=Bn.get(u))&&lf(r,u),f=f.createElement("link"),Dt(f);var y=f;y._p=new Promise(function(R,O){y.onload=R,y.onerror=O}),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 sf=0;function Gw(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&&sf===0&&(sf=62500*Cw());var u=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>sf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(u)}}: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(Yw,e),Yi=null,Gi.call(e))}function Yw(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 u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var y=u[f];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(n.set(y.dataset.precedence,y),r=y)}r&&n.set(null,r)}u=t.instance,y=u.getAttribute("data-precedence"),f=n.get(y)||r,f===r&&n.set(null,u),n.set(y,u),this.count++,r=Gi.bind(this),u.addEventListener("load",r),u.addEventListener("error",r),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var fo={$$typeof:M,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function $w(e,t,n,r,u,f,y,R,O){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=Xt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xt(0),this.hiddenUpdates=Xt(null),this.identifierPrefix=r,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function lx(e,t,n,r,u,f,y,R,O,G,J,te){return e=new $w(e,t,n,y,O,G,J,te,R),t=1,f===!0&&(t|=24),f=pn(3,null,null,t),e.current=f,f.stateNode=e,t=Bu(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:r,isDehydrated:n,cache:t},Iu(f),e}function rx(e){return e?(e=Lr,e):Lr}function sx(e,t,n,r,u,f){u=rx(u),r.context===null?r.context=u:r.pendingContext=u,r=hl(t),r.payload={element:n},f=f===void 0?null:f,f!==null&&(r.callback=f),n=ml(e,r,t),n!==null&&(ln(n,e,t),Is(n,e,t))}function ox(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function of(e,t){ox(e,t),(e=e.alternate)&&ox(e,t)}function ix(e){if(e.tag===13||e.tag===31){var t=Kl(e,67108864);t!==null&&ln(t,e,67108864),of(e,67108864)}}function cx(e){if(e.tag===13||e.tag===31){var t=bn();t=nu(t);var n=Kl(e,t);n!==null&&ln(n,e,t),of(e,t)}}var Ki=!0;function Kw(e,t,n,r){var u=U.T;U.T=null;var f=$.p;try{$.p=2,cf(e,t,n,r)}finally{$.p=f,U.T=u}}function Xw(e,t,n,r){var u=U.T;U.T=null;var f=$.p;try{$.p=8,cf(e,t,n,r)}finally{$.p=f,U.T=u}}function cf(e,t,n,r){if(Ki){var u=uf(r);if(u===null)Xd(e,t,r,Xi,n),dx(e,r);else if(Qw(u,e,t,n,r))r.stopPropagation();else if(dx(e,r),t&4&&-1<Fw.indexOf(e)){for(;u!==null;){var f=Er(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var y=It(f.pendingLanes);if(y!==0){var R=f;for(R.pendingLanes|=2,R.entangledLanes|=2;y;){var O=1<<31-jt(y);R.entanglements[1]|=O,y&=~O}fa(f),($e&6)===0&&(Ai=$t()+500,ro(0))}}break;case 31:case 13:R=Kl(f,2),R!==null&&ln(R,f,2),Di(),of(f,2)}if(f=uf(r),f===null&&Xd(e,t,r,Xi,n),f===u)break;u=f}u!==null&&r.stopPropagation()}else Xd(e,t,r,null,n)}}function uf(e){return e=du(e),df(e)}var Xi=null;function df(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=m(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 ux(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(Zc()){case Kt:return 2;case Ea:return 8;case br:case Jc:return 32;case ql:return 268435456;default:return 32}default:return 32}}var ff=!1,El=null,Rl=null,Nl=null,ho=new Map,mo=new Map,Tl=[],Fw="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 dx(e,t){switch(e){case"focusin":case"focusout":El=null;break;case"dragenter":case"dragleave":Rl=null;break;case"mouseover":case"mouseout":Nl=null;break;case"pointerover":case"pointerout":ho.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":mo.delete(t.pointerId)}}function po(e,t,n,r,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:f,targetContainers:[u]},t!==null&&(t=Er(t),t!==null&&ix(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function Qw(e,t,n,r,u){switch(t){case"focusin":return El=po(El,e,t,n,r,u),!0;case"dragenter":return Rl=po(Rl,e,t,n,r,u),!0;case"mouseover":return Nl=po(Nl,e,t,n,r,u),!0;case"pointerover":var f=u.pointerId;return ho.set(f,po(ho.get(f)||null,e,t,n,r,u)),!0;case"gotpointercapture":return f=u.pointerId,mo.set(f,po(mo.get(f)||null,e,t,n,r,u)),!0}return!1}function fx(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,Rm(e.priority,function(){cx(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,Rm(e.priority,function(){cx(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=uf(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);uu=r,n.target.dispatchEvent(r),uu=null}else return t=Er(n),t!==null&&ix(t),e.blockedOn=n,!1;t.shift()}return!0}function hx(e,t,n){Fi(e)&&n.delete(t)}function Zw(){ff=!1,El!==null&&Fi(El)&&(El=null),Rl!==null&&Fi(Rl)&&(Rl=null),Nl!==null&&Fi(Nl)&&(Nl=null),ho.forEach(hx),mo.forEach(hx)}function Qi(e,t){e.blockedOn===t&&(e.blockedOn=null,ff||(ff=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Zw)))}var Zi=null;function mx(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],u=e[t+2];if(typeof r!="function"){if(df(r||n)===null)continue;break}var f=Er(n);f!==null&&(e.splice(t,3),t-=3,cd(f,{pending:!0,data:u,method:n.method,action:r},r,u))}}))}function ss(e){function t(O){return Qi(O,e)}El!==null&&Qi(El,e),Rl!==null&&Qi(Rl,e),Nl!==null&&Qi(Nl,e),ho.forEach(t),mo.forEach(t);for(var n=0;n<Tl.length;n++){var r=Tl[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Tl.length&&(n=Tl[0],n.blockedOn===null);)fx(n),n.blockedOn===null&&Tl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var u=n[r],f=n[r+1],y=u[Jt]||null;if(typeof f=="function")y||mx(n);else if(y){var R=null;if(f&&f.hasAttribute("formAction")){if(u=f,y=f[Jt]||null)R=y.formAction;else if(df(u)!==null)continue}else R=y.action;typeof R=="function"?n[r+1]=R:(n.splice(r,3),r-=3),mx(n)}}}function px(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(y){return u=y})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=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,u=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),u!==null&&(u(),u=null)}}}function hf(e){this._internalRoot=e}Ji.prototype.render=hf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current,r=bn();sx(n,r,e,t,null,null)},Ji.prototype.unmount=hf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sx(e.current,2,null,e,null,null),Di(),t[jr]=null}};function Ji(e){this._internalRoot=e}Ji.prototype.unstable_scheduleHydration=function(e){if(e){var t=Em();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Tl.length&&t!==0&&t<Tl[n].priority;n++);Tl.splice(n,0,e),n===0&&fx(e)}};var gx=l.version;if(gx!=="19.2.8")throw Error(i(527,gx,"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?b(e):null,e=e===null?null:e.stateNode,e};var Jw={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(Jw),wt=Wi}catch{}}return vo.createRoot=function(e,t){if(!c(e))throw Error(i(299));var n=!1,r="",u=jg,f=Cg,y=Eg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=lx(e,1,!1,null,null,n,r,null,u,f,y,px),e[jr]=t.current,Kd(e),new hf(t)},vo.hydrateRoot=function(e,t,n){if(!c(e))throw Error(i(299));var r=!1,u="",f=jg,y=Cg,R=Eg,O=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(y=n.onCaughtError),n.onRecoverableError!==void 0&&(R=n.onRecoverableError),n.formState!==void 0&&(O=n.formState)),t=lx(e,1,!0,t,n??null,r,u,O,f,y,R,px),t.context=rx(null),n=t.current,r=bn(),r=nu(r),u=hl(r),u.callback=null,ml(n,u,r),n=r,t.current.lanes=n,Ut(t,n),fa(t),e[jr]=t.current,Kd(e),new Ji(t)},vo.version="19.2.8",vo}var Mx;function ij(){if(Mx)return vf.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(),vf.exports=oj(),vf.exports}var cj=ij();const uj=gh(cj);/**
|
|
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 xh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Sy=/^[\\/]{2}/;function dj(a,l){return l+a.replace(/\\/g,"/")}var Ax="popstate";function _x(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function fj(a={}){function l(i,c){var v;let d=(v=c.state)==null?void 0:v.masked,{pathname:h,search:m,hash:g}=d||i.location;return Pf("",{pathname:h,search:m,hash:g},c.state&&c.state.usr||null,c.state&&c.state.key||"default",d?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function o(i,c){return typeof c=="string"?c:Co(c)}return mj(l,o,null,a)}function ht(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function Yn(a,l){if(!a){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function hj(){return Math.random().toString(36).substring(2,10)}function Dx(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,c){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof l=="string"?gs(l):l,state:o,key:l&&l.key||i||hj(),mask:c}}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 gs(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 mj(a,l,o,i={}){let{window:c=document.defaultView,v5Compat:d=!1}=i,h=c.history,m="POP",g=null,v=b();v==null&&(v=0,h.replaceState({...h.state,idx:v},""));function b(){return(h.state||{idx:null}).idx}function S(){m="POP";let C=b(),T=C==null?null:C-v;v=C,g&&g({action:m,location:j.location,delta:T})}function x(C,T){m="PUSH";let N=_x(C)?C:Pf(j.location,C,T);v=b()+1;let M=Dx(N,v),A=j.createHref(N.mask||N);try{h.pushState(M,"",A)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;c.location.assign(A)}d&&g&&g({action:m,location:j.location,delta:1})}function w(C,T){m="REPLACE";let N=_x(C)?C:Pf(j.location,C,T);v=b();let M=Dx(N,v),A=j.createHref(N.mask||N);h.replaceState(M,"",A),d&&g&&g({action:m,location:j.location,delta:0})}function E(C){return pj(c,C)}let j={get action(){return m},get location(){return a(c,h)},listen(C){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(Ax,S),g=C,()=>{c.removeEventListener(Ax,S),g=null}},createHref(C){return l(c,C)},createURL:E,encodeLocation(C){let T=E(C);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:x,replace:w,go(C){return h.go(C)}};return j}function pj(a,l,o=!1){let i="http://localhost";a&&(i=a.location.origin!=="null"?a.location.origin:a.location.href),ht(i,"No window.location.(origin|href) available to create URL");let c=typeof l=="string"?l:Co(l);return c=c.replace(/ $/,"%20"),!o&&Sy.test(c)&&(c=i+c),new URL(c,i)}function wy(a,l,o="/"){return gj(a,l,o,!1)}function gj(a,l,o,i,c){let d=typeof l=="string"?gs(l):l,h=Qa(d.pathname||"/",o);if(h==null)return null;let m=vj(a),g=null,v=Tj(h);for(let b=0;g==null&&b<m.length;++b)g=Nj(m[b],v,i);return g}function vj(a){let l=jy(a);return xj(l),l}function jy(a,l=[],o=[],i="",c=!1){let d=(h,m,g=c,v)=>{let b={relativePath:v===void 0?h.path||"":v,caseSensitive:h.caseSensitive===!0,childrenIndex:m,route:h};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(i)&&g)return;ht(b.relativePath.startsWith(i),`Absolute route path "${b.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(i.length)}let S=la([i,b.relativePath]),x=o.concat(b);h.children&&h.children.length>0&&(ht(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${S}".`),jy(h.children,l,x,S,g)),!(h.path==null&&!h.index)&&l.push({path:S,score:Ej(S,h.index),routesMeta:x.map((w,E)=>{let[j,C]=Ry(w.relativePath,w.caseSensitive,E===x.length-1);return{...w,matcher:j,compiledParams:C}})})};return a.forEach((h,m)=>{var g;if(h.path===""||!((g=h.path)!=null&&g.includes("?")))d(h,m);else for(let v of Cy(h.path))d(h,m,!0,v)}),l}function Cy(a){let l=a.split("/");if(l.length===0)return[];let[o,...i]=l,c=o.endsWith("?"),d=o.replace(/\?$/,"");if(i.length===0)return c?[d,""]:[d];let h=Cy(i.join("/")),m=[];return m.push(...h.map(g=>g===""?d:[d,g].join("/"))),c&&m.push(...h),m.map(g=>a.startsWith("/")&&g===""?"/":g)}function xj(a){a.sort((l,o)=>l.score!==o.score?o.score-l.score:Rj(l.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var yj=/^:[\w-]+$/,bj=3,Sj=2,wj=1,jj=10,Cj=-2,Ox=a=>a==="*";function Ej(a,l){let o=a.split("/"),i=o.length;return o.some(Ox)&&(i+=Cj),l&&(i+=Sj),o.filter(c=>!Ox(c)).reduce((c,d)=>c+(yj.test(d)?bj:d===""?wj:jj),i)}function Rj(a,l){return a.length===l.length&&a.slice(0,-1).every((i,c)=>i===l[c])?a[a.length-1]-l[l.length-1]:0}function Nj(a,l,o=!1){let{routesMeta:i}=a,c={},d="/",h=[];for(let m=0;m<i.length;++m){let g=i[m],v=m===i.length-1,b=d==="/"?l:l.slice(d.length)||"/",S={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},x=g.matcher&&g.compiledParams?Ey(S,b,g.matcher,g.compiledParams):yc(S,b),w=g.route;if(!x&&v&&o&&!i[i.length-1].route.index&&(x=yc({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!x)return null;Object.assign(c,x.params),h.push({params:c,pathname:la([d,x.pathname]),pathnameBase:_j(la([d,x.pathnameBase])),route:w}),x.pathnameBase!=="/"&&(d=la([d,x.pathnameBase]))}return h}function yc(a,l){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[o,i]=Ry(a.path,a.caseSensitive,a.end);return Ey(a,l,o,i)}function Ey(a,l,o,i){let c=l.match(o);if(!c)return null;let d=c[0],h=d.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:i.reduce((v,{paramName:b,isOptional:S},x)=>{if(b==="*"){let E=m[x]||"";h=d.slice(0,d.length-E.length).replace(/(.)\/+$/,"$1")}const w=m[x];return S&&!w?v[b]=void 0:v[b]=(w||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:h,pattern:a}}function Ry(a,l=!1,o=!0){Yn(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=[],c="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,g,v,b)=>{if(i.push({paramName:m,isOptional:g!=null}),g){let S=b.charAt(v+h.length);return S&&S!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(i.push({paramName:"*"}),c+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?c+="\\/*$":a!==""&&a!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,l?void 0:"i"),i]}function Tj(a){try{return a.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Yn(!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 Qa(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:c=""}=typeof a=="string"?gs(a):a,d;return o?(o=Ny(o),o.startsWith("/")?d=kx(o.substring(1),"/"):d=kx(o,l)):d=l,{pathname:d,search:Dj(i),hash:Oj(c)}}function kx(a,l){let o=bc(l).split("/");return a.split("/").forEach(c=>{c===".."?o.length>1&&o.pop():c!=="."&&o.push(c)}),o.length>1?o.join("/"):"/"}function Sf(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 Aj(a){return a.filter((l,o)=>o===0||l.route.path&&l.route.path.length>0)}function yh(a){let l=Aj(a);return l.map((o,i)=>i===l.length-1?o.pathname:o.pathnameBase)}function Rc(a,l,o,i=!1){let c;typeof a=="string"?c=gs(a):(c={...a},ht(!c.pathname||!c.pathname.includes("?"),Sf("?","pathname","search",c)),ht(!c.pathname||!c.pathname.includes("#"),Sf("#","pathname","hash",c)),ht(!c.search||!c.search.includes("#"),Sf("#","search","hash",c)));let d=a===""||c.pathname==="",h=d?"/":c.pathname,m;if(h==null)m=o;else{let S=l.length-1;if(!i&&h.startsWith("..")){let x=h.split("/");for(;x[0]==="..";)x.shift(),S-=1;c.pathname=x.join("/")}m=S>=0?l[S]:"/"}let g=Mj(c,m),v=h&&h!=="/"&&h.endsWith("/"),b=(d||h===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(v||b)&&(g.pathname+="/"),g}var Ny=a=>a.replace(/[\\/]{2,}/g,"/"),la=a=>Ny(a.join("/")),bc=a=>a.replace(/\/+$/,""),_j=a=>bc(a).replace(/^\/*/,"/"),Dj=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,Oj=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,kj=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 zj(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function Lj(a){let l=a.map(o=>o.route.path).filter(Boolean);return la(l)||"/"}var Ty=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function My(a,l){let o=a;if(typeof o!="string"||!xh.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let i=o,c=!1;if(Ty)try{let d=new URL(window.location.href),h=Sy.test(o)?new URL(dj(o,d.protocol)):new URL(o),m=Qa(h.pathname,l);h.origin===d.origin&&m!=null?o=m+h.search+h.hash:c=!0}catch{Yn(!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:c,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ay=["POST","PUT","PATCH","DELETE"];new Set(Ay);var Uj=["GET",...Ay];new Set(Uj);var Hj=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Bj(a){try{return Hj.includes(new URL(a).protocol)}catch{return!1}}var vs=p.createContext(null);vs.displayName="DataRouter";var Nc=p.createContext(null);Nc.displayName="DataRouterState";var _y=p.createContext(!1);function Pj(){return p.useContext(_y)}var Dy=p.createContext({isTransitioning:!1});Dy.displayName="ViewTransition";var qj=p.createContext(new Map);qj.displayName="Fetchers";var Vj=p.createContext(null);Vj.displayName="Await";var Tn=p.createContext(null);Tn.displayName="Navigation";var Ao=p.createContext(null);Ao.displayName="Location";var Sa=p.createContext({outlet:null,matches:[],isDataRoute:!1});Sa.displayName="Route";var bh=p.createContext(null);bh.displayName="RouteError";var Oy="REACT_ROUTER_ERROR",Ij="REDIRECT",Gj="ROUTE_ERROR_RESPONSE";function Yj(a){if(a.startsWith(`${Oy}:${Ij}:{`))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 $j(a){if(a.startsWith(`${Oy}:${Gj}:{`))try{let l=JSON.parse(a.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new kj(l.status,l.statusText,l.data)}catch{}}function Kj(a,{relative:l}={}){ht(xs(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=p.useContext(Tn),{hash:c,pathname:d,search:h}=Do(a,{relative:l}),m=d;return o!=="/"&&(m=d==="/"?o:la([o,d])),i.createHref({pathname:m,search:h,hash:c})}function xs(){return p.useContext(Ao)!=null}function un(){return ht(xs(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Ao).location}var ky="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function zy(a){p.useContext(Tn).static||p.useLayoutEffect(a)}function _o(){let{isDataRoute:a}=p.useContext(Sa);return a?sC():Xj()}function Xj(){ht(xs(),"useNavigate() may be used only in the context of a <Router> component.");let a=p.useContext(vs),{basename:l,navigator:o}=p.useContext(Tn),{matches:i}=p.useContext(Sa),{pathname:c}=un(),d=JSON.stringify(yh(i)),h=p.useRef(!1);return zy(()=>{h.current=!0}),p.useCallback((g,v={})=>{if(Yn(h.current,ky),!h.current)return;if(typeof g=="number"){o.go(g);return}let b=Rc(g,JSON.parse(d),c,v.relative==="path");a==null&&l!=="/"&&(b.pathname=b.pathname==="/"?l:la([l,b.pathname])),(v.replace?o.replace:o.push)(b,v.state,v)},[l,o,d,c,a])}p.createContext(null);function Do(a,{relative:l}={}){let{matches:o}=p.useContext(Sa),{pathname:i}=un(),c=JSON.stringify(yh(o));return p.useMemo(()=>Rc(a,JSON.parse(c),i,l==="path"),[a,c,i,l])}function Fj(a,l){return Ly(a,l)}function Ly(a,l,o){var C;ht(xs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=p.useContext(Tn),{matches:c}=p.useContext(Sa),d=c[c.length-1],h=d?d.params:{},m=d?d.pathname:"/",g=d?d.pathnameBase:"/",v=d&&d.route;{let T=v&&v.path||"";Hy(m,!v||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${T}">) 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="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let b=un(),S;if(l){let T=typeof l=="string"?gs(l):l;ht(g==="/"||((C=T.pathname)==null?void 0:C.startsWith(g)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${T.pathname}" was given in the \`location\` prop.`),S=T}else S=b;let x=S.pathname||"/",w=x;if(g!=="/"){let T=g.replace(/^\//,"").split("/");w="/"+x.replace(/^\//,"").split("/").slice(T.length).join("/")}let E=o&&o.state.matches.length?o.state.matches.map(T=>Object.assign(T,{route:o.manifest[T.route.id]||T.route})):wy(a,{pathname:w});Yn(v||E!=null,`No routes matched location "${S.pathname}${S.search}${S.hash}" `),Yn(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${S.pathname}${S.search}${S.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=eC(E&&E.map(T=>Object.assign({},T,{params:Object.assign({},h,T.params),pathname:la([g,i.encodeLocation?i.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?g:la([g,i.encodeLocation?i.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,o);return l&&j?p.createElement(Ao.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...S},navigationType:"POP"}},j):j}function Qj(){let a=rC(),l=zj(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)",c={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=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:d},"ErrorBoundary")," or"," ",p.createElement("code",{style:d},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},l),o?p.createElement("pre",{style:c},o):null,h)}var Zj=p.createElement(Qj,null),Uy=class extends p.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=$j(a.digest);o&&(a=o)}let l=a!==void 0?p.createElement(Sa.Provider,{value:this.props.routeContext},p.createElement(bh.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?p.createElement(Jj,{error:a},l):l}};Uy.contextType=_y;var wf=new WeakMap;function Jj({children:a,error:l}){let{basename:o}=p.useContext(Tn);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=Yj(l.digest);if(i){let c=wf.get(l);if(c)throw c;let d=My(i.location,o),h=d.absoluteURL||d.to;if(Bj(h))throw new Error("Invalid redirect location");if(Ty&&!wf.get(l))if(d.isExternal||i.reloadDocument)window.location.href=h;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:i.replace}));throw wf.set(l,m),m}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return a}function Wj({routeContext:a,match:l,children:o}){let i=p.useContext(vs);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),p.createElement(Sa.Provider,{value:a},o)}function eC(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 c=a,d=i==null?void 0:i.errors;if(d!=null){let b=c.findIndex(S=>S.route.id&&(d==null?void 0:d[S.route.id])!==void 0);ht(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,b+1))}let h=!1,m=-1;if(o&&i){h=i.renderFallback;for(let b=0;b<c.length;b++){let S=c[b];if((S.route.HydrateFallback||S.route.hydrateFallbackElement)&&(m=b),S.route.id){let{loaderData:x,errors:w}=i,E=S.route.loader&&!x.hasOwnProperty(S.route.id)&&(!w||w[S.route.id]===void 0);if(S.route.lazy||E){o.isStatic&&(h=!0),m>=0?c=c.slice(0,m+1):c=[c[0]];break}}}}let g=o==null?void 0:o.onError,v=i&&g?(b,S)=>{var x,w;g(b,{location:i.location,params:((w=(x=i.matches)==null?void 0:x[0])==null?void 0:w.params)??{},pattern:Lj(i.matches),errorInfo:S})}:void 0;return c.reduceRight((b,S,x)=>{let w,E=!1,j=null,C=null;i&&(w=d&&S.route.id?d[S.route.id]:void 0,j=S.route.errorElement||Zj,h&&(m<0&&x===0?(Hy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,C=null):m===x&&(E=!0,C=S.route.hydrateFallbackElement||null)));let T=l.concat(c.slice(0,x+1)),N=()=>{let M;return w?M=j:E?M=C:S.route.Component?M=p.createElement(S.route.Component,null):S.route.element?M=S.route.element:M=b,p.createElement(Wj,{match:S,routeContext:{outlet:b,matches:T,isDataRoute:i!=null},children:M})};return i&&(S.route.ErrorBoundary||S.route.errorElement||x===0)?p.createElement(Uy,{location:i.location,revalidation:i.revalidation,component:j,error:w,children:N(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:v}):N()},null)}function Sh(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tC(a){let l=p.useContext(vs);return ht(l,Sh(a)),l}function nC(a){let l=p.useContext(Nc);return ht(l,Sh(a)),l}function aC(a){let l=p.useContext(Sa);return ht(l,Sh(a)),l}function wh(a){let l=aC(a),o=l.matches[l.matches.length-1];return ht(o.route.id,`${a} can only be used on routes that contain a unique "id"`),o.route.id}function lC(){return wh("useRouteId")}function rC(){var i;let a=p.useContext(bh),l=nC("useRouteError"),o=wh("useRouteError");return a!==void 0?a:(i=l.errors)==null?void 0:i[o]}function sC(){let{router:a}=tC("useNavigate"),l=wh("useNavigate"),o=p.useRef(!1);return zy(()=>{o.current=!0}),p.useCallback(async(c,d={})=>{Yn(o.current,ky),o.current&&(typeof c=="number"?await a.navigate(c):await a.navigate(c,{fromRouteId:l,...d}))},[a,l])}var zx={};function Hy(a,l,o){!l&&!zx[a]&&(zx[a]=!0,Yn(!1,o))}p.memo(oC);function oC({routes:a,manifest:l,future:o,state:i,isStatic:c,onError:d}){return Ly(a,void 0,{manifest:l,state:i,isStatic:c,onError:d})}function qf({to:a,replace:l,state:o,relative:i}){ht(xs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=p.useContext(Tn);Yn(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=p.useContext(Sa),{pathname:h}=un(),m=_o(),g=Rc(a,yh(d),h,i==="path"),v=JSON.stringify(g);return p.useEffect(()=>{m(JSON.parse(v),{replace:l,state:o,relative:i})},[m,v,i,l,o]),null}function rn(a){ht(!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 iC({basename:a="/",children:l=null,location:o,navigationType:i="POP",navigator:c,static:d=!1,useTransitions:h}){ht(!xs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=a.replace(/^\/*/,"/"),g=p.useMemo(()=>({basename:m,navigator:c,static:d,useTransitions:h,future:{}}),[m,c,d,h]);typeof o=="string"&&(o=gs(o));let{pathname:v="/",search:b="",hash:S="",state:x=null,key:w="default",mask:E}=o,j=p.useMemo(()=>{let C=Qa(v,m);return C==null?null:{location:{pathname:C,search:b,hash:S,state:x,key:w,mask:E},navigationType:i}},[m,v,b,S,x,w,i,E]);return Yn(j!=null,`<Router basename="${m}"> is not able to match the URL "${v}${b}${S}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:p.createElement(Tn.Provider,{value:g},p.createElement(Ao.Provider,{children:l,value:j}))}function By({children:a,location:l}){return Fj(Vf(a),l)}function Vf(a,l=[]){let o=[];return p.Children.forEach(a,(i,c)=>{if(!p.isValidElement(i))return;let d=[...l,c];if(i.type===p.Fragment){o.push.apply(o,Vf(i.props.children,d));return}ht(i.type===rn,`[${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>`),ht(!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=Vf(i.props.children,d)),o.push(h)}),o}var hc="get",mc="application/x-www-form-urlencoded";function Tc(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function cC(a){return Tc(a)&&a.tagName.toLowerCase()==="button"}function uC(a){return Tc(a)&&a.tagName.toLowerCase()==="form"}function dC(a){return Tc(a)&&a.tagName.toLowerCase()==="input"}function fC(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function hC(a,l){return a.button===0&&(!l||l==="_self")&&!fC(a)}function If(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(c=>[o,c]):[[o,i]])},[]))}function mC(a,l){let o=If(a);return l&&l.forEach((i,c)=>{o.has(c)||l.getAll(c).forEach(d=>{o.append(c,d)})}),o}var ec=null;function pC(){if(ec===null)try{new FormData(document.createElement("form"),0),ec=!1}catch{ec=!0}return ec}var gC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function jf(a){return a!=null&&!gC.has(a)?(Yn(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mc}"`),null):a}function vC(a,l){let o,i,c,d,h;if(uC(a)){let m=a.getAttribute("action");i=m?Qa(m,l):null,o=a.getAttribute("method")||hc,c=jf(a.getAttribute("enctype"))||mc,d=new FormData(a)}else if(cC(a)||dC(a)&&(a.type==="submit"||a.type==="image")){let m=a.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||m.getAttribute("action");if(i=g?Qa(g,l):null,o=a.getAttribute("formmethod")||m.getAttribute("method")||hc,c=jf(a.getAttribute("formenctype"))||jf(m.getAttribute("enctype"))||mc,d=new FormData(m,a),!pC()){let{name:v,type:b,value:S}=a;if(b==="image"){let x=v?`${v}.`:"";d.append(`${x}x`,"0"),d.append(`${x}y`,"0")}else v&&d.append(v,S)}}else{if(Tc(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=hc,i=null,c=mc,h=a}return d&&c==="text/plain"&&(h=d,d=void 0),{action:i,method:o.toLowerCase(),encType:c,formData:d,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function jh(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function Py(a,l,o,i){let c=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return o?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${i}`:c.pathname=`${c.pathname}.${i}`:c.pathname==="/"?c.pathname=`_root.${i}`:l&&Qa(c.pathname,l)==="/"?c.pathname=`${bc(l)}/_root.${i}`:c.pathname=`${bc(c.pathname)}.${i}`,c}async function xC(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 yC(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 bC(a,l,o){let i=await Promise.all(a.map(async c=>{let d=l.routes[c.route.id];if(d){let h=await xC(d,o);return h.links?h.links():[]}return[]}));return CC(i.flat(1).filter(yC).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Lx(a,l,o,i,c,d){let h=(g,v)=>o[v]?g.route.id!==o[v].route.id:!0,m=(g,v)=>{var b;return o[v].pathname!==g.pathname||((b=o[v].route.path)==null?void 0:b.endsWith("*"))&&o[v].params["*"]!==g.params["*"]};return d==="assets"?l.filter((g,v)=>h(g,v)||m(g,v)):d==="data"?l.filter((g,v)=>{var S;let b=i.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(h(g,v)||m(g,v))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((S=o[0])==null?void 0:S.params)||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function SC(a,l,{includeHydrateFallback:o}={}){return wC(a.map(i=>{let c=l.routes[i.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),o&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function wC(a){return[...new Set(a)]}function jC(a){let l={},o=Object.keys(a).sort();for(let i of o)l[i]=a[i];return l}function CC(a,l){let o=new Set;return new Set(l),a.reduce((i,c)=>{let d=JSON.stringify(jC(c));return o.has(d)||(o.add(d),i.push({key:d,link:c})),i},[])}function Ch(){let a=p.useContext(vs);return jh(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function EC(){let a=p.useContext(Nc);return jh(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Eh=p.createContext(void 0);Eh.displayName="FrameworkContext";function Mc(){let a=p.useContext(Eh);return jh(a,"You must render this element inside a <HydratedRouter> element"),a}function RC(a,l){let o=p.useContext(Eh),[i,c]=p.useState(!1),[d,h]=p.useState(!1),{onFocus:m,onBlur:g,onMouseEnter:v,onMouseLeave:b,onTouchStart:S}=l,x=p.useRef(null);p.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let j=T=>{T.forEach(N=>{h(N.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return x.current&&C.observe(x.current),()=>{C.disconnect()}}},[a]),p.useEffect(()=>{if(i){let j=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(j)}}},[i]);let w=()=>{c(!0)},E=()=>{c(!1),h(!1)};return o?a!=="intent"?[d,x,{}]:[d,x,{onFocus:xo(m,w),onBlur:xo(g,E),onMouseEnter:xo(v,w),onMouseLeave:xo(b,E),onTouchStart:xo(S,w)}]:[!1,x,{}]}function xo(a,l){return o=>{a&&a(o),o.defaultPrevented||l(o)}}function NC({page:a,...l}){let o=Pj(),{nonce:i}=Mc(),{router:c}=Ch(),d=p.useMemo(()=>wy(c.routes,a,c.basename),[c.routes,a,c.basename]);return d?(l.nonce==null&&i&&(l={...l,nonce:i}),o?p.createElement(MC,{page:a,matches:d,...l}):p.createElement(AC,{page:a,matches:d,...l})):null}function TC(a){let{manifest:l,routeModules:o}=Mc(),[i,c]=p.useState([]);return p.useEffect(()=>{let d=!1;return bC(a,l,o).then(h=>{d||c(h)}),()=>{d=!0}},[a,l,o]),i}function MC({page:a,matches:l,...o}){let i=un(),{future:c}=Mc(),{basename:d}=Ch(),h=p.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let m=Py(a,d,c.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let b of l)typeof b.route.shouldRevalidate=="function"?g=!0:v.push(b.route.id);return g&&v.length>0&&m.searchParams.set("_routes",v.join(",")),[m.pathname+m.search]},[d,c.v8_trailingSlashAwareDataRequests,a,i,l]);return p.createElement(p.Fragment,null,h.map(m=>p.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...o})))}function AC({page:a,matches:l,...o}){let i=un(),{future:c,manifest:d,routeModules:h}=Mc(),{basename:m}=Ch(),{loaderData:g,matches:v}=EC(),b=p.useMemo(()=>Lx(a,l,v,d,i,"data"),[a,l,v,d,i]),S=p.useMemo(()=>Lx(a,l,v,d,i,"assets"),[a,l,v,d,i]),x=p.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let j=new Set,C=!1;if(l.forEach(N=>{var A;let M=d.routes[N.route.id];!M||!M.hasLoader||(!b.some(_=>_.route.id===N.route.id)&&N.route.id in g&&((A=h[N.route.id])!=null&&A.shouldRevalidate)||M.hasClientLoader?C=!0:j.add(N.route.id))}),j.size===0)return[];let T=Py(a,m,c.v8_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&T.searchParams.set("_routes",l.filter(N=>j.has(N.route.id)).map(N=>N.route.id).join(",")),[T.pathname+T.search]},[m,c.v8_trailingSlashAwareDataRequests,g,i,d,b,l,a,h]),w=p.useMemo(()=>SC(S,d),[S,d]),E=TC(S);return p.createElement(p.Fragment,null,x.map(j=>p.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...o})),w.map(j=>p.createElement("link",{key:j,rel:"modulepreload",href:j,...o})),E.map(({key:j,link:C})=>p.createElement("link",{key:j,nonce:o.nonce,...C,crossOrigin:C.crossOrigin??o.crossOrigin})))}function _C(...a){return l=>{a.forEach(o=>{typeof o=="function"?o(l):o!=null&&(o.current=l)})}}var DC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{DC&&(window.__reactRouterVersion="7.18.2")}catch{}function OC({basename:a,children:l,useTransitions:o,window:i}){let c=p.useRef();c.current==null&&(c.current=fj({window:i,v5Compat:!0}));let d=c.current,[h,m]=p.useState({action:d.action,location:d.location}),g=p.useCallback(v=>{o===!1?m(v):p.startTransition(()=>m(v))},[o]);return p.useLayoutEffect(()=>d.listen(g),[d,g]),p.createElement(iC,{basename:a,children:l,location:h.location,navigationType:h.action,navigator:d,useTransitions:o})}var ur=p.forwardRef(function({onClick:l,discover:o="render",prefetch:i="none",relative:c,reloadDocument:d,replace:h,mask:m,state:g,target:v,to:b,preventScrollReset:S,viewTransition:x,defaultShouldRevalidate:w,...E},j){let{basename:C,navigator:T,useTransitions:N}=p.useContext(Tn),M=typeof b=="string"&&xh.test(b),A=My(b,C);b=A.to;let _=Kj(b,{relative:c}),z=un(),q=null;if(m){let ce=Rc(m,[],z.mask?z.mask.pathname:"/",!0);C!=="/"&&(ce.pathname=ce.pathname==="/"?C:la([C,ce.pathname])),q=T.createHref(ce)}let[k,W,re]=RC(i,E),K=LC(b,{replace:h,mask:m,state:g,target:v,preventScrollReset:S,relative:c,viewTransition:x,defaultShouldRevalidate:w,useTransitions:N});function V(ce){l&&l(ce),ce.defaultPrevented||K(ce)}let le=!(A.isExternal||d),se=p.createElement("a",{...E,...re,href:(le?q:void 0)||A.absoluteURL||_,onClick:le?V:l,ref:_C(j,W),target:v,"data-discover":!M&&o==="render"?"true":void 0});return k&&!M?p.createElement(p.Fragment,null,se,p.createElement(NC,{page:_})):se});ur.displayName="Link";var qy=p.forwardRef(function({"aria-current":l="page",caseSensitive:o=!1,className:i="",end:c=!1,style:d,to:h,viewTransition:m,children:g,...v},b){let S=Do(h,{relative:v.relative}),x=un(),w=p.useContext(Nc),{navigator:E,basename:j}=p.useContext(Tn),C=w!=null&&VC(S)&&m===!0,T=E.encodeLocation?E.encodeLocation(S).pathname:S.pathname,N=x.pathname,M=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;o||(N=N.toLowerCase(),M=M?M.toLowerCase():null,T=T.toLowerCase()),M&&j&&(M=Qa(M,j)||M);const A=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let _=N===T||!c&&N.startsWith(T)&&N.charAt(A)==="/",z=M!=null&&(M===T||!c&&M.startsWith(T)&&M.charAt(T.length)==="/"),q={isActive:_,isPending:z,isTransitioning:C},k=_?l:void 0,W;typeof i=="function"?W=i(q):W=[i,_?"active":null,z?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let re=typeof d=="function"?d(q):d;return p.createElement(ur,{...v,"aria-current":k,className:W,ref:b,style:re,to:h,viewTransition:m},typeof g=="function"?g(q):g)});qy.displayName="NavLink";var kC=p.forwardRef(({discover:a="render",fetcherKey:l,navigate:o,reloadDocument:i,replace:c,state:d,method:h=hc,action:m,onSubmit:g,relative:v,preventScrollReset:b,viewTransition:S,defaultShouldRevalidate:x,...w},E)=>{let{useTransitions:j}=p.useContext(Tn),C=PC(),T=qC(m,{relative:v}),N=h.toLowerCase()==="get"?"get":"post",M=typeof m=="string"&&xh.test(m),A=_=>{if(g&&g(_),_.defaultPrevented)return;_.preventDefault();let z=_.nativeEvent.submitter,q=(z==null?void 0:z.getAttribute("formmethod"))||h,k=()=>C(z||_.currentTarget,{fetcherKey:l,method:q,navigate:o,replace:c,state:d,relative:v,preventScrollReset:b,viewTransition:S,defaultShouldRevalidate:x});j&&o!==!1?p.startTransition(()=>k()):k()};return p.createElement("form",{ref:E,method:N,action:T,onSubmit:i?g:A,...w,"data-discover":!M&&a==="render"?"true":void 0})});kC.displayName="Form";function zC(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=p.useContext(vs);return ht(l,zC(a)),l}function LC(a,{target:l,replace:o,mask:i,state:c,preventScrollReset:d,relative:h,viewTransition:m,defaultShouldRevalidate:g,useTransitions:v}={}){let b=_o(),S=un(),x=Do(a,{relative:h});return p.useCallback(w=>{if(hC(w,l)){w.preventDefault();let E=o!==void 0?o:Co(S)===Co(x),j=()=>b(a,{replace:E,mask:i,state:c,preventScrollReset:d,relative:h,viewTransition:m,defaultShouldRevalidate:g});v?p.startTransition(()=>j()):j()}},[S,b,x,o,i,c,l,a,d,h,m,g,v])}function UC(a){Yn(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=p.useRef(If(a)),o=p.useRef(!1),i=un(),c=p.useMemo(()=>mC(i.search,o.current?null:l.current),[i.search]),d=_o(),h=p.useCallback((m,g)=>{const v=If(typeof m=="function"?m(new URLSearchParams(c)):m);o.current=!0,d("?"+v,g)},[d,c]);return[c,h]}var HC=0,BC=()=>`__${String(++HC)}__`;function PC(){let{router:a}=Vy("useSubmit"),{basename:l}=p.useContext(Tn),o=lC(),i=a.fetch,c=a.navigate;return p.useCallback(async(d,h={})=>{let{action:m,method:g,encType:v,formData:b,body:S}=vC(d,l);if(h.navigate===!1){let x=h.fetcherKey||BC();await i(x,o,h.action||m,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:b,body:S,formMethod:h.method||g,formEncType:h.encType||v,flushSync:h.flushSync})}else await c(h.action||m,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:b,body:S,formMethod:h.method||g,formEncType:h.encType||v,replace:h.replace,state:h.state,fromRouteId:o,flushSync:h.flushSync,viewTransition:h.viewTransition})},[i,c,l,o])}function qC(a,{relative:l}={}){let{basename:o}=p.useContext(Tn),i=p.useContext(Sa);ht(i,"useFormAction must be used inside a RouteContext");let[c]=i.matches.slice(-1),d={...Do(a||".",{relative:l})},h=un();if(a==null){d.search=h.search;let m=new URLSearchParams(d.search),g=m.getAll("index");if(g.some(b=>b==="")){m.delete("index"),g.filter(S=>S).forEach(S=>m.append("index",S));let b=m.toString();d.search=b?`?${b}`:""}}return(!a||a===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:la([o,d.pathname])),Co(d)}function VC(a,{relative:l}={}){let o=p.useContext(Dy);ht(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"),c=Do(a,{relative:l});if(!o.isTransitioning)return!1;let d=Qa(o.currentLocation.pathname,i)||o.currentLocation.pathname,h=Qa(o.nextLocation.pathname,i)||o.nextLocation.pathname;return yc(c.pathname,h)!=null||yc(c.pathname,d)!=null}var ys=by();const IC=gh(ys),GC="";class YC extends Error{constructor(l,o,i){var c;super(typeof i=="object"&&i&&"error"in i?String(((c=i.error)==null?void 0:c.message)??i):"Request failed"),this.status=l,this.type=o,this.body=i}}async function yo(a,l,o,i){var g;const c=o!==void 0,d=await fetch(`${GC}${l}`,{method:a,headers:{...c?{"content-type":"application/json"}:{},...(i==null?void 0:i.headers)??{}},body:c?JSON.stringify(o):void 0,credentials:"include",...i}),h=await d.text();let m;try{m=h?JSON.parse(h):void 0}catch{m=h}if(!d.ok)throw new YC(d.status,typeof m=="object"&&m&&"error"in m?String(((g=m.error)==null?void 0:g.type)??"error"):"error",m);return m}const Se={get:(a,l)=>yo("GET",a,void 0,l),post:(a,l,o)=>yo("POST",a,l,o),patch:(a,l,o)=>yo("PATCH",a,l,o),put:(a,l,o)=>yo("PUT",a,l,o),del:a=>yo("DELETE",a)},Iy=p.createContext(void 0);function $C({children:a}){const[l,o]=p.useState(null),[i,c]=p.useState(!0),d=p.useCallback(async()=>{try{const g=await Se.get("/api/admin/me");o(g)}catch{o(null)}finally{c(!1)}},[]);p.useEffect(()=>{d()},[d]);const h=p.useCallback(async(g,v,b,S)=>{const x={username:g,password:v};b&&(x.totp=b),S&&(x.recoveryCode=S);try{const w=await Se.post("/api/admin/login",x);return o({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const E=w.status,j=w.type;if(E===401&&j==="totp_required")return{totpRequired:!0};throw w}},[]),m=p.useCallback(async()=>{await Se.post("/api/admin/logout"),o(null)},[]);return s.jsx(Iy.Provider,{value:{user:l,loading:i,login:h,logout:m,refresh:d},children:a})}function Rh(){const a=p.useContext(Iy);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 KC=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gy=(...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 XC={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 FC=p.forwardRef(({color:a="currentColor",size:l=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:h,...m},g)=>p.createElement("svg",{ref:g,...XC,width:l,height:l,stroke:a,strokeWidth:i?Number(o)*24/Number(l):o,className:Gy("lucide",c),...m},[...h.map(([v,b])=>p.createElement(v,b)),...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 ke=(a,l)=>{const o=p.forwardRef(({className:i,...c},d)=>p.createElement(FC,{ref:d,iconNode:l,className:Gy(`lucide-${KC(a)}`,i),...c}));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 Yy=ke("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
86
|
-
* @license lucide-react v0.469.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const QC=ke("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
91
|
-
* @license lucide-react v0.469.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const ZC=ke("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
|
96
|
-
* @license lucide-react v0.469.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const JC=ke("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
|
|
101
|
-
* @license lucide-react v0.469.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const $y=ke("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
106
|
-
* @license lucide-react v0.469.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const WC=ke("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
111
|
-
* @license lucide-react v0.469.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const e2=ke("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
|
|
116
|
-
* @license lucide-react v0.469.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const Ac=ke("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
121
|
-
* @license lucide-react v0.469.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const t2=ke("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
126
|
-
* @license lucide-react v0.469.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const n2=ke("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
131
|
-
* @license lucide-react v0.469.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const a2=ke("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
136
|
-
* @license lucide-react v0.469.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const l2=ke("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
|
|
141
|
-
* @license lucide-react v0.469.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const Cf=ke("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
146
|
-
* @license lucide-react v0.469.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const r2=ke("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
151
|
-
* @license lucide-react v0.469.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const s2=ke("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
156
|
-
* @license lucide-react v0.469.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const Ky=ke("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
161
|
-
* @license lucide-react v0.469.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const o2=ke("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
166
|
-
* @license lucide-react v0.469.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const i2=ke("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
171
|
-
* @license lucide-react v0.469.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const c2=ke("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
|
|
176
|
-
* @license lucide-react v0.469.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const Xy=ke("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
181
|
-
* @license lucide-react v0.469.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const Fy=ke("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
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 Qy=ke("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
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=ke("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 u2=ke("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
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 d2=ke("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
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 f2=ke("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 Zy=ke("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
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 h2=ke("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 Oo=ke("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 m2=ke("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/**
|
|
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 p2=ke("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
|
|
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 Jy=ke("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 g2=ke("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 v2=ke("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
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 x2=ke("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
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 _c=ke("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
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 y2=ke("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
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 b2=ke("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
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 Dc=ke("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
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 S2=ke("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Wy(a){var l,o,i="";if(typeof a=="string"||typeof a=="number")i+=a;else if(typeof a=="object")if(Array.isArray(a)){var c=a.length;for(l=0;l<c;l++)a[l]&&(o=Wy(a[l]))&&(i&&(i+=" "),i+=o)}else for(o in a)a[o]&&(i&&(i+=" "),i+=o);return i}function eb(){for(var a,l,o=0,i="",c=arguments.length;o<c;o++)(a=arguments[o])&&(l=Wy(a))&&(i&&(i+=" "),i+=l);return i}const Nh="-",w2=a=>{const l=C2(a),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:h=>{const m=h.split(Nh);return m[0]===""&&m.length!==1&&m.shift(),tb(m,l)||j2(h)},getConflictingClassGroupIds:(h,m)=>{const g=o[h]||[];return m&&i[h]?[...g,...i[h]]:g}}},tb=(a,l)=>{var h;if(a.length===0)return l.classGroupId;const o=a[0],i=l.nextPart.get(o),c=i?tb(a.slice(1),i):void 0;if(c)return c;if(l.validators.length===0)return;const d=a.join(Nh);return(h=l.validators.find(({validator:m})=>m(d)))==null?void 0:h.classGroupId},Ux=/^\[(.+)\]$/,j2=a=>{if(Ux.test(a)){const l=Ux.exec(a)[1],o=l==null?void 0:l.substring(0,l.indexOf(":"));if(o)return"arbitrary.."+o}},C2=a=>{const{theme:l,prefix:o}=a,i={nextPart:new Map,validators:[]};return R2(Object.entries(a.classGroups),o).forEach(([d,h])=>{Gf(h,i,d,l)}),i},Gf=(a,l,o,i)=>{a.forEach(c=>{if(typeof c=="string"){const d=c===""?l:Hx(l,c);d.classGroupId=o;return}if(typeof c=="function"){if(E2(c)){Gf(c(i),l,o,i);return}l.validators.push({validator:c,classGroupId:o});return}Object.entries(c).forEach(([d,h])=>{Gf(h,Hx(l,d),o,i)})})},Hx=(a,l)=>{let o=a;return l.split(Nh).forEach(i=>{o.nextPart.has(i)||o.nextPart.set(i,{nextPart:new Map,validators:[]}),o=o.nextPart.get(i)}),o},E2=a=>a.isThemeGetter,R2=(a,l)=>l?a.map(([o,i])=>{const c=i.map(d=>typeof d=="string"?l+d:typeof d=="object"?Object.fromEntries(Object.entries(d).map(([h,m])=>[l+h,m])):d);return[o,c]}):a,N2=a=>{if(a<1)return{get:()=>{},set:()=>{}};let l=0,o=new Map,i=new Map;const c=(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 c(d,h),h},set(d,h){o.has(d)?o.set(d,h):c(d,h)}}},nb="!",T2=a=>{const{separator:l,experimentalParseClassName:o}=a,i=l.length===1,c=l[0],d=l.length,h=m=>{const g=[];let v=0,b=0,S;for(let C=0;C<m.length;C++){let T=m[C];if(v===0){if(T===c&&(i||m.slice(C,C+d)===l)){g.push(m.slice(b,C)),b=C+d;continue}if(T==="/"){S=C;continue}}T==="["?v++:T==="]"&&v--}const x=g.length===0?m:m.substring(b),w=x.startsWith(nb),E=w?x.substring(1):x,j=S&&S>b?S-b:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:E,maybePostfixModifierPosition:j}};return o?m=>o({className:m,parseClassName:h}):h},M2=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},A2=a=>({cache:N2(a.cacheSize),parseClassName:T2(a),...w2(a)}),_2=/\s+/,D2=(a,l)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:c}=l,d=[],h=a.trim().split(_2);let m="";for(let g=h.length-1;g>=0;g-=1){const v=h[g],{modifiers:b,hasImportantModifier:S,baseClassName:x,maybePostfixModifierPosition:w}=o(v);let E=!!w,j=i(E?x.substring(0,w):x);if(!j){if(!E){m=v+(m.length>0?" "+m:m);continue}if(j=i(x),!j){m=v+(m.length>0?" "+m:m);continue}E=!1}const C=M2(b).join(":"),T=S?C+nb:C,N=T+j;if(d.includes(N))continue;d.push(N);const M=c(j,E);for(let A=0;A<M.length;++A){const _=M[A];d.push(T+_)}m=v+(m.length>0?" "+m:m)}return m};function O2(){let a=0,l,o,i="";for(;a<arguments.length;)(l=arguments[a++])&&(o=ab(l))&&(i&&(i+=" "),i+=o);return i}const ab=a=>{if(typeof a=="string")return a;let l,o="";for(let i=0;i<a.length;i++)a[i]&&(l=ab(a[i]))&&(o&&(o+=" "),o+=l);return o};function k2(a,...l){let o,i,c,d=h;function h(g){const v=l.reduce((b,S)=>S(b),a());return o=A2(v),i=o.cache.get,c=o.cache.set,d=m,m(g)}function m(g){const v=i(g);if(v)return v;const b=D2(g,o);return c(g,b),b}return function(){return d(O2.apply(null,arguments))}}const dt=a=>{const l=o=>o[a]||[];return l.isThemeGetter=!0,l},lb=/^\[(?:([a-z-]+):)?(.+)\]$/i,z2=/^\d+\/\d+$/,L2=new Set(["px","full","screen"]),U2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,H2=/\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$/,B2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,P2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,q2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ya=a=>ds(a)||L2.has(a)||z2.test(a),Al=a=>bs(a,"length",F2),ds=a=>!!a&&!Number.isNaN(Number(a)),Ef=a=>bs(a,"number",ds),bo=a=>!!a&&Number.isInteger(Number(a)),V2=a=>a.endsWith("%")&&ds(a.slice(0,-1)),Oe=a=>lb.test(a),_l=a=>U2.test(a),I2=new Set(["length","size","percentage"]),G2=a=>bs(a,I2,rb),Y2=a=>bs(a,"position",rb),$2=new Set(["image","url"]),K2=a=>bs(a,$2,Z2),X2=a=>bs(a,"",Q2),So=()=>!0,bs=(a,l,o)=>{const i=lb.exec(a);return i?i[1]?typeof l=="string"?i[1]===l:l.has(i[1]):o(i[2]):!1},F2=a=>H2.test(a)&&!B2.test(a),rb=()=>!1,Q2=a=>P2.test(a),Z2=a=>q2.test(a),J2=()=>{const a=dt("colors"),l=dt("spacing"),o=dt("blur"),i=dt("brightness"),c=dt("borderColor"),d=dt("borderRadius"),h=dt("borderSpacing"),m=dt("borderWidth"),g=dt("contrast"),v=dt("grayscale"),b=dt("hueRotate"),S=dt("invert"),x=dt("gap"),w=dt("gradientColorStops"),E=dt("gradientColorStopPositions"),j=dt("inset"),C=dt("margin"),T=dt("opacity"),N=dt("padding"),M=dt("saturate"),A=dt("scale"),_=dt("sepia"),z=dt("skew"),q=dt("space"),k=dt("translate"),W=()=>["auto","contain","none"],re=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto",Oe,l],V=()=>[Oe,l],le=()=>["",Ya,Al],se=()=>["auto",ds,Oe],ce=()=>["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"],H=()=>["","0",Oe],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[ds,Oe];return{cacheSize:500,separator:":",theme:{colors:[So],spacing:[Ya,Al],blur:["none","",_l,Oe],brightness:D(),borderColor:[a],borderRadius:["none","","full",_l,Oe],borderSpacing:V(),borderWidth:le(),contrast:D(),grayscale:H(),hueRotate:D(),invert:H(),gap:V(),gradientColorStops:[a],gradientColorStopPositions:[V2,Al],inset:K(),margin:K(),opacity:D(),padding:V(),saturate:D(),scale:D(),sepia:H(),skew:D(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",Oe]}],container:["container"],columns:[{columns:[_l]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:[...ce(),Oe]}],overflow:[{overflow:re()}],"overflow-x":[{"overflow-x":re()}],"overflow-y":[{"overflow-y":re()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bo,Oe]}],basis:[{basis:K()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Oe]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",bo,Oe]}],"grid-cols":[{"grid-cols":[So]}],"col-start-end":[{col:["auto",{span:["full",bo,Oe]},Oe]}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":[So]}],"row-start-end":[{row:["auto",{span:[bo,Oe]},Oe]}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Oe]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"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:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[q]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[q]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Oe,l]}],"min-w":[{"min-w":[Oe,l,"min","max","fit"]}],"max-w":[{"max-w":[Oe,l,"none","full","min","max","fit","prose",{screen:[_l]},_l]}],h:[{h:[Oe,l,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Oe,l,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Oe,l,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Oe,l,"auto","min","max","fit"]}],"font-size":[{text:["base",_l,Al]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ef]}],"font-family":[{font:[So]}],"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",Oe]}],"line-clamp":[{"line-clamp":["none",ds,Ef]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ya,Oe]}],"list-image":[{"list-image":["none",Oe]}],"list-style-type":[{list:["none","disc","decimal",Oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[a]}],"placeholder-opacity":[{"placeholder-opacity":[T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[a]}],"text-opacity":[{"text-opacity":[T]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ya,Al]}],"underline-offset":[{"underline-offset":["auto",Ya,Oe]}],"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:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe]}],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",Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[T]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ce(),Y2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",G2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},K2]}],"bg-color":[{bg:[a]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[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:[m]}],"border-w-x":[{"border-x":[m]}],"border-w-y":[{"border-y":[m]}],"border-w-s":[{"border-s":[m]}],"border-w-e":[{"border-e":[m]}],"border-w-t":[{"border-t":[m]}],"border-w-r":[{"border-r":[m]}],"border-w-b":[{"border-b":[m]}],"border-w-l":[{"border-l":[m]}],"border-opacity":[{"border-opacity":[T]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[m]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[m]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[T]}],"divide-style":[{divide:U()}],"border-color":[{border:[c]}],"border-color-x":[{"border-x":[c]}],"border-color-y":[{"border-y":[c]}],"border-color-s":[{"border-s":[c]}],"border-color-e":[{"border-e":[c]}],"border-color-t":[{"border-t":[c]}],"border-color-r":[{"border-r":[c]}],"border-color-b":[{"border-b":[c]}],"border-color-l":[{"border-l":[c]}],"divide-color":[{divide:[c]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Ya,Oe]}],"outline-w":[{outline:[Ya,Al]}],"outline-color":[{outline:[a]}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[a]}],"ring-opacity":[{"ring-opacity":[T]}],"ring-offset-w":[{"ring-offset":[Ya,Al]}],"ring-offset-color":[{"ring-offset":[a]}],shadow:[{shadow:["","inner","none",_l,X2]}],"shadow-color":[{shadow:[So]}],opacity:[{opacity:[T]}],"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",_l,Oe]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[S]}],saturate:[{saturate:[M]}],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":[b]}],"backdrop-invert":[{"backdrop-invert":[S]}],"backdrop-opacity":[{"backdrop-opacity":[T]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"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",Oe]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",Oe]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",Oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[bo,Oe]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[z]}],"skew-y":[{"skew-y":[z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Oe]}],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",Oe]}],"caret-color":[{caret:[a]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Oe]}],fill:[{fill:[a,"none"]}],"stroke-w":[{stroke:[Ya,Al,Ef]}],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"]}}},W2=k2(J2);function je(...a){return W2(eb(a))}function At(a,l="—"){return a==null||Number.isNaN(a)?l:a.toLocaleString()}function Oc(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 Th(a){if(!a)return"—";try{return new Date(a).toLocaleString()}catch{return a}}function eE(a,l=8){return a?a.length>l?`${a.slice(0,l)}…`:a:"—"}function tE(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 c=Math.floor(i/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const nE=[{to:"/",label:"Dashboard",icon:Xy,end:!0},{to:"/providers",label:"Providers",icon:Zy},{to:"/models",label:"Models",icon:JC},{to:"/combos",label:"Combos",icon:Qy},{to:"/aliases",label:"Aliases",icon:a2},{to:"/api-keys",label:"API Keys",icon:Fy},{to:"/requests",label:"Requests",icon:Yy},{to:"/statistics",label:"Statistics",icon:i2},{to:"/audit",label:"Audit Logs",icon:p2},{to:"/settings",label:"Settings",icon:l2}];function aE(){const[a,l]=p.useState(null);return p.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:nE.map(o=>s.jsxs(qy,{to:o.to,end:o.end,className:({isActive:i})=>je("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(g2,{className:"h-3.5 w-3.5 text-primary"})," ",a?`v${a}`:"v…"]})]})}var lE=Object.defineProperty,Mh=(a,l)=>lE(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 sb(...a){return l=>{let o=!1;const i=a.map(c=>{const d=Yf(c,l);return!o&&typeof d=="function"&&(o=!0),d});if(o)return()=>{for(let c=0;c<i.length;c++){const d=i[c];typeof d=="function"?d():Yf(a[c],null)}}}}Mh(sb,"composeRefs");function Ve(...a){return p.useCallback(sb(...a),a)}Mh(Ve,"useComposedRefs");var rE=Object.defineProperty,ra=(a,l)=>rE(a,"name",{value:l,configurable:!0});function va(a){const l=p.forwardRef((o,i)=>{let{children:c,...d}=o,h=null,m=!1;const g=[];$f(c)&&typeof tc=="function"&&(c=tc(c._payload)),p.Children.forEach(c,x=>{var w;if(db(x)){m=!0;const E=x;let j="child"in E.props?E.props.child:E.props.children;$f(j)&&typeof tc=="function"&&(j=tc(j._payload)),h=oE(E,j),g.push((w=h==null?void 0:h.props)==null?void 0:w.children)}else g.push(x)}),h?h=p.cloneElement(h,void 0,g):!m&&p.Children.count(c)===1&&p.isValidElement(c)&&(h=c);const v=h?ub(h):void 0,b=Ve(i,v);if(!h){if(c||c===0)throw new Error(m?uE(a):cE(a));return c}const S=cb(d,h.props??{});return h.type!==p.Fragment&&(S.ref=i?b:v),p.cloneElement(h,S)});return l.displayName=`${a}.Slot`,l}ra(va,"createSlot");var sE=va("Slot"),ob=Symbol.for("radix.slottable");function ib(a){const l=ra(o=>"child"in o?o.children(o.child):o.children,"Slottable");return l.displayName=`${a}.Slottable`,l.__radixId=ob,l}ra(ib,"createSlottable");var oE=ra((a,l)=>{if("child"in a.props){const o=a.props.child;return p.isValidElement(o)?p.cloneElement(o,void 0,a.props.children(o.props.children)):null}return p.isValidElement(l)?l:null},"getSlottableElementFromSlottable");function cb(a,l){const o={...l};for(const i in l){const c=a[i],d=l[i];/^on[A-Z]/.test(i)?c&&d?o[i]=(...m)=>{const g=d(...m);return c(...m),g}:c&&(o[i]=c):i==="style"?o[i]={...c,...d}:i==="className"&&(o[i]=[c,d].filter(Boolean).join(" "))}return{...a,...o}}ra(cb,"mergeProps");function ub(a){var i,c;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=(c=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:c.get,o=l&&"isReactWarning"in l&&l.isReactWarning,o?a.props.ref:a.props.ref||a.ref)}ra(ub,"getElementRef");function db(a){return p.isValidElement(a)&&typeof a.type=="function"&&"__radixId"in a.type&&a.type.__radixId===ob}ra(db,"isSlottable");var iE=Symbol.for("react.lazy");function $f(a){return a!=null&&typeof a=="object"&&"$$typeof"in a&&a.$$typeof===iE&&"_payload"in a&&fb(a._payload)}ra($f,"isLazyComponent");function fb(a){return typeof a=="object"&&a!==null&&"then"in a}ra(fb,"isPromiseLike");var cE=ra(a=>`${a} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),uE=ra(a=>`${a} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),tc=ps[" use ".trim().toString()];const Bx=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,Px=eb,hb=(a,l)=>o=>{var i;if((l==null?void 0:l.variants)==null)return Px(a,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:c,defaultVariants:d}=l,h=Object.keys(c).map(v=>{const b=o==null?void 0:o[v],S=d==null?void 0:d[v];if(b===null)return null;const x=Bx(b)||Bx(S);return c[v][x]}),m=o&&Object.entries(o).reduce((v,b)=>{let[S,x]=b;return x===void 0||(v[S]=x),v},{}),g=l==null||(i=l.compoundVariants)===null||i===void 0?void 0:i.reduce((v,b)=>{let{class:S,className:x,...w}=b;return Object.entries(w).every(E=>{let[j,C]=E;return Array.isArray(C)?C.includes({...d,...m}[j]):{...d,...m}[j]===C})?[...v,S,x]:v},[]);return Px(a,h,g,o==null?void 0:o.class,o==null?void 0:o.className)},dE=hb("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=p.forwardRef(({className:a,variant:l,size:o,asChild:i=!1,...c},d)=>{const h=i?sE:"button";return s.jsx(h,{className:je(dE({variant:l,size:o,className:a})),ref:d,...c})});he.displayName="Button";const mb=p.createContext(void 0);function fE({children:a,defaultTheme:l="system",storageKey:o="latedev-theme"}){const[i,c]=p.useState(()=>localStorage.getItem(o)||l);p.useEffect(()=>{const h=window.document.documentElement;if(h.classList.remove("light","dark"),i==="system"){const m=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";h.classList.add(m);return}h.classList.add(i)},[i]);const d={theme:i,setTheme:h=>{localStorage.setItem(o,h),c(h)}};return s.jsx(mb.Provider,{value:d,children:a})}function hE(){const a=p.useContext(mb);if(!a)throw new Error("useTheme must be used within ThemeProvider");return a}var mE=Object.defineProperty,Ss=(a,l)=>mE(a,"name",{value:l,configurable:!0}),pb=!!(typeof window<"u"&&window.document&&window.document.createElement);function we(a,l,{checkForDefaultPrevented:o=!0}={}){return Ss(function(c){if(a==null||a(c),o===!1||!c||!c.defaultPrevented)return l==null?void 0:l(c)},"handleEvent")}Ss(we,"composeEventHandlers");function pE(a){var l;if(!pb)throw new Error("Cannot access window outside of the DOM");return((l=a==null?void 0:a.ownerDocument)==null?void 0:l.defaultView)??window}Ss(pE,"getOwnerWindow");function Kf(a){if(!pb)throw new Error("Cannot access document outside of the DOM");return(a==null?void 0:a.ownerDocument)??document}Ss(Kf,"getOwnerDocument");function gb(a,l=!1){const{activeElement:o}=Kf(a);if(!(o!=null&&o.nodeName))return null;if(vb(o)&&o.contentDocument)return gb(o.contentDocument.body,l);if(l){const i=o.getAttribute("aria-activedescendant");if(i){const c=Kf(o).getElementById(i);if(c)return c}}return o}Ss(gb,"getActiveElement");function vb(a){return a.tagName==="IFRAME"}Ss(vb,"isFrame");var gE=Object.defineProperty,Pn=(a,l)=>gE(a,"name",{value:l,configurable:!0});function vE(a,l){const o=p.createContext(l);o.displayName=a+"Context";const i=Pn(d=>{const{children:h,...m}=d,g=p.useMemo(()=>m,Object.values(m));return s.jsx(o.Provider,{value:g,children:h})},"Provider");i.displayName=a+"Provider";function c(d,h={}){const{optional:m=!1}=h,g=p.useContext(o);if(g)return g;if(l!==void 0)return l;if(!m)throw new Error(`\`${d}\` must be used within \`${a}\``)}return Pn(c,"useContext"),[i,c]}Pn(vE,"createContext");function dn(a,l=[]){let o=[];function i(d,h){const m=p.createContext(h);m.displayName=d+"Context";const g=o.length;o=[...o,h];const v=Pn(S=>{var T;const{scope:x,children:w,...E}=S,j=((T=x==null?void 0:x[a])==null?void 0:T[g])||m,C=p.useMemo(()=>E,Object.values(E));return s.jsx(j.Provider,{value:C,children:w})},"Provider");v.displayName=d+"Provider";function b(S,x,w={}){var T;const{optional:E=!1}=w,j=((T=x==null?void 0:x[a])==null?void 0:T[g])||m,C=p.useContext(j);if(C)return C;if(h!==void 0)return h;if(!E)throw new Error(`\`${S}\` must be used within \`${d}\``)}return Pn(b,"useContext"),[v,b]}Pn(i,"createContext");const c=Pn(()=>{const d=o.map(h=>p.createContext(h));return Pn(function(m){const g=(m==null?void 0:m[a])||d;return p.useMemo(()=>({[`__scope${a}`]:{...m,[a]:g}}),[m,g])},"useScope")},"createScope");return c.scopeName=a,[i,xb(c,...l)]}Pn(dn,"createContextScope");function xb(...a){const l=a[0];if(a.length===1)return l;const o=Pn(()=>{const i=a.map(c=>({useScope:c(),scopeName:c.scopeName}));return Pn(function(d){const h=i.reduce((m,{useScope:g,scopeName:v})=>{const S=g(d)[`__scope${v}`];return{...m,...S}},{});return p.useMemo(()=>({[`__scope${l.scopeName}`]:h}),[h])},"useComposedScopes")},"createScope");return o.scopeName=l.scopeName,o}Pn(xb,"composeContextScopes");var _t=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},xE=Object.defineProperty,yE=(a,l)=>xE(a,"name",{value:l,configurable:!0}),qx=ps[" useEffectEvent ".trim().toString()],Vx=ps[" useInsertionEffect ".trim().toString()];function yb(a){if(typeof qx=="function")return qx(a);const l=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Vx=="function"?Vx(()=>{l.current=a}):_t(()=>{l.current=a}),p.useMemo(()=>((...o)=>{var i;return(i=l.current)==null?void 0:i.call(l,...o)}),[])}yE(yb,"useEffectEvent");var bE=Object.defineProperty,ko=(a,l)=>bE(a,"name",{value:l,configurable:!0}),SE=ps[" useInsertionEffect ".trim().toString()]||_t;function Za({prop:a,defaultProp:l,onChange:o=ko(()=>{},"onChange"),caller:i}){const[c,d,h]=bb({defaultProp:l,onChange:o}),m=a!==void 0,g=m?a:c,v=p.useCallback(b=>{var S;if(m){const x=Sb(b)?b(a):b;x!==a&&((S=h.current)==null||S.call(h,x))}else d(b)},[m,a,d,h]);return[g,v]}ko(Za,"useControllableState");function bb({defaultProp:a,onChange:l}){const[o,i]=p.useState(a),c=p.useRef(o),d=p.useRef(l);return SE(()=>{d.current=l},[l]),p.useEffect(()=>{var h;c.current!==o&&((h=d.current)==null||h.call(d,o),c.current=o)},[o,c]),[o,i,d]}ko(bb,"useUncontrolledState");function Sb(a){return typeof a=="function"}ko(Sb,"isFunction");var Ix=Symbol("RADIX:SYNC_STATE");function wE(a,l,o,i){const{prop:c,defaultProp:d,onChange:h,caller:m}=l,g=c!==void 0,v=yb(h),b=[{...o,state:d}];i&&b.push(i);const[S,x]=p.useReducer((C,T)=>{if(T.type===Ix)return{...C,state:T.state};const N=a(C,T);return g&&!Object.is(N.state,C.state)&&v(N.state),N},...b),w=S.state,E=p.useRef(w);p.useEffect(()=>{E.current!==w&&(E.current=w,g||v(w))},[w,E,g]);const j=p.useMemo(()=>c!==void 0?{...S,state:c}:S,[S,c]);return p.useEffect(()=>{g&&!Object.is(c,S.state)&&x({type:Ix,state:c})},[c,S.state,g]),[j,x]}ko(wE,"useControllableStateReducer");var jE=Object.defineProperty,CE=(a,l)=>jE(a,"name",{value:l,configurable:!0}),EE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=EE.reduce((a,l)=>{const o=va(`Primitive.${l}`),i=p.forwardRef((c,d)=>{const{asChild:h,...m}=c,g=h?o:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(g,{...m,ref:d})});return i.displayName=`Primitive.${l}`,{...a,[l]:i}},{});function Ah(a,l){a&&ys.flushSync(()=>a.dispatchEvent(l))}CE(Ah,"dispatchDiscreteCustomEvent");var RE=Object.defineProperty,zt=(a,l)=>RE(a,"name",{value:l,configurable:!0});function kc(a){const l=a+"CollectionProvider",[o,i]=dn(l),[c,d]=o(l,{collectionRef:{current:null},itemMap:new Map}),h=zt(j=>{const{scope:C,children:T}=j,N=p.useRef(null),M=p.useRef(new Map).current;return s.jsx(c,{scope:C,itemMap:M,collectionRef:N,children:T})},"CollectionProvider");h.displayName=l;const m=a+"CollectionSlot",g=va(m),v=p.forwardRef((j,C)=>{const{scope:T,children:N}=j,M=d(m,T),A=Ve(C,M.collectionRef);return s.jsx(g,{ref:A,children:N})});v.displayName=m;const b=a+"CollectionItemSlot",S="data-radix-collection-item",x=va(b),w=p.forwardRef((j,C)=>{const{scope:T,children:N,...M}=j,A=p.useRef(null),_=Ve(C,A),z=d(b,T);return p.useEffect(()=>(z.itemMap.set(A,{ref:A,...M}),()=>void z.itemMap.delete(A))),s.jsx(x,{[S]:"",ref:_,children:N})});w.displayName=b;function E(j){const C=d(a+"CollectionConsumer",j);return p.useCallback(()=>{const N=C.collectionRef.current;if(!N)return[];const M=Array.from(N.querySelectorAll(`[${S}]`));return Array.from(C.itemMap.values()).sort((z,q)=>M.indexOf(z.ref.current)-M.indexOf(q.ref.current))},[C.collectionRef,C.itemMap])}return zt(E,"useCollection"),[{Provider:h,Slot:v,ItemSlot:w},E,i]}zt(kc,"createCollection");var Gx=new WeakMap,Tt,Sn,Rf=(Sn=class extends Map{constructor(o){super(o);yx(this,Tt);mf(this,Tt,[...super.keys()]),Gx.set(this,!0)}set(o,i){return Gx.get(this)&&(this.has(o)?Gt(this,Tt)[Gt(this,Tt).indexOf(o)]=o:Gt(this,Tt).push(o)),super.set(o,i),this}insert(o,i,c){const d=this.has(i),h=Gt(this,Tt).length,m=_h(o);let g=m>=0?m:h+m;const v=g<0||g>=h?-1:g;if(v===this.size||d&&v===this.size-1||v===-1)return this.set(i,c),this;const b=this.size+(d?0:1);m<0&&g++;const S=[...Gt(this,Tt)];let x,w=!1;for(let E=g;E<b;E++)if(g===E){let j=S[E];S[E]===i&&(j=S[E+1]),d&&this.delete(i),x=this.get(j),this.set(i,c)}else{!w&&S[E-1]===i&&(w=!0);const j=S[w?E:E-1],C=x;x=this.get(j),this.delete(j),this.set(j,C)}return this}with(o,i,c){const d=new Sn(this);return d.insert(o,i,c),d}before(o){const i=Gt(this,Tt).indexOf(o)-1;if(!(i<0))return this.entryAt(i)}setBefore(o,i,c){const d=Gt(this,Tt).indexOf(o);return d===-1?this:this.insert(d,i,c)}after(o){let i=Gt(this,Tt).indexOf(o);if(i=i===-1||i===this.size-1?-1:i+1,i!==-1)return this.entryAt(i)}setAfter(o,i,c){const d=Gt(this,Tt).indexOf(o);return d===-1?this:this.insert(d+1,i,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return mf(this,Tt,[]),super.clear()}delete(o){const i=super.delete(o);return i&&Gt(this,Tt).splice(Gt(this,Tt).indexOf(o),1),i}deleteAt(o){const i=this.keyAt(o);return i!==void 0?this.delete(i):!1}at(o){const i=pc(Gt(this,Tt),o);if(i!==void 0)return this.get(i)}entryAt(o){const i=pc(Gt(this,Tt),o);if(i!==void 0)return[i,this.get(i)]}indexOf(o){return Gt(this,Tt).indexOf(o)}keyAt(o){return pc(Gt(this,Tt),o)}from(o,i){const c=this.indexOf(o);if(c===-1)return;let d=c+i;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(o,i){const c=this.indexOf(o);if(c===-1)return;let d=c+i;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(o,i){let c=0;for(const d of this){if(Reflect.apply(o,i,[d,c,this]))return d;c++}}findIndex(o,i){let c=0;for(const d of this){if(Reflect.apply(o,i,[d,c,this]))return c;c++}return-1}filter(o,i){const c=[];let d=0;for(const h of this)Reflect.apply(o,i,[h,d,this])&&c.push(h),d++;return new Sn(c)}map(o,i){const c=[];let d=0;for(const h of this)c.push([h[0],Reflect.apply(o,i,[h,d,this])]),d++;return new Sn(c)}reduce(...o){const[i,c]=o;let d=0,h=c??this.at(0);for(const m of this)d===0&&o.length===1?h=m:h=Reflect.apply(i,this,[h,m,d,this]),d++;return h}reduceRight(...o){const[i,c]=o;let d=c??this.at(-1);for(let h=this.size-1;h>=0;h--){const m=this.at(h);h===this.size-1&&o.length===1?d=m:d=Reflect.apply(i,this,[d,m,h,this])}return d}toSorted(o){const i=[...this.entries()].sort(o);return new Sn(i)}toReversed(){const o=new Sn;for(let i=this.size-1;i>=0;i--){const c=this.keyAt(i),d=this.get(c);o.set(c,d)}return o}toSpliced(...o){const i=[...this.entries()];return i.splice(...o),new Sn(i)}slice(o,i){const c=new Sn;let d=this.size-1;if(o===void 0)return c;o<0&&(o=o+this.size),i!==void 0&&i>0&&(d=i-1);for(let h=o;h<=d;h++){const m=this.keyAt(h),g=this.get(m);c.set(m,g)}return c}every(o,i){let c=0;for(const d of this){if(!Reflect.apply(o,i,[d,c,this]))return!1;c++}return!0}some(o,i){let c=0;for(const d of this){if(Reflect.apply(o,i,[d,c,this]))return!0;c++}return!1}},Tt=new WeakMap,zt(Sn,"OrderedDict"),Sn);function pc(a,l){if("at"in Array.prototype)return Array.prototype.at.call(a,l);const o=wb(a,l);return o===-1?void 0:a[o]}zt(pc,"at");function wb(a,l){const o=a.length,i=_h(l),c=i>=0?i:o+i;return c<0||c>=o?-1:c}zt(wb,"toSafeIndex");function _h(a){return a!==a||a===0?0:Math.trunc(a)}zt(_h,"toSafeInteger");function NE(a){const l=a+"CollectionProvider",[o,i]=dn(l),[c,d]=o(l,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Rf,setItemMap:zt(()=>{},"setItemMap")}),h=zt(({state:M,...A})=>M?s.jsx(g,{...A,state:M}):s.jsx(m,{...A}),"CollectionProvider");h.displayName=l;const m=zt(M=>{const A=C();return s.jsx(g,{...M,state:A})},"CollectionInit");m.displayName=l+"Init";const g=zt(M=>{const{scope:A,children:_,state:z}=M,q=p.useRef(null),[k,W]=p.useState(null),re=Ve(q,W),[K,V]=z;return p.useEffect(()=>{if(!k)return;const le=Eb(()=>{});return le.observe(k,{childList:!0,subtree:!0}),()=>{le.disconnect()}},[k]),s.jsx(c,{scope:A,itemMap:K,setItemMap:V,collectionRef:re,collectionRefObject:q,collectionElement:k,children:_})},"CollectionProviderImpl");g.displayName=l+"Impl";const v=a+"CollectionSlot",b=va(v),S=p.forwardRef((M,A)=>{const{scope:_,children:z}=M,q=d(v,_),k=Ve(A,q.collectionRef);return s.jsx(b,{ref:k,children:z})});S.displayName=v;const x=a+"CollectionItemSlot",w="data-radix-collection-item",E=va(x),j=p.forwardRef((M,A)=>{const{scope:_,children:z,...q}=M,k=p.useRef(null),[W,re]=p.useState(null),K=Ve(A,k,re),V=d(x,_),{setItemMap:le}=V,se=p.useRef(q);jb(se.current,q)||(se.current=q);const ce=se.current;return p.useEffect(()=>{const U=ce;return le($=>W?$.has(W)?$.set(W,{...U,element:W}).toSorted(Xf):($.set(W,{...U,element:W}),$.toSorted(Xf)):$),()=>{le($=>!W||!$.has(W)?$:($.delete(W),new Rf($)))}},[W,ce,le]),s.jsx(E,{[w]:"",ref:K,children:z})});j.displayName=x;function C(){return p.useState(new Rf)}zt(C,"useInitCollection");function T(M){const{itemMap:A}=d(a+"CollectionConsumer",M);return A}return zt(T,"useCollection"),[{Provider:h,Slot:S,ItemSlot:j},{createCollectionScope:i,useCollection:T,useInitCollection:C}]}zt(NE,"createCollection");function jb(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 c of o)if(!Object.prototype.hasOwnProperty.call(l,c)||a[c]!==l[c])return!1;return!0}zt(jb,"shallowEqual");function Cb(a,l){return!!(l.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)}zt(Cb,"isElementPreceding");function Xf(a,l){return!a[1].element||!l[1].element?0:Cb(a[1].element,l[1].element)?-1:1}zt(Xf,"sortByDocumentPosition");function Eb(a){return new MutationObserver(o=>{for(const i of o)if(i.type==="childList"){a();return}})}zt(Eb,"getChildListObserver");var TE=Object.defineProperty,ME=(a,l)=>TE(a,"name",{value:l,configurable:!0}),AE=p.createContext(void 0);function zo(a){const l=p.useContext(AE);return a||l||"ltr"}ME(zo,"useDirection");var _E=Object.defineProperty,DE=(a,l)=>_E(a,"name",{value:l,configurable:!0});function $n(a){const l=p.useRef(a);return p.useEffect(()=>{l.current=a}),p.useMemo(()=>((...o)=>{var i;return(i=l.current)==null?void 0:i.call(l,...o)}),[])}DE($n,"useCallbackRef");var OE=Object.defineProperty,kt=(a,l)=>OE(a,"name",{value:l,configurable:!0}),Ff="dismissableLayer.update",kE="dismissableLayer.pointerDownOutside",zE="dismissableLayer.focusOutside",Yx,Rb=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),zc=p.forwardRef(kt(function(l,o){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:v,...b}=l,S=p.useContext(Rb),[x,w]=p.useState(null),E=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=p.useState({}),C=Ve(o,w),T=Array.from(S.layers),[N]=[...S.layersWithOutsidePointerEventsDisabled].slice(-1),M=N?T.indexOf(N):-1,A=x?T.indexOf(x):-1,_=S.layersWithOutsidePointerEventsDisabled.size>0,z=A>=M,q=p.useRef(!1),k=Tb(V=>{h==null||h(V),g==null||g(V),V.defaultPrevented||v==null||v()},{ownerDocument:E,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:q,dismissableSurfaces:S.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(V=>{if(!(V instanceof Node))return!1;const le=[...S.branches].some(se=>se.contains(V));return z&&!le},[S.branches,z])}),W=Mb(V=>{if(c&&q.current)return;const le=V.target;[...S.branches].some(ce=>ce.contains(le))||(m==null||m(V),g==null||g(V),V.defaultPrevented||v==null||v())},E),re=x?A===T.length-1:!1,K=$n(V=>{V.key==="Escape"&&(d==null||d(V),!V.defaultPrevented&&v&&(V.preventDefault(),v()))});return p.useEffect(()=>{if(re)return E.addEventListener("keydown",K,{capture:!0}),()=>E.removeEventListener("keydown",K,{capture:!0})},[E,re,K]),p.useEffect(()=>{if(x)return i&&(S.layersWithOutsidePointerEventsDisabled.size===0&&(Yx=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),S.layersWithOutsidePointerEventsDisabled.add(x)),S.layers.add(x),Qf(),()=>{i&&(S.layersWithOutsidePointerEventsDisabled.delete(x),S.layersWithOutsidePointerEventsDisabled.size===0&&(E.body.style.pointerEvents=Yx))}},[x,E,i,S]),p.useEffect(()=>()=>{x&&(S.layers.delete(x),S.layersWithOutsidePointerEventsDisabled.delete(x),Qf())},[x,S]),p.useEffect(()=>{const V=kt(()=>j({}),"handleUpdate");return document.addEventListener(Ff,V),()=>document.removeEventListener(Ff,V)},[]),s.jsx(Ue.div,{...b,ref:C,style:{pointerEvents:_?z?"auto":"none":void 0,...l.style},onFocusCapture:we(l.onFocusCapture,W.onFocusCapture),onBlurCapture:we(l.onBlurCapture,W.onBlurCapture),onPointerDownCapture:we(l.onPointerDownCapture,k.onPointerDownCapture)})},"DismissableLayer"));function Nb(){const a=p.useContext(Rb),[l,o]=p.useState(null);return p.useEffect(()=>{if(l)return a.dismissableSurfaces.add(l),()=>{a.dismissableSurfaces.delete(l)}},[l,a.dismissableSurfaces]),o}kt(Nb,"useDismissableLayerSurface");var LE=kt(()=>!0,"IS_TRUE");function Tb(a,l){const{ownerDocument:o=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:d,shouldHandlePointerDownOutside:h=LE}=l,m=$n(a),g=p.useRef(!1),v=p.useRef(!1),b=p.useRef(new Map),S=p.useRef(()=>{});return p.useEffect(()=>{function x(){v.current=!1,c.current=!1,b.current.clear()}kt(x,"resetOutsideInteraction");function w(){return Array.from(b.current.values()).some(Boolean)}kt(w,"isOutsideInteractionIntercepted");function E(M){if(!v.current)return;const A=M.target;A instanceof Node&&[...d].some(z=>z.contains(A))||b.current.set(M.type,!0),M.type==="click"&&window.setTimeout(()=>{v.current&&S.current()},0)}kt(E,"handleInteractionCapture");function j(M){v.current&&b.current.set(M.type,!1)}kt(j,"handleInteractionBubble");const C=kt(M=>{if(M.target&&!g.current){let A=function(){o.removeEventListener("click",S.current);const z=w();x(),z||Dh(kE,m,_,{discrete:!0})};if(kt(A,"handleAndDispatchPointerDownOutsideEvent"),!h(M.target)){o.removeEventListener("click",S.current),x(),g.current=!1;return}const _={originalEvent:M};v.current=!0,c.current=i&&M.button===0,b.current.clear(),!i||M.button!==0?A():(o.removeEventListener("click",S.current),S.current=A,o.addEventListener("click",S.current,{once:!0}))}else o.removeEventListener("click",S.current),x();g.current=!1},"handlePointerDown"),T=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const M of T)o.addEventListener(M,E,!0),o.addEventListener(M,j);const N=window.setTimeout(()=>{o.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(N),o.removeEventListener("pointerdown",C),o.removeEventListener("click",S.current);for(const M of T)o.removeEventListener(M,E,!0),o.removeEventListener(M,j)}},[o,m,i,c,d,h]),{onPointerDownCapture:kt(()=>g.current=!0,"onPointerDownCapture")}}kt(Tb,"usePointerDownOutside");function Mb(a,l=globalThis==null?void 0:globalThis.document){const o=$n(a),i=p.useRef(!1);return p.useEffect(()=>{const c=kt(d=>{d.target&&!i.current&&Dh(zE,o,{originalEvent:d},{discrete:!1})},"handleFocus");return l.addEventListener("focusin",c),()=>l.removeEventListener("focusin",c)},[l,o]),{onFocusCapture:kt(()=>i.current=!0,"onFocusCapture"),onBlurCapture:kt(()=>i.current=!1,"onBlurCapture")}}kt(Mb,"useFocusOutside");function Qf(){const a=new CustomEvent(Ff);document.dispatchEvent(a)}kt(Qf,"dispatchUpdate");function Dh(a,l,o,{discrete:i}){const c=o.originalEvent.target,d=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:o});l&&c.addEventListener(a,l,{once:!0}),i?Ah(c,d):c.dispatchEvent(d)}kt(Dh,"handleAndDispatchCustomEvent");var UE=Object.defineProperty,Oh=(a,l)=>UE(a,"name",{value:l,configurable:!0}),nc=0,ha=null;function HE(a){return Lo(),a.children}Oh(HE,"FocusGuards");function Lo(){p.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)}},[])}Oh(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}Oh(Zf,"createFocusGuard");var BE=Object.defineProperty,Qt=(a,l)=>BE(a,"name",{value:l,configurable:!0}),Nf="focusScope.autoFocusOnMount",Tf="focusScope.autoFocusOnUnmount",$x={bubbles:!1,cancelable:!0},kh=p.forwardRef(Qt(function(l,o){const{loop:i=!1,trapped:c=!1,onMountAutoFocus:d,onUnmountAutoFocus:h,...m}=l,[g,v]=p.useState(null),b=$n(d),S=$n(h),x=p.useRef(null),w=Ve(o,v),E=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(c){let C=function(A){if(E.paused||!g)return;const _=A.target;g.contains(_)?x.current=_:$a(x.current,{select:!0})},T=function(A){if(E.paused||!g)return;const _=A.relatedTarget;_!==null&&(g.contains(_)||$a(x.current,{select:!0}))},N=function(A){if(document.activeElement===document.body)for(const z of A)z.removedNodes.length>0&&$a(g)};Qt(C,"handleFocusIn"),Qt(T,"handleFocusOut"),Qt(N,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",T);const M=new MutationObserver(N);return g&&M.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",T),M.disconnect()}}},[c,g,E.paused]),p.useEffect(()=>{if(g){Kx.add(E);const C=document.activeElement;if(!g.contains(C)){const N=new CustomEvent(Nf,$x);g.addEventListener(Nf,b),g.dispatchEvent(N),N.defaultPrevented||(Ab(zb(zh(g)),{select:!0}),document.activeElement===C&&$a(g))}return()=>{g.removeEventListener(Nf,b),setTimeout(()=>{const N=new CustomEvent(Tf,$x);g.addEventListener(Tf,S),g.dispatchEvent(N),N.defaultPrevented||$a(C??document.body,{select:!0}),g.removeEventListener(Tf,S),Kx.remove(E)},0)}}},[g,b,S,E]);const j=p.useCallback(C=>{if(!i&&!c||E.paused)return;const T=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,N=document.activeElement;if(T&&N){const M=C.currentTarget,[A,_]=_b(M);A&&_?!C.shiftKey&&N===_?(C.preventDefault(),i&&$a(A,{select:!0})):C.shiftKey&&N===A&&(C.preventDefault(),i&&$a(_,{select:!0})):N===M&&C.preventDefault()}},[i,c,E.paused]);return s.jsx(Ue.div,{tabIndex:-1,...m,ref:w,onKeyDown:j})},"FocusScope"));function Ab(a,{select:l=!1}={}){const o=document.activeElement;for(const i of a)if($a(i,{select:l}),document.activeElement!==o)return}Qt(Ab,"focusFirst");function _b(a){const l=zh(a),o=Jf(l,a),i=Jf(l.reverse(),a);return[o,i]}Qt(_b,"getTabbableEdges");function zh(a){const l=[],o=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:Qt(i=>{const c=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||c?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;o.nextNode();)l.push(o.currentNode);return l}Qt(zh,"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}):Db(i,{upTo:l})))return i}Qt(Jf,"findVisible");function Db(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}Qt(Db,"isHidden");function Ob(a){return a instanceof HTMLInputElement&&"select"in a}Qt(Ob,"isSelectableInput");function $a(a,{select:l=!1}={}){if(a&&a.focus){const o=document.activeElement;a.focus({preventScroll:!0}),a!==o&&Ob(a)&&l&&a.select()}}Qt($a,"focus");var Kx=kb();function kb(){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()}}}Qt(kb,"createFocusScopesStack");function Wf(a,l){const o=[...a],i=o.indexOf(l);return i!==-1&&o.splice(i,1),o}Qt(Wf,"arrayRemove");function zb(a){return a.filter(l=>l.tagName!=="A")}Qt(zb,"removeLinks");var PE=Object.defineProperty,qE=(a,l)=>PE(a,"name",{value:l,configurable:!0}),VE=ps[" useId ".trim().toString()]||(()=>{}),IE=0;function ga(a){const[l,o]=p.useState(VE());return _t(()=>{a||o(i=>i??String(IE++))},[a]),a||(l?`radix-${l}`:"")}qE(ga,"useId");const GE=["top","right","bottom","left"],Ll=Math.min,Ka=Math.max,Sc=Math.round,ac=Math.floor,Xa=a=>({x:a,y:a}),YE={left:"right",right:"left",bottom:"top",top:"bottom"};function Lb(a,l,o){return Ka(a,Ll(l,o))}function Ja(a,l){return typeof a=="function"?a(l):a}function Ul(a){return a.split("-")[0]}function ws(a){return a.split("-")[1]}function Lh(a){return a==="x"?"y":"x"}function Uh(a){return a==="y"?"height":"width"}function pa(a){const l=a[0];return l==="t"||l==="b"?"y":"x"}function Hh(a){return Lh(pa(a))}function $E(a,l,o){o===void 0&&(o=!1);const i=ws(a),c=Hh(a),d=Uh(c);let h=c==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return l.reference[d]>l.floating[d]&&(h=wc(h)),[h,wc(h)]}function KE(a){const l=wc(a);return[eh(a),l,eh(l)]}function eh(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}const Xx=["left","right"],Fx=["right","left"],XE=["top","bottom"],FE=["bottom","top"];function QE(a,l,o){switch(a){case"top":case"bottom":return o?l?Fx:Xx:l?Xx:Fx;case"left":case"right":return l?XE:FE;default:return[]}}function ZE(a,l,o,i){const c=ws(a);let d=QE(Ul(a),o==="start",i);return c&&(d=d.map(h=>h+"-"+c),l&&(d=d.concat(d.map(eh)))),d}function wc(a){const l=Ul(a);return YE[l]+a.slice(l.length)}function JE(a){var l,o,i,c;return{top:(l=a.top)!=null?l:0,right:(o=a.right)!=null?o:0,bottom:(i=a.bottom)!=null?i:0,left:(c=a.left)!=null?c:0}}function Ub(a){return typeof a!="number"?JE(a):{top:a,right:a,bottom:a,left:a}}function jc(a){const{x:l,y:o,width:i,height:c}=a;return{width:i,height:c,top:o,left:l,right:l+i,bottom:o+c,x:l,y:o}}function Qx(a,l,o){let{reference:i,floating:c}=a;const d=pa(l),h=Hh(l),m=Uh(h),g=Ul(l),v=d==="y",b=i.x+i.width/2-c.width/2,S=i.y+i.height/2-c.height/2,x=i[m]/2-c[m]/2;let w;switch(g){case"top":w={x:b,y:i.y-c.height};break;case"bottom":w={x:b,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y:S};break;case"left":w={x:i.x-c.width,y:S};break;default:w={x:i.x,y:i.y}}const E=ws(l);return E&&(w[h]+=x*(E==="end"?1:-1)*(o&&v?-1:1)),w}async function WE(a,l){var o;l===void 0&&(l={});const{x:i,y:c,platform:d,rects:h,elements:m,strategy:g}=a,{boundary:v="clippingAncestors",rootBoundary:b="viewport",elementContext:S="floating",altBoundary:x=!1,padding:w=0}=Ja(l,a),E=Ub(w),C=m[x?S==="floating"?"reference":"floating":S],T=jc(await d.getClippingRect({element:(o=await(d.isElement==null?void 0:d.isElement(C)))==null||o?C:C.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(m.floating)),boundary:v,rootBoundary:b,strategy:g})),N=S==="floating"?{x:i,y:c,width:h.floating.width,height:h.floating.height}:h.reference,M=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m.floating)),A=await(d.isElement==null?void 0:d.isElement(M))&&await(d.getScale==null?void 0:d.getScale(M))||{x:1,y:1},_=jc(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:N,offsetParent:M,strategy:g}):N);return{top:(T.top-_.top+E.top)/A.y,bottom:(_.bottom-T.bottom+E.bottom)/A.y,left:(T.left-_.left+E.left)/A.x,right:(_.right-T.right+E.right)/A.x}}const eR=50,tR=async(a,l,o)=>{const{placement:i="bottom",strategy:c="absolute",middleware:d=[],platform:h}=o,m=h.detectOverflow?h:{...h,detectOverflow:WE},g=await(h.isRTL==null?void 0:h.isRTL(l));let v=await h.getElementRects({reference:a,floating:l,strategy:c}),{x:b,y:S}=Qx(v,i,g),x=i,w=0;const E={};for(let j=0;j<d.length;j++){const C=d[j];if(!C)continue;const{name:T,fn:N}=C,{x:M,y:A,data:_,reset:z}=await N({x:b,y:S,initialPlacement:i,placement:x,strategy:c,middlewareData:E,rects:v,platform:m,elements:{reference:a,floating:l}});b=M??b,S=A??S,E[T]={...E[T],..._},z&&w<eR&&(w++,typeof z=="object"&&(z.placement&&(x=z.placement),z.rects&&(v=z.rects===!0?await h.getElementRects({reference:a,floating:l,strategy:c}):z.rects),{x:b,y:S}=Qx(v,x,g)),j=-1)}return{x:b,y:S,placement:x,strategy:c,middlewareData:E}},nR=a=>({name:"arrow",options:a,async fn(l){const{x:o,y:i,placement:c,rects:d,platform:h,elements:m,middlewareData:g}=l,{element:v,padding:b=0}=Ja(a,l)||{};if(v==null)return{};const S=Ub(b),x={x:o,y:i},w=Hh(c),E=Uh(w),j=await h.getDimensions(v),C=w==="y",T=C?"top":"left",N=C?"bottom":"right",M=C?"clientHeight":"clientWidth",A=d.reference[E]+d.reference[w]-x[w]-d.floating[E],_=x[w]-d.reference[w],z=await(h.getOffsetParent==null?void 0:h.getOffsetParent(v));let q=z?z[M]:0;(!q||!await(h.isElement==null?void 0:h.isElement(z)))&&(q=m.floating[M]||d.floating[E]);const k=A/2-_/2,W=q/2-j[E]/2-1,re=Ll(S[T],W),K=Ll(S[N],W),V=q-j[E]-K,le=q/2-j[E]/2+k,se=Lb(re,le,V),ce=!g.arrow&&ws(c)!=null&&le!==se&&d.reference[E]/2-(le<re?re:K)-j[E]/2<0,U=ce?le<re?le-re:le-V:0;return{[w]:x[w]+U,data:{[w]:se,centerOffset:le-se-U,...ce&&{alignmentOffset:U}},reset:ce}}}),aR=function(a){return a===void 0&&(a={}),{name:"flip",options:a,async fn(l){var o,i;const{placement:c,middlewareData:d,rects:h,initialPlacement:m,platform:g,elements:v}=l,{mainAxis:b=!0,crossAxis:S=!0,fallbackPlacements:x,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:j=!0,...C}=Ja(a,l);if((o=d.arrow)!=null&&o.alignmentOffset)return{};const T=Ul(c),N=pa(m),M=Ul(m)===m,A=await(g.isRTL==null?void 0:g.isRTL(v.floating)),_=x||(M||!j?[wc(m)]:KE(m)),z=E!=="none";!x&&z&&_.push(...ZE(m,j,E,A));const q=[m,..._],k=await g.detectOverflow(l,C),W=[];let re=((i=d.flip)==null?void 0:i.overflows)||[];if(b&&W.push(k[T]),S){const se=$E(c,h,A);W.push(k[se[0]],k[se[1]])}if(re=[...re,{placement:c,overflows:W}],!W.every(se=>se<=0)){var K,V;const se=(((K=d.flip)==null?void 0:K.index)||0)+1,ce=q[se];if(ce&&(!(S==="alignment"?N!==pa(ce):!1)||re.every(ne=>pa(ne.placement)===N?ne.overflows[0]>0:!0)))return{data:{index:se,overflows:re},reset:{placement:ce}};let U=(V=re.filter($=>$.overflows[0]<=0).sort(($,ne)=>$.overflows[1]-ne.overflows[1])[0])==null?void 0:V.placement;if(!U)switch(w){case"bestFit":{var le;const $=(le=re.filter(ne=>{if(z){const H=pa(ne.placement);return H===N||H==="y"}return!0}).map(ne=>[ne.placement,ne.overflows.filter(H=>H>0).reduce((H,F)=>H+F,0)]).sort((ne,H)=>ne[1]-H[1])[0])==null?void 0:le[0];$&&(U=$);break}case"initialPlacement":U=m;break}if(c!==U)return{reset:{placement:U}}}return{}}}};function Zx(a,l){return{top:a.top-l.height,right:a.right-l.width,bottom:a.bottom-l.height,left:a.left-l.width}}function Jx(a){return GE.some(l=>a[l]>=0)}const lR=function(a){return a===void 0&&(a={}),{name:"hide",options:a,async fn(l){const{rects:o,platform:i}=l,{strategy:c="referenceHidden",...d}=Ja(a,l);switch(c){case"referenceHidden":{const h=await i.detectOverflow(l,{...d,elementContext:"reference"}),m=Zx(h,o.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Jx(m)}}}case"escaped":{const h=await i.detectOverflow(l,{...d,altBoundary:!0}),m=Zx(h,o.floating);return{data:{escapedOffsets:m,escaped:Jx(m)}}}default:return{}}}}},Hb=new Set(["left","top"]);async function rR(a,l){const{placement:o,platform:i,elements:c}=a,d=await(i.isRTL==null?void 0:i.isRTL(c.floating)),h=Ul(o),m=ws(o),g=pa(o)==="y",v=Hb.has(h)?-1:1,b=d&&g?-1:1,S=Ja(l,a);let{mainAxis:x,crossAxis:w,alignmentAxis:E}=typeof S=="number"?{mainAxis:S,crossAxis:0,alignmentAxis:null}:{mainAxis:S.mainAxis||0,crossAxis:S.crossAxis||0,alignmentAxis:S.alignmentAxis};return m&&typeof E=="number"&&(w=m==="end"?E*-1:E),g?{x:w*b,y:x*v}:{x:x*v,y:w*b}}const sR=function(a){return a===void 0&&(a=0),{name:"offset",options:a,async fn(l){var o,i;const{x:c,y:d,placement:h,middlewareData:m}=l,g=await rR(l,a);return h===((o=m.offset)==null?void 0:o.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:c+g.x,y:d+g.y,data:{...g,placement:h}}}}},oR=function(a){return a===void 0&&(a={}),{name:"shift",options:a,async fn(l){const{x:o,y:i,placement:c,platform:d}=l,{mainAxis:h=!0,crossAxis:m=!1,limiter:g={fn:N=>{let{x:M,y:A}=N;return{x:M,y:A}}},...v}=Ja(a,l),b={x:o,y:i},S=await d.detectOverflow(l,v),x=pa(c),w=Lh(x);let E=b[w],j=b[x];const C=(N,M)=>Lb(M+S[N==="y"?"top":"left"],M,M-S[N==="y"?"bottom":"right"]);h&&(E=C(w,E)),m&&(j=C(x,j));const T=g.fn({...l,[w]:E,[x]:j});return{...T,data:{x:T.x-o,y:T.y-i,enabled:{[w]:h,[x]:m}}}}}},iR=function(a){return a===void 0&&(a={}),{options:a,fn(l){var o,i;const{x:c,y:d,placement:h,rects:m,middlewareData:g}=l,{offset:v=0,mainAxis:b=!0,crossAxis:S=!0}=Ja(a,l),x={x:c,y:d},w=pa(h),E=Lh(w);let j=x[E],C=x[w];const T=Ja(v,l),N=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:(o=T.mainAxis)!=null?o:0,crossAxis:(i=T.crossAxis)!=null?i:0};if(b){const _=E==="y"?"height":"width",z=m.reference[E]-m.floating[_]+N.mainAxis,q=m.reference[E]+m.reference[_]-N.mainAxis;j<z?j=z:j>q&&(j=q)}if(S){var M,A;const _=E==="y"?"width":"height",z=Hb.has(Ul(h)),q=m.reference[w]-m.floating[_]+(z&&((M=g.offset)==null?void 0:M[w])||0)+(z?0:N.crossAxis),k=m.reference[w]+m.reference[_]+(z?0:((A=g.offset)==null?void 0:A[w])||0)-(z?N.crossAxis:0);C<q?C=q:C>k&&(C=k)}return{[E]:j,[w]:C}}}},cR=function(a){return a===void 0&&(a={}),{name:"size",options:a,async fn(l){const{placement:o,rects:i,platform:c,elements:d}=l,{apply:h=()=>{},...m}=Ja(a,l),g=await c.detectOverflow(l,m),v=Ul(o),b=ws(o),S=pa(o)==="y",{width:x,height:w}=i.floating;let E,j;v==="top"||v==="bottom"?(E=v,j=b===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(j=v,E=b==="end"?"top":"bottom");const C=w-g.top-g.bottom,T=x-g.left-g.right,N=Ll(w-g[E],C),M=Ll(x-g[j],T),A=l.middlewareData.shift,_=!A;let z=N,q=M;A!=null&&A.enabled.x&&(q=T),A!=null&&A.enabled.y&&(z=C),_&&!b&&(S?q=x-2*Ka(g.left,g.right):z=w-2*Ka(g.top,g.bottom)),await h({...l,availableWidth:q,availableHeight:z});const k=await c.getDimensions(d.floating);return x!==k.width||w!==k.height?{reset:{rects:!0}}:{}}}};function Lc(){return typeof window<"u"}function js(a){return Bb(a)?(a.nodeName||"").toLowerCase():"#document"}function cn(a){var l;return(a==null||(l=a.ownerDocument)==null?void 0:l.defaultView)||window}function tl(a){var l;return(l=(Bb(a)?a.ownerDocument:a.document)||window.document)==null?void 0:l.documentElement}function Bb(a){return Lc()?a instanceof Node||a instanceof cn(a).Node:!1}function xa(a){return Lc()?a instanceof Element||a instanceof cn(a).Element:!1}function Bl(a){return Lc()?a instanceof HTMLElement||a instanceof cn(a).HTMLElement:!1}function Wx(a){return!Lc()||typeof ShadowRoot>"u"?!1:a instanceof ShadowRoot||a instanceof cn(a).ShadowRoot}function Uc(a){const{overflow:l,overflowX:o,overflowY:i,display:c}=ya(a);return/auto|scroll|overlay|hidden|clip/.test(l+i+o)&&c!=="inline"&&c!=="contents"}function uR(a){return/^(table|td|th)$/.test(js(a))}function Hc(a){try{if(a.matches(":popover-open"))return!0}catch{}try{return a.matches(":modal")}catch{return!1}}const dR=/transform|translate|scale|rotate|perspective|filter/,fR=/paint|layout|strict|content/,sr=a=>!!a&&a!=="none";let Mf;function Bh(a){const l=xa(a)?ya(a):a;return sr(l.transform)||sr(l.translate)||sr(l.scale)||sr(l.rotate)||sr(l.perspective)||!Ph()&&(sr(l.backdropFilter)||sr(l.filter))||dR.test(l.willChange||"")||fR.test(l.contain||"")}function hR(a){let l=fr(a);for(;Bl(l)&&!Eo(l);){if(Bh(l))return l;if(Hc(l))return null;l=fr(l)}return null}function Ph(){return Mf==null&&(Mf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Mf}function Eo(a){return/^(html|body|#document)$/.test(js(a))}function ya(a){return cn(a).getComputedStyle(a)}function Bc(a){return xa(a)?{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}:{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function fr(a){if(js(a)==="html")return a;const l=a.assignedSlot||a.parentNode||Wx(a)&&a.host||tl(a);return Wx(l)?l.host:l}function Pb(a){const l=fr(a);return Eo(l)?(a.ownerDocument||a).body:Bl(l)&&Uc(l)?l:Pb(l)}function Ro(a,l,o){var i;l===void 0&&(l=[]),o===void 0&&(o=!0);const c=Pb(a),d=c===((i=a.ownerDocument)==null?void 0:i.body),h=cn(c);if(d){const m=th(h);return l.concat(h,h.visualViewport||[],Uc(c)?c:[],m&&o?Ro(m):[])}else return l.concat(c,Ro(c,[],o))}function th(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function qb(a){const l=ya(a);let o=parseFloat(l.width)||0,i=parseFloat(l.height)||0;const c=Bl(a),d=c?a.offsetWidth:o,h=c?a.offsetHeight:i,m=Sc(o)!==d||Sc(i)!==h;return m&&(o=d,i=h),{width:o,height:i,$:m}}function qh(a){return xa(a)?a:a.contextElement}function fs(a){const l=qh(a);if(!Bl(l))return Xa(1);const o=l.getBoundingClientRect(),{width:i,height:c,$:d}=qb(l);let h=(d?Sc(o.width):o.width)/i,m=(d?Sc(o.height):o.height)/c;return(!h||!Number.isFinite(h))&&(h=1),(!m||!Number.isFinite(m))&&(m=1),{x:h,y:m}}const mR=Xa(0);function Vb(a){const l=cn(a);return!Ph()||!l.visualViewport?mR:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function pR(a,l,o){return l===void 0&&(l=!1),!!o&&l&&o===cn(a)}function hr(a,l,o,i){l===void 0&&(l=!1),o===void 0&&(o=!1);const c=a.getBoundingClientRect(),d=qh(a);let h=Xa(1);l&&(i?xa(i)&&(h=fs(i)):h=fs(a));const m=pR(d,o,i)?Vb(d):Xa(0);let g=(c.left+m.x)/h.x,v=(c.top+m.y)/h.y,b=c.width/h.x,S=c.height/h.y;if(d&&i){const x=cn(d),w=xa(i)?cn(i):i;let E=x,j=th(E);for(;j&&w!==E;){const C=fs(j),T=j.getBoundingClientRect(),N=ya(j),M=T.left+(j.clientLeft+parseFloat(N.paddingLeft))*C.x,A=T.top+(j.clientTop+parseFloat(N.paddingTop))*C.y;g*=C.x,v*=C.y,b*=C.x,S*=C.y,g+=M,v+=A,E=cn(j),j=th(E)}}return jc({width:b,height:S,x:g,y:v})}function Pc(a,l){const o=Bc(a).scrollLeft;return l?l.left+o:hr(tl(a)).left+o}function Ib(a,l){const o=a.getBoundingClientRect(),i=o.left+l.scrollLeft-Pc(a,o),c=o.top+l.scrollTop;return{x:i,y:c}}function gR(a){let{elements:l,rect:o,offsetParent:i,strategy:c}=a;const d=c==="fixed",h=tl(i),m=l?Hc(l.floating):!1;if(i===h||m&&d)return o;let g={scrollLeft:0,scrollTop:0},v=Xa(1);const b=Xa(0),S=Bl(i);if((S||!d)&&((js(i)!=="body"||Uc(h))&&(g=Bc(i)),S)){const w=hr(i);v=fs(i),b.x=w.x+i.clientLeft,b.y=w.y+i.clientTop}const x=h&&!S&&!d?Ib(h,g):Xa(0);return{width:o.width*v.x,height:o.height*v.y,x:o.x*v.x-g.scrollLeft*v.x+b.x+x.x,y:o.y*v.y-g.scrollTop*v.y+b.y+x.y}}function vR(a){return a.getClientRects?Array.from(a.getClientRects()):[]}function xR(a){const l=Bc(a),o=a.ownerDocument.body,i=Ka(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),c=Ka(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let d=-l.scrollLeft+Pc(a);const h=-l.scrollTop;return ya(o).direction==="rtl"&&(d+=Ka(a.clientWidth,o.clientWidth)-i),{width:i,height:c,x:d,y:h}}const yR=25;function bR(a,l,o){o===void 0&&(o="viewport");const i=o==="layoutViewport",c=cn(a),d=tl(a),h=c.visualViewport;let m=d.clientWidth,g=d.clientHeight,v=0,b=0;if(h){const x=!Ph()||l==="fixed";i?x||(v=-h.offsetLeft,b=-h.offsetTop):(m=h.width,g=h.height,x&&(v=h.offsetLeft,b=h.offsetTop))}if(Pc(d)<=0){const x=d.ownerDocument,w=x.body,E=getComputedStyle(w),j=x.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,C=Math.abs(d.clientWidth-w.clientWidth-j),T=getComputedStyle(d).scrollbarGutter==="stable both-edges"?C/2:C;T<=yR&&(m-=T)}return{width:m,height:g,x:v,y:b}}function SR(a,l){const o=hr(a,!0,l==="fixed"),i=o.top+a.clientTop,c=o.left+a.clientLeft,d=fs(a),h=a.clientWidth*d.x,m=a.clientHeight*d.y,g=c*d.x,v=i*d.y;return{width:h,height:m,x:g,y:v}}function ey(a,l,o){let i;if(l==="viewport"||l==="layoutViewport")i=bR(a,o,l);else if(l==="document")i=xR(tl(a));else if(xa(l))i=SR(l,o);else{const c=Vb(a);i={x:l.x-c.x,y:l.y-c.y,width:l.width,height:l.height}}return jc(i)}function wR(a,l){const o=l.get(a);if(o)return o;let i=Ro(a,[],!1).filter(m=>xa(m)&&js(m)!=="body"),c=null;const d=ya(a).position==="fixed";let h=d?fr(a):a;for(;xa(h)&&!Eo(h);){const m=ya(h),g=Bh(h),v=c?c.position:d?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&m.position==="static")?i=i.filter(S=>S!==h):c=m,h=fr(h)}return l.set(a,i),i}function jR(a){let{element:l,boundary:o,rootBoundary:i,strategy:c}=a;const h=[...o==="clippingAncestors"?Hc(l)?[]:wR(l,this._c):[].concat(o),i],m=ey(l,h[0],c);let g=m.top,v=m.right,b=m.bottom,S=m.left;for(let x=1;x<h.length;x++){const w=ey(l,h[x],c);g=Ka(w.top,g),v=Ll(w.right,v),b=Ll(w.bottom,b),S=Ka(w.left,S)}return{width:v-S,height:b-g,x:S,y:g}}function CR(a){const{width:l,height:o}=qb(a);return{width:l,height:o}}function ER(a,l,o){const i=Bl(l),c=tl(l),d=o==="fixed",h=hr(a,!0,d,l);let m={scrollLeft:0,scrollTop:0};const g=Xa(0);if((i||!d)&&((js(l)!=="body"||Uc(c))&&(m=Bc(l)),i)){const x=hr(l,!0,d,l);g.x=x.x+l.clientLeft,g.y=x.y+l.clientTop}!i&&c&&(g.x=Pc(c));const v=c&&!i&&!d?Ib(c,m):Xa(0),b=h.left+m.scrollLeft-g.x-v.x,S=h.top+m.scrollTop-g.y-v.y;return{x:b,y:S,width:h.width,height:h.height}}function Af(a){return ya(a).position==="static"}function ty(a,l){if(!Bl(a)||ya(a).position==="fixed")return null;if(l)return l(a);let o=a.offsetParent;return tl(a)===o&&(o=o.ownerDocument.body),o}function Gb(a,l){const o=cn(a);if(Hc(a))return o;if(!Bl(a)){let c=fr(a);for(;c&&!Eo(c);){if(xa(c)&&!Af(c))return c;c=fr(c)}return o}let i=ty(a,l);for(;i&&uR(i)&&Af(i);)i=ty(i,l);return i&&Eo(i)&&Af(i)&&!Bh(i)?o:i||hR(a)||o}const RR=async function(a){const l=this.getOffsetParent||Gb,o=this.getDimensions,i=await o(a.floating);return{reference:ER(a.reference,await l(a.floating),a.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function NR(a){return ya(a).direction==="rtl"}const TR={convertOffsetParentRelativeRectToViewportRelativeRect:gR,getDocumentElement:tl,getClippingRect:jR,getOffsetParent:Gb,getElementRects:RR,getClientRects:vR,getDimensions:CR,getScale:fs,isElement:xa,isRTL:NR};function Yb(a,l){return a.x===l.x&&a.y===l.y&&a.width===l.width&&a.height===l.height}function MR(a,l,o){let i=null,c;const d=tl(a);function h(){var b;clearTimeout(c),(b=i)==null||b.disconnect(),i=null}function m(b,S){b===void 0&&(b=!1),S===void 0&&(S=1),h();const x=a.getBoundingClientRect(),{left:w,top:E,width:j,height:C}=x;if(b||l(),!j||!C)return;const T=ac(E),N=ac(d.clientWidth-(w+j)),M=ac(d.clientHeight-(E+C)),A=ac(w),z={rootMargin:-T+"px "+-N+"px "+-M+"px "+-A+"px",threshold:Ka(0,Ll(1,S))||1};let q=!0;function k(W){const re=W[0].intersectionRatio;if(!Yb(x,a.getBoundingClientRect()))return m();if(re!==S){if(!q)return m();re?m(!1,re):c=setTimeout(()=>{m(!1,1e-7)},1e3)}q=!1}try{i=new IntersectionObserver(k,{...z,root:d.ownerDocument})}catch{i=new IntersectionObserver(k,z)}i.observe(a)}const g=cn(a),v=()=>m(o);return g.addEventListener("resize",v),m(!0),()=>{g.removeEventListener("resize",v),h()}}function AR(a,l,o,i){i===void 0&&(i={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:g=!1}=i,v=qh(a),b=c||d?[...v?Ro(v):[],...l?Ro(l):[]]:[];b.forEach(T=>{c&&T.addEventListener("scroll",o),d&&T.addEventListener("resize",o)});const S=v&&m?MR(v,o,d):null;let x=-1,w=null;h&&(w=new ResizeObserver(T=>{let[N]=T;N&&N.target===v&&w&&l&&(w.unobserve(l),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var M;(M=w)==null||M.observe(l)})),o()}),v&&!g&&w.observe(v),l&&w.observe(l));let E,j=g?hr(a):null;g&&C();function C(){const T=hr(a);j&&!Yb(j,T)&&o(),j=T,E=requestAnimationFrame(C)}return o(),()=>{var T;b.forEach(N=>{c&&N.removeEventListener("scroll",o),d&&N.removeEventListener("resize",o)}),S==null||S(),(T=w)==null||T.disconnect(),w=null,g&&cancelAnimationFrame(E)}}const _R=sR,DR=oR,OR=aR,kR=cR,zR=lR,ny=nR,LR=iR,UR=(a,l,o)=>{const i=new Map,c=o??{},d={...TR,...c.platform,_c:i};return tR(a,l,{...c,platform:d})};var HR=typeof document<"u",BR=function(){},gc=HR?p.useLayoutEffect:BR;function Cc(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,c;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(!Cc(a[i],l[i]))return!1;return!0}if(c=Object.keys(a),o=c.length,o!==Object.keys(l).length)return!1;for(i=o;i--!==0;)if(!{}.hasOwnProperty.call(l,c[i]))return!1;for(i=o;i--!==0;){const d=c[i];if(!(d==="_owner"&&a.$$typeof)&&!Cc(a[d],l[d]))return!1}return!0}return a!==a&&l!==l}function $b(a){return typeof window>"u"?1:(a.ownerDocument.defaultView||window).devicePixelRatio||1}function ay(a,l){const o=$b(a);return Math.round(l*o)/o}function _f(a){const l=p.useRef(a);return gc(()=>{l.current=a}),l}function PR(a){a===void 0&&(a={});const{placement:l="bottom",strategy:o="absolute",middleware:i=[],platform:c,elements:{reference:d,floating:h}={},transform:m=!0,whileElementsMounted:g,open:v}=a,[b,S]=p.useState({x:0,y:0,strategy:o,placement:l,middlewareData:{},isPositioned:!1}),[x,w]=p.useState(i);Cc(x,i)||w(i);const[E,j]=p.useState(null),[C,T]=p.useState(null),N=p.useCallback(ne=>{ne!==z.current&&(z.current=ne,j(ne))},[]),M=p.useCallback(ne=>{ne!==q.current&&(q.current=ne,T(ne))},[]),A=d||E,_=h||C,z=p.useRef(null),q=p.useRef(null),k=p.useRef(b),W=g!=null,re=_f(g),K=_f(c),V=_f(v),le=p.useCallback(()=>{if(!z.current||!q.current)return;const ne={placement:l,strategy:o,middleware:x};K.current&&(ne.platform=K.current),UR(z.current,q.current,ne).then(H=>{const F={...H,isPositioned:V.current!==!1};se.current&&!Cc(k.current,F)&&(k.current=F,ys.flushSync(()=>{S(F)}))})},[x,l,o,K,V]);gc(()=>{v===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,S(ne=>({...ne,isPositioned:!1})))},[v]);const se=p.useRef(!1);gc(()=>(se.current=!0,()=>{se.current=!1}),[]),gc(()=>{if(A&&(z.current=A),_&&(q.current=_),A&&_){if(re.current)return re.current(A,_,le);le()}},[A,_,le,re,W]);const ce=p.useMemo(()=>({reference:z,floating:q,setReference:N,setFloating:M}),[N,M]),U=p.useMemo(()=>({reference:A,floating:_}),[A,_]),$=p.useMemo(()=>{const ne={position:o,left:0,top:0};if(!U.floating)return ne;const H=ay(U.floating,b.x),F=ay(U.floating,b.y);return m?{...ne,transform:"translate("+H+"px, "+F+"px)",...$b(U.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:H,top:F}},[o,m,U.floating,b.x,b.y]);return p.useMemo(()=>({...b,update:le,refs:ce,elements:U,floatingStyles:$}),[b,le,ce,U,$])}const qR=a=>{function l(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:a,fn(o){const{element:i,padding:c}=typeof a=="function"?a(o):a;return i&&l(i)?i.current!=null?ny({element:i.current,padding:c}).fn(o):{}:i?ny({element:i,padding:c}).fn(o):{}}}},VR=(a,l)=>{const o=_R(a);return{name:o.name,fn:o.fn,options:[a,l]}},IR=(a,l)=>{const o=DR(a);return{name:o.name,fn:o.fn,options:[a,l]}},GR=(a,l)=>({fn:LR(a).fn,options:[a,l]}),YR=(a,l)=>{const o=OR(a);return{name:o.name,fn:o.fn,options:[a,l]}},$R=(a,l)=>{const o=kR(a);return{name:o.name,fn:o.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=qR(a);return{name:o.name,fn:o.fn,options:[a,l]}};var FR=Object.defineProperty,QR=(a,l)=>FR(a,"name",{value:l,configurable:!0});function qc(a){const[l,o]=p.useState(void 0);return _t(()=>{if(a){o({width:a.offsetWidth,height:a.offsetHeight});const i=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let h,m;if("borderBoxSize"in d){const g=d.borderBoxSize,v=Array.isArray(g)?g[0]:g;h=v.inlineSize,m=v.blockSize}else h=a.offsetWidth,m=a.offsetHeight;o({width:h,height:m})});return i.observe(a,{box:"border-box"}),()=>i.unobserve(a)}else o(void 0)},[a]),l}QR(qc,"useSize");var ZR=Object.defineProperty,kl=(a,l)=>ZR(a,"name",{value:l,configurable:!0}),Kb="Popper",[Xb,Cs]=dn(Kb),[JR,Fb]=Xb(Kb),WR=kl(a=>{const{__scopePopper:l,children:o}=a,[i,c]=p.useState(null),[d,h]=p.useState(void 0);return s.jsx(JR,{scope:l,anchor:i,onAnchorChange:c,placementState:d,setPlacementState:h,children:o})},"Popper"),eN="PopperAnchor",tN=p.forwardRef(kl(function(l,o){const{__scopePopper:i,virtualRef:c,...d}=l,h=Fb(eN,i),m=p.useRef(null),g=h.onAnchorChange,v=p.useCallback(j=>{m.current=j,j&&g(j)},[g]),b=Ve(o,v),S=p.useRef(null);p.useEffect(()=>{if(!c)return;const j=S.current;S.current=c.current,j!==S.current&&g(S.current)});const x=h.placementState&&Vc(h.placementState),w=x==null?void 0:x[0],E=x==null?void 0:x[1];return c?null:s.jsx(Ue.div,{"data-radix-popper-side":w,"data-radix-popper-align":E,...d,ref:b})},"PopperAnchor")),Qb="PopperContent",[nN,OD]=Xb(Qb),aN=p.forwardRef(kl(function(l,o){var me,Re,Ae,Me,He,mt,pt;const{__scopePopper:i,side:c="bottom",sideOffset:d=0,align:h="center",alignOffset:m=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:b=[],collisionPadding:S=0,sticky:x="partial",hideWhenDetached:w=!1,updatePositionStrategy:E="optimized",onPlaced:j,...C}=l,T=Fb(Qb,i),[N,M]=p.useState(null),A=Ve(o,M),[_,z]=p.useState(null),q=qc(_),k=(q==null?void 0:q.width)??0,W=(q==null?void 0:q.height)??0,re=c+(h!=="center"?"-"+h:""),K=typeof S=="number"?S:{top:0,right:0,bottom:0,left:0,...S},V=Array.isArray(b)?b:[b],le=V.length>0,se={padding:K,boundary:V.filter(Zb),altBoundary:le},{refs:ce,floatingStyles:U,placement:$,isPositioned:ne,middlewareData:H}=PR({strategy:"fixed",placement:re,whileElementsMounted:kl((...bt)=>AR(...bt,{animationFrame:E==="always"}),"whileElementsMounted"),elements:{reference:T.anchor},middleware:[VR({mainAxis:d+W,alignmentAxis:m}),v&&IR({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?GR():void 0,...se}),v&&YR({...se}),$R({...se,apply:kl(({elements:bt,rects:St,availableWidth:Lt,availableHeight:fn})=>{const{width:Qn,height:hn}=St.reference,ja=bt.floating.style;ja.setProperty("--radix-popper-available-width",`${Lt}px`),ja.setProperty("--radix-popper-available-height",`${fn}px`),ja.setProperty("--radix-popper-anchor-width",`${Qn}px`),ja.setProperty("--radix-popper-anchor-height",`${hn}px`)},"apply")}),_&&XR({element:_,padding:g}),lN({arrowWidth:k,arrowHeight:W}),w&&KR({strategy:"referenceHidden",...se,boundary:le?se.boundary:void 0})]}),F=T.setPlacementState;_t(()=>(F($),()=>{F(void 0)}),[$,F]);const[D,P]=Vc($),Q=$n(j);_t(()=>{ne&&(Q==null||Q())},[ne,Q]);const ae=(me=H.arrow)==null?void 0:me.x,de=(Re=H.arrow)==null?void 0:Re.y,Z=((Ae=H.arrow)==null?void 0:Ae.centerOffset)!==0,[oe,ie]=p.useState();return _t(()=>{N&&ie(window.getComputedStyle(N).zIndex)},[N]),s.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:ne?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(Me=H.transformOrigin)==null?void 0:Me.x,(He=H.transformOrigin)==null?void 0:He.y].join(" "),...((mt=H.hide)==null?void 0:mt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:l.dir,children:s.jsx(nN,{scope:i,placedSide:D,placedAlign:P,onArrowChange:z,arrowX:ae,arrowY:de,shouldHideArrow:Z,children:s.jsx(Ue.div,{"data-side":D,"data-align":P,...C,ref:A,style:{...C.style,animation:ne?(pt=C.style)==null?void 0:pt.animation:"none"}})})})},"PopperContent"));function Zb(a){return a!==null}kl(Zb,"isNotNull");var lN=kl(a=>({name:"transformOrigin",options:a,fn(l){var C,T,N;const{placement:o,rects:i,middlewareData:c}=l,h=((C=c.arrow)==null?void 0:C.centerOffset)!==0,m=h?0:a.arrowWidth,g=h?0:a.arrowHeight,[v,b]=Vc(o),S={start:"0%",center:"50%",end:"100%"}[b],x=(((T=c.arrow)==null?void 0:T.x)??0)+m/2,w=(((N=c.arrow)==null?void 0:N.y)??0)+g/2;let E="",j="";return v==="bottom"?(E=h?S:`${x}px`,j=`${-g}px`):v==="top"?(E=h?S:`${x}px`,j=`${i.floating.height+g}px`):v==="right"?(E=`${-g}px`,j=h?S:`${w}px`):v==="left"&&(E=`${i.floating.width+g}px`,j=h?S:`${w}px`),{data:{x:E,y:j}}}}),"transformOrigin");function Vc(a){const[l,o="center"]=a.split("-");return[l,o]}kl(Vc,"getSideAndAlignFromPlacement");var Jb=WR,Wb=tN,Vh=aN,rN=Object.defineProperty,sN=(a,l)=>rN(a,"name",{value:l,configurable:!0}),Ih=p.forwardRef(sN(function(l,o){var g;const{container:i,...c}=l,[d,h]=p.useState(!1);_t(()=>h(!0),[]);const m=i||d&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return m?ys.createPortal(s.jsx(Ue.div,{...c,ref:o}),m):null},"Portal")),oN=Object.defineProperty,Wa=(a,l)=>oN(a,"name",{value:l,configurable:!0});function e0(a,l){return p.useReducer((o,i)=>l[o][i]??o,a)}Wa(e0,"useStateMachine");var nl=Wa(a=>{const{present:l,children:o}=a,i=t0(l),c=typeof o=="function"?o({present:i.isPresent}):p.Children.only(o),d=n0(i.ref,a0(c));return typeof o=="function"||i.isPresent?p.cloneElement(c,{ref:d}):null},"Presence");function t0(a){const[l,o]=p.useState(),i=p.useRef(null),c=p.useRef(a),d=p.useRef("none"),h=p.useRef(void 0),m=a?"mounted":"unmounted",[g,v]=e0(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{g==="mounted"?(d.current=h.current??us(i.current),h.current=void 0):d.current="none"},[g]),_t(()=>{const b=i.current,S=c.current;if(S!==a){const w=d.current,E=us(b);a?(h.current=E,v("MOUNT")):E==="none"||(b==null?void 0:b.display)==="none"?v("UNMOUNT"):v(S&&w!==E?"ANIMATION_OUT":"UNMOUNT"),c.current=a}},[a,v]),_t(()=>{if(l){let b;const S=l.ownerDocument.defaultView??window,x=Wa(E=>{const C=us(i.current).includes(CSS.escape(E.animationName));if(E.target===l&&C&&(v("ANIMATION_END"),!c.current)){const T=l.style.animationFillMode;l.style.animationFillMode="forwards",b=S.setTimeout(()=>{l.style.animationFillMode==="forwards"&&(l.style.animationFillMode=T)})}},"handleAnimationEnd"),w=Wa(E=>{E.target===l&&(d.current=us(i.current))},"handleAnimationStart");return l.addEventListener("animationstart",w),l.addEventListener("animationcancel",x),l.addEventListener("animationend",x),()=>{S.clearTimeout(b),l.removeEventListener("animationstart",w),l.removeEventListener("animationcancel",x),l.removeEventListener("animationend",x)}}else v("ANIMATION_END")},[l,v]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:p.useCallback(b=>{if(b){const S=getComputedStyle(b);i.current=S,h.current=us(S)}else i.current=null;o(b)},[])}}Wa(t0,"usePresence");function nh(a,l){if(typeof a=="function")return a(l);a!=null&&(a.current=l)}Wa(nh,"setRef");function n0(...a){const l=p.useRef(a);return l.current=a,p.useCallback(o=>{const i=l.current;let c=!1;const d=i.map(h=>{const m=nh(h,o);return!c&&typeof m=="function"&&(c=!0),m});if(c)return()=>{for(let h=0;h<d.length;h++){const m=d[h];typeof m=="function"?m():nh(i[h],null)}}},[])}Wa(n0,"useStableComposedRefs");function us(a){return(a==null?void 0:a.animationName)||"none"}Wa(us,"getAnimationName");function a0(a){var i,c;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=(c=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:c.get,o=l&&"isReactWarning"in l&&l.isReactWarning,o?a.props.ref:a.props.ref||a.ref)}Wa(a0,"getElementRef");var iN=Object.defineProperty,Gh=(a,l)=>iN(a,"name",{value:l,configurable:!0}),Df=!1;function l0(){const[a,l]=p.useState(Df);return p.useEffect(()=>{Df||(Df=!0,l(!0))},[]),a}Gh(l0,"useIsHydrated");var r0=ps[" useSyncExternalStore ".trim().toString()];function s0(){return()=>{}}Gh(s0,"subscribe");function o0(){return r0(s0,()=>!0,()=>!1)}Gh(o0,"useIsHydratedModern");var cN=typeof r0=="function"?o0:l0,uN=Object.defineProperty,pr=(a,l)=>uN(a,"name",{value:l,configurable:!0}),Of="rovingFocusGroup.onEntryFocus",dN={bubbles:!1,cancelable:!0},Ic="RovingFocusGroup",[ah,i0,fN]=kc(Ic),[hN,Gc]=dn(Ic,[fN]),[mN,pN]=hN(Ic),gN=p.forwardRef(pr(function(l,o){return s.jsx(ah.Provider,{scope:l.__scopeRovingFocusGroup,children:s.jsx(ah.Slot,{scope:l.__scopeRovingFocusGroup,children:s.jsx(vN,{...l,ref:o})})})},"RovingFocusGroup")),vN=p.forwardRef(pr(function(l,o){const{__scopeRovingFocusGroup:i,orientation:c,loop:d=!1,dir:h,currentTabStopId:m,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:b,preventScrollOnEntryFocus:S=!1,...x}=l,w=p.useRef(null),E=Ve(o,w),j=zo(h),[C,T]=Za({prop:m,defaultProp:g??null,onChange:v,caller:Ic}),[N,M]=p.useState(!1),A=$n(b),_=i0(i),z=p.useRef(!1),[q,k]=p.useState(0);return p.useEffect(()=>{const W=w.current;if(W)return W.addEventListener(Of,A),()=>W.removeEventListener(Of,A)},[A]),s.jsx(mN,{scope:i,orientation:c,dir:j,loop:d,currentTabStopId:C,onItemFocus:p.useCallback(W=>T(W),[T]),onItemShiftTab:p.useCallback(()=>M(!0),[]),onFocusableItemAdd:p.useCallback(()=>k(W=>W+1),[]),onFocusableItemRemove:p.useCallback(()=>k(W=>W-1),[]),children:s.jsx(Ue.div,{tabIndex:N||q===0?-1:0,"data-orientation":c,...x,ref:E,style:{outline:"none",...l.style},onMouseDown:we(l.onMouseDown,()=>{z.current=!0}),onFocus:we(l.onFocus,W=>{const re=!z.current;if(W.target===W.currentTarget&&re&&!N){const K=new CustomEvent(Of,dN);if(W.currentTarget.dispatchEvent(K),!K.defaultPrevented){const V=_().filter($=>$.focusable),le=V.find($=>$.active),se=V.find($=>$.id===C),U=[le,se,...V].filter(Boolean).map($=>$.ref.current);Yh(U,S)}}z.current=!1}),onBlur:we(l.onBlur,()=>M(!1))})})},"RovingFocusGroupImpl")),xN="RovingFocusGroupItem",yN=p.forwardRef(pr(function(l,o){const{__scopeRovingFocusGroup:i,focusable:c=!0,active:d=!1,tabStopId:h,children:m,...g}=l,v=ga(),b=h||v,S=pN(xN,i),x=S.currentTabStopId===b,w=i0(i),{onFocusableItemAdd:E,onFocusableItemRemove:j,currentTabStopId:C}=S,T=cN();return _t(()=>{if(!(!T||!c))return E(),()=>j()},[T,c,E,j]),p.useEffect(()=>{if(!(T||!c))return E(),()=>j()},[T,c,E,j]),s.jsx(ah.ItemSlot,{scope:i,id:b,focusable:c,active:d,children:s.jsx(Ue.span,{tabIndex:x?0:-1,"data-orientation":S.orientation,...g,ref:o,onMouseDown:we(l.onMouseDown,N=>{c?S.onItemFocus(b):N.preventDefault()}),onFocus:we(l.onFocus,()=>S.onItemFocus(b)),onKeyDown:we(l.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){S.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const M=u0(N,S.orientation,S.dir);if(M!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let _=w().filter(z=>z.focusable).map(z=>z.ref.current);if(M==="last")_.reverse();else if(M==="prev"||M==="next"){M==="prev"&&_.reverse();const z=_.indexOf(N.currentTarget);_=S.loop?d0(_,z+1):_.slice(z+1)}setTimeout(()=>Yh(_))}}),children:typeof m=="function"?m({isCurrentTabStop:x,hasTabStop:C!=null}):m})})},"RovingFocusGroupItem")),bN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function c0(a,l){return l!=="rtl"?a:a==="ArrowLeft"?"ArrowRight":a==="ArrowRight"?"ArrowLeft":a}pr(c0,"getDirectionAwareKey");function u0(a,l,o){const i=c0(a.key,o);if(!(l==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(l==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return bN[i]}pr(u0,"getFocusIntent");function Yh(a,l=!1){const o=document.activeElement;for(const i of a)if(i===o||(i.focus({preventScroll:l}),document.activeElement!==o))return}pr(Yh,"focusFirst");function d0(a,l){return a.map((o,i)=>a[(l+i)%a.length])}pr(d0,"wrapArray");var f0=gN,h0=yN,SN=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={},kf=0,m0=function(a){return a&&(a.host||m0(a.parentNode))},wN=function(a,l){return l.map(function(o){if(a.contains(o))return o;var i=m0(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})},jN=function(a,l,o,i){var c=wN(l,Array.isArray(a)?a:[a]);rc[o]||(rc[o]=new WeakMap);var d=rc[o],h=[],m=new Set,g=new Set(c),v=function(S){!S||m.has(S)||(m.add(S),v(S.parentNode))};c.forEach(v);var b=function(S){!S||g.has(S)||Array.prototype.forEach.call(S.children,function(x){if(m.has(x))b(x);else try{var w=x.getAttribute(i),E=w!==null&&w!=="false",j=(os.get(x)||0)+1,C=(d.get(x)||0)+1;os.set(x,j),d.set(x,C),h.push(x),j===1&&E&&lc.set(x,!0),C===1&&x.setAttribute(o,"true"),E||x.setAttribute(i,"true")}catch(T){console.error("aria-hidden: cannot operate on ",x,T)}})};return b(l),m.clear(),kf++,function(){h.forEach(function(S){var x=os.get(S)-1,w=d.get(S)-1;os.set(S,x),d.set(S,w),x||(lc.has(S)||S.removeAttribute(i),lc.delete(S)),w||S.removeAttribute(o)}),kf--,kf||(os=new WeakMap,os=new WeakMap,lc=new WeakMap,rc={})}},$h=function(a,l,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(a)?a:[a]),c=SN(a);return c?(i.push.apply(i,Array.from(c.querySelectorAll("[aria-live], script"))),jN(i,c,o,"aria-hidden")):function(){return null}},ma=function(){return ma=Object.assign||function(l){for(var o,i=1,c=arguments.length;i<c;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 p0(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 c=0,i=Object.getOwnPropertySymbols(a);c<i.length;c++)l.indexOf(i[c])<0&&Object.prototype.propertyIsEnumerable.call(a,i[c])&&(o[i[c]]=a[i[c]]);return o}function CN(a,l,o){if(o||arguments.length===2)for(var i=0,c=l.length,d;i<c;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 vc="right-scroll-bar-position",xc="width-before-scroll-bar",EN="with-scroll-bars-hidden",RN="--removed-body-scroll-bar-size";function zf(a,l){return typeof a=="function"?a(l):a&&(a.current=l),a}function NN(a,l){var o=p.useState(function(){return{value:a,callback:l,facade:{get current(){return o.value},set current(i){var c=o.value;c!==i&&(o.value=i,o.callback(i,c))}}}})[0];return o.callback=l,o.facade}var TN=typeof window<"u"?p.useLayoutEffect:p.useEffect,ly=new WeakMap;function MN(a,l){var o=NN(null,function(i){return a.forEach(function(c){return zf(c,i)})});return TN(function(){var i=ly.get(o);if(i){var c=new Set(i),d=new Set(a),h=o.current;c.forEach(function(m){d.has(m)||zf(m,null)}),d.forEach(function(m){c.has(m)||zf(m,h)})}ly.set(o,a)},[a]),o}function AN(a){return a}function _N(a,l){l===void 0&&(l=AN);var o=[],i=!1,c={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(m){return m!==h})}},assignSyncMedium:function(d){for(i=!0;o.length;){var h=o;o=[],h.forEach(d)}o={push:function(m){return d(m)},filter:function(){return o}}},assignMedium:function(d){i=!0;var h=[];if(o.length){var m=o;o=[],m.forEach(d),h=o}var g=function(){var b=h;h=[],b.forEach(d)},v=function(){return Promise.resolve().then(g)};v(),o={push:function(b){h.push(b),v()},filter:function(b){return h=h.filter(b),o}}}};return c}function DN(a){a===void 0&&(a={});var l=_N(null);return l.options=ma({async:!0,ssr:!1},a),l}var g0=function(a){var l=a.sideCar,o=p0(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 p.createElement(i,ma({},o))};g0.isSideCarExport=!0;function ON(a,l){return a.useMedium(l),g0}var v0=DN(),Lf=function(){},Yc=p.forwardRef(function(a,l){var o=p.useRef(null),i=p.useState({onScrollCapture:Lf,onWheelCapture:Lf,onTouchMoveCapture:Lf}),c=i[0],d=i[1],h=a.forwardProps,m=a.children,g=a.className,v=a.removeScrollBar,b=a.enabled,S=a.shards,x=a.sideCar,w=a.noRelative,E=a.noIsolation,j=a.inert,C=a.allowPinchZoom,T=a.as,N=T===void 0?"div":T,M=a.gapMode,A=p0(a,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=x,z=MN([o,l]),q=ma(ma({},A),c);return p.createElement(p.Fragment,null,b&&p.createElement(_,{sideCar:v0,removeScrollBar:v,shards:S,noRelative:w,noIsolation:E,inert:j,setCallbacks:d,allowPinchZoom:!!C,lockRef:o,gapMode:M}),h?p.cloneElement(p.Children.only(m),ma(ma({},q),{ref:z})):p.createElement(N,ma({},q,{className:g,ref:z}),m))});Yc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Yc.classNames={fullWidth:xc,zeroRight:vc};var kN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zN(){if(!document)return null;var a=document.createElement("style");a.type="text/css";var l=kN();return l&&a.setAttribute("nonce",l),a}function LN(a,l){a.styleSheet?a.styleSheet.cssText=l:a.appendChild(document.createTextNode(l))}function UN(a){var l=document.head||document.getElementsByTagName("head")[0];l.appendChild(a)}var HN=function(){var a=0,l=null;return{add:function(o){a==0&&(l=zN())&&(LN(l,o),UN(l)),a++},remove:function(){a--,!a&&l&&(l.parentNode&&l.parentNode.removeChild(l),l=null)}}},BN=function(){var a=HN();return function(l,o){p.useEffect(function(){return a.add(l),function(){a.remove()}},[l&&o])}},x0=function(){var a=BN(),l=function(o){var i=o.styles,c=o.dynamic;return a(i,c),null};return l},PN={left:0,top:0,right:0,gap:0},Uf=function(a){return parseInt(a||"",10)||0},qN=function(a){var l=window.getComputedStyle(document.body),o=l[a==="padding"?"paddingLeft":"marginLeft"],i=l[a==="padding"?"paddingTop":"marginTop"],c=l[a==="padding"?"paddingRight":"marginRight"];return[Uf(o),Uf(i),Uf(c)]},VN=function(a){if(a===void 0&&(a="margin"),typeof window>"u")return PN;var l=qN(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])}},IN=x0(),hs="data-scroll-locked",GN=function(a,l,o,i){var c=a.left,d=a.top,h=a.right,m=a.gap;return o===void 0&&(o="margin"),`
|
|
281
|
-
.`.concat(EN,` {
|
|
282
|
-
overflow: hidden `).concat(i,`;
|
|
283
|
-
padding-right: `).concat(m,"px ").concat(i,`;
|
|
284
|
-
}
|
|
285
|
-
body[`).concat(hs,`] {
|
|
286
|
-
overflow: hidden `).concat(i,`;
|
|
287
|
-
overscroll-behavior: contain;
|
|
288
|
-
`).concat([l&&"position: relative ".concat(i,";"),o==="margin"&&`
|
|
289
|
-
padding-left: `.concat(c,`px;
|
|
290
|
-
padding-top: `).concat(d,`px;
|
|
291
|
-
padding-right: `).concat(h,`px;
|
|
292
|
-
margin-left:0;
|
|
293
|
-
margin-top:0;
|
|
294
|
-
margin-right: `).concat(m,"px ").concat(i,`;
|
|
295
|
-
`),o==="padding"&&"padding-right: ".concat(m,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.`).concat(vc,` {
|
|
299
|
-
right: `).concat(m,"px ").concat(i,`;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.`).concat(xc,` {
|
|
303
|
-
margin-right: `).concat(m,"px ").concat(i,`;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.`).concat(vc," .").concat(vc,` {
|
|
307
|
-
right: 0 `).concat(i,`;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
.`).concat(xc," .").concat(xc,` {
|
|
311
|
-
margin-right: 0 `).concat(i,`;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
body[`).concat(hs,`] {
|
|
315
|
-
`).concat(RN,": ").concat(m,`px;
|
|
316
|
-
}
|
|
317
|
-
`)},ry=function(){var a=parseInt(document.body.getAttribute(hs)||"0",10);return isFinite(a)?a:0},YN=function(){p.useEffect(function(){return document.body.setAttribute(hs,(ry()+1).toString()),function(){var a=ry()-1;a<=0?document.body.removeAttribute(hs):document.body.setAttribute(hs,a.toString())}},[])},$N=function(a){var l=a.noRelative,o=a.noImportant,i=a.gapMode,c=i===void 0?"margin":i;YN();var d=p.useMemo(function(){return VN(c)},[c]);return p.createElement(IN,{styles:GN(d,!l,c,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,KN=function(a){return a.tagName==="TEXTAREA"},y0=function(a,l){if(!(a instanceof Element))return!1;var o=window.getComputedStyle(a);return o[l]!=="hidden"&&!(o.overflowY===o.overflowX&&!KN(a)&&o[l]==="visible")},XN=function(a){return y0(a,"overflowY")},FN=function(a){return y0(a,"overflowX")},sy=function(a,l){var o=l.ownerDocument,i=l;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var c=b0(a,i);if(c){var d=S0(a,i),h=d[1],m=d[2];if(h>m)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},QN=function(a){var l=a.scrollTop,o=a.scrollHeight,i=a.clientHeight;return[l,o,i]},ZN=function(a){var l=a.scrollLeft,o=a.scrollWidth,i=a.clientWidth;return[l,o,i]},b0=function(a,l){return a==="v"?XN(l):FN(l)},S0=function(a,l){return a==="v"?QN(l):ZN(l)},JN=function(a,l){return a==="h"&&l==="rtl"?-1:1},WN=function(a,l,o,i,c){var d=JN(a,window.getComputedStyle(l).direction),h=d*i,m=o.target,g=l.contains(m),v=!1,b=h>0,S=0,x=0;do{if(!m)break;var w=S0(a,m),E=w[0],j=w[1],C=w[2],T=j-C-d*E;(E||T)&&b0(a,m)&&(S+=T,x+=E);var N=m.parentNode;m=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!g&&m!==document.body||g&&(l.contains(m)||l===m));return(b&&Math.abs(S)<1||!b&&Math.abs(x)<1)&&(v=!0),v},oc=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},oy=function(a){return[a.deltaX,a.deltaY]},iy=function(a){return a&&"current"in a?a.current:a},eT=function(a,l){return a[0]===l[0]&&a[1]===l[1]},tT=function(a){return`
|
|
318
|
-
.block-interactivity-`.concat(a,` {pointer-events: none;}
|
|
319
|
-
.allow-interactivity-`).concat(a,` {pointer-events: all;}
|
|
320
|
-
`)},nT=0,cs=[];function aT(a){var l=p.useRef([]),o=p.useRef([0,0]),i=p.useRef(),c=p.useState(nT++)[0],d=p.useState(x0)[0],h=p.useRef(a);p.useEffect(function(){h.current=a},[a]),p.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(c));var j=CN([a.lockRef.current],(a.shards||[]).map(iy),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[a.inert,a.lockRef.current,a.shards]);var m=p.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!h.current.allowPinchZoom;var T=oc(j),N=o.current,M="deltaX"in j?j.deltaX:N[0]-T[0],A="deltaY"in j?j.deltaY:N[1]-T[1],_,z=j.target,q=Math.abs(M)>Math.abs(A)?"h":"v";if("touches"in j&&q==="h"&&z.type==="range")return!1;var k=window.getSelection(),W=k&&k.anchorNode,re=W?W===z||W.contains(z):!1;if(re)return!1;var K=sy(q,z);if(!K)return!0;if(K?_=q:(_=q==="v"?"h":"v",K=sy(q,z)),!K)return!1;if(!i.current&&"changedTouches"in j&&(M||A)&&(i.current=_),!_)return!0;var V=i.current||_;return WN(V,C,j,V==="h"?M:A)},[]),g=p.useCallback(function(j){var C=j;if(!(!cs.length||cs[cs.length-1]!==d)){var T="deltaY"in C?oy(C):oc(C),N=l.current.filter(function(_){return _.name===C.type&&(_.target===C.target||C.target===_.shadowParent)&&eT(_.delta,T)})[0];if(N&&N.should){C.cancelable&&C.preventDefault();return}if(!N){var M=(h.current.shards||[]).map(iy).filter(Boolean).filter(function(_){return _.contains(C.target)}),A=M.length>0?m(C,M[0]):!h.current.noIsolation;A&&C.cancelable&&C.preventDefault()}}},[]),v=p.useCallback(function(j,C,T,N){var M={name:j,delta:C,target:T,should:N,shadowParent:lT(T)};l.current.push(M),setTimeout(function(){l.current=l.current.filter(function(A){return A!==M})},1)},[]),b=p.useCallback(function(j){o.current=oc(j),i.current=void 0},[]),S=p.useCallback(function(j){v(j.type,oy(j),j.target,m(j,a.lockRef.current))},[]),x=p.useCallback(function(j){v(j.type,oc(j),j.target,m(j,a.lockRef.current))},[]);p.useEffect(function(){return cs.push(d),a.setCallbacks({onScrollCapture:S,onWheelCapture:S,onTouchMoveCapture:x}),document.addEventListener("wheel",g,is),document.addEventListener("touchmove",g,is),document.addEventListener("touchstart",b,is),function(){cs=cs.filter(function(j){return j!==d}),document.removeEventListener("wheel",g,is),document.removeEventListener("touchmove",g,is),document.removeEventListener("touchstart",b,is)}},[]);var w=a.removeScrollBar,E=a.inert;return p.createElement(p.Fragment,null,E?p.createElement(d,{styles:tT(c)}):null,w?p.createElement($N,{noRelative:a.noRelative,gapMode:a.gapMode}):null)}function lT(a){for(var l=null;a!==null;)a instanceof ShadowRoot&&(l=a.host,a=a.host),a=a.parentNode;return l}const rT=ON(v0,aT);var $c=p.forwardRef(function(a,l){return p.createElement(Yc,ma({},a,{ref:l,sideCar:rT}))});$c.classNames=Yc.classNames;var sT=Object.defineProperty,it=(a,l)=>sT(a,"name",{value:l,configurable:!0}),oT=["Enter"," "],iT=["ArrowDown","PageUp","Home"],w0=["ArrowUp","PageDown","End"],cT=[...iT,...w0],Kc="Menu",[rh,uT,dT]=kc(Kc),[gr,j0]=dn(Kc,[dT,Cs,Gc]),Kh=Cs(),C0=Gc(),[fT,Uo]=gr(Kc),[hT,Xh]=gr(Kc),mT=it(a=>{const{__scopeMenu:l,open:o=!1,children:i,dir:c,onOpenChange:d,modal:h=!0}=a,m=Kh(l),[g,v]=p.useState(null),b=p.useRef(!1),S=$n(d),x=zo(c);return p.useEffect(()=>{const w=it(()=>{b.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},"handleKeyDown"),E=it(()=>b.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),p.useEffect(()=>{if(!o)return;const w=it(()=>S(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[o,S]),s.jsx(Jb,{...m,children:s.jsx(fT,{scope:l,open:o,onOpenChange:S,content:g,onContentChange:v,children:s.jsx(hT,{scope:l,onClose:p.useCallback(()=>S(!1),[S]),isUsingKeyboardRef:b,dir:x,modal:h,children:i})})})},"Menu"),pT=p.forwardRef(it(function(l,o){const{__scopeMenu:i,...c}=l,d=Kh(i);return s.jsx(Wb,{...d,...c,ref:o})},"MenuAnchor")),E0="MenuPortal",[gT,vT]=gr(E0,{forceMount:void 0}),xT=it(a=>{const{__scopeMenu:l,forceMount:o,children:i,container:c}=a,d=Uo(E0,l);return s.jsx(gT,{scope:l,forceMount:o,children:s.jsx(nl,{present:o||d.open,children:s.jsx(Ih,{asChild:!0,container:c,children:i})})})},"MenuPortal"),zl="MenuContent",[yT,R0]=gr(zl),bT=p.forwardRef(it(function(l,o){const i=vT(zl,l.__scopeMenu),{forceMount:c=i.forceMount,...d}=l,h=Uo(zl,l.__scopeMenu),m=Xh(zl,l.__scopeMenu);return s.jsx(rh.Provider,{scope:l.__scopeMenu,children:s.jsx(nl,{present:c||h.open,children:s.jsx(rh.Slot,{scope:l.__scopeMenu,children:m.modal?s.jsx(ST,{...d,ref:o}):s.jsx(wT,{...d,ref:o})})})})},"MenuContent")),ST=p.forwardRef(it(function(l,o){const i=Uo(zl,l.__scopeMenu),c=p.useRef(null),d=Ve(o,c);return p.useEffect(()=>{const h=c.current;if(h)return $h(h)},[]),s.jsx(N0,{...l,ref:d,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:we(l.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),wT=p.forwardRef(it(function(l,o){const i=Uo(zl,l.__scopeMenu);return s.jsx(N0,{...l,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),jT=va("MenuContent.ScrollLock"),N0=p.forwardRef(it(function(l,o){const{__scopeMenu:i,loop:c=!1,trapFocus:d,onOpenAutoFocus:h,onCloseAutoFocus:m,disableOutsidePointerEvents:g,onEntryFocus:v,onEscapeKeyDown:b,onPointerDownOutside:S,onFocusOutside:x,onInteractOutside:w,onDismiss:E,disableOutsideScroll:j,...C}=l,T=Uo(zl,i),N=Xh(zl,i),M=Kh(i),A=C0(i),_=uT(i),[z,q]=p.useState(null),k=p.useRef(null),W=Ve(o,k,T.onContentChange),re=p.useRef(0),K=p.useRef(""),V=p.useRef(0),le=p.useRef(null),se=p.useRef("right"),ce=p.useRef(0),U=j?$c:p.Fragment,$=j?{as:jT,allowPinchZoom:!0}:void 0,ne=it(F=>{var ie,me;const D=K.current+F,P=_().filter(Re=>!Re.disabled),Q=document.activeElement,ae=(ie=P.find(Re=>Re.ref.current===Q))==null?void 0:ie.textValue,de=P.map(Re=>Re.textValue),Z=D0(de,D,ae),oe=(me=P.find(Re=>Re.textValue===Z))==null?void 0:me.ref.current;it((function Re(Ae){K.current=Ae,window.clearTimeout(re.current),Ae!==""&&(re.current=window.setTimeout(()=>Re(""),1e3))}),"updateSearch")(D),oe&&setTimeout(()=>oe.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(re.current),[]),Lo();const H=p.useCallback(F=>{var P,Q;return se.current===((P=le.current)==null?void 0:P.side)&&k0(F,(Q=le.current)==null?void 0:Q.area)},[]);return s.jsx(yT,{scope:i,searchRef:K,onItemEnter:p.useCallback(F=>{H(F)&&F.preventDefault()},[H]),onItemLeave:p.useCallback(F=>{var D;H(F)||((D=k.current)==null||D.focus(),q(null))},[H]),onTriggerLeave:p.useCallback(F=>{H(F)&&F.preventDefault()},[H]),pointerGraceTimerRef:V,onPointerGraceIntentChange:p.useCallback(F=>{le.current=F},[]),children:s.jsx(U,{...$,children:s.jsx(kh,{asChild:!0,trapped:d,onMountAutoFocus:we(h,F=>{var D;F.preventDefault(),(D=k.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:m,children:s.jsx(zc,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:b,onPointerDownOutside:S,onFocusOutside:x,onInteractOutside:w,onDismiss:E,children:s.jsx(f0,{asChild:!0,...A,dir:N.dir,orientation:"vertical",loop:c,currentTabStopId:z,onCurrentTabStopIdChange:q,onEntryFocus:we(v,F=>{N.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Vh,{role:"menu","aria-orientation":"vertical","data-state":T0(T.open),"data-radix-menu-content":"",dir:N.dir,...M,...C,ref:W,style:{outline:"none",...C.style},onKeyDown:we(C.onKeyDown,F=>{const P=F.target.closest("[data-radix-menu-content]")===F.currentTarget,Q=F.ctrlKey||F.altKey||F.metaKey,ae=F.key.length===1;P&&(F.key==="Tab"&&F.preventDefault(),!Q&&ae&&ne(F.key));const de=k.current;if(F.target!==de||!cT.includes(F.key))return;F.preventDefault();const oe=_().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);w0.includes(F.key)&&oe.reverse(),A0(oe)}),onBlur:we(l.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(re.current),K.current="")}),onPointerMove:we(l.onPointerMove,Ec(F=>{const D=F.target,P=ce.current!==F.clientX;if(F.currentTarget.contains(D)&&P){const Q=F.clientX>ce.current?"right":"left";se.current=Q,ce.current=F.clientX}}))})})})})})})},"MenuContentImpl")),CT=p.forwardRef(it(function(l,o){const{__scopeMenu:i,...c}=l;return s.jsx(Ue.div,{...c,ref:o})},"MenuLabel")),sh="MenuItem",cy="menu.itemSelect",ET=p.forwardRef(it(function(l,o){const{disabled:i=!1,onSelect:c,...d}=l,h=p.useRef(null),m=Xh(sh,l.__scopeMenu),g=R0(sh,l.__scopeMenu),v=Ve(o,h),b=p.useRef(!1),S=it(()=>{const x=h.current;if(!i&&x){const w=new CustomEvent(cy,{bubbles:!0,cancelable:!0});x.addEventListener(cy,E=>c==null?void 0:c(E),{once:!0}),Ah(x,w),w.defaultPrevented?b.current=!1:m.onClose()}},"handleSelect");return s.jsx(RT,{...d,ref:v,disabled:i,onClick:we(l.onClick,S),onPointerDown:x=>{var w;(w=l.onPointerDown)==null||w.call(l,x),b.current=!0},onPointerUp:we(l.onPointerUp,x=>{var w;b.current||(w=x.currentTarget)==null||w.click()}),onKeyDown:we(l.onKeyDown,x=>{i||x.target!==x.currentTarget||g.searchRef.current!==""&&x.key===" "||oT.includes(x.key)&&(x.currentTarget.click(),x.preventDefault())})})},"MenuItem")),RT=p.forwardRef(it(function(l,o){const{__scopeMenu:i,disabled:c=!1,textValue:d,...h}=l,m=R0(sh,i),g=C0(i),v=p.useRef(null),b=Ve(o,v),[S,x]=p.useState(!1),[w,E]=p.useState("");return p.useEffect(()=>{const j=v.current;j&&E((j.textContent??"").trim())},[h.children]),s.jsx(rh.ItemSlot,{scope:i,disabled:c,textValue:d??w,children:s.jsx(h0,{asChild:!0,...g,focusable:!c,children:s.jsx(Ue.div,{role:"menuitem","data-highlighted":S?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...h,ref:b,onPointerMove:we(l.onPointerMove,Ec(j=>{c?m.onItemLeave(j):(m.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:we(l.onPointerLeave,Ec(j=>m.onItemLeave(j))),onFocus:we(l.onFocus,()=>x(!0)),onBlur:we(l.onBlur,()=>x(!1))})})})},"MenuItemImpl")),NT="MenuRadioGroup",[kD,zD]=gr(NT,{value:void 0,onValueChange:it(()=>{},"onValueChange")}),TT="MenuItemIndicator",[LD,UD]=gr(TT,{checked:!1}),MT=p.forwardRef(it(function(l,o){const{__scopeMenu:i,...c}=l;return s.jsx(Ue.div,{role:"separator","aria-orientation":"horizontal",...c,ref:o})},"MenuSeparator")),AT="MenuSub",[HD,BD]=gr(AT);function T0(a){return a?"open":"closed"}it(T0,"getOpenState");function M0(a){return a==="indeterminate"}it(M0,"isIndeterminate");function _T(a){return M0(a)?"indeterminate":a?"checked":"unchecked"}it(_T,"getCheckedState");function A0(a){const l=document.activeElement;for(const o of a)if(o===l||(o.focus(),document.activeElement!==l))return}it(A0,"focusFirst");function _0(a,l){return a.map((o,i)=>a[(l+i)%a.length])}it(_0,"wrapArray");function D0(a,l,o){const c=l.length>1&&Array.from(l).every(v=>v===l[0])?l[0]:l,d=o?a.indexOf(o):-1;let h=_0(a,Math.max(d,0));c.length===1&&(h=h.filter(v=>v!==o));const g=h.find(v=>v.toLowerCase().startsWith(c.toLowerCase()));return g!==o?g:void 0}it(D0,"getNextMatch");function O0(a,l){const{x:o,y:i}=a;let c=!1;for(let d=0,h=l.length-1;d<l.length;h=d++){const m=l[d],g=l[h],v=m.x,b=m.y,S=g.x,x=g.y;b>i!=x>i&&o<(S-v)*(i-b)/(x-b)+v&&(c=!c)}return c}it(O0,"isPointInPolygon");function k0(a,l){if(!l)return!1;const o={x:a.clientX,y:a.clientY};return O0(o,l)}it(k0,"isPointerInGraceArea");function Ec(a){return l=>l.pointerType==="mouse"?a(l):void 0}it(Ec,"whenMouse");var DT=mT,OT=pT,kT=xT,zT=bT,LT=CT,UT=ET,HT=MT,BT=Object.defineProperty,vr=(a,l)=>BT(a,"name",{value:l,configurable:!0}),Fh="DropdownMenu",[PT,PD]=dn(Fh,[j0]),xr=j0(),[qT,z0]=PT(Fh),VT=vr(a=>{const{__scopeDropdownMenu:l,children:o,dir:i,open:c,defaultOpen:d,onOpenChange:h,modal:m=!0}=a,g=xr(l),v=p.useRef(null),[b,S]=Za({prop:c,defaultProp:d??!1,onChange:h,caller:Fh});return s.jsx(qT,{scope:l,triggerId:ga(),triggerRef:v,contentId:ga(),open:b,onOpenChange:S,onOpenToggle:p.useCallback(()=>S(x=>!x),[S]),modal:m,children:s.jsx(DT,{...g,open:b,onOpenChange:S,dir:i,modal:m,children:o})})},"DropdownMenu"),IT="DropdownMenuTrigger",GT=p.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,disabled:c=!1,...d}=l,h=z0(IT,i),m=xr(i),g=Ve(o,h.triggerRef);return s.jsx(OT,{asChild:!0,...m,children:s.jsx(Ue.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":c?"":void 0,disabled:c,...d,ref:g,onPointerDown:we(l.onPointerDown,v=>{!c&&v.button===0&&v.ctrlKey===!1&&(h.onOpenToggle(),h.open||v.preventDefault())}),onKeyDown:we(l.onKeyDown,v=>{c||(["Enter"," "].includes(v.key)&&h.onOpenToggle(),v.key==="ArrowDown"&&h.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),YT=vr(a=>{const{__scopeDropdownMenu:l,...o}=a,i=xr(l);return s.jsx(kT,{...i,...o})},"DropdownMenuPortal"),$T="DropdownMenuContent",KT=p.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...c}=l,d=z0($T,i),h=xr(i),m=p.useRef(!1);return s.jsx(zT,{id:d.contentId,"aria-labelledby":d.triggerId,...h,...c,ref:o,onCloseAutoFocus:we(l.onCloseAutoFocus,g=>{var v;m.current||(v=d.triggerRef.current)==null||v.focus(),m.current=!1,g.preventDefault()}),onInteractOutside:we(l.onInteractOutside,g=>{const v=g.detail.originalEvent,b=v.button===0&&v.ctrlKey===!0,S=v.button===2||b;(!d.modal||S)&&(m.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")),XT=p.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...c}=l,d=xr(i);return s.jsx(LT,{...d,...c,ref:o})},"DropdownMenuLabel")),FT=p.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...c}=l,d=xr(i);return s.jsx(UT,{...d,...c,ref:o})},"DropdownMenuItem")),QT=p.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...c}=l,d=xr(i);return s.jsx(HT,{...d,...c,ref:o})},"DropdownMenuSeparator")),ZT=VT,JT=GT,WT=YT,L0=KT,U0=XT,H0=FT,B0=QT;const eM=ZT,tM=JT,P0=p.forwardRef(({className:a,sideOffset:l=4,...o},i)=>s.jsx(WT,{children:s.jsx(L0,{ref:i,sideOffset:l,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",a),...o})}));P0.displayName=L0.displayName;const q0=p.forwardRef(({className:a,inset:l,...o},i)=>s.jsx(H0,{ref:i,className:je("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}));q0.displayName=H0.displayName;const nM=p.forwardRef(({className:a,...l},o)=>s.jsx(U0,{ref:o,className:je("px-2 py-1.5 text-sm font-semibold",a),...l}));nM.displayName=U0.displayName;const aM=p.forwardRef(({className:a,...l},o)=>s.jsx(B0,{ref:o,className:je("-mx-1 my-1 h-px bg-muted",a),...l}));aM.displayName=B0.displayName;function lM(){const{theme:a,setTheme:l}=hE(),{user:o,logout:i}=Rh(),[c,d]=p.useState(!1),[h,m]=p.useState(null),g=_o(),v=a==="light"?x2:a==="dark"?f2:d2;return p.useEffect(()=>{Se.get("/api/admin/update/check").then(b=>m(b)).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(e2,{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(eM,{open:c,onOpenChange:d,children:[s.jsx(tM,{asChild:!0,children:s.jsx(he,{variant:"ghost",children:(o==null?void 0:o.username)??"admin"})}),s.jsx(P0,{align:"end",children:s.jsxs(q0,{onClick:()=>void i(),children:[s.jsx(u2,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Ne=p.forwardRef(({className:a,type:l,...o},i)=>s.jsx("input",{type:l,className:je("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 rM=Object.defineProperty,sM=(a,l)=>rM(a,"name",{value:l,configurable:!0}),oM=p.forwardRef(sM(function(l,o){return s.jsx(Ue.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=oM;const ye=p.forwardRef(({className:a,...l},o)=>s.jsx(V0,{ref:o,className:je("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",a),...l}));ye.displayName=V0.displayName;const Ze=p.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:je("rounded-lg border bg-card text-card-foreground shadow-sm",a),...l}));Ze.displayName="Card";const Je=p.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:je("flex flex-col space-y-1.5 p-6",a),...l}));Je.displayName="CardHeader";const We=p.forwardRef(({className:a,...l},o)=>s.jsx("h3",{ref:o,className:je("text-lg font-semibold leading-none tracking-tight",a),...l}));We.displayName="CardTitle";const wn=p.forwardRef(({className:a,...l},o)=>s.jsx("p",{ref:o,className:je("text-sm text-muted-foreground",a),...l}));wn.displayName="CardDescription";const et=p.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:je("p-6 pt-0",a),...l}));et.displayName="CardContent";const I0=p.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:je("flex items-center p-6 pt-0",a),...l}));I0.displayName="CardFooter";var iM=a=>{switch(a){case"success":return dM;case"info":return hM;case"warning":return fM;case"error":return mM;default:return null}},cM=Array(12).fill(0),uM=({visible:a,className:l})=>ue.createElement("div",{className:["sonner-loading-wrapper",l].filter(Boolean).join(" "),"data-visible":a},ue.createElement("div",{className:"sonner-spinner"},cM.map((o,i)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),dM=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),fM=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),hM=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),mM=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),pM=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),gM=()=>{let[a,l]=ue.useState(document.hidden);return ue.useEffect(()=>{let o=()=>{l(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),a},oh=1,vM=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,c=typeof(a==null?void 0:a.id)=="number"||((l=a.id)==null?void 0:l.length)>0?a.id:oh++,d=this.toasts.find(m=>m.id===c),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),d?this.toasts=this.toasts.map(m=>m.id===c?(this.publish({...m,...a,id:c,title:o}),{...m,...a,id:c,dismissible:h,title:o}):m):this.addToast({title:o,...i,dismissible:h,id:c}),c},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(),c=o!==void 0,d,h=i.then(async g=>{if(d=["resolve",g],ue.isValidElement(g))c=!1,this.create({id:o,type:"default",message:g});else if(yM(g)&&!g.ok){c=!1;let v=typeof l.error=="function"?await l.error(`HTTP error! status: ${g.status}`):l.error,b=typeof l.description=="function"?await l.description(`HTTP error! status: ${g.status}`):l.description;this.create({id:o,type:"error",message:v,description:b})}else if(l.success!==void 0){c=!1;let v=typeof l.success=="function"?await l.success(g):l.success,b=typeof l.description=="function"?await l.description(g):l.description;this.create({id:o,type:"success",message:v,description:b})}}).catch(async g=>{if(d=["reject",g],l.error!==void 0){c=!1;let v=typeof l.error=="function"?await l.error(g):l.error,b=typeof l.description=="function"?await l.description(g):l.description;this.create({id:o,type:"error",message:v,description:b})}}).finally(()=>{var g;c&&(this.dismiss(o),o=void 0),(g=l.finally)==null||g.call(l)}),m=()=>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:m}:Object.assign(o,{unwrap:m})},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}},sn=new vM,xM=(a,l)=>{let o=(l==null?void 0:l.id)||oh++;return sn.addToast({title:a,...l,id:o}),o},yM=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",bM=xM,SM=()=>sn.toasts,wM=()=>sn.getActiveToasts(),xe=Object.assign(bM,{success:sn.success,info:sn.info,warning:sn.warning,error:sn.error,custom:sn.custom,message:sn.message,promise:sn.promise,dismiss:sn.dismiss,loading:sn.loading},{getHistory:SM,getToasts:wM});function jM(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))}jM(`: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%)}
|
|
321
|
-
`);function ic(a){return a.label!==void 0}var CM=3,EM="32px",RM="16px",uy=4e3,NM=356,TM=14,MM=20,AM=200;function na(...a){return a.filter(Boolean).join(" ")}function _M(a){let[l,o]=a.split("-"),i=[];return l&&i.push(l),o&&i.push(o),i}var DM=a=>{var l,o,i,c,d,h,m,g,v,b,S;let{invert:x,toast:w,unstyled:E,interacting:j,setHeights:C,visibleToasts:T,heights:N,index:M,toasts:A,expanded:_,removeToast:z,defaultRichColors:q,closeButton:k,style:W,cancelButtonStyle:re,actionButtonStyle:K,className:V="",descriptionClassName:le="",duration:se,position:ce,gap:U,loadingIcon:$,expandByDefault:ne,classNames:H,icons:F,closeButtonAriaLabel:D="Close toast",pauseWhenPageIsHidden:P}=a,[Q,ae]=ue.useState(null),[de,Z]=ue.useState(null),[oe,ie]=ue.useState(!1),[me,Re]=ue.useState(!1),[Ae,Me]=ue.useState(!1),[He,mt]=ue.useState(!1),[pt,bt]=ue.useState(!1),[St,Lt]=ue.useState(0),[fn,Qn]=ue.useState(0),hn=ue.useRef(w.duration||se||uy),ja=ue.useRef(null),Ca=ue.useRef(null),$t=M===0,Zc=M+1<=T,Kt=w.type,Ea=w.dismissible!==!1,br=w.className||"",Jc=w.descriptionClassName||"",ql=ue.useMemo(()=>N.findIndex(Ee=>Ee.toastId===w.id)||0,[N,w.id]),Wc=ue.useMemo(()=>{var Ee;return(Ee=w.closeButton)!=null?Ee:k},[w.closeButton,k]),Po=ue.useMemo(()=>w.duration||se||uy,[w.duration,se]),Ra=ue.useRef(0),wt=ue.useRef(0),Zn=ue.useRef(0),jt=ue.useRef(null),[eu,tu]=ce.split("-"),qo=ue.useMemo(()=>N.reduce((Ee,Ke,st)=>st>=ql?Ee:Ee+Ke.height,0),[N,ql]),Vl=gM(),Sr=w.invert||x,rl=Kt==="loading";wt.current=ue.useMemo(()=>ql*U+qo,[ql,qo]),ue.useEffect(()=>{hn.current=Po},[Po]),ue.useEffect(()=>{ie(!0)},[]),ue.useEffect(()=>{let Ee=Ca.current;if(Ee){let Ke=Ee.getBoundingClientRect().height;return Qn(Ke),C(st=>[{toastId:w.id,height:Ke,position:w.position},...st]),()=>C(st=>st.filter(Xt=>Xt.toastId!==w.id))}},[C,w.id]),ue.useLayoutEffect(()=>{if(!oe)return;let Ee=Ca.current,Ke=Ee.style.height;Ee.style.height="auto";let st=Ee.getBoundingClientRect().height;Ee.style.height=Ke,Qn(st),C(Xt=>Xt.find(Ut=>Ut.toastId===w.id)?Xt.map(Ut=>Ut.toastId===w.id?{...Ut,height:st}:Ut):[{toastId:w.id,height:st,position:w.position},...Xt])},[oe,w.title,w.description,C,w.id]);let It=ue.useCallback(()=>{Re(!0),Lt(wt.current),C(Ee=>Ee.filter(Ke=>Ke.toastId!==w.id)),setTimeout(()=>{z(w)},AM)},[w,z,C,wt]);ue.useEffect(()=>{if(w.promise&&Kt==="loading"||w.duration===1/0||w.type==="loading")return;let Ee;return _||j||P&&Vl?(()=>{if(Zn.current<Ra.current){let Ke=new Date().getTime()-Ra.current;hn.current=hn.current-Ke}Zn.current=new Date().getTime()})():hn.current!==1/0&&(Ra.current=new Date().getTime(),Ee=setTimeout(()=>{var Ke;(Ke=w.onAutoClose)==null||Ke.call(w,w),It()},hn.current)),()=>clearTimeout(Ee)},[_,j,w,Kt,P,Vl,It]),ue.useEffect(()=>{w.delete&&It()},[It,w.delete]);function wr(){var Ee,Ke,st;return F!=null&&F.loading?ue.createElement("div",{className:na(H==null?void 0:H.loader,(Ee=w==null?void 0:w.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":Kt==="loading"},F.loading):$?ue.createElement("div",{className:na(H==null?void 0:H.loader,(Ke=w==null?void 0:w.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":Kt==="loading"},$):ue.createElement(uM,{className:na(H==null?void 0:H.loader,(st=w==null?void 0:w.classNames)==null?void 0:st.loader),visible:Kt==="loading"})}return ue.createElement("li",{tabIndex:0,ref:Ca,className:na(V,br,H==null?void 0:H.toast,(l=w==null?void 0:w.classNames)==null?void 0:l.toast,H==null?void 0:H.default,H==null?void 0:H[Kt],(o=w==null?void 0:w.classNames)==null?void 0:o[Kt]),"data-sonner-toast":"","data-rich-colors":(i=w.richColors)!=null?i:q,"data-styled":!(w.jsx||w.unstyled||E),"data-mounted":oe,"data-promise":!!w.promise,"data-swiped":pt,"data-removed":me,"data-visible":Zc,"data-y-position":eu,"data-x-position":tu,"data-index":M,"data-front":$t,"data-swiping":Ae,"data-dismissible":Ea,"data-type":Kt,"data-invert":Sr,"data-swipe-out":He,"data-swipe-direction":de,"data-expanded":!!(_||ne&&oe),style:{"--index":M,"--toasts-before":M,"--z-index":A.length-M,"--offset":`${me?St:wt.current}px`,"--initial-height":ne?"auto":`${fn}px`,...W,...w.style},onDragEnd:()=>{Me(!1),ae(null),jt.current=null},onPointerDown:Ee=>{rl||!Ea||(ja.current=new Date,Lt(wt.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(Me(!0),jt.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,Ke,st,Xt;if(He||!Ea)return;jt.current=null;let Ut=Number(((Ee=Ca.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),oa=Number(((Ke=Ca.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ia=new Date().getTime()-((st=ja.current)==null?void 0:st.getTime()),Zt=Q==="x"?Ut:oa,Jn=Math.abs(Zt)/ia;if(Math.abs(Zt)>=MM||Jn>.11){Lt(wt.current),(Xt=w.onDismiss)==null||Xt.call(w,w),Z(Q==="x"?Ut>0?"right":"left":oa>0?"down":"up"),It(),mt(!0),bt(!1);return}Me(!1),ae(null)},onPointerMove:Ee=>{var Ke,st,Xt,Ut;if(!jt.current||!Ea||((Ke=window.getSelection())==null?void 0:Ke.toString().length)>0)return;let oa=Ee.clientY-jt.current.y,ia=Ee.clientX-jt.current.x,Zt=(st=a.swipeDirections)!=null?st:_M(ce);!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"?(Zt.includes("top")||Zt.includes("bottom"))&&(Zt.includes("top")&&oa<0||Zt.includes("bottom")&&oa>0)&&(Jn.y=oa):Q==="x"&&(Zt.includes("left")||Zt.includes("right"))&&(Zt.includes("left")&&ia<0||Zt.includes("right")&&ia>0)&&(Jn.x=ia),(Math.abs(Jn.x)>0||Math.abs(Jn.y)>0)&&bt(!0),(Xt=Ca.current)==null||Xt.style.setProperty("--swipe-amount-x",`${Jn.x}px`),(Ut=Ca.current)==null||Ut.style.setProperty("--swipe-amount-y",`${Jn.y}px`)}},Wc&&!w.jsx?ue.createElement("button",{"aria-label":D,"data-disabled":rl,"data-close-button":!0,onClick:rl||!Ea?()=>{}:()=>{var Ee;It(),(Ee=w.onDismiss)==null||Ee.call(w,w)},className:na(H==null?void 0:H.closeButton,(c=w==null?void 0:w.classNames)==null?void 0:c.closeButton)},(d=F==null?void 0:F.close)!=null?d:pM):null,w.jsx||p.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ue.createElement(ue.Fragment,null,Kt||w.icon||w.promise?ue.createElement("div",{"data-icon":"",className:na(H==null?void 0:H.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||(F==null?void 0:F[Kt])||iM(Kt):null):null,ue.createElement("div",{"data-content":"",className:na(H==null?void 0:H.content,(m=w==null?void 0:w.classNames)==null?void 0:m.content)},ue.createElement("div",{"data-title":"",className:na(H==null?void 0:H.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?ue.createElement("div",{"data-description":"",className:na(le,Jc,H==null?void 0:H.description,(v=w==null?void 0:w.classNames)==null?void 0:v.description)},typeof w.description=="function"?w.description():w.description):null),p.isValidElement(w.cancel)?w.cancel:w.cancel&&ic(w.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||re,onClick:Ee=>{var Ke,st;ic(w.cancel)&&Ea&&((st=(Ke=w.cancel).onClick)==null||st.call(Ke,Ee),It())},className:na(H==null?void 0:H.cancelButton,(b=w==null?void 0:w.classNames)==null?void 0:b.cancelButton)},w.cancel.label):null,p.isValidElement(w.action)?w.action:w.action&&ic(w.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||K,onClick:Ee=>{var Ke,st;ic(w.action)&&((st=(Ke=w.action).onClick)==null||st.call(Ke,Ee),!Ee.defaultPrevented&&It())},className:na(H==null?void 0:H.actionButton,(S=w==null?void 0:w.classNames)==null?void 0:S.actionButton)},w.action.label):null))};function dy(){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 OM(a,l){let o={};return[a,l].forEach((i,c)=>{let d=c===1,h=d?"--mobile-offset":"--offset",m=d?RM:EM;function g(v){["top","right","bottom","left"].forEach(b=>{o[`${h}-${b}`]=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}`]=m:o[`${h}-${v}`]=typeof i[v]=="number"?`${i[v]}px`:i[v]}):g(m)}),o}var kM=p.forwardRef(function(a,l){let{invert:o,position:i="bottom-right",hotkey:c=["altKey","KeyT"],expand:d,closeButton:h,className:m,offset:g,mobileOffset:v,theme:b="light",richColors:S,duration:x,style:w,visibleToasts:E=CM,toastOptions:j,dir:C=dy(),gap:T=TM,loadingIcon:N,icons:M,containerAriaLabel:A="Notifications",pauseWhenPageIsHidden:_}=a,[z,q]=ue.useState([]),k=ue.useMemo(()=>Array.from(new Set([i].concat(z.filter(P=>P.position).map(P=>P.position)))),[z,i]),[W,re]=ue.useState([]),[K,V]=ue.useState(!1),[le,se]=ue.useState(!1),[ce,U]=ue.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ue.useRef(null),ne=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=ue.useRef(null),F=ue.useRef(!1),D=ue.useCallback(P=>{q(Q=>{var ae;return(ae=Q.find(de=>de.id===P.id))!=null&&ae.delete||sn.dismiss(P.id),Q.filter(({id:de})=>de!==P.id)})},[]);return ue.useEffect(()=>sn.subscribe(P=>{if(P.dismiss){q(Q=>Q.map(ae=>ae.id===P.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{IC.flushSync(()=>{q(Q=>{let ae=Q.findIndex(de=>de.id===P.id);return ae!==-1?[...Q.slice(0,ae),{...Q[ae],...P},...Q.slice(ae+1)]:[P,...Q]})})})}),[]),ue.useEffect(()=>{if(b!=="system"){U(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let P=window.matchMedia("(prefers-color-scheme: dark)");try{P.addEventListener("change",({matches:Q})=>{U(Q?"dark":"light")})}catch{P.addListener(({matches:ae})=>{try{U(ae?"dark":"light")}catch(de){console.error(de)}})}},[b]),ue.useEffect(()=>{z.length<=1&&V(!1)},[z]),ue.useEffect(()=>{let P=Q=>{var ae,de;c.every(Z=>Q[Z]||Q.code===Z)&&(V(!0),(ae=$.current)==null||ae.focus()),Q.code==="Escape"&&(document.activeElement===$.current||(de=$.current)!=null&&de.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[c]),ue.useEffect(()=>{if($.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,F.current=!1)}},[$.current]),ue.createElement("section",{ref:l,"aria-label":`${A} ${ne}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((P,Q)=>{var ae;let[de,Z]=P.split("-");return z.length?ue.createElement("ol",{key:P,dir:C==="auto"?dy():C,tabIndex:-1,ref:$,className:m,"data-sonner-toaster":!0,"data-theme":ce,"data-y-position":de,"data-lifted":K&&z.length>1&&!d,"data-x-position":Z,style:{"--front-toast-height":`${((ae=W[0])==null?void 0:ae.height)||0}px`,"--width":`${NM}px`,"--gap":`${T}px`,...w,...OM(g,v)},onBlur:oe=>{F.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(F.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||F.current||(F.current=!0,H.current=oe.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{le||V(!1)},onDragEnd:()=>V(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||se(!0)},onPointerUp:()=>se(!1)},z.filter(oe=>!oe.position&&Q===0||oe.position===P).map((oe,ie)=>{var me,Re;return ue.createElement(DM,{key:oe.id,icons:M,index:ie,toast:oe,defaultRichColors:S,duration:(me=j==null?void 0:j.duration)!=null?me:x,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:o,visibleToasts:E,closeButton:(Re=j==null?void 0:j.closeButton)!=null?Re:h,interacting:le,position:P,style:j==null?void 0:j.style,unstyled:j==null?void 0:j.unstyled,classNames:j==null?void 0:j.classNames,cancelButtonStyle:j==null?void 0:j.cancelButtonStyle,actionButtonStyle:j==null?void 0:j.actionButtonStyle,removeToast:D,toasts:z.filter(Ae=>Ae.position==oe.position),heights:W.filter(Ae=>Ae.position==oe.position),setHeights:re,expandByDefault:d,gap:T,loadingIcon:N,expanded:K,pauseWhenPageIsHidden:_,swipeDirections:a.swipeDirections})})):null}))});function zM(){const{login:a}=Rh(),[l,o]=p.useState("admin"),[i,c]=p.useState(""),[d,h]=p.useState(""),[m,g]=p.useState(""),[v,b]=p.useState(!1),[S,x]=p.useState(!1),w=_o(),E=un();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(wn,{children:"Enter your admin credentials."})]}),s.jsxs(et,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(ye,{children:"Username"}),s.jsx(Ne,{value:l,onChange:j=>o(j.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(ye,{children:"Password"}),s.jsx(Ne,{type:"password",value:i,onChange:j=>c(j.target.value)})]}),v&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(ye,{children:"2FA code (or recovery code)"}),s.jsx(Ne,{value:d,onChange:j=>h(j.target.value),placeholder:"123456",maxLength:6})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(ye,{children:"Recovery code (alternative)"}),s.jsx(Ne,{value:m,onChange:j=>g(j.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),s.jsx("div",{className:"px-6 pb-6",children:s.jsx(he,{className:"w-full",disabled:S,onClick:async()=>{var j,C;x(!0);try{if((await a(l,i,d||void 0,m||void 0)).totpRequired){b(!0);return}const N=((C=(j=E.state)==null?void 0:j.from)==null?void 0:C.pathname)??"/";w(N,{replace:!0})}catch(T){xe.error(T.message)}finally{x(!1)}},children:"Sign in"})})]})})}function LM(){const[a,l]=p.useState("admin"),[o,i]=p.useState(""),[c,d]=p.useState(""),[h,m]=p.useState(!1),[g,v]=p.useState(!0);p.useEffect(()=>{Se.get("/api/admin/setup/status").then(x=>v(!x.masterKeyConfigured)).catch(()=>v(!0))},[]);const b=!g||c.trim().length>=32,S=!h&&o.length>=12&&b;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(wn,{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(ye,{children:"Username"}),s.jsx(Ne,{value:a,onChange:x=>l(x.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(ye,{children:"Password (12+ chars)"}),s.jsx(Ne,{type:"password",value:o,onChange:x=>i(x.target.value)})]}),g&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(ye,{children:"Master encryption key (required, 32+ chars)"}),s.jsx(Ne,{type:"password",value:c,onChange:x=>d(x.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.jsx(I0,{children:s.jsx(he,{disabled:!S,onClick:async()=>{m(!0);try{await Se.post("/api/admin/setup",{username:a,password:o,setupMasterKey:g?c.trim():void 0}),xe.success("Admin account created"),window.location.assign("/login")}catch(x){xe.error(x.message)}finally{m(!1)}},children:"Create admin"})})]})})}function wa({title:a,description:l,actions:o,className:i}){return s.jsxs("div",{className:je("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 UM=hb("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",success:"border-transparent bg-emerald-600 text-white",warning:"border-transparent bg-amber-500 text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Qe({className:a,variant:l,...o}){return s.jsx("div",{className:je(UM({variant:l}),a),...o})}function HM(){const[a,l]=p.useState(null);return p.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(Oo,{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(Qy,{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(Fy,{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:At(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?Oc(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:At(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:At(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(wn,{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(Zy,{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(Qe,{variant:"outline",className:"ml-2",children:o.type})]}),s.jsx(Qe,{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(wn,{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:Th(o.createdAt)})]},o.id)})]})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const Kn=p.forwardRef(({className:a,...l},o)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:o,className:je("w-full caption-bottom text-sm",a),...l})}));Kn.displayName="Table";const Xn=p.forwardRef(({className:a,...l},o)=>s.jsx("thead",{ref:o,className:je("[&_tr]:border-b",a),...l}));Xn.displayName="TableHeader";const Fn=p.forwardRef(({className:a,...l},o)=>s.jsx("tbody",{ref:o,className:je("[&_tr:last-child]:border-0",a),...l}));Fn.displayName="TableBody";const Ye=p.forwardRef(({className:a,...l},o)=>s.jsx("tr",{ref:o,className:je("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...l}));Ye.displayName="TableRow";const pe=p.forwardRef(({className:a,...l},o)=>s.jsx("th",{ref:o,className:je("h-10 px-2 text-left align-middle font-medium text-muted-foreground",a),...l}));pe.displayName="TableHead";const fe=p.forwardRef(({className:a,...l},o)=>s.jsx("td",{ref:o,className:je("p-2 align-middle",a),...l}));fe.displayName="TableCell";var BM=Object.defineProperty,Mn=(a,l)=>BM(a,"name",{value:l,configurable:!0}),Qh="Dialog",[G0,Y0]=dn(Qh),[PM,sa]=G0(Qh),$0=Mn(a=>{const{__scopeDialog:l,children:o,open:i,defaultOpen:c,onOpenChange:d,modal:h=!0}=a,m=p.useRef(null),g=p.useRef(null),[v,b]=Za({prop:i,defaultProp:c??!1,onChange:d,caller:Qh}),[S,x]=p.useState(0),[w,E]=p.useState(0);return s.jsx(PM,{scope:l,triggerRef:m,contentRef:g,contentId:ga(),titleId:ga(),descriptionId:ga(),titlePresent:S>0,descriptionPresent:w>0,setTitleCount:x,setDescriptionCount:E,open:v,onOpenChange:b,onOpenToggle:p.useCallback(()=>b(j=>!j),[b]),modal:h,children:o})},"Dialog"),qM="DialogTrigger",K0=p.forwardRef(Mn(function(l,o){const{__scopeDialog:i,...c}=l,d=sa(qM,i),h=Ve(o,d.triggerRef);return s.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":Xc(d.open),...c,ref:h,onClick:we(l.onClick,d.onOpenToggle)})},"DialogTrigger")),X0="DialogPortal",[VM,F0]=G0(X0,{forceMount:void 0}),Q0=Mn(a=>{const{__scopeDialog:l,forceMount:o,children:i,container:c}=a,d=sa(X0,l);return s.jsx(VM,{scope:l,forceMount:o,children:p.Children.map(i,h=>s.jsx(nl,{present:o||d.open,children:s.jsx(Ih,{asChild:!0,container:c,children:h})}))})},"DialogPortal"),ih="DialogOverlay",Zh=p.forwardRef(Mn(function(l,o){const i=F0(ih,l.__scopeDialog),{forceMount:c=i.forceMount,...d}=l,h=sa(ih,l.__scopeDialog);return h.modal?s.jsx(nl,{present:c||h.open,children:s.jsx(GM,{...d,ref:o})}):null},"DialogOverlay")),IM=va("DialogOverlay.RemoveScroll"),GM=p.forwardRef(Mn(function(l,o){const{__scopeDialog:i,...c}=l,d=sa(ih,i),h=Nb(),m=Ve(o,h);return s.jsx($c,{as:IM,allowPinchZoom:!0,shards:[d.contentRef],children:s.jsx(Ue.div,{"data-state":Xc(d.open),...c,ref:m,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),No="DialogContent",Jh=p.forwardRef(Mn(function(l,o){const i=F0(No,l.__scopeDialog),{forceMount:c=i.forceMount,...d}=l,h=sa(No,l.__scopeDialog);return s.jsx(nl,{present:c||h.open,children:h.modal?s.jsx(YM,{...d,ref:o}):s.jsx($M,{...d,ref:o})})},"DialogContent")),YM=p.forwardRef(Mn(function(l,o){const i=sa(No,l.__scopeDialog),c=p.useRef(null),d=Ve(o,i.contentRef,c);return p.useEffect(()=>{const h=c.current;if(h)return $h(h)},[]),s.jsx(Z0,{...l,ref:d,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:we(l.onCloseAutoFocus,h=>{var m;h.preventDefault(),(m=i.triggerRef.current)==null||m.focus()}),onPointerDownOutside:we(l.onPointerDownOutside,h=>{const m=h.detail.originalEvent,g=m.button===0&&m.ctrlKey===!0;(m.button===2||g)&&h.preventDefault()}),onFocusOutside:we(l.onFocusOutside,h=>h.preventDefault())})},"DialogContentModal")),$M=p.forwardRef(Mn(function(l,o){const i=sa(No,l.__scopeDialog),c=p.useRef(!1),d=p.useRef(!1);return s.jsx(Z0,{...l,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var m,g;(m=l.onCloseAutoFocus)==null||m.call(l,h),h.defaultPrevented||(c.current||(g=i.triggerRef.current)==null||g.focus(),h.preventDefault()),c.current=!1,d.current=!1},onInteractOutside:h=>{var v,b;(v=l.onInteractOutside)==null||v.call(l,h),h.defaultPrevented||(c.current=!0,h.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const m=h.target;((b=i.triggerRef.current)==null?void 0:b.contains(m))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&d.current&&h.preventDefault()}})},"DialogContentNonModal")),Z0=p.forwardRef(Mn(function(l,o){const{__scopeDialog:i,trapFocus:c,onOpenAutoFocus:d,onCloseAutoFocus:h,...m}=l,g=sa(No,i);return Lo(),s.jsx(s.Fragment,{children:s.jsx(kh,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:d,onUnmountAutoFocus:h,children:s.jsx(zc,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Xc(g.open),...m,ref:o,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),KM="DialogTitle",Wh=p.forwardRef(Mn(function(l,o){const{__scopeDialog:i,...c}=l,d=sa(KM,i),{setTitleCount:h}=d;return _t(()=>(h(m=>m+1),()=>h(m=>m-1)),[h]),s.jsx(Ue.h2,{id:d.titleId,...c,ref:o})},"DialogTitle")),XM="DialogDescription",em=p.forwardRef(Mn(function(l,o){const{__scopeDialog:i,...c}=l,d=sa(XM,i),{setDescriptionCount:h}=d;return _t(()=>(h(m=>m+1),()=>h(m=>m-1)),[h]),s.jsx(Ue.p,{id:d.descriptionId,...c,ref:o})},"DialogDescription")),FM="DialogClose",tm=p.forwardRef(Mn(function(l,o){const{__scopeDialog:i,...c}=l,d=sa(FM,i);return s.jsx(Ue.button,{type:"button",...c,ref:o,onClick:we(l.onClick,()=>d.onOpenChange(!1))})},"DialogClose"));function Xc(a){return a?"open":"closed"}Mn(Xc,"getState");const qn=$0,Ho=K0,QM=Q0,J0=p.forwardRef(({className:a,...l},o)=>s.jsx(Zh,{ref:o,className:je("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}));J0.displayName=Zh.displayName;const jn=p.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(QM,{children:[s.jsx(J0,{}),s.jsxs(Jh,{ref:i,className:je("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(tm,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[s.jsx(Dc,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jn.displayName=Jh.displayName;const Cn=({className:a,...l})=>s.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",a),...l});Cn.displayName="DialogHeader";const Vn=({className:a,...l})=>s.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...l});Vn.displayName="DialogFooter";const En=p.forwardRef(({className:a,...l},o)=>s.jsx(Wh,{ref:o,className:je("text-lg font-semibold leading-none tracking-tight",a),...l}));En.displayName=Wh.displayName;const ch=p.forwardRef(({className:a,...l},o)=>s.jsx(em,{ref:o,className:je("text-sm text-muted-foreground",a),...l}));ch.displayName=em.displayName;var ZM=Object.defineProperty,al=(a,l)=>ZM(a,"name",{value:l,configurable:!0}),JM="AlertDialog",[WM,qD]=dn(JM,[Y0]),ll=Y0(),eA=al(a=>{const{__scopeAlertDialog:l,...o}=a,i=ll(l);return s.jsx($0,{...i,...o,modal:!0})},"AlertDialog"),tA=p.forwardRef(al(function(l,o){const{__scopeAlertDialog:i,...c}=l,d=ll(i);return s.jsx(K0,{...d,...c,ref:o})},"AlertDialogTrigger")),nA=al(a=>{const{__scopeAlertDialog:l,...o}=a,i=ll(l);return s.jsx(Q0,{...i,...o})},"AlertDialogPortal"),aA=p.forwardRef(al(function(l,o){const{__scopeAlertDialog:i,...c}=l,d=ll(i);return s.jsx(Zh,{...d,...c,ref:o})},"AlertDialogOverlay")),lA="AlertDialogContent",[rA,sA]=WM(lA),oA=p.forwardRef(al(function(l,o){const{__scopeAlertDialog:i,children:c,...d}=l,h=ll(i),m=p.useRef(null),g=Ve(o,m),v=p.useRef(null);return s.jsx(rA,{scope:i,cancelRef:v,children:s.jsx(Jh,{role:"alertdialog",...h,...d,ref:g,onOpenAutoFocus:we(d.onOpenAutoFocus,b=>{var S;b.preventDefault(),(S=v.current)==null||S.focus({preventScroll:!0})}),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault(),children:c})})},"AlertDialogContent")),iA=p.forwardRef(al(function(l,o){const{__scopeAlertDialog:i,...c}=l,d=ll(i);return s.jsx(Wh,{...d,...c,ref:o})},"AlertDialogTitle")),cA=p.forwardRef(al(function(l,o){const{__scopeAlertDialog:i,...c}=l,d=ll(i);return s.jsx(em,{...d,...c,ref:o})},"AlertDialogDescription")),uA=p.forwardRef(al(function(l,o){const{__scopeAlertDialog:i,...c}=l,d=ll(i);return s.jsx(tm,{...d,...c,ref:o})},"AlertDialogAction")),dA="AlertDialogCancel",fA=p.forwardRef(al(function(l,o){const{__scopeAlertDialog:i,...c}=l,{cancelRef:d}=sA(dA,i),h=ll(i),m=Ve(o,d);return s.jsx(tm,{...h,...c,ref:m})},"AlertDialogCancel")),hA=eA,mA=tA,pA=nA,W0=aA,e1=oA,t1=uA,n1=fA,a1=iA,l1=cA;const r1=hA,gA=mA,vA=pA,s1=p.forwardRef(({className:a,...l},o)=>s.jsx(W0,{ref:o,className:je("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}));s1.displayName=W0.displayName;const nm=p.forwardRef(({className:a,...l},o)=>s.jsxs(vA,{children:[s.jsx(s1,{}),s.jsx(e1,{ref:o,className:je("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})]}));nm.displayName=e1.displayName;const o1=({className:a,...l})=>s.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",a),...l}),i1=({className:a,...l})=>s.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...l}),am=p.forwardRef(({className:a,...l},o)=>s.jsx(a1,{ref:o,className:je("text-lg font-semibold",a),...l}));am.displayName=a1.displayName;const lm=p.forwardRef(({className:a,...l},o)=>s.jsx(l1,{ref:o,className:je("text-sm text-muted-foreground",a),...l}));lm.displayName=l1.displayName;const rm=p.forwardRef(({className:a,...l},o)=>s.jsx(t1,{ref:o,className:je("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}));rm.displayName=t1.displayName;const sm=p.forwardRef(({className:a,...l},o)=>s.jsx(n1,{ref:o,className:je("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}));sm.displayName=n1.displayName;var xA=Object.defineProperty,yA=(a,l)=>xA(a,"name",{value:l,configurable:!0});function uh(a,[l,o]){return Math.min(o,Math.max(l,a))}yA(uh,"clamp");var bA=Object.defineProperty,SA=(a,l)=>bA(a,"name",{value:l,configurable:!0});function c1(a){const l=p.useRef({value:a,previous:a});return p.useMemo(()=>(l.current.value!==a&&(l.current.previous=l.current.value,l.current.value=a),l.current.previous),[a])}SA(c1,"usePrevious");var wA=Object.defineProperty,jA=(a,l)=>wA(a,"name",{value:l,configurable:!0}),u1=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"}),CA=p.forwardRef(jA(function(l,o){return s.jsx(Ue.span,{...l,ref:o,style:{...u1,...l.style}})},"VisuallyHidden")),EA=CA,RA=Object.defineProperty,rt=(a,l)=>RA(a,"name",{value:l,configurable:!0}),NA=[" ","Enter","ArrowUp","ArrowDown"],TA=[" ","Enter"],ms="Select",[Fc,om,MA]=kc(ms),[yr,VD]=dn(ms,[MA,Cs]),im=Cs(),[AA,Pl]=yr(ms),[_A,DA]=yr(ms);function d1(a){const{__scopeSelect:l,children:o,open:i,defaultOpen:c,onOpenChange:d,value:h,defaultValue:m,onValueChange:g,dir:v,name:b,autoComplete:S,disabled:x,required:w,form:E,internal_do_not_use_render:j}=a,C=im(l),[T,N]=p.useState(null),[M,A]=p.useState(null),[_,z]=p.useState(!1),q=zo(v),[k,W]=Za({prop:i,defaultProp:c??!1,onChange:d,caller:ms}),[re,K]=Za({prop:h,defaultProp:m,onChange:g,caller:ms}),V=p.useRef(null),le=p.useRef(re);p.useEffect(()=>{const P=E?T==null?void 0:T.ownerDocument.getElementById(E):T==null?void 0:T.form;if(P instanceof HTMLFormElement){const Q=rt(()=>K(le.current),"reset");return P.addEventListener("reset",Q),()=>P.removeEventListener("reset",Q)}},[E,T,K]);const se=T?!!E||!!T.closest("form"):!0,[ce,U]=p.useState(new Set),$=ga(),ne=Array.from(ce).map(P=>P.props.value).join(";"),H=p.useCallback(P=>{U(Q=>new Set(Q).add(P))},[]),F=p.useCallback(P=>{U(Q=>{const ae=new Set(Q);return ae.delete(P),ae})},[]),D={required:w,trigger:T,onTriggerChange:N,valueNode:M,onValueNodeChange:A,valueNodeHasChildren:_,onValueNodeHasChildrenChange:z,contentId:$,value:re,onValueChange:K,open:k,onOpenChange:W,dir:q,triggerPointerDownPosRef:V,disabled:x,name:b,autoComplete:S,form:E,nativeOptions:ce,nativeSelectKey:ne,isFormControl:se};return s.jsx(Jb,{...C,children:s.jsx(AA,{scope:l,...D,children:s.jsx(Fc.Provider,{scope:l,children:s.jsx(_A,{scope:l,onNativeOptionAdd:H,onNativeOptionRemove:F,children:v1(j)?j(D):o})})})})}rt(d1,"SelectProvider");var OA=rt(a=>{const{__scopeSelect:l,children:o,...i}=a;return s.jsx(d1,{__scopeSelect:l,...i,internal_do_not_use_render:({isFormControl:c})=>s.jsxs(s.Fragment,{children:[o,c?s.jsx(t_,{__scopeSelect:l}):null]})})},"Select"),kA="SelectTrigger",f1=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,disabled:c=!1,...d}=l,h=im(i),m=Pl(kA,i),g=m.disabled||c,v=Ve(o,m.onTriggerChange),b=om(i),S=p.useRef("touch"),[x,w,E]=cm(C=>{const T=b().filter(A=>!A.disabled),N=T.find(A=>A.value===m.value),M=um(T,C,N);M!==void 0&&m.onValueChange(M.value)}),j=rt(C=>{g||(m.onOpenChange(!0),E()),C&&(m.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return s.jsx(Wb,{asChild:!0,...h,children:s.jsx(Ue.button,{type:"button",role:"combobox","aria-controls":m.open?m.contentId:void 0,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":Bo(m.value)?"":void 0,...d,ref:v,onClick:we(d.onClick,C=>{C.currentTarget.focus(),S.current!=="mouse"&&j(C)}),onPointerDown:we(d.onPointerDown,C=>{S.current=C.pointerType;const T=C.target;T.hasPointerCapture(C.pointerId)&&T.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(j(C),C.preventDefault())}),onKeyDown:we(d.onKeyDown,C=>{const T=x.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&w(C.key),!(T&&C.key===" ")&&NA.includes(C.key)&&(j(),C.preventDefault())})})})},"SelectTrigger")),zA="SelectValue",LA=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,className:c,style:d,children:h,placeholder:m="",...g}=l,v=Pl(zA,i),{onValueNodeHasChildrenChange:b}=v,S=h!==void 0,x=Ve(o,v.onValueNodeChange);_t(()=>{b(S)},[b,S]);const w=Bo(v.value);return s.jsx(Ue.span,{...g,asChild:w?!1:g.asChild,ref:x,style:{pointerEvents:"none"},children:s.jsx(p.Fragment,{children:w?m:h},w?"placeholder":"value")})},"SelectValue")),UA=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,children:c,...d}=l;return s.jsx(Ue.span,{"aria-hidden":!0,...d,ref:o,children:c||"▼"})},"SelectIcon")),HA="SelectPortal",[BA,PA]=yr(HA,{forceMount:void 0}),qA=rt(a=>{const{__scopeSelect:l,forceMount:o,...i}=a;return s.jsx(BA,{scope:a.__scopeSelect,forceMount:o,children:s.jsx(Ih,{asChild:!0,...i})})},"SelectPortal"),mr="SelectContent",h1=p.forwardRef(rt(function(l,o){const i=PA(mr,l.__scopeSelect),{forceMount:c=i.forceMount,...d}=l,h=Pl(mr,l.__scopeSelect),[m,g]=p.useState();return _t(()=>{g(new DocumentFragment)},[]),s.jsx(nl,{present:c||h.open,children:({present:v})=>v?s.jsx(GA,{...d,ref:o}):s.jsx(VA,{...d,fragment:m})})},"SelectContent")),VA=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,children:c,fragment:d}=l;return d?ys.createPortal(s.jsx(m1,{scope:i,children:s.jsx(Fc.Slot,{scope:i,children:s.jsx("div",{ref:o,children:c})})}),d):null},"SelectContentFragment")),aa=10,[m1,Qc]=yr(mr),IA=va("SelectContent.RemoveScroll"),GA=p.forwardRef(rt(function(l,o){const{__scopeSelect:i}=l,{position:c="item-aligned",onCloseAutoFocus:d,onEscapeKeyDown:h,onPointerDownOutside:m,side:g,sideOffset:v,align:b,alignOffset:S,arrowPadding:x,collisionBoundary:w,collisionPadding:E,sticky:j,hideWhenDetached:C,avoidCollisions:T,...N}=l,M=Pl(mr,i),[A,_]=p.useState(null),[z,q]=p.useState(null),k=Ve(o,_),[W,re]=p.useState(null),[K,V]=p.useState(null),le=om(i),[se,ce]=p.useState(!1),U=p.useRef(!1);p.useEffect(()=>{if(A)return $h(A)},[A]),Lo();const $=p.useCallback(ie=>{const[me,...Re]=le().map(He=>He.ref.current),[Ae]=Re.slice(-1),Me=document.activeElement;for(const He of ie)if(He===Me||(He==null||He.scrollIntoView({block:"nearest"}),He===me&&z&&(z.scrollTop=0),He===Ae&&z&&(z.scrollTop=z.scrollHeight),He==null||He.focus(),document.activeElement!==Me))return},[le,z]),ne=p.useCallback(()=>$([W,A]),[$,W,A]);p.useEffect(()=>{se&&ne()},[se,ne]);const{onOpenChange:H,triggerPointerDownPosRef:F}=M;p.useEffect(()=>{if(A){let ie={x:0,y:0};const me=rt(Ae=>{var Me,He;ie={x:Math.abs(Math.round(Ae.pageX)-(((Me=F.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(Ae.pageY)-(((He=F.current)==null?void 0:He.y)??0))}},"handlePointerMove"),Re=rt(Ae=>{ie.x<=10&&ie.y<=10?Ae.preventDefault():Ae.composedPath().includes(A)||H(!1),document.removeEventListener("pointermove",me),F.current=null},"handlePointerUp");return F.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",Re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",Re,{capture:!0})}}},[A,H,F]),p.useEffect(()=>{const ie=rt(()=>H(!1),"close");return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[H]);const[D,P]=cm(ie=>{const me=le().filter(Me=>!Me.disabled),Re=me.find(Me=>Me.ref.current===document.activeElement),Ae=um(me,ie,Re);Ae&&setTimeout(()=>{var Me;return(Me=Ae.ref.current)==null?void 0:Me.focus()})}),Q=p.useCallback((ie,me,Re)=>{const Ae=!U.current&&!Re;(M.value!==void 0&&M.value===me||Ae)&&(re(ie),Ae&&(U.current=!0))},[M.value]),ae=p.useCallback(()=>A==null?void 0:A.focus(),[A]),de=p.useCallback((ie,me,Re)=>{const Ae=!U.current&&!Re;(M.value!==void 0&&M.value===me||Ae)&&V(ie)},[M.value]),Z=c==="popper"?fy:YA,oe=Z===fy?{side:g,sideOffset:v,align:b,alignOffset:S,arrowPadding:x,collisionBoundary:w,collisionPadding:E,sticky:j,hideWhenDetached:C,avoidCollisions:T}:{};return s.jsx(m1,{scope:i,content:A,viewport:z,onViewportChange:q,itemRefCallback:Q,selectedItem:W,onItemLeave:ae,itemTextRefCallback:de,focusSelectedItem:ne,selectedItemText:K,position:c,isPositioned:se,searchRef:D,children:s.jsx($c,{as:IA,allowPinchZoom:!0,children:s.jsx(kh,{asChild:!0,trapped:M.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:we(d,ie=>{var me;(me=M.trigger)==null||me.focus({preventScroll:!0}),ie.preventDefault()}),children:s.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>M.onOpenChange(!1),children:s.jsx(Z,{role:"listbox",id:M.contentId,"data-state":M.open?"open":"closed",dir:M.dir,onContextMenu:ie=>ie.preventDefault(),...N,...oe,onPlaced:()=>ce(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:we(N.onKeyDown,ie=>{const me=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!me&&ie.key.length===1&&P(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let Ae=le().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Me=ie.target,He=Ae.indexOf(Me);Ae=Ae.slice(He+1)}setTimeout(()=>$(Ae)),ie.preventDefault()}})})})})})})},"SelectContentImpl")),YA=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,onPlaced:c,...d}=l,h=Pl(mr,i),m=Qc(mr,i),[g,v]=p.useState(null),[b,S]=p.useState(null),x=Ve(o,S),w=om(i),E=p.useRef(!1),j=p.useRef(!0),{viewport:C,selectedItem:T,selectedItemText:N,focusSelectedItem:M}=m,A=p.useCallback(()=>{if(h.trigger&&h.valueNode&&g&&b&&C&&T&&N){const k=h.trigger.getBoundingClientRect(),W=b.getBoundingClientRect(),re=h.valueNode.getBoundingClientRect(),K=N.getBoundingClientRect();if(h.dir!=="rtl"){const Me=K.left-W.left,He=re.left-Me,mt=k.left-He,pt=k.width+mt,bt=Math.max(pt,W.width),St=window.innerWidth-aa,Lt=uh(He,[aa,Math.max(aa,St-bt)]);g.style.minWidth=pt+"px",g.style.left=Lt+"px"}else{const Me=W.right-K.right,He=window.innerWidth-re.right-Me,mt=window.innerWidth-k.right-He,pt=k.width+mt,bt=Math.max(pt,W.width),St=window.innerWidth-aa,Lt=uh(He,[aa,Math.max(aa,St-bt)]);g.style.minWidth=pt+"px",g.style.right=Lt+"px"}const V=w(),le=window.innerHeight-aa*2,se=C.scrollHeight,ce=window.getComputedStyle(b),U=parseInt(ce.borderTopWidth,10),$=parseInt(ce.paddingTop,10),ne=parseInt(ce.borderBottomWidth,10),H=parseInt(ce.paddingBottom,10),F=U+$+se+H+ne,D=Math.min(T.offsetHeight*5,F),P=window.getComputedStyle(C),Q=parseInt(P.paddingTop,10),ae=parseInt(P.paddingBottom,10),de=k.top+k.height/2-aa,Z=le-de,oe=T.offsetHeight/2,ie=T.offsetTop+oe,me=U+$+ie,Re=F-me;if(me<=de){const Me=V.length>0&&T===V[V.length-1].ref.current;g.style.bottom="0px";const He=b.clientHeight-C.offsetTop-C.offsetHeight,mt=Math.max(Z,oe+(Me?ae:0)+He+ne),pt=me+mt;g.style.height=pt+"px"}else{const Me=V.length>0&&T===V[0].ref.current;g.style.top="0px";const mt=Math.max(de,U+C.offsetTop+(Me?Q:0)+oe)+Re;g.style.height=mt+"px",C.scrollTop=me-de+C.offsetTop}g.style.margin=`${aa}px 0`,g.style.minHeight=D+"px",g.style.maxHeight=le+"px",c==null||c(),requestAnimationFrame(()=>E.current=!0)}},[w,h.trigger,h.valueNode,g,b,C,T,N,h.dir,c]);_t(()=>A(),[A]);const[_,z]=p.useState();_t(()=>{b&&z(window.getComputedStyle(b).zIndex)},[b]);const q=p.useCallback(k=>{k&&j.current===!0&&(A(),M==null||M(),j.current=!1)},[A,M]);return s.jsx($A,{scope:i,contentWrapper:g,shouldExpandOnScrollRef:E,onScrollButtonChange:q,children:s.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:s.jsx(Ue.div,{...d,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...d.style}})})})},"SelectItemAlignedPosition")),fy=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,align:c="start",collisionPadding:d=aa,...h}=l,m=im(i);return s.jsx(Vh,{...m,...h,ref:o,align:c,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")),[$A,KA]=yr(mr,{}),hy="SelectViewport",XA=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,nonce:c,...d}=l,h=Qc(hy,i),m=KA(hy,i),g=Ve(o,h.onViewportChange),v=p.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:c}),s.jsx(Fc.Slot,{scope:i,children:s.jsx(Ue.div,{"data-radix-select-viewport":"",role:"presentation",...d,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...d.style},onScroll:we(d.onScroll,b=>{const S=b.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:w}=m;if(w!=null&&w.current&&x){const E=Math.abs(v.current-S.scrollTop);if(E>0){const j=window.innerHeight-aa*2,C=parseFloat(x.style.minHeight),T=parseFloat(x.style.height),N=Math.max(C,T);if(N<j){const M=N+E,A=Math.min(j,M),_=M-A;x.style.height=A+"px",x.style.bottom==="0px"&&(S.scrollTop=_>0?_:0,x.style.justifyContent="flex-end")}}}v.current=S.scrollTop})})})]})},"SelectViewport")),FA="SelectGroup",[ID,GD]=yr(FA),dh="SelectItem",[QA,p1]=yr(dh),g1=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,value:c,disabled:d=!1,textValue:h,...m}=l,g=Pl(dh,i),v=Qc(dh,i),b=g.value===c,[S,x]=p.useState(h??""),[w,E]=p.useState(!1),j=$n(A=>{var _;return(_=v.itemRefCallback)==null?void 0:_.call(v,A,c,d)}),C=Ve(o,j),T=ga(),N=p.useRef("touch"),M=rt(()=>{d||(g.onValueChange(c),g.onOpenChange(!1))},"handleSelect");return s.jsx(QA,{scope:i,value:c,disabled:d,textId:T,isSelected:b,onItemTextChange:p.useCallback(A=>{x(_=>_||((A==null?void 0:A.textContent)??"").trim())},[]),children:s.jsx(Fc.ItemSlot,{scope:i,value:c,disabled:d,textValue:S,children:s.jsx(Ue.div,{role:"option","aria-labelledby":T,"data-highlighted":w?"":void 0,"aria-selected":b&&w,"data-state":b?"checked":"unchecked","aria-disabled":d||void 0,"data-disabled":d?"":void 0,tabIndex:d?void 0:-1,...m,ref:C,onFocus:we(m.onFocus,()=>E(!0)),onBlur:we(m.onBlur,()=>E(!1)),onClick:we(m.onClick,()=>{N.current!=="mouse"&&M()}),onPointerUp:we(m.onPointerUp,()=>{N.current==="mouse"&&M()}),onPointerDown:we(m.onPointerDown,A=>{N.current=A.pointerType}),onPointerMove:we(m.onPointerMove,A=>{var _;N.current=A.pointerType,d?(_=v.onItemLeave)==null||_.call(v):N.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(m.onPointerLeave,A=>{var _;A.currentTarget===document.activeElement&&((_=v.onItemLeave)==null||_.call(v))}),onKeyDown:we(m.onKeyDown,A=>{var z;d||A.target!==A.currentTarget||((z=v.searchRef)==null?void 0:z.current)!==""&&A.key===" "||(TA.includes(A.key)&&M(),A.key===" "&&A.preventDefault())})})})})},"SelectItem")),cc="SelectItemText",ZA=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,className:c,style:d,...h}=l,m=Pl(cc,i),g=Qc(cc,i),v=p1(cc,i),b=DA(cc,i),[S,x]=p.useState(null),w=$n(M=>{var A;return(A=g.itemTextRefCallback)==null?void 0:A.call(g,M,v.value,v.disabled)}),E=Ve(o,x,v.onItemTextChange,w),j=S==null?void 0:S.textContent,C=p.useMemo(()=>s.jsx("option",{value:v.value,disabled:v.disabled,children:j},v.value),[v.disabled,v.value,j]),{onNativeOptionAdd:T,onNativeOptionRemove:N}=b;return _t(()=>(T(C),()=>N(C)),[T,N,C]),s.jsxs(s.Fragment,{children:[s.jsx(Ue.span,{id:v.textId,...h,ref:E}),v.isSelected&&m.valueNode&&!m.valueNodeHasChildren&&!Bo(m.value)?ys.createPortal(h.children,m.valueNode):null]})},"SelectItemText")),JA="SelectItemIndicator",WA=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,...c}=l;return p1(JA,i).isSelected?s.jsx(Ue.span,{"aria-hidden":!0,...c,ref:o}):null},"SelectItemIndicator")),e_="SelectBubbleInput",t_=p.forwardRef(rt(function({__scopeSelect:l,...o},i){const c=Pl(e_,l),{value:d,onValueChange:h,required:m,disabled:g,name:v,autoComplete:b,form:S}=c,{nativeOptions:x,nativeSelectKey:w}=c,E=p.useRef(null),j=Ve(i,E),C=d??"",T=c1(C),N=Array.from(x).some(M=>(M.props.value??"")==="");return p.useEffect(()=>{const M=E.current;if(!M)return;const A=window.HTMLSelectElement.prototype,z=Object.getOwnPropertyDescriptor(A,"value").set;if(T!==C&&z){const q=new Event("change",{bubbles:!0});z.call(M,C),M.dispatchEvent(q)}},[T,C]),s.jsxs(Ue.select,{"aria-hidden":!0,required:m,tabIndex:-1,name:v,autoComplete:b,disabled:g,form:S,onChange:M=>h(M.target.value),...o,style:{...u1,...o.style},ref:j,defaultValue:C,children:[Bo(d)&&!N?s.jsx("option",{value:""}):null,Array.from(x)]},w)},"SelectBubbleInput"));function v1(a){return typeof a=="function"}rt(v1,"isFunction");function Bo(a){return a===""||a===void 0}rt(Bo,"shouldShowPlaceholder");function cm(a){const l=$n(a),o=p.useRef(""),i=p.useRef(0),c=p.useCallback(h=>{const m=o.current+h;l(m),rt((function g(v){o.current=v,window.clearTimeout(i.current),v!==""&&(i.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(m)},[l]),d=p.useCallback(()=>{o.current="",window.clearTimeout(i.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(i.current),[]),[o,c,d]}rt(cm,"useTypeaheadSearch");function um(a,l,o){const c=l.length>1&&Array.from(l).every(v=>v===l[0])?l[0]:l,d=o?a.indexOf(o):-1;let h=x1(a,Math.max(d,0));c.length===1&&(h=h.filter(v=>v!==o));const g=h.find(v=>v.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==o?g:void 0}rt(um,"findNextItem");function x1(a,l){return a.map((o,i)=>a[(l+i)%a.length])}rt(x1,"wrapArray");const In=OA,Gn=LA,Rn=p.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(f1,{ref:i,className:je("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(UA,{asChild:!0,children:s.jsx(WC,{className:"h-4 w-4 opacity-50"})})]}));Rn.displayName=f1.displayName;const Nn=p.forwardRef(({className:a,children:l,position:o="popper",...i},c)=>s.jsx(qA,{children:s.jsx(h1,{ref:c,className:je("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(XA,{className:je("p-1",o==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:l})})}));Nn.displayName=h1.displayName;const lt=p.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(g1,{ref:i,className:je("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(WA,{children:s.jsx($y,{className:"h-4 w-4"})})}),s.jsx(ZA,{children:l})]}));lt.displayName=g1.displayName;var n_=Object.defineProperty,Hl=(a,l)=>n_(a,"name",{value:l,configurable:!0}),dm="Switch",[a_,YD]=dn(dm),[l_,fm]=a_(dm);function y1(a){const{__scopeSwitch:l,checked:o,children:i,defaultChecked:c,disabled:d,form:h,name:m,onCheckedChange:g,required:v,value:b="on",internal_do_not_use_render:S}=a,[x,w]=Za({prop:o,defaultProp:c??!1,onChange:g,caller:dm}),[E,j]=p.useState(null),[C,T]=p.useState(null),N=p.useRef(!1),[M,A]=p.useReducer(q=>q+1,0),_=E?!!h||!!E.closest("form"):!0,z={checked:x,setChecked:w,disabled:d,control:E,setControl:j,name:m,form:h,value:b,hasConsumerStoppedPropagationRef:N,userInteractionCount:M,onUserInteraction:A,required:v,defaultChecked:c,isFormControl:_,bubbleInput:C,setBubbleInput:T};return s.jsx(l_,{scope:l,...z,children:S1(S)?S(z):i})}Hl(y1,"SwitchProvider");var r_="SwitchTrigger",s_=p.forwardRef(Hl(function({__scopeSwitch:l,onClick:o,...i},c){const{control:d,form:h,value:m,disabled:g,checked:v,required:b,setControl:S,setChecked:x,hasConsumerStoppedPropagationRef:w,onUserInteraction:E,isFormControl:j,bubbleInput:C}=fm(r_,l),T=Ve(c,S),N=p.useRef(v);return p.useEffect(()=>{const M=h?d==null?void 0:d.ownerDocument.getElementById(h):d==null?void 0:d.form;if(M instanceof HTMLFormElement){const A=Hl(()=>x(N.current),"reset");return M.addEventListener("reset",A),()=>M.removeEventListener("reset",A)}},[d,h,x]),s.jsx(Ue.button,{type:"button",role:"switch","aria-checked":v,"aria-required":b,"data-state":hm(v),"data-disabled":g?"":void 0,disabled:g,value:m,...i,ref:T,onClick:we(o,M=>{E(),x(A=>!A),C&&j&&(w.current=M.isPropagationStopped(),w.current||M.stopPropagation())})})},"SwitchTrigger")),b1=p.forwardRef(Hl(function(l,o){const{__scopeSwitch:i,name:c,checked:d,defaultChecked:h,required:m,disabled:g,value:v,onCheckedChange:b,form:S,...x}=l;return s.jsx(y1,{__scopeSwitch:i,checked:d,defaultChecked:h,disabled:g,required:m,onCheckedChange:b,name:c,form:S,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(s_,{...x,ref:o,__scopeSwitch:i}),w&&s.jsx(u_,{__scopeSwitch:i})]})})},"Switch")),o_="SwitchThumb",i_=p.forwardRef(Hl(function(l,o){const{__scopeSwitch:i,...c}=l,d=fm(o_,i);return s.jsx(Ue.span,{"data-state":hm(d.checked),"data-disabled":d.disabled?"":void 0,...c,ref:o})},"SwitchThumb")),c_="SwitchBubbleInput",u_=p.forwardRef(Hl(function({__scopeSwitch:l,onClick:o,...i},c){const{control:d,hasConsumerStoppedPropagationRef:h,userInteractionCount:m,checked:g,defaultChecked:v,required:b,disabled:S,name:x,value:w,form:E,bubbleInput:j,setBubbleInput:C}=fm(c_,l),T=Ve(c,C),N=qc(d),M=p.useRef(!1),A=p.useRef(g),_=p.useRef(m);p.useEffect(()=>{const q=j;if(!q)return;const k=window.HTMLInputElement.prototype,re=Object.getOwnPropertyDescriptor(k,"checked").set,K=m!==_.current;_.current=m;const V=A.current!==g;A.current=g;const le=!(K&&h.current);if(V&&re){M.current=!K;const se=new Event("click",{bubbles:le});re.call(q,g),q.dispatchEvent(se),M.current=!1}},[j,g,h,m]);const z=p.useRef(g);return s.jsx(Ue.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??z.current,required:b,disabled:S,name:x,value:w,form:E,...i,tabIndex:-1,ref:T,onClick:we(o,q=>{M.current&&q.stopPropagation()}),style:{...i.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function S1(a){return typeof a=="function"}Hl(S1,"isFunction");function hm(a){return a?"checked":"unchecked"}Hl(hm,"getState");const ba=p.forwardRef(({className:a,...l},o)=>s.jsx(b1,{className:je("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(i_,{className:je("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=b1.displayName;const or={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0};function d_(){const[a,l]=p.useState([]),[o,i]=p.useState(!1),[c,d]=p.useState(or),[h,m]=p.useState(!1),[g,v]=p.useState(null),[b,S]=p.useState(null),[x,w]=p.useState(or),[E,j]=p.useState(null),[C,T]=p.useState(!1),N=()=>Se.get("/api/admin/providers").then(k=>l(k.providers));p.useEffect(()=>{N()},[]);const M=async()=>{m(!0);try{let k;if(c.customHeaders.trim())try{k=JSON.parse(c.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await Se.post("/api/admin/providers",{name:c.name,slug:c.slug||void 0,type:c.type,baseUrl:c.baseUrl,apiKey:c.apiKey,customHeaders:k,enabled:c.enabled}),xe.success("Provider created"),i(!1),d(or),N()}catch(k){xe.error(k.message)}finally{m(!1)}},A=async k=>{v(k);try{const W=await Se.post(`/api/admin/providers/${k}/test`);xe.success(W.ok?`Connection OK: ${W.detail}`:`Failed: ${W.detail}`),N()}catch(W){xe.error(W.message)}finally{v(null)}},_=k=>{S(k.id),w({...or,name:k.name,slug:k.slug||"",type:k.type,baseUrl:k.baseUrl,apiKey:"",customHeaders:"",enabled:k.enabled})},z=async()=>{if(b){m(!0);try{let k;if(x.customHeaders.trim())try{k=JSON.parse(x.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await Se.patch("/api/admin/providers",{id:b,name:x.name,slug:x.slug||void 0,type:x.type,baseUrl:x.baseUrl,apiKey:x.apiKey||void 0,customHeaders:k,enabled:x.enabled}),xe.success("Provider updated"),S(null),w(or),N()}catch(k){xe.error(k.message)}finally{m(!1)}}},q=async k=>{T(!0);try{await Se.del(`/api/admin/providers/${k}`),xe.success("Provider removed"),N()}catch(W){xe.error(W.message)}finally{T(!1),j(null)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:s.jsxs(qn,{open:o,onOpenChange:i,children:[s.jsx(Ho,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Oo,{className:"mr-1 h-4 w-4"})," Add provider"]})}),s.jsxs(jn,{children:[s.jsx(Cn,{children:s.jsx(En,{children:"New provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(ye,{children:"Name"}),s.jsx(Ne,{value:c.name,onChange:k=>d({...c,name:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Slug (optional)"}),s.jsx(Ne,{value:c.slug,onChange:k=>d({...c,slug:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Type"}),s.jsxs(In,{value:c.type,onValueChange:k=>d({...c,type:k}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(lt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Base URL"}),s.jsx(Ne,{value:c.baseUrl,onChange:k=>d({...c,baseUrl:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"API key"}),s.jsx(Ne,{type:"password",value:c.apiKey,onChange:k=>d({...c,apiKey:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Custom headers (JSON)"}),s.jsx(Ne,{value:c.customHeaders,onChange:k=>d({...c,customHeaders:k.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:c.enabled,onCheckedChange:k=>d({...c,enabled:k})}),s.jsx(ye,{children:"Enabled"})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>i(!1),children:"Cancel"}),s.jsx(he,{disabled:h||!c.name||!c.apiKey,onClick:M,children:"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All providers"}),s.jsxs(wn,{children:[a.length," total"]})]}),s.jsx(et,{children:s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{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(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(fe,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),a.map(k=>s.jsxs(Ye,{children:[s.jsxs(fe,{className:"font-medium",children:[k.name," ",s.jsx("span",{className:"text-xs text-muted-foreground",children:k.slug})]}),s.jsx(fe,{children:s.jsx(Qe,{variant:"outline",children:k.type})}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:k.baseUrl}),s.jsx(fe,{children:k.modelCount}),s.jsx(fe,{children:s.jsx(Qe,{variant:k.health==="healthy"?"success":k.health==="down"?"destructive":"secondary",children:k.health})}),s.jsx(fe,{children:k.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(he,{size:"sm",variant:"outline",disabled:g===k.id,onClick:()=>A(k.id),children:s.jsx(h2,{className:"h-3 w-3"})}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>_(k),children:"✎"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>j(k.id),children:s.jsx(_c,{className:"h-3 w-3"})})]})})]},k.id))]})]})})]}),s.jsx(qn,{open:!!b,onOpenChange:k=>{k||(S(null),w(or))},children:s.jsxs(jn,{children:[s.jsx(Cn,{children:s.jsx(En,{children:"Edit provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(ye,{children:"Name"}),s.jsx(Ne,{value:x.name,onChange:k=>w({...x,name:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Slug (optional)"}),s.jsx(Ne,{value:x.slug,onChange:k=>w({...x,slug:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Type"}),s.jsxs(In,{value:x.type,onValueChange:k=>w({...x,type:k}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(lt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Base URL"}),s.jsx(Ne,{value:x.baseUrl,onChange:k=>w({...x,baseUrl:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"API key (leave empty to keep current)"}),s.jsx(Ne,{type:"password",value:x.apiKey,onChange:k=>w({...x,apiKey:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Custom headers (JSON)"}),s.jsx(Ne,{value:x.customHeaders,onChange:k=>w({...x,customHeaders:k.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:x.enabled,onCheckedChange:k=>w({...x,enabled:k})}),s.jsx(ye,{children:"Enabled"})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>{S(null),w(or)},children:"Cancel"}),s.jsx(he,{disabled:h||!x.name,onClick:z,children:"Save changes"})]})]})}),s.jsx(r1,{open:!!E,onOpenChange:k=>{k||j(null)},children:s.jsxs(nm,{children:[s.jsxs(o1,{children:[s.jsx(am,{children:"Delete provider?"}),s.jsx(lm,{children:"This will soft-disable the provider if models depend on it."})]}),s.jsxs(i1,{children:[s.jsx(sm,{children:"Cancel"}),s.jsx(rm,{disabled:C,onClick:k=>{E&&(k.preventDefault(),q(E))},children:C?"Deleting…":"Delete"})]})]})})]})}var f_=Object.defineProperty,el=(a,l)=>f_(a,"name",{value:l,configurable:!0}),mm="Checkbox",[h_,$D]=dn(mm),[m_,pm]=h_(mm);function w1(a){const{__scopeCheckbox:l,checked:o,children:i,defaultChecked:c,disabled:d,form:h,name:m,onCheckedChange:g,required:v,value:b="on",internal_do_not_use_render:S}=a,[x,w]=Za({prop:o,defaultProp:c??!1,onChange:g,caller:mm}),[E,j]=p.useState(null),[C,T]=p.useState(null),N=p.useRef(!1),[M,A]=p.useReducer(q=>q+1,0),_=E?!!h||!!E.closest("form"):!0,z={checked:x,disabled:d,setChecked:w,control:E,setControl:j,name:m,form:h,value:b,hasConsumerStoppedPropagationRef:N,userInteractionCount:M,onUserInteraction:A,required:v,defaultChecked:Fa(c)?!1:c,isFormControl:_,bubbleInput:C,setBubbleInput:T};return s.jsx(m_,{scope:l,...z,children:C1(S)?S(z):i})}el(w1,"CheckboxProvider");var p_="CheckboxTrigger",g_=p.forwardRef(el(function({__scopeCheckbox:l,onKeyDown:o,onClick:i,...c},d){const{control:h,value:m,disabled:g,checked:v,required:b,setControl:S,setChecked:x,hasConsumerStoppedPropagationRef:w,onUserInteraction:E,isFormControl:j,bubbleInput:C}=pm(p_,l),T=Ve(d,S),N=p.useRef(v);return p.useEffect(()=>{const M=h==null?void 0:h.form;if(M){const A=el(()=>x(N.current),"reset");return M.addEventListener("reset",A),()=>M.removeEventListener("reset",A)}},[h,x]),s.jsx(Ue.button,{type:"button",role:"checkbox","aria-checked":Fa(v)?"mixed":v,"aria-required":b,"data-state":gm(v),"data-disabled":g?"":void 0,disabled:g,value:m,...c,ref:T,onKeyDown:we(o,M=>{M.key==="Enter"&&M.preventDefault()}),onClick:we(i,M=>{E(),x(A=>Fa(A)?!0:!A),C&&j&&(w.current=M.isPropagationStopped(),w.current||M.stopPropagation())})})},"CheckboxTrigger")),j1=p.forwardRef(el(function(l,o){const{__scopeCheckbox:i,name:c,checked:d,defaultChecked:h,required:m,disabled:g,value:v,onCheckedChange:b,form:S,...x}=l;return s.jsx(w1,{__scopeCheckbox:i,checked:d,defaultChecked:h,disabled:g,required:m,onCheckedChange:b,name:c,form:S,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(g_,{...x,ref:o,__scopeCheckbox:i}),w&&s.jsx(b_,{__scopeCheckbox:i})]})})},"Checkbox")),v_="CheckboxIndicator",x_=p.forwardRef(el(function(l,o){const{__scopeCheckbox:i,forceMount:c,...d}=l,h=pm(v_,i);return s.jsx(nl,{present:c||Fa(h.checked)||h.checked===!0,children:s.jsx(Ue.span,{"data-state":gm(h.checked),"data-disabled":h.disabled?"":void 0,...d,ref:o,style:{pointerEvents:"none",...l.style}})})},"CheckboxIndicator")),y_="CheckboxBubbleInput",b_=p.forwardRef(el(function({__scopeCheckbox:l,onClick:o,...i},c){const{control:d,hasConsumerStoppedPropagationRef:h,userInteractionCount:m,checked:g,defaultChecked:v,required:b,disabled:S,name:x,value:w,form:E,bubbleInput:j,setBubbleInput:C}=pm(y_,l),T=Ve(c,C),N=qc(d),M=p.useRef(!1),A=p.useRef(g),_=p.useRef(m);p.useEffect(()=>{const q=j;if(!q)return;const k=window.HTMLInputElement.prototype,re=Object.getOwnPropertyDescriptor(k,"checked").set,K=m!==_.current;_.current=m;const V=A.current!==g;A.current=g;const le=!(K&&h.current);if(V&&re){M.current=!K;const se=new Event("click",{bubbles:le});q.indeterminate=Fa(g),re.call(q,Fa(g)?!1:g),q.dispatchEvent(se),M.current=!1}},[j,g,h,m]);const z=p.useRef(Fa(g)?!1:g);return s.jsx(Ue.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??z.current,required:b,disabled:S,name:x,value:w,form:E,...i,tabIndex:-1,ref:T,onClick:we(o,q=>{M.current&&q.stopPropagation()}),style:{...i.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function C1(a){return typeof a=="function"}el(C1,"isFunction");function Fa(a){return a==="indeterminate"}el(Fa,"isIndeterminate");function gm(a){return Fa(a)?"indeterminate":a?"checked":"unchecked"}el(gm,"getState");const vm=p.forwardRef(({className:a,...l},o)=>s.jsx(j1,{ref:o,className:je("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(x_,{className:je("flex items-center justify-center text-current"),children:s.jsx($y,{className:"h-3.5 w-3.5"})})}));vm.displayName=j1.displayName;function S_(){const[a,l]=p.useState([]),[o,i]=p.useState([]),[c,d]=p.useState("all"),[h,m]=p.useState(!1),[g,v]=p.useState(""),[b,S]=p.useState([]),[x,w]=p.useState(new Set),[E,j]=p.useState(!1),[C,T]=p.useState(""),[N,M]=p.useState(""),[A,_]=p.useState(null),[z,q]=p.useState(!1),[k,W]=p.useState(null),[re,K]=p.useState(null),V=async()=>{const[H,F]=await Promise.all([Se.get("/api/admin/models"),Se.get("/api/admin/providers")]);l(H.models),i(F.providers)};p.useEffect(()=>{V()},[]);const le=a.filter(H=>!(c!=="all"&&H.providerId!==c||C&&!H.publicModelId.toLowerCase().includes(C.toLowerCase()))),se=b.filter(H=>{if(!N)return!0;const F=N.toLowerCase();return H.upstreamId.toLowerCase().includes(F)||H.displayName.toLowerCase().includes(F)}),ce=async()=>{if(g){j(!0);try{const H=await Se.post(`/api/admin/providers/${g}/discover`);S(H.models),w(new Set)}catch(H){xe.error(H.message)}finally{j(!1)}}},U=async()=>{if(x.size!==0)try{const H=await Se.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(x)});xe.success(`Imported ${H.imported} of ${H.requested}`),m(!1),S([]),w(new Set),V()}catch(H){xe.error(H.message)}},$=async()=>{if(re)try{await Se.del(`/api/admin/models/${re.id}`),xe.success("Model deleted"),K(null),V()}catch(H){xe.error(H.message)}},ne=async H=>{var D,P,Q;_(H),q(!0);const F=Date.now();W({phase:"streaming",startedAt:F,text:"",progress:{}});try{const ae=await globalThis.fetch(`/api/admin/models/${H}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},credentials:"include"});if(!ae.ok){const Re=await ae.text().catch(()=>"");W({phase:"error",model:H,error:`HTTP ${ae.status}: ${Re}`});return}const de=(D=ae.body)==null?void 0:D.getReader();if(!de){W({phase:"error",model:H,error:"No response body"});return}const Z=new TextDecoder;let oe="",ie="",me=!1;for(;!me;){const{value:Re,done:Ae}=await de.read();me=Ae,Re&&(oe+=Z.decode(Re,{stream:!0}));let Me;for(;(Me=oe.indexOf(`
|
|
322
|
-
|
|
323
|
-
`))>=0;){const He=oe.slice(0,Me);oe=oe.slice(Me+2);const mt=He.split(`
|
|
324
|
-
`);let pt="",bt="";for(const St of mt)St.startsWith("event: ")?pt=St.slice(7):St.startsWith("data: ")&&(bt=St.slice(6));if(bt){if(pt===""||pt==="message")try{const Lt=(P=JSON.parse(bt).choices)==null?void 0:P[0];(Q=Lt==null?void 0:Lt.delta)!=null&&Q.content&&(ie+=Lt.delta.content),W(fn=>{if(!fn||fn.phase!=="streaming")return fn;const Qn=Date.now()-F,hn=fn.progress.ttftMs??Qn;return{...fn,text:ie,progress:{ttftMs:hn,elapsedMs:Qn}}})}catch{}if(pt==="test_meta")try{const St=JSON.parse(bt);W({phase:"done",model:H,result:St,text:ie})}catch{}if(pt==="test_error")try{const St=JSON.parse(bt);W({phase:"error",model:H,error:St.message})}catch{}}}}W(Re=>!Re||Re.phase==="streaming"?{phase:"error",model:H,error:"Stream ended unexpectedly"}:Re)}catch(ae){W({phase:"error",model:H,error:ae.message})}finally{_(null)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Models",description:"Physical models imported from providers",actions:s.jsxs(qn,{open:h,onOpenChange:m,children:[s.jsx(Ho,{asChild:!0,children:s.jsxs(he,{variant:"outline",children:[s.jsx(Ky,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),s.jsxs(jn,{className:"max-w-2xl",children:[s.jsx(Cn,{children:s.jsx(En,{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(In,{value:g,onValueChange:v,children:[s.jsx(Rn,{children:s.jsx(Gn,{placeholder:"Choose provider"})}),s.jsx(Nn,{children:o.map(H=>s.jsx(lt,{value:H.id,children:H.name},H.id))})]})}),s.jsx(he,{onClick:ce,disabled:!g||E,children:E?"Fetching…":"Fetch"})]}),b.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(Jy,{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:N,onChange:H=>M(H.target.value)}),N&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>M(""),children:s.jsx(Dc,{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:[se.length," / ",b.length," · ",x.size," selected"]}),s.jsx(he,{variant:"outline",size:"sm",onClick:()=>w(new Set(se.filter(H=>!H.alreadyImported).map(H=>H.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:se.length===0&&b.length>0?s.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):se.map(H=>s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(vm,{checked:x.has(H.upstreamId),onCheckedChange:F=>{const D=new Set(x);F?D.add(H.upstreamId):D.delete(H.upstreamId),w(D)}}),s.jsx("span",{className:"font-mono text-xs",children:H.upstreamId}),H.alreadyImported&&s.jsx(Qe,{variant:"secondary",children:"imported"})]},H.upstreamId))})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),s.jsxs(he,{disabled:x.size===0,onClick:U,children:["Import ",x.size||""]})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All models"}),s.jsxs(wn,{children:[a.length," total"]})]}),s.jsxs(et,{children:[s.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[s.jsxs(In,{value:c,onValueChange:d,children:[s.jsx(Rn,{className:"w-56",children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"all",children:"All providers"}),o.map(H=>s.jsx(lt,{value:H.id,children:H.name},H.id))]})]}),s.jsx(Ne,{className:"max-w-xs",placeholder:"Search public ID",value:C,onChange:H=>T(H.target.value)})]}),s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{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(Fn,{children:[le.length===0&&s.jsx(Ye,{children:s.jsx(fe,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),le.map(H=>s.jsxs(Ye,{children:[s.jsx(fe,{className:"font-mono text-xs",children:H.publicModelId}),s.jsx(fe,{children:H.providerSlug}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:H.upstreamModelId}),s.jsx(fe,{className:"space-x-1",children:Object.entries(H.capabilities).filter(([,F])=>F===!0).slice(0,4).map(([F])=>s.jsx(Qe,{variant:"outline",className:"mr-1",children:F},F))}),s.jsx(fe,{children:H.upstreamAvailable?s.jsx(Qe,{variant:"success",children:"up"}):s.jsx(Qe,{variant:"destructive",children:"down"})}),s.jsx(fe,{children:H.enabled?"Yes":"No"}),s.jsx(fe,{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(H.id),disabled:A!==null,children:[A===H.id?s.jsx(jo,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(c2,{className:"h-3.5 w-3.5"})," Test"]}),s.jsxs(he,{size:"sm",variant:"destructive",onClick:()=>K(H),disabled:A!==null,children:[s.jsx(_c,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},H.id))]})]})]})]}),s.jsx(qn,{open:!!re,onOpenChange:H=>{H||K(null)},children:s.jsxs(jn,{className:"max-w-md",children:[s.jsx(Cn,{children:s.jsx(En,{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:re==null?void 0:re.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:()=>K(null),children:"Huỷ"}),s.jsx(he,{variant:"destructive",onClick:$,children:"Xoá"})]})]})}),s.jsx(qn,{open:z,onOpenChange:q,children:s.jsxs(jn,{className:"max-w-2xl",children:[s.jsx(Cn,{children:s.jsx(En,{children:"Kết quả test model"})}),k&&k.phase==="streaming"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(jo,{className:"h-4 w-4 animate-spin"})," Đang stream…",s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["TTFT ",k.progress.ttftMs!=null?`${k.progress.ttftMs} ms`:"…"]}),s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["· ",k.progress.elapsedMs!=null?`${k.progress.elapsedMs} ms`:"…"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi (streaming)"}),s.jsxs("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:[k.text||s.jsx("span",{className:"text-muted-foreground/60 animate-pulse",children:"waiting for first token…"}),k.phase==="streaming"&&s.jsx("span",{className:"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-primary/70"})]})]})]}),k&&k.phase==="done"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(Qe,{variant:k.result.success?"success":"destructive",children:k.result.success?"Thành công":"Thất bại"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Thời gian phản hồi"}),s.jsxs("div",{className:"font-mono",children:[k.result.latencyMs," ms"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"TTFT"}),s.jsx("div",{className:"font-mono",children:k.result.ttftMs!=null?`${k.result.ttftMs} ms`:"—"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tokens (in / out)"}),s.jsxs("div",{className:"font-mono",children:[k.result.usage.input," / ",k.result.usage.output]})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi của model"}),s.jsx("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:k.text||k.result.text||"(trống)"})]}),k.result.attempts.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Attempts"}),s.jsx("div",{className:"space-y-1",children:k.result.attempts.map((H,F)=>s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[s.jsx(Qe,{variant:H.success?"success":"destructive",children:H.success?"OK":"FAIL"}),s.jsxs("span",{className:"font-mono",children:[H.providerName," / ",H.modelId]}),s.jsxs("span",{className:"text-muted-foreground",children:[H.latencyMs," ms"]}),H.failureReason&&s.jsx("span",{className:"text-destructive",children:H.failureReason})]},F))})]})]}),k&&k.phase==="error"&&s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx(Qe,{variant:"destructive",children:"Thất bại"}),s.jsx("p",{className:"text-destructive",children:k.error})]}),s.jsx(Vn,{children:s.jsx(he,{variant:"outline",onClick:()=>q(!1),children:"Đóng"})})]})})]})}function w_(){const[a,l]=p.useState([]),[o,i]=p.useState([]),[c,d]=p.useState(!1),[h,m]=p.useState(!1),[g,v]=p.useState(null),[b,S]=p.useState(!1),[x,w]=p.useState(!1),[E,j]=p.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),[C,T]=p.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),N=async()=>{const[K,V]=await Promise.all([Se.get("/api/admin/combos"),Se.get("/api/admin/models")]);l(K.combos),i(V.models)};p.useEffect(()=>{N()},[]);const M=K=>{j(V=>({...V,members:[...V.members,{modelId:K,weight:1,position:V.members.length,enabled:!0}]}))},A=K=>{j(V=>({...V,members:V.members.filter((le,se)=>se!==K).map((le,se)=>({...le,position:se}))}))},_=async()=>{if(E.members.length===0){xe.error("Add at least one member");return}S(!0);try{await Se.post("/api/admin/combos",{name:E.name,slug:E.slug||void 0,mode:E.mode,enabled:E.enabled,members:E.members}),xe.success("Combo created"),d(!1),j({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),N()}catch(K){xe.error(K.message)}finally{S(!1)}},z=async K=>{try{const le=(await Se.get(`/api/admin/combos/${K.id}`)).combo;v(le.id),T({name:le.name,slug:le.slug??"",mode:le.mode,enabled:le.enabled,members:le.members.map(se=>({modelId:se.modelId,weight:se.weight,position:se.position,enabled:se.enabled}))}),m(!0)}catch(V){xe.error(V.message)}},q=async()=>{if(g){if(C.members.length===0){xe.error("Add at least one member");return}w(!0);try{await Se.patch("/api/admin/combos",{id:g,name:C.name,slug:C.slug||void 0,mode:C.mode,enabled:C.enabled,members:C.members}),xe.success("Combo updated"),m(!1),v(null),N()}catch(K){xe.error(K.message)}finally{w(!1)}}},k=K=>{T(V=>({...V,members:[...V.members,{modelId:K,weight:1,position:V.members.length,enabled:!0}]}))},W=K=>{T(V=>({...V,members:V.members.filter((le,se)=>se!==K).map((le,se)=>({...le,position:se}))}))},re=async K=>{if(confirm("Delete this combo?"))try{await Se.del(`/api/admin/combos/${K}`),xe.success("Combo removed"),N()}catch(V){xe.error(V.message)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Combos",description:"Virtual models combining physical models",actions:s.jsxs(qn,{open:c,onOpenChange:d,children:[s.jsx(Ho,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Oo,{className:"mr-1 h-4 w-4"})," New combo"]})}),s.jsxs(jn,{className:"max-w-2xl",children:[s.jsx(Cn,{children:s.jsx(En,{children:"New combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(ye,{children:"Name"}),s.jsx(Ne,{value:E.name,onChange:K=>j({...E,name:K.target.value})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Ne,{value:E.slug,onChange:K=>j({...E,slug:K.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Mode"}),s.jsxs(In,{value:E.mode,onValueChange:K=>j({...E,mode:K}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(lt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:E.enabled,onCheckedChange:K=>j({...E,enabled:K})}),s.jsx(ye,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Members"}),s.jsx(my,{models:o,addedIds:E.members.map(K=>K.modelId),onAdd:M}),s.jsx("div",{className:"mt-2 space-y-1",children:E.members.map((K,V)=>{var le;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:(le=o.find(se=>se.id===K.modelId))==null?void 0:le.publicModelId}),s.jsx(Ne,{type:"number",min:1,value:K.weight,onChange:se=>{const ce=Number(se.target.value);j(U=>({...U,members:U.members.map(($,ne)=>ne===V?{...$,weight:ce}:$)}))},className:"w-20"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>A(V),children:"Remove"})]},V)})})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),s.jsx(he,{disabled:!E.name||b,onClick:_,children:b?"Creating…":"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All combos"}),s.jsxs(wn,{children:[a.length," total"]})]}),s.jsx(et,{children:s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{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(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No combos yet."})}),a.map(K=>s.jsxs(Ye,{children:[s.jsx(fe,{className:"font-mono text-xs",children:K.publicModelId}),s.jsx(fe,{children:s.jsx(Qe,{variant:"outline",children:K.mode})}),s.jsx(fe,{children:K.memberCount}),s.jsx(fe,{children:K.healthyMemberCount}),s.jsx(fe,{children:K.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(he,{size:"sm",variant:"outline",onClick:()=>void z(K),children:[s.jsx(v2,{className:"h-3.5 w-3.5"})," Sửa"]}),s.jsxs(he,{size:"sm",variant:"destructive",onClick:()=>re(K.id),children:[s.jsx(_c,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},K.id))]})]})})]}),s.jsx(qn,{open:h,onOpenChange:m,children:s.jsxs(jn,{className:"max-w-2xl",children:[s.jsx(Cn,{children:s.jsx(En,{children:"Edit combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(ye,{children:"Name"}),s.jsx(Ne,{value:C.name,onChange:K=>T({...C,name:K.target.value})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Ne,{value:C.slug,onChange:K=>T({...C,slug:K.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Mode"}),s.jsxs(In,{value:C.mode,onValueChange:K=>T({...C,mode:K}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(lt,{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:K=>T({...C,enabled:K})}),s.jsx(ye,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Members"}),s.jsx(my,{models:o,addedIds:C.members.map(K=>K.modelId),onAdd:k}),s.jsx("div",{className:"mt-2 space-y-1",children:C.members.map((K,V)=>{var le;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:(le=o.find(se=>se.id===K.modelId))==null?void 0:le.publicModelId}),s.jsx(Ne,{type:"number",min:1,value:K.weight,onChange:se=>{const ce=Number(se.target.value);T(U=>({...U,members:U.members.map(($,ne)=>ne===V?{...$,weight:ce}:$)}))},className:"w-20"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>W(V),children:"Remove"})]},V)})})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),s.jsx(he,{disabled:!C.name||x,onClick:q,children:x?"Saving…":"Save"})]})]})})]})}function my({models:a,addedIds:l,onAdd:o}){const[i,c]=p.useState(""),h=(i?a.filter(m=>{const g=i.toLowerCase();return m.publicModelId.toLowerCase().includes(g)||m.displayName.toLowerCase().includes(g)}):a).filter(m=>!l.includes(m.id));return s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Jy,{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:m=>c(m.target.value)}),i&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>c(""),children:s.jsx(Dc,{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(m=>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:m.publicModelId}),s.jsx(he,{size:"sm",variant:"ghost",onClick:()=>o(m.id),children:"+ Add"})]},m.id))})]})}function j_(){const[a,l]=p.useState([]),[o,i]=p.useState([]),[c,d]=p.useState([]),[h,m]=p.useState(!1),[g,v]=p.useState({alias:"",targetKind:"model",targetId:"",enabled:!0}),b=async()=>{const[x,w,E]=await Promise.all([Se.get("/api/admin/aliases"),Se.get("/api/admin/models"),Se.get("/api/admin/combos")]);l(x.aliases),i(w.models),d(E.combos)};p.useEffect(()=>{b()},[]);const S=async()=>{try{await Se.post("/api/admin/aliases",g),xe.success("Alias created"),m(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),b()}catch(x){xe.error(x.message)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:s.jsxs(qn,{open:h,onOpenChange:m,children:[s.jsx(Ho,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Oo,{className:"mr-1 h-4 w-4"})," New alias"]})}),s.jsxs(jn,{children:[s.jsx(Cn,{children:s.jsx(En,{children:"New alias"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(ye,{children:"Alias"}),s.jsx(Ne,{value:g.alias,onChange:x=>v({...g,alias:x.target.value}),placeholder:"coding"})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Target type"}),s.jsxs(In,{value:g.targetKind,onValueChange:x=>v({...g,targetKind:x}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"model",children:"Model"}),s.jsx(lt,{value:"combo",children:"Combo"})]})]})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Target"}),s.jsxs(In,{value:g.targetId,onValueChange:x=>v({...g,targetId:x}),children:[s.jsx(Rn,{children:s.jsx(Gn,{placeholder:"Choose target"})}),s.jsx(Nn,{children:(g.targetKind==="model"?o:c).map(x=>s.jsx(lt,{value:x.id,children:x.publicModelId},x.id))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:g.enabled,onCheckedChange:x=>v({...g,enabled:x})}),s.jsx(ye,{children:"Enabled"})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),s.jsx(he,{disabled:!g.alias||!g.targetId,onClick:S,children:"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All aliases"}),s.jsxs(wn,{children:[a.length," total"]})]}),s.jsx(et,{children:s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{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(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(fe,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),a.map(x=>s.jsxs(Ye,{children:[s.jsx(fe,{className:"font-mono text-xs",children:x.alias}),s.jsx(fe,{className:"font-mono text-xs",children:x.targetName??x.targetId}),s.jsx(fe,{children:s.jsx(Qe,{variant:"outline",children:x.targetKind})}),s.jsx(fe,{children:x.enabled?"Yes":"No"}),s.jsx(fe,{className:"text-right",children:s.jsx(he,{size:"sm",variant:"outline",onClick:async()=>{await Se.del(`/api/admin/aliases/${x.id}`),xe.success("Removed"),b()},children:"Delete"})})]},x.id))]})]})})]})]})}function C_(){const[a,l]=p.useState([]),[o,i]=p.useState([]),[c,d]=p.useState([]),[h,m]=p.useState(!1),[g,v]=p.useState(null),[b,S]=p.useState(null),[x,w]=p.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),E=async()=>{const[N,M,A]=await Promise.all([Se.get("/api/admin/api-keys"),Se.get("/api/admin/models"),Se.get("/api/admin/combos")]);l(N.apiKeys),i(M.models),d(A.combos)};p.useEffect(()=>{E()},[]);const j=async()=>{try{const N=await Se.post("/api/admin/api-keys",{name:x.name,expiresAt:x.expiresAt||null,allowAllModels:x.allowAll,permissions:x.allowAll?void 0:x.permissions,rpmLimit:x.rpmLimit?Number(x.rpmLimit):null,tpmLimit:x.tpmLimit?Number(x.tpmLimit):null,maxConcurrent:x.concurrency?Number(x.concurrency):null,...x.customSecret.trim()?{secret:x.customSecret.trim()}:{}});m(!1),v({secret:N.secret,name:N.name}),w({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),E()}catch(N){xe.error(N.message)}},C=async(N,M)=>{try{await Se.patch("/api/admin/api-keys",{id:N,enabled:!M}),xe.success(M?"Key disabled":"Key enabled"),E()}catch(A){xe.error(A.message)}},T=async N=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await Se.del(`/api/admin/api-keys/${N}`),xe.success("Key deleted"),E()}catch(M){xe.error(M.message)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:s.jsxs(qn,{open:h,onOpenChange:m,children:[s.jsx(Ho,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Oo,{className:"mr-1 h-4 w-4"})," New key"]})}),s.jsxs(jn,{className:"max-w-2xl",children:[s.jsx(Cn,{children:s.jsx(En,{children:"New API key"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(ye,{children:"Name"}),s.jsx(Ne,{value:x.name,onChange:N=>w({...x,name:N.target.value})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Expires (optional)"}),s.jsx(Ne,{type:"datetime-local",value:x.expiresAt,onChange:N=>w({...x,expiresAt:N.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{children:[s.jsx(ye,{children:"RPM limit"}),s.jsx(Ne,{value:x.rpmLimit,onChange:N=>w({...x,rpmLimit:N.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"TPM limit"}),s.jsx(Ne,{value:x.tpmLimit,onChange:N=>w({...x,tpmLimit:N.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Concurrency"}),s.jsx(Ne,{value:x.concurrency,onChange:N=>w({...x,concurrency:N.target.value}),type:"number"})]})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Key value (optional)"}),s.jsx(Ne,{value:x.customSecret,onChange:N=>w({...x,customSecret:N.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:x.allowAll,onCheckedChange:N=>w({...x,allowAll:N})}),s.jsx(ye,{children:"Allow all current and future models"})]}),!x.allowAll&&s.jsxs("div",{children:[s.jsx(ye,{children:"Scope"}),s.jsx("div",{className:"max-h-48 space-y-1 overflow-auto rounded border p-2",children:[...o.map(N=>({targetKind:"model",targetId:N.id,label:N.publicModelId})),...c.map(N=>({targetKind:"combo",targetId:N.id,label:N.publicModelId}))].map(N=>{const M=x.permissions.some(A=>A.targetKind===N.targetKind&&A.targetId===N.targetId);return s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(vm,{checked:M,onCheckedChange:A=>{w(_=>({..._,permissions:A?[..._.permissions,{targetKind:N.targetKind,targetId:N.targetId}]:_.permissions.filter(z=>!(z.targetKind===N.targetKind&&z.targetId===N.targetId))}))}}),s.jsx("span",{className:"font-mono text-xs",children:N.label}),s.jsx(Qe,{variant:"outline",className:"ml-1",children:N.targetKind})]},`${N.targetKind}:${N.targetId}`)})})]})]}),s.jsxs(Vn,{children:[s.jsx(he,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),s.jsx(he,{disabled:!x.name,onClick:j,children:"Create"})]})]})]})}),s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"All keys"}),s.jsxs(wn,{children:[a.length," total"]})]}),s.jsx(et,{children:s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{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(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),a.map(N=>s.jsxs(Ye,{children:[s.jsx(fe,{className:"font-medium",children:N.name}),s.jsxs(fe,{className:"font-mono text-xs",children:[N.keyPrefix,"…"]}),s.jsx(fe,{children:N.enabled?s.jsx(Qe,{variant:"success",children:"enabled"}):s.jsx(Qe,{variant:"destructive",children:"disabled"})}),s.jsx(fe,{children:N.allowAllModels?"all":`${N.modelScopeCount} scoped`}),s.jsx(fe,{className:"text-xs",children:[N.rpmLimit,N.tpmLimit,N.concurrencyLimit].map((M,A)=>M?["","RPM","TPM","Conc"][A+1]:null).filter(Boolean).join(" / ")||"—"}),s.jsx(fe,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[N.secret&&s.jsxs(s.Fragment,{children:[s.jsx(he,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(N.secret),xe.success("Copied")},children:s.jsx(Cf,{className:"h-3.5 w-3.5"})}),s.jsx(he,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>S({secret:N.secret,name:N.name}),children:s.jsx(o2,{className:"h-3.5 w-3.5"})})]}),s.jsxs(he,{size:"sm",variant:"outline",onClick:()=>C(N.id,N.enabled),children:[N.enabled?s.jsx(QC,{className:"mr-1 h-3.5 w-3.5"}):s.jsx(Ac,{className:"mr-1 h-3.5 w-3.5"}),N.enabled?"Disable":"Enable"]}),s.jsx(he,{size:"sm",variant:"destructive",onClick:()=>T(N.id),children:s.jsx(_c,{className:"h-3.5 w-3.5"})})]})})]},N.id))]})]})})]}),s.jsx(qn,{open:!!g,onOpenChange:N=>{N||v(null)},children:s.jsxs(jn,{children:[s.jsxs(Cn,{children:[s.jsx(En,{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:g==null?void 0:g.secret}),s.jsxs(Vn,{children:[s.jsxs(he,{onClick:()=>{g&&(navigator.clipboard.writeText(g.secret),xe.success("Copied"))},children:[s.jsx(Cf,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(he,{variant:"outline",onClick:()=>v(null),children:"I have saved it"})]})]})}),s.jsx(qn,{open:!!b,onOpenChange:N=>{N||S(null)},children:s.jsxs(jn,{children:[s.jsxs(Cn,{children:[s.jsxs(En,{children:["API key: ",b==null?void 0:b.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:b==null?void 0:b.secret}),s.jsxs(Vn,{children:[s.jsxs(he,{onClick:()=>{b&&(navigator.clipboard.writeText(b.secret),xe.success("Copied"))},children:[s.jsx(Cf,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(he,{variant:"outline",onClick:()=>S(null),children:"Close"})]})]})})]})}const E_=3e3;function R_(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 N_(){const[a,l]=p.useState([]),[o,i]=p.useState(0),[c,d]=p.useState(0),[h,m]=p.useState({success:"all",protocol:"all",streaming:"all",model:""}),[g,v]=p.useState(null),[b,S]=p.useState(null),[x,w]=p.useState(0),E=50,j=p.useRef(Date.now()),C=p.useRef(new Set),T=p.useRef(h);T.current=h;const N=p.useRef(c);N.current=c;const M=p.useCallback(async()=>{const _=new URLSearchParams;_.set("limit",String(E)),_.set("offset",String(c)),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 z=await Se.get(`/api/admin/requests?${_.toString()}`);l(z.requests),i(z.total);for(const q of z.requests)C.current.add(q.id)},[c,h]);p.useEffect(()=>{M()},[M]),p.useEffect(()=>{w(0)},[c,h]),p.useEffect(()=>{let _=!1,z=null;const q=new Set,k=()=>{_||(z=new EventSource(`/api/admin/requests/stream?since=${j.current}`),z.addEventListener("request",W=>{if(!_)try{const re=JSON.parse(W.data),K=new Date(re.createdAt).getTime();if(Number.isFinite(K)&&(j.current=Math.max(j.current,K)),C.current.has(re.id))return;C.current.add(re.id),w(V=>V+1),N.current===0&&R_(re,T.current)&&(l(V=>V.some(le=>le.id===re.id)?V:[re,...V].slice(0,E)),i(V=>V+1))}catch{}}),z.onerror=()=>{z==null||z.close(),z=null,_||q.add(setTimeout(k,E_))})};return k(),()=>{_=!0,z==null||z.close();for(const W of q)clearTimeout(W);q.clear()}},[]);const A=async _=>{v(_);const z=await Se.get(`/api/admin/requests/${_}`);S(z)};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(In,{value:h.success,onValueChange:_=>{d(0),m({...h,success:_})},children:[s.jsx(Rn,{className:"w-36",children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"all",children:"All"}),s.jsx(lt,{value:"true",children:"Success"}),s.jsx(lt,{value:"false",children:"Failed"})]})]}),s.jsxs(In,{value:h.protocol,onValueChange:_=>{d(0),m({...h,protocol:_})},children:[s.jsx(Rn,{className:"w-32",children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"all",children:"Any protocol"}),s.jsx(lt,{value:"openai",children:"OpenAI"}),s.jsx(lt,{value:"anthropic",children:"Anthropic"})]})]}),s.jsxs(In,{value:h.streaming,onValueChange:_=>{d(0),m({...h,streaming:_})},children:[s.jsx(Rn,{className:"w-32",children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"all",children:"Any"}),s.jsx(lt,{value:"true",children:"Streaming"}),s.jsx(lt,{value:"false",children:"Non-stream"})]})]}),s.jsx(Ne,{className:"max-w-xs",placeholder:"Model contains…",value:h.model,onChange:_=>{d(0),m({...h,model:_.target.value})}}),x>0&&s.jsxs(he,{size:"sm",variant:"secondary",onClick:()=>{w(0),M()},children:[x," new request",x>1?"s":""," — refresh"]})]}),s.jsx(We,{className:"mt-3 text-base",children:"Results"})]}),s.jsxs(et,{children:[s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{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(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(fe,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),a.map(_=>s.jsxs(Ye,{className:"cursor-pointer",onClick:()=>A(_.id),children:[s.jsx(fe,{className:"text-xs",children:Th(_.createdAt)}),s.jsx(fe,{children:_.success?s.jsx(Qe,{variant:"success",children:_.httpStatus}):s.jsx(Qe,{variant:"destructive",children:_.httpStatus})}),s.jsx(fe,{className:"font-mono text-xs",children:_.requestedModel}),s.jsx(fe,{className:"font-mono text-xs text-muted-foreground",children:_.finalModelPublicId??"—"}),s.jsxs(fe,{className:"text-xs",children:[At(_.inputTokens+_.outputTokens)," ",_.cacheReadTokens?s.jsxs("span",{className:"text-amber-600",children:["(+",_.cacheReadTokens," cache)"]}):null]}),s.jsxs(fe,{className:"text-xs",children:[dr(_.totalLatencyMs),_.ttftMs?s.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",_.ttftMs,"ms"]}):null]}),s.jsxs(fe,{className:"text-xs",children:[_.attemptsCount,_.gatewayCacheHit?s.jsx(Qe,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),s.jsx(fe,{className:"text-xs",children:_.apiKeyName??"—"}),s.jsx(fe,{className:"text-xs",children:_.clientIp}),s.jsx(fe,{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 ",c+1,"–",Math.min(c+E,o)," of ",o]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(he,{size:"sm",variant:"outline",disabled:c===0,onClick:()=>d(Math.max(0,c-E)),children:"Prev"}),s.jsx(he,{size:"sm",variant:"outline",disabled:c+E>=o,onClick:()=>d(c+E),children:"Next"})]})]})]})]}),s.jsx(qn,{open:!!g,onOpenChange:_=>{_||(v(null),S(null))},children:s.jsxs(jn,{className:"max-w-3xl",children:[s.jsx(Cn,{children:s.jsxs(En,{children:["Request ",eE(g,16)]})}),b?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"}),b.request.success?s.jsx(Qe,{variant:"success",children:b.request.httpStatus}):s.jsx(Qe,{variant:"destructive",children:b.request.httpStatus})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),dr(b.request.totalLatencyMs)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",At(b.request.inputTokens)," · out ",At(b.request.outputTokens)," · cache ",At(b.request.cacheReadTokens)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Attempts"}),b.request.attemptsCount]})]}),b.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:[b.request.errorType,": ",b.request.errorMessage]})]}),b.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:b.request.requestPayload})]}),b.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:b.request.responsePayload})]}),b.attempts.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Attempts"}),s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{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(Fn,{children:b.attempts.map(_=>s.jsxs(Ye,{children:[s.jsx(fe,{children:_.attemptNumber}),s.jsx(fe,{children:_.providerName}),s.jsx(fe,{className:"font-mono text-xs",children:_.modelPublicId}),s.jsx(fe,{children:_.success?s.jsx(Qe,{variant:"success",children:String(_.statusCode??"OK")}):s.jsx(Qe,{variant:"destructive",children:String(_.statusCode??"err")})}),s.jsx(fe,{className:"text-xs",children:dr(_.latencyMs)}),s.jsx(fe,{className:"text-xs",children:_.failureReason??_.selectionReason})]},_.id))})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}var T_=Object.defineProperty,Es=(a,l)=>T_(a,"name",{value:l,configurable:!0}),xm="Tabs",[M_,KD]=dn(xm,[Gc]),E1=Gc(),[A_,ym]=M_(xm),__=p.forwardRef(Es(function(l,o){const{__scopeTabs:i,value:c,onValueChange:d,defaultValue:h,orientation:m="horizontal",dir:g,activationMode:v="automatic",...b}=l,S=zo(g),[x,w]=Za({prop:c,onChange:d,defaultProp:h??"",caller:xm});return s.jsx(A_,{scope:i,baseId:ga(),value:x,onValueChange:w,orientation:m,dir:S,activationMode:v,children:s.jsx(Ue.div,{dir:S,"data-orientation":m,...b,ref:o})})},"Tabs")),D_="TabsList",O_=p.forwardRef(Es(function(l,o){const{__scopeTabs:i,loop:c=!0,...d}=l,h=ym(D_,i),m=E1(i);return s.jsx(f0,{asChild:!0,...m,orientation:h.orientation,dir:h.dir,loop:c,children:s.jsx(Ue.div,{role:"tablist","aria-orientation":h.orientation,...d,ref:o})})},"TabsList")),k_="TabsTrigger",z_=p.forwardRef(Es(function(l,o){const{__scopeTabs:i,value:c,disabled:d=!1,...h}=l,m=ym(k_,i),g=E1(i),v=bm(m.baseId,c),b=Sm(m.baseId,c),S=c===m.value;return s.jsx(h0,{asChild:!0,...g,focusable:!d,active:S,children:s.jsx(Ue.button,{type:"button",role:"tab","aria-selected":S,"aria-controls":b,"data-state":S?"active":"inactive","data-disabled":d?"":void 0,disabled:d,id:v,...h,ref:o,onMouseDown:we(l.onMouseDown,x=>{!d&&x.button===0&&x.ctrlKey===!1?m.onValueChange(c):x.preventDefault()}),onKeyDown:we(l.onKeyDown,x=>{d||x.target!==x.currentTarget||[" ","Enter"].includes(x.key)&&m.onValueChange(c)}),onFocus:we(l.onFocus,()=>{const x=m.activationMode!=="manual";!S&&!d&&x&&m.onValueChange(c)})})})},"TabsTrigger")),L_="TabsContent",U_=p.forwardRef(Es(function(l,o){const{__scopeTabs:i,value:c,forceMount:d,children:h,...m}=l,g=ym(L_,i),v=bm(g.baseId,c),b=Sm(g.baseId,c),S=c===g.value,x=p.useRef(S);return p.useEffect(()=>{const w=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(w)},[]),s.jsx(nl,{present:d||S,children:({present:w})=>s.jsx(Ue.div,{"data-state":S?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:b,tabIndex:0,...m,ref:o,style:{...l.style,animationDuration:x.current?"0s":void 0},children:w&&h})})},"TabsContent"));function bm(a,l){return`${a}-trigger-${l}`}Es(bm,"makeTriggerId");function Sm(a,l){return`${a}-content-${l}`}Es(Sm,"makeContentId");var H_=__,R1=O_,N1=z_,T1=U_;const M1=H_,wm=p.forwardRef(({className:a,...l},o)=>s.jsx(R1,{ref:o,className:je("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",a),...l}));wm.displayName=R1.displayName;const Ol=p.forwardRef(({className:a,...l},o)=>s.jsx(N1,{ref:o,className:je("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}));Ol.displayName=N1.displayName;const wo=p.forwardRef(({className:a,...l},o)=>s.jsx(T1,{ref:o,className:je("mt-2 ring-offset-background focus-visible:outline-none",a),...l}));wo.displayName=T1.displayName;const B_=3e3,P_=1600,q_=10,V_=3;function I_(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 G_(a){const[l,o]=p.useState(null),[i,c]=p.useState(null),[d,h]=p.useState([]),[m,g]=p.useState([]),[v,b]=p.useState([]),[S,x]=p.useState(!0),[w,E]=p.useState(null),j=p.useRef([]),C=p.useRef(null),T=p.useRef(new Set),N=p.useRef(Date.now()),M=p.useRef(0),A=p.useRef([]);return p.useEffect(()=>{let _=!1;return x(!0),E(null),T.current=new Set,N.current=Date.now(),Se.get(`/api/admin/stats?preset=${a}`).then(z=>{if(!_){o(z),c(z.summary),C.current=z.summary,h(z.recent),g(z.providers),j.current=z.providers;for(const q of z.recent)T.current.add(q.id);x(!1)}}).catch(z=>{_||(E(z.message),x(!1))}),()=>{_=!0}},[a]),p.useEffect(()=>{let _=!1,z=null;const q=new Set,k=()=>{_||(z=new EventSource(`/api/admin/requests/stream?since=${N.current}`),z.addEventListener("request",W=>{if(!_)try{const re=JSON.parse(W.data),K=new Date(re.createdAt).getTime();if(Number.isFinite(K)&&(N.current=Math.max(N.current,K)),T.current.has(re.id))return;if(T.current.add(re.id),C.current&&c(I_(C.current,re)),h(V=>V.some(le=>le.id===re.id)?V:[re,...V].slice(0,q_)),re.providerId){j.current=j.current.map(ce=>ce.id===re.providerId?{...ce,requests:ce.requests+1,errorRate:ce.requests+1?(ce.errorRate*ce.requests+(re.success?0:1))/(ce.requests+1):0}:ce),g(j.current);const V=`p${++M.current}`,le={id:V,providerId:re.providerId,success:re.success};A.current=[...A.current.slice(-(V_*4)),le],b(A.current);const se=setTimeout(()=>{A.current=A.current.filter(ce=>ce.id!==V),b(A.current)},P_);q.add(se)}}catch{}}),z.onerror=()=>{z==null||z.close(),z=null,_||q.add(setTimeout(k,B_))})};return k(),()=>{_=!0,z==null||z.close();for(const W of q)clearTimeout(W);q.clear()}},[]),p.useEffect(()=>{const _=setInterval(()=>{Se.get("/api/admin/providers").then(z=>{const q=new Map(z.providers.map(k=>[k.id,k]));j.current=j.current.map(k=>{const W=q.get(k.id);return W?{...k,health:W.health,enabled:W.enabled}:k}),g(j.current)}).catch(()=>{})},3e4);return()=>clearInterval(_)},[]),{snapshot:l,live:i??(l==null?void 0:l.summary)??Y_,recent:d,providers:m,pulses:v,loading:S,error:w}}const Y_={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 A1({data:a,className:l,strokeClass:o="stroke-primary",fillClass:i}){if(a.length===0)return s.jsx("svg",{className:je("h-6 w-20",l),viewBox:"0 0 80 24"});const h=Math.max(...a),m=Math.min(...a),g=h-m||1,b=a.map((S,x)=>{const w=x/(a.length-1)*78+1,E=22-(S-m)/g*20;return`${w.toFixed(1)},${E.toFixed(1)}`}).join(" ");return s.jsxs("svg",{className:je("h-6 w-20",l),viewBox:"0 0 80 24",preserveAspectRatio:"none",children:[i&&s.jsx("polygon",{points:`1,23 ${b} 79,23`,className:i}),s.jsx("polyline",{points:b,fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:o})]})}function $_(a,l,o){const i=performance.now();let c=0;const d=h=>{const m=Math.min((h-i)/l,1),g=Math.round(a*m);g!==c&&(c=g,o(g)),m<1&&requestAnimationFrame(d)};requestAnimationFrame(d)}function K_({delta:a,inverse:l}){if(Math.abs(a)<.005)return null;const o=a>0,i=l?!o:o,c=`${(Math.abs(a)*100).toFixed(1)}%`;return s.jsxs("span",{className:je("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?"▲":"▼"}),c]})}function Dl({icon:a,label:l,value:o,format:i="number",delta:c,deltaInverse:d,sparkData:h,sparkStroke:m}){const[g,v]=p.useState(0),b=p.useRef(0);p.useEffect(()=>{const x=b.current,w=o;b.current=o,x!==w&&$_(Math.abs(w-x),600,E=>v(x+(w>x?E:-E)))},[o]);const S=i==="percent"?Oc(g):i==="latency"?dr(g):At(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]}),c!==void 0&&s.jsx(K_,{delta:c,inverse:d})]}),s.jsxs(et,{className:"flex items-end justify-between",children:[s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:S}),h&&h.length>1&&s.jsx(A1,{data:h,strokeClass:m??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const _1=1e3,py=380,uc=60,ir=_1/2,cr=720,Hf=62,X_=260;function F_(a){return a==="healthy"?"fill-emerald-400":a==="degraded"?"fill-amber-400":"fill-red-400"}function Bf(a,l,o,i){const c=a+(o-a)*.45,d=a+(o-a)*.55;return`M${a},${l} C${c},${l} ${d},${i} ${o},${i}`}function Q_({liveRequests:a,successRate:l,providers:o,pulses:i}){const c=py/2,d=c,h=Math.max(1,o.reduce((m,g)=>m+g.requests,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 ${_1} ${py}`,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(m=>{const v=60+o.indexOf(m)*Hf,b=m.requests/h,S=Math.max(1.5,Math.min(6,2+b*8));return s.jsx("path",{d:Bf(ir,c,cr-20,v),fill:"none",stroke:"hsl(var(--border))",strokeWidth:S,strokeLinecap:"round",opacity:.6},m.id)}),s.jsx("path",{d:Bf(uc+30,d,ir-30,c),fill:"none",stroke:"hsl(var(--border))",strokeWidth:3,strokeLinecap:"round",strokeDasharray:"6 3",opacity:.5}),i.map(m=>{const g=o.findIndex(x=>x.id===m.providerId);if(g===-1)return null;const v=60+g*Hf,b=Bf(ir,c,cr-20,v),S=m.success?"var(--primary)":"#f87171";return s.jsxs("g",{filter:"url(#glow)",children:[s.jsx("circle",{r:5,fill:S,opacity:.9,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:b})}),s.jsx("circle",{r:9,fill:S,opacity:.25,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:b})})]},m.id)}),s.jsx("circle",{cx:uc,cy:d,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),s.jsx("text",{x:uc,y:d-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:gy(a)}),s.jsx("text",{x:uc,y:d+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),s.jsx("circle",{cx:ir,cy:c,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),s.jsx("image",{x:ir-12,y:c-16,width:24,height:24,href:"/logo.png"}),s.jsx("text",{x:ir,y:c+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),s.jsxs("text",{x:ir,y:c+38,textAnchor:"middle",className:"fill-emerald-500",fontSize:10,fontWeight:600,children:[(l*100).toFixed(1),"%"]}),o.map((m,g)=>{const v=60+g*Hf,b=m.requests/h,S=!m.enabled||m.requests===0;return s.jsxs("g",{opacity:S?.4:1,children:[s.jsx("rect",{x:cr-20,y:v-14,width:X_,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),s.jsx("circle",{cx:cr-6,cy:v+10,r:4,className:F_(m.health)}),s.jsx("text",{x:cr+6,y:v-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:m.name}),s.jsxs("text",{x:cr+6,y:v+12,className:"fill-muted-foreground",fontSize:10,children:[m.modelCount," model",m.modelCount!==1?"s":""," · ",gy(m.requests)," req"]}),s.jsxs("text",{x:cr+6,y:v+25,className:"fill-muted-foreground",fontSize:10,children:[(b*100).toFixed(1),"% traffic · ",m.avgLatencyMs<1e3?`${Math.round(m.avgLatencyMs)}ms`:`${(m.avgLatencyMs/1e3).toFixed(1)}s`," avg",m.errorRate>0&&s.jsxs("tspan",{className:"fill-red-500",children:[" · ",(m.errorRate*100).toFixed(0),"% err"]})]})]},m.id)})]})})})]})}function gy(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a)}function Z_({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(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{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(Fn,{children:a.map(l=>s.jsxs(Ye,{children:[s.jsx(fe,{className:"font-mono text-xs",children:l.requestedModel}),s.jsx(fe,{className:"text-xs text-muted-foreground",children:l.providerName??"—"}),s.jsxs(fe,{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["in ",At(l.inputTokens)," · out ",At(l.outputTokens)]}),l.cacheReadTokens>0&&s.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",At(l.cacheReadTokens)," cache)"]})]}),s.jsx(fe,{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(fe,{className:"text-xs text-muted-foreground",children:tE(l.createdAt)})]},l.id))})]})})]})}const fh=34,vy=2*Math.PI*fh;function J_(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 W_({successRate:a,averageLatencyMs:l,latencySpark:o}){const{stroke:i,text:c}=J_(a),d=Math.min(1,Math.max(0,a)),h=vy*(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:vy,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 ${c}`,children:Oc(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(A1,{data:o,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function eD(){const[a,l]=p.useState("7d"),{snapshot:o,live:i,recent:c,providers:d,pulses:h,loading:m,error:g}=G_(a);if(m)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(g||!o)return s.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",g??"unknown error"]});const v=i,b=o.previous,S=o.series;function x(j,C){return C>0?(j-C)/C:void 0}const w=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(wm,{children:[s.jsx(Ol,{value:"today",children:"Today"}),s.jsx(Ol,{value:"7d",children:"7 days"}),s.jsx(Ol,{value:"30d",children:"30 days"})]})})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsx(Dl,{icon:Yy,label:"Requests",value:v.totalRequests,delta:x(v.totalRequests,b.totalRequests),sparkData:w}),s.jsx(Dl,{icon:Ac,label:"Success rate",format:"percent",value:v.successRate,delta:x(v.successRate,b.successRate),sparkData:w,sparkStroke:"stroke-emerald-500"}),s.jsx(Dl,{icon:r2,label:"Total tokens",value:v.totalTokens,delta:x(v.totalTokens,b.totalTokens),sparkData:S.map(j=>j.inputTokens+j.outputTokens)}),s.jsx(Dl,{icon:s2,label:"Cache hit rate",format:"percent",value:v.cacheHitRate,delta:x(v.cacheHitRate,b.cacheHitRate),sparkData:S.map(j=>j.cacheRead)}),s.jsx(Dl,{icon:n2,label:"Avg latency",format:"latency",value:v.averageLatencyMs,delta:x(v.averageLatencyMs,b.averageLatencyMs),deltaInverse:!0,sparkData:E,sparkStroke:"stroke-amber-500"}),s.jsx(Dl,{icon:Xy,label:"p95 latency",format:"latency",value:v.p95LatencyMs}),s.jsx(Dl,{icon:y2,label:"Avg TTFT",format:"latency",value:v.averageTtftMs??0}),s.jsx(Dl,{icon:m2,label:"Fallback rate",format:"percent",value:v.fallbackRate,delta:x(v.fallbackRate,b.fallbackRate),deltaInverse:!0})]}),s.jsx("div",{className:"mt-6",children:s.jsx(Q_,{liveRequests:v.totalRequests,successRate:v.successRate,providers:d,pulses:h})}),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(Z_,{rows:c})}),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(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Model"}),s.jsx(pe,{children:"Req"}),s.jsx(pe,{children:"Errors"}),s.jsx(pe,{children:"Tokens"})]})}),s.jsxs(Fn,{children:[o.topModels.length===0&&s.jsx(Ye,{children:s.jsx(fe,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),o.topModels.map(j=>s.jsxs(Ye,{children:[s.jsx(fe,{className:"font-mono text-xs",children:j.publicId}),s.jsx(fe,{className:"text-xs",children:At(j.requests)}),s.jsx(fe,{className:"text-xs",children:s.jsx("span",{className:j.errorRate>.1?"text-destructive":"text-muted-foreground",children:Oc(j.errorRate)})}),s.jsx(fe,{className:"text-xs",children:At(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(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Key"}),s.jsx(pe,{children:"Requests"}),s.jsx(pe,{children:"Tokens"})]})}),s.jsxs(Fn,{children:[o.topApiKeys.length===0&&s.jsx(Ye,{children:s.jsx(fe,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),o.topApiKeys.map((j,C)=>s.jsxs(Ye,{children:[s.jsx(fe,{className:"text-xs",children:j.name}),s.jsx(fe,{className:"text-xs",children:At(j.requests)}),s.jsx(fe,{className:"text-xs",children:At(j.totalTokens)})]},C))]})]})})]})]})]}),s.jsx("div",{className:"mt-6",children:s.jsx(W_,{successRate:v.successRate,averageLatencyMs:v.averageLatencyMs,latencySpark:E})})]})}function tD(){const[a,l]=p.useState([]),[o,i]=p.useState(0);return p.useEffect(()=>{Se.get("/api/admin/audit?limit=200").then(c=>{l(c.rows),i(c.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(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{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(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(fe,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),a.map(c=>s.jsxs(Ye,{children:[s.jsx(fe,{className:"text-xs",children:Th(c.createdAt)}),s.jsx(fe,{className:"font-mono text-xs",children:c.action}),s.jsx(fe,{children:c.success?s.jsx(Qe,{variant:"success",children:"ok"}):s.jsx(Qe,{variant:"destructive",children:"fail"})}),s.jsx(fe,{className:"text-xs",children:c.targetName??c.targetId??"—"}),s.jsx(fe,{className:"text-xs",children:c.ip}),s.jsx(fe,{className:"text-xs",children:c.actor})]},c.id))]})]})})]})]})}const hh={enabled:!0,sound:!0};let To=hh,mh=!1,dc=null;const ph=new Set;function D1(){for(const a of ph)a()}function O1(a=!1){return mh&&!a?Promise.resolve():(!a&&dc||(dc=(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,D1()}catch{}})()),dc)}async function xy(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,D1()}function nD(a){return ph.add(a),()=>ph.delete(a)}function k1(){return p.useSyncExternalStore(nD,()=>To,()=>To)}function aD(){const[a]=UC(),[l,o]=p.useState(null),[i,c]=p.useState(null),[d,h]=p.useState({current:"",next:""}),[m,g]=p.useState(null),[v,b]=p.useState(!1),[S,x]=p.useState("idle"),[w,E]=p.useState(null),j=async(Z=!1)=>{x("checking"),E(null);try{const oe=await Se.get(`/api/admin/update/check${Z?"?force=1":""}`);g(oe),x("idle")}catch(oe){E(oe.message),x("error")}},C=async()=>{b(!0),x("installing"),E(null);try{const Z=await Se.post("/api/admin/update/run");x("restarting"),xe.success(Z.message||"Update started — the gateway will restart shortly.");const oe=setInterval(()=>{fetch("/health").then(ie=>{ie.ok&&(clearInterval(oe),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(oe),12e4)}catch(Z){xe.error(Z.message),E(Z.message),x("error")}finally{b(!1)}},[T,N]=p.useState("disabled"),[M,A]=p.useState(""),[_,z]=p.useState(""),[q,k]=p.useState(""),[W,re]=p.useState([]),[K,V]=p.useState(""),[le,se]=p.useState(""),[ce,U]=p.useState(!1),[$,ne]=p.useState(null),H=async()=>{const Z=await Se.get("/api/admin/settings");o(Z.settings);const oe=await Se.get("/api/admin/settings/system");c(oe);try{const ie=await Se.get("/api/admin/me");N(ie.totpEnabled?"enabled":"disabled")}catch{}};if(p.useEffect(()=>{O1(!0)},[]),p.useEffect(()=>{H(),j()},[]),!l)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const F=async Z=>{try{await Se.patch("/api/admin/settings",Z),xe.success("Saved"),H()}catch(oe){xe.error(oe.message)}},D=async()=>{try{const Z=await Se.post("/api/admin/account/totp/begin");A(Z.secret),z(Z.qr),N("setup"),xe.info("Scan the QR code with your authenticator app")}catch(Z){xe.error(Z.message)}},P=async()=>{if(!q||q.length!==6){xe.error("Enter a 6-digit code");return}try{const Z=await Se.post("/api/admin/account/totp/verify",{code:q});re(Z.recoveryCodes),N("showingRecovery"),xe.success("TOTP enabled successfully")}catch(Z){xe.error(Z.message)}},Q=async()=>{if(!K){xe.error("Enter your password");return}if(!le){xe.error("Enter a TOTP code or recovery code");return}try{await Se.post("/api/admin/account/totp/disable",{password:K,totp:le}),N("disabled"),V(""),se(""),xe.success("TOTP disabled"),H()}catch(Z){xe.error(Z.message)}},ae=async()=>{U(!0);try{const Z=await Se.post("/api/admin/account/totp/recovery/regenerate",{password:K,totp:le});re(Z.recoveryCodes),N("showingRecovery"),xe.success("Recovery codes regenerated")}catch(Z){xe.error(Z.message)}U(!1)},de=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:de,children:[s.jsxs(wm,{children:[s.jsx(Ol,{value:"logging",children:"Logging"}),s.jsx(Ol,{value:"security",children:"Security"}),s.jsx(Ol,{value:"backup",children:"Backup"}),s.jsx(Ol,{value:"system",children:"System"})]}),s.jsx(wo,{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(ye,{children:"Request-content logging"}),s.jsxs(In,{value:l.contentLogMode,onValueChange:Z=>F({contentLogMode:Z}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"off",children:"Off"}),s.jsx(lt,{value:"metadata",children:"Metadata only (default)"}),s.jsx(lt,{value:"prompt",children:"Prompt (sanitized)"}),s.jsx(lt,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(ye,{children:"Retention (days)"}),s.jsx(Ne,{type:"number",min:1,max:3650,value:l.retentionDays,onChange:Z=>F({retentionDays:Number(Z.target.value)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(ye,{children:"Database size limit (MB)"}),s.jsx(Ne,{type:"number",min:64,value:l.dbSizeLimitMb,onChange:Z=>F({dbSizeLimitMb:Number(Z.target.value)})})]}),s.jsx("div",{className:"flex items-center gap-2 pt-2",children:s.jsx(he,{onClick:async()=>{const Z=await Se.post("/api/admin/settings/cleanup");xe.success(`Deleted ${Z.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),s.jsx(wo,{value:"security",children:s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Security"}),s.jsx(wn,{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(ye,{children:"Trusted proxy hops"}),s.jsx(Ne,{type:"number",min:0,max:8,value:l.trustProxyHops,onChange:Z=>F({trustProxyHops:Number(Z.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(ye,{className:"text-base",children:"TOTP 2FA"}),T==="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,T==="disabled"?s.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:"Disabled"}):null]}),T==="disabled"&&s.jsx(he,{variant:"outline",onClick:D,children:"Enable TOTP"}),T==="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."}),_&&s.jsx("img",{src:_,alt:"TOTP QR code",className:"h-40 w-40"}),s.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",M]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(ye,{children:"Verify code"}),s.jsx(Ne,{value:q,onChange:Z=>k(Z.target.value),placeholder:"123456",maxLength:6})]}),s.jsx(he,{disabled:q.length<6,onClick:P,children:"Verify & enable"})]})]}),T==="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:W.map((Z,oe)=>s.jsx("div",{className:"font-mono text-xs",children:Z},oe))}),s.jsx(he,{onClick:()=>{N("enabled"),xe.success("Recovery codes saved")},children:"I have saved them"})]}),T==="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(ye,{children:"Password"}),s.jsx(Ne,{type:"password",value:K,onChange:Z=>V(Z.target.value),placeholder:"Current password"})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"TOTP code"}),s.jsx(Ne,{value:le,onChange:Z=>se(Z.target.value),placeholder:"123456",maxLength:6})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{variant:"outline",size:"sm",disabled:ce||!K||le.length<6,onClick:ae,children:"Regenerate recovery codes"}),s.jsx(he,{variant:"destructive",size:"sm",disabled:!K||le.length<6,onClick:Q,children:"Disable TOTP"})]})]})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx(ye,{children:"Change password"}),s.jsx(Ne,{type:"password",placeholder:"Current password",value:d.current,onChange:Z=>h({...d,current:Z.target.value})}),s.jsx(Ne,{type:"password",placeholder:"New password (12+ chars)",value:d.next,onChange:Z=>h({...d,next:Z.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}),xe.success("Password changed"),h({current:"",next:""})}catch(Z){xe.error(Z.message)}},children:"Change password"})]})]})]})}),s.jsx(wo,{value:"backup",children:s.jsxs(Ze,{children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Backup & restore"}),s.jsx(wn,{children:"Download a snapshot or restore from a previous backup"})]}),s.jsxs(et,{className:"space-y-3",children:[s.jsx(he,{onClick:async()=>{try{const Z=await fetch("/api/admin/backup/create",{method:"POST",credentials:"include"});if(!Z.ok)throw new Error("Backup failed");const oe=await Z.blob(),ie=URL.createObjectURL(oe),me=document.createElement("a");me.href=ie,me.download="latedev-backup.json",me.click(),URL.revokeObjectURL(ie),xe.success("Backup downloaded")}catch(Z){xe.error(Z.message)}},children:"Download backup"}),s.jsxs(r1,{open:$!==null,onOpenChange:Z=>{Z||ne(null)},children:[s.jsx(gA,{asChild:!0,children:s.jsxs("div",{children:[s.jsx(ye,{children:"Restore from backup file"}),s.jsx(Ne,{type:"file",accept:".json,application/json","data-testid":"restore-file",onChange:Z=>{var ie;const oe=(ie=Z.target.files)==null?void 0:ie[0];ne(oe??null)}})]})}),s.jsxs(nm,{children:[s.jsxs(o1,{children:[s.jsx(am,{children:"Restore backup?"}),s.jsxs(lm,{children:["Restoring will replace the entire current database with the selected backup (",($==null?void 0:$.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),s.jsxs(i1,{children:[s.jsx(sm,{children:"Cancel"}),s.jsx(rm,{onClick:async()=>{var oe,ie;const Z=$;if(Z)try{const me=await fetch("/api/admin/backup/restore",{method:"POST",body:Z,credentials:"include",headers:{"content-type":"application/json"}});if(!me.ok)throw new Error(((ie=(oe=await me.json())==null?void 0:oe.error)==null?void 0:ie.message)??"Restore failed");xe.success("Restored. Reloading…"),ne(null),setTimeout(()=>location.reload(),600)}catch(me){xe.error(me.message)}},children:"Restore"})]})]})]})]})]})}),s.jsxs(wo,{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:Z=>F({gatewayCacheEnabled:Z})}),s.jsx(ye,{children:"Gateway response cache (disabled by default)"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(ye,{children:"Cache TTL (s)"}),s.jsx(Ne,{type:"number",min:1,value:l.gatewayCacheDefaultTtlSeconds,onChange:Z=>F({gatewayCacheDefaultTtlSeconds:Number(Z.target.value)})})]}),s.jsxs("div",{children:[s.jsx(ye,{children:"Cache max size (MB)"}),s.jsx(Ne,{type:"number",min:1,value:l.gatewayCacheMaxSizeMb,onChange:Z=>F({gatewayCacheMaxSizeMb:Number(Z.target.value)})})]})]}),s.jsx(he,{variant:"outline",onClick:async()=>{const Z=await Se.post("/api/admin/settings/cache/clear");xe.success(`Cleared ${Z.deleted} entries`)},children:"Clear gateway cache"})]})]}),s.jsx(lD,{}),s.jsxs(Ze,{className:"mt-4",children:[s.jsxs(Je,{children:[s.jsx(We,{className:"text-base",children:"Updates"}),s.jsx(wn,{children:"Automatic updates from the npm registry"})]}),s.jsxs(et,{className:"space-y-3 text-sm",children:[S==="checking"&&!m&&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…"]}),m&&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",m.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:m.latestVersion?`v${m.latestVersion}`:"—"})]}),m.status.docker?s.jsx(Qe,{variant:"secondary",children:m.status.watchtower?"Docker + Watchtower":"Docker"}):m.latestVersion===null?s.jsx(Qe,{variant:"secondary",children:"Registry unreachable"}):m.hasUpdate?s.jsx(Qe,{variant:"success",children:"Update available"}):s.jsxs(Qe,{variant:"outline",children:[s.jsx(Ac,{className:"mr-1 h-3 w-3"})," Up to date"]})]}),m.status.docker&&m.status.watchtower&&m.watchtowerReachable&&s.jsx("p",{className:"text-muted-foreground",children:"Watchtower pulls new images automatically every hour — or use Update now for an instant update."}),m.status.docker&&m.status.watchtower&&m.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"}),"."]}),m.status.docker&&!m.status.watchtower&&s.jsx("p",{className:"text-muted-foreground",children:m.status.reason??"This instance runs in Docker — update by pulling the new image tag."}),!m.status.docker&&m.latestVersion===null&&s.jsxs("p",{className:"text-muted-foreground",children:["Could not reach the npm registry (offline or blocked). ",w&&s.jsx("span",{className:"text-destructive",children:w})]}),S==="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."]}),S==="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:[m.hasUpdate&&S==="idle"&&(!m.status.docker||m.status.watchtower&&m.watchtowerReachable!==!1)&&s.jsxs(he,{disabled:v||m.status.docker&&m.watchtowerReachable===!1,onClick:C,children:[s.jsx(Ky,{className:"mr-1 h-4 w-4"})," Update now"]}),m.hasUpdate&&m.changelogUrl&&s.jsx(he,{variant:"outline",asChild:!0,children:s.jsx("a",{href:m.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),S==="idle"&&s.jsx(he,{variant:"ghost",disabled:v,onClick:()=>j(!0),children:"Check again"})]})]})]})]})]})]})]})}function lD(){const a=k1();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(ZC,{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 xy({enabled:l})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(b2,{className:"h-3 w-3"})," Play notification sound"]}),s.jsx(ba,{checked:a.sound,onCheckedChange:l=>void xy({sound:l})})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function rD({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,c=o.success&&o.totalLatencyMs>15e3,d=je("rounded-md border shadow-lg transition-all",i&&"bg-destructive text-destructive-foreground border-destructive",c&&"bg-amber-500/90 text-amber-950 border-amber-600/50",!i&&!c&&"bg-card text-card-foreground border-border");return s.jsxs(ur,{to:"/requests",className:je("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(t2,{className:"h-4 w-4 shrink-0"}):o.success?s.jsx(Ac,{className:"h-4 w-4 shrink-0"}):s.jsx(S2,{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(Dc,{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 ",At(o.inputTokens)," · out ",At(o.outputTokens),(o.cacheReadTokens>0||o.cacheWriteTokens>0)&&s.jsxs(s.Fragment,{children:[" · cache ",o.cacheReadTokens>0&&s.jsxs("span",{children:["r",At(o.cacheReadTokens)]}),o.cacheReadTokens>0&&o.cacheWriteTokens>0&&"/",o.cacheWriteTokens>0&&s.jsxs("span",{children:["w",At(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 sD=5e3,oD=8,iD=3e3;let fc=null;function cD(){try{fc||(fc=new Audio("/notification.mp3")),fc.currentTime=0,fc.play().catch(()=>{})}catch{}}function uD(){const[a,l]=p.useState([]),o=p.useRef(null),i=p.useRef(new Map),c=p.useRef(Date.now()),d=k1(),h=p.useRef(d.sound);h.current=d.sound,p.useEffect(()=>{O1()},[]);const m=d.enabled;return p.useEffect(()=>{var x;if(!m){(x=o.current)==null||x.close(),o.current=null;const w=i.current;for(const E of w.values())clearTimeout(E);w.clear(),l([]);return}let v=!1;const b=i.current,S=()=>{if(v)return;const w=new EventSource(`/api/admin/requests/stream?since=${c.current}`);o.current=w,w.addEventListener("request",E=>{if(!v)try{const j=JSON.parse(E.data),C=new Date(j.createdAt).getTime();Number.isFinite(C)&&(c.current=Math.max(c.current,C)),l(N=>N.some(M=>M.id===j.id)?N:[j,...N].slice(0,oD));const T=setTimeout(()=>{l(N=>N.filter(M=>M.id!==j.id)),b.delete(j.id)},sD);b.set(j.id,T),h.current&&cD()}catch{}}),w.onerror=()=>{w.close(),o.current=null,v||setTimeout(S,iD)}};return S(),()=>{var w;v=!0,(w=o.current)==null||w.close(),o.current=null;for(const E of b.values())clearTimeout(E);b.clear()}},[m]),{items:a,dismiss:v=>{const b=i.current.get(v);b&&(clearTimeout(b),i.current.delete(v)),l(S=>S.filter(x=>x.id!==v))}}}function dD({children:a}){const{user:l,loading:o}=Rh(),i=un();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 fD(){const{items:a,dismiss:l}=uD();return s.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[s.jsx(aE,{}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(lM,{}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsxs(By,{children:[s.jsx(rn,{index:!0,element:s.jsx(HM,{})}),s.jsx(rn,{path:"/providers",element:s.jsx(d_,{})}),s.jsx(rn,{path:"/models",element:s.jsx(S_,{})}),s.jsx(rn,{path:"/combos",element:s.jsx(w_,{})}),s.jsx(rn,{path:"/aliases",element:s.jsx(j_,{})}),s.jsx(rn,{path:"/api-keys",element:s.jsx(C_,{})}),s.jsx(rn,{path:"/requests",element:s.jsx(N_,{})}),s.jsx(rn,{path:"/statistics",element:s.jsx(eD,{})}),s.jsx(rn,{path:"/audit",element:s.jsx(tD,{})}),s.jsx(rn,{path:"/settings/*",element:s.jsx(aD,{})})]})})]}),s.jsx(rD,{items:a,onDismiss:l})]})}function hD({children:a}){const[l,o]=p.useState(null),i=un();return p.useEffect(()=>{Se.get("/api/admin/setup/status").then(c=>o(c.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 mD(){return s.jsx($C,{children:s.jsx(hD,{children:s.jsxs(By,{children:[s.jsx(rn,{path:"/setup",element:s.jsx(LM,{})}),s.jsx(rn,{path:"/login",element:s.jsx(zM,{})}),s.jsx(rn,{path:"/*",element:s.jsx(dD,{children:s.jsx(fD,{})})})]})})})}const pD=kM;var gD=Object.defineProperty,on=(a,l)=>gD(a,"name",{value:l,configurable:!0}),[jm,XD]=dn("Tooltip",[Cs]),vD=Cs(),xD="TooltipProvider",yD=700,yy="tooltip.open",[bD,SD]=jm(xD),wD=on(a=>{const{__scopeTooltip:l,delayDuration:o=yD,skipDelayDuration:i=300,disableHoverableContent:c=!1,children:d}=a,h=p.useRef(!0),m=p.useRef(!1),g=p.useRef(0);return p.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),s.jsx(bD,{scope:l,isOpenDelayedRef:h,delayDuration:o,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(g.current),h.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>h.current=!0,i))},[i]),isPointerInTransitRef:m,onPointerInTransitChange:p.useCallback(v=>{m.current=v},[]),disableHoverableContent:c,children:d})},"TooltipProvider"),jD="Tooltip",[FD,Cm]=jm(jD),CD="TooltipPortal",[QD,ED]=jm(CD,{forceMount:void 0}),Mo="TooltipContent",RD=p.forwardRef(on(function(l,o){const i=ED(Mo,l.__scopeTooltip),{forceMount:c=i.forceMount,side:d="top",...h}=l,m=Cm(Mo,l.__scopeTooltip);return s.jsx(nl,{present:c||m.open,children:m.disableHoverableContent?s.jsx(z1,{side:d,...h,ref:o}):s.jsx(ND,{side:d,...h,ref:o})})},"TooltipContent")),ND=p.forwardRef(on(function(l,o){const i=Cm(Mo,l.__scopeTooltip),c=SD(Mo,l.__scopeTooltip),d=p.useRef(null),h=Ve(o,d),[m,g]=p.useState(null),{trigger:v,onClose:b}=i,S=d.current,{onPointerInTransitChange:x}=c,w=p.useCallback(()=>{g(null),x(!1)},[x]),E=p.useCallback((j,C)=>{const T=j.currentTarget,N={x:j.clientX,y:j.clientY},M=L1(N,T.getBoundingClientRect()),A=U1(N,M),_=H1(C.getBoundingClientRect()),z=P1([...A,..._]);g(z),x(!0)},[x]);return p.useEffect(()=>()=>w(),[w]),p.useEffect(()=>{if(v&&S){const j=on(T=>E(T,S),"handleTriggerLeave"),C=on(T=>E(T,v),"handleContentLeave");return v.addEventListener("pointerleave",j),S.addEventListener("pointerleave",C),()=>{v.removeEventListener("pointerleave",j),S.removeEventListener("pointerleave",C)}}},[v,S,E,w]),p.useEffect(()=>{if(m){const j=on(C=>{const T=C.target,N={x:C.clientX,y:C.clientY},M=(v==null?void 0:v.contains(T))||(S==null?void 0:S.contains(T)),A=!B1(N,m);M?w():A&&(w(),b())},"handleTrackPointerGrace");return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[v,S,m,b,w]),s.jsx(z1,{...l,ref:h})},"TooltipContentHoverable")),TD=ib("TooltipContent"),z1=p.forwardRef(on(function(l,o){const{__scopeTooltip:i,children:c,"aria-label":d,id:h,onEscapeKeyDown:m,onPointerDownOutside:g,...v}=l,b=Cm(Mo,i),S=vD(i),{onClose:x}=b;p.useEffect(()=>(document.addEventListener(yy,x),()=>document.removeEventListener(yy,x)),[x]),p.useEffect(()=>{if(b.trigger){const E=on(j=>{j.target instanceof Node&&j.target.contains(b.trigger)&&x()},"handleScroll");return window.addEventListener("scroll",E,{capture:!0}),()=>window.removeEventListener("scroll",E,{capture:!0})}},[b.trigger,x]);const{setContentId:w}=b;return _t(()=>(w(h),()=>{w(void 0)}),[h,w]),s.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:E=>E.preventDefault(),onDismiss:x,children:s.jsxs(Vh,{"data-state":b.stateAttribute,role:d?void 0:"tooltip",id:d?void 0:b.contentId,...S,...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(TD,{children:c}),d?s.jsx(EA,{id:b.contentId,role:"tooltip",children:d}):null]})})},"TooltipContentImpl"));function L1(a,l){const o=Math.abs(l.top-a.y),i=Math.abs(l.bottom-a.y),c=Math.abs(l.right-a.x),d=Math.abs(l.left-a.x);switch(Math.min(o,i,c,d)){case d:return"left";case c:return"right";case o:return"top";case i:return"bottom";default:throw new Error("unreachable")}}on(L1,"getExitSideFromRect");function U1(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}on(U1,"getPaddedExitPoints");function H1(a){const{top:l,right:o,bottom:i,left:c}=a;return[{x:c,y:l},{x:o,y:l},{x:o,y:i},{x:c,y:i}]}on(H1,"getPointsFromRect");function B1(a,l){const{x:o,y:i}=a;let c=!1;for(let d=0,h=l.length-1;d<l.length;h=d++){const m=l[d],g=l[h],v=m.x,b=m.y,S=g.x,x=g.y;b>i!=x>i&&o<(S-v)*(i-b)/(x-b)+v&&(c=!c)}return c}on(B1,"isPointInPolygon");function P1(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),q1(l)}on(P1,"getHull");function q1(a){if(a.length<=1)return a.slice();const l=[];for(let i=0;i<a.length;i++){const c=a[i];for(;l.length>=2;){const d=l[l.length-1],h=l[l.length-2];if((d.x-h.x)*(c.y-h.y)>=(d.y-h.y)*(c.x-h.x))l.pop();else break}l.push(c)}l.pop();const o=[];for(let i=a.length-1;i>=0;i--){const c=a[i];for(;o.length>=2;){const d=o[o.length-1],h=o[o.length-2];if((d.x-h.x)*(c.y-h.y)>=(d.y-h.y)*(c.x-h.x))o.pop();else break}o.push(c)}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)}on(q1,"getHullPresorted");var MD=wD,V1=RD;const AD=MD,_D=p.forwardRef(({className:a,sideOffset:l=4,...o},i)=>s.jsx(V1,{ref:i,sideOffset:l,className:je("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}));_D.displayName=V1.displayName;uj.createRoot(document.getElementById("root")).render(s.jsx(ue.StrictMode,{children:s.jsx(fE,{defaultTheme:"dark",storageKey:"latedev-theme",children:s.jsxs(AD,{children:[s.jsx(OC,{children:s.jsx(mD,{})}),s.jsx(pD,{position:"top-right"})]})})}));
|