@agent-team-foundation/first-tree-hub 0.9.4 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/assets/index-CzlAfdgm.js +361 -0
- package/dist/web/assets/index-DEwlT6PE.css +1 -0
- package/dist/web/fonts/inter-latin-ext.woff2 +0 -0
- package/dist/web/fonts/inter-latin.woff2 +0 -0
- package/dist/web/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
- package/dist/web/fonts/jetbrains-mono-latin.woff2 +0 -0
- package/dist/web/index.html +4 -2
- package/package.json +1 -1
- package/dist/web/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
- package/dist/web/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
- package/dist/web/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
- package/dist/web/assets/geist-mono-cyrillic-wght-normal-BZdD_g9V.woff2 +0 -0
- package/dist/web/assets/geist-mono-latin-ext-wght-normal-b6lpi8_2.woff2 +0 -0
- package/dist/web/assets/geist-mono-latin-wght-normal-Cjtb1TV-.woff2 +0 -0
- package/dist/web/assets/index-DEbM78Bl.css +0 -1
- package/dist/web/assets/index-os2Tqmer.js +0 -361
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
var Xx=e=>{throw TypeError(e)};var gm=(e,t,n)=>t.has(e)||Xx("Cannot "+n);var U=(e,t,n)=>(gm(e,t,"read from private field"),n?n.call(e):t.get(e)),_e=(e,t,n)=>t.has(e)?Xx("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ye=(e,t,n,i)=>(gm(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),Be=(e,t,n)=>(gm(e,t,"access private method"),n);var qc=(e,t,n,i)=>({set _(l){ye(e,t,l,n)},get _(){return U(e,t,i)}});function bN(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const l in i)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(i,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>i[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function Od(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ym={exports:{}},Bo={};/**
|
|
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 Jx;function xN(){if(Jx)return Bo;Jx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,l,o){var u=null;if(o!==void 0&&(u=""+o),l.key!==void 0&&(u=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:i,key:u,ref:l!==void 0?l:null,props:o}}return Bo.Fragment=t,Bo.jsx=n,Bo.jsxs=n,Bo}var Wx;function SN(){return Wx||(Wx=1,ym.exports=xN()),ym.exports}var d=SN(),vm={exports:{}},Le={};/**
|
|
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 e0;function wN(){if(e0)return Le;e0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.iterator;function x(L){return L===null||typeof L!="object"?null:(L=b&&L[b]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function N(L,A,C){this.props=L,this.context=A,this.refs=E,this.updater=C||k}N.prototype.isReactComponent={},N.prototype.setState=function(L,A){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,A,"setState")},N.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function T(){}T.prototype=N.prototype;function O(L,A,C){this.props=L,this.context=A,this.refs=E,this.updater=C||k}var I=O.prototype=new T;I.constructor=O,j(I,N.prototype),I.isPureReactComponent=!0;var B=Array.isArray;function z(){}var F={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function ee(L,A,C){var J=C.ref;return{$$typeof:e,type:L,key:A,ref:J!==void 0?J:null,props:C}}function q(L,A){return ee(L.type,A,L.props)}function ae(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function re(L){var A={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(C){return A[C]})}var pe=/\/+/g;function de(L,A){return typeof L=="object"&&L!==null&&L.key!=null?re(""+L.key):A.toString(36)}function W(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(z,z):(L.status="pending",L.then(function(A){L.status==="pending"&&(L.status="fulfilled",L.value=A)},function(A){L.status==="pending"&&(L.status="rejected",L.reason=A)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function P(L,A,C,J,Y){var ue=typeof L;(ue==="undefined"||ue==="boolean")&&(L=null);var ge=!1;if(L===null)ge=!0;else switch(ue){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(L.$$typeof){case e:case t:ge=!0;break;case y:return ge=L._init,P(ge(L._payload),A,C,J,Y)}}if(ge)return Y=Y(L),ge=J===""?"."+de(L,0):J,B(Y)?(C="",ge!=null&&(C=ge.replace(pe,"$&/")+"/"),P(Y,A,C,"",function(_t){return _t})):Y!=null&&(ae(Y)&&(Y=q(Y,C+(Y.key==null||L&&L.key===Y.key?"":(""+Y.key).replace(pe,"$&/")+"/")+ge)),A.push(Y)),1;ge=0;var Me=J===""?".":J+":";if(B(L))for(var xe=0;xe<L.length;xe++)J=L[xe],ue=Me+de(J,xe),ge+=P(J,A,C,ue,Y);else if(xe=x(L),typeof xe=="function")for(L=xe.call(L),xe=0;!(J=L.next()).done;)J=J.value,ue=Me+de(J,xe++),ge+=P(J,A,C,ue,Y);else if(ue==="object"){if(typeof L.then=="function")return P(W(L),A,C,J,Y);throw A=String(L),Error("Objects are not valid as a React child (found: "+(A==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":A)+"). If you meant to render a collection of children, use an array instead.")}return ge}function V(L,A,C){if(L==null)return L;var J=[],Y=0;return P(L,J,"","",function(ue){return A.call(C,ue,Y++)}),J}function ce(L){if(L._status===-1){var A=L._result;A=A(),A.then(function(C){(L._status===0||L._status===-1)&&(L._status=1,L._result=C)},function(C){(L._status===0||L._status===-1)&&(L._status=2,L._result=C)}),L._status===-1&&(L._status=0,L._result=A)}if(L._status===1)return L._result.default;throw L._result}var be=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var A=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(A))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},R={map:V,forEach:function(L,A,C){V(L,function(){A.apply(this,arguments)},C)},count:function(L){var A=0;return V(L,function(){A++}),A},toArray:function(L){return V(L,function(A){return A})||[]},only:function(L){if(!ae(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Le.Activity=g,Le.Children=R,Le.Component=N,Le.Fragment=n,Le.Profiler=l,Le.PureComponent=O,Le.StrictMode=i,Le.Suspense=m,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,Le.__COMPILER_RUNTIME={__proto__:null,c:function(L){return F.H.useMemoCache(L)}},Le.cache=function(L){return function(){return L.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(L,A,C){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var J=j({},L.props),Y=L.key;if(A!=null)for(ue in A.key!==void 0&&(Y=""+A.key),A)!Z.call(A,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&A.ref===void 0||(J[ue]=A[ue]);var ue=arguments.length-2;if(ue===1)J.children=C;else if(1<ue){for(var ge=Array(ue),Me=0;Me<ue;Me++)ge[Me]=arguments[Me+2];J.children=ge}return ee(L.type,Y,J)},Le.createContext=function(L){return L={$$typeof:u,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:o,_context:L},L},Le.createElement=function(L,A,C){var J,Y={},ue=null;if(A!=null)for(J in A.key!==void 0&&(ue=""+A.key),A)Z.call(A,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(Y[J]=A[J]);var ge=arguments.length-2;if(ge===1)Y.children=C;else if(1<ge){for(var Me=Array(ge),xe=0;xe<ge;xe++)Me[xe]=arguments[xe+2];Y.children=Me}if(L&&L.defaultProps)for(J in ge=L.defaultProps,ge)Y[J]===void 0&&(Y[J]=ge[J]);return ee(L,ue,Y)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(L){return{$$typeof:f,render:L}},Le.isValidElement=ae,Le.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ce}},Le.memo=function(L,A){return{$$typeof:h,type:L,compare:A===void 0?null:A}},Le.startTransition=function(L){var A=F.T,C={};F.T=C;try{var J=L(),Y=F.S;Y!==null&&Y(C,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(z,be)}catch(ue){be(ue)}finally{A!==null&&C.types!==null&&(A.types=C.types),F.T=A}},Le.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},Le.use=function(L){return F.H.use(L)},Le.useActionState=function(L,A,C){return F.H.useActionState(L,A,C)},Le.useCallback=function(L,A){return F.H.useCallback(L,A)},Le.useContext=function(L){return F.H.useContext(L)},Le.useDebugValue=function(){},Le.useDeferredValue=function(L,A){return F.H.useDeferredValue(L,A)},Le.useEffect=function(L,A){return F.H.useEffect(L,A)},Le.useEffectEvent=function(L){return F.H.useEffectEvent(L)},Le.useId=function(){return F.H.useId()},Le.useImperativeHandle=function(L,A,C){return F.H.useImperativeHandle(L,A,C)},Le.useInsertionEffect=function(L,A){return F.H.useInsertionEffect(L,A)},Le.useLayoutEffect=function(L,A){return F.H.useLayoutEffect(L,A)},Le.useMemo=function(L,A){return F.H.useMemo(L,A)},Le.useOptimistic=function(L,A){return F.H.useOptimistic(L,A)},Le.useReducer=function(L,A,C){return F.H.useReducer(L,A,C)},Le.useRef=function(L){return F.H.useRef(L)},Le.useState=function(L){return F.H.useState(L)},Le.useSyncExternalStore=function(L,A,C){return F.H.useSyncExternalStore(L,A,C)},Le.useTransition=function(){return F.H.useTransition()},Le.version="19.2.4",Le}var t0;function ng(){return t0||(t0=1,vm.exports=wN()),vm.exports}var S=ng();const kN=Od(S),rg=bN({__proto__:null,default:kN},[S]);var bm={exports:{}},Po={},xm={exports:{}},Sm={};/**
|
|
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 n0;function jN(){return n0||(n0=1,(function(e){function t(P,V){var ce=P.length;P.push(V);e:for(;0<ce;){var be=ce-1>>>1,R=P[be];if(0<l(R,V))P[be]=V,P[ce]=R,ce=be;else break e}}function n(P){return P.length===0?null:P[0]}function i(P){if(P.length===0)return null;var V=P[0],ce=P.pop();if(ce!==V){P[0]=ce;e:for(var be=0,R=P.length,L=R>>>1;be<L;){var A=2*(be+1)-1,C=P[A],J=A+1,Y=P[J];if(0>l(C,ce))J<R&&0>l(Y,C)?(P[be]=Y,P[J]=ce,be=J):(P[be]=C,P[A]=ce,be=A);else if(J<R&&0>l(Y,ce))P[be]=Y,P[J]=ce,be=J;else break e}}return V}function l(P,V){var ce=P.sortIndex-V.sortIndex;return ce!==0?ce:P.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],y=1,g=null,b=3,x=!1,k=!1,j=!1,E=!1,N=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function I(P){for(var V=n(h);V!==null;){if(V.callback===null)i(h);else if(V.startTime<=P)i(h),V.sortIndex=V.expirationTime,t(m,V);else break;V=n(h)}}function B(P){if(j=!1,I(P),!k)if(n(m)!==null)k=!0,z||(z=!0,re());else{var V=n(h);V!==null&&W(B,V.startTime-P)}}var z=!1,F=-1,Z=5,ee=-1;function q(){return E?!0:!(e.unstable_now()-ee<Z)}function ae(){if(E=!1,z){var P=e.unstable_now();ee=P;var V=!0;try{e:{k=!1,j&&(j=!1,T(F),F=-1),x=!0;var ce=b;try{t:{for(I(P),g=n(m);g!==null&&!(g.expirationTime>P&&q());){var be=g.callback;if(typeof be=="function"){g.callback=null,b=g.priorityLevel;var R=be(g.expirationTime<=P);if(P=e.unstable_now(),typeof R=="function"){g.callback=R,I(P),V=!0;break t}g===n(m)&&i(m),I(P)}else i(m);g=n(m)}if(g!==null)V=!0;else{var L=n(h);L!==null&&W(B,L.startTime-P),V=!1}}break e}finally{g=null,b=ce,x=!1}V=void 0}}finally{V?re():z=!1}}}var re;if(typeof O=="function")re=function(){O(ae)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,de=pe.port2;pe.port1.onmessage=ae,re=function(){de.postMessage(null)}}else re=function(){N(ae,0)};function W(P,V){F=N(function(){P(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(P){switch(b){case 1:case 2:case 3:var V=3;break;default:V=b}var ce=b;b=V;try{return P()}finally{b=ce}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(P,V){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var ce=b;b=P;try{return V()}finally{b=ce}},e.unstable_scheduleCallback=function(P,V,ce){var be=e.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?be+ce:be):ce=be,P){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=ce+R,P={id:y++,callback:V,priorityLevel:P,startTime:ce,expirationTime:R,sortIndex:-1},ce>be?(P.sortIndex=ce,t(h,P),n(m)===null&&P===n(h)&&(j?(T(F),F=-1):j=!0,W(B,ce-be))):(P.sortIndex=R,t(m,P),k||x||(k=!0,z||(z=!0,re()))),P},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(P){var V=b;return function(){var ce=b;b=V;try{return P.apply(this,arguments)}finally{b=ce}}}})(Sm)),Sm}var r0;function EN(){return r0||(r0=1,xm.exports=jN()),xm.exports}var wm={exports:{}},fn={};/**
|
|
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 a0;function CN(){if(a0)return fn;a0=1;var e=ng();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},l=Symbol.for("react.portal");function o(m,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:m,containerInfo:h,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,fn.createPortal=function(m,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(m,h,null,y)},fn.flushSync=function(m){var h=u.T,y=i.p;try{if(u.T=null,i.p=2,m)return m()}finally{u.T=h,i.p=y,i.d.f()}},fn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(m,h))},fn.prefetchDNS=function(m){typeof m=="string"&&i.d.D(m)},fn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:x}):y==="script"&&i.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},fn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=f(h.as,h.crossOrigin);i.d.M(m,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(m)},fn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin);i.d.L(m,y,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},fn.preloadModule=function(m,h){if(typeof m=="string")if(h){var y=f(h.as,h.crossOrigin);i.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(m)},fn.requestFormReset=function(m){i.d.r(m)},fn.unstable_batchedUpdates=function(m,h){return m(h)},fn.useFormState=function(m,h,y){return u.H.useFormState(m,h,y)},fn.useFormStatus=function(){return u.H.useHostTransitionStatus()},fn.version="19.2.4",fn}var i0;function MS(){if(i0)return wm.exports;i0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),wm.exports=CN(),wm.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 l0;function _N(){if(l0)return Po;l0=1;var e=EN(),t=ng(),n=MS();function i(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var a=r,s=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,(a.flags&4098)!==0&&(s=a.return),r=a.return;while(r)}return a.tag===3?s:null}function u(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function f(r){if(r.tag===31){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function m(r){if(o(r)!==r)throw Error(i(188))}function h(r){var a=r.alternate;if(!a){if(a=o(r),a===null)throw Error(i(188));return a!==r?null:r}for(var s=r,c=a;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(c=p.return,c!==null){s=c;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===c)return m(p),a;v=v.sibling}throw Error(i(188))}if(s.return!==c.return)s=p,c=v;else{for(var w=!1,_=p.child;_;){if(_===s){w=!0,s=p,c=v;break}if(_===c){w=!0,c=p,s=v;break}_=_.sibling}if(!w){for(_=v.child;_;){if(_===s){w=!0,s=v,c=p;break}if(_===c){w=!0,c=v,s=p;break}_=_.sibling}if(!w)throw Error(i(189))}}if(s.alternate!==c)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?r:a}function y(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=y(r),a!==null)return a;r=r.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),O=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function re(r){return r===null||typeof r!="object"?null:(r=ae&&r[ae]||r["@@iterator"],typeof r=="function"?r:null)}var pe=Symbol.for("react.client.reference");function de(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===pe?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case N:return"Profiler";case E:return"StrictMode";case B:return"Suspense";case z:return"SuspenseList";case ee:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case O:return r.displayName||"Context";case T:return(r._context.displayName||"Context")+".Consumer";case I:var a=r.render;return r=r.displayName,r||(r=a.displayName||a.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case F:return a=r.displayName||null,a!==null?a:de(r.type)||"Memo";case Z:a=r._payload,r=r._init;try{return de(r(a))}catch{}}return null}var W=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},be=[],R=-1;function L(r){return{current:r}}function A(r){0>R||(r.current=be[R],be[R]=null,R--)}function C(r,a){R++,be[R]=r.current,r.current=a}var J=L(null),Y=L(null),ue=L(null),ge=L(null);function Me(r,a){switch(C(ue,a),C(Y,r),C(J,null),a.nodeType){case 9:case 11:r=(r=a.documentElement)&&(r=r.namespaceURI)?xx(r):0;break;default:if(r=a.tagName,a=a.namespaceURI)a=xx(a),r=Sx(a,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}A(J),C(J,r)}function xe(){A(J),A(Y),A(ue)}function _t(r){r.memoizedState!==null&&C(ge,r);var a=J.current,s=Sx(a,r.type);a!==s&&(C(Y,r),C(J,s))}function en(r){Y.current===r&&(A(J),A(Y)),ge.current===r&&(A(ge),Mo._currentValue=ce)}var Bn,tr;function tn(r){if(Bn===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Bn=a&&a[1]||"",tr=-1<s.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Bn+r+tr}var Na=!1;function ft(r,a){if(!r||Na)return"";Na=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(X){var K=X}Reflect.construct(r,[],se)}else{try{se.call()}catch(X){K=X}r.call(se.prototype)}}else{try{throw Error()}catch(X){K=X}(se=r())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(X){if(X&&K&&typeof X.stack=="string")return[X.stack,K.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),w=v[0],_=v[1];if(w&&_){var M=w.split(`
|
|
44
|
+
`),G=_.split(`
|
|
45
|
+
`);for(p=c=0;c<M.length&&!M[c].includes("DetermineComponentFrameRoot");)c++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(c===M.length||p===G.length)for(c=M.length-1,p=G.length-1;1<=c&&0<=p&&M[c]!==G[p];)p--;for(;1<=c&&0<=p;c--,p--)if(M[c]!==G[p]){if(c!==1||p!==1)do if(c--,p--,0>p||M[c]!==G[p]){var te=`
|
|
46
|
+
`+M[c].replace(" at new "," at ");return r.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",r.displayName)),te}while(1<=c&&0<=p);break}}}finally{Na=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?tn(s):""}function Gt(r,a){switch(r.tag){case 26:case 27:case 5:return tn(r.type);case 16:return tn("Lazy");case 13:return r.child!==a&&a!==null?tn("Suspense Fallback"):tn("Suspense");case 19:return tn("SuspenseList");case 0:case 15:return ft(r.type,!1);case 11:return ft(r.type.render,!1);case 1:return ft(r.type,!0);case 31:return tn("Activity");default:return""}}function br(r){try{var a="",s=null;do a+=Gt(r,s),s=r,r=r.return;while(r);return a}catch(c){return`
|
|
47
|
+
Error generating stack: `+c.message+`
|
|
48
|
+
`+c.stack}}var Zr=Object.prototype.hasOwnProperty,Vr=e.unstable_scheduleCallback,Ai=e.unstable_cancelCallback,Ti=e.unstable_shouldYield,Zs=e.unstable_requestPaint,nn=e.unstable_now,Vs=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,$e=e.unstable_LowPriority,nt=e.unstable_IdlePriority,cn=e.log,xr=e.unstable_setDisableYieldValue,rn=null,Dt=null;function dn(r){if(typeof cn=="function"&&xr(r),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(rn,r)}catch{}}var ut=Math.clz32?Math.clz32:Aa,Nr=Math.log,Pn=Math.LN2;function Aa(r){return r>>>=0,r===0?32:31-(Nr(r)/Pn|0)|0}var Ri=256,zi=262144,Oi=4194304;function Ar(r){var a=r&42;if(a!==0)return a;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Di(r,a,s){var c=r.pendingLanes;if(c===0)return 0;var p=0,v=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var _=c&134217727;return _!==0?(c=_&~v,c!==0?p=Ar(c):(w&=_,w!==0?p=Ar(w):s||(s=_&~r,s!==0&&(p=Ar(s))))):(_=c&~v,_!==0?p=Ar(_):w!==0?p=Ar(w):s||(s=c&~r,s!==0&&(p=Ar(s)))),p===0?0:a!==0&&a!==p&&(a&v)===0&&(v=p&-p,s=a&-a,v>=s||v===32&&(s&4194048)!==0)?a:p}function Ta(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function Au(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 Qs(){var r=Oi;return Oi<<=1,(Oi&62914560)===0&&(Oi=4194304),r}function Sl(r){for(var a=[],s=0;31>s;s++)a.push(r);return a}function Ra(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Tu(r,a,s,c,p,v){var w=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var _=r.entanglements,M=r.expirationTimes,G=r.hiddenUpdates;for(s=w&~s;0<s;){var te=31-ut(s),se=1<<te;_[te]=0,M[te]=-1;var K=G[te];if(K!==null)for(G[te]=null,te=0;te<K.length;te++){var X=K[te];X!==null&&(X.lane&=-536870913)}s&=~se}c!==0&&Gs(r,c,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(w&~a))}function Gs(r,a,s){r.pendingLanes|=a,r.suspendedLanes&=~a;var c=31-ut(a);r.entangledLanes|=a,r.entanglements[c]=r.entanglements[c]|1073741824|s&261930}function oe(r,a){var s=r.entangledLanes|=a;for(r=r.entanglements;s;){var c=31-ut(s),p=1<<c;p&a|r[c]&a&&(r[c]|=a),s&=~p}}function He(r,a){var s=a&-a;return s=(s&42)!==0?1:Kt(s),(s&(r.suspendedLanes|a))!==0?0:s}function Kt(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function wl(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function lf(){var r=V.p;return r!==0?r:(r=window.event,r===void 0?32:Hx(r.type))}function ly(r,a){var s=V.p;try{return V.p=r,a()}finally{V.p=s}}var za=Math.random().toString(36).slice(2),an="__reactFiber$"+za,wn="__reactProps$"+za,kl="__reactContainer$"+za,sf="__reactEvents$"+za,oC="__reactListeners$"+za,uC="__reactHandles$"+za,sy="__reactResources$"+za,Ks="__reactMarker$"+za;function of(r){delete r[an],delete r[wn],delete r[sf],delete r[oC],delete r[uC]}function jl(r){var a=r[an];if(a)return a;for(var s=r.parentNode;s;){if(a=s[kl]||s[an]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(r=Nx(r);r!==null;){if(s=r[an])return s;r=Nx(r)}return a}r=s,s=r.parentNode}return null}function El(r){if(r=r[an]||r[kl]){var a=r.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return r}return null}function Ys(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(i(33))}function Cl(r){var a=r[sy];return a||(a=r[sy]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Yt(r){r[Ks]=!0}var oy=new Set,uy={};function Mi(r,a){_l(r,a),_l(r+"Capture",a)}function _l(r,a){for(uy[r]=a,r=0;r<a.length;r++)oy.add(a[r])}var cC=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]*$"),cy={},dy={};function dC(r){return Zr.call(dy,r)?!0:Zr.call(cy,r)?!1:cC.test(r)?dy[r]=!0:(cy[r]=!0,!1)}function Ru(r,a,s){if(dC(a))if(s===null)r.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,""+s)}}function zu(r,a,s){if(s===null)r.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+s)}}function Qr(r,a,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(a,s,""+c)}}function nr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function fy(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function fC(r,a,s){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);if(!r.hasOwnProperty(a)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,v=c.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return p.call(this)},set:function(w){s=""+w,v.call(this,w)}}),Object.defineProperty(r,a,{enumerable:c.enumerable}),{getValue:function(){return s},setValue:function(w){s=""+w},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function uf(r){if(!r._valueTracker){var a=fy(r)?"checked":"value";r._valueTracker=fC(r,a,""+r[a])}}function hy(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var s=a.getValue(),c="";return r&&(c=fy(r)?r.checked?"true":"false":r.value),r=c,r!==s?(a.setValue(r),!0):!1}function Ou(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var hC=/[\n"\\]/g;function rr(r){return r.replace(hC,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function cf(r,a,s,c,p,v,w,_){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),a!=null?w==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+nr(a)):r.value!==""+nr(a)&&(r.value=""+nr(a)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),a!=null?df(r,w,nr(a)):s!=null?df(r,w,nr(s)):c!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.name=""+nr(_):r.removeAttribute("name")}function my(r,a,s,c,p,v,w,_){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),a!=null||s!=null){if(!(v!=="submit"&&v!=="reset"||a!=null)){uf(r);return}s=s!=null?""+nr(s):"",a=a!=null?""+nr(a):s,_||a===r.value||(r.value=a),r.defaultValue=a}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=_?r.checked:!!c,r.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),uf(r)}function df(r,a,s){a==="number"&&Ou(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Nl(r,a,s,c){if(r=r.options,a){a={};for(var p=0;p<s.length;p++)a["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=a.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&c&&(r[s].defaultSelected=!0)}else{for(s=""+nr(s),a=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,c&&(r[p].defaultSelected=!0);return}a!==null||r[p].disabled||(a=r[p])}a!==null&&(a.selected=!0)}}function py(r,a,s){if(a!=null&&(a=""+nr(a),a!==r.value&&(r.value=a),s==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=s!=null?""+nr(s):""}function gy(r,a,s,c){if(a==null){if(c!=null){if(s!=null)throw Error(i(92));if(W(c)){if(1<c.length)throw Error(i(93));c=c[0]}s=c}s==null&&(s=""),a=s}s=nr(a),r.defaultValue=s,c=r.textContent,c===s&&c!==""&&c!==null&&(r.value=c),uf(r)}function Al(r,a){if(a){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=a;return}}r.textContent=a}var mC=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 yy(r,a,s){var c=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?c?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":c?r.setProperty(a,s):typeof s!="number"||s===0||mC.has(a)?a==="float"?r.cssFloat=s:r[a]=(""+s).trim():r[a]=s+"px"}function vy(r,a,s){if(a!=null&&typeof a!="object")throw Error(i(62));if(r=r.style,s!=null){for(var c in s)!s.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var p in a)c=a[p],a.hasOwnProperty(p)&&s[p]!==c&&yy(r,p,c)}else for(var v in a)a.hasOwnProperty(v)&&yy(r,v,a[v])}function ff(r){if(r.indexOf("-")===-1)return!1;switch(r){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 pC=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"]]),gC=/^[\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 Du(r){return gC.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Gr(){}var hf=null;function mf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Tl=null,Rl=null;function by(r){var a=El(r);if(a&&(r=a.stateNode)){var s=r[wn]||null;e:switch(r=a.stateNode,a.type){case"input":if(cf(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+rr(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var c=s[a];if(c!==r&&c.form===r.form){var p=c[wn]||null;if(!p)throw Error(i(90));cf(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(a=0;a<s.length;a++)c=s[a],c.form===r.form&&hy(c)}break e;case"textarea":py(r,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Nl(r,!!s.multiple,a,!1)}}}var pf=!1;function xy(r,a,s){if(pf)return r(a,s);pf=!0;try{var c=r(a);return c}finally{if(pf=!1,(Tl!==null||Rl!==null)&&(Sc(),Tl&&(a=Tl,r=Rl,Rl=Tl=null,by(a),r)))for(a=0;a<r.length;a++)by(r[a])}}function Xs(r,a){var s=r.stateNode;if(s===null)return null;var c=s[wn]||null;if(c===null)return null;s=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(i(231,a,typeof s));return s}var Kr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gf=!1;if(Kr)try{var Js={};Object.defineProperty(Js,"passive",{get:function(){gf=!0}}),window.addEventListener("test",Js,Js),window.removeEventListener("test",Js,Js)}catch{gf=!1}var Oa=null,yf=null,Mu=null;function Sy(){if(Mu)return Mu;var r,a=yf,s=a.length,c,p="value"in Oa?Oa.value:Oa.textContent,v=p.length;for(r=0;r<s&&a[r]===p[r];r++);var w=s-r;for(c=1;c<=w&&a[s-c]===p[v-c];c++);return Mu=p.slice(r,1<c?1-c:void 0)}function Lu(r){var a=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function Uu(){return!0}function wy(){return!1}function kn(r){function a(s,c,p,v,w){this._reactName=s,this._targetInst=p,this.type=c,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var _ in r)r.hasOwnProperty(_)&&(s=r[_],this[_]=s?s(v):v[_]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Uu:wy,this.isPropagationStopped=wy,this}return g(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Uu)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Uu)},persist:function(){},isPersistent:Uu}),a}var Li={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Iu=kn(Li),Ws=g({},Li,{view:0,detail:0}),yC=kn(Ws),vf,bf,eo,Bu=g({},Ws,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sf,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==eo&&(eo&&r.type==="mousemove"?(vf=r.screenX-eo.screenX,bf=r.screenY-eo.screenY):bf=vf=0,eo=r),vf)},movementY:function(r){return"movementY"in r?r.movementY:bf}}),ky=kn(Bu),vC=g({},Bu,{dataTransfer:0}),bC=kn(vC),xC=g({},Ws,{relatedTarget:0}),xf=kn(xC),SC=g({},Li,{animationName:0,elapsedTime:0,pseudoElement:0}),wC=kn(SC),kC=g({},Li,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),jC=kn(kC),EC=g({},Li,{data:0}),jy=kn(EC),CC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_C={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"},NC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AC(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=NC[r])?!!a[r]:!1}function Sf(){return AC}var TC=g({},Ws,{key:function(r){if(r.key){var a=CC[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=Lu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?_C[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sf,charCode:function(r){return r.type==="keypress"?Lu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Lu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),RC=kn(TC),zC=g({},Bu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ey=kn(zC),OC=g({},Ws,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sf}),DC=kn(OC),MC=g({},Li,{propertyName:0,elapsedTime:0,pseudoElement:0}),LC=kn(MC),UC=g({},Bu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),IC=kn(UC),BC=g({},Li,{newState:0,oldState:0}),PC=kn(BC),$C=[9,13,27,32],wf=Kr&&"CompositionEvent"in window,to=null;Kr&&"documentMode"in document&&(to=document.documentMode);var FC=Kr&&"TextEvent"in window&&!to,Cy=Kr&&(!wf||to&&8<to&&11>=to),_y=" ",Ny=!1;function Ay(r,a){switch(r){case"keyup":return $C.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ty(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var zl=!1;function qC(r,a){switch(r){case"compositionend":return Ty(a);case"keypress":return a.which!==32?null:(Ny=!0,_y);case"textInput":return r=a.data,r===_y&&Ny?null:r;default:return null}}function HC(r,a){if(zl)return r==="compositionend"||!wf&&Ay(r,a)?(r=Sy(),Mu=yf=Oa=null,zl=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Cy&&a.locale!=="ko"?null:a.data;default:return null}}var ZC={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 Ry(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!ZC[r.type]:a==="textarea"}function zy(r,a,s,c){Tl?Rl?Rl.push(c):Rl=[c]:Tl=c,a=Nc(a,"onChange"),0<a.length&&(s=new Iu("onChange","change",null,s,c),r.push({event:s,listeners:a}))}var no=null,ro=null;function VC(r){mx(r,0)}function Pu(r){var a=Ys(r);if(hy(a))return r}function Oy(r,a){if(r==="change")return a}var Dy=!1;if(Kr){var kf;if(Kr){var jf="oninput"in document;if(!jf){var My=document.createElement("div");My.setAttribute("oninput","return;"),jf=typeof My.oninput=="function"}kf=jf}else kf=!1;Dy=kf&&(!document.documentMode||9<document.documentMode)}function Ly(){no&&(no.detachEvent("onpropertychange",Uy),ro=no=null)}function Uy(r){if(r.propertyName==="value"&&Pu(ro)){var a=[];zy(a,ro,r,mf(r)),xy(VC,a)}}function QC(r,a,s){r==="focusin"?(Ly(),no=a,ro=s,no.attachEvent("onpropertychange",Uy)):r==="focusout"&&Ly()}function GC(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Pu(ro)}function KC(r,a){if(r==="click")return Pu(a)}function YC(r,a){if(r==="input"||r==="change")return Pu(a)}function XC(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var $n=typeof Object.is=="function"?Object.is:XC;function ao(r,a){if($n(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var s=Object.keys(r),c=Object.keys(a);if(s.length!==c.length)return!1;for(c=0;c<s.length;c++){var p=s[c];if(!Zr.call(a,p)||!$n(r[p],a[p]))return!1}return!0}function Iy(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function By(r,a){var s=Iy(r);r=0;for(var c;s;){if(s.nodeType===3){if(c=r+s.textContent.length,r<=a&&c>=a)return{node:s,offset:a-r};r=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Iy(s)}}function Py(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?Py(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function $y(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=Ou(r.document);a instanceof r.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)r=a.contentWindow;else break;a=Ou(r.document)}return a}function Ef(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}var JC=Kr&&"documentMode"in document&&11>=document.documentMode,Ol=null,Cf=null,io=null,_f=!1;function Fy(r,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;_f||Ol==null||Ol!==Ou(c)||(c=Ol,"selectionStart"in c&&Ef(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),io&&ao(io,c)||(io=c,c=Nc(Cf,"onSelect"),0<c.length&&(a=new Iu("onSelect","select",null,a,s),r.push({event:a,listeners:c}),a.target=Ol)))}function Ui(r,a){var s={};return s[r.toLowerCase()]=a.toLowerCase(),s["Webkit"+r]="webkit"+a,s["Moz"+r]="moz"+a,s}var Dl={animationend:Ui("Animation","AnimationEnd"),animationiteration:Ui("Animation","AnimationIteration"),animationstart:Ui("Animation","AnimationStart"),transitionrun:Ui("Transition","TransitionRun"),transitionstart:Ui("Transition","TransitionStart"),transitioncancel:Ui("Transition","TransitionCancel"),transitionend:Ui("Transition","TransitionEnd")},Nf={},qy={};Kr&&(qy=document.createElement("div").style,"AnimationEvent"in window||(delete Dl.animationend.animation,delete Dl.animationiteration.animation,delete Dl.animationstart.animation),"TransitionEvent"in window||delete Dl.transitionend.transition);function Ii(r){if(Nf[r])return Nf[r];if(!Dl[r])return r;var a=Dl[r],s;for(s in a)if(a.hasOwnProperty(s)&&s in qy)return Nf[r]=a[s];return r}var Hy=Ii("animationend"),Zy=Ii("animationiteration"),Vy=Ii("animationstart"),WC=Ii("transitionrun"),e_=Ii("transitionstart"),t_=Ii("transitioncancel"),Qy=Ii("transitionend"),Gy=new Map,Af="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(" ");Af.push("scrollEnd");function Sr(r,a){Gy.set(r,a),Mi(a,[r])}var $u=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},ar=[],Ml=0,Tf=0;function Fu(){for(var r=Ml,a=Tf=Ml=0;a<r;){var s=ar[a];ar[a++]=null;var c=ar[a];ar[a++]=null;var p=ar[a];ar[a++]=null;var v=ar[a];if(ar[a++]=null,c!==null&&p!==null){var w=c.pending;w===null?p.next=p:(p.next=w.next,w.next=p),c.pending=p}v!==0&&Ky(s,p,v)}}function qu(r,a,s,c){ar[Ml++]=r,ar[Ml++]=a,ar[Ml++]=s,ar[Ml++]=c,Tf|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function Rf(r,a,s,c){return qu(r,a,s,c),Hu(r)}function Bi(r,a){return qu(r,null,null,a),Hu(r)}function Ky(r,a,s){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,c=v.alternate,c!==null&&(c.childLanes|=s),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&a!==null&&(p=31-ut(s),r=v.hiddenUpdates,c=r[p],c===null?r[p]=[a]:c.push(a),a.lane=s|536870912),v):null}function Hu(r){if(50<No)throw No=0,Ph=null,Error(i(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var Ll={};function n_(r,a,s,c){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(r,a,s,c){return new n_(r,a,s,c)}function zf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Yr(r,a){var s=r.alternate;return s===null?(s=Fn(r.tag,a,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=a,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,a=r.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function Yy(r,a){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,a=s.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function Zu(r,a,s,c,p,v){var w=0;if(c=r,typeof r=="function")zf(r)&&(w=1);else if(typeof r=="string")w=sN(r,s,J.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case ee:return r=Fn(31,s,a,p),r.elementType=ee,r.lanes=v,r;case j:return Pi(s.children,p,v,a);case E:w=8,p|=24;break;case N:return r=Fn(12,s,a,p|2),r.elementType=N,r.lanes=v,r;case B:return r=Fn(13,s,a,p),r.elementType=B,r.lanes=v,r;case z:return r=Fn(19,s,a,p),r.elementType=z,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:w=10;break e;case T:w=9;break e;case I:w=11;break e;case F:w=14;break e;case Z:w=16,c=null;break e}w=29,s=Error(i(130,r===null?"null":typeof r,"")),c=null}return a=Fn(w,s,a,p),a.elementType=r,a.type=c,a.lanes=v,a}function Pi(r,a,s,c){return r=Fn(7,r,c,a),r.lanes=s,r}function Of(r,a,s){return r=Fn(6,r,null,a),r.lanes=s,r}function Xy(r){var a=Fn(18,null,null,0);return a.stateNode=r,a}function Df(r,a,s){return a=Fn(4,r.children!==null?r.children:[],r.key,a),a.lanes=s,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var Jy=new WeakMap;function ir(r,a){if(typeof r=="object"&&r!==null){var s=Jy.get(r);return s!==void 0?s:(a={value:r,source:a,stack:br(a)},Jy.set(r,a),a)}return{value:r,source:a,stack:br(a)}}var Ul=[],Il=0,Vu=null,lo=0,lr=[],sr=0,Da=null,Tr=1,Rr="";function Xr(r,a){Ul[Il++]=lo,Ul[Il++]=Vu,Vu=r,lo=a}function Wy(r,a,s){lr[sr++]=Tr,lr[sr++]=Rr,lr[sr++]=Da,Da=r;var c=Tr;r=Rr;var p=32-ut(c)-1;c&=~(1<<p),s+=1;var v=32-ut(a)+p;if(30<v){var w=p-p%5;v=(c&(1<<w)-1).toString(32),c>>=w,p-=w,Tr=1<<32-ut(a)+p|s<<p|c,Rr=v+r}else Tr=1<<v|s<<p|c,Rr=r}function Mf(r){r.return!==null&&(Xr(r,1),Wy(r,1,0))}function Lf(r){for(;r===Vu;)Vu=Ul[--Il],Ul[Il]=null,lo=Ul[--Il],Ul[Il]=null;for(;r===Da;)Da=lr[--sr],lr[sr]=null,Rr=lr[--sr],lr[sr]=null,Tr=lr[--sr],lr[sr]=null}function ev(r,a){lr[sr++]=Tr,lr[sr++]=Rr,lr[sr++]=Da,Tr=a.id,Rr=a.overflow,Da=r}var ln=null,wt=null,Ye=!1,Ma=null,or=!1,Uf=Error(i(519));function La(r){var a=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw so(ir(a,r)),Uf}function tv(r){var a=r.stateNode,s=r.type,c=r.memoizedProps;switch(a[an]=r,a[wn]=c,s){case"dialog":Ve("cancel",a),Ve("close",a);break;case"iframe":case"object":case"embed":Ve("load",a);break;case"video":case"audio":for(s=0;s<To.length;s++)Ve(To[s],a);break;case"source":Ve("error",a);break;case"img":case"image":case"link":Ve("error",a),Ve("load",a);break;case"details":Ve("toggle",a);break;case"input":Ve("invalid",a),my(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ve("invalid",a);break;case"textarea":Ve("invalid",a),gy(a,c.value,c.defaultValue,c.children)}s=c.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||c.suppressHydrationWarning===!0||vx(a.textContent,s)?(c.popover!=null&&(Ve("beforetoggle",a),Ve("toggle",a)),c.onScroll!=null&&Ve("scroll",a),c.onScrollEnd!=null&&Ve("scrollend",a),c.onClick!=null&&(a.onclick=Gr),a=!0):a=!1,a||La(r,!0)}function nv(r){for(ln=r.return;ln;)switch(ln.tag){case 5:case 31:case 13:or=!1;return;case 27:case 3:or=!0;return;default:ln=ln.return}}function Bl(r){if(r!==ln)return!1;if(!Ye)return nv(r),Ye=!0,!1;var a=r.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||tm(r.type,r.memoizedProps)),s=!s),s&&wt&&La(r),nv(r),a===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));wt=_x(r)}else if(a===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));wt=_x(r)}else a===27?(a=wt,Ya(r.type)?(r=lm,lm=null,wt=r):wt=a):wt=ln?cr(r.stateNode.nextSibling):null;return!0}function $i(){wt=ln=null,Ye=!1}function If(){var r=Ma;return r!==null&&(_n===null?_n=r:_n.push.apply(_n,r),Ma=null),r}function so(r){Ma===null?Ma=[r]:Ma.push(r)}var Bf=L(null),Fi=null,Jr=null;function Ua(r,a,s){C(Bf,a._currentValue),a._currentValue=s}function Wr(r){r._currentValue=Bf.current,A(Bf)}function Pf(r,a,s){for(;r!==null;){var c=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,c!==null&&(c.childLanes|=a)):c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a),r===s)break;r=r.return}}function $f(r,a,s,c){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var w=p.child;v=v.firstContext;e:for(;v!==null;){var _=v;v=p;for(var M=0;M<a.length;M++)if(_.context===a[M]){v.lanes|=s,_=v.alternate,_!==null&&(_.lanes|=s),Pf(v.return,s,r),c||(w=null);break e}v=_.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(i(341));w.lanes|=s,v=w.alternate,v!==null&&(v.lanes|=s),Pf(w,s,r),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===r){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}function Pl(r,a,s,c){r=null;for(var p=a,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var w=p.alternate;if(w===null)throw Error(i(387));if(w=w.memoizedProps,w!==null){var _=p.type;$n(p.pendingProps.value,w.value)||(r!==null?r.push(_):r=[_])}}else if(p===ge.current){if(w=p.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Mo):r=[Mo])}p=p.return}r!==null&&$f(a,r,s,c),a.flags|=262144}function Qu(r){for(r=r.firstContext;r!==null;){if(!$n(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function qi(r){Fi=r,Jr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function sn(r){return rv(Fi,r)}function Gu(r,a){return Fi===null&&qi(r),rv(r,a)}function rv(r,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},Jr===null){if(r===null)throw Error(i(308));Jr=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else Jr=Jr.next=a;return s}var r_=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(s,c){r.push(c)}};this.abort=function(){a.aborted=!0,r.forEach(function(s){return s()})}},a_=e.unstable_scheduleCallback,i_=e.unstable_NormalPriority,Ut={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ff(){return{controller:new r_,data:new Map,refCount:0}}function oo(r){r.refCount--,r.refCount===0&&a_(i_,function(){r.controller.abort()})}var uo=null,qf=0,$l=0,Fl=null;function l_(r,a){if(uo===null){var s=uo=[];qf=0,$l=Vh(),Fl={status:"pending",value:void 0,then:function(c){s.push(c)}}}return qf++,a.then(av,av),a}function av(){if(--qf===0&&uo!==null){Fl!==null&&(Fl.status="fulfilled");var r=uo;uo=null,$l=0,Fl=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function s_(r,a){var s=[],c={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){c.status="fulfilled",c.value=a;for(var p=0;p<s.length;p++)(0,s[p])(a)},function(p){for(c.status="rejected",c.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),c}var iv=P.S;P.S=function(r,a){Fb=nn(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&l_(r,a),iv!==null&&iv(r,a)};var Hi=L(null);function Hf(){var r=Hi.current;return r!==null?r:gt.pooledCache}function Ku(r,a){a===null?C(Hi,Hi.current):C(Hi,a.pool)}function lv(){var r=Hf();return r===null?null:{parent:Ut._currentValue,pool:r}}var ql=Error(i(460)),Zf=Error(i(474)),Yu=Error(i(542)),Xu={then:function(){}};function sv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function ov(r,a,s){switch(s=r[s],s===void 0?r.push(a):s!==a&&(a.then(Gr,Gr),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,cv(r),r;default:if(typeof a.status=="string")a.then(Gr,Gr);else{if(r=gt,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=a,r.status="pending",r.then(function(c){if(a.status==="pending"){var p=a;p.status="fulfilled",p.value=c}},function(c){if(a.status==="pending"){var p=a;p.status="rejected",p.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,cv(r),r}throw Vi=a,ql}}function Zi(r){try{var a=r._init;return a(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Vi=s,ql):s}}var Vi=null;function uv(){if(Vi===null)throw Error(i(459));var r=Vi;return Vi=null,r}function cv(r){if(r===ql||r===Yu)throw Error(i(483))}var Hl=null,co=0;function Ju(r){var a=co;return co+=1,Hl===null&&(Hl=[]),ov(Hl,r,a)}function fo(r,a){a=a.props.ref,r.ref=a!==void 0?a:null}function Wu(r,a){throw a.$$typeof===b?Error(i(525)):(r=Object.prototype.toString.call(a),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function dv(r){function a(H,$){if(r){var Q=H.deletions;Q===null?(H.deletions=[$],H.flags|=16):Q.push($)}}function s(H,$){if(!r)return null;for(;$!==null;)a(H,$),$=$.sibling;return null}function c(H){for(var $=new Map;H!==null;)H.key!==null?$.set(H.key,H):$.set(H.index,H),H=H.sibling;return $}function p(H,$){return H=Yr(H,$),H.index=0,H.sibling=null,H}function v(H,$,Q){return H.index=Q,r?(Q=H.alternate,Q!==null?(Q=Q.index,Q<$?(H.flags|=67108866,$):Q):(H.flags|=67108866,$)):(H.flags|=1048576,$)}function w(H){return r&&H.alternate===null&&(H.flags|=67108866),H}function _(H,$,Q,le){return $===null||$.tag!==6?($=Of(Q,H.mode,le),$.return=H,$):($=p($,Q),$.return=H,$)}function M(H,$,Q,le){var Ne=Q.type;return Ne===j?te(H,$,Q.props.children,le,Q.key):$!==null&&($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Z&&Zi(Ne)===$.type)?($=p($,Q.props),fo($,Q),$.return=H,$):($=Zu(Q.type,Q.key,Q.props,null,H.mode,le),fo($,Q),$.return=H,$)}function G(H,$,Q,le){return $===null||$.tag!==4||$.stateNode.containerInfo!==Q.containerInfo||$.stateNode.implementation!==Q.implementation?($=Df(Q,H.mode,le),$.return=H,$):($=p($,Q.children||[]),$.return=H,$)}function te(H,$,Q,le,Ne){return $===null||$.tag!==7?($=Pi(Q,H.mode,le,Ne),$.return=H,$):($=p($,Q),$.return=H,$)}function se(H,$,Q){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Of(""+$,H.mode,Q),$.return=H,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case x:return Q=Zu($.type,$.key,$.props,null,H.mode,Q),fo(Q,$),Q.return=H,Q;case k:return $=Df($,H.mode,Q),$.return=H,$;case Z:return $=Zi($),se(H,$,Q)}if(W($)||re($))return $=Pi($,H.mode,Q,null),$.return=H,$;if(typeof $.then=="function")return se(H,Ju($),Q);if($.$$typeof===O)return se(H,Gu(H,$),Q);Wu(H,$)}return null}function K(H,$,Q,le){var Ne=$!==null?$.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ne!==null?null:_(H,$,""+Q,le);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:return Q.key===Ne?M(H,$,Q,le):null;case k:return Q.key===Ne?G(H,$,Q,le):null;case Z:return Q=Zi(Q),K(H,$,Q,le)}if(W(Q)||re(Q))return Ne!==null?null:te(H,$,Q,le,null);if(typeof Q.then=="function")return K(H,$,Ju(Q),le);if(Q.$$typeof===O)return K(H,$,Gu(H,Q),le);Wu(H,Q)}return null}function X(H,$,Q,le,Ne){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return H=H.get(Q)||null,_($,H,""+le,Ne);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case x:return H=H.get(le.key===null?Q:le.key)||null,M($,H,le,Ne);case k:return H=H.get(le.key===null?Q:le.key)||null,G($,H,le,Ne);case Z:return le=Zi(le),X(H,$,Q,le,Ne)}if(W(le)||re(le))return H=H.get(Q)||null,te($,H,le,Ne,null);if(typeof le.then=="function")return X(H,$,Q,Ju(le),Ne);if(le.$$typeof===O)return X(H,$,Q,Gu($,le),Ne);Wu($,le)}return null}function Se(H,$,Q,le){for(var Ne=null,rt=null,je=$,Ie=$=0,Ke=null;je!==null&&Ie<Q.length;Ie++){je.index>Ie?(Ke=je,je=null):Ke=je.sibling;var at=K(H,je,Q[Ie],le);if(at===null){je===null&&(je=Ke);break}r&&je&&at.alternate===null&&a(H,je),$=v(at,$,Ie),rt===null?Ne=at:rt.sibling=at,rt=at,je=Ke}if(Ie===Q.length)return s(H,je),Ye&&Xr(H,Ie),Ne;if(je===null){for(;Ie<Q.length;Ie++)je=se(H,Q[Ie],le),je!==null&&($=v(je,$,Ie),rt===null?Ne=je:rt.sibling=je,rt=je);return Ye&&Xr(H,Ie),Ne}for(je=c(je);Ie<Q.length;Ie++)Ke=X(je,H,Ie,Q[Ie],le),Ke!==null&&(r&&Ke.alternate!==null&&je.delete(Ke.key===null?Ie:Ke.key),$=v(Ke,$,Ie),rt===null?Ne=Ke:rt.sibling=Ke,rt=Ke);return r&&je.forEach(function(ti){return a(H,ti)}),Ye&&Xr(H,Ie),Ne}function ze(H,$,Q,le){if(Q==null)throw Error(i(151));for(var Ne=null,rt=null,je=$,Ie=$=0,Ke=null,at=Q.next();je!==null&&!at.done;Ie++,at=Q.next()){je.index>Ie?(Ke=je,je=null):Ke=je.sibling;var ti=K(H,je,at.value,le);if(ti===null){je===null&&(je=Ke);break}r&&je&&ti.alternate===null&&a(H,je),$=v(ti,$,Ie),rt===null?Ne=ti:rt.sibling=ti,rt=ti,je=Ke}if(at.done)return s(H,je),Ye&&Xr(H,Ie),Ne;if(je===null){for(;!at.done;Ie++,at=Q.next())at=se(H,at.value,le),at!==null&&($=v(at,$,Ie),rt===null?Ne=at:rt.sibling=at,rt=at);return Ye&&Xr(H,Ie),Ne}for(je=c(je);!at.done;Ie++,at=Q.next())at=X(je,H,Ie,at.value,le),at!==null&&(r&&at.alternate!==null&&je.delete(at.key===null?Ie:at.key),$=v(at,$,Ie),rt===null?Ne=at:rt.sibling=at,rt=at);return r&&je.forEach(function(vN){return a(H,vN)}),Ye&&Xr(H,Ie),Ne}function pt(H,$,Q,le){if(typeof Q=="object"&&Q!==null&&Q.type===j&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:e:{for(var Ne=Q.key;$!==null;){if($.key===Ne){if(Ne=Q.type,Ne===j){if($.tag===7){s(H,$.sibling),le=p($,Q.props.children),le.return=H,H=le;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Z&&Zi(Ne)===$.type){s(H,$.sibling),le=p($,Q.props),fo(le,Q),le.return=H,H=le;break e}s(H,$);break}else a(H,$);$=$.sibling}Q.type===j?(le=Pi(Q.props.children,H.mode,le,Q.key),le.return=H,H=le):(le=Zu(Q.type,Q.key,Q.props,null,H.mode,le),fo(le,Q),le.return=H,H=le)}return w(H);case k:e:{for(Ne=Q.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===Q.containerInfo&&$.stateNode.implementation===Q.implementation){s(H,$.sibling),le=p($,Q.children||[]),le.return=H,H=le;break e}else{s(H,$);break}else a(H,$);$=$.sibling}le=Df(Q,H.mode,le),le.return=H,H=le}return w(H);case Z:return Q=Zi(Q),pt(H,$,Q,le)}if(W(Q))return Se(H,$,Q,le);if(re(Q)){if(Ne=re(Q),typeof Ne!="function")throw Error(i(150));return Q=Ne.call(Q),ze(H,$,Q,le)}if(typeof Q.then=="function")return pt(H,$,Ju(Q),le);if(Q.$$typeof===O)return pt(H,$,Gu(H,Q),le);Wu(H,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,$!==null&&$.tag===6?(s(H,$.sibling),le=p($,Q),le.return=H,H=le):(s(H,$),le=Of(Q,H.mode,le),le.return=H,H=le),w(H)):s(H,$)}return function(H,$,Q,le){try{co=0;var Ne=pt(H,$,Q,le);return Hl=null,Ne}catch(je){if(je===ql||je===Yu)throw je;var rt=Fn(29,je,null,H.mode);return rt.lanes=le,rt.return=H,rt}finally{}}}var Qi=dv(!0),fv=dv(!1),Ia=!1;function Vf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qf(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Ba(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Pa(r,a,s){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(it&2)!==0){var p=c.pending;return p===null?a.next=a:(a.next=p.next,p.next=a),c.pending=a,a=Hu(r),Ky(r,null,s),a}return qu(r,c,a,s),Hu(r)}function ho(r,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var c=a.lanes;c&=r.pendingLanes,s|=c,a.lanes=s,oe(r,s)}}function Gf(r,a){var s=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var w={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=w:v=v.next=w,s=s.next}while(s!==null);v===null?p=v=a:v=v.next=a}else p=v=a;s={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=a:r.next=a,s.lastBaseUpdate=a}var Kf=!1;function mo(){if(Kf){var r=Fl;if(r!==null)throw r}}function po(r,a,s,c){Kf=!1;var p=r.updateQueue;Ia=!1;var v=p.firstBaseUpdate,w=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var M=_,G=M.next;M.next=null,w===null?v=G:w.next=G,w=M;var te=r.alternate;te!==null&&(te=te.updateQueue,_=te.lastBaseUpdate,_!==w&&(_===null?te.firstBaseUpdate=G:_.next=G,te.lastBaseUpdate=M))}if(v!==null){var se=p.baseState;w=0,te=G=M=null,_=v;do{var K=_.lane&-536870913,X=K!==_.lane;if(X?(Ge&K)===K:(c&K)===K){K!==0&&K===$l&&(Kf=!0),te!==null&&(te=te.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Se=r,ze=_;K=a;var pt=s;switch(ze.tag){case 1:if(Se=ze.payload,typeof Se=="function"){se=Se.call(pt,se,K);break e}se=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=ze.payload,K=typeof Se=="function"?Se.call(pt,se,K):Se,K==null)break e;se=g({},se,K);break e;case 2:Ia=!0}}K=_.callback,K!==null&&(r.flags|=64,X&&(r.flags|=8192),X=p.callbacks,X===null?p.callbacks=[K]:X.push(K))}else X={lane:K,tag:_.tag,payload:_.payload,callback:_.callback,next:null},te===null?(G=te=X,M=se):te=te.next=X,w|=K;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;X=_,_=X.next,X.next=null,p.lastBaseUpdate=X,p.shared.pending=null}}while(!0);te===null&&(M=se),p.baseState=M,p.firstBaseUpdate=G,p.lastBaseUpdate=te,v===null&&(p.shared.lanes=0),Za|=w,r.lanes=w,r.memoizedState=se}}function hv(r,a){if(typeof r!="function")throw Error(i(191,r));r.call(a)}function mv(r,a){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)hv(s[r],a)}var Zl=L(null),ec=L(0);function pv(r,a){r=oa,C(ec,r),C(Zl,a),oa=r|a.baseLanes}function Yf(){C(ec,oa),C(Zl,Zl.current)}function Xf(){oa=ec.current,A(Zl),A(ec)}var qn=L(null),ur=null;function $a(r){var a=r.alternate;C(Mt,Mt.current&1),C(qn,r),ur===null&&(a===null||Zl.current!==null||a.memoizedState!==null)&&(ur=r)}function Jf(r){C(Mt,Mt.current),C(qn,r),ur===null&&(ur=r)}function gv(r){r.tag===22?(C(Mt,Mt.current),C(qn,r),ur===null&&(ur=r)):Fa()}function Fa(){C(Mt,Mt.current),C(qn,qn.current)}function Hn(r){A(qn),ur===r&&(ur=null),A(Mt)}var Mt=L(0);function tc(r){for(var a=r;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||am(s)||im(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var ea=0,Ue=null,ht=null,It=null,nc=!1,Vl=!1,Gi=!1,rc=0,go=0,Ql=null,o_=0;function Rt(){throw Error(i(321))}function Wf(r,a){if(a===null)return!1;for(var s=0;s<a.length&&s<r.length;s++)if(!$n(r[s],a[s]))return!1;return!0}function eh(r,a,s,c,p,v){return ea=v,Ue=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,P.H=r===null||r.memoizedState===null?Wv:ph,Gi=!1,v=s(c,p),Gi=!1,Vl&&(v=vv(a,s,c,p)),yv(r),v}function yv(r){P.H=bo;var a=ht!==null&&ht.next!==null;if(ea=0,It=ht=Ue=null,nc=!1,go=0,Ql=null,a)throw Error(i(300));r===null||Bt||(r=r.dependencies,r!==null&&Qu(r)&&(Bt=!0))}function vv(r,a,s,c){Ue=r;var p=0;do{if(Vl&&(Ql=null),go=0,Vl=!1,25<=p)throw Error(i(301));if(p+=1,It=ht=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}P.H=eb,v=a(s,c)}while(Vl);return v}function u_(){var r=P.H,a=r.useState()[0];return a=typeof a.then=="function"?yo(a):a,r=r.useState()[0],(ht!==null?ht.memoizedState:null)!==r&&(Ue.flags|=1024),a}function th(){var r=rc!==0;return rc=0,r}function nh(r,a,s){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~s}function rh(r){if(nc){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}nc=!1}ea=0,It=ht=Ue=null,Vl=!1,go=rc=0,Ql=null}function gn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?Ue.memoizedState=It=r:It=It.next=r,It}function Lt(){if(ht===null){var r=Ue.alternate;r=r!==null?r.memoizedState:null}else r=ht.next;var a=It===null?Ue.memoizedState:It.next;if(a!==null)It=a,ht=r;else{if(r===null)throw Ue.alternate===null?Error(i(467)):Error(i(310));ht=r,r={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},It===null?Ue.memoizedState=It=r:It=It.next=r}return It}function ac(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yo(r){var a=go;return go+=1,Ql===null&&(Ql=[]),r=ov(Ql,r,a),a=Ue,(It===null?a.memoizedState:It.next)===null&&(a=a.alternate,P.H=a===null||a.memoizedState===null?Wv:ph),r}function ic(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return yo(r);if(r.$$typeof===O)return sn(r)}throw Error(i(438,String(r)))}function ah(r){var a=null,s=Ue.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var c=Ue.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(p){return p.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=ac(),Ue.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(r),c=0;c<r;c++)s[c]=q;return a.index++,s}function ta(r,a){return typeof a=="function"?a(r):a}function lc(r){var a=Lt();return ih(a,ht,r)}function ih(r,a,s){var c=r.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=s;var p=r.baseQueue,v=c.pending;if(v!==null){if(p!==null){var w=p.next;p.next=v.next,v.next=w}a.baseQueue=p=v,c.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{a=p.next;var _=w=null,M=null,G=a,te=!1;do{var se=G.lane&-536870913;if(se!==G.lane?(Ge&se)===se:(ea&se)===se){var K=G.revertLane;if(K===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),se===$l&&(te=!0);else if((ea&K)===K){G=G.next,K===$l&&(te=!0);continue}else se={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},M===null?(_=M=se,w=v):M=M.next=se,Ue.lanes|=K,Za|=K;se=G.action,Gi&&s(v,se),v=G.hasEagerState?G.eagerState:s(v,se)}else K={lane:se,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},M===null?(_=M=K,w=v):M=M.next=K,Ue.lanes|=se,Za|=se;G=G.next}while(G!==null&&G!==a);if(M===null?w=v:M.next=_,!$n(v,r.memoizedState)&&(Bt=!0,te&&(s=Fl,s!==null)))throw s;r.memoizedState=v,r.baseState=w,r.baseQueue=M,c.lastRenderedState=v}return p===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function lh(r){var a=Lt(),s=a.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=r;var c=s.dispatch,p=s.pending,v=a.memoizedState;if(p!==null){s.pending=null;var w=p=p.next;do v=r(v,w.action),w=w.next;while(w!==p);$n(v,a.memoizedState)||(Bt=!0),a.memoizedState=v,a.baseQueue===null&&(a.baseState=v),s.lastRenderedState=v}return[v,c]}function bv(r,a,s){var c=Ue,p=Lt(),v=Ye;if(v){if(s===void 0)throw Error(i(407));s=s()}else s=a();var w=!$n((ht||p).memoizedState,s);if(w&&(p.memoizedState=s,Bt=!0),p=p.queue,uh(wv.bind(null,c,p,r),[r]),p.getSnapshot!==a||w||It!==null&&It.memoizedState.tag&1){if(c.flags|=2048,Gl(9,{destroy:void 0},Sv.bind(null,c,p,s,a),null),gt===null)throw Error(i(349));v||(ea&127)!==0||xv(c,a,s)}return s}function xv(r,a,s){r.flags|=16384,r={getSnapshot:a,value:s},a=Ue.updateQueue,a===null?(a=ac(),Ue.updateQueue=a,a.stores=[r]):(s=a.stores,s===null?a.stores=[r]:s.push(r))}function Sv(r,a,s,c){a.value=s,a.getSnapshot=c,kv(a)&&jv(r)}function wv(r,a,s){return s(function(){kv(a)&&jv(r)})}function kv(r){var a=r.getSnapshot;r=r.value;try{var s=a();return!$n(r,s)}catch{return!0}}function jv(r){var a=Bi(r,2);a!==null&&Nn(a,r,2)}function sh(r){var a=gn();if(typeof r=="function"){var s=r;if(r=s(),Gi){dn(!0);try{s()}finally{dn(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:r},a}function Ev(r,a,s,c){return r.baseState=s,ih(r,ht,typeof c=="function"?c:ta)}function c_(r,a,s,c,p){if(uc(r))throw Error(i(485));if(r=a.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};P.T!==null?s(!0):v.isTransition=!1,c(v),s=a.pending,s===null?(v.next=a.pending=v,Cv(a,v)):(v.next=s.next,a.pending=s.next=v)}}function Cv(r,a){var s=a.action,c=a.payload,p=r.state;if(a.isTransition){var v=P.T,w={};P.T=w;try{var _=s(p,c),M=P.S;M!==null&&M(w,_),_v(r,a,_)}catch(G){oh(r,a,G)}finally{v!==null&&w.types!==null&&(v.types=w.types),P.T=v}}else try{v=s(p,c),_v(r,a,v)}catch(G){oh(r,a,G)}}function _v(r,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(c){Nv(r,a,c)},function(c){return oh(r,a,c)}):Nv(r,a,s)}function Nv(r,a,s){a.status="fulfilled",a.value=s,Av(a),r.state=s,a=r.pending,a!==null&&(s=a.next,s===a?r.pending=null:(s=s.next,a.next=s,Cv(r,s)))}function oh(r,a,s){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=s,Av(a),a=a.next;while(a!==c)}r.action=null}function Av(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function Tv(r,a){return a}function Rv(r,a){if(Ye){var s=gt.formState;if(s!==null){e:{var c=Ue;if(Ye){if(wt){t:{for(var p=wt,v=or;p.nodeType!==8;){if(!v){p=null;break t}if(p=cr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){wt=cr(p.nextSibling),c=p.data==="F!";break e}}La(c)}c=!1}c&&(a=s[0])}}return s=gn(),s.memoizedState=s.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tv,lastRenderedState:a},s.queue=c,s=Yv.bind(null,Ue,c),c.dispatch=s,c=sh(!1),v=mh.bind(null,Ue,!1,c.queue),c=gn(),p={state:a,dispatch:null,action:r,pending:null},c.queue=p,s=c_.bind(null,Ue,p,v,s),p.dispatch=s,c.memoizedState=r,[a,s,!1]}function zv(r){var a=Lt();return Ov(a,ht,r)}function Ov(r,a,s){if(a=ih(r,a,Tv)[0],r=lc(ta)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var c=yo(a)}catch(w){throw w===ql?Yu:w}else c=a;a=Lt();var p=a.queue,v=p.dispatch;return s!==a.memoizedState&&(Ue.flags|=2048,Gl(9,{destroy:void 0},d_.bind(null,p,s),null)),[c,v,r]}function d_(r,a){r.action=a}function Dv(r){var a=Lt(),s=ht;if(s!==null)return Ov(a,s,r);Lt(),a=a.memoizedState,s=Lt();var c=s.queue.dispatch;return s.memoizedState=r,[a,c,!1]}function Gl(r,a,s,c){return r={tag:r,create:s,deps:c,inst:a,next:null},a=Ue.updateQueue,a===null&&(a=ac(),Ue.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=r.next=r:(c=s.next,s.next=r,r.next=c,a.lastEffect=r),r}function Mv(){return Lt().memoizedState}function sc(r,a,s,c){var p=gn();Ue.flags|=r,p.memoizedState=Gl(1|a,{destroy:void 0},s,c===void 0?null:c)}function oc(r,a,s,c){var p=Lt();c=c===void 0?null:c;var v=p.memoizedState.inst;ht!==null&&c!==null&&Wf(c,ht.memoizedState.deps)?p.memoizedState=Gl(a,v,s,c):(Ue.flags|=r,p.memoizedState=Gl(1|a,v,s,c))}function Lv(r,a){sc(8390656,8,r,a)}function uh(r,a){oc(2048,8,r,a)}function f_(r){Ue.flags|=4;var a=Ue.updateQueue;if(a===null)a=ac(),Ue.updateQueue=a,a.events=[r];else{var s=a.events;s===null?a.events=[r]:s.push(r)}}function Uv(r){var a=Lt().memoizedState;return f_({ref:a,nextImpl:r}),function(){if((it&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}function Iv(r,a){return oc(4,2,r,a)}function Bv(r,a){return oc(4,4,r,a)}function Pv(r,a){if(typeof a=="function"){r=r();var s=a(r);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function $v(r,a,s){s=s!=null?s.concat([r]):null,oc(4,4,Pv.bind(null,a,r),s)}function ch(){}function Fv(r,a){var s=Lt();a=a===void 0?null:a;var c=s.memoizedState;return a!==null&&Wf(a,c[1])?c[0]:(s.memoizedState=[r,a],r)}function qv(r,a){var s=Lt();a=a===void 0?null:a;var c=s.memoizedState;if(a!==null&&Wf(a,c[1]))return c[0];if(c=r(),Gi){dn(!0);try{r()}finally{dn(!1)}}return s.memoizedState=[c,a],c}function dh(r,a,s){return s===void 0||(ea&1073741824)!==0&&(Ge&261930)===0?r.memoizedState=a:(r.memoizedState=s,r=Hb(),Ue.lanes|=r,Za|=r,s)}function Hv(r,a,s,c){return $n(s,a)?s:Zl.current!==null?(r=dh(r,s,c),$n(r,a)||(Bt=!0),r):(ea&42)===0||(ea&1073741824)!==0&&(Ge&261930)===0?(Bt=!0,r.memoizedState=s):(r=Hb(),Ue.lanes|=r,Za|=r,a)}function Zv(r,a,s,c,p){var v=V.p;V.p=v!==0&&8>v?v:8;var w=P.T,_={};P.T=_,mh(r,!1,a,s);try{var M=p(),G=P.S;if(G!==null&&G(_,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var te=s_(M,c);vo(r,a,te,Qn(r))}else vo(r,a,c,Qn(r))}catch(se){vo(r,a,{then:function(){},status:"rejected",reason:se},Qn())}finally{V.p=v,w!==null&&_.types!==null&&(w.types=_.types),P.T=w}}function h_(){}function fh(r,a,s,c){if(r.tag!==5)throw Error(i(476));var p=Vv(r).queue;Zv(r,p,a,ce,s===null?h_:function(){return Qv(r),s(c)})}function Vv(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:ce},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:s},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function Qv(r){var a=Vv(r);a.next===null&&(a=r.alternate.memoizedState),vo(r,a.next.queue,{},Qn())}function hh(){return sn(Mo)}function Gv(){return Lt().memoizedState}function Kv(){return Lt().memoizedState}function m_(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var s=Qn();r=Ba(s);var c=Pa(a,r,s);c!==null&&(Nn(c,a,s),ho(c,a,s)),a={cache:Ff()},r.payload=a;return}a=a.return}}function p_(r,a,s){var c=Qn();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},uc(r)?Xv(a,s):(s=Rf(r,a,s,c),s!==null&&(Nn(s,r,c),Jv(s,a,c)))}function Yv(r,a,s){var c=Qn();vo(r,a,s,c)}function vo(r,a,s,c){var p={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(uc(r))Xv(a,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=a.lastRenderedReducer,v!==null))try{var w=a.lastRenderedState,_=v(w,s);if(p.hasEagerState=!0,p.eagerState=_,$n(_,w))return qu(r,a,p,0),gt===null&&Fu(),!1}catch{}finally{}if(s=Rf(r,a,p,c),s!==null)return Nn(s,r,c),Jv(s,a,c),!0}return!1}function mh(r,a,s,c){if(c={lane:2,revertLane:Vh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},uc(r)){if(a)throw Error(i(479))}else a=Rf(r,s,c,2),a!==null&&Nn(a,r,2)}function uc(r){var a=r.alternate;return r===Ue||a!==null&&a===Ue}function Xv(r,a){Vl=nc=!0;var s=r.pending;s===null?a.next=a:(a.next=s.next,s.next=a),r.pending=a}function Jv(r,a,s){if((s&4194048)!==0){var c=a.lanes;c&=r.pendingLanes,s|=c,a.lanes=s,oe(r,s)}}var bo={readContext:sn,use:ic,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};bo.useEffectEvent=Rt;var Wv={readContext:sn,use:ic,useCallback:function(r,a){return gn().memoizedState=[r,a===void 0?null:a],r},useContext:sn,useEffect:Lv,useImperativeHandle:function(r,a,s){s=s!=null?s.concat([r]):null,sc(4194308,4,Pv.bind(null,a,r),s)},useLayoutEffect:function(r,a){return sc(4194308,4,r,a)},useInsertionEffect:function(r,a){sc(4,2,r,a)},useMemo:function(r,a){var s=gn();a=a===void 0?null:a;var c=r();if(Gi){dn(!0);try{r()}finally{dn(!1)}}return s.memoizedState=[c,a],c},useReducer:function(r,a,s){var c=gn();if(s!==void 0){var p=s(a);if(Gi){dn(!0);try{s(a)}finally{dn(!1)}}}else p=a;return c.memoizedState=c.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},c.queue=r,r=r.dispatch=p_.bind(null,Ue,r),[c.memoizedState,r]},useRef:function(r){var a=gn();return r={current:r},a.memoizedState=r},useState:function(r){r=sh(r);var a=r.queue,s=Yv.bind(null,Ue,a);return a.dispatch=s,[r.memoizedState,s]},useDebugValue:ch,useDeferredValue:function(r,a){var s=gn();return dh(s,r,a)},useTransition:function(){var r=sh(!1);return r=Zv.bind(null,Ue,r.queue,!0,!1),gn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,s){var c=Ue,p=gn();if(Ye){if(s===void 0)throw Error(i(407));s=s()}else{if(s=a(),gt===null)throw Error(i(349));(Ge&127)!==0||xv(c,a,s)}p.memoizedState=s;var v={value:s,getSnapshot:a};return p.queue=v,Lv(wv.bind(null,c,v,r),[r]),c.flags|=2048,Gl(9,{destroy:void 0},Sv.bind(null,c,v,s,a),null),s},useId:function(){var r=gn(),a=gt.identifierPrefix;if(Ye){var s=Rr,c=Tr;s=(c&~(1<<32-ut(c)-1)).toString(32)+s,a="_"+a+"R_"+s,s=rc++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=o_++,a="_"+a+"r_"+s.toString(32)+"_";return r.memoizedState=a},useHostTransitionStatus:hh,useFormState:Rv,useActionState:Rv,useOptimistic:function(r){var a=gn();a.memoizedState=a.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=mh.bind(null,Ue,!0,s),s.dispatch=a,[r,a]},useMemoCache:ah,useCacheRefresh:function(){return gn().memoizedState=m_.bind(null,Ue)},useEffectEvent:function(r){var a=gn(),s={impl:r};return a.memoizedState=s,function(){if((it&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}},ph={readContext:sn,use:ic,useCallback:Fv,useContext:sn,useEffect:uh,useImperativeHandle:$v,useInsertionEffect:Iv,useLayoutEffect:Bv,useMemo:qv,useReducer:lc,useRef:Mv,useState:function(){return lc(ta)},useDebugValue:ch,useDeferredValue:function(r,a){var s=Lt();return Hv(s,ht.memoizedState,r,a)},useTransition:function(){var r=lc(ta)[0],a=Lt().memoizedState;return[typeof r=="boolean"?r:yo(r),a]},useSyncExternalStore:bv,useId:Gv,useHostTransitionStatus:hh,useFormState:zv,useActionState:zv,useOptimistic:function(r,a){var s=Lt();return Ev(s,ht,r,a)},useMemoCache:ah,useCacheRefresh:Kv};ph.useEffectEvent=Uv;var eb={readContext:sn,use:ic,useCallback:Fv,useContext:sn,useEffect:uh,useImperativeHandle:$v,useInsertionEffect:Iv,useLayoutEffect:Bv,useMemo:qv,useReducer:lh,useRef:Mv,useState:function(){return lh(ta)},useDebugValue:ch,useDeferredValue:function(r,a){var s=Lt();return ht===null?dh(s,r,a):Hv(s,ht.memoizedState,r,a)},useTransition:function(){var r=lh(ta)[0],a=Lt().memoizedState;return[typeof r=="boolean"?r:yo(r),a]},useSyncExternalStore:bv,useId:Gv,useHostTransitionStatus:hh,useFormState:Dv,useActionState:Dv,useOptimistic:function(r,a){var s=Lt();return ht!==null?Ev(s,ht,r,a):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:ah,useCacheRefresh:Kv};eb.useEffectEvent=Uv;function gh(r,a,s,c){a=r.memoizedState,s=s(c,a),s=s==null?a:g({},a,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var yh={enqueueSetState:function(r,a,s){r=r._reactInternals;var c=Qn(),p=Ba(c);p.payload=a,s!=null&&(p.callback=s),a=Pa(r,p,c),a!==null&&(Nn(a,r,c),ho(a,r,c))},enqueueReplaceState:function(r,a,s){r=r._reactInternals;var c=Qn(),p=Ba(c);p.tag=1,p.payload=a,s!=null&&(p.callback=s),a=Pa(r,p,c),a!==null&&(Nn(a,r,c),ho(a,r,c))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var s=Qn(),c=Ba(s);c.tag=2,a!=null&&(c.callback=a),a=Pa(r,c,s),a!==null&&(Nn(a,r,s),ho(a,r,s))}};function tb(r,a,s,c,p,v,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,v,w):a.prototype&&a.prototype.isPureReactComponent?!ao(s,c)||!ao(p,v):!0}function nb(r,a,s,c){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,c),a.state!==r&&yh.enqueueReplaceState(a,a.state,null)}function Ki(r,a){var s=a;if("ref"in a){s={};for(var c in a)c!=="ref"&&(s[c]=a[c])}if(r=r.defaultProps){s===a&&(s=g({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function rb(r){$u(r)}function ab(r){console.error(r)}function ib(r){$u(r)}function cc(r,a){try{var s=r.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function lb(r,a,s){try{var c=r.onCaughtError;c(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function vh(r,a,s){return s=Ba(s),s.tag=3,s.payload={element:null},s.callback=function(){cc(r,a)},s}function sb(r){return r=Ba(r),r.tag=3,r}function ob(r,a,s,c){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=c.value;r.payload=function(){return p(v)},r.callback=function(){lb(a,s,c)}}var w=s.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){lb(a,s,c),typeof p!="function"&&(Va===null?Va=new Set([this]):Va.add(this));var _=c.stack;this.componentDidCatch(c.value,{componentStack:_!==null?_:""})})}function g_(r,a,s,c,p){if(s.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(a=s.alternate,a!==null&&Pl(a,s,p,!0),s=qn.current,s!==null){switch(s.tag){case 31:case 13:return ur===null?wc():s.alternate===null&&zt===0&&(zt=3),s.flags&=-257,s.flags|=65536,s.lanes=p,c===Xu?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([c]):a.add(c),qh(r,c,p)),!1;case 22:return s.flags|=65536,c===Xu?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([c]):s.add(c)),qh(r,c,p)),!1}throw Error(i(435,s.tag))}return qh(r,c,p),wc(),!1}if(Ye)return a=qn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=p,c!==Uf&&(r=Error(i(422),{cause:c}),so(ir(r,s)))):(c!==Uf&&(a=Error(i(423),{cause:c}),so(ir(a,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,c=ir(c,s),p=vh(r.stateNode,c,p),Gf(r,p),zt!==4&&(zt=2)),!1;var v=Error(i(520),{cause:c});if(v=ir(v,s),_o===null?_o=[v]:_o.push(v),zt!==4&&(zt=2),a===null)return!0;c=ir(c,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=vh(s.stateNode,c,r),Gf(s,r),!1;case 1:if(a=s.type,v=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Va===null||!Va.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=sb(p),ob(p,r,s,c),Gf(s,p),!1}s=s.return}while(s!==null);return!1}var bh=Error(i(461)),Bt=!1;function on(r,a,s,c){a.child=r===null?fv(a,null,s,c):Qi(a,r.child,s,c)}function ub(r,a,s,c,p){s=s.render;var v=a.ref;if("ref"in c){var w={};for(var _ in c)_!=="ref"&&(w[_]=c[_])}else w=c;return qi(a),c=eh(r,a,s,w,v,p),_=th(),r!==null&&!Bt?(nh(r,a,p),na(r,a,p)):(Ye&&_&&Mf(a),a.flags|=1,on(r,a,c,p),a.child)}function cb(r,a,s,c,p){if(r===null){var v=s.type;return typeof v=="function"&&!zf(v)&&v.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=v,db(r,a,v,c,p)):(r=Zu(s.type,null,c,a,a.mode,p),r.ref=a.ref,r.return=a,a.child=r)}if(v=r.child,!_h(r,p)){var w=v.memoizedProps;if(s=s.compare,s=s!==null?s:ao,s(w,c)&&r.ref===a.ref)return na(r,a,p)}return a.flags|=1,r=Yr(v,c),r.ref=a.ref,r.return=a,a.child=r}function db(r,a,s,c,p){if(r!==null){var v=r.memoizedProps;if(ao(v,c)&&r.ref===a.ref)if(Bt=!1,a.pendingProps=c=v,_h(r,p))(r.flags&131072)!==0&&(Bt=!0);else return a.lanes=r.lanes,na(r,a,p)}return xh(r,a,s,c,p)}function fb(r,a,s,c){var p=c.children,v=r!==null?r.memoizedState:null;if(r===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((a.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(c=a.child=r.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~v}else c=0,a.child=null;return hb(r,a,v,s,c)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&Ku(a,v!==null?v.cachePool:null),v!==null?pv(a,v):Yf(),gv(a);else return c=a.lanes=536870912,hb(r,a,v!==null?v.baseLanes|s:s,s,c)}else v!==null?(Ku(a,v.cachePool),pv(a,v),Fa(),a.memoizedState=null):(r!==null&&Ku(a,null),Yf(),Fa());return on(r,a,p,s),a.child}function xo(r,a){return r!==null&&r.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function hb(r,a,s,c,p){var v=Hf();return v=v===null?null:{parent:Ut._currentValue,pool:v},a.memoizedState={baseLanes:s,cachePool:v},r!==null&&Ku(a,null),Yf(),gv(a),r!==null&&Pl(r,a,c,!0),a.childLanes=p,null}function dc(r,a){return a=hc({mode:a.mode,children:a.children},r.mode),a.ref=r.ref,r.child=a,a.return=r,a}function mb(r,a,s){return Qi(a,r.child,null,s),r=dc(a,a.pendingProps),r.flags|=2,Hn(a),a.memoizedState=null,r}function y_(r,a,s){var c=a.pendingProps,p=(a.flags&128)!==0;if(a.flags&=-129,r===null){if(Ye){if(c.mode==="hidden")return r=dc(a,c),a.lanes=536870912,xo(null,r);if(Jf(a),(r=wt)?(r=Cx(r,or),r=r!==null&&r.data==="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Da!==null?{id:Tr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},s=Xy(r),s.return=a,a.child=s,ln=a,wt=null)):r=null,r===null)throw La(a);return a.lanes=536870912,null}return dc(a,c)}var v=r.memoizedState;if(v!==null){var w=v.dehydrated;if(Jf(a),p)if(a.flags&256)a.flags&=-257,a=mb(r,a,s);else if(a.memoizedState!==null)a.child=r.child,a.flags|=128,a=null;else throw Error(i(558));else if(Bt||Pl(r,a,s,!1),p=(s&r.childLanes)!==0,Bt||p){if(c=gt,c!==null&&(w=He(c,s),w!==0&&w!==v.retryLane))throw v.retryLane=w,Bi(r,w),Nn(c,r,w),bh;wc(),a=mb(r,a,s)}else r=v.treeContext,wt=cr(w.nextSibling),ln=a,Ye=!0,Ma=null,or=!1,r!==null&&ev(a,r),a=dc(a,c),a.flags|=4096;return a}return r=Yr(r.child,{mode:c.mode,children:c.children}),r.ref=a.ref,a.child=r,r.return=a,r}function fc(r,a){var s=a.ref;if(s===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(i(284));(r===null||r.ref!==s)&&(a.flags|=4194816)}}function xh(r,a,s,c,p){return qi(a),s=eh(r,a,s,c,void 0,p),c=th(),r!==null&&!Bt?(nh(r,a,p),na(r,a,p)):(Ye&&c&&Mf(a),a.flags|=1,on(r,a,s,p),a.child)}function pb(r,a,s,c,p,v){return qi(a),a.updateQueue=null,s=vv(a,c,s,p),yv(r),c=th(),r!==null&&!Bt?(nh(r,a,v),na(r,a,v)):(Ye&&c&&Mf(a),a.flags|=1,on(r,a,s,v),a.child)}function gb(r,a,s,c,p){if(qi(a),a.stateNode===null){var v=Ll,w=s.contextType;typeof w=="object"&&w!==null&&(v=sn(w)),v=new s(c,v),a.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=yh,a.stateNode=v,v._reactInternals=a,v=a.stateNode,v.props=c,v.state=a.memoizedState,v.refs={},Vf(a),w=s.contextType,v.context=typeof w=="object"&&w!==null?sn(w):Ll,v.state=a.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(gh(a,s,w,c),v.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&yh.enqueueReplaceState(v,v.state,null),po(a,c,v,p),mo(),v.state=a.memoizedState),typeof v.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(r===null){v=a.stateNode;var _=a.memoizedProps,M=Ki(s,_);v.props=M;var G=v.context,te=s.contextType;w=Ll,typeof te=="object"&&te!==null&&(w=sn(te));var se=s.getDerivedStateFromProps;te=typeof se=="function"||typeof v.getSnapshotBeforeUpdate=="function",_=a.pendingProps!==_,te||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(_||G!==w)&&nb(a,v,c,w),Ia=!1;var K=a.memoizedState;v.state=K,po(a,c,v,p),mo(),G=a.memoizedState,_||K!==G||Ia?(typeof se=="function"&&(gh(a,s,se,c),G=a.memoizedState),(M=Ia||tb(a,s,M,c,K,G,w))?(te||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(a.flags|=4194308)):(typeof v.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=G),v.props=c,v.state=G,v.context=w,c=M):(typeof v.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{v=a.stateNode,Qf(r,a),w=a.memoizedProps,te=Ki(s,w),v.props=te,se=a.pendingProps,K=v.context,G=s.contextType,M=Ll,typeof G=="object"&&G!==null&&(M=sn(G)),_=s.getDerivedStateFromProps,(G=typeof _=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==se||K!==M)&&nb(a,v,c,M),Ia=!1,K=a.memoizedState,v.state=K,po(a,c,v,p),mo();var X=a.memoizedState;w!==se||K!==X||Ia||r!==null&&r.dependencies!==null&&Qu(r.dependencies)?(typeof _=="function"&&(gh(a,s,_,c),X=a.memoizedState),(te=Ia||tb(a,s,te,c,K,X,M)||r!==null&&r.dependencies!==null&&Qu(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,X,M),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,X,M)),typeof v.componentDidUpdate=="function"&&(a.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(a.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=X),v.props=c,v.state=X,v.context=M,c=te):(typeof v.componentDidUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(a.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&K===r.memoizedState||(a.flags|=1024),c=!1)}return v=c,fc(r,a),c=(a.flags&128)!==0,v||c?(v=a.stateNode,s=c&&typeof s.getDerivedStateFromError!="function"?null:v.render(),a.flags|=1,r!==null&&c?(a.child=Qi(a,r.child,null,p),a.child=Qi(a,null,s,p)):on(r,a,s,p),a.memoizedState=v.state,r=a.child):r=na(r,a,p),r}function yb(r,a,s,c){return $i(),a.flags|=256,on(r,a,s,c),a.child}var Sh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wh(r){return{baseLanes:r,cachePool:lv()}}function kh(r,a,s){return r=r!==null?r.childLanes&~s:0,a&&(r|=Vn),r}function vb(r,a,s){var c=a.pendingProps,p=!1,v=(a.flags&128)!==0,w;if((w=v)||(w=r!==null&&r.memoizedState===null?!1:(Mt.current&2)!==0),w&&(p=!0,a.flags&=-129),w=(a.flags&32)!==0,a.flags&=-33,r===null){if(Ye){if(p?$a(a):Fa(),(r=wt)?(r=Cx(r,or),r=r!==null&&r.data!=="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Da!==null?{id:Tr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},s=Xy(r),s.return=a,a.child=s,ln=a,wt=null)):r=null,r===null)throw La(a);return im(r)?a.lanes=32:a.lanes=536870912,null}var _=c.children;return c=c.fallback,p?(Fa(),p=a.mode,_=hc({mode:"hidden",children:_},p),c=Pi(c,p,s,null),_.return=a,c.return=a,_.sibling=c,a.child=_,c=a.child,c.memoizedState=wh(s),c.childLanes=kh(r,w,s),a.memoizedState=Sh,xo(null,c)):($a(a),jh(a,_))}var M=r.memoizedState;if(M!==null&&(_=M.dehydrated,_!==null)){if(v)a.flags&256?($a(a),a.flags&=-257,a=Eh(r,a,s)):a.memoizedState!==null?(Fa(),a.child=r.child,a.flags|=128,a=null):(Fa(),_=c.fallback,p=a.mode,c=hc({mode:"visible",children:c.children},p),_=Pi(_,p,s,null),_.flags|=2,c.return=a,_.return=a,c.sibling=_,a.child=c,Qi(a,r.child,null,s),c=a.child,c.memoizedState=wh(s),c.childLanes=kh(r,w,s),a.memoizedState=Sh,a=xo(null,c));else if($a(a),im(_)){if(w=_.nextSibling&&_.nextSibling.dataset,w)var G=w.dgst;w=G,c=Error(i(419)),c.stack="",c.digest=w,so({value:c,source:null,stack:null}),a=Eh(r,a,s)}else if(Bt||Pl(r,a,s,!1),w=(s&r.childLanes)!==0,Bt||w){if(w=gt,w!==null&&(c=He(w,s),c!==0&&c!==M.retryLane))throw M.retryLane=c,Bi(r,c),Nn(w,r,c),bh;am(_)||wc(),a=Eh(r,a,s)}else am(_)?(a.flags|=192,a.child=r.child,a=null):(r=M.treeContext,wt=cr(_.nextSibling),ln=a,Ye=!0,Ma=null,or=!1,r!==null&&ev(a,r),a=jh(a,c.children),a.flags|=4096);return a}return p?(Fa(),_=c.fallback,p=a.mode,M=r.child,G=M.sibling,c=Yr(M,{mode:"hidden",children:c.children}),c.subtreeFlags=M.subtreeFlags&65011712,G!==null?_=Yr(G,_):(_=Pi(_,p,s,null),_.flags|=2),_.return=a,c.return=a,c.sibling=_,a.child=c,xo(null,c),c=a.child,_=r.child.memoizedState,_===null?_=wh(s):(p=_.cachePool,p!==null?(M=Ut._currentValue,p=p.parent!==M?{parent:M,pool:M}:p):p=lv(),_={baseLanes:_.baseLanes|s,cachePool:p}),c.memoizedState=_,c.childLanes=kh(r,w,s),a.memoizedState=Sh,xo(r.child,c)):($a(a),s=r.child,r=s.sibling,s=Yr(s,{mode:"visible",children:c.children}),s.return=a,s.sibling=null,r!==null&&(w=a.deletions,w===null?(a.deletions=[r],a.flags|=16):w.push(r)),a.child=s,a.memoizedState=null,s)}function jh(r,a){return a=hc({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function hc(r,a){return r=Fn(22,r,null,a),r.lanes=0,r}function Eh(r,a,s){return Qi(a,r.child,null,s),r=jh(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function bb(r,a,s){r.lanes|=a;var c=r.alternate;c!==null&&(c.lanes|=a),Pf(r.return,a,s)}function Ch(r,a,s,c,p,v){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:s,tailMode:p,treeForkCount:v}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=s,w.tailMode=p,w.treeForkCount=v)}function xb(r,a,s){var c=a.pendingProps,p=c.revealOrder,v=c.tail;c=c.children;var w=Mt.current,_=(w&2)!==0;if(_?(w=w&1|2,a.flags|=128):w&=1,C(Mt,w),on(r,a,c,s),c=Ye?lo:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&bb(r,s,a);else if(r.tag===19)bb(r,s,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=a.child,p=null;s!==null;)r=s.alternate,r!==null&&tc(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=a.child,a.child=null):(p=s.sibling,s.sibling=null),Ch(a,!1,p,s,v,c);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=a.child,a.child=null;p!==null;){if(r=p.alternate,r!==null&&tc(r)===null){a.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}Ch(a,!0,s,null,v,c);break;case"together":Ch(a,!1,null,null,void 0,c);break;default:a.memoizedState=null}return a.child}function na(r,a,s){if(r!==null&&(a.dependencies=r.dependencies),Za|=a.lanes,(s&a.childLanes)===0)if(r!==null){if(Pl(r,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(i(153));if(a.child!==null){for(r=a.child,s=Yr(r,r.pendingProps),a.child=s,s.return=a;r.sibling!==null;)r=r.sibling,s=s.sibling=Yr(r,r.pendingProps),s.return=a;s.sibling=null}return a.child}function _h(r,a){return(r.lanes&a)!==0?!0:(r=r.dependencies,!!(r!==null&&Qu(r)))}function v_(r,a,s){switch(a.tag){case 3:Me(a,a.stateNode.containerInfo),Ua(a,Ut,r.memoizedState.cache),$i();break;case 27:case 5:_t(a);break;case 4:Me(a,a.stateNode.containerInfo);break;case 10:Ua(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Jf(a),null;break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated!==null?($a(a),a.flags|=128,null):(s&a.child.childLanes)!==0?vb(r,a,s):($a(a),r=na(r,a,s),r!==null?r.sibling:null);$a(a);break;case 19:var p=(r.flags&128)!==0;if(c=(s&a.childLanes)!==0,c||(Pl(r,a,s,!1),c=(s&a.childLanes)!==0),p){if(c)return xb(r,a,s);a.flags|=128}if(p=a.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),C(Mt,Mt.current),c)break;return null;case 22:return a.lanes=0,fb(r,a,s,a.pendingProps);case 24:Ua(a,Ut,r.memoizedState.cache)}return na(r,a,s)}function Sb(r,a,s){if(r!==null)if(r.memoizedProps!==a.pendingProps)Bt=!0;else{if(!_h(r,s)&&(a.flags&128)===0)return Bt=!1,v_(r,a,s);Bt=(r.flags&131072)!==0}else Bt=!1,Ye&&(a.flags&1048576)!==0&&Wy(a,lo,a.index);switch(a.lanes=0,a.tag){case 16:e:{var c=a.pendingProps;if(r=Zi(a.elementType),a.type=r,typeof r=="function")zf(r)?(c=Ki(r,c),a.tag=1,a=gb(null,a,r,c,s)):(a.tag=0,a=xh(null,a,r,c,s));else{if(r!=null){var p=r.$$typeof;if(p===I){a.tag=11,a=ub(null,a,r,c,s);break e}else if(p===F){a.tag=14,a=cb(null,a,r,c,s);break e}}throw a=de(r)||r,Error(i(306,a,""))}}return a;case 0:return xh(r,a,a.type,a.pendingProps,s);case 1:return c=a.type,p=Ki(c,a.pendingProps),gb(r,a,c,p,s);case 3:e:{if(Me(a,a.stateNode.containerInfo),r===null)throw Error(i(387));c=a.pendingProps;var v=a.memoizedState;p=v.element,Qf(r,a),po(a,c,null,s);var w=a.memoizedState;if(c=w.cache,Ua(a,Ut,c),c!==v.cache&&$f(a,[Ut],s,!0),mo(),c=w.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:w.cache},a.updateQueue.baseState=v,a.memoizedState=v,a.flags&256){a=yb(r,a,c,s);break e}else if(c!==p){p=ir(Error(i(424)),a),so(p),a=yb(r,a,c,s);break e}else{switch(r=a.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(wt=cr(r.firstChild),ln=a,Ye=!0,Ma=null,or=!0,s=fv(a,null,c,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if($i(),c===p){a=na(r,a,s);break e}on(r,a,c,s)}a=a.child}return a;case 26:return fc(r,a),r===null?(s=zx(a.type,null,a.pendingProps,null))?a.memoizedState=s:Ye||(s=a.type,r=a.pendingProps,c=Ac(ue.current).createElement(s),c[an]=a,c[wn]=r,un(c,s,r),Yt(c),a.stateNode=c):a.memoizedState=zx(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return _t(a),r===null&&Ye&&(c=a.stateNode=Ax(a.type,a.pendingProps,ue.current),ln=a,or=!0,p=wt,Ya(a.type)?(lm=p,wt=cr(c.firstChild)):wt=p),on(r,a,a.pendingProps.children,s),fc(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&Ye&&((p=c=wt)&&(c=G_(c,a.type,a.pendingProps,or),c!==null?(a.stateNode=c,ln=a,wt=cr(c.firstChild),or=!1,p=!0):p=!1),p||La(a)),_t(a),p=a.type,v=a.pendingProps,w=r!==null?r.memoizedProps:null,c=v.children,tm(p,v)?c=null:w!==null&&tm(p,w)&&(a.flags|=32),a.memoizedState!==null&&(p=eh(r,a,u_,null,null,s),Mo._currentValue=p),fc(r,a),on(r,a,c,s),a.child;case 6:return r===null&&Ye&&((r=s=wt)&&(s=K_(s,a.pendingProps,or),s!==null?(a.stateNode=s,ln=a,wt=null,r=!0):r=!1),r||La(a)),null;case 13:return vb(r,a,s);case 4:return Me(a,a.stateNode.containerInfo),c=a.pendingProps,r===null?a.child=Qi(a,null,c,s):on(r,a,c,s),a.child;case 11:return ub(r,a,a.type,a.pendingProps,s);case 7:return on(r,a,a.pendingProps,s),a.child;case 8:return on(r,a,a.pendingProps.children,s),a.child;case 12:return on(r,a,a.pendingProps.children,s),a.child;case 10:return c=a.pendingProps,Ua(a,a.type,c.value),on(r,a,c.children,s),a.child;case 9:return p=a.type._context,c=a.pendingProps.children,qi(a),p=sn(p),c=c(p),a.flags|=1,on(r,a,c,s),a.child;case 14:return cb(r,a,a.type,a.pendingProps,s);case 15:return db(r,a,a.type,a.pendingProps,s);case 19:return xb(r,a,s);case 31:return y_(r,a,s);case 22:return fb(r,a,s,a.pendingProps);case 24:return qi(a),c=sn(Ut),r===null?(p=Hf(),p===null&&(p=gt,v=Ff(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),a.memoizedState={parent:c,cache:p},Vf(a),Ua(a,Ut,p)):((r.lanes&s)!==0&&(Qf(r,a),po(a,null,null,s),mo()),p=r.memoizedState,v=a.memoizedState,p.parent!==c?(p={parent:c,cache:c},a.memoizedState=p,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=p),Ua(a,Ut,c)):(c=v.cache,Ua(a,Ut,c),c!==p.cache&&$f(a,[Ut],s,!0))),on(r,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function ra(r){r.flags|=4}function Nh(r,a,s,c,p){if((a=(r.mode&32)!==0)&&(a=!1),a){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Gb())r.flags|=8192;else throw Vi=Xu,Zf}else r.flags&=-16777217}function wb(r,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Ux(a))if(Gb())r.flags|=8192;else throw Vi=Xu,Zf}function mc(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag!==22?Qs():536870912,r.lanes|=a,Jl|=a)}function So(r,a){if(!Ye)switch(r.tailMode){case"hidden":a=r.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function kt(r){var a=r.alternate!==null&&r.alternate.child===r.child,s=0,c=0;if(a)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=c,r.childLanes=s,a}function b_(r,a,s){var c=a.pendingProps;switch(Lf(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(a),null;case 1:return kt(a),null;case 3:return s=a.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Wr(Ut),xe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Bl(a)?ra(a):r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,If())),kt(a),null;case 26:var p=a.type,v=a.memoizedState;return r===null?(ra(a),v!==null?(kt(a),wb(a,v)):(kt(a),Nh(a,p,null,c,s))):v?v!==r.memoizedState?(ra(a),kt(a),wb(a,v)):(kt(a),a.flags&=-16777217):(r=r.memoizedProps,r!==c&&ra(a),kt(a),Nh(a,p,r,c,s)),null;case 27:if(en(a),s=ue.current,p=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==c&&ra(a);else{if(!c){if(a.stateNode===null)throw Error(i(166));return kt(a),null}r=J.current,Bl(a)?tv(a):(r=Ax(p,c,s),a.stateNode=r,ra(a))}return kt(a),null;case 5:if(en(a),p=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==c&&ra(a);else{if(!c){if(a.stateNode===null)throw Error(i(166));return kt(a),null}if(v=J.current,Bl(a))tv(a);else{var w=Ac(ue.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?w.createElement(p,{is:c.is}):w.createElement(p)}}v[an]=a,v[wn]=c;e:for(w=a.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===a)break e;for(;w.sibling===null;){if(w.return===null||w.return===a)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}a.stateNode=v;e:switch(un(v,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&ra(a)}}return kt(a),Nh(a,a.type,r===null?null:r.memoizedProps,a.pendingProps,s),null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==c&&ra(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(i(166));if(r=ue.current,Bl(a)){if(r=a.stateNode,s=a.memoizedProps,c=null,p=ln,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}r[an]=a,r=!!(r.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||vx(r.nodeValue,s)),r||La(a,!0)}else r=Ac(r).createTextNode(c),r[an]=a,a.stateNode=r}return kt(a),null;case 31:if(s=a.memoizedState,r===null||r.memoizedState!==null){if(c=Bl(a),s!==null){if(r===null){if(!c)throw Error(i(318));if(r=a.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[an]=a}else $i(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;kt(a),r=!1}else s=If(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return a.flags&256?(Hn(a),a):(Hn(a),null);if((a.flags&128)!==0)throw Error(i(558))}return kt(a),null;case 13:if(c=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Bl(a),c!==null&&c.dehydrated!==null){if(r===null){if(!p)throw Error(i(318));if(p=a.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[an]=a}else $i(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;kt(a),p=!1}else p=If(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return a.flags&256?(Hn(a),a):(Hn(a),null)}return Hn(a),(a.flags&128)!==0?(a.lanes=s,a):(s=c!==null,r=r!==null&&r.memoizedState!==null,s&&(c=a.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==p&&(c.flags|=2048)),s!==r&&s&&(a.child.flags|=8192),mc(a,a.updateQueue),kt(a),null);case 4:return xe(),r===null&&Yh(a.stateNode.containerInfo),kt(a),null;case 10:return Wr(a.type),kt(a),null;case 19:if(A(Mt),c=a.memoizedState,c===null)return kt(a),null;if(p=(a.flags&128)!==0,v=c.rendering,v===null)if(p)So(c,!1);else{if(zt!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(v=tc(r),v!==null){for(a.flags|=128,So(c,!1),r=v.updateQueue,a.updateQueue=r,mc(a,r),a.subtreeFlags=0,r=s,s=a.child;s!==null;)Yy(s,r),s=s.sibling;return C(Mt,Mt.current&1|2),Ye&&Xr(a,c.treeForkCount),a.child}r=r.sibling}c.tail!==null&&nn()>bc&&(a.flags|=128,p=!0,So(c,!1),a.lanes=4194304)}else{if(!p)if(r=tc(v),r!==null){if(a.flags|=128,p=!0,r=r.updateQueue,a.updateQueue=r,mc(a,r),So(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!Ye)return kt(a),null}else 2*nn()-c.renderingStartTime>bc&&s!==536870912&&(a.flags|=128,p=!0,So(c,!1),a.lanes=4194304);c.isBackwards?(v.sibling=a.child,a.child=v):(r=c.last,r!==null?r.sibling=v:a.child=v,c.last=v)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=nn(),r.sibling=null,s=Mt.current,C(Mt,p?s&1|2:s&1),Ye&&Xr(a,c.treeForkCount),r):(kt(a),null);case 22:case 23:return Hn(a),Xf(),c=a.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(s&536870912)!==0&&(a.flags&128)===0&&(kt(a),a.subtreeFlags&6&&(a.flags|=8192)):kt(a),s=a.updateQueue,s!==null&&mc(a,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),r!==null&&A(Hi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Wr(Ut),kt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function x_(r,a){switch(Lf(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return Wr(Ut),xe(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return en(a),null;case 31:if(a.memoizedState!==null){if(Hn(a),a.alternate===null)throw Error(i(340));$i()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 13:if(Hn(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(i(340));$i()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return A(Mt),null;case 4:return xe(),null;case 10:return Wr(a.type),null;case 22:case 23:return Hn(a),Xf(),r!==null&&A(Hi),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return Wr(Ut),null;case 25:return null;default:return null}}function kb(r,a){switch(Lf(a),a.tag){case 3:Wr(Ut),xe();break;case 26:case 27:case 5:en(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&Hn(a);break;case 13:Hn(a);break;case 19:A(Mt);break;case 10:Wr(a.type);break;case 22:case 23:Hn(a),Xf(),r!==null&&A(Hi);break;case 24:Wr(Ut)}}function wo(r,a){try{var s=a.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var p=c.next;s=p;do{if((s.tag&r)===r){c=void 0;var v=s.create,w=s.inst;c=v(),w.destroy=c}s=s.next}while(s!==p)}}catch(_){dt(a,a.return,_)}}function qa(r,a,s){try{var c=a.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var v=p.next;c=v;do{if((c.tag&r)===r){var w=c.inst,_=w.destroy;if(_!==void 0){w.destroy=void 0,p=a;var M=s,G=_;try{G()}catch(te){dt(p,M,te)}}}c=c.next}while(c!==v)}}catch(te){dt(a,a.return,te)}}function jb(r){var a=r.updateQueue;if(a!==null){var s=r.stateNode;try{mv(a,s)}catch(c){dt(r,r.return,c)}}}function Eb(r,a,s){s.props=Ki(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(c){dt(r,a,c)}}function ko(r,a){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof s=="function"?r.refCleanup=s(c):s.current=c}}catch(p){dt(r,a,p)}}function zr(r,a){var s=r.ref,c=r.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(p){dt(r,a,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){dt(r,a,p)}else s.current=null}function Cb(r){var a=r.type,s=r.memoizedProps,c=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(p){dt(r,r.return,p)}}function Ah(r,a,s){try{var c=r.stateNode;F_(c,r.type,s,a),c[wn]=a}catch(p){dt(r,r.return,p)}}function _b(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ya(r.type)||r.tag===4}function Th(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||_b(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ya(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Rh(r,a,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(r),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Gr));else if(c!==4&&(c===27&&Ya(r.type)&&(s=r.stateNode,a=null),r=r.child,r!==null))for(Rh(r,a,s),r=r.sibling;r!==null;)Rh(r,a,s),r=r.sibling}function pc(r,a,s){var c=r.tag;if(c===5||c===6)r=r.stateNode,a?s.insertBefore(r,a):s.appendChild(r);else if(c!==4&&(c===27&&Ya(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(pc(r,a,s),r=r.sibling;r!==null;)pc(r,a,s),r=r.sibling}function Nb(r){var a=r.stateNode,s=r.memoizedProps;try{for(var c=r.type,p=a.attributes;p.length;)a.removeAttributeNode(p[0]);un(a,c,s),a[an]=r,a[wn]=s}catch(v){dt(r,r.return,v)}}var aa=!1,Pt=!1,zh=!1,Ab=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function S_(r,a){if(r=r.containerInfo,Wh=Lc,r=$y(r),Ef(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var p=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var w=0,_=-1,M=-1,G=0,te=0,se=r,K=null;t:for(;;){for(var X;se!==s||p!==0&&se.nodeType!==3||(_=w+p),se!==v||c!==0&&se.nodeType!==3||(M=w+c),se.nodeType===3&&(w+=se.nodeValue.length),(X=se.firstChild)!==null;)K=se,se=X;for(;;){if(se===r)break t;if(K===s&&++G===p&&(_=w),K===v&&++te===c&&(M=w),(X=se.nextSibling)!==null)break;se=K,K=se.parentNode}se=X}s=_===-1||M===-1?null:{start:_,end:M}}else s=null}s=s||{start:0,end:0}}else s=null;for(em={focusedElem:r,selectionRange:s},Lc=!1,Xt=a;Xt!==null;)if(a=Xt,r=a.child,(a.subtreeFlags&1028)!==0&&r!==null)r.return=a,Xt=r;else for(;Xt!==null;){switch(a=Xt,v=a.alternate,r=a.flags,a.tag){case 0:if((r&4)!==0&&(r=a.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,s=a,p=v.memoizedProps,v=v.memoizedState,c=s.stateNode;try{var Se=Ki(s.type,p);r=c.getSnapshotBeforeUpdate(Se,v),c.__reactInternalSnapshotBeforeUpdate=r}catch(ze){dt(s,s.return,ze)}}break;case 3:if((r&1024)!==0){if(r=a.stateNode.containerInfo,s=r.nodeType,s===9)rm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":rm(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=a.sibling,r!==null){r.return=a.return,Xt=r;break}Xt=a.return}}function Tb(r,a,s){var c=s.flags;switch(s.tag){case 0:case 11:case 15:la(r,s),c&4&&wo(5,s);break;case 1:if(la(r,s),c&4)if(r=s.stateNode,a===null)try{r.componentDidMount()}catch(w){dt(s,s.return,w)}else{var p=Ki(s.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(p,a,r.__reactInternalSnapshotBeforeUpdate)}catch(w){dt(s,s.return,w)}}c&64&&jb(s),c&512&&ko(s,s.return);break;case 3:if(la(r,s),c&64&&(r=s.updateQueue,r!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{mv(r,a)}catch(w){dt(s,s.return,w)}}break;case 27:a===null&&c&4&&Nb(s);case 26:case 5:la(r,s),a===null&&c&4&&Cb(s),c&512&&ko(s,s.return);break;case 12:la(r,s);break;case 31:la(r,s),c&4&&Ob(r,s);break;case 13:la(r,s),c&4&&Db(r,s),c&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=T_.bind(null,s),Y_(r,s))));break;case 22:if(c=s.memoizedState!==null||aa,!c){a=a!==null&&a.memoizedState!==null||Pt,p=aa;var v=Pt;aa=c,(Pt=a)&&!v?sa(r,s,(s.subtreeFlags&8772)!==0):la(r,s),aa=p,Pt=v}break;case 30:break;default:la(r,s)}}function Rb(r){var a=r.alternate;a!==null&&(r.alternate=null,Rb(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&of(a)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var jt=null,jn=!1;function ia(r,a,s){for(s=s.child;s!==null;)zb(r,a,s),s=s.sibling}function zb(r,a,s){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(rn,s)}catch{}switch(s.tag){case 26:Pt||zr(s,a),ia(r,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Pt||zr(s,a);var c=jt,p=jn;Ya(s.type)&&(jt=s.stateNode,jn=!1),ia(r,a,s),zo(s.stateNode),jt=c,jn=p;break;case 5:Pt||zr(s,a);case 6:if(c=jt,p=jn,jt=null,ia(r,a,s),jt=c,jn=p,jt!==null)if(jn)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(s.stateNode)}catch(v){dt(s,a,v)}else try{jt.removeChild(s.stateNode)}catch(v){dt(s,a,v)}break;case 18:jt!==null&&(jn?(r=jt,jx(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),ls(r)):jx(jt,s.stateNode));break;case 4:c=jt,p=jn,jt=s.stateNode.containerInfo,jn=!0,ia(r,a,s),jt=c,jn=p;break;case 0:case 11:case 14:case 15:qa(2,s,a),Pt||qa(4,s,a),ia(r,a,s);break;case 1:Pt||(zr(s,a),c=s.stateNode,typeof c.componentWillUnmount=="function"&&Eb(s,a,c)),ia(r,a,s);break;case 21:ia(r,a,s);break;case 22:Pt=(c=Pt)||s.memoizedState!==null,ia(r,a,s),Pt=c;break;default:ia(r,a,s)}}function Ob(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ls(r)}catch(s){dt(a,a.return,s)}}}function Db(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ls(r)}catch(s){dt(a,a.return,s)}}function w_(r){switch(r.tag){case 31:case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new Ab),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new Ab),a;default:throw Error(i(435,r.tag))}}function gc(r,a){var s=w_(r);a.forEach(function(c){if(!s.has(c)){s.add(c);var p=R_.bind(null,r,c);c.then(p,p)}})}function En(r,a){var s=a.deletions;if(s!==null)for(var c=0;c<s.length;c++){var p=s[c],v=r,w=a,_=w;e:for(;_!==null;){switch(_.tag){case 27:if(Ya(_.type)){jt=_.stateNode,jn=!1;break e}break;case 5:jt=_.stateNode,jn=!1;break e;case 3:case 4:jt=_.stateNode.containerInfo,jn=!0;break e}_=_.return}if(jt===null)throw Error(i(160));zb(v,w,p),jt=null,jn=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Mb(a,r),a=a.sibling}var wr=null;function Mb(r,a){var s=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:En(a,r),Cn(r),c&4&&(qa(3,r,r.return),wo(3,r),qa(5,r,r.return));break;case 1:En(a,r),Cn(r),c&512&&(Pt||s===null||zr(s,s.return)),c&64&&aa&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?c:s.concat(c))));break;case 26:var p=wr;if(En(a,r),Cn(r),c&512&&(Pt||s===null||zr(s,s.return)),c&4){var v=s!==null?s.memoizedState:null;if(c=r.memoizedState,s===null)if(c===null)if(r.stateNode===null){e:{c=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Ks]||v[an]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(c),p.head.insertBefore(v,p.querySelector("head > title"))),un(v,c,s),v[an]=r,Yt(v),c=v;break e;case"link":var w=Mx("link","href",p).get(c+(s.href||""));if(w){for(var _=0;_<w.length;_++)if(v=w[_],v.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&v.getAttribute("rel")===(s.rel==null?null:s.rel)&&v.getAttribute("title")===(s.title==null?null:s.title)&&v.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){w.splice(_,1);break t}}v=p.createElement(c),un(v,c,s),p.head.appendChild(v);break;case"meta":if(w=Mx("meta","content",p).get(c+(s.content||""))){for(_=0;_<w.length;_++)if(v=w[_],v.getAttribute("content")===(s.content==null?null:""+s.content)&&v.getAttribute("name")===(s.name==null?null:s.name)&&v.getAttribute("property")===(s.property==null?null:s.property)&&v.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&v.getAttribute("charset")===(s.charSet==null?null:s.charSet)){w.splice(_,1);break t}}v=p.createElement(c),un(v,c,s),p.head.appendChild(v);break;default:throw Error(i(468,c))}v[an]=r,Yt(v),c=v}r.stateNode=c}else Lx(p,r.type,r.stateNode);else r.stateNode=Dx(p,c,r.memoizedProps);else v!==c?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,c===null?Lx(p,r.type,r.stateNode):Dx(p,c,r.memoizedProps)):c===null&&r.stateNode!==null&&Ah(r,r.memoizedProps,s.memoizedProps)}break;case 27:En(a,r),Cn(r),c&512&&(Pt||s===null||zr(s,s.return)),s!==null&&c&4&&Ah(r,r.memoizedProps,s.memoizedProps);break;case 5:if(En(a,r),Cn(r),c&512&&(Pt||s===null||zr(s,s.return)),r.flags&32){p=r.stateNode;try{Al(p,"")}catch(Se){dt(r,r.return,Se)}}c&4&&r.stateNode!=null&&(p=r.memoizedProps,Ah(r,p,s!==null?s.memoizedProps:p)),c&1024&&(zh=!0);break;case 6:if(En(a,r),Cn(r),c&4){if(r.stateNode===null)throw Error(i(162));c=r.memoizedProps,s=r.stateNode;try{s.nodeValue=c}catch(Se){dt(r,r.return,Se)}}break;case 3:if(zc=null,p=wr,wr=Tc(a.containerInfo),En(a,r),wr=p,Cn(r),c&4&&s!==null&&s.memoizedState.isDehydrated)try{ls(a.containerInfo)}catch(Se){dt(r,r.return,Se)}zh&&(zh=!1,Lb(r));break;case 4:c=wr,wr=Tc(r.stateNode.containerInfo),En(a,r),Cn(r),wr=c;break;case 12:En(a,r),Cn(r);break;case 31:En(a,r),Cn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,gc(r,c)));break;case 13:En(a,r),Cn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(vc=nn()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,gc(r,c)));break;case 22:p=r.memoizedState!==null;var M=s!==null&&s.memoizedState!==null,G=aa,te=Pt;if(aa=G||p,Pt=te||M,En(a,r),Pt=te,aa=G,Cn(r),c&8192)e:for(a=r.stateNode,a._visibility=p?a._visibility&-2:a._visibility|1,p&&(s===null||M||aa||Pt||Yi(r)),s=null,a=r;;){if(a.tag===5||a.tag===26){if(s===null){M=s=a;try{if(v=M.stateNode,p)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{_=M.stateNode;var se=M.memoizedProps.style,K=se!=null&&se.hasOwnProperty("display")?se.display:null;_.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(Se){dt(M,M.return,Se)}}}else if(a.tag===6){if(s===null){M=a;try{M.stateNode.nodeValue=p?"":M.memoizedProps}catch(Se){dt(M,M.return,Se)}}}else if(a.tag===18){if(s===null){M=a;try{var X=M.stateNode;p?Ex(X,!0):Ex(M.stateNode,!1)}catch(Se){dt(M,M.return,Se)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===r)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=r.updateQueue,c!==null&&(s=c.retryQueue,s!==null&&(c.retryQueue=null,gc(r,s))));break;case 19:En(a,r),Cn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,gc(r,c)));break;case 30:break;case 21:break;default:En(a,r),Cn(r)}}function Cn(r){var a=r.flags;if(a&2){try{for(var s,c=r.return;c!==null;){if(_b(c)){s=c;break}c=c.return}if(s==null)throw Error(i(160));switch(s.tag){case 27:var p=s.stateNode,v=Th(r);pc(r,v,p);break;case 5:var w=s.stateNode;s.flags&32&&(Al(w,""),s.flags&=-33);var _=Th(r);pc(r,_,w);break;case 3:case 4:var M=s.stateNode.containerInfo,G=Th(r);Rh(r,G,M);break;default:throw Error(i(161))}}catch(te){dt(r,r.return,te)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function Lb(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;Lb(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),r=r.sibling}}function la(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Tb(r,a.alternate,a),a=a.sibling}function Yi(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:qa(4,a,a.return),Yi(a);break;case 1:zr(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&Eb(a,a.return,s),Yi(a);break;case 27:zo(a.stateNode);case 26:case 5:zr(a,a.return),Yi(a);break;case 22:a.memoizedState===null&&Yi(a);break;case 30:Yi(a);break;default:Yi(a)}r=r.sibling}}function sa(r,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var c=a.alternate,p=r,v=a,w=v.flags;switch(v.tag){case 0:case 11:case 15:sa(p,v,s),wo(4,v);break;case 1:if(sa(p,v,s),c=v,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){dt(c,c.return,G)}if(c=v,p=c.updateQueue,p!==null){var _=c.stateNode;try{var M=p.shared.hiddenCallbacks;if(M!==null)for(p.shared.hiddenCallbacks=null,p=0;p<M.length;p++)hv(M[p],_)}catch(G){dt(c,c.return,G)}}s&&w&64&&jb(v),ko(v,v.return);break;case 27:Nb(v);case 26:case 5:sa(p,v,s),s&&c===null&&w&4&&Cb(v),ko(v,v.return);break;case 12:sa(p,v,s);break;case 31:sa(p,v,s),s&&w&4&&Ob(p,v);break;case 13:sa(p,v,s),s&&w&4&&Db(p,v);break;case 22:v.memoizedState===null&&sa(p,v,s),ko(v,v.return);break;case 30:break;default:sa(p,v,s)}a=a.sibling}}function Oh(r,a){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&oo(s))}function Dh(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&oo(r))}function kr(r,a,s,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Ub(r,a,s,c),a=a.sibling}function Ub(r,a,s,c){var p=a.flags;switch(a.tag){case 0:case 11:case 15:kr(r,a,s,c),p&2048&&wo(9,a);break;case 1:kr(r,a,s,c);break;case 3:kr(r,a,s,c),p&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&oo(r)));break;case 12:if(p&2048){kr(r,a,s,c),r=a.stateNode;try{var v=a.memoizedProps,w=v.id,_=v.onPostCommit;typeof _=="function"&&_(w,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(M){dt(a,a.return,M)}}else kr(r,a,s,c);break;case 31:kr(r,a,s,c);break;case 13:kr(r,a,s,c);break;case 23:break;case 22:v=a.stateNode,w=a.alternate,a.memoizedState!==null?v._visibility&2?kr(r,a,s,c):jo(r,a):v._visibility&2?kr(r,a,s,c):(v._visibility|=2,Kl(r,a,s,c,(a.subtreeFlags&10256)!==0||!1)),p&2048&&Oh(w,a);break;case 24:kr(r,a,s,c),p&2048&&Dh(a.alternate,a);break;default:kr(r,a,s,c)}}function Kl(r,a,s,c,p){for(p=p&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var v=r,w=a,_=s,M=c,G=w.flags;switch(w.tag){case 0:case 11:case 15:Kl(v,w,_,M,p),wo(8,w);break;case 23:break;case 22:var te=w.stateNode;w.memoizedState!==null?te._visibility&2?Kl(v,w,_,M,p):jo(v,w):(te._visibility|=2,Kl(v,w,_,M,p)),p&&G&2048&&Oh(w.alternate,w);break;case 24:Kl(v,w,_,M,p),p&&G&2048&&Dh(w.alternate,w);break;default:Kl(v,w,_,M,p)}a=a.sibling}}function jo(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=r,c=a,p=c.flags;switch(c.tag){case 22:jo(s,c),p&2048&&Oh(c.alternate,c);break;case 24:jo(s,c),p&2048&&Dh(c.alternate,c);break;default:jo(s,c)}a=a.sibling}}var Eo=8192;function Yl(r,a,s){if(r.subtreeFlags&Eo)for(r=r.child;r!==null;)Ib(r,a,s),r=r.sibling}function Ib(r,a,s){switch(r.tag){case 26:Yl(r,a,s),r.flags&Eo&&r.memoizedState!==null&&oN(s,wr,r.memoizedState,r.memoizedProps);break;case 5:Yl(r,a,s);break;case 3:case 4:var c=wr;wr=Tc(r.stateNode.containerInfo),Yl(r,a,s),wr=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=Eo,Eo=16777216,Yl(r,a,s),Eo=c):Yl(r,a,s));break;default:Yl(r,a,s)}}function Bb(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function Co(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Xt=c,$b(c,r)}Bb(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Pb(r),r=r.sibling}function Pb(r){switch(r.tag){case 0:case 11:case 15:Co(r),r.flags&2048&&qa(9,r,r.return);break;case 3:Co(r);break;case 12:Co(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,yc(r)):Co(r);break;default:Co(r)}}function yc(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var c=a[s];Xt=c,$b(c,r)}Bb(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:qa(8,a,a.return),yc(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,yc(a));break;default:yc(a)}r=r.sibling}}function $b(r,a){for(;Xt!==null;){var s=Xt;switch(s.tag){case 0:case 11:case 15:qa(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var c=s.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:oo(s.memoizedState.cache)}if(c=s.child,c!==null)c.return=s,Xt=c;else e:for(s=r;Xt!==null;){c=Xt;var p=c.sibling,v=c.return;if(Rb(c),c===s){Xt=null;break e}if(p!==null){p.return=v,Xt=p;break e}Xt=v}}}var k_={getCacheForType:function(r){var a=sn(Ut),s=a.data.get(r);return s===void 0&&(s=r(),a.data.set(r,s)),s},cacheSignal:function(){return sn(Ut).controller.signal}},j_=typeof WeakMap=="function"?WeakMap:Map,it=0,gt=null,Ze=null,Ge=0,ct=0,Zn=null,Ha=!1,Xl=!1,Mh=!1,oa=0,zt=0,Za=0,Xi=0,Lh=0,Vn=0,Jl=0,_o=null,_n=null,Uh=!1,vc=0,Fb=0,bc=1/0,xc=null,Va=null,Ht=0,Qa=null,Wl=null,ua=0,Ih=0,Bh=null,qb=null,No=0,Ph=null;function Qn(){return(it&2)!==0&&Ge!==0?Ge&-Ge:P.T!==null?Vh():lf()}function Hb(){if(Vn===0)if((Ge&536870912)===0||Ye){var r=zi;zi<<=1,(zi&3932160)===0&&(zi=262144),Vn=r}else Vn=536870912;return r=qn.current,r!==null&&(r.flags|=32),Vn}function Nn(r,a,s){(r===gt&&(ct===2||ct===9)||r.cancelPendingCommit!==null)&&(es(r,0),Ga(r,Ge,Vn,!1)),Ra(r,s),((it&2)===0||r!==gt)&&(r===gt&&((it&2)===0&&(Xi|=s),zt===4&&Ga(r,Ge,Vn,!1)),Or(r))}function Zb(r,a,s){if((it&6)!==0)throw Error(i(327));var c=!s&&(a&127)===0&&(a&r.expiredLanes)===0||Ta(r,a),p=c?__(r,a):Fh(r,a,!0),v=c;do{if(p===0){Xl&&!c&&Ga(r,a,0,!1);break}else{if(s=r.current.alternate,v&&!E_(s)){p=Fh(r,a,!1),v=!1;continue}if(p===2){if(v=a,r.errorRecoveryDisabledLanes&v)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){a=w;e:{var _=r;p=_o;var M=_.current.memoizedState.isDehydrated;if(M&&(es(_,w).flags|=256),w=Fh(_,w,!1),w!==2){if(Mh&&!M){_.errorRecoveryDisabledLanes|=v,Xi|=v,p=4;break e}v=_n,_n=p,v!==null&&(_n===null?_n=v:_n.push.apply(_n,v))}p=w}if(v=!1,p!==2)continue}}if(p===1){es(r,0),Ga(r,a,0,!0);break}e:{switch(c=r,v=p,v){case 0:case 1:throw Error(i(345));case 4:if((a&4194048)!==a)break;case 6:Ga(c,a,Vn,!Ha);break e;case 2:_n=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(p=vc+300-nn(),10<p)){if(Ga(c,a,Vn,!Ha),Di(c,0,!0)!==0)break e;ua=a,c.timeoutHandle=wx(Vb.bind(null,c,s,_n,xc,Uh,a,Vn,Xi,Jl,Ha,v,"Throttled",-0,0),p);break e}Vb(c,s,_n,xc,Uh,a,Vn,Xi,Jl,Ha,v,null,-0,0)}}break}while(!0);Or(r)}function Vb(r,a,s,c,p,v,w,_,M,G,te,se,K,X){if(r.timeoutHandle=-1,se=a.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Gr},Ib(a,v,se);var Se=(v&62914560)===v?vc-nn():(v&4194048)===v?Fb-nn():0;if(Se=uN(se,Se),Se!==null){ua=v,r.cancelPendingCommit=Se(ex.bind(null,r,a,v,s,c,p,w,_,M,te,se,null,K,X)),Ga(r,v,w,!G);return}}ex(r,a,v,s,c,p,w,_,M)}function E_(r){for(var a=r;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var c=0;c<s.length;c++){var p=s[c],v=p.getSnapshot;p=p.value;try{if(!$n(v(),p))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ga(r,a,s,c){a&=~Lh,a&=~Xi,r.suspendedLanes|=a,r.pingedLanes&=~a,c&&(r.warmLanes|=a),c=r.expirationTimes;for(var p=a;0<p;){var v=31-ut(p),w=1<<v;c[v]=-1,p&=~w}s!==0&&Gs(r,s,a)}function Sc(){return(it&6)===0?(Ao(0),!1):!0}function $h(){if(Ze!==null){if(ct===0)var r=Ze.return;else r=Ze,Jr=Fi=null,rh(r),Hl=null,co=0,r=Ze;for(;r!==null;)kb(r.alternate,r),r=r.return;Ze=null}}function es(r,a){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,Z_(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),ua=0,$h(),gt=r,Ze=s=Yr(r.current,null),Ge=a,ct=0,Zn=null,Ha=!1,Xl=Ta(r,a),Mh=!1,Jl=Vn=Lh=Xi=Za=zt=0,_n=_o=null,Uh=!1,(a&8)!==0&&(a|=a&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=a;0<c;){var p=31-ut(c),v=1<<p;a|=r[p],c&=~v}return oa=a,Fu(),s}function Qb(r,a){Ue=null,P.H=bo,a===ql||a===Yu?(a=uv(),ct=3):a===Zf?(a=uv(),ct=4):ct=a===bh?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Zn=a,Ze===null&&(zt=1,cc(r,ir(a,r.current)))}function Gb(){var r=qn.current;return r===null?!0:(Ge&4194048)===Ge?ur===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?r===ur:!1}function Kb(){var r=P.H;return P.H=bo,r===null?bo:r}function Yb(){var r=P.A;return P.A=k_,r}function wc(){zt=4,Ha||(Ge&4194048)!==Ge&&qn.current!==null||(Xl=!0),(Za&134217727)===0&&(Xi&134217727)===0||gt===null||Ga(gt,Ge,Vn,!1)}function Fh(r,a,s){var c=it;it|=2;var p=Kb(),v=Yb();(gt!==r||Ge!==a)&&(xc=null,es(r,a)),a=!1;var w=zt;e:do try{if(ct!==0&&Ze!==null){var _=Ze,M=Zn;switch(ct){case 8:$h(),w=6;break e;case 3:case 2:case 9:case 6:qn.current===null&&(a=!0);var G=ct;if(ct=0,Zn=null,ts(r,_,M,G),s&&Xl){w=0;break e}break;default:G=ct,ct=0,Zn=null,ts(r,_,M,G)}}C_(),w=zt;break}catch(te){Qb(r,te)}while(!0);return a&&r.shellSuspendCounter++,Jr=Fi=null,it=c,P.H=p,P.A=v,Ze===null&&(gt=null,Ge=0,Fu()),w}function C_(){for(;Ze!==null;)Xb(Ze)}function __(r,a){var s=it;it|=2;var c=Kb(),p=Yb();gt!==r||Ge!==a?(xc=null,bc=nn()+500,es(r,a)):Xl=Ta(r,a);e:do try{if(ct!==0&&Ze!==null){a=Ze;var v=Zn;t:switch(ct){case 1:ct=0,Zn=null,ts(r,a,v,1);break;case 2:case 9:if(sv(v)){ct=0,Zn=null,Jb(a);break}a=function(){ct!==2&&ct!==9||gt!==r||(ct=7),Or(r)},v.then(a,a);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:sv(v)?(ct=0,Zn=null,Jb(a)):(ct=0,Zn=null,ts(r,a,v,7));break;case 5:var w=null;switch(Ze.tag){case 26:w=Ze.memoizedState;case 5:case 27:var _=Ze;if(w?Ux(w):_.stateNode.complete){ct=0,Zn=null;var M=_.sibling;if(M!==null)Ze=M;else{var G=_.return;G!==null?(Ze=G,kc(G)):Ze=null}break t}}ct=0,Zn=null,ts(r,a,v,5);break;case 6:ct=0,Zn=null,ts(r,a,v,6);break;case 8:$h(),zt=6;break e;default:throw Error(i(462))}}N_();break}catch(te){Qb(r,te)}while(!0);return Jr=Fi=null,P.H=c,P.A=p,it=s,Ze!==null?0:(gt=null,Ge=0,Fu(),zt)}function N_(){for(;Ze!==null&&!Ti();)Xb(Ze)}function Xb(r){var a=Sb(r.alternate,r,oa);r.memoizedProps=r.pendingProps,a===null?kc(r):Ze=a}function Jb(r){var a=r,s=a.alternate;switch(a.tag){case 15:case 0:a=pb(s,a,a.pendingProps,a.type,void 0,Ge);break;case 11:a=pb(s,a,a.pendingProps,a.type.render,a.ref,Ge);break;case 5:rh(a);default:kb(s,a),a=Ze=Yy(a,oa),a=Sb(s,a,oa)}r.memoizedProps=r.pendingProps,a===null?kc(r):Ze=a}function ts(r,a,s,c){Jr=Fi=null,rh(a),Hl=null,co=0;var p=a.return;try{if(g_(r,p,a,s,Ge)){zt=1,cc(r,ir(s,r.current)),Ze=null;return}}catch(v){if(p!==null)throw Ze=p,v;zt=1,cc(r,ir(s,r.current)),Ze=null;return}a.flags&32768?(Ye||c===1?r=!0:Xl||(Ge&536870912)!==0?r=!1:(Ha=r=!0,(c===2||c===9||c===3||c===6)&&(c=qn.current,c!==null&&c.tag===13&&(c.flags|=16384))),Wb(a,r)):kc(a)}function kc(r){var a=r;do{if((a.flags&32768)!==0){Wb(a,Ha);return}r=a.return;var s=b_(a.alternate,a,oa);if(s!==null){Ze=s;return}if(a=a.sibling,a!==null){Ze=a;return}Ze=a=r}while(a!==null);zt===0&&(zt=5)}function Wb(r,a){do{var s=x_(r.alternate,r);if(s!==null){s.flags&=32767,Ze=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(r=r.sibling,r!==null)){Ze=r;return}Ze=r=s}while(r!==null);zt=6,Ze=null}function ex(r,a,s,c,p,v,w,_,M){r.cancelPendingCommit=null;do jc();while(Ht!==0);if((it&6)!==0)throw Error(i(327));if(a!==null){if(a===r.current)throw Error(i(177));if(v=a.lanes|a.childLanes,v|=Tf,Tu(r,s,v,w,_,M),r===gt&&(Ze=gt=null,Ge=0),Wl=a,Qa=r,ua=s,Ih=v,Bh=p,qb=c,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,z_(Oe,function(){return ix(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||c){c=P.T,P.T=null,p=V.p,V.p=2,w=it,it|=4;try{S_(r,a,s)}finally{it=w,V.p=p,P.T=c}}Ht=1,tx(),nx(),rx()}}function tx(){if(Ht===1){Ht=0;var r=Qa,a=Wl,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=P.T,P.T=null;var c=V.p;V.p=2;var p=it;it|=4;try{Mb(a,r);var v=em,w=$y(r.containerInfo),_=v.focusedElem,M=v.selectionRange;if(w!==_&&_&&_.ownerDocument&&Py(_.ownerDocument.documentElement,_)){if(M!==null&&Ef(_)){var G=M.start,te=M.end;if(te===void 0&&(te=G),"selectionStart"in _)_.selectionStart=G,_.selectionEnd=Math.min(te,_.value.length);else{var se=_.ownerDocument||document,K=se&&se.defaultView||window;if(K.getSelection){var X=K.getSelection(),Se=_.textContent.length,ze=Math.min(M.start,Se),pt=M.end===void 0?ze:Math.min(M.end,Se);!X.extend&&ze>pt&&(w=pt,pt=ze,ze=w);var H=By(_,ze),$=By(_,pt);if(H&&$&&(X.rangeCount!==1||X.anchorNode!==H.node||X.anchorOffset!==H.offset||X.focusNode!==$.node||X.focusOffset!==$.offset)){var Q=se.createRange();Q.setStart(H.node,H.offset),X.removeAllRanges(),ze>pt?(X.addRange(Q),X.extend($.node,$.offset)):(Q.setEnd($.node,$.offset),X.addRange(Q))}}}}for(se=[],X=_;X=X.parentNode;)X.nodeType===1&&se.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<se.length;_++){var le=se[_];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Lc=!!Wh,em=Wh=null}finally{it=p,V.p=c,P.T=s}}r.current=a,Ht=2}}function nx(){if(Ht===2){Ht=0;var r=Qa,a=Wl,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=P.T,P.T=null;var c=V.p;V.p=2;var p=it;it|=4;try{Tb(r,a.alternate,a)}finally{it=p,V.p=c,P.T=s}}Ht=3}}function rx(){if(Ht===4||Ht===3){Ht=0,Zs();var r=Qa,a=Wl,s=ua,c=qb;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Ht=5:(Ht=0,Wl=Qa=null,ax(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Va=null),wl(s),a=a.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(rn,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=P.T,p=V.p,V.p=2,P.T=null;try{for(var v=r.onRecoverableError,w=0;w<c.length;w++){var _=c[w];v(_.value,{componentStack:_.stack})}}finally{P.T=a,V.p=p}}(ua&3)!==0&&jc(),Or(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===Ph?No++:(No=0,Ph=r):No=0,Ao(0)}}function ax(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,oo(a)))}function jc(){return tx(),nx(),rx(),ix()}function ix(){if(Ht!==5)return!1;var r=Qa,a=Ih;Ih=0;var s=wl(ua),c=P.T,p=V.p;try{V.p=32>s?32:s,P.T=null,s=Bh,Bh=null;var v=Qa,w=ua;if(Ht=0,Wl=Qa=null,ua=0,(it&6)!==0)throw Error(i(331));var _=it;if(it|=4,Pb(v.current),Ub(v,v.current,w,s),it=_,Ao(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(rn,v)}catch{}return!0}finally{V.p=p,P.T=c,ax(r,a)}}function lx(r,a,s){a=ir(s,a),a=vh(r.stateNode,a,2),r=Pa(r,a,2),r!==null&&(Ra(r,2),Or(r))}function dt(r,a,s){if(r.tag===3)lx(r,r,s);else for(;a!==null;){if(a.tag===3){lx(a,r,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Va===null||!Va.has(c))){r=ir(s,r),s=sb(2),c=Pa(a,s,2),c!==null&&(ob(s,c,a,r),Ra(c,2),Or(c));break}}a=a.return}}function qh(r,a,s){var c=r.pingCache;if(c===null){c=r.pingCache=new j_;var p=new Set;c.set(a,p)}else p=c.get(a),p===void 0&&(p=new Set,c.set(a,p));p.has(s)||(Mh=!0,p.add(s),r=A_.bind(null,r,a,s),a.then(r,r))}function A_(r,a,s){var c=r.pingCache;c!==null&&c.delete(a),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,gt===r&&(Ge&s)===s&&(zt===4||zt===3&&(Ge&62914560)===Ge&&300>nn()-vc?(it&2)===0&&es(r,0):Lh|=s,Jl===Ge&&(Jl=0)),Or(r)}function sx(r,a){a===0&&(a=Qs()),r=Bi(r,a),r!==null&&(Ra(r,a),Or(r))}function T_(r){var a=r.memoizedState,s=0;a!==null&&(s=a.retryLane),sx(r,s)}function R_(r,a){var s=0;switch(r.tag){case 31:case 13:var c=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(a),sx(r,s)}function z_(r,a){return Vr(r,a)}var Ec=null,ns=null,Hh=!1,Cc=!1,Zh=!1,Ka=0;function Or(r){r!==ns&&r.next===null&&(ns===null?Ec=ns=r:ns=ns.next=r),Cc=!0,Hh||(Hh=!0,D_())}function Ao(r,a){if(!Zh&&Cc){Zh=!0;do for(var s=!1,c=Ec;c!==null;){if(r!==0){var p=c.pendingLanes;if(p===0)var v=0;else{var w=c.suspendedLanes,_=c.pingedLanes;v=(1<<31-ut(42|r)+1)-1,v&=p&~(w&~_),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,dx(c,v))}else v=Ge,v=Di(c,c===gt?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||Ta(c,v)||(s=!0,dx(c,v));c=c.next}while(s);Zh=!1}}function O_(){ox()}function ox(){Cc=Hh=!1;var r=0;Ka!==0&&H_()&&(r=Ka);for(var a=nn(),s=null,c=Ec;c!==null;){var p=c.next,v=ux(c,a);v===0?(c.next=null,s===null?Ec=p:s.next=p,p===null&&(ns=s)):(s=c,(r!==0||(v&3)!==0)&&(Cc=!0)),c=p}Ht!==0&&Ht!==5||Ao(r),Ka!==0&&(Ka=0)}function ux(r,a){for(var s=r.suspendedLanes,c=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var w=31-ut(v),_=1<<w,M=p[w];M===-1?((_&s)===0||(_&c)!==0)&&(p[w]=Au(_,a)):M<=a&&(r.expiredLanes|=_),v&=~_}if(a=gt,s=Ge,s=Di(r,r===a?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,s===0||r===a&&(ct===2||ct===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&Ai(c),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ta(r,s)){if(a=s&-s,a===r.callbackPriority)return a;switch(c!==null&&Ai(c),wl(s)){case 2:case 8:s=me;break;case 32:s=Oe;break;case 268435456:s=nt;break;default:s=Oe}return c=cx.bind(null,r),s=Vr(s,c),r.callbackPriority=a,r.callbackNode=s,a}return c!==null&&c!==null&&Ai(c),r.callbackPriority=2,r.callbackNode=null,2}function cx(r,a){if(Ht!==0&&Ht!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(jc()&&r.callbackNode!==s)return null;var c=Ge;return c=Di(r,r===gt?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(Zb(r,c,a),ux(r,nn()),r.callbackNode!=null&&r.callbackNode===s?cx.bind(null,r):null)}function dx(r,a){if(jc())return null;Zb(r,a,!0)}function D_(){V_(function(){(it&6)!==0?Vr(ne,O_):ox()})}function Vh(){if(Ka===0){var r=$l;r===0&&(r=Ri,Ri<<=1,(Ri&261888)===0&&(Ri=256)),Ka=r}return Ka}function fx(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Du(""+r)}function hx(r,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,r.id&&s.setAttribute("form",r.id),a.parentNode.insertBefore(s,a),r=new FormData(r),s.parentNode.removeChild(s),r}function M_(r,a,s,c,p){if(a==="submit"&&s&&s.stateNode===p){var v=fx((p[wn]||null).action),w=c.submitter;w&&(a=(a=w[wn]||null)?fx(a.formAction):w.getAttribute("formAction"),a!==null&&(v=a,w=null));var _=new Iu("action","action",null,c,p);r.push({event:_,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ka!==0){var M=w?hx(p,w):new FormData(p);fh(s,{pending:!0,data:M,method:p.method,action:v},null,M)}}else typeof v=="function"&&(_.preventDefault(),M=w?hx(p,w):new FormData(p),fh(s,{pending:!0,data:M,method:p.method,action:v},v,M))},currentTarget:p}]})}}for(var Qh=0;Qh<Af.length;Qh++){var Gh=Af[Qh],L_=Gh.toLowerCase(),U_=Gh[0].toUpperCase()+Gh.slice(1);Sr(L_,"on"+U_)}Sr(Hy,"onAnimationEnd"),Sr(Zy,"onAnimationIteration"),Sr(Vy,"onAnimationStart"),Sr("dblclick","onDoubleClick"),Sr("focusin","onFocus"),Sr("focusout","onBlur"),Sr(WC,"onTransitionRun"),Sr(e_,"onTransitionStart"),Sr(t_,"onTransitionCancel"),Sr(Qy,"onTransitionEnd"),_l("onMouseEnter",["mouseout","mouseover"]),_l("onMouseLeave",["mouseout","mouseover"]),_l("onPointerEnter",["pointerout","pointerover"]),_l("onPointerLeave",["pointerout","pointerover"]),Mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var To="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(" "),I_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(To));function mx(r,a){a=(a&4)!==0;for(var s=0;s<r.length;s++){var c=r[s],p=c.event;c=c.listeners;e:{var v=void 0;if(a)for(var w=c.length-1;0<=w;w--){var _=c[w],M=_.instance,G=_.currentTarget;if(_=_.listener,M!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=G;try{v(p)}catch(te){$u(te)}p.currentTarget=null,v=M}else for(w=0;w<c.length;w++){if(_=c[w],M=_.instance,G=_.currentTarget,_=_.listener,M!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=G;try{v(p)}catch(te){$u(te)}p.currentTarget=null,v=M}}}}function Ve(r,a){var s=a[sf];s===void 0&&(s=a[sf]=new Set);var c=r+"__bubble";s.has(c)||(px(a,r,2,!1),s.add(c))}function Kh(r,a,s){var c=0;a&&(c|=4),px(s,r,c,a)}var _c="_reactListening"+Math.random().toString(36).slice(2);function Yh(r){if(!r[_c]){r[_c]=!0,oy.forEach(function(s){s!=="selectionchange"&&(I_.has(s)||Kh(s,!1,r),Kh(s,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[_c]||(a[_c]=!0,Kh("selectionchange",!1,a))}}function px(r,a,s,c){switch(Hx(a)){case 2:var p=fN;break;case 8:p=hN;break;default:p=dm}s=p.bind(null,a,s,r),p=void 0,!gf||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(p=!0),c?p!==void 0?r.addEventListener(a,s,{capture:!0,passive:p}):r.addEventListener(a,s,!0):p!==void 0?r.addEventListener(a,s,{passive:p}):r.addEventListener(a,s,!1)}function Xh(r,a,s,c,p){var v=c;if((a&1)===0&&(a&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var _=c.stateNode.containerInfo;if(_===p)break;if(w===4)for(w=c.return;w!==null;){var M=w.tag;if((M===3||M===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;_!==null;){if(w=jl(_),w===null)return;if(M=w.tag,M===5||M===6||M===26||M===27){c=v=w;continue e}_=_.parentNode}}c=c.return}xy(function(){var G=v,te=mf(s),se=[];e:{var K=Gy.get(r);if(K!==void 0){var X=Iu,Se=r;switch(r){case"keypress":if(Lu(s)===0)break e;case"keydown":case"keyup":X=RC;break;case"focusin":Se="focus",X=xf;break;case"focusout":Se="blur",X=xf;break;case"beforeblur":case"afterblur":X=xf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=ky;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=bC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=DC;break;case Hy:case Zy:case Vy:X=wC;break;case Qy:X=LC;break;case"scroll":case"scrollend":X=yC;break;case"wheel":X=IC;break;case"copy":case"cut":case"paste":X=jC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Ey;break;case"toggle":case"beforetoggle":X=PC}var ze=(a&4)!==0,pt=!ze&&(r==="scroll"||r==="scrollend"),H=ze?K!==null?K+"Capture":null:K;ze=[];for(var $=G,Q;$!==null;){var le=$;if(Q=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Q===null||H===null||(le=Xs($,H),le!=null&&ze.push(Ro($,le,Q))),pt)break;$=$.return}0<ze.length&&(K=new X(K,Se,null,s,te),se.push({event:K,listeners:ze}))}}if((a&7)===0){e:{if(K=r==="mouseover"||r==="pointerover",X=r==="mouseout"||r==="pointerout",K&&s!==hf&&(Se=s.relatedTarget||s.fromElement)&&(jl(Se)||Se[kl]))break e;if((X||K)&&(K=te.window===te?te:(K=te.ownerDocument)?K.defaultView||K.parentWindow:window,X?(Se=s.relatedTarget||s.toElement,X=G,Se=Se?jl(Se):null,Se!==null&&(pt=o(Se),ze=Se.tag,Se!==pt||ze!==5&&ze!==27&&ze!==6)&&(Se=null)):(X=null,Se=G),X!==Se)){if(ze=ky,le="onMouseLeave",H="onMouseEnter",$="mouse",(r==="pointerout"||r==="pointerover")&&(ze=Ey,le="onPointerLeave",H="onPointerEnter",$="pointer"),pt=X==null?K:Ys(X),Q=Se==null?K:Ys(Se),K=new ze(le,$+"leave",X,s,te),K.target=pt,K.relatedTarget=Q,le=null,jl(te)===G&&(ze=new ze(H,$+"enter",Se,s,te),ze.target=Q,ze.relatedTarget=pt,le=ze),pt=le,X&&Se)t:{for(ze=B_,H=X,$=Se,Q=0,le=H;le;le=ze(le))Q++;le=0;for(var Ne=$;Ne;Ne=ze(Ne))le++;for(;0<Q-le;)H=ze(H),Q--;for(;0<le-Q;)$=ze($),le--;for(;Q--;){if(H===$||$!==null&&H===$.alternate){ze=H;break t}H=ze(H),$=ze($)}ze=null}else ze=null;X!==null&&gx(se,K,X,ze,!1),Se!==null&&pt!==null&&gx(se,pt,Se,ze,!0)}}e:{if(K=G?Ys(G):window,X=K.nodeName&&K.nodeName.toLowerCase(),X==="select"||X==="input"&&K.type==="file")var rt=Oy;else if(Ry(K))if(Dy)rt=YC;else{rt=GC;var je=QC}else X=K.nodeName,!X||X.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?G&&ff(G.elementType)&&(rt=Oy):rt=KC;if(rt&&(rt=rt(r,G))){zy(se,rt,s,te);break e}je&&je(r,K,G),r==="focusout"&&G&&K.type==="number"&&G.memoizedProps.value!=null&&df(K,"number",K.value)}switch(je=G?Ys(G):window,r){case"focusin":(Ry(je)||je.contentEditable==="true")&&(Ol=je,Cf=G,io=null);break;case"focusout":io=Cf=Ol=null;break;case"mousedown":_f=!0;break;case"contextmenu":case"mouseup":case"dragend":_f=!1,Fy(se,s,te);break;case"selectionchange":if(JC)break;case"keydown":case"keyup":Fy(se,s,te)}var Ie;if(wf)e:{switch(r){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else zl?Ay(r,s)&&(Ke="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(Ke="onCompositionStart");Ke&&(Cy&&s.locale!=="ko"&&(zl||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&zl&&(Ie=Sy()):(Oa=te,yf="value"in Oa?Oa.value:Oa.textContent,zl=!0)),je=Nc(G,Ke),0<je.length&&(Ke=new jy(Ke,r,null,s,te),se.push({event:Ke,listeners:je}),Ie?Ke.data=Ie:(Ie=Ty(s),Ie!==null&&(Ke.data=Ie)))),(Ie=FC?qC(r,s):HC(r,s))&&(Ke=Nc(G,"onBeforeInput"),0<Ke.length&&(je=new jy("onBeforeInput","beforeinput",null,s,te),se.push({event:je,listeners:Ke}),je.data=Ie)),M_(se,r,G,s,te)}mx(se,a)})}function Ro(r,a,s){return{instance:r,listener:a,currentTarget:s}}function Nc(r,a){for(var s=a+"Capture",c=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=Xs(r,s),p!=null&&c.unshift(Ro(r,p,v)),p=Xs(r,a),p!=null&&c.push(Ro(r,p,v))),r.tag===3)return c;r=r.return}return[]}function B_(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function gx(r,a,s,c,p){for(var v=a._reactName,w=[];s!==null&&s!==c;){var _=s,M=_.alternate,G=_.stateNode;if(_=_.tag,M!==null&&M===c)break;_!==5&&_!==26&&_!==27||G===null||(M=G,p?(G=Xs(s,v),G!=null&&w.unshift(Ro(s,G,M))):p||(G=Xs(s,v),G!=null&&w.push(Ro(s,G,M)))),s=s.return}w.length!==0&&r.push({event:a,listeners:w})}var P_=/\r\n?/g,$_=/\u0000|\uFFFD/g;function yx(r){return(typeof r=="string"?r:""+r).replace(P_,`
|
|
49
|
+
`).replace($_,"")}function vx(r,a){return a=yx(a),yx(r)===a}function mt(r,a,s,c,p,v){switch(s){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||Al(r,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&Al(r,""+c);break;case"className":zu(r,"class",c);break;case"tabIndex":zu(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":zu(r,s,c);break;case"style":vy(r,c,v);break;case"data":if(a!=="object"){zu(r,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||s!=="href")){r.removeAttribute(s);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Du(""+c),r.setAttribute(s,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(s,"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 v=="function"&&(s==="formAction"?(a!=="input"&&mt(r,a,"name",p.name,p,null),mt(r,a,"formEncType",p.formEncType,p,null),mt(r,a,"formMethod",p.formMethod,p,null),mt(r,a,"formTarget",p.formTarget,p,null)):(mt(r,a,"encType",p.encType,p,null),mt(r,a,"method",p.method,p,null),mt(r,a,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(s);break}c=Du(""+c),r.setAttribute(s,c);break;case"onClick":c!=null&&(r.onclick=Gr);break;case"onScroll":c!=null&&Ve("scroll",r);break;case"onScrollEnd":c!=null&&Ve("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=s}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}s=Du(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""+c):r.removeAttribute(s);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":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":c===!0?r.setAttribute(s,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(s,c):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(s,c):r.removeAttribute(s);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(s):r.setAttribute(s,c);break;case"popover":Ve("beforetoggle",r),Ve("toggle",r),Ru(r,"popover",c);break;case"xlinkActuate":Qr(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Qr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Qr(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Qr(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Qr(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Qr(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Qr(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Qr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Qr(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Ru(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=pC.get(s)||s,Ru(r,s,c))}}function Jh(r,a,s,c,p,v){switch(s){case"style":vy(r,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(s=c.__html,s!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=s}}break;case"children":typeof c=="string"?Al(r,c):(typeof c=="number"||typeof c=="bigint")&&Al(r,""+c);break;case"onScroll":c!=null&&Ve("scroll",r);break;case"onScrollEnd":c!=null&&Ve("scrollend",r);break;case"onClick":c!=null&&(r.onclick=Gr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!uy.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),a=s.slice(2,p?s.length-7:void 0),v=r[wn]||null,v=v!=null?v[s]:null,typeof v=="function"&&r.removeEventListener(a,v,p),typeof c=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(a,c,p);break e}s in r?r[s]=c:c===!0?r.setAttribute(s,""):Ru(r,s,c)}}}function un(r,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",r),Ve("load",r);var c=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var w=s[v];if(w!=null)switch(v){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:mt(r,a,v,w,s,null)}}p&&mt(r,a,"srcSet",s.srcSet,s,null),c&&mt(r,a,"src",s.src,s,null);return;case"input":Ve("invalid",r);var _=v=w=p=null,M=null,G=null;for(c in s)if(s.hasOwnProperty(c)){var te=s[c];if(te!=null)switch(c){case"name":p=te;break;case"type":w=te;break;case"checked":M=te;break;case"defaultChecked":G=te;break;case"value":v=te;break;case"defaultValue":_=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(i(137,a));break;default:mt(r,a,c,te,s,null)}}my(r,v,_,M,G,w,p,!1);return;case"select":Ve("invalid",r),c=w=v=null;for(p in s)if(s.hasOwnProperty(p)&&(_=s[p],_!=null))switch(p){case"value":v=_;break;case"defaultValue":w=_;break;case"multiple":c=_;default:mt(r,a,p,_,s,null)}a=v,s=w,r.multiple=!!c,a!=null?Nl(r,!!c,a,!1):s!=null&&Nl(r,!!c,s,!0);return;case"textarea":Ve("invalid",r),v=p=c=null;for(w in s)if(s.hasOwnProperty(w)&&(_=s[w],_!=null))switch(w){case"value":c=_;break;case"defaultValue":p=_;break;case"children":v=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(i(91));break;default:mt(r,a,w,_,s,null)}gy(r,c,p,v);return;case"option":for(M in s)if(s.hasOwnProperty(M)&&(c=s[M],c!=null))switch(M){case"selected":r.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:mt(r,a,M,c,s,null)}return;case"dialog":Ve("beforetoggle",r),Ve("toggle",r),Ve("cancel",r),Ve("close",r);break;case"iframe":case"object":Ve("load",r);break;case"video":case"audio":for(c=0;c<To.length;c++)Ve(To[c],r);break;case"image":Ve("error",r),Ve("load",r);break;case"details":Ve("toggle",r);break;case"embed":case"source":case"link":Ve("error",r),Ve("load",r);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 s)if(s.hasOwnProperty(G)&&(c=s[G],c!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:mt(r,a,G,c,s,null)}return;default:if(ff(a)){for(te in s)s.hasOwnProperty(te)&&(c=s[te],c!==void 0&&Jh(r,a,te,c,s,void 0));return}}for(_ in s)s.hasOwnProperty(_)&&(c=s[_],c!=null&&mt(r,a,_,c,s,null))}function F_(r,a,s,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,w=null,_=null,M=null,G=null,te=null;for(X in s){var se=s[X];if(s.hasOwnProperty(X)&&se!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":M=se;default:c.hasOwnProperty(X)||mt(r,a,X,null,c,se)}}for(var K in c){var X=c[K];if(se=s[K],c.hasOwnProperty(K)&&(X!=null||se!=null))switch(K){case"type":v=X;break;case"name":p=X;break;case"checked":G=X;break;case"defaultChecked":te=X;break;case"value":w=X;break;case"defaultValue":_=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,a));break;default:X!==se&&mt(r,a,K,X,c,se)}}cf(r,w,_,M,G,te,v,p);return;case"select":X=w=_=K=null;for(v in s)if(M=s[v],s.hasOwnProperty(v)&&M!=null)switch(v){case"value":break;case"multiple":X=M;default:c.hasOwnProperty(v)||mt(r,a,v,null,c,M)}for(p in c)if(v=c[p],M=s[p],c.hasOwnProperty(p)&&(v!=null||M!=null))switch(p){case"value":K=v;break;case"defaultValue":_=v;break;case"multiple":w=v;default:v!==M&&mt(r,a,p,v,c,M)}a=_,s=w,c=X,K!=null?Nl(r,!!s,K,!1):!!c!=!!s&&(a!=null?Nl(r,!!s,a,!0):Nl(r,!!s,s?[]:"",!1));return;case"textarea":X=K=null;for(_ in s)if(p=s[_],s.hasOwnProperty(_)&&p!=null&&!c.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:mt(r,a,_,null,c,p)}for(w in c)if(p=c[w],v=s[w],c.hasOwnProperty(w)&&(p!=null||v!=null))switch(w){case"value":K=p;break;case"defaultValue":X=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(i(91));break;default:p!==v&&mt(r,a,w,p,c,v)}py(r,K,X);return;case"option":for(var Se in s)if(K=s[Se],s.hasOwnProperty(Se)&&K!=null&&!c.hasOwnProperty(Se))switch(Se){case"selected":r.selected=!1;break;default:mt(r,a,Se,null,c,K)}for(M in c)if(K=c[M],X=s[M],c.hasOwnProperty(M)&&K!==X&&(K!=null||X!=null))switch(M){case"selected":r.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:mt(r,a,M,K,c,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 ze in s)K=s[ze],s.hasOwnProperty(ze)&&K!=null&&!c.hasOwnProperty(ze)&&mt(r,a,ze,null,c,K);for(G in c)if(K=c[G],X=s[G],c.hasOwnProperty(G)&&K!==X&&(K!=null||X!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(i(137,a));break;default:mt(r,a,G,K,c,X)}return;default:if(ff(a)){for(var pt in s)K=s[pt],s.hasOwnProperty(pt)&&K!==void 0&&!c.hasOwnProperty(pt)&&Jh(r,a,pt,void 0,c,K);for(te in c)K=c[te],X=s[te],!c.hasOwnProperty(te)||K===X||K===void 0&&X===void 0||Jh(r,a,te,K,c,X);return}}for(var H in s)K=s[H],s.hasOwnProperty(H)&&K!=null&&!c.hasOwnProperty(H)&&mt(r,a,H,null,c,K);for(se in c)K=c[se],X=s[se],!c.hasOwnProperty(se)||K===X||K==null&&X==null||mt(r,a,se,K,c,X)}function bx(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function q_(){if(typeof performance.getEntriesByType=="function"){for(var r=0,a=0,s=performance.getEntriesByType("resource"),c=0;c<s.length;c++){var p=s[c],v=p.transferSize,w=p.initiatorType,_=p.duration;if(v&&_&&bx(w)){for(w=0,_=p.responseEnd,c+=1;c<s.length;c++){var M=s[c],G=M.startTime;if(G>_)break;var te=M.transferSize,se=M.initiatorType;te&&bx(se)&&(M=M.responseEnd,w+=te*(M<_?1:(_-G)/(M-G)))}if(--c,a+=8*(v+w)/(p.duration/1e3),r++,10<r)break}}if(0<r)return a/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Wh=null,em=null;function Ac(r){return r.nodeType===9?r:r.ownerDocument}function xx(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sx(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function tm(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var nm=null;function H_(){var r=window.event;return r&&r.type==="popstate"?r===nm?!1:(nm=r,!0):(nm=null,!1)}var wx=typeof setTimeout=="function"?setTimeout:void 0,Z_=typeof clearTimeout=="function"?clearTimeout:void 0,kx=typeof Promise=="function"?Promise:void 0,V_=typeof queueMicrotask=="function"?queueMicrotask:typeof kx<"u"?function(r){return kx.resolve(null).then(r).catch(Q_)}:wx;function Q_(r){setTimeout(function(){throw r})}function Ya(r){return r==="head"}function jx(r,a){var s=a,c=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(c===0){r.removeChild(p),ls(a);return}c--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")c++;else if(s==="html")zo(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,zo(s);for(var v=s.firstChild;v;){var w=v.nextSibling,_=v.nodeName;v[Ks]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=w}}else s==="body"&&zo(r.ownerDocument.body);s=p}while(s);ls(a)}function Ex(r,a){var s=r;r=0;do{var c=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=c}while(s)}function rm(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":rm(s),of(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function G_(r,a,s,c){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[Ks])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=cr(r.nextSibling),r===null)break}return null}function K_(r,a,s){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=cr(r.nextSibling),r===null))return null;return r}function Cx(r,a){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=cr(r.nextSibling),r===null))return null;return r}function am(r){return r.data==="$?"||r.data==="$~"}function im(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function Y_(r,a){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=a;else if(r.data!=="$?"||s.readyState!=="loading")a();else{var c=function(){a(),s.removeEventListener("DOMContentLoaded",c)};s.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function cr(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return r}var lm=null;function _x(r){r=r.nextSibling;for(var a=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(a===0)return cr(r.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}r=r.nextSibling}return null}function Nx(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return r;a--}else s!=="/$"&&s!=="/&"||a++}r=r.previousSibling}return null}function Ax(r,a,s){switch(a=Ac(s),r){case"html":if(r=a.documentElement,!r)throw Error(i(452));return r;case"head":if(r=a.head,!r)throw Error(i(453));return r;case"body":if(r=a.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function zo(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);of(r)}var dr=new Map,Tx=new Set;function Tc(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ca=V.d;V.d={f:X_,r:J_,D:W_,C:eN,L:tN,m:nN,X:aN,S:rN,M:iN};function X_(){var r=ca.f(),a=Sc();return r||a}function J_(r){var a=El(r);a!==null&&a.tag===5&&a.type==="form"?Qv(a):ca.r(r)}var rs=typeof document>"u"?null:document;function Rx(r,a,s){var c=rs;if(c&&typeof a=="string"&&a){var p=rr(a);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),Tx.has(p)||(Tx.add(p),r={rel:r,crossOrigin:s,href:a},c.querySelector(p)===null&&(a=c.createElement("link"),un(a,"link",r),Yt(a),c.head.appendChild(a)))}}function W_(r){ca.D(r),Rx("dns-prefetch",r,null)}function eN(r,a){ca.C(r,a),Rx("preconnect",r,a)}function tN(r,a,s){ca.L(r,a,s);var c=rs;if(c&&r&&a){var p='link[rel="preload"][as="'+rr(a)+'"]';a==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+rr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+rr(s.imageSizes)+'"]')):p+='[href="'+rr(r)+'"]';var v=p;switch(a){case"style":v=as(r);break;case"script":v=is(r)}dr.has(v)||(r=g({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:r,as:a},s),dr.set(v,r),c.querySelector(p)!==null||a==="style"&&c.querySelector(Oo(v))||a==="script"&&c.querySelector(Do(v))||(a=c.createElement("link"),un(a,"link",r),Yt(a),c.head.appendChild(a)))}}function nN(r,a){ca.m(r,a);var s=rs;if(s&&r){var c=a&&typeof a.as=="string"?a.as:"script",p='link[rel="modulepreload"][as="'+rr(c)+'"][href="'+rr(r)+'"]',v=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=is(r)}if(!dr.has(v)&&(r=g({rel:"modulepreload",href:r},a),dr.set(v,r),s.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Do(v)))return}c=s.createElement("link"),un(c,"link",r),Yt(c),s.head.appendChild(c)}}}function rN(r,a,s){ca.S(r,a,s);var c=rs;if(c&&r){var p=Cl(c).hoistableStyles,v=as(r);a=a||"default";var w=p.get(v);if(!w){var _={loading:0,preload:null};if(w=c.querySelector(Oo(v)))_.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":a},s),(s=dr.get(v))&&sm(r,s);var M=w=c.createElement("link");Yt(M),un(M,"link",r),M._p=new Promise(function(G,te){M.onload=G,M.onerror=te}),M.addEventListener("load",function(){_.loading|=1}),M.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Rc(w,a,c)}w={type:"stylesheet",instance:w,count:1,state:_},p.set(v,w)}}}function aN(r,a){ca.X(r,a);var s=rs;if(s&&r){var c=Cl(s).hoistableScripts,p=is(r),v=c.get(p);v||(v=s.querySelector(Do(p)),v||(r=g({src:r,async:!0},a),(a=dr.get(p))&&om(r,a),v=s.createElement("script"),Yt(v),un(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function iN(r,a){ca.M(r,a);var s=rs;if(s&&r){var c=Cl(s).hoistableScripts,p=is(r),v=c.get(p);v||(v=s.querySelector(Do(p)),v||(r=g({src:r,async:!0,type:"module"},a),(a=dr.get(p))&&om(r,a),v=s.createElement("script"),Yt(v),un(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(p,v))}}function zx(r,a,s,c){var p=(p=ue.current)?Tc(p):null;if(!p)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=as(s.href),s=Cl(p).hoistableStyles,c=s.get(a),c||(c={type:"style",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=as(s.href);var v=Cl(p).hoistableStyles,w=v.get(r);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,w),(v=p.querySelector(Oo(r)))&&!v._p&&(w.instance=v,w.state.loading=5),dr.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},dr.set(r,s),v||lN(p,r,s,w.state))),a&&c===null)throw Error(i(528,""));return w}if(a&&c!==null)throw Error(i(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=is(s),s=Cl(p).hoistableScripts,c=s.get(a),c||(c={type:"script",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function as(r){return'href="'+rr(r)+'"'}function Oo(r){return'link[rel="stylesheet"]['+r+"]"}function Ox(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function lN(r,a,s,c){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=r.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),un(a,"link",s),Yt(a),r.head.appendChild(a))}function is(r){return'[src="'+rr(r)+'"]'}function Do(r){return"script[async]"+r}function Dx(r,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=r.querySelector('style[data-href~="'+rr(s.href)+'"]');if(c)return a.instance=c,Yt(c),c;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),Yt(c),un(c,"style",p),Rc(c,s.precedence,r),a.instance=c;case"stylesheet":p=as(s.href);var v=r.querySelector(Oo(p));if(v)return a.state.loading|=4,a.instance=v,Yt(v),v;c=Ox(s),(p=dr.get(p))&&sm(c,p),v=(r.ownerDocument||r).createElement("link"),Yt(v);var w=v;return w._p=new Promise(function(_,M){w.onload=_,w.onerror=M}),un(v,"link",c),a.state.loading|=4,Rc(v,s.precedence,r),a.instance=v;case"script":return v=is(s.src),(p=r.querySelector(Do(v)))?(a.instance=p,Yt(p),p):(c=s,(p=dr.get(v))&&(c=g({},s),om(c,p)),r=r.ownerDocument||r,p=r.createElement("script"),Yt(p),un(p,"link",c),r.head.appendChild(p),a.instance=p);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,Rc(c,s.precedence,r));return a.instance}function Rc(r,a,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,v=p,w=0;w<c.length;w++){var _=c[w];if(_.dataset.precedence===a)v=_;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(r,a.firstChild))}function sm(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.title==null&&(r.title=a.title)}function om(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.integrity==null&&(r.integrity=a.integrity)}var zc=null;function Mx(r,a,s){if(zc===null){var c=new Map,p=zc=new Map;p.set(s,c)}else p=zc,c=p.get(s),c||(c=new Map,p.set(s,c));if(c.has(r))return c;for(c.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[Ks]||v[an]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(a)||"";w=r+w;var _=c.get(w);_?_.push(v):c.set(w,[v])}}return c}function Lx(r,a,s){r=r.ownerDocument||r,r.head.insertBefore(s,a==="title"?r.querySelector("head > title"):null)}function sN(r,a,s){if(s===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return r=a.disabled,typeof a.precedence=="string"&&r==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Ux(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function oN(r,a,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=as(c.href),v=a.querySelector(Oo(p));if(v){a=v._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(r.count++,r=Oc.bind(r),a.then(r,r)),s.state.loading|=4,s.instance=v,Yt(v);return}v=a.ownerDocument||a,c=Ox(c),(p=dr.get(p))&&sm(c,p),v=v.createElement("link"),Yt(v);var w=v;w._p=new Promise(function(_,M){w.onload=_,w.onerror=M}),un(v,"link",c),s.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=Oc.bind(r),a.addEventListener("load",s),a.addEventListener("error",s))}}var um=0;function uN(r,a){return r.stylesheets&&r.count===0&&Mc(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var c=setTimeout(function(){if(r.stylesheets&&Mc(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+a);0<r.imgBytes&&um===0&&(um=62500*q_());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Mc(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>um?50:800)+a);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Oc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mc(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Dc=null;function Mc(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Dc=new Map,a.forEach(cN,r),Dc=null,Oc.call(r))}function cN(r,a){if(!(a.state.loading&4)){var s=Dc.get(r);if(s)var c=s.get(null);else{s=new Map,Dc.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var w=p[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(s.set(w.dataset.precedence,w),c=w)}c&&s.set(null,c)}p=a.instance,w=p.getAttribute("data-precedence"),v=s.get(w)||c,v===c&&s.set(null,p),s.set(w,p),this.count++,c=Oc.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),a.state.loading|=4}}var Mo={$$typeof:O,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function dN(r,a,s,c,p,v,w,_,M){this.tag=1,this.containerInfo=r,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=Sl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sl(0),this.hiddenUpdates=Sl(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Ix(r,a,s,c,p,v,w,_,M,G,te,se){return r=new dN(r,a,s,w,M,G,te,se,_),a=1,v===!0&&(a|=24),v=Fn(3,null,null,a),r.current=v,v.stateNode=r,a=Ff(),a.refCount++,r.pooledCache=a,a.refCount++,v.memoizedState={element:c,isDehydrated:s,cache:a},Vf(v),r}function Bx(r){return r?(r=Ll,r):Ll}function Px(r,a,s,c,p,v){p=Bx(p),c.context===null?c.context=p:c.pendingContext=p,c=Ba(a),c.payload={element:s},v=v===void 0?null:v,v!==null&&(c.callback=v),s=Pa(r,c,a),s!==null&&(Nn(s,r,a),ho(s,r,a))}function $x(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<a?s:a}}function cm(r,a){$x(r,a),(r=r.alternate)&&$x(r,a)}function Fx(r){if(r.tag===13||r.tag===31){var a=Bi(r,67108864);a!==null&&Nn(a,r,67108864),cm(r,67108864)}}function qx(r){if(r.tag===13||r.tag===31){var a=Qn();a=Kt(a);var s=Bi(r,a);s!==null&&Nn(s,r,a),cm(r,a)}}var Lc=!0;function fN(r,a,s,c){var p=P.T;P.T=null;var v=V.p;try{V.p=2,dm(r,a,s,c)}finally{V.p=v,P.T=p}}function hN(r,a,s,c){var p=P.T;P.T=null;var v=V.p;try{V.p=8,dm(r,a,s,c)}finally{V.p=v,P.T=p}}function dm(r,a,s,c){if(Lc){var p=fm(c);if(p===null)Xh(r,a,c,Uc,s),Zx(r,c);else if(pN(p,r,a,s,c))c.stopPropagation();else if(Zx(r,c),a&4&&-1<mN.indexOf(r)){for(;p!==null;){var v=El(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Ar(v.pendingLanes);if(w!==0){var _=v;for(_.pendingLanes|=2,_.entangledLanes|=2;w;){var M=1<<31-ut(w);_.entanglements[1]|=M,w&=~M}Or(v),(it&6)===0&&(bc=nn()+500,Ao(0))}}break;case 31:case 13:_=Bi(v,2),_!==null&&Nn(_,v,2),Sc(),cm(v,2)}if(v=fm(c),v===null&&Xh(r,a,c,Uc,s),v===p)break;p=v}p!==null&&c.stopPropagation()}else Xh(r,a,c,null,s)}}function fm(r){return r=mf(r),hm(r)}var Uc=null;function hm(r){if(Uc=null,r=jl(r),r!==null){var a=o(r);if(a===null)r=null;else{var s=a.tag;if(s===13){if(r=u(a),r!==null)return r;r=null}else if(s===31){if(r=f(a),r!==null)return r;r=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return Uc=r,null}function Hx(r){switch(r){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(Vs()){case ne:return 2;case me:return 8;case Oe:case $e:return 32;case nt:return 268435456;default:return 32}default:return 32}}var mm=!1,Xa=null,Ja=null,Wa=null,Lo=new Map,Uo=new Map,ei=[],mN="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 Zx(r,a){switch(r){case"focusin":case"focusout":Xa=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":Wa=null;break;case"pointerover":case"pointerout":Lo.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(a.pointerId)}}function Io(r,a,s,c,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:a,domEventName:s,eventSystemFlags:c,nativeEvent:v,targetContainers:[p]},a!==null&&(a=El(a),a!==null&&Fx(a)),r):(r.eventSystemFlags|=c,a=r.targetContainers,p!==null&&a.indexOf(p)===-1&&a.push(p),r)}function pN(r,a,s,c,p){switch(a){case"focusin":return Xa=Io(Xa,r,a,s,c,p),!0;case"dragenter":return Ja=Io(Ja,r,a,s,c,p),!0;case"mouseover":return Wa=Io(Wa,r,a,s,c,p),!0;case"pointerover":var v=p.pointerId;return Lo.set(v,Io(Lo.get(v)||null,r,a,s,c,p)),!0;case"gotpointercapture":return v=p.pointerId,Uo.set(v,Io(Uo.get(v)||null,r,a,s,c,p)),!0}return!1}function Vx(r){var a=jl(r.target);if(a!==null){var s=o(a);if(s!==null){if(a=s.tag,a===13){if(a=u(s),a!==null){r.blockedOn=a,ly(r.priority,function(){qx(s)});return}}else if(a===31){if(a=f(s),a!==null){r.blockedOn=a,ly(r.priority,function(){qx(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Ic(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var s=fm(r.nativeEvent);if(s===null){s=r.nativeEvent;var c=new s.constructor(s.type,s);hf=c,s.target.dispatchEvent(c),hf=null}else return a=El(s),a!==null&&Fx(a),r.blockedOn=s,!1;a.shift()}return!0}function Qx(r,a,s){Ic(r)&&s.delete(a)}function gN(){mm=!1,Xa!==null&&Ic(Xa)&&(Xa=null),Ja!==null&&Ic(Ja)&&(Ja=null),Wa!==null&&Ic(Wa)&&(Wa=null),Lo.forEach(Qx),Uo.forEach(Qx)}function Bc(r,a){r.blockedOn===a&&(r.blockedOn=null,mm||(mm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,gN)))}var Pc=null;function Gx(r){Pc!==r&&(Pc=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Pc===r&&(Pc=null);for(var a=0;a<r.length;a+=3){var s=r[a],c=r[a+1],p=r[a+2];if(typeof c!="function"){if(hm(c||s)===null)continue;break}var v=El(s);v!==null&&(r.splice(a,3),a-=3,fh(v,{pending:!0,data:p,method:s.method,action:c},c,p))}}))}function ls(r){function a(M){return Bc(M,r)}Xa!==null&&Bc(Xa,r),Ja!==null&&Bc(Ja,r),Wa!==null&&Bc(Wa,r),Lo.forEach(a),Uo.forEach(a);for(var s=0;s<ei.length;s++){var c=ei[s];c.blockedOn===r&&(c.blockedOn=null)}for(;0<ei.length&&(s=ei[0],s.blockedOn===null);)Vx(s),s.blockedOn===null&&ei.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(c=0;c<s.length;c+=3){var p=s[c],v=s[c+1],w=p[wn]||null;if(typeof v=="function")w||Gx(s);else if(w){var _=null;if(v&&v.hasAttribute("formAction")){if(p=v,w=v[wn]||null)_=w.formAction;else if(hm(p)!==null)continue}else _=w.action;typeof _=="function"?s[c+1]=_:(s.splice(c,3),c-=3),Gx(s)}}}function Kx(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return p=w})},focusReset:"manual",scroll:"manual"})}function a(){p!==null&&(p(),p=null),c||setTimeout(s,20)}function s(){if(!c&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),p!==null&&(p(),p=null)}}}function pm(r){this._internalRoot=r}$c.prototype.render=pm.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(i(409));var s=a.current,c=Qn();Px(s,c,r,a,null,null)},$c.prototype.unmount=pm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;Px(r.current,2,null,r,null,null),Sc(),a[kl]=null}};function $c(r){this._internalRoot=r}$c.prototype.unstable_scheduleHydration=function(r){if(r){var a=lf();r={blockedOn:null,target:r,priority:a};for(var s=0;s<ei.length&&a!==0&&a<ei[s].priority;s++);ei.splice(s,0,r),s===0&&Vx(r)}};var Yx=t.version;if(Yx!=="19.2.4")throw Error(i(527,Yx,"19.2.4"));V.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=h(a),r=r!==null?y(r):null,r=r===null?null:r.stateNode,r};var yN={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fc.isDisabled&&Fc.supportsFiber)try{rn=Fc.inject(yN),Dt=Fc}catch{}}return Po.createRoot=function(r,a){if(!l(r))throw Error(i(299));var s=!1,c="",p=rb,v=ab,w=ib;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError)),a=Ix(r,1,!1,null,null,s,c,null,p,v,w,Kx),r[kl]=a.current,Yh(r),new pm(a)},Po.hydrateRoot=function(r,a,s){if(!l(r))throw Error(i(299));var c=!1,p="",v=rb,w=ab,_=ib,M=null;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError),s.formState!==void 0&&(M=s.formState)),a=Ix(r,1,!0,a,s??null,c,p,M,v,w,_,Kx),a.context=Bx(null),s=a.current,c=Qn(),c=Kt(c),p=Ba(c),p.callback=null,Pa(s,p,c),s=c,a.current.lanes=s,Ra(a,s),Or(a),r[kl]=a.current,Yh(r),new $c(a)},Po.version="19.2.4",Po}var s0;function NN(){if(s0)return bm.exports;s0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),bm.exports=_N(),bm.exports}var AN=NN(),Us=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tl,oi,Ss,jS,TN=(jS=class extends Us{constructor(){super();_e(this,tl);_e(this,oi);_e(this,Ss);ye(this,Ss,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,oi)||this.setEventListener(U(this,Ss))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,oi))==null||t.call(this),ye(this,oi,void 0))}setEventListener(t){var n;ye(this,Ss,t),(n=U(this,oi))==null||n.call(this),ye(this,oi,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){U(this,tl)!==t&&(ye(this,tl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof U(this,tl)=="boolean"?U(this,tl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},tl=new WeakMap,oi=new WeakMap,Ss=new WeakMap,jS),ag=new TN,RN={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ui,tg,ES,zN=(ES=class{constructor(){_e(this,ui,RN);_e(this,tg,!1)}setTimeoutProvider(e){ye(this,ui,e)}setTimeout(e,t){return U(this,ui).setTimeout(e,t)}clearTimeout(e){U(this,ui).clearTimeout(e)}setInterval(e,t){return U(this,ui).setInterval(e,t)}clearInterval(e){U(this,ui).clearInterval(e)}},ui=new WeakMap,tg=new WeakMap,ES),el=new zN;function ON(e){setTimeout(e,0)}var DN=typeof window>"u"||"Deno"in globalThis;function bn(){}function MN(e,t){return typeof e=="function"?e(t):e}function cp(e){return typeof e=="number"&&e>=0&&e!==1/0}function LS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vi(e,t){return typeof e=="function"?e(t):e}function hr(e,t){return typeof e=="function"?e(t):e}function o0(e,t){const{type:n="all",exact:i,fetchStatus:l,predicate:o,queryKey:u,stale:f}=e;if(u){if(i){if(t.queryHash!==ig(u,t.options))return!1}else if(!ru(t.queryKey,u))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||o&&!o(t))}function u0(e,t){const{exact:n,status:i,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(cl(t.options.mutationKey)!==cl(o))return!1}else if(!ru(t.options.mutationKey,o))return!1}return!(i&&t.state.status!==i||l&&!l(t))}function ig(e,t){return((t==null?void 0:t.queryKeyHashFn)||cl)(e)}function cl(e){return JSON.stringify(e,(t,n)=>dp(n)?Object.keys(n).sort().reduce((i,l)=>(i[l]=n[l],i),{}):n)}function ru(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ru(e[n],t[n])):!1}var LN=Object.prototype.hasOwnProperty;function US(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=c0(e)&&c0(t);if(!i&&!(dp(e)&&dp(t)))return t;const o=(i?e:Object.keys(e)).length,u=i?t:Object.keys(t),f=u.length,m=i?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=i?y:u[y],b=e[g],x=t[g];if(b===x){m[g]=b,(i?y<o:LN.call(e,g))&&h++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){m[g]=x;continue}const k=US(b,x,n+1);m[g]=k,k===b&&h++}return o===f&&h===o?e:m}function vd(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function c0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function dp(e){if(!d0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!d0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function d0(e){return Object.prototype.toString.call(e)==="[object Object]"}function UN(e){return new Promise(t=>{el.setTimeout(t,e)})}function fp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?US(e,t):t}function IN(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function BN(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var lg=Symbol();function IS(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===lg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function sg(e,t){return typeof e=="function"?e(...t):!!e}function PN(e,t,n){let i=!1,l;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(l??(l=t()),i||(i=!0,l.aborted?n():l.addEventListener("abort",n,{once:!0})),l)}),e}var au=(()=>{let e=()=>DN;return{isServer(){return e()},setIsServer(t){e=t}}})();function hp(){let e,t;const n=new Promise((l,o)=>{e=l,t=o});n.status="pending",n.catch(()=>{});function i(l){Object.assign(n,l),delete n.resolve,delete n.reject}return n.resolve=l=>{i({status:"fulfilled",value:l}),e(l)},n.reject=l=>{i({status:"rejected",reason:l}),t(l)},n}var $N=ON;function FN(){let e=[],t=0,n=f=>{f()},i=f=>{f()},l=$N;const o=f=>{t?e.push(f):l(()=>{n(f)})},u=()=>{const f=e;e=[],f.length&&l(()=>{i(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||u()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{i=f},setScheduler:f=>{l=f}}}var Vt=FN(),ws,ci,ks,CS,qN=(CS=class extends Us{constructor(){super();_e(this,ws,!0);_e(this,ci);_e(this,ks);ye(this,ks,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}})}onSubscribe(){U(this,ci)||this.setEventListener(U(this,ks))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,ci))==null||t.call(this),ye(this,ci,void 0))}setEventListener(t){var n;ye(this,ks,t),(n=U(this,ci))==null||n.call(this),ye(this,ci,t(this.setOnline.bind(this)))}setOnline(t){U(this,ws)!==t&&(ye(this,ws,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return U(this,ws)}},ws=new WeakMap,ci=new WeakMap,ks=new WeakMap,CS),bd=new qN;function HN(e){return Math.min(1e3*2**e,3e4)}function BS(e){return(e??"online")==="online"?bd.isOnline():!0}var mp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function PS(e){let t=!1,n=0,i;const l=hp(),o=()=>l.status!=="pending",u=j=>{var E;if(!o()){const N=new mp(j);b(N),(E=e.onCancel)==null||E.call(e,N)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>ag.isFocused()&&(e.networkMode==="always"||bd.isOnline())&&e.canRun(),y=()=>BS(e.networkMode)&&e.canRun(),g=j=>{o()||(i==null||i(),l.resolve(j))},b=j=>{o()||(i==null||i(),l.reject(j))},x=()=>new Promise(j=>{var E;i=N=>{(o()||h())&&j(N)},(E=e.onPause)==null||E.call(e)}).then(()=>{var j;i=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const E=n===0?e.initialPromise:void 0;try{j=E??e.fn()}catch(N){j=Promise.reject(N)}Promise.resolve(j).then(g).catch(N=>{var z;if(o())return;const T=e.retry??(au.isServer()?0:3),O=e.retryDelay??HN,I=typeof O=="function"?O(n,N):O,B=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,N);if(t||!B){b(N);return}n++,(z=e.onFail)==null||z.call(e,n,N),UN(I).then(()=>h()?void 0:x()).then(()=>{t?b(N):k()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(i==null||i(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():x().then(k),l)}}var nl,_S,$S=(_S=class{constructor(){_e(this,nl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cp(this.gcTime)&&ye(this,nl,el.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(au.isServer()?1/0:300*1e3))}clearGcTimeout(){U(this,nl)&&(el.clearTimeout(U(this,nl)),ye(this,nl,void 0))}},nl=new WeakMap,_S),rl,js,fr,al,Jt,mu,il,Kn,FS,fa,NS,ZN=(NS=class extends $S{constructor(t){super();_e(this,Kn);_e(this,rl);_e(this,js);_e(this,fr);_e(this,al);_e(this,Jt);_e(this,mu);_e(this,il);ye(this,il,!1),ye(this,mu,t.defaultOptions),this.setOptions(t.options),this.observers=[],ye(this,al,t.client),ye(this,fr,U(this,al).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ye(this,rl,h0(this.options)),this.state=t.state??U(this,rl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=U(this,Jt))==null?void 0:t.promise}setOptions(t){if(this.options={...U(this,mu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=h0(this.options);n.data!==void 0&&(this.setState(f0(n.data,n.dataUpdatedAt)),ye(this,rl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,fr).remove(this)}setData(t,n){const i=fp(this.state.data,t,this.options);return Be(this,Kn,fa).call(this,{data:i,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),i}setState(t,n){Be(this,Kn,fa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var i,l;const n=(i=U(this,Jt))==null?void 0:i.promise;return(l=U(this,Jt))==null||l.cancel(t),n?n.then(bn).catch(bn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return U(this,rl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>hr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>vi(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!LS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Jt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Jt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),U(this,fr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(U(this,Jt)&&(U(this,il)||Be(this,Kn,FS).call(this)?U(this,Jt).cancel({revert:!0}):U(this,Jt).cancelRetry()),this.scheduleGc()),U(this,fr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Be(this,Kn,fa).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,b,x,k,j,E,N,T,O;if(this.state.fetchStatus!=="idle"&&((m=U(this,Jt))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,Jt))return U(this,Jt).continueRetry(),U(this,Jt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const I=this.observers.find(B=>B.options.queryFn);I&&this.setOptions(I.options)}const i=new AbortController,l=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(ye(this,il,!0),i.signal)})},o=()=>{const I=IS(this.options,n),z=(()=>{const F={client:U(this,al),queryKey:this.queryKey,meta:this.meta};return l(F),F})();return ye(this,il,!1),this.options.persister?this.options.persister(I,z,this):I(z)},f=(()=>{const I={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:U(this,al),state:this.state,fetchFn:o};return l(I),I})();(h=this.options.behavior)==null||h.onFetch(f,this),ye(this,js,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&Be(this,Kn,fa).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),ye(this,Jt,PS({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:I=>{I instanceof mp&&I.revert&&this.setState({...U(this,js),fetchStatus:"idle"}),i.abort()},onFail:(I,B)=>{Be(this,Kn,fa).call(this,{type:"failed",failureCount:I,error:B})},onPause:()=>{Be(this,Kn,fa).call(this,{type:"pause"})},onContinue:()=>{Be(this,Kn,fa).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const I=await U(this,Jt).start();if(I===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(I),(x=(b=U(this,fr).config).onSuccess)==null||x.call(b,I,this),(j=(k=U(this,fr).config).onSettled)==null||j.call(k,I,this.state.error,this),I}catch(I){if(I instanceof mp){if(I.silent)return U(this,Jt).promise;if(I.revert){if(this.state.data===void 0)throw I;return this.state.data}}throw Be(this,Kn,fa).call(this,{type:"error",error:I}),(N=(E=U(this,fr).config).onError)==null||N.call(E,I,this),(O=(T=U(this,fr).config).onSettled)==null||O.call(T,this.state.data,I,this),I}finally{this.scheduleGc()}}},rl=new WeakMap,js=new WeakMap,fr=new WeakMap,al=new WeakMap,Jt=new WeakMap,mu=new WeakMap,il=new WeakMap,Kn=new WeakSet,FS=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},fa=function(t){const n=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...qS(i.data,this.options),fetchMeta:t.meta??null};case"success":const l={...i,...f0(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ye(this,js,t.manual?l:void 0),l;case"error":const o=t.error;return{...i,error:o,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=n(this.state),Vt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),U(this,fr).notify({query:this,type:"updated",action:t})})},NS);function qS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:BS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function f0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function h0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Tn,Xe,pu,vn,ll,Es,ha,di,gu,Cs,_s,sl,ol,fi,Ns,st,Ko,pp,gp,yp,vp,bp,xp,Sp,HS,AS,VN=(AS=class extends Us{constructor(t,n){super();_e(this,st);_e(this,Tn);_e(this,Xe);_e(this,pu);_e(this,vn);_e(this,ll);_e(this,Es);_e(this,ha);_e(this,di);_e(this,gu);_e(this,Cs);_e(this,_s);_e(this,sl);_e(this,ol);_e(this,fi);_e(this,Ns,new Set);this.options=n,ye(this,Tn,t),ye(this,di,null),ye(this,ha,hp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,Xe).addObserver(this),m0(U(this,Xe),this.options)?Be(this,st,Ko).call(this):this.updateResult(),Be(this,st,vp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wp(U(this,Xe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wp(U(this,Xe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Be(this,st,bp).call(this),Be(this,st,xp).call(this),U(this,Xe).removeObserver(this)}setOptions(t){const n=this.options,i=U(this,Xe);if(this.options=U(this,Tn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hr(this.options.enabled,U(this,Xe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Be(this,st,Sp).call(this),U(this,Xe).setOptions(this.options),n._defaulted&&!vd(this.options,n)&&U(this,Tn).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,Xe),observer:this});const l=this.hasListeners();l&&p0(U(this,Xe),i,this.options,n)&&Be(this,st,Ko).call(this),this.updateResult(),l&&(U(this,Xe)!==i||hr(this.options.enabled,U(this,Xe))!==hr(n.enabled,U(this,Xe))||vi(this.options.staleTime,U(this,Xe))!==vi(n.staleTime,U(this,Xe)))&&Be(this,st,pp).call(this);const o=Be(this,st,gp).call(this);l&&(U(this,Xe)!==i||hr(this.options.enabled,U(this,Xe))!==hr(n.enabled,U(this,Xe))||o!==U(this,fi))&&Be(this,st,yp).call(this,o)}getOptimisticResult(t){const n=U(this,Tn).getQueryCache().build(U(this,Tn),t),i=this.createResult(n,t);return GN(this,i)&&(ye(this,vn,i),ye(this,Es,this.options),ye(this,ll,U(this,Xe).state)),i}getCurrentResult(){return U(this,vn)}trackResult(t,n){return new Proxy(t,{get:(i,l)=>(this.trackProp(l),n==null||n(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&U(this,ha).status==="pending"&&U(this,ha).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,l))})}trackProp(t){U(this,Ns).add(t)}getCurrentQuery(){return U(this,Xe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=U(this,Tn).defaultQueryOptions(t),i=U(this,Tn).getQueryCache().build(U(this,Tn),n);return i.fetch().then(()=>this.createResult(i,n))}fetch(t){return Be(this,st,Ko).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,vn)))}createResult(t,n){var ee;const i=U(this,Xe),l=this.options,o=U(this,vn),u=U(this,ll),f=U(this,Es),h=t!==i?t.state:U(this,pu),{state:y}=t;let g={...y},b=!1,x;if(n._optimisticResults){const q=this.hasListeners(),ae=!q&&m0(t,n),re=q&&p0(t,i,n,l);(ae||re)&&(g={...g,...qS(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=g;x=g.data;let N=!1;if(n.placeholderData!==void 0&&x===void 0&&E==="pending"){let q;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(q=o.data,N=!0):q=typeof n.placeholderData=="function"?n.placeholderData((ee=U(this,_s))==null?void 0:ee.state.data,U(this,_s)):n.placeholderData,q!==void 0&&(E="success",x=fp(o==null?void 0:o.data,q,n),b=!0)}if(n.select&&x!==void 0&&!N)if(o&&x===(u==null?void 0:u.data)&&n.select===U(this,gu))x=U(this,Cs);else try{ye(this,gu,n.select),x=n.select(x),x=fp(o==null?void 0:o.data,x,n),ye(this,Cs,x),ye(this,di,null)}catch(q){ye(this,di,q)}U(this,di)&&(k=U(this,di),x=U(this,Cs),j=Date.now(),E="error");const T=g.fetchStatus==="fetching",O=E==="pending",I=E==="error",B=O&&T,z=x!==void 0,Z={status:E,fetchStatus:g.fetchStatus,isPending:O,isSuccess:E==="success",isError:I,isInitialLoading:B,isLoading:B,data:x,dataUpdatedAt:g.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:T,isRefetching:T&&!O,isLoadingError:I&&!z,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:I&&z,isStale:og(t,n),refetch:this.refetch,promise:U(this,ha),isEnabled:hr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const q=Z.data!==void 0,ae=Z.status==="error"&&!q,re=W=>{ae?W.reject(Z.error):q&&W.resolve(Z.data)},pe=()=>{const W=ye(this,ha,Z.promise=hp());re(W)},de=U(this,ha);switch(de.status){case"pending":t.queryHash===i.queryHash&&re(de);break;case"fulfilled":(ae||Z.data!==de.value)&&pe();break;case"rejected":(!ae||Z.error!==de.reason)&&pe();break}}return Z}updateResult(){const t=U(this,vn),n=this.createResult(U(this,Xe),this.options);if(ye(this,ll,U(this,Xe).state),ye(this,Es,this.options),U(this,ll).data!==void 0&&ye(this,_s,U(this,Xe)),vd(n,t))return;ye(this,vn,n);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!U(this,Ns).size)return!0;const u=new Set(o??U(this,Ns));return this.options.throwOnError&&u.add("error"),Object.keys(U(this,vn)).some(f=>{const m=f;return U(this,vn)[m]!==t[m]&&u.has(m)})};Be(this,st,HS).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Be(this,st,vp).call(this)}},Tn=new WeakMap,Xe=new WeakMap,pu=new WeakMap,vn=new WeakMap,ll=new WeakMap,Es=new WeakMap,ha=new WeakMap,di=new WeakMap,gu=new WeakMap,Cs=new WeakMap,_s=new WeakMap,sl=new WeakMap,ol=new WeakMap,fi=new WeakMap,Ns=new WeakMap,st=new WeakSet,Ko=function(t){Be(this,st,Sp).call(this);let n=U(this,Xe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(bn)),n},pp=function(){Be(this,st,bp).call(this);const t=vi(this.options.staleTime,U(this,Xe));if(au.isServer()||U(this,vn).isStale||!cp(t))return;const i=LS(U(this,vn).dataUpdatedAt,t)+1;ye(this,sl,el.setTimeout(()=>{U(this,vn).isStale||this.updateResult()},i))},gp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,Xe)):this.options.refetchInterval)??!1},yp=function(t){Be(this,st,xp).call(this),ye(this,fi,t),!(au.isServer()||hr(this.options.enabled,U(this,Xe))===!1||!cp(U(this,fi))||U(this,fi)===0)&&ye(this,ol,el.setInterval(()=>{(this.options.refetchIntervalInBackground||ag.isFocused())&&Be(this,st,Ko).call(this)},U(this,fi)))},vp=function(){Be(this,st,pp).call(this),Be(this,st,yp).call(this,Be(this,st,gp).call(this))},bp=function(){U(this,sl)&&(el.clearTimeout(U(this,sl)),ye(this,sl,void 0))},xp=function(){U(this,ol)&&(el.clearInterval(U(this,ol)),ye(this,ol,void 0))},Sp=function(){const t=U(this,Tn).getQueryCache().build(U(this,Tn),this.options);if(t===U(this,Xe))return;const n=U(this,Xe);ye(this,Xe,t),ye(this,pu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},HS=function(t){Vt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(U(this,vn))}),U(this,Tn).getQueryCache().notify({query:U(this,Xe),type:"observerResultsUpdated"})})},AS);function QN(e,t){return hr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function m0(e,t){return QN(e,t)||e.state.data!==void 0&&wp(e,t,t.refetchOnMount)}function wp(e,t,n){if(hr(t.enabled,e)!==!1&&vi(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&og(e,t)}return!1}function p0(e,t,n,i){return(e!==t||hr(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&og(e,n)}function og(e,t){return hr(t.enabled,e)!==!1&&e.isStaleByTime(vi(t.staleTime,e))}function GN(e,t){return!vd(e.getCurrentResult(),t)}function g0(e){return{onFetch:(t,n)=>{var y,g,b,x,k;const i=t.options,l=(b=(g=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:b.direction,o=((x=t.state.data)==null?void 0:x.pages)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=O=>{PN(O,()=>t.signal,()=>j=!0)},N=IS(t.options,t.fetchOptions),T=async(O,I,B)=>{if(j)return Promise.reject();if(I==null&&O.pages.length)return Promise.resolve(O);const F=(()=>{const ae={client:t.client,queryKey:t.queryKey,pageParam:I,direction:B?"backward":"forward",meta:t.options.meta};return E(ae),ae})(),Z=await N(F),{maxPages:ee}=t.options,q=B?BN:IN;return{pages:q(O.pages,Z,ee),pageParams:q(O.pageParams,I,ee)}};if(l&&o.length){const O=l==="backward",I=O?KN:y0,B={pages:o,pageParams:u},z=I(i,B);f=await T(B,z,O)}else{const O=e??o.length;do{const I=m===0?u[0]??i.initialPageParam:y0(i,f);if(m>0&&I==null)break;f=await T(f,I),m++}while(m<O)}return f};t.options.persister?t.fetchFn=()=>{var j,E;return(E=(j=t.options).persister)==null?void 0:E.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function y0(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function KN(e,{pages:t,pageParams:n}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n):void 0}var yu,Lr,hn,ul,Ur,ii,TS,YN=(TS=class extends $S{constructor(t){super();_e(this,Ur);_e(this,yu);_e(this,Lr);_e(this,hn);_e(this,ul);ye(this,yu,t.client),this.mutationId=t.mutationId,ye(this,hn,t.mutationCache),ye(this,Lr,[]),this.state=t.state||ZS(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){U(this,Lr).includes(t)||(U(this,Lr).push(t),this.clearGcTimeout(),U(this,hn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ye(this,Lr,U(this,Lr).filter(n=>n!==t)),this.scheduleGc(),U(this,hn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){U(this,Lr).length||(this.state.status==="pending"?this.scheduleGc():U(this,hn).remove(this))}continue(){var t;return((t=U(this,ul))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,f,m,h,y,g,b,x,k,j,E,N,T,O,I,B,z,F;const n=()=>{Be(this,Ur,ii).call(this,{type:"continue"})},i={client:U(this,yu),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,ul,PS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(Z,ee)=>{Be(this,Ur,ii).call(this,{type:"failed",failureCount:Z,error:ee})},onPause:()=>{Be(this,Ur,ii).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,hn).canRun(this)}));const l=this.state.status==="pending",o=!U(this,ul).canStart();try{if(l)n();else{Be(this,Ur,ii).call(this,{type:"pending",variables:t,isPaused:o}),U(this,hn).config.onMutate&&await U(this,hn).config.onMutate(t,this,i);const ee=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,t,i));ee!==this.state.context&&Be(this,Ur,ii).call(this,{type:"pending",context:ee,variables:t,isPaused:o})}const Z=await U(this,ul).start();return await((h=(m=U(this,hn).config).onSuccess)==null?void 0:h.call(m,Z,t,this.state.context,this,i)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,Z,t,this.state.context,i)),await((x=(b=U(this,hn).config).onSettled)==null?void 0:x.call(b,Z,null,this.state.variables,this.state.context,this,i)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,Z,null,t,this.state.context,i)),Be(this,Ur,ii).call(this,{type:"success",data:Z}),Z}catch(Z){try{await((N=(E=U(this,hn).config).onError)==null?void 0:N.call(E,Z,t,this.state.context,this,i))}catch(ee){Promise.reject(ee)}try{await((O=(T=this.options).onError)==null?void 0:O.call(T,Z,t,this.state.context,i))}catch(ee){Promise.reject(ee)}try{await((B=(I=U(this,hn).config).onSettled)==null?void 0:B.call(I,void 0,Z,this.state.variables,this.state.context,this,i))}catch(ee){Promise.reject(ee)}try{await((F=(z=this.options).onSettled)==null?void 0:F.call(z,void 0,Z,t,this.state.context,i))}catch(ee){Promise.reject(ee)}throw Be(this,Ur,ii).call(this,{type:"error",error:Z}),Z}finally{U(this,hn).runNext(this)}}},yu=new WeakMap,Lr=new WeakMap,hn=new WeakMap,ul=new WeakMap,Ur=new WeakSet,ii=function(t){const n=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Vt.batch(()=>{U(this,Lr).forEach(i=>{i.onMutationUpdate(t)}),U(this,hn).notify({mutation:this,type:"updated",action:t})})},TS);function ZS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ma,jr,vu,RS,XN=(RS=class extends Us{constructor(t={}){super();_e(this,ma);_e(this,jr);_e(this,vu);this.config=t,ye(this,ma,new Set),ye(this,jr,new Map),ye(this,vu,0)}build(t,n,i){const l=new YN({client:t,mutationCache:this,mutationId:++qc(this,vu)._,options:t.defaultMutationOptions(n),state:i});return this.add(l),l}add(t){U(this,ma).add(t);const n=Hc(t);if(typeof n=="string"){const i=U(this,jr).get(n);i?i.push(t):U(this,jr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(U(this,ma).delete(t)){const n=Hc(t);if(typeof n=="string"){const i=U(this,jr).get(n);if(i)if(i.length>1){const l=i.indexOf(t);l!==-1&&i.splice(l,1)}else i[0]===t&&U(this,jr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Hc(t);if(typeof n=="string"){const i=U(this,jr).get(n),l=i==null?void 0:i.find(o=>o.state.status==="pending");return!l||l===t}else return!0}runNext(t){var i;const n=Hc(t);if(typeof n=="string"){const l=(i=U(this,jr).get(n))==null?void 0:i.find(o=>o!==t&&o.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vt.batch(()=>{U(this,ma).forEach(t=>{this.notify({type:"removed",mutation:t})}),U(this,ma).clear(),U(this,jr).clear()})}getAll(){return Array.from(U(this,ma))}find(t){const n={exact:!0,...t};return this.getAll().find(i=>u0(n,i))}findAll(t={}){return this.getAll().filter(n=>u0(t,n))}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Vt.batch(()=>Promise.all(t.map(n=>n.continue().catch(bn))))}},ma=new WeakMap,jr=new WeakMap,vu=new WeakMap,RS);function Hc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var pa,hi,Rn,ga,va,ud,kp,zS,JN=(zS=class extends Us{constructor(n,i){super();_e(this,va);_e(this,pa);_e(this,hi);_e(this,Rn);_e(this,ga);ye(this,pa,n),this.setOptions(i),this.bindMethods(),Be(this,va,ud).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var l;const i=this.options;this.options=U(this,pa).defaultMutationOptions(n),vd(this.options,i)||U(this,pa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:U(this,Rn),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&cl(i.mutationKey)!==cl(this.options.mutationKey)?this.reset():((l=U(this,Rn))==null?void 0:l.state.status)==="pending"&&U(this,Rn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=U(this,Rn))==null||n.removeObserver(this)}onMutationUpdate(n){Be(this,va,ud).call(this),Be(this,va,kp).call(this,n)}getCurrentResult(){return U(this,hi)}reset(){var n;(n=U(this,Rn))==null||n.removeObserver(this),ye(this,Rn,void 0),Be(this,va,ud).call(this),Be(this,va,kp).call(this)}mutate(n,i){var l;return ye(this,ga,i),(l=U(this,Rn))==null||l.removeObserver(this),ye(this,Rn,U(this,pa).getMutationCache().build(U(this,pa),this.options)),U(this,Rn).addObserver(this),U(this,Rn).execute(n)}},pa=new WeakMap,hi=new WeakMap,Rn=new WeakMap,ga=new WeakMap,va=new WeakSet,ud=function(){var i;const n=((i=U(this,Rn))==null?void 0:i.state)??ZS();ye(this,hi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},kp=function(n){Vt.batch(()=>{var i,l,o,u,f,m,h,y;if(U(this,ga)&&this.hasListeners()){const g=U(this,hi).variables,b=U(this,hi).context,x={client:U(this,pa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(i=U(this,ga)).onSuccess)==null||l.call(i,n.data,g,b,x)}catch(k){Promise.reject(k)}try{(u=(o=U(this,ga)).onSettled)==null||u.call(o,n.data,null,g,b,x)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=U(this,ga)).onError)==null||m.call(f,n.error,g,b,x)}catch(k){Promise.reject(k)}try{(y=(h=U(this,ga)).onSettled)==null||y.call(h,void 0,n.error,g,b,x)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(U(this,hi))})})},zS),Ir,OS,WN=(OS=class extends Us{constructor(t={}){super();_e(this,Ir);this.config=t,ye(this,Ir,new Map)}build(t,n,i){const l=n.queryKey,o=n.queryHash??ig(l,n);let u=this.get(o);return u||(u=new ZN({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:i,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){U(this,Ir).has(t.queryHash)||(U(this,Ir).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=U(this,Ir).get(t.queryHash);n&&(t.destroy(),n===t&&U(this,Ir).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return U(this,Ir).get(t)}getAll(){return[...U(this,Ir).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(i=>o0(n,i))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(i=>o0(t,i)):n}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ir=new WeakMap,OS),Ot,mi,pi,As,Ts,gi,Rs,zs,DS,e2=(DS=class{constructor(e={}){_e(this,Ot);_e(this,mi);_e(this,pi);_e(this,As);_e(this,Ts);_e(this,gi);_e(this,Rs);_e(this,zs);ye(this,Ot,e.queryCache||new WN),ye(this,mi,e.mutationCache||new XN),ye(this,pi,e.defaultOptions||{}),ye(this,As,new Map),ye(this,Ts,new Map),ye(this,gi,0)}mount(){qc(this,gi)._++,U(this,gi)===1&&(ye(this,Rs,ag.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,Ot).onFocus())})),ye(this,zs,bd.subscribe(async e=>{e&&(await this.resumePausedMutations(),U(this,Ot).onOnline())})))}unmount(){var e,t;qc(this,gi)._--,U(this,gi)===0&&((e=U(this,Rs))==null||e.call(this),ye(this,Rs,void 0),(t=U(this,zs))==null||t.call(this),ye(this,zs,void 0))}isFetching(e){return U(this,Ot).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return U(this,mi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=U(this,Ot).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=U(this,Ot).build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(vi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return U(this,Ot).findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),l=U(this,Ot).get(i.queryHash),o=l==null?void 0:l.state.data,u=MN(t,o);if(u!==void 0)return U(this,Ot).build(this,i).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Vt.batch(()=>U(this,Ot).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=U(this,Ot).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=U(this,Ot);Vt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=U(this,Ot);return Vt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},i=Vt.batch(()=>U(this,Ot).findAll(e).map(l=>l.cancel(n)));return Promise.all(i).then(bn).catch(bn)}invalidateQueries(e,t={}){return Vt.batch(()=>(U(this,Ot).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},i=Vt.batch(()=>U(this,Ot).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(bn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(i).then(bn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=U(this,Ot).build(this,t);return n.isStaleByTime(vi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(bn).catch(bn)}fetchInfiniteQuery(e){return e.behavior=g0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(bn).catch(bn)}ensureInfiniteQueryData(e){return e.behavior=g0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return bd.isOnline()?U(this,mi).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,Ot)}getMutationCache(){return U(this,mi)}getDefaultOptions(){return U(this,pi)}setDefaultOptions(e){ye(this,pi,e)}setQueryDefaults(e,t){U(this,As).set(cl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...U(this,As).values()],n={};return t.forEach(i=>{ru(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){U(this,Ts).set(cl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...U(this,Ts).values()],n={};return t.forEach(i=>{ru(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...U(this,pi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ig(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===lg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...U(this,pi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){U(this,Ot).clear(),U(this,mi).clear()}},Ot=new WeakMap,mi=new WeakMap,pi=new WeakMap,As=new WeakMap,Ts=new WeakMap,gi=new WeakMap,Rs=new WeakMap,zs=new WeakMap,DS),VS=S.createContext(void 0),Wn=e=>{const t=S.useContext(VS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},t2=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(VS.Provider,{value:e,children:t})),QS=S.createContext(!1),n2=()=>S.useContext(QS);QS.Provider;function r2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var a2=S.createContext(r2()),i2=()=>S.useContext(a2),l2=(e,t,n)=>{const i=n!=null&&n.state.error&&typeof e.throwOnError=="function"?sg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},s2=e=>{S.useEffect(()=>{e.clearReset()},[e])},o2=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(l&&e.data===void 0||sg(n,[e.error,i])),u2=e=>{if(e.suspense){const n=l=>l==="static"?l:Math.max(l??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...l)=>n(i(...l)):n(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},c2=(e,t)=>e.isLoading&&e.isFetching&&!t,d2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,v0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function f2(e,t,n){var b,x,k,j;const i=n2(),l=i2(),o=Wn(),u=o.defaultQueryOptions(e);(x=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||x.call(b,u);const f=o.getQueryCache().get(u.queryHash);u._optimisticResults=i?"isRestoring":"optimistic",u2(u),l2(u,l,f),s2(l);const m=!o.getQueryCache().get(u.queryHash),[h]=S.useState(()=>new t(o,u)),y=h.getOptimisticResult(u),g=!i&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(E=>{const N=g?h.subscribe(Vt.batchCalls(E)):bn;return h.updateResult(),N},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),S.useEffect(()=>{h.setOptions(u)},[u,h]),d2(u,y))throw v0(u,h,l);if(o2({result:y,errorResetBoundary:l,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,u,y),u.experimental_prefetchInRender&&!au.isServer()&&c2(y,i)){const E=m?v0(u,h,l):f==null?void 0:f.promise;E==null||E.catch(bn).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?y:h.trackResult(y)}function qe(e,t){return f2(e,VN)}function yt(e,t){const n=Wn(),[i]=S.useState(()=>new JN(n,e));S.useEffect(()=>{i.setOptions(e)},[i,e]);const l=S.useSyncExternalStore(S.useCallback(u=>i.subscribe(Vt.batchCalls(u)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=S.useCallback((u,f)=>{i.mutate(u,f).catch(bn)},[i]);if(l.error&&sg(i.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:o,mutateAsync:l.mutate}}/**
|
|
50
|
+
* react-router v7.13.1
|
|
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 b0="popstate";function x0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function h2(e={}){function t(i,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:u,search:f,hash:m}=o||i.location;return jp("",{pathname:u,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,l){return typeof l=="string"?l:iu(l)}return p2(t,n,null,e)}function Et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function m2(){return Math.random().toString(36).substring(2,10)}function S0(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function jp(e,t,n=null,i,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Is(t):t,state:n,key:t&&t.key||i||m2(),unstable_mask:l}}function iu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Is(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function p2(e,t,n,i={}){let{window:l=document.defaultView,v5Compat:o=!1}=i,u=l.history,f="POP",m=null,h=y();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function y(){return(u.state||{idx:null}).idx}function g(){f="POP";let E=y(),N=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:N})}function b(E,N){f="PUSH";let T=x0(E)?E:jp(j.location,E,N);h=y()+1;let O=S0(T,h),I=j.createHref(T.unstable_mask||T);try{u.pushState(O,"",I)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;l.location.assign(I)}o&&m&&m({action:f,location:j.location,delta:1})}function x(E,N){f="REPLACE";let T=x0(E)?E:jp(j.location,E,N);h=y();let O=S0(T,h),I=j.createHref(T.unstable_mask||T);u.replaceState(O,"",I),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return g2(E)}let j={get action(){return f},get location(){return e(l,u)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(b0,g),m=E,()=>{l.removeEventListener(b0,g),m=null}},createHref(E){return t(l,E)},createURL:k,encodeLocation(E){let N=k(E);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:b,replace:x,go(E){return u.go(E)}};return j}function g2(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Et(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:iu(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function GS(e,t,n="/"){return y2(e,t,n,!1)}function y2(e,t,n,i){let l=typeof t=="string"?Is(t):t,o=ba(l.pathname||"/",n);if(o==null)return null;let u=KS(e);v2(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=A2(o);f=_2(u[m],h,i)}return f}function KS(e,t=[],n=[],i="",l=!1){let o=(u,f,m=l,h)=>{let y={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&m)return;Et(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let g=$r([i,y.relativePath]),b=n.concat(y);u.children&&u.children.length>0&&(Et(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),KS(u.children,t,b,g,m)),!(u.path==null&&!u.index)&&t.push({path:g,score:E2(g,u.index),routesMeta:b})};return e.forEach((u,f)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))o(u,f);else for(let h of YS(u.path))o(u,f,!0,h)}),t}function YS(e){let t=e.split("/");if(t.length===0)return[];let[n,...i]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(i.length===0)return l?[o,""]:[o];let u=YS(i.join("/")),f=[];return f.push(...u.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function v2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:C2(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var b2=/^:[\w-]+$/,x2=3,S2=2,w2=1,k2=10,j2=-2,w0=e=>e==="*";function E2(e,t){let n=e.split("/"),i=n.length;return n.some(w0)&&(i+=j2),t&&(i+=S2),n.filter(l=>!w0(l)).reduce((l,o)=>l+(b2.test(o)?x2:o===""?w2:k2),i)}function C2(e,t){return e.length===t.length&&e.slice(0,-1).every((i,l)=>i===t[l])?e[e.length-1]-t[t.length-1]:0}function _2(e,t,n=!1){let{routesMeta:i}=e,l={},o="/",u=[];for(let f=0;f<i.length;++f){let m=i[f],h=f===i.length-1,y=o==="/"?t:t.slice(o.length)||"/",g=xd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),b=m.route;if(!g&&h&&n&&!i[i.length-1].route.index&&(g=xd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),u.push({params:l,pathname:$r([o,g.pathname]),pathnameBase:O2($r([o,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(o=$r([o,g.pathnameBase]))}return u}function xd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=N2(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],u=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:i.reduce((h,{paramName:y,isOptional:g},b)=>{if(y==="*"){let k=f[b]||"";u=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const x=f[b];return g&&!x?h[y]=void 0:h[y]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:u,pattern:e}}function N2(e,t=!1,n=!0){pr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,m,h,y)=>{if(i.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+u.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),i]}function A2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ba(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&i!=="/"?null:e.slice(n)||"/"}var T2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function R2(e,t="/"){let{pathname:n,search:i="",hash:l=""}=typeof e=="string"?Is(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=k0(n.substring(1),"/"):o=k0(n,t)):o=t,{pathname:o,search:D2(i),hash:M2(l)}}function k0(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function km(e,t,n,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function z2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ug(e){let t=z2(e);return t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase)}function Dd(e,t,n,i=!1){let l;typeof e=="string"?l=Is(e):(l={...e},Et(!l.pathname||!l.pathname.includes("?"),km("?","pathname","search",l)),Et(!l.pathname||!l.pathname.includes("#"),km("#","pathname","hash",l)),Et(!l.search||!l.search.includes("#"),km("#","search","hash",l)));let o=e===""||l.pathname==="",u=o?"/":l.pathname,f;if(u==null)f=n;else{let g=t.length-1;if(!i&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),g-=1;l.pathname=b.join("/")}f=g>=0?t[g]:"/"}let m=R2(l,f),h=u&&u!=="/"&&u.endsWith("/"),y=(o||u===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var $r=e=>e.join("/").replace(/\/\/+/g,"/"),O2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),D2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,M2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,L2=class{constructor(e,t,n,i=!1){this.status=e,this.statusText=t||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function U2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function I2(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var XS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function JS(e,t){let n=e;if(typeof n!="string"||!T2.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,l=!1;if(XS)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=ba(u.pathname,t);u.origin===o.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{pr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var WS=["POST","PUT","PATCH","DELETE"];new Set(WS);var B2=["GET",...WS];new Set(B2);var Bs=S.createContext(null);Bs.displayName="DataRouter";var Md=S.createContext(null);Md.displayName="DataRouterState";var P2=S.createContext(!1),ew=S.createContext({isTransitioning:!1});ew.displayName="ViewTransition";var $2=S.createContext(new Map);$2.displayName="Fetchers";var F2=S.createContext(null);F2.displayName="Await";var er=S.createContext(null);er.displayName="Navigation";var bu=S.createContext(null);bu.displayName="Location";var gr=S.createContext({outlet:null,matches:[],isDataRoute:!1});gr.displayName="Route";var cg=S.createContext(null);cg.displayName="RouteError";var tw="REACT_ROUTER_ERROR",q2="REDIRECT",H2="ROUTE_ERROR_RESPONSE";function Z2(e){if(e.startsWith(`${tw}:${q2}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function V2(e){if(e.startsWith(`${tw}:${H2}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new L2(t.status,t.statusText,t.data)}catch{}}function Q2(e,{relative:t}={}){Et(Ps(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=S.useContext(er),{hash:l,pathname:o,search:u}=xu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:$r([n,o])),i.createHref({pathname:f,search:u,hash:l})}function Ps(){return S.useContext(bu)!=null}function yr(){return Et(Ps(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(bu).location}var nw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rw(e){S.useContext(er).static||S.useLayoutEffect(e)}function qr(){let{isDataRoute:e}=S.useContext(gr);return e?uA():G2()}function G2(){Et(Ps(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(Bs),{basename:t,navigator:n}=S.useContext(er),{matches:i}=S.useContext(gr),{pathname:l}=yr(),o=JSON.stringify(ug(i)),u=S.useRef(!1);return rw(()=>{u.current=!0}),S.useCallback((m,h={})=>{if(pr(u.current,nw),!u.current)return;if(typeof m=="number"){n.go(m);return}let y=Dd(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:$r([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var K2=S.createContext(null);function Y2(e){let t=S.useContext(gr).outlet;return S.useMemo(()=>t&&S.createElement(K2.Provider,{value:e},t),[t,e])}function X2(){let{matches:e}=S.useContext(gr),t=e[e.length-1];return t?t.params:{}}function xu(e,{relative:t}={}){let{matches:n}=S.useContext(gr),{pathname:i}=yr(),l=JSON.stringify(ug(n));return S.useMemo(()=>Dd(e,JSON.parse(l),i,t==="path"),[e,l,i,t])}function J2(e,t){return aw(e,t)}function aw(e,t,n){var E;Et(Ps(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=S.useContext(er),{matches:l}=S.useContext(gr),o=l[l.length-1],u=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let N=h&&h.path||"";lw(f,!h||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let y=yr(),g;if(t){let N=typeof t=="string"?Is(t):t;Et(m==="/"||((E=N.pathname)==null?void 0:E.startsWith(m)),`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 "${m}" but pathname "${N.pathname}" was given in the \`location\` prop.`),g=N}else g=y;let b=g.pathname||"/",x=b;if(m!=="/"){let N=m.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(N.length).join("/")}let k=GS(e,{pathname:x});pr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),pr(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.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=rA(k&&k.map(N=>Object.assign({},N,{params:Object.assign({},u,N.params),pathname:$r([m,i.encodeLocation?i.encodeLocation(N.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?m:$r([m,i.encodeLocation?i.encodeLocation(N.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),l,n);return t&&j?S.createElement(bu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function W2(){let e=oA(),t=U2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:i},o={padding:"2px 4px",backgroundColor:i},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:o},"ErrorBoundary")," or"," ",S.createElement("code",{style:o},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:l},n):null,u)}var eA=S.createElement(W2,null),iw=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=V2(e.digest);n&&(e=n)}let t=e!==void 0?S.createElement(gr.Provider,{value:this.props.routeContext},S.createElement(cg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?S.createElement(tA,{error:e},t):t}};iw.contextType=P2;var jm=new WeakMap;function tA({children:e,error:t}){let{basename:n}=S.useContext(er);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=Z2(t.digest);if(i){let l=jm.get(t);if(l)throw l;let o=JS(i.location,n);if(XS&&!jm.get(t))if(o.isExternal||i.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:i.replace}));throw jm.set(t,u),u}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function nA({routeContext:e,match:t,children:n}){let i=S.useContext(Bs);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(gr.Provider,{value:e},n)}function rA(e,t=[],n){let i=n==null?void 0:n.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let l=e,o=i==null?void 0:i.errors;if(o!=null){let y=l.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);Et(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let u=!1,f=-1;if(n&&i){u=i.renderFallback;for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:b,errors:x}=i,k=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!x||x[g.route.id]===void 0);if(g.route.lazy||k){n.isStatic&&(u=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=i&&m?(y,g)=>{var b,x;m(y,{location:i.location,params:((x=(b=i.matches)==null?void 0:b[0])==null?void 0:x.params)??{},unstable_pattern:I2(i.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,b)=>{let x,k=!1,j=null,E=null;i&&(x=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||eA,u&&(f<0&&b===0?(lw("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,E=null):f===b&&(k=!0,E=g.route.hydrateFallbackElement||null)));let N=t.concat(l.slice(0,b+1)),T=()=>{let O;return x?O=j:k?O=E:g.route.Component?O=S.createElement(g.route.Component,null):g.route.element?O=g.route.element:O=y,S.createElement(nA,{match:g,routeContext:{outlet:y,matches:N,isDataRoute:i!=null},children:O})};return i&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?S.createElement(iw,{location:i.location,revalidation:i.revalidation,component:j,error:x,children:T(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:h}):T()},null)}function dg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function aA(e){let t=S.useContext(Bs);return Et(t,dg(e)),t}function iA(e){let t=S.useContext(Md);return Et(t,dg(e)),t}function lA(e){let t=S.useContext(gr);return Et(t,dg(e)),t}function fg(e){let t=lA(e),n=t.matches[t.matches.length-1];return Et(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sA(){return fg("useRouteId")}function oA(){var i;let e=S.useContext(cg),t=iA("useRouteError"),n=fg("useRouteError");return e!==void 0?e:(i=t.errors)==null?void 0:i[n]}function uA(){let{router:e}=aA("useNavigate"),t=fg("useNavigate"),n=S.useRef(!1);return rw(()=>{n.current=!0}),S.useCallback(async(l,o={})=>{pr(n.current,nw),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var j0={};function lw(e,t,n){!t&&!j0[e]&&(j0[e]=!0,pr(!1,n))}S.memo(cA);function cA({routes:e,future:t,state:n,isStatic:i,onError:l}){return aw(e,void 0,{state:n,isStatic:i,onError:l})}function hg({to:e,replace:t,state:n,relative:i}){Et(Ps(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=S.useContext(er);pr(!l,"<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:o}=S.useContext(gr),{pathname:u}=yr(),f=qr(),m=Dd(e,ug(o),u,i==="path"),h=JSON.stringify(m);return S.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:i})},[f,h,i,t,n]),null}function Ep(e){return Y2(e.context)}function Dr(e){Et(!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 dA({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:l,static:o=!1,unstable_useTransitions:u}){Et(!Ps(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=S.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:u,future:{}}),[f,l,o,u]);typeof n=="string"&&(n=Is(n));let{pathname:h="/",search:y="",hash:g="",state:b=null,key:x="default",unstable_mask:k}=n,j=S.useMemo(()=>{let E=ba(h,f);return E==null?null:{location:{pathname:E,search:y,hash:g,state:b,key:x,unstable_mask:k},navigationType:i}},[f,h,y,g,b,x,i,k]);return pr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:S.createElement(er.Provider,{value:m},S.createElement(bu.Provider,{children:t,value:j}))}function fA({children:e,location:t}){return J2(Cp(e),t)}function Cp(e,t=[]){let n=[];return S.Children.forEach(e,(i,l)=>{if(!S.isValidElement(i))return;let o=[...t,l];if(i.type===S.Fragment){n.push.apply(n,Cp(i.props.children,o));return}Et(i.type===Dr,`[${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>`),Et(!i.props.index||!i.props.children,"An index route cannot have child routes.");let u={id:i.props.id||o.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&&(u.children=Cp(i.props.children,o)),n.push(u)}),n}var cd="get",dd="application/x-www-form-urlencoded";function Ld(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function hA(e){return Ld(e)&&e.tagName.toLowerCase()==="button"}function mA(e){return Ld(e)&&e.tagName.toLowerCase()==="form"}function pA(e){return Ld(e)&&e.tagName.toLowerCase()==="input"}function gA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function yA(e,t){return e.button===0&&(!t||t==="_self")&&!gA(e)}function _p(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let i=e[n];return t.concat(Array.isArray(i)?i.map(l=>[n,l]):[[n,i]])},[]))}function vA(e,t){let n=_p(e);return t&&t.forEach((i,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var Zc=null;function bA(){if(Zc===null)try{new FormData(document.createElement("form"),0),Zc=!1}catch{Zc=!0}return Zc}var xA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Em(e){return e!=null&&!xA.has(e)?(pr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dd}"`),null):e}function SA(e,t){let n,i,l,o,u;if(mA(e)){let f=e.getAttribute("action");i=f?ba(f,t):null,n=e.getAttribute("method")||cd,l=Em(e.getAttribute("enctype"))||dd,o=new FormData(e)}else if(hA(e)||pA(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(i=m?ba(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||cd,l=Em(e.getAttribute("formenctype"))||Em(f.getAttribute("enctype"))||dd,o=new FormData(f,e),!bA()){let{name:h,type:y,value:g}=e;if(y==="image"){let b=h?`${h}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else h&&o.append(h,g)}}else{if(Ld(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=cd,i=null,l=dd,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:i,method:n.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function mg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wA(e,t,n,i){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${i}`:l.pathname=`${l.pathname}.${i}`:l.pathname==="/"?l.pathname=`_root.${i}`:t&&ba(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${i}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${i}`,l}async function kA(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function jA(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function EA(e,t,n){let i=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await kA(o,n);return u.links?u.links():[]}return[]}));return AA(i.flat(1).filter(jA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function E0(e,t,n,i,l,o){let u=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var y;return n[h].pathname!==m.pathname||((y=n[h].route.path)==null?void 0:y.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>u(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var g;let y=i.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(u(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function CA(e,t,{includeHydrateFallback:n}={}){return _A(e.map(i=>{let l=t.routes[i.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),n&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function _A(e){return[...new Set(e)]}function NA(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function AA(e,t){let n=new Set;return new Set(t),e.reduce((i,l)=>{let o=JSON.stringify(NA(l));return n.has(o)||(n.add(o),i.push({key:o,link:l})),i},[])}function sw(){let e=S.useContext(Bs);return mg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function TA(){let e=S.useContext(Md);return mg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var pg=S.createContext(void 0);pg.displayName="FrameworkContext";function ow(){let e=S.useContext(pg);return mg(e,"You must render this element inside a <HydratedRouter> element"),e}function RA(e,t){let n=S.useContext(pg),[i,l]=S.useState(!1),[o,u]=S.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,b=S.useRef(null);S.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let j=N=>{N.forEach(T=>{u(T.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),S.useEffect(()=>{if(i){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[i]);let x=()=>{l(!0)},k=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:$o(f,x),onBlur:$o(m,k),onMouseEnter:$o(h,x),onMouseLeave:$o(y,k),onTouchStart:$o(g,x)}]:[!1,b,{}]}function $o(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function zA({page:e,...t}){let{router:n}=sw(),i=S.useMemo(()=>GS(n.routes,e,n.basename),[n.routes,e,n.basename]);return i?S.createElement(DA,{page:e,matches:i,...t}):null}function OA(e){let{manifest:t,routeModules:n}=ow(),[i,l]=S.useState([]);return S.useEffect(()=>{let o=!1;return EA(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),i}function DA({page:e,matches:t,...n}){let i=yr(),{future:l,manifest:o,routeModules:u}=ow(),{basename:f}=sw(),{loaderData:m,matches:h}=TA(),y=S.useMemo(()=>E0(e,t,h,o,i,"data"),[e,t,h,o,i]),g=S.useMemo(()=>E0(e,t,h,o,i,"assets"),[e,t,h,o,i]),b=S.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let j=new Set,E=!1;if(t.forEach(T=>{var I;let O=o.routes[T.route.id];!O||!O.hasLoader||(!y.some(B=>B.route.id===T.route.id)&&T.route.id in m&&((I=u[T.route.id])!=null&&I.shouldRevalidate)||O.hasClientLoader?E=!0:j.add(T.route.id))}),j.size===0)return[];let N=wA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&N.searchParams.set("_routes",t.filter(T=>j.has(T.route.id)).map(T=>T.route.id).join(",")),[N.pathname+N.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,i,o,y,t,e,u]),x=S.useMemo(()=>CA(g,o),[g,o]),k=OA(g);return S.createElement(S.Fragment,null,b.map(j=>S.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),x.map(j=>S.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:E})=>S.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function MA(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var LA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{LA&&(window.__reactRouterVersion="7.13.1")}catch{}function UA({basename:e,children:t,unstable_useTransitions:n,window:i}){let l=S.useRef();l.current==null&&(l.current=h2({window:i,v5Compat:!0}));let o=l.current,[u,f]=S.useState({action:o.action,location:o.location}),m=S.useCallback(h=>{n===!1?f(h):S.startTransition(()=>f(h))},[n]);return S.useLayoutEffect(()=>o.listen(m),[o,m]),S.createElement(dA,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var uw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cw=S.forwardRef(function({onClick:t,discover:n="render",prefetch:i="none",relative:l,reloadDocument:o,replace:u,unstable_mask:f,state:m,target:h,to:y,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:x,...k},j){let{basename:E,navigator:N,unstable_useTransitions:T}=S.useContext(er),O=typeof y=="string"&&uw.test(y),I=JS(y,E);y=I.to;let B=Q2(y,{relative:l}),z=yr(),F=null;if(f){let W=Dd(f,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);E!=="/"&&(W.pathname=W.pathname==="/"?E:$r([E,W.pathname])),F=N.createHref(W)}let[Z,ee,q]=RA(i,k),ae=PA(y,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:x,unstable_useTransitions:T});function re(W){t&&t(W),W.defaultPrevented||ae(W)}let pe=!(I.isExternal||o),de=S.createElement("a",{...k,...q,href:(pe?F:void 0)||I.absoluteURL||B,onClick:pe?re:t,ref:MA(j,ee),target:h,"data-discover":!O&&n==="render"?"true":void 0});return Z&&!O?S.createElement(S.Fragment,null,de,S.createElement(zA,{page:B})):de});cw.displayName="Link";var dw=S.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:i="",end:l=!1,style:o,to:u,viewTransition:f,children:m,...h},y){let g=xu(u,{relative:h.relative}),b=yr(),x=S.useContext(Md),{navigator:k,basename:j}=S.useContext(er),E=x!=null&&ZA(g)&&f===!0,N=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,T=b.pathname,O=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(T=T.toLowerCase(),O=O?O.toLowerCase():null,N=N.toLowerCase()),O&&j&&(O=ba(O,j)||O);const I=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let B=T===N||!l&&T.startsWith(N)&&T.charAt(I)==="/",z=O!=null&&(O===N||!l&&O.startsWith(N)&&O.charAt(N.length)==="/"),F={isActive:B,isPending:z,isTransitioning:E},Z=B?t:void 0,ee;typeof i=="function"?ee=i(F):ee=[i,B?"active":null,z?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let q=typeof o=="function"?o(F):o;return S.createElement(cw,{...h,"aria-current":Z,className:ee,ref:y,style:q,to:u,viewTransition:f},typeof m=="function"?m(F):m)});dw.displayName="NavLink";var IA=S.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:l,state:o,method:u=cd,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b,...x},k)=>{let{unstable_useTransitions:j}=S.useContext(er),E=qA(),N=HA(f,{relative:h}),T=u.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&uw.test(f),I=B=>{if(m&&m(B),B.defaultPrevented)return;B.preventDefault();let z=B.nativeEvent.submitter,F=(z==null?void 0:z.getAttribute("formmethod"))||u,Z=()=>E(z||B.currentTarget,{fetcherKey:t,method:F,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b});j&&n!==!1?S.startTransition(()=>Z()):Z()};return S.createElement("form",{ref:k,method:T,action:N,onSubmit:i?m:I,...x,"data-discover":!O&&e==="render"?"true":void 0})});IA.displayName="Form";function BA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fw(e){let t=S.useContext(Bs);return Et(t,BA(e)),t}function PA(e,{target:t,replace:n,unstable_mask:i,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=qr(),g=yr(),b=xu(e,{relative:u});return S.useCallback(x=>{if(yA(x,t)){x.preventDefault();let k=n!==void 0?n:iu(g)===iu(b),j=()=>y(e,{replace:k,unstable_mask:i,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?S.startTransition(()=>j()):j()}},[g,y,b,n,i,l,t,e,o,u,f,m,h])}function gg(e){pr(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 t=S.useRef(_p(e)),n=S.useRef(!1),i=yr(),l=S.useMemo(()=>vA(i.search,n.current?null:t.current),[i.search]),o=qr(),u=S.useCallback((f,m)=>{const h=_p(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,u]}var $A=0,FA=()=>`__${String(++$A)}__`;function qA(){let{router:e}=fw("useSubmit"),{basename:t}=S.useContext(er),n=sA(),i=e.fetch,l=e.navigate;return S.useCallback(async(o,u={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=SA(o,t);if(u.navigate===!1){let b=u.fetcherKey||FA();await i(b,n,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await l(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[i,l,t,n])}function HA(e,{relative:t}={}){let{basename:n}=S.useContext(er),i=S.useContext(gr);Et(i,"useFormAction must be used inside a RouteContext");let[l]=i.matches.slice(-1),o={...xu(e||".",{relative:t})},u=yr();if(e==null){o.search=u.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(y=>y==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:$r([n,o.pathname])),iu(o)}function ZA(e,{relative:t}={}){let n=S.useContext(ew);Et(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=fw("useViewTransitionState"),l=xu(e,{relative:t});if(!n.isTransitioning)return!1;let o=ba(n.currentLocation.pathname,i)||n.currentLocation.pathname,u=ba(n.nextLocation.pathname,i)||n.nextLocation.pathname;return xd(l.pathname,u)!=null||xd(l.pathname,o)!=null}const VA="/api/v1";async function QA(e,t){const n=await fetch(`${VA}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!n.ok){const i=await n.text();let l;try{l=JSON.parse(i).error??i}catch{l=i}throw new Error(l)}return await n.json()}const hw="/api/v1",yg="first-tree-hub:tokens";function vg(){const e=localStorage.getItem(yg);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function mw(e){localStorage.setItem(yg,JSON.stringify(e))}function pw(){localStorage.removeItem(yg)}class Ud extends Error{constructor(t,n,i){super(n),this.status=t,this.issues=i,this.name="ApiError"}}let Fo=null;async function GA(e){return Fo||(Fo=(async()=>{try{const t=await fetch(`${hw}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(!t.ok)return null;const n=await t.json(),i={accessToken:n.accessToken,refreshToken:n.refreshToken??e};return mw(i),i}catch{return null}finally{Fo=null}})(),Fo)}async function Vc(e,t){const{method:n="GET",body:i}=t??{},l=f=>{const m={};return f&&(m.Authorization=`Bearer ${f}`),i!==void 0&&(m["Content-Type"]="application/json"),fetch(`${hw}${e}`,{method:n,headers:m,body:i!==void 0?JSON.stringify(i):void 0})},o=vg();let u=await l(o==null?void 0:o.accessToken);if(u.status===401&&(o!=null&&o.refreshToken)){const f=await GA(o.refreshToken);f&&(u=await l(f.accessToken))}if(!u.ok){u.status===401&&(pw(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await u.text();let m,h;try{const y=JSON.parse(f);m=y.error??f,Array.isArray(y.details)&&(h=y.details.filter(g=>typeof g=="object"&&g!==null&&Array.isArray(g.path)))}catch{m=f}throw new Ud(u.status,m,h)}if(u.status!==204)return await u.json()}const De={get:e=>Vc(e),post:(e,t)=>Vc(e,{method:"POST",body:t}),patch:(e,t)=>Vc(e,{method:"PATCH",body:t}),delete:e=>Vc(e,{method:"DELETE"})},gw=S.createContext(null);function KA({children:e}){const[t,n]=S.useState(()=>!!vg()),[i,l]=S.useState(null),[o,u]=S.useState(null),[f,m]=S.useState(null),h=S.useCallback(()=>{pw(),n(!1),l(null),u(null),m(null)},[]),y=S.useCallback(async()=>{try{const b=await De.get("/me");l(b.member.role),u(b.member.id),m(b.member.agentId)}catch{}},[]),g=S.useCallback(async(b,x)=>{const k=await QA(b,x);mw({accessToken:k.accessToken,refreshToken:k.refreshToken}),n(!0),await De.get("/me").then(j=>{l(j.member.role),u(j.member.id),m(j.member.agentId)}).catch(()=>{})},[]);return S.useEffect(()=>{t&&!i&&y()},[t,i,y]),S.useEffect(()=>{const b=()=>h();return window.addEventListener("auth:logout",b),()=>window.removeEventListener("auth:logout",b)},[h]),d.jsx(gw.Provider,{value:{isAuthenticated:t,role:i,memberId:o,agentId:f,login:g,logout:h},children:e})}function ja(){const e=S.useContext(gw);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function YA(){const{isAuthenticated:e}=ja();return e?d.jsx(Ep,{}):d.jsx(hg,{to:"/login",replace:!0})}/**
|
|
61
|
+
* @license lucide-react v0.577.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 yw=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.577.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
|
+
*/const XA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
71
|
+
* @license lucide-react v0.577.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 JA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase());/**
|
|
76
|
+
* @license lucide-react v0.577.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 C0=e=>{const t=JA(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
81
|
+
* @license lucide-react v0.577.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
|
+
*/var WA={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"};/**
|
|
86
|
+
* @license lucide-react v0.577.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 eT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
91
|
+
* @license lucide-react v0.577.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 tT=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:l="",children:o,iconNode:u,...f},m)=>S.createElement("svg",{ref:m,...WA,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:yw("lucide",l),...!o&&!eT(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,y])=>S.createElement(h,y)),...Array.isArray(o)?o:[o]]));/**
|
|
96
|
+
* @license lucide-react v0.577.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 ot=(e,t)=>{const n=S.forwardRef(({className:i,...l},o)=>S.createElement(tT,{ref:o,iconNode:t,className:yw(`lucide-${XA(C0(e))}`,`lucide-${e}`,i),...l}));return n.displayName=C0(e),n};/**
|
|
101
|
+
* @license lucide-react v0.577.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 nT=[["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"}]],rT=ot("bell",nT);/**
|
|
106
|
+
* @license lucide-react v0.577.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 aT=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],iT=ot("bot",aT);/**
|
|
111
|
+
* @license lucide-react v0.577.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 lT=[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]],sT=ot("cable",lT);/**
|
|
116
|
+
* @license lucide-react v0.577.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 oT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Id=ot("check",oT);/**
|
|
121
|
+
* @license lucide-react v0.577.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 uT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cT=ot("chevron-down",uT);/**
|
|
126
|
+
* @license lucide-react v0.577.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 dT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],fT=ot("chevron-right",dT);/**
|
|
131
|
+
* @license lucide-react v0.577.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 hT=[["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"}]],bg=ot("copy",hT);/**
|
|
136
|
+
* @license lucide-react v0.577.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 mT=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],pT=ot("ellipsis",mT);/**
|
|
141
|
+
* @license lucide-react v0.577.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 gT=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],yT=ot("funnel",gT);/**
|
|
146
|
+
* @license lucide-react v0.577.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 vT=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],bT=ot("layout-dashboard",vT);/**
|
|
151
|
+
* @license lucide-react v0.577.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 xT=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Np=ot("link-2",xT);/**
|
|
156
|
+
* @license lucide-react v0.577.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 ST=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],wT=ot("lock",ST);/**
|
|
161
|
+
* @license lucide-react v0.577.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 kT=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],jT=ot("log-out",kT);/**
|
|
166
|
+
* @license lucide-react v0.577.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 ET=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],vw=ot("message-square",ET);/**
|
|
171
|
+
* @license lucide-react v0.577.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 CT=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],_T=ot("moon",CT);/**
|
|
176
|
+
* @license lucide-react v0.577.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 NT=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],AT=ot("paperclip",NT);/**
|
|
181
|
+
* @license lucide-react v0.577.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 TT=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],RT=ot("pause",TT);/**
|
|
186
|
+
* @license lucide-react v0.577.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 zT=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Bd=ot("pencil",zT);/**
|
|
191
|
+
* @license lucide-react v0.577.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 OT=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],DT=ot("play",OT);/**
|
|
196
|
+
* @license lucide-react v0.577.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 MT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],gl=ot("plus",MT);/**
|
|
201
|
+
* @license lucide-react v0.577.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 LT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Pd=ot("search",LT);/**
|
|
206
|
+
* @license lucide-react v0.577.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 UT=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],IT=ot("send",UT);/**
|
|
211
|
+
* @license lucide-react v0.577.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 BT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],PT=ot("square",BT);/**
|
|
216
|
+
* @license lucide-react v0.577.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 $T=[["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"}]],FT=ot("sun",$T);/**
|
|
221
|
+
* @license lucide-react v0.577.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 qT=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],HT=ot("terminal",qT);/**
|
|
226
|
+
* @license lucide-react v0.577.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 ZT=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],lu=ot("trash-2",ZT);/**
|
|
231
|
+
* @license lucide-react v0.577.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 VT=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],QT=ot("triangle-alert",VT);/**
|
|
236
|
+
* @license lucide-react v0.577.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 GT=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],KT=ot("undo-2",GT);/**
|
|
241
|
+
* @license lucide-react v0.577.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 YT=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],XT=ot("unplug",YT);/**
|
|
246
|
+
* @license lucide-react v0.577.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 JT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ap=ot("x",JT);function bw(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=bw(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function xw(){for(var e,t,n=0,i="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=bw(e))&&(i&&(i+=" "),i+=t);return i}const WT=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},eR=(e,t)=>({classGroupId:e,validator:t}),Sw=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Sd="-",_0=[],tR="arbitrary..",nR=e=>{const t=aR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return rR(u);const f=u.split(Sd),m=f[0]===""&&f.length>1?1:0;return ww(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=i[u],h=n[u];return m?h?WT(h,m):m:h||_0}return n[u]||_0}}},ww=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=ww(e,t+1,o);if(h)return h}const u=n.validators;if(u===null)return;const f=t===0?e.join(Sd):e.slice(t).join(Sd),m=u.length;for(let h=0;h<m;h++){const y=u[h];if(y.validator(f))return y.classGroupId}},rR=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?tR+i:void 0})(),aR=e=>{const{theme:t,classGroups:n}=e;return iR(n,t)},iR=(e,t)=>{const n=Sw();for(const i in e){const l=e[i];xg(l,n,i,t)}return n},xg=(e,t,n,i)=>{const l=e.length;for(let o=0;o<l;o++){const u=e[o];lR(u,t,n,i)}},lR=(e,t,n,i)=>{if(typeof e=="string"){sR(e,t,n);return}if(typeof e=="function"){oR(e,t,n,i);return}uR(e,t,n,i)},sR=(e,t,n)=>{const i=e===""?t:kw(t,e);i.classGroupId=n},oR=(e,t,n,i)=>{if(cR(e)){xg(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(eR(n,e))},uR=(e,t,n,i)=>{const l=Object.entries(e),o=l.length;for(let u=0;u<o;u++){const[f,m]=l[u];xg(m,kw(t,f),n,i)}},kw=(e,t)=>{let n=e;const i=t.split(Sd),l=i.length;for(let o=0;o<l;o++){const u=i[o];let f=n.nextPart.get(u);f||(f=Sw(),n.nextPart.set(u,f)),n=f}return n},cR=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,dR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const l=(o,u)=>{n[o]=u,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(o){let u=n[o];if(u!==void 0)return u;if((u=i[o])!==void 0)return l(o,u),u},set(o,u){o in n?n[o]=u:l(o,u)}}},Tp="!",N0=":",fR=[],A0=(e,t,n,i,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:l}),hR=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=l=>{const o=[];let u=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const E=l[j];if(u===0&&f===0){if(E===N0){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?u++:E==="]"?u--:E==="("?f++:E===")"&&f--}const g=o.length===0?l:l.slice(m);let b=g,x=!1;g.endsWith(Tp)?(b=g.slice(0,-1),x=!0):g.startsWith(Tp)&&(b=g.slice(1),x=!0);const k=h&&h>m?h-m:void 0;return A0(o,x,b,k)};if(t){const l=t+N0,o=i;i=u=>u.startsWith(l)?o(u.slice(l.length)):A0(fR,!1,u,void 0,!0)}if(n){const l=i;i=o=>n({className:o,parseClassName:l})}return i},mR=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let l=[];for(let o=0;o<n.length;o++){const u=n[o],f=u[0]==="[",m=t.has(u);f||m?(l.length>0&&(l.sort(),i.push(...l),l=[]),i.push(u)):l.push(u)}return l.length>0&&(l.sort(),i.push(...l)),i}},pR=e=>({cache:dR(e.cacheSize),parseClassName:hR(e),sortModifiers:mR(e),...nR(e)}),gR=/\s+/,yR=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:l,sortModifiers:o}=t,u=[],f=e.trim().split(gR);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:b,hasImportantModifier:x,baseClassName:k,maybePostfixModifierPosition:j}=n(y);if(g){m=y+(m.length>0?" "+m:m);continue}let E=!!j,N=i(E?k.substring(0,j):k);if(!N){if(!E){m=y+(m.length>0?" "+m:m);continue}if(N=i(k),!N){m=y+(m.length>0?" "+m:m);continue}E=!1}const T=b.length===0?"":b.length===1?b[0]:o(b).join(":"),O=x?T+Tp:T,I=O+N;if(u.indexOf(I)>-1)continue;u.push(I);const B=l(N,E);for(let z=0;z<B.length;++z){const F=B[z];u.push(O+F)}m=y+(m.length>0?" "+m:m)}return m},vR=(...e)=>{let t=0,n,i,l="";for(;t<e.length;)(n=e[t++])&&(i=jw(n))&&(l&&(l+=" "),l+=i);return l},jw=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=jw(e[i]))&&(n&&(n+=" "),n+=t);return n},bR=(e,...t)=>{let n,i,l,o;const u=m=>{const h=t.reduce((y,g)=>g(y),e());return n=pR(h),i=n.cache.get,l=n.cache.set,o=f,f(m)},f=m=>{const h=i(m);if(h)return h;const y=yR(m,n);return l(m,y),y};return o=u,(...m)=>o(vR(...m))},xR=[],Zt=e=>{const t=n=>n[e]||xR;return t.isThemeGetter=!0,t},Ew=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Cw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SR=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,wR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kR=/\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$/,jR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ER=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ni=e=>SR.test(e),Fe=e=>!!e&&!Number.isNaN(Number(e)),ri=e=>!!e&&Number.isInteger(Number(e)),Cm=e=>e.endsWith("%")&&Fe(e.slice(0,-1)),da=e=>wR.test(e),_w=()=>!0,_R=e=>kR.test(e)&&!jR.test(e),Sg=()=>!1,NR=e=>ER.test(e),AR=e=>CR.test(e),TR=e=>!we(e)&&!ke(e),RR=e=>ji(e,Tw,Sg),we=e=>Ew.test(e),Ji=e=>ji(e,Rw,_R),T0=e=>ji(e,BR,Fe),zR=e=>ji(e,Ow,_w),OR=e=>ji(e,zw,Sg),R0=e=>ji(e,Nw,Sg),DR=e=>ji(e,Aw,AR),Qc=e=>ji(e,Dw,NR),ke=e=>Cw.test(e),qo=e=>yl(e,Rw),MR=e=>yl(e,zw),z0=e=>yl(e,Nw),LR=e=>yl(e,Tw),UR=e=>yl(e,Aw),Gc=e=>yl(e,Dw,!0),IR=e=>yl(e,Ow,!0),ji=(e,t,n)=>{const i=Ew.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},yl=(e,t,n=!1)=>{const i=Cw.exec(e);return i?i[1]?t(i[1]):n:!1},Nw=e=>e==="position"||e==="percentage",Aw=e=>e==="image"||e==="url",Tw=e=>e==="length"||e==="size"||e==="bg-size",Rw=e=>e==="length",BR=e=>e==="number",zw=e=>e==="family-name",Ow=e=>e==="number"||e==="weight",Dw=e=>e==="shadow",PR=()=>{const e=Zt("color"),t=Zt("font"),n=Zt("text"),i=Zt("font-weight"),l=Zt("tracking"),o=Zt("leading"),u=Zt("breakpoint"),f=Zt("container"),m=Zt("spacing"),h=Zt("radius"),y=Zt("shadow"),g=Zt("inset-shadow"),b=Zt("text-shadow"),x=Zt("drop-shadow"),k=Zt("blur"),j=Zt("perspective"),E=Zt("aspect"),N=Zt("ease"),T=Zt("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...I(),ke,we],z=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],Z=()=>[ke,we,m],ee=()=>[ni,"full","auto",...Z()],q=()=>[ri,"none","subgrid",ke,we],ae=()=>["auto",{span:["full",ri,ke,we]},ri,ke,we],re=()=>[ri,"auto",ke,we],pe=()=>["auto","min","max","fr",ke,we],de=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...Z()],V=()=>[ni,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Z()],ce=()=>[ni,"screen","full","dvw","lvw","svw","min","max","fit",...Z()],be=()=>[ni,"screen","full","lh","dvh","lvh","svh","min","max","fit",...Z()],R=()=>[e,ke,we],L=()=>[...I(),z0,R0,{position:[ke,we]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],C=()=>["auto","cover","contain",LR,RR,{size:[ke,we]}],J=()=>[Cm,qo,Ji],Y=()=>["","none","full",h,ke,we],ue=()=>["",Fe,qo,Ji],ge=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Fe,Cm,z0,R0],_t=()=>["","none",k,ke,we],en=()=>["none",Fe,ke,we],Bn=()=>["none",Fe,ke,we],tr=()=>[Fe,ke,we],tn=()=>[ni,"full",...Z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[da],breakpoint:[da],color:[_w],container:[da],"drop-shadow":[da],ease:["in","out","in-out"],font:[TR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[da],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[da],shadow:[da],spacing:["px",Fe],text:[da],"text-shadow":[da],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ni,we,ke,E]}],container:["container"],columns:[{columns:[Fe,we,ke,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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"],sr:["sr-only","not-sr-only"],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:B()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ee()}],"inset-x":[{"inset-x":ee()}],"inset-y":[{"inset-y":ee()}],start:[{"inset-s":ee(),start:ee()}],end:[{"inset-e":ee(),end:ee()}],"inset-bs":[{"inset-bs":ee()}],"inset-be":[{"inset-be":ee()}],top:[{top:ee()}],right:[{right:ee()}],bottom:[{bottom:ee()}],left:[{left:ee()}],visibility:["visible","invisible","collapse"],z:[{z:[ri,"auto",ke,we]}],basis:[{basis:[ni,"full","auto",f,...Z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,ni,"auto","initial","none",we]}],grow:[{grow:["",Fe,ke,we]}],shrink:[{shrink:["",Fe,ke,we]}],order:[{order:[ri,"first","last","none",ke,we]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:Z()}],"gap-x":[{"gap-x":Z()}],"gap-y":[{"gap-y":Z()}],"justify-content":[{justify:[...de(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...de()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":de()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pbs:[{pbs:Z()}],pbe:[{pbe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":Z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Z()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...ce()]}],"min-inline-size":[{"min-inline":["auto",...ce()]}],"max-inline-size":[{"max-inline":["none",...ce()]}],"block-size":[{block:["auto",...be()]}],"min-block-size":[{"min-block":["auto",...be()]}],"max-block-size":[{"max-block":["none",...be()]}],w:[{w:[f,"screen",...V()]}],"min-w":[{"min-w":[f,"screen","none",...V()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,qo,Ji]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,IR,zR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cm,we]}],"font-family":[{font:[MR,OR,t]}],"font-features":[{"font-features":[we]}],"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:[l,ke,we]}],"line-clamp":[{"line-clamp":[Fe,"none",ke,T0]}],leading:[{leading:[o,...Z()]}],"list-image":[{"list-image":["none",ke,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",ke,Ji]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[Fe,"auto",ke,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ri,ke,we],radial:["",ke,we],conic:[ri,ke,we]},UR,DR]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,ke,we]}],"outline-w":[{outline:["",Fe,qo,Ji]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",y,Gc,Qc]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",g,Gc,Qc]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[Fe,Ji]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",b,Gc,Qc]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[Fe,ke,we]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[ke,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,we]}],filter:[{filter:["","none",ke,we]}],blur:[{blur:_t()}],brightness:[{brightness:[Fe,ke,we]}],contrast:[{contrast:[Fe,ke,we]}],"drop-shadow":[{"drop-shadow":["","none",x,Gc,Qc]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",Fe,ke,we]}],"hue-rotate":[{"hue-rotate":[Fe,ke,we]}],invert:[{invert:["",Fe,ke,we]}],saturate:[{saturate:[Fe,ke,we]}],sepia:[{sepia:["",Fe,ke,we]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,we]}],"backdrop-blur":[{"backdrop-blur":_t()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,ke,we]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,ke,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,ke,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,ke,we]}],"backdrop-invert":[{"backdrop-invert":["",Fe,ke,we]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,ke,we]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,ke,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,ke,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Z()}],"border-spacing-x":[{"border-spacing-x":Z()}],"border-spacing-y":[{"border-spacing-y":Z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",ke,we]}],ease:[{ease:["linear","initial",N,ke,we]}],delay:[{delay:[Fe,ke,we]}],animate:[{animate:["none",T,ke,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,ke,we]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:en()}],"rotate-x":[{"rotate-x":en()}],"rotate-y":[{"rotate-y":en()}],"rotate-z":[{"rotate-z":en()}],scale:[{scale:Bn()}],"scale-x":[{"scale-x":Bn()}],"scale-y":[{"scale-y":Bn()}],"scale-z":[{"scale-z":Bn()}],"scale-3d":["scale-3d"],skew:[{skew:tr()}],"skew-x":[{"skew-x":tr()}],"skew-y":[{"skew-y":tr()}],transform:[{transform:[ke,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:tn()}],"translate-x":[{"translate-x":tn()}],"translate-y":[{"translate-y":tn()}],"translate-z":[{"translate-z":tn()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",ke,we]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mbs":[{"scroll-mbs":Z()}],"scroll-mbe":[{"scroll-mbe":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pbs":[{"scroll-pbs":Z()}],"scroll-pbe":[{"scroll-pbe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"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",ke,we]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[Fe,qo,Ji,T0]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},$R=bR(PR);function Te(...e){return $R(xw(e))}function xa(e){return e?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e)):"—"}function FR(e){return De.delete(`/clients/${encodeURIComponent(e)}`)}function Su(){return De.get("/admin/agents/activity")}function $d(){return De.get("/clients")}function qR(e){return De.post(`/clients/${e}/disconnect`)}function Mw(){return De.post("/connect-tokens")}const Lw=(e,t)=>["session",e,t],Rp=e=>["agent-sessions",e];function HR(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.toolUseId!="string"||typeof t.name!="string"||t.status!=="pending"&&t.status!=="ok"&&t.status!=="error"?null:{toolUseId:t.toolUseId,name:t.name,args:t.args,status:t.status,durationMs:typeof t.durationMs=="number"?t.durationMs:void 0,resultPreview:typeof t.resultPreview=="string"?t.resultPreview:void 0}}function ZR(e){if(typeof e!="object"||e===null)return null;const t=e;return t.source!=="sdk"&&t.source!=="runtime"&&t.source!=="tool"||typeof t.message!="string"?null:{source:t.source,message:t.message}}function VR(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function $s(e,t){const n=new URLSearchParams;t!=null&&t.state&&n.set("state",t.state),t!=null&&t.runtimeState&&n.set("runtimeState",t.runtimeState);const i=n.toString();return De.get(`/admin/sessions/agents/${e}${i?`?${i}`:""}`)}function QR(e,t,n){const i=new URLSearchParams;i.set("limit",String(n.limit)),(n==null?void 0:n.cursor)!==void 0&&i.set("cursor",String(n.cursor)),n!=null&&n.direction&&i.set("direction",n.direction);const l=i.toString();return De.get(`/admin/sessions/agents/${e}/${t}/events${l?`?${l}`:""}`)}function GR(e,t){return De.post(`/admin/sessions/agents/${e}/${t}/suspend`)}function KR(e,t){return De.post(`/admin/sessions/agents/${e}/${t}/terminate`)}var O0=1,YR=.9,XR=.8,JR=.17,_m=.1,Nm=.999,WR=.9999,ez=.99,tz=/[\\\/_+.#"@\[\(\{&]/,nz=/[\\\/_+.#"@\[\(\{&]/g,rz=/[\s-]/,Uw=/[\s-]/g;function zp(e,t,n,i,l,o,u){if(o===t.length)return l===e.length?O0:ez;var f=`${l},${o}`;if(u[f]!==void 0)return u[f];for(var m=i.charAt(o),h=n.indexOf(m,l),y=0,g,b,x,k;h>=0;)g=zp(e,t,n,i,h+1,o+1,u),g>y&&(h===l?g*=O0:tz.test(e.charAt(h-1))?(g*=XR,x=e.slice(l,h-1).match(nz),x&&l>0&&(g*=Math.pow(Nm,x.length))):rz.test(e.charAt(h-1))?(g*=YR,k=e.slice(l,h-1).match(Uw),k&&l>0&&(g*=Math.pow(Nm,k.length))):(g*=JR,l>0&&(g*=Math.pow(Nm,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=WR)),(g<_m&&n.charAt(h-1)===i.charAt(o+1)||i.charAt(o+1)===i.charAt(o)&&n.charAt(h-1)!==i.charAt(o))&&(b=zp(e,t,n,i,h+1,o+2,u),b*_m>g&&(g=b*_m)),g>y&&(y=g),h=n.indexOf(m,h+1);return u[f]=y,y}function D0(e){return e.toLowerCase().replace(Uw," ")}function az(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,zp(e,t,D0(e),D0(t),0,0,{})}function bi(e,t,{checkForDefaultPrevented:n=!0}={}){return function(l){if(e==null||e(l),n===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function M0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xi(...e){return t=>{let n=!1;const i=e.map(l=>{const o=M0(l,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let l=0;l<i.length;l++){const o=i[l];typeof o=="function"?o():M0(e[l],null)}}}}function vl(...e){return S.useCallback(xi(...e),e)}function iz(e,t){const n=S.createContext(t),i=o=>{const{children:u,...f}=o,m=S.useMemo(()=>f,Object.values(f));return d.jsx(n.Provider,{value:m,children:u})};i.displayName=e+"Provider";function l(o){const u=S.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[i,l]}function lz(e,t=[]){let n=[];function i(o,u){const f=S.createContext(u),m=n.length;n=[...n,u];const h=g=>{var N;const{scope:b,children:x,...k}=g,j=((N=b==null?void 0:b[e])==null?void 0:N[m])||f,E=S.useMemo(()=>k,Object.values(k));return d.jsx(j.Provider,{value:E,children:x})};h.displayName=o+"Provider";function y(g,b){var j;const x=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=S.useContext(x);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(u=>S.createContext(u));return function(f){const m=(f==null?void 0:f[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[i,sz(l,...t)]}function sz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const u=i.reduce((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var su=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},oz=rg[" useId ".trim().toString()]||(()=>{}),uz=0;function ya(e){const[t,n]=S.useState(oz());return su(()=>{n(i=>i??String(uz++))},[e]),t?`radix-${t}`:""}var cz=rg[" useInsertionEffect ".trim().toString()]||su;function dz({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[l,o,u]=fz({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const y=S.useRef(e!==void 0);S.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${i} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,i])}const h=S.useCallback(y=>{var g;if(f){const b=hz(y)?y(e):y;b!==e&&((g=u.current)==null||g.call(u,b))}else o(y)},[f,e,o,u]);return[m,h]}function fz({defaultProp:e,onChange:t}){const[n,i]=S.useState(e),l=S.useRef(n),o=S.useRef(t);return cz(()=>{o.current=t},[t]),S.useEffect(()=>{var u;l.current!==n&&((u=o.current)==null||u.call(o,n),l.current=n)},[n,l]),[n,i,o]}function hz(e){return typeof e=="function"}var Iw=MS();const mz=Od(Iw);function Bw(e){const t=pz(e),n=S.forwardRef((i,l)=>{const{children:o,...u}=i,f=S.Children.toArray(o),m=f.find(yz);if(m){const h=m.props.children,y=f.map(g=>g===m?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:g);return d.jsx(t,{...u,ref:l,children:S.isValidElement(h)?S.cloneElement(h,void 0,y):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function pz(e){const t=S.forwardRef((n,i)=>{const{children:l,...o}=n;if(S.isValidElement(l)){const u=bz(l),f=vz(o,l.props);return l.type!==S.Fragment&&(f.ref=i?xi(i,u):u),S.cloneElement(l,f)}return S.Children.count(l)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gz=Symbol("radix.slottable");function yz(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gz}function vz(e,t){const n={...t};for(const i in t){const l=e[i],o=t[i];/^on[A-Z]/.test(i)?l&&o?n[i]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[i]=l):i==="style"?n[i]={...l,...o}:i==="className"&&(n[i]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function bz(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ea=xz.reduce((e,t)=>{const n=Bw(`Primitive.${t}`),i=S.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function Sz(e,t){e&&Iw.flushSync(()=>e.dispatchEvent(t))}function ou(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}function wz(e,t=globalThis==null?void 0:globalThis.document){const n=ou(e);S.useEffect(()=>{const i=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var kz="DismissableLayer",Op="dismissableLayer.update",jz="dismissableLayer.pointerDownOutside",Ez="dismissableLayer.focusOutside",L0,Pw=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$w=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...m}=e,h=S.useContext(Pw),[y,g]=S.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=S.useState({}),k=vl(t,F=>g(F)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),N=j.indexOf(E),T=y?j.indexOf(y):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,I=T>=N,B=Nz(F=>{const Z=F.target,ee=[...h.branches].some(q=>q.contains(Z));!I||ee||(l==null||l(F),u==null||u(F),F.defaultPrevented||f==null||f())},b),z=Az(F=>{const Z=F.target;[...h.branches].some(q=>q.contains(Z))||(o==null||o(F),u==null||u(F),F.defaultPrevented||f==null||f())},b);return wz(F=>{T===h.layers.size-1&&(i==null||i(F),!F.defaultPrevented&&f&&(F.preventDefault(),f()))},b),S.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(L0=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),U0(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=L0)}},[y,b,n,h]),S.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),U0())},[y,h]),S.useEffect(()=>{const F=()=>x({});return document.addEventListener(Op,F),()=>document.removeEventListener(Op,F)},[]),d.jsx(Ea.div,{...m,ref:k,style:{pointerEvents:O?I?"auto":"none":void 0,...e.style},onFocusCapture:bi(e.onFocusCapture,z.onFocusCapture),onBlurCapture:bi(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:bi(e.onPointerDownCapture,B.onPointerDownCapture)})});$w.displayName=kz;var Cz="DismissableLayerBranch",_z=S.forwardRef((e,t)=>{const n=S.useContext(Pw),i=S.useRef(null),l=vl(t,i);return S.useEffect(()=>{const o=i.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(Ea.div,{...e,ref:l})});_z.displayName=Cz;function Nz(e,t=globalThis==null?void 0:globalThis.document){const n=ou(e),i=S.useRef(!1),l=S.useRef(()=>{});return S.useEffect(()=>{const o=f=>{if(f.target&&!i.current){let m=function(){Fw(jz,n,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=m,t.addEventListener("click",l.current,{once:!0})):m()}else t.removeEventListener("click",l.current);i.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>i.current=!0}}function Az(e,t=globalThis==null?void 0:globalThis.document){const n=ou(e),i=S.useRef(!1);return S.useEffect(()=>{const l=o=>{o.target&&!i.current&&Fw(Ez,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function U0(){const e=new CustomEvent(Op);document.dispatchEvent(e)}function Fw(e,t,n,{discrete:i}){const l=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),i?Sz(l,o):l.dispatchEvent(o)}var Am="focusScope.autoFocusOnMount",Tm="focusScope.autoFocusOnUnmount",I0={bubbles:!1,cancelable:!0},Tz="FocusScope",qw=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...u}=e,[f,m]=S.useState(null),h=ou(l),y=ou(o),g=S.useRef(null),b=vl(t,j=>m(j)),x=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(i){let j=function(O){if(x.paused||!f)return;const I=O.target;f.contains(I)?g.current=I:li(g.current,{select:!0})},E=function(O){if(x.paused||!f)return;const I=O.relatedTarget;I!==null&&(f.contains(I)||li(g.current,{select:!0}))},N=function(O){if(document.activeElement===document.body)for(const B of O)B.removedNodes.length>0&&li(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const T=new MutationObserver(N);return f&&T.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),T.disconnect()}}},[i,f,x.paused]),S.useEffect(()=>{if(f){P0.add(x);const j=document.activeElement;if(!f.contains(j)){const N=new CustomEvent(Am,I0);f.addEventListener(Am,h),f.dispatchEvent(N),N.defaultPrevented||(Rz(Lz(Hw(f)),{select:!0}),document.activeElement===j&&li(f))}return()=>{f.removeEventListener(Am,h),setTimeout(()=>{const N=new CustomEvent(Tm,I0);f.addEventListener(Tm,y),f.dispatchEvent(N),N.defaultPrevented||li(j??document.body,{select:!0}),f.removeEventListener(Tm,y),P0.remove(x)},0)}}},[f,h,y,x]);const k=S.useCallback(j=>{if(!n&&!i||x.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,N=document.activeElement;if(E&&N){const T=j.currentTarget,[O,I]=zz(T);O&&I?!j.shiftKey&&N===I?(j.preventDefault(),n&&li(O,{select:!0})):j.shiftKey&&N===O&&(j.preventDefault(),n&&li(I,{select:!0})):N===T&&j.preventDefault()}},[n,i,x.paused]);return d.jsx(Ea.div,{tabIndex:-1,...u,ref:b,onKeyDown:k})});qw.displayName=Tz;function Rz(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(li(i,{select:t}),document.activeElement!==n)return}function zz(e){const t=Hw(e),n=B0(t,e),i=B0(t.reverse(),e);return[n,i]}function Hw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function B0(e,t){for(const n of e)if(!Oz(n,{upTo:t}))return n}function Oz(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Dz(e){return e instanceof HTMLInputElement&&"select"in e}function li(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Dz(e)&&t&&e.select()}}var P0=Mz();function Mz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=$0(e,t),e.unshift(t)},remove(t){var n;e=$0(e,t),(n=e[0])==null||n.resume()}}}function $0(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function Lz(e){return e.filter(t=>t.tagName!=="A")}var Uz="Portal",Zw=S.forwardRef((e,t)=>{var f;const{container:n,...i}=e,[l,o]=S.useState(!1);su(()=>o(!0),[]);const u=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?mz.createPortal(d.jsx(Ea.div,{...i,ref:t}),u):null});Zw.displayName=Uz;function Iz(e,t){return S.useReducer((n,i)=>t[n][i]??n,e)}var Fd=e=>{const{present:t,children:n}=e,i=Bz(t),l=typeof n=="function"?n({present:i.isPresent}):S.Children.only(n),o=vl(i.ref,Pz(l));return typeof n=="function"||i.isPresent?S.cloneElement(l,{ref:o}):null};Fd.displayName="Presence";function Bz(e){const[t,n]=S.useState(),i=S.useRef(null),l=S.useRef(e),o=S.useRef("none"),u=e?"mounted":"unmounted",[f,m]=Iz(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const h=Kc(i.current);o.current=f==="mounted"?h:"none"},[f]),su(()=>{const h=i.current,y=l.current;if(y!==e){const b=o.current,x=Kc(h);e?m("MOUNT"):x==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&b!==x?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),su(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=x=>{const j=Kc(i.current).includes(CSS.escape(x.animationName));if(x.target===t&&j&&(m("ANIMATION_END"),!l.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},b=x=>{x.target===t&&(o.current=Kc(i.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:S.useCallback(h=>{i.current=h?getComputedStyle(h):null,n(h)},[])}}function Kc(e){return(e==null?void 0:e.animationName)||"none"}function Pz(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Rm=0;function $z(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??F0()),document.body.insertAdjacentElement("beforeend",e[1]??F0()),Rm++,()=>{Rm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rm--}},[])}function F0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Br=function(){return Br=Object.assign||function(t){for(var n,i=1,l=arguments.length;i<l;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Br.apply(this,arguments)};function Vw(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(n[i[l]]=e[i[l]]);return n}function Fz(e,t,n){if(n||arguments.length===2)for(var i=0,l=t.length,o;i<l;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var fd="right-scroll-bar-position",hd="width-before-scroll-bar",qz="with-scroll-bars-hidden",Hz="--removed-body-scroll-bar-size";function zm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Zz(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var l=n.value;l!==i&&(n.value=i,n.callback(i,l))}}}})[0];return n.callback=t,n.facade}var Vz=typeof window<"u"?S.useLayoutEffect:S.useEffect,q0=new WeakMap;function Qz(e,t){var n=Zz(null,function(i){return e.forEach(function(l){return zm(l,i)})});return Vz(function(){var i=q0.get(n);if(i){var l=new Set(i),o=new Set(e),u=n.current;l.forEach(function(f){o.has(f)||zm(f,null)}),o.forEach(function(f){l.has(f)||zm(f,u)})}q0.set(n,e)},[e]),n}function Gz(e){return e}function Kz(e,t){t===void 0&&(t=Gz);var n=[],i=!1,l={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var u=t(o,i);return n.push(u),function(){n=n.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(i=!0;n.length;){var u=n;n=[],u.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){i=!0;var u=[];if(n.length){var f=n;n=[],f.forEach(o),u=n}var m=function(){var y=u;u=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){u.push(y),h()},filter:function(y){return u=u.filter(y),n}}}};return l}function Yz(e){e===void 0&&(e={});var t=Kz(null);return t.options=Br({async:!0,ssr:!1},e),t}var Qw=function(e){var t=e.sideCar,n=Vw(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return S.createElement(i,Br({},n))};Qw.isSideCarExport=!0;function Xz(e,t){return e.useMedium(t),Qw}var Gw=Yz(),Om=function(){},qd=S.forwardRef(function(e,t){var n=S.useRef(null),i=S.useState({onScrollCapture:Om,onWheelCapture:Om,onTouchMoveCapture:Om}),l=i[0],o=i[1],u=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,b=e.sideCar,x=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,N=e.as,T=N===void 0?"div":N,O=e.gapMode,I=Vw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),B=b,z=Qz([n,t]),F=Br(Br({},I),l);return S.createElement(S.Fragment,null,y&&S.createElement(B,{sideCar:Gw,removeScrollBar:h,shards:g,noRelative:x,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:O}),u?S.cloneElement(S.Children.only(f),Br(Br({},F),{ref:z})):S.createElement(T,Br({},F,{className:m,ref:z}),f))});qd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qd.classNames={fullWidth:hd,zeroRight:fd};var Jz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Jz();return t&&e.setAttribute("nonce",t),e}function eO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Wz())&&(eO(t,n),tO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rO=function(){var e=nO();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Kw=function(){var e=rO(),t=function(n){var i=n.styles,l=n.dynamic;return e(i,l),null};return t},aO={left:0,top:0,right:0,gap:0},Dm=function(e){return parseInt(e||"",10)||0},iO=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[Dm(n),Dm(i),Dm(l)]},lO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aO;var t=iO(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},sO=Kw(),vs="data-scroll-locked",oO=function(e,t,n,i){var l=e.left,o=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
251
|
+
.`.concat(qz,` {
|
|
252
|
+
overflow: hidden `).concat(i,`;
|
|
253
|
+
padding-right: `).concat(f,"px ").concat(i,`;
|
|
254
|
+
}
|
|
255
|
+
body[`).concat(vs,`] {
|
|
256
|
+
overflow: hidden `).concat(i,`;
|
|
257
|
+
overscroll-behavior: contain;
|
|
258
|
+
`).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&`
|
|
259
|
+
padding-left: `.concat(l,`px;
|
|
260
|
+
padding-top: `).concat(o,`px;
|
|
261
|
+
padding-right: `).concat(u,`px;
|
|
262
|
+
margin-left:0;
|
|
263
|
+
margin-top:0;
|
|
264
|
+
margin-right: `).concat(f,"px ").concat(i,`;
|
|
265
|
+
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.`).concat(fd,` {
|
|
269
|
+
right: `).concat(f,"px ").concat(i,`;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.`).concat(hd,` {
|
|
273
|
+
margin-right: `).concat(f,"px ").concat(i,`;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.`).concat(fd," .").concat(fd,` {
|
|
277
|
+
right: 0 `).concat(i,`;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.`).concat(hd," .").concat(hd,` {
|
|
281
|
+
margin-right: 0 `).concat(i,`;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
body[`).concat(vs,`] {
|
|
285
|
+
`).concat(Hz,": ").concat(f,`px;
|
|
286
|
+
}
|
|
287
|
+
`)},H0=function(){var e=parseInt(document.body.getAttribute(vs)||"0",10);return isFinite(e)?e:0},uO=function(){S.useEffect(function(){return document.body.setAttribute(vs,(H0()+1).toString()),function(){var e=H0()-1;e<=0?document.body.removeAttribute(vs):document.body.setAttribute(vs,e.toString())}},[])},cO=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,l=i===void 0?"margin":i;uO();var o=S.useMemo(function(){return lO(l)},[l]);return S.createElement(sO,{styles:oO(o,!t,l,n?"":"!important")})},Dp=!1;if(typeof window<"u")try{var Yc=Object.defineProperty({},"passive",{get:function(){return Dp=!0,!0}});window.addEventListener("test",Yc,Yc),window.removeEventListener("test",Yc,Yc)}catch{Dp=!1}var ss=Dp?{passive:!1}:!1,dO=function(e){return e.tagName==="TEXTAREA"},Yw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dO(e)&&n[t]==="visible")},fO=function(e){return Yw(e,"overflowY")},hO=function(e){return Yw(e,"overflowX")},Z0=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=Xw(e,i);if(l){var o=Jw(e,i),u=o[1],f=o[2];if(u>f)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},mO=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},pO=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},Xw=function(e,t){return e==="v"?fO(t):hO(t)},Jw=function(e,t){return e==="v"?mO(t):pO(t)},gO=function(e,t){return e==="h"&&t==="rtl"?-1:1},yO=function(e,t,n,i,l){var o=gO(e,window.getComputedStyle(t).direction),u=o*i,f=n.target,m=t.contains(f),h=!1,y=u>0,g=0,b=0;do{if(!f)break;var x=Jw(e,f),k=x[0],j=x[1],E=x[2],N=j-E-o*k;(k||N)&&Xw(e,f)&&(g+=N,b+=k);var T=f.parentNode;f=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(y&&Math.abs(g)<1||!y&&Math.abs(b)<1)&&(h=!0),h},Xc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},V0=function(e){return[e.deltaX,e.deltaY]},Q0=function(e){return e&&"current"in e?e.current:e},vO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bO=function(e){return`
|
|
288
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
289
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
290
|
+
`)},xO=0,os=[];function SO(e){var t=S.useRef([]),n=S.useRef([0,0]),i=S.useRef(),l=S.useState(xO++)[0],o=S.useState(Kw)[0],u=S.useRef(e);S.useEffect(function(){u.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=Fz([e.lockRef.current],(e.shards||[]).map(Q0),!0).filter(Boolean);return j.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=S.useCallback(function(j,E){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!u.current.allowPinchZoom;var N=Xc(j),T=n.current,O="deltaX"in j?j.deltaX:T[0]-N[0],I="deltaY"in j?j.deltaY:T[1]-N[1],B,z=j.target,F=Math.abs(O)>Math.abs(I)?"h":"v";if("touches"in j&&F==="h"&&z.type==="range")return!1;var Z=window.getSelection(),ee=Z&&Z.anchorNode,q=ee?ee===z||ee.contains(z):!1;if(q)return!1;var ae=Z0(F,z);if(!ae)return!0;if(ae?B=F:(B=F==="v"?"h":"v",ae=Z0(F,z)),!ae)return!1;if(!i.current&&"changedTouches"in j&&(O||I)&&(i.current=B),!B)return!0;var re=i.current||B;return yO(re,E,j,re==="h"?O:I)},[]),m=S.useCallback(function(j){var E=j;if(!(!os.length||os[os.length-1]!==o)){var N="deltaY"in E?V0(E):Xc(E),T=t.current.filter(function(B){return B.name===E.type&&(B.target===E.target||E.target===B.shadowParent)&&vO(B.delta,N)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var O=(u.current.shards||[]).map(Q0).filter(Boolean).filter(function(B){return B.contains(E.target)}),I=O.length>0?f(E,O[0]):!u.current.noIsolation;I&&E.cancelable&&E.preventDefault()}}},[]),h=S.useCallback(function(j,E,N,T){var O={name:j,delta:E,target:N,should:T,shadowParent:wO(N)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(I){return I!==O})},1)},[]),y=S.useCallback(function(j){n.current=Xc(j),i.current=void 0},[]),g=S.useCallback(function(j){h(j.type,V0(j),j.target,f(j,e.lockRef.current))},[]),b=S.useCallback(function(j){h(j.type,Xc(j),j.target,f(j,e.lockRef.current))},[]);S.useEffect(function(){return os.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",m,ss),document.addEventListener("touchmove",m,ss),document.addEventListener("touchstart",y,ss),function(){os=os.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,ss),document.removeEventListener("touchmove",m,ss),document.removeEventListener("touchstart",y,ss)}},[]);var x=e.removeScrollBar,k=e.inert;return S.createElement(S.Fragment,null,k?S.createElement(o,{styles:bO(l)}):null,x?S.createElement(cO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kO=Xz(Gw,SO);var Ww=S.forwardRef(function(e,t){return S.createElement(qd,Br({},e,{ref:t,sideCar:kO}))});Ww.classNames=qd.classNames;var jO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},us=new WeakMap,Jc=new WeakMap,Wc={},Mm=0,ek=function(e){return e&&(e.host||ek(e.parentNode))},EO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=ek(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},CO=function(e,t,n,i){var l=EO(t,Array.isArray(e)?e:[e]);Wc[n]||(Wc[n]=new WeakMap);var o=Wc[n],u=[],f=new Set,m=new Set(l),h=function(g){!g||f.has(g)||(f.add(g),h(g.parentNode))};l.forEach(h);var y=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(f.has(b))y(b);else try{var x=b.getAttribute(i),k=x!==null&&x!=="false",j=(us.get(b)||0)+1,E=(o.get(b)||0)+1;us.set(b,j),o.set(b,E),u.push(b),j===1&&k&&Jc.set(b,!0),E===1&&b.setAttribute(n,"true"),k||b.setAttribute(i,"true")}catch(N){console.error("aria-hidden: cannot operate on ",b,N)}})};return y(t),f.clear(),Mm++,function(){u.forEach(function(g){var b=us.get(g)-1,x=o.get(g)-1;us.set(g,b),o.set(g,x),b||(Jc.has(g)||g.removeAttribute(i),Jc.delete(g)),x||g.removeAttribute(n)}),Mm--,Mm||(us=new WeakMap,us=new WeakMap,Jc=new WeakMap,Wc={})}},_O=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),l=jO(e);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),CO(i,l,n,"aria-hidden")):function(){return null}},Hd="Dialog",[tk]=lz(Hd),[NO,_r]=tk(Hd),nk=e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:l,onOpenChange:o,modal:u=!0}=e,f=S.useRef(null),m=S.useRef(null),[h,y]=dz({prop:i,defaultProp:l??!1,onChange:o,caller:Hd});return d.jsx(NO,{scope:t,triggerRef:f,contentRef:m,contentId:ya(),titleId:ya(),descriptionId:ya(),open:h,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(g=>!g),[y]),modal:u,children:n})};nk.displayName=Hd;var rk="DialogTrigger",ak=S.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,l=_r(rk,n),o=vl(t,l.triggerRef);return d.jsx(Ea.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":jg(l.open),...i,ref:o,onClick:bi(e.onClick,l.onOpenToggle)})});ak.displayName=rk;var wg="DialogPortal",[AO,ik]=tk(wg,{forceMount:void 0}),lk=e=>{const{__scopeDialog:t,forceMount:n,children:i,container:l}=e,o=_r(wg,t);return d.jsx(AO,{scope:t,forceMount:n,children:S.Children.map(i,u=>d.jsx(Fd,{present:n||o.open,children:d.jsx(Zw,{asChild:!0,container:l,children:u})}))})};lk.displayName=wg;var wd="DialogOverlay",sk=S.forwardRef((e,t)=>{const n=ik(wd,e.__scopeDialog),{forceMount:i=n.forceMount,...l}=e,o=_r(wd,e.__scopeDialog);return o.modal?d.jsx(Fd,{present:i||o.open,children:d.jsx(RO,{...l,ref:t})}):null});sk.displayName=wd;var TO=Bw("DialogOverlay.RemoveScroll"),RO=S.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,l=_r(wd,n);return d.jsx(Ww,{as:TO,allowPinchZoom:!0,shards:[l.contentRef],children:d.jsx(Ea.div,{"data-state":jg(l.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),dl="DialogContent",ok=S.forwardRef((e,t)=>{const n=ik(dl,e.__scopeDialog),{forceMount:i=n.forceMount,...l}=e,o=_r(dl,e.__scopeDialog);return d.jsx(Fd,{present:i||o.open,children:o.modal?d.jsx(zO,{...l,ref:t}):d.jsx(OO,{...l,ref:t})})});ok.displayName=dl;var zO=S.forwardRef((e,t)=>{const n=_r(dl,e.__scopeDialog),i=S.useRef(null),l=vl(t,n.contentRef,i);return S.useEffect(()=>{const o=i.current;if(o)return _O(o)},[]),d.jsx(uk,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bi(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:bi(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:bi(e.onFocusOutside,o=>o.preventDefault())})}),OO=S.forwardRef((e,t)=>{const n=_r(dl,e.__scopeDialog),i=S.useRef(!1),l=S.useRef(!1);return d.jsx(uk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,f;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(i.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:o=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const u=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),uk=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:o,...u}=e,f=_r(dl,n),m=S.useRef(null),h=vl(t,m);return $z(),d.jsxs(d.Fragment,{children:[d.jsx(qw,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:o,children:d.jsx($w,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":jg(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(DO,{titleId:f.titleId}),d.jsx(LO,{contentRef:m,descriptionId:f.descriptionId})]})]})}),kg="DialogTitle",ck=S.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,l=_r(kg,n);return d.jsx(Ea.h2,{id:l.titleId,...i,ref:t})});ck.displayName=kg;var dk="DialogDescription",fk=S.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,l=_r(dk,n);return d.jsx(Ea.p,{id:l.descriptionId,...i,ref:t})});fk.displayName=dk;var hk="DialogClose",mk=S.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,l=_r(hk,n);return d.jsx(Ea.button,{type:"button",...i,ref:t,onClick:bi(e.onClick,()=>l.onOpenChange(!1))})});mk.displayName=hk;function jg(e){return e?"open":"closed"}var pk="DialogTitleWarning",[IF,gk]=iz(pk,{contentName:dl,titleName:kg,docsSlug:"dialog"}),DO=({titleId:e})=>{const t=gk(pk),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
291
|
+
|
|
292
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
293
|
+
|
|
294
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},MO="DialogDescriptionWarning",LO=({contentRef:e,descriptionId:t})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gk(MO).contentName}}.`;return S.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(i))},[i,e,t]),null},yk=nk,UO=ak,vk=lk,bk=sk,xk=ok,IO=ck,BO=fk,PO=mk,$O=Symbol.for("react.lazy"),kd=rg[" use ".trim().toString()];function FO(e){return typeof e=="object"&&e!==null&&"then"in e}function Sk(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$O&&"_payload"in e&&FO(e._payload)}function wk(e){const t=HO(e),n=S.forwardRef((i,l)=>{let{children:o,...u}=i;Sk(o)&&typeof kd=="function"&&(o=kd(o._payload));const f=S.Children.toArray(o),m=f.find(VO);if(m){const h=m.props.children,y=f.map(g=>g===m?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:g);return d.jsx(t,{...u,ref:l,children:S.isValidElement(h)?S.cloneElement(h,void 0,y):null})}return d.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var qO=wk("Slot");function HO(e){const t=S.forwardRef((n,i)=>{let{children:l,...o}=n;if(Sk(l)&&typeof kd=="function"&&(l=kd(l._payload)),S.isValidElement(l)){const u=GO(l),f=QO(o,l.props);return l.type!==S.Fragment&&(f.ref=i?xi(i,u):u),S.cloneElement(l,f)}return S.Children.count(l)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZO=Symbol("radix.slottable");function VO(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZO}function QO(e,t){const n={...t};for(const i in t){const l=e[i],o=t[i];/^on[A-Z]/.test(i)?l&&o?n[i]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[i]=l):i==="style"?n[i]={...l,...o}:i==="className"&&(n[i]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function GO(e){var i,l;let t=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var KO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ca=KO.reduce((e,t)=>{const n=wk(`Primitive.${t}`),i=S.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...f,ref:o})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),Ho='[cmdk-group=""]',Lm='[cmdk-group-items=""]',YO='[cmdk-group-heading=""]',kk='[cmdk-item=""]',G0=`${kk}:not([aria-disabled="true"])`,Mp="cmdk-item-select",fs="data-value",XO=(e,t,n)=>az(e,t,n),jk=S.createContext(void 0),wu=()=>S.useContext(jk),Ek=S.createContext(void 0),Eg=()=>S.useContext(Ek),Ck=S.createContext(void 0),_k=S.forwardRef((e,t)=>{let n=hs(()=>{var A,C;return{search:"",value:(C=(A=e.value)!=null?A:e.defaultValue)!=null?C:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=hs(()=>new Set),l=hs(()=>new Map),o=hs(()=>new Map),u=hs(()=>new Set),f=Nk(e),{label:m,children:h,value:y,onValueChange:g,filter:b,shouldFilter:x,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...N}=e,T=ya(),O=ya(),I=ya(),B=S.useRef(null),z=o3();fl(()=>{if(y!==void 0){let A=y.trim();n.current.value=A,F.emit()}},[y]),fl(()=>{z(6,pe)},[]);let F=S.useMemo(()=>({subscribe:A=>(u.current.add(A),()=>u.current.delete(A)),snapshot:()=>n.current,setState:(A,C,J)=>{var Y,ue,ge,Me;if(!Object.is(n.current[A],C)){if(n.current[A]=C,A==="search")re(),q(),z(1,ae);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let xe=document.getElementById(I);xe?xe.focus():(Y=document.getElementById(T))==null||Y.focus()}if(z(7,()=>{var xe;n.current.selectedItemId=(xe=de())==null?void 0:xe.id,F.emit()}),J||z(5,pe),((ue=f.current)==null?void 0:ue.value)!==void 0){let xe=C??"";(Me=(ge=f.current).onValueChange)==null||Me.call(ge,xe);return}}F.emit()}},emit:()=>{u.current.forEach(A=>A())}}),[]),Z=S.useMemo(()=>({value:(A,C,J)=>{var Y;C!==((Y=o.current.get(A))==null?void 0:Y.value)&&(o.current.set(A,{value:C,keywords:J}),n.current.filtered.items.set(A,ee(C,J)),z(2,()=>{q(),F.emit()}))},item:(A,C)=>(i.current.add(A),C&&(l.current.has(C)?l.current.get(C).add(A):l.current.set(C,new Set([A]))),z(3,()=>{re(),q(),n.current.value||ae(),F.emit()}),()=>{o.current.delete(A),i.current.delete(A),n.current.filtered.items.delete(A);let J=de();z(4,()=>{re(),(J==null?void 0:J.getAttribute("id"))===A&&ae(),F.emit()})}),group:A=>(l.current.has(A)||l.current.set(A,new Set),()=>{o.current.delete(A),l.current.delete(A)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:T,inputId:I,labelId:O,listInnerRef:B}),[]);function ee(A,C){var J,Y;let ue=(Y=(J=f.current)==null?void 0:J.filter)!=null?Y:XO;return A?ue(A,n.current.search,C):0}function q(){if(!n.current.search||f.current.shouldFilter===!1)return;let A=n.current.filtered.items,C=[];n.current.filtered.groups.forEach(Y=>{let ue=l.current.get(Y),ge=0;ue.forEach(Me=>{let xe=A.get(Me);ge=Math.max(xe,ge)}),C.push([Y,ge])});let J=B.current;W().sort((Y,ue)=>{var ge,Me;let xe=Y.getAttribute("id"),_t=ue.getAttribute("id");return((ge=A.get(_t))!=null?ge:0)-((Me=A.get(xe))!=null?Me:0)}).forEach(Y=>{let ue=Y.closest(Lm);ue?ue.appendChild(Y.parentElement===ue?Y:Y.closest(`${Lm} > *`)):J.appendChild(Y.parentElement===J?Y:Y.closest(`${Lm} > *`))}),C.sort((Y,ue)=>ue[1]-Y[1]).forEach(Y=>{var ue;let ge=(ue=B.current)==null?void 0:ue.querySelector(`${Ho}[${fs}="${encodeURIComponent(Y[0])}"]`);ge==null||ge.parentElement.appendChild(ge)})}function ae(){let A=W().find(J=>J.getAttribute("aria-disabled")!=="true"),C=A==null?void 0:A.getAttribute(fs);F.setState("value",C||void 0)}function re(){var A,C,J,Y;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=i.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let ge of i.current){let Me=(C=(A=o.current.get(ge))==null?void 0:A.value)!=null?C:"",xe=(Y=(J=o.current.get(ge))==null?void 0:J.keywords)!=null?Y:[],_t=ee(Me,xe);n.current.filtered.items.set(ge,_t),_t>0&&ue++}for(let[ge,Me]of l.current)for(let xe of Me)if(n.current.filtered.items.get(xe)>0){n.current.filtered.groups.add(ge);break}n.current.filtered.count=ue}function pe(){var A,C,J;let Y=de();Y&&(((A=Y.parentElement)==null?void 0:A.firstChild)===Y&&((J=(C=Y.closest(Ho))==null?void 0:C.querySelector(YO))==null||J.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function de(){var A;return(A=B.current)==null?void 0:A.querySelector(`${kk}[aria-selected="true"]`)}function W(){var A;return Array.from(((A=B.current)==null?void 0:A.querySelectorAll(G0))||[])}function P(A){let C=W()[A];C&&F.setState("value",C.getAttribute(fs))}function V(A){var C;let J=de(),Y=W(),ue=Y.findIndex(Me=>Me===J),ge=Y[ue+A];(C=f.current)!=null&&C.loop&&(ge=ue+A<0?Y[Y.length-1]:ue+A===Y.length?Y[0]:Y[ue+A]),ge&&F.setState("value",ge.getAttribute(fs))}function ce(A){let C=de(),J=C==null?void 0:C.closest(Ho),Y;for(;J&&!Y;)J=A>0?l3(J,Ho):s3(J,Ho),Y=J==null?void 0:J.querySelector(G0);Y?F.setState("value",Y.getAttribute(fs)):V(A)}let be=()=>P(W().length-1),R=A=>{A.preventDefault(),A.metaKey?be():A.altKey?ce(1):V(1)},L=A=>{A.preventDefault(),A.metaKey?P(0):A.altKey?ce(-1):V(-1)};return S.createElement(Ca.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:A=>{var C;(C=N.onKeyDown)==null||C.call(N,A);let J=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||J))switch(A.key){case"n":case"j":{E&&A.ctrlKey&&R(A);break}case"ArrowDown":{R(A);break}case"p":case"k":{E&&A.ctrlKey&&L(A);break}case"ArrowUp":{L(A);break}case"Home":{A.preventDefault(),P(0);break}case"End":{A.preventDefault(),be();break}case"Enter":{A.preventDefault();let Y=de();if(Y){let ue=new Event(Mp);Y.dispatchEvent(ue)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:Z.inputId,id:Z.labelId,style:c3},m),Zd(e,A=>S.createElement(Ek.Provider,{value:F},S.createElement(jk.Provider,{value:Z},A))))}),JO=S.forwardRef((e,t)=>{var n,i;let l=ya(),o=S.useRef(null),u=S.useContext(Ck),f=wu(),m=Nk(e),h=(i=(n=m.current)==null?void 0:n.forceMount)!=null?i:u==null?void 0:u.forceMount;fl(()=>{if(!h)return f.item(l,u==null?void 0:u.id)},[h]);let y=Ak(l,o,[e.value,e.children,o],e.keywords),g=Eg(),b=Si(z=>z.value&&z.value===y.current),x=Si(z=>h||f.filter()===!1?!0:z.search?z.filtered.items.get(l)>0:!0);S.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(Mp,k),()=>z.removeEventListener(Mp,k)},[x,e.onSelect,e.disabled]);function k(){var z,F;j(),(F=(z=m.current).onSelect)==null||F.call(z,y.current)}function j(){g.setState("value",y.current,!0)}if(!x)return null;let{disabled:E,value:N,onSelect:T,forceMount:O,keywords:I,...B}=e;return S.createElement(Ca.div,{ref:xi(o,t),...B,id:l,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||f.getDisablePointerSelection()?void 0:j,onClick:E?void 0:k},e.children)}),WO=S.forwardRef((e,t)=>{let{heading:n,children:i,forceMount:l,...o}=e,u=ya(),f=S.useRef(null),m=S.useRef(null),h=ya(),y=wu(),g=Si(x=>l||y.filter()===!1?!0:x.search?x.filtered.groups.has(u):!0);fl(()=>y.group(u),[]),Ak(u,f,[e.value,e.heading,m]);let b=S.useMemo(()=>({id:u,forceMount:l}),[l]);return S.createElement(Ca.div,{ref:xi(f,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&S.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Zd(e,x=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},S.createElement(Ck.Provider,{value:b},x))))}),e3=S.forwardRef((e,t)=>{let{alwaysRender:n,...i}=e,l=S.useRef(null),o=Si(u=>!u.search);return!n&&!o?null:S.createElement(Ca.div,{ref:xi(l,t),...i,"cmdk-separator":"",role:"separator"})}),t3=S.forwardRef((e,t)=>{let{onValueChange:n,...i}=e,l=e.value!=null,o=Eg(),u=Si(h=>h.search),f=Si(h=>h.selectedItemId),m=wu();return S.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),S.createElement(Ca.input,{ref:t,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:l?e.value:u,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),n3=S.forwardRef((e,t)=>{let{children:n,label:i="Suggestions",...l}=e,o=S.useRef(null),u=S.useRef(null),f=Si(h=>h.selectedItemId),m=wu();return S.useEffect(()=>{if(u.current&&o.current){let h=u.current,y=o.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let x=h.offsetHeight;y.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(g),b.unobserve(h)}}},[]),S.createElement(Ca.div,{ref:xi(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":i,id:m.listId},Zd(e,h=>S.createElement("div",{ref:xi(u,m.listInnerRef),"cmdk-list-sizer":""},h)))}),r3=S.forwardRef((e,t)=>{let{open:n,onOpenChange:i,overlayClassName:l,contentClassName:o,container:u,...f}=e;return S.createElement(yk,{open:n,onOpenChange:i},S.createElement(vk,{container:u},S.createElement(bk,{"cmdk-overlay":"",className:l}),S.createElement(xk,{"aria-label":e.label,"cmdk-dialog":"",className:o},S.createElement(_k,{ref:t,...f}))))}),a3=S.forwardRef((e,t)=>Si(n=>n.filtered.count===0)?S.createElement(Ca.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),i3=S.forwardRef((e,t)=>{let{progress:n,children:i,label:l="Loading...",...o}=e;return S.createElement(Ca.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Zd(e,u=>S.createElement("div",{"aria-hidden":!0},u)))}),Ln=Object.assign(_k,{List:n3,Item:JO,Input:t3,Group:WO,Separator:e3,Dialog:r3,Empty:a3,Loading:i3});function l3(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function s3(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Nk(e){let t=S.useRef(e);return fl(()=>{t.current=e}),t}var fl=typeof window>"u"?S.useEffect:S.useLayoutEffect;function hs(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function Si(e){let t=Eg(),n=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,n,n)}function Ak(e,t,n,i=[]){let l=S.useRef(),o=wu();return fl(()=>{var u;let f=(()=>{var h;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.current.textContent)==null?void 0:h.trim():l.current}})(),m=i.map(h=>h.trim());o.value(e,f,m),(u=t.current)==null||u.setAttribute(fs,f),l.current=f}),l}var o3=()=>{let[e,t]=S.useState(),n=hs(()=>new Map);return fl(()=>{n.current.forEach(i=>i()),n.current=new Map},[e]),(i,l)=>{n.current.set(i,l),t({})}};function u3(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Zd({asChild:e,children:t},n){return e&&S.isValidElement(t)?S.cloneElement(u3(t),{ref:t.ref},n(t.props.children)):n(t)}var c3={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const On=yk,d3=UO,f3=vk,Tk=S.forwardRef(({className:e,...t},n)=>d.jsx(bk,{ref:n,className:Te("fixed inset-0 z-50 bg-overlay-scrim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Tk.displayName="DialogOverlay";const Sn=S.forwardRef(({className:e,children:t,...n},i)=>d.jsxs(f3,{children:[d.jsx(Tk,{}),d.jsxs(xk,{ref:i,className:Te("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 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,d.jsxs(PO,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[d.jsx(Ap,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Sn.displayName="DialogContent";function Jn({className:e,...t}){return d.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Dn({className:e,...t}){return d.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const Mn=S.forwardRef(({className:e,...t},n)=>d.jsx(IO,{ref:n,className:Te("text-subtitle leading-none tracking-tight",e),...t}));Mn.displayName="DialogTitle";const h3=S.forwardRef(({className:e,...t},n)=>d.jsx(BO,{ref:n,className:Te("text-body text-muted-foreground",e),...t}));h3.displayName="DialogDescription";const Rk=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln,{ref:n,className:Te("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Rk.displayName=Ln.displayName;function m3({open:e,onOpenChange:t,children:n}){return d.jsx(On,{open:e,onOpenChange:t,children:d.jsx(Sn,{className:"overflow-hidden p-0 shadow-lg",children:d.jsx(Rk,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})})}const zk=S.forwardRef(({className:e,...t},n)=>d.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[d.jsx(Pd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),d.jsx(Ln.Input,{ref:n,className:Te("flex h-11 w-full rounded-md bg-transparent py-3 text-body outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));zk.displayName=Ln.Input.displayName;const Ok=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.List,{ref:n,className:Te("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Ok.displayName=Ln.List.displayName;const Dk=S.forwardRef((e,t)=>d.jsx(Ln.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Dk.displayName=Ln.Empty.displayName;const md=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.Group,{ref:n,className:Te("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-caption [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));md.displayName=Ln.Group.displayName;const Lp=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.Separator,{ref:n,className:Te("-mx-1 h-px bg-border",e),...t}));Lp.displayName=Ln.Separator.displayName;const pd=S.forwardRef(({className:e,...t},n)=>d.jsx(Ln.Item,{ref:n,className:Te("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));pd.displayName=Ln.Item.displayName;function Cg(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.type&&t.set("type",e.type);const n=t.toString();return De.get(`/admin/agents${n?`?${n}`:""}`)}function p3(e){const t=new URLSearchParams;t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor);const n=t.toString();return De.get(`/admin/agents/all${n?`?${n}`:""}`)}function Mk(e){return De.get(`/admin/agents/${encodeURIComponent(e)}`)}function g3(e){return De.post("/admin/agents",e)}function K0(e,t){return De.patch(`/admin/agents/${encodeURIComponent(e)}`,t)}function y3(e){return De.delete(`/admin/agents/${encodeURIComponent(e)}`)}function v3(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/suspend`,{})}function b3(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/reactivate`,{})}function x3(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/test`,{})}function Ei(){const{data:e}=qe({queryKey:["agents","name-map"],queryFn:()=>Cg({limit:100}),staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e!=null&&e.items)for(const n of e.items)t.set(n.uuid,n.displayName??n.name??n.uuid);return n=>n?t.get(n)??n:"—"},[e])}const S3=[{path:"/",label:"Workspace"},{path:"/agents",label:"Agents"},{path:"/clients",label:"Computers"},{path:"/settings",label:"Settings"},{path:"/admin",label:"Admin"}];function w3({open:e,onOpenChange:t}){const n=qr(),i=Ei(),{data:l}=qe({queryKey:["activity"],queryFn:Su,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=qe({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await $s(y.agentId);for(const b of g)h.push({agentId:y.agentId,session:b})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return d.jsxs(m3,{open:e,onOpenChange:t,children:[d.jsx(zk,{placeholder:"Jump to agent, chat, or page…"}),d.jsxs(Ok,{children:[d.jsx(Dk,{children:"No results"}),o.length>0&&d.jsx(md,{heading:"Agents",children:o.map(h=>{const y=i(h.agentId);return d.jsxs(pd,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[d.jsx(iT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:y}),d.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(Lp,{}),d.jsx(md,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=i(h);return d.jsxs(pd,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[d.jsx(vw,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{className:"flex-1 truncate",children:g}),d.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),d.jsx(Lp,{}),d.jsx(md,{heading:"Pages",children:S3.map(h=>d.jsxs(pd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[d.jsx(bT,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),d.jsx("span",{children:h.label})]},h.path))})]})]})}function ku(e){return d.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[d.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),d.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),d.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),d.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),d.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),d.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),d.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),d.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function Up(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.severity&&t.set("severity",e.severity),(e==null?void 0:e.read)!==void 0&&t.set("read",String(e.read)),e!=null&&e.agentId&&t.set("agentId",e.agentId);const n=t.toString();return De.get(`/admin/notifications${n?`?${n}`:""}`)}function Lk(e){return De.post(`/admin/notifications/${e}/read`)}function k3(){return De.post("/admin/notifications/read-all")}const j3={agent_error:"Error",session_error:"Error",agent_blocked:"Blocked",agent_stale:"Stale",agent_disconnected:"Disconnected",agent_connected:"Connected",agent_needs_decision:"Decision",session_completed:"Completed"};function E3(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function Uk({notification:e,onClick:t,clickable:n}){const i=(j3[e.type]??e.type).toString(),l=E3(e.severity),o=n??!0;return d.jsxs("button",{type:"button",onClick:t,className:Te("w-full text-left transition-colors text-body",o?"cursor-pointer":"cursor-default"),style:{padding:"var(--sp-1_5) var(--sp-2)",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`var(--hairline-bold) solid ${l}`,borderRadius:"0 var(--sp-0_75) var(--sp-0_75) 0"},onMouseEnter:u=>{o&&(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{u.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[d.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[d.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:i.replace("_"," ")}),d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:xa(e.createdAt)})]}),d.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function C3(){var x;const[e,t]=S.useState(!1),[n,i]=S.useState(null),l=S.useRef(null),o=qr(),u=Wn(),{data:f}=qe({queryKey:["notifications","bell"],queryFn:()=>Up({limit:8}),refetchInterval:1e4}),{data:m}=qe({queryKey:["notifications","unread-count"],queryFn:()=>Up({read:!1,limit:100}),refetchInterval:1e4}),h=((x=m==null?void 0:m.items)==null?void 0:x.length)??0,y=h>0,g=S.useCallback(async k=>{k.read||(Lk(k.id).catch(()=>{}),u.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,u]),b=S.useCallback(async()=>{i(null);try{await k3(),await u.invalidateQueries({queryKey:["notifications"]})}catch(k){i(k instanceof Error?k.message:"Failed to mark all as read")}},[u]);return d.jsxs("div",{className:"relative",children:[d.jsxs("button",{type:"button",onClick:()=>t(!e),className:"relative flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[d.jsx(rT,{className:"h-4 w-4"}),y&&d.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center rounded-full px-1 font-medium text-label",style:{height:16,minWidth:16,background:"var(--state-error)",color:"var(--bg)"},children:h>99?"99+":h})]}),e&&d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),d.jsxs("div",{ref:l,className:"absolute right-0 top-full mt-1 z-50",style:{width:320,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6,boxShadow:"var(--shadow-md)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),y&&d.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&d.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_5) var(--sp-3)",color:"var(--state-error)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:n}),d.jsx("div",{className:"flex flex-col overflow-y-auto",style:{maxHeight:360,padding:8,gap:4},children:!(f!=null&&f.items)||f.items.length===0?d.jsx("div",{className:"text-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-4_5) 0"},children:"No notifications"}):f.items.map(k=>d.jsx(Uk,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function _3(){if(typeof window>"u")return"light";const e=window.localStorage.getItem("theme");return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function N3(){const[e,t]=S.useState(_3);return S.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),d.jsx("button",{type:"button",onClick:()=>t(e==="dark"?"light":"dark"),"aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-body text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:e==="dark"?d.jsx(FT,{className:"h-4 w-4"}):d.jsx(_T,{className:"h-4 w-4"})})}const Y0=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/agents",label:"Agents",end:!1,kbd:"⌘2"},{to:"/clients",label:"Computers",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}],A3={to:"/admin",label:"Admin",end:!1,kbd:"⌘5"};function T3(){const{role:e,logout:t}=ja(),n=e==="admin",[i,l]=S.useState(!1),o=n?[...Y0,A3]:Y0,u=yr(),f=u.pathname==="/"||u.search.includes("a=");return S.useEffect(()=>{const m=h=>{(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="k"&&(h.preventDefault(),l(y=>!y))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]),d.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[d.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"auto 1fr auto",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.jsx(ku,{width:16,height:18,style:{color:"var(--fg)"}}),d.jsxs("span",{className:"text-title",style:{color:"var(--fg)"},children:["First Tree"," ",d.jsx("span",{className:"font-normal",style:{color:"var(--fg-3)"},children:"Hub"})]})]}),d.jsx("nav",{className:"flex justify-center",style:{gap:2,pointerEvents:"none"},children:o.map(m=>d.jsx(dw,{to:m.to,end:m.end,style:{pointerEvents:"auto"},className:({isActive:h})=>Te("inline-flex items-center transition-colors",h?"":"hover:text-[var(--fg)]"),children:({isActive:h})=>d.jsxs("span",{className:"inline-flex items-center text-subtitle font-medium",style:{padding:"var(--sp-1_5) var(--sp-3)",gap:6,borderRadius:5,color:h?"var(--fg)":"var(--fg-3)",background:h?"var(--bg-hover)":"transparent"},children:[m.label,h&&d.jsx("span",{className:"kbd",children:m.kbd})]})},m.to))}),d.jsxs("div",{className:"flex items-center",style:{gap:6},children:[d.jsxs("button",{type:"button",onClick:()=>l(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors text-body",style:{gap:8,padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--fg)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--fg-3)"},children:[d.jsx(Pd,{className:"h-4 w-4"}),d.jsx("span",{children:"Jump to…"}),d.jsx("span",{className:"kbd",children:"⌘K"})]}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),d.jsx(C3,{}),d.jsx(N3,{}),d.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center transition-colors hover:text-[var(--fg)] text-body",style:{padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",borderRadius:"var(--radius-input)",gap:6},"aria-label":"Log out",children:d.jsx(jT,{className:"h-4 w-4"})})]})]}),d.jsx(w3,{open:i,onOpenChange:l}),f?d.jsx(Ep,{}):d.jsx("main",{className:"flex-1 overflow-auto",children:d.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:d.jsx(Ep,{})})})]})}function ie(e,t,n){function i(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=u.prototype,y=Object.keys(h);for(let g=0;g<y.length;g++){const b=y[g];b in f||(f[b]=h[b].bind(f))}}const l=(n==null?void 0:n.Parent)??Object;class o extends l{}Object.defineProperty(o,"name",{value:e});function u(f){var m;const h=n!=null&&n.Parent?new o:this;i(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(u,"init",{value:i}),Object.defineProperty(u,Symbol.hasInstance,{value:f=>{var m,h;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(h=(m=f==null?void 0:f._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}class bs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ik extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Bk={};function wi(e){return Bk}function Pk(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,l])=>t.indexOf(+i)===-1).map(([i,l])=>l)}function Ip(e,t){return typeof t=="bigint"?t.toString():t}function Vd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function _g(e){return e==null}function Ng(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function R3(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let l=(i.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(i)){const m=i.match(/\d?e-(\d?)/);m!=null&&m[1]&&(l=Number.parseInt(m[1]))}const o=n>l?n:l,u=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return u%f/10**o}const X0=Symbol("evaluating");function lt(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==X0)return i===void 0&&(i=X0,i=n()),i},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function bl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ci(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function J0(e){return JSON.stringify(e)}function z3(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const $k="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function uu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const O3=Vd(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Os(e){if(uu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(uu(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Fk(e){return Os(e)?{...e}:Array.isArray(e)?[...e]:e}const D3=new Set(["string","number","symbol"]);function Ds(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _i(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(i._zod.parent=e),i}function Ce(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function M3(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const L3={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function U3(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Ci(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=n.shape[f])}return bl(this,"shape",u),u},checks:[]});return _i(e,o)}function I3(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ci(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return bl(this,"shape",u),u},checks:[]});return _i(e,o)}function B3(e,t){if(!Os(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(o,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Ci(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return bl(this,"shape",o),o}});return _i(e,l)}function P3(e,t){if(!Os(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ci(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return bl(this,"shape",i),i}});return _i(e,n)}function $3(e,t){const n=Ci(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return bl(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return _i(e,n)}function F3(e,t,n){const l=t._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Ci(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(m[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)m[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return bl(this,"shape",m),m},checks:[]});return _i(t,u)}function q3(e,t,n){const i=Ci(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const u in n){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(o[u]=new e({type:"nonoptional",innerType:l[u]}))}else for(const u in l)o[u]=new e({type:"nonoptional",innerType:l[u]});return bl(this,"shape",o),o}});return _i(t,i)}function ps(e,t=0){var n;if(e.aborted===!0)return!0;for(let i=t;i<e.issues.length;i++)if(((n=e.issues[i])==null?void 0:n.continue)!==!0)return!0;return!1}function gs(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function ed(e){return typeof e=="string"?e:e==null?void 0:e.message}function ki(e,t,n){var l,o,u,f,m,h;const i={...e,path:e.path??[]};if(!e.message){const y=ed((u=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:u.call(o,e))??ed((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??ed((m=n.customError)==null?void 0:m.call(n,e))??ed((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";i.message=y}return delete i.inst,delete i.continue,t!=null&&t.reportInput||delete i.input,i}function Ag(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function cu(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const qk=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ip,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Hk=ie("$ZodError",qk),Zk=ie("$ZodError",qk,{Parent:Error});function H3(e,t=n=>n.message){const n={},i=[];for(const l of e.issues)l.path.length>0?(n[l.path[0]]=n[l.path[0]]||[],n[l.path[0]].push(t(l))):i.push(t(l));return{formErrors:i,fieldErrors:n}}function Z3(e,t=n=>n.message){const n={_errors:[]},i=l=>{for(const o of l.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(u=>i({issues:u}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let u=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(o))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return i(e),n}const Tg=e=>(t,n,i,l)=>{const o=i?Object.assign(i,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new bs;if(u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>ki(m,o,wi())));throw $k(f,l==null?void 0:l.callee),f}return u.value},Rg=e=>async(t,n,i,l)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>ki(m,o,wi())));throw $k(f,l==null?void 0:l.callee),f}return u.value},Qd=e=>(t,n,i)=>{const l=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},l);if(o instanceof Promise)throw new bs;return o.issues.length?{success:!1,error:new(e??Hk)(o.issues.map(u=>ki(u,l,wi())))}:{success:!0,data:o.value}},V3=Qd(Zk),Gd=e=>async(t,n,i)=>{const l=i?Object.assign(i,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},l);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(u=>ki(u,l,wi())))}:{success:!0,data:o.value}},Q3=Gd(Zk),G3=e=>(t,n,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Tg(e)(t,n,l)},K3=e=>(t,n,i)=>Tg(e)(t,n,i),Y3=e=>async(t,n,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Rg(e)(t,n,l)},X3=e=>async(t,n,i)=>Rg(e)(t,n,i),J3=e=>(t,n,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Qd(e)(t,n,l)},W3=e=>(t,n,i)=>Qd(e)(t,n,i),eD=e=>async(t,n,i)=>{const l=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Gd(e)(t,n,l)},tD=e=>async(t,n,i)=>Gd(e)(t,n,i),nD=/^[cC][^\s-]{8,}$/,rD=/^[0-9a-z]+$/,aD=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,iD=/^[0-9a-vA-V]{20}$/,lD=/^[A-Za-z0-9]{27}$/,sD=/^[a-zA-Z0-9_-]{21}$/,oD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,uD=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,W0=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,cD=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,dD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function fD(){return new RegExp(dD,"u")}const hD=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,pD=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,gD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yD=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vk=/^[A-Za-z0-9_-]*$/,vD=/^\+[1-9]\d{6,14}$/,Qk="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",bD=new RegExp(`^${Qk}$`);function Gk(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xD(e){return new RegExp(`^${Gk(e)}$`)}function SD(e){const t=Gk({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${Qk}T(?:${i})$`)}const wD=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},kD=/^-?\d+$/,Kk=/^-?\d+(?:\.\d+)?$/,jD=/^(?:true|false)$/i,ED=/^[^A-Z]*$/,CD=/^[^a-z]*$/,Un=ie("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Yk={number:"number",bigint:"bigint",object:"date"},Xk=ie("$ZodCheckLessThan",(e,t)=>{Un.init(e,t);const n=Yk[typeof t.value];e._zod.onattach.push(i=>{const l=i._zod.bag,o=(t.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?l.maximum=t.value:l.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jk=ie("$ZodCheckGreaterThan",(e,t)=>{Un.init(e,t);const n=Yk[typeof t.value];e._zod.onattach.push(i=>{const l=i._zod.bag,o=(t.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?l.minimum=t.value:l.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_D=ie("$ZodCheckMultipleOf",(e,t)=>{Un.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):R3(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ND=ie("$ZodCheckNumberFormat",(e,t)=>{var u;Un.init(e,t),t.format=t.format||"float64";const n=(u=t.format)==null?void 0:u.includes("int"),i=n?"int":"number",[l,o]=L3[t.format];e._zod.onattach.push(f=>{const m=f._zod.bag;m.format=t.format,m.minimum=l,m.maximum=o,n&&(m.pattern=kD)}),e._zod.check=f=>{const m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}m<l&&f.issues.push({origin:"number",input:m,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!t.abort}),m>o&&f.issues.push({origin:"number",input:m,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),AD=ie("$ZodCheckMaxLength",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=i=>{const l=i.value;return!_g(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{const l=i.value;if(l.length<=t.maximum)return;const u=Ag(l);i.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),TD=ie("$ZodCheckMinLength",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=i=>{const l=i.value;return!_g(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const l=i.value;if(l.length>=t.minimum)return;const u=Ag(l);i.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),RD=ie("$ZodCheckLengthEquals",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=i=>{const l=i.value;return!_g(l)&&l.length!==void 0}),e._zod.onattach.push(i=>{const l=i._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=i=>{const l=i.value,o=l.length;if(o===t.length)return;const u=Ag(l),f=o>t.length;i.issues.push({origin:u,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Kd=ie("$ZodCheckStringFormat",(e,t)=>{var n,i;Un.init(e,t),e._zod.onattach.push(l=>{const o=l._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=l=>{t.pattern.lastIndex=0,!t.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:t.format,input:l.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),zD=ie("$ZodCheckRegex",(e,t)=>{Kd.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),OD=ie("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ED),Kd.init(e,t)}),DD=ie("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=CD),Kd.init(e,t)}),MD=ie("$ZodCheckIncludes",(e,t)=>{Un.init(e,t);const n=Ds(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=l=>{l.value.includes(t.includes,t.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:l.value,inst:e,continue:!t.abort})}}),LD=ie("$ZodCheckStartsWith",(e,t)=>{Un.init(e,t);const n=new RegExp(`^${Ds(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const l=i._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),UD=ie("$ZodCheckEndsWith",(e,t)=>{Un.init(e,t);const n=new RegExp(`.*${Ds(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const l=i._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),ID=ie("$ZodCheckOverwrite",(e,t)=>{Un.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class BD{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(`
|
|
295
|
+
`).filter(u=>u),l=Math.min(...i.map(u=>u.length-u.trimStart().length)),o=i.map(u=>u.slice(l)).map(u=>" ".repeat(this.indent*2)+u);for(const u of o)this.content.push(u)}compile(){const t=Function,n=this==null?void 0:this.args,l=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,l.join(`
|
|
296
|
+
`))}}const PD={major:4,minor:3,patch:6},Nt=ie("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=PD;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const u of o._zod.onattach)u(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),(l=e._zod.deferred)==null||l.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,m,h)=>{let y=ps(f),g;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(y)continue;const x=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new bs;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==x&&(y||(y=ps(f,x)))});else{if(f.issues.length===x)continue;y||(y=ps(f,x))}}return g?g.then(()=>f):f},u=(f,m,h)=>{if(ps(f))return f.aborted=!0,f;const y=o(m,i,h);if(y instanceof Promise){if(h.async===!1)throw new bs;return y.then(g=>e._zod.parse(g,h))}return e._zod.parse(y,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const y=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return y instanceof Promise?y.then(g=>u(g,f,m)):u(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new bs;return h.then(y=>o(y,i,m))}return o(h,i,m)}}lt(e,"~standard",()=>({validate:o=>{var u;try{const f=V3(e,o);return f.success?{value:f.data}:{issues:(u=f.error)==null?void 0:u.issues}}catch{return Q3(e,o).then(m=>{var h;return m.success?{value:m.data}:{issues:(h=m.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}))}),zg=ie("$ZodString",(e,t)=>{var n;Nt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??wD(e._zod.bag),e._zod.parse=(i,l)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),Ct=ie("$ZodStringFormat",(e,t)=>{Kd.init(e,t),zg.init(e,t)}),$D=ie("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=uD),Ct.init(e,t)}),FD=ie("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=W0(i))}else t.pattern??(t.pattern=W0());Ct.init(e,t)}),qD=ie("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cD),Ct.init(e,t)}),HD=ie("$ZodURL",(e,t)=>{Ct.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),l=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=l.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ZD=ie("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=fD()),Ct.init(e,t)}),VD=ie("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=sD),Ct.init(e,t)}),QD=ie("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=nD),Ct.init(e,t)}),GD=ie("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=rD),Ct.init(e,t)}),KD=ie("$ZodULID",(e,t)=>{t.pattern??(t.pattern=aD),Ct.init(e,t)}),YD=ie("$ZodXID",(e,t)=>{t.pattern??(t.pattern=iD),Ct.init(e,t)}),XD=ie("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=lD),Ct.init(e,t)}),JD=ie("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=SD(t)),Ct.init(e,t)}),WD=ie("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=bD),Ct.init(e,t)}),eM=ie("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=xD(t)),Ct.init(e,t)}),tM=ie("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=oD),Ct.init(e,t)}),nM=ie("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=hD),Ct.init(e,t),e._zod.bag.format="ipv4"}),rM=ie("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mD),Ct.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),aM=ie("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=pD),Ct.init(e,t)}),iM=ie("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=gD),Ct.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[l,o]=i;if(!o)throw new Error;const u=Number(o);if(`${u}`!==o)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${l}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Wk(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const lM=ie("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yD),Ct.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Wk(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function sM(e){if(!Vk.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Wk(n)}const oM=ie("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Vk),Ct.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{sM(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),uM=ie("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vD),Ct.init(e,t)});function cM(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const l=JSON.parse(atob(i));return!("typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||t&&(!("alg"in l)||l.alg!==t))}catch{return!1}}const dM=ie("$ZodJWT",(e,t)=>{Ct.init(e,t),e._zod.check=n=>{cM(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),ej=ie("$ZodNumber",(e,t)=>{Nt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Kk,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const l=n.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return n;const o=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...o?{received:o}:{}}),n}}),fM=ie("$ZodNumberFormat",(e,t)=>{ND.init(e,t),ej.init(e,t)}),hM=ie("$ZodBoolean",(e,t)=>{Nt.init(e,t),e._zod.pattern=jD,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const l=n.value;return typeof l=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),n}}),mM=ie("$ZodUnknown",(e,t)=>{Nt.init(e,t),e._zod.parse=n=>n}),pM=ie("$ZodNever",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function e1(e,t,n){e.issues.length&&t.issues.push(...gs(n,e.issues)),t.value[n]=e.value}const gM=ie("$ZodArray",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,i)=>{const l=n.value;if(!Array.isArray(l))return n.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),n;n.value=Array(l.length);const o=[];for(let u=0;u<l.length;u++){const f=l[u],m=t.element._zod.run({value:f,issues:[]},i);m instanceof Promise?o.push(m.then(h=>e1(h,n,u))):e1(m,n,u)}return o.length?Promise.all(o).then(()=>n):n}});function jd(e,t,n,i,l){if(e.issues.length){if(l&&!(n in i))return;t.issues.push(...gs(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function tj(e){var i,l,o,u;const t=Object.keys(e.shape);for(const f of t)if(!((u=(o=(l=(i=e.shape)==null?void 0:i[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=M3(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function nj(e,t,n,i,l,o){const u=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,y=m.optout==="optional";for(const g in t){if(f.has(g))continue;if(h==="never"){u.push(g);continue}const b=m.run({value:t[g],issues:[]},i);b instanceof Promise?e.push(b.then(x=>jd(x,n,g,t,y))):jd(b,n,g,t,y)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const yM=ie("$ZodObject",(e,t)=>{Nt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const i=Vd(()=>tj(t));lt(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const y=f[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const g of y.values)m[h].add(g)}}return m});const l=uu,o=t.catchall;let u;e._zod.parse=(f,m)=>{u??(u=i.value);const h=f.value;if(!l(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const y=[],g=u.shape;for(const b of u.keys){const x=g[b],k=x._zod.optout==="optional",j=x._zod.run({value:h[b],issues:[]},m);j instanceof Promise?y.push(j.then(E=>jd(E,f,b,h,k))):jd(j,f,b,h,k)}return o?nj(y,h,f,m,i.value,e):y.length?Promise.all(y).then(()=>f):f}}),vM=ie("$ZodObjectJIT",(e,t)=>{yM.init(e,t);const n=e._zod.parse,i=Vd(()=>tj(t)),l=b=>{var O;const x=new BD(["shape","payload","ctx"]),k=i.value,j=I=>{const B=J0(I);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};x.write("const input = payload.value;");const E=Object.create(null);let N=0;for(const I of k.keys)E[I]=`key_${N++}`;x.write("const newResult = {};");for(const I of k.keys){const B=E[I],z=J0(I),F=b[I],Z=((O=F==null?void 0:F._zod)==null?void 0:O.optout)==="optional";x.write(`const ${B} = ${j(I)};`),Z?x.write(`
|
|
297
|
+
if (${B}.issues.length) {
|
|
298
|
+
if (${z} in input) {
|
|
299
|
+
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
300
|
+
...iss,
|
|
301
|
+
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
302
|
+
})));
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (${B}.value === undefined) {
|
|
307
|
+
if (${z} in input) {
|
|
308
|
+
newResult[${z}] = undefined;
|
|
309
|
+
}
|
|
310
|
+
} else {
|
|
311
|
+
newResult[${z}] = ${B}.value;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
`):x.write(`
|
|
315
|
+
if (${B}.issues.length) {
|
|
316
|
+
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
317
|
+
...iss,
|
|
318
|
+
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
319
|
+
})));
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (${B}.value === undefined) {
|
|
323
|
+
if (${z} in input) {
|
|
324
|
+
newResult[${z}] = undefined;
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
newResult[${z}] = ${B}.value;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
`)}x.write("payload.value = newResult;"),x.write("return payload;");const T=x.compile();return(I,B)=>T(b,I,B)};let o;const u=uu,f=!Bk.jitless,h=f&&O3.value,y=t.catchall;let g;e._zod.parse=(b,x)=>{g??(g=i.value);const k=b.value;return u(k)?f&&h&&(x==null?void 0:x.async)===!1&&x.jitless!==!0?(o||(o=l(t.shape)),b=o(b,x),y?nj([],k,b,x,g,e):b):n(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function t1(e,t,n,i){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const l=e.filter(o=>!ps(o));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(u=>ki(u,i,wi())))}),t)}const rj=ie("$ZodUnion",(e,t)=>{Nt.init(e,t),lt(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),lt(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),lt(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),lt(e._zod,"pattern",()=>{if(t.options.every(l=>l._zod.pattern)){const l=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${l.map(o=>Ng(o.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(l,o)=>{if(n)return i(l,o);let u=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:l.value,issues:[]},o);if(h instanceof Promise)f.push(h),u=!0;else{if(h.issues.length===0)return h;f.push(h)}}return u?Promise.all(f).then(m=>t1(m,l,e,o)):t1(f,l,e,o)}}),bM=ie("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,rj.init(e,t);const n=e._zod.parse;lt(e._zod,"propValues",()=>{const l={};for(const o of t.options){const u=o._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(u)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const i=Vd(()=>{var u;const l=t.options,o=new Map;for(const f of l){const m=(u=f._zod.propValues)==null?void 0:u[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,f)}}return o});e._zod.parse=(l,o)=>{const u=l.value;if(!uu(u))return l.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),l;const f=i.value.get(u==null?void 0:u[t.discriminator]);return f?f._zod.run(l,o):t.unionFallback?n(l,o):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),l)}}),xM=ie("$ZodIntersection",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,i)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},i),u=t.right._zod.run({value:l,issues:[]},i);return o instanceof Promise||u instanceof Promise?Promise.all([o,u]).then(([m,h])=>n1(n,m,h)):n1(n,o,u)}});function Bp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Os(e)&&Os(t)){const n=Object.keys(t),i=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of i){const u=Bp(e[o],t[o]);if(!u.valid)return{valid:!1,mergeErrorPath:[o,...u.mergeErrorPath]};l[o]=u.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const l=e[i],o=t[i],u=Bp(l,o);if(!u.valid)return{valid:!1,mergeErrorPath:[i,...u.mergeErrorPath]};n.push(u.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function n1(e,t,n){const i=new Map;let l;for(const f of t.issues)if(f.code==="unrecognized_keys"){l??(l=f);for(const m of f.keys)i.has(m)||i.set(m,{}),i.get(m).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)i.has(m)||i.set(m,{}),i.get(m).r=!0;else e.issues.push(f);const o=[...i].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(o.length&&l&&e.issues.push({...l,keys:o}),ps(e))return e;const u=Bp(t.value,n.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const SM=ie("$ZodRecord",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,i)=>{const l=n.value;if(!Os(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],u=t.keyType._zod.values;if(u){n.value={};const f=new Set;for(const h of u)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const y=t.valueType._zod.run({value:l[h],issues:[]},i);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...gs(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...gs(h,y.issues)),n.value[h]=y.value)}let m;for(const h in l)f.has(h)||(m=m??[],m.push(h));m&&m.length>0&&n.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:m})}else{n.value={};for(const f of Reflect.ownKeys(l)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},i);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Kk.test(f)&&m.issues.length){const g=t.keyType._zod.run({value:Number(f),issues:[]},i);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(m=g)}if(m.issues.length){t.mode==="loose"?n.value[f]=l[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(g=>ki(g,i,wi())),input:f,path:[f],inst:e});continue}const y=t.valueType._zod.run({value:l[f],issues:[]},i);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...gs(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...gs(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),wM=ie("$ZodEnum",(e,t)=>{Nt.init(e,t);const n=Pk(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(l=>D3.has(typeof l)).map(l=>typeof l=="string"?Ds(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const u=l.value;return i.has(u)||l.issues.push({code:"invalid_value",values:n,input:u,inst:e}),l}}),kM=ie("$ZodLiteral",(e,t)=>{if(Nt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?Ds(i):i?Ds(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,l)=>{const o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),jM=ie("$ZodTransform",(e,t)=>{Nt.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Ik(e.constructor.name);const l=t.transform(n.value,n);if(i.async)return(l instanceof Promise?l:Promise.resolve(l)).then(u=>(n.value=u,n));if(l instanceof Promise)throw new bs;return n.value=l,n}});function r1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const aj=ie("$ZodOptional",(e,t)=>{Nt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",lt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),lt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ng(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const l=t.innerType._zod.run(n,i);return l instanceof Promise?l.then(o=>r1(o,n.value)):r1(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),EM=ie("$ZodExactOptional",(e,t)=>{aj.init(e,t),lt(e._zod,"values",()=>t.innerType._zod.values),lt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),CM=ie("$ZodNullable",(e,t)=>{Nt.init(e,t),lt(e._zod,"optin",()=>t.innerType._zod.optin),lt(e._zod,"optout",()=>t.innerType._zod.optout),lt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ng(n.source)}|null)$`):void 0}),lt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),_M=ie("$ZodDefault",(e,t)=>{Nt.init(e,t),e._zod.optin="optional",lt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const l=t.innerType._zod.run(n,i);return l instanceof Promise?l.then(o=>a1(o,t)):a1(l,t)}});function a1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const NM=ie("$ZodPrefault",(e,t)=>{Nt.init(e,t),e._zod.optin="optional",lt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),AM=ie("$ZodNonOptional",(e,t)=>{Nt.init(e,t),lt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const l=t.innerType._zod.run(n,i);return l instanceof Promise?l.then(o=>i1(o,e)):i1(l,e)}});function i1(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const TM=ie("$ZodCatch",(e,t)=>{Nt.init(e,t),lt(e._zod,"optin",()=>t.innerType._zod.optin),lt(e._zod,"optout",()=>t.innerType._zod.optout),lt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const l=t.innerType._zod.run(n,i);return l instanceof Promise?l.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(u=>ki(u,i,wi()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>ki(o,i,wi()))},input:n.value}),n.issues=[]),n)}}),RM=ie("$ZodPipe",(e,t)=>{Nt.init(e,t),lt(e._zod,"values",()=>t.in._zod.values),lt(e._zod,"optin",()=>t.in._zod.optin),lt(e._zod,"optout",()=>t.out._zod.optout),lt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const o=t.out._zod.run(n,i);return o instanceof Promise?o.then(u=>td(u,t.in,i)):td(o,t.in,i)}const l=t.in._zod.run(n,i);return l instanceof Promise?l.then(o=>td(o,t.out,i)):td(l,t.out,i)}});function td(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const zM=ie("$ZodReadonly",(e,t)=>{Nt.init(e,t),lt(e._zod,"propValues",()=>t.innerType._zod.propValues),lt(e._zod,"values",()=>t.innerType._zod.values),lt(e._zod,"optin",()=>{var n,i;return(i=(n=t.innerType)==null?void 0:n._zod)==null?void 0:i.optin}),lt(e._zod,"optout",()=>{var n,i;return(i=(n=t.innerType)==null?void 0:n._zod)==null?void 0:i.optout}),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const l=t.innerType._zod.run(n,i);return l instanceof Promise?l.then(l1):l1(l)}});function l1(e){return e.value=Object.freeze(e.value),e}const OM=ie("$ZodCustom",(e,t)=>{Un.init(e,t),Nt.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,l=t.fn(i);if(l instanceof Promise)return l.then(o=>s1(o,n,i,e));s1(l,n,i,e)}});function s1(e,t,n,i){if(!e){const l={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(l.params=i._zod.def.params),t.issues.push(cu(l))}}var o1;class DM{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const l={...i,...this._map.get(t)};return Object.keys(l).length?l:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function MM(){return new DM}(o1=globalThis).__zod_globalRegistry??(o1.__zod_globalRegistry=MM());const Yo=globalThis.__zod_globalRegistry;function LM(e,t){return new e({type:"string",...Ce(t)})}function UM(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(t)})}function u1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(t)})}function IM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(t)})}function BM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(t)})}function PM(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(t)})}function $M(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(t)})}function FM(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(t)})}function qM(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(t)})}function HM(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(t)})}function ZM(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(t)})}function VM(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(t)})}function QM(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(t)})}function GM(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(t)})}function KM(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(t)})}function YM(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(t)})}function XM(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(t)})}function JM(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(t)})}function WM(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(t)})}function e4(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(t)})}function t4(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(t)})}function n4(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(t)})}function r4(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(t)})}function a4(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(t)})}function i4(e,t){return new e({type:"string",format:"date",check:"string_format",...Ce(t)})}function l4(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(t)})}function s4(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ce(t)})}function o4(e,t){return new e({type:"number",checks:[],...Ce(t)})}function u4(e,t){return new e({type:"number",coerce:!0,checks:[],...Ce(t)})}function c4(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(t)})}function d4(e,t){return new e({type:"boolean",...Ce(t)})}function f4(e){return new e({type:"unknown"})}function h4(e,t){return new e({type:"never",...Ce(t)})}function c1(e,t){return new Xk({check:"less_than",...Ce(t),value:e,inclusive:!1})}function Um(e,t){return new Xk({check:"less_than",...Ce(t),value:e,inclusive:!0})}function d1(e,t){return new Jk({check:"greater_than",...Ce(t),value:e,inclusive:!1})}function Im(e,t){return new Jk({check:"greater_than",...Ce(t),value:e,inclusive:!0})}function f1(e,t){return new _D({check:"multiple_of",...Ce(t),value:e})}function ij(e,t){return new AD({check:"max_length",...Ce(t),maximum:e})}function Ed(e,t){return new TD({check:"min_length",...Ce(t),minimum:e})}function lj(e,t){return new RD({check:"length_equals",...Ce(t),length:e})}function m4(e,t){return new zD({check:"string_format",format:"regex",...Ce(t),pattern:e})}function p4(e){return new OD({check:"string_format",format:"lowercase",...Ce(e)})}function g4(e){return new DD({check:"string_format",format:"uppercase",...Ce(e)})}function y4(e,t){return new MD({check:"string_format",format:"includes",...Ce(t),includes:e})}function v4(e,t){return new LD({check:"string_format",format:"starts_with",...Ce(t),prefix:e})}function b4(e,t){return new UD({check:"string_format",format:"ends_with",...Ce(t),suffix:e})}function Fs(e){return new ID({check:"overwrite",tx:e})}function x4(e){return Fs(t=>t.normalize(e))}function S4(){return Fs(e=>e.trim())}function w4(){return Fs(e=>e.toLowerCase())}function k4(){return Fs(e=>e.toUpperCase())}function j4(){return Fs(e=>z3(e))}function E4(e,t,n){return new e({type:"array",element:t,...Ce(n)})}function C4(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ce(n)})}function _4(e){const t=N4(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(cu(i,n.value,t._zod.def));else{const l=i;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=t),l.continue??(l.continue=!t._zod.def.abort),n.issues.push(cu(l))}},e(n.value,n)));return t}function N4(e,t){const n=new Un({check:"custom",...Ce(t)});return n._zod.check=e,n}function sj(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Yo,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Ft(e,t,n={path:[],schemaPath:[]}){var y,g;var i;const l=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const u={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,u);const f=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);if(f)u.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,b);else{const k=u.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,b)}const x=e._zod.parent;x&&(u.ref||(u.ref=x),Ft(x,t,b),t.seen.get(x).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&yn(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((i=u.schema).default??(i.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function oj(e,t){var u,f,m,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const y of e.seen.entries()){const g=(u=e.metadataRegistry.get(y[0]))==null?void 0:u.id;if(g){const b=i.get(g);if(b&&b!==y[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(g,y[0])}}const l=y=>{var j;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(j=e.external.registry.get(y[0]))==null?void 0:j.id,N=e.external.uri??(O=>O);if(E)return{ref:N(E)};const T=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=T,{defId:T,ref:`${N("__shared")}#/${g}/${T}`}}if(y[1]===n)return{ref:"#"};const x=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:x+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:b,defId:x}=l(y);g.def={...g.schema},x&&(g.defId=x);const k=g.schema;for(const j in k)delete k[j];k.$ref=b};if(e.cycles==="throw")for(const y of e.seen.entries()){const g=y[1];if(g.cycle)throw new Error(`Cycle detected: #/${(f=g.cycle)==null?void 0:f.join("/")}/<root>
|
|
331
|
+
|
|
332
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const g=y[1];if(t===y[0]){o(y);continue}if(e.external){const x=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&x){o(y);continue}}if((h=e.metadataRegistry.get(y[0]))==null?void 0:h.id){o(y);continue}if(g.cycle){o(y);continue}if(g.count>1&&e.reused==="ref"){o(y);continue}}}function uj(e,t){var u,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=h=>{const y=e.seen.get(h);if(y.ref===null)return;const g=y.def??y.schema,b={...g},x=y.ref;if(y.ref=null,x){i(x);const j=e.seen.get(x),E=j.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(E)):Object.assign(g,E),Object.assign(g,b),h._zod.parent===x)for(const T in g)T==="$ref"||T==="allOf"||T in b||delete g[T];if(E.$ref&&j.def)for(const T in g)T==="$ref"||T==="allOf"||T in j.def&&JSON.stringify(g[T])===JSON.stringify(j.def[T])&&delete g[T]}const k=h._zod.parent;if(k&&k!==x){i(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(g.$ref=j.schema.$ref,j.def))for(const E in g)E==="$ref"||E==="allOf"||E in j.def&&JSON.stringify(g[E])===JSON.stringify(j.def[E])&&delete g[E]}e.override({zodSchema:h,jsonSchema:g,path:y.path??[]})};for(const h of[...e.seen.entries()].reverse())i(h[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,(u=e.external)!=null&&u.uri){const h=(f=e.external.registry.get(t))==null?void 0:f.id;if(!h)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(h)}Object.assign(l,n.def??n.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const y=h[1];y.def&&y.defId&&(o[y.defId]=y.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?l.$defs=o:l.definitions=o);try{const h=JSON.parse(JSON.stringify(l));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:Cd(t,"input",e.processors),output:Cd(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function yn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return yn(i.element,n);if(i.type==="set")return yn(i.valueType,n);if(i.type==="lazy")return yn(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return yn(i.innerType,n);if(i.type==="intersection")return yn(i.left,n)||yn(i.right,n);if(i.type==="record"||i.type==="map")return yn(i.keyType,n)||yn(i.valueType,n);if(i.type==="pipe")return yn(i.in,n)||yn(i.out,n);if(i.type==="object"){for(const l in i.shape)if(yn(i.shape[l],n))return!0;return!1}if(i.type==="union"){for(const l of i.options)if(yn(l,n))return!0;return!1}if(i.type==="tuple"){for(const l of i.items)if(yn(l,n))return!0;return!!(i.rest&&yn(i.rest,n))}return!1}const A4=(e,t={})=>n=>{const i=sj({...n,processors:t});return Ft(e,i),oj(i,e),uj(i,e)},Cd=(e,t,n={})=>i=>{const{libraryOptions:l,target:o}=i??{},u=sj({...l??{},target:o,io:t,processors:n});return Ft(e,u),oj(u,e),uj(u,e)},T4={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},R4=(e,t,n,i)=>{const l=n;l.type="string";const{minimum:o,maximum:u,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof u=="number"&&(l.maxLength=u),f&&(l.format=T4[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),h&&(l.contentEncoding=h),m&&m.size>0){const y=[...m];y.length===1?l.pattern=y[0].source:y.length>1&&(l.allOf=[...y.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},z4=(e,t,n,i)=>{const l=n,{minimum:o,maximum:u,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:y}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof y=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=y,l.exclusiveMinimum=!0):l.exclusiveMinimum=y),typeof o=="number"&&(l.minimum=o,typeof y=="number"&&t.target!=="draft-04"&&(y>=o?delete l.minimum:delete l.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.maximum=h,l.exclusiveMaximum=!0):l.exclusiveMaximum=h),typeof u=="number"&&(l.maximum=u,typeof h=="number"&&t.target!=="draft-04"&&(h<=u?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},O4=(e,t,n,i)=>{n.type="boolean"},D4=(e,t,n,i)=>{n.not={}},M4=(e,t,n,i)=>{},L4=(e,t,n,i)=>{const l=e._zod.def,o=Pk(l.entries);o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),n.enum=o},U4=(e,t,n,i)=>{const l=e._zod.def,o=[];for(const u of l.values)if(u===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(u))}else o.push(u);if(o.length!==0)if(o.length===1){const u=o[0];n.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[u]:n.const=u}else o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),o.every(u=>typeof u=="boolean")&&(n.type="boolean"),o.every(u=>u===null)&&(n.type="null"),n.enum=o},I4=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},B4=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},P4=(e,t,n,i)=>{const l=n,o=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(l.minItems=u),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Ft(o.element,t,{...i,path:[...i.path,"items"]})},$4=(e,t,n,i)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const u=o.shape;for(const y in u)l.properties[y]=Ft(u[y],t,{...i,path:[...i.path,"properties",y]});const f=new Set(Object.keys(u)),m=new Set([...f].filter(y=>{const g=o.shape[y]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));m.size>0&&(l.required=Array.from(m)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?l.additionalProperties=!1:o.catchall?o.catchall&&(l.additionalProperties=Ft(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},F4=(e,t,n,i)=>{const l=e._zod.def,o=l.inclusive===!1,u=l.options.map((f,m)=>Ft(f,t,{...i,path:[...i.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=u:n.anyOf=u},q4=(e,t,n,i)=>{const l=e._zod.def,o=Ft(l.left,t,{...i,path:[...i.path,"allOf",0]}),u=Ft(l.right,t,{...i,path:[...i.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(u)?u.allOf:[u]];n.allOf=m},H4=(e,t,n,i)=>{const l=n,o=e._zod.def;l.type="object";const u=o.keyType,f=u._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const y=Ft(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});l.patternProperties={};for(const g of m)l.patternProperties[g.source]=y}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(l.propertyNames=Ft(o.keyType,t,{...i,path:[...i.path,"propertyNames"]})),l.additionalProperties=Ft(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const h=u._zod.values;if(h){const y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},Z4=(e,t,n,i)=>{const l=e._zod.def,o=Ft(l.innerType,t,i),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},V4=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType},Q4=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},G4=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},K4=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType;let u;try{u=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=u},Y4=(e,t,n,i)=>{const l=e._zod.def,o=t.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;Ft(o,t,i);const u=t.seen.get(e);u.ref=o},X4=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},cj=(e,t,n,i)=>{const l=e._zod.def;Ft(l.innerType,t,i);const o=t.seen.get(e);o.ref=l.innerType},J4=ie("ZodISODateTime",(e,t)=>{JD.init(e,t),Tt.init(e,t)});function W4(e){return a4(J4,e)}const e5=ie("ZodISODate",(e,t)=>{WD.init(e,t),Tt.init(e,t)});function t5(e){return i4(e5,e)}const n5=ie("ZodISOTime",(e,t)=>{eM.init(e,t),Tt.init(e,t)});function r5(e){return l4(n5,e)}const a5=ie("ZodISODuration",(e,t)=>{tM.init(e,t),Tt.init(e,t)});function i5(e){return s4(a5,e)}const l5=(e,t)=>{Hk.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Z3(e,n)},flatten:{value:n=>H3(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ip,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ip,2)}},isEmpty:{get(){return e.issues.length===0}}})},vr=ie("ZodError",l5,{Parent:Error}),s5=Tg(vr),o5=Rg(vr),u5=Qd(vr),c5=Gd(vr),d5=G3(vr),f5=K3(vr),h5=Y3(vr),m5=X3(vr),p5=J3(vr),g5=W3(vr),y5=eD(vr),v5=tD(vr),At=ie("ZodType",(e,t)=>(Nt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Cd(e,"input"),output:Cd(e,"output")}}),e.toJSONSchema=A4(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ci(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>_i(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>s5(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>u5(e,n,i),e.parseAsync=async(n,i)=>o5(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>c5(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>d5(e,n,i),e.decode=(n,i)=>f5(e,n,i),e.encodeAsync=async(n,i)=>h5(e,n,i),e.decodeAsync=async(n,i)=>m5(e,n,i),e.safeEncode=(n,i)=>p5(e,n,i),e.safeDecode=(n,i)=>g5(e,n,i),e.safeEncodeAsync=async(n,i)=>y5(e,n,i),e.safeDecodeAsync=async(n,i)=>v5(e,n,i),e.refine=(n,i)=>e.check(d6(n,i)),e.superRefine=n=>e.check(f6(n)),e.overwrite=n=>e.check(Fs(n)),e.optional=()=>p1(e),e.exactOptional=()=>J5(e),e.nullable=()=>g1(e),e.nullish=()=>p1(g1(e)),e.nonoptional=n=>a6(e,n),e.array=()=>Yn(e),e.or=n=>hj([e,n]),e.and=n=>V5(e,n),e.transform=n=>y1(e,Y5(n)),e.default=n=>t6(e,n),e.prefault=n=>r6(e,n),e.catch=n=>l6(e,n),e.pipe=n=>y1(e,n),e.readonly=()=>u6(e),e.describe=n=>{const i=e.clone();return Yo.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){var n;return(n=Yo.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Yo.get(e);const i=e.clone();return Yo.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),dj=ie("_ZodString",(e,t)=>{zg.init(e,t),At.init(e,t),e._zod.processJSONSchema=(i,l,o)=>R4(e,i,l);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(m4(...i)),e.includes=(...i)=>e.check(y4(...i)),e.startsWith=(...i)=>e.check(v4(...i)),e.endsWith=(...i)=>e.check(b4(...i)),e.min=(...i)=>e.check(Ed(...i)),e.max=(...i)=>e.check(ij(...i)),e.length=(...i)=>e.check(lj(...i)),e.nonempty=(...i)=>e.check(Ed(1,...i)),e.lowercase=i=>e.check(p4(i)),e.uppercase=i=>e.check(g4(i)),e.trim=()=>e.check(S4()),e.normalize=(...i)=>e.check(x4(...i)),e.toLowerCase=()=>e.check(w4()),e.toUpperCase=()=>e.check(k4()),e.slugify=()=>e.check(j4())}),b5=ie("ZodString",(e,t)=>{zg.init(e,t),dj.init(e,t),e.email=n=>e.check(UM(x5,n)),e.url=n=>e.check(FM(S5,n)),e.jwt=n=>e.check(r4(L5,n)),e.emoji=n=>e.check(qM(w5,n)),e.guid=n=>e.check(u1(h1,n)),e.uuid=n=>e.check(IM(nd,n)),e.uuidv4=n=>e.check(BM(nd,n)),e.uuidv6=n=>e.check(PM(nd,n)),e.uuidv7=n=>e.check($M(nd,n)),e.nanoid=n=>e.check(HM(k5,n)),e.guid=n=>e.check(u1(h1,n)),e.cuid=n=>e.check(ZM(j5,n)),e.cuid2=n=>e.check(VM(E5,n)),e.ulid=n=>e.check(QM(C5,n)),e.base64=n=>e.check(e4(O5,n)),e.base64url=n=>e.check(t4(D5,n)),e.xid=n=>e.check(GM(_5,n)),e.ksuid=n=>e.check(KM(N5,n)),e.ipv4=n=>e.check(YM(A5,n)),e.ipv6=n=>e.check(XM(T5,n)),e.cidrv4=n=>e.check(JM(R5,n)),e.cidrv6=n=>e.check(WM(z5,n)),e.e164=n=>e.check(n4(M5,n)),e.datetime=n=>e.check(W4(n)),e.date=n=>e.check(t5(n)),e.time=n=>e.check(r5(n)),e.duration=n=>e.check(i5(n))});function D(e){return LM(b5,e)}const Tt=ie("ZodStringFormat",(e,t)=>{Ct.init(e,t),dj.init(e,t)}),x5=ie("ZodEmail",(e,t)=>{qD.init(e,t),Tt.init(e,t)}),h1=ie("ZodGUID",(e,t)=>{$D.init(e,t),Tt.init(e,t)}),nd=ie("ZodUUID",(e,t)=>{FD.init(e,t),Tt.init(e,t)}),S5=ie("ZodURL",(e,t)=>{HD.init(e,t),Tt.init(e,t)}),w5=ie("ZodEmoji",(e,t)=>{ZD.init(e,t),Tt.init(e,t)}),k5=ie("ZodNanoID",(e,t)=>{VD.init(e,t),Tt.init(e,t)}),j5=ie("ZodCUID",(e,t)=>{QD.init(e,t),Tt.init(e,t)}),E5=ie("ZodCUID2",(e,t)=>{GD.init(e,t),Tt.init(e,t)}),C5=ie("ZodULID",(e,t)=>{KD.init(e,t),Tt.init(e,t)}),_5=ie("ZodXID",(e,t)=>{YD.init(e,t),Tt.init(e,t)}),N5=ie("ZodKSUID",(e,t)=>{XD.init(e,t),Tt.init(e,t)}),A5=ie("ZodIPv4",(e,t)=>{nM.init(e,t),Tt.init(e,t)}),T5=ie("ZodIPv6",(e,t)=>{rM.init(e,t),Tt.init(e,t)}),R5=ie("ZodCIDRv4",(e,t)=>{aM.init(e,t),Tt.init(e,t)}),z5=ie("ZodCIDRv6",(e,t)=>{iM.init(e,t),Tt.init(e,t)}),O5=ie("ZodBase64",(e,t)=>{lM.init(e,t),Tt.init(e,t)}),D5=ie("ZodBase64URL",(e,t)=>{oM.init(e,t),Tt.init(e,t)}),M5=ie("ZodE164",(e,t)=>{uM.init(e,t),Tt.init(e,t)}),L5=ie("ZodJWT",(e,t)=>{dM.init(e,t),Tt.init(e,t)}),Og=ie("ZodNumber",(e,t)=>{ej.init(e,t),At.init(e,t),e._zod.processJSONSchema=(i,l,o)=>z4(e,i,l),e.gt=(i,l)=>e.check(d1(i,l)),e.gte=(i,l)=>e.check(Im(i,l)),e.min=(i,l)=>e.check(Im(i,l)),e.lt=(i,l)=>e.check(c1(i,l)),e.lte=(i,l)=>e.check(Um(i,l)),e.max=(i,l)=>e.check(Um(i,l)),e.int=i=>e.check(m1(i)),e.safe=i=>e.check(m1(i)),e.positive=i=>e.check(d1(0,i)),e.nonnegative=i=>e.check(Im(0,i)),e.negative=i=>e.check(c1(0,i)),e.nonpositive=i=>e.check(Um(0,i)),e.multipleOf=(i,l)=>e.check(f1(i,l)),e.step=(i,l)=>e.check(f1(i,l)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function We(e){return o4(Og,e)}const U5=ie("ZodNumberFormat",(e,t)=>{fM.init(e,t),Og.init(e,t)});function m1(e){return c4(U5,e)}const I5=ie("ZodBoolean",(e,t)=>{hM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>O4(e,n,i)});function ju(e){return d4(I5,e)}const B5=ie("ZodUnknown",(e,t)=>{mM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>M4()});function St(){return f4(B5)}const P5=ie("ZodNever",(e,t)=>{pM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>D4(e,n,i)});function $5(e){return h4(P5,e)}const F5=ie("ZodArray",(e,t)=>{gM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>P4(e,n,i,l),e.element=t.element,e.min=(n,i)=>e.check(Ed(n,i)),e.nonempty=n=>e.check(Ed(1,n)),e.max=(n,i)=>e.check(ij(n,i)),e.length=(n,i)=>e.check(lj(n,i)),e.unwrap=()=>e.element});function Yn(e,t){return E4(F5,e,t)}const q5=ie("ZodObject",(e,t)=>{vM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>$4(e,n,i,l),lt(e,"shape",()=>t.shape),e.keyof=()=>tt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:St()}),e.loose=()=>e.clone({...e._zod.def,catchall:St()}),e.strict=()=>e.clone({...e._zod.def,catchall:$5()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>B3(e,n),e.safeExtend=n=>P3(e,n),e.merge=n=>$3(e,n),e.pick=n=>U3(e,n),e.omit=n=>I3(e,n),e.partial=(...n)=>F3(pj,e,n[0]),e.required=(...n)=>q3(gj,e,n[0])});function fe(e,t){const n={type:"object",shape:e??{},...Ce(t)};return new q5(n)}const fj=ie("ZodUnion",(e,t)=>{rj.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>F4(e,n,i,l),e.options=t.options});function hj(e,t){return new fj({type:"union",options:e,...Ce(t)})}const H5=ie("ZodDiscriminatedUnion",(e,t)=>{fj.init(e,t),bM.init(e,t)});function mj(e,t,n){return new H5({type:"union",options:t,discriminator:e,...Ce(n)})}const Z5=ie("ZodIntersection",(e,t)=>{xM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>q4(e,n,i,l)});function V5(e,t){return new Z5({type:"intersection",left:e,right:t})}const Q5=ie("ZodRecord",(e,t)=>{SM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>H4(e,n,i,l),e.keyType=t.keyType,e.valueType=t.valueType});function qt(e,t,n){return new Q5({type:"record",keyType:e,valueType:t,...Ce(n)})}const Pp=ie("ZodEnum",(e,t)=>{wM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(i,l,o)=>L4(e,i,l),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,l)=>{const o={};for(const u of i)if(n.has(u))o[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Pp({...t,checks:[],...Ce(l),entries:o})},e.exclude=(i,l)=>{const o={...t.entries};for(const u of i)if(n.has(u))delete o[u];else throw new Error(`Key ${u} not found in enum`);return new Pp({...t,checks:[],...Ce(l),entries:o})}});function tt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Pp({type:"enum",entries:n,...Ce(t)})}const G5=ie("ZodLiteral",(e,t)=>{kM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>U4(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function zn(e,t){return new G5({type:"literal",values:Array.isArray(e)?e:[e],...Ce(t)})}const K5=ie("ZodTransform",(e,t)=>{jM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>B4(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Ik(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(cu(o,n.value,t));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=n.value),u.inst??(u.inst=e),n.issues.push(cu(u))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function Y5(e){return new K5({type:"transform",transform:e})}const pj=ie("ZodOptional",(e,t)=>{aj.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>cj(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function p1(e){return new pj({type:"optional",innerType:e})}const X5=ie("ZodExactOptional",(e,t)=>{EM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>cj(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function J5(e){return new X5({type:"optional",innerType:e})}const W5=ie("ZodNullable",(e,t)=>{CM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>Z4(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function g1(e){return new W5({type:"nullable",innerType:e})}const e6=ie("ZodDefault",(e,t)=>{_M.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>Q4(e,n,i,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function t6(e,t){return new e6({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Fk(t)}})}const n6=ie("ZodPrefault",(e,t)=>{NM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>G4(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function r6(e,t){return new n6({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Fk(t)}})}const gj=ie("ZodNonOptional",(e,t)=>{AM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>V4(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function a6(e,t){return new gj({type:"nonoptional",innerType:e,...Ce(t)})}const i6=ie("ZodCatch",(e,t)=>{TM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>K4(e,n,i,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function l6(e,t){return new i6({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const s6=ie("ZodPipe",(e,t)=>{RM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>Y4(e,n,i,l),e.in=t.in,e.out=t.out});function y1(e,t){return new s6({type:"pipe",in:e,out:t})}const o6=ie("ZodReadonly",(e,t)=>{zM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>X4(e,n,i,l),e.unwrap=()=>e._zod.def.innerType});function u6(e){return new o6({type:"readonly",innerType:e})}const c6=ie("ZodCustom",(e,t)=>{OM.init(e,t),At.init(e,t),e._zod.processJSONSchema=(n,i,l)=>I4(e,n)});function d6(e,t={}){return C4(c6,e,t)}function f6(e){return _4(e)}const Bm={custom:"custom"};function Yd(e){return u4(Og,e)}const h6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},yj=tt(["feishu","slack","kael"]),vj=tt(["active","inactive"]);fe({platform:yj,agentId:D().min(1),credentials:qt(D(),St()),status:vj.default("active")});fe({agentId:D().min(1).optional(),credentials:qt(D(),St()).optional(),status:vj.optional()});fe({id:We(),platform:D(),agentId:D(),hasCredentials:ju(),status:D(),createdAt:D(),updatedAt:D()});const m6=tt(["code","reverse_token","oauth","manual"]);fe({appId:D().min(1),appSecret:D().min(1)});fe({platform:yj,externalUserId:D().min(1),agentId:D().min(1),boundVia:m6.default("manual"),displayName:D().max(200).optional()});fe({id:We(),platform:D(),externalUserId:D(),agentId:D(),boundVia:D().nullable(),displayName:D().nullable(),createdAt:D()});fe({feishuUserId:D().min(1),displayName:D().max(200).optional()});fe({configId:We(),platform:D(),agentId:D(),appId:D(),connected:ju(),lastActiveAt:D().nullable()});const bj=tt(["online","offline"]),xj=tt(["idle","working","blocked","error"]);tt(["active","suspended","evicted"]);const p6=tt(["active","suspended"]);fe({chatId:D().min(1),state:p6});fe({runtimeState:xj});fe({agentId:D().min(1),runtimeType:D().max(50),runtimeVersion:D().max(50).optional()});tt(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent"]);fe({agentId:D(),status:bj,connectedAt:D().nullable(),lastSeenAt:D(),clientId:D().nullable().optional(),runtimeType:D().nullable().optional(),runtimeVersion:D().nullable().optional(),runtimeState:xj.nullable().optional(),activeSessions:We().int().nullable().optional(),totalSessions:We().int().nullable().optional(),runtimeUpdatedAt:D().nullable().optional()});fe({total:We().int(),running:We().int(),byState:fe({idle:We().int(),working:We().int(),blocked:We().int(),error:We().int()}),clients:We().int()});const g6={HUMAN:"human",PERSONAL_ASSISTANT:"personal_assistant",AUTONOMOUS_AGENT:"autonomous_agent"},Xd=tt(["human","personal_assistant","autonomous_agent"]),v1={PRIVATE:"private",ORGANIZATION:"organization"},Dg=tt(["private","organization"]),y6=tt(["admin-api","portal"]);tt(["active","suspended"]);fe({name:D().min(1).max(100).regex(/^[a-z0-9_-]+$/,"Only lowercase alphanumeric, hyphens, and underscores").optional(),type:Xd,displayName:D().max(200).optional(),delegateMention:D().max(100).optional(),organizationId:D().max(100).optional(),source:y6.optional(),visibility:Dg.optional(),metadata:qt(D(),St()).optional(),managerId:D().optional(),clientId:D().min(1).max(100).optional()});fe({type:Xd.optional(),displayName:D().max(200).nullable().optional(),delegateMention:D().max(100).nullable().optional(),visibility:Dg.optional(),metadata:qt(D(),St()).optional(),managerId:D().nullable().optional(),clientId:D().min(1).max(100).nullable().optional()});fe({uuid:D(),name:D().nullable(),organizationId:D(),type:Xd,displayName:D().nullable(),delegateMention:D().nullable(),inboxId:D(),status:D(),source:D().nullable().optional(),cloudUserId:D().nullable().optional(),visibility:Dg,metadata:qt(D(),St()),managerId:D().nullable(),clientId:D().nullable(),presenceStatus:bj.optional(),createdAt:D(),updatedAt:D()});fe({repo:D().nullable(),branch:D().nullable()});fe({type:zn("agent:pinned"),agentId:D(),name:D().nullable(),displayName:D().nullable(),agentType:Xd});const v6=32e3,Mg=/^[a-z0-9][a-z0-9_-]{0,63}$/i,b6=/^[A-Z][A-Z0-9_]*$/,x6=fe({append:D().max(v6).default("")}),S6=fe({name:D().regex(Mg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:zn("stdio"),command:D().min(1),args:Yn(D()).optional()}),w6=fe({name:D().regex(Mg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:zn("http"),url:D().url(),headers:qt(D(),D()).optional()}),k6=fe({name:D().regex(Mg,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:zn("sse"),url:D().url(),headers:qt(D(),D()).optional()}),j6=mj("transport",[S6,w6,k6]),E6=fe({key:D().regex(b6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:D(),sensitive:ju().default(!1)}),C6=fe({url:D().min(1),ref:D().min(1).optional(),localPath:D().min(1).optional()}),Lg=fe({prompt:x6.default({append:""}),model:D().default(""),mcpServers:Yn(j6).default([]),env:Yn(E6).default([]),gitRepos:Yn(C6).default([])}),_6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,u)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:Bm.custom,path:["mcpServers",u,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const i=new Set;e.env.forEach((o,u)=>{i.has(o.key)&&t.addIssue({code:Bm.custom,path:["env",u,"key"],message:`Duplicate env key "${o.key}"`}),i.add(o.key)});const l=new Set;e.gitRepos.forEach((o,u)=>{const f=o.localPath??_d(o.url);f&&(l.has(f)&&t.addIssue({code:Bm.custom,path:["gitRepos",u,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},Sj=Lg.superRefine(_6),N6=fe({agentId:D(),version:We().int().positive(),payload:Sj,updatedAt:D(),updatedBy:D()});fe({expectedVersion:We().int().positive(),payload:Lg.partial()});fe({payload:Lg.partial()});fe({current:N6,next:Sj,diff:Yn(fe({path:D(),op:tt(["add","remove","replace"]),before:St().optional(),after:St().optional()}))});const $p="***";function _d(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}fe({username:D().min(1),password:D().min(1)});fe({accessToken:D(),refreshToken:D()});fe({refreshToken:D().min(1)});fe({token:D().min(1)});fe({token:D(),expiresIn:We(),command:D()});const A6=tt(["direct","group","thread"]);fe({type:A6,topic:D().max(500).optional(),participantIds:Yn(D()).min(1),metadata:qt(D(),St()).optional()});const T6=fe({agentId:D(),role:D(),mode:D(),joinedAt:D()}),R6=fe({id:D(),organizationId:D(),type:D(),topic:D().nullable(),lifecyclePolicy:D().nullable().optional(),metadata:qt(D(),St()),createdAt:D(),updatedAt:D()});R6.extend({participants:Yn(T6)});fe({topic:D().trim().max(500).nullable()});fe({agentId:D().min(1),mode:tt(["full","mention_only"]).default("full")});fe({agentId:D().min(1)});const z6=tt(["connected","disconnected"]);fe({id:D(),userId:D().nullable(),status:z6,sdkVersion:D().max(50).nullable(),hostname:D().max(100).nullable(),os:D().max(50).nullable(),agentCount:We().int().min(0),connectedAt:D().nullable(),lastSeenAt:D(),metadata:qt(D(),St()).nullable()});fe({clientId:D().min(1).max(100),hostname:D().max(100).optional(),os:D().max(50).optional(),sdkVersion:D().max(50).optional()});fe({limit:Yd().int().min(1).max(100).default(20),cursor:D().optional()});const Ug=tt(["hub_ui","cli","feishu","github","api"]),wj=tt(["text","markdown","card","reference","file","task"]);fe({format:wj.default("text"),content:St(),metadata:qt(D(),St()).optional(),inReplyTo:D().optional(),replyToInbox:D().optional(),replyToChat:D().optional(),source:Ug.optional()});fe({format:wj.default("text"),content:St(),metadata:qt(D(),St()).optional(),replyToInbox:D().optional(),replyToChat:D().optional(),source:Ug.optional()});const O6=fe({id:D(),chatId:D(),senderId:D(),format:D(),content:St(),metadata:qt(D(),St()),replyToInbox:D().nullable(),replyToChat:D().nullable(),inReplyTo:D().nullable(),source:Ug.nullable(),createdAt:D()}),D6=O6.extend({configVersion:We().int().positive()});tt(["pending","delivered","acked","failed"]);const M6=fe({id:We(),inboxId:D(),messageId:D(),chatId:D().nullable(),status:D(),retryCount:We(),createdAt:D(),deliveredAt:D().nullable(),ackedAt:D().nullable()});M6.extend({message:D6});fe({limit:Yd().int().min(1).max(50).default(10)});const L6={ADMIN:"admin",MEMBER:"member"},Ig=tt(["admin","member"]),U6=fe({id:D(),userId:D(),organizationId:D(),agentId:D(),role:Ig,createdAt:D()});fe({username:D().min(1).max(100),displayName:D().min(1).max(200),role:Ig.default("member")});fe({role:Ig.optional(),displayName:D().min(1).max(200).optional()});U6.extend({username:D(),displayName:D(),password:D()});const I6=tt(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),kj=tt(["high","medium","low"]);fe({id:D(),organizationId:D(),type:I6,severity:kj,agentId:D().nullable(),chatId:D().nullable(),message:D(),read:ju(),createdAt:D()});fe({limit:Yd().int().min(1).max(100).default(20),cursor:D().optional(),severity:kj.optional(),read:tt(["true","false"]).transform(e=>e==="true").optional(),agentId:D().optional()});const jj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;fe({name:D().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!jj.test(e),"Name must not be a UUID format"),displayName:D().min(1).max(200),maxAgents:We().int().min(0).default(0),maxMessagesPerMinute:We().int().min(0).default(0),features:qt(D(),St()).default({})});fe({name:D().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!jj.test(e),"Name must not be a UUID format").optional(),displayName:D().min(1).max(200).optional(),maxAgents:We().int().min(0).optional(),maxMessagesPerMinute:We().int().min(0).optional(),features:qt(D(),St()).optional()});fe({id:D(),name:D(),displayName:D(),maxAgents:We(),maxMessagesPerMinute:We(),features:qt(D(),St()),createdAt:D(),updatedAt:D()});const B6=fe({workingCount:We().int().nonnegative(),errorMask:ju()}),P6=fe({type:zn("pulse:tick"),organizationId:D(),agents:qt(D(),Yn(B6).length(32))}),$6=tt(["tool_call","error","assistant_text","thinking","turn_end"]),Ej=fe({toolUseId:D(),name:D(),args:St(),status:tt(["pending","ok","error"]),durationMs:We().int().nonnegative().optional(),resultPreview:D().max(400).optional()}),Cj=fe({source:tt(["sdk","runtime","tool"]),message:D().max(2e3)}),_j=fe({text:D().max(8e3)}),Nj=fe({}),Aj=fe({status:tt(["success","error"])}),F6=mj("kind",[fe({kind:zn("tool_call"),payload:Ej}),fe({kind:zn("error"),payload:Cj}),fe({kind:zn("assistant_text"),payload:_j}),fe({kind:zn("thinking"),payload:Nj}),fe({kind:zn("turn_end"),payload:Aj})]);fe({id:D(),agentId:D(),chatId:D(),seq:We().int().positive(),kind:$6,payload:hj([Ej,Cj,_j,Nj,Aj]),createdAt:D()});fe({agentId:D(),chatId:D(),event:F6});fe({agentId:D(),chatId:D()});fe({type:zn("session:reconcile"),agentId:D().min(1),chatIds:Yn(D().min(1)).max(500)});fe({type:zn("session:reconcile:result"),agentId:D().min(1),staleChatIds:Yn(D().min(1))});const q6=fe({organizationId:D(),agentCount:We(),chatCount:We(),messageCount:We()});fe({totalAgents:We(),totalChats:We(),totalMessages:We(),byOrganization:Yn(q6)});fe({key:D(),value:St(),updatedAt:D()});qt(D(),St());const yi={INBOX_TIMEOUT_SECONDS:"inbox_timeout_seconds",MAX_RETRY_COUNT:"max_retry_count",POLLING_INTERVAL_SECONDS:"polling_interval_seconds",PRESENCE_CLEANUP_SECONDS:"presence_cleanup_seconds"},gd={[yi.INBOX_TIMEOUT_SECONDS]:300,[yi.MAX_RETRY_COUNT]:3,[yi.POLLING_INTERVAL_SECONDS]:5,[yi.PRESENCE_CLEANUP_SECONDS]:60},du=tt(["pending","assigned","working","completed","failed","cancelled"]),b1=tt(["agent","admin"]),H6=tt(["assigned","status_changed","cancelled"]);fe({taskId:D(),event:H6,title:D(),body:D().default(""),status:du,fromStatus:du.optional(),originRef:D().nullable().optional()});const Z6=fe({title:D().min(1).max(500),body:D().optional(),assigneeAgentId:D().optional(),originRef:D().max(500).optional(),metadata:qt(D(),St()).optional()});Z6.extend({organizationId:D().optional()});fe({status:tt(["working","completed","failed"]),result:D().optional()});fe({assigneeAgentId:D().nullable().optional(),status:du.optional(),result:D().optional()});fe({chatId:D().min(1)});const V6=fe({id:D(),organizationId:D(),title:D(),body:D(),status:du,assigneeAgentId:D().nullable(),createdByType:b1,createdById:D(),originRef:D().nullable(),result:D().nullable(),metadata:qt(D(),St()),createdAt:D(),updatedAt:D(),cancelledAt:D().nullable(),cancelledByType:b1.nullable(),cancelledById:D().nullable()}),Q6=fe({taskId:D(),chatId:D(),linkedByAgentId:D().nullable(),linkedAt:D()});V6.extend({chats:Yn(Q6)});fe({status:du.optional(),assigneeAgentId:D().optional(),originRef:D().optional(),limit:Yd().int().min(1).max(100).default(20),cursor:D().optional()});const G6=tt(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);fe({taskId:D(),signal:G6,reason:D()});const K6=tt(["active","suspended"]);fe({id:D(),username:D(),displayName:D(),avatarUrl:D().nullable(),status:K6,createdAt:D(),updatedAt:D()});fe({username:D().min(1).max(100),displayName:D().min(1).max(200),password:D().min(8).max(200)});fe({displayName:D().min(1).max(200).optional(),password:D().min(8).max(200).optional()});fe({type:zn("auth"),token:D().min(1)});fe({type:zn("server:welcome"),serverCommandVersion:D().min(1),serverTimeMs:We().int().nonnegative()}).passthrough();const Tj=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function Y6(e){const t=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));for(const n of Object.values(e))for(let i=0;i<32&&i<n.length;i++){const l=n[i],o=t[i];!l||!o||(o.workingCount+=l.workingCount,o.errorMask=o.errorMask||l.errorMask)}return t}const X6=2e3,J6=3e4;let si=null,Nd=!1,Pm=0,Wo=null;const Fp=new Set;let Xo=null,ys=0;function W6(e){for(const t of Fp)try{t(e)}catch{}Xo&&(e.type==="notification"?Xo.invalidateQueries({queryKey:["notifications"]}):e.type==="session:state"&&(Xo.invalidateQueries({queryKey:["activity"]}),Xo.invalidateQueries({queryKey:["sessions"]})))}function Rj(){const e=vg();if(!(e!=null&&e.accessToken))return;const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/ws/admin?token=${e.accessToken}`,i=new WebSocket(n);si=i,i.onmessage=l=>{if(i===si)try{const o=JSON.parse(l.data);W6(o)}catch{}},i.onopen=()=>{i===si&&(Pm=0)},i.onclose=()=>{if(i!==si||(si=null,Nd||ys===0))return;Pm++;const l=Math.min(X6*2**(Pm-1),J6);Wo=setTimeout(()=>{Wo=null,!Nd&&ys>0&&Rj()},l)}}function eL(){Nd=!0,Wo&&(clearTimeout(Wo),Wo=null),si&&(si.close(1e3,"unmount"),si=null)}function zj(e){const{onMessage:t,enabled:n=!0}=e??{},i=Wn(),l=S.useRef(t);l.current=t,S.useEffect(()=>{Xo=i},[i]),S.useEffect(()=>{if(!n)return;const o=u=>{var f;return(f=l.current)==null?void 0:f.call(l,u)};return Fp.add(o),ys++,ys===1&&(Nd=!1,Rj()),()=>{Fp.delete(o),ys--,ys===0&&eL()}},[n])}const Oj=S.createContext({aggregated:Tj,agents:{},receivedAtMs:null,stale:!0});function tL({children:e}){const[t,n]=S.useState({aggregated:Tj,agents:{},receivedAtMs:null}),[i,l]=S.useState(()=>Date.now());zj({onMessage:u=>{const f=P6.safeParse(u);f.success&&n({aggregated:Y6(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),S.useEffect(()=>{const u=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(u)},[]);const o=S.useMemo(()=>({...t,stale:t.receivedAtMs===null||i-t.receivedAtMs>3e4}),[t,i]);return d.jsx(Oj.Provider,{value:o,children:e})}function nL(){return S.useContext(Oj)}function Jd({title:e,subtitle:t,right:n,className:i,style:l,...o}){return d.jsxs("div",{className:Te("flex items-baseline gap-3 shrink-0",i),style:{padding:"var(--sp-3) var(--sp-5) var(--sp-2_5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)",...l},...o,children:[d.jsx("h1",{className:"m-0 text-title",style:{color:"var(--fg)"},children:e}),t&&d.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),d.jsx("div",{style:{flex:1}}),n]})}function Dj({className:e,style:t,...n}){return d.jsx("div",{className:Te("flex items-end",e),style:{gap:2,height:34,padding:"0 var(--sp-5)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",...t},...n})}function Mj({active:e,onClick:t,children:n}){return d.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 bg-transparent text-body font-medium",style:{padding:"var(--sp-1_75) var(--sp-3)",marginBottom:-1,borderBottom:`var(--hairline-bold) solid ${e?"var(--accent)":"transparent"}`,color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",transition:"color 0.12s"},onMouseEnter:i=>{e||(i.currentTarget.style.color="var(--fg)")},onMouseLeave:i=>{e||(i.currentTarget.style.color="var(--fg-3)")},children:n})}const rL={neutral:{bg:"var(--bg-sunken)",fg:"var(--fg-2)",bd:"var(--border)"},accent:{bg:"var(--accent-bg)",fg:"var(--accent-dim)",bd:"color-mix(in oklch, var(--accent) 30%, transparent)"},warn:{bg:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},error:{bg:"color-mix(in oklch, var(--state-error) 14%, transparent)",fg:"var(--state-error)",bd:"color-mix(in oklch, var(--state-error) 30%, transparent)"},outline:{bg:"transparent",fg:"var(--fg-3)",bd:"var(--border)"},idle:{bg:"color-mix(in oklch, var(--state-idle) 14%, transparent)",fg:"var(--state-idle)",bd:"color-mix(in oklch, var(--state-idle) 30%, transparent)"},working:{bg:"color-mix(in oklch, var(--state-working) 14%, transparent)",fg:"var(--state-working)",bd:"color-mix(in oklch, var(--state-working) 30%, transparent)"},blocked:{bg:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},offline:{bg:"color-mix(in oklch, var(--state-offline) 14%, transparent)",fg:"var(--state-offline)",bd:"color-mix(in oklch, var(--state-offline) 30%, transparent)"}};function Wt({tone:e="neutral",className:t,style:n,...i}){const l=rL[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return d.jsx("span",{className:Te("mono inline-flex items-center uppercase text-caption leading-[1.6]",t),style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",...o},...i})}const Sa=S.forwardRef(({className:e,...t},n)=>d.jsx("table",{ref:n,className:Te("w-full",e),style:{borderCollapse:"separate",borderSpacing:0},...t}));Sa.displayName="DenseTable";const wa=S.forwardRef(({className:e,...t},n)=>d.jsx("thead",{ref:n,className:e,...t}));wa.displayName="DenseTableHeader";const ka=S.forwardRef(({className:e,...t},n)=>d.jsx("tbody",{ref:n,className:e,...t}));ka.displayName="DenseTableBody";const Qt=S.forwardRef(({className:e,interactive:t,selected:n,style:i,...l},o)=>d.jsx("tr",{ref:o,className:Te("transition-colors",e),"data-interactive":t?"":void 0,"data-selected":n?"":void 0,style:{background:n?"var(--bg-active)":void 0,cursor:t?"pointer":void 0,...i},...l}));Qt.displayName="DenseTableRow";const Ae=S.forwardRef(({className:e,style:t,...n},i)=>d.jsx("th",{ref:i,className:Te("mono text-left uppercase text-eyebrow whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border)",...t},...n}));Ae.displayName="DenseTableHead";const Ee=S.forwardRef(({className:e,style:t,...n},i)=>d.jsx("td",{ref:i,className:Te("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Ee.displayName="DenseTableCell";const Fr=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},...t}));Fr.displayName="Panel";const Lj=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("flex items-center justify-between gap-3",e),style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},...t}));Lj.displayName="PanelHeader";const Uj=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)"},...t}));Uj.displayName="PanelTitle";const aL=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te(e),style:{padding:"var(--sp-3) var(--sp-3_5)"},...t}));aL.displayName="PanelBody";function Ms({children:e,right:t,className:n,style:i,...l}){return d.jsxs("div",{className:Te("mono flex items-center justify-between uppercase text-eyebrow",n),style:{padding:"var(--sp-1_75) var(--sp-3_5)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)",...i},...l,children:[d.jsx("span",{children:e}),t]})}function Eu({className:e,style:t,...n}){return d.jsx("span",{className:Te("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function Bg(){return De.get("/members")}function iL(e){return De.post("/members",e)}function lL(e,t){return De.patch(`/members/${encodeURIComponent(e)}`,t)}function sL(e){return De.delete(`/members/${encodeURIComponent(e)}`)}function Pg(){const{data:e}=qe({queryKey:["members","name-map"],queryFn:Bg,staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.id,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function oL(){const e=qr(),t=Pg(),{data:n,isLoading:i,error:l}=qe({queryKey:["admin-all-agents"],queryFn:()=>p3({limit:100})});return d.jsxs("div",{children:[d.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-2_5)"},children:"Every agent in the organization — including private agents owned by other members. Use this view to troubleshoot or reassign."}),d.jsxs(Fr,{children:[d.jsxs(Ms,{children:["All agents · ",(n==null?void 0:n.items.length)??0]}),i?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l?d.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",l instanceof Error?l.message:"Unknown error"]}):!n||n.items.length===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents"}):d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Name"}),d.jsx(Ae,{children:"Display"}),d.jsx(Ae,{children:"Type"}),d.jsx(Ae,{children:"Visibility"}),d.jsx(Ae,{children:"Owner"}),d.jsx(Ae,{children:"Status"}),d.jsx(Ae,{children:"Created"})]})}),d.jsx(ka,{children:n.items.map(o=>d.jsxs(Qt,{interactive:!0,onClick:()=>e(`/agents/${encodeURIComponent(o.uuid)}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono font-medium",children:o.name??o.uuid.slice(0,8)})}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:o.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:o.type==="autonomous_agent"?"accent":"neutral",children:o.type})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:o.visibility==="organization"?"accent":"outline",children:o.visibility})}),d.jsx(Ee,{className:"text-label",style:{color:"var(--fg-2)"},children:o.managerId?t(o.managerId):"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:o.status==="active"?"accent":"neutral",children:o.status})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(o.createdAt)})]},o.uuid))})]})]})]})}const x1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,S1=xw,uL=(e,t)=>n=>{var i;if((t==null?void 0:t.variants)==null)return S1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,u=Object.keys(l).map(h=>{const y=n==null?void 0:n[h],g=o==null?void 0:o[h];if(y===null)return null;const b=x1(y)||x1(g);return l[h][b]}),f=n&&Object.entries(n).reduce((h,y)=>{let[g,b]=y;return b===void 0||(h[g]=b),h},{}),m=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((h,y)=>{let{class:g,className:b,...x}=y;return Object.entries(x).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,g,b]:h},[]);return S1(e,u,m,n==null?void 0:n.class,n==null?void 0:n.className)},cL=uL("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-input)] text-body font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm 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 px-3 text-label",xs:"h-7 rounded-[var(--radius-chip)] px-2.5 text-label gap-1.5",lg:"h-10 px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ve=S.forwardRef(({className:e,variant:t,size:n,asChild:i=!1,...l},o)=>{const u=i?qO:"button";return d.jsx(u,{className:Te(cL({variant:t,size:n,className:e})),ref:o,...l})});ve.displayName="Button";const vt=S.forwardRef(({className:e,type:t,...n},i)=>d.jsx("input",{type:t,className:Te("flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors file:border-0 file:bg-transparent file:text-body 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",e),ref:i,...n}));vt.displayName="Input";var dL="Label",Ij=S.forwardRef((e,t)=>d.jsx(Ca.label,{...e,ref:t,onMouseDown:n=>{var l;n.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ij.displayName=dL;var fL=Ij;const Je=S.forwardRef(({className:e,...t},n)=>d.jsx(fL,{ref:n,className:Te("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Je.displayName="Label";const Bj=Object.values(L6);function hL(e,t){const n=(e==null?void 0:e.trim())||t,i=n.split(/[\s._-]+/).filter(Boolean);if(i.length>=2){const l=i[0]??"",o=i[1]??"";return`${l[0]??""}${o[0]??""}`.toUpperCase()}return n.slice(0,2).toUpperCase()}function mL(){const e=Wn(),{memberId:t}=ja(),[n,i]=S.useState(!1),[l,o]=S.useState({username:"",displayName:"",role:"member"}),[u,f]=S.useState(null),[m,h]=S.useState(null),{data:y,isLoading:g,error:b}=qe({queryKey:["members"],queryFn:Bg}),x=yt({mutationFn:()=>iL({username:l.username,displayName:l.displayName,role:l.role}),onSuccess:T=>{e.invalidateQueries({queryKey:["members"]}),f(T.password)}}),k=yt({mutationFn:sL,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function j(){i(!1),o({username:"",displayName:"",role:"member"}),f(null)}function E(T){T.preventDefault(),x.mutate()}function N(T){window.confirm("Delete this member? Their human agent will also be deactivated.")&&k.mutate(T)}return d.jsxs(d.Fragment,{children:[d.jsxs(Fr,{children:[d.jsxs(Ms,{right:d.jsxs(On,{open:n,onOpenChange:T=>T?i(!0):j(),children:[d.jsx(d3,{asChild:!0,children:d.jsxs(ve,{size:"xs",className:"normal-case tracking-normal",children:[d.jsx(gl,{className:"h-3 w-3"}),"Add member"]})}),d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:u?"Member Created":"Create Member"})}),u?d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Member created. Share the password below — it will only be shown once."}),d.jsxs("div",{className:"flex items-center gap-2 rounded-md p-3",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("code",{className:"flex-1 text-body mono",children:u}),d.jsx(ve,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText(u),title:"Copy password",children:d.jsx(bg,{className:"h-4 w-4"})})]}),d.jsx(Dn,{children:d.jsx(ve,{onClick:j,children:"Done"})})]}):d.jsxs("form",{onSubmit:E,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"member-username",children:"Username"}),d.jsx(vt,{id:"member-username",type:"text",value:l.username,onChange:T=>o({...l,username:T.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"member-name",children:"Display Name"}),d.jsx(vt,{id:"member-name",value:l.displayName,onChange:T=>o({...l,displayName:T.target.value}),required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"member-role",children:"Role"}),d.jsx("select",{id:"member-role",value:l.role,onChange:T=>o({...l,role:T.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:Bj.map(T=>d.jsx("option",{value:T,children:T},T))})]}),x.error instanceof Error&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:x.error.message}),d.jsx(Dn,{children:d.jsx(ve,{type:"submit",disabled:x.isPending,children:x.isPending?"Creating...":"Create"})})]})]})]}),children:["Members · ",(y==null?void 0:y.length)??0]}),g?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):b?d.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",b instanceof Error?b.message:"Unknown error"]}):(y==null?void 0:y.length)===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No members"}):d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{style:{width:30}}),d.jsx(Ae,{children:"Username"}),d.jsx(Ae,{children:"Name"}),d.jsx(Ae,{children:"Role"}),d.jsx(Ae,{children:"Created"}),d.jsx(Ae,{style:{width:1}})]})}),d.jsx(ka,{children:y==null?void 0:y.map(T=>{const O=t===T.id;return d.jsxs(Qt,{children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono inline-flex items-center justify-center text-caption font-semibold",style:{width:22,height:22,borderRadius:"var(--radius-input)",background:O?"var(--accent-bg)":"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)",color:O?"var(--accent-dim)":"var(--fg-2)"},children:hL(T.displayName,T.username)})}),d.jsxs(Ee,{children:[d.jsx("span",{className:"mono font-medium",children:T.username}),O&&d.jsx(Eu,{style:{marginLeft:6},children:"you"})]}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:T.displayName}),d.jsx(Ee,{children:d.jsx(Wt,{tone:T.role==="admin"?"accent":"neutral",children:T.role})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(T.createdAt)}),d.jsx(Ee,{style:{whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-0.5 justify-end",children:[d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h({id:T.id,username:T.username,displayName:T.displayName,role:T.role}),title:"Edit",children:d.jsx(Bd,{className:"h-3.5 w-3.5"})}),d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>N(T.id),disabled:k.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:d.jsx(lu,{className:"h-3.5 w-3.5"})})]})})]},T.id)})})]})]}),d.jsx(pL,{target:m,onClose:()=>h(null),onSaved:()=>{h(null),e.invalidateQueries({queryKey:["members"]})}})]})}function pL({target:e,onClose:t,onSaved:n}){const[i,l]=S.useState(""),[o,u]=S.useState("member"),[f,m]=S.useState(null);S.useEffect(()=>{e&&(l(e.displayName),u(e.role),m(null))},[e]);const h=yt({mutationFn:async()=>{if(!e)throw new Error("No target");const b={};return i.trim()&&i!==e.displayName&&(b.displayName=i.trim()),o!==e.role&&(b.role=o),Object.keys(b).length===0?e:lL(e.id,b)},onSuccess:()=>{m(null),n()},onError:b=>{m(b instanceof Error?b.message:String(b))}});function y(b){b.preventDefault(),h.mutate()}const g=e!==null;return d.jsx(On,{open:g,onOpenChange:b=>b?void 0:t(),children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Edit Member"})}),e&&d.jsxs("form",{onSubmit:y,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{children:"Username"}),d.jsx(vt,{value:e.username,disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"edit-member-display",children:"Display Name"}),d.jsx(vt,{id:"edit-member-display",value:i,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"edit-member-role",children:"Role"}),d.jsx("select",{id:"edit-member-role",value:o,onChange:b=>u(b.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:Bj.map(b=>d.jsx("option",{value:b,children:b},b))}),d.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Demoting the last admin is blocked — every org needs at least one admin to manage members."})]}),f&&d.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),d.jsx(ve,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function gL(){return De.get("/admin/system/config")}function yL(e){return De.patch("/admin/system/config",e)}const Pj=[{key:yi.INBOX_TIMEOUT_SECONDS,label:"Inbox timeout",description:"How long an agent waits for inbound messages before sleeping.",unit:"seconds"},{key:yi.MAX_RETRY_COUNT,label:"Max retry count",description:"Delivery attempts before a message is marked failed.",unit:null},{key:yi.POLLING_INTERVAL_SECONDS,label:"Polling interval",description:"Runtime heartbeat cadence for offline detection.",unit:"seconds"},{key:yi.PRESENCE_CLEANUP_SECONDS,label:"Presence cleanup",description:"When presence rows expire after disconnect.",unit:"seconds"}],w1=Pj.map(e=>e.key);function vL(){const e=Wn(),{data:t,isLoading:n}=qe({queryKey:["system-config"],queryFn:gL}),[i,l]=S.useState({}),[o,u]=S.useState(!1);S.useEffect(()=>{if(!t)return;const y={};for(const g of w1){const b=t[g]??gd[g]??"";y[g]=String(b)}l(y)},[t]);const f=yt({mutationFn:()=>{const y={};for(const[g,b]of Object.entries(i)){const x=b.trim();if(x==="")y[g]=gd[g]??0;else{const k=Number(x);y[g]=Number.isNaN(k)?x:k}}return yL(y)},onSuccess:()=>{e.invalidateQueries({queryKey:["system-config"]}),u(!0),setTimeout(()=>u(!1),2e3)}});function m(){const y={};for(const g of w1)y[g]=String(gd[g]??"");l(y)}function h(y){y.preventDefault(),f.mutate()}return d.jsx("form",{onSubmit:h,children:d.jsxs(Fr,{children:[d.jsxs(Lj,{children:[d.jsx(Uj,{children:"System configuration"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),d.jsx(ve,{type:"button",variant:"ghost",size:"xs",onClick:m,disabled:f.isPending,children:"Reset defaults"}),d.jsxs(ve,{type:"submit",size:"xs",disabled:f.isPending,children:[d.jsx(Id,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save changes"]})]})]}),d.jsxs("div",{style:{padding:"var(--sp-1) var(--sp-4) var(--sp-3_5)"},children:[n?d.jsx("div",{className:"py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):Pj.map(y=>d.jsx(bL,{field:y,value:i[y.key]??"",onChange:g=>l({...i,[y.key]:g})},y.key)),f.error instanceof Error&&d.jsx("div",{className:"text-body pt-2",style:{color:"var(--state-error)"},children:f.error.message})]})]})})}function bL({field:e,value:t,onChange:n}){const i=String(gd[e.key]??"—");return d.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) 0",borderTop:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e.label}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.key})]}),d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:e.description}),d.jsxs(Eu,{style:{marginTop:4,display:"block"},children:["default"," ",d.jsx("span",{className:"mono normal-case tracking-normal",style:{color:"var(--fg-3)"},children:i})]})]}),d.jsxs("div",{style:{position:"relative"},children:[d.jsx("input",{value:t,onChange:l=>n(l.target.value),className:"w-full outline-none mono text-body",style:{padding:`var(--sp-1_25) ${e.unit?56:10}px var(--sp-1_25) var(--sp-2_5)`,background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}}),e.unit&&d.jsx("span",{className:"mono text-caption",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)",pointerEvents:"none"},children:e.unit})]})]})}const k1=[{key:"members",label:"Members"},{key:"all-agents",label:"All agents"},{key:"settings",label:"Org settings"}];function xL(){const{role:e}=ja(),t=yr(),n=qr();if(e===null)return d.jsx("div",{className:"text-body",style:{padding:20,color:"var(--fg-3)"},children:"Loading…"});if(e!=="admin")return d.jsx(hg,{to:"/settings",replace:!0});const i=t.hash.replace("#",""),l=k1.some(u=>u.key===i)?i:"members",o=u=>{n({hash:u},{replace:!0})};return d.jsxs("div",{className:"-m-6",children:[d.jsx(Jd,{title:"Admin",subtitle:"Organization-wide controls"}),d.jsx(Dj,{children:k1.map(u=>d.jsx(Mj,{active:l===u.key,onClick:()=>o(u.key),children:u.label},u.key))}),d.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[l==="members"&&d.jsx(mL,{}),l==="all-agents"&&d.jsx(oL,{}),l==="settings"&&d.jsx(vL,{})]})]})}function $j(){return De.get("/admin/adapter-mappings")}function SL(e){return De.post("/admin/adapter-mappings",e)}function wL(e){return De.delete(`/admin/adapter-mappings/${e}`)}function Fj(){return De.get("/admin/adapters/status")}function qj(){return De.get("/admin/adapters")}function kL(e){return De.post("/admin/adapters",e)}function jL(e,t){return De.patch(`/admin/adapters/${e}`,t)}function EL(e){return De.delete(`/admin/adapters/${e}`)}function CL(e){return De.get(`/admin/agents/${e}/config`)}function _L(e,t){return De.patch(`/admin/agents/${e}/config`,t)}function NL(e,t){return De.post(`/admin/agents/${e}/config/dry-run`,{payload:t})}function AL(e){return De.get(`/admin/agents/${e}/client-status`)}function TL({className:e,style:t,...n}){return d.jsx("div",{className:Te("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function RL({onClick:e,children:t}){return d.jsx("button",{type:"button",onClick:e,className:"bg-transparent border-0 p-0 cursor-pointer",style:{color:"var(--fg-3)",textDecoration:"none",font:"inherit"},onMouseEnter:n=>{n.currentTarget.style.color="var(--fg)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--fg-3)"},children:t})}function zL(){return d.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function OL({children:e,mono:t}){return d.jsx("span",{className:Te("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}function hl({state:e,size:t=8,className:n}){const i={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?d.jsxs("span",{className:Te("shrink-0",n),style:i,role:"img","aria-label":"working",children:[d.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),d.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?d.jsx("span",{className:Te("shrink-0",n),style:{...i,border:"var(--hairline-bold) dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:d.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?d.jsx("span",{className:Te("shrink-0",n),style:{...i,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?d.jsx("span",{className:Te("shrink-0",n),style:{...i,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):d.jsx("span",{className:Te("shrink-0",n),style:{...i,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function DL(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function ml({state:e,className:t}){const n=e!==null&&DL(e)?e:"offline",i=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return d.jsxs("span",{className:Te("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:i},children:[d.jsx(hl,{state:n,size:7}),n]})}function rd({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:4},children:[d.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),d.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:1},children:t})]})}function ML(e){const{agent:t}=e,[n,i]=S.useState(!1),l=t.displayName||t.name||t.uuid;return d.jsxs("section",{style:{background:"color-mix(in oklch, var(--state-error) 6%, var(--bg-raised))",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[d.jsx(QT,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),d.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),d.jsxs("div",{children:[t.status==="active"?d.jsx($m,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:d.jsx(ve,{variant:"outline",size:"xs",onClick:e.onSuspend,disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):d.jsx($m,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:d.jsx(ve,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),d.jsx($m,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:d.jsxs(ve,{variant:"destructive",size:"xs",onClick:()=>i(!0),disabled:e.deletePending,children:[d.jsx(lu,{className:"h-3 w-3"}),"Delete"]})})]}),d.jsx(LL,{open:n,onOpenChange:i,expected:l,onDelete:()=>{i(!1),e.onDelete()},deleting:e.deletePending})]})}function $m(e){return d.jsxs("div",{className:"flex items-start justify-between gap-4 text-body",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid color-mix(in oklch, var(--state-error) 14%, transparent)"},children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),d.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),d.jsx("div",{children:e.action})]})}function LL({open:e,onOpenChange:t,expected:n,onDelete:i,deleting:l}){const[o,u]=S.useState("");function f(m){m.preventDefault(),o===n&&i()}return d.jsx(On,{open:e,onOpenChange:m=>{t(m),m||u("")},children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsxs(Mn,{children:['Delete "',n,'"?']})}),d.jsxs("form",{onSubmit:f,className:"space-y-4",children:[d.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",d.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),d.jsx(vt,{value:o,onChange:m=>u(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),d.jsx(ve,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}const UL={unchanged:{label:"",tone:""},added:{label:"new",tone:"bg-success-soft text-success"},modified:{label:"changed",tone:"bg-warn-soft text-warn"},deleted:{label:"will be removed on save",tone:"bg-error-soft text-error"}};function $g({status:e,onEdit:t,onDelete:n,onUndo:i,children:l,disabled:o}){const u=UL[e],f=e==="deleted";return d.jsxs("div",{className:Te("flex items-center gap-2 rounded border px-3 py-2 text-body",f?"bg-error-soft border-error text-error line-through decoration-error":"bg-card"),children:[d.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),u.label&&d.jsx("span",{className:Te("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",u.tone),children:u.label}),!o&&(f?d.jsxs(ve,{size:"sm",variant:"ghost",onClick:i,children:[d.jsx(KT,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):d.jsx(IL,{onEdit:t,onDelete:n}))]})}function IL({onEdit:e,onDelete:t}){return d.jsxs("div",{className:"flex gap-1",children:[d.jsx(ve,{size:"sm",variant:"ghost",onClick:e,title:"Edit",children:"Edit"}),d.jsxs(ve,{size:"sm",variant:"ghost",onClick:t,title:"Delete",children:[d.jsx(pT,{className:"sr-only h-3.5 w-3.5","aria-hidden":!0}),"Delete"]})]})}function BL(e){const[t,n]=S.useState(null),i=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["Environment Variables (",i,")"]}),!e.disabled&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(gl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-body text-muted-foreground",children:"No environment variables."}):e.items.map(l=>d.jsxs($g,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[d.jsx("span",{className:"font-mono font-medium",children:l.value.key}),d.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:l.value.sensitive?"••••••":l.value.value||d.jsx("em",{children:"(empty)"})}),l.value.sensitive&&d.jsx(wT,{className:"h-3 w-3 text-muted-foreground"})]},l.key))}),t&&d.jsx(PL,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenKeys:e.otherKeys(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function PL({open:e,onOpenChange:t,initial:n,forbiddenKeys:i,onSubmit:l}){const[o,u]=S.useState((n==null?void 0:n.key)??""),[f,m]=S.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,y]=S.useState((n==null?void 0:n.sensitive)??!1),[g,b]=S.useState(null);S.useEffect(()=>{e&&(u((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),y((n==null?void 0:n.sensitive)??!1),b(null))},[e,n]);function x(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){b("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(i.has(o)){b(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=$p),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:n?"Edit environment variable":"Add environment variable"})}),d.jsxs("form",{onSubmit:x,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"env-key",children:"Key"}),d.jsx(vt,{id:"env-key",value:o,onChange:k=>u(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&d.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"env-value",children:"Value"}),d.jsx(vt,{id:"env-value",type:h?"password":"text",autoComplete:"new-password",value:f,onChange:k=>m(k.target.value),placeholder:n!=null&&n.sensitive?"Leave empty to keep existing value":h?"new secret":"value",className:"font-mono"})]}),d.jsxs("label",{className:"flex items-center gap-2 text-body",children:[d.jsx("input",{type:"checkbox",checked:h,onChange:k=>y(k.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),g&&d.jsx("p",{className:"text-body text-destructive",children:g}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(ve,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function $L(e){const[t,n]=S.useState(null),i=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["Git Repositories (",i,")"]}),!e.disabled&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(gl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??_d(l.value.url);return d.jsxs($g,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[d.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&d.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),d.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&d.jsx(FL,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenPaths:e.otherPaths(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function FL({open:e,onOpenChange:t,initial:n,forbiddenPaths:i,onSubmit:l}){const[o,u]=S.useState((n==null?void 0:n.url)??""),[f,m]=S.useState((n==null?void 0:n.ref)??""),[h,y]=S.useState((n==null?void 0:n.localPath)??""),[g,b]=S.useState(null);S.useEffect(()=>{e&&(u((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),y((n==null?void 0:n.localPath)??""),b(null))},[e,n]);function x(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const E=h.trim()||_d(j);if(E&&i.has(E)){b(`Another repo already occupies local path "${E}".`);return}const N={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(N)}return d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:n?"Edit Git repository":"Add Git repository"})}),d.jsxs("form",{onSubmit:x,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"git-url",children:"URL"}),d.jsx(vt,{id:"git-url",value:o,onChange:k=>u(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),d.jsx(vt,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"git-path",children:"Local path (optional)"}),d.jsx(vt,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:_d(o)||"repo-name",className:"font-mono"}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&d.jsx("p",{className:"text-body text-destructive",children:g}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(ve,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function qL({agent:e,onSave:t}){const[n,i]=S.useState(!1),l=Ei(),o=Pg(),u=e.metadata,f=u==null?void 0:u.tree,m=typeof(f==null?void 0:f.role)=="string"?f.role:null,h=Array.isArray(f==null?void 0:f.domains)?(f==null?void 0:f.domains).filter(b=>typeof b=="string"):[],y=e.managerId?o(e.managerId):null,g=e.delegateMention?l(e.delegateMention):null;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("h2",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:"Profile"}),e.status==="active"&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>i(!0),children:[d.jsx(Bd,{className:"h-3 w-3"})," Edit"]})]}),d.jsxs("div",{className:"px-4 py-3 text-body space-y-1",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-mono",children:e.name??e.uuid}),d.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),d.jsx("span",{children:e.displayName??d.jsx("span",{className:"text-muted-foreground italic",children:"no display name"})}),g&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),d.jsxs("span",{className:"text-muted-foreground",children:["delegate ",d.jsx("span",{className:"font-mono",children:g})]})]})]}),d.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[d.jsxs("span",{children:["owner ",d.jsx("span",{className:"text-foreground",children:y??"—"})]}),m&&d.jsxs("span",{children:["role ",d.jsx("span",{className:"text-foreground",children:m})]}),d.jsxs("span",{children:["type ",d.jsx(Wt,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),d.jsxs("span",{children:["visibility"," ",d.jsx(Wt,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&d.jsxs("span",{children:["domains"," ",d.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>d.jsx(Wt,{tone:"outline",children:b},b))})]})]})]}),d.jsx(HL,{agent:e,open:n,onOpenChange:i,onSave:t})]})}function HL({agent:e,open:t,onOpenChange:n,onSave:i}){var I;const{memberId:l,role:o}=ja(),[u,f]=S.useState(e.displayName??""),[m,h]=S.useState(e.delegateMention??""),[y,g]=S.useState(e.visibility),[b,x]=S.useState(!1),[k,j]=S.useState(null);S.useEffect(()=>{t&&(f(e.displayName??""),h(e.delegateMention??""),g(e.visibility),j(null))},[t,e]);const E=e.type==="human",N=o==="admin"||e.managerId===l,T=qe({queryKey:["agents-for-delegate"],queryFn:async()=>(await Cg({limit:100})).items.filter(z=>z.type==="personal_assistant"&&z.status==="active"),enabled:t&&E});async function O(B){B.preventDefault(),j(null),x(!0);try{const z={displayName:u||null,delegateMention:m||null};y!==e.visibility&&(z.visibility=y),await i(z),n(!1)}catch(z){j(z instanceof Error?z.message:String(z))}finally{x(!1)}}return d.jsx(On,{open:t,onOpenChange:n,children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Edit Identity"})}),d.jsxs("form",{onSubmit:O,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{children:"Name (mention)"}),d.jsx(vt,{value:e.name??"",disabled:!0,className:"font-mono"}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Name is permanent after creation."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"id-display",children:"Display Name"}),d.jsx(vt,{id:"id-display",value:u,onChange:B=>f(B.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"id-visibility",children:"Visibility"}),d.jsxs("select",{id:"id-visibility",value:y,onChange:B=>g(B.target.value),disabled:!N,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[d.jsx("option",{value:v1.PRIVATE,children:"Private — only the manager"}),d.jsx("option",{value:v1.ORGANIZATION,children:"Organization — all members"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:N?"Private agents are only visible to their manager; organization agents appear in every member's list.":"Only the manager or an admin can change this agent's visibility."})]}),E&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"id-delegate",children:"Delegate Mention"}),d.jsxs("select",{id:"id-delegate",value:m,onChange:B=>h(B.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"",children:"None"}),(I=T.data)==null?void 0:I.map(B=>d.jsx("option",{value:B.uuid,children:B.displayName?`${B.displayName} (${B.name??B.uuid})`:B.name??B.uuid},B.uuid))]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&d.jsx("p",{className:"text-body text-destructive",children:k}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),d.jsx(ve,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function ZL(e){const[t,n]=S.useState(null),i=e.items.filter(l=>l.status!=="deleted").length;return d.jsxs("section",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:["MCP Servers (",i,")"]}),!e.disabled&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[d.jsx(gl,{className:"h-3 w-3"})," Add"]})]}),d.jsx("div",{className:"px-4 py-3 space-y-2",children:e.items.length===0?d.jsx("p",{className:"text-body text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(l=>d.jsxs($g,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[d.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),d.jsx("span",{className:"font-medium font-mono",children:l.value.name}),d.jsx("span",{className:"text-caption text-muted-foreground truncate",children:VL(l.value)})]},l.key))}),t&&d.jsx(QL,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenNames:e.otherNames(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function VL(e){var t;if(e.transport==="stdio"){const n=(t=e.args)!=null&&t.length?` ${e.args.join(" ")}`:"";return`${e.command}${n}`}return e.url}function QL({open:e,onOpenChange:t,initial:n,forbiddenNames:i,onSubmit:l}){const[o,u]=S.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=S.useState((n==null?void 0:n.name)??""),[h,y]=S.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,b]=S.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[x,k]=S.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=S.useState(null);S.useEffect(()=>{e&&(u((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),y((n==null?void 0:n.transport)==="stdio"?n.command:""),b((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),k(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),E(null))},[e,n]);function N(T){if(T.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){E("Name must start alphanumeric and contain only a-z0-9_-.");return}if(i.has(f.toLowerCase())){E(`Another MCP server is already named "${f}".`);return}let O;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const I=g.trim().split(/\s+/).filter(B=>B.length>0);O={name:f,transport:"stdio",command:h.trim(),...I.length?{args:I}:{}}}else{const I=x.trim();try{new URL(I)}catch{E("URL is not valid.");return}O={name:f,transport:o,url:I}}l(O)}return d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:n?"Edit MCP server":"Add MCP server"})}),d.jsxs("form",{onSubmit:N,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"mcp-transport",children:"Transport"}),d.jsxs("select",{id:"mcp-transport",value:o,onChange:T=>u(T.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),d.jsx("option",{value:"http",children:"http"}),d.jsx("option",{value:"sse",children:"sse"})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"mcp-name",children:"Name"}),d.jsx(vt,{id:"mcp-name",value:f,onChange:T=>m(T.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"mcp-command",children:"Command"}),d.jsx(vt,{id:"mcp-command",value:h,onChange:T=>y(T.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),d.jsx(vt,{id:"mcp-args",value:g,onChange:T=>b(T.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"mcp-url",children:"URL"}),d.jsx(vt,{id:"mcp-url",value:x,onChange:T=>k(T.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&d.jsx("p",{className:"text-body text-destructive",children:j}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),d.jsx(ve,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const j1=[{value:"claude-opus-4-6",label:"claude-opus-4-6",hint:"most capable"},{value:"claude-sonnet-4-6",label:"claude-sonnet-4-6",hint:"default"},{value:"claude-haiku-4-5",label:"claude-haiku-4-5",hint:"fastest"}];function GL({value:e,baseline:t,onChange:n,onRevert:i,disabled:l}){const o=e!==t,u=!j1.some(f=>f.value===e)&&e!=="";return d.jsxs("section",{style:{background:"var(--bg-raised)",border:`var(--hairline) solid ${o?"color-mix(in oklch, var(--state-blocked) 40%, transparent)":"var(--border)"}`,borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["Model",o&&d.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:3,background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))"},children:"changed"})]}),o&&d.jsx(ve,{size:"xs",variant:"ghost",onClick:i,disabled:l,children:"Revert"})]}),d.jsxs("div",{className:"px-4 py-3 space-y-2",children:[d.jsxs("select",{value:e,onChange:f=>n(f.target.value),disabled:l,className:"flex h-9 w-full max-w-md rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:[d.jsx("option",{value:"",children:"(agent default)"}),j1.map(f=>d.jsxs("option",{value:f.value,children:[f.label,f.hint?` — ${f.hint}`:""]},f.value)),u&&d.jsxs("option",{value:e,children:[e," — custom"]})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"Choose which Claude model powers this agent. Applies to new sessions immediately; active sessions switch on their next message."})]})]})}function KL(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const YL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JL={};function E1(e,t){return(JL.jsx?XL:YL).test(e)}const WL=/[ \t\n\f\r]/g;function eU(e){return typeof e=="object"?e.type==="text"?C1(e.value):!1:C1(e)}function C1(e){return e.replace(WL,"")===""}class Cu{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Cu.prototype.normal={};Cu.prototype.property={};Cu.prototype.space=void 0;function Hj(e,t){const n={},i={};for(const l of e)Object.assign(n,l.property),Object.assign(i,l.normal);return new Cu(n,i,t)}function qp(e){return e.toLowerCase()}class In{constructor(t,n){this.attribute=n,this.property=t}}In.prototype.attribute="";In.prototype.booleanish=!1;In.prototype.boolean=!1;In.prototype.commaOrSpaceSeparated=!1;In.prototype.commaSeparated=!1;In.prototype.defined=!1;In.prototype.mustUseProperty=!1;In.prototype.number=!1;In.prototype.overloadedBoolean=!1;In.prototype.property="";In.prototype.spaceSeparated=!1;In.prototype.space=void 0;let tU=0;const Pe=xl(),$t=xl(),Hp=xl(),he=xl(),xt=xl(),xs=xl(),Gn=xl();function xl(){return 2**++tU}const Zp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Pe,booleanish:$t,commaOrSpaceSeparated:Gn,commaSeparated:xs,number:he,overloadedBoolean:Hp,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),Fm=Object.keys(Zp);class Fg extends In{constructor(t,n,i,l){let o=-1;if(super(t,n),_1(this,"space",l),typeof i=="number")for(;++o<Fm.length;){const u=Fm[o];_1(this,Fm[o],(i&Zp[u])===Zp[u])}}}Fg.prototype.defined=!0;function _1(e,t,n){n&&(e[t]=n)}function qs(e){const t={},n={};for(const[i,l]of Object.entries(e.properties)){const o=new Fg(i,e.transform(e.attributes||{},i),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,n[qp(i)]=i,n[qp(o.attribute)]=i}return new Cu(t,n,e.space)}const Zj=qs({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:xt,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:he,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:xt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:$t,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Vj(e,t){return t in e?e[t]:t}function Qj(e,t){return Vj(e,t.toLowerCase())}const nU=qs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xs,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:Pe,allowPaymentRequest:Pe,allowUserMedia:Pe,alt:null,as:null,async:Pe,autoCapitalize:null,autoComplete:xt,autoFocus:Pe,autoPlay:Pe,blocking:xt,capture:null,charSet:null,checked:Pe,cite:null,className:xt,cols:he,colSpan:null,content:null,contentEditable:$t,controls:Pe,controlsList:xt,coords:he|xs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Pe,defer:Pe,dir:null,dirName:null,disabled:Pe,download:Hp,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Pe,formTarget:null,headers:xt,height:he,hidden:Hp,high:he,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inert:Pe,inputMode:null,integrity:null,is:null,isMap:Pe,itemId:null,itemProp:xt,itemRef:xt,itemScope:Pe,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Pe,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Pe,muted:Pe,name:null,nonce:null,noModule:Pe,noValidate:Pe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Pe,optimum:he,pattern:null,ping:xt,placeholder:null,playsInline:Pe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Pe,referrerPolicy:null,rel:xt,required:Pe,reversed:Pe,rows:he,rowSpan:he,sandbox:xt,scope:null,scoped:Pe,seamless:Pe,selected:Pe,shadowRootClonable:Pe,shadowRootDelegatesFocus:Pe,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Pe,useMap:null,value:$t,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Pe,declare:Pe,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Pe,noHref:Pe,noShade:Pe,noWrap:Pe,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Pe,disableRemotePlayback:Pe,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:Qj}),rU=qs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Gn,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:xt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Pe,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xs,g2:xs,glyphName:xs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:Gn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gn,rev:Gn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gn,requiredFeatures:Gn,requiredFonts:Gn,requiredFormats:Gn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:Gn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gn,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Vj}),Gj=qs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Kj=qs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qj}),Yj=qs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),aU={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},iU=/[A-Z]/g,N1=/-[a-z]/g,lU=/^data[-\w.:]+$/i;function sU(e,t){const n=qp(t);let i=t,l=In;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&lU.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(N1,uU);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!N1.test(o)){let u=o.replace(iU,oU);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=Fg}return new l(i,t)}function oU(e){return"-"+e.toLowerCase()}function uU(e){return e.charAt(1).toUpperCase()}const cU=Hj([Zj,nU,Gj,Kj,Yj],"html"),qg=Hj([Zj,rU,Gj,Kj,Yj],"svg");function dU(e){return e.join(" ").trim()}var cs={},qm,A1;function fU(){if(A1)return qm;A1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
333
|
+
`,h="/",y="*",g="",b="comment",x="declaration";function k(E,N){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];N=N||{};var T=1,O=1;function I(de){var W=de.match(t);W&&(T+=W.length);var P=de.lastIndexOf(m);O=~P?de.length-P:O+de.length}function B(){var de={line:T,column:O};return function(W){return W.position=new z(de),ee(),W}}function z(de){this.start=de,this.end={line:T,column:O},this.source=N.source}z.prototype.content=E;function F(de){var W=new Error(N.source+":"+T+":"+O+": "+de);if(W.reason=de,W.filename=N.source,W.line=T,W.column=O,W.source=E,!N.silent)throw W}function Z(de){var W=de.exec(E);if(W){var P=W[0];return I(P),E=E.slice(P.length),W}}function ee(){Z(n)}function q(de){var W;for(de=de||[];W=ae();)W!==!1&&de.push(W);return de}function ae(){var de=B();if(!(h!=E.charAt(0)||y!=E.charAt(1))){for(var W=2;g!=E.charAt(W)&&(y!=E.charAt(W)||h!=E.charAt(W+1));)++W;if(W+=2,g===E.charAt(W-1))return F("End of comment missing");var P=E.slice(2,W-2);return O+=2,I(P),E=E.slice(W),O+=2,de({type:b,comment:P})}}function re(){var de=B(),W=Z(i);if(W){if(ae(),!Z(l))return F("property missing ':'");var P=Z(o),V=de({type:x,property:j(W[0].replace(e,g)),value:P?j(P[0].replace(e,g)):g});return Z(u),V}}function pe(){var de=[];q(de);for(var W;W=re();)W!==!1&&(de.push(W),q(de));return de}return ee(),pe()}function j(E){return E?E.replace(f,g):g}return qm=k,qm}var T1;function hU(){if(T1)return cs;T1=1;var e=cs&&cs.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(cs,"__esModule",{value:!0}),cs.default=n;const t=e(fU());function n(i,l){let o=null;if(!i||typeof i!="string")return o;const u=(0,t.default)(i),f=typeof l=="function";return u.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:y}=m;f?l(h,y,m):y&&(o=o||{},o[h]=y)}),o}return cs}var Zo={},R1;function mU(){if(R1)return Zo;R1=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},u=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},m=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(l,f):h=h.replace(i,f),h.replace(t,u))};return Zo.camelCase=m,Zo}var Vo,z1;function pU(){if(z1)return Vo;z1=1;var e=Vo&&Vo.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(hU()),n=mU();function i(l,o){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(u[(0,n.camelCase)(f,o)]=m)}),u}return i.default=i,Vo=i,Vo}var gU=pU();const yU=Od(gU),Xj=Jj("end"),Hg=Jj("start");function Jj(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function vU(e){const t=Hg(e),n=Xj(e);if(t&&n)return{start:t,end:n}}function eu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?O1(e.position):"start"in e||"end"in e?O1(e):"line"in e||"column"in e?Vp(e):""}function Vp(e){return D1(e&&e.line)+":"+D1(e&&e.column)}function O1(e){return Vp(e&&e.start)+"-"+Vp(e&&e.end)}function D1(e){return e&&typeof e=="number"?e:1}class pn extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let l="",o={},u=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(u=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof i=="string"){const m=i.indexOf(":");m===-1?o.ruleId=i:(o.source=i.slice(0,m),o.ruleId=i.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=eu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}pn.prototype.file="";pn.prototype.name="";pn.prototype.reason="";pn.prototype.message="";pn.prototype.stack="";pn.prototype.column=void 0;pn.prototype.line=void 0;pn.prototype.ancestors=void 0;pn.prototype.cause=void 0;pn.prototype.fatal=void 0;pn.prototype.place=void 0;pn.prototype.ruleId=void 0;pn.prototype.source=void 0;const Zg={}.hasOwnProperty,bU=new Map,xU=/[A-Z]/g,SU=new Set(["table","tbody","thead","tfoot","tr"]),wU=new Set(["td","th"]),Wj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kU(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=RU(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=TU(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qg:cU,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=eE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function eE(e,t,n){if(t.type==="element")return jU(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return EU(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return _U(e,t,n);if(t.type==="mdxjsEsm")return CU(e,t);if(t.type==="root")return NU(e,t,n);if(t.type==="text")return AU(e,t)}function jU(e,t,n){const i=e.schema;let l=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(l=qg,e.schema=l),e.ancestors.push(t);const o=nE(e,t.tagName,!1),u=zU(e,t);let f=Qg(e,t);return SU.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!eU(m):!0})),tE(e,u,o,t),Vg(u,f),e.ancestors.pop(),e.schema=i,e.create(t,o,u,n)}function EU(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}fu(e,t.position)}function CU(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fu(e,t.position)}function _U(e,t,n){const i=e.schema;let l=i;t.name==="svg"&&i.space==="html"&&(l=qg,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:nE(e,t.name,!0),u=OU(e,t),f=Qg(e,t);return tE(e,u,o,t),Vg(u,f),e.ancestors.pop(),e.schema=i,e.create(t,o,u,n)}function NU(e,t,n){const i={};return Vg(i,Qg(e,t)),e.create(t,e.Fragment,i,n)}function AU(e,t){return t.value}function tE(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Vg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function TU(e,t,n){return i;function i(l,o,u,f){const h=Array.isArray(u.children)?n:t;return f?h(o,u,f):h(o,u)}}function RU(e,t){return n;function n(i,l,o,u){const f=Array.isArray(o.children),m=Hg(i);return t(l,o,u,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function zU(e,t){const n={};let i,l;for(l in t.properties)if(l!=="children"&&Zg.call(t.properties,l)){const o=DU(e,l,t.properties[l]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&wU.has(t.tagName)?i=f:n[u]=f}}if(i){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function OU(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const o=i.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else fu(e,t.position);else{const l=i.name;let o;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else fu(e,t.position);else o=i.value===null?!0:i.value;n[l]=o}return n}function Qg(e,t){const n=[];let i=-1;const l=e.passKeys?new Map:bU;for(;++i<t.children.length;){const o=t.children[i];let u;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;u=m+"-"+h,l.set(m,h+1)}}const f=eE(e,o,u);f!==void 0&&n.push(f)}return n}function DU(e,t,n){const i=sU(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?KL(n):dU(n)),i.property==="style"){let l=typeof n=="object"?n:MU(e,String(n));return e.stylePropertyNameCase==="css"&&(l=LU(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&i.space?aU[i.property]||i.property:i.attribute,n]}}function MU(e,t){try{return yU(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,l=new pn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=Wj+"#cannot-parse-style-attribute",l}}function nE(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,u;for(;++o<l.length;){const f=E1(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}i=u}else i=E1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const l=i.value;return Zg.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(i);fu(e)}function fu(e,t){const n=new pn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Wj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function LU(e){const t={};let n;for(n in e)Zg.call(e,n)&&(t[UU(n)]=e[n]);return t}function UU(e){let t=e.replace(xU,IU);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function IU(e){return"-"+e.toLowerCase()}const Hm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},BU={};function Gg(e,t){const n=BU,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return rE(e,i,l)}function rE(e,t,n){if(PU(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return M1(e.children,t,n)}return Array.isArray(e)?M1(e,t,n):""}function M1(e,t,n){const i=[];let l=-1;for(;++l<e.length;)i[l]=rE(e[l],t,n);return i.join("")}function PU(e){return!!(e&&typeof e=="object")}const L1=document.createElement("i");function Kg(e){const t="&"+e+";";L1.innerHTML=t;const n=L1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Xn(e,t,n,i){const l=e.length;let o=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,i.length<1e4)u=Array.from(i),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<i.length;)u=i.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function mr(e,t){return e.length>0?(Xn(e,e.length,0,t),e):t}const U1={}.hasOwnProperty;function aE(e){const t={};let n=-1;for(;++n<e.length;)$U(t,e[n]);return t}function $U(e,t){let n;for(n in t){const l=(U1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){U1.call(l,u)||(l[u]=[]);const f=o[u];FU(l[u],Array.isArray(f)?f:f?[f]:[])}}}function FU(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Xn(e,0,0,i)}function iE(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Cr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xn=Ni(/[A-Za-z]/),mn=Ni(/[\dA-Za-z]/),qU=Ni(/[#-'*+\--9=?A-Z^-~]/);function Ad(e){return e!==null&&(e<32||e===127)}const Qp=Ni(/\d/),HU=Ni(/[\dA-Fa-f]/),ZU=Ni(/[!-/:-@[-`{-~]/);function Re(e){return e!==null&&e<-2}function bt(e){return e!==null&&(e<0||e===32)}function Qe(e){return e===-2||e===-1||e===32}const Wd=Ni(new RegExp("\\p{P}|\\p{S}","u")),pl=Ni(/\s/);function Ni(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Hs(e){const t=[];let n=-1,i=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&mn(e.charCodeAt(n+1))&&mn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),l=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(i,n),encodeURIComponent(u)),i=n+l+1,u=""),l&&(n+=l,l=0)}return t.join("")+e.slice(i)}function et(e,t,n,i){const l=i?i-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(m){return Qe(m)?(e.enter(n),f(m)):t(m)}function f(m){return Qe(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const VU={tokenize:QU};function QU(e){const t=e.attempt(this.parser.constructs.contentInitial,i,l);let n;return t;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),et(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Re(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const GU={tokenize:KU},I1={tokenize:YU};function KU(e){const t=this,n=[];let i=0,l,o,u;return f;function f(O){if(i<n.length){const I=n[i];return t.containerState=I[1],e.attempt(I[0].continuation,m,h)(O)}return h(O)}function m(O){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&T();const I=t.events.length;let B=I,z;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){z=t.events[B][1].end;break}N(i);let F=I;for(;F<t.events.length;)t.events[F][1].end={...z},F++;return Xn(t.events,B+1,0,t.events.slice(I)),t.events.length=F,h(O)}return f(O)}function h(O){if(i===n.length){if(!l)return b(O);if(l.currentConstruct&&l.currentConstruct.concrete)return k(O);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(I1,y,g)(O)}function y(O){return l&&T(),N(i),b(O)}function g(O){return t.parser.lazy[t.now().line]=i!==n.length,u=t.now().offset,k(O)}function b(O){return t.containerState={},e.attempt(I1,x,k)(O)}function x(O){return i++,n.push([t.currentConstruct,t.containerState]),b(O)}function k(O){if(O===null){l&&T(),N(0),e.consume(O);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(O)}function j(O){if(O===null){E(e.exit("chunkFlow"),!0),N(0),e.consume(O);return}return Re(O)?(e.consume(O),E(e.exit("chunkFlow")),i=0,t.interrupt=void 0,f):(e.consume(O),j)}function E(O,I){const B=t.sliceStream(O);if(I&&B.push(null),O.previous=o,o&&(o.next=O),o=O,l.defineSkip(O.start),l.write(B),t.parser.lazy[O.start.line]){let z=l.events.length;for(;z--;)if(l.events[z][1].start.offset<u&&(!l.events[z][1].end||l.events[z][1].end.offset>u))return;const F=t.events.length;let Z=F,ee,q;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(ee){q=t.events[Z][1].end;break}ee=!0}for(N(i),z=F;z<t.events.length;)t.events[z][1].end={...q},z++;Xn(t.events,Z+1,0,t.events.slice(F)),t.events.length=z}}function N(O){let I=n.length;for(;I-- >O;){const B=n[I];t.containerState=B[1],B[0].exit.call(t,e)}n.length=O}function T(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function YU(e,t,n){return et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ls(e){if(e===null||bt(e)||pl(e))return 1;if(Wd(e))return 2}function ef(e,t,n){const i=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!i.includes(o)&&(t=o(t,n),i.push(o))}return t}const Gp={name:"attention",resolveAll:XU,tokenize:JU};function XU(e,t){let n=-1,i,l,o,u,f,m,h,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[i][1].end},b={...e[n][1].start};B1(g,-m),B1(b,m),u={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[i][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:m>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[i][1].end={...u.start},e[n][1].start={...f.end},h=[],e[i][1].end.offset-e[i][1].start.offset&&(h=mr(h,[["enter",e[i][1],t],["exit",e[i][1],t]])),h=mr(h,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",o,t]]),h=mr(h,ef(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),h=mr(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(y=2,h=mr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,Xn(e,i-1,n-i+3,h),n=i+h.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function JU(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,l=Ls(i);let o;return u;function u(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),y=Ls(m),g=!y||y===2&&l||n.includes(m),b=!l||l===2&&y||n.includes(i);return h._open=!!(o===42?g:g&&(l||!b)),h._close=!!(o===42?b:b&&(y||!g)),t(m)}}function B1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const WU={name:"autolink",tokenize:eI};function eI(e,t,n){let i=0;return l;function l(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(x){return xn(x)?(e.consume(x),u):x===64?n(x):h(x)}function u(x){return x===43||x===45||x===46||mn(x)?(i=1,f(x)):h(x)}function f(x){return x===58?(e.consume(x),i=0,m):(x===43||x===45||x===46||mn(x))&&i++<32?(e.consume(x),f):(i=0,h(x))}function m(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||Ad(x)?n(x):(e.consume(x),m)}function h(x){return x===64?(e.consume(x),y):qU(x)?(e.consume(x),h):n(x)}function y(x){return mn(x)?g(x):n(x)}function g(x){return x===46?(e.consume(x),i=0,y):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):b(x)}function b(x){if((x===45||mn(x))&&i++<63){const k=x===45?b:g;return e.consume(x),k}return n(x)}}const _u={partial:!0,tokenize:tI};function tI(e,t,n){return i;function i(o){return Qe(o)?et(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Re(o)?t(o):n(o)}}const lE={continuation:{tokenize:rI},exit:aI,name:"blockQuote",tokenize:nI};function nI(e,t,n){const i=this;return l;function l(u){if(u===62){const f=i.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return Qe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function rI(e,t,n){const i=this;return l;function l(u){return Qe(u)?et(e,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(lE,t,n)(u)}}function aI(e){e.exit("blockQuote")}const sE={name:"characterEscape",tokenize:iI};function iI(e,t,n){return i;function i(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return ZU(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const oE={name:"characterReference",tokenize:lI};function lI(e,t,n){const i=this;let l=0,o,u;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,u=mn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=HU,y):(e.enter("characterReferenceValue"),o=7,u=Qp,y(g))}function y(g){if(g===59&&l){const b=e.exit("characterReferenceValue");return u===mn&&!Kg(i.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&l++<o?(e.consume(g),y):n(g)}}const P1={partial:!0,tokenize:oI},$1={concrete:!0,name:"codeFenced",tokenize:sI};function sI(e,t,n){const i=this,l={partial:!0,tokenize:B};let o=0,u=0,f;return m;function m(z){return h(z)}function h(z){const F=i.events[i.events.length-1];return o=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,f=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(z)}function y(z){return z===f?(u++,e.consume(z),y):u<3?n(z):(e.exit("codeFencedFenceSequence"),Qe(z)?et(e,g,"whitespace")(z):g(z))}function g(z){return z===null||Re(z)?(e.exit("codeFencedFence"),i.interrupt?t(z):e.check(P1,j,I)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(z))}function b(z){return z===null||Re(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(z)):Qe(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,x,"whitespace")(z)):z===96&&z===f?n(z):(e.consume(z),b)}function x(z){return z===null||Re(z)?g(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(z))}function k(z){return z===null||Re(z)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(z)):z===96&&z===f?n(z):(e.consume(z),k)}function j(z){return e.attempt(l,I,E)(z)}function E(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),N}function N(z){return o>0&&Qe(z)?et(e,T,"linePrefix",o+1)(z):T(z)}function T(z){return z===null||Re(z)?e.check(P1,j,I)(z):(e.enter("codeFlowValue"),O(z))}function O(z){return z===null||Re(z)?(e.exit("codeFlowValue"),T(z)):(e.consume(z),O)}function I(z){return e.exit("codeFenced"),t(z)}function B(z,F,Z){let ee=0;return q;function q(W){return z.enter("lineEnding"),z.consume(W),z.exit("lineEnding"),ae}function ae(W){return z.enter("codeFencedFence"),Qe(W)?et(z,re,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):re(W)}function re(W){return W===f?(z.enter("codeFencedFenceSequence"),pe(W)):Z(W)}function pe(W){return W===f?(ee++,z.consume(W),pe):ee>=u?(z.exit("codeFencedFenceSequence"),Qe(W)?et(z,de,"whitespace")(W):de(W)):Z(W)}function de(W){return W===null||Re(W)?(z.exit("codeFencedFence"),F(W)):Z(W)}}}function oI(e,t,n){const i=this;return l;function l(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return i.parser.lazy[i.now().line]?n(u):t(u)}}const Zm={name:"codeIndented",tokenize:cI},uI={partial:!0,tokenize:dI};function cI(e,t,n){const i=this;return l;function l(h){return e.enter("codeIndented"),et(e,o,"linePrefix",5)(h)}function o(h){const y=i.events[i.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?u(h):n(h)}function u(h){return h===null?m(h):Re(h)?e.attempt(uI,u,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Re(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function dI(e,t,n){const i=this;return l;function l(u){return i.parser.lazy[i.now().line]?n(u):Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):et(e,o,"linePrefix",5)(u)}function o(u){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Re(u)?l(u):n(u)}}const fI={name:"codeText",previous:mI,resolve:hI,tokenize:pI};function hI(e){let t=e.length-4,n=3,i,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)l===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(l=i):(i===t||e[i][1].type==="lineEnding")&&(e[l][1].type="codeTextData",i!==l+2&&(e[l][1].end=e[i-1][1].end,e.splice(l+2,i-l-2),t-=i-l-2,i=l+2),l=void 0);return e}function mI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function pI(e,t,n){let i=0,l,o;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),i++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(o=e.enter("codeTextSequence"),l=0,y(g)):Re(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Re(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),l++,y):l===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class gI{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return i&&Qo(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Qo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Qo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Qo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Qo(this.left,n.reverse())}}}function Qo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function uE(e){const t={};let n=-1,i,l,o,u,f,m,h;const y=new gI(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(i=y.get(n),n&&i[1].type==="chunkFlow"&&y.get(n-1)[1].type==="listItemPrefix"&&(m=i[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,yI(y,n)),n=t[n],h=!0);else if(i[1]._container){for(o=n,l=void 0;o--;)if(u=y.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(i[1].end={...y.get(l)[1].start},f=y.slice(l,n),f.unshift(i),y.splice(l,n-l+1,f))}}return Xn(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function yI(e,t){const n=e.get(t)[1],i=e.get(t)[2];let l=t-1;const o=[];let u=n._tokenizer;u||(u=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,m=[],h={};let y,g,b=-1,x=n,k=0,j=0;const E=[j];for(;x;){for(;e.get(++l)[1]!==x;);o.push(l),x._tokenizer||(y=i.sliceStream(x),x.next||y.push(null),g&&u.defineSkip(x.start),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=x,x=x.next}for(x=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(j=b+1,E.push(j),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(u.events=[],x?(x._tokenizer=void 0,x.previous=void 0):E.pop(),b=E.length;b--;){const N=f.slice(E[b],E[b+1]),T=o.pop();m.push([T,T+N.length-1]),e.splice(T,2,N)}for(m.reverse(),b=-1;++b<m.length;)h[k+m[b][0]]=k+m[b][1],k+=m[b][1]-m[b][0]-1;return h}const vI={resolve:xI,tokenize:SI},bI={partial:!0,tokenize:wI};function xI(e){return uE(e),e}function SI(e,t){let n;return i;function i(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):Re(f)?e.check(bI,u,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function wI(e,t,n){const i=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),et(e,o,"linePrefix")}function o(u){if(u===null||Re(u))return n(u);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(i.parser.constructs.flow,n,t)(u)}}function cE(e,t,n,i,l,o,u,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(N){return N===60?(e.enter(i),e.enter(l),e.enter(o),e.consume(N),e.exit(o),b):N===null||N===32||N===41||Ad(N)?n(N):(e.enter(i),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(N))}function b(N){return N===62?(e.enter(o),e.consume(N),e.exit(o),e.exit(l),e.exit(i),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===62?(e.exit("chunkString"),e.exit(f),b(N)):N===null||N===60||Re(N)?n(N):(e.consume(N),N===92?k:x)}function k(N){return N===60||N===62||N===92?(e.consume(N),x):x(N)}function j(N){return!y&&(N===null||N===41||bt(N))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(i),t(N)):y<h&&N===40?(e.consume(N),y++,j):N===41?(e.consume(N),y--,j):N===null||N===32||N===40||Ad(N)?n(N):(e.consume(N),N===92?E:j)}function E(N){return N===40||N===41||N===92?(e.consume(N),j):j(N)}}function dE(e,t,n,i,l,o){const u=this;let f=0,m;return h;function h(x){return e.enter(i),e.enter(l),e.consume(x),e.exit(l),e.enter(o),y}function y(x){return f>999||x===null||x===91||x===93&&!m||x===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(x):x===93?(e.exit(o),e.enter(l),e.consume(x),e.exit(l),e.exit(i),t):Re(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||x===91||x===93||Re(x)||f++>999?(e.exit("chunkString"),y(x)):(e.consume(x),m||(m=!Qe(x)),x===92?b:g)}function b(x){return x===91||x===92||x===93?(e.consume(x),f++,g):g(x)}}function fE(e,t,n,i,l,o){let u;return f;function f(b){return b===34||b===39||b===40?(e.enter(i),e.enter(l),e.consume(b),e.exit(l),u=b===40?41:b,m):n(b)}function m(b){return b===u?(e.enter(l),e.consume(b),e.exit(l),e.exit(i),t):(e.enter(o),h(b))}function h(b){return b===u?(e.exit(o),m(u)):b===null?n(b):Re(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),et(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===u||b===null||Re(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?g:y)}function g(b){return b===u||b===92?(e.consume(b),y):y(b)}}function tu(e,t){let n;return i;function i(l){return Re(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,i):Qe(l)?et(e,i,n?"linePrefix":"lineSuffix")(l):t(l)}}const kI={name:"definition",tokenize:EI},jI={partial:!0,tokenize:CI};function EI(e,t,n){const i=this;let l;return o;function o(x){return e.enter("definition"),u(x)}function u(x){return dE.call(i,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function f(x){return l=Cr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),m):n(x)}function m(x){return bt(x)?tu(e,h)(x):h(x)}function h(x){return cE(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function y(x){return e.attempt(jI,g,g)(x)}function g(x){return Qe(x)?et(e,b,"whitespace")(x):b(x)}function b(x){return x===null||Re(x)?(e.exit("definition"),i.parser.defined.push(l),t(x)):n(x)}}function CI(e,t,n){return i;function i(f){return bt(f)?tu(e,l)(f):n(f)}function l(f){return fE(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Qe(f)?et(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Re(f)?t(f):n(f)}}const _I={name:"hardBreakEscape",tokenize:NI};function NI(e,t,n){return i;function i(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Re(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const AI={name:"headingAtx",resolve:TI,tokenize:RI};function TI(e,t){let n=e.length-2,i=3,l,o;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(l={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},o={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Xn(e,i,n-i+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function RI(e,t,n){let i=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&i++<6?(e.consume(y),u):y===null||bt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||Re(y)?(e.exit("atxHeading"),t(y)):Qe(y)?et(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function m(y){return y===35?(e.consume(y),m):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||bt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const zI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],F1=["pre","script","style","textarea"],OI={concrete:!0,name:"htmlFlow",resolveTo:LI,tokenize:UI},DI={partial:!0,tokenize:BI},MI={partial:!0,tokenize:II};function LI(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function UI(e,t,n){const i=this;let l,o,u,f,m;return h;function h(C){return y(C)}function y(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),g}function g(C){return C===33?(e.consume(C),b):C===47?(e.consume(C),o=!0,j):C===63?(e.consume(C),l=3,i.interrupt?t:R):xn(C)?(e.consume(C),u=String.fromCharCode(C),E):n(C)}function b(C){return C===45?(e.consume(C),l=2,x):C===91?(e.consume(C),l=5,f=0,k):xn(C)?(e.consume(C),l=4,i.interrupt?t:R):n(C)}function x(C){return C===45?(e.consume(C),i.interrupt?t:R):n(C)}function k(C){const J="CDATA[";return C===J.charCodeAt(f++)?(e.consume(C),f===J.length?i.interrupt?t:re:k):n(C)}function j(C){return xn(C)?(e.consume(C),u=String.fromCharCode(C),E):n(C)}function E(C){if(C===null||C===47||C===62||bt(C)){const J=C===47,Y=u.toLowerCase();return!J&&!o&&F1.includes(Y)?(l=1,i.interrupt?t(C):re(C)):zI.includes(u.toLowerCase())?(l=6,J?(e.consume(C),N):i.interrupt?t(C):re(C)):(l=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(C):o?T(C):O(C))}return C===45||mn(C)?(e.consume(C),u+=String.fromCharCode(C),E):n(C)}function N(C){return C===62?(e.consume(C),i.interrupt?t:re):n(C)}function T(C){return Qe(C)?(e.consume(C),T):q(C)}function O(C){return C===47?(e.consume(C),q):C===58||C===95||xn(C)?(e.consume(C),I):Qe(C)?(e.consume(C),O):q(C)}function I(C){return C===45||C===46||C===58||C===95||mn(C)?(e.consume(C),I):B(C)}function B(C){return C===61?(e.consume(C),z):Qe(C)?(e.consume(C),B):O(C)}function z(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),m=C,F):Qe(C)?(e.consume(C),z):Z(C)}function F(C){return C===m?(e.consume(C),m=null,ee):C===null||Re(C)?n(C):(e.consume(C),F)}function Z(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||bt(C)?B(C):(e.consume(C),Z)}function ee(C){return C===47||C===62||Qe(C)?O(C):n(C)}function q(C){return C===62?(e.consume(C),ae):n(C)}function ae(C){return C===null||Re(C)?re(C):Qe(C)?(e.consume(C),ae):n(C)}function re(C){return C===45&&l===2?(e.consume(C),P):C===60&&l===1?(e.consume(C),V):C===62&&l===4?(e.consume(C),L):C===63&&l===3?(e.consume(C),R):C===93&&l===5?(e.consume(C),be):Re(C)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(DI,A,pe)(C)):C===null||Re(C)?(e.exit("htmlFlowData"),pe(C)):(e.consume(C),re)}function pe(C){return e.check(MI,de,A)(C)}function de(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),W}function W(C){return C===null||Re(C)?pe(C):(e.enter("htmlFlowData"),re(C))}function P(C){return C===45?(e.consume(C),R):re(C)}function V(C){return C===47?(e.consume(C),u="",ce):re(C)}function ce(C){if(C===62){const J=u.toLowerCase();return F1.includes(J)?(e.consume(C),L):re(C)}return xn(C)&&u.length<8?(e.consume(C),u+=String.fromCharCode(C),ce):re(C)}function be(C){return C===93?(e.consume(C),R):re(C)}function R(C){return C===62?(e.consume(C),L):C===45&&l===2?(e.consume(C),R):re(C)}function L(C){return C===null||Re(C)?(e.exit("htmlFlowData"),A(C)):(e.consume(C),L)}function A(C){return e.exit("htmlFlow"),t(C)}}function II(e,t,n){const i=this;return l;function l(u){return Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):n(u)}function o(u){return i.parser.lazy[i.now().line]?n(u):t(u)}}function BI(e,t,n){return i;function i(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(_u,t,n)}}const PI={name:"htmlText",tokenize:$I};function $I(e,t,n){const i=this;let l,o,u;return f;function f(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),m}function m(R){return R===33?(e.consume(R),h):R===47?(e.consume(R),B):R===63?(e.consume(R),O):xn(R)?(e.consume(R),Z):n(R)}function h(R){return R===45?(e.consume(R),y):R===91?(e.consume(R),o=0,k):xn(R)?(e.consume(R),T):n(R)}function y(R){return R===45?(e.consume(R),x):n(R)}function g(R){return R===null?n(R):R===45?(e.consume(R),b):Re(R)?(u=g,V(R)):(e.consume(R),g)}function b(R){return R===45?(e.consume(R),x):g(R)}function x(R){return R===62?P(R):R===45?b(R):g(R)}function k(R){const L="CDATA[";return R===L.charCodeAt(o++)?(e.consume(R),o===L.length?j:k):n(R)}function j(R){return R===null?n(R):R===93?(e.consume(R),E):Re(R)?(u=j,V(R)):(e.consume(R),j)}function E(R){return R===93?(e.consume(R),N):j(R)}function N(R){return R===62?P(R):R===93?(e.consume(R),N):j(R)}function T(R){return R===null||R===62?P(R):Re(R)?(u=T,V(R)):(e.consume(R),T)}function O(R){return R===null?n(R):R===63?(e.consume(R),I):Re(R)?(u=O,V(R)):(e.consume(R),O)}function I(R){return R===62?P(R):O(R)}function B(R){return xn(R)?(e.consume(R),z):n(R)}function z(R){return R===45||mn(R)?(e.consume(R),z):F(R)}function F(R){return Re(R)?(u=F,V(R)):Qe(R)?(e.consume(R),F):P(R)}function Z(R){return R===45||mn(R)?(e.consume(R),Z):R===47||R===62||bt(R)?ee(R):n(R)}function ee(R){return R===47?(e.consume(R),P):R===58||R===95||xn(R)?(e.consume(R),q):Re(R)?(u=ee,V(R)):Qe(R)?(e.consume(R),ee):P(R)}function q(R){return R===45||R===46||R===58||R===95||mn(R)?(e.consume(R),q):ae(R)}function ae(R){return R===61?(e.consume(R),re):Re(R)?(u=ae,V(R)):Qe(R)?(e.consume(R),ae):ee(R)}function re(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),l=R,pe):Re(R)?(u=re,V(R)):Qe(R)?(e.consume(R),re):(e.consume(R),de)}function pe(R){return R===l?(e.consume(R),l=void 0,W):R===null?n(R):Re(R)?(u=pe,V(R)):(e.consume(R),pe)}function de(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||bt(R)?ee(R):(e.consume(R),de)}function W(R){return R===47||R===62||bt(R)?ee(R):n(R)}function P(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function V(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),ce}function ce(R){return Qe(R)?et(e,be,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):be(R)}function be(R){return e.enter("htmlTextData"),u(R)}}const Yg={name:"labelEnd",resolveAll:ZI,resolveTo:VI,tokenize:QI},FI={tokenize:GI},qI={tokenize:KI},HI={tokenize:YI};function ZI(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const l=i.type==="labelImage"?4:2;i.type="data",t+=l}}return e.length!==n.length&&Xn(e,0,e.length,n),e}function VI(e,t){let n=e.length,i=0,l,o,u,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){i=2;break}}else l.type==="labelEnd"&&(u=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},y={type:"labelText",start:{...e[o+i+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=mr(f,e.slice(o+1,o+i+3)),f=mr(f,[["enter",y,t]]),f=mr(f,ef(t.parser.constructs.insideSpan.null,e.slice(o+i+4,u-3),t)),f=mr(f,[["exit",y,t],e[u-2],e[u-1],["exit",h,t]]),f=mr(f,e.slice(u+1)),f=mr(f,[["exit",m,t]]),Xn(e,o,e.length,f),e}function QI(e,t,n){const i=this;let l=i.events.length,o,u;for(;l--;)if((i.events[l][1].type==="labelImage"||i.events[l][1].type==="labelLink")&&!i.events[l][1]._balanced){o=i.events[l][1];break}return f;function f(b){return o?o._inactive?g(b):(u=i.parser.defined.includes(Cr(i.sliceSerialize({start:o.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),m):n(b)}function m(b){return b===40?e.attempt(FI,y,u?y:g)(b):b===91?e.attempt(qI,y,u?h:g)(b):u?y(b):g(b)}function h(b){return e.attempt(HI,y,g)(b)}function y(b){return t(b)}function g(b){return o._balanced=!0,n(b)}}function GI(e,t,n){return i;function i(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return bt(g)?tu(e,o)(g):o(g)}function o(g){return g===41?y(g):cE(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return bt(g)?tu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?fE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return bt(g)?tu(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function KI(e,t,n){const i=this;return l;function l(f){return dE.call(i,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return i.parser.defined.includes(Cr(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function YI(e,t,n){return i;function i(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const XI={name:"labelStartImage",resolveAll:Yg.resolveAll,tokenize:JI};function JI(e,t,n){const i=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(f):t(f)}}const WI={name:"labelStartLink",resolveAll:Yg.resolveAll,tokenize:e9};function e9(e,t,n){const i=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):t(u)}}const Vm={name:"lineEnding",tokenize:t9};function t9(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),et(e,t,"linePrefix")}}const yd={name:"thematicBreak",tokenize:n9};function n9(e,t,n){let i=0,l;return o;function o(h){return e.enter("thematicBreak"),u(h)}function u(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):i>=3&&(h===null||Re(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),i++,m):(e.exit("thematicBreakSequence"),Qe(h)?et(e,f,"whitespace")(h):f(h))}}const An={continuation:{tokenize:l9},exit:o9,name:"list",tokenize:i9},r9={partial:!0,tokenize:u9},a9={partial:!0,tokenize:s9};function i9(e,t,n){const i=this,l=i.events[i.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,u=0;return f;function f(x){const k=i.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!i.containerState.marker||x===i.containerState.marker:Qp(x)){if(i.containerState.type||(i.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(yd,n,h)(x):h(x);if(!i.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(x)}return n(x)}function m(x){return Qp(x)&&++u<10?(e.consume(x),m):(!i.interrupt||u<2)&&(i.containerState.marker?x===i.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),h(x)):n(x)}function h(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||x,e.check(_u,i.interrupt?n:y,e.attempt(r9,b,g))}function y(x){return i.containerState.initialBlankLine=!0,o++,b(x)}function g(x){return Qe(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),b):n(x)}function b(x){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function l9(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(_u,l,o);function l(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,et(e,t,"listItemIndent",i.containerState.size+1)(f)}function o(f){return i.containerState.furtherBlankLines||!Qe(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,u(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(a9,t,u)(f))}function u(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,et(e,e.attempt(An,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function s9(e,t,n){const i=this;return et(e,l,"listItemIndent",i.containerState.size+1);function l(o){const u=i.events[i.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===i.containerState.size?t(o):n(o)}}function o9(e){e.exit(this.containerState.type)}function u9(e,t,n){const i=this;return et(e,l,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const u=i.events[i.events.length-1];return!Qe(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const q1={name:"setextUnderline",resolveTo:c9,tokenize:d9};function c9(e,t){let n=e.length,i,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const u={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",u,t]),e.splice(o+1,0,["exit",e[i][1],t]),e[i][1].end={...e[o][1].end}):e[i][1]=u,e.push(["exit",u,t]),e}function d9(e,t,n){const i=this;let l;return o;function o(h){let y=i.events.length,g;for(;y--;)if(i.events[y][1].type!=="lineEnding"&&i.events[y][1].type!=="linePrefix"&&i.events[y][1].type!=="content"){g=i.events[y][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||g)?(e.enter("setextHeadingLine"),l=h,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Qe(h)?et(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||Re(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const f9={tokenize:h9};function h9(e){const t=this,n=e.attempt(_u,i,e.attempt(this.parser.constructs.flowInitial,l,et(e,e.attempt(this.parser.constructs.flow,l,e.attempt(vI,l)),"linePrefix")));return n;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const m9={resolveAll:mE()},p9=hE("string"),g9=hE("text");function hE(e){return{resolveAll:mE(e==="text"?y9:void 0),tokenize:t};function t(n){const i=this,l=this.parser.constructs[e],o=n.attempt(l,u,f);return u;function u(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),m}function m(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),m)}function h(y){if(y===null)return!0;const g=l[y];let b=-1;if(g)for(;++b<g.length;){const x=g[b];if(!x.previous||x.previous.call(i,i.previous))return!0}return!1}}}function mE(e){return t;function t(n,i){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,i):n}}function y9(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],l=t.sliceStream(i);let o=l.length,u=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:i.start._bufferIndex+u,_index:i.start._index+o,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const v9={42:An,43:An,45:An,48:An,49:An,50:An,51:An,52:An,53:An,54:An,55:An,56:An,57:An,62:lE},b9={91:kI},x9={[-2]:Zm,[-1]:Zm,32:Zm},S9={35:AI,42:yd,45:[q1,yd],60:OI,61:q1,95:yd,96:$1,126:$1},w9={38:oE,92:sE},k9={[-5]:Vm,[-4]:Vm,[-3]:Vm,33:XI,38:oE,42:Gp,60:[WU,PI],91:WI,92:[_I,sE],93:Yg,95:Gp,96:fI},j9={null:[Gp,m9]},E9={null:[42,95]},C9={null:[]},_9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:E9,contentInitial:b9,disable:C9,document:v9,flow:S9,flowInitial:x9,insideSpan:j9,string:w9,text:k9},Symbol.toStringTag,{value:"Module"}));function N9(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let u=[],f=[];const m={attempt:F(B),check:F(z),consume:T,enter:O,exit:I,interrupt:F(z,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(ae){return u=mr(u,ae),E(),u[u.length-1]!==null?[]:(Z(t,0),h.events=ef(o,h.events,h),h.events)}function b(ae,re){return T9(x(ae),re)}function x(ae){return A9(u,ae)}function k(){const{_bufferIndex:ae,_index:re,line:pe,column:de,offset:W}=i;return{_bufferIndex:ae,_index:re,line:pe,column:de,offset:W}}function j(ae){l[ae.line]=ae.column,q()}function E(){let ae;for(;i._index<u.length;){const re=u[i._index];if(typeof re=="string")for(ae=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===ae&&i._bufferIndex<re.length;)N(re.charCodeAt(i._bufferIndex));else N(re)}}function N(ae){y=y(ae)}function T(ae){Re(ae)?(i.line++,i.column=1,i.offset+=ae===-3?2:1,q()):ae!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===u[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=ae}function O(ae,re){const pe=re||{};return pe.type=ae,pe.start=k(),h.events.push(["enter",pe,h]),f.push(pe),pe}function I(ae){const re=f.pop();return re.end=k(),h.events.push(["exit",re,h]),re}function B(ae,re){Z(ae,re.from)}function z(ae,re){re.restore()}function F(ae,re){return pe;function pe(de,W,P){let V,ce,be,R;return Array.isArray(de)?A(de):"tokenize"in de?A([de]):L(de);function L(ue){return ge;function ge(Me){const xe=Me!==null&&ue[Me],_t=Me!==null&&ue.null,en=[...Array.isArray(xe)?xe:xe?[xe]:[],...Array.isArray(_t)?_t:_t?[_t]:[]];return A(en)(Me)}}function A(ue){return V=ue,ce=0,ue.length===0?P:C(ue[ce])}function C(ue){return ge;function ge(Me){return R=ee(),be=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?Y():ue.tokenize.call(re?Object.assign(Object.create(h),re):h,m,J,Y)(Me)}}function J(ue){return ae(be,R),W}function Y(ue){return R.restore(),++ce<V.length?C(V[ce]):P}}}function Z(ae,re){ae.resolveAll&&!o.includes(ae)&&o.push(ae),ae.resolve&&Xn(h.events,re,h.events.length-re,ae.resolve(h.events.slice(re),h)),ae.resolveTo&&(h.events=ae.resolveTo(h.events,h))}function ee(){const ae=k(),re=h.previous,pe=h.currentConstruct,de=h.events.length,W=Array.from(f);return{from:de,restore:P};function P(){i=ae,h.previous=re,h.currentConstruct=pe,h.events.length=de,f=W,q()}}function q(){i.line in l&&i.column<2&&(i.column=l[i.line],i.offset+=l[i.line]-1)}}function A9(e,t){const n=t.start._index,i=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let u;if(n===l)u=[e[n].slice(i,o)];else{if(u=e.slice(n,l),i>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(i):u.shift()}o>0&&u.push(e[l].slice(0,o))}return u}function T9(e,t){let n=-1;const i=[];let l;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
334
|
+
`;break}case-3:{u=`\r
|
|
335
|
+
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(o)}l=o===-2,i.push(u)}return i.join("")}function R9(e){const i={constructs:aE([_9,...(e||{}).extensions||[]]),content:l(VU),defined:[],document:l(GU),flow:l(f9),lazy:{},string:l(p9),text:l(g9)};return i;function l(o){return u;function u(f){return N9(i,o,f)}}}function z9(e){for(;!uE(e););return e}const H1=/[\0\t\n\r]/g;function O9(){let e=1,t="",n=!0,i;return l;function l(o,u,f){const m=[];let h,y,g,b,x;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(H1.lastIndex=g,h=H1.exec(o),b=h&&h.index!==void 0?h.index:o.length,x=o.charCodeAt(b),!h){t=o.slice(g);break}if(x===10&&g===b&&i)m.push(-3),i=void 0;else switch(i&&(m.push(-5),i=void 0),g<b&&(m.push(o.slice(g,b)),e+=b-g),x){case 0:{m.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,m.push(-2);e++<y;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:i=!0,e=1}g=b+1}return f&&(i&&m.push(-5),t&&m.push(t),m.push(null)),m}}const D9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function M9(e){return e.replace(D9,L9)}function L9(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return iE(n.slice(o?2:1),o?16:10)}return Kg(n)||e}const pE={}.hasOwnProperty;function U9(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),I9(n)(z9(R9(n).document().write(O9()(e,t,!0))))}function I9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Zr),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:o(Na),blockQuote:o(_t),characterEscape:ee,characterReference:ee,codeFenced:o(en),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(en,u),codeText:o(Bn,u),codeTextData:ee,data:ee,codeFlowValue:ee,definition:o(tr),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(tn),hardBreakEscape:o(ft),hardBreakTrailing:o(ft),htmlFlow:o(Gt,u),htmlFlowData:ee,htmlText:o(Gt,u),htmlTextData:ee,image:o(br),label:u,link:o(Zr),listItem:o(Ai),listItemValue:b,listOrdered:o(Vr,g),listUnordered:o(Vr),paragraph:o(Ti),reference:C,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(Na),strong:o(Zs),thematicBreak:o(Vs)},exit:{atxHeading:m(),atxHeadingSequence:B,autolink:m(),autolinkEmail:xe,autolinkProtocol:Me,blockQuote:m(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:ue,characterReference:ge,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:x,codeFencedFenceMeta:k,codeFlowValue:q,codeIndented:m(N),codeText:m(W),codeTextData:q,data:q,definition:m(),definitionDestinationString:I,definitionLabelString:T,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(re),hardBreakTrailing:m(re),htmlFlow:m(pe),htmlFlowData:q,htmlText:m(de),htmlTextData:q,image:m(V),label:be,labelText:ce,lineEnding:ae,link:m(P),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:J,resourceDestinationString:R,resourceTitleString:L,resource:A,setextHeading:m(Z),setextHeadingLineSequence:F,setextHeadingText:z,strong:m(),thematicBreak:m()}};gE(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(ne){let me={type:"root",children:[]};const Oe={stack:[me],tokenStack:[],config:t,enter:f,exit:h,buffer:u,resume:y,data:n},$e=[];let nt=-1;for(;++nt<ne.length;)if(ne[nt][1].type==="listOrdered"||ne[nt][1].type==="listUnordered")if(ne[nt][0]==="enter")$e.push(nt);else{const cn=$e.pop();nt=l(ne,cn,nt)}for(nt=-1;++nt<ne.length;){const cn=t[ne[nt][0]];pE.call(cn,ne[nt][1].type)&&cn[ne[nt][1].type].call(Object.assign({sliceSerialize:ne[nt][2].sliceSerialize},Oe),ne[nt][1])}if(Oe.tokenStack.length>0){const cn=Oe.tokenStack[Oe.tokenStack.length-1];(cn[1]||Z1).call(Oe,void 0,cn[0])}for(me.position={start:ai(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ai(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)me=t.transforms[nt](me)||me;return me}function l(ne,me,Oe){let $e=me-1,nt=-1,cn=!1,xr,rn,Dt,dn;for(;++$e<=Oe;){const ut=ne[$e];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?nt++:nt--,dn=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(xr&&!dn&&!nt&&!Dt&&(Dt=$e),dn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:dn=void 0}if(!nt&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||nt===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(xr){let Nr=$e;for(rn=void 0;Nr--;){const Pn=ne[Nr];if(Pn[1].type==="lineEnding"||Pn[1].type==="lineEndingBlank"){if(Pn[0]==="exit")continue;rn&&(ne[rn][1].type="lineEndingBlank",cn=!0),Pn[1].type="lineEnding",rn=Nr}else if(!(Pn[1].type==="linePrefix"||Pn[1].type==="blockQuotePrefix"||Pn[1].type==="blockQuotePrefixWhitespace"||Pn[1].type==="blockQuoteMarker"||Pn[1].type==="listItemIndent"))break}Dt&&(!rn||Dt<rn)&&(xr._spread=!0),xr.end=Object.assign({},rn?ne[rn][1].start:ut[1].end),ne.splice(rn||$e,0,["exit",xr,ut[2]]),$e++,Oe++}if(ut[1].type==="listItemPrefix"){const Nr={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};xr=Nr,ne.splice($e,0,["enter",Nr,ut[2]]),$e++,Oe++,Dt=void 0,dn=!0}}}return ne[me][1]._spread=cn,Oe}function o(ne,me){return Oe;function Oe($e){f.call(this,ne($e),$e),me&&me.call(this,$e)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ne,me,Oe){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([me,Oe||void 0]),ne.position={start:ai(me.start),end:void 0}}function m(ne){return me;function me(Oe){ne&&ne.call(this,Oe),h.call(this,Oe)}}function h(ne,me){const Oe=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==ne.type&&(me?me.call(this,ne,$e[0]):($e[1]||Z1).call(this,ne,$e[0]));else throw new Error("Cannot close `"+ne.type+"` ("+eu({start:ne.start,end:ne.end})+"): it’s not open");Oe.position.end=ai(ne.end)}function y(){return Gg(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(ne){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.lang=ne}function k(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.meta=ne}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne.replace(/(\r?\n|\r)$/g,"")}function T(ne){const me=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=me,Oe.identifier=Cr(this.sliceSerialize(ne)).toLowerCase()}function O(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.title=ne}function I(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.url=ne}function B(ne){const me=this.stack[this.stack.length-1];if(!me.depth){const Oe=this.sliceSerialize(ne).length;me.depth=Oe}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function F(ne){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(ne){const Oe=this.stack[this.stack.length-1].children;let $e=Oe[Oe.length-1];(!$e||$e.type!=="text")&&($e=nn(),$e.position={start:ai(ne.start),end:void 0},Oe.push($e)),this.stack.push($e)}function q(ne){const me=this.stack.pop();me.value+=this.sliceSerialize(ne),me.position.end=ai(ne.end)}function ae(ne){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=me.children[me.children.length-1];Oe.position.end=ai(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(ee.call(this,ne),q.call(this,ne))}function re(){this.data.atHardBreak=!0}function pe(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function de(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function W(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function P(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=me,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function V(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=me,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function ce(ne){const me=this.sliceSerialize(ne),Oe=this.stack[this.stack.length-2];Oe.label=M9(me),Oe.identifier=Cr(me).toLowerCase()}function be(){const ne=this.stack[this.stack.length-1],me=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const $e=ne.children;Oe.children=$e}else Oe.alt=me}function R(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.url=ne}function L(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.title=ne}function A(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function J(ne){const me=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=me,Oe.identifier=Cr(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function Y(ne){this.data.characterReferenceType=ne.type}function ue(ne){const me=this.sliceSerialize(ne),Oe=this.data.characterReferenceType;let $e;Oe?($e=iE(me,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=Kg(me);const nt=this.stack[this.stack.length-1];nt.value+=$e}function ge(ne){const me=this.stack.pop();me.position.end=ai(ne.end)}function Me(ne){q.call(this,ne);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(ne)}function xe(ne){q.call(this,ne);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(ne)}function _t(){return{type:"blockquote",children:[]}}function en(){return{type:"code",lang:null,meta:null,value:""}}function Bn(){return{type:"inlineCode",value:""}}function tr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function tn(){return{type:"emphasis",children:[]}}function Na(){return{type:"heading",depth:0,children:[]}}function ft(){return{type:"break"}}function Gt(){return{type:"html",value:""}}function br(){return{type:"image",title:null,url:"",alt:null}}function Zr(){return{type:"link",title:null,url:"",children:[]}}function Vr(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function Ai(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function Ti(){return{type:"paragraph",children:[]}}function Zs(){return{type:"strong",children:[]}}function nn(){return{type:"text",value:""}}function Vs(){return{type:"thematicBreak"}}}function ai(e){return{line:e.line,column:e.column,offset:e.offset}}function gE(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?gE(e,i):B9(e,i)}}function B9(e,t){let n;for(n in t)if(pE.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function Z1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+eu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+eu({start:t.start,end:t.end})+") is still open")}function P9(e){const t=this;t.parser=n;function n(i){return U9(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function $9(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function F9(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
336
|
+
`}]}function q9(e,t){const n=t.value?t.value+`
|
|
337
|
+
`:"",i={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(i.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function H9(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Z9(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V9(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),l=Hs(i.toLowerCase()),o=e.footnoteOrder.indexOf(i);let u,f=e.footnoteCounts.get(i);f===void 0?(f=0,e.footnoteOrder.push(i),u=e.footnoteOrder.length):u=o+1,f+=1,e.footnoteCounts.set(i,f);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function Q9(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function G9(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yE(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const u=l[l.length-1];return u&&u.type==="text"?u.value+=i:l.push({type:"text",value:i}),l}function K9(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return yE(e,t);const l={src:Hs(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(l.title=i.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function Y9(e,t){const n={src:Hs(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function X9(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function J9(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return yE(e,t);const l={href:Hs(i.url||"")};i.title!==null&&i.title!==void 0&&(l.title=i.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function W9(e,t){const n={href:Hs(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function e8(e,t,n){const i=e.all(t),l=n?t8(n):vE(t),o={},u=[];if(typeof t.checked=="boolean"){const y=i[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},i.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<i.length;){const y=i[f];(l||f!==0||y.type!=="element"||y.tagName!=="p")&&u.push({type:"text",value:`
|
|
338
|
+
`}),y.type==="element"&&y.tagName==="p"&&!l?u.push(...y.children):u.push(y)}const m=i[i.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
|
|
339
|
+
`});const h={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,h),e.applyData(t,h)}function t8(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=vE(n[i])}return t}function vE(e){const t=e.spread;return t??e.children.length>1}function n8(e,t){const n={},i=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<i.length;){const u=i[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function r8(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function a8(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function i8(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function l8(e,t){const n=e.all(t),i=n.shift(),l=[];if(i){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],u),l.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Hg(t.children[1]),m=Xj(t.children[t.children.length-1]);f&&m&&(u.position={start:f,end:m}),l.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function s8(e,t,n){const i=n?n.children:void 0,o=(i?i.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],b={},x=u?u[m]:void 0;x&&(b.align=x);let k={type:"element",tagName:o,properties:b,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),h.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,y),e.applyData(t,y)}function o8(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const V1=9,Q1=32;function u8(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),l=0;const o=[];for(;i;)o.push(G1(t.slice(l,i.index),l>0,!0),i[0]),l=i.index+i[0].length,i=n.exec(t);return o.push(G1(t.slice(l),l>0,!1)),o.join("")}function G1(e,t,n){let i=0,l=e.length;if(t){let o=e.codePointAt(i);for(;o===V1||o===Q1;)i++,o=e.codePointAt(i)}if(n){let o=e.codePointAt(l-1);for(;o===V1||o===Q1;)l--,o=e.codePointAt(l-1)}return l>i?e.slice(i,l):""}function c8(e,t){const n={type:"text",value:u8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function d8(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const f8={blockquote:$9,break:F9,code:q9,delete:H9,emphasis:Z9,footnoteReference:V9,heading:Q9,html:G9,imageReference:K9,image:Y9,inlineCode:X9,linkReference:J9,link:W9,listItem:e8,list:n8,paragraph:r8,root:a8,strong:i8,table:l8,tableCell:o8,tableRow:s8,text:c8,thematicBreak:d8,toml:ad,yaml:ad,definition:ad,footnoteDefinition:ad};function ad(){}const bE=-1,tf=0,nu=1,Td=2,Xg=3,Jg=4,Wg=5,ey=6,xE=7,SE=8,K1=typeof self=="object"?self:globalThis,h8=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),i=l=>{if(e.has(l))return e.get(l);const[o,u]=t[l];switch(o){case tf:case bE:return n(u,l);case nu:{const f=n([],l);for(const m of u)f.push(i(m));return f}case Td:{const f=n({},l);for(const[m,h]of u)f[i(m)]=i(h);return f}case Xg:return n(new Date(u),l);case Jg:{const{source:f,flags:m}=u;return n(new RegExp(f,m),l)}case Wg:{const f=n(new Map,l);for(const[m,h]of u)f.set(i(m),i(h));return f}case ey:{const f=n(new Set,l);for(const m of u)f.add(i(m));return f}case xE:{const{name:f,message:m}=u;return n(new K1[f](m),l)}case SE:return n(BigInt(u),l);case"BigInt":return n(Object(BigInt(u)),l);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new K1[o](u),l)};return i},Y1=e=>h8(new Map,e)(0),ds="",{toString:m8}={},{keys:p8}=Object,Go=e=>{const t=typeof e;if(t!=="object"||!e)return[tf,t];const n=m8.call(e).slice(8,-1);switch(n){case"Array":return[nu,ds];case"Object":return[Td,ds];case"Date":return[Xg,ds];case"RegExp":return[Jg,ds];case"Map":return[Wg,ds];case"Set":return[ey,ds];case"DataView":return[nu,n]}return n.includes("Array")?[nu,n]:n.includes("Error")?[xE,n]:[Td,n]},id=([e,t])=>e===tf&&(t==="function"||t==="symbol"),g8=(e,t,n,i)=>{const l=(u,f)=>{const m=i.push(u)-1;return n.set(f,m),m},o=u=>{if(n.has(u))return n.get(u);let[f,m]=Go(u);switch(f){case tf:{let y=u;switch(m){case"bigint":f=SE,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([bE],u)}return l([f,y],u)}case nu:{if(m){let b=u;return m==="DataView"?b=new Uint8Array(u.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(u)),l([m,[...b]],u)}const y=[],g=l([f,y],u);for(const b of u)y.push(o(b));return g}case Td:{if(m)switch(m){case"BigInt":return l([m,u.toString()],u);case"Boolean":case"Number":case"String":return l([m,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const y=[],g=l([f,y],u);for(const b of p8(u))(e||!id(Go(u[b])))&&y.push([o(b),o(u[b])]);return g}case Xg:return l([f,u.toISOString()],u);case Jg:{const{source:y,flags:g}=u;return l([f,{source:y,flags:g}],u)}case Wg:{const y=[],g=l([f,y],u);for(const[b,x]of u)(e||!(id(Go(b))||id(Go(x))))&&y.push([o(b),o(x)]);return g}case ey:{const y=[],g=l([f,y],u);for(const b of u)(e||!id(Go(b)))&&y.push(o(b));return g}}const{message:h}=u;return l([f,{name:m,message:h}],u)};return o},X1=(e,{json:t,lossy:n}={})=>{const i=[];return g8(!(t||n),!!t,new Map,i)(e),i},Rd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Y1(X1(e,t)):structuredClone(e):(e,t)=>Y1(X1(e,t));function y8(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function v8(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function b8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||y8,i=e.options.footnoteBackLabel||v8,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const y=e.all(h),g=String(h.identifier).toUpperCase(),b=Hs(g.toLowerCase());let x=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++x<=j;){k.length>0&&k.push({type:"text",value:" "});let T=typeof n=="string"?n:n(m,x);typeof T=="string"&&(T={type:"text",value:T}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(m,x),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const E=y[y.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const T=E.children[E.children.length-1];T&&T.type==="text"?T.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else y.push(...k);const N={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(h,N),f.push(N)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Rd(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
|
|
340
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
341
|
+
`}]}}const nf=(function(e){if(e==null)return k8;if(typeof e=="function")return rf(e);if(typeof e=="object")return Array.isArray(e)?x8(e):S8(e);if(typeof e=="string")return w8(e);throw new Error("Expected function, string, or object as test")});function x8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=nf(e[n]);return rf(i);function i(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function S8(e){const t=e;return rf(n);function n(i){const l=i;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function w8(e){return rf(t);function t(n){return n&&n.type===e}}function rf(e){return t;function t(n,i,l){return!!(j8(n)&&e.call(this,n,typeof i=="number"?i:void 0,l||void 0))}}function k8(){return!0}function j8(e){return e!==null&&typeof e=="object"&&"type"in e}const wE=[],E8=!0,Kp=!1,C8="skip";function kE(e,t,n,i){let l;typeof t=="function"&&typeof n!="function"?(i=n,n=t):l=t;const o=nf(l),u=i?-1:1;f(e,void 0,[])();function f(m,h,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const x=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(x?"<"+x+">":""))+")"})}return b;function b(){let x=wE,k,j,E;if((!t||o(m,h,y[y.length-1]||void 0))&&(x=_8(n(m,y)),x[0]===Kp))return x;if("children"in m&&m.children){const N=m;if(N.children&&x[0]!==C8)for(j=(i?N.children.length:-1)+u,E=y.concat(N);j>-1&&j<N.children.length;){const T=N.children[j];if(k=f(T,j,E)(),k[0]===Kp)return k;j=typeof k[1]=="number"?k[1]:j+u}}return x}}}function _8(e){return Array.isArray(e)?e:typeof e=="number"?[E8,e]:e==null?wE:[e]}function ty(e,t,n,i){let l,o,u;typeof t=="function"&&typeof n!="function"?(o=void 0,u=t,l=n):(o=t,u=n,l=i),kE(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return u(m,g,y)}}const Yp={}.hasOwnProperty,N8={};function A8(e,t){const n=t||N8,i=new Map,l=new Map,o=new Map,u={...f8,...n.handlers},f={all:h,applyData:R8,definitionById:i,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:u,one:m,options:n,patch:T8,wrap:O8};return ty(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?i:l,b=String(y.identifier).toUpperCase();g.has(b)||g.set(b,y)}}),f;function m(y,g){const b=y.type,x=f.handlers[b];if(Yp.call(f.handlers,b)&&x)return x(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:j,...E}=y,N=Rd(E);return N.children=f.all(y),N}return Rd(y)}return(f.options.unknownHandler||z8)(f,y,g)}function h(y){const g=[];if("children"in y){const b=y.children;let x=-1;for(;++x<b.length;){const k=f.one(b[x],y);if(k){if(x&&b[x-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=J1(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=J1(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function T8(e,t){e.position&&(t.position=vU(e))}function R8(e,t){let n=t;if(e&&e.data){const i=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const u="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,Rd(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function z8(e,t){const n=t.data||{},i="value"in t&&!(Yp.call(n,"hProperties")||Yp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function O8(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
|
|
342
|
+
`});++i<e.length;)i&&n.push({type:"text",value:`
|
|
343
|
+
`}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
344
|
+
`}),n}function J1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function W1(e,t){const n=A8(e,t),i=n.one(e,void 0),l=b8(n),o=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
|
|
345
|
+
`},l),o}function D8(e,t){return e&&"run"in e?async function(n,i){const l=W1(n,{file:i,...t});await e.run(l,i)}:function(n,i){return W1(n,{file:i,...e||t})}}function eS(e){if(e)throw e}var Qm,tS;function M8(){if(tS)return Qm;tS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var y=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},u=function(h,y){n&&y.name==="__proto__"?n(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(i)return i(h,y).value}else return;return h[y]};return Qm=function m(){var h,y,g,b,x,k,j=arguments[0],E=1,N=arguments.length,T=!1;for(typeof j=="boolean"&&(T=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<N;++E)if(h=arguments[E],h!=null)for(y in h)g=f(j,y),b=f(h,y),j!==b&&(T&&b&&(o(b)||(x=l(b)))?(x?(x=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},u(j,{name:y,newValue:m(T,k,b)})):typeof b<"u"&&u(j,{name:y,newValue:b}));return j},Qm}var L8=M8();const Gm=Od(L8);function Xp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function U8(){const e=[],t={run:n,use:i};return t;function n(...l){let o=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...l);function f(m,...h){const y=e[++o];let g=-1;if(m){u(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?I8(y,f)(...h):u(null,...h)}}function i(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function I8(e,t){let n;return i;function i(...u){const f=e.length>u.length;let m;f&&u.push(l);try{m=e.apply(this,u)}catch(h){const y=h;if(f&&n)throw y;return l(y)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(u,...f){n||(n=!0,t(u,...f))}function o(u){l(null,u)}}const Mr={basename:B8,dirname:P8,extname:$8,join:F8,sep:"/"};function B8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Nu(e);let n=0,i=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else i<0&&(o=!0,i=l+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let u=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else u<0&&(o=!0,u=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(i=l):(f=-1,i=u));return n===i?i=u:i<0&&(i=e.length),e.slice(n,i)}function P8(e){if(Nu(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function $8(e){Nu(e);let t=e.length,n=-1,i=0,l=-1,o=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){i=t+1;break}continue}n<0&&(u=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===i+1?"":e.slice(l,n)}function F8(...e){let t=-1,n;for(;++t<e.length;)Nu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":q8(n)}function q8(e){Nu(e);const t=e.codePointAt(0)===47;let n=H8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function H8(e,t){let n="",i=0,l=-1,o=0,u=-1,f,m;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(l===u-1||o===1))if(l!==u-1&&o===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",i=0):(n=n.slice(0,m),i=n.length-1-n.lastIndexOf("/")),l=u,o=0;continue}}else if(n.length>0){n="",i=0,l=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(l+1,u):n=e.slice(l+1,u),i=u-l-1;l=u,o=0}else f===46&&o>-1?o++:o=-1}return n}function Nu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Z8={cwd:V8};function V8(){return"/"}function Jp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Q8(e){if(typeof e=="string")e=new URL(e);else if(!Jp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return G8(e)}function G8(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Km=["history","path","basename","stem","extname","dirname"];class jE{constructor(t){let n;t?Jp(t)?n={path:t}:typeof t=="string"||K8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Z8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Km.length;){const o=Km[i];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)Km.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Mr.basename(this.path):void 0}set basename(t){Xm(t,"basename"),Ym(t,"basename"),this.path=Mr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mr.dirname(this.path):void 0}set dirname(t){nS(this.basename,"dirname"),this.path=Mr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mr.extname(this.path):void 0}set extname(t){if(Ym(t,"extname"),nS(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Mr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Jp(t)&&(t=Q8(t)),Xm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mr.basename(this.path,this.extname):void 0}set stem(t){Xm(t,"stem"),Ym(t,"stem"),this.path=Mr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const l=this.message(t,n,i);throw l.fatal=!0,l}info(t,n,i){const l=this.message(t,n,i);return l.fatal=void 0,l}message(t,n,i){const l=new pn(t,n,i);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ym(e,t){if(e&&e.includes(Mr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mr.sep+"`")}function Xm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function nS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function K8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Y8=(function(e){const i=this.constructor.prototype,l=i[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,i),o}),X8={}.hasOwnProperty;class ny extends Y8{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=U8()}copy(){const t=new ny;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Gm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ep("data",this.frozen),this.namespace[t]=n,this):X8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ep("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const l=n.call(t,...i);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ld(t),i=this.parser||this.Parser;return Jm("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Jm("process",this.parser||this.Parser),Wm("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,u){const f=ld(t),m=i.parse(f);i.run(m,f,function(y,g,b){if(y||!g||!b)return h(y);const x=g,k=i.stringify(x,b);eB(k)?b.value=k:b.result=k,h(y,b)});function h(y,g){y||!g?u(y):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,i;return this.freeze(),Jm("processSync",this.parser||this.Parser),Wm("processSync",this.compiler||this.Compiler),this.process(t,l),aS("processSync","process",n),i;function l(o,u){n=!0,eS(o),i=u}}run(t,n,i){rS(t),this.freeze();const l=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?o(void 0,i):new Promise(o);function o(u,f){const m=ld(n);l.run(t,m,h);function h(y,g,b){const x=g||t;y?f(y):u?u(x):i(void 0,x,b)}}}runSync(t,n){let i=!1,l;return this.run(t,n,o),aS("runSync","run",i),l;function o(u,f){eS(u),l=f,i=!0}}stringify(t,n){this.freeze();const i=ld(n),l=this.compiler||this.Compiler;return Wm("stringify",l),rS(t),l(t,i)}use(t,...n){const i=this.attachers,l=this.namespace;if(ep("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...g]=h;m(y,g)}else u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(l.settings=Gm(!0,l.settings,h.settings))}function f(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const g=h[y];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,y){let g=-1,b=-1;for(;++g<i.length;)if(i[g][0]===h){b=g;break}if(b===-1)i.push([h,...y]);else if(y.length>0){let[x,...k]=y;const j=i[b][1];Xp(j)&&Xp(x)&&(x=Gm(!0,j,x)),i[b]=[h,x,...k]}}}}const J8=new ny().freeze();function Jm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ep(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function rS(e){if(!Xp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function aS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ld(e){return W8(e)?e:new jE(e)}function W8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function eB(e){return typeof e=="string"||tB(e)}function tB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",iS=[],lS={allowDangerousHtml:!0},rB=/^(https?|ircs?|mailto|xmpp)$/i,aB=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function iB(e){const t=lB(e),n=sB(e);return oB(t.runSync(t.parse(n),n),e)}function lB(e){const t=e.rehypePlugins||iS,n=e.remarkPlugins||iS,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...lS}:lS;return J8().use(P9).use(n).use(D8,i).use(t)}function sB(e){const t=e.children||"",n=new jE;return typeof t=="string"&&(n.value=t),n}function oB(e,t){const n=t.allowedElements,i=t.allowElement,l=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||uB;for(const y of aB)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+nB+y.id,void 0);return ty(e,h),kU(e,{Fragment:d.Fragment,components:l,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function h(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return u?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let x;for(x in Hm)if(Object.hasOwn(Hm,x)&&Object.hasOwn(y.properties,x)){const k=y.properties[x],j=Hm[x];(j===null||j.includes(y.tagName))&&(y.properties[x]=m(String(k||""),x,y))}}if(y.type==="element"){let x=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!x&&i&&typeof g=="number"&&(x=!i(y,g,b)),x&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function uB(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||i!==-1&&t>i||rB.test(e.slice(0,t))?e:""}function cB(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function EE(e,t,n){const l=nf((n||{}).ignore||[]),o=dB(t);let u=-1;for(;++u<o.length;)kE(e,"text",f);function f(h,y){let g=-1,b;for(;++g<y.length;){const x=y[g],k=b?b.children:void 0;if(l(x,k?k.indexOf(x):void 0,b))return;b=x}if(b)return m(h,y)}function m(h,y){const g=y[y.length-1],b=o[u][0],x=o[u][1];let k=0;const E=g.children.indexOf(h);let N=!1,T=[];b.lastIndex=0;let O=b.exec(h.value);for(;O;){const I=O.index,B={index:O.index,input:O.input,stack:[...y,h]};let z=x(...O,B);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?b.lastIndex=I+1:(k!==I&&T.push({type:"text",value:h.value.slice(k,I)}),Array.isArray(z)?T.push(...z):z&&T.push(z),k=I+O[0].length,N=!0),!b.global)break;O=b.exec(h.value)}return N?(k<h.value.length&&T.push({type:"text",value:h.value.slice(k)}),g.children.splice(E,1,...T)):T=[h],E+T.length}}function dB(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const l=n[i];t.push([fB(l[0]),hB(l[1])])}return t}function fB(e){return typeof e=="string"?new RegExp(cB(e),"g"):e}function hB(e){return typeof e=="function"?e:function(){return e}}function mB(e){EE(e,[/\r?\n|\r/g,pB])}function pB(){return{type:"break"}}function gB(){return function(e){mB(e)}}function sS(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,l=n.indexOf(t);for(;l!==-1;)i++,l=n.indexOf(t,l+t.length);return i}const tp="phrasing",np=["autolink","link","image","label"];function yB(){return{transforms:[jB],enter:{literalAutolink:bB,literalAutolinkEmail:rp,literalAutolinkHttp:rp,literalAutolinkWww:rp},exit:{literalAutolink:kB,literalAutolinkEmail:wB,literalAutolinkHttp:xB,literalAutolinkWww:SB}}}function vB(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:tp,notInConstruct:np},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:tp,notInConstruct:np},{character:":",before:"[ps]",after:"\\/",inConstruct:tp,notInConstruct:np}]}}function bB(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rp(e){this.config.enter.autolinkProtocol.call(this,e)}function xB(e){this.config.exit.autolinkProtocol.call(this,e)}function SB(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function wB(e){this.config.exit.autolinkEmail.call(this,e)}function kB(e){this.exit(e)}function jB(e){EE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,EB],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),CB]],{ignore:["link","linkReference"]})}function EB(e,t,n,i,l){let o="";if(!CE(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!_B(n)))return!1;const u=NB(n+i);if(!u[0])return!1;const f={type:"link",title:null,url:o+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function CB(e,t,n,i){return!CE(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function _B(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function NB(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const l=sS(e,"(");let o=sS(e,")");for(;i!==-1&&l>o;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),o++;return[e,n]}function CE(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||pl(n)||Wd(n))&&(!t||n!==47)}_E.peek=UB;function AB(){this.buffer()}function TB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function RB(){this.buffer()}function zB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function OB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function DB(e){this.exit(e)}function MB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LB(e){this.exit(e)}function UB(){return"["}function _E(e,t,n,i){const l=n.createTracker(i);let o=l.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),u(),o+=l.move("]"),o}function IB(){return{enter:{gfmFootnoteCallString:AB,gfmFootnoteCall:TB,gfmFootnoteDefinitionLabelString:RB,gfmFootnoteDefinition:zB},exit:{gfmFootnoteCallString:OB,gfmFootnoteCall:DB,gfmFootnoteDefinitionLabelString:MB,gfmFootnoteDefinition:LB}}}function BB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_E},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,l,o,u){const f=o.createTracker(u);let m=f.move("[^");const h=o.enter("footnoteDefinition"),y=o.enter("label");return m+=f.move(o.safe(o.associationId(i),{before:m,after:"]"})),y(),m+=f.move("]:"),i.children&&i.children.length>0&&(f.shift(4),m+=f.move((t?`
|
|
346
|
+
`:" ")+o.indentLines(o.containerFlow(i,f.current()),t?NE:PB))),h(),m}}function PB(e,t,n){return t===0?e:NE(e,t,n)}function NE(e,t,n){return(n?"":" ")+e}const $B=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];AE.peek=VB;function FB(){return{canContainEols:["delete"],enter:{strikethrough:HB},exit:{strikethrough:ZB}}}function qB(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:$B}],handlers:{delete:AE}}}function HB(e){this.enter({type:"delete",children:[]},e)}function ZB(e){this.exit(e)}function AE(e,t,n,i){const l=n.createTracker(i),o=n.enter("strikethrough");let u=l.move("~~");return u+=n.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),o(),u}function VB(){return"~"}function QB(e){return e.length}function GB(e,t){const n=t||{},i=(n.align||[]).concat(),l=n.stringLength||QB,o=[],u=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],E=[];let N=-1;for(e[y].length>h&&(h=e[y].length);++N<e[y].length;){const T=KB(e[y][N]);if(n.alignDelimiters!==!1){const O=l(T);E[N]=O,(m[N]===void 0||O>m[N])&&(m[N]=O)}j.push(T)}u[y]=j,f[y]=E}let g=-1;if(typeof i=="object"&&"length"in i)for(;++g<h;)o[g]=oS(i[g]);else{const j=oS(i);for(;++g<h;)o[g]=j}g=-1;const b=[],x=[];for(;++g<h;){const j=o[g];let E="",N="";j===99?(E=":",N=":"):j===108?E=":":j===114&&(N=":");let T=n.alignDelimiters===!1?1:Math.max(1,m[g]-E.length-N.length);const O=E+"-".repeat(T)+N;n.alignDelimiters!==!1&&(T=E.length+T+N.length,T>m[g]&&(m[g]=T),x[g]=T),b[g]=O}u.splice(1,0,b),f.splice(1,0,x),y=-1;const k=[];for(;++y<u.length;){const j=u[y],E=f[y];g=-1;const N=[];for(;++g<h;){const T=j[g]||"";let O="",I="";if(n.alignDelimiters!==!1){const B=m[g]-(E[g]||0),z=o[g];z===114?O=" ".repeat(B):z===99?B%2?(O=" ".repeat(B/2+.5),I=" ".repeat(B/2-.5)):(O=" ".repeat(B/2),I=O):I=" ".repeat(B)}n.delimiterStart!==!1&&!g&&N.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||g)&&N.push(" "),n.alignDelimiters!==!1&&N.push(O),N.push(T),n.alignDelimiters!==!1&&N.push(I),n.padding!==!1&&N.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&N.push("|")}k.push(n.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return k.join(`
|
|
347
|
+
`)}function KB(e){return e==null?"":String(e)}function oS(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function YB(e,t,n,i){const l=n.enter("blockquote"),o=n.createTracker(i);o.move("> "),o.shift(2);const u=n.indentLines(n.containerFlow(e,o.current()),XB);return l(),u}function XB(e,t,n){return">"+(n?"":" ")+e}function JB(e,t){return uS(e,t.inConstruct,!0)&&!uS(e,t.notInConstruct,!1)}function uS(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function cS(e,t,n,i){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
|
|
348
|
+
`&&JB(n.stack,n.unsafe[l]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
349
|
+
`}function WB(e,t){const n=String(e);let i=n.indexOf(t),l=i,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===l?++o>u&&(u=o):o=1,l=i+t.length,i=n.indexOf(t,l);return u}function eP(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function tP(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function nP(e,t,n,i){const l=tP(n),o=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(eP(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(o,rP);return g(),b}const f=n.createTracker(i),m=l.repeat(Math.max(WB(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${u}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${u}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
|
|
350
|
+
`,encode:["`"],...f.current()})),g()}return y+=f.move(`
|
|
351
|
+
`),o&&(y+=f.move(o+`
|
|
352
|
+
`)),y+=f.move(m),h(),y}function rP(e,t,n){return(n?"":" ")+e}function ry(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function aP(e,t,n,i){const l=ry(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("definition");let f=n.enter("label");const m=n.createTracker(i);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
353
|
+
`,...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),u(),h}function iP(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function hu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function zd(e,t,n){const i=Ls(e),l=Ls(t);return i===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}TE.peek=lP;function TE(e,t,n,i){const l=iP(n),o=n.enter("emphasis"),u=n.createTracker(i),f=u.move(l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=zd(i.before.charCodeAt(i.before.length-1),h,l);y.inside&&(m=hu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=zd(i.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+hu(g));const x=u.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+x}function lP(e,t,n){return n.options.emphasis||"*"}function sP(e,t){let n=!1;return ty(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,Kp}),!!((!e.depth||e.depth<3)&&Gg(e)&&(t.options.setext||n))}function oP(e,t,n,i){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(i);if(sP(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
|
|
354
|
+
`,after:`
|
|
355
|
+
`});return g(),y(),b+`
|
|
356
|
+
`+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
357
|
+
`))+1))}const u="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
358
|
+
`,...o.current()});return/^[\t ]/.test(h)&&(h=hu(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),m(),f(),h}RE.peek=uP;function RE(e){return e.value||""}function uP(){return"<"}zE.peek=cP;function zE(e,t,n,i){const l=ry(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("image");let f=n.enter("label");const m=n.createTracker(i);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),u(),h}function cP(){return"!"}OE.peek=dP;function OE(e,t,n,i){const l=e.referenceType,o=n.enter("imageReference");let u=n.enter("label");const f=n.createTracker(i);let m=f.move("![");const h=n.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function dP(){return"!"}DE.peek=fP;function DE(e,t,n){let i=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(i);)l+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<n.unsafe.length;){const u=n.unsafe[o],f=n.compilePattern(u);let m;if(u.atBreak)for(;m=f.exec(i);){let h=m.index;i.charCodeAt(h)===10&&i.charCodeAt(h-1)===13&&h--,i=i.slice(0,h)+" "+i.slice(m.index+1)}}return l+i+l}function fP(){return"`"}function ME(e,t){const n=Gg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}LE.peek=hP;function LE(e,t,n,i){const l=ry(n),o=l==='"'?"Quote":"Apostrophe",u=n.createTracker(i);let f,m;if(ME(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=u.move("<");return g+=u.move(n.containerPhrasing(e,{before:g,after:">",...u.current()})),g+=u.move(">"),f(),n.stack=y,g}f=n.enter("link"),m=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(m=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=u.move(" "+l),h+=u.move(n.safe(e.title,{before:h,after:l,...u.current()})),h+=u.move(l),m()),h+=u.move(")"),f(),h}function hP(e,t,n){return ME(e,n)?"<":"["}UE.peek=mP;function UE(e,t,n,i){const l=e.referenceType,o=n.enter("linkReference");let u=n.enter("label");const f=n.createTracker(i);let m=f.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function mP(){return"["}function ay(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function pP(e){const t=ay(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gP(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function IE(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function yP(e,t,n,i){const l=n.enter("list"),o=n.bulletCurrent;let u=e.ordered?gP(n):ay(n);const f=e.ordered?u==="."?")":".":pP(n);let m=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&y&&(!y.children||!y.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),IE(n)===u&&y){let g=-1;for(;++g<e.children.length;){const b=e.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(u=f),n.bulletCurrent=u;const h=n.containerFlow(e,i);return n.bulletLastUsed=u,n.bulletCurrent=o,l(),h}function vP(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function bP(e,t,n,i){const l=vP(n);let o=n.bulletCurrent||ay(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let u=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(i);f.move(o+" ".repeat(u-o.length)),f.shift(u);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),y);return m(),h;function y(g,b,x){return b?(x?"":" ".repeat(u))+g:(x?o:o+" ".repeat(u-o.length))+g}}function xP(e,t,n,i){const l=n.enter("paragraph"),o=n.enter("phrasing"),u=n.containerPhrasing(e,i);return o(),l(),u}const SP=nf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function wP(e,t,n,i){return(e.children.some(function(u){return SP(u)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function kP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}BE.peek=jP;function BE(e,t,n,i){const l=kP(n),o=n.enter("strong"),u=n.createTracker(i),f=u.move(l+l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=zd(i.before.charCodeAt(i.before.length-1),h,l);y.inside&&(m=hu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=zd(i.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+hu(g));const x=u.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+x}function jP(e,t,n){return n.options.strong||"*"}function EP(e,t,n,i){return n.safe(e.value,i)}function CP(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function _P(e,t,n){const i=(IE(n)+(n.options.ruleSpaces?" ":"")).repeat(CP(n));return n.options.ruleSpaces?i.slice(0,-1):i}const PE={blockquote:YB,break:cS,code:nP,definition:aP,emphasis:TE,hardBreak:cS,heading:oP,html:RE,image:zE,imageReference:OE,inlineCode:DE,link:LE,linkReference:UE,list:yP,listItem:bP,paragraph:xP,root:wP,strong:BE,text:EP,thematicBreak:_P};function NP(){return{enter:{table:AP,tableData:dS,tableHeader:dS,tableRow:RP},exit:{codeText:zP,table:TP,tableData:ap,tableHeader:ap,tableRow:ap}}}function AP(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function TP(e){this.exit(e),this.data.inTable=void 0}function RP(e){this.enter({type:"tableRow",children:[]},e)}function ap(e){this.exit(e)}function dS(e){this.enter({type:"tableCell",children:[]},e)}function zP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,OP));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function OP(e,t){return t==="|"?t:e}function DP(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
359
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:m,tableRow:f}};function u(x,k,j,E){return h(y(x,j,E),x.align)}function f(x,k,j,E){const N=g(x,j,E),T=h([N]);return T.slice(0,T.indexOf(`
|
|
360
|
+
`))}function m(x,k,j,E){const N=j.enter("tableCell"),T=j.enter("phrasing"),O=j.containerPhrasing(x,{...E,before:o,after:o});return T(),N(),O}function h(x,k){return GB(x,{align:k,alignDelimiters:i,padding:n,stringLength:l})}function y(x,k,j){const E=x.children;let N=-1;const T=[],O=k.enter("table");for(;++N<E.length;)T[N]=g(E[N],k,j);return O(),T}function g(x,k,j){const E=x.children;let N=-1;const T=[],O=k.enter("tableRow");for(;++N<E.length;)T[N]=m(E[N],x,k,j);return O(),T}function b(x,k,j){let E=PE.inlineCode(x,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function MP(){return{exit:{taskListCheckValueChecked:fS,taskListCheckValueUnchecked:fS,paragraph:UP}}}function LP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:IP}}}function fS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function UP(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const l=t.children;let o=-1,u;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){u=f;break}}u===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function IP(e,t,n,i){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(i);o&&f.move(u);let m=PE.listItem(e,t,n,{...i,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+u}}function BP(){return[yB(),IB(),FB(),NP(),MP()]}function PP(e){return{extensions:[vB(),BB(e),qB(),DP(e),LP()]}}const $P={tokenize:QP,partial:!0},$E={tokenize:GP,partial:!0},FE={tokenize:KP,partial:!0},qE={tokenize:YP,partial:!0},FP={tokenize:XP,partial:!0},HE={name:"wwwAutolink",tokenize:ZP,previous:VE},ZE={name:"protocolAutolink",tokenize:VP,previous:QE},_a={name:"emailAutolink",tokenize:HP,previous:GE},Hr={};function qP(){return{text:Hr}}let Wi=48;for(;Wi<123;)Hr[Wi]=_a,Wi++,Wi===58?Wi=65:Wi===91&&(Wi=97);Hr[43]=_a;Hr[45]=_a;Hr[46]=_a;Hr[95]=_a;Hr[72]=[_a,ZE];Hr[104]=[_a,ZE];Hr[87]=[_a,HE];Hr[119]=[_a,HE];function HP(e,t,n){const i=this;let l,o;return u;function u(g){return!Wp(g)||!GE.call(i,i.previous)||iy(i.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Wp(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(FP,y,h)(g):g===45||g===95||mn(g)?(o=!0,e.consume(g),m):y(g)}function h(g){return e.consume(g),l=!0,m}function y(g){return o&&l&&xn(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function ZP(e,t,n){const i=this;return l;function l(u){return u!==87&&u!==119||!VE.call(i,i.previous)||iy(i.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check($P,e.attempt($E,e.attempt(FE,o),n),n)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function VP(e,t,n){const i=this;let l="",o=!1;return u;function u(g){return(g===72||g===104)&&QE.call(i,i.previous)&&!iy(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(xn(g)&&l.length<5)return l+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(g),m}return n(g)}function m(g){return g===47?(e.consume(g),o?h:(o=!0,m)):n(g)}function h(g){return g===null||Ad(g)||bt(g)||pl(g)||Wd(g)?n(g):e.attempt($E,e.attempt(FE,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function QP(e,t,n){let i=0;return l;function l(u){return(u===87||u===119)&&i<3?(i++,e.consume(u),l):u===46&&i===3?(e.consume(u),o):n(u)}function o(u){return u===null?n(u):t(u)}}function GP(e,t,n){let i,l,o;return u;function u(h){return h===46||h===95?e.check(qE,m,f)(h):h===null||bt(h)||pl(h)||h!==45&&Wd(h)?m(h):(o=!0,e.consume(h),u)}function f(h){return h===95?i=!0:(l=i,i=void 0),e.consume(h),u}function m(h){return l||i||!o?n(h):t(h)}}function KP(e,t){let n=0,i=0;return l;function l(u){return u===40?(n++,e.consume(u),l):u===41&&i<n?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(qE,t,o)(u):u===null||bt(u)||pl(u)?t(u):(e.consume(u),l)}function o(u){return u===41&&i++,e.consume(u),l}}function YP(e,t,n){return i;function i(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),i):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||bt(f)||pl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||bt(f)||pl(f)?t(f):i(f)}function o(f){return xn(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),i):xn(f)?(e.consume(f),u):n(f)}}function XP(e,t,n){return i;function i(o){return e.consume(o),l}function l(o){return mn(o)?n(o):t(o)}}function VE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||bt(e)}function QE(e){return!xn(e)}function GE(e){return!(e===47||Wp(e))}function Wp(e){return e===43||e===45||e===46||e===95||mn(e)}function iy(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const JP={tokenize:l$,partial:!0};function WP(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:r$,continuation:{tokenize:a$},exit:i$}},text:{91:{name:"gfmFootnoteCall",tokenize:n$},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:e$,resolveTo:t$}}}}function e$(e,t,n){const i=this;let l=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u;for(;l--;){const m=i.events[l][1];if(m.type==="labelImage"){u=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!u||!u._balanced)return n(m);const h=Cr(i.sliceSerialize({start:u.end,end:i.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function t$(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...f),e}function n$(e,t,n){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,u;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!u||g===null||g===91||bt(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Cr(i.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return bt(g)||(u=!0),o++,e.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function r$(e,t,n){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,u=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):n(k)}function y(k){if(u>999||k===93&&!f||k===null||k===91||bt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Cr(i.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return bt(k)||(f=!0),u++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),u++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),et(e,x,"gfmFootnoteDefinitionWhitespace")):n(k)}function x(k){return t(k)}}function a$(e,t,n){return e.check(_u,t,e.attempt(JP,t,n))}function i$(e){e.exit("gfmFootnoteDefinition")}function l$(e,t,n){const i=this;return et(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const u=i.events[i.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):n(o)}}function s$(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function l(u,f){let m=-1;for(;++m<u.length;)if(u[m][0]==="enter"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._close){let h=m;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[m][1].end.offset-u[m][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[m][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[m][1].end)},g={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[m][1].start)},b=[["enter",y,f],["enter",u[h][1],f],["exit",u[h][1],f],["enter",g,f]],x=f.parser.constructs.insideSpan.null;x&&Xn(b,b.length,0,ef(x,u.slice(h+1,m),f)),Xn(b,b.length,0,[["exit",g,f],["enter",u[m][1],f],["exit",u[m][1],f],["exit",y,f]]),Xn(u,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<u.length;)u[m][1].type==="strikethroughSequenceTemporary"&&(u[m][1].type="data");return u}function o(u,f,m){const h=this.previous,y=this.events;let g=0;return b;function b(k){return h===126&&y[y.length-1][1].type!=="characterEscape"?m(k):(u.enter("strikethroughSequenceTemporary"),x(k))}function x(k){const j=Ls(h);if(k===126)return g>1?m(k):(u.consume(k),g++,x);if(g<2&&!n)return m(k);const E=u.exit("strikethroughSequenceTemporary"),N=Ls(k);return E._open=!N||N===2&&!!j,E._close=!j||j===2&&!!N,f(k)}}}class o${constructor(){this.map=[]}add(t,n,i){u$(this,t,n,i)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let l=i.pop();for(;l;){for(const o of l)t.push(o);l=i.pop()}this.map.length=0}}function u$(e,t,n,i){let l=0;if(!(n===0&&i.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...i);return}l+=1}e.map.push([t,n,i])}}function c$(e,t){let n=!1;const i=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function d$(){return{flow:{null:{name:"table",tokenize:f$,resolveAll:h$}}}}function f$(e,t,n){const i=this;let l=0,o=0,u;return f;function f(q){let ae=i.events.length-1;for(;ae>-1;){const de=i.events[ae][1].type;if(de==="lineEnding"||de==="linePrefix")ae--;else break}const re=ae>-1?i.events[ae][1].type:null,pe=re==="tableHead"||re==="tableRow"?z:m;return pe===z&&i.parser.lazy[i.now().line]?n(q):pe(q)}function m(q){return e.enter("tableHead"),e.enter("tableRow"),h(q)}function h(q){return q===124||(u=!0,o+=1),y(q)}function y(q){return q===null?n(q):Re(q)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),x):n(q):Qe(q)?et(e,y,"whitespace")(q):(o+=1,u&&(u=!1,l+=1),q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),g(q)))}function g(q){return q===null||q===124||bt(q)?(e.exit("data"),y(q)):(e.consume(q),q===92?b:g)}function b(q){return q===92||q===124?(e.consume(q),g):g(q)}function x(q){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(q):(e.enter("tableDelimiterRow"),u=!1,Qe(q)?et(e,k,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):k(q))}function k(q){return q===45||q===58?E(q):q===124?(u=!0,e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),j):B(q)}function j(q){return Qe(q)?et(e,E,"whitespace")(q):E(q)}function E(q){return q===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),N):q===45?(o+=1,N(q)):q===null||Re(q)?I(q):B(q)}function N(q){return q===45?(e.enter("tableDelimiterFiller"),T(q)):B(q)}function T(q){return q===45?(e.consume(q),T):q===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(q),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(q))}function O(q){return Qe(q)?et(e,I,"whitespace")(q):I(q)}function I(q){return q===124?k(q):q===null||Re(q)?!u||l!==o?B(q):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(q)):B(q)}function B(q){return n(q)}function z(q){return e.enter("tableRow"),F(q)}function F(q){return q===124?(e.enter("tableCellDivider"),e.consume(q),e.exit("tableCellDivider"),F):q===null||Re(q)?(e.exit("tableRow"),t(q)):Qe(q)?et(e,F,"whitespace")(q):(e.enter("data"),Z(q))}function Z(q){return q===null||q===124||bt(q)?(e.exit("data"),F(q)):(e.consume(q),q===92?ee:Z)}function ee(q){return q===92||q===124?(e.consume(q),Z):Z(q)}}function h$(e,t){let n=-1,i=!0,l=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,m=0,h,y,g;const b=new o$;for(;++n<e.length;){const x=e[n],k=x[1];x[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(hS(b,t,m,h,y),y=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(i=!0,g=void 0,o=[0,0,0,0],u=[0,n+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",y,t]])),l=k.type==="tableDelimiterRow"?2:y?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(i=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],g=sd(b,t,o,l,void 0,g),o=[0,0,0,0]),u[2]=n)):k.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(u[0]=u[1],g=sd(b,t,o,l,void 0,g)),o=u,u=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(u[0]=u[1],g=sd(b,t,o,l,n,g)):u[1]!==0&&(g=sd(b,t,u,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=n)}for(m!==0&&hS(b,t,m,h,y),b.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=c$(t.events,n))}return e}function sd(e,t,n,i,l,o){const u=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},ms(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=ms(t.events,n[1]);if(o={type:u,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=ms(t.events,n[2]),y=ms(t.events,n[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",g,t]]),i!==2){const b=t.events[n[2]],x=t.events[n[3]];if(b[1].end=Object.assign({},x[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return l!==void 0&&(o.end=Object.assign({},ms(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function hS(e,t,n,i,l){const o=[],u=ms(t.events,n);l&&(l.end=Object.assign({},u),o.push(["exit",l,t])),i.end=Object.assign({},u),o.push(["exit",i,t]),e.add(n+1,0,o)}function ms(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const m$={name:"tasklistCheck",tokenize:g$};function p$(){return{text:{91:m$}}}function g$(e,t,n){const i=this;return l;function l(m){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return bt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),u):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),u):n(m)}function u(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return Re(m)?t(m):Qe(m)?e.check({tokenize:y$},t,n)(m):n(m)}}function y$(e,t,n){return et(e,i,"whitespace");function i(l){return l===null?n(l):t(l)}}function v$(e){return aE([qP(),WP(),s$(e),d$(),p$()])}const b$={};function x$(e){const t=this,n=e||b$,i=t.data(),l=i.micromarkExtensions||(i.micromarkExtensions=[]),o=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),u=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);l.push(v$(n)),o.push(BP()),u.push(PP(n))}function KE({children:e,className:t}){return d.jsx("div",{className:Te("prose prose-sm max-w-none leading-[1.55] text-[color:inherit]","prose-headings:text-current prose-p:text-current prose-li:text-current prose-strong:text-current prose-em:text-current prose-blockquote:text-current","prose-p:my-2 prose-headings:mt-3 prose-headings:mb-1.5 prose-ul:my-2 prose-ol:my-2 prose-li:my-0.5 prose-pre:my-2 prose-blockquote:my-2 prose-hr:my-3","prose-a:text-[color:var(--accent)] prose-a:no-underline hover:prose-a:underline","prose-code:text-current prose-code:bg-[color:var(--bg-sunken)] prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-code:text-[0.9em] prose-code:before:content-none prose-code:after:content-none","prose-pre:bg-[color:var(--bg-sunken)] prose-pre:text-current prose-pre:border prose-pre:border-[color:var(--border)]","prose-hr:border-[color:var(--border)]","prose-blockquote:border-l-[color:var(--border-strong)] prose-blockquote:text-[color:var(--fg-2)]","prose-th:border-[color:var(--border)] prose-td:border-[color:var(--border)]",t),children:d.jsx(iB,{remarkPlugins:[x$,gB],children:e})})}function S$({value:e,baseline:t,onChange:n,onRevert:i,disabled:l}){const[o,u]=S.useState(!1),f=S.useRef(null),m=e!==t;return S.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),d.jsxs("section",{style:{background:"var(--bg-raised)",border:`var(--hairline) solid ${m?"color-mix(in oklch, var(--state-blocked) 40%, transparent)":"var(--border)"}`,borderRadius:6},children:[d.jsxs("header",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("h3",{className:"inline-flex items-center gap-2 text-body font-semibold",style:{color:"var(--fg)"},children:["System Prompt Append",m&&d.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:3,background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))"},children:"changed"})]}),d.jsx("div",{className:"flex gap-2",children:!o&&!l&&d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>u(!0),children:[d.jsx(Bd,{className:"h-3 w-3"})," Edit"]})})]}),d.jsx("div",{className:"px-4 py-3",children:o?d.jsxs("div",{className:"space-y-2",children:[d.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),u(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-body shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ve,{size:"xs",variant:"ghost",onClick:()=>{i(),u(!1)},disabled:!m,children:"Revert"}),d.jsx(ve,{size:"xs",onClick:()=>u(!1),children:"Done"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"`Done` collapses this editor. The change is saved only when you click Save in the bar at the bottom of the page."})]}):d.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?d.jsx(KE,{children:e}):d.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}const w$={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function k$(e){return!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage?null:d.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 border-t bg-warn-soft/95 px-6 py-3 backdrop-blur",children:d.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{className:"flex flex-col gap-1 text-body",children:[e.summary.anyDirty&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{"aria-hidden":!0,children:"🟡"}),d.jsxs("span",{className:"font-medium",children:[e.summary.dirtySections.length," section",e.summary.dirtySections.length===1?"":"s"," with unsaved changes"]}),d.jsx("span",{className:"text-muted-foreground",children:"·"}),d.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(t=>d.jsx("button",{type:"button",className:"rounded bg-card px-2 py-0.5 text-caption border hover:bg-warn-soft",onClick:()=>e.onJumpTo(t),children:w$[t]},t))})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:e.saveHint}),e.conflictMessage&&d.jsx("p",{className:"text-caption text-warn font-medium",children:e.conflictMessage}),e.errorMessage&&d.jsx("p",{className:"text-caption text-error font-medium",children:e.errorMessage})]}),d.jsxs("div",{className:"flex gap-2",children:[e.conflictMessage&&d.jsx(ve,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),d.jsx(ve,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),d.jsx(ve,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?"Saving…":"Save"})]})]})})}function Er(e){return`agent-cfg-${e}`}function j$(e){return e.isUnclaimed?"Saving: configuration stored; will apply when a computer claims this agent.":e.isOffline?"Saving: configuration stored; will apply when the computer reconnects.":e.activeSessions>0?`Saving: new chats use this immediately; ${e.activeSessions} active chat${e.activeSessions===1?"":"s"} switch on their next message.`:"Saving: new chats use this immediately."}function E$(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function C$(e,t){return JSON.stringify(e)===JSON.stringify(t)}function ip(e,t){return e.map((n,i)=>({key:`${t}-${i+1}`,value:n,baseline:n,status:"unchanged"}))}function mS(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:C$(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function lp(e,t){const n=e;return{add:i=>t(l=>{const o=l[e],u=new Set(o.map(h=>h.key)),f=E$(n,u),m=[...o,{key:f,value:i,baseline:null,status:"added"}];return{...l,[e]:mS(m)}}),update:(i,l)=>t(o=>{const f=o[e].map(m=>m.key===i?{...m,value:l}:m);return{...o,[e]:mS(f)}}),remove:i=>t(l=>{const u=l[e].map(f=>f.key!==i?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:u}}),undo:i=>t(l=>{const u=l[e].map(f=>f.key!==i||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:u}})}}function _$(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:ip(e.payload.mcpServers,"mcp"),env:ip(e.payload.env,"env"),git:ip(e.payload.gitRepos,"git")}}function N$(e){const[t,n]=S.useState(null);S.useEffect(()=>{e&&t===null&&n(_$(e))},[e,t]);const i=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},l=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",u=i.promptAppend!==l,f=i.model!==o,m=S.useMemo(()=>{const O=[],I=Z=>Z.reduce((ee,q)=>q.status==="unchanged"?ee:ee+1,0),B=I(i.mcp),z=I(i.env),F=I(i.git);return u&&O.push("prompt"),f&&O.push("model"),B>0&&O.push("mcp"),z>0&&O.push("env"),F>0&&O.push("git"),{anyDirty:O.length>0,dirtySections:O,counts:{prompt:u?1:0,model:f?1:0,mcp:B,env:z,git:F}}},[i,u,f]),h=S.useCallback(O=>{n(I=>I&&O(I))},[]),y=S.useCallback(O=>h(I=>({...I,promptAppend:O})),[h]),g=S.useCallback(()=>h(O=>({...O,promptAppend:l})),[h,l]),b=S.useCallback(O=>h(I=>({...I,model:O})),[h]),x=S.useCallback(()=>h(O=>({...O,model:o})),[h,o]),k=S.useMemo(()=>lp("mcp",h),[h]),j=S.useMemo(()=>lp("env",h),[h]),E=S.useMemo(()=>lp("git",h),[h]),N=S.useCallback(()=>{n(null)},[]),T=S.useCallback(()=>{if(!t||!e)return{};const O={};u&&(O.prompt={append:t.promptAppend}),f&&(O.model=t.model);const I=m.counts.mcp>0,B=m.counts.env>0,z=m.counts.git>0;return I&&(O.mcpServers=t.mcp.filter(F=>F.status!=="deleted").map(F=>F.value)),B&&(O.env=t.env.filter(F=>F.status!=="deleted").map(F=>{const Z=F.value;return Z.sensitive&&Z.value===$p?{key:Z.key,value:$p,sensitive:!0}:Z})),z&&(O.gitRepos=t.git.filter(F=>F.status!=="deleted").map(F=>F.value)),O},[t,e,u,f,m]);return{draft:i,summary:m,promptDirty:u,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:b,revertModel:x,addMcp:k.add,updateMcp:k.update,deleteMcp:k.remove,undoDeleteMcp:k.undo,addEnv:j.add,updateEnv:j.update,deleteEnv:j.remove,undoDeleteEnv:j.undo,addGit:E.add,updateGit:E.update,deleteGit:E.remove,undoDeleteGit:E.undo,resetAll:N,buildPayloadPatch:T}}const A$=Object.values(h6);function T$(e){const t=[{key:"identity",label:"Profile",anchor:"ad-identity"},{key:"bindings",label:"Bindings",anchor:"ad-bindings"}],n=e?[]:[{key:"prompt",label:"Prompt",anchor:Er("prompt")},{key:"model",label:"Model",anchor:Er("model")},{key:"mcp",label:"MCP tools",anchor:Er("mcp")},{key:"env",label:"Environment",anchor:Er("env")},{key:"git",label:"Git",anchor:Er("git")}],i=[{key:"danger",label:"Danger zone",anchor:"ad-danger"}],l=[{label:"Identity",items:t}];return n.length>0&&l.push({label:"Runtime",items:n}),l.push({label:"Danger zone",items:i}),l}function R$(){var Ri,zi,Oi,Ar,Di,Ta,Au,Qs,Sl,Ra,Tu,Gs;const t=X2().uuid??"",n=qr(),i=Wn(),l=qe({queryKey:["agent",t],queryFn:()=>Mk(t),enabled:!!t}),o=qe({queryKey:["agent-config",t],queryFn:()=>CL(t),enabled:!!t&&((Ri=l.data)==null?void 0:Ri.type)!=="human"}),u=qe({queryKey:["agent-client-status",t],queryFn:()=>AL(t),enabled:!!t&&((zi=l.data)==null?void 0:zi.type)!=="human"}),f=qe({queryKey:["agent-sessions-active",t],queryFn:()=>$s(t,{state:"active"}),enabled:!!t&&((Oi=l.data)==null?void 0:Oi.type)!=="human"}),m=qe({queryKey:["adapters"],queryFn:qj}),h=qe({queryKey:["adapter-mappings"],queryFn:$j}),{data:y}=qe({queryKey:["adapter-statuses"],queryFn:Fj,refetchInterval:15e3}),g=((Ar=m.data)==null?void 0:Ar.filter(oe=>oe.agentId===t))??[],b=((Di=h.data)==null?void 0:Di.filter(oe=>oe.agentId===t))??[],x=N$(o.data),[k,j]=S.useState(null),[E,N]=S.useState(null),T=yt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const oe=x.buildPayloadPatch();return _L(t,{expectedVersion:o.data.version,payload:oe})},onSuccess:oe=>{i.setQueryData(["agent-config",t],oe),j(null),N(null)},onError:oe=>{if(oe instanceof Ud&&oe.status===409){N("Someone else saved a newer version while you were editing."),j(null);return}j(oe instanceof Error?oe.message:String(oe))}}),O=S.useCallback(()=>{N(null),j(null),i.invalidateQueries({queryKey:["agent-config",t]}),x.resetAll()},[i,t,x]),I=S.useCallback(oe=>{const He=document.getElementById(oe);He&&He.scrollIntoView({behavior:"smooth",block:"start"})},[]),B=yt({mutationFn:oe=>K0(t,oe),onSuccess:()=>{i.invalidateQueries({queryKey:["agent",t]}),i.invalidateQueries({queryKey:["agents"]})}}),z=yt({mutationFn:()=>v3(t),onSuccess:()=>i.invalidateQueries({queryKey:["agent",t]})}),F=yt({mutationFn:()=>b3(t),onSuccess:()=>i.invalidateQueries({queryKey:["agent",t]})}),Z=yt({mutationFn:()=>y3(t),onSuccess:()=>n("/agents")}),ee=yt({mutationFn:()=>x3(t)}),[q,ae]=S.useState(!1),[re,pe]=S.useState(""),[de,W]=S.useState(null),P=qe({queryKey:["clients"],queryFn:$d,enabled:q}),V=yt({mutationFn:oe=>K0(t,{clientId:oe}),onSuccess:()=>{i.invalidateQueries({queryKey:["agent",t]}),i.invalidateQueries({queryKey:["agent-client-status",t]}),i.invalidateQueries({queryKey:["agents"]}),ae(!1),pe(""),W(null)},onError:oe=>W(oe instanceof Error?oe.message:String(oe))}),[ce,be]=S.useState(!1),[R,L]=S.useState(null),[A,C]=S.useState(sp),[J,Y]=S.useState(""),ue=yt({mutationFn:async()=>{const oe=pS(A);if(!oe)throw new Error("Credentials are required");return kL({platform:A.platform,agentId:t,credentials:oe,status:A.status})},onSuccess:()=>{i.invalidateQueries({queryKey:["adapters"]}),me()}}),ge=yt({mutationFn:()=>{if(!R)throw new Error("No adapter selected");const oe={status:A.status},He=pS(A);return He&&(oe.credentials=He),jL(R,oe)},onSuccess:()=>{i.invalidateQueries({queryKey:["adapters"]}),me()}}),Me=yt({mutationFn:EL,onSuccess:()=>i.invalidateQueries({queryKey:["adapters"]})}),xe=yt({mutationFn:()=>SL({platform:A.platform,externalUserId:A.externalUserId,agentId:t,boundVia:"manual",displayName:A.displayName||void 0}),onSuccess:()=>{i.invalidateQueries({queryKey:["adapter-mappings"]}),me()}}),_t=yt({mutationFn:wL,onSuccess:()=>i.invalidateQueries({queryKey:["adapter-mappings"]})}),[en,Bn]=S.useState(null),tr=yt({mutationFn:()=>NL(t,x.buildPayloadPatch()),onSuccess:oe=>{const He=oe.diff.length?oe.diff.map(Kt=>`${Kt.op} ${Kt.path}`).join(`
|
|
361
|
+
`):"(no changes)";Bn(He)},onError:oe=>Bn(`Dry run failed: ${oe instanceof Error?oe.message:String(oe)}`)});S.useEffect(()=>{if(!x.summary.anyDirty)return;const oe=He=>{He.preventDefault(),He.returnValue=""};return window.addEventListener("beforeunload",oe),()=>window.removeEventListener("beforeunload",oe)},[x.summary.anyDirty]);const tn=((Ta=l.data)==null?void 0:Ta.type)==="human",Na=S.useMemo(()=>T$(tn),[tn]);if(l.isLoading)return d.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:d.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return d.jsxs("div",{className:"-m-6 p-6 text-body",style:{color:"var(--state-error)"},children:["Failed to load agent: ",l.error instanceof Error?l.error.message:"Unknown error"]});const ft=l.data;if(!ft)return d.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const Gt=ft.type==="human",br=u.data,Zr=((Au=f.data)==null?void 0:Au.length)??0,Vr=!Gt&&!(br!=null&&br.clientId),Ai=!Gt&&br?!br.online&&!!br.clientId:!1,Ti=ft,Zs=Ti.runtimeState??null,nn=Ti.runtimeType??null,Vs=Ti.totalSessions??null,ne=ft.uuid.slice(0,8);function me(){be(!1),L(null),C(sp),Y("")}function Oe(oe){L(oe.id),C({...sp,platform:oe.platform,status:oe.status}),be(!0)}function $e(oe){if(oe.preventDefault(),Y(""),Gt){if(!A.externalUserId)return;xe.mutate();return}if(A.platform==="feishu"){if(!R&&(!A.feishuAppId||!A.feishuAppSecret)){Y("App ID and App Secret are required");return}}else if(A.platform==="kael"){if(!R&&(!A.kaelUserId||!A.kaelProjectId)){Y("User ID and Project ID are required");return}}else{const He=A.credentialsJson.trim();if(!R&&!He){Y("Credentials are required");return}if(He)try{JSON.parse(He)}catch{Y("Invalid JSON");return}}R?ge.mutate():ue.mutate()}const nt=ue.error??ge.error??xe.error,cn=ue.isPending||ge.isPending||xe.isPending,xr=j$({activeSessions:Zr,isUnclaimed:Vr,isOffline:Ai}),rn=x.draft.mcp.filter(oe=>oe.status!=="deleted"),Dt=x.draft.env.filter(oe=>oe.status!=="deleted"),dn=x.draft.git.filter(oe=>oe.status!=="deleted"),ut=oe=>new Set(rn.filter(He=>He.key!==oe).map(He=>He.value.name.toLowerCase())),Nr=oe=>new Set(Dt.filter(He=>He.key!==oe).map(He=>He.value.key)),Pn=oe=>new Set(dn.filter(He=>He.key!==oe).map(He=>{const{value:Kt}=He;return Kt.localPath?Kt.localPath:((Kt.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),Aa={sessions:Vs??"—",active:Zr,runtime:nn??(Gt?"human":"—"),model:((Sl=(Qs=o.data)==null?void 0:Qs.payload.model)==null?void 0:Sl.trim())||"—"};return d.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[d.jsx("aside",{className:"shrink-0 overflow-auto",style:{width:220,borderRight:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",padding:"var(--sp-3) 0"},children:Na.map(oe=>d.jsxs("div",{style:{marginBottom:12},children:[d.jsx(Eu,{style:{display:"block",padding:"var(--sp-1) var(--sp-4)"},children:oe.label}),oe.items.map(He=>d.jsx("button",{type:"button",onClick:()=>I(He.anchor),className:"block w-full text-left bg-transparent text-body",style:{padding:"var(--sp-1_25) var(--sp-4) var(--sp-1_25) var(--sp-3_5)",color:"var(--fg-3)",border:"none",borderLeft:"var(--hairline-bold) solid transparent",cursor:"pointer"},onMouseEnter:Kt=>{Kt.currentTarget.style.color="var(--fg)",Kt.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:Kt=>{Kt.currentTarget.style.color="var(--fg-3)",Kt.currentTarget.style.background="transparent"},children:He.label},He.key))]},oe.label))}),d.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[d.jsxs(TL,{style:{marginBottom:8},children:[d.jsx(RL,{onClick:()=>n("/agents"),children:"Agents"}),d.jsx(zL,{}),d.jsx(OL,{mono:!0,children:ft.name??ne})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"inline-flex items-center justify-center",style:{width:36,height:36,borderRadius:"var(--radius-panel)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:d.jsx(ku,{width:18,height:20,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-baseline gap-2",children:[d.jsx("span",{className:"text-title",children:ft.displayName??ft.name??ne}),d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",ft.name??ne]})]}),d.jsxs("div",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:["agt_",ne," · ",ft.type,ft.visibility?` · ${ft.visibility}`:""]})]}),d.jsx(ml,{state:Zs}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx(ve,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${ft.uuid}`),children:"Open chat →"}),!Gt&&ft.status==="active"&&d.jsxs(ve,{variant:"outline",size:"xs",onClick:()=>{ee.reset(),ee.mutate()},disabled:ee.isPending,children:[d.jsx(DT,{className:"h-3 w-3"}),ee.isPending?"Testing…":"Test"]})]})]}),d.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[d.jsx(rd,{label:"sessions",value:Aa.sessions}),d.jsx(rd,{label:"active",value:Aa.active,accent:typeof Aa.active=="number"&&Aa.active>0?"var(--accent)":void 0}),d.jsx(rd,{label:"runtime",value:Aa.runtime}),d.jsx(rd,{label:"model",value:Aa.model})]})]}),d.jsxs("div",{className:"mx-auto",style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)",maxWidth:960,display:"flex",flexDirection:"column",gap:16},children:[(ee.data||ee.error)&&d.jsx(U$,{result:ee.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>ee.reset()}),Vr&&ft.status==="active"&&d.jsxs("div",{className:"flex items-center justify-between gap-3",style:{borderRadius:"var(--radius-panel)",padding:"var(--sp-2_5) var(--sp-3_5)",background:"color-mix(in oklch, var(--state-blocked) 10%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[d.jsxs("div",{className:"text-body",children:[d.jsx("div",{className:"font-medium",children:"No computer bound"}),d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:"Bind this agent to a computer so it can run. A computer will also claim it on first WebSocket connect."})]}),d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>ae(!0),children:[d.jsx(Np,{className:"h-3 w-3"}),"Bind computer"]})]}),d.jsx("div",{id:"ad-identity",children:d.jsx(qL,{agent:ft,onSave:async oe=>{await B.mutateAsync(oe)}})}),!Gt&&d.jsxs(z$,{loaded:!!o.data,loading:o.isLoading,error:o.error?String(o.error):null,version:((Ra=o.data)==null?void 0:Ra.version)??null,dirty:x.summary.anyDirty,children:[d.jsx("div",{id:Er("prompt"),children:d.jsx(S$,{value:x.draft.promptAppend,baseline:((Tu=o.data)==null?void 0:Tu.payload.prompt.append)??"",onChange:x.setPromptAppend,onRevert:x.revertPrompt,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("model"),children:d.jsx(GL,{value:x.draft.model,baseline:((Gs=o.data)==null?void 0:Gs.payload.model)??"",onChange:x.setModel,onRevert:x.revertModel,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("mcp"),children:d.jsx(ZL,{items:x.draft.mcp,otherNames:ut,onAdd:x.addMcp,onUpdate:x.updateMcp,onDelete:x.deleteMcp,onUndoDelete:x.undoDeleteMcp,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("env"),children:d.jsx(BL,{items:x.draft.env,otherKeys:Nr,onAdd:x.addEnv,onUpdate:x.updateEnv,onDelete:x.deleteEnv,onUndoDelete:x.undoDeleteEnv,disabled:ft.status!=="active"})}),d.jsx("div",{id:Er("git"),children:d.jsx($L,{items:x.draft.git,otherPaths:Pn,onAdd:x.addGit,onUpdate:x.updateGit,onDelete:x.deleteGit,onUndoDelete:x.undoDeleteGit,disabled:ft.status!=="active"})}),en&&d.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:8,borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:en})]}),d.jsx("div",{id:"ad-bindings",children:d.jsxs(Fr,{children:[d.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"inline-flex items-center gap-2 text-body font-semibold",children:[Gt?d.jsx(Np,{className:"h-3.5 w-3.5"}):d.jsx(sT,{className:"h-3.5 w-3.5"}),"Platform bindings"]}),d.jsxs(ve,{size:"xs",variant:"outline",onClick:()=>be(!0),children:[d.jsx(gl,{className:"h-3 w-3"}),Gt?"Bind user":"Bind bot"]})]}),Gt?d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Platform"}),d.jsx(Ae,{children:"External user ID"}),d.jsx(Ae,{children:"Display name"}),d.jsx(Ae,{children:"Bound via"}),d.jsx(Ae,{children:"Created"}),d.jsx(Ae,{style:{width:32}})]})}),d.jsx(ka,{children:b.length===0?d.jsx(Qt,{children:d.jsx(Ee,{colSpan:6,style:{textAlign:"center",color:"var(--fg-3)",padding:16},children:"No platform bindings"})}):b.map(oe=>d.jsxs(Qt,{children:[d.jsx(Ee,{children:d.jsx(Wt,{children:oe.platform})}),d.jsx(Ee,{className:"mono text-label",children:oe.externalUserId}),d.jsx(Ee,{children:oe.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:"outline",children:oe.boundVia??"—"})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(oe.createdAt)}),d.jsx(Ee,{children:d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{confirm("Remove this binding?")&&_t.mutate(oe.id)},disabled:_t.isPending,children:d.jsx(lu,{className:"h-3.5 w-3.5"})})})]},oe.id))})]}):d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Platform"}),d.jsx(Ae,{children:"Status"}),d.jsx(Ae,{children:"Connection"}),d.jsx(Ae,{children:"Created"}),d.jsx(Ae,{style:{width:64}})]})}),d.jsx(ka,{children:g.length===0?d.jsx(Qt,{children:d.jsx(Ee,{colSpan:5,style:{textAlign:"center",color:"var(--fg-3)",padding:16},children:"No platform bindings"})}):g.map(oe=>{const He=y==null?void 0:y.find(wl=>wl.configId===oe.id),Kt=oe.platform==="kael"?oe.status==="active":!!(He!=null&&He.connected);return d.jsxs(Qt,{children:[d.jsx(Ee,{children:d.jsx(Wt,{children:oe.platform})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:oe.status==="active"?"accent":"outline",children:oe.status})}),d.jsx(Ee,{children:d.jsx(ml,{state:Kt?"idle":"offline"})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(oe.createdAt)}),d.jsx(Ee,{children:d.jsxs("div",{className:"flex gap-1",children:[d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>Oe(oe),title:"Edit",children:"…"}),d.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{confirm("Remove this bot binding?")&&Me.mutate(oe.id)},disabled:Me.isPending,title:"Delete",children:d.jsx(lu,{className:"h-3.5 w-3.5"})})]})})]},oe.id)})})]})]})}),d.jsx("div",{id:"ad-danger",children:d.jsx(ML,{agent:ft,suspendPending:z.isPending,reactivatePending:F.isPending,deletePending:Z.isPending,onSuspend:()=>{confirm("Suspend this agent? Runtime binds and HTTP calls will be refused.")&&z.mutate()},onReactivate:()=>F.mutate(),onDelete:()=>Z.mutate()})}),!Gt&&x.summary.anyDirty&&d.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:d.jsx("button",{type:"button",onClick:()=>tr.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:tr.isPending,children:tr.isPending?"Computing dry-run…":"Preview server-side diff"})})]}),!Gt&&d.jsx(k$,{summary:x.summary,saveHint:xr,conflictMessage:E,errorMessage:k,saving:T.isPending,onSave:()=>T.mutate(),onDiscard:()=>{(!x.summary.anyDirty||confirm("Discard all unsaved changes?"))&&(x.resetAll(),j(null),N(null))},onReloadRemote:O,onJumpTo:oe=>I(Er(oe))})]}),d.jsx(On,{open:q,onOpenChange:oe=>{ae(oe),oe||(pe(""),W(null),V.reset())},children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Bind computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick a computer you own to pin this agent to. The bind is one-shot — once set, moving the agent requires deleting and re-creating it on the target computer."}),P.isLoading?d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):P.error?d.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",P.error instanceof Error?P.error.message:"Unknown"]}):d.jsx(O$,{clients:P.data??[],selected:re,onSelect:pe}),de&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:de})]}),d.jsxs(Dn,{children:[d.jsx(ve,{variant:"outline",onClick:()=>ae(!1),children:"Cancel"}),d.jsx(ve,{disabled:!re||V.isPending,onClick:()=>{W(null),V.mutate(re)},children:V.isPending?"Binding…":"Bind"})]})]})}),d.jsx(On,{open:ce,onOpenChange:oe=>oe?be(!0):me(),children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:Gt?"Bind External User":R?"Edit Bot Binding":"Bind Bot"})}),d.jsxs("form",{onSubmit:$e,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"binding-platform",children:"Platform"}),d.jsx("select",{id:"binding-platform",value:A.platform,onChange:oe=>C({...A,platform:oe.target.value}),disabled:!!R,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:A$.map(oe=>d.jsx("option",{value:oe,children:oe},oe))})]}),Gt?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"binding-ext-id",children:"External User ID"}),d.jsx(vt,{id:"binding-ext-id",value:A.externalUserId,onChange:oe=>C({...A,externalUserId:oe.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"binding-name",children:"Display Name (optional)"}),d.jsx(vt,{id:"binding-name",value:A.displayName,onChange:oe=>C({...A,displayName:oe.target.value})})]})]}):d.jsxs(d.Fragment,{children:[A.platform==="feishu"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Je,{htmlFor:"feishu-app-id",children:["App ID",R?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"feishu-app-id",value:A.feishuAppId,onChange:oe=>C({...A,feishuAppId:oe.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Je,{htmlFor:"feishu-app-secret",children:["App Secret",R?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:A.feishuAppSecret,onChange:oe=>C({...A,feishuAppSecret:oe.target.value}),placeholder:"••••••••"})]})]}):A.platform==="kael"?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Je,{htmlFor:"kael-user-id",children:["User ID",R?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"kael-user-id",value:A.kaelUserId,onChange:oe=>C({...A,kaelUserId:oe.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Je,{htmlFor:"kael-project-id",children:["Project ID",R?" — leave empty to keep existing":""]}),d.jsx(vt,{id:"kael-project-id",value:A.kaelProjectId,onChange:oe=>C({...A,kaelProjectId:oe.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!R&&d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):d.jsxs("div",{className:"space-y-2",children:[d.jsxs(Je,{htmlFor:"binding-creds",children:["Credentials (JSON)",R?" — leave empty to keep existing":""]}),d.jsx("textarea",{id:"binding-creds",value:A.credentialsJson,onChange:oe=>C({...A,credentialsJson:oe.target.value}),rows:4,className:"flex w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-2 text-body shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),J&&d.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:J}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"binding-status",children:"Status"}),d.jsxs("select",{id:"binding-status",value:A.status,onChange:oe=>C({...A,status:oe.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[d.jsx("option",{value:"active",children:"active"}),d.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),nt instanceof Error&&d.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:nt.message}),d.jsx(Dn,{children:d.jsx(ve,{type:"submit",disabled:cn,children:cn?"Saving...":R?"Update":"Create"})})]})]})})]})}function z$(e){return d.jsxs("section",{className:"space-y-3",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsxs("div",{className:"inline-flex items-baseline gap-2",children:[d.jsx("h2",{className:"text-subtitle",children:"Behavior"}),e.version!=null&&d.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:["v",e.version]}),e.dirty&&d.jsx(Eu,{style:{color:"var(--state-blocked)"},children:"draft"})]})}),e.loading&&d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),e.error&&d.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",e.error]}),e.loaded&&d.jsx("div",{className:"space-y-3",children:e.children})]})}const sp={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:"",kaelAgentToken:""};function pS(e){if(e.platform==="feishu"){if(!e.feishuAppId&&!e.feishuAppSecret)return null;if(!e.feishuAppId||!e.feishuAppSecret)throw new Error("Both App ID and App Secret are required");return{app_id:e.feishuAppId,app_secret:e.feishuAppSecret}}if(e.platform==="kael"){if(!e.kaelUserId&&!e.kaelProjectId)return null;if(!e.kaelUserId||!e.kaelProjectId)throw new Error("User ID and Project ID are required");return{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId}}const t=e.credentialsJson.trim();return t?JSON.parse(t):null}function O$({clients:e,selected:t,onSelect:n}){const i=e.filter(l=>l.status==="connected");return i.length===0?d.jsxs("div",{className:"text-body",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:"var(--sp-2_5) var(--sp-3)",color:"var(--fg-3)"},children:["No connected computers available. Run"," ",d.jsx("code",{className:"mono text-label",children:"first-tree-hub client connect <url>"})," on the computer that should run this agent, then reopen this dialog."]}):d.jsx("ul",{className:"max-h-64 overflow-y-auto",style:{border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",margin:0,padding:0,listStyle:"none"},children:i.map(l=>{const o=l.id===t,u=l.status==="online"||l.status==="active";return d.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:d.jsxs("button",{type:"button",onClick:()=>n(l.id),className:Te("w-full text-left flex items-center gap-3"),style:{padding:"var(--sp-2) var(--sp-3)",background:o?"var(--accent-bg)":"transparent",border:"none",cursor:"pointer"},children:[d.jsx("span",{className:Te("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:u?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),d.jsxs("span",{className:"flex-1 min-w-0",children:[d.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),d.jsxs("span",{className:"block mono truncate text-caption",style:{color:"var(--fg-4)"},children:[l.id,l.os?` · ${l.os}`:"",l.sdkVersion?` · SDK ${l.sdkVersion}`:""]})]}),d.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const D$={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},M$={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},L$={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function U$({result:e,onDismiss:t}){const n=M$[e.status],i=L$[e.status],l=e.connection;return d.jsx("div",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderLeft:`var(--sp-0_75) solid ${n}`,borderRadius:"var(--radius-panel)",padding:"var(--sp-3) var(--sp-3_5)"},children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Wt,{tone:i,children:D$[e.status]}),e.responseTime!=null&&d.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&d.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&d.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[d.jsx("div",{children:l.runtimeState&&d.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?d.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):d.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&d.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&d.jsx("p",{className:"mono whitespace-pre-wrap text-label",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:8,maxHeight:160,overflow:"auto"},children:e.responseContent})]}),d.jsx(ve,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function I$(e){return/^[A-Za-z0-9_./:=-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function B$({agent:e,open:t,onClose:n,onBound:i}){var g;const[l,o]=S.useState(!1),u=qe({queryKey:["connect-token",e.uuid],queryFn:()=>Mw(),enabled:t,staleTime:6e4}),f=qe({queryKey:["agent-poll",e.uuid],queryFn:()=>Mk(e.uuid),enabled:t&&!e.clientId,refetchInterval:2e3});S.useEffect(()=>{const b=f.data;b!=null&&b.clientId&&i(b)},[f.data,i]);const m=((g=u.data)==null?void 0:g.command)??"",h=m&&e.name?`npm install -g @agent-team-foundation/first-tree-hub && first-tree-hub agent add ${I$(e.name)} --agent-id ${e.uuid} && `+m:m;function y(){h&&(navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3))}return d.jsx(On,{open:t,onOpenChange:b=>!b&&n(),children:d.jsxs(Sn,{className:"max-w-lg",children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Last step — connect your computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-body text-muted-foreground",children:"Open a terminal on your computer and run this command. It installs the First Tree Hub CLI, signs your computer in, and keeps it online in the background."}),d.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-3",children:[d.jsx("code",{className:"flex-1 text-caption font-mono break-all select-all",children:h||"Generating command…"}),d.jsx(ve,{variant:"outline",size:"icon",className:"shrink-0",onClick:y,disabled:!h,children:l?d.jsx(Id,{className:"h-4 w-4",style:{color:"var(--state-idle)"}}):d.jsx(bg,{className:"h-4 w-4"})})]}),d.jsxs("div",{className:"flex items-center gap-2 text-body text-muted-foreground",children:[d.jsx(hl,{state:"working",size:8}),d.jsx("span",{children:"Waiting for your computer to connect…"})]}),d.jsx("p",{className:"text-caption text-muted-foreground",children:"The command is good for 10 minutes. After it runs once, your computer stays online automatically — no need to keep this terminal open."})]}),d.jsx(Dn,{children:d.jsx(ve,{variant:"outline",onClick:n,children:"Skip for now"})})]})})}const P$=/^[a-z0-9_-]+$/,od=100;function $$(e){if(!e||e.length===0)return{};const t={},n=["name","displayName","clientId"];for(const i of e){const l=i.path[0];if(typeof l=="string"&&n.includes(l)){const o=l;t[o]||(t[o]=i.message)}else t._root=i.message}return t}function F$(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,100)}function q$({open:e,onOpenChange:t,onCreated:n}){const i=Wn(),[l,o]=S.useState(""),[u,f]=S.useState(!1),[m,h]=S.useState(""),[y,g]=S.useState(!1),[b,x]=S.useState("claude-code"),[k,j]=S.useState("form"),[E,N]=S.useState([]),[T,O]=S.useState(null),[I,B]=S.useState(!1),[z,F]=S.useState({});S.useEffect(()=>{e&&(o(""),f(!1),h(""),g(!1),x("claude-code"),j("form"),N([]),O(null),B(!1),F({}))},[e]);const Z=F$(l),ee=yt({mutationFn:async P=>{const V=m.trim()||l.trim()||"Untitled assistant";return g3({name:Z||void 0,type:"personal_assistant",displayName:V,clientId:P.clientId})},onSuccess:P=>{i.invalidateQueries({queryKey:["agents"]}),i.invalidateQueries({queryKey:["activity"]}),n(P,b)}}),ae={...S.useMemo(()=>{const P=ee.error;if(!P)return{};if(P instanceof Ud){const V=$$(P.issues);return Object.keys(V).length>0?V:P.status===409?{name:"That hub ID is already in use in this organization. Pick a different one."}:{_root:P.message}}return P instanceof Error?{_root:P.message}:{}},[ee.error]),...z};function re(){const P={};return Z?Z.length>od?P.name=`Hub ID must be at most ${od} characters (got ${Z.length}).`:P$.test(Z)||(P.name="Hub ID must contain only lowercase letters, digits, hyphens (-), and underscores (_)."):l.trim().length>0&&(P.name="Name must contain at least one letter or digit (e.g. a-z, 0-9)."),m.length>200&&(P.displayName=`Display name must be at most 200 characters (got ${m.length}).`),P}async function pe(P){var ce,be;P.preventDefault();const V=re();if(F(V),!(Object.keys(V).length>0)){if(b!=="claude-code"){ee.mutate({clientId:void 0});return}B(!0);try{const L=(await $d()).filter(C=>C.status==="connected");if(L.length===0){ee.mutate({clientId:void 0});return}if(L.length===1){ee.mutate({clientId:(ce=L[0])==null?void 0:ce.id});return}const A=[...L].sort((C,J)=>J.lastSeenAt.localeCompare(C.lastSeenAt));N(A),O(((be=A[0])==null?void 0:be.id)??null),j("pick-computer")}catch{ee.mutate({clientId:void 0})}finally{B(!1)}}}function de(){T&&ee.mutate({clientId:T})}const W=l.trim().length>0&&!ee.isPending&&!I;return k==="pick-computer"?d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(Sn,{className:"max-w-lg",children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Choose a computer"})}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",d.jsx("span",{className:"font-medium",children:l})," should run:"]}),d.jsx("div",{className:"space-y-2",children:E.map(P=>{const V=T===P.id;return d.jsxs("label",{className:V?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[d.jsx("input",{type:"radio",name:"target-computer",checked:V,onChange:()=>O(P.id),className:"mt-1"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-body font-medium truncate",children:P.hostname??P.id}),d.jsxs("div",{className:"text-caption text-muted-foreground",children:[P.os??"unknown OS"," · last seen ",new Date(P.lastSeenAt).toLocaleString()]})]})]},P.id)})}),ae.clientId&&d.jsx("p",{className:"text-body text-destructive",children:ae.clientId}),ae._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:ae._root})]}),d.jsxs(Dn,{children:[d.jsx(ve,{variant:"outline",onClick:()=>j("form"),disabled:ee.isPending,children:"Back"}),d.jsx(ve,{onClick:de,disabled:!T||ee.isPending,children:ee.isPending?"Creating…":"Create"})]})]})}):d.jsx(On,{open:e,onOpenChange:t,children:d.jsxs(Sn,{className:"max-w-lg",children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"New Agent"})}),d.jsxs("form",{onSubmit:pe,className:"space-y-5",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"new-agent-name",children:"Name"}),d.jsx(vt,{id:"new-agent-name",value:l,onChange:P=>{const V=P.target.value;o(V),f(!0),y||h(V),z.name&&F(ce=>({...ce,name:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:od,"aria-invalid":ae.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error"}),d.jsxs("p",{id:"new-agent-name-help",className:"text-caption text-muted-foreground",children:["Hub ID: lowercase letters, digits, hyphens (-), and underscores (_). Up to ",od," characters. Permanent after creation — you can't rename the agent later."]}),u&&Z&&d.jsxs("p",{className:"text-caption text-muted-foreground",children:["ID on hub: ",d.jsx("span",{className:"font-mono",children:Z})]}),ae.name&&d.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:ae.name})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"new-agent-display-name",children:"Display name"}),d.jsx(vt,{id:"new-agent-display-name",value:m,onChange:P=>{h(P.target.value),g(!0),z.displayName&&F(V=>({...V,displayName:void 0}))},placeholder:"How teammates see this agent",maxLength:200,"aria-invalid":ae.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),d.jsx("p",{id:"new-agent-display-name-help",className:"text-caption text-muted-foreground",children:"Shown in chats and lists. Defaults to the Name above; you can change it anytime later."}),ae.displayName&&d.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:ae.displayName})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{children:"Where it runs"}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{className:b==="claude-code"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[d.jsx("input",{type:"radio",name:"runtime",checked:b==="claude-code",onChange:()=>x("claude-code"),className:"mt-1"}),d.jsxs("div",{children:[d.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),d.jsx("div",{className:"text-caption text-muted-foreground",children:"Runs on your computer, can access your local files. (default)"})]})]}),d.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border p-3 cursor-not-allowed opacity-60",title:"Coming soon",children:[d.jsx("input",{type:"radio",name:"runtime",disabled:!0,className:"mt-1"}),d.jsxs("div",{children:[d.jsxs("div",{className:"text-body font-medium",children:["Kael ",d.jsx("span",{className:"ml-1 text-caption font-normal text-muted-foreground",children:"— coming soon"})]}),d.jsx("div",{className:"text-caption text-muted-foreground",children:"Ready to go, runs in the cloud."})]})]})]})]}),ae._root&&d.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:ae._root}),d.jsx(Dn,{children:d.jsx(ve,{type:"submit",disabled:!W,children:I?"Checking computers…":ee.isPending?"Creating…":"Create"})})]})]})})}function Jo({active:e,count:t,warn:n,className:i,children:l,style:o,...u}){return d.jsxs("button",{type:"button",className:Te("mono inline-flex items-center gap-1 text-caption leading-[1.6]",i),style:{padding:"var(--sp-0_5) var(--sp-1_75)",borderRadius:3,border:`var(--hairline) solid ${e?"var(--border-strong)":"var(--border)"}`,background:e?"var(--bg-active)":"transparent",color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",...o},...u,children:[l,t!==void 0&&d.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const H$=Object.values(g6);function gS(e){return[...e].sort((t,n)=>{const i=(t.name??t.displayName??"").toLowerCase(),l=(n.name??n.displayName??"").toLowerCase();return i.localeCompare(l)})}function Z$(e,t){const n=t.get(e.uuid);return{runtimeState:(n==null?void 0:n.runtimeState)??null,activeSessions:(n==null?void 0:n.activeSessions)??null,totalSessions:(n==null?void 0:n.totalSessions)??null}}function op(e,t,n){var l;let i=0;for(const o of e)((l=t.get(o.uuid))==null?void 0:l.runtimeState)===n&&i++;return i}function V$(){const e=qr(),{memberId:t}=ja(),[n,i]=S.useState(),[l,o]=S.useState(""),[u,f]=S.useState(!1),[m,h]=S.useState(null),[y,g]=S.useState("all"),[b,x]=S.useState(""),k=Ei(),j=Pg(),{data:E,isLoading:N,error:T}=qe({queryKey:["agents",n,l],queryFn:()=>Cg({limit:100,cursor:n,type:l||void 0})}),{data:O}=qe({queryKey:["activity"],queryFn:Su,refetchInterval:1e4}),I=S.useMemo(()=>{const V=new Map;for(const ce of(O==null?void 0:O.agents)??[])V.set(ce.agentId,ce);return V},[O==null?void 0:O.agents]),{myAgents:B,teamAgents:z}=S.useMemo(()=>{if(!(E!=null&&E.items))return{myAgents:[],teamAgents:[]};const V=[],ce=[];for(const be of E.items)t&&be.managerId===t?V.push(be):ce.push(be);return{myAgents:gS(V),teamAgents:gS(ce)}},[E,t]),F=(E==null?void 0:E.items.length)??0,Z=B.length,ee=z.length,q=S.useMemo(()=>((E==null?void 0:E.items)??[]).filter(V=>{var ce;return((ce=I.get(V.uuid))==null?void 0:ce.runtimeState)==="working"}).length,[E==null?void 0:E.items,I]),ae=S.useMemo(()=>((E==null?void 0:E.items)??[]).filter(V=>{var be;const ce=(be=I.get(V.uuid))==null?void 0:be.runtimeState;return ce==="blocked"||ce==="error"}).length,[E==null?void 0:E.items,I]);function re(V){var be;const ce=(be=I.get(V.uuid))==null?void 0:be.runtimeState;return y==="mine"?t!=null&&V.managerId===t:y==="running"?ce==="working":y==="attn"?ce==="blocked"||ce==="error":!0}function pe(V){if(!b.trim())return!0;const ce=b.toLowerCase(),be=V.delegateMention?k(V.delegateMention):"",R=j(V.managerId);return(V.name??"").toLowerCase().includes(ce)||(V.displayName??"").toLowerCase().includes(ce)||be.toLowerCase().includes(ce)||R.toLowerCase().includes(ce)}const de=B.filter(V=>re(V)&&pe(V)),W=z.filter(V=>re(V)&&pe(V));function P(V,ce){if(f(!1),V.clientId){e(`/?a=${V.uuid}`);return}if(ce==="claude-code"){h(V);return}e(`/?a=${V.uuid}`)}return d.jsxs("div",{className:"-m-6",children:[d.jsx(Jd,{title:"Agents",subtitle:F>0?d.jsxs(d.Fragment,{children:[F," total · ",Z," mine · ",ee," team"]}):null,right:d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(ve,{variant:"outline",size:"xs",children:"Import"}),d.jsxs(ve,{size:"xs",onClick:()=>f(!0),children:[d.jsx(gl,{className:"h-3 w-3"}),"New agent"]})]})}),d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[d.jsxs("div",{className:"flex items-center gap-2.5 mb-3.5",style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[d.jsxs("div",{className:"relative",style:{width:240},children:[d.jsx(Pd,{className:"absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"},size:13}),d.jsx("input",{value:b,onChange:V=>x(V.target.value),placeholder:"Filter by name, delegate, owner…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2_5) var(--sp-1_25) var(--sp-7)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),d.jsxs("div",{className:"flex gap-1",children:[d.jsx(Jo,{active:y==="all",count:F,onClick:()=>g("all"),children:"all"}),d.jsx(Jo,{active:y==="mine",count:Z,onClick:()=>g("mine"),children:"mine"}),d.jsx(Jo,{active:y==="running",count:q,onClick:()=>g("running"),children:"running"}),d.jsx(Jo,{active:y==="attn",count:ae,warn:!0,onClick:()=>g("attn"),children:"attn"})]}),d.jsx("div",{style:{flex:1}}),d.jsxs("select",{value:l,onChange:V=>{o(V.target.value),i(void 0)},className:"outline-none text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"},children:[d.jsx("option",{value:"",children:"all types"}),H$.map(V=>d.jsx("option",{value:V,children:V},V))]}),d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-label",children:[d.jsx(yT,{className:"h-3 w-3"})," Columns"]})]}),N?d.jsx("div",{className:"text-center py-8",style:{color:"var(--fg-3)"},children:"Loading…"}):T?d.jsxs("div",{className:"text-center py-8",style:{color:"var(--state-error)"},children:["Failed to load agents: ",T instanceof Error?T.message:"Unknown error"]}):d.jsxs(d.Fragment,{children:[d.jsx(yS,{title:`My agents · ${de.length}`,agents:de,runtimeMap:I,resolveAgentName:k,resolveMemberName:j,navigate:e,emptyLabel:B.length===0?"No agents yet — create one to get started":"No agents match the current filter",breakdown:d.jsx(Q$,{items:[{state:"working",count:op(B,I,"working")},{state:"blocked",count:op(B,I,"blocked")},{state:"error",count:op(B,I,"error")}]}),className:"mb-4"}),z.length>0&&d.jsx(yS,{title:`Team agents · ${W.length}`,agents:W,runtimeMap:I,resolveAgentName:k,resolveMemberName:j,navigate:e,emptyLabel:"No agents match the current filter"})]}),(E==null?void 0:E.nextCursor)&&d.jsx("div",{className:"flex justify-end mt-4",children:d.jsx(ve,{variant:"outline",size:"xs",onClick:()=>i(E.nextCursor??void 0),children:"Next page"})})]}),d.jsx(q$,{open:u,onOpenChange:f,onCreated:P}),m&&d.jsx(B$,{agent:m,open:m!==null,onClose:()=>{const V=m.uuid;h(null),e(`/?a=${V}`)},onBound:V=>{h(null),e(`/?a=${V.uuid}`)}})]})}function yS({title:e,agents:t,runtimeMap:n,resolveAgentName:i,resolveMemberName:l,navigate:o,emptyLabel:u,breakdown:f,className:m}){return d.jsxs(Fr,{className:m,children:[d.jsx(Ms,{right:f,children:e}),t.length===0?d.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:u}):d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Name"}),d.jsx(Ae,{children:"Display"}),d.jsx(Ae,{children:"Type"}),d.jsx(Ae,{children:"Delegate"}),d.jsx(Ae,{children:"Owner"}),d.jsx(Ae,{children:"Runtime"}),d.jsx(Ae,{children:"Sessions"}),d.jsx(Ae,{children:"Status"}),d.jsx(Ae,{children:"Created"})]})}),d.jsx(ka,{children:t.map(h=>d.jsx(G$,{agent:h,runtime:Z$(h,n),resolveAgentName:i,resolveMemberName:l,navigate:o},h.uuid))})]})]})}function Q$({items:e}){const t=e.filter(n=>n.count>0);return t.length===0?null:d.jsx("span",{className:"inline-flex items-center",children:t.map((n,i)=>d.jsxs("span",{className:"inline-flex items-center",children:[i>0&&d.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{className:"mono inline-flex items-center gap-1 text-caption",style:{color:`var(--state-${n.state})`},children:[d.jsx("span",{"aria-hidden":!0,children:"●"}),n.count," ",n.label??n.state]})]},n.state))})}function G$({agent:e,runtime:t,resolveAgentName:n,resolveMemberName:i,navigate:l}){const{runtimeState:o,activeSessions:u,totalSessions:f}=t,m=o==="idle"||o==="working"||o==="blocked"||o==="error"||o==="offline";return d.jsxs(Qt,{interactive:!0,onClick:()=>l(`/agents/${e.uuid}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono font-medium",children:e.name})}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:e.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})}),d.jsx(Ee,{className:"mono text-label",style:{color:e.delegateMention?"var(--accent-dim)":"var(--fg-4)"},children:e.delegateMention?n(e.delegateMention):"—"}),d.jsx(Ee,{className:"text-label",style:{color:"var(--fg-2)"},children:i(e.managerId)}),d.jsx(Ee,{children:o&&m?d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx(hl,{state:o,size:7}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:o})]}):d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"—"})}),d.jsx(Ee,{children:u===null&&f===null?d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"}):d.jsxs("span",{className:"mono tnum text-label",children:[d.jsx("span",{style:{color:"var(--fg-2)"},children:u??0}),d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",f??0]})]})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:e.status==="active"?"accent":"outline",children:e.status})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(e.createdAt)})]})}function K$(){const{data:e}=qe({queryKey:["members","user-name-map"],queryFn:Bg,staleTime:3e4});return S.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.userId,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function Y$(){const[e,t]=S.useState(null),[n,i]=S.useState(!1),l=yt({mutationFn:Mw,onSuccess:u=>{t(u),i(!1)}}),o=async()=>{e&&(await navigator.clipboard.writeText(e.command),i(!0),setTimeout(()=>i(!1),2e3))};return d.jsxs("div",{className:"grid items-center gap-2.5 mb-3.5",style:{gridTemplateColumns:"auto 1fr auto auto",padding:"var(--sp-2) var(--sp-3)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)"},children:[d.jsxs("span",{className:"inline-flex items-center gap-2 text-body",style:{color:"var(--fg-2)"},children:[d.jsx(HT,{className:"h-3.5 w-3.5"}),"Connect a computer"]}),e?d.jsxs("code",{className:"mono whitespace-nowrap overflow-hidden text-ellipsis text-label",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)"},title:e.command,children:[e.command," ",d.jsxs("span",{style:{color:"var(--fg-4)"},children:["# expires in ",Math.round(e.expiresIn/60),"m"]})]}):d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"Generate a single-use command to pair a new machine with this Hub."}),d.jsxs(ve,{variant:"outline",size:"xs",onClick:o,disabled:!e,children:[n?d.jsx(Id,{className:"h-3 w-3"}):d.jsx(bg,{className:"h-3 w-3"}),n?"Copied":"Copy"]}),d.jsx(ve,{variant:"outline",size:"xs",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Generating…":e?"Regenerate":"Generate"})]})}function X$(){const e=Wn(),t=Ei(),n=K$(),{role:i}=ja(),l=i==="admin",[o,u]=S.useState(null),[f,m]=S.useState(null),[h,y]=S.useState(null),[g,b]=S.useState(null),{data:x}=qe({queryKey:["clients"],queryFn:$d,refetchInterval:1e4}),{data:k}=qe({queryKey:["activity"],queryFn:Su,refetchInterval:1e4}),j=yt({mutationFn:qR,onSuccess:()=>{m(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})}}),E=yt({mutationFn:FR,onSuccess:()=>{y(null),b(null),e.invalidateQueries({queryKey:["clients"]}),e.invalidateQueries({queryKey:["activity"]})},onError:B=>{B instanceof Ud?b(B.message):b(B instanceof Error?B.message:String(B))}}),N=S.useMemo(()=>{const B=new Map;for(const z of(k==null?void 0:k.agents)??[]){if(!z.clientId)continue;const F=B.get(z.clientId)??[];F.push(z),B.set(z.clientId,F)}return B},[k==null?void 0:k.agents]),T=B=>N.get(B)??[],O=(x??[]).filter(B=>B.status==="connected").length,I=(x??[]).reduce((B,z)=>B+z.agentCount,0);return d.jsxs("div",{className:"-m-6",children:[d.jsx(Jd,{title:"Computers",subtitle:x&&x.length>0?d.jsxs(d.Fragment,{children:[x.length," total · ",O," connected · ",I," agents bound"]}):null}),d.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[d.jsx(Y$,{}),h&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:d.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[d.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),d.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",d.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:h.hostname??h.id.slice(0,8)}),". Retire refuses if any agent is still pinned to this computer — you must delete those agents first (reassign is not available in this milestone)."]}),T(h.id).length>0&&d.jsxs("div",{className:"mb-3 p-2 rounded",style:{background:"color-mix(in oklch, var(--state-blocked) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[d.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),d.jsx("ul",{className:"text-body space-y-0.5",children:T(h.id).map(B=>d.jsx("li",{className:"font-medium",children:t(B.agentId)},B.agentId))})]}),g&&d.jsx("div",{className:"mb-3 p-2 rounded text-body",style:{background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",color:"var(--state-error)"},children:g}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ve,{variant:"outline",size:"sm",onClick:()=>{y(null),b(null)},children:"Cancel"}),d.jsx(ve,{variant:"destructive",size:"sm",onClick:()=>E.mutate(h.id),disabled:E.isPending,children:E.isPending?"Retiring…":"Retire"})]})]})}),f&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:d.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[d.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),d.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",d.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.id.slice(0,8)})," ","and affect all bound agents:"]}),d.jsx("ul",{className:"mb-4 space-y-1",children:T(f.id).length===0?d.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):T(f.id).map(B=>d.jsxs("li",{className:"text-body flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:t(B.agentId)}),d.jsx(ml,{state:B.runtimeState})]},B.agentId))}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(ve,{variant:"outline",size:"sm",onClick:()=>m(null),children:"Cancel"}),d.jsx(ve,{variant:"destructive",size:"sm",onClick:()=>j.mutate(f.id),disabled:j.isPending,children:j.isPending?"Disconnecting…":"Disconnect"})]})]})}),!x||x.length===0?d.jsx(Fr,{children:d.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers. Use the button above to generate a connect command."})}):d.jsxs(Fr,{children:[d.jsxs(Ms,{right:d.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",x.length]}),d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{style:{width:16}}),d.jsx(Ae,{children:"Hostname"}),l&&d.jsx(Ae,{children:"Owner"}),d.jsx(Ae,{children:"OS"}),d.jsx(Ae,{children:"SDK"}),d.jsx(Ae,{children:"Agents"}),d.jsx(Ae,{children:"Connected"}),d.jsx(Ae,{children:"Status"}),d.jsx(Ae,{})]})}),d.jsx(ka,{children:x.map(B=>{const z=o===B.id,F=T(B.id);return d.jsx(J$,{client:B,boundAgents:F,isExpanded:z,agentName:t,showOwner:l,ownerName:n,onToggle:()=>u(z?null:B.id),onDisconnect:()=>m(B),onRetire:()=>{b(null),y(B)}},B.id)})})]})]})]})]})}function J$({client:e,boundAgents:t,isExpanded:n,agentName:i,showOwner:l,ownerName:o,onToggle:u,onDisconnect:f,onRetire:m}){const h=l?9:8,y=e.status==="connected"?"idle":"offline";return d.jsxs(d.Fragment,{children:[d.jsxs(Qt,{interactive:!0,selected:n,onClick:u,children:[d.jsx(Ee,{style:{width:16},children:d.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?d.jsx(cT,{className:"h-3.5 w-3.5"}):d.jsx(fT,{className:"h-3.5 w-3.5"})})}),d.jsx(Ee,{className:"font-medium",children:e.hostname??"—"}),l&&d.jsx(Ee,{style:{color:"var(--fg-2)"},children:o(e.userId)}),d.jsx(Ee,{style:{color:"var(--fg-3)"},children:e.os??"—"}),d.jsx(Ee,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),d.jsx(Ee,{children:d.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?xa(e.connectedAt):"—"}),d.jsx(Ee,{children:d.jsx(ml,{state:y})}),d.jsx(Ee,{style:{width:1,whiteSpace:"nowrap"},children:d.jsxs("div",{className:"flex gap-1 justify-end",children:[d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-label",onClick:g=>{g.stopPropagation(),f()},children:[d.jsx(XT,{className:"h-3 w-3"})," Disconnect"]}),d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:g=>{g.stopPropagation(),m()},children:[d.jsx(lu,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&d.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[d.jsx(Ee,{}),d.jsxs(Ee,{colSpan:h-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[d.jsxs(Eu,{style:{display:"block",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?d.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):d.jsx("div",{className:"flex flex-col gap-1",children:t.map(g=>d.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[d.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:i(g.agentId)}),d.jsx(ml,{state:g.runtimeState}),g.activeSessions!==null&&d.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[g.activeSessions," / ",g.totalSessions??0," sessions"]})]},g.agentId))})]})]})]})}const YE=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));YE.displayName="Card";const XE=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...t}));XE.displayName="CardHeader";const JE=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("text-subtitle leading-none",e),...t}));JE.displayName="CardTitle";const WE=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("text-body text-muted-foreground",e),...t}));WE.displayName="CardDescription";const eC=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...t}));eC.displayName="CardContent";const W$=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:Te("flex items-center p-6 pt-0",e),...t}));W$.displayName="CardFooter";function eF(){const{isAuthenticated:e,login:t}=ja(),[n,i]=S.useState(""),[l,o]=S.useState(""),[u,f]=S.useState(null),[m,h]=S.useState(!1);if(e)return d.jsx(hg,{to:"/",replace:!0});const y=async g=>{g.preventDefault(),f(null),h(!0);try{await t(n,l)}catch(b){f(b instanceof Error?b.message:"Login failed")}finally{h(!1)}};return d.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:d.jsxs(YE,{className:"w-full max-w-sm",children:[d.jsxs(XE,{className:"text-center",children:[d.jsx(JE,{className:"text-title",children:"First Tree"}),d.jsx(WE,{children:"Sign in to your workspace"})]}),d.jsx(eC,{children:d.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u&&d.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-body text-destructive",children:u}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"username",children:"Username"}),d.jsx(vt,{id:"username",value:n,onChange:g=>i(g.target.value),required:!0,autoFocus:!0})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Je,{htmlFor:"password",children:"Password"}),d.jsx(vt,{id:"password",type:"password",value:l,onChange:g=>o(g.target.value),required:!0})]}),d.jsx(ve,{type:"submit",className:"w-full",disabled:m,children:m?"Signing in...":"Sign in"})]})})]})})}function tF(){const e=qr(),t=Ei(),{data:n,isLoading:i}=qe({queryKey:["adapters"],queryFn:qj}),{data:l,isLoading:o}=qe({queryKey:["adapter-mappings"],queryFn:$j}),{data:u}=qe({queryKey:["adapter-statuses"],queryFn:Fj,refetchInterval:15e3}),f=i||o,m=S.useMemo(()=>{const g=new Map;for(const b of u??[])g.set(b.configId,b);return g},[u]),{onlineBots:h,offlineBots:y}=S.useMemo(()=>{var x;let g=0,b=0;for(const k of n??[])(x=m.get(k.id))!=null&&x.connected?g++:b++;return{onlineBots:g,offlineBots:b}},[n,m]);return d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-3)"},children:"Overview of platform bindings for agents you can manage. Configure each binding from the Agent detail page."}),d.jsxs(Fr,{className:"mb-3.5",children:[d.jsxs(Ms,{right:d.jsxs("span",{className:"inline-flex items-center",children:[d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[d.jsx("span",{"aria-hidden":!0,children:"●"}),h," online"]}),d.jsx("span",{style:{color:"var(--fg-4)",margin:"0 var(--sp-1_5)"},"aria-hidden":!0,children:"·"}),d.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[d.jsx("span",{"aria-hidden":!0,children:"○"}),y," offline"]})]}),children:["Bot bindings · ",(n==null?void 0:n.length)??0]}),f?d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n!=null&&n.length?d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Agent"}),d.jsx(Ae,{children:"Platform"}),d.jsx(Ae,{children:"Status"}),d.jsx(Ae,{children:"Connection"}),d.jsx(Ae,{children:"Created"}),d.jsx(Ae,{})]})}),d.jsx(ka,{children:n.map(g=>{var x;const b=((x=m.get(g.id))==null?void 0:x.connected)??!1;return d.jsxs(Qt,{interactive:!0,onClick:()=>e(`/agents/${g.agentId}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono font-medium",children:t(g.agentId)})}),d.jsx(Ee,{children:d.jsx(Wt,{children:g.platform})}),d.jsx(Ee,{children:d.jsx(Wt,{tone:g.status==="active"?"accent":"outline",children:g.status})}),d.jsx(Ee,{children:d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[d.jsx(hl,{state:b?"idle":"offline",size:7}),d.jsx("span",{style:{color:"var(--fg-3)"},children:b?"Online":"Offline"})]})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(g.createdAt)}),d.jsx(Ee,{style:{textAlign:"right",whiteSpace:"nowrap"},children:d.jsxs(ve,{variant:"ghost",size:"xs",className:"text-label",onClick:k=>{k.stopPropagation(),e(`/agents/${g.agentId}`)},children:[d.jsx(Np,{className:"h-3 w-3"}),"Manage"]})})]},g.id)})})]}):d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"No bot bindings"})]}),d.jsxs(Fr,{children:[d.jsxs(Ms,{children:["User bindings · ",(l==null?void 0:l.length)??0]}),f?d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l!=null&&l.length?d.jsxs(Sa,{children:[d.jsx(wa,{children:d.jsxs(Qt,{children:[d.jsx(Ae,{children:"Agent"}),d.jsx(Ae,{children:"Platform"}),d.jsx(Ae,{children:"External user ID"}),d.jsx(Ae,{children:"Display name"}),d.jsx(Ae,{children:"Bound via"}),d.jsx(Ae,{children:"Created"})]})}),d.jsx(ka,{children:l.map(g=>d.jsxs(Qt,{interactive:!0,onClick:()=>e(`/agents/${g.agentId}`),children:[d.jsx(Ee,{children:d.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:t(g.agentId)})}),d.jsx(Ee,{children:d.jsx(Wt,{children:g.platform})}),d.jsx(Ee,{children:d.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:g.externalUserId})}),d.jsx(Ee,{style:{color:"var(--fg-2)"},children:g.displayName??"—"}),d.jsx(Ee,{children:d.jsx(Wt,{tone:"outline",children:g.boundVia??"—"})}),d.jsx(Ee,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:xa(g.createdAt)})]},g.id))})]}):d.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:"No user bindings"})]})]})}function nF(){return d.jsxs("div",{className:"-m-6",children:[d.jsx(Jd,{title:"Settings",subtitle:"Per-member controls"}),d.jsx(Dj,{children:d.jsx(Mj,{active:!0,children:"Bindings"})}),d.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:d.jsx(tF,{})})]})}function rF(e){return De.get(`/admin/chats/${encodeURIComponent(e)}`)}function aF(e,t){return De.patch(`/admin/chats/${encodeURIComponent(e)}`,{topic:t})}function vS(e,t){return De.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function iF(e,t){return De.post(`/admin/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function lF(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const l=i.result;if(typeof l!="string"){n(new Error("Unexpected FileReader result"));return}const o=l.indexOf(",");t(o>=0?l.slice(o+1):l)},i.onerror=()=>n(i.error??new Error("FileReader error")),i.readAsDataURL(e)})}function sF(e){return De.post(`/admin/agents/${encodeURIComponent(e)}/chats`,{})}function oF(e,t){const n=new URLSearchParams;n.set("limit",String(t.limit)),t!=null&&t.cursor&&n.set("cursor",t.cursor);const i=n.toString();return De.get(`/admin/chats/${encodeURIComponent(e)}/messages${i?`?${i}`:""}`)}function tC(e,t){return t&&(e==="idle"||e==="working"||e==="blocked"||e==="error")?e:"offline"}function uF(e){let t=-1;for(const l of e)l.kind==="turn_end"&&l.seq>t&&(t=l.seq);const n=e.filter(l=>l.kind==="turn_end"?!1:l.kind==="error"?!0:l.seq>t),i=new Map;for(const l of n){if(l.kind!=="tool_call")continue;const o=bS(l.payload);if(!o)continue;const u=i.get(o)??-1;l.seq>u&&i.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=bS(l.payload);return o?i.get(o)===l.seq:!0})}function bS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function af(e){const t=new Date(e),n=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),i=l=>{var o;return((o=n.find(u=>u.type===l))==null?void 0:o.value)??""};return`${i("month")}/${i("day")} ${i("hour")}:${i("minute")}`}function nC(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const i=Math.round(n/60);if(i<60)return`${i}m ago`;const l=Math.round(i/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function cF(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function xS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function dF({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function fF({agentId:e,chatId:t,session:n}){const i=Wn(),[,l]=gg(),[o,u]=S.useState(!1),[f,m]=S.useState(null),h=Lw(e,t),y=Rp(e),g=E=>{i.setQueryData(h,N=>N&&{...N,state:E}),i.setQueryData(y,N=>N&&N.map(T=>T.chatId===t?{...T,state:E}:T))},b=yt({mutationFn:()=>GR(e,t),onMutate:async()=>{await i.cancelQueries({queryKey:h}),await i.cancelQueries({queryKey:y});const E=i.getQueryData(h),N=i.getQueryData(y);return g("suspended"),{previousSession:E,previousList:N}},onError:(E,N,T)=>{T!=null&&T.previousSession&&i.setQueryData(h,T.previousSession),T!=null&&T.previousList&&i.setQueryData(y,T.previousList)},onSuccess:E=>{g(E.state)}}),x=yt({mutationFn:()=>KR(e,t),onMutate:async()=>{await i.cancelQueries({queryKey:h}),await i.cancelQueries({queryKey:y});const E=i.getQueryData(h),N=i.getQueryData(y);return i.setQueryData(y,T=>T&&T.filter(O=>O.chatId!==t)),{previousSession:E,previousList:N}},onError:(E,N,T)=>{T!=null&&T.previousSession&&i.setQueryData(h,T.previousSession),T!=null&&T.previousList&&i.setQueryData(y,T.previousList),m(E instanceof Error?E.message:"Terminate failed")},onSuccess:(E,N,T)=>{if(E.state!=="evicted"){T!=null&&T.previousList&&i.setQueryData(y,T.previousList),g(E.state),m(`Session is ${E.state}; terminate only applies to suspended sessions.`);return}m(null),u(!1),l({a:e})}}),k=(n==null?void 0:n.state)==="active",j=(n==null?void 0:n.state)==="suspended";return!k&&!j?null:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"inline-flex items-center",style:{gap:4,padding:4,border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",background:"var(--bg-sunken)"},children:[k&&d.jsxs("button",{type:"button",onClick:()=>b.mutate(),disabled:b.isPending,className:"inline-flex items-center transition-colors text-label",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--fg-2)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="var(--bg-hover)",onMouseLeave:E=>E.currentTarget.style.background="transparent",children:[d.jsx(RT,{className:"h-3 w-3"})," Suspend",d.jsx("span",{className:"kbd",style:{marginLeft:2},children:"⌘⇧P"})]}),j&&d.jsxs("button",{type:"button",onClick:()=>{m(null),u(!0)},disabled:x.isPending,className:"inline-flex items-center transition-colors text-label font-semibold",style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"var(--state-error)",background:"color-mix(in oklch, var(--state-error) 18%, transparent)",borderRadius:"var(--radius-input)"},onMouseEnter:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 28%, transparent)",onMouseLeave:E=>E.currentTarget.style.background="color-mix(in oklch, var(--state-error) 18%, transparent)",children:[d.jsx(PT,{className:"h-3 w-3"})," Terminate"]})]}),d.jsx(hF,{open:o,onOpenChange:E=>{x.isPending||u(E),E||m(null)},session:n,chatId:t,error:f,pending:x.isPending,onConfirm:()=>x.mutate()})]})}function hF(e){const{open:t,onOpenChange:n,session:i,chatId:l,pending:o,error:u,onConfirm:f}=e;function m(y){y.preventDefault(),o||f()}const h=l.slice(0,8);return d.jsx(On,{open:t,onOpenChange:n,children:d.jsxs(Sn,{children:[d.jsx(Jn,{children:d.jsx(Mn,{children:"Terminate session?"})}),d.jsxs("form",{onSubmit:m,className:"space-y-4",children:[d.jsx("p",{className:"text-body text-muted-foreground",children:"Ending this session is permanent. It is removed from the workspace and cannot be resumed. Chat history is preserved; a new message will start a fresh session."}),d.jsxs("div",{className:"mono text-label",style:{padding:"var(--sp-2) var(--sp-2_5)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",display:"grid",gap:4},children:[d.jsxs("span",{children:["chat: ",d.jsxs("span",{className:"font-medium",children:[h,"…"]})]}),(i==null?void 0:i.lastActivityAt)&&d.jsxs("span",{children:["last activity: ",nC(i.lastActivityAt)]}),typeof(i==null?void 0:i.messageCount)=="number"&&d.jsxs("span",{children:["messages: ",i.messageCount]})]}),u&&d.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)"},children:u}),d.jsxs(Dn,{children:[d.jsx(ve,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"}),d.jsx(ve,{type:"submit",variant:"destructive",disabled:o,children:o?"Terminating…":"Terminate"})]})]})]})})}function mF({event:e}){const t=HR(e.payload);if(!t)return null;const n=t.status==="error",i=t.status==="pending",l=n?"var(--state-error)":i?"var(--state-blocked)":"var(--fg-3)",o=n?"failed":i?"using":"used";return d.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[i?d.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:l,animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0,marginTop:5}}):d.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),d.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?xS(t.args):void 0,children:[d.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",d.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?d.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",xS(t.args),")"]}):null,t.durationMs!==void 0&&!i?d.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",cF(t.durationMs)]}):null]})]})}function pF({event:e,agentNameFn:t,agentId:n}){const i=VR(e.payload);if(!i||i.text.length===0)return null;const l=t(n);return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[d.jsx(rC,{name:l,isSelf:!1}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:af(e.createdAt)}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),d.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:i.text})]})]})}function gF({event:e}){return d.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[d.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0}}),d.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:af(e.createdAt)})]})}function yF({event:e}){const t=ZR(e.payload),n=af(e.createdAt);return d.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2_5)",borderLeft:"var(--hairline-bold) solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 var(--radius-input) var(--radius-input) 0"},children:[d.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),d.jsx("div",{className:"text-label",style:{marginTop:2,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(t==null?void 0:t.message)??"(invalid error payload)"})]})}function rC({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return d.jsx("div",{className:"mono text-eyebrow font-bold",style:{width:20,height:20,borderRadius:"var(--radius-input)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:t?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:t?"none":"var(--hairline) solid var(--border-strong)",color:t?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:t?n:d.jsx(ku,{width:9,height:10,style:{color:"var(--accent)"}})})}function vF({msg:e,myAgentId:t,agentNameFn:n}){const i=n(e.senderId),l=t===e.senderId;return d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[d.jsx(rC,{name:i,isSelf:l}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[d.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:i}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:af(e.createdAt)}),d.jsx("span",{style:{marginLeft:"auto"},children:d.jsx(dF,{msg:e,myAgentId:t})})]}),d.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&bF(e.content)?d.jsx("img",{src:`data:${e.content.mimeType};base64,${e.content.data}`,alt:e.content.filename??"image",style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):e.format==="text"?d.jsx(KE,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):d.jsx("pre",{className:"mono text-label",style:{background:"var(--bg-sunken)",padding:8,borderRadius:"var(--radius-input)",overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function bF(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.data=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")}function xF({agentId:e,chatId:t}){var L;const n=Wn(),i=Ei(),{agentId:l}=ja(),[o,u]=S.useState(""),[f,m]=S.useState([]),[h,y]=S.useState(!1),[g,b]=S.useState(null),x=S.useRef(null),k=S.useRef(null),{data:j}=qe({queryKey:["chat-messages",t],queryFn:()=>oF(t,{limit:50}),refetchInterval:5e3}),{data:E}=qe({queryKey:["session-events",e,t],queryFn:()=>QR(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:N}=qe({queryKey:Lw(e,t),queryFn:()=>$s(e).then(A=>A.find(C=>C.chatId===t)??null),refetchInterval:5e3}),{data:T}=qe({queryKey:["chat-detail",t],queryFn:()=>rF(t),enabled:!!t}),O=yt({mutationFn:A=>vS(t,A),onSuccess:()=>{u(""),n.invalidateQueries({queryKey:["chat-messages",t]})}}),I=S.useCallback(A=>{const J=A.filter(ge=>ge.type.startsWith("image/"));if(J.length===0)return;const Y=J.find(ge=>ge.size>5242880);if(Y){b(`Image too large (${(Y.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const ue=J.map(ge=>({id:crypto.randomUUID(),file:ge,previewUrl:URL.createObjectURL(ge)}));m(ge=>[...ge,...ue]),b(null)},[]),B=S.useCallback(A=>{m(C=>{const J=C.find(Y=>Y.id===A);return J&&URL.revokeObjectURL(J.previewUrl),C.filter(Y=>Y.id!==A)})},[]),z=async()=>{const A=o.trim(),C=f;if(!(!A&&C.length===0)&&!h){if(C.length>0){y(!0),b(null);try{for(const J of C){const Y=await lF(J.file);await iF(t,{data:Y,mimeType:J.file.type,filename:J.file.name,size:J.file.size}),URL.revokeObjectURL(J.previewUrl)}m([]),A&&await vS(t,A),u(""),n.invalidateQueries({queryKey:["chat-messages",t]})}catch(J){b(J instanceof Error?J.message:"Failed to send image")}finally{y(!1)}return}O.mutate(A)}},[F,Z]=S.useState(!1),[ee,q]=S.useState(""),ae=S.useRef(null);S.useEffect(()=>{var A;F&&((A=ae.current)==null||A.focus())},[F]);const re=yt({mutationFn:A=>aF(t,A),onSuccess:()=>{Z(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),pe=()=>{const A=ee.trim();re.mutate(A.length>0?A:null)},de=S.useMemo(()=>{const A=(j==null?void 0:j.items)??[],C=uF((E==null?void 0:E.items)??[]),J=[...A.map(Y=>({kind:"message",at:Y.createdAt,key:`m-${Y.id}`,data:Y})),...C.map(Y=>({kind:"event",at:Y.createdAt,key:`e-${Y.id}`,data:Y}))];return J.sort((Y,ue)=>Y.at.localeCompare(ue.at)),J},[j,E]),W=de.length;S.useEffect(()=>{var A;W>0&&((A=k.current)==null||A.scrollIntoView({behavior:"smooth"}))},[W]);const P=T!=null&&T.participants?T.participants.map(A=>{const C=i(A.agentId);return`@${C.length>20?`${C.slice(0,17)}…`:C}`}).join(" "):`@${i(e)}`,V=i(e),ce=(N==null?void 0:N.runtimeState)??"idle",be=tC((N==null?void 0:N.runtimeState)??null,e?"connected":null),R=(N==null?void 0:N.messageCount)??((L=j==null?void 0:j.items)==null?void 0:L.length)??0;return d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d.jsxs("div",{className:"grid items-center shrink-0",style:{gridTemplateColumns:"1fr auto",gap:10,padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border)"},children:[d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center",style:{gap:8},children:[d.jsx(hl,{state:be,size:8}),F?d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:ae,value:ee,onChange:A=>q(A.target.value),onKeyDown:A=>{A.key==="Enter"?(A.preventDefault(),pe()):A.key==="Escape"&&(A.preventDefault(),Z(!1))},disabled:re.isPending,maxLength:500,placeholder:"Chat name",className:"outline-none text-subtitle",style:{flex:1,minWidth:0,color:"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",padding:"var(--sp-0_5) var(--sp-1_5)"}}),d.jsx("button",{type:"button",onClick:pe,disabled:re.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:d.jsx(Id,{className:"h-3.5 w-3.5"})}),d.jsx("button",{type:"button",onClick:()=>Z(!1),disabled:re.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:d.jsx(Ap,{className:"h-3.5 w-3.5"})})]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"truncate text-subtitle",style:{color:"var(--fg)"},children:(T==null?void 0:T.topic)||(N==null?void 0:N.summary)||`Chat · ${t.slice(0,8)}`}),d.jsx("button",{type:"button",onClick:()=>{q((T==null?void 0:T.topic)??""),Z(!0)},title:"Rename chat",className:"inline-flex items-center transition-colors",style:{color:"var(--fg-4)",padding:2},onMouseEnter:A=>A.currentTarget.style.color="var(--fg-2)",onMouseLeave:A=>A.currentTarget.style.color="var(--fg-4)",children:d.jsx(Bd,{className:"h-3 w-3"})})]}),d.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)",padding:"var(--hairline) var(--sp-1_25)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)"},children:t})]}),d.jsxs("div",{className:"flex items-center text-caption",style:{color:"var(--fg-3)",marginTop:4,gap:10},children:[d.jsx("span",{className:"mono",children:P}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["started ",nC((N==null?void 0:N.startedAt)??null)]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:[R," msgs"]}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["runtime"," ",d.jsx("span",{className:"mono",style:{color:be==="error"?"var(--state-error)":"var(--fg-2)"},children:ce})]})]})]}),d.jsx(fF,{agentId:e,chatId:t,session:N??null})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[W===0&&d.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[d.jsx(vw,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),d.jsx("div",{className:"flex flex-col",style:{gap:4},children:de.map(A=>{if(A.kind==="event"){const C=A.data;switch(C.kind){case"tool_call":return d.jsx(mF,{event:C},A.key);case"assistant_text":return d.jsx(pF,{event:C,agentId:e,agentNameFn:i},A.key);case"thinking":return d.jsx(gF,{event:C},A.key);case"error":return d.jsx(yF,{event:C},A.key);default:return null}}return d.jsx(vF,{msg:A.data,myAgentId:l,agentNameFn:i},A.key)})}),d.jsx("div",{ref:k})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"},children:[d.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:A=>A.preventDefault(),onDrop:A=>{A.preventDefault(),I(Array.from(A.dataTransfer.files))},children:[f.length>0&&d.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:f.map(A=>d.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[d.jsx("img",{src:A.previewUrl,alt:A.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),d.jsx("button",{type:"button",onClick:()=>B(A.id),style:{position:"absolute",top:1,right:1,width:14,height:14,borderRadius:"50%",background:"var(--color-overlay-scrim)",border:"none",color:"var(--bg-raised)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},children:d.jsx(Ap,{className:"h-2 w-2"})})]},A.id))}),d.jsx("textarea",{value:o,onChange:A=>u(A.target.value),onPaste:A=>{const C=Array.from(A.clipboardData.files);C.length>0&&(A.preventDefault(),I(C))},placeholder:`Message @${V} · / for commands · @ to mention`,rows:2,onKeyDown:A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),z())},disabled:O.isPending||h,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2_25) var(--sp-3) var(--sp-7_5)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}}),d.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[d.jsxs("span",{className:"mono flex items-center",style:{gap:8},children:[d.jsx("button",{type:"button",onClick:()=>{var A;return(A=x.current)==null?void 0:A.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:d.jsx(AT,{className:"h-3.5 w-3.5"})}),d.jsx("input",{ref:x,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:A=>{A.target.files&&(I(Array.from(A.target.files)),A.target.value="")}}),d.jsx("span",{children:"/suspend"}),d.jsx("span",{children:"/resume"}),d.jsx("span",{children:"/branch"}),d.jsx("span",{children:"/promote"})]}),d.jsxs("span",{className:"flex items-center",style:{gap:8},children:[h&&d.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),d.jsxs("span",{children:[d.jsx("span",{className:"kbd",children:"⏎"})," send ",d.jsx("span",{className:"kbd",children:"⇧⏎"})," new line"]}),d.jsxs("button",{type:"button",onClick:z,disabled:O.isPending||h||!o.trim()&&f.length===0,className:Te("inline-flex items-center transition-colors text-label font-semibold",(O.isPending||h||!o.trim()&&f.length===0)&&"opacity-50 cursor-not-allowed"),style:{gap:6,padding:"var(--sp-1) var(--sp-2_5)",color:"oklch(0.14 0.01 150)",background:"var(--accent)",border:"var(--hairline) solid var(--accent)",borderRadius:"var(--radius-input)"},children:[d.jsx(IT,{className:"h-3 w-3"})," Send"]})]})]})]}),(O.isError||g)&&d.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:g??(O.error instanceof Error?O.error.message:"Failed to send")})]})]})}function SF(){return d.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:d.jsxs("div",{className:"text-center max-w-sm",children:[d.jsx(ku,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),d.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),d.jsx("div",{className:"text-body text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}function wF({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(xF,{agentId:e,chatId:t}):d.jsx(SF,{})}function aC(){const{data:e}=qe({queryKey:["clients"],queryFn:$d,staleTime:1e4,refetchInterval:1e4});return S.useMemo(()=>{const t=e??[],n=new Map;for(const i of t)n.set(i.id,i);return{resolve:i=>i?n.get(i)??null:null,clients:t,connectedClients:t.filter(i=>i.status==="connected")}},[e])}function eg({children:e}){return d.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)",marginBottom:8},children:e})}function iC({children:e}){return d.jsx("div",{className:"grid text-body",style:{gridTemplateColumns:"auto 1fr",columnGap:10,rowGap:4},children:e})}function Pr({label:e,children:t}){return d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{color:"var(--fg-3)"},children:e}),d.jsx("div",{className:"text-right truncate",style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:t})]})}function SS(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const i=Math.round(n/60);if(i<60)return`${i}m ago`;const l=Math.round(i/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}function wS(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${n}m`;const i=Math.floor(n/60);return i<24?`${i}h ${n%60}m`:`${Math.floor(i/24)}d ${i%24}h`}function up({label:e,value:t,accent:n}){return d.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)"},children:[d.jsx("div",{className:"mono uppercase text-caption",style:{color:"var(--fg-4)"},children:e}),d.jsx("div",{className:"mono text-subtitle",style:{color:n??"var(--fg)"},children:t})]})}function kF({notifications:e,agentId:t}){const[,n]=gg(),i=Wn(),l=yt({mutationFn:o=>Lk(o),onSuccess:()=>{i.invalidateQueries({queryKey:["notifications"]})}});return d.jsx("div",{className:"flex flex-col",style:{gap:4},children:e.map(o=>d.jsx(Uk,{notification:o,clickable:!!o.chatId,onClick:()=>{o.read||l.mutate(o.id),o.chatId&&n({a:t,c:o.chatId})}},o.id))})}function lC({agentId:e}){var h;const t=Ei(),{resolve:n}=aC(),{data:i}=qe({queryKey:["activity"],queryFn:Su,refetchInterval:1e4}),l=(h=i==null?void 0:i.agents)==null?void 0:h.find(y=>y.agentId===e),o=n(l==null?void 0:l.clientId),{data:u}=qe({queryKey:["notifications","agent",e],queryFn:()=>Up({agentId:e,limit:3}),refetchInterval:3e4}),f=t(e),m=(l==null?void 0:l.runtimeState)??"offline";return d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center",style:{gap:10},children:[d.jsx("div",{className:"flex items-center justify-center",style:{width:32,height:32,borderRadius:5,background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:d.jsx(ku,{width:14,height:16,style:{color:"var(--accent)"}})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-subtitle",style:{color:"var(--fg)"},children:f}),d.jsx("div",{className:"mono truncate text-body",style:{color:"var(--fg-4)"},children:e})]}),d.jsx(ml,{state:m})]}),d.jsxs("div",{className:"grid",style:{gridTemplateColumns:"repeat(3, 1fr)",gap:4,marginTop:10},children:[d.jsx(up,{label:"sessions",value:(l==null?void 0:l.totalSessions)??0,accent:((l==null?void 0:l.totalSessions)??0)>0?"var(--fg)":"var(--fg-4)"}),d.jsx(up,{label:"active",value:(l==null?void 0:l.activeSessions)??0,accent:((l==null?void 0:l.activeSessions)??0)>0?"var(--accent)":"var(--fg-4)"}),d.jsx(up,{label:"uptime",value:wS((o==null?void 0:o.connectedAt)??null)})]})]}),d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx(eg,{children:"Computer · runtime"}),d.jsxs(iC,{children:[d.jsx(Pr,{label:"host",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.hostname)??"—"})}),d.jsx(Pr,{label:"os",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.os)??"—"})}),d.jsx(Pr,{label:"runtime",children:d.jsx("span",{className:"mono",children:(l==null?void 0:l.runtimeType)??"—"})}),d.jsx(Pr,{label:"sdk",children:d.jsx("span",{className:"mono text-label",children:(o==null?void 0:o.sdkVersion)??"—"})}),d.jsx(Pr,{label:"connected",children:d.jsx("span",{className:"mono text-label",children:wS((o==null?void 0:o.connectedAt)??null)})})]})]}),d.jsxs("div",{style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},className:"flex flex-col",children:[d.jsx("a",{href:`/agents/${e}`,style:{color:"var(--accent)"},className:"hover:underline text-label",children:"Manage agent →"}),d.jsx("a",{href:"/clients",style:{color:"var(--accent)",marginTop:4},className:"hover:underline text-label",children:"Computers →"})]}),d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)"},children:[d.jsx(eg,{children:"Notifications"}),!(u!=null&&u.items)||u.items.length===0?d.jsx("div",{className:"text-center text-label",style:{color:"var(--fg-3)",padding:"var(--sp-3) 0"},children:"No notifications for this agent"}):d.jsx(kF,{notifications:u.items,agentId:e})]})]})}function jF({agentId:e,chatId:t}){const{data:n}=qe({queryKey:["session",e,t],queryFn:()=>$s(e).then(i=>i.find(l=>l.chatId===t)??null),refetchInterval:5e3});return d.jsxs("div",{className:"flex flex-col overflow-hidden flex-1",children:[d.jsxs("div",{style:{padding:"var(--sp-3) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx(eg,{children:"Session"}),d.jsxs(iC,{children:[d.jsx(Pr,{label:"state",children:d.jsx(ml,{state:(n==null?void 0:n.runtimeState)??(n==null?void 0:n.state)??null})}),d.jsx(Pr,{label:"chat",children:d.jsx("span",{className:"mono text-body",children:t.slice(0,12)})}),d.jsx(Pr,{label:"started",children:SS((n==null?void 0:n.startedAt)??null)}),d.jsx(Pr,{label:"last",children:SS((n==null?void 0:n.lastActivityAt)??null)}),d.jsx(Pr,{label:"messages",children:d.jsx("span",{className:"mono",children:(n==null?void 0:n.messageCount)??0})})]})]}),d.jsx(lC,{agentId:e})]})}function EF({selectedAgentId:e,selectedChatId:t}){return t&&e?d.jsx(jF,{agentId:e,chatId:t}):e?d.jsx(lC,{agentId:e}):null}const CF=32;function _F({aggregated:e,stale:t,className:n}){const i=Math.max(1,...e.map(l=>l.workingCount));return d.jsx("div",{className:Te("flex items-end gap-[var(--sp-0_5)]",t&&"opacity-40",n),style:{height:22},"aria-hidden":!0,children:Array.from({length:CF}).map((l,o)=>{const u=e[o]??{workingCount:0,errorMask:!1},f=u.workingCount===0?.08:u.workingCount/i,m=.25+f*.7,h=u.errorMask?"var(--state-error)":"var(--accent)";return d.jsx("span",{className:"flex-1",style:{height:`${Math.max(12,f*100)}%`,background:h,opacity:m,borderRadius:.5}},o)})})}const NF={error:0,blocked:1,working:2,idle:3};function AF(e,t){return t?e?NF[e]??4:4:5}function TF(e,t){return t==="all"?!0:t==="active"?e.runtimeState==="working":e.runtimeState==="blocked"||e.runtimeState==="error"}function RF({selectedAgentId:e,selectedChatId:t,onSelectAgent:n,onSelectChat:i}){const l=Ei(),{resolve:o}=aC(),u=Wn(),f=nL(),[m,h]=S.useState(""),[y,g]=S.useState("all"),{data:b}=qe({queryKey:["activity"],queryFn:Su,refetchInterval:1e4}),{data:x}=qe({queryKey:e?Rp(e):["agent-sessions",null],queryFn:()=>e?$s(e):Promise.resolve([]),enabled:!!e,refetchInterval:1e4}),k=yt({mutationFn:z=>sF(z),onSuccess:(z,F)=>{u.invalidateQueries({queryKey:Rp(F)}),i(F,z.id)}}),{humans:j,agents:E,totalAll:N}=S.useMemo(()=>{const z=(b==null?void 0:b.agents)??[],F=m.trim().toLowerCase(),Z=z.filter(re=>{var W;if(!TF(re,y))return!1;if(!F)return!0;const pe=l(re.agentId).toLowerCase(),de=re.clientId?(((W=o(re.clientId))==null?void 0:W.hostname)??"").toLowerCase():"";return pe.includes(F)||de.includes(F)||re.agentId.toLowerCase().includes(F)}),ee=re=>AF(re.runtimeState,re.clientId),q=[],ae=[];for(const re of Z)(re.type==="human"?q:ae).push(re);return q.sort((re,pe)=>ee(re)-ee(pe)),ae.sort((re,pe)=>ee(re)-ee(pe)),{humans:q,agents:ae,totalAll:z.length}},[b,m,y,l,o]),T=S.useMemo(()=>{const z=(b==null?void 0:b.agents)??[];return{working:z.filter(F=>F.runtimeState==="working").length,blocked:z.filter(F=>F.runtimeState==="blocked").length,error:z.filter(F=>F.runtimeState==="error").length}},[b]),O=[{value:"all",label:"all",count:N},{value:"active",label:"active",count:T.working},{value:"attn",label:"attn",count:T.blocked+T.error,warn:T.blocked+T.error>0}],I=z=>{var re;const F=e===z.agentId,Z=tC(z.runtimeState,z.clientId),ee=z.clientId?((re=o(z.clientId))==null?void 0:re.hostname)??z.clientId.slice(0,8):null,q=z.activeSessions??0,ae=z.totalSessions??0;return d.jsxs("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("button",{type:"button",onClick:()=>n(F?null:z.agentId),className:Te("w-full text-left transition-colors grid items-center","hover:bg-[var(--bg-hover)]"),style:{gridTemplateColumns:"var(--sp-3_5) 1fr auto",columnGap:8,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-3)",background:F?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${F?"var(--accent)":"transparent"}`},children:[d.jsx(hl,{state:Z,size:8}),d.jsxs("div",{className:"min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"mono truncate text-body font-medium",style:{color:"var(--fg)"},children:l(z.agentId)}),z.type==="human"&&d.jsx("span",{className:"mono uppercase text-eyebrow",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--accent)",background:"color-mix(in oklch, var(--accent) 15%, transparent)"},children:"human"})]}),d.jsx("div",{className:"truncate text-body",style:{color:"var(--fg-3)"},children:Z==="offline"?"disconnected":ee||"—"})]}),d.jsx("div",{className:"flex flex-col items-end gap-0.5",children:ae>0&&d.jsxs("span",{className:"mono tnum text-label",style:{color:"var(--fg-3)"},children:[q,d.jsxs("span",{style:{color:"var(--fg-4)"},children:[" / ",ae]})]})})]}),F&&d.jsxs("div",{style:{background:"var(--bg-sunken)",paddingBottom:4},children:[(!x||x.length===0)&&d.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-4)"},children:"No sessions yet"}),x==null?void 0:x.filter(pe=>pe.state!=="evicted").map(pe=>{const de=pe.state==="active"?"working":"idle";return d.jsxs("button",{type:"button",onClick:()=>i(z.agentId,pe.chatId),className:"w-full grid items-center text-left transition-colors",style:{gridTemplateColumns:"var(--sp-3_5) 1fr",columnGap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",background:t===pe.chatId?"var(--bg-hover)":"transparent",color:pe.state==="active"?"var(--fg-2)":"var(--fg-3)"},onMouseEnter:W=>{t!==pe.chatId&&(W.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:W=>{t!==pe.chatId&&(W.currentTarget.style.background="transparent")},children:[d.jsx(hl,{state:de,size:6}),d.jsx("span",{className:"truncate text-body",style:{color:pe.topic||pe.summary?"var(--fg-2)":"var(--fg-4)"},children:pe.topic||pe.summary||`Chat · ${pe.chatId.slice(0,8)}`})]},pe.chatId)}),d.jsxs("button",{type:"button",onClick:()=>k.mutate(z.agentId),disabled:k.isPending,className:"w-full flex items-center text-left transition-colors text-body",style:{gap:6,padding:"var(--sp-1_75) var(--sp-2_5) var(--sp-1_75) var(--sp-7)",color:"var(--fg-3)"},onMouseEnter:pe=>{pe.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:pe=>{pe.currentTarget.style.background="transparent"},children:[d.jsx(gl,{className:"h-3 w-3"}),"New chat"]})]})]},z.agentId)},B=j.length+E.length;return d.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:268,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-2)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsx("div",{style:{marginBottom:8},children:d.jsxs("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-3)"},children:[N," members"]})}),d.jsxs("div",{className:"relative",children:[d.jsx(Pd,{className:"h-3.5 w-3.5 absolute pointer-events-none",style:{left:8,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),d.jsx("input",{value:m,onChange:z=>h(z.target.value),placeholder:"Filter…",className:"w-full outline-none text-body",style:{padding:"var(--sp-1_25) var(--sp-2) var(--sp-1_25) var(--sp-6_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]}),d.jsx("div",{className:"flex gap-1",style:{marginTop:8},children:O.map(z=>d.jsx(Jo,{active:y===z.value,count:z.count,warn:z.warn,onClick:()=>g(z.value),children:z.label},z.value))})]}),d.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[d.jsxs("div",{className:"flex items-center justify-between",style:{marginBottom:4},children:[d.jsxs("span",{className:"mono flex items-center gap-1.5 text-eyebrow",style:{color:"var(--fg-3)"},children:[d.jsx(zF,{}),"5m"]}),d.jsx("span",{className:"mono text-body",style:{color:"var(--fg-4)"},children:f.stale?"stale":"live"})]}),d.jsx(_F,{aggregated:f.aggregated,stale:f.stale}),d.jsxs("div",{className:"flex justify-between text-body",style:{marginTop:6},children:[d.jsxs("span",{className:"mono",style:{color:"var(--state-working)"},children:[T.working," working"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-blocked)"},children:[T.blocked," blocked"]}),d.jsxs("span",{className:"mono",style:{color:"var(--state-error)"},children:[T.error," error"]})]})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto",children:[B===0&&d.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:m||y!=="all"?"No matches":"No agents"}),E.length>0&&d.jsxs("div",{children:[d.jsx(kS,{label:"Agents",count:E.length}),E.map(I)]}),j.length>0&&d.jsxs("div",{children:[d.jsx(kS,{label:"Humans",count:j.length}),j.map(I)]})]})]})}function kS({label:e,count:t}){return d.jsxs("div",{className:"mono uppercase sticky top-0 z-10 text-eyebrow",style:{padding:"var(--sp-1_25) var(--sp-3)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[e," · ",t]})}function zF(){return d.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",style:{color:"var(--accent)"},children:[d.jsx("title",{children:"pulse"}),d.jsx("path",{d:"M1 8 h3 l1.5 -4 l3 8 l2 -4 h4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function OF(){const[e,t]=gg(),n=e.get("a"),i=e.get("c");zj();const l=S.useCallback(f=>{t(f?{a:f}:{})},[t]),o=S.useCallback((f,m)=>{t({a:f,c:m})},[t]),{data:u}=qe({queryKey:["agent-sessions",n],queryFn:()=>n?$s(n):Promise.resolve([]),enabled:!!n&&!i});return S.useEffect(()=>{if(!n||i||!u||u.length===0)return;const f=[...u].filter(m=>m.state!=="evicted").sort((m,h)=>(h.lastActivityAt??"").localeCompare(m.lastActivityAt??""))[0];f&&t({a:n,c:f.chatId},{replace:!0})},[n,i,u,t]),d.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[d.jsx(RF,{selectedAgentId:n,selectedChatId:i,onSelectAgent:l,onSelectChat:o}),d.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:d.jsx(wF,{selectedAgentId:n,selectedChatId:i})}),n&&d.jsx("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:290,borderLeft:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:d.jsx(EF,{selectedAgentId:n,selectedChatId:i})})]})}const DF=new e2({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function MF(){return d.jsx(t2,{client:DF,children:d.jsx(KA,{children:d.jsx(UA,{children:d.jsxs(fA,{children:[d.jsx(Dr,{path:"/login",element:d.jsx(eF,{})}),d.jsx(Dr,{element:d.jsx(YA,{}),children:d.jsxs(Dr,{element:d.jsx(tL,{children:d.jsx(T3,{})}),children:[d.jsx(Dr,{index:!0,element:d.jsx(OF,{})}),d.jsx(Dr,{path:"agents",element:d.jsx(V$,{})}),d.jsx(Dr,{path:"agents/:uuid",element:d.jsx(R$,{})}),d.jsx(Dr,{path:"clients",element:d.jsx(X$,{})}),d.jsx(Dr,{path:"settings",element:d.jsx(nF,{})}),d.jsx(Dr,{path:"admin",element:d.jsx(xL,{})})]})})]})})})})}const sC=document.getElementById("root");if(!sC)throw new Error("Root element not found");AN.createRoot(sC).render(d.jsx(S.StrictMode,{children:d.jsx(MF,{})}));
|